/* Quit Goosin' Around! — Linocut Pond Party theme
   pond-green table · cream paper panels · orange goose-bill buttons · ink type */

:root {
  --pond: #1f4034;
  --pond-deep: #163026;
  --pond-light: #2a5142;
  --cream: #f1e7cf;
  --cream-2: #e6d8b6;
  --ink: #2a2118;
  --ink-soft: #4a3f30;
  --bill: #e07a2e;
  --bill-dark: #c6611c;
  --good: #5d8a3a;
  --bad: #b23b2e;
  --gold: #c89b3c;
  --paper-edge: #cdbf9a;
  --shadow: rgba(0,0,0,.35);
  --display: 'Rye', 'Georgia', serif;
  --type: 'Special Elite', 'Courier New', monospace;
  --term: 'VT323', 'Courier New', monospace;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
/* kill the double-tap-to-zoom delay on fast repeated taps (Draw, Holler) */
button, .card, .vote-card, .player { touch-action: manipulation; }
body {
  margin: 0;
  font-family: var(--type);
  color: var(--ink);
  background-color: var(--pond);
  background-image:
    radial-gradient(circle at 50% -10%, var(--pond-light), transparent 55%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E");
  background-attachment: fixed;
  color-scheme: dark;
}
.hidden { display: none !important; }

/* ---------- shared elements ---------- */
.paper {
  background: var(--cream);
  background-image: linear-gradient(180deg, rgba(255,255,255,.25), transparent 40%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='p'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.7' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23p)' opacity='0.04'/%3E%3C/svg%3E");
  color: var(--ink);
  border: 2px solid var(--paper-edge);
  border-radius: 12px;
  box-shadow: 0 4px 0 rgba(0,0,0,.18), 0 8px 18px var(--shadow);
}

.btn {
  font-family: var(--type);
  font-size: .95rem;
  letter-spacing: .03em;
  cursor: pointer;
  color: var(--cream);
  background: var(--ink);
  border: 2px solid var(--ink);
  border-radius: 9px;
  padding: 10px 16px;
  box-shadow: 0 3px 0 rgba(0,0,0,.3);
  transition: transform .05s, filter .15s, background .15s;
}
.btn:hover { filter: brightness(1.12); }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0,0,0,.3); }
.btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.btn-primary { background: var(--bill); border-color: var(--bill-dark); color: #2a1500; font-weight: bold; text-transform: uppercase; letter-spacing: .05em; }
.btn-ghost { background: transparent; color: var(--cream); border-color: var(--cream); }
.btn.block { display: block; width: 100%; }
.btn-icon { background: var(--cream); color: var(--ink); border-color: var(--paper-edge); font-size: .8rem; }
.btn-danger { background: var(--bad); border-color: #7e2018; color: var(--cream); font-weight: bold; text-transform: uppercase; letter-spacing: .05em; }

.row { display: flex; gap: 10px; }
input, select {
  font-family: var(--type);
  font-size: 1rem; color: var(--ink);
  background: #fbf6e7; border: 2px solid var(--paper-edge);
  border-radius: 8px; padding: 9px 11px;
}
input::placeholder { color: #9a8d6e; }
.err { color: #ffb4a6; text-align: center; min-height: 1.2em; margin: 8px 0 0; }

/* ---------- lobby ---------- */
.screen { min-height: 100vh; }
.lobby { display: flex; align-items: center; justify-content: center; padding: 24px; }
.lobby-inner { width: 100%; max-width: 440px; text-align: center; }
.logo {
  font-family: var(--display); color: var(--cream);
  font-size: clamp(2.4rem, 8vw, 4rem); line-height: .95; margin: 0 0 6px;
  text-shadow: 3px 3px 0 var(--ink), 5px 5px 0 rgba(0,0,0,.25);
}
.logo span { color: var(--bill); }
.logo.small { font-size: 2.6rem; }
.tag { color: var(--cream-2); font-size: .85rem; opacity: .85; margin: 0 0 20px; }
.lobby-card { padding: 22px; text-align: left; }
.field { display: block; font-size: .85rem; color: var(--ink-soft); margin-bottom: 14px; }
.field input { width: 100%; margin-top: 6px; }
.block { margin-top: 6px; }
.or { text-align: center; margin: 16px 0; position: relative; color: var(--ink-soft); }
.or::before, .or::after { content: ''; position: absolute; top: 50%; width: 40%; height: 2px; background: var(--paper-edge); }
.or::before { left: 0; } .or::after { right: 0; }
.code-input { flex: 1; text-transform: uppercase; letter-spacing: .35em; text-align: center; font-weight: bold; font-size: 1.2rem; }
.codepill { text-align: center; font-size: 1.1rem; margin-bottom: 8px; color: var(--ink-soft); }
/* one-tap invite link, right under the room code */
.copy-link-btn { background: #fbf6e7; color: var(--ink); border-color: var(--paper-edge); font-size: .85rem; margin-bottom: 12px; }
.copy-link-btn:hover { border-color: var(--bill); }
.codepill strong { font-family: var(--display); font-size: 1.6rem; letter-spacing: .2em; color: var(--bill-dark); }
.check { display: flex; gap: 8px; align-items: flex-start; font-size: .8rem; color: var(--ink-soft); margin-bottom: 14px; cursor: pointer; }
.check.small { color: var(--ink); }
.check input { width: auto; }

/* back-to-lobby button, top-left of the waiting room */
.back-btn { position: absolute; top: 16px; left: 16px; z-index: 5; background: var(--cream); color: var(--ink); border-color: var(--paper-edge); font-size: .85rem; padding: 8px 14px; }
.back-btn:hover { border-color: var(--bill); }

/* ---------- silliest-goose vote (waiting room) ---------- */
/* startin' rules callout */
.vote-rules { position: relative; background: #fbf6e7; border: 2px solid var(--bill); border-radius: 10px; padding: 14px 12px 10px; margin-bottom: 12px; }
.vote-rules .vr-badge { position: absolute; top: -10px; left: 12px; background: var(--bill); color: #2a1500; font-family: var(--display); font-size: .8rem; letter-spacing: .04em; padding: 1px 10px; border-radius: 6px; border: 2px solid var(--bill-dark); }
.vote-rules .vr-list { margin: 6px 0 4px; padding-left: 18px; font-size: .82rem; color: var(--ink); line-height: 1.45; }
.vote-rules .vr-list strong { color: var(--bill-dark); }
.vote-rules .vr-foot { font-family: var(--display); font-size: 1rem; color: var(--bill-dark); text-align: right; }

/* vote status line */
.vote-status { font-family: var(--type); text-transform: uppercase; letter-spacing: .08em; font-size: .74rem; color: var(--ink-soft); margin-bottom: 8px; }
.vote-status.split { color: var(--bad); }
.vote-status.good { color: var(--good); font-weight: bold; }

/* lobby nudge buttons — small, sit inline on the right of the chat header */
.nudge-row { display: flex; gap: 10px; justify-content: center; }
.nudge-btn { background: var(--bill); color: #2a1500; border-color: var(--bill-dark); font-weight: bold; text-transform: uppercase; letter-spacing: .04em; font-size: .9rem; padding: 9px 18px; box-shadow: 0 3px 0 rgba(0,0,0,.3); }
.nudge-btn:hover { filter: brightness(1.1); }

/* lobby chat ("Lobby Honkin'") */
.lobby-honk { margin-top: 12px; border-top: 2px solid var(--paper-edge); padding-top: 10px; }
/* centered header, with the Vote!/Holler buttons on their own row below it */
.lh-head { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-bottom: 10px; }
.lh-title { font-family: var(--display); font-size: 1.2rem; color: var(--bill-dark); text-align: center; }
.lh-msgs { height: 96px; overflow-y: auto; font-size: .82rem; color: var(--ink); background: #fbf6e7; border: 2px solid var(--paper-edge); border-radius: 8px; padding: 6px 8px; margin-bottom: 8px; }
/* empty-state hint so it's clear this is where chat appears (not the input) */
.lh-msgs:empty::before { content: 'honks from the pond show up here…'; color: #9a8d6e; font-style: italic; }
.lh-msgs div { padding: 2px 0; }
.lh-msgs .c-from { color: var(--bill-dark); font-weight: bold; }
.lh-row { gap: 8px; }
.lh-row input { flex: 1; min-width: 0; font-size: .82rem; }  /* smaller so the placeholder fits */
.lh-row input::placeholder { font-size: .82rem; }

/* nudge banner (top-center, playful honk reminder) */
.nudge-banner { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 130; background: var(--bill); color: #2a1500; border: 2px solid var(--bill-dark); border-radius: 10px; padding: 10px 20px; font-family: var(--display); font-size: 1.05rem; box-shadow: 0 6px 20px rgba(0,0,0,.5); }
.nudge-banner.show { animation: fadeIn .2s ease-out; }

/* lobby on phones: let the taller card scroll instead of center-clipping, and
   keep taps/buttons thumb-friendly. */
@media (max-width: 560px) {
  .lobby { align-items: flex-start; padding: 16px; }
  /* clear the fixed sound pill so it never sits on the title */
  .lobby .lobby-inner { padding-top: 40px; padding-bottom: 28px; }
  .menu-sound { top: 8px; right: 8px; font-size: .68rem; padding: 6px 10px; }
  .lh-msgs { height: 72px; }
  .nudge-btn { padding: 11px 8px; }
  .vote-card { padding: 11px 12px; }
}
.vote-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.vote-card { background: #fbf6e7; border: 2px solid var(--paper-edge); border-radius: 10px; padding: 9px 11px; transition: transform .05s, border-color .15s, background .15s; }
.vote-card.clickable { cursor: pointer; }
.vote-card.clickable:hover { border-color: var(--bill); transform: translateY(-1px); }
.vote-card.my-vote { border-color: var(--bill); box-shadow: 0 0 0 2px rgba(224,122,46,.25); }
.vote-card.has-votes { background: #f4ecd6; }
.vc-top { display: flex; align-items: center; gap: 8px; }
.vc-name { font-weight: bold; text-transform: uppercase; letter-spacing: .03em; font-size: .9rem; color: var(--ink); }
.vc-tags { display: flex; gap: 4px; }
.vc-tags span { font-size: .58rem; text-transform: uppercase; letter-spacing: .06em; padding: 1px 5px; border-radius: 4px; border: 1px solid currentColor; }
.vm-you { color: var(--bill-dark); }
.vm-bot { color: #3a6ea5; }
.vm-host { color: var(--good); }
.vm-away { color: var(--bad); }
.vc-count { margin-left: auto; font-family: var(--display); font-size: 1.2rem; color: var(--bill-dark); min-width: 12px; text-align: right; }
.vc-remove { background: transparent; border: none; color: var(--bad); font-size: 1rem; cursor: pointer; padding: 0 2px; box-shadow: none; line-height: 1; }
.vc-remove:hover { filter: brightness(1.2); }
.vc-voters { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 7px; }
.vc-voters:empty { display: none; }
.voter-chip { font-size: .66rem; background: var(--pond-light); color: var(--cream); border-radius: 10px; padding: 2px 8px; }
.host-controls { display: flex; flex-direction: column; gap: 10px; margin-bottom: 10px; }
.host-controls .check { margin-bottom: 0; }
.start-hint { font-size: .72rem; color: var(--ink-soft); text-align: center; margin: -4px 0 0; min-height: 1em; }
.decided { text-align: center; padding: 14px 10px 6px; animation: fadeIn .4s; }
.decided-head { font-family: var(--display); font-size: 1.6rem; color: var(--bill-dark); }
.decided-body { font-size: 1rem; color: var(--ink); margin-top: 6px; }
.decided-body strong { color: var(--bill-dark); }
.decided-foot { font-size: .8rem; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .1em; margin-top: 8px; }

/* ---------- game shell ---------- */
#game { display: flex; flex-direction: column; height: 100vh; padding: 10px; gap: 10px; }
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 8px 16px; gap: 12px; }
.topbar .brand { font-family: var(--display); font-size: 1.3rem; color: var(--ink); }
.topbar .brand span { color: var(--bill-dark); }
.room-strip { font-size: .8rem; color: var(--ink-soft); letter-spacing: .03em; }
.room-strip strong { color: var(--ink); }

.table {
  flex: 1; display: grid; gap: 12px; min-height: 0;
  grid-template-columns: 300px 1fr 320px;
}
.rail { display: flex; flex-direction: column; gap: 12px; min-height: 0; overflow-y: auto; padding-right: 2px; }
.rail-right { overflow: hidden; }

/* ---------- decks / piles ---------- */
.decks { display: flex; gap: 8px; }
.pile {
  position: relative; flex: 1; aspect-ratio: 3/4; border-radius: 10px;
  border: 2px solid rgba(0,0,0,.4);
  background: var(--pond-deep);
  box-shadow: 3px 3px 0 -1px rgba(0,0,0,.5), 6px 6px 0 -1px rgba(0,0,0,.32), 9px 9px 0 -1px rgba(0,0,0,.2);
  display: flex; flex-direction: column; justify-content: space-between; overflow: hidden;
}
.pile.wild { border-color: var(--bill-dark); }
.pile.discard { box-shadow: 2px 2px 0 -1px rgba(0,0,0,.4); background: rgba(0,0,0,.25); }
.pile .pile-l { position: relative; z-index: 1; font-size: .58rem; text-transform: uppercase; letter-spacing: .06em; color: var(--cream); background: rgba(0,0,0,.55); padding: 3px 4px; text-align: center; line-height: 1.1; }
.pile .pile-n { position: relative; z-index: 1; font-family: var(--display); font-size: 1.3rem; color: var(--cream); align-self: flex-end; background: rgba(0,0,0,.6); border-radius: 8px 0 0 0; padding: 0 8px; }
/* discard art layer — the goose card back, flipped upside down */
.pile-art { position: absolute; inset: 0; z-index: 0; background-size: cover; background-position: center; background-repeat: no-repeat; transform: rotate(180deg); }
.pile.has-back .pile-l { background: rgba(0,0,0,.62); }
.pile.empty { opacity: .4; }

/* ---------- player panels ---------- */
.players { display: flex; flex-direction: column; gap: 8px; }
.player {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px;
  position: relative;
}
.player .pinfo { flex: 1; min-width: 0; }
.player .pname { font-size: .9rem; font-weight: bold; color: var(--ink); text-transform: uppercase; letter-spacing: .03em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player .pname .you { color: var(--bill-dark); }
.player .pscore { font-family: var(--display); font-size: 1.8rem; line-height: 1; color: var(--bill-dark); }
.player .pscore .max { font-size: .8rem; color: var(--ink-soft); }
.player .pscore .hidden-score { color: var(--ink-soft); opacity: .6; }
.player .pmeta { font-size: .72rem; color: var(--ink-soft); }
.player .pgoose { width: 42px; height: 42px; opacity: .35; background-size: contain; background-repeat: no-repeat; background-position: center; }
.player.active { outline: 3px solid var(--bill); outline-offset: 0; }
.player.target { outline: 3px solid var(--bad); }
.player.selectable { cursor: pointer; }
.player.selectable:hover { filter: brightness(1.05); transform: translateX(2px); }
.player.off { opacity: .5; }
.stamp { font-size: .62rem; text-transform: uppercase; letter-spacing: .08em; padding: 2px 6px; border-radius: 4px; border: 1.5px solid currentColor; display: inline-block; }
.stamp.goose { color: var(--good); }
.player .pwild { display: flex; gap: 4px; margin-top: 4px; }

/* ---------- birdwatchers (spectators, by name) ---------- */
/* Deliberately NOT a paper panel: dashed + muted so watchers never read as
   players. Hidden entirely when nobody's watching. */
.watchers {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  border: 2px dashed rgba(241,231,207,.35); border-radius: 10px;
  padding: 7px 10px; font-size: .78rem; color: var(--cream-2);
}
.watchers .w-label { text-transform: uppercase; letter-spacing: .09em; font-size: .62rem; opacity: .85; }
.watcher-chip { background: rgba(0,0,0,.28); border: 1px solid rgba(241,231,207,.25); color: var(--cream); border-radius: 10px; padding: 2px 9px; }
.watcher-chip em { font-style: normal; color: var(--bill); }
/* waiting room variant sits on cream paper — flip to ink tones */
.lobby-watchers { border-color: var(--paper-edge); color: var(--ink-soft); margin-bottom: 14px; }
.lobby-watchers .watcher-chip { background: #fbf6e7; border-color: var(--paper-edge); color: var(--ink); }
.lobby-watchers .watcher-chip em { color: var(--bill-dark); }

/* ---------- cards ---------- */
.hand { display: flex; flex-wrap: wrap; gap: 6px; }
.wildhand { margin-bottom: 6px; }
.myhand { padding: 10px; }
.myhand-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.myhand-title { font-weight: bold; text-transform: uppercase; letter-spacing: .05em; font-size: .85rem; }
.myhand-hint { font-size: .72rem; color: var(--ink-soft); }
.card {
  position: relative; width: 70px; aspect-ratio: 3/4; border-radius: 8px;
  border: 2px solid var(--ink); overflow: hidden; flex: 0 0 auto;
  background: var(--cream); background-size: cover; background-position: center; background-repeat: no-repeat;
  box-shadow: 0 2px 0 rgba(0,0,0,.3); user-select: none;
  display: flex; flex-direction: column; justify-content: space-between;
}
.card.tiny { width: 40px; border-width: 1.5px; }
.card .pts { position: absolute; top: 3px; right: 4px; font-family: var(--display); font-size: .8rem; color: var(--cream); background: rgba(0,0,0,.6); border-radius: 6px; padding: 0 5px; z-index: 2; }
.card .label { position: relative; z-index: 2; background: rgba(243,236,216,.92); color: var(--ink); font-size: .6rem; text-transform: uppercase; letter-spacing: .03em; text-align: center; padding: 3px 2px; line-height: 1; }
.card .nameless { flex: 1; }
.card.selectable { cursor: pointer; }
.card.selectable:hover { transform: translateY(-6px); }
.card.selected { outline: 3px solid var(--bill); transform: translateY(-9px); }

/* ---------- center stage ---------- */
.stage { display: flex; flex-direction: column; min-height: 0; gap: 12px; }
.stage-head { text-align: center; padding-top: 6px; }
.turn-banner { font-family: var(--display); font-size: clamp(1.8rem, 3.4vw, 3rem); color: var(--cream); text-shadow: 3px 3px 0 var(--ink); line-height: 1; }
.turn-banner.mine { color: var(--bill); }
.turn-sub { font-family: var(--type); text-transform: uppercase; letter-spacing: .2em; color: var(--cream-2); font-size: .85rem; margin-top: 4px; }
/* the live play table */
.play-area {
  flex: 1; border: 3px dashed rgba(241,231,207,.35); border-radius: 16px;
  display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Ctext x='50%25' y='55%25' font-size='120' text-anchor='middle' fill='%23ffffff' opacity='0.03'%3E%E2%97%86%3C/text%3E%3C/svg%3E");
}
.play-idle { text-align: center; color: var(--cream-2); display: flex; flex-direction: column; gap: 8px; padding: 16px; }
.play-idle .pi-main { font-family: var(--display); font-size: clamp(1.4rem, 2.6vw, 2.2rem); color: var(--cream); opacity: .85; }
.play-idle .pi-sub { font-size: .85rem; text-transform: uppercase; letter-spacing: .12em; opacity: .7; }
.play-idle.mine .pi-main { color: var(--bill); }
/* dramatic event flash in the center */
.event-flash { text-align: center; animation: stampIn .4s ease-out; }
.event-flash .ef-card { width: clamp(150px, 22vh, 220px); aspect-ratio: 3/4; margin: 0 auto 14px; border-radius: 14px; border: 3px solid var(--ink); background-size: cover; background-position: center; background-repeat: no-repeat; background-color: var(--cream); box-shadow: 0 12px 0 rgba(0,0,0,.3); }
.event-flash .ef-title { font-family: var(--display); font-size: clamp(1.6rem, 3vw, 2.4rem); color: var(--cream); text-shadow: 2px 2px 0 var(--ink); }
.event-flash .ef-sub { color: var(--cream-2); font-size: 1rem; margin-top: 6px; max-width: 80%; margin-left: auto; margin-right: auto; }

/* turn-pass banner in the center (brief transition) */
.turn-flip { text-align: center; animation: stampIn .35s ease-out; }
.turn-flip .tf-label { font-family: var(--type); text-transform: uppercase; letter-spacing: .2em; color: var(--cream-2); font-size: .8rem; }
.turn-flip .tf-name { font-family: var(--display); font-size: clamp(1.8rem, 3.4vw, 2.8rem); color: var(--cream); text-shadow: 3px 3px 0 var(--ink); margin-top: 4px; }
.turn-flip.mine .tf-name { color: var(--bill); }

/* dim backdrop behind a draw/trade reveal so it reads as a centered popup
   over whatever you were scrolled to */
.reveal-backdrop { position: fixed; inset: 0; background: rgba(8,18,14,.74); z-index: 1; pointer-events: auto; animation: fadeIn .2s ease-out; }
/* caption under the big revealed draw — viewport-centered (lives in the fixed
   fly layer), card name + goose names + name button */
.draw-caption {
  position: fixed; left: 50%; bottom: 16%; transform: translateX(-50%);
  text-align: center; display: flex; flex-direction: column; gap: 8px; align-items: center;
  z-index: 95; pointer-events: auto;
}
.draw-caption .dc-name { font-family: var(--display); font-size: 1.4rem; color: var(--cream); text-shadow: 2px 2px 0 var(--ink); }
/* the drawn goose's given name(s): a light-on-dark plate under the card */
.draw-caption .dc-geesenames {
  display: inline-block; background: var(--ink); color: var(--cream);
  border: 2px solid #000; border-radius: 8px; padding: 5px 14px;
  font-size: 1.1rem; font-weight: bold; letter-spacing: .02em;
  box-shadow: 0 3px 0 rgba(0,0,0,.45);
}
.draw-caption .dc-btn { font-size: .9rem; padding: 8px 16px; }
/* cream "Later" button under the orange name button */
.draw-caption .dc-later { background: var(--cream); color: var(--ink); border-color: var(--cream-2); font-weight: bold; }
.draw-caption .dc-later:hover { background: var(--cream-2); }

/* trade-in-the-market: tradeable geese pulled big into the center */
.trade-stage { width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 14px; text-align: center; }
.trade-stage .ts-head { font-family: var(--display); font-size: clamp(1.5rem, 3vw, 2.2rem); color: var(--cream); text-shadow: 2px 2px 0 var(--ink); }
.trade-stage .ts-sub { color: var(--cream-2); font-size: .9rem; }
.trade-stage .ts-cards { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; align-items: flex-start; overflow-y: auto; max-height: 70%; padding: 6px; }
.trade-stage .ts-empty { color: var(--cream-2); font-size: 1rem; }

/* a card-slot wraps a card + an optional name caption under it */
.card-slot { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.card-cap { font-size: .62rem; line-height: 1.05; text-align: center; max-width: 84px; color: var(--cream-2); word-break: break-word; }
.myhand .card-cap { color: var(--ink-soft); }
.card-cap .unnamed { opacity: .55; font-style: italic; }
.card.nameable { cursor: pointer; }
.card.nameable:hover { transform: translateY(-6px); }
.card.big { width: clamp(110px, 15vh, 150px); }

/* ---------- crayon doodles ---------- */
/* the doodle overlay riding a card face */
.doodle-layer { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1; }
.fly-card { overflow: hidden; }

/* the doodle editor */
.doodle-modal { z-index: 135; }
.doodle-box { width: min(94vw, 460px); max-height: 94vh; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.dd-title { font-family: var(--display); font-size: 1.3rem; color: var(--ink); text-align: center; }
.dd-stage {
  position: relative; margin: 0 auto; aspect-ratio: 3/4;
  width: min(100%, calc((94vh - 250px) * 3 / 4));
  border: 2px solid var(--ink); border-radius: 10px; overflow: hidden;
  background-color: var(--cream); background-size: cover; background-position: center; background-repeat: no-repeat;
}
.dd-canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: crosshair; }
.dd-tools { display: flex; flex-direction: column; gap: 8px; }
.dd-colors { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.dd-swatch { width: 30px; height: 30px; border-radius: 50%; border: 2px solid rgba(0,0,0,.35); padding: 0; cursor: pointer; box-shadow: 0 2px 0 rgba(0,0,0,.2); }
.dd-swatch.sel { outline: 3px solid var(--bill); outline-offset: 2px; }
.dd-weights { display: flex; gap: 8px; justify-content: center; align-items: center; flex-wrap: wrap; }
.dd-weight { width: 46px; height: 34px; display: flex; align-items: center; justify-content: center; background: #fbf6e7; border: 2px solid var(--paper-edge); border-radius: 8px; cursor: pointer; padding: 0; }
.dd-weight.sel { border-color: var(--bill); box-shadow: 0 0 0 2px rgba(224,122,46,.3); }
.dd-weight span { display: block; border-radius: 50%; background: var(--ink); }
.dd-mini { font-size: .78rem; padding: 6px 12px; color: var(--ink); border-color: var(--ink); }
.dd-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
/* ghost buttons sit on cream paper in the editor — give them ink so
   "Cancel" is actually legible */
.doodle-box .btn-ghost { color: var(--ink); border-color: var(--ink); }

/* ---------- pond graffiti (doodle the table) ---------- */
/* Zone canvases sit at z1; every real UI element in a zone is lifted to z2+
   so text, cards, and buttons always paint ABOVE the crayon. */
.pond-layer { position: absolute; inset: 0; pointer-events: none; z-index: 1; }
#game .topbar, .decks, .myhand { position: relative; }
.play-area > *:not(.pond-layer),
#game .topbar > *:not(.pond-layer),
.player > *:not(.pond-layer),
.myhand > *:not(.pond-layer) { position: relative; z-index: 2; }
/* deck piles are positioned boxes, so their zone canvas rides above the pile
   art (z2) while the labels/counters step up to z3 */
.decks > .pond-layer { z-index: 2; }
.pile .pile-l, .pile .pile-n { z-index: 3; }
/* the readability buffer: a soft halo behind table text so crayon underneath
   never makes it hard to read */
.player .pname, .player .pscore, .player .pmeta,
.myhand-title, .myhand-hint,
#game .topbar .brand, #game .topbar .room-strip {
  text-shadow: 0 0 3px var(--cream), 0 0 6px var(--cream), 0 0 10px var(--cream);
}
.play-area .pi-main, .play-area .pi-sub {
  text-shadow: 0 0 6px var(--pond-deep), 0 0 12px var(--pond-deep), 0 0 18px var(--pond-deep);
}

/* marker-mode toggle — bottom-LEFT above Leave Game, clear of the right
   rail's volume slider. z sits BELOW the Log & Chat toggle (110) and all
   modals, so it never covers other controls. */
.pond-btn {
  position: fixed; left: 14px; bottom: 64px; z-index: 105;
  background: var(--cream); color: var(--ink); border-color: var(--paper-edge);
  font-weight: bold; text-transform: uppercase; letter-spacing: .04em;
  box-shadow: 0 4px 12px rgba(0,0,0,.5);
}
/* while a card-doodle editor is open, get out of the way entirely */
body.card-editor-open .pond-btn { display: none; }
.pond-btn:hover { border-color: var(--bill); }
body.pond-mode .pond-btn { background: var(--bill); color: #2a1500; border-color: var(--bill-dark); }
/* full-screen crayon capture — sits UNDER threat/win overlays (z100+) so a
   Big Boy response is never blocked by doodling */
.pond-capture { position: fixed; inset: 0; z-index: 96; cursor: crosshair; touch-action: none; }
/* floating toolbar */
.pond-bar {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 64px; z-index: 112;
  display: flex; flex-direction: column; gap: 8px; align-items: center;
  padding: 10px 12px; max-width: 94vw;
}
@media (max-width: 1040px) {
  .pond-bar { bottom: 106px; }
  .pond-btn { left: 10px; bottom: 12px; }
  /* On phones, the floating your-turn bar pops at the TOP so it never sits on
     the doodle tools (it's also draggable anywhere — grab the chip). */
  body.my-turn.doodling-surface .stage-actions:not(:empty) {
    bottom: auto; top: max(10px, env(safe-area-inset-top));
    left: 8px; right: 8px; border-radius: 12px;
  }
}
/* eraser mode: swap the crosshair for a "rubbing" cursor + highlight */
body.pond-erasing .pond-capture { cursor: cell; }
.dd-eraser.sel { background: var(--bill); color: #2a1500; border-color: var(--bill-dark); }
/* editor canvas in eraser mode */
.dd-canvas.erasing { cursor: cell; }

/* ---------- draggable panels: the corner grip ---------- */
/* a small plate of dots — the universal "you can drag me" glyph */
.drag-grip {
  position: absolute; top: 4px; left: 5px; width: 20px; height: 20px;
  cursor: grab; touch-action: none; z-index: 6; border-radius: 5px;
  background-image: radial-gradient(var(--ink-soft) 1.1px, transparent 1.5px);
  background-size: 6px 6px; background-position: 2px 3px;
  opacity: .5;
}
.drag-grip:hover { opacity: .95; background-color: rgba(0,0,0,.07); }
.drag-grip:active { cursor: grabbing; }
/* cream dots for grips sitting on the dark table (your-turn bar) */
.drag-grip.on-dark { background-image: radial-gradient(rgba(241,231,207,.85) 1.1px, transparent 1.5px); }
/* panels the grip lives on need to anchor it */
.doodle-box { position: relative; }
.stage-actions { position: relative; }
.pond-bar { padding-left: 28px; }

/* ---------- waiting-room doodling: the WHOLE room is a canvas ----------
   Two zones: the green background (waitbg, canvas z0 behind the content) and
   the paper card (waitcard, canvas z1 over box/button BACKGROUNDS). Text and
   inputs float above the crayon at z2 with a halo buffer, so ya can scribble
   on everything and still read and press everything. */
#waiting { position: relative; }
#waiting > .pond-layer { z-index: 0; }
#waiting .lobby-inner { position: relative; z-index: 1; }
#waiting .lobby-card { position: relative; }

/* text, inputs, and interactive bits ride above the crayon */
#waiting .codepill, #waiting .vote-status, #waiting .start-hint, #waitHint,
#waiting .decided, #waiting .vr-badge, #waiting .vr-list, #waiting .vr-foot,
#waiting .vc-top, #waiting .vc-voters, #waiting .vc-remove,
#waiting .lh-title, #waiting .check, #waiting .lh-msgs, #waiting .lh-row,
#waiting .lobby-watchers, #waiting .btn .btn-label {
  position: relative; z-index: 2;
}
/* the readability buffer: cream halo behind card text */
#waiting .codepill, #waiting .vote-status, #waiting .start-hint, #waitHint,
#waiting .decided, #waiting .vr-badge, #waiting .vr-list, #waiting .vr-foot,
#waiting .vc-top, #waiting .lh-title, #waiting .check {
  text-shadow: 0 0 3px var(--cream), 0 0 6px var(--cream), 0 0 10px var(--cream);
}
/* button labels: halo matched to the button's own background */
#waiting .btn .btn-label { text-shadow: 0 0 3px var(--cream), 0 0 6px rgba(241,231,207,.85); }
#waiting .btn:not(.btn-primary):not(.copy-link-btn):not(.nudge-btn) .btn-label {
  text-shadow: 0 0 3px var(--ink), 0 0 6px rgba(42,33,24,.85);
}

/* your-turn top banner: visible ONLY when it's your turn AND a busy surface
   (name modal, doodle editor, pond marker) is open — pinned above keyboards
   and modals so nobody ever stalls the pond mid-mustache */
.turn-top {
  display: none; position: fixed; top: 8px; left: 50%; transform: translateX(-50%);
  z-index: 175; background: var(--bill); color: #2a1500; border: 2px solid var(--bill-dark);
  border-radius: 10px; padding: 8px 18px; font-family: var(--display); font-size: 1.1rem;
  letter-spacing: .04em; box-shadow: 0 6px 18px rgba(0,0,0,.55); pointer-events: none;
  animation: honkPulse 1.2s infinite;
}
body.my-turn.doodling-surface .turn-top { display: block; }

/* Your turn never waits on the crayon: while ANY doodle surface is open
   (pond marker mode OR the card editor), the action buttons float above it,
   announced by a pulsing "yer turn" chip — and the draw reveal flies above
   the doodle UI too, so you draw, watch it land, and keep doodling. */
body.pond-mode .stage-actions { z-index: 97; }              /* pond: buttons above the capture layer */
body.my-turn.doodling-surface .stage-actions { z-index: 140; cursor: grab; touch-action: none; }   /* your turn: above card editors too (z135); grab = draggable */
body.my-turn.doodling-surface .stage-actions:active { cursor: grabbing; }
body.doodling-surface .fly-layer { z-index: 145; }          /* card reveal above any doodle surface */
body.my-turn.doodling-surface .stage-actions:not(:empty)::before {
  content: "it's yer turn!";
  flex-basis: 100%; text-align: center;
  font-family: var(--display); font-size: 1.15rem; letter-spacing: .04em;
  color: var(--bill); text-shadow: 2px 2px 0 var(--ink), 0 0 12px rgba(0,0,0,.6);
  animation: honkPulse 1.2s infinite;
}
/* threat / announce / win overlay ALWAYS beats doodle editors — a Big Boy
   response can never hide behind your art project */
#overlay { z-index: 150; }
@media (min-width: 1041px) {
  /* keep the crayon toolbar clear of the floating action buttons */
  body.pond-mode.has-actions .pond-bar { bottom: 138px; }
}

/* name-your-goose modal */
.name-modal { z-index: 130; }
.name-box { width: min(92vw, 380px); padding: 22px; display: flex; flex-direction: column; gap: 12px; }
.name-box .nm-title { font-family: var(--display); font-size: 1.4rem; color: var(--ink); text-align: center; }
.name-box .nm-input { width: 100%; }
.name-box .nm-actions { display: flex; gap: 10px; justify-content: center; margin-top: 4px; }
/* ghost button sits on cream paper here — give it ink so it's legible */
.name-box .btn-ghost { color: var(--ink); border-color: var(--ink); }

/* bottom-center action bar (on your turn) */
.stage-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; align-items: center; min-height: 8px; }
.stage-actions .btn { font-size: 1rem; padding: 12px 20px; }
.stage-actions .trade-help { width: 100%; text-align: center; color: var(--cream-2); font-size: .85rem; }

/* flying-card animation layer */
.fly-layer { position: fixed; inset: 0; pointer-events: none; z-index: 90; }
.fly-card {
  position: fixed; border-radius: 9px; border: 2px solid var(--ink);
  background-color: var(--cream); background-size: cover; background-position: center; background-repeat: no-repeat;
  box-shadow: 0 12px 28px rgba(0,0,0,.5); transform-origin: center center; will-change: transform;
  z-index: 2;  /* sit ABOVE the dim reveal backdrop so the drawn card isn't dulled */
}

/* ---------- right rail panels ---------- */
/* minmax(0,…) + scrollable panels so the three boxes always fit the column
   height (and scroll internally) instead of clipping off the bottom. */
.rail-right { display: grid; grid-template-rows: minmax(80px, 1fr) auto auto; gap: 12px; min-height: 0; overflow: hidden; }
.panel { display: flex; flex-direction: column; min-height: 0; padding: 10px; overflow: hidden; }
.panel-head { font-weight: bold; text-transform: uppercase; letter-spacing: .08em; font-size: .8rem; border-bottom: 2px solid var(--paper-edge); padding-bottom: 6px; margin-bottom: 8px; color: var(--ink); }
.log { flex: 1; overflow-y: auto; font-family: var(--term); font-size: 1.05rem; line-height: 1.15; min-height: 0; }
.log div { padding: 3px 0; border-bottom: 1px solid rgba(0,0,0,.08); color: var(--ink-soft); }
.log .bad { color: var(--bad); }
.log .good { color: var(--good); }
.log .win { color: var(--bill-dark); font-weight: bold; }
.chat-panel { height: clamp(130px, 22vh, 180px); }
.chat { flex: 1; overflow-y: auto; font-size: .85rem; }
.chat div { padding: 2px 0; }
.chat .c-from { color: var(--bill-dark); font-weight: bold; }
.chat-row { min-width: 0; }
.chat-row input { flex: 1; min-width: 0; }  /* min-width:0 lets the input shrink so the Honk button never clips */
.sound-panel { gap: 8px; }
.slider-field { display: flex; align-items: center; gap: 8px; font-size: .8rem; color: var(--ink-soft); }
.slider-field input[type=range] { flex: 1; accent-color: var(--bill); }

/* ---------- Big Boy overlay ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 100; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 20px;
  background: rgba(8,18,14,.82); backdrop-filter: blur(2px);
  animation: fadeIn .25s ease-out;
}
.overlay-card { position: relative; width: min(34vh, 300px); aspect-ratio: 3/4; animation: slamCard .5s cubic-bezier(.2,1.4,.4,1); flex: 0 0 auto; }
.overlay-art { position: absolute; inset: 0; border-radius: 16px; border: 4px solid var(--ink); background: var(--cream); background-size: cover; background-position: center; background-repeat: no-repeat; box-shadow: 0 20px 50px rgba(0,0,0,.6); }
.overlay-banner {
  transform: rotate(-3deg); max-width: min(92vw, 720px); text-align: center;
  font-family: var(--display); font-size: clamp(1.5rem, 4vw, 3rem); color: var(--bill);
  background: var(--ink); padding: 14px 22px; border: 3px solid var(--bill);
  text-shadow: 2px 2px 0 #000; box-shadow: 0 10px 30px rgba(0,0,0,.6);
  animation: slamBanner .45s .18s cubic-bezier(.2,1.6,.4,1) both; line-height: 1.05;
}
.overlay.win .overlay-banner { font-size: clamp(2rem, 6vw, 4.2rem); color: var(--cream); }
.overlay-sub { color: var(--cream-2); font-family: var(--type); font-size: 1rem; text-transform: uppercase; letter-spacing: .12em; text-align: center; }
.overlay-sub:empty { display: none; }
.overlay-honk { font-family: var(--display); color: var(--bill); font-size: 1.6rem; text-shadow: 2px 2px 0 #000; animation: honkPulse 1s infinite; }
.overlay-honk:empty { display: none; }
.overlay-controls { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; max-width: 560px; animation: fadeIn .3s .5s both; }
.overlay-controls .btn { font-size: 1rem; }
.overlay-msg { color: var(--cream); font-family: var(--type); font-size: 1.1rem; }
/* Big Boy intel strip: everyone's card counts, visible during the threat */
.threat-counts { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; width: 100%; margin-bottom: 4px; }
.tc-chip { font-size: .74rem; color: var(--cream-2); background: rgba(0,0,0,.45); border: 1px solid rgba(241,231,207,.25); border-radius: 12px; padding: 3px 10px; }
.tc-chip strong { color: var(--bill); }
.tc-chip.me { border-color: var(--bill); }

/* ---------- menu sound toggle (lobby + waiting room) ---------- */
.menu-sound {
  position: fixed; top: 12px; right: 12px; z-index: 60;
  background: var(--cream); color: var(--ink); border-color: var(--paper-edge);
  font-size: .8rem; padding: 8px 14px; text-transform: uppercase; letter-spacing: .05em;
  box-shadow: 0 3px 10px rgba(0,0,0,.4);
}
.menu-sound:hover { border-color: var(--bill); }

/* ---------- solo button + Host Pass sheet ---------- */
.solo-btn { background: #fbf6e7; color: var(--ink); border-color: var(--paper-edge); margin-top: 8px; }
.solo-btn:hover { border-color: var(--bill); }
.pass-modal { z-index: 160; }
.pass-box { width: min(94vw, 420px); padding: 22px; display: flex; flex-direction: column; gap: 10px; }
.pass-title { font-family: var(--display); font-size: 1.5rem; color: var(--bill-dark); text-align: center; }
.pass-body { font-size: .95rem; color: var(--ink); }
.pass-list { margin: 0; padding-left: 20px; font-size: .9rem; color: var(--ink); line-height: 1.5; }
.pass-note { font-size: .78rem; color: var(--ink-soft); text-align: center; }
/* ⚠️ friends & family callout — REMOVE AT PUBLIC LAUNCH (FREE_FRIEND_CODE) ⚠️ */
.friend-callout { background: var(--bill); color: #2a1500; border: 3px dashed #2a1500; border-radius: 12px; padding: 12px 14px; text-align: center; margin: 4px 0 2px; }
.fc-badge { font-family: var(--type); font-size: .62rem; font-weight: bold; letter-spacing: .16em; opacity: .8; }
.fc-lead { font-family: var(--display); font-size: 1.3rem; line-height: 1.05; margin: 3px 0 6px; }
.fc-how { font-size: .82rem; }
.fc-code { font-family: var(--display); font-size: 1.9rem; letter-spacing: .12em; background: #2a1500; color: var(--bill); border-radius: 8px; padding: 4px 10px; margin-top: 6px; user-select: all; }
.friend-btn { background: var(--good); border-color: #3f5f28; color: #f1f7e9; }
.pass-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.pass-actions .btn-ghost { color: var(--ink); border-color: var(--ink); }
.pass-redeem { display: flex; gap: 8px; }
.pass-redeem .pass-key { flex: 1; min-width: 0; font-size: .85rem; }

/* ---------- how-to-goose (rules) ---------- */
.how-btn { background: transparent; color: var(--ink); border-color: var(--paper-edge); margin-top: 8px; }
.how-btn:hover { border-color: var(--bill); }
/* waiting-room rules button — in the flow under the header, clear of the
   fixed sound pill that used to cover the old corner placement on mobile */
.waiting-how { margin: 0 0 14px; }
/* game topbar keeps Rules + Sound together */
.topbar-btns { display: flex; gap: 8px; align-items: center; }

.rules-modal { z-index: 155; }
.rules-box { width: min(94vw, 560px); max-height: 90vh; padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.rules-body { overflow-y: auto; min-height: 0; padding-right: 6px; color: var(--ink); font-size: .95rem; line-height: 1.5; }
.rules-body .rules-title { font-family: var(--display); font-size: 1.9rem; color: var(--bill-dark); text-align: center; line-height: 1; }
.rules-body .rules-tag { text-align: center; color: var(--ink-soft); font-size: .85rem; margin: 4px 0 10px; }
.rules-body h3 { font-family: var(--display); font-size: 1.25rem; color: var(--bill-dark); margin: 18px 0 4px; }
.rules-body p { margin: 6px 0; }
.rules-body ul { margin: 6px 0; padding-left: 20px; }
.rules-body li { margin: 3px 0; }
.rules-body .rules-outro { font-family: var(--display); font-size: 1.15rem; color: var(--bill-dark); text-align: center; margin-top: 18px; }
.rules-close { align-self: center; }

/* ---------- deck gallery (end of game) ---------- */
.deck-gallery { z-index: 152; align-items: stretch; justify-content: flex-start; overflow-y: auto; padding: 12px; background: rgba(10, 22, 17, .98); }
.gal-box { width: min(96vw, 640px); margin: 0 auto; display: flex; flex-direction: column; gap: 12px; min-height: 100%; padding-bottom: 16px; }
.gal-head { text-align: center; margin-top: 6px; }
.gal-title { font-family: var(--display); font-size: 2rem; color: var(--cream); text-shadow: 3px 3px 0 var(--ink); }
.gal-sub { color: var(--cream-2); font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; margin-top: 4px; }
.gal-tabs { display: flex; gap: 8px; justify-content: center; }
.gal-tab { background: transparent; color: var(--cream); border-color: var(--cream); }
.gal-tab.sel { background: var(--bill); border-color: var(--bill-dark); color: #2a1500; font-weight: bold; }
.gal-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.gal-grid .gal-cell { min-width: 0; }
.gal-grid .card.gal-gridcard { width: 100%; cursor: pointer; }
.gal-grid .card-cap { color: var(--cream); background: rgba(0,0,0,.5); border-radius: 6px; padding: 2px 6px; max-width: 100%; }
.gal-full { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; flex: 1; padding-top: 8px; }
.card.gal-bigcard { width: min(70vw, 46vh, 340px); }
.gal-cap { color: var(--cream); background: rgba(0,0,0,.55); border-radius: 8px; padding: 4px 12px; font-size: 1rem; max-width: 90vw; }
.gal-nav { display: flex; gap: 16px; align-items: center; }
.gal-arrow { font-size: 1.5rem; padding: 6px 18px; background: transparent; color: var(--cream); border-color: var(--cream); }
.gal-pos { color: var(--cream-2); font-family: var(--type); font-size: .9rem; min-width: 70px; text-align: center; }
.gal-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 4px; }

/* ---------- toast ---------- */
.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: var(--cream); border: 2px solid var(--bill);
  padding: 12px 22px; border-radius: 10px; z-index: 120; font-size: .95rem; text-align: center;
  box-shadow: 0 6px 20px rgba(0,0,0,.5); animation: fadeIn .2s;
}

/* ---------- animations ---------- */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slamCard { 0% { transform: scale(2.4) rotate(8deg); opacity: 0; } 60% { opacity: 1; } 100% { transform: scale(1) rotate(-2deg); } }
@keyframes slamBanner { 0% { transform: rotate(-3deg) scale(2.6); opacity: 0; } 100% { transform: rotate(-3deg) scale(1); opacity: 1; } }
@keyframes honkPulse { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: .55; transform: scale(1.08); } }
@keyframes stampIn { 0% { transform: scale(1.8) rotate(-6deg); opacity: 0; } 100% { transform: scale(1) rotate(0); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { * { animation-duration: .01ms !important; } }

/* ---------- audience / spectator view ---------- */
.watch-btn { background: transparent; color: var(--ink); border-color: var(--paper-edge); margin-top: 12px; }
.watch-btn:hover { border-color: var(--bill); }
.spec-badge { font-size: .62rem; font-weight: bold; letter-spacing: .12em; color: #2a1500; background: var(--bill); border-radius: 5px; padding: 2px 7px; text-transform: uppercase; }
/* Spectators have no hand and no actions; scores are private even to them. */
.spectating .myhand { display: none; }
.spectating .stage-actions { display: none; }
.spectating .pscore { display: none; }
.spectating .player { cursor: default; }
/* the live stage is the broadcast focus */
.spectating .play-area { border-style: solid; border-color: rgba(224,122,46,.35); }
.spec-panel-toggle { display: none; position: relative; }
/* unread honk-chat count, top-left of the Log & Chat toggle */
.chat-badge {
  position: absolute; top: -9px; left: -9px; min-width: 22px; height: 22px; padding: 0 5px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bad); color: var(--cream); border: 2px solid var(--cream);
  border-radius: 11px; font-family: var(--type); font-size: .72rem; font-weight: bold; line-height: 1;
  box-shadow: 0 2px 5px rgba(0,0,0,.5);
}
.chat-badge.pulse { animation: badgePulse .55s ease-out; }
@keyframes badgePulse { 0% { transform: scale(1); } 40% { transform: scale(1.55); } 100% { transform: scale(1); } }

/* ---------- host in-game controls (skip / remove) ---------- */
.host-ctl { position: absolute; top: 6px; right: 8px; display: flex; gap: 6px; z-index: 2; }
.hc-btn { font-family: var(--type); font-size: .58rem; text-transform: uppercase; letter-spacing: .05em; padding: 3px 7px; border-radius: 6px; border: 1.5px solid var(--ink); background: var(--ink); color: var(--cream); cursor: pointer; box-shadow: none; }
.hc-btn:hover { filter: brightness(1.2); }
.hc-btn.danger { background: var(--bad); border-color: #7e2018; }
.player.removed { opacity: .55; }
.player.removed .pname { text-decoration: line-through; }

/* ---------- leave game button ---------- */
/* desktop: red button pinned to the bottom-left corner of the page */
.leave-btn {
  background: var(--bad); color: var(--cream); border-color: #7e2018;
  font-weight: bold; text-transform: uppercase; letter-spacing: .04em;
  position: fixed; bottom: 14px; left: 14px; z-index: 50;
  box-shadow: 0 4px 12px rgba(0,0,0,.5);
}
.leave-btn:hover { filter: brightness(1.12); }

/* ---------- winner's hand spread under the win banner ---------- */
.win-hand { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 100%; max-width: min(94vw, 1000px); }
.win-hand:empty { display: none; }
.wh-title { font-family: var(--type); text-transform: uppercase; letter-spacing: .12em; color: var(--cream-2); font-size: .8rem; }
/* One row, always — a big gaggle scrolls sideways instead of wrapping and
   shoving the trophy/buttons off-screen. */
.wh-cards { display: flex; flex-wrap: nowrap; gap: 10px; overflow-x: auto; overflow-y: visible; padding: 4px; width: 100%; -webkit-overflow-scrolling: touch; }
.wh-cards .card-slot { flex: 0 0 auto; }
/* centers the row when it fits; left-anchors the scroll when it doesn't */
.wh-cards .card-slot:first-child { margin-left: auto; }
.wh-cards .card-slot:last-child { margin-right: auto; }
/* names under each winning card — light text on a dark plate (only rendered
   when a card actually has a name) */
.win-hand .card-cap { color: var(--cream); font-weight: bold; background: rgba(0,0,0,.5); border: 1px solid rgba(0,0,0,.65); border-radius: 6px; padding: 2px 6px; max-width: 92px; }

/* Desktop win screen: never clip into the margins. The overlay scrolls when
   tall, and the auto margins center the content only when it fits. */
@media (min-width: 1041px) {
  .overlay.win { overflow-y: auto; justify-content: flex-start; padding: 20px 16px; }
  .overlay.win .overlay-card { margin-top: auto; width: min(30vh, 280px); }
  .overlay.win .overlay-controls { margin-bottom: auto; padding-bottom: 4px; }
}

/* ---------- responsive (mobile only — desktop layout above is untouched) ---------- */
@media (max-width: 1040px) {
  /* Single-column phone layout. We dissolve the left rail + center stage
     (display:contents) so their children become direct items of the column —
     that lets the turn prompt, live stage, and action buttons sit at the very
     top (no scrolling), with the decks, roster and gaggle below them. */
  .table { display: flex; flex-direction: column; overflow-y: auto; }
  .rail-left, .stage { display: contents; }
  .rail { overflow: visible; }
  /* Each lifted panel keeps its natural height (no flex-shrink) so the column
     scrolls instead of squashing — otherwise the buttons collapse and overlap
     the decks. */
  .stage-head, .play-area, .stage-actions, .decks, .players, .watchers, .myhand, .rail-right { flex: 0 0 auto; }

  .stage-head    { order: 1; }                                 /* YOUR TURN prompt */
  .play-area     { order: 2; min-height: 150px; }              /* live play stage */
  /* Draw / Trade / Cancel buttons: pinned near the bottom (just above the
     Log & Chat toggle) so they're always visible no matter where you've
     scrolled. (mobile only) */
  .stage-actions { order: 3; padding: 2px 0; }
  .stage-actions:not(:empty) {
    position: fixed; left: 0; right: 0; bottom: 58px; z-index: 60;
    padding: 10px 12px; background: var(--pond);
    box-shadow: 0 -7px 14px -2px rgba(0,0,0,.55);
  }
  .table { padding-bottom: 160px; }   /* clear the fixed action bar + Log&Chat toggle */
  /* don't trap scrolling inside the trade card list — let the page scroll */
  .trade-stage .ts-cards { max-height: none; overflow: visible; }
  .trade-stage { height: auto; }
  .decks         { order: 4; }                                 /* deck row, full size */
  .players       { order: 5; }                                 /* the stack of players */
  #watchers      { order: 5; }                                 /* birdwatchers, right under the players */
  .myhand        { order: 6; }                                 /* your gaggle, under players */

  /* Log & Chat (+ Sounds + Leave) live in a bottom sheet behind a toggle for
     EVERYONE on mobile (players too) — no more scrolling a long right rail. */
  .rail-right { display: none; }
  .spec-panel-toggle {
    display: block; position: fixed; left: 50%; bottom: 10px; transform: translateX(-50%);
    z-index: 110; background: var(--bill); color: #2a1500; border-color: var(--bill-dark);
    font-weight: bold; text-transform: uppercase; letter-spacing: .05em; box-shadow: 0 4px 14px rgba(0,0,0,.5);
  }
  body.spec-panels-open .rail-right {
    display: flex; flex-direction: column; gap: 12px;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 109;
    max-height: 76vh; overflow-y: auto; padding: 14px 12px 70px;
    background: var(--pond-deep); border-top: 3px solid var(--bill);
    box-shadow: 0 -8px 24px rgba(0,0,0,.5);
  }
  /* Honk Chat above the Activity Log; Sounds then Leave at the bottom. */
  /* Prioritize Honk Chat: tall and never squished; Activity Log is thinner and
     scrolls inside its own box. */
  .rail-right .chat-panel  { order: 1; flex: 0 0 auto; height: clamp(220px, 40vh, 360px); }
  .rail-right .log-panel   { order: 2; flex: 0 0 auto; height: clamp(120px, 20vh, 170px); }
  .rail-right .sound-panel { order: 3; flex: 0 0 auto; }
  .rail-right .leave-btn { order: 4; flex: 0 0 auto; position: static; width: 100%; box-shadow: 0 3px 0 rgba(0,0,0,.3); }

  /* WIN overlay on mobile: scroll top-to-bottom (nothing clipped), small
     trophy, single scrollable row of winning cards, buttons pinned to bottom. */
  .overlay.win { justify-content: flex-start; overflow-y: auto; padding: 16px 12px 0; gap: 12px; }
  .overlay.win .overlay-card { width: min(26vh, 150px); }
  .win-hand { width: 100%; max-width: 100%; }
  .wh-cards { flex-wrap: nowrap; overflow-x: auto; overflow-y: visible; max-height: none; justify-content: flex-start; width: 100%; -webkit-overflow-scrolling: touch; }
  .wh-cards .card-slot { flex: 0 0 auto; }
  .overlay.win .overlay-controls { position: sticky; bottom: 0; width: 100%; margin-top: auto; padding: 12px 0; background: rgba(8,18,14,.96); box-shadow: 0 -6px 14px rgba(0,0,0,.5); z-index: 3; }
  /* Big Boy / threat overlay on mobile: stay centered with a big card (same
     size as a drawn card), not shrunk to a corner or pushed to the bottom. */
  .overlay:not(.win) .overlay-card { width: min(64vw, 300px); }
  /* drawn-card label + buttons sit lower so they clear the card image */
  .draw-caption { bottom: 8%; }
}
