/* Page styles on top of pw.css (PWDS tokens + components). */
html, body { margin: 0; background: var(--pw-bg); }
#pw-app a.pw-btn-primary { color: #fff; }
#pw-app a.pw-btn-secondary { color: var(--pw-fg); }
.tt-h2 { font-size: clamp(26px, 3.6vw, 34px); font-weight: 700; letter-spacing: -.02em; margin-bottom: 20px; }
.tt-h3 { font-size: 20px; font-weight: 600; margin: 4px 0 14px; }
.tt-section { padding: 48px 0 0; }
.tt-muted { color: var(--pw-fg-muted); }
.tt-empty { font-size: 14px; color: var(--pw-fg-subtle); padding: 8px 10px; }
.tt-foot { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--pw-border); font-size: 12px; color: var(--pw-fg-subtle); text-align: center; }

/* hero facts */
.tt-facts { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 28px; }
.tt-fact { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: var(--pw-radius-full);
  background: var(--pw-bg-muted); font-size: 14px; font-weight: 500; }
.tt-fact b { font-weight: 600; }

/* live pill */
.tt-live { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--pw-brand-700); background: var(--pw-brand-50); padding: 4px 10px; border-radius: var(--pw-radius-full); }
.tt-live i { width: 8px; height: 8px; border-radius: 50%; background: var(--pw-brand-500); animation: ttPulse 1.6s ease-in-out infinite; }
.tt-live.off { color: var(--pw-fg-muted); background: var(--pw-bg-muted); }
.tt-live.off i { background: var(--pw-fg-subtle); animation: none; }
@keyframes ttPulse { 0%, 100% { box-shadow: 0 0 0 0 var(--pw-ring); } 50% { box-shadow: 0 0 0 6px transparent; } }
@media (prefers-reduced-motion: reduce) { .tt-live i { animation: none; } }

/* live match cards */
.tt-matches { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.tt-match { padding: 16px 18px; }
.tt-match-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; gap: 8px; }
.tt-team { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--pw-radius-xl); background: var(--pw-bg-muted); }
.tt-team.win { background: var(--pw-success-50); }
.tt-team.loss { background: var(--pw-bg-subtle); color: var(--pw-fg-muted); }
.tt-team-names { flex: 1; min-width: 0; font-weight: 600; font-size: 15px; }
.tt-team-avatars { display: flex; gap: 4px; }
.tt-big-score { font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; min-width: 44px; text-align: right; }
.tt-vs { display: flex; align-items: center; gap: 8px; margin: 6px 0; font-size: 11px; font-weight: 700; letter-spacing: .08em; color: var(--pw-fg-subtle); }
.tt-vs::before, .tt-vs::after { content: ''; flex: 1; height: 1px; background: var(--pw-border); }
.tt-status { font-size: 12px; font-weight: 600; }
.tt-status.done { color: var(--pw-success-fg); }
.tt-status.warn { color: var(--pw-warning-fg); }
.tt-byes { margin-top: 12px; font-size: 14px; color: var(--pw-fg-muted); }

/* leaderboard */
.tt-board { padding: 20px; }
.tt-lb-head, .pw-lb-row { display: grid; grid-template-columns: 22px 28px 1fr 44px 48px; gap: 10px; align-items: center; }
.tt-lb-head { padding: 0 10px 6px; font-size: 11px; font-weight: 600; color: var(--pw-fg-muted); text-transform: uppercase; letter-spacing: .06em; }
.tt-lb-list { display: flex; flex-direction: column; gap: 4px; }
.tt-rank { text-align: center; font-weight: 700; font-size: 14px; color: var(--pw-fg-muted); font-variant-numeric: tabular-nums; }
.tt-rank.first { color: var(--pw-brand-600); }
.tt-lb-name { min-width: 0; font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tt-lb-meta { font-size: 13px; color: var(--pw-fg-muted); font-variant-numeric: tabular-nums; text-align: right; }
.tt-lb-pct { font-weight: 700; font-size: 14px; font-variant-numeric: tabular-nums; text-align: right; }

/* history */
.tt-round { display: flex; flex-direction: column; gap: 8px; margin-bottom: 22px; }
.tt-round-title { font-size: 15px; font-weight: 700; }
.tt-round-title span { font-weight: 400; font-size: 13px; color: var(--pw-fg-subtle); }
.tt-line { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: center; padding: 10px 14px;
  background: var(--pw-bg-subtle); border-radius: var(--pw-radius-xl); font-size: 14px; color: var(--pw-fg-muted); }
.tt-line-a { text-align: right; } .tt-line-b { text-align: left; }
.tt-line .win { color: var(--pw-fg); font-weight: 700; }
.tt-line-score { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--pw-fg); white-space: nowrap; }

