/* ============================================================
   Truth or Dare — game styles (mobile-first, no framework).
   Visual language matches game_redesign.css (Poppins, soft cards,
   bold gradient accents). Play surface is chrome-free full-screen.
   ============================================================ */

:root {
  --td-bg: #120d1d;
  --td-bg2: #1d1430;
  --td-card: #241a3a;
  --td-card2: #2e2249;
  --td-line: rgba(255, 255, 255, .09);
  --td-text: #f4effe;
  --td-dim: #b9aed6;
  --td-accent: #ff4d6d;
  --td-accent2: #ff8a3d;
  --td-truth: #4da3ff;
  --td-dare: #ff4d6d;
  --td-good: #3ee0a6;
  --td-bad: #ff4d6d;
  --td-gold: #ffc26b;
  --td-radius: 18px;
  --td-font: 'Poppins', system-ui, -apple-system, sans-serif;
}

.td-body {
  background: radial-gradient(1200px 600px at 50% -100px, var(--td-bg2), var(--td-bg)) fixed;
  color: var(--td-text);
  font-family: var(--td-font);
  min-height: 100vh;
}
.td-body a { text-decoration: none; }

.td-hidden { display: none !important; }
.td-center { text-align: center; }

.td-wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 20px 16px 64px;
}

/* ---------- lean top bar (play/lobby) ---------- */
.td-topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px;
  background: rgba(18, 13, 29, .82);
  backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 40;
  border-bottom: 1px solid var(--td-line);
}
.td-topbrand { display: flex; align-items: center; gap: 8px; color: var(--td-text); font-weight: 700; }
.td-topbrand-emoji { font-size: 1.2rem; }
.td-topbrand-logo { display: block; width: 28px; height: 28px; object-fit: contain; }

/* ---------- flash errors ---------- */
.td-flash-err {
  max-width: 720px; margin: 12px auto 0; padding: 12px 16px;
  background: rgba(255, 77, 109, .14); border: 1px solid rgba(255, 77, 109, .4);
  border-radius: 12px; color: #ffd7de; font-weight: 600; font-size: .92rem;
}

/* ---------- typography / shared ---------- */
.td-h1 { font-size: 1.7rem; font-weight: 800; margin: 10px 0; }
.td-h2 { font-size: 1.2rem; font-weight: 700; margin: 0 0 12px; }
.td-pill {
  display: inline-block; padding: 6px 14px; border-radius: 999px;
  background: rgba(255, 138, 61, .14); border: 1px solid rgba(255, 138, 61, .4);
  color: var(--td-gold); font-weight: 700; font-size: .8rem;
}
.td-label { display: block; font-weight: 700; font-size: .95rem; margin-bottom: 6px; }
.td-sub { color: var(--td-dim); font-size: .85rem; margin: 2px 0 10px; }

.td-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: 999px; border: 0; cursor: pointer;
  background: linear-gradient(135deg, var(--td-accent), var(--td-accent2));
  color: #fff; font-family: var(--td-font); font-weight: 700; font-size: 1rem;
  box-shadow: 0 8px 24px rgba(255, 77, 109, .35);
  transition: transform .15s ease, box-shadow .15s ease;
}
.td-btn:hover { transform: translateY(-2px); color: #fff; }
.td-btn:active { transform: translateY(0) scale(.98); }
.td-btn-lg { padding: 15px 30px; font-size: 1.1rem; }
.td-btn-ghost {
  background: transparent; border: 2px solid var(--td-line);
  color: var(--td-text); box-shadow: none;
}
.td-btn-sm { padding: 8px 16px; font-size: .85rem; }
.td-btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }

.td-input {
  width: 100%; padding: 12px 14px; border-radius: 12px;
  border: 1.5px solid var(--td-line); background: var(--td-card);
  color: var(--td-text); font-family: var(--td-font); font-size: 1rem;
}
.td-input:focus { outline: none; border-color: var(--td-accent2); }
.td-input-err { border-color: var(--td-bad) !important; }

.td-card-box {
  background: var(--td-card); border: 1px solid var(--td-line);
  border-radius: var(--td-radius); padding: 18px; margin-bottom: 16px;
}

/* ---------- home ---------- */
.td-hero { text-align: center; padding: 26px 0 18px; }
.td-hero-title {
  font-size: 2rem; font-weight: 800; line-height: 1.2; margin: 14px 0 10px;
  background: linear-gradient(135deg, #fff, var(--td-gold));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.td-hero-sub { color: var(--td-dim); font-size: .98rem; max-width: 560px; margin: 0 auto; }

.td-resume-banner {
  display: block; text-align: center; margin: 0 0 14px; padding: 12px 16px;
  border-radius: 12px; background: rgba(62, 224, 166, .12);
  border: 1px solid rgba(62, 224, 166, .4); color: var(--td-good); font-weight: 700;
}
.td-record-card {
  display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; align-items: center;
  margin: 0 0 18px; padding: 10px 16px; border-radius: 12px;
  background: rgba(255, 194, 107, .1); border: 1px solid rgba(255, 194, 107, .35);
  color: var(--td-gold); font-size: .92rem;
}

.td-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 8px 0 18px; }
.td-mode-card {
  display: flex; flex-direction: column; gap: 4px; text-align: left;
  padding: 18px 16px; border-radius: var(--td-radius); cursor: pointer;
  background: var(--td-card); border: 1.5px solid var(--td-line);
  color: var(--td-text); font-family: var(--td-font);
  transition: transform .15s ease, border-color .15s ease;
}
.td-mode-card:hover { transform: translateY(-3px); border-color: var(--td-accent2); color: var(--td-text); }
.td-mode-emoji { font-size: 1.9rem; }
.td-mode-name { font-weight: 800; font-size: 1.05rem; }
.td-mode-sub { color: var(--td-dim); font-size: .8rem; line-height: 1.35; }
.td-mode-pass { border-color: rgba(255, 138, 61, .5); }

.td-code-form { margin: 0 0 20px; }
.td-code-row { display: flex; gap: 10px; }
.td-code-input { text-transform: uppercase; letter-spacing: .3em; font-weight: 700; }

.td-how { margin-top: 8px; }
.td-how-list { color: var(--td-dim); padding-left: 22px; display: grid; gap: 8px; font-size: .95rem; }

.td-noroom { padding: 60px 0; }
.td-noroom-emoji { font-size: 3.4rem; }

/* ---------- setup wizard ---------- */
.td-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.td-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 14px; border-radius: 999px; cursor: pointer; user-select: none;
  background: var(--td-card2); border: 1.5px solid var(--td-line);
  color: var(--td-text); font-weight: 600; font-size: .88rem; font-family: var(--td-font);
}
.td-chip.selected { border-color: var(--td-accent2); background: rgba(255, 138, 61, .16); }
.td-chip.disabled { opacity: .38; cursor: not-allowed; }
.td-chip-count { color: var(--td-dim); font-size: .74rem; }
.td-chip .td-eye { margin-left: 2px; opacity: .7; }

