/* Layout: game-show floor. Scoreboard rail | 10x10 board | shop counter; stacks to one column on phones.
   A single dark "stage at night" look, used in both host themes on purpose. */
:root {
  --bg: #1a1230;
  --panel: #251a45;
  --panel-2: #312359;
  --line: #4b3b7d;
  --fg: #fff4e2;
  --muted: #b9a9d8;
  --gold: #ffb627;
  --pink: #ff5d8f;
  --good: #80ed99;
  --bad: #ff7b7b;
  --chip: rgba(20, 12, 40, .86);
  --shade: rgba(10, 6, 24, .8);

  --display: 'Bungee', 'Arial Black', Impact, system-ui, sans-serif;
  --body: 'Fredoka', 'Trebuchet MS', system-ui, sans-serif;
  --mono: 'Chivo Mono', ui-monospace, Menlo, Consolas, monospace;

  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { background: var(--bg); color: var(--fg); }
body {
  margin: 0;
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.45;
  min-height: 100%;
  background:
    radial-gradient(ellipse 70% 45% at 50% 0%, rgba(255, 93, 143, .16), transparent 70%),
    radial-gradient(circle, rgba(255, 255, 255, .05) 1px, transparent 1.5px) 0 0 / 22px 22px,
    var(--bg);
}
button { font: inherit; color: inherit; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
/* Feel like an app: no rubber-band refresh, no text-selection or callout menus on game pieces */
html, body { overscroll-behavior-y: none; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { overflow-x: clip; }   /* the tornado spin must never make the page scroll sideways */
button, .board-wrap, .cheat-path, .players, .turn, .made-by, .modal h2, .standings {
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}

.install { display: grid; gap: 6px; }
.install-btn {
  justify-self: start;
  padding: 9px 14px;
  border-radius: 10px;
  border: 2px solid var(--muted);
  background: transparent;
  color: var(--fg);
  font-weight: 600;
  cursor: pointer;
}
.install-btn:hover { border-color: var(--gold); }
.install-tip { margin: 0; font-size: .85rem; color: var(--muted); }
.install-tip b { color: var(--fg); }
button:focus-visible, input:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
h1, h2, h3 { text-wrap: balance; margin: 0; }

.app {
  max-width: 1300px; margin: 0 auto;
  padding-inline: max(16px, env(safe-area-inset-left, 0px)) max(16px, env(safe-area-inset-right, 0px));
  padding-block: calc(18px + env(safe-area-inset-top, 0px)) calc(64px + env(safe-area-inset-bottom, 0px));
}

.made-by {
  position: fixed;
  right: calc(12px + env(safe-area-inset-right, 0px));
  bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  z-index: 40;
  padding: 5px 12px;
  border-radius: 99px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--muted);
  font: 600 .78rem var(--body);
  letter-spacing: .04em;
  box-shadow: 0 3px 10px rgba(0, 0, 0, .35);
  pointer-events: none;
}

/* ---------- header ---------- */
.top { text-align: center; display: grid; gap: 4px; margin-bottom: 18px; }
.logo {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(1.6rem, 5vw, 3.2rem);
  line-height: 1.05;
  letter-spacing: .01em;
  text-shadow: 0 4px 0 rgba(0, 0, 0, .35);
}
.rainbow-word span:nth-child(1) { color: #ff5d8f; }
.rainbow-word span:nth-child(2) { color: #ff9f1c; }
.rainbow-word span:nth-child(3) { color: #ffd23f; }
.rainbow-word span:nth-child(4) { color: #48cae4; }
.rainbow-word span:nth-child(5) { color: #80ed99; }
.boxed {
  display: inline-block;
  padding: 0 .25em;
  border: .09em solid var(--gold);
  border-radius: .12em;
  color: var(--gold);
  transform: rotate(-2deg);
}
.tag { margin: 0; color: var(--muted); font-size: 1.05rem; }
.tag strong { color: var(--fg); }

/* ---------- setup ---------- */
.setup { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 20px; max-width: 980px; margin: 0 auto; }
.setup-card, .rules { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 22px; min-width: 0; }
.setup-card { display: grid; gap: 18px; align-content: start; }
.setup-card h2 { font-family: var(--display); font-weight: 400; font-size: 1.5rem; color: var(--gold); }
.count-row { display: flex; gap: 8px; flex-wrap: wrap; }
.count {
  flex: 1 1 90px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 2px solid var(--line);
  background: var(--panel-2);
  font-weight: 600;
  cursor: pointer;
}
.count[aria-checked="true"] { border-color: var(--gold); background: var(--gold); color: var(--bg); }
.names { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.name-field { display: grid; gap: 4px; font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.name-field label::before { content: ""; display: inline-block; width: .7em; height: .7em; border-radius: 50%; background: var(--pc); margin-right: .45em; vertical-align: -.05em; }
.name-field input {
  font: 500 1rem var(--body);
  color: var(--fg);
  background: var(--bg);
  border: 2px solid var(--line);
  border-left: 6px solid var(--pc);
  border-radius: 10px;
  padding: 9px 10px;
  width: 100%;
  letter-spacing: 0;
  text-transform: none;
}
.name-field select {
  font: 500 .9rem var(--body);
  color: var(--fg);
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 8px;
  width: 100%;
  letter-spacing: 0;
  text-transform: none;
  cursor: pointer;
}

.ai-quick { display: grid; gap: 8px; padding-top: 14px; border-top: 1px dashed var(--line); }
.ai-quick-label { font-size: .85rem; color: var(--muted); }
.ai-quick-row { display: flex; gap: 8px; flex-wrap: wrap; }
.ai-btn {
  flex: 1 1 80px;
  font-family: var(--display);
  font-size: .95rem;
  padding: 10px 12px;
  border-radius: 12px;
  border: 2px solid var(--lvl);
  background: transparent;
  color: var(--lvl);
  cursor: pointer;
  transition: background .15s, color .15s;
}
.ai-btn:hover, .ai-btn:focus-visible { background: var(--lvl); color: var(--bg); }
.easy { --lvl: var(--good); }
.medium { --lvl: var(--gold); }
.hard { --lvl: var(--bad); }
.big-btn {
  font-family: var(--display);
  font-size: 1.15rem;
  padding: 14px 22px;
  border: 0;
  border-radius: 14px;
  background: var(--gold);
  color: var(--bg);
  cursor: pointer;
  box-shadow: 0 5px 0 #b87a00;
  transition: transform .1s, box-shadow .1s;
}
.big-btn:hover { transform: translateY(-1px); }
.big-btn:active { transform: translateY(4px); box-shadow: 0 1px 0 #b87a00; }
.big-btn:disabled { opacity: .5; cursor: default; transform: none; }

.rules h3 { font-family: var(--display); font-weight: 400; font-size: 1rem; color: var(--pink); margin-bottom: 8px; }
.rules ul { margin: 0 0 18px; padding-left: 1.1em; display: grid; gap: 6px; color: var(--muted); }
.rules ul:last-child { margin-bottom: 0; }
.rules b { color: var(--fg); }
.spec-list { list-style: none; padding-left: 0 !important; }
.spec-list li { display: grid; grid-template-columns: 1.8em auto; column-gap: 6px; }
.spec-list b { display: block; }
.spec-ico { grid-row: span 2; font-size: 1.3rem; line-height: 1.2; }

/* ---------- game layout ---------- */
.game { display: grid; grid-template-columns: 220px minmax(0, 1fr) 270px; gap: 20px; align-items: start; }
.players { display: grid; gap: 10px; }
.pcard {
  position: relative;
  background: var(--panel);
  border: 2px solid var(--line);
  border-radius: 16px;
  padding: 12px 14px 12px 20px;
  overflow: hidden;
  transition: transform .2s, border-color .2s;
}
.pcard::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 7px; background: var(--pc); }
.pcard.active { border-color: var(--pc); transform: scale(1.03); box-shadow: 0 0 0 4px color-mix(in srgb, var(--pc) 25%, transparent); }
.pname { font-weight: 600; display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.pscore { font: 700 1.35rem/1.2 var(--mono); font-variant-numeric: tabular-nums; margin-top: 2px; overflow-wrap: anywhere; }
.pneed { font-size: .8rem; color: var(--muted); }
.pneed.bang { color: var(--good); font-weight: 600; }
.pill { font-size: .7rem; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; padding: 2px 8px; border-radius: 99px; background: var(--pc); color: var(--bg); white-space: nowrap; }

.stage { min-width: 0; display: grid; gap: 12px; }
.banner { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 12px 16px; display: grid; gap: 4px; }
.turn { font-family: var(--display); font-size: clamp(1.05rem, 2.6vw, 1.5rem); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.turn .dot { width: .8em; height: .8em; border-radius: 50%; background: var(--pc); box-shadow: 0 0 12px var(--pc); }
.turn .who { color: var(--pc); }
.cpu-tag { font-size: .7rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--lvl); }
.turn .thinking { font: 600 .85rem var(--body); color: var(--muted); }
.turn .thinking i { font-style: normal; animation: blink 1.2s infinite; }
.turn .thinking i:nth-child(2) { animation-delay: .2s; }
.turn .thinking i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 100% { opacity: .2; } 50% { opacity: 1; } }
.turn .round { margin-left: auto; font: 600 .8rem var(--body); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.turn .round.final { color: var(--bg); background: var(--pink); padding: 2px 10px; border-radius: 99px; }
.result { margin: 0; color: var(--muted); min-height: 1.45em; }
.result b { color: var(--fg); }
.treat-bar { height: 6px; border-radius: 6px; background: var(--panel-2); overflow: hidden; }
.treat-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--pink), var(--gold)); animation: drain 3s linear forwards; }
@keyframes drain { from { width: 100%; } to { width: 0%; } }

.board-wrap {
  display: grid;
  grid-template-columns: 1.4em minmax(0, 1fr);
  grid-template-rows: 1.4em auto;
  gap: 4px;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
}
.col-labels, .row-labels { display: grid; font: 700 .72rem var(--mono); color: var(--muted); }
.col-labels { grid-template-columns: repeat(10, 1fr); gap: clamp(3px, .6vw, 6px); text-align: center; align-items: end; }
.row-labels { grid-template-rows: repeat(10, 1fr); gap: clamp(3px, .6vw, 6px); align-items: center; }
.board {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  grid-template-rows: repeat(10, minmax(0, 1fr));
  gap: clamp(3px, .6vw, 6px);
  aspect-ratio: 1;
  width: 100%;
  max-width: 100%;
}
.sq {
  position: relative;
  border: 0;
  padding: 0;
  border-radius: 18%;
  cursor: pointer;
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .28), inset 0 2px 0 rgba(255, 255, 255, .25), 0 2px 0 rgba(0, 0, 0, .4);
  transition: transform .12s ease, filter .2s;
  min-width: 0;
}
.sq:hover { transform: translateY(-2px) scale(1.07); z-index: 2; }
.board.locked .sq { cursor: default; }
.board.locked .sq:hover { transform: none; }
.sq .chip {
  position: absolute;
  inset: 10%;
  display: grid;
  place-items: center;
  background: var(--chip);
  color: var(--fg);
  border-radius: 6px;
  font: 700 clamp(6.5px, 1.25vw, 11.5px)/1 var(--mono);
  letter-spacing: -.02em;
  text-align: center;
  opacity: 0;
  transform: scale(.5);
  transition: opacity .2s, transform .2s;
  pointer-events: none;
  overflow: hidden;
}
.sq .chip.pos { color: var(--good); }
.sq .chip.neg { color: var(--bad); }
.sq .chip.spec { color: var(--gold); font-size: clamp(6px, 1vw, 9.5px); line-height: 1.15; }
.sq .chip .ico { display: block; font-size: 1.6em; }
.sq.show .chip { opacity: 1; transform: none; }
.sq.picked { animation: flip .5s ease; outline: 3px solid var(--fg); outline-offset: 1px; z-index: 3; }
@keyframes flip { 0% { transform: rotateY(0); } 50% { transform: rotateY(90deg) scale(1.15); } 100% { transform: rotateY(0) scale(1.1); } }
.sq.on-path { outline: 3px dashed var(--gold); outline-offset: 1px; z-index: 1; }
.sq.cool { filter: grayscale(1) brightness(.45); cursor: not-allowed; }
.sq.cool:hover { transform: none; }
.sq .cd {
  position: absolute; inset: 0; display: grid; place-items: center;
  font: 700 clamp(10px, 2vw, 18px)/1 var(--mono); color: var(--fg);
  text-shadow: 0 1px 3px rgba(0, 0, 0, .9); pointer-events: none;
}
.sq .cd:empty, .sq .step:empty { display: none; }
.sq .step {
  position: absolute; top: -6px; right: -6px; z-index: 2;
  min-width: 1.5em; height: 1.5em; padding: 0 .3em; border-radius: 99px;
  display: grid; place-items: center;
  background: var(--gold); color: var(--bg);
  font: 700 clamp(8px, 1.1vw, 11px)/1 var(--mono);
  box-shadow: 0 1px 0 rgba(0, 0, 0, .4); pointer-events: none;
}

/* ---------- cheat path ---------- */
.cheat-path {
  max-width: 1300px; margin: 0 auto 18px;
  background: linear-gradient(135deg, #3a1d4f, var(--panel));
  border: 2px solid var(--pink); border-radius: 18px; padding: 14px 16px;
  display: grid; grid-template-columns: minmax(0, 15rem) minmax(0, 1fr); gap: 16px; align-items: center;
}
.cp-head h2 { font-family: var(--display); font-weight: 400; font-size: 1.35rem; color: var(--pink); }
.cp-head p { margin: 2px 0 0; font-size: .85rem; color: var(--muted); }
.cp-head b { color: var(--fg); }
.cp-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.cp-step {
  display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto auto auto; column-gap: 8px; row-gap: 1px;
  align-items: center; background: var(--bg); border: 2px solid var(--gold); border-radius: 12px; padding: 8px 10px; min-width: 0;
}
.cp-step.hidden-step { border-style: dashed; border-color: var(--line); }
.cp-step.cooling { border-color: var(--line); opacity: .7; }
.cp-n { grid-column: 1 / -1; font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.cp-sq { grid-row: span 2; width: 1.9rem; height: 1.9rem; border-radius: 6px; box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .3); }
.cp-q { grid-row: span 2; width: 1.9rem; height: 1.9rem; border-radius: 6px; display: grid; place-items: center; background: var(--panel-2); font-family: var(--display); color: var(--muted); }
.cp-coord { font: 700 1rem/1.1 var(--mono); }
.cp-val { font: 700 .85rem/1.1 var(--mono); font-variant-numeric: tabular-nums; }
.cp-val.pos { color: var(--good); }
.cp-val.neg { color: var(--bad); }
.cp-note { grid-column: 1 / -1; font-size: .72rem; color: var(--muted); margin-top: 3px; }
.hidden-step .cp-note { grid-column: 2; margin-top: 0; }

.zero-btn {
  margin-top: 8px; width: 100%;
  font-size: .78rem; padding: 5px 8px; border-radius: 8px;
  background: transparent; border: 1px dashed var(--line); color: var(--muted); cursor: pointer;
}
.zero-btn:hover:not(:disabled) { border-color: var(--pc); color: var(--fg); }
.zero-btn:disabled { opacity: .4; cursor: default; }

/* ---------- sidebar ---------- */
.side { display: grid; gap: 14px; min-width: 0; }
.shop, .log-box { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 14px; display: grid; gap: 10px; }
.side h3 { font-family: var(--display); font-weight: 400; font-size: .95rem; color: var(--muted); letter-spacing: .04em; }
.shop-btn {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 10px;
  text-align: left;
  padding: 12px 14px;
  border-radius: 14px;
  border: 2px solid var(--line);
  background: var(--panel-2);
  cursor: pointer;
  transition: transform .1s, border-color .15s;
}
.shop-btn:hover:not(:disabled) { transform: translateY(-2px); border-color: var(--gold); }
.shop-btn:disabled { opacity: .45; cursor: not-allowed; }
.shop-name { font-family: var(--display); font-size: 1.05rem; }
.cheat .shop-name { color: var(--pink); }
.roll .shop-name { color: var(--good); }
.shop-cost { font: 700 .85rem var(--mono); color: var(--gold); align-self: center; }
.shop-desc { grid-column: 1 / -1; font-size: .82rem; color: var(--muted); }
.log { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; max-height: 280px; overflow-y: auto; font-size: .86rem; }
.log li { padding: 6px 8px 6px 10px; border-left: 4px solid var(--pc); background: var(--bg); border-radius: 0 8px 8px 0; color: var(--muted); }
.log li:first-child { color: var(--fg); }
.log .empty { border-left-color: var(--line); }
.link-btn { background: none; border: 0; color: var(--muted); text-decoration: underline; cursor: pointer; padding: 6px; justify-self: center; }
.link-btn:hover { color: var(--fg); }

/* ---------- overlays ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 50;
  background: var(--shade);
  display: flex;
  padding: calc(16px + env(safe-area-inset-top, 0px)) 16px calc(16px + env(safe-area-inset-bottom, 0px));
  overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
  backdrop-filter: blur(3px);
}
.modal {
  margin: auto;
  background: var(--panel);
  border: 2px solid var(--line);
  border-radius: 22px;
  padding: 22px;
  width: 100%;
  max-width: 420px;
  display: grid;
  gap: 12px;
  justify-items: center;
  text-align: center;
  animation: pop .35s cubic-bezier(.2, 1.4, .4, 1);
}
@keyframes pop { from { transform: scale(.7); opacity: 0; } }
.modal h2 { font-family: var(--display); font-weight: 400; font-size: 1.6rem; color: var(--gold); }
.modal-sub { margin: 0; color: var(--muted); }
.wheel-holder { position: relative; width: min(300px, 76vw); aspect-ratio: 1; max-width: 100%; }
.wheel-holder canvas { width: 100%; height: 100%; display: block; }
.wheel-pointer {
  position: absolute; left: 50%; top: -6px; transform: translateX(-50%); z-index: 2;
  width: 0; height: 0;
  border-left: 14px solid transparent; border-right: 14px solid transparent; border-top: 26px solid var(--fg);
  filter: drop-shadow(0 3px 0 rgba(0, 0, 0, .5));
}

.win-modal { max-width: 560px; }
.duck { width: min(300px, 100%); height: auto; }
.win-title { font-size: clamp(1.8rem, 6vw, 2.6rem) !important; color: var(--fg) !important; text-shadow: 0 4px 0 var(--pink); }
.standings { width: 100%; display: grid; gap: 8px; margin-top: 4px; }
.st-head, .st-row { display: grid; grid-template-columns: 4.2rem minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.st-head { font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding: 0 18px; }
.st-head span:last-child, .st-row .st-score { text-align: right; }
.st-row {
  padding: 8px 18px;
  background: linear-gradient(90deg, var(--pc) 0 10px, var(--panel-2) 10px);
  transform: skewX(-12deg);
  border-radius: 6px;
  animation: slide .5s cubic-bezier(.2, 1.2, .4, 1) both;
  animation-delay: var(--d);
}
.st-row > * { transform: skewX(12deg); }
.st-row.first { background: linear-gradient(90deg, var(--pc) 0 10px, #4a3a12 10px, var(--panel-2)); box-shadow: 0 0 0 2px var(--gold); }
@keyframes slide { from { transform: skewX(-12deg) translateX(60px); opacity: 0; } }
.st-place { font-family: var(--display); font-size: 1.7rem; font-style: italic; line-height: 1; text-align: left; -webkit-background-clip: text; background-clip: text; color: transparent; }
.st-place sup { font-size: .5em; }
.p1 { background-image: linear-gradient(180deg, #fff3a0, #ffb627 55%, #c77800); }
.p2 { background-image: linear-gradient(180deg, #ffffff, #c9d3e0 55%, #7d8a9c); }
.p3 { background-image: linear-gradient(180deg, #ffd0a6, #d98a4a 55%, #8a4a1c); }
.p4 { background-image: linear-gradient(180deg, #d0c6ff, #8f7fd6 55%, #4d3f94); }
.st-name { text-align: left; font-weight: 600; overflow-wrap: anywhere; }
.st-name small { display: block; font-weight: 400; color: var(--muted); font-size: .76rem; }
.st-score { font: 700 1rem var(--mono); font-variant-numeric: tabular-nums; }
.win-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; justify-content: center; margin-top: 6px; }

/* ---------- special-square list on the rules card ---------- */
.spec-note { margin: -2px 0 10px; font-size: .88rem; color: var(--muted); }
.spec-note b { color: var(--gold); }
.spec-list { grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); gap: 10px 14px !important; font-size: .86rem; }

/* ---------- big "you picked" card ---------- */
.overlay.reveal { cursor: pointer; z-index: 60; }
.rv-card {
  margin: auto;
  width: min(380px, 100%);
  background: var(--panel);
  border: 3px solid var(--gold);
  border-radius: 26px;
  padding: 20px;
  display: grid;
  justify-items: center;
  gap: 8px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .55);
  animation: pop .35s cubic-bezier(.2, 1.5, .4, 1);
}
.rv-who { font-family: var(--display); font-size: 1.05rem; color: var(--pc); display: flex; align-items: center; gap: 8px; }
.rv-dot { width: .7em; height: .7em; border-radius: 50%; background: var(--pc); box-shadow: 0 0 10px var(--pc); }
.rv-swatch {
  width: min(170px, 46vw); aspect-ratio: 1; max-width: 100%;
  border-radius: 22%;
  display: grid; place-items: center;
  box-shadow: inset 0 -6px 0 rgba(0, 0, 0, .28), inset 0 4px 0 rgba(255, 255, 255, .25), 0 6px 0 rgba(0, 0, 0, .4);
  animation: flip .6s ease;
}
.rv-swatch span {
  font: 700 clamp(1.8rem, 9vw, 2.6rem)/1 var(--display);
  color: var(--fg);
  background: var(--chip);
  padding: .15em .35em;
  border-radius: .3em;
}
.rv-name { font-size: .9rem; color: var(--muted); }
.rv-value { font: 700 clamp(2.6rem, 14vw, 4rem)/1 var(--mono); font-variant-numeric: tabular-nums; animation: pop .45s .15s cubic-bezier(.2, 1.6, .4, 1) both; }
.rv-value.pos { color: var(--good); }
.rv-value.neg { color: var(--bad); }
.rv-path { font-size: .8rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--gold); }
.rv-special { display: grid; gap: 4px; justify-items: center; animation: pop .45s .15s cubic-bezier(.2, 1.6, .4, 1) both; }
.rv-special .rv-ico { font-size: 3rem; line-height: 1; }
.rv-special b { font-family: var(--display); font-weight: 400; font-size: 1.45rem; color: var(--gold); text-wrap: balance; }
.rv-special p { margin: 0; color: var(--fg); max-width: 30ch; }
.rv-tap { font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-top: 4px; }

/* ---------- special-square pop-ups ---------- */
#fx { z-index: 55; }
.fx-modal { max-width: 460px; }
.fx-ico { font-size: 3.4rem; line-height: 1; animation: pop .45s cubic-bezier(.2, 1.6, .4, 1); }
.fx-ico.money { animation: pop .45s cubic-bezier(.2, 1.6, .4, 1), wobble 1s .45s ease-in-out infinite; }
@keyframes wobble { 0%, 100% { transform: rotate(-8deg) scale(1.05); } 50% { transform: rotate(8deg) scale(1.15); } }
.fx-text { color: var(--fg); max-width: 34ch; }
.fx-text b { color: var(--gold); }
.fx-small { margin: 0; font-size: .82rem; color: var(--muted); }
.fx-small a { color: var(--gold); }
.fx-scores { width: 100%; display: grid; gap: 6px; margin-top: 8px; }
.fx-score {
  display: flex; justify-content: space-between; gap: 10px; align-items: center;
  padding: 7px 12px 7px 14px; border-radius: 10px;
  background: var(--bg); border-left: 5px solid var(--pc);
  font-variant-numeric: tabular-nums; text-align: left;
}
.fx-score b { font-family: var(--mono); }
.fx-score.now { outline: 2px solid var(--gold); }
.claim { background: var(--good); box-shadow: 0 5px 0 #3c9d55; }
.roll-num { font: 700 3.4rem/1 var(--mono); color: var(--muted); font-variant-numeric: tabular-nums; }
.roll-num.final { color: var(--gold); animation: pop .4s cubic-bezier(.2, 1.6, .4, 1); }

.pots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; width: 100%; }
.pot {
  display: grid; justify-items: center; gap: 4px;
  padding: 12px 6px; border-radius: 16px;
  border: 2px solid var(--line); background: var(--panel-2);
  font-weight: 600; cursor: pointer;
  transition: transform .15s, border-color .15s;
}
.pot span { font-size: 2.6rem; line-height: 1; }
button.pot:hover { transform: translateY(-4px) rotate(-3deg); border-color: var(--gold); }
.pot.open { cursor: default; }
.pot.open b { font-family: var(--mono); font-size: .95rem; }
.pot.open b.pos { color: var(--good); }
.pot.open b.neg { color: var(--bad); }
.pot.chosen { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold); }

.quiz-q { font: 400 clamp(2rem, 10vw, 2.8rem)/1.1 var(--display); color: var(--fg); }
.quiz-opts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; width: 100%; }
.quiz-opt {
  font: 700 1.5rem var(--mono); padding: 14px; border-radius: 14px;
  border: 2px solid var(--line); background: var(--panel-2); cursor: pointer;
}
.quiz-opt:hover { border-color: var(--gold); }
.quiz-timer { width: 100%; height: 8px; border-radius: 8px; background: var(--panel-2); overflow: hidden; }
.quiz-timer span { display: block; height: 100%; background: linear-gradient(90deg, var(--bad), var(--gold)); animation: drain 5s linear forwards; }

.eeny-word { font: 400 clamp(1.8rem, 9vw, 2.6rem)/1.1 var(--display); color: var(--pink); min-height: 1.2em; }
.eeny-chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.eeny-chip {
  padding: 8px 14px; border-radius: 99px; font-weight: 600;
  border: 2px solid var(--pc); color: var(--fg); background: var(--bg);
  transition: transform .12s, background .12s;
}
.eeny-chip.on { background: var(--pc); color: var(--bg); transform: scale(1.12); }
.eeny-chip.win { box-shadow: 0 0 0 4px var(--gold), 0 0 24px var(--gold); }

.duck-fx { background: transparent; border: 0; max-width: 520px; }
.giant-duck { font-size: min(52vw, 260px); line-height: 1; animation: duck-in .5s cubic-bezier(.2, 1.6, .4, 1), shake .18s .5s 6; }
.quack { font: 400 clamp(3rem, 16vw, 5.5rem)/1 var(--display); color: var(--gold); text-shadow: 0 6px 0 var(--pink); animation: pop .3s .25s cubic-bezier(.2, 1.8, .4, 1) both; }
@keyframes duck-in { from { transform: translateY(80%) scale(.3); opacity: 0; } }
@keyframes shake { 50% { transform: rotate(-6deg) translateX(-6px); } }

.rick-fx { max-width: 640px; }
.rick-frame { width: 100%; aspect-ratio: 16 / 9; max-width: 100%; border-radius: 14px; overflow: hidden; background: #000; }
.rick-frame iframe { width: 100%; height: 100%; border: 0; display: block; }

/* chewed-up squares and board-wide effects */
.sq.gone {
  background: var(--bg) !important;
  box-shadow: inset 0 0 0 2px var(--line);
  border-radius: 30% 12% 40% 18%;
  cursor: default;
  opacity: .7;
}
.sq.gone:hover { transform: none; }
.sq.gone .cd { font-size: clamp(9px, 1.6vw, 15px); }
.board.mixing .sq { animation: mix .9s ease; }
@keyframes mix { 30% { transform: scale(.6) rotate(-12deg); filter: brightness(1.6); } 60% { transform: scale(.6) rotate(12deg); } }
.board.tornado { animation: twister 1.4s cubic-bezier(.5, 0, .3, 1); }
@keyframes twister {
  0% { transform: rotate(0) scale(1); filter: blur(0); }
  45% { transform: rotate(540deg) scale(.35); filter: blur(4px); }
  100% { transform: rotate(720deg) scale(1); filter: blur(0); }
}
.pcard.out { opacity: .5; filter: grayscale(.7); }
.out-pill { background: var(--bad) !important; }

/* ---------- responsive ---------- */
@media (max-width: 1040px) {
  .game { grid-template-columns: minmax(0, 1fr); }
  .players { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
  .pcard.active { transform: none; }
  .side { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); align-items: start; }
  .link-btn { grid-column: 1 / -1; }
}
@media (max-width: 860px) {
  .cheat-path { grid-template-columns: minmax(0, 1fr); }
  .cp-steps { grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); }
}
@media (max-width: 720px) {
  .setup { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 600px) {
  .app { padding-block: calc(12px + env(safe-area-inset-top, 0px)) calc(64px + env(safe-area-inset-bottom, 0px)); }
  .top { margin-bottom: 12px; }
  .tag { font-size: .92rem; }
  .setup-card, .rules { padding: 16px; }
  /* Cheat Path becomes one swipeable row so the board stays near the top */
  .cheat-path { padding: 12px; gap: 10px; margin-bottom: 12px; }
  .cp-head h2 { font-size: 1.1rem; }
  .cp-steps { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 4px; -webkit-overflow-scrolling: touch; }
  .cp-step { flex: 0 0 116px; scroll-snap-align: start; padding: 6px 8px; }
  .game { gap: 12px; }
  .players { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .pcard { padding: 8px 10px 8px 16px; border-radius: 12px; }
  .pscore { font-size: 1.1rem; }
  .pneed { font-size: .72rem; }
  .zero-btn { padding: 8px; font-size: .8rem; }
  .banner { padding: 10px 12px; }
  .result { font-size: .9rem; }
  .shop-btn { padding: 12px; }
  .duck { width: min(220px, 70%); }
  .modal { padding: 16px; }
  .st-head, .st-row { grid-template-columns: 3.4rem minmax(0, 1fr) auto; gap: 8px; }
  .st-head { padding: 0 12px; }
  .st-row { padding: 7px 12px; }
  .st-place { font-size: 1.35rem; }
}
@media (max-width: 420px) {
  .names { grid-template-columns: minmax(0, 1fr); }
  .board-wrap { grid-template-columns: 1em minmax(0, 1fr); grid-template-rows: 1em auto; gap: 3px; }
  .col-labels, .row-labels { font-size: .6rem; }
  .sq { border-radius: 14%; }
  .sq .chip { inset: 3%; border-radius: 4px; font-size: 7px; letter-spacing: -.05em; }
  .sq .chip.spec { font-size: 6px; }
  .sq .step { top: -4px; right: -4px; font-size: 8px; }
  .made-by { font-size: .7rem; padding: 4px 10px; }
}

/* Phones and tablets: no sticky hover lifts after a tap */
@media (hover: none) {
  .sq:hover, .big-btn:hover, .shop-btn:hover:not(:disabled) { transform: none; }
  .sq:active:not(.cool) { transform: scale(.94); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .treat-bar span { animation-duration: 3s !important; }
}
