/* ===== Play while you wait — the hub and the four games =====
   Loaded after styles.css on play.html only. Every colour is a site token. */

.play-page [hidden] { display: none !important; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- Hub ---------- */
.play-hub { padding: clamp(1.6rem, 5vw, 3rem) 1.25rem clamp(3rem, 7vw, 5rem); }

/* The storefront sign: turquoise, chocolate lettering, the plates sit on it */
.play-head {
  max-width: 1080px;
  margin: 0 auto;
  padding: clamp(1.6rem, 4vw, 2.6rem) 1.25rem clamp(5rem, 11vw, 7rem);
  text-align: center;
  background:
    radial-gradient(circle at 12% 18%, rgba(255, 253, 249, 0.22) 0 3px, transparent 4px) 0 0 / 34px 34px,
    var(--lagoon);
  border: 2px solid var(--ink);
  border-radius: 36px;
  box-shadow: 0 6px 0 var(--ink);
}

.play-aside { font-size: 1.15rem; color: var(--ink); line-height: 1.8; }

.play-head h1 {
  font-size: clamp(2.7rem, 9vw, 5.4rem);
  color: var(--ink);
  line-height: 1;
  text-shadow: 0.045em 0.05em 0 var(--paper);
  margin: 0.1rem 0 0.8rem;
}

.play-lede { max-width: 34rem; margin: 0 auto; font-size: 1.08rem; font-weight: 600; color: var(--ink); text-wrap: balance; }

.play-grid {
  list-style: none;
  max-width: 980px;
  margin: calc(-1 * clamp(3.6rem, 9vw, 5.2rem)) auto 0;
  padding: 0 clamp(0rem, 3vw, 1.6rem);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1rem, 2.6vw, 1.6rem);
  position: relative;
}

.play-tile {
  display: flex;
  flex-direction: column;
  height: 100%;
  color: var(--ink);
  text-decoration: none;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 28px;
  box-shadow: 0 6px 0 var(--ink);
  overflow: hidden;
  transition: transform 0.18s cubic-bezier(0.3, 1.4, 0.6, 1), box-shadow 0.18s ease;
}

.play-tile:hover { transform: translateY(-3px); box-shadow: 0 9px 0 var(--ink); }
.play-tile:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--ink); }
.play-tile:focus-visible { outline: 3px solid var(--fraise); outline-offset: 4px; }

.tile-stage {
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 9;
  border-bottom: 2px solid var(--ink);
  background: radial-gradient(ellipse at 50% 92%, rgba(255, 253, 249, 0.45), transparent 62%), var(--tile-bg, var(--butter));
  perspective: 600px;
}

.tile-crepe { --tile-bg: var(--butter); }
.tile-drizzle { --tile-bg: var(--paper-deep); }
.tile-berry { --tile-bg: var(--lagoon); }
.tile-memory { --tile-bg: var(--fraise); }

.tile-icon { width: min(62%, 240px); height: auto; overflow: visible; }

.tile-text { display: grid; gap: 0.15rem; padding: 0.95rem 1.3rem 1.25rem; }

.tile-name { font-family: var(--font-show); font-weight: 400; font-size: clamp(1.45rem, 3.2vw, 1.95rem); line-height: 1.15; }

.tile-line { color: var(--ink-soft); font-weight: 600; }

.tile-best {
  justify-self: start;
  margin-top: 0.55rem;
  padding: 0.12rem 0.75rem;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  background: var(--paper-deep);
  font-size: 0.86rem;
  font-weight: 800;
}

.play-after { max-width: 40rem; margin: clamp(2.4rem, 5vw, 3.4rem) auto 0; text-align: center; }
.play-after p { color: var(--ink-soft); font-weight: 600; }
.play-after-links { display: flex; flex-wrap: wrap; gap: 0.7rem; justify-content: center; margin-top: 0.9rem; }
.play-noscript { text-align: center; margin-top: 2rem; font-weight: 700; }

@media (max-width: 600px) {
  .play-grid { grid-template-columns: 1fr; padding: 0; }
  .play-head { border-radius: 28px; }
}

/* live icons: the crepe turns slowly; the others move when you point at them */
@media (prefers-reduced-motion: no-preference) {
  .icon-crepe { animation: tile-turn 6s ease-in-out infinite; transform-origin: 50% 70%; }
  .icon-drizzle .td-line, .icon-drizzle .td-shine { stroke-dasharray: 1; stroke-dashoffset: 0; }
  .play-tile:hover .icon-drizzle .td-line, .play-tile:focus-visible .icon-drizzle .td-line,
  .play-tile:hover .icon-drizzle .td-shine, .play-tile:focus-visible .icon-drizzle .td-shine { animation: tile-pour 1.1s cubic-bezier(0.5, 0, 0.3, 1) both; }
  .icon-berry .tb-fall, .icon-berry .tb-fall2 { transform-box: fill-box; transform-origin: center; }
  .play-tile:hover .icon-berry .tb-fall, .play-tile:focus-visible .icon-berry .tb-fall { animation: tile-fall 0.9s cubic-bezier(0.4, 0, 0.6, 1) both; }
  .play-tile:hover .icon-berry .tb-fall2, .play-tile:focus-visible .icon-berry .tb-fall2 { animation: tile-fall 0.9s cubic-bezier(0.4, 0, 0.6, 1) 0.12s both; }
  .icon-memory .tm-back, .icon-memory .tm-front { transition: transform 0.35s cubic-bezier(0.3, 1.5, 0.6, 1); transform-box: fill-box; transform-origin: 50% 90%; }
  .play-tile:hover .icon-memory .tm-back, .play-tile:focus-visible .icon-memory .tm-back { transform: rotate(-20deg) translateX(-6px); }
  .play-tile:hover .icon-memory .tm-front, .play-tile:focus-visible .icon-memory .tm-front { transform: rotate(16deg) translate(6px, -6px); }
}