.td-player-row { display: flex; gap: 8px; margin-bottom: 8px; align-items: center; }
.td-player-emoji {
  flex: 0 0 46px; height: 46px; border-radius: 12px; font-size: 1.3rem;
  background: var(--td-card2); border: 1.5px solid var(--td-line); cursor: pointer;
}
.td-player-del {
  flex: 0 0 38px; height: 38px; border-radius: 10px; border: 0; cursor: pointer;
  background: rgba(255, 77, 109, .15); color: var(--td-bad); font-weight: 800;
}
.td-pool-note { border-radius: 12px; padding: 10px 14px; font-size: .88rem; font-weight: 600; }
.td-pool-ok  { background: rgba(62, 224, 166, .1); color: var(--td-good); }
.td-pool-low { background: rgba(255, 77, 109, .12); color: #ffb3c0; }

.td-seg { display: flex; gap: 6px; flex-wrap: wrap; }
.td-seg .td-chip { flex: 1; justify-content: center; min-width: 72px; }

.td-range-row { display: flex; align-items: center; gap: 12px; }
.td-range-val { min-width: 44px; text-align: center; font-weight: 800; color: var(--td-gold); }
.td-timer-row {
  display: grid;
  grid-template-columns: minmax(112px, auto) minmax(140px, 1fr);
  gap: 12px;
  align-items: center;
  margin-top: 12px;
}
.td-timer-row strong {
  color: var(--td-text);
  white-space: nowrap;
}
.td-timer-row input[type="range"] {
  width: 100%;
  accent-color: var(--td-dare);
}
.td-timer-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.td-modal {
  position: fixed; inset: 0; z-index: 90; display: flex; align-items: center; justify-content: center;
  background: rgba(5, 3, 10, .72); padding: 20px;
}
.td-modal-card {
  width: 100%; max-width: 440px; max-height: 80vh; overflow-y: auto;
  background: var(--td-card); border: 1px solid var(--td-line);
  border-radius: var(--td-radius); padding: 20px;
}
.td-sample { padding: 10px 12px; border-radius: 10px; background: var(--td-card2); margin-top: 8px; font-size: .9rem; }

/* ---------- play surface ---------- */
.td-play-wrap { max-width: 560px; margin: 0 auto; padding: 14px 14px 40px; }

.td-hud {
  display: flex; justify-content: space-between; align-items: center;
  font-size: .82rem; color: var(--td-dim); margin-bottom: 12px; gap: 8px;
}
.td-hud-round { font-weight: 700; color: var(--td-text); }
.td-hud-leave { color: var(--td-bad); background: none; border: 0; cursor: pointer; font-family: var(--td-font); font-size: .82rem; }

.td-players-strip { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 14px; }
.td-pchip {
  flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 2px;
  min-width: 64px; padding: 8px 10px; border-radius: 14px;
  background: var(--td-card); border: 1.5px solid var(--td-line); font-size: .72rem;
}
.td-pchip.actor { border-color: var(--td-gold); background: rgba(255, 194, 107, .1); }
.td-pchip.offline { opacity: .45; }
.td-pchip-emoji { font-size: 1.25rem; }
.td-pchip-name { font-weight: 700; max-width: 72px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.td-pchip-pts { color: var(--td-gold); font-weight: 700; }
.td-pchip-meta { color: var(--td-dim); }

/* pass interstitial — full screen, NO ads (mis-tap protection) */
.td-pass-screen {
  position: fixed; inset: 0; z-index: 80; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 14px; text-align: center;
  background: radial-gradient(800px 500px at 50% 20%, var(--td-bg2), var(--td-bg));
  padding: 30px; cursor: pointer;
}
.td-pass-label { color: var(--td-dim); font-size: 1rem; font-weight: 600; }
.td-pass-emoji { font-size: 3.6rem; }
.td-pass-name { font-size: 2.2rem; font-weight: 800; color: var(--td-gold); }
.td-pass-hint { color: var(--td-dim); font-size: .85rem; margin-top: 18px; }

/* choose phase */
.td-choose { text-align: center; padding: 24px 0; }
.td-choose-title { font-size: 1.5rem; font-weight: 800; margin-bottom: 20px; }
.td-choose-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.td-choose-truth, .td-choose-dare {
  padding: 30px 10px; border-radius: var(--td-radius); border: 0; cursor: pointer;
  font-family: var(--td-font); font-weight: 800; font-size: 1.3rem; color: #fff;
  transition: transform .15s ease;
}
.td-choose-truth { background: linear-gradient(160deg, #2563eb, var(--td-truth)); }
.td-choose-dare  { background: linear-gradient(160deg, #be123c, var(--td-dare)); }
.td-choose-truth:active, .td-choose-dare:active { transform: scale(.97); }
.td-choose-spin { margin-top: 14px; }

/* prompt card */
.td-card {
  position: relative; border-radius: 22px; padding: 26px 20px 20px; margin: 4px 0 16px;
  background: linear-gradient(165deg, var(--td-card2), var(--td-card));
  border: 1.5px solid var(--td-line); text-align: center;
  animation: tdFlip .45s ease;
}
@keyframes tdFlip { from { transform: rotateY(70deg); opacity: 0; } to { transform: none; opacity: 1; } }
.td-card-type {
  display: inline-block; padding: 4px 14px; border-radius: 999px;
  font-weight: 800; font-size: .78rem; letter-spacing: .12em; margin-bottom: 14px;
}
.td-card.truth .td-card-type { background: rgba(77, 163, 255, .16); color: var(--td-truth); }
.td-card.dare .td-card-type, .td-card.forfeit .td-card-type { background: rgba(255, 77, 109, .16); color: var(--td-dare); }
.td-card-emoji { font-size: 2.2rem; display: block; margin-bottom: 8px; }
.td-card-text { font-size: 1.25rem; font-weight: 700; line-height: 1.4; }
.td-card-target { margin-top: 10px; color: var(--td-gold); font-weight: 700; font-size: .9rem; }
.td-card-heat { position: absolute; top: 14px; right: 14px; font-size: .8rem; }

/* countdown ring */
.td-timer { display: flex; justify-content: center; margin: 6px 0 14px; }
.td-timer svg { width: 74px; height: 74px; transform: rotate(-90deg); }
.td-timer circle { fill: none; stroke-width: 6; }
.td-timer .bg { stroke: var(--td-line); }
.td-timer .fg { stroke: var(--td-good); stroke-linecap: round; transition: stroke-dashoffset 1s linear, stroke .4s; }
.td-timer.amber .fg { stroke: var(--td-gold); }
.td-timer.red .fg { stroke: var(--td-bad); }
.td-timer-num {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 1.05rem;
}
.td-timer-box { position: relative; width: 74px; height: 74px; }

/* actions */
.td-actions { display: flex; flex-direction: column; gap: 10px; }
.td-actions-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.td-verdict-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 8px; }
.td-verdict-yes { background: linear-gradient(135deg, #059669, var(--td-good)); box-shadow: 0 8px 24px rgba(62,224,166,.3); }
.td-verdict-no  { background: linear-gradient(135deg, #9f1239, var(--td-bad)); }

/* result flash */
.td-result-pop {
  text-align: center; padding: 14px; border-radius: 14px; margin-bottom: 12px;
  font-weight: 800; font-size: 1.1rem; animation: tdPop .3s ease;
}
.td-result-pop.good { background: rgba(62, 224, 166, .13); color: var(--td-good); }
.td-result-pop.bad  { background: rgba(255, 77, 109, .13); color: #ffb3c0; }
@keyframes tdPop { from { transform: scale(.8); opacity: 0; } to { transform: none; opacity: 1; } }

/* feed */
.td-feed { margin-top: 18px; border-top: 1px solid var(--td-line); padding-top: 12px; }
.td-feed-item { color: var(--td-dim); font-size: .8rem; padding: 3px 0; }
.td-feed-item strong { color: var(--td-text); }

/* rate / report row */
.td-rate-row { display: flex; justify-content: center; gap: 14px; margin-top: 10px; }
.td-rate-btn { background: none; border: 0; cursor: pointer; font-size: 1.05rem; opacity: .6; }
.td-rate-btn.on, .td-rate-btn:hover { opacity: 1; }
.td-report-link { color: var(--td-dim); font-size: .76rem; background: none; border: 0; cursor: pointer; }

/* ---------- results ---------- */
.td-podium { display: flex; align-items: flex-end; justify-content: center; gap: 10px; margin: 22px 0; }
.td-podium-slot { text-align: center; flex: 1; max-width: 130px; }
.td-podium-base {
  border-radius: 12px 12px 0 0; background: var(--td-card2);
  border: 1px solid var(--td-line); border-bottom: 0; padding-top: 10px;
}
.td-podium-1 .td-podium-base { height: 96px; background: linear-gradient(180deg, rgba(255,194,107,.25), var(--td-card2)); }
.td-podium-2 .td-podium-base { height: 68px; }
.td-podium-3 .td-podium-base { height: 50px; }
.td-podium-emoji { font-size: 2rem; }
.td-podium-name { font-weight: 800; font-size: .95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.td-podium-pts { color: var(--td-gold); font-weight: 700; font-size: .85rem; }
.td-podium-medal { font-size: 1.3rem; }

.td-sups { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 18px 0; }
.td-sup {
  padding: 12px; border-radius: 14px; background: var(--td-card);
  border: 1px solid var(--td-line); text-align: center;
}
.td-sup-badge { font-weight: 800; font-size: .95rem; }
.td-sup-who { color: var(--td-gold); font-weight: 700; font-size: .9rem; margin-top: 2px; }
.td-sup-desc { color: var(--td-dim); font-size: .72rem; }

.td-lb-table { width: 100%; border-collapse: collapse; margin: 10px 0 18px; }
.td-lb-table td { padding: 9px 8px; border-bottom: 1px solid var(--td-line); font-size: .92rem; }
.td-lb-rank { color: var(--td-dim); width: 30px; }
.td-lb-pts { text-align: right; font-weight: 800; color: var(--td-gold); }
.td-lb-meta { color: var(--td-dim); font-size: .76rem; }

.td-series-box { text-align: center; margin: 14px 0; padding: 12px; border-radius: 14px; background: rgba(77, 163, 255, .1); border: 1px solid rgba(77, 163, 255, .35); }
.td-series-lead { font-weight: 800; color: var(--td-truth); }

.td-results-ctas { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 20px; }
.td-empty-state { text-align: center; padding: 40px 10px; }
.td-empty-emoji { font-size: 3.4rem; }

#td-confetti { position: fixed; inset: 0; pointer-events: none; z-index: 60; }

/* ---------- lobby ---------- */
.td-lobby-code {
  text-align: center; font-size: 2rem; font-weight: 800; letter-spacing: .35em;
  color: var(--td-gold); padding: 14px; border-radius: 14px;
  background: var(--td-card); border: 1.5px dashed rgba(255, 194, 107, .5); margin: 12px 0;
}
.td-share-row { display: flex; gap: 8px; margin: 10px 0 16px; }
.td-lobby-list { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; }
.td-lobby-player {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px;
  border-radius: 12px; background: var(--td-card); border: 1px solid var(--td-line);
}
.td-lobby-player .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--td-good); }
.td-lobby-player.offline .dot { background: var(--td-dim); }
.td-lobby-host-tag { margin-left: auto; font-size: .72rem; color: var(--td-gold); font-weight: 700; }

/* ---------- ttl banner + custom prompt review ---------- */
.td-ttl-note {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  margin: 10px 0; padding: 8px 14px; border-radius: 12px; font-size: .84rem; font-weight: 700;
  background: rgba(255, 194, 107, .14); border: 1px solid rgba(255, 194, 107, .45); color: var(--td-gold);
}
.td-custom-strip {
  margin: 12px 0; padding: 10px 12px; border-radius: 12px;
  background: var(--td-card); border: 1px dashed rgba(255, 194, 107, .5);
}
.td-custom-item {
  display: flex; align-items: center; gap: 8px; padding: 6px 0; font-size: .86rem;
}
.td-custom-item .td-custom-text { flex: 1; }
.td-custom-item em { color: var(--td-dim); font-size: .74rem; }

/* ---------- misc ---------- */
.td-offline-note {
  position: fixed; bottom: 14px; left: 50%; transform: translateX(-50%); z-index: 95;
  background: rgba(255, 194, 107, .95); color: #241a00; font-weight: 700; font-size: .84rem;
  padding: 8px 18px; border-radius: 999px;
}

@media (min-width: 640px) {
  .td-hero-title { font-size: 2.5rem; }
  .td-modes { grid-template-columns: repeat(4, 1fr); }
  .td-mode-card { text-align: center; align-items: center; }
  .td-sups { grid-template-columns: repeat(3, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .td-card, .td-result-pop { animation: none; }
}

/* ============================================================
   Truth or Dare theme refresh.
   ============================================================ */

:root {
  --td-bg: #100b0f;
  --td-bg2: #181013;
  --td-card: rgba(27, 20, 26, .92);
  --td-card2: rgba(38, 30, 38, .94);
  --td-line: rgba(255, 255, 255, .13);
  --td-line-strong: rgba(255, 255, 255, .22);
  --td-text: #fff8f3;
  --td-dim: #d1c1c7;
  --td-accent: #f43f5e;
  --td-accent2: #f59e0b;
  --td-truth: #22d3ee;
  --td-dare: #fb3f67;
  --td-good: #34d399;
  --td-bad: #fb3f67;
  --td-gold: #fbbf24;
  --td-radius: 8px;
  --td-shadow: 0 18px 46px rgba(0, 0, 0, .34);
}

html:has(body.td-body) {
  overflow-x: hidden;
}

.td-body {
  position: relative;
  overflow-x: hidden;
  background:
    linear-gradient(118deg, rgba(34, 211, 238, .13) 0%, transparent 31%),
    linear-gradient(242deg, rgba(244, 63, 94, .18) 0%, transparent 34%),
    linear-gradient(180deg, #11090d 0%, #180f11 48%, #0e1414 100%) fixed;
}
.td-body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: .28;
  background:
    repeating-linear-gradient(135deg, rgba(255,255,255,.05) 0 1px, transparent 1px 22px),
    linear-gradient(90deg, rgba(34,211,238,.06), transparent 35%, rgba(244,63,94,.07));
}
.td-body > * {
  position: relative;
  z-index: 1;
}
.td-body *,
.td-body *::before,
.td-body *::after {
  box-sizing: border-box;
}

.td-wrap {
  width: min(100% - 28px, 1120px);
  max-width: none;
  padding: 28px 0 72px;
}
.td-page-setup .td-wrap { width: min(100% - 28px, 1180px); }
.td-page-join .td-wrap,
.td-page-noroom .td-wrap { width: min(100% - 28px, 760px); }
.td-page-results .td-wrap { width: min(100% - 28px, 980px); }

/* Admin-configured fixed ad slots. Truth or Dare's lean lobby/play pages do
   not load the legacy global stylesheet, so the shared partial needs its
   complete responsive contract here as well. */
.td-body .ad-shell {
  display: block;
  width: 100%;
  max-width: 100%;
  min-height: 100px;
  margin: 18px auto;
  overflow: hidden;
  clear: both;
  text-align: center;
}
.td-body .ad-shell > .ad,
.td-body .ad-shell > .adbanner {
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  text-align: center;
}
.td-body .ad-shell ins,
.td-body .ad-shell iframe {
  max-width: 100%;
}
.td-page-play .td-play-wrap > .ad-shell {
  grid-column: 1 / -1;
}

.td-topbar {
  border-bottom: 1px solid rgba(255,255,255,.12);
  background:
    linear-gradient(90deg, rgba(34,211,238,.12), rgba(244,63,94,.10)),
    rgba(12, 8, 12, .86);
  box-shadow: 0 12px 30px rgba(0,0,0,.22);
}
.td-topbrand {
  min-width: 0;
}
.td-topbrand-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.td-hero {
  position: relative;
  text-align: left;
  padding: 28px 0 22px;
}
.td-home-hero {
  min-height: 300px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(230px, 320px);
  align-items: center;
  gap: 28px;
}
.td-hero-copy {
  min-width: 0;
}
.td-hero-art {
  justify-self: end;
  width: min(100%, 300px);
  aspect-ratio: 1;
  padding: 12px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(34,211,238,.14), transparent 42%),
    linear-gradient(315deg, rgba(244,63,94,.18), transparent 45%),
    rgba(255,255,255,.055);
  box-shadow: var(--td-shadow);
}
.td-hero-art img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border-radius: 6px;
}
.td-hero::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 160px;
  height: 2px;
  background: linear-gradient(90deg, var(--td-truth), var(--td-gold), var(--td-dare));
}
.td-page-home .td-hero::after {
  width: min(48vw, 440px);
}
.td-hero-title {
  max-width: 760px;
  margin: 12px 0 12px;
  font-size: clamp(2.2rem, 4.8vw, 4.6rem);
  line-height: .98;
  letter-spacing: 0;
  background: linear-gradient(95deg, #ffffff 0%, var(--td-truth) 33%, var(--td-gold) 56%, var(--td-dare) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.td-hero-sub {
  max-width: 620px;
  margin: 0;
  color: #e7d8df;
  font-size: 1.02rem;
  line-height: 1.6;
}
.td-pill {
  border-radius: 8px;
  color: #ffe8b2;
  background: linear-gradient(135deg, rgba(245,158,11,.18), rgba(244,63,94,.10));
  border-color: rgba(245,158,11,.42);
}

.td-card-box,
.td-mode-card,
.td-sup,
.td-series-box,
.td-lobby-panel,
.td-card,
.td-modal-card {
  border-radius: 8px;
}
.td-card-box,
.td-lobby-panel {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(34,211,238,.055), transparent 28%),
    linear-gradient(315deg, rgba(244,63,94,.075), transparent 32%),
    var(--td-card);
  border: 1px solid var(--td-line);
  box-shadow: 0 12px 34px rgba(0,0,0,.22);
}
.td-card-box::before,
.td-lobby-panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, var(--td-truth), var(--td-gold), var(--td-dare));
  opacity: .8;
}
.td-label {
  color: #fffaf5;
  letter-spacing: 0;
}
.td-sub {
  color: var(--td-dim);
  line-height: 1.5;
}
.td-h1,
.td-h2 {
  letter-spacing: 0;
}

.td-btn {
  min-height: 44px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--td-dare), #f97316);
  box-shadow: 0 12px 26px rgba(244, 63, 94, .26);
  white-space: normal;
  text-align: center;
}
.td-btn-ghost {
  border: 1px solid var(--td-line-strong);
  background: rgba(255,255,255,.045);
  box-shadow: none;
}
.td-btn-ghost:hover {
  border-color: rgba(34,211,238,.42);
  background: rgba(34,211,238,.08);
}
.td-input {
  min-height: 46px;
  border-radius: 8px;
  background: rgba(14, 11, 15, .66);
  border-color: var(--td-line);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05);
}
.td-input:focus {
  border-color: rgba(34,211,238,.72);
  box-shadow: 0 0 0 3px rgba(34,211,238,.14);
}

.td-modes {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0 20px;
}
.td-mode-card {
  min-height: 162px;
  padding: 18px;
  position: relative;
  overflow: hidden;
  border-color: rgba(255,255,255,.15);
  background:
    linear-gradient(145deg, rgba(255,255,255,.08), rgba(255,255,255,.025)),
    rgba(25,18,23,.9);
}
.td-mode-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: linear-gradient(90deg, var(--td-truth), var(--td-dare));
}
.td-mode-solo::before { background: linear-gradient(90deg, var(--td-good), var(--td-truth)); }
.td-mode-pass::before { background: linear-gradient(90deg, var(--td-gold), #f97316); }
.td-mode-live::before { background: linear-gradient(90deg, var(--td-truth), #6366f1); }
.td-mode-join::before { background: linear-gradient(90deg, var(--td-dare), var(--td-gold)); }
.td-mode-card:hover {
  border-color: rgba(255,255,255,.28);
  box-shadow: 0 16px 36px rgba(0,0,0,.28);
}
.td-mode-emoji {
  font-size: 2.15rem;
  line-height: 1;
}
.td-mode-name,
.td-mode-sub {
  min-width: 0;
}
.td-code-row {
  align-items: stretch;
}
.td-code-row .td-btn {
  flex: 0 0 auto;
}
.td-how {
  padding: 18px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 8px;
  background: rgba(255,255,255,.035);
}

#td-setup-form {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(340px, .92fr);
  gap: 16px;
  align-items: start;
}
.td-setup-card {
  margin: 0;
  padding: 20px;
}
.td-setup-identity { grid-column: 1; grid-row: 1; }
.td-setup-age { grid-column: 1; grid-row: 2; }
.td-setup-cats { grid-column: 1; grid-row: 3 / span 2; }
.td-setup-heat { grid-column: 2; grid-row: 1; }
.td-setup-rules { grid-column: 2; grid-row: 2; }
.td-setup-economy { grid-column: 2; grid-row: 3; }
#td-setup-form > .td-pool-note,
#td-setup-form > .td-submit-row {
  grid-column: 1 / -1;
}
.td-page-setup .td-hero {
  min-height: 0;
  padding-top: 18px;
}
.td-page-setup .td-hero::before {
  content: "";
  position: absolute;
  right: 0;
  top: 14px;
  width: 150px;
  height: 58px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,.16);
  background:
    linear-gradient(90deg, rgba(34,211,238,.72) 0 50%, rgba(244,63,94,.78) 50% 100%),
    rgba(255,255,255,.08);
  transform: skew(-8deg);
  opacity: .55;
}
.td-chips,
.td-seg {
  gap: 10px;
}
.td-seg {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
}
.td-seg .td-chip {
  min-width: 0;
  width: 100%;
}
.td-chip {
  min-height: 42px;
  min-width: 0;
  justify-content: center;
  border-radius: 8px;
  background: rgba(255,255,255,.055);
  border-color: rgba(255,255,255,.13);
  white-space: normal;
  line-height: 1.25;
  overflow-wrap: break-word;
  word-break: normal;
}
.td-chip.selected {
  color: #fff;
  border-color: rgba(251,191,36,.64);
  background:
    linear-gradient(135deg, rgba(34,211,238,.16), rgba(244,63,94,.16)),
    rgba(255,255,255,.07);
  box-shadow: inset 0 0 0 1px rgba(251,191,36,.20);
}
.td-chip.disabled {
  opacity: .42;
}
.td-chip-count {
  color: #decfd5;
  line-height: 1.2;
}
#td-age-seg {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}
#td-age-seg .td-chip-count {
  white-space: nowrap;
}
#td-points-seg .td-chip {
  justify-content: space-between;
  text-align: left;
}
.td-emoji-row {
  margin-top: 12px;
}
.td-emoji-chip {
  width: 46px;
  min-width: 46px;
  padding: 0;
  font-size: 1.15rem;
}
#td-cats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(126px, 1fr));
}
#td-cats .td-chip {
  justify-content: space-between;
  text-align: left;
  padding-left: 10px;
  padding-right: 10px;
}
.td-cats-note {
  margin-top: 12px;
}
.td-section-gap { margin-top: 18px; }
.td-section-gap-sm { margin-top: 16px; }
.td-toggle-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-top: 10px;
  cursor: pointer;
}
.td-toggle-row-first {
  margin-top: 16px;
}
.td-toggle-row input {
  flex: 0 0 auto;
  margin-top: 3px;
}
.td-range-row input[type="range"] {
  flex: 1;
  accent-color: var(--td-dare);
}
.td-pool-note {
  border-radius: 8px;
  margin-top: 2px;
}
.td-submit-row {
  margin-top: 0;
  text-align: center;
}
.td-modal-actions {
  margin-top: 14px;
  text-align: right;
}
.td-consent-card {
  margin-top: 14px;
  background: rgba(255,255,255,.055);
}
.td-join-card {
  max-width: 620px;
  margin-left: auto;
  margin-right: auto;
}

