/* Self-hosted fonts */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/static/fonts/inter-400.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/static/fonts/inter-500.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/static/fonts/inter-600.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/static/fonts/inter-700.woff2') format('woff2');
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/static/fonts/jetbrains-mono-400.woff2') format('woff2');
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/static/fonts/jetbrains-mono-700.woff2') format('woff2');
}

/* Pokerthon Viewer — Dark Poker Theme */

:root {
  --bg: #0f1a0f;
  --surface: #1a2e1a;
  --card-bg: #1e3a1e;
  --border: #2d4a2d;
  --text: #e8f5e8;
  --text-muted: #8aab8a;
  --accent: #4caf50;
  --accent-hover: #66bb6a;
  --danger: #e53935;
  --warn: #fb8c00;
  --gold: #ffd700;
  --silver: #c0c0c0;
  --bronze: #cd7f32;
  --tag-color: #2196f3;
  --lag-color: #f44336;
  --fish-color: #4caf50;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container { flex: 1; }

/* Nav */
nav {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: .75rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

nav .brand {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
}

nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: .9rem;
  transition: color .15s;
}

nav a:hover { color: var(--text); }
nav a.active {
  color: var(--accent);
  border-bottom: 2px solid var(--accent);
  padding-bottom: 2px;
}

/* Footer */
footer {
  text-align: center;
  padding: 1.25rem;
  font-size: .78rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  margin-top: 2rem;
}

/* Chip numbers use monospace */
.chips { font-family: 'JetBrains Mono', monospace; }

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem;
}

/* Cards */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem;
}

/* Stats Bar (lobby) */
.stats-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: .6rem 1.2rem;
  margin-bottom: .5rem;
  font-size: .88rem;
}

.stats-bar-item { display: flex; align-items: baseline; gap: .35rem; }
.stats-bar-num  { font-family: 'JetBrains Mono', monospace; font-size: 1.1rem; font-weight: 700; color: var(--accent); }
.stats-bar-label { color: var(--text-muted); font-size: .8rem; }
.stats-bar-sep  { color: var(--border); }

/* Table Grid */
.table-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

@media (max-width: 900px) { .table-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .table-grid { grid-template-columns: 1fr; } }

.table-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem;
  transition: border-color .2s, transform .2s, box-shadow .2s;
  text-decoration: none;
  color: inherit;
  display: block;
}

.table-card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
}

.table-card-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: .5rem; }
.table-card .table-no { font-size: 1.3rem; font-weight: 700; color: var(--accent); }
.table-card .table-badges { display: flex; gap: .3rem; flex-wrap: wrap; }
.table-card .table-info { font-size: .85rem; color: var(--text-muted); margin-top: .4rem; display: flex; gap: .75rem; }

/* Seat progress bar */
.seat-progress-wrap {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin: .4rem 0;
}

.seat-progress-bar {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width .4s ease;
  min-width: 2px;
}

/* Leaderboard rank 1 row */
.lb-rank1 { background: rgba(255,215,0,.05) !important; }