/* rules */
.tt-rules { padding: 20px 22px; }
.tt-rules ul { margin: 10px 0 0; padding-left: 18px; display: flex; flex-direction: column; gap: 8px; font-size: 14px; line-height: 1.5; color: var(--pw-fg-muted); }
.tt-rules b { color: var(--pw-fg); font-weight: 600; }

/* manage */
.tt-panel { padding: 22px; margin-bottom: 20px; }
.tt-field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--pw-fg-muted); }
.tt-grid3 { display: grid; grid-template-columns: 2fr 1.4fr 1.4fr; gap: 12px; }
.tt-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.tt-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.tt-chip { display: inline-flex; align-items: center; gap: 8px; padding: 4px 6px 4px 4px; border: 1px solid var(--pw-border); border-radius: var(--pw-radius-full); font-size: 14px; font-weight: 500; }
.tt-chip button { border: none; background: none; cursor: pointer; color: var(--pw-fg-subtle); font-size: 16px; line-height: 1; padding: 2px 6px; border-radius: 50%; }
.tt-chip button:hover { background: var(--pw-bg-hover); color: var(--pw-fg); }
.tt-chip .pw-avatar { width: 24px !important; height: 24px !important; border-radius: 50%; font-size: 10px !important; }
.tt-step { display: inline-flex; align-items: center; border: 1px solid var(--pw-border-strong); border-radius: var(--pw-radius-md); overflow: hidden; flex-shrink: 0; }
.tt-step button { width: 36px; height: 44px; border: none; background: var(--pw-bg); color: var(--pw-fg); font-size: 20px; cursor: pointer; }
.tt-step button:hover { background: var(--pw-bg-hover); }
.tt-step input { width: 48px; height: 44px; border: none; border-left: 1px solid var(--pw-border); border-right: 1px solid var(--pw-border);
  text-align: center; font-size: 20px; font-weight: 700; background: var(--pw-bg); color: var(--pw-fg); font-family: inherit; }
.tt-save { font-size: 13px; color: var(--pw-fg-muted); }
.tt-save.err { color: var(--pw-warning-fg); }
.tt-banner { padding: 12px 16px; border-radius: var(--pw-radius-xl); background: var(--pw-warning-50); color: var(--pw-warning-fg); font-size: 14px; margin-bottom: 16px; }
.tt-danger { color: var(--pw-warning-fg) !important; }

@media (max-width: 700px) {
  .tt-grid3 { grid-template-columns: 1fr; }
  .tt-line { grid-template-columns: 1fr; text-align: center; gap: 2px; }
  .tt-line-a, .tt-line-b { text-align: center; }
}

/* ===== story ===== */
.tt-chapter { padding: 64px 0 0; }
.tt-chapter-num { font-family: var(--pw-font-serif); font-style: italic; font-size: 20px; color: var(--pw-brand-500); margin-bottom: 4px; }
.tt-chapter h2 { font-family: var(--pw-font-serif); font-weight: 400; font-size: clamp(30px, 4.4vw, 46px); letter-spacing: -.01em; line-height: 1.05; margin-bottom: 10px; }
.tt-chapter-lede { font-size: 17px; color: var(--pw-fg-muted); max-width: 560px; margin-bottom: 24px; }

.tt-reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s var(--pw-ease-out), transform .6s var(--pw-ease-out); transition-delay: var(--d, 0ms); }
.tt-reveal.in { opacity: 1; transform: none; }
.tt-reveal.instant { transition: none; }

.tt-stories { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.tt-story { padding: 20px; border-top: 4px solid var(--tone); }
.tt-story-kicker { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--pw-fg-muted); margin-bottom: 8px; }
.tt-story h3 { font-size: 22px; font-weight: 700; letter-spacing: -.02em; margin-bottom: 6px; }
.tt-story p { font-size: 14px; color: var(--pw-fg-muted); line-height: 1.5; }
.tone-brand { --tone: var(--pw-brand-500); } .tone-coral { --tone: var(--pw-petal-coral); } .tone-gold { --tone: var(--pw-petal-gold); }
.tone-cyan { --tone: var(--pw-petal-cyan); } .tone-sky { --tone: var(--pw-petal-sky); }