.td-play-wrap {
  width: min(100% - 24px, 980px);
  max-width: none;
  padding: 20px 0 48px;
}
.td-page-play .td-play-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 300px);
  gap: 16px;
  align-items: start;
}
.td-page-play .td-play-wrap:has(.td-play-side .td-feed:empty) {
  grid-template-columns: minmax(0, 760px);
  justify-content: center;
}
.td-page-play .td-play-wrap:has(.td-play-side .td-feed:empty) .td-play-side {
  display: none;
}
.td-play-main,
.td-play-side {
  min-width: 0;
}
.td-play-main {
  padding: 16px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 8px;
  background: rgba(255,255,255,.035);
}
.td-play-side .td-feed {
  max-height: calc(100vh - 120px);
  overflow: auto;
  margin-top: 0;
  padding: 14px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 8px;
  background: rgba(255,255,255,.035);
}
.td-hud {
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.td-players-strip {
  scrollbar-width: thin;
}
.td-pchip {
  border-radius: 8px;
  background: rgba(255,255,255,.055);
}
.td-card {
  background:
    linear-gradient(135deg, rgba(34,211,238,.12), transparent 34%),
    linear-gradient(315deg, rgba(244,63,94,.16), transparent 38%),
    rgba(24, 17, 23, .94);
  box-shadow: var(--td-shadow);
}
.td-card-text {
  overflow-wrap: anywhere;
}
.td-choose-btns {
  gap: 12px;
}
.td-choose-truth,
.td-choose-dare {
  border-radius: 8px;
}

.td-lobby-hero {
  padding: 14px 0 18px;
}
.td-lobby-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(300px, .95fr);
  gap: 16px;
  align-items: start;
}
.td-lobby-panel {
  padding: 18px;
}
.td-lobby-code-panel,
.td-lobby-settings-panel,
.td-lobby-feed {
  grid-column: 1;
}
.td-lobby-roster-panel {
  grid-column: 2;
  grid-row: 1 / span 3;
}
.td-lobby-code {
  border-radius: 8px;
  color: #fff3c4;
  background:
    linear-gradient(90deg, rgba(34,211,238,.12), rgba(244,63,94,.12)),
    rgba(255,255,255,.055);
  border-color: rgba(251,191,36,.5);
  letter-spacing: .26em;
  overflow-wrap: anywhere;
}
.td-share-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
}
.td-lobby-player {
  border-radius: 8px;
  background: rgba(255,255,255,.055);
}
.td-lobby-start {
  margin-top: 16px;
}
#td-start-note {
  margin-top: 10px;
}
.td-lobby-feed {
  margin-top: 0;
  padding: 14px 18px;
}

