/* Where Do You Stand? Summer camp: pine-green dusk, a mowed athletic field,
   cream bulletin-board panels, camp-counselor orange buttons. */
@font-face { font-family: "Fredoka"; src: url(fonts/fredoka-latin-500-normal.woff2) format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Fredoka"; src: url(fonts/fredoka-latin-600-normal.woff2) format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Fredoka"; src: url(fonts/fredoka-latin-700-normal.woff2) format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Luckiest Guy"; src: url(fonts/luckiest-guy-latin-400-normal.woff2) format("woff2"); font-weight: 400; font-display: swap; }

:root {
  --rtg-bg: #1f3b2c;
  --rtg-panel: #fff8e8;
  --rtg-ink: #2a2a22;
  --rtg-muted: #7b7360;
  --rtg-line: #e6d9bb;
  --rtg-accent: #f26b1d;
  --rtg-accent-dk: #a8450c;
  --rtg-edge: #24412f;
  --rtg-title: #ffd23f;
  --rtg-font: "Fredoka", system-ui, sans-serif;
  --rtg-display: "Luckiest Guy", "Fredoka", system-ui, sans-serif;
  --stage-h: clamp(300px, 56vh, 620px);
}
html { background: #172d21; }
body {
  min-height: 100vh;
  background:
    radial-gradient(ellipse 120% 60% at 50% -10%, #3c6b4b 0%, transparent 60%),
    linear-gradient(#22412f, #172d21) fixed;
}
h1, h2 { font-weight: 400; letter-spacing: .02em; }
.rtg-home h1, .wds-over h1 { text-shadow: 0 4px 0 #0005; }
.rtg-how ol { margin: .4em 0 0; padding-left: 1.3em; display: grid; gap: .35em; }
.rtg-how h2 { color: var(--rtg-title); font-size: 1.3rem; }

/* ---------- lobby: custom topics ---------- */
.wds-custom textarea {
  width: 100%; box-sizing: border-box; resize: vertical; min-height: 90px;
  font: 500 1rem/1.4 var(--rtg-font); color: var(--rtg-ink); background: #fff;
  border: 2px solid var(--rtg-line); border-radius: 10px; padding: .6em .8em;
}
.wds-custom p { margin: 0 0 .6em; font-size: .9rem; }
.wds-custom-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 8px; font-size: .85rem; }
.wds-custom-list { margin: 0; padding-left: 1.2em; display: grid; gap: .25em; }
.wds-custom-list i { color: var(--rtg-muted); font-style: normal; font-size: .85em; }

/* ---------- game screen ---------- */
.wds { max-width: 1240px; margin: 0 auto; padding: 10px 16px 40px; display: grid; gap: 10px; box-sizing: border-box; }
.wds-bar {
  display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; align-items: center; gap: 8px 14px;
  color: #fff; min-height: 40px;
}
.wds-round { font: 400 1.15rem var(--rtg-display); color: var(--rtg-title); letter-spacing: .03em; white-space: nowrap; }
.wds-code { font-weight: 700; letter-spacing: .2em; padding: .15em .6em; border: 2px solid #ffffff40; border-radius: 99px; font-size: .9rem; }
.wds-gm { opacity: .85; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wds-tools { display: flex; gap: 6px; justify-content: flex-end; }
.wds-tools .rtg-btn { color: #fff; border-color: #ffffff55; }

.wds-topic { text-align: center; color: #fff; min-height: 64px; display: grid; align-content: center; }
.wds-ask { font-size: .95rem; opacity: .75; letter-spacing: .06em; text-transform: uppercase; font-weight: 600; }
.wds-flags { font: 400 clamp(1.4rem, 4vw, 2.3rem)/1.15 var(--rtg-display); text-wrap: balance; }
.wds-flags i, .wds-card-flags i { font: 600 .55em var(--rtg-font); font-style: normal; opacity: .7; margin: 0 .2em; vertical-align: middle; }
.wds-flag { color: #fff; text-shadow: 0 3px 0 color-mix(in srgb, var(--fc) 75%, #000), 0 0 0 var(--fc); border-bottom: .12em solid var(--fc); }

.wds-stage {
  position: relative; height: var(--stage-h); border-radius: 22px; overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 120%, #2c5a35 0%, transparent 70%),
    linear-gradient(#2a5236, #1f4129);
  border: 3px solid #0f2418; box-shadow: inset 0 0 40px #0006, 0 10px 30px #0005;
}
.wds-stage canvas { position: absolute; inset: 0; display: block; touch-action: none; user-select: none; -webkit-user-select: none; cursor: crosshair; }

/* Game-show countdown ring */
.wds-timer { position: absolute; top: 12px; right: 12px; width: 78px; height: 78px; pointer-events: none; filter: drop-shadow(0 4px 6px #0006); }
.wds-timer svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.wds-timer circle { fill: #10261a; stroke-width: 9; }
.wds-timer .bg { stroke: #ffffff26; }
.wds-timer .fg { fill: none; stroke: var(--rtg-title); stroke-dasharray: 100; stroke-linecap: round; transition: stroke .2s; }
.wds-timer b { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font: 400 2rem var(--rtg-display); padding-top: 4px; }
.wds-timer.urgent .fg { stroke: #ff5a3c; }
.wds-timer.urgent b { color: #ffd0c4; animation: wds-throb .5s ease-in-out infinite alternate; }
@keyframes wds-throb { to { transform: scale(1.15); } }

/* Big moments over the field */
.wds-msg { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.wds-card {
  background: var(--rtg-panel); border: 3px solid var(--rtg-edge); border-radius: 20px; box-shadow: var(--rtg-shadow);
  padding: 18px 26px; text-align: center; max-width: min(560px, 86%); animation: wds-drop .5s cubic-bezier(.2, 1.4, .4, 1);
}
.wds-card small { color: var(--rtg-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .08em; }
.wds-card-flags { font: 400 clamp(1.5rem, 4.5vw, 2.6rem)/1.15 var(--rtg-display); margin: .25em 0; color: var(--rtg-ink); }
.wds-card .wds-flag { color: var(--fc); text-shadow: none; border: 0; }
.wds-card p { margin: 0; color: var(--rtg-muted); }
@keyframes wds-drop { from { transform: translateY(-40px) scale(.8); opacity: 0; } }
.wds-big {
  font: 400 clamp(3rem, 12vw, 7rem)/1 var(--rtg-display); color: #fff; letter-spacing: .04em;
  text-shadow: 0 6px 0 #0007, 0 0 30px #0008; animation: wds-slam .45s cubic-bezier(.2, 1.6, .4, 1);
}
.wds-big.go { color: #b6ff8c; }
.wds-big.freeze { color: #bfe9ff; }
.wds-big.reveal { color: var(--rtg-title); animation: wds-slam .45s cubic-bezier(.2, 1.6, .4, 1), wds-wiggle 1.1s ease-in-out .45s; }
@keyframes wds-slam { from { transform: scale(2.4); opacity: 0; } }
@keyframes wds-wiggle { 25% { transform: rotate(-4deg) scale(1.05); } 75% { transform: rotate(4deg) scale(1.05); } }
.wds-whisper {
  align-self: start; margin-top: 14px; background: #10261acc; color: #fff; padding: .4em 1em; border-radius: 99px;
  font-weight: 600; animation: wds-fade .5s ease-out;
}
@keyframes wds-fade { from { opacity: 0; transform: translateY(-8px); } }

/* Below the field */
.wds-lower { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 12px; align-items: start; }
.wds-panel { min-height: 170px; }
.wds-panel h2, .wds-tracker h2 { font-size: 1.4rem; margin-bottom: .35em; }
.wds-panel p { margin: .3em 0; }
.wds-skip { margin-top: 6px; }
.wds-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.wds-row:empty { display: none; }
.wds-near b { color: color-mix(in srgb, var(--c) 70%, #000); }
.wds-queue { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.wds-queue li { display: flex; align-items: center; gap: .5em; padding: .45em .7em; border-radius: 12px; background: #f3ead2; font-size: 1.05rem; }
.wds-queue li em { margin-left: auto; font-style: normal; font-size: .85rem; color: var(--rtg-muted); }
.wds-queue li.now { background: #ffe9a8; box-shadow: 0 0 0 2.5px var(--rtg-title) inset; }
.wds-queue li.now em { color: var(--rtg-ink); font-weight: 600; }
.wds-queue li.done { opacity: .55; }
.wds-you-up { font-weight: 600; color: var(--rtg-accent-dk); }
.wds-hands { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.wds-hands h3 { margin: 0 6px 0 0; font-size: .9rem; color: var(--rtg-muted); }
.wds-hands-line { font-weight: 600; }
.wds-hint { font-size: .85rem; margin-top: 10px !important; }

.wds-tracker .rtg-note { font: 600 .8rem var(--rtg-font); }
.wds-track { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 6px 10px; }
.wds-track li { display: flex; align-items: center; gap: .4em; min-width: 0; font-size: .92rem; }
.wds-track li.away { opacity: .4; }
.wds-track li em { font-style: normal; color: #2e8b3a; font-weight: 700; font-size: .85rem; }
.wds-track li:not(.shared) .wds-dot { filter: saturate(.35) opacity(.75); }
.wds-tname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wds-dot {
  flex: none; display: inline-grid; place-items: center; width: 1.9em; height: 1.9em; border-radius: 50%;
  background: var(--c); color: #fff; font-size: .72rem; font-weight: 700; border: 2px solid #fff; box-shadow: 0 1px 2px #0004;
  text-shadow: 0 1px 1px #0006;
}
.wds-role { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 12px; padding-top: 10px; border-top: 1.5px solid var(--rtg-line); font-size: .85rem; color: var(--rtg-muted); }
.wds-role select { font: 500 .9rem var(--rtg-font); border: 2px solid var(--rtg-line); border-radius: 8px; padding: .3em .5em; background: #fff; }

/* ---------- the wrap-up ---------- */
.wds-over { max-width: 620px; margin: 0 auto; padding: 32px 18px 60px; display: grid; gap: 16px; text-align: center; }
.wds-over h1 { color: var(--rtg-title); font-size: clamp(2.4rem, 9vw, 3.6rem); margin: 0; }
.wds-buddy { color: #fff; font-size: 1.2rem; margin: 0; }
.wds-buddy b { color: var(--rtg-title); }
.wds-wait { color: #fff; opacity: .8; }
.wds-summary { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; text-align: left; }
.wds-summary li { display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; align-items: center; gap: 4px 10px; font-size: .95rem; }
.wds-summary li.me { background: #ffe9a8; border-radius: 10px; padding: 4px 6px; margin: 0 -6px; }
.wds-summary em { font-style: normal; color: var(--rtg-muted); font-size: .85rem; white-space: nowrap; }

/* ---------- phones ---------- */
@media (max-width: 760px) {
  :root { --stage-h: clamp(300px, 60vh, 640px); }
  .wds { padding: 8px 10px 30px; gap: 8px; }
  .wds-bar { grid-template-columns: auto auto minmax(0, 1fr); }
  .wds-gm { display: none; }
  .wds-tools { grid-column: 3; }
  .wds-tools [data-wds="bigscreen"], .wds-tools [data-wds="end"] { display: none; }
  .wds-topic { min-height: 54px; }
  .wds-stage { border-radius: 16px; }
  .wds-timer { width: 60px; height: 60px; top: 8px; right: 8px; }
  .wds-timer b { font-size: 1.5rem; }
  .wds-lower { grid-template-columns: minmax(0, 1fr); }
  .wds-panel { min-height: 150px; }
  .wds-summary li { grid-template-columns: auto minmax(0, 1fr) auto; }
  .wds-summary li > span:not(.wds-dot) { grid-column: 2 / 4; font-size: .85rem; }
}

/* ---------- the big screen: the field is the show ---------- */
.wds.watching { --stage-h: clamp(320px, 74vh, 980px); max-width: 1600px; }
.wds.watching .wds-lower { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