/* race */
.tt-race { padding: 18px 18px 6px; overflow-x: auto; }
.tt-race svg { width: 100%; min-width: 520px; height: auto; display: block; }
.tt-race-grid { stroke: var(--pw-border); stroke-dasharray: 3 4; }
.tt-race-rank, .tt-race-col { font-size: 12px; fill: var(--pw-fg-subtle); font-weight: 600; }
.tt-race-col { text-anchor: middle; }
.tt-race-line path { fill: none; stroke-width: 4; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; }
.tt-race.in .tt-race-line path { animation: ttDraw 1.4s var(--pw-ease-out) forwards; }
.tt-race.instant .tt-race-line path { animation: none; stroke-dashoffset: 0; }
.tt-race-name { font-size: 13px; font-weight: 600; fill: var(--pw-fg); }
.tt-race-line { transition: opacity .2s; cursor: pointer; outline: none; }
.tt-race svg:hover .tt-race-line, .tt-race svg:focus-within .tt-race-line { opacity: .18; }
.tt-race svg .tt-race-line:hover, .tt-race svg .tt-race-line:focus { opacity: 1; }
.tt-race-line:hover path, .tt-race-line:focus path { stroke-width: 6; }
@keyframes ttDraw { to { stroke-dashoffset: 0; } }

/* tree */
.tt-tree { padding: 12px 12px 6px; background: radial-gradient(ellipse 80% 70% at 50% 100%, var(--pw-brand-50), var(--pw-bg) 70%); }
.tt-tree svg { width: 100%; height: auto; display: block; overflow: hidden; }
.tt-trunk { fill: #8a6a4e; }
.tt-ground { fill: var(--pw-bg-active); }
.tt-limb { fill: none; stroke: #8a6a4e; stroke-width: 7; stroke-linecap: round; }
.tt-branch-label { font-size: 12px; font-weight: 600; fill: var(--pw-fg-muted); }
.tt-leaf { transform-box: fill-box; }
.tt-leaf > path:first-of-type { stroke: rgba(2,6,23,.12); stroke-width: 1; }
.tt-leaf .tt-vein { stroke: rgba(255,255,255,.7); stroke-width: 1.2; fill: none; }
.tt-leaf.bud > path { fill: var(--pw-bg); stroke: var(--pw-brand-400); stroke-width: 2; stroke-dasharray: 4 3; }
.tt-leaf.bud .tt-vein { stroke: var(--pw-brand-200); }
.tt-leaf path { animation: ttSway 3.6s ease-in-out infinite; animation-delay: calc(var(--sway) * -1); transform-origin: 0 0; }
.tt-leaf:hover path { filter: brightness(1.08) drop-shadow(0 2px 4px rgba(2,6,23,.25)); }
.tt-branch.tt-reveal { transform: scale(.6); transform-origin: 50% 100%; transform-box: fill-box; }
.tt-branch.tt-reveal.in { transform: none; }
.tt-crown { transition: transform .8s var(--pw-ease-out); transform: scale(.45); }
.tt-crown.bloom { transform: scale(1.15); }
.tt-crown ellipse { opacity: .9; }
.tt-champ-label { font-family: var(--pw-font-serif); font-style: italic; font-size: 22px; text-anchor: middle; fill: var(--pw-brand-600); }
@keyframes ttSway { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(5deg); } }

/* 3D hero slot */
.tt-hero3d { position: relative; height: 420px; width: 100%; }
.tt-hero3d canvas { position: absolute; inset: 0; }
@media (max-width: 900px) { .tt-hero3d { height: 320px; } }

@media (prefers-reduced-motion: reduce) {
  .tt-reveal { opacity: 1; transform: none; transition: none; }
  .tt-race-line path { animation: none !important; stroke-dashoffset: 0; }
  .tt-leaf path { animation: none; }
}

/* ===== hero stage ===== */
.tt-hero { position: relative; margin: -8px -16px 0; padding: 8px 16px 0; border-radius: var(--pw-radius-3xl); overflow: hidden; isolation: isolate; }
.tt-hero .pw-hero-grid { position: relative; z-index: 1; padding-bottom: 56px; }
.tt-hero-bg { position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 55% 70% at 78% 55%, var(--pw-brand-50), transparent 70%),
    linear-gradient(180deg, var(--pw-bg) 0%, var(--pw-bg-subtle) 100%); }