.td-feed {
  border-top-color: rgba(255,255,255,.12);
}
.td-feed-item {
  border-bottom: 1px solid rgba(255,255,255,.06);
  padding: 7px 0;
}

.td-results-ctas {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}
.td-podium-slot,
.td-sup,
.td-series-box,
.td-lb-table {
  min-width: 0;
}
.td-podium-base,
.td-sup,
.td-series-box {
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(34,211,238,.06), rgba(244,63,94,.06)),
    rgba(255,255,255,.045);
}
.td-lb-table {
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 8px;
  background: rgba(255,255,255,.035);
}
.td-lb-table td {
  overflow-wrap: anywhere;
}
.td-noroom {
  padding: 72px 20px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(34,211,238,.09), rgba(244,63,94,.10)),
    rgba(255,255,255,.035);
}

@media (max-width: 1020px) {
  .td-modes {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  #td-setup-form,
  .td-page-play .td-play-wrap,
  .td-lobby-grid {
    grid-template-columns: 1fr;
  }
  .td-setup-identity,
  .td-setup-age,
  .td-setup-cats,
  .td-setup-heat,
  .td-setup-rules,
  .td-setup-economy,
  .td-lobby-code-panel,
  .td-lobby-settings-panel,
  .td-lobby-roster-panel,
  .td-lobby-feed {
    grid-column: 1;
    grid-row: auto;
  }
  .td-play-side .td-feed {
    max-height: none;
  }
}

@media (max-width: 680px) {
  .td-wrap,
  .td-page-setup .td-wrap,
  .td-page-join .td-wrap,
  .td-page-noroom .td-wrap,
  .td-page-results .td-wrap,
  .td-play-wrap {
    width: min(100% - 20px, 100%);
    padding-bottom: 48px;
  }
  .td-home-hero {
    min-height: 0;
    grid-template-columns: 1fr;
    gap: 18px;
    padding-top: 20px;
  }
  .td-hero-art {
    justify-self: start;
    width: min(210px, 70vw);
  }
  .td-page-setup .td-hero::before {
    display: none;
  }
  .td-hero-title {
    font-size: clamp(2rem, 14vw, 3.15rem);
  }
  .td-modes,
  .td-choose-btns,
  .td-actions-row,
  .td-verdict-btns,
  .td-results-ctas,
  .td-share-row {
    grid-template-columns: 1fr;
  }
  .td-mode-card {
    min-height: 126px;
    align-items: flex-start;
    text-align: left;
  }
  .td-card-box,
  .td-lobby-panel,
  .td-play-main,
  .td-play-side .td-feed {
    padding: 16px;
  }
  .td-seg,
  #td-cats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  #td-points-seg {
    grid-template-columns: 1fr;
  }
  .td-chip {
    justify-content: center;
  }
  #td-cats .td-chip {
    justify-content: space-between;
  }
  .td-code-row {
    flex-direction: column;
  }
  .td-code-row .td-btn {
    width: 100%;
  }
  .td-lobby-code {
    font-size: clamp(1.55rem, 10vw, 2rem);
    letter-spacing: .18em;
  }
  .td-podium {
    gap: 6px;
  }
}

