.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sound-toggle {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--cream);
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 850;
}

.exit-link {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.sound-toggle:hover,
.sound-toggle:focus-visible {
  border-color: var(--mint);
  color: var(--mint);
}

.sound-toggle[aria-pressed="false"] {
  color: var(--muted);
  opacity: 0.82;
}

.sound-bars {
  height: 15px;
  display: flex;
  align-items: end;
  gap: 2px;
}

.sound-bars i {
  width: 3px;
  height: 35%;
  border-radius: 4px;
  background: currentColor;
}

.sound-toggle[aria-pressed="true"] .sound-bars i {
  animation: sound-meter 520ms ease-in-out infinite alternate;
}

.sound-toggle[aria-pressed="true"] .sound-bars i:nth-child(2) { animation-delay: -180ms; }
.sound-toggle[aria-pressed="true"] .sound-bars i:nth-child(3) { animation-delay: -340ms; }

@keyframes sound-meter {
  to { height: 100%; }
}

.pit-layout {
  min-height: 720px;
  display: grid;
  grid-template-columns: 176px minmax(0, 1fr);
  gap: clamp(12px, 2.2vw, 24px);
  background:
    linear-gradient(rgba(255, 255, 255, 0.022) 1px, transparent 1px) 0 0 / 100% 34px,
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px) 0 0 / 34px 100%,
    #0b1816;
}

.hud { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.water-stat strong { color: #7fffe0; }

.shift-board {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: rgba(2, 8, 7, 0.72);
}

.shift-board ol {
  display: grid;
  gap: 5px;
  margin: 12px 0 18px;
  padding: 0;
  list-style: none;
}

.shift-board li {
  display: grid;
  grid-template-columns: 40px 1fr;
  align-items: center;
  gap: 6px;
  padding: 8px 7px;
  border: 1px solid transparent;
  border-radius: 9px;
  color: #869b90;
  font-size: 0.68rem;
}

.shift-board li span {
  font-weight: 950;
  letter-spacing: 0.12em;
}

.shift-board li b { font-weight: 700; }
.shift-board li.done { color: var(--mint); }
.shift-board li.done::after { content: "✓"; }

.shift-board li.current {
  border-color: rgba(200, 255, 54, 0.35);
  color: var(--acid);
  background: rgba(200, 255, 54, 0.08);
}

.rack > span {
  color: var(--muted);
  font-size: 0.61rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.rack-slots {
  min-height: 52px;
  display: flex;
  align-items: end;
  gap: 3px;
  margin-top: 7px;
  padding: 7px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.025);
}

.rack-plate {
  width: 8px;
  height: 34px;
  flex: 0 0 auto;
  border: 2px solid #fff0c5;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  box-shadow: 0 0 8px rgba(255, 243, 207, 0.18);
}

.rack-plate:nth-child(3n) {
  width: 11px;
  height: 27px;
  border-radius: 3px 3px 50% 50%;
}

.wash-zone {
  min-width: 0;
  display: grid;
  grid-template-rows: auto minmax(470px, 1fr) auto auto;
  gap: 11px;
}

.rush-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.rush-row > span {
  color: var(--muted);
  font-size: 0.65rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.timer-track {
  height: 10px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
}

.timer-track span {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--danger), var(--gold), var(--acid));
  box-shadow: 0 0 16px rgba(200, 255, 54, 0.28);
  transform-origin: left;
}

.dish-yard {
  position: relative;
  min-height: 470px;
  overflow: hidden;
  isolation: isolate;
  border: 5px solid #62766f;
  border-radius: 38px 38px 64px 64px;
  background:
    radial-gradient(circle at 20% 20%, rgba(84, 243, 194, 0.09), transparent 24%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.07), transparent 35%),
    #173b39;
  box-shadow:
    inset 0 12px 34px rgba(0, 0, 0, 0.46),
    0 20px 44px rgba(0, 0, 0, 0.28);
  touch-action: pan-y;
}

.glass-rack {
  position: absolute;
  right: 16px;
  top: 16px;
  z-index: 16;
  width: 126px;
  min-height: 88px;
  display: grid;
  place-content: center;
  gap: 3px;
  padding: 10px;
  border: 3px solid rgba(208, 243, 239, .48);
  border-radius: 15px;
  color: #d7fffa;
  background: repeating-linear-gradient(90deg, rgba(189,235,229,.12) 0 8px, transparent 8px 17px), rgba(3,20,20,.88);
  box-shadow: inset 0 0 20px rgba(84,243,194,.12), 0 10px 22px rgba(0,0,0,.28);
  text-align: center;
  transition: border-color 130ms ease, background 130ms ease, transform 130ms ease, opacity 130ms ease;
}