/* faint court lines in perspective behind the table */
.tt-hero-bg::before { content: ''; position: absolute; left: 40%; right: -10%; bottom: -10%; height: 70%;
  background:
    linear-gradient(90deg, transparent 49.6%, var(--pw-brand-200) 49.6%, var(--pw-brand-200) 50.4%, transparent 50.4%),
    repeating-linear-gradient(0deg, transparent 0 46px, var(--pw-brand-100) 46px 48px),
    repeating-linear-gradient(90deg, transparent 0 46px, var(--pw-brand-100) 46px 48px);
  transform: perspective(600px) rotateX(62deg); transform-origin: 50% 100%; opacity: .85;
  -webkit-mask-image: radial-gradient(ellipse 60% 80% at 50% 100%, #000 30%, transparent 75%);
          mask-image: radial-gradient(ellipse 60% 80% at 50% 100%, #000 30%, transparent 75%); }
/* soft petal glows */
.tt-hero-bg i { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .45; animation: ttDrift 14s ease-in-out infinite alternate; }
.tt-hero-bg .b1 { width: 340px; height: 340px; right: 4%; top: 6%; background: var(--pw-petal-lavender); }
.tt-hero-bg .b2 { width: 260px; height: 260px; right: 30%; bottom: -60px; background: var(--pw-petal-cyan); opacity: .28; animation-delay: -5s; }
.tt-hero-bg .b3 { width: 220px; height: 220px; left: -60px; top: -40px; background: var(--pw-petal-gold); opacity: .22; animation-delay: -9s; }
@keyframes ttDrift { from { transform: translate(0, 0) scale(1); } to { transform: translate(-30px, 20px) scale(1.12); } }
@media (prefers-reduced-motion: reduce) { .tt-hero-bg i { animation: none; } }
@media (max-width: 900px) { .tt-hero-bg::before { left: -10%; height: 45%; } }

/* ===== sign-up ===== */
.tt-signup { border-top: 4px solid var(--pw-brand-500); }
.tt-signup-form { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.tt-hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.tt-signed { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 14px 16px; border-radius: var(--pw-radius-xl); background: var(--pw-success-50); }
.tt-signup-msg { margin-top: 10px; font-size: 14px; color: var(--pw-warning-fg); }
.tt-chip-in { padding-right: 12px; animation: ttChipIn .4s var(--pw-ease-out) both; animation-delay: calc(var(--i) * 25ms); }
.tt-chip-in.me { border-color: var(--pw-brand-500); background: var(--pw-brand-50); }
@keyframes ttChipIn { from { opacity: 0; transform: scale(.8); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .tt-chip-in { animation: none; } }
.tt-setup-wrap { max-width: 760px; }

/* ===== one-step sign-up in the hero ===== */
.tt-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.tt-hero-form { display: flex; gap: 10px; max-width: 480px; padding: 6px; border-radius: var(--pw-radius-xl);
  background: var(--pw-bg); box-shadow: var(--pw-shadow-md), 0 0 0 1px var(--pw-border); }
.tt-hero-form .pw-input { flex: 1; min-width: 0; height: 52px; border: none; font-size: 18px; box-shadow: none; }
.tt-hero-form .pw-input:focus { box-shadow: none; }
.tt-hero-form:focus-within { box-shadow: var(--pw-shadow-md), 0 0 0 2px var(--pw-brand-500), 0 0 0 6px var(--pw-ring); }
.tt-hero-hint { margin-top: 10px; font-size: 13px; color: var(--pw-fg-muted); }
.tt-hero-signed { max-width: 480px; padding: 14px 16px; animation: ttChipIn .4s var(--pw-ease-out) both; }
.tt-signed-title { font-size: 18px; font-weight: 700; }
.tt-tick { width: 36px; height: 36px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  background: var(--pw-success-500); color: #fff; font-weight: 700; flex-shrink: 0; }
.tt-you { font-size: 11px; font-weight: 700; color: var(--pw-brand-600); text-transform: uppercase; letter-spacing: .06em; margin-left: 2px; }
@media (max-width: 480px) {
  .tt-hero-form { flex-direction: column; }
  .tt-hero-form .pw-btn { width: 100%; }
}

/* ===== avatar picker ===== */
.tt-emoji { line-height: 1; }
.tt-pick-label { font-size: 13px; font-weight: 600; color: var(--pw-fg-muted); margin-bottom: 8px; }
.tt-picks { display: flex; flex-wrap: wrap; gap: 6px; max-width: 480px; margin-bottom: 12px; }
.tt-pick { width: 40px; height: 40px; border-radius: var(--pw-radius-md); border: 1px solid var(--pw-border); background: var(--pw-bg);
  font-size: 20px; line-height: 1; cursor: pointer; transition: transform 120ms var(--pw-ease-out), border-color 120ms, box-shadow 120ms; }
.tt-pick:hover { transform: translateY(-2px); border-color: var(--pw-border-strong); }
.tt-pick.on { border-color: var(--pw-brand-500); box-shadow: 0 0 0 3px var(--pw-ring); background: var(--pw-brand-50); transform: scale(1.08); }
.tt-form-avatar { display: inline-flex; align-items: center; justify-content: center; width: 44px; font-size: 26px; flex-shrink: 0; }

/* ===== lobby ===== */
.tt-lobby { border-top: 4px solid var(--pw-petal-gold); }
.tt-countdown { font-family: var(--pw-font-serif); font-size: clamp(26px, 3.4vw, 34px); line-height: 1.1; margin: 4px 0 2px; }
.tt-seats { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 14px 8px; margin-top: 22px; }
.tt-seat { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; text-align: center;
  animation: ttBob 3.2s ease-in-out infinite; animation-delay: calc(var(--i) * -0.37s); }
.tt-seat span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tt-seat .pw-avatar { width: 52px !important; height: 57px !important; font-size: 28px !important; }
.tt-seat.me span { color: var(--pw-brand-600); }
.tt-seat.me .pw-avatar { box-shadow: 0 0 0 3px var(--pw-bg), 0 0 0 5px var(--pw-brand-500); }
@keyframes ttBob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
.tt-ghost .tt-team { background: var(--pw-bg-subtle); }
.tt-ghost-av { width: 36px; height: 40px; border-radius: 28% 28% 0 28% / 18% 18% 0 18%; border: 2px dashed var(--pw-border-strong);
  display: flex; align-items: center; justify-content: center; color: var(--pw-fg-subtle); font-weight: 700; }
.tt-ghost-line { display: block; height: 10px; width: 70%; border-radius: 6px;
  background: linear-gradient(90deg, var(--pw-bg-muted), var(--pw-bg-active), var(--pw-bg-muted)); background-size: 200% 100%; animation: ttShimmer 1.6s linear infinite; }
@keyframes ttShimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .tt-seat, .tt-ghost-line { animation: none; } }

/* ===== manage tabs ===== */
.tt-tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 22px; padding: 6px;
  border-radius: var(--pw-radius-xl); background: var(--pw-bg-muted); }
.tt-tab { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 10px 14px; border: none; cursor: pointer;
  border-radius: var(--pw-radius-md); background: transparent; color: var(--pw-fg-muted); font-family: inherit; text-align: left;
  transition: background-color 150ms, color 150ms; }
.tt-tab b { font-size: 15px; font-weight: 600; color: var(--pw-fg); }
.tt-tab span { font-size: 12px; }
.tt-tab:hover { background: var(--pw-bg-hover); }
.tt-tab.on { background: var(--pw-bg); box-shadow: var(--pw-shadow-sm); }
.tt-tab.on b { color: var(--pw-brand-600); }
.tt-link { border: none; background: none; padding: 0; font: inherit; color: var(--pw-brand-600); cursor: pointer; text-decoration: underline; }
.tt-roster { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.tt-roster-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--pw-radius-xl); background: var(--pw-bg-subtle); }
.tt-roster-row .tt-lb-name { flex: 1; }
@media (max-width: 640px) {
  .tt-tabs { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) { .pw-header .tt-save { display: none; } }

/* ===== live play ===== */
.tt-live-card { position: relative; overflow: hidden; }
.tt-live-card.playing { box-shadow: var(--pw-shadow-md), 0 0 0 2px var(--pw-brand-200); }
.tt-live-dot { color: var(--pw-brand-600); display: inline-flex; align-items: center; gap: 6px; }
.tt-live-dot::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--pw-brand-500); animation: ttPulse 1.4s ease-in-out infinite; }
.tt-tag { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 2px 8px; border-radius: var(--pw-radius-full); }
.tt-tag.deuce { background: var(--pw-warning-50); color: var(--pw-warning-fg); animation: ttWiggle 1.2s ease-in-out infinite; }
.tt-tag.mp { background: var(--pw-brand-50); color: var(--pw-brand-700); }
@keyframes ttWiggle { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-3deg); } 75% { transform: rotate(3deg); } }