@media (max-width: 360px) {
  .td-seg,
  #td-cats {
    grid-template-columns: 1fr;
  }
}

/* Setup uses balanced columns so long option groups do not stretch a grid row. */
#td-setup-form {
  display: block;
}
.td-setup-grid {
  column-count: 2;
  column-gap: 16px;
}
.td-setup-col {
  display: contents;
}
.td-setup-card {
  display: inline-block;
  width: 100%;
  vertical-align: top;
  break-inside: avoid;
  margin: 0 0 16px;
}
#td-setup-form > .td-pool-note {
  margin-top: 0;
}
#td-setup-form > .td-submit-row {
  margin-top: 16px;
}

@media (max-width: 1020px) {
  .td-setup-grid {
    column-count: 1;
  }
}

/* ============================================================
   Brighter Truth or Dare UX pass: colorful, informative accordions.
   ============================================================ */

:root {
  --td-bg: #fff7fb;
  --td-bg2: #f5fcff;
  --td-card: rgba(255, 255, 255, .86);
  --td-card2: rgba(255, 255, 255, .72);
  --td-line: rgba(68, 45, 92, .15);
  --td-line-strong: rgba(68, 45, 92, .24);
  --td-text: #26162f;
  --td-dim: #68566f;
  --td-accent: #ff3f78;
  --td-accent2: #ffb000;
  --td-truth: #00aee8;
  --td-dare: #ff3f78;
  --td-good: #00ad7a;
  --td-bad: #f43f5e;
  --td-gold: #b56a00;
  --td-shadow: 0 18px 45px rgba(74, 42, 96, .16);
}