@keyframes tile-turn {
  0%, 100% { transform: rotateY(-18deg) rotateX(4deg); }
  50% { transform: rotateY(18deg) rotateX(-2deg); }
}
@keyframes tile-pour { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes tile-fall {
  0% { transform: translateY(-22px) rotate(-12deg); }
  70% { transform: translateY(6px) rotate(4deg) scale(1.04, 0.94); }
  100% { transform: translateY(0) rotate(0); }
}

/* ---------- Game stage (same chrome for every game) ---------- */
body.game-open { overflow: hidden; }

.game-stage {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  background: var(--paper);
  color: var(--ink);
}

.game-bar {
  position: relative;
  z-index: 5;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.5rem;
  padding: calc(0.5rem + env(safe-area-inset-top)) max(0.75rem, env(safe-area-inset-right)) 0.5rem max(0.75rem, env(safe-area-inset-left));
  background: var(--paper);
  border-bottom: 2px solid var(--ink);
}

.game-title {
  font-family: var(--font-show);
  font-size: clamp(1.2rem, 4.4vw, 1.7rem);
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
}
.game-stage .game-title:focus,
.game-stage .game-title:focus-visible { outline: none; }

.game-actions { justify-self: end; display: flex; gap: 0.5rem; }

.gbtn {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: none;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 3px 0 var(--ink);
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.gbtn svg { width: 22px; height: 22px; }
.gbtn:hover { transform: translateY(-1px); box-shadow: 0 4px 0 var(--ink); }
.gbtn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.gbtn[aria-pressed="true"] { background: var(--butter); }

.game-stage :focus-visible { outline: 3px solid var(--fraise); outline-offset: 3px; }

.game-body { position: relative; flex: 1; min-height: 0; overflow: hidden; }

.game-overlay {
  position: absolute;
  inset: var(--bar-h, 60px) 0 0 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 1.25rem;
  background: rgba(43, 22, 14, 0.42);
}

#gameLoading { background: var(--paper); }

.play-card {
  width: min(100%, 440px);
  padding: 1.4rem 1.5rem 1.5rem;
  text-align: center;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 26px;
  box-shadow: 0 8px 0 var(--ink);
}

.play-card-title { font-family: var(--font-show); font-size: clamp(1.7rem, 6vw, 2.3rem); line-height: 1.1; }
.play-card-aside { font-size: 1rem; line-height: 1.9; }
.play-card-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.8rem; margin-top: 1.1rem; }
.play-card-actions .btn { font-size: 0.98rem; }

.loading-card { border: 0; box-shadow: none; background: transparent; font-weight: 700; }

.loading-crepe {
  display: block;
  width: 72px;
  height: 72px;
  margin: 0 auto 0.8rem;
  border: 2.5px solid var(--ink);
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 35%, rgba(154, 90, 30, 0.45) 0 5px, transparent 6px),
    radial-gradient(circle at 64% 62%, rgba(154, 90, 30, 0.4) 0 7px, transparent 8px),
    radial-gradient(circle at 58% 26%, rgba(154, 90, 30, 0.35) 0 4px, transparent 5px),
    radial-gradient(circle, #f9c667, var(--butter));
  animation: loading-spin 1.2s linear infinite;
}
@keyframes loading-spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: no-preference) {
  .play-card-pop { animation: card-pop 0.42s cubic-bezier(0.2, 0.9, 0.3, 1.25) both; }
}
@keyframes card-pop { from { opacity: 0; transform: translateY(24px) scale(0.94); } to { opacity: 1; transform: none; } }

.play-confetti { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 60; }

/* stars shared by Drizzle Master */
.stars { display: flex; justify-content: center; gap: 0.35rem; margin: 0.6rem 0 0.2rem; }
.stars svg { width: 44px; height: 44px; fill: var(--paper-deep); stroke: var(--ink); stroke-width: 1.6; }
.stars .on svg { fill: var(--butter); }
@media (prefers-reduced-motion: no-preference) {
  .stars .on { animation: star-pop 0.5s cubic-bezier(0.3, 1.8, 0.5, 1) both; animation-delay: calc(var(--n, 0) * 140ms + 150ms); }
}
@keyframes star-pop { from { transform: scale(0) rotate(-40deg); } to { transform: none; } }

/* ---------- Build a Crepe ---------- */
.bac {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(320px, 30vw, 390px);
}

