/* Dice Fight: screen layouts (home, lobby, play, results, final). */

.screen { min-height: 100vh; min-height: 100dvh; }

/* ================================================================ HOME */

.home-wrap, .lobby-wrap, .final-wrap {
  max-width: 480px;
  margin: 0 auto;
  padding: calc(16px + var(--safe-top)) 16px calc(24px + var(--safe-bottom));
  display: flex; flex-direction: column; gap: 14px;
}
.logo {
  width: 100%; height: auto; display: block;
  border-radius: 16px; border: var(--stroke); box-shadow: 6px 6px 0 var(--magenta);
}
.tagline {
  text-align: center; margin: 0.2rem 0 0.4rem;
  font-family: var(--font-display); font-size: 1.44rem; letter-spacing: 0.03em; color: var(--cyan);
  text-transform: uppercase;
}
.tagline-row { display: flex; align-items: center; justify-content: center; gap: 10px; }
.tagline-row .tagline { flex: 1; }
.tagline-row .sound-toggle { flex: none; }
.home-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 0.4rem; }
.rejoin { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.rejoin p { margin: 0; flex: 1 1 100%; }

/* ================================================================ LOBBY */

.lobby-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 10px 12px; }
.lobby-head > div:first-child { min-width: 0; }
.lobby-head-buttons { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.lobby-head-buttons .btn { white-space: nowrap; }
.room-code {
  font-family: var(--font-display); font-size: clamp(3.5rem, 18.75vw, 5rem); line-height: 0.95; letter-spacing: 0.12em;
  color: var(--yellow); text-shadow: 4px 4px 0 var(--magenta), 6px 6px 0 var(--ink);
}

.player-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.player {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px 10px 10px; border-radius: 32px;
  background: rgba(255, 255, 255, 0.06);
}
.player.me { background: rgba(255, 214, 10, 0.16); outline: 2px solid rgba(255, 214, 10, 0.5); }
.player.away { opacity: 0.45; }
/* Names never break mid-word; the badges wrap onto their own line instead. */
.player { flex-wrap: wrap; row-gap: 8px; }
.player-name { font-weight: 800; font-size: 1rem; flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.badge {
  font-size: 0.72rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em;
  padding: 4px 10px; border-radius: 999px; background: var(--yellow); color: var(--ink);
}
.badge-away { background: var(--muted); }
.badge-you { background: var(--cyan); }
.badges { display: flex; gap: 6px; flex: none; margin-left: auto; }
.badges:empty { display: none; }

.avatar { width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--ink); background: var(--indigo); flex: none; object-fit: cover; }
.avatar-sm { width: 30px; height: 30px; }
.avatar-lg { width: 96px; height: 96px; border-width: 3px; }
.avatar-champion { width: 128px; height: 128px; border-width: 4px; }

.avatar-card summary { cursor: pointer; list-style: none; margin: 0; }
.avatar-card summary::-webkit-details-marker { display: none; }
.avatar-card summary::after { content: " ▾"; color: var(--muted); }
.avatar-card[open] summary { margin-bottom: 0.75rem; }
.avatar-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.avatar-pick {
  appearance: none; padding: 0; border: 3px solid transparent; border-radius: 50%;
  background: none; aspect-ratio: 1; cursor: pointer;
}
.avatar-pick img { width: 100%; height: 100%; border-radius: 50%; display: block; }
.avatar-pick.mine { border-color: var(--yellow); box-shadow: 0 0 0 3px var(--ink), 0 0 14px var(--yellow); }
.avatar-pick:disabled { opacity: 0.2; cursor: not-allowed; }

.settings { display: grid; gap: 14px; }
.setting { display: grid; gap: 6px; }
.setting-label { font-weight: 800; display: flex; justify-content: space-between; gap: 8px; }
.setting-label output { font-family: var(--font-display); font-size: 1.5rem; color: var(--yellow); }
.setting input[type=range] { width: 100%; accent-color: var(--magenta); height: 32px; }
.segmented { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; }
.segmented button {
  appearance: none; border: 2px solid var(--ink); border-radius: 10px; min-height: 44px;
  background: rgba(255, 255, 255, 0.1); color: var(--white); font-weight: 800; font-size: 0.95rem; cursor: pointer;
  padding: 4px 6px;
}
.segmented button[aria-checked=true] { background: var(--cyan); color: var(--ink); box-shadow: 2px 2px 0 var(--ink); }
.segmented-3 button { font-size: 0.85rem; line-height: 1.1; }
.settings.readonly input, .settings.readonly button { pointer-events: none; }
.settings.readonly input[type=range] { opacity: 0.75; }

.lobby-actions, .final-actions { display: grid; gap: 10px; justify-items: center; padding-bottom: 8px; }
.lobby-actions .btn-huge, .final-actions .btn { width: 100%; }
.waiting { margin: 0; color: var(--muted); font-weight: 700; text-align: center; }

/* ================================================================ PLAY */

#screen-play {
  position: fixed; inset: 0;
  display: grid;
  /* Named areas so hidden rows (e.g. the modifier reminder) never shift the layout. */
  grid-template-rows: auto auto auto minmax(0, 1fr) auto auto;
  grid-template-areas: "hud" "mod" "feed" "arena" "opps" "foot";
  padding: calc(8px + var(--safe-top)) 12px calc(10px + var(--safe-bottom));
  gap: 6px;
  overflow: hidden;
  touch-action: none;
  user-select: none; -webkit-user-select: none;
}