html:has(body.td-body) {
  background: #fff7fb;
}
.td-body {
  color: var(--td-text);
  background:
    radial-gradient(circle at 8% 12%, rgba(0, 174, 232, .34), transparent 28%),
    radial-gradient(circle at 86% 8%, rgba(255, 63, 120, .28), transparent 30%),
    radial-gradient(circle at 52% 92%, rgba(255, 176, 0, .24), transparent 34%),
    linear-gradient(135deg, #fff8fc 0%, #effbff 42%, #fff2df 100%) fixed;
}
.td-body::before {
  opacity: .34;
  background:
    repeating-linear-gradient(135deg, rgba(255,255,255,.58) 0 1px, transparent 1px 24px),
    linear-gradient(90deg, rgba(0,174,232,.08), rgba(255,255,255,.20), rgba(255,63,120,.08));
}
.td-topbar {
  background: rgba(255,255,255,.80);
  border-bottom-color: rgba(68,45,92,.12);
  box-shadow: 0 10px 30px rgba(74,42,96,.10);
}
.td-topbrand {
  color: var(--td-text);
}
.td-flash-err {
  background: rgba(255, 63, 120, .12);
  border-color: rgba(255, 63, 120, .30);
  color: #9f1239;
}

.td-hero-title,
.td-play-title {
  color: var(--td-text);
  background: linear-gradient(95deg, #281337 0%, var(--td-truth) 34%, #ff9f1c 58%, var(--td-dare) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: none;
}
.td-play-title {
  margin: 0 0 10px;
  font-size: clamp(1.65rem, 3.6vw, 2.7rem);
  font-weight: 800;
  line-height: 1.05;
}
.td-hero-sub,
.td-sub,
.td-mode-sub,
.td-how-list {
  color: var(--td-dim);
}
.td-pill {
  color: #7c2d12;
  background: linear-gradient(135deg, rgba(255,255,255,.78), rgba(255,176,0,.22));
  border-color: rgba(255,176,0,.40);
}
.td-hero::after,
.td-card-box::before,
.td-lobby-panel::before,
.td-mode-card::before {
  background: linear-gradient(90deg, var(--td-truth), #8b5cf6, var(--td-gold), var(--td-dare));
}

.td-card-box,
.td-lobby-panel,
.td-mode-card,
.td-play-main,
.td-play-side .td-feed,
.td-how,
.td-noroom,
.td-modal-card,
.td-lb-table,
.td-sup,
.td-series-box {
  background:
    linear-gradient(135deg, rgba(255,255,255,.92), rgba(255,255,255,.68)),
    linear-gradient(135deg, rgba(0,174,232,.08), rgba(255,63,120,.08));
  border-color: var(--td-line);
  box-shadow: var(--td-shadow);
  color: var(--td-text);
}
.td-card-box,
.td-lobby-panel,
.td-play-main,
.td-play-side .td-feed {
  backdrop-filter: blur(10px);
}
.td-label,
.td-h1,
.td-h2,
.td-mode-name,
.td-pchip-name,
.td-lobby-player,
.td-lb-table td {
  color: var(--td-text);
}

.td-input {
  color: var(--td-text);
  min-height: 54px;
  border: 2px solid rgba(139, 92, 246, .20);
  background:
    linear-gradient(180deg, rgba(255,255,255,.98), rgba(255,255,255,.86)),
    rgba(255,255,255,.92);
  box-shadow: 0 8px 20px rgba(74,42,96,.08), inset 0 1px 0 rgba(255,255,255,.85);
}
.td-input::placeholder {
  color: rgba(68,45,92,.48);
}
.td-input:focus {
  border-color: var(--td-truth);
  box-shadow: 0 0 0 4px rgba(0,174,232,.16), 0 12px 26px rgba(0,174,232,.14);
}
.td-input-err {
  border-color: var(--td-dare) !important;
  box-shadow: 0 0 0 4px rgba(255,63,120,.16) !important;
}

.td-chip,
.td-pchip,
.td-player-emoji,
.td-lobby-player {
  color: var(--td-text);
  background: rgba(255,255,255,.72);
  border-color: rgba(68,45,92,.15);
}
.td-chip.selected {
  color: #241229;
  border-color: rgba(255, 63, 120, .48);
  background:
    linear-gradient(135deg, rgba(0,174,232,.20), rgba(255,176,0,.18), rgba(255,63,120,.16)),
    rgba(255,255,255,.86);
}
.td-chip-count,
.td-lb-meta,
.td-pchip-meta {
  color: #745f79;
}
.td-btn {
  color: #fff;
  background: linear-gradient(135deg, #ff3f78, #ff8a3d, #ffb000);
  box-shadow: 0 14px 28px rgba(255,63,120,.22);
}
.td-btn-ghost {
  color: var(--td-text);
  background: rgba(255,255,255,.68);
  border-color: rgba(68,45,92,.18);
}
.td-btn:disabled {
  color: rgba(38,22,47,.48);
  background: rgba(255,255,255,.55);
}

.td-help-panel {
  margin-top: 18px;
  max-width: 720px;
  border: 1px solid rgba(68,45,92,.14);
  border-radius: 8px;
  background: rgba(255,255,255,.64);
  box-shadow: 0 10px 25px rgba(74,42,96,.08);
  color: var(--td-text);
}
.td-help-panel summary {
  cursor: pointer;
  padding: 12px 14px;
  font-weight: 800;
  color: var(--td-text);
  list-style: none;
}
.td-help-panel summary::-webkit-details-marker {
  display: none;
}
.td-help-panel summary::after {
  content: "⌄";
  float: right;
  color: var(--td-dare);
}
.td-help-panel[open] summary::after {
  content: "⌃";
}
.td-help-panel ol {
  margin: 0;
  padding: 0 20px 14px 34px;
  color: var(--td-dim);
  line-height: 1.55;
}
.td-noroom .td-help-panel {
  margin-left: auto;
  margin-right: auto;
  text-align: left;
}

.td-card-toggle {
  width: 100%;
  min-height: 54px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  margin: -6px 0 14px;
  padding: 10px 12px;
  border: 1px solid rgba(68,45,92,.13);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(0,174,232,.12), rgba(255,176,0,.12), rgba(255,63,120,.10)),
    rgba(255,255,255,.70);
  color: var(--td-text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.td-card-toggle-title {
  font-weight: 800;
  min-width: 0;
}
.td-card-toggle-summary {
  max-width: 360px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #7c2d12;
  font-size: .86rem;
  font-weight: 800;
}
.td-card-toggle-icon {
  color: var(--td-dare);
  font-weight: 900;
}
.td-setup-card.is-collapsed {
  padding-bottom: 14px;
}
.td-setup-card.is-collapsed > :not(.td-card-toggle) {
  display: none !important;
}
.td-setup-card.is-collapsed .td-card-toggle {
  margin-bottom: 0;
}
.td-setup-card.is-collapsed .td-card-toggle-icon {
  transform: rotate(-90deg);
}
.td-card-toggle + .td-label {
  margin-top: 2px;
}

.td-card {
  color: var(--td-text);
  background:
    linear-gradient(135deg, rgba(255,255,255,.92), rgba(255,255,255,.72)),
    linear-gradient(135deg, rgba(0,174,232,.15), rgba(255,63,120,.12));
}
.td-card.truth .td-card-type {
  background: rgba(0,174,232,.13);
  color: #036b86;
}
.td-card.dare .td-card-type,
.td-card.forfeit .td-card-type {
  background: rgba(255,63,120,.13);
  color: #9f1239;
}
.td-choose-truth {
  background: linear-gradient(150deg, #0ea5e9, #22d3ee);
}
.td-choose-dare {
  background: linear-gradient(150deg, #ff3f78, #fb7185);
}
.td-page-play .td-play-wrap {
  row-gap: 16px;
}
.td-play-intro {
  grid-column: 1 / -1;
}
.td-page-play .td-play-wrap:has(.td-play-side .td-feed:empty) {
  grid-template-columns: minmax(0, 760px);
}
.td-page-play .td-play-wrap:has(.td-play-side .td-feed:empty) .td-play-intro,
.td-page-play .td-play-wrap:has(.td-play-side .td-feed:empty) .td-play-main {
  grid-column: 1;
}
.td-lobby-code {
  color: #2a1740;
  background:
    linear-gradient(90deg, rgba(0,174,232,.16), rgba(255,176,0,.18), rgba(255,63,120,.14)),
    rgba(255,255,255,.76);
}
.td-feed-item {
  color: var(--td-dim);
  border-bottom-color: rgba(68,45,92,.09);
}
.td-feed-item strong {
  color: var(--td-text);
}

@media (max-width: 680px) {
  .td-hero,
  .td-play-intro {
    min-width: 0;
  }

  .td-hero-title {
    max-width: 100%;
    font-size: clamp(1.85rem, 8.5vw, 2.35rem);
    line-height: 1.06;
    overflow-wrap: break-word;
    word-break: normal;
  }

  .td-page-home .td-hero-title {
    font-size: clamp(2rem, 9.6vw, 2.8rem);
  }

  .td-play-title {
    font-size: clamp(1.55rem, 8vw, 2.25rem);
  }

  .td-card-toggle {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .td-card-toggle-title {
    grid-column: 1;
    grid-row: 1;
  }
  .td-card-toggle-summary {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-self: start;
    max-width: none;
    white-space: normal;
    text-align: left;
  }
  .td-card-toggle-icon {
    grid-column: 2;
    grid-row: 1 / span 2;
    align-self: center;
    justify-self: end;
  }
  .td-help-panel {
    max-width: none;
  }
}

.td-help-panel summary::after {
  content: "+";
}
.td-help-panel[open] summary::after {
  content: "-";
}

.td-share-actions,
.td-room-actions,
.td-settings-summary,
.td-custom-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: stretch;
}

.td-share-actions {
  margin: -4px 0 14px;
}

.td-share-actions .td-btn {
  flex: 1 1 110px;
  justify-content: center;
}

.td-lobby-steps {
  margin: 8px 0 0;
  padding-left: 20px;
  color: var(--td-dim);
  line-height: 1.55;
}

.td-room-actions {
  margin-top: 14px;
}

.td-btn-danger,
.td-hud-delete {
  border-color: rgba(255, 63, 120, .35) !important;
  color: #9f1239 !important;
  background:
    linear-gradient(135deg, rgba(255, 63, 120, .14), rgba(255, 176, 0, .10)),
    rgba(255,255,255,.72) !important;
}

.td-settings-summary {
  margin: 12px 0 14px;
}

.td-setting-pill {
  flex: 1 1 150px;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  padding: 9px 12px;
  border: 1px solid rgba(68,45,92,.14);
  border-radius: 8px;
  color: var(--td-text);
  font-weight: 800;
  background:
    linear-gradient(135deg, rgba(0,174,232,.12), rgba(255,176,0,.12), rgba(255,63,120,.10)),
    rgba(255,255,255,.72);
}

.td-inline-settings {
  margin-top: 10px;
  border: 1px solid rgba(68,45,92,.13);
  border-radius: 8px;
  background: rgba(255,255,255,.58);
  overflow: hidden;
}

.td-inline-settings summary {
  cursor: pointer;
  padding: 11px 12px;
  font-weight: 800;
  color: var(--td-text);
}

.td-inline-settings > .td-sub,
.td-inline-settings > .td-chips {
  margin: 0;
  padding: 0 12px 12px;
}

.td-custom-tools {
  width: 100%;
  margin: 12px 0;
  padding: 12px;
  border: 1px solid rgba(0,174,232,.16);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(0,174,232,.10), rgba(255,63,120,.08)),
    rgba(255,255,255,.62);
}

.td-custom-counts {
  flex: 1 1 220px;
  display: grid;
  gap: 3px;
  min-width: 0;
}

.td-custom-counts strong {
  color: var(--td-text);
}

.td-custom-counts span,
.td-custom-counts em {
  color: var(--td-dim);
  font-style: normal;
  font-size: .86rem;
  line-height: 1.35;
}

.td-custom-tools #td-custom-open {
  align-self: center;
  white-space: normal;
}

.td-active-rooms {
  margin: 12px 0 20px;
}

.td-section-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.td-section-head h2 {
  margin: 8px 0 6px;
}

.td-active-room-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
}

.td-active-room-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(68,45,92,.14);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(0,174,232,.12), rgba(255,176,0,.12), rgba(255,63,120,.10)),
    rgba(255,255,255,.70);
}

.td-active-room-top,
.td-active-room-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.td-active-room-code {
  margin-left: auto;
  padding: 5px 8px;
  border: 1px dashed rgba(68,45,92,.28);
  border-radius: 8px;
  color: #7c2d12;
  font-weight: 900;
}

.td-active-room-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.td-active-room-meta span,
.td-active-room-top span {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 5px 8px;
  border-radius: 8px;
  color: var(--td-text);
  font-size: .8rem;
  font-weight: 800;
  background: rgba(255,255,255,.62);
  border: 1px solid rgba(68,45,92,.12);
}

.td-active-room-actions .td-btn {
  flex: 1 1 120px;
}

@media (max-width: 680px) {
  .td-timer-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .td-share-actions .td-btn,
  .td-setting-pill,
  .td-custom-tools #td-custom-open,
  .td-active-room-actions .td-btn {
    flex-basis: 100%;
  }
}


/* ============================================================
   Jul 2026 pass — prompt wheel (spin mode), play surface polish,
   modern results page.
   ============================================================ */

/* ---------- the prompt wheel ---------- */
.td-wheelbox {
  text-align: center;
  padding: 4px 0 2px;
  animation: tdPopIn .3s ease;
}
.td-wheelbox-title {
  font-size: clamp(1.15rem, 3.4vw, 1.5rem);
  font-weight: 800;
  color: var(--td-text);
}
.td-wheelbox-title strong { color: #9f1239; }
.td-wheelbox-sub {
  max-width: 430px;
  margin: 6px auto 0;
  color: var(--td-dim);
  font-size: .85rem;
  line-height: 1.5;
}
.td-wheelbox-stage {
  position: relative;
  width: min(82vw, 390px);
  aspect-ratio: 1;
  margin: 18px auto 12px;
}
.td-wheelbox-canvas {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  filter: drop-shadow(0 18px 34px rgba(74, 42, 96, .28));
}
.td-wheelbox-canvas canvas {
  width: 100%;
  height: 100%;
  display: block;
}
.td-wheelbox-pointer {
  position: absolute;
  top: -10px;
  left: 50%;
  z-index: 3;
  width: 0;
  height: 0;
  transform: translateX(-50%);
  border-left: 16px solid transparent;
  border-right: 16px solid transparent;
  border-top: 30px solid #2a1740;
  filter: drop-shadow(0 4px 8px rgba(42, 23, 64, .35));
}
.td-wheelbox-pointer::after {
  content: "";
  position: absolute;
  top: -28px;
  left: -9px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ffb000;
}
.td-wheelbox-hub {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  width: 96px;
  height: 96px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 5px solid #fff;
  cursor: pointer;
  color: #fff;
  font-family: var(--td-font);
  font-size: 1.05rem;
  font-weight: 900;
  letter-spacing: .06em;
  background: linear-gradient(135deg, #ff3f78, #ff8a3d);
  box-shadow: 0 12px 30px rgba(255, 63, 120, .45), inset 0 -3px 0 rgba(0, 0, 0, .12);
  animation: tdHubPulse 1.6s ease-in-out infinite;
  transition: transform .15s ease;
}
.td-wheelbox-hub:hover { animation-play-state: paused; transform: translate(-50%, -50%) scale(1.08); }
.td-wheelbox-hub:disabled {
  cursor: default;
  animation: none;
  font-size: 1.5rem;
  background: linear-gradient(135deg, #4b3861, #2a1740);
  box-shadow: 0 10px 24px rgba(42, 23, 64, .3);
  transform: translate(-50%, -50%);
}
.td-wheelbox.is-landed .td-wheelbox-hub { animation: tdHubPop .45s ease; }
.td-wheelbox.landed-truth .td-wheelbox-hub { background: linear-gradient(135deg, #0284c7, #22d3ee); }
.td-wheelbox.landed-dare .td-wheelbox-hub { background: linear-gradient(135deg, #e11d48, #ff8a3d); }
@keyframes tdHubPulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1); box-shadow: 0 12px 30px rgba(255, 63, 120, .45), 0 0 0 0 rgba(255, 63, 120, .35); }
  50% { transform: translate(-50%, -50%) scale(1.06); box-shadow: 0 12px 30px rgba(255, 63, 120, .45), 0 0 0 16px rgba(255, 63, 120, 0); }
}
@keyframes tdHubPop {
  0% { transform: translate(-50%, -50%) scale(.6); }
  55% { transform: translate(-50%, -50%) scale(1.22); }
  100% { transform: translate(-50%, -50%) scale(1); }
}
@keyframes tdPopIn {
  from { transform: scale(.94); opacity: 0; }
  to { transform: none; opacity: 1; }
}
.td-wheelbox-legend {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 4px;
}
.td-wheelbox-legend span {
  padding: 5px 12px;
  border-radius: 999px;
  font-size: .76rem;
  font-weight: 800;
  color: #fff;
}
.td-wheelbox-legend .truth { background: linear-gradient(135deg, #0284c7, #0e9bd8); }
.td-wheelbox-legend .dare { background: linear-gradient(135deg, #e11d48, #f43f5e); }
.td-wheelbox-note {
  min-height: 26px;
  margin-top: 10px;
  font-size: .95rem;
  font-weight: 700;
  color: var(--td-text);
}
.td-wheelbox.is-landed .td-wheelbox-note {
  animation: tdPop .3s ease;
  font-size: 1.1rem;
}
.td-wheelbox #td-rem { margin-top: 8px; }

/* ---------- play surface polish ---------- */
.td-play-brand {
  margin: 0;
  font-size: 1.08rem;
  font-weight: 900;
  letter-spacing: .01em;
  background: linear-gradient(95deg, #281337 0%, var(--td-truth) 45%, var(--td-dare) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  white-space: nowrap;
}
.td-play-brand span { font-weight: 600; }
.td-hud {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding-bottom: 12px;
  margin-bottom: 14px;
  border-bottom: 1px solid rgba(68, 45, 92, .12);
}
.td-hud-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.td-hud-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(68, 45, 92, .14);
  background: rgba(255, 255, 255, .72);
  color: var(--td-text);
  font-size: .76rem;
  font-weight: 800;
}
.td-hud-actions { margin-left: auto; display: flex; gap: 6px; }
.td-hud-leave {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid rgba(68, 45, 92, .16) !important;
  background: rgba(255, 255, 255, .72);
  color: var(--td-dim);
  font-size: .76rem;
  font-weight: 800;
  cursor: pointer;
}
.td-hud-leave:hover { color: #9f1239; border-color: rgba(255, 63, 120, .4) !important; }
.td-stage { min-height: 260px; }
.td-help-inplay { margin-top: 18px; }

.td-pchip {
  border: 1.5px solid rgba(68, 45, 92, .13);
  box-shadow: 0 6px 16px rgba(74, 42, 96, .07);
}
.td-pchip.actor {
  border-color: rgba(255, 176, 0, .65);
  background:
    linear-gradient(135deg, rgba(255, 176, 0, .18), rgba(255, 63, 120, .10)),
    rgba(255, 255, 255, .85);
  box-shadow: 0 8px 20px rgba(255, 176, 0, .22);
  transform: translateY(-1px);
}

.td-card {
  padding: 30px 22px 24px;
  border-width: 1.5px;
}
.td-card::after {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 5px;
  border-radius: 22px 22px 0 0;
}
.td-card.truth::after { background: linear-gradient(90deg, #0284c7, #22d3ee); }
.td-card.dare::after, .td-card.forfeit::after { background: linear-gradient(90deg, #e11d48, #ff8a3d); }
.td-card-text { font-size: clamp(1.2rem, 3.2vw, 1.5rem); }
.td-card-emoji { font-size: 2.6rem; }

.td-rate-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(68, 45, 92, .12);
  background: rgba(255, 255, 255, .6);
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
}
.td-rate-hint {
  color: var(--td-dim);
  font-size: .78rem;
  font-weight: 700;
}
.td-rate-btn {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid rgba(68, 45, 92, .14);
  background: rgba(255, 255, 255, .85);
  font-size: 1.15rem;
  opacity: 1;
  transition: transform .12s ease, box-shadow .12s ease;
}
.td-rate-btn:hover { transform: translateY(-2px) scale(1.06); box-shadow: 0 8px 18px rgba(74, 42, 96, .14); }
.td-rate-btn.on {
  border-color: rgba(255, 176, 0, .7);
  background: linear-gradient(135deg, rgba(255, 176, 0, .25), rgba(255, 63, 120, .18));
  box-shadow: 0 8px 18px rgba(255, 176, 0, .25);
}
.td-rate-btn:disabled:not(.on) { opacity: .35; }
.td-report-link { align-self: center; }

/* ---------- results page ---------- */
.td-results-hero {
  text-align: center;
  padding: 20px 0 10px;
}
.td-results-hero .td-hero-title {
  max-width: none;
  font-size: clamp(2rem, 5vw, 3.4rem);
}
.td-page-results .td-hero::after { display: none; }

.td-champion {
  position: relative;
  max-width: 460px;
  margin: 18px auto 6px;
  padding: 30px 22px 22px;
  border-radius: 8px;
  text-align: center;
  border: 1px solid rgba(255, 176, 0, .45);
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 176, 0, .30), transparent 62%),
    linear-gradient(135deg, rgba(255, 255, 255, .94), rgba(255, 255, 255, .74)),
    linear-gradient(135deg, rgba(0, 174, 232, .10), rgba(255, 63, 120, .10));
  box-shadow: 0 22px 50px rgba(181, 106, 0, .18);
  animation: tdPopIn .4s ease;
}
.td-champion-crown {
  font-size: 2.2rem;
  line-height: 1;
  animation: tdCrown 2.2s ease-in-out infinite;
}
@keyframes tdCrown {
  0%, 100% { transform: translateY(0) rotate(-4deg); }
  50% { transform: translateY(-6px) rotate(4deg); }
}
.td-champion-emoji { font-size: 3.4rem; line-height: 1.2; }
.td-champion-name {
  font-size: clamp(1.4rem, 4vw, 1.9rem);
  font-weight: 900;
  color: var(--td-text);
  overflow-wrap: anywhere;
}
.td-champion-pts {
  margin-top: 2px;
  font-size: 1.5rem;
  font-weight: 900;
  color: #b56a00;
}
.td-champion-pts small { font-size: .85rem; font-weight: 800; color: var(--td-dim); }

.td-podium { margin: 26px 0 8px; gap: 12px; }
.td-podium-slot { max-width: 150px; }
.td-podium-emoji { font-size: 2.3rem; }
.td-podium-name { font-size: .92rem; }
.td-podium-base {
  border: 1px solid rgba(68, 45, 92, .14);
  border-bottom: 0;
  border-radius: 10px 10px 0 0;
  animation: tdRise .5s ease backwards;
}
.td-podium-1 .td-podium-base {
  height: 104px;
  border-color: rgba(255, 176, 0, .55);
  background: linear-gradient(180deg, rgba(255, 176, 0, .38), rgba(255, 255, 255, .65));
  animation-delay: .25s;
}
.td-podium-2 .td-podium-base {
  height: 72px;
  background: linear-gradient(180deg, rgba(148, 163, 184, .35), rgba(255, 255, 255, .65));
  animation-delay: .1s;
}
.td-podium-3 .td-podium-base {
  height: 54px;
  background: linear-gradient(180deg, rgba(217, 119, 6, .28), rgba(255, 255, 255, .65));
  animation-delay: 0s;
}
@keyframes tdRise {
  from { transform: translateY(26px); opacity: 0; }
  to { transform: none; opacity: 1; }
}
.td-podium-medal { font-size: 1.5rem; }
.td-podium-pts { color: #b56a00; font-weight: 900; }

.td-sups { margin: 20px 0; gap: 12px; }
.td-sup {
  padding: 16px 12px 14px;
  border-radius: 8px;
  transition: transform .15s ease, box-shadow .15s ease;
}
.td-sup:hover { transform: translateY(-3px); box-shadow: 0 16px 34px rgba(74, 42, 96, .16); }
.td-sup-emoji { font-size: 1.9rem; line-height: 1.3; }
.td-sup-badge { margin-top: 2px; }
.td-sup-who { margin-top: 4px; color: #9f1239; }
.td-sup-desc { margin-top: 4px; font-size: .76rem; }

.td-lb { display: grid; gap: 10px; margin: 14px 0 20px; }
.td-lb-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-radius: 8px;
  border: 1px solid rgba(68, 45, 92, .13);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .92), rgba(255, 255, 255, .70)),
    linear-gradient(135deg, rgba(0, 174, 232, .07), rgba(255, 63, 120, .07));
  box-shadow: 0 10px 26px rgba(74, 42, 96, .10);
}
.td-lb-row.first { border-color: rgba(255, 176, 0, .5); }
.td-lb-rank {
  flex: 0 0 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-weight: 900;
  font-size: .95rem;
  color: #fff;
  background: #8b7a94;
}
.td-lb-rank.r1 { background: linear-gradient(135deg, #f59e0b, #ffb000); }
.td-lb-rank.r2 { background: linear-gradient(135deg, #64748b, #94a3b8); }
.td-lb-rank.r3 { background: linear-gradient(135deg, #b45309, #d97706); }
.td-lb-main { flex: 1; min-width: 0; display: grid; gap: 3px; }
.td-lb-name {
  font-weight: 800;
  color: var(--td-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.td-lb-meta { color: var(--td-dim); font-size: .76rem; }
.td-lb-bar {
  display: block;
  height: 6px;
  border-radius: 999px;
  background: rgba(68, 45, 92, .10);
  overflow: hidden;
}
.td-lb-bar i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--td-truth), #8b5cf6, var(--td-dare));
}
.td-lb-pts {
  flex: 0 0 auto;
  font-size: 1.15rem;
  font-weight: 900;
  color: #b56a00;
}

.td-solo-result {
  max-width: 480px;
  margin: 16px auto;
  padding: 28px 20px 22px;
  border-radius: 8px;
  text-align: center;
  border: 1px solid rgba(68, 45, 92, .14);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .94), rgba(255, 255, 255, .72)),
    linear-gradient(135deg, rgba(0, 174, 232, .10), rgba(255, 63, 120, .10));
  box-shadow: var(--td-shadow);
}
.td-solo-result-emoji { font-size: 3.2rem; }
.td-solo-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  margin-top: 16px;
}
.td-solo-stat {
  display: grid;
  gap: 2px;
  padding: 14px 10px;
  border-radius: 8px;
  border: 1px solid rgba(68, 45, 92, .12);
  background: rgba(255, 255, 255, .7);
}
.td-solo-stat-num { font-size: 1.5rem; font-weight: 900; color: #b56a00; }
.td-solo-stat-label { color: var(--td-dim); font-size: .76rem; font-weight: 700; }

.td-results-ctas { margin-top: 24px; }
.td-page-results .td-help-panel {
  max-width: none;
  margin-top: 18px;
}

@media (max-width: 680px) {
  .td-hud { gap: 8px; }
  .td-hud-actions { margin-left: auto; }
  .td-wheelbox-stage { width: min(88vw, 340px); }
  .td-wheelbox-hub { width: 82px; height: 82px; font-size: .95rem; }
  .td-podium-slot { max-width: 110px; }
  .td-lb-row { padding: 10px 12px; gap: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .td-wheelbox-hub, .td-champion-crown, .td-podium-base, .td-lb-bar i, .td-wheelbox, .td-champion {
    animation: none !important;
  }
}

/* Verdict buttons keep their semantic colours (the theme .td-btn gradient
   used to override them — both looked orange). */
.td-btn.td-verdict-yes { background: linear-gradient(135deg, #059669, #34d399); box-shadow: 0 12px 26px rgba(5, 150, 105, .28); }
.td-btn.td-verdict-no  { background: linear-gradient(135deg, #9f1239, #f43f5e); box-shadow: 0 12px 26px rgba(159, 18, 57, .24); }