.glass-rack > span { color: #bce7e2; font-size: 1rem; letter-spacing: .16em; }
.glass-rack strong { font-size: .7rem; letter-spacing: .12em; }
.glass-rack small { color: var(--muted); font-size: .55rem; }
.glass-rack:disabled { opacity: .42; }
.glass-rack.active { opacity: 1; border-color: #7fffe0; }
.glass-rack.drop-ready { border-color: var(--acid); background-color: rgba(87,122,27,.88); transform: scale(1.06); }

.floor-spill {
  position: absolute;
  inset: 0;
  z-index: 28;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 4px;
  overflow: hidden;
  color: #eaffff;
  background: rgba(6, 29, 34, .66);
  text-shadow: 0 2px 12px #001518;
  backdrop-filter: blur(2px);
}

.floor-spill[hidden] { display: none; }
.floor-spill strong { position: relative; z-index: 2; font: 900 clamp(2rem, 7vw, 4.5rem)/1 Impact, sans-serif; letter-spacing: .04em; }
.floor-spill small { position: relative; z-index: 2; font-weight: 900; }
.puddle { position: absolute; border-radius: 50%; background: rgba(58, 207, 230, .38); box-shadow: 0 0 0 18px rgba(58,207,230,.08), inset 0 0 30px rgba(255,255,255,.2); transform: rotate(-12deg); }
.puddle-one { left: 9%; top: 14%; width: 56%; height: 42%; }
.puddle-two { right: 6%; bottom: 9%; width: 42%; height: 34%; transform: rotate(18deg); }

.utility-strip { display: grid; gap: 10px; }
.water-station,
.floor-callout { min-width: 0; display: grid; grid-template-columns: minmax(170px, .9fr) minmax(130px, 1.1fr) auto; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 16px; background: rgba(2,8,7,.72); }
.utility-copy { min-width: 0; display: grid; gap: 2px; }
.utility-copy span,
.floor-callout span { color: var(--mint); font-size: .56rem; font-weight: 950; letter-spacing: .12em; text-transform: uppercase; }
.utility-copy strong { color: #a9fff0; font-size: .8rem; letter-spacing: .05em; }
.utility-copy small { color: var(--muted); font-size: .56rem; }
.water-gauge { height: 17px; overflow: hidden; border: 2px solid #426d69; border-radius: 999px; background: #162321; box-shadow: inset 0 3px 9px rgba(0,0,0,.5); }
.water-gauge span { width: 100%; height: 100%; display: block; border-radius: inherit; background: linear-gradient(90deg, #36e5ff, #6fffd4); box-shadow: 0 0 16px rgba(54,229,255,.3); transform-origin: left; transition: transform 220ms ease, filter 220ms ease; }
.water-station.dirty .water-gauge span { background: linear-gradient(90deg, #a27128, #baa64b); }
.water-station.critical .water-gauge span { background: linear-gradient(90deg, #8f381f, #d86b28); }
.water-station.critical .utility-copy strong { color: var(--danger); }
.utility-button { min-height: 48px; padding: 9px 14px; border: 2px solid rgba(255,255,255,.22); border-radius: 12px; color: var(--cream); background: #263735; font-weight: 950; cursor: pointer; }
.utility-button:hover,
.utility-button:focus-visible { border-color: var(--acid); color: var(--acid); }
.utility-button:disabled { opacity: .45; cursor: not-allowed; }
.floor-callout { grid-template-columns: 1fr auto; border-color: rgba(255,103,95,.55); background: linear-gradient(90deg, rgba(116,20,25,.82), rgba(40,12,15,.9)); }
.floor-callout[hidden] { display: none; }
.floor-callout > div { display: grid; gap: 3px; }
.floor-callout strong { color: #fff3cf; font-size: .8rem; }
.mop-button { min-width: 132px; border-color: #ffaaa4; background: #a81d27; }

.scrubby-cursor { display: none; }
@media (hover: hover) and (pointer: fine) {
  body.scrubby-active .scrubby-cursor {
    position: fixed;
    z-index: 200;
    width: 31px;
    height: 23px;
    display: block;
    border: 3px solid #355b19;
    border-radius: 46% 54% 42% 58%;
    pointer-events: none;
    background: repeating-linear-gradient(155deg, #b9e83f 0 3px, #82b829 3px 6px);
    box-shadow: 0 4px 8px rgba(0,0,0,.34), inset 0 3px rgba(255,255,255,.3);
    transform: translate3d(var(--cursor-x, -80px), var(--cursor-y, -80px), 0) rotate(-17deg);
  }
  body.scrubby-active .scrubby-cursor::after { position: absolute; right: -7px; top: -8px; width: 9px; height: 9px; border: 2px solid rgba(220,255,250,.78); border-radius: 50%; content: ""; box-shadow: -9px 3px 0 -2px rgba(220,255,250,.65); }
  body.scrubby-active .dish-yard,
  body.scrubby-active .grime,
  body.scrubby-active .tub-target { cursor: none; }
  body.glass-dragging .scrubby-cursor { display: none; }
}

.dish-yard::before {
  position: absolute;
  inset: 13px;
  z-index: -2;
  border-radius: 29px 29px 54px 54px;
  content: "";
  background:
    repeating-radial-gradient(ellipse at 50% 0, transparent 0 27px, rgba(84, 243, 194, 0.055) 28px 30px),
    linear-gradient(#125b60, #0a3f45);
}

.spray-grid {
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0.25;
  background:
    linear-gradient(90deg, transparent 49.5%, rgba(255,255,255,.08) 50%, transparent 50.5%),
    linear-gradient(transparent 49.5%, rgba(255,255,255,.06) 50%, transparent 50.5%);
  background-size: 33.333% 50%;
}

.active-dishes {
  position: absolute;
  inset: 20px;
}

.yard-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 12px;
  color: rgba(255, 243, 207, 0.38);
  letter-spacing: 0.18em;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.yard-empty.hidden { opacity: 0; }

.empty-plate {
  width: 104px;
  aspect-ratio: 1;
  border: 10px double rgba(255, 243, 207, 0.22);
  border-radius: 50%;
}

.dish-item {
  --dish-w: 156px;
  --dish-h: 156px;
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--dish-w);
  height: var(--dish-h);
  display: grid;
  place-items: center;
  transform: translate(-50%, -50%) rotate(var(--tilt)) scale(var(--scale, 1));
  transition: filter 180ms ease, opacity 180ms ease, transform 240ms ease;
  animation: dish-arrive 260ms cubic-bezier(.2,.8,.2,1) both;
}

.dish-item[data-kind="tray"] { --dish-w: 196px; --dish-h: 126px; }
.dish-item[data-kind="platter"] { --dish-w: 194px; --dish-h: 128px; }
.dish-item[data-kind="pan"] { --dish-w: 186px; --dish-h: 148px; }
.dish-item[data-kind="bus-tub"] { --dish-w: 204px; --dish-h: 134px; }

@keyframes dish-arrive {
  from { opacity: 0; transform: translate(-50%, -35%) rotate(calc(var(--tilt) - 14deg)) scale(.72); }
}

.dish-surface {
  position: relative;
  width: 100%;
  height: 100%;
  border: 8px solid #e8dbb8;
  border-radius: 50%;
  background:
    radial-gradient(circle at 42% 34%, rgba(255, 255, 255, 0.75), transparent 12%),
    radial-gradient(circle, #fbf4df 0 57%, #d3c39e 58% 66%, #fff7e1 67%);
  box-shadow: 0 20px 35px rgba(0,0,0,.34), inset 0 0 22px rgba(91,70,45,.22);
}

.dish-item[data-kind="bowl"] .dish-surface {
  border-width: 13px;
  background:
    radial-gradient(ellipse at 42% 35%, rgba(255,255,255,.48), transparent 10%),
    radial-gradient(circle, #cfc09e 0 36%, #8f8064 38%, #f7efd8 56%, #d9c9a5 70%);
  box-shadow: 0 18px 34px rgba(0,0,0,.38), inset 0 18px 24px rgba(78,57,31,.32);
}

.dish-item[data-kind="tray"] .dish-surface {
  border-width: 10px;
  border-radius: 26px;
  background: linear-gradient(145deg, #c7ccd0, #747f82 55%, #c9d1cf);
  box-shadow: 0 20px 34px rgba(0,0,0,.4), inset 0 0 0 5px rgba(30,42,43,.27), inset 0 12px 22px rgba(255,255,255,.18);
}

.dish-item[data-kind="platter"] .dish-surface {
  border-width: 10px;
  border-radius: 50%;
  background: radial-gradient(ellipse, #fcf0d1 0 56%, #cbb98f 58% 68%, #fff8e5 69%);
}

.dish-item[data-kind="pan"] .dish-surface {
  width: 142px;
  height: 142px;
  margin-right: 38px;
  border: 9px solid #60696a;
  background: radial-gradient(circle at 40% 35%, #4d5859, #172021 68%);
  box-shadow: 0 20px 35px rgba(0,0,0,.48), inset 0 0 0 5px #2d3738, inset 0 0 24px rgba(0,0,0,.6);
}

.dish-item[data-kind="pan"] .dish-surface::after {
  position: absolute;
  left: calc(100% - 3px);
  top: 54px;
  width: 57px;
  height: 22px;
  border: 5px solid #596365;
  border-left: 0;
  border-radius: 0 16px 16px 0;
  content: "";
  background: #222c2d;
  box-shadow: 0 10px 15px rgba(0,0,0,.25);
}

.dish-item[data-kind="bus-tub"] .dish-surface {
  overflow: hidden;
  border: 9px solid #8c9b96;
  border-top-width: 15px;
  border-radius: 20px 20px 42px 42px;
  background: linear-gradient(160deg, #516b66, #243b39 65%);
  box-shadow: 0 20px 35px rgba(0,0,0,.42), inset 0 14px 24px rgba(0,0,0,.36);
}

.dish-item[data-kind="bus-tub"] .dish-surface::before,
.dish-item[data-kind="bus-tub"] .dish-surface::after {
  position: absolute;
  top: -2px;
  width: 30px;
  height: 9px;
  border-radius: 999px;
  content: "";
  background: #151f1e;
}

.dish-item[data-kind="bus-tub"] .dish-surface::before { left: 18px; }
.dish-item[data-kind="bus-tub"] .dish-surface::after { right: 18px; }

.dish-label {
  position: absolute;
  left: 50%;
  bottom: -15px;
  z-index: 7;
  max-width: 95%;
  padding: 4px 7px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 999px;
  color: #fff3cf;
  background: rgba(3, 12, 11, .86);
  font-size: .58rem;
  font-weight: 900;
  letter-spacing: .08em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  transform: translateX(-50%);
  white-space: nowrap;
  pointer-events: none;
}

.grime-layer {
  position: absolute;
  inset: 11%;
  z-index: 5;
}

.grime {
  --grime-color: #4e2e18;
  position: absolute;
  left: var(--gx);
  top: var(--gy);
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: #fff5d7;
  background: transparent;
  cursor: crosshair;
  touch-action: manipulation;
  transform: translate(-50%, -50%) rotate(var(--gturn));
}

.grime::before {
  width: 31px;
  height: 31px;
  border: 2px solid color-mix(in srgb, var(--grime-color) 70%, black);
  border-radius: 43% 57% 62% 38% / 48% 41% 59% 52%;
  content: "";
  background: var(--grime-fill, radial-gradient(circle at 38% 34%, #875624 0 18%, #4e2e18 54%, #2b1a10 100%));
  box-shadow: 0 5px 10px rgba(39, 23, 12, 0.35);
  transition: transform 90ms ease, filter 90ms ease;
}

.grime::after {
  position: absolute;
  right: 0;
  bottom: 0;
  min-width: 18px;
  height: 18px;
  display: none;
  place-items: center;
  border: 2px solid #07100f;
  border-radius: 50%;
  content: attr(data-hits-left);
  color: #07100f;
  background: var(--acid);
  font-size: 10px;
  font-weight: 950;
}

.grime.multi-hit::after { display: grid; }
.grime:hover::before,
.grime:focus-visible::before { transform: scale(1.18); filter: brightness(1.22); }
.grime:focus-visible { outline: 3px solid var(--acid); outline-offset: 1px; }
.grime.hit-pulse::before { animation: grime-hit 120ms ease; }
.grime.scrubbed { pointer-events: none; }
.grime.scrubbed::before { opacity: 0; transform: scale(1.8); }

@keyframes grime-hit {
  50% { transform: scale(.72) rotate(18deg); }
}

.grime[data-grime="cheese"] {
  --grime-color: #d59b16;
  --grime-fill: radial-gradient(circle at 68% 28%, #fff2a2 0 8%, transparent 9%), linear-gradient(135deg, #ffd75b, #c48212 68%);
}

.grime[data-grime="sauce"] {
  --grime-color: #9d1f20;
  --grime-fill: radial-gradient(circle at 32% 28%, #ef7662, #8e191b 72%);
}

.grime[data-grime="char"] {
  --grime-color: #090909;
  --grime-fill: repeating-radial-gradient(circle, #25201b 0 4px, #070707 5px 8px);
}

.grime[data-grime="curry"] {
  --grime-color: #c95f16;
  --grime-fill: radial-gradient(circle at 36% 32%, #ffad37, #bb3d0b 72%);
}

.grime[data-grime="rice"] {
  --grime-color: #c7b98f;
  --grime-fill: radial-gradient(ellipse at 30% 30%, #fff7d8 0 10%, transparent 12%), radial-gradient(ellipse at 68% 58%, #fff1c1 0 11%, transparent 13%), #8b6238;
}

.grime[data-grime="grease"] {
  --grime-color: #4e2e18;
}

.clean-seal {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: grid;
  place-items: center;
  pointer-events: none;
  color: #117557;
  font-family: Impact, sans-serif;
  font-size: clamp(1.65rem, 4vw, 3.4rem);
  letter-spacing: .05em;
  opacity: 0;
  transform: rotate(-12deg) scale(1.3);
  transition: opacity 160ms ease, transform 160ms ease;
}

.dish-item.clean .clean-seal { opacity: .78; transform: rotate(-12deg) scale(1); }
.dish-item.clean .dish-surface { filter: brightness(1.1) saturate(.72); }
.dish-item.clean .tub-hit-count { display: none; }
.dish-item.missed { animation: missed-dish 620ms ease-in forwards; pointer-events: none; }

@keyframes missed-dish {
  to { opacity: 0; transform: translate(-50%, 75%) rotate(calc(var(--tilt) + 24deg)) scale(.74); filter: grayscale(.8); }
}

.tub-target {
  position: absolute;
  inset: 0;
  z-index: 6;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  border-radius: inherit;
  background: transparent;
  cursor: crosshair;
  touch-action: manipulation;
}

.tub-target:focus-visible { outline: 4px solid var(--acid); outline-offset: 3px; }

.mini-dish-stack {
  position: absolute;
  inset: 17px 25px 22px;
  display: grid;
  align-content: end;
  justify-items: center;
  pointer-events: none;
}

.mini-dish-stack i {
  width: calc(54px + var(--stack-index) * 9px);
  height: 15px;
  margin-top: -6px;
  border: 4px solid #eaddb8;
  border-radius: 50%;
  background: #8f8064;
  box-shadow: 0 4px 6px rgba(0,0,0,.3);
  transition: opacity 120ms ease, transform 120ms ease;
}

.tub-hit-count {
  position: absolute;
  right: 9px;
  top: 9px;
  min-width: 29px;
  height: 29px;
  display: grid;
  place-items: center;
  border: 2px solid #07100f;
  border-radius: 50%;
  color: #07100f;
  background: var(--acid);
  font-size: .75rem;
  font-weight: 950;
  pointer-events: none;
}

.bubbles {
  position: absolute;
  inset: 0;
  z-index: 12;
  pointer-events: none;
}

.bubble {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--size);
  height: var(--size);
  border: 1px solid rgba(233, 255, 252, 0.65);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  animation: bubble-pop 480ms ease-out forwards;
}

@keyframes bubble-pop {
  to { opacity: 0; transform: translateY(-30px) scale(1.7); }
}

.wash-lane {
  display: grid;
  grid-template-columns: minmax(190px, .72fr) minmax(300px, 1.28fr);
  gap: 12px;
}

.overflow-station,
.dishwasher-station {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(2, 8, 7, .62);
}

.overflow-station {
  min-height: 142px;
  display: grid;
  grid-template-columns: 90px 1fr;
  align-items: center;
  gap: 8px;
  padding: 12px;
}

.overflow-copy {
  display: grid;
  gap: 3px;
}

.overflow-copy span,
.overflow-copy small {
  color: var(--muted);
  font-size: .58rem;
  line-height: 1.25;
}

.overflow-copy span { font-weight: 900; letter-spacing: .11em; text-transform: uppercase; }
.overflow-copy strong { color: var(--danger); font-size: .86rem; letter-spacing: .08em; }

.overflow-tub {
  position: relative;
  height: 94px;
  overflow: visible;
  border: 8px solid #7e8f8b;
  border-top-width: 13px;
  border-radius: 13px 13px 31px 31px;
  background: linear-gradient(160deg, #4f6763, #203633 70%);
  box-shadow: inset 0 13px 22px rgba(0,0,0,.45), 0 14px 20px rgba(0,0,0,.24);
  transform-origin: bottom;
}

.tub-rim {
  position: absolute;
  left: 10%;
  right: 10%;
  top: -18px;
  height: 7px;
  border-radius: 999px;
  background: #172321;
}

.overflow-stack {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 8px;
  height: 82px;
  display: grid;
  align-content: end;
  justify-items: center;
}

.overflow-stack span {
  width: calc(48px + var(--overflow-index) * 12px);
  height: 13px;
  margin-top: -6px;
  border: 4px solid #eadfbe;
  border-radius: 50%;
  background: #86795e;
  box-shadow: 0 3px 6px rgba(0,0,0,.35);
  transform: rotate(var(--overflow-tilt));
}

.overflow-tub.warning { animation: tub-wobble 280ms ease 2; }
.overflow-tub.danger { border-color: var(--danger); box-shadow: 0 0 25px rgba(255,103,95,.35), inset 0 13px 22px rgba(0,0,0,.45); }
.overflow-tub.breaking { animation: tub-break 650ms cubic-bezier(.2,.8,.2,1) forwards; }

@keyframes tub-wobble { 33% { transform: rotate(-3deg); } 66% { transform: rotate(3deg); } }
@keyframes tub-break { 25% { transform: rotate(-7deg) scale(1.04); } 60% { transform: rotate(8deg) translateY(5px); } to { transform: rotate(-12deg) translateY(38px); filter: saturate(.4); } }

.crack { position: absolute; z-index: 4; display: none; width: 4px; height: 72px; background: #ff8d85; transform: rotate(24deg); }
.crack-one { left: 42%; top: 2px; }
.crack-two { right: 30%; top: 12px; transform: rotate(-31deg); }
.overflow-tub.breaking .crack { display: block; }

.dishwasher-station {
  padding: 9px;
}

.dishwasher-station > p {
  margin: 7px 4px 2px;
  color: var(--muted);
  font-size: .68rem;
  text-align: center;
}

.dishwasher {
  overflow: hidden;
  border: 2px solid #9aa6a5;
  border-radius: 16px;
  background: linear-gradient(145deg, #697777, #293536 64%);
  box-shadow: 0 18px 28px rgba(0,0,0,.32), inset 0 1px rgba(255,255,255,.24);
}

.washer-console {
  height: 35px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-bottom: 1px solid rgba(255,255,255,.18);
  background: #111a1b;
}

.washer-light { width: 8px; height: 8px; border-radius: 50%; background: #66716d; box-shadow: 0 0 0 transparent; }
.dishwasher.ready .washer-light { background: var(--acid); box-shadow: 0 0 12px var(--acid); animation: ready-pulse 700ms ease-in-out infinite alternate; }
@keyframes ready-pulse { to { opacity: .48; } }
.washer-readout { color: #9daba7; font: 800 .53rem/1 'Courier New', monospace; letter-spacing: .08em; }
.dishwasher.ready .washer-readout { color: var(--acid); }
.washer-dial { width: 18px; height: 18px; border: 3px solid #899494; border-radius: 50%; box-shadow: inset 0 0 0 3px #1b2425; }

.dishwasher-button {
  width: 100%;
  min-height: 112px;
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  padding: 10px 16px 12px 12px;
  border: 0;
  color: var(--cream);
  background: linear-gradient(145deg, #5c696a, #273334 70%);
  cursor: pointer;
  text-align: left;
  transition: filter 140ms ease, transform 120ms ease, background 140ms ease;
}

.dishwasher-button:disabled { cursor: not-allowed; filter: saturate(.45) brightness(.72); }
.dishwasher-button:not(:disabled):hover,
.dishwasher-button:not(:disabled):focus-visible { background: linear-gradient(145deg, #879491, #344e47 70%); filter: brightness(1.1); }
.dishwasher-button:not(:disabled):active { transform: translateY(3px); filter: brightness(.84); }
.dishwasher-button:focus-visible { outline: 4px solid var(--acid); outline-offset: -5px; }

.washer-door {
  width: 76px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 5px solid #9da6a6;
  border-radius: 14px;
  background: #1c2728;
  box-shadow: inset 0 0 0 4px #566263, inset 0 0 25px rgba(0,0,0,.68);
}

.washer-window {
  width: 48px;
  height: 38px;
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 3px;
  overflow: hidden;
  border-radius: 50%;
  background: radial-gradient(circle at 45% 38%, #366b70, #0a282c 72%);
}

.washer-window i { width: 6px; height: 25px; border: 2px solid #d7d0b4; border-radius: 50%; transform: rotate(var(--rack-turn, -7deg)); }
.washer-window i:nth-child(2) { --rack-turn: 0deg; height: 30px; }
.washer-window i:nth-child(3) { --rack-turn: 8deg; height: 22px; }
.dishwasher.loading .washer-window { animation: washer-spin 430ms ease-in-out; }
@keyframes washer-spin { 50% { transform: rotate(18deg) scale(.88); filter: brightness(1.7); } }

.washer-copy { min-width: 0; display: grid; gap: 5px; }
.washer-copy strong { font-size: clamp(1.05rem, 2.6vw, 1.55rem); line-height: .95; text-transform: uppercase; }
.washer-copy small { color: var(--muted); font-size: .68rem; line-height: 1.3; }
.dishwasher.ready .washer-copy strong { color: var(--acid); }
.washer-arrow { font-size: 1.8rem; font-weight: 950; }

.flying-dish {
  position: fixed;
  z-index: 80;
  left: var(--fly-left);
  top: var(--fly-top);
  width: var(--fly-width);
  height: var(--fly-height);
  border: 7px solid #e8dbb8;
  border-radius: var(--fly-radius, 50%);
  pointer-events: none;
  background: radial-gradient(circle, #fbf4df 0 57%, #d3c39e 58% 66%, #fff7e1 67%);
  box-shadow: 0 16px 28px rgba(0,0,0,.4);
  animation: fly-to-washer 520ms cubic-bezier(.34,.7,.2,1) forwards;
}

.flying-dish.type-tray,
.flying-dish.type-bus-tub { --fly-radius: 22px; }
.flying-dish.type-pan { background: radial-gradient(circle, #4d5859, #172021 68%); border-color: #60696a; }

@keyframes fly-to-washer {
  55% { transform: translate(calc(var(--fly-x) * .55), calc(var(--fly-y) * .35 - 70px)) rotate(190deg) scale(.72); }
  to { opacity: 0; transform: translate(var(--fly-x), var(--fly-y)) rotate(390deg) scale(.18); }
}

.fired-panel {
  position: relative;
  overflow: hidden;
  border-color: rgba(255, 103, 95, .62);
  background:
    repeating-linear-gradient(135deg, rgba(255,255,255,.025) 0 10px, transparent 10px 20px),
    radial-gradient(circle at 50% 0, rgba(255, 33, 54, .32), transparent 56%),
    #25090d;
  box-shadow: 0 0 0 4px rgba(255,103,95,.12), 0 34px 90px rgba(0,0,0,.72);
}

.fired-panel h2 { color: #ff7067; font-family: Impact, sans-serif; font-size: clamp(2.6rem, 10vw, 5.5rem); letter-spacing: .01em; text-shadow: 0 0 24px rgba(255,49,55,.45); }
.fired-line { color: #fff3cf !important; font-size: clamp(1rem, 3vw, 1.35rem); font-weight: 850; }
.fired-stamp { display: inline-block; margin-bottom: 14px; padding: 6px 10px; border: 3px solid #ff675f; color: #ff8b84; font: 950 .72rem/1 'Courier New', monospace; letter-spacing: .14em; transform: rotate(-4deg); }
.reapply-button { border-color: #ffb1ab; color: #fff; background: #b71925; }
.reapply-button:hover { border-color: #fff; background: #e02b38; }
.centered { justify-content: center; }
.result-link { display: inline-grid; place-items: center; color: var(--cream); text-decoration: none; }

.fail-flash {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: none;
  place-items: center;
  pointer-events: none;
  color: white;
  background: rgba(210, 0, 24, .88);
  mix-blend-mode: screen;
}

.fail-flash.show { display: grid; animation: fail-flash 760ms ease-out both; }
.fail-flash span { font-family: Impact, sans-serif; font-size: clamp(4rem, 15vw, 12rem); letter-spacing: -.02em; text-align: center; transform: rotate(-4deg); }
@keyframes fail-flash { 0% { opacity: 0; } 12%, 48% { opacity: 1; } 100% { opacity: 0; } }

body.sunday-mode {
  background:
    radial-gradient(circle at 15% 0, rgba(255, 103, 95, 0.26), transparent 35rem),
    radial-gradient(circle at 90% 15%, rgba(255, 79, 163, 0.2), transparent 30rem),
    #120b10;
}

body.sunday-mode .timer-track span { background: linear-gradient(90deg, #ff305f, #ff9f1c); }
body.firing .pit-layout { border-color: rgba(255,103,95,.7); box-shadow: 0 0 60px rgba(255,30,50,.25); }

.modal {
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}

.modal-panel { max-height: calc(100dvh - 32px); overflow-y: auto; }

.controls-copy {
  margin: 0;
  color: var(--muted);
  font-size: .72rem;
  line-height: 1.5;
  text-align: center;
}

@media (max-width: 850px) {
  .pit-layout { grid-template-columns: 1fr; }
  .shift-board { order: 2; }
  .shift-board ol { grid-template-columns: repeat(7, minmax(0, 1fr)); }
  .shift-board li { display: block; padding: 6px 3px; text-align: center; }
  .shift-board li b,
  .shift-board li.done::after { display: none; }
  .rack { display: none; }
  .wash-lane { grid-template-columns: minmax(160px, .65fr) minmax(280px, 1.35fr); }
}

@media (max-width: 650px) {
  .topbar-actions { gap: 5px; }
  .sound-toggle { min-width: 42px; padding: 8px 10px; }
  .sound-toggle > span:last-child { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
  .wash-zone { grid-template-rows: auto auto auto; }
  .rush-row { grid-template-columns: 1fr; gap: 5px; }
  .rush-row > span { text-align: right; }
  .dish-yard { min-height: 430px; border-width: 4px; border-radius: 28px 28px 44px 44px; }
  .active-dishes {
    position: relative;
    inset: auto;
    min-height: 420px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-content: space-around;
    justify-items: center;
    gap: 8px 2px;
    padding: 20px 4px 28px;
  }
  .dish-item,
  .dish-item[data-kind="tray"],
  .dish-item[data-kind="platter"],
  .dish-item[data-kind="pan"],
  .dish-item[data-kind="bus-tub"] {
    --dish-w: min(42vw, 154px);
    --dish-h: min(42vw, 154px);
    position: relative;
    left: auto;
    top: auto;
    width: var(--dish-w);
    height: var(--dish-h);
    transform: rotate(var(--tilt)) scale(var(--scale, 1));
  }
  .dish-item[data-kind="tray"],
  .dish-item[data-kind="platter"],
  .dish-item[data-kind="bus-tub"] { --dish-h: min(30vw, 112px); }
  .dish-item[data-kind="pan"] .dish-surface { width: calc(var(--dish-w) - 20px); height: calc(var(--dish-w) - 20px); margin-right: 20px; }
  .dish-item[data-kind="pan"] .dish-surface::after { top: 42%; width: 38px; height: 18px; }
  @keyframes dish-arrive { from { opacity: 0; transform: translateY(-14px) rotate(calc(var(--tilt) - 10deg)) scale(.8); } }
  .dish-item.missed { animation-name: missed-dish-mobile; }
  @keyframes missed-dish-mobile { to { opacity: 0; transform: translateY(70%) rotate(calc(var(--tilt) + 24deg)) scale(.74); filter: grayscale(.8); } }
  .dish-label { bottom: -9px; }
  .grime { width: 50px; height: 50px; }
  .grime::before { width: 33px; height: 33px; }
  .wash-lane { grid-template-columns: 1fr; }
  .overflow-station { min-height: 112px; grid-template-columns: 98px 1fr; }
  .overflow-tub { height: 74px; }
  .dishwasher-button { min-height: 100px; grid-template-columns: 68px minmax(0,1fr) auto; padding: 9px; }
  .washer-door { width: 62px; }
  .washer-window { width: 39px; height: 31px; }
  .washer-copy strong { font-size: 1rem; }
  .shift-board { padding: 10px; }
  .shift-board ol { margin: 8px 0 0; }
  body.is-running .game-shell { gap: 8px; }
  body.is-running .game-heading { align-items: center; padding: 10px 13px; }
  body.is-running .game-heading h1 { margin: 2px 0; font-size: 2.25rem; }
  body.is-running .game-heading p:not(.eyebrow) { display: none; }
  body.is-running .xp-pill { margin-top: 0; padding: 7px 9px; }
  body.is-running .xp-pill small { display: none; }
  body.is-running .stat { padding: 7px 9px; }
  body.is-running .shift-board { display: none; }
  body.is-running .pit-layout { min-height: 0; padding: 8px; }
}

@media (max-width: 390px) {
  .dish-yard { min-height: 400px; }
  .active-dishes { min-height: 390px; }
  .hud { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hud .stat:last-child { grid-column: span 2; }
  .washer-copy small { font-size: .61rem; }
  .washer-arrow { font-size: 1.3rem; }
}

@media (prefers-reduced-motion: reduce) {
  .sound-bars i,
  .dish-item,
  .grime,
  .grime::before,
  .overflow-tub,
  .flying-dish,
  .fail-flash,
  .dishwasher,
  .washer-window {
    animation: none !important;
    transition: none !important;
  }

  .flying-dish { display: none; }
  .fail-flash.show { display: none; }
}

/* Rush mechanics: pan bosses, fragile glass, silverware, RNG cycles, and utility hazards. */
.dish-yard.has-glass .active-dishes { right: 150px; }

.dish-item.pan-boss {
  --dish-w: 230px;
  --dish-h: 190px;
  z-index: 4;
}

.dish-item.pan-boss::before {
  position: absolute;
  left: 15px;
  top: -15px;
  z-index: 10;
  padding: 5px 9px;
  border: 2px solid #ff7d55;
  border-radius: 999px;
  content: "PAN BOSS";
  color: #fff3cf;
  background: #701c17;
  box-shadow: 0 0 18px rgba(255,75,44,.38);
  font: 950 .6rem/1 'Courier New', monospace;
  letter-spacing: .12em;
}

.dish-item.pan-boss .dish-surface {
  width: 178px;
  height: 178px;
  border-color: #8b6960;
  box-shadow: 0 0 0 4px rgba(255,92,62,.16), 0 24px 40px rgba(0,0,0,.54), inset 0 0 34px rgba(0,0,0,.78);
}

.dish-item[data-kind="glass"] { --dish-w: 84px; --dish-h: 126px; z-index: 8; }
.dish-item[data-kind="glass"] .dish-surface { overflow: visible; border: 0; background: transparent; box-shadow: none; }
.glass-control {
  position: absolute;
  inset: 0;
  z-index: 7;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  border-radius: 18px;
  background: rgba(200,255,250,.04);
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-drag: none;
}
.glass-control:hover,
.glass-control:focus-visible { outline: 3px solid var(--acid); outline-offset: 3px; background: rgba(200,255,250,.1); }
.glass-control:active { cursor: grabbing; }
.glass-control.carrying,
.glass-control.keyboard-carrying { opacity: .22; }
.glass-cup {
  position: absolute;
  left: 50%;
  top: 8px;
  width: 57px;
  height: 74px;
  border: 4px solid rgba(218,255,251,.84);
  border-top: 2px solid rgba(236,255,253,.94);
  border-radius: 8px 8px 24px 24px;
  background: linear-gradient(90deg, rgba(255,255,255,.26), rgba(90,214,221,.08) 45%, rgba(255,255,255,.16));
  box-shadow: inset 10px 0 15px rgba(255,255,255,.13), 0 12px 18px rgba(0,0,0,.24);
  transform: translateX(-50%);
}
.glass-cup::before { position: absolute; left: 50%; top: 100%; width: 5px; height: 27px; border-radius: 4px; content: ""; background: rgba(218,255,251,.88); transform: translateX(-50%); }
.glass-cup::after { position: absolute; left: 50%; top: calc(100% + 24px); width: 43px; height: 8px; border: 4px solid rgba(218,255,251,.88); border-radius: 50%; content: ""; transform: translateX(-50%); }
.glass-cup i { position: absolute; left: 5px; right: 5px; bottom: 6px; height: 24px; border-radius: 4px 4px 18px 18px; background: linear-gradient(#ff8fd1, #9b1c77); box-shadow: inset 0 5px rgba(255,255,255,.2); }
.dish-item.racked .glass-cup { opacity: .34; filter: saturate(.35); transform: translateX(-50%) scale(.88); }
.dish-item.racked .dish-label { color: var(--mint); }
.dish-item.broken-glass .glass-cup { opacity: .35; transform: translateX(-50%) rotate(24deg) scale(.7); filter: grayscale(1); }

.glass-ghost {
  position: fixed;
  left: var(--drag-left);
  top: var(--drag-top);
  z-index: 190;
  width: 84px;
  height: 126px;
  pointer-events: none;
  filter: drop-shadow(0 18px 12px rgba(0,0,0,.4));
  transform: rotate(4deg) scale(1.04);
}
.glass-ghost .glass-cup { top: 8px; }

.dish-item[data-kind="silverware"] { --dish-w: 180px; --dish-h: 126px; }
.dish-item[data-kind="silverware"] .dish-surface {
  overflow: hidden;
  border: 9px solid #7a8b88;
  border-radius: 18px 18px 35px 35px;
  background: linear-gradient(155deg, #4b5f5b, #1c302e 72%);
  box-shadow: 0 20px 34px rgba(0,0,0,.42), inset 0 12px 22px rgba(0,0,0,.4);
}
.silver-target { position: absolute; inset: 0; z-index: 7; width: 100%; height: 100%; padding: 0; border: 0; border-radius: inherit; background: transparent; cursor: crosshair; touch-action: manipulation; }
.silver-target:focus-visible { outline: 4px solid var(--acid); outline-offset: -6px; }
.utensil-stack { position: absolute; inset: 13px 20px 24px; display: flex; align-items: end; justify-content: center; gap: 5px; pointer-events: none; }
.utensil-stack i { position: relative; width: 8px; height: 70px; border-radius: 5px; background: linear-gradient(90deg, #aebfc0, #eef7f5 48%, #667879); box-shadow: 0 5px 8px rgba(0,0,0,.25); transform: rotate(calc((var(--utensil-index) - 3) * 4deg)); transition: opacity 120ms ease, transform 120ms ease; }
.utensil-stack i::before { position: absolute; left: -4px; top: -3px; width: 16px; height: 21px; border: 3px solid #c9d5d4; border-radius: 50% 50% 42% 42%; content: ""; background: #788989; }
.utensil-stack i:nth-child(even)::before { height: 18px; border: 0; border-radius: 4px 4px 10px 10px; background: repeating-linear-gradient(90deg, #dbe5e3 0 2px, transparent 2px 4px); }
.utensil-stack i.sorted { opacity: .18; transform: translateY(-55px) rotate(20deg); }
.dish-item.clean .silver-hit-count { display: none; }

.dish-item.machine-rejected { animation: machine-reject 380ms ease; }
@keyframes machine-reject { 25% { transform: translate(-53%, -50%) rotate(calc(var(--tilt) - 5deg)); filter: sepia(.8); } 70% { transform: translate(-47%, -50%) rotate(calc(var(--tilt) + 5deg)); } }
.dishwasher.risky .washer-light { background: #ff9f1c; box-shadow: 0 0 12px #ff9f1c; animation: ready-pulse 420ms ease-in-out infinite alternate; }
.dishwasher.risky .washer-readout,
.dishwasher.risky .washer-copy strong { color: #ffca59; }
.dishwasher.risky .dishwasher-button { background: linear-gradient(145deg, #79632d, #34311e 70%); }
.hazard-locked .active-dishes { filter: blur(1.5px) saturate(.45); }
body.water-changing .water-station { border-color: #59dff2; box-shadow: 0 0 22px rgba(54,229,255,.2); }

@media (hover: hover) and (pointer: fine) {
  body.scrubby-active.scrubby-over .scrubby-cursor { display: block; }
  body.scrubby-active:not(.scrubby-over) .scrubby-cursor { display: none; }
  body.scrubby-active .silver-target { cursor: none; }
  body.glass-dragging,
  body.glass-dragging * { cursor: grabbing !important; }
}

@media (min-width: 651px) {
  .dish-yard.crowded .dish-item:not(.pan-boss) { --dish-w: 132px; --dish-h: 132px; }
  .dish-yard.crowded .dish-item[data-kind="tray"],
  .dish-yard.crowded .dish-item[data-kind="platter"],
  .dish-yard.crowded .dish-item[data-kind="silverware"],
  .dish-yard.crowded .dish-item[data-kind="bus-tub"] { --dish-w: 160px; --dish-h: 108px; }
  .dish-yard.crowded .dish-item[data-kind="glass"] { --dish-w: 74px; --dish-h: 112px; }
  .dish-yard.crowded .dish-item.pan-boss { --dish-w: 190px; --dish-h: 165px; }
  .dish-yard.crowded .dish-item.pan-boss .dish-surface { width: 152px; height: 152px; }
}

@media (max-width: 850px) {
  .hud { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 650px) {
  .utility-strip { gap: 7px; }
  .water-station { grid-template-columns: 1fr auto; gap: 8px; }
  .water-gauge { grid-column: 1 / -1; grid-row: 2; }
  .water-button { grid-column: 2; grid-row: 1; }
  .floor-callout { grid-template-columns: 1fr auto; }
  .dish-yard.has-glass .active-dishes { right: auto; padding-bottom: 112px; }
  .glass-rack { left: 10px; right: 10px; top: auto; bottom: 8px; width: auto; min-height: 78px; grid-template-columns: auto auto; align-items: center; }
  .glass-rack small { grid-column: 1 / -1; }
  .dish-item[data-kind="glass"] { --dish-w: 74px; --dish-h: 112px; }
  .dish-item[data-kind="silverware"] { --dish-w: min(42vw, 154px); --dish-h: min(30vw, 112px); }
  .dish-item.pan-boss { --dish-w: min(46vw, 168px); --dish-h: min(46vw, 168px); }
  .dish-item.pan-boss .dish-surface { width: calc(var(--dish-w) - 16px); height: calc(var(--dish-w) - 16px); margin-right: 16px; }
  .dish-item.pan-boss::before { left: 4px; top: -10px; }
  .dish-yard.crowded { min-height: 590px; }
  .dish-yard.crowded .active-dishes { min-height: 580px; align-content: space-evenly; }
  .hud { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hud .stat:last-child { grid-column: auto; }
}

@media (max-width: 390px) {
  .dish-yard.crowded { min-height: 560px; }
  .dish-yard.crowded .active-dishes { min-height: 550px; }
  .floor-callout { grid-template-columns: 1fr; }
  .mop-button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .glass-rack,
  .glass-control,
  .glass-ghost,
  .utensil-stack i,
  .machine-rejected,
  .water-gauge span { animation: none !important; transition: none !important; }
}