.hud { grid-area: hud; }
.mod-row { grid-area: mod; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.mod-row:not(:has(> :not([hidden]))) { display: none; }
.feed { grid-area: feed; }
.arena { grid-area: arena; }
.opponents { grid-area: opps; align-items: flex-start; }
.play-foot { grid-area: foot; }

.hud { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; }
.hud-left { display: grid; gap: 2px; }
.hud-round { font-family: var(--font-display); font-size: 1.38rem; color: var(--cyan); text-transform: uppercase; }
.hud-timer { font-family: var(--font-display); font-size: 2rem; line-height: 1; color: var(--white); font-variant-numeric: tabular-nums; }
.hud-timer.urgent { color: var(--magenta); font-size: 2.2rem; animation: pulse 0.5s ease-in-out infinite alternate; }
.hud-score { text-align: center; }
.hud-total {
  font-family: var(--font-display); font-size: 4rem; line-height: 1;
  color: var(--yellow); text-shadow: 3px 3px 0 var(--magenta), 5px 5px 0 var(--ink);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.hud-total.hidden-total { color: var(--muted); text-shadow: 3px 3px 0 var(--ink); }
.hud-total.bump { animation: bump 260ms ease-out; }
.hud-lives { min-height: 1.4rem; font-size: 1.2rem; letter-spacing: 0.15em; }
.life { display: inline-block; }
.life.lost { filter: grayscale(1); opacity: 0.35; }
.sound-toggle {
  justify-self: end; appearance: none; width: 48px; height: 48px; border-radius: 50%;
  border: 2px solid var(--muted); background: rgba(0, 0, 0, 0.3); font-size: 1.4rem; cursor: pointer; color: var(--white);
}
.sound-toggle[aria-pressed=true] { border-color: var(--cyan); }

/* ---------- fun rounds ---------- */

.modifier-card {
  grid-row: 4; position: relative; z-index: 1; margin-top: 6px;
  display: grid; gap: 4px; justify-items: center; max-width: 360px;
  padding: 12px 16px; border: 4px solid var(--ink); border-radius: 16px;
  background: var(--magenta); color: var(--white); box-shadow: 6px 6px 0 var(--cyan);
  transform: rotate(-2deg);
  animation: mod-in 420ms cubic-bezier(.2, 1.6, .4, 1) both 120ms;
}
.modifier-kicker { font-family: var(--font-display); font-size: 1.25rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--yellow); }
.modifier-name { font-family: var(--font-display); font-size: clamp(2.5rem, 12.5vw, 3.5rem); line-height: 1; text-shadow: 3px 3px 0 var(--ink); }
.modifier-desc { font-weight: 800; font-size: 1rem; }
@keyframes mod-in { from { transform: rotate(-2deg) scale(2); opacity: 0; } }

/* ---------- party rules ---------- */

.opening-card {
  grid-row: 5; align-self: start; position: relative; z-index: 2; margin-top: 12px;
  max-width: 360px; padding: 10px 16px; border: 4px solid var(--ink); border-radius: 16px;
  background: var(--yellow); color: var(--ink); box-shadow: 6px 6px 0 var(--magenta);
  transform: rotate(2deg);
  animation: mod-in 420ms cubic-bezier(.2, 1.6, .4, 1) both 240ms;
}
.opening-kicker { font-weight: 900; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.08em; }
.opening-text { font-family: var(--font-display); font-size: clamp(2rem, 10vw, 2.75rem); line-height: 1.05; }

.party { z-index: 35; background: rgba(6, 8, 30, 0.82); touch-action: manipulation; }
.party-card {
  width: min(92vw, 420px); display: grid; gap: 12px; justify-items: center;
  padding: 20px 16px; border: 5px solid var(--ink); border-radius: 22px;
  background: linear-gradient(160deg, var(--cyan), #00a8d6); color: var(--ink);
  box-shadow: 8px 8px 0 var(--magenta);
  animation: claim-in 380ms cubic-bezier(.2, 1.6, .4, 1);
  transform: translate(-50%, -50%) rotate(-2deg); position: absolute; left: 50%; top: 45%;
}
.party-card.shake-card { animation: shake 360ms ease-in-out; }
.party-kicker { font-family: var(--font-display); font-size: 1.63rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--white); text-shadow: 2px 2px 0 var(--ink); }
.party-text { font-family: var(--font-display); font-size: clamp(2.5rem, 12.5vw, 3.5rem); line-height: 1.05; text-align: center; }
.party-status { font-weight: 900; font-size: 1.05rem; min-height: 1.3em; text-align: center; }
.party-challenge { display: grid; gap: 10px; justify-items: center; width: 100%; }
.party-challenge input {
  width: 100%; font-size: 1.6rem; font-weight: 900; text-align: center; text-transform: uppercase; letter-spacing: 0.1em;
  padding: 10px; border: var(--stroke); border-radius: 12px; background: var(--cream); color: var(--ink);
  user-select: text; -webkit-user-select: text; touch-action: manipulation;
}
.party-challenge form { display: grid; gap: 8px; width: 100%; }
.party-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; width: 100%; }
.party-options .btn { font-size: 2.5rem; min-height: 64px; padding: 0; }
.emergency {
  appearance: none; width: 150px; height: 150px; border-radius: 50%; cursor: pointer; touch-action: manipulation;
  border: 6px solid var(--ink); background: radial-gradient(circle at 35% 30%, #ff8080, var(--red) 55%, #8a0016);
  box-shadow: 0 10px 0 #5a000e, 0 12px 0 var(--ink);
  font-family: var(--font-display); font-size: 2rem; color: var(--white); text-shadow: 2px 2px 0 var(--ink);
}
.emergency:active { transform: translateY(8px); box-shadow: 0 2px 0 #5a000e, 0 4px 0 var(--ink); }
.party-done { font-family: var(--font-display); font-size: 2.5rem; }

/* Dead Air: no feed, no timer. The final three seconds get a screen pulse instead. */
#screen-play.dead-air .feed,
#screen-play.dead-air .hud-timer { visibility: hidden; }

.powerup-chip {
  padding: 3px 12px; border-radius: 999px; border: 2px solid var(--ink);
  background: var(--yellow); color: var(--ink); font-weight: 800; font-size: 0.85rem;
}
.powerup-chip.global { background: var(--red); color: var(--white); }
.powerup-chip.theirs { background: rgba(255, 255, 255, 0.12); color: var(--cream); border-color: rgba(255, 255, 255, 0.25); }
.powerup-chip em { font-style: italic; font-weight: 900; color: var(--cyan); }

.btn-lock.global-lock {
  background: linear-gradient(180deg, #ff5a5a, #c4001f); color: var(--white); text-shadow: 3px 3px 0 var(--ink);
  box-shadow: 5px 5px 0 var(--ink), 0 0 28px rgba(255, 59, 59, 0.55);
}

/* ---------- power-up tray and announcement (inside the countdown overlay) ---------- */

.powerups {
  grid-row: 1; align-self: start; position: relative; z-index: 2;
  width: 100%; max-width: 460px; display: grid; gap: 8px;
}
.powerups-title { font-family: var(--font-display); font-size: 1.63rem; text-transform: uppercase; color: var(--yellow); text-shadow: 2px 2px 0 var(--ink); }
.powerups-title span { display: block; font-family: var(--font-body); font-size: 0.8rem; font-weight: 700; text-transform: none; color: var(--cream); text-shadow: 0 0 6px var(--ink), 1px 1px 0 var(--ink); }
.powerup-buttons { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pu {
  appearance: none; border: var(--stroke); border-radius: 14px; box-shadow: 3px 3px 0 var(--ink);
  min-height: 92px; padding: 8px 6px; cursor: pointer; touch-action: manipulation;
  display: grid; align-content: center; gap: 4px; color: var(--ink);
  animation: pu-in 260ms cubic-bezier(.2, 1.5, .4, 1) both;
}
.pu b { font-family: var(--font-display); font-size: 2rem; line-height: 1; font-weight: 400; }
.pu small { font-size: 0.72rem; font-weight: 700; line-height: 1.15; }
.pu:active:not(:disabled) { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.pu:disabled { filter: grayscale(0.8) brightness(0.6); }
.pu-plus2 { background: var(--yellow); }
.pu-oneup { background: var(--green); animation-delay: 50ms; }
.pu-global { background: var(--red); color: var(--white); animation-delay: 100ms; }
.pu-global b { font-size: 1.88rem; text-shadow: 2px 2px 0 var(--ink); }
@keyframes pu-in { from { opacity: 0; transform: translateY(-30px) scale(0.9); } }

.powerup-claim {
  position: absolute; left: 50%; top: 50%; z-index: 3; width: min(92vw, 420px);
  transform: translate(-50%, -50%) rotate(-3deg);
  display: grid; justify-items: center; gap: 6px; padding: 18px 14px;
  background: var(--yellow); color: var(--ink); border: 5px solid var(--ink); border-radius: 18px;
  box-shadow: 8px 8px 0 var(--magenta);
  animation: claim-in 380ms cubic-bezier(.2, 1.6, .4, 1);
}
.powerup-claim.global { background: var(--red); color: var(--white); }
.powerup-claim .claim-who { font-family: var(--font-display); font-size: 2.5rem; line-height: 1; overflow-wrap: anywhere; }
.powerup-claim .claim-what { font-family: var(--font-display); font-size: clamp(2.5rem, 12.5vw, 4rem); line-height: 0.95; -webkit-text-stroke: 2px var(--ink); paint-order: stroke fill; color: var(--white); text-shadow: 4px 4px 0 var(--ink); }
.powerup-claim.global .claim-what { color: var(--yellow); }
.powerup-claim .claim-desc { font-weight: 800; }
@keyframes claim-in { from { transform: translate(-50%, -50%) rotate(-3deg) scale(2.2); opacity: 0; } }

.modifier-reminder {
  justify-self: center; padding: 3px 12px; border-radius: 999px;
  background: var(--magenta); color: var(--white); font-weight: 800; font-size: 0.85rem; border: 2px solid var(--ink);
}

.feed {
  list-style: none; margin: 0; padding: 0 4px;
  /* Fixed height (about four wrapped lines) so the die never jumps. Newest at the bottom;
     older lines slide up and fade out under the top edge. */
  height: 5.2em; overflow: hidden;
  display: flex; flex-direction: column; justify-content: flex-end; gap: 0.15em;
  font-size: 0.9rem; line-height: 1.25em; font-weight: 400;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 1.1em);
  mask-image: linear-gradient(to bottom, transparent 0, #000 1.1em);
}
.feed li { flex: none; overflow-wrap: anywhere; color: var(--cream); animation: feed-in 240ms ease-out; }
.feed-name { font-style: italic; font-weight: 400; color: var(--cyan); }
.feed li.k-lock .feed-name { color: var(--yellow); }
.feed li:not(:last-child) { opacity: 0.55; }
.feed li.k-bust { color: var(--magenta); }
.feed li.k-lock { color: var(--cyan); }
.feed li.k-double, .feed li.k-run { color: var(--yellow); }

.arena { position: relative; display: grid; place-items: center; min-height: 0; }
.die-zone {
  position: relative; z-index: 1;
  width: min(78vw, 46vh, 420px); aspect-ratio: 1;
  display: grid; place-items: center;
  touch-action: none; cursor: grab; outline: none;
}
.die-zone:focus-visible { outline: 3px dashed var(--cyan); outline-offset: 8px; border-radius: 24px; }
.die-zone.disabled { cursor: default; }
.roll-hint {
  position: absolute; bottom: 4px; left: 0; right: 0; text-align: center;
  font-family: var(--font-display); text-transform: uppercase; color: var(--muted); letter-spacing: 0.08em;
}
.last-roll { position: absolute; top: 4px; right: 4px; font-weight: 800; color: var(--cream); font-size: 0.9rem; }

.opponents { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.opp { position: relative; display: grid; justify-items: center; width: 52px; font-size: 0.7rem; font-weight: 700; }
.opp .avatar { width: 38px; height: 38px; }
.opp-name { max-width: 52px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.opp-status {
  position: absolute; top: 22px; left: 50%; transform: translateX(-50%) rotate(-12deg);
  font-family: var(--font-display); font-size: 0.94rem; padding: 0 4px; border: 2px solid var(--ink); border-radius: 4px;
}
.opp.locked .opp-status { background: var(--cyan); color: var(--ink); }
.opp.busted .opp-status { background: var(--magenta); color: var(--white); }
.opp.busted .avatar { filter: grayscale(1); }
.opp.away .avatar { opacity: 0.4; }

.play-foot { display: grid; }
.btn-lock {
  min-height: 76px; font-size: 2.88rem; width: 100%;
  background: linear-gradient(180deg, var(--yellow), var(--orange));
  box-shadow: 5px 5px 0 var(--ink), 0 0 24px rgba(255, 214, 10, 0.35);
}

/* ---------- overlays ---------- */

.overlay {
  position: fixed; inset: 0; z-index: 30;
  display: grid; place-items: center; text-align: center;
  padding: calc(16px + var(--safe-top)) 16px calc(16px + var(--safe-bottom));
}
.countdown {
  background: radial-gradient(circle at 50% 55%, rgba(58, 26, 138, 0.85), rgba(11, 15, 58, 0.96));
  grid-template-rows: 1fr auto auto auto 1fr;
  /* Closed: the announcer slides out first, then the backdrop fades, then it stops existing. */
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 260ms ease 220ms, visibility 0s linear 480ms;
}
.countdown.open {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transition: opacity 200ms ease, visibility 0s;
}
.countdown .announcer {
  position: absolute; bottom: 0; right: -10%; width: min(70vw, 360px); pointer-events: none;
  transform: translateX(115%) rotate(6deg);
  transition: transform 340ms cubic-bezier(.55, 0, .9, .4);           /* exit: whoosh off to the right */
}
.countdown.open .announcer {
  transform: translateX(0) rotate(0);
  transition: transform 520ms cubic-bezier(.2, 1.35, .45, 1) 80ms;  /* entrance: overshoot and settle */
}
.countdown-round { grid-row: 2; font-family: var(--font-display); font-size: 2.5rem; color: var(--cyan); text-transform: uppercase; position: relative; }
.countdown-num {
  grid-row: 3; position: relative;
  font-family: var(--font-display); font-size: 13.75rem; line-height: 1;
  color: var(--yellow); text-shadow: 6px 6px 0 var(--magenta), 10px 10px 0 var(--ink);
}
.countdown-num.go { font-size: clamp(3.5rem, 18.75vw, 6.25rem); color: var(--white); }
.countdown-num.tick { animation: slam 380ms cubic-bezier(.2, 1.6, .4, 1); }
.countdown-line { grid-row: 4; position: relative; max-width: min(22ch, 90vw); font-weight: 800; font-size: 1.15rem; color: var(--cream); }

.results { background: rgba(6, 8, 30, 0.985); overflow-y: auto; touch-action: pan-y; align-items: start; }
.results-inner { width: 100%; max-width: 480px; display: grid; gap: 10px; padding-top: 8px; }
.results-title {
  font-size: clamp(2rem, 10vw, 3rem); text-transform: uppercase; color: var(--yellow);
  text-shadow: 4px 4px 0 var(--magenta), 6px 6px 0 var(--ink);
}
.results-reason { margin: 0; color: var(--cyan); font-weight: 700; }
.results-rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column-reverse; gap: 8px; }
.result-row {
  display: grid; grid-template-columns: 2.2rem auto 1fr auto; align-items: center; gap: 10px;
  padding: 8px 12px 8px 8px; border-radius: 14px; text-align: left;
  background: rgba(255, 255, 255, 0.07); border: 2px solid rgba(255, 255, 255, 0.12);
  animation: row-in 320ms cubic-bezier(.2, 1.4, .4, 1);
}
.result-row.first { background: linear-gradient(90deg, rgba(255, 214, 10, 0.35), rgba(255, 45, 149, 0.25)); border-color: var(--yellow); }
.result-row.me { outline: 2px solid var(--cyan); }
.result-place { font-family: var(--font-display); font-size: 2.25rem; color: var(--yellow); text-align: center; }
.result-who { min-width: 0; }
.result-name { font-weight: 800; font-size: 0.9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.result-meta { font-size: 0.8rem; color: var(--muted); }
.result-note { font-size: 0.8rem; color: var(--cyan); font-style: italic; }
.result-sips { font-size: 0.8rem; color: var(--orange); font-weight: 700; }
.result-score { text-align: right; }
.result-total { font-family: var(--font-display); font-size: 2rem; overflow-wrap: anywhere; word-break: break-all; max-width: 40vw; }
.result-points { font-size: 0.8rem; font-weight: 800; color: var(--yellow); }
.results-next { color: var(--muted); font-weight: 700; margin: 4px 0 0; }

/* ================================================================ FINAL */

.final-wrap { position: relative; }
.final-announcer {
  position: absolute; top: 0; right: -30px; width: 200px; pointer-events: none; z-index: 0;
  animation: announcer-in 560ms cubic-bezier(.2, 1.35, .45, 1) both;
}
@keyframes announcer-in { from { transform: translateX(140%) rotate(6deg); } }
/* Caption, avatar and name share one centred column to the left of the announcer
   (200px wide, 30px off the right edge). */
.champion { position: relative; z-index: 1; display: grid; justify-items: center; text-align: center; gap: 6px; padding-top: 0; min-height: 180px; width: calc(100% - 180px); }
.champion .eyebrow {

  max-width: 100%; line-height: 1.35;
  color: var(--cyan);
  font-weight: 800;
  /* Dark outline + glow so it stays readable over the announcer artwork. */
  text-shadow:
    -1px -1px 0 var(--ink), 1px -1px 0 var(--ink), -1px 1px 0 var(--ink), 1px 1px 0 var(--ink),
    2px 2px 0 var(--ink), 0 0 8px rgba(10, 10, 24, 0.9);
}
/* One line, sized to the name's length (--len is set from JS) so it never breaks mid-word. */
.champion-name {
  font-family: var(--font-display); line-height: 1; color: var(--yellow); white-space: nowrap;
  font-size: clamp(1rem, calc((min(100vw, 480px) - 212px) / (var(--len, 6) * 0.6)), 3rem);
  text-shadow: 0.06em 0.06em 0 var(--magenta), 0.1em 0.1em 0 var(--ink);
}
.table-scroll { overflow-x: auto; }
/* Fixed columns so a long name can't push Dice off the card; names trim with an ellipsis. */
.final-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; table-layout: fixed; }
.final-table th { text-align: left; font-size: 0.62rem; text-transform: uppercase; color: var(--muted); padding: 4px 2px; }
.final-table th:nth-child(1) { width: 1.6rem; }
.final-table th:nth-child(3) { width: 2.6rem; text-align: right; }
.final-table th:nth-child(4) { width: 3.2rem; text-align: right; }
.final-table th:nth-child(5) { width: 3.6rem; text-align: right; }
.final-table td { padding: 6px 2px; border-top: 1px solid rgba(255, 255, 255, 0.1); vertical-align: middle; }
.final-table td.num { text-align: right; font-weight: 800; }
.final-table td.dice { text-align: right; word-break: break-all; font-size: 0.8rem; }
.final-table tr.me td { background: rgba(34, 228, 255, 0.1); }
.final-table .who { display: flex; align-items: center; gap: 6px; font-weight: 400; font-size: 0.78rem; white-space: nowrap; min-width: 0; }
.final-table .who span { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.final-table .who .avatar { flex: none; }
.final-table .note { display: block; font-size: 0.72rem; font-style: italic; color: var(--cyan); font-weight: 500; }
.drink-card { border-color: var(--orange); text-align: center; font-weight: 800; font-size: 1.1rem; }

/* Drinking prompts: always optional, never block play. */
.drink-prompt {
  display: grid; gap: 2px; justify-items: center; text-align: center;
  padding: 10px 14px; border-radius: 16px; border: 3px solid var(--ink);
  background: linear-gradient(180deg, var(--orange), #e05a00); color: var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
  animation: mod-in 420ms cubic-bezier(.2, 1.6, .4, 1) both;
}
.drink-prompt .drink-sips { font-family: var(--font-display); font-size: 2.5rem; line-height: 1; }
.drink-prompt .drink-why { font-weight: 800; }
.drink-prompt .drink-small { font-size: 0.8rem; font-weight: 700; opacity: 0.85; }
.drink-card.drink-prompt { border-color: var(--ink); }