/* Badges */
.badge {
  display: inline-block;
  padding: .15rem .5rem;
  border-radius: 4px;
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.badge-open    { background: #1b5e20; color: #a5d6a7; }
.badge-paused  { background: #e65100; color: #ffe0b2; }
.badge-closed  { background: #424242; color: #bdbdbd; }
.badge-live    { background: #b71c1c; color: #ffcdd2; animation: pulse 1.5s infinite; }
.badge-tag     { background: var(--tag-color); color: #fff; }
.badge-lag     { background: var(--lag-color); color: #fff; }
.badge-fish    { background: var(--fish-color); color: #fff; }

@keyframes pulse { 0%,100%{opacity:1;} 50%{opacity:.6;} }

/* Leaderboard table */
table { width: 100%; border-collapse: collapse; }
th, td { padding: .6rem .75rem; text-align: left; }
th { background: var(--surface); color: var(--text-muted); font-size: .8rem; text-transform: uppercase; }
tr:nth-child(even) { background: rgba(255,255,255,.03); }
tr:hover { background: rgba(255,255,255,.06); }

td a { color: var(--accent); text-decoration: none; }
td a:hover { text-decoration: underline; }

.rank-gold   { color: var(--gold);   font-weight: 700; }
.rank-silver { color: var(--silver); font-weight: 700; }
.rank-bronze { color: var(--bronze); font-weight: 700; }

/* ── Info Bar (live table top strip) ── */
.info-bar {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  margin-bottom: .5rem;
}

.info-pill {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: .4rem .75rem;
  flex: 1;
  min-width: 90px;
  text-align: center;
}

.info-pill.pill-primary {
  border-color: var(--accent);
  background: rgba(76,175,80,.08);
}

.info-pill .pill-label {
  font-size: .65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
}

.info-pill .pill-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--accent);
  margin-top: .05rem;
}

.info-pill .pill-value.warn { color: var(--warn); }
.info-pill .pill-value.danger { color: var(--danger); animation: pulse 1s infinite; }

/* Status line (below info bar) */
.status-line {
  font-size: .75rem;
  color: var(--text-muted);
  text-align: right;
  margin-bottom: .75rem;
  padding-right: .25rem;
}

/* ── Poker Table Wrap ── */
/* Responsive: scales with screen width, aspect-ratio maintains proportions */
.poker-table-wrap {
  position: relative;
  width: 100%;
  max-width: 860px;
  aspect-ratio: 86 / 54;
  margin: 0 auto 1.5rem;
  overflow: visible;
}

.poker-table {
  position: absolute;
  width: 67%;
  height: 55%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background:
    radial-gradient(ellipse at 50% 40%, #2e8033 0%, #297a2d 35%, #1f6623 65%, #195a1c 100%);
  border-radius: 50%;
  border: 10px solid #5d4037;
  box-shadow:
    0 0 0 3px #4e342e,
    0 0 0 6px rgba(62,39,35,.35),
    0 0 50px rgba(0,0,0,.5),
    inset 0 2px 40px rgba(0,0,0,.2),
    inset 0 0 80px rgba(0,0,0,.12);
}

/* Inner felt line decoration */
.poker-table::after {
  content: '';
  position: absolute;
  inset: 12px;
  border: 1.5px solid rgba(255,255,255,.06);
  border-radius: 50%;
  pointer-events: none;
}

.board-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

.board-cards { display: flex; gap: .35rem; justify-content: center; }

.playing-card {
  width: 46px;
  height: 64px;
  background: linear-gradient(160deg, #fff 0%, #f3f3f3 100%);
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  border: 1px solid #ccc;
  color: #111;
  box-shadow: 0 2px 8px rgba(0,0,0,.3);
}

.playing-card.hearts, .playing-card.diamonds { color: #c62828; }
.playing-card.spades,  .playing-card.clubs   { color: #111; }
.playing-card.empty {
  background: rgba(255,255,255,.08);
  color: rgba(255,255,255,.25);
  border: 1px dashed rgba(255,255,255,.15);
  box-shadow: none;
}

/* Small cards (hand detail hole cards) */
.playing-card.small {
  width: 32px; height: 46px;
  font-size: .75rem;
  border-radius: 4px;
}

/* Mini cards (hand list board) */
.playing-card.mini {
  width: 24px; height: 34px;
  font-size: .6rem;
  border-radius: 3px;
  padding: 0;
}

.board-cards-inline { display: inline-flex; gap: .2rem; vertical-align: middle; }

/* Pot display on table center */
.pot-display { margin-top: .3rem; text-align: center; }
.pot-main {
  color: #fff;
  font-family: 'JetBrains Mono', monospace;
  font-size: .9rem;
  font-weight: 700;
  text-shadow: 0 1px 6px rgba(0,0,0,.7);
}
.pot-side {
  color: var(--warn);
  font-family: 'JetBrains Mono', monospace;
  font-size: .72rem;
  margin-top: .1rem;
}

/* ── Seat positions around table (9 seats) ── */
/* Positions are center-anchored via transform: translate(-50%,-50%) */
.seat-container {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .2rem;
  transform: translate(-50%, -50%);
  z-index: 2;
}

/* 9 seat coordinates — adjusted to prevent clipping at edges */
.seat-pos-1 { top: 88%; left: 50%; }   /* bottom center */
.seat-pos-2 { top: 79%; left: 77%; }   /* bottom right */
.seat-pos-3 { top: 50%; left: 93%; }   /* right */
.seat-pos-4 { top: 17%; left: 82%; }   /* top right */
.seat-pos-5 { top:  9%; left: 63%; }   /* top center-right */
.seat-pos-6 { top:  9%; left: 37%; }   /* top center-left */
.seat-pos-7 { top: 17%; left: 18%; }   /* top left */
.seat-pos-8 { top: 50%; left:  7%; }   /* left */
.seat-pos-9 { top: 79%; left: 23%; }   /* bottom left */

.seat-chip {
  width: 88px;
  background: rgba(18,36,18,.93);
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: .3rem .45rem;
  text-align: center;
  font-size: .68rem;
  backdrop-filter: blur(6px);
  transition: border-color .25s, box-shadow .25s, opacity .25s;
  box-shadow: 0 2px 8px rgba(0,0,0,.35);
  overflow: hidden;
}

.seat-chip.active-turn {
  border-color: var(--accent);
  box-shadow: 0 0 12px var(--accent), 0 0 28px rgba(76,175,80,.3);
  animation: glow-turn 1.2s ease-in-out infinite alternate;
}

@keyframes glow-turn {
  from { box-shadow: 0 0 8px var(--accent), 0 2px 8px rgba(0,0,0,.35); }
  to   { box-shadow: 0 0 20px var(--accent), 0 0 40px rgba(76,175,80,.35); }
}

.seat-chip.folded  { opacity: .3; }
.seat-chip.all-in  { border-color: var(--warn); box-shadow: 0 0 10px rgba(251,140,0,.4), 0 2px 8px rgba(0,0,0,.35); }
.seat-chip.empty {
  border-style: dashed;
  border-color: rgba(45,74,45,.5);
  color: var(--text-muted);
  background: rgba(15,26,15,.4);
  box-shadow: none;
}

.seat-chip .seat-no    { font-size: .55rem; color: var(--text-muted); }
.seat-chip .seat-name  { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 78px; }
.seat-chip .seat-stack { color: var(--accent); font-family: 'JetBrains Mono', monospace; font-size: .7rem; }

/* Per-seat bet indicator */
.seat-bet-chip {
  display: inline-block;
  background: rgba(251,140,0,.15);
  color: var(--warn);
  font-family: 'JetBrains Mono', monospace;
  font-size: .6rem;
  border-radius: 3px;
  padding: .05rem .25rem;
  margin-top: .1rem;
}

/* Active seat action labels */
.seat-action-call  { font-size: .62rem; color: #64b5f6; font-weight: 700; }
.seat-action-check { font-size: .62rem; color: #66bb6a; }
.seat-action-fold  { font-size: .6rem; color: #9e9e9e; }
.seat-action-allin { font-size: .62rem; color: var(--danger); font-weight: 700; }

.seat-markers { display: flex; gap: .2rem; justify-content: center; }

.seat-marker {
  font-size: .55rem;
  font-weight: 700;
  padding: .1rem .28rem;
  border-radius: 3px;
  line-height: 1.2;
}

.marker-d  { background: #f9a825; color: #000; }
.marker-sb { background: #1565c0; color: #fff; }
.marker-bb { background: #b71c1c; color: #fff; }

/* Action feed */
.action-feed {
  max-height: 300px;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: .5rem;
}

/* Custom scrollbar for dark theme */
.action-feed::-webkit-scrollbar { width: 6px; }
.action-feed::-webkit-scrollbar-track { background: transparent; }
.action-feed::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.action-feed::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

.action-item {
  padding: .3rem .5rem;
  font-size: .82rem;
  border-bottom: 1px solid rgba(255,255,255,.04);
  border-radius: 3px;
  transition: background .15s;
}

.action-item:last-child { border-bottom: none; }
.action-item:hover { background: rgba(255,255,255,.03); }
.action-system       { color: var(--text-muted); font-style: italic; }
.action-system-event { color: var(--text-muted); font-style: italic; text-align: center; letter-spacing: .05em; }
.action-player  { color: var(--text); }
.action-fold    { color: #9e9e9e; }
.action-check   { color: #66bb6a; }
.action-call    { color: #64b5f6; }
.action-raise   { color: var(--warn); font-weight: 600; }
.action-allin   { color: var(--danger); font-weight: 700; }

/* Mini leaderboard */
.mini-lb td { font-size: .85rem; padding: .4rem .6rem; }

/* Leaderboard: TOP 3 row highlight */
.rank-top3-1 { background: rgba(255,215,0,.07) !important; }
.rank-top3-2 { background: rgba(192,192,192,.05) !important; }
.rank-top3-3 { background: rgba(205,127,50,.05) !important; }

/* Win-rate progress bar */
.wr-bar-wrap {
  width: 48px;
  height: 5px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
  flex-shrink: 0;
}

.wr-bar {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
}

/* Online dot */
.online-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  background: var(--accent);
  border-radius: 50%;
  margin-right: .3rem;
  vertical-align: middle;
  box-shadow: 0 0 4px var(--accent);
  animation: pulse 2s infinite;
}

/* Pagination */
.pagination { display: flex; gap: .5rem; align-items: center; margin-top: 1rem; }
.pagination a, .pagination span {
  padding: .3rem .7rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  text-decoration: none;
  color: var(--text);
  font-size: .85rem;
}
.pagination a:hover { background: var(--surface); }
.pagination .current { background: var(--accent); color: #000; }

/* Buttons */
.btn {
  display: inline-block;
  padding: .4rem .9rem;
  border-radius: 5px;
  border: none;
  cursor: pointer;
  font-size: .85rem;
  text-decoration: none;
  transition: opacity .15s;
}

.btn:hover { opacity: .85; }
.btn-primary { background: var(--accent); color: #000; }
.btn-secondary { background: var(--surface); color: var(--text); border: 1px solid var(--border); }

/* Section headings */
h1 { font-size: 1.6rem; margin-bottom: 1rem; }
h2 { font-size: 1.2rem; margin-bottom: .75rem; color: var(--text-muted); }

/* Summary cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: .75rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  text-align: center;
}

.stat-card .num { font-size: 1.8rem; font-weight: 700; color: var(--accent); }
.stat-card .label { font-size: .8rem; color: var(--text-muted); margin-top: .2rem; }

/* ── Leaderboard toolbar (tabs + sort) ── */
.lb-toolbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.lb-tabs {
  display: flex;
  gap: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.lb-tab {
  padding: .4rem .9rem;
  font-size: .85rem;
  font-family: inherit;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  transition: background .15s, color .15s;
  border-right: 1px solid var(--border);
}

.lb-tab:last-child { border-right: none; }
.lb-tab:hover { background: rgba(255,255,255,.05); color: var(--text); }
.lb-tab.active { background: var(--accent); color: #000; font-weight: 600; }

.lb-sorts {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
  margin-left: auto;
}

/* Mobile responsive tables */
@media (max-width: 640px) {
  .hide-mobile { display: none; }
}

/* ── Small-screen adaptive (phones) ── */
@media (max-width: 600px) {
  .poker-table-wrap { aspect-ratio: 86 / 62; }
  .poker-table { width: 62%; height: 48%; }
  .seat-chip {
    width: 68px;
    font-size: .58rem;
    padding: .2rem .3rem;
    border-radius: 8px;
  }
  .seat-chip .seat-name { max-width: 58px; font-size: .58rem; }
  .seat-chip .seat-stack { font-size: .56rem; }
  .seat-chip .seat-no { font-size: .48rem; }
  .seat-marker { font-size: .48rem; padding: .05rem .2rem; }
  .playing-card { width: 34px; height: 48px; font-size: .8rem; }
  .board-cards { gap: .2rem; }
  .pot-main { font-size: .75rem; }
  .pot-side { font-size: .6rem; }
  .info-bar { gap: .3rem; }
  .info-pill { min-width: 65px; padding: .3rem .4rem; }
  .info-pill .pill-label { font-size: .55rem; }
  .info-pill .pill-value { font-size: .9rem; }
  .container { padding: 1rem; }
}

@media (max-width: 420px) {
  .poker-table-wrap { aspect-ratio: 86 / 70; }
  .seat-chip { width: 58px; font-size: .52rem; }
  .seat-chip .seat-name { max-width: 48px; }
  .seat-chip .seat-stack { font-size: .5rem; }
  .info-pill { min-width: 55px; padding: .25rem .3rem; }
  .info-pill .pill-value { font-size: .78rem; }
}

/* ── V8: Table idle message ── */
.table-idle-msg {
  color: rgba(255,255,255,.45);
  font-size: .85rem;
  margin-top: .5rem;
  letter-spacing: .03em;
  animation: idle-fade 2.5s ease-in-out infinite;
}

@keyframes idle-fade { 0%,100%{opacity:.45;} 50%{opacity:.8;} }

/* ── V14: Showdown micro cards on seats ── */
.playing-card.micro {
  width: 20px;
  height: 28px;
  font-size: .5rem;
  border-radius: 3px;
  box-shadow: 0 1px 3px rgba(0,0,0,.3);
}

.seat-hole-cards {
  display: flex;
  gap: .15rem;
  justify-content: center;
  margin-top: .15rem;
}

/* ── V15: Global dark scrollbar ── */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }
html { scrollbar-color: var(--border) var(--bg); }

/* ── Blind Level Banner ── */
.blind-level-banner {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  background: linear-gradient(135deg, rgba(255,180,0,.15), rgba(255,120,0,.1));
  border: 1px solid rgba(255,180,0,.4);
  border-radius: 8px;
  padding: .6rem 1rem;
  margin-bottom: 1rem;
  font-size: .9rem;
}
.blind-level-num {
  font-weight: 700;
  font-size: 1rem;
  color: var(--accent);
}
.blind-level-blinds {
  font-weight: 600;
  color: var(--text);
}
.blind-level-next {
  color: var(--text-muted);
  font-size: .85rem;
}
#blindCountdown {
  color: var(--accent);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.blind-level-waiting {
  background: linear-gradient(135deg, rgba(100,180,255,.12), rgba(60,130,255,.08));
  border-color: rgba(100,180,255,.4);
}

/* ── Action feed: tournament results ── */
.action-tournament-winner {
  color: var(--gold) !important;
  font-weight: 700;
  font-size: .95rem;
  text-align: center;
  letter-spacing: .05em;
  padding: .5rem !important;
}
.action-tournament-runner-up {
  color: var(--silver) !important;
  font-weight: 600;
  text-align: center;
  letter-spacing: .04em;
}

/* ── Tournament Celebration Overlay ── */
.tournament-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0);
  backdrop-filter: blur(0px);
  pointer-events: none;
  opacity: 0;
  transition: opacity .6s ease, background .6s ease, backdrop-filter .6s ease;
}
.tournament-overlay.visible {
  opacity: 1;
  pointer-events: auto;
  background: rgba(0, 0, 0, .75);
  backdrop-filter: blur(8px);
}

.tournament-modal {
  position: relative;
  text-align: center;
  padding: 3rem 4rem;
  border-radius: 20px;
  background: linear-gradient(170deg, #1a2e1a 0%, #0f1a0f 60%, #1a1a0a 100%);
  border: 2px solid rgba(255, 215, 0, .4);
  box-shadow:
    0 0 60px rgba(255, 215, 0, .15),
    0 0 120px rgba(255, 215, 0, .05),
    0 20px 60px rgba(0, 0, 0, .6);
  transform: scale(.8);
  transition: transform .5s cubic-bezier(.34, 1.56, .64, 1);
  overflow: hidden;
  max-width: 480px;
  width: 90vw;
}
.tournament-overlay.visible .tournament-modal {
  transform: scale(1);
}

.trophy-glow {
  position: absolute;
  top: -40%;
  left: 50%;
  transform: translateX(-50%);
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(255,215,0,.2) 0%, transparent 70%);
  pointer-events: none;
  animation: trophy-glow-pulse 2s ease-in-out infinite;
}
@keyframes trophy-glow-pulse {
  0%, 100% { opacity: .6; transform: translateX(-50%) scale(1); }
  50% { opacity: 1; transform: translateX(-50%) scale(1.15); }
}

.trophy-icon {
  font-size: 5rem;
  line-height: 1;
  margin-bottom: .5rem;
  position: relative;
  z-index: 1;
  animation: trophy-bounce .8s cubic-bezier(.34, 1.56, .64, 1) both;
  filter: drop-shadow(0 0 20px rgba(255, 215, 0, .5));
}
@keyframes trophy-bounce {
  0%   { transform: scale(0) rotate(-15deg); opacity: 0; }
  60%  { transform: scale(1.15) rotate(3deg); opacity: 1; }
  100% { transform: scale(1) rotate(0deg); }
}

.tournament-title {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: .25em;
  color: rgba(255, 215, 0, .8);
  text-transform: uppercase;
  margin-bottom: 1rem;
  position: relative;
  z-index: 1;
  animation: title-fade-in .6s .3s ease both;
}
@keyframes title-fade-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.winner-name {
  font-size: 2.4rem;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 0 30px rgba(255, 215, 0, .4), 0 2px 4px rgba(0, 0, 0, .5);
  margin-bottom: 1.5rem;
  position: relative;
  z-index: 1;
  animation: winner-reveal .7s .5s ease both;
}
@keyframes winner-reveal {
  from { opacity: 0; transform: translateY(15px) scale(.9); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.runner-up-section {
  position: relative;
  z-index: 1;
  margin-bottom: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, .1);
  animation: runner-up-in .6s .9s ease both;
}
@keyframes runner-up-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.runner-up-label {
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--silver);
  margin-bottom: .3rem;
}
.runner-up-name {
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--silver);
  text-shadow: 0 0 15px rgba(192, 192, 192, .3);
}

.tournament-close-btn {
  position: relative;
  z-index: 1;
  margin-top: .5rem;
  padding: .5rem 2rem;
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 8px;
  background: rgba(255, 255, 255, .08);
  color: var(--text-muted);
  font-size: .85rem;
  cursor: pointer;
  transition: background .2s, color .2s, border-color .2s;
  animation: btn-fade .5s 1.2s ease both;
}
.tournament-close-btn:hover {
  background: rgba(255, 255, 255, .15);
  color: var(--text);
  border-color: rgba(255, 255, 255, .35);
}
@keyframes btn-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Confetti */
.confetti-container {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}
.confetti-piece {
  position: absolute;
  top: -20px;
  border-radius: 2px;
  opacity: 0;
  animation: confetti-fall linear forwards;
}
@keyframes confetti-fall {
  0%   { opacity: 1; transform: translateY(0) rotate(0deg); }
  100% { opacity: 0; transform: translateY(500px) rotate(720deg); }
}
