:root {
  color-scheme: dark;
  --ground: #111a2d;
  --panel: #17233a;
  --ink: #f6ead5;
  --secondary: #bdc9df;
  --line: #45526d;
  --amber: #ffd28b;
  --button: #222e47;
  font: 100%/1.45 "Segoe UI", system-ui, sans-serif;
  background: var(--ground);
  color: var(--ink);
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 0; }
button {
  appearance: none;
  font-family: inherit;
  font-size: .92rem;
  font-weight: 650;
  color: var(--ink);
  background: var(--button);
  border: 1px solid var(--line);
  border-radius: .55rem;
  min-height: 44px;
  padding: .62rem .9rem;
  cursor: pointer;
}
button:not(:disabled):hover { border-color: var(--amber); }
button:disabled { opacity: .48; cursor: default; }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 3px; }
button.primary { background: var(--amber); color: #242336; border-color: var(--amber); }
button.primary:hover { background: #ffe5b6; }
button.quiet { white-space: nowrap; background: transparent; }
.game {
  width: min(100%, 49rem);
  margin: 0 auto;
  padding: .9rem clamp(.65rem, 3vw, 1.55rem) 1rem;
}
.game-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .85rem;
  padding: 0 0 .75rem;
}
h1, h2, p, dl, dd { margin: 0; }
h1 { font-size: clamp(1.65rem, 5vw, 2.35rem); line-height: 1.04; letter-spacing: -.035em; }
.game-header p { color: var(--secondary); font-size: .88rem; margin-top: .36rem; max-width: 42ch; }
.hud {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem 1.05rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: .65rem .65rem 0 0;
  border-bottom: 0;
  padding: .52rem .78rem;
  font-variant-numeric: tabular-nums;
}
.hud div { min-width: 2.4rem; }
.hud dt { color: var(--secondary); font-size: .74rem; }
.hud dd { font-size: 1rem; font-weight: 700; white-space: nowrap; }
#score, #bonus { color: var(--amber); }
.field {
  position: relative;
  aspect-ratio: 900 / 760;
  border: 1px solid var(--line);
  border-radius: 0 0 .65rem .65rem;
  isolation: isolate;
  overflow: hidden;
  background: #10192d;
}
.field:focus-visible { outline-offset: -4px; }
.city, .actors, .party, .overlay { position: absolute; inset: 0; width: 100%; height: 100%; }
.city { object-fit: fill; user-select: none; pointer-events: none; }
.actors { pointer-events: none; user-select: none; }
.actor { position: absolute; }
.actor img { width: 100%; height: 100%; object-fit: contain; display: block; }
.actor[data-piece="courier"] img { transform: scale(.9); }
.actor[data-piece^="cat-"] img { transform: scale(.79); }
.actor[data-piece="IceCream"] > img { transform: scale(.77); }
.actor[data-flip="true"] > img { transform: scaleX(-1); filter: hue-rotate(30deg); }
.actor[data-served="true"] { opacity: .4; }
.game[data-phase="hit"] .actor[data-piece="courier"] { opacity: .35; }
.order {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .08rem;
  padding: .15rem .26rem;
  bottom: 90%;
  left: 50%;
  transform: translateX(-50%);
  background: #fff7de;
  border: 2px solid #24253a;
  border-radius: .5rem;
}
.order img {
  width: clamp(.95rem, 4vw, 1.65rem);
  height: clamp(.95rem, 4vw, 1.65rem);
  transform: none !important;
}
.overlay {
  display: grid;
  place-items: center;
  padding: .72rem;
  background: #10192d9c;
}
.notice {
  max-width: min(100%, 30rem);
  max-height: 100%;
  overflow: auto;
  padding: clamp(.74rem, 4vw, 1.42rem);
  background: var(--panel);
  border: 1px solid #687891;
  border-radius: .72rem;
  box-shadow: 0 12px 30px #0b11244f;
  text-align: center;
}
.notice h2 { font-size: clamp(1.14rem, 4.8vw, 1.75rem); line-height: 1.08; text-wrap: balance; }
.notice p { color: var(--secondary); margin-top: .5rem; font-size: clamp(.79rem, 2.7vw, .99rem); }
.notice-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .45rem; }
.notice-actions:not(:empty) { margin-top: .8rem; }
.notice ol { padding-left: 1.75rem; margin: .65rem auto 0; width: fit-content; text-align: left; color: var(--secondary); }
.notice .breakdown { margin: .65rem auto 0; width: fit-content; color: var(--secondary); }
.notice .breakdown div { display: flex; justify-content: space-between; gap: .85rem; font-size: .9rem; }
.notice .breakdown dd { color: var(--ink); font-weight: 700; }
.control-deck {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .65rem;
  margin-top: .7rem;
}
.game-actions p { color: var(--secondary); font-size: .77rem; margin-top: .45rem; max-width: 22ch; }
.game-actions button + button { margin-left: .18rem; }
.directions {
  display: grid;
  grid-template-columns: repeat(3, 44px);
  grid-template-rows: repeat(2, 44px);
  gap: 4px;
}
.move { min-width: 44px; min-height: 44px; padding: 0; touch-action: none; user-select: none; }
.move svg { width: 25px; height: 25px; stroke: currentColor; fill: none; stroke-width: 2.25; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.move.up { grid-column: 2; }
.move.left { grid-row: 2; grid-column: 1; }
.move.left svg { transform: rotate(-90deg); }
.move.down { grid-row: 2; grid-column: 2; }
.move.down svg { transform: rotate(180deg); }
.move.right { grid-row: 2; grid-column: 3; }
.move.right svg { transform: rotate(90deg); }
.move[data-held="true"] { background: var(--amber); color: #242336; }
.finish-area { display: flex; align-items: center; justify-content: space-between; gap: .65rem; padding: .75rem 0 .12rem; }
.finish-area p { color: var(--secondary); font-size: .87rem; }
.finish-area button { white-space: nowrap; }
.party {
  background: radial-gradient(ellipse at 18% 10%, #754684 0%, transparent 46%),
    radial-gradient(ellipse at 82% 30%, #375e90 0%, transparent 48%), #262441;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(3, 1fr);
  padding: 24% 8% 5%;
}
.party img { width: min(100%, 86px); align-self: center; justify-self: center; animation: dance 1.3s ease-in-out infinite alternate; }
.party img:nth-child(3n+2) { animation-delay: -.38s; }
.party img:nth-child(3n) { animation-delay: -.76s; }
@keyframes dance { from { transform: translateY(2px) rotate(-4deg); } to { transform: translateY(-8px) rotate(4deg); } }
.game[data-phase="party"][data-paused="false"] .overlay { align-items: start; background: none; pointer-events: none; }
.game[data-phase="party"][data-paused="false"] .notice { margin-top: 2%; }
.game[data-paused="true"] .party img { animation-play-state: paused; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
::selection { background: var(--amber); color: #242336; }

@media (max-width: 450px) {
  .game-header { align-items: start; }
  .game-header p { font-size: .8rem; }
  .hud { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .42rem .48rem; padding: .45rem .58rem; }
  .hud dd { font-size: .9rem; }
  .notice-actions button { padding: .53rem .62rem; }
}
@media (prefers-reduced-motion: reduce) {
  .party img { animation: none; }
}



.project-link { display: inline-block; margin-bottom: .4rem; color: inherit; font-size: .92rem; text-underline-offset: .2em; }