.bac-scene { position: relative; min-width: 0; min-height: 0; overflow: hidden; background: #6b3c1c; }
.bac-canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
.bac-canvas:active { cursor: grabbing; }
.bac-canvas:focus-visible { outline-offset: -5px; }

.bac-chip {
  position: absolute;
  left: 50%;
  top: 1.4rem;
  transform: translateX(-50%);
  max-width: calc(100% - 2rem);
  padding: 0.35rem 0.95rem;
  background: rgba(255, 253, 249, 0.94);
  border: 2px solid var(--ink);
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.92rem;
  text-align: center;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.bac-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-left: 2px solid var(--ink);
  background: var(--paper);
}

.bac-onit { padding: 1.2rem 1rem 0.7rem; border-bottom: 2px dashed rgba(58, 30, 20, 0.25); }
.bac-onit h3, .bac-row h3 { font-size: 0.95rem; font-weight: 800; }
.bac-onit-head { display: flex; justify-content: space-between; align-items: baseline; gap: 0.5rem; }
.bac-count { font-size: 0.85rem; font-weight: 700; color: var(--ink-soft); }
.bac-chips { list-style: none; display: flex; flex-wrap: wrap; gap: 0.4rem; min-height: 2.1rem; margin-top: 0.45rem; }
.bac-empty { color: var(--ink-soft); font-size: 0.9rem; align-self: center; }
.bac-chips button {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.22rem 0.5rem 0.22rem 0.7rem;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  background: var(--paper-deep);
  color: var(--ink);
  font: 700 0.86rem var(--font-body);
  cursor: pointer;
}
.bac-chips button:hover { background: #ffe9c4; }
.bac-chips button span[aria-hidden] { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--ink); color: var(--paper); font-size: 0.75rem; line-height: 1; }
@media (prefers-reduced-motion: no-preference) {
  .bac-chips li { animation: chip-in 0.3s cubic-bezier(0.3, 1.6, 0.5, 1) both; }
}
@keyframes chip-in { from { transform: scale(0.4); opacity: 0; } to { transform: none; opacity: 1; } }
.bac-note { margin-top: 0.4rem; font-size: 0.88rem; font-weight: 600; color: var(--fraise-deep); }

.bac-tabs { display: none; }

.bac-rows { flex: 1; min-height: 0; overflow-y: auto; padding: 0.4rem 1rem 1rem; overscroll-behavior: contain; }
.bac-row { padding-top: 0.75rem; }
.bac-items { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 0.45rem; margin-top: 0.4rem; }

.bac-item {
  display: grid;
  justify-items: center;
  gap: 0.1rem;
  width: 100%;
  padding: 0.3rem 0.2rem 0.4rem;
  border: 2px solid var(--ink);
  border-radius: 16px;
  background: var(--paper);
  box-shadow: 0 3px 0 var(--ink);
  color: var(--ink);
  font: 700 0.78rem/1.2 var(--font-body);
  text-align: center;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}
.bac-item img { width: 56px; height: 56px; pointer-events: none; }
.bac-item:hover { background: #fff6e6; transform: translateY(-1px); box-shadow: 0 4px 0 var(--ink); }
.bac-item:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.bac-item[aria-pressed="true"] { background: var(--butter); }
.bac-item[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; }

.bac-actions { display: flex; gap: 0.6rem; padding: 0.8rem 1rem calc(0.9rem + env(safe-area-inset-bottom)); border-top: 2px solid var(--ink); background: var(--paper); }
.bac-actions .btn { flex: 1; text-align: center; }
.bac-actions .btn[disabled] { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: 0 4px 0 var(--ink); }

.bac-ghost {
  position: fixed;
  z-index: 400;
  width: 64px;
  height: 64px;
  margin: -32px 0 0 -32px;
  pointer-events: none;
  filter: drop-shadow(0 6px 0 rgba(58, 30, 20, 0.35));
  transition: transform 0.12s ease;
}
.bac-ghost.over { transform: scale(1.25); }

.bac-result {
  position: absolute;
  left: 50%;
  bottom: 1.1rem;
  transform: translateX(-50%);
  width: min(calc(100% - 2rem), 460px);
  z-index: 8;
}
.bac-result .play-card { width: 100%; display: grid; gap: 0.2rem; }
.bac-result-photo { width: 100%; max-height: 150px; object-fit: cover; border: 2px solid var(--ink); border-radius: 16px; margin: 0.4rem 0; }
.bac-result-price { font-weight: 800; color: var(--fraise); }
.bac-result-sub { color: var(--ink-soft); font-weight: 600; font-size: 0.95rem; }
.bac-result-best { font-size: 0.88rem; font-weight: 700; color: var(--myrtille); }

@media (max-width: 820px) {
  .bac { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; }
  .bac-panel { border-left: 0; border-top: 2px solid var(--ink); max-height: 50%; min-height: 0; min-width: 0; }
  .game-body .bac-panel { max-height: none; height: clamp(250px, 44dvh, 360px); }
  .bac-onit { padding: 0.6rem 0.9rem 0.45rem; }
  .bac-chips { min-height: 1.9rem; flex-wrap: nowrap; overflow-x: auto; margin-top: 0.3rem; padding-bottom: 0.2rem; }
  .bac-chips li { flex: none; }
  .bac-tabs { display: flex; gap: 0.35rem; padding: 0.5rem 0.9rem 0; }
  .bac-tabs button {
    flex: 1;
    padding: 0.3rem 0.2rem;
    border: 1.5px solid var(--ink);
    border-radius: 999px;
    background: var(--paper);
    color: var(--ink);
    font: 800 0.82rem var(--font-body);
    cursor: pointer;
  }
  .bac-tabs button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
  .bac-rows { padding: 0.2rem 0.9rem 0.6rem; }
  .bac-row { padding-top: 0.45rem; }
  .bac-row h3 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .bac-row.is-hidden-tab { display: none; }
  .bac-items { grid-template-columns: repeat(auto-fill, minmax(66px, 1fr)); gap: 0.4rem; }
  .bac-item img { width: 46px; height: 46px; }
  .bac-item { font-size: 0.72rem; border-radius: 14px; }
  .bac-actions { padding: 0.55rem 0.9rem calc(0.6rem + env(safe-area-inset-bottom)); }
  .bac-actions .btn { padding: 0.6rem 1rem; }
  .bac-chip { top: 1.1rem; font-size: 0.8rem; padding: 0.25rem 0.7rem; }
  .bac-result { bottom: 0.7rem; }
  .bac-result .play-card { padding: 0.9rem 1rem 1rem; }
  .bac-result-photo { max-height: 96px; }
}

/* ---------- Drizzle Master ---------- */
.dm { position: absolute; inset: 0; background: #6b3c1c; }
.dm-canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: crosshair; }

.dm-hud {
  position: absolute;
  top: 1.3rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.35rem 0.5rem 0.35rem 1rem;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 999px;
  box-shadow: 0 3px 0 var(--ink);
  white-space: nowrap;
  pointer-events: none;
}
.dm-round { font-weight: 800; }
.dm-pattern { color: var(--ink-soft); font-weight: 600; }
.dm-total { display: inline-flex; align-items: center; gap: 0.2rem; padding: 0.1rem 0.55rem; border-radius: 999px; background: var(--butter); border: 1.5px solid var(--ink); font-weight: 800; }
.dm-total svg { width: 16px; height: 16px; fill: var(--paper); stroke: var(--ink); stroke-width: 2; }

.dm-bottom {
  position: absolute;
  left: 50%;
  bottom: calc(1rem + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 0.7rem;
  width: max-content;
  max-width: calc(100% - 1.5rem);
}
.dm-tip { padding: 0.35rem 0.9rem; border-radius: 999px; background: rgba(255, 253, 249, 0.94); border: 2px solid var(--ink); font-weight: 700; font-size: 0.92rem; }
.dm-bottom .btn[disabled] { opacity: 0.5; cursor: not-allowed; }

.dm-card-wrap { position: absolute; inset: 0; display: grid; place-items: center; padding: 1rem; background: rgba(43, 22, 14, 0.25); z-index: 8; }
.dm-word { font-family: var(--font-hand); color: var(--fraise); font-size: 1.2rem; line-height: 1.8; }
.dm-detail { color: var(--ink-soft); font-weight: 600; font-size: 0.95rem; }

@media (max-width: 600px) {
  .dm-hud { top: 1.1rem; gap: 0.4rem; padding-left: 0.8rem; font-size: 0.85rem; }
  .dm-pattern { display: none; }
  .dm-tip { font-size: 0.8rem; padding: 0.3rem 0.7rem; }
  .dm-bottom { gap: 0.45rem; }
  .dm-bottom .btn { padding: 0.55rem 1rem; font-size: 0.9rem; }
}

/* ---------- Berry Catch ---------- */
.bc { position: absolute; inset: 0; background: var(--lagoon); user-select: none; -webkit-user-select: none; }
.bc-canvas { display: block; width: 100%; height: 100%; touch-action: none; }

.bc-hud {
  position: absolute;
  top: 1.5rem;
  left: 0.9rem;
  right: 0.9rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  pointer-events: none;
}
.bc-pill {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
  padding: 0.2rem 0.95rem;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 999px;
  box-shadow: 0 3px 0 var(--ink);
  font-weight: 700;
}
.bc-num { font-family: var(--font-show); font-size: 1.55rem; line-height: 1.2; font-variant-numeric: tabular-nums; }
.bc-time.is-low { background: var(--fraise); color: #fff; }
.bc-streak { position: absolute; left: 50%; top: 0; transform: translateX(-50%); font-family: var(--font-hand); color: var(--ink); font-size: 1.1rem; line-height: 2; white-space: nowrap; }

.bc-overlay { position: absolute; inset: 0; display: grid; place-items: center; padding: 1rem; background: rgba(43, 22, 14, 0.3); z-index: 8; }
.bc-legend { list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.45rem 1rem; margin: 0.9rem 0 0.4rem; text-align: left; }
.bc-legend li { display: flex; align-items: center; gap: 0.5rem; font-weight: 700; }
.bc-legend img { width: 34px; height: 34px; flex: none; }
.bc-legend b { margin-left: auto; font-family: var(--font-show); font-weight: 400; color: var(--fraise); }
.bc-how { color: var(--ink-soft); font-weight: 600; font-size: 0.95rem; margin-top: 0.5rem; }
.bc-big { font-family: var(--font-show); font-size: clamp(2.8rem, 12vw, 4rem); line-height: 1.05; color: var(--fraise); text-shadow: 0.04em 0.05em 0 var(--ink); }

/* ---------- Memory Match ---------- */
.mm {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: var(--wood, #2b160e) 0 0 / 720px 360px, #2b160e;
}
.mm::before { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 40%, transparent 35%, rgba(43, 22, 14, 0.38)); pointer-events: none; }

.mm-top {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.6rem 1rem;
  padding: 1.4rem 0.9rem 0.4rem;
}

.mm-sizes { display: flex; gap: 0.35rem; border: 0; padding: 0.25rem; background: var(--paper); border: 2px solid var(--ink); border-radius: 999px; box-shadow: 0 3px 0 var(--ink); }
.mm-size { position: relative; cursor: pointer; }
.mm-size input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.mm-size span { display: block; padding: 0.2rem 0.8rem; border-radius: 999px; font-weight: 800; font-size: 0.9rem; }
.mm-size small { font-weight: 600; color: var(--ink-soft); font-size: 0.78rem; }
.mm-size input:checked + span { background: var(--ink); color: var(--paper); }
.mm-size input:checked + span small { color: rgba(255, 253, 249, 0.75); }
.mm-size input:focus-visible + span { outline: 3px solid var(--fraise); outline-offset: 2px; }

.mm-stats { display: flex; gap: 0.5rem; }
.mm-stat { padding: 0.2rem 0.8rem; background: var(--paper); border: 2px solid var(--ink); border-radius: 999px; box-shadow: 0 3px 0 var(--ink); font-weight: 700; font-size: 0.9rem; }
.mm-stat b { font-variant-numeric: tabular-nums; font-weight: 900; }

.mm-boardwrap { position: relative; z-index: 1; flex: 1; min-height: 0; display: grid; place-items: center; padding: 0.6rem 0.75rem calc(1rem + env(safe-area-inset-bottom)); }

.mm-board {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(var(--cols, 4), var(--card-w, 120px));
  gap: var(--gap, 12px);
}

.mm-cell { width: var(--card-w, 120px); }

.mm-card {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  perspective: 900px;
  border-radius: 12px;
  -webkit-tap-highlight-color: transparent;
}
.mm-card:focus-visible { outline: 3px solid var(--butter); outline-offset: 4px; }

.mm-shadow {
  position: absolute;
  left: 6%; right: 6%; bottom: -7px;
  height: 22%;
  border-radius: 50%;
  background: rgba(20, 8, 4, 0.5);
  filter: blur(6px);
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.mm-inner { position: absolute; inset: 0; transform-style: preserve-3d; }
.mm-card.is-up .mm-inner { transform: rotateY(180deg); }

.mm-face {
  position: absolute;
  inset: 0;
  border: 2px solid var(--ink);
  border-radius: 12px;
  overflow: hidden;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

.mm-back {
  display: grid;
  place-items: center;
  transform: translateZ(2.5px);
  background:
    radial-gradient(circle, rgba(255, 253, 249, 0.3) 0 2px, transparent 2.5px) 0 0 / 14px 14px,
    var(--lagoon);
  box-shadow: inset 0 0 0 5px var(--lagoon), inset 0 0 0 7px rgba(255, 253, 249, 0.8);
}
.mm-badge { width: 58%; height: auto; filter: drop-shadow(0 3px 0 rgba(58, 30, 20, 0.55)); }

.mm-front {
  display: flex;
  flex-direction: column;
  background: var(--paper);
  transform: rotateY(180deg) translateZ(2.5px);
}
.mm-front img { display: block; width: 100%; flex: 1; min-height: 0; object-fit: cover; border-bottom: 2px solid var(--ink); }
.mm-name {
  display: grid;
  place-items: center;
  height: 26%;
  padding: 0 0.3rem;
  font-weight: 800;
  font-size: clamp(0.58rem, calc(var(--card-w, 120px) * 0.085), 0.95rem);
  line-height: 1.15;
  text-align: center;
}
.mm-card.is-matched .mm-name { font-family: var(--font-hand); font-weight: 400; color: var(--fraise); line-height: 1.3; font-size: clamp(0.5rem, calc(var(--card-w, 120px) * 0.072), 0.85rem); }

.mm-edge { position: absolute; top: 10px; bottom: 10px; width: 5px; background: var(--espresso); }
.mm-edge-l { left: -2.5px; transform: rotateY(90deg); }
.mm-edge-r { right: -2.5px; transform: rotateY(90deg); }

.mm-card.is-matched { cursor: default; }

.mm-result { position: absolute; inset: 0; z-index: 8; display: grid; place-items: center; padding: 1rem; background: rgba(43, 22, 14, 0.3); }
.mm-result-line { font-weight: 700; font-size: 1.05rem; margin-top: 0.3rem; }
.mm-result-best { color: var(--myrtille); font-weight: 800; font-size: 0.92rem; margin-top: 0.2rem; }

@media (prefers-reduced-motion: no-preference) {
  .mm:not(.is-reduced) .mm-card.anim-up .mm-inner { animation: mm-up 0.46s cubic-bezier(0.3, 0.7, 0.35, 1) both; }
  .mm:not(.is-reduced) .mm-card.anim-down .mm-inner { animation: mm-down 0.42s cubic-bezier(0.3, 0.7, 0.35, 1) both; }
  .mm:not(.is-reduced) .mm-card.anim-up .mm-shadow, .mm:not(.is-reduced) .mm-card.anim-down .mm-shadow { animation: mm-lift-shadow 0.44s ease both; }
  .mm:not(.is-reduced) .mm-card.anim-hop .mm-inner { animation: mm-hop 0.55s cubic-bezier(0.3, 1.5, 0.5, 1) both; }
  .mm:not(.is-reduced) .mm-card.anim-wave .mm-inner { animation: mm-wave 0.7s ease-in-out calc(var(--d, 0) * 55ms) both; }
  .mm:not(.is-reduced) .mm-cell.anim-deal { animation: mm-deal 0.5s cubic-bezier(0.3, 1.3, 0.5, 1) calc(var(--d, 0) * 35ms) both; }
}

@keyframes mm-up {
  0% { transform: translateZ(0) rotateY(0); }
  45% { transform: translateZ(70px) rotateY(100deg); }
  82% { transform: translateZ(8px) rotateY(186deg); }
  100% { transform: translateZ(0) rotateY(180deg); }
}
@keyframes mm-down {
  0% { transform: translateZ(0) rotateY(180deg); }
  45% { transform: translateZ(60px) rotateY(80deg); }
  82% { transform: translateZ(6px) rotateY(-5deg); }
  100% { transform: translateZ(0) rotateY(0); }
}
@keyframes mm-lift-shadow { 45% { transform: scale(0.8) translateY(8px); opacity: 0.35; } }
@keyframes mm-hop {
  0% { transform: rotateY(180deg); }
  35% { transform: translateY(-18%) translateZ(30px) rotateY(180deg); }
  70% { transform: translateY(2%) rotateY(180deg) scale(1.02, 0.97); }
  100% { transform: rotateY(180deg); }
}
@keyframes mm-wave {
  0%, 100% { transform: rotateY(180deg); }
  40% { transform: translateY(-14%) rotateY(180deg) rotateZ(-4deg); }
  70% { transform: translateY(3%) rotateY(180deg) rotateZ(2deg); }
}
@keyframes mm-deal { from { opacity: 0; transform: translateY(-30px) rotate(-6deg) scale(0.9); } to { opacity: 1; transform: none; } }

/* Reduce Motion: cards cross-fade instead of turning over */
.mm.is-reduced .mm-inner { transform: none !important; }
.mm.is-reduced .mm-front { transform: translateZ(2.5px); opacity: 0; transition: opacity 0.2s ease; }
.mm.is-reduced .mm-back { transition: opacity 0.2s ease; }
.mm.is-reduced .mm-card.is-up .mm-front { opacity: 1; }
.mm.is-reduced .mm-card.is-up .mm-back { opacity: 0; }
.mm.is-reduced .mm-edge { display: none; }

@media (max-width: 600px) {
  .mm-top { padding-top: 1.15rem; gap: 0.45rem; }
  .mm-size span { padding: 0.15rem 0.6rem; font-size: 0.82rem; }
  .mm-size small { display: none; }
  .mm-stat { font-size: 0.82rem; padding: 0.15rem 0.6rem; }
  .mm-face, .mm-card { border-radius: 9px; }
}

/* ---------- Griddle Flip ---------- */
.tile-griddle { --tile-bg: var(--wash); }
@media (prefers-reduced-motion: no-preference) {
  .icon-griddle .tg-crepe { transform-box: fill-box; transform-origin: center; }
  .play-tile:hover .icon-griddle .tg-crepe, .play-tile:focus-visible .icon-griddle .tg-crepe { animation: tile-flip 0.9s cubic-bezier(0.4, 0, 0.3, 1) both; }
}
@keyframes tile-flip {
  0% { transform: translateY(0) rotateX(0); }
  45% { transform: translateY(-26px) rotateX(120deg) scaleY(0.6); }
  100% { transform: translateY(0) rotateX(180deg); }
}

.gf { position: absolute; inset: 0; background: #6b3c1c; user-select: none; -webkit-user-select: none; }
.gf-canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: crosshair; }

.gf-hud {
  position: absolute;
  top: 1.3rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.35rem 0.5rem 0.35rem 1rem;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 999px;
  box-shadow: 0 3px 0 var(--ink);
  white-space: nowrap;
  pointer-events: none;
}
.gf-round { font-weight: 800; }
.gf-step { color: var(--ink-soft); font-weight: 600; }
.gf-total { display: inline-flex; align-items: center; gap: 0.2rem; padding: 0.1rem 0.55rem; border-radius: 999px; background: var(--butter); border: 1.5px solid var(--ink); font-weight: 800; }
.gf-total svg { width: 16px; height: 16px; fill: var(--paper); stroke: var(--ink); stroke-width: 2; }

/* the doneness bar: pale batter to gold to scorched, the golden band marked */
.gf-meter {
  position: absolute;
  top: 4.4rem;
  left: 50%;
  transform: translateX(-50%);
  width: min(72%, 340px);
  height: 20px;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 999px;
  box-shadow: 0 3px 0 var(--ink);
  overflow: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.gf-meter-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: linear-gradient(90deg, #f7e7b9, var(--butter) 62%, #9a5a1e); }
.gf-meter-band {
  position: absolute;
  top: 0;
  bottom: 0;
  border-left: 2px solid var(--ink);
  border-right: 2px solid var(--ink);
  background: repeating-linear-gradient(45deg, rgba(255, 253, 249, 0.5) 0 5px, transparent 5px 10px);
}

.gf-bottom {
  position: absolute;
  left: 50%;
  bottom: calc(1rem + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.6rem;
  width: max-content;
  max-width: calc(100% - 1.5rem);
}
.gf-tip { padding: 0.35rem 0.9rem; border-radius: 999px; background: rgba(255, 253, 249, 0.94); border: 2px solid var(--ink); font-weight: 700; font-size: 0.92rem; }
.gf-bottom .btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.gf-bottom .btn { touch-action: none; }
.gf-bottom .btn.is-held { background: var(--butter); transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }

.gf-card-wrap { position: absolute; inset: 0; display: grid; place-items: center; padding: 1rem; background: rgba(43, 22, 14, 0.25); z-index: 8; }
.gf-word { font-family: var(--font-hand); color: var(--fraise); font-size: 1.2rem; line-height: 1.8; }
.gf-breakdown { list-style: none; display: grid; gap: 0.3rem; margin: 0.7rem 0 0.1rem; text-align: left; }
.gf-breakdown li { display: flex; justify-content: space-between; gap: 1rem; padding: 0.2rem 0.8rem; border: 1.5px solid var(--ink); border-radius: 999px; background: var(--paper-deep); font-weight: 700; font-size: 0.93rem; }
.gf-breakdown b { font-weight: 800; color: var(--myrtille); }
.gf-menu { margin-top: 0.7rem; color: var(--ink-soft); font-weight: 600; font-size: 0.95rem; }

@media (max-width: 600px) {
  .gf-hud { top: 1.1rem; gap: 0.4rem; padding-left: 0.8rem; font-size: 0.85rem; }
  .gf-step { display: none; }
  .gf-meter { top: 3.9rem; }
  .gf-tip { font-size: 0.8rem; padding: 0.3rem 0.7rem; }
  .gf-bottom .btn { padding: 0.55rem 1rem; font-size: 0.9rem; }
}

/* ---------- Waffle Stack ---------- */
.tile-waffle { --tile-bg: var(--paper-deep); }
@media (prefers-reduced-motion: no-preference) {
  .icon-waffle .tw-hang { transform-box: view-box; transform-origin: 112px 5px; }
  .play-tile:hover .icon-waffle .tw-hang, .play-tile:focus-visible .icon-waffle .tw-hang { animation: tile-sway 1.3s ease-in-out infinite alternate; }
}
@keyframes tile-sway { from { transform: rotate(-10deg); } to { transform: rotate(10deg); } }

.ws { position: absolute; inset: 0; background: #6b3c1c; user-select: none; -webkit-user-select: none; }
.ws-canvas { display: block; width: 100%; height: 100%; touch-action: manipulation; cursor: pointer; }

.ws-hud {
  position: absolute;
  top: 1.3rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.35rem 1rem;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 999px;
  box-shadow: 0 3px 0 var(--ink);
  white-space: nowrap;
  pointer-events: none;
}
.ws-count { font-weight: 800; }
.ws-best { color: var(--ink-soft); font-weight: 600; }

.ws-bottom {
  position: absolute;
  left: 50%;
  bottom: calc(1rem + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.6rem;
  width: max-content;
  max-width: calc(100% - 1.5rem);
}
.ws-tip { padding: 0.35rem 0.9rem; border-radius: 999px; background: rgba(255, 253, 249, 0.94); border: 2px solid var(--ink); font-weight: 700; font-size: 0.92rem; }
.ws-bottom .btn[disabled] { opacity: 0.5; cursor: not-allowed; }

/* "Perfect!", "+1" and "Timber!" pop up over the tower and float away */
.ws-burst { position: absolute; left: 50%; top: 30%; width: 0; height: 0; pointer-events: none; z-index: 5; }
.ws-pop {
  position: absolute;
  left: 0;
  top: 0;
  font-family: var(--font-hand);
  font-size: 1.6rem;
  color: var(--paper);
  text-shadow: 0 2px 0 var(--ink), 0 0 14px rgba(43, 22, 14, 0.45);
  white-space: nowrap;
  animation: ws-pop 1.1s ease-out both;
}
.ws-pop.is-perfect { color: var(--butter); font-size: 2rem; }
.ws-pop.is-timber { color: var(--fraise); font-size: 2.5rem; }
@keyframes ws-pop {
  0% { opacity: 0; transform: translate(-50%, 14px) scale(0.7); }
  20% { opacity: 1; transform: translate(-50%, 0) scale(1.08); }
  100% { opacity: 0; transform: translate(-50%, -46px) scale(1); }
}
@keyframes ws-fade { 0%, 60% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; transform: translate(-50%, 0); } }

.ws-card-wrap { position: absolute; inset: 0; display: grid; place-items: center; padding: 1rem; background: rgba(43, 22, 14, 0.25); z-index: 8; }
.ws-word { font-family: var(--font-hand); color: var(--fraise); font-size: 1.25rem; line-height: 1.8; }
.ws-note { margin-top: 0.25rem; color: var(--ink-soft); font-weight: 600; font-size: 0.95rem; }
.ws-note.is-best { color: var(--fraise); font-weight: 800; }
.ws-dish {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0.5rem auto 0.2rem;
  padding: 0.4rem 0.9rem 0.4rem 0.4rem;
  max-width: 20rem;
  border: 2px solid var(--ink);
  border-radius: 14px;
  background: var(--paper-deep);
  color: var(--ink);
  text-decoration: none;
  text-align: left;
  box-shadow: 0 3px 0 var(--ink);
  transition: transform 0.15s ease;
}
.ws-dish:hover, .ws-dish:focus-visible { transform: translateY(-2px); }
.ws-dish img { flex: none; width: 56px; height: 56px; object-fit: cover; border-radius: 10px; border: 1.5px solid var(--ink); }
.ws-dish-text { display: grid; gap: 0.1rem; }
.ws-dish-text small { color: var(--fraise); font-weight: 800; font-size: 0.9rem; }

@media (max-width: 600px) {
  .ws-hud { top: 1.1rem; font-size: 0.85rem; }
  .ws-tip { font-size: 0.8rem; padding: 0.3rem 0.7rem; }
  .ws-pop { font-size: 1.3rem; }
  .ws-pop.is-timber { font-size: 2rem; }
}

/* ---------- Order Up! ---------- */
.tile-order { --tile-bg: var(--wash); }
@media (prefers-reduced-motion: no-preference) {
  .icon-order .to-bell { transform-box: fill-box; transform-origin: 50% 100%; }
  .play-tile:hover .icon-order .to-bell, .play-tile:focus-visible .icon-order .to-bell { animation: tile-ring 0.7s ease-in-out both; }
}
@keyframes tile-ring { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(-14deg); } 45% { transform: rotate(12deg); } 70% { transform: rotate(-7deg); } }

.ou { position: absolute; inset: 0; background: #6b3c1c; user-select: none; -webkit-user-select: none; }
.ou-canvas { display: block; width: 100%; height: 100%; }

/* the rail across the top, tickets clipped to it */
.ou-top { position: absolute; left: 0; right: 0; top: 0.8rem; display: grid; justify-items: center; gap: 0.5rem; padding: 0 0.75rem; pointer-events: none; }
.ou-hud { display: flex; align-items: center; gap: 0.7rem; padding: 0.3rem 0.9rem; background: var(--paper); border: 2px solid var(--ink); border-radius: 999px; box-shadow: 0 3px 0 var(--ink); font-weight: 800; white-space: nowrap; }
.ou-stars { display: inline-flex; align-items: center; gap: 0.15rem; padding: 0.05rem 0.55rem; border-radius: 999px; background: var(--butter); border: 1.5px solid var(--ink); }
.ou-rail {
  list-style: none;
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  min-height: 1rem;
  max-width: 100%;
  padding: 0.55rem 0.6rem 0;
  border-top: 5px solid var(--ink);
  border-radius: 3px;
}
.ou-ticket {
  position: relative;
  width: 11.5rem;
  padding: 0.45rem 0.6rem 0.8rem;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 4px 4px 0 0;
  box-shadow: 0 3px 0 rgba(43, 22, 14, 0.35);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 6px), 92% 100%, 84% calc(100% - 6px), 76% 100%, 68% calc(100% - 6px), 60% 100%, 52% calc(100% - 6px), 44% 100%, 36% calc(100% - 6px), 28% 100%, 20% calc(100% - 6px), 12% 100%, 4% calc(100% - 6px), 0 100%);
  transform-origin: 50% 0;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.ou-ticket:not(.is-current) { transform: scale(0.9); opacity: 0.85; }
.ou-ticket.is-current { background: #fffaf0; }
.ou-ticket.is-current::before { content: ""; position: absolute; left: 50%; top: -9px; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; background: var(--fraise); border: 2px solid var(--ink); }
.ou-ticket-n { font-size: 0.72rem; font-weight: 800; color: var(--ink-soft); }
.ou-ticket-dish { display: block; font-family: var(--font-show); font-weight: 400; font-size: 1.05rem; line-height: 1.15; color: var(--ink); }
.ou-patience { display: block; height: 7px; margin: 0.35rem 0 0.4rem; border: 1.5px solid var(--ink); border-radius: 999px; background: var(--paper-deep); overflow: hidden; }
.ou-patience-fill { display: block; height: 100%; width: 100%; background: var(--leaf); }
.ou-ticket.is-low .ou-patience-fill { background: var(--butter); }
.ou-ticket.is-late { border-color: var(--fraise); }
.ou-ticket.is-late .ou-ticket-n::after { content: " · late"; color: var(--fraise); }
.ou-needs { list-style: none; display: grid; gap: 0.15rem; }
.ou-needs li { display: flex; align-items: center; gap: 0.35rem; font-size: 0.82rem; font-weight: 700; color: var(--ink); }
.ou-needs img { width: 22px; height: 22px; flex: none; }
.ou-needs li.is-done { color: var(--ink-soft); text-decoration: line-through; text-decoration-thickness: 2px; }
.ou-needs li.is-done::after { content: "✓"; margin-left: auto; color: var(--leaf); font-weight: 900; text-decoration: none; }
.ou-stamp { position: absolute; inset: 30% 0 auto; text-align: center; font-size: 1.9rem; color: var(--butter); text-shadow: 0 2px 0 var(--ink); transform: rotate(-8deg); }

@media (prefers-reduced-motion: no-preference) {
  .ou-ticket.is-new { animation: ou-clip 0.45s cubic-bezier(0.3, 1.5, 0.5, 1) both; }
  .ou-ticket.is-late { animation: ou-wobble 1.4s ease-in-out infinite; }
  .ou-ticket.is-shake { animation: ou-shake 0.4s ease both; }
  .ou-ticket.is-served { animation: ou-away 0.9s ease-in both; }
  .ou-item.is-bounced { animation: ou-shake 0.4s ease both; }
}
@keyframes ou-clip { from { transform: translateY(-40px) rotate(-6deg); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes ou-wobble { 0%, 100% { rotate: 0deg; } 50% { rotate: 1.5deg; } }
@keyframes ou-shake { 0%, 100% { translate: 0; } 20% { translate: -6px; } 45% { translate: 6px; } 70% { translate: -3px; } }
@keyframes ou-away { 0%, 45% { transform: none; opacity: 1; } 100% { transform: translateY(-60px) rotate(8deg); opacity: 0; } }

.ou-note {
  position: absolute;
  left: 50%;
  bottom: calc(13.2rem + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  max-width: calc(100% - 2rem);
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  background: rgba(255, 253, 249, 0.95);
  border: 2px solid var(--ink);
  font-weight: 700;
  font-size: 0.9rem;
  text-align: center;
  pointer-events: none;
}
.ou-burst { position: absolute; left: 50%; top: 45%; width: 0; height: 0; pointer-events: none; z-index: 5; }
.ou-pop {
  position: absolute;
  left: 0;
  top: 0;
  font-family: var(--font-show);
  font-size: 2.4rem;
  color: var(--butter);
  white-space: nowrap;
  text-shadow: 0 3px 0 var(--ink), 0 0 16px rgba(43, 22, 14, 0.45);
  animation: ws-pop 1.2s ease-out both;
}

/* the tray */
.ou-tray {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(100%, 46rem);
  padding: 0.6rem 0.8rem calc(0.8rem + env(safe-area-inset-bottom));
  background: var(--paper);
  border: 2px solid var(--ink);
  border-bottom: 0;
  border-radius: 20px 20px 0 0;
}
.ou-tabs { display: flex; gap: 0.35rem; }
.ou-tab {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.35rem 0.5rem;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  background: var(--paper-deep);
  color: var(--ink);
  font: inherit;
  font-weight: 800;
  font-size: 0.88rem;
  cursor: pointer;
}
.ou-tab[aria-selected="true"] { background: var(--ink); color: var(--paper); }
.ou-tab-dot { display: inline-grid; place-items: center; min-width: 1.25rem; height: 1.25rem; padding: 0 0.3rem; border-radius: 999px; background: var(--butter); color: var(--ink); border: 1.5px solid var(--ink); font-size: 0.75rem; }
.ou-items { grid-template-columns: repeat(5, minmax(0, 1fr)); margin-top: 0.55rem; }
.ou-item { position: relative; }
.ou-item.is-needed { background: #fff6e0; }
.ou-item.is-needed::after { content: ""; position: absolute; top: 5px; right: 5px; width: 12px; height: 12px; border-radius: 50%; background: var(--butter); border: 2px solid var(--ink); }
.ou-item[aria-pressed="true"] { background: #e7f3dc; }

.ou-card-wrap { position: absolute; inset: 0; display: grid; place-items: center; padding: 1rem; background: rgba(43, 22, 14, 0.25); z-index: 8; overflow-y: auto; }
.ou-word { font-family: var(--font-hand); color: var(--fraise); font-size: 1.25rem; line-height: 1.8; }
.ou-total { font-weight: 800; }
.ou-summary { list-style: none; display: grid; gap: 0.25rem; margin: 0.6rem 0 0.2rem; text-align: left; }
.ou-summary li { display: flex; justify-content: space-between; gap: 1rem; padding: 0.2rem 0.8rem; border: 1.5px solid var(--ink); border-radius: 999px; background: var(--paper-deep); font-weight: 700; font-size: 0.92rem; }
.ou-summary b { color: var(--butter); text-shadow: 0 1px 0 var(--ink); letter-spacing: 0.05em; }
.ou-note-best { color: var(--fraise); font-weight: 800; margin-top: 0.2rem; }

@media (max-width: 600px) {
  .ou-top { top: 0.5rem; gap: 0.3rem; }
  .ou-hud { font-size: 0.82rem; }
  .ou-rail { gap: 0.35rem; padding: 0.45rem 0.3rem 0; }
  .ou-ticket { width: 8.4rem; padding: 0.35rem 0.45rem 0.7rem; }
  .ou-ticket-dish { font-size: 0.9rem; }
  .ou-needs li { font-size: 0.72rem; gap: 0.25rem; }
  .ou-needs img { width: 16px; height: 16px; }
  .ou-tab { font-size: 0.78rem; padding: 0.3rem 0.35rem; }
  .ou-items { grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 0.3rem; }
  .ou-items .bac-item img { width: 44px; height: 44px; }
  .ou-note { bottom: calc(11.5rem + env(safe-area-inset-bottom)); font-size: 0.8rem; }
  .ou-pop { font-size: 1.9rem; }
}

/* ---------- Latte Art (shares Drizzle Master's HUD, tip and cards) ---------- */
.tile-latte { --tile-bg: #f6e7d3; }
@media (prefers-reduced-motion: no-preference) {
  .icon-latte .tl-jug { transform-box: view-box; transform-origin: 120px 30px; transition: transform 0.35s cubic-bezier(0.3, 1.5, 0.5, 1); }
  .play-tile:hover .icon-latte .tl-jug, .play-tile:focus-visible .icon-latte .tl-jug { transform: rotate(-9deg); }
}

.la-milk { display: inline-block; width: 4.2rem; height: 0.75rem; border: 1.5px solid var(--ink); border-radius: 999px; background: var(--paper-deep); overflow: hidden; }
.la-milk-fill { display: block; height: 100%; background: linear-gradient(#fffaf2, #ecd6bb); border-right: 1.5px solid var(--ink); transform-origin: 0 50%; }
.la .dm-bottom { flex-wrap: wrap; justify-content: center; }
.la-actions { display: flex; gap: 0.5rem; }
.la-card-wrap { overflow-y: auto; }

@media (max-width: 600px) {
  .la .dm-bottom { width: calc(100% - 1.5rem); }
  .la .dm-tip { flex-basis: 100%; text-align: center; }
  .la-milk { width: 3rem; }
}

@media (prefers-reduced-motion: reduce) {
  .play-tile, .gbtn, .bac-item { transition: none; }
  .ou-pop { animation: ws-fade 0.7s ease-out both; }
  .ou-ticket { transition: none; }
  .ws-pop { animation: ws-fade 0.7s ease-out both; }
  .ws-dish { transition: none; }
  .loading-crepe { animation: none; }
}