.tt-team-btn { width: 100%; border: none; font: inherit; color: inherit; text-align: left; cursor: pointer; transition: transform 120ms var(--pw-ease-out), background-color 150ms; }
.tt-team-btn:hover { background: var(--pw-bg-active); }
.tt-team-btn:active { transform: scale(.98); }
.tt-team-btn.win:hover { background: var(--pw-success-50); }
.tt-cheer-hint { display: block; font-size: 11px; font-weight: 500; color: var(--pw-fg-subtle); opacity: 0; transition: opacity 150ms; }
.tt-team-btn:hover .tt-cheer-hint, .tt-team-btn:focus-visible .tt-cheer-hint { opacity: 1; }
@media (hover: none) { .tt-cheer-hint { opacity: 1; } }

.tt-big-score { position: relative; transition: color 200ms; }
.tt-big-score.tt-pop { animation: ttScorePop .7s var(--pw-ease-out); color: var(--pw-brand-600); }
@keyframes ttScorePop { 0% { transform: scale(1); } 30% { transform: scale(1.55); } 100% { transform: scale(1); } }
.tt-plus { position: absolute; right: 0; top: -6px; font-size: 13px; font-weight: 700; color: var(--pw-success-500); animation: ttPlus 1.2s ease-out forwards; }
@keyframes ttPlus { from { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(-26px); } }

.tt-meter { position: relative; display: flex; height: 22px; margin: 12px 0 8px; border-radius: var(--pw-radius-full); overflow: hidden; background: var(--pw-petal-cyan); }
.tt-meter-a { background: var(--pw-petal-coral); transition: width .5s var(--pw-ease-out); }
.tt-meter-b { flex: 1; }
.tt-meter em { position: absolute; top: 50%; transform: translateY(-50%); font-style: normal; font-size: 11px; font-weight: 700; color: #fff; text-shadow: 0 1px 2px rgba(2,6,23,.3); }
.tt-meter em.l { left: 10px; } .tt-meter em.r { right: 10px; }
.tt-meter::after { content: '📣 cheers'; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); font-size: 10px; font-weight: 700; color: #fff; letter-spacing: .04em; text-shadow: 0 1px 2px rgba(2,6,23,.3); }

.tt-reacts { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.tt-react { height: 38px; border: 1px solid var(--pw-border); border-radius: var(--pw-radius-md); background: var(--pw-bg); font-size: 18px; cursor: pointer;
  transition: transform 120ms var(--pw-ease-out), background-color 120ms; }
.tt-react:hover { background: var(--pw-bg-hover); transform: translateY(-2px); }
.tt-react:active { transform: scale(.9); }

.tt-fx { position: absolute; inset: 0; pointer-events: none; z-index: 3; overflow: hidden; }
.tt-float { position: absolute; bottom: 40px; font-size: 26px; animation: ttFloatUp var(--dur, 2s) ease-out forwards; }
.tt-combo { position: absolute; top: -6px; right: -18px; font-size: 13px; font-weight: 800; color: var(--pw-brand-600); }
.tt-rain { position: fixed; inset: 0; pointer-events: none; z-index: 60; overflow: hidden; }
.tt-rain span { position: absolute; top: -60px; animation: ttRain 2.8s cubic-bezier(.3,.1,.6,1) forwards; }
@keyframes ttRain { to { transform: translateY(110vh) rotate(var(--spin)); } }
@keyframes ttFloatUp {
  0% { opacity: 0; transform: translate(0, 0) scale(.6); }
  15% { opacity: 1; transform: translate(calc(var(--drift) * .2), -30px) scale(1.15); }
  100% { opacity: 0; transform: translate(var(--drift), -220px) scale(1); }
}

.tt-ticker { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.tt-tick-row { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: var(--pw-radius-xl); background: var(--pw-bg-subtle); font-size: 14px; color: var(--pw-fg-muted); }
.tt-tick-row b { color: var(--pw-fg); font-variant-numeric: tabular-nums; }
.tt-tick-row time { margin-left: auto; font-size: 12px; color: var(--pw-fg-subtle); }
.tt-tick-row.new { background: var(--pw-brand-50); color: var(--pw-fg); animation: ttTickIn .5s var(--pw-ease-out); }
.tt-tick-row:nth-child(n+4) { opacity: .6; }
@keyframes ttTickIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

.tt-toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; z-index: 50;
  padding: 10px 16px; border-radius: var(--pw-radius-full); background: var(--pw-fg); color: var(--pw-bg); font-size: 14px; font-weight: 600;
  transition: opacity .2s, transform .2s var(--pw-ease-out); }
.tt-toast.on { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  .tt-float, .tt-big-score.tt-pop, .tt-plus, .tt-tag.deuce, .tt-tick-row.new { animation: none; }
  .tt-float { display: none; }
}
