/* ─── Variables ─── */
:root {
  --bg: #060610;
  --surface: #0d0d1c;
  --surface2: #121226;
  --surface3: #1a1a30;
  --accent: #c8a96e;
  --accent-dim: #8a6f42;
  --accent2: #e8cc90;
  --blue: #4dc9f6;
  --blue-dim: rgba(77,201,246,0.12);
  --text: #dddde8;
  --text-muted: rgba(221,221,232,0.42);
  --green: #34d399;
  --green-bg: rgba(52,211,153,0.10);
  --green-border: rgba(52,211,153,0.28);
  --yellow: #fbbf24;
  --yellow-bg: rgba(251,191,36,0.10);
  --yellow-border: rgba(251,191,36,0.28);
  --red: #fb7185;
  --red-bg: rgba(251,113,133,0.09);
  --red-border: rgba(251,113,133,0.26);
  --border: rgba(255,255,255,0.065);
  --border-strong: rgba(255,255,255,0.13);
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.4);
  --shadow: 0 8px 32px rgba(0,0,0,0.55);
  --shadow-lg: 0 20px 60px rgba(0,0,0,0.7);
  --transition: 0.18s cubic-bezier(0.4,0,0.2,1);
}

/* ─── Light theme ─── */
[data-theme="light"] {
  --bg: #f2f0eb;
  --surface: #ffffff;
  --surface2: #f5f3ee;
  --surface3: #ebe8e1;
  --accent: #8a6f42;
  --accent-dim: #6b5530;
  --accent2: #5c4422;
  --text: #1a1a2e;
  --text-muted: rgba(26,26,46,0.5);
  --green: #16a34a;
  --green-bg: rgba(22,163,74,0.1);
  --green-border: rgba(22,163,74,0.3);
  --yellow: #ca8a04;
  --yellow-bg: rgba(202,138,4,0.1);
  --yellow-border: rgba(202,138,4,0.3);
  --red: #dc2626;
  --red-bg: rgba(220,38,38,0.08);
  --red-border: rgba(220,38,38,0.25);
  --border: rgba(0,0,0,0.08);
  --border-strong: rgba(0,0,0,0.15);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.08);
  --shadow: 0 8px 32px rgba(0,0,0,0.1);
  --shadow-lg: 0 20px 60px rgba(0,0,0,0.15);
}

[data-theme="light"] body {
  background: #f2f0eb;
}

[data-theme="light"] body::before,
[data-theme="light"] body::after {
  display: none;
}

[data-theme="light"] header {
  background: rgba(255,255,255,0.92);
  box-shadow: 0 1px 0 rgba(0,0,0,0.06), 0 4px 24px rgba(0,0,0,0.06);
}

[data-theme="light"] header::after {
  background: linear-gradient(90deg, transparent 0%, rgba(138,111,66,0.3) 50%, transparent 100%);
}

[data-theme="light"] .landing-overlay {
  background: #f2f0eb;
}

[data-theme="light"] .landing-overlay::before {
  display: none;
}

[data-theme="light"] .modal-overlay {
  background: rgba(0,0,0,0.35);
}

[data-theme="light"] .logo-icon {
  color: #fff;
}

[data-theme="light"] .footer-logo-icon {
  color: #fff;
}

[data-theme="light"] .btn-guess {
  color: #fff;
}

[data-theme="light"] .landing-play-btn {
  color: #fff;
}

[data-theme="light"] .btn-share-text {
  color: #fff;
}

[data-theme="light"] .cookie-accept {
  color: #fff;
}

/* ─── Reset ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
button, a, input, [role="button"] { touch-action: manipulation; }

body {
  background:
    radial-gradient(ellipse 110% 55% at 50% -2%, rgba(200,169,110,0.13) 0%, transparent 55%),
    radial-gradient(ellipse 55% 90% at -8% 60%, rgba(88,55,220,0.08) 0%, transparent 50%),
    radial-gradient(ellipse 55% 90% at 108% 40%, rgba(0,180,240,0.07) 0%, transparent 50%),
    #060610;
  color: var(--text);
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ─── Hex triangular mesh (LoL-style) ─── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(0deg,   rgba(200,169,110,0.045) 1px, transparent 1px),
    linear-gradient(60deg,  rgba(200,169,110,0.032) 1px, transparent 1px),
    linear-gradient(-60deg, rgba(200,169,110,0.032) 1px, transparent 1px);
  background-size: 32px 55px;
  pointer-events: none;
  z-index: 0;
}

/* ─── Side ambient glows (arena atmosphere) ─── */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 40% 60% at 0% 70%, rgba(80,45,200,0.09) 0%, transparent 55%),
    radial-gradient(ellipse 40% 60% at 100% 30%, rgba(0,190,240,0.08) 0%, transparent 55%);
  pointer-events: none;
  z-index: 0;
}

main, header { position: relative; z-index: 1; }

/* ─── Header ─── */
header {
  background: rgba(6,6,16,0.94);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 1px 0 rgba(200,169,110,0.08), 0 4px 24px rgba(0,0,0,0.5);
}

header::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(200,169,110,0.35) 30%, rgba(200,169,110,0.55) 50%, rgba(200,169,110,0.35) 70%, transparent 100%);
}

.header-inner {
  max-width: 860px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 62px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.logo-icon {
  width: 34px;
  height: 34px;
  background: linear-gradient(135deg, var(--accent), var(--accent-dim));
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 900;
  color: #06060e;
  letter-spacing: -0.5px;
  flex-shrink: 0;
}

.logo-text {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.3px;
  color: var(--accent2);
  text-shadow: 0 0 20px rgba(200,169,110,0.4);
}

.logo { cursor: pointer; background: none; border: none; padding: 0; }
.logo:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: var(--radius-sm); }

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-lang {
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--text-muted);
  height: 36px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
  font-family: inherit;
  letter-spacing: 0.5px;
  transition: border-color var(--transition), color var(--transition), background var(--transition);
}

.btn-lang:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(200,169,110,0.07);
}

.btn-icon {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  transition: border-color var(--transition), color var(--transition), background var(--transition);
}

.btn-icon-svg { padding: 0; }
.btn-icon-svg svg { display: block; }
.btn-icon:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(200,169,110,0.07);
}
.btn-icon:focus-visible, .btn-lang:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ─── Main ─── */
main {
  max-width: 860px;
  margin: 0 auto;
  padding: 28px 16px 80px;
}

/* ─── Mode tabs ─── */
.mode-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 24px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 5px;
  border: 1px solid var(--border);
}

.mode-tab {
  flex: 1;
  padding: 9px 8px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 600;
  font-family: inherit;
  transition: color var(--transition), background var(--transition), box-shadow var(--transition), border-color var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  letter-spacing: 0.1px;
  white-space: nowrap;
}

.mode-tab:hover:not(.active) {
  color: var(--text);
  background: rgba(255,255,255,0.04);
}

.mode-tab:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}
.mode-tab.active {
  background: var(--surface3);
  color: var(--accent2);
  box-shadow: 0 1px 6px rgba(0,0,0,0.35);
  border: 1px solid rgba(200,169,110,0.18);
}

.mode-tab-tournament {
  color: rgba(180,140,255,0.65) !important;
}
.mode-tab-tournament.active {
  background: rgba(120,80,220,0.18) !important;
  color: #c8a0f8 !important;
  border-color: rgba(120,80,220,0.3) !important;
}
.mode-tab-tournament:hover:not(.active) {
  color: #c8a0f8 !important;
  background: rgba(120,80,220,0.1) !important;
}

/* ─── League filter panel ─── */
.league-filter-panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.28s cubic-bezier(0.4,0,0.2,1), opacity 0.2s;
  opacity: 0;
  margin-bottom: 0;
}
.league-filter-panel.open {
  max-height: 400px;
  opacity: 1;
  margin-bottom: 16px;
}
.lfp-inner {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.lfp-section { display: flex; flex-direction: column; gap: 7px; }
.lfp-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.lfp-section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.9px;
  color: var(--text-muted);
  text-transform: uppercase;
}
.lfp-section-toggle {
  background: none;
  border: none;
  color: var(--accent-dim);
  font-size: 11px;
  font-family: inherit;
  cursor: pointer;
  padding: 0;
  transition: color var(--transition);
}
.lfp-section-toggle:hover { color: var(--accent); }
.lfp-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.lfp-chip {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  color: var(--text-muted);
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
  white-space: nowrap;
  user-select: none;
}
.lfp-chip:hover { border-color: var(--border-strong); color: var(--text); }
.lfp-chip.active {
  background: rgba(200,169,110,0.10);
  border-color: rgba(200,169,110,0.32);
  color: var(--accent2);
}
.lfp-chip-erl-all {
  background: rgba(77,201,246,0.07);
  border-color: rgba(77,201,246,0.2);
  color: var(--blue);
  font-size: 11px;
}
.lfp-chip-erl-all:hover { border-color: rgba(77,201,246,0.45); }
.lfp-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 6px;
  border-top: 1px solid var(--border);
}
.lfp-count {
  font-size: 11px;
  color: var(--text-muted);
}
.lfp-note {
  font-size: 10.5px;
  color: var(--text-muted);
  opacity: 0.7;
  font-style: italic;
}
.lfp-reset {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 11px;
  font-family: inherit;
  padding: 3px 10px;
  cursor: pointer;
  transition: all var(--transition);
}
.lfp-reset:hover { border-color: var(--border-strong); color: var(--text); }

/* active filter indicator on btn-league */
.btn-league-active { position: relative; }
.btn-league-active::after {
  content: '';
  position: absolute;
  top: 4px; right: 4px;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  border: 1.5px solid var(--bg);
}

/* ─── Stats bar ─── */
.stats-bar {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-bottom: 24px;
}

.stat-chip {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 8px 10px;
  text-align: center;
  transition: border-color var(--transition);
}

.stat-chip:hover { border-color: var(--border-strong); }

.stat-chip-value {
  font-size: 22px;
  font-weight: 800;
  color: var(--accent2);
  letter-spacing: -0.5px;
  line-height: 1;
  margin-bottom: 5px;
  font-variant-numeric: tabular-nums;
}

.stat-chip-label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 600;
}

/* ─── Legend ─── */
.legend {
  display: flex;
  gap: 14px;
  justify-content: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--text-muted);
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex-shrink: 0;
}
.legend-dot.green  { background: var(--green); }
.legend-dot.yellow { background: var(--yellow); }
.legend-dot.red    { background: var(--red); }

/* ─── Attempt dots ─── */
.attempts-info {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-bottom: 18px;
}

.attempt-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--surface3);
  border: 1px solid var(--border-strong);
  transition: all 0.25s ease;
}

.attempt-dot.used { background: var(--accent-dim); border-color: var(--accent); }
.attempt-dot.win  { background: var(--green); border-color: var(--green); box-shadow: 0 0 6px rgba(52,211,153,0.5); }

/* ─── Puzzle area ─── */
#puzzle-area {
  margin-bottom: 20px;
  animation: fadeUp 0.3s ease;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── Search ─── */
.search-wrap {
  position: relative;
  margin-bottom: 10px;
}

.search-input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 13px 18px 13px 46px;
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
  font-weight: 500;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(200,169,110,0.12);
}

.search-input::placeholder { color: var(--text-muted); font-weight: 400; }

.search-icon {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 17px;
  pointer-events: none;
  line-height: 1;
}

.search-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0; right: 0;
  background: var(--surface2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  z-index: 50;
  max-height: 296px;
  overflow-y: auto;
}

.search-dropdown::-webkit-scrollbar { width: 4px; }
.search-dropdown::-webkit-scrollbar-track { background: transparent; }
.search-dropdown::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 2px; }

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 14px;
  cursor: pointer;
  transition: background var(--transition);
  border-bottom: 1px solid var(--border);
}
.dropdown-item:last-child { border-bottom: none; }
.dropdown-item:hover { background: rgba(200,169,110,0.07); }

.player-avatar-sm {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--surface3);
  border: 1px solid var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  color: var(--accent2);
  flex-shrink: 0;
  background-size: cover;
  background-position: top center;
}

.player-avatar-sm.has-img { font-size: 0; }

.dropdown-player-info { flex: 1; min-width: 0; }
.dropdown-player-name { font-weight: 700; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dropdown-player-meta { font-size: 11.5px; color: var(--text-muted); margin-top: 1px; }

.dropdown-player-role {
  font-size: 10.5px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 20px;
  background: var(--surface3);
  color: var(--text-muted);
  flex-shrink: 0;
  letter-spacing: 0.3px;
}

/* ─── Guess button ─── */
.btn-guess {
  width: 100%;
  padding: 13px;
  background: linear-gradient(135deg, var(--accent), var(--accent-dim));
  border: none;
  border-radius: var(--radius-lg);
  color: #06060e;
  font-size: 14.5px;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), filter var(--transition), opacity var(--transition);
  margin-bottom: 20px;
  letter-spacing: 0.3px;
}

.btn-guess:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(200,169,110,0.35);
  filter: brightness(1.08);
}

.btn-guess:active:not(:disabled) { transform: translateY(0); }
.btn-guess:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.btn-guess:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* ─── Guess table ─── */
.guesses-section { margin-top: 6px; }

.table-header {
  display: grid;
  grid-template-columns: 170px repeat(6, 1fr);
  gap: 5px;
  margin-bottom: 7px;
  padding: 0 2px;
}

.table-header span {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.9px;
  text-align: center;
}

.table-header span:first-child { text-align: left; padding-left: 10px; }

.guess-row {
  display: grid;
  grid-template-columns: 170px repeat(6, 1fr);
  gap: 5px;
  margin-bottom: 5px;
}

/* Staggered flip-in animation per cell */
.guess-row .guess-cell {
  animation: cellReveal 0.35s ease both;
}
.guess-row .guess-cell:nth-child(1) { animation-delay: 0s; }
.guess-row .guess-cell:nth-child(2) { animation-delay: 0.06s; }
.guess-row .guess-cell:nth-child(3) { animation-delay: 0.12s; }
.guess-row .guess-cell:nth-child(4) { animation-delay: 0.18s; }
.guess-row .guess-cell:nth-child(5) { animation-delay: 0.24s; }
.guess-row .guess-cell:nth-child(6) { animation-delay: 0.30s; }
.guess-row .guess-cell:nth-child(7) { animation-delay: 0.36s; }

@keyframes cellReveal {
  from { opacity: 0; transform: rotateX(60deg) scale(0.95); }
  to   { opacity: 1; transform: rotateX(0) scale(1); }
}

.guess-cell {
  padding: 9px 5px;
  border-radius: var(--radius-sm);
  text-align: center;
  font-size: 12.5px;
  font-weight: 700;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 50px;
  border: 1px solid transparent;
}

.guess-cell.player-name-cell {
  text-align: left;
  align-items: flex-start;
  padding: 9px 12px;
  background: var(--surface);
  border-color: var(--border);
}

.player-name-cell .cell-main { font-size: 13px; font-weight: 800; line-height: 1.2; }
.player-name-cell .cell-sub  { font-size: 10.5px; color: var(--text-muted); font-weight: 400; margin-top: 2px; }

.cell-hit   { background: var(--green-bg);  border-color: var(--green-border);  color: var(--green);  }
.cell-close { background: var(--yellow-bg); border-color: var(--yellow-border); color: var(--yellow); }
.cell-miss  { background: var(--red-bg);    border-color: var(--red-border);    color: var(--red);    }

.cell-arrow { font-size: 9px; opacity: 0.75; margin-top: 1px; }

/* ─── Win modal ─── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: fadeIn 0.2s ease;
  overscroll-behavior: contain;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  background: var(--surface2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  padding: 36px 32px;
  max-width: 380px;
  width: calc(100% - 32px);
  text-align: center;
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(200,169,110,0.08);
  animation: modalIn 0.32s cubic-bezier(0.34,1.56,0.64,1);
}

@keyframes modalIn {
  from { transform: scale(0.88) translateY(12px); opacity: 0; }
  to   { transform: scale(1) translateY(0); opacity: 1; }
}

.modal-icon { font-size: 52px; margin-bottom: 10px; }
.modal-title { font-size: 26px; font-weight: 900; margin-bottom: 6px; color: var(--accent2); letter-spacing: -0.5px; }
.modal-subtitle { color: var(--text-muted); font-size: 13.5px; margin-bottom: 20px; }

.modal-player {
  background: var(--surface3);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 16px;
  border: 1px solid rgba(200,169,110,0.15);
}

.modal-player-name { font-size: 21px; font-weight: 900; color: var(--accent2); letter-spacing: -0.3px; }
.modal-player-team { font-size: 12.5px; color: var(--text-muted); margin-top: 4px; }

.modal-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 18px;
}

.modal-stat {
  background: var(--surface3);
  border-radius: var(--radius-sm);
  padding: 11px;
  border: 1px solid var(--border);
}

.modal-stat-value { font-size: 21px; font-weight: 800; color: var(--text); letter-spacing: -0.5px; }
.modal-stat-label { font-size: 10px; color: var(--text-muted); margin-top: 3px; text-transform: uppercase; letter-spacing: 0.6px; }

.modal-share-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.9px;
  text-transform: uppercase;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 8px;
}

.modal-share-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}

.btn-share-sm {
  padding: 10px 6px;
  border-radius: var(--radius);
  font-size: 12px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition);
  border: 1px solid transparent;
  line-height: 1.3;
}

.btn-share-text {
  background: linear-gradient(135deg, var(--accent), var(--accent-dim));
  color: #06060e;
}
.btn-share-text:hover { filter: brightness(1.1); box-shadow: 0 3px 12px rgba(200,169,110,0.3); }

.btn-share-x {
  background: #000;
  color: #fff;
  border-color: rgba(255,255,255,0.15);
}
.btn-share-x:hover { background: #111; border-color: rgba(255,255,255,0.3); }

.btn-share-img {
  background: var(--surface3);
  color: var(--text-muted);
  border-color: var(--border-strong);
}
.btn-share-img:hover { color: var(--text); border-color: rgba(255,255,255,0.2); }

.btn-new-game {
  width: 100%;
  padding: 11px;
  background: transparent;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 13.5px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-new-game:hover { border-color: var(--border-strong); color: var(--text); background: var(--surface3); }

/* ─── Site footer ─── */
.site-footer {
  margin-top: 40px;
  border-top: 1px solid var(--border);
  padding: 20px 16px 28px;
  max-width: 660px;
  margin-left: auto;
  margin-right: auto;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
}

.footer-logo-icon {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--accent), var(--accent-dim));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 900;
  color: #06060e;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 10px;
}

.footer-link {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  transition: color var(--transition);
}
.footer-link:hover { color: var(--text); }

.footer-coffee {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
  font-size: 12.5px;
  transition: all var(--transition);
}
.footer-coffee:hover {
  border-color: var(--accent-dim);
  color: var(--accent2);
  background: rgba(200,169,110,0.06);
}

.footer-social {
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  transition: all var(--transition);
}
.footer-social:hover { border-color: var(--border-strong); background: var(--surface2); color: var(--text); }

.footer-sep { color: var(--border-strong); font-size: 11px; }

.footer-copy {
  font-size: 11px;
  color: var(--text-muted);
  opacity: 0.5;
}

/* ─── Toast ─── */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface3);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 11px 20px;
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: var(--shadow);
  z-index: 300;
  animation: toastIn 0.28s ease, toastOut 0.28s ease 2.5s forwards;
  white-space: nowrap;
}

@keyframes toastIn  { from { opacity:0; transform:translateX(-50%) translateY(14px); } to { opacity:1; transform:translateX(-50%) translateY(0); } }
@keyframes toastOut { to   { opacity:0; transform:translateX(-50%) translateY(14px); } }

/* ─── Photo mode ─── */
.photo-puzzle {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.photo-frame {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.photo-avatar {
  width: 224px;
  height: 268px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow), 0 0 0 1px rgba(200,169,110,0.1);
  position: relative;
  overflow: hidden;
  background: var(--surface);
}

.photo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
  display: block;
  transition: transform 0.7s cubic-bezier(0.4,0,0.2,1), filter 0.6s ease;
  transform-origin: 50% 40%;
}

.photo-initials {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 54px;
  font-weight: 900;
  color: rgba(255,255,255,0.85);
  text-shadow: 0 2px 12px rgba(0,0,0,0.5);
}

.photo-role-badge {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(8,8,15,0.78);
  color: var(--accent2);
  font-size: 10.5px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 20px;
  backdrop-filter: blur(6px);
  border: 1px solid rgba(200,169,110,0.2);
  white-space: nowrap;
  letter-spacing: 0.5px;
}

.photo-reveal-name {
  font-size: 20px;
  font-weight: 900;
  color: var(--accent2);
  text-align: center;
  letter-spacing: -0.3px;
}

.photo-blur-bar {
  display: flex;
  gap: 5px;
}

.blur-step {
  width: 34px;
  height: 4px;
  border-radius: 2px;
  background: var(--surface3);
  transition: background 0.3s ease;
}

.blur-step.revealed { background: var(--accent); }

/* ─── Quote mode ─── */
.quote-puzzle {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 30px 28px 24px;
  position: relative;
  text-align: center;
  overflow: hidden;
}

.quote-puzzle::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.4;
}

.quote-mark {
  font-size: 64px;
  line-height: 0.6;
  color: var(--accent);
  opacity: 0.25;
  font-family: Georgia, serif;
  margin-bottom: 12px;
}

.quote-text {
  font-size: 17px;
  line-height: 1.65;
  color: var(--text);
  font-style: italic;
  margin-bottom: 14px;
  max-width: 580px;
  margin-left: auto;
  margin-right: auto;
  font-weight: 500;
}

.quote-text-pl {
  font-size: 13px;
  color: var(--text-muted);
  font-style: italic;
  margin-top: -6px;
  margin-bottom: 14px;
  max-width: 580px;
  margin-left: auto;
  margin-right: auto;
  font-weight: 400;
}

.quote-author {
  font-size: 13.5px;
  color: var(--text-muted);
  font-weight: 500;
}

.quote-who {
  color: var(--accent2);
  font-weight: 700;
}

/* ─── Achievement mode ─── */
.achievement-puzzle {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 28px 24px;
  text-align: center;
  overflow: hidden;
  position: relative;
}

.achievement-puzzle::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--yellow), transparent);
  opacity: 0.35;
}

.achievement-icon { font-size: 42px; margin-bottom: 14px; }

.achievement-text {
  font-size: 15.5px;
  line-height: 1.7;
  color: var(--text);
  max-width: 580px;
  margin: 0 auto 14px;
}

.achievement-answer {
  color: var(--accent2);
  font-size: 14px;
  font-weight: 700;
  margin-top: 10px;
}

/* ─── Hints row ─── */
.hints-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  justify-content: center;
  margin-top: 10px;
}

.hint-pill {
  background: rgba(200,169,110,0.08);
  border: 1px solid rgba(200,169,110,0.25);
  border-radius: 20px;
  padding: 5px 14px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--accent2);
  animation: fadeUp 0.3s ease;
  letter-spacing: 0.2px;
}

/* ─── Simple guess rows (Photo/Quote/Achievement) ─── */
.simple-guess-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 5px;
  border: 1px solid transparent;
  animation: fadeUp 0.28s ease;
  font-size: 13.5px;
}

.simple-guess-row.cell-hit  { background: var(--green-bg);  border-color: var(--green-border);  }
.simple-guess-row.cell-miss { background: var(--red-bg);    border-color: var(--red-border);    }

.sg-icon { font-size: 14px; flex-shrink: 0; }
.sg-name { font-weight: 800; flex-shrink: 0; }
.sg-meta { font-size: 11.5px; color: var(--text-muted); }

/* ─── Help modal ─── */
.help-modal {
  position: relative;
  max-width: 480px;
  padding: 32px 28px 28px;
  text-align: left;
}

.help-close {
  position: absolute;
  top: 16px; right: 16px;
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  width: 30px; height: 30px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
}
.help-close:hover { border-color: var(--accent); color: var(--accent); }

.help-title {
  font-size: 17px;
  font-weight: 800;
  color: var(--accent2);
  margin-bottom: 20px;
  letter-spacing: -0.3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.help-body { display: flex; flex-direction: column; gap: 16px; }

.help-section { display: flex; flex-direction: column; gap: 6px; }

.help-mode-head {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--accent);
}

.help-section p {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.5;
}

.help-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}

.help-chip {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 6px;
  font-weight: 600;
}
.help-chip.hit  { background: var(--green-bg);  border: 1px solid var(--green-border);  color: #6fcf97; }
.help-chip.close{ background: rgba(242,201,76,0.1); border: 1px solid rgba(242,201,76,0.3); color: #f2c94c; }
.help-chip.miss { background: var(--red-bg);    border: 1px solid var(--red-border);    color: #eb5757; }

.help-hints-section { padding-top: 4px; border-top: 1px solid var(--border); }

.help-hints-row {
  display: grid;
  grid-template-columns: auto auto auto auto auto auto auto;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}

.help-hint-chip {
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 9px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
}

.help-arrow { color: var(--text-muted); font-size: 12px; }

/* ─── Responsive ─── */
@media (max-width: 640px) {
  main { padding: 20px 12px 60px; }

  .mode-tab { font-size: 11px; padding: 8px 4px; gap: 3px; }

  .table-header,
  .guess-row { grid-template-columns: 120px repeat(6, 1fr); }

  .guess-cell { font-size: 11px; padding: 7px 3px; min-height: 44px; }
  .player-name-cell .cell-main { font-size: 11.5px; }

  .stats-bar { gap: 6px; }
  .stat-chip { padding: 10px 6px; }
  .stat-chip-value { font-size: 18px; }

  .photo-avatar { width: 176px; height: 210px; }
  .photo-initials { font-size: 42px; }
  .quote-text { font-size: 15px; }
  .achievement-text { font-size: 14px; }

  .modal { padding: 28px 20px; }

  .site-footer { padding: 16px 12px 24px; }
  .footer-inner { flex-direction: column; align-items: flex-start; gap: 8px; }
}

@media (max-width: 480px) {
  /* Header */
  .header-inner { height: 52px; }
  header { padding: 0 12px; }
  .header-actions { gap: 5px; }
  .btn-icon { width: 32px; height: 32px; font-size: 14px; }
  .btn-lang { height: 32px; padding: 0 7px; font-size: 10px; }
  .logo-text { font-size: 16px; }
  .logo-icon { width: 28px; height: 28px; font-size: 13px; }

  /* Mode tabs */
  .mode-tabs { padding: 4px; gap: 3px; }
  .mode-tab { font-size: 10px; padding: 7px 2px; gap: 2px; }

  /* Guess table — tighter columns */
  .table-header,
  .guess-row { grid-template-columns: 90px repeat(6, 1fr); }
  .guess-cell { font-size: 10px; padding: 6px 2px; min-height: 40px; }
  .player-name-cell .cell-main { font-size: 10px; }
  .cell-arrow { font-size: 9px; }

  /* Stats */
  .stat-chip-value { font-size: 16px; }
  .stat-chip-label { font-size: 8px; }

  /* League filter */
  .league-filter-panel.open { max-height: 320px; overflow-y: auto; }
  .lfp-chip { font-size: 10px; padding: 4px 7px; }

  /* Modal */
  .modal { padding: 22px 16px; width: calc(100vw - 32px); max-width: none; }
  .modal-title { font-size: 18px; }

  /* Search */
  #search-input { font-size: 14px; }
}

/* ─── Tournament ─── */
#tournament-container { padding: 0 0 40px 0; }

.trn-builder { max-width: 640px; margin: 0 auto; }
.trn-builder-header { text-align: center; padding: 24px 0 16px; }
.trn-title { font-size: 20px; font-weight: 800; color: var(--accent); margin: 0 0 6px; letter-spacing: -0.3px; }
.trn-subtitle { font-size: 12.5px; color: var(--text-muted); margin: 0; }
.trn-roles-list { display: flex; flex-direction: column; gap: 8px; padding: 0 16px; }
.trn-role-row {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface); border-radius: var(--radius);
  padding: 10px 14px; border: 1px solid var(--border);
  min-height: 58px; position: relative;
}
.trn-role-label { width: 86px; flex-shrink: 0; font-size: 12.5px; font-weight: 600; color: var(--text-muted); }
.trn-search-wrap { flex: 1; position: relative; }
.trn-search-input {
  width: 100%; background: var(--bg); border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); padding: 8px 12px; color: var(--text);
  font-size: 13.5px; font-family: inherit; outline: none;
}
.trn-search-input:focus { border-color: var(--accent); }
.trn-dropdown {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0;
  background: var(--surface2); border: 1px solid var(--accent);
  border-radius: var(--radius-sm); z-index: 100; overflow: hidden;
  box-shadow: var(--shadow);
}
.trn-dropdown-item { display: flex; align-items: center; gap: 10px; padding: 8px 12px; cursor: pointer; transition: background var(--transition); }
.trn-dropdown-item:hover { background: rgba(200,169,110,0.07); }
.trn-picked-player { display: flex; align-items: center; gap: 10px; flex: 1; }
.trn-remove-btn { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 15px; padding: 4px 8px; margin-left: auto; transition: color var(--transition); }
.trn-remove-btn:hover { color: var(--red); }
.trn-player-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: #fff; flex-shrink: 0;
}
.trn-player-avatar.sm { width: 28px; height: 28px; font-size: 10px; }
.trn-player-name { font-size: 13.5px; font-weight: 700; color: var(--text); }
.trn-player-meta { font-size: 11px; color: var(--text-muted); }
.trn-player-info { flex: 1; }
.trn-start-btn {
  display: block; width: calc(100% - 32px); margin: 18px 16px 0;
  padding: 13px; background: linear-gradient(135deg, var(--accent), var(--accent-dim));
  border: none; border-radius: var(--radius); color: #06060e; font-size: 15px;
  font-weight: 800; font-family: inherit; cursor: pointer; transition: all var(--transition);
}
.trn-start-btn:hover:not(.disabled) { filter: brightness(1.08); transform: translateY(-1px); }
.trn-start-btn.disabled { opacity: 0.3; cursor: not-allowed; }

.trn-bracket { max-width: 640px; margin: 0 auto; padding: 0 16px 40px; }
.trn-bracket-header { text-align: center; padding: 18px 0 14px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.trn-round-badge { background: rgba(106,63,200,0.3); color: #c8a0f8; font-size: 10.5px; font-weight: 700; padding: 3px 10px; border-radius: 20px; letter-spacing: 1px; border: 1px solid rgba(106,63,200,0.4); }
.trn-match-counter { font-size: 11.5px; color: var(--text-muted); }
.trn-matchup { display: flex; gap: 10px; align-items: stretch; margin: 0 0 14px; flex-wrap: wrap; }
.trn-vs { display: flex; align-items: center; justify-content: center; font-size: 16px; font-weight: 900; color: var(--accent); flex-shrink: 0; min-width: 30px; }
.trn-team-card { flex: 1; min-width: 200px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; transition: border-color var(--transition); }
.trn-team-card.user-team { border-color: rgba(106,63,200,0.4); background: rgba(106,63,200,0.08); }
.trn-team-card.winner { border-color: var(--green-border); background: var(--green-bg); }
.trn-team-card.loser  { border-color: var(--red-border); background: var(--red-bg); opacity: 0.7; }
.trn-team-header { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.trn-team-flag { font-size: 18px; }
.trn-team-name { font-size: 14px; font-weight: 700; color: var(--text); flex: 1; }
.trn-you-badge { background: rgba(106,63,200,0.3); color: #c8a0f8; font-size: 9.5px; font-weight: 700; padding: 2px 7px; border-radius: 10px; border: 1px solid rgba(106,63,200,0.35); }
.trn-team-roster { display: flex; flex-direction: column; gap: 4px; }
.trn-roster-row { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-muted); padding: 2px 0; }
.trn-roster-row.won  { color: var(--green); }
.trn-roster-row.lost { color: var(--red); text-decoration: line-through; opacity: 0.7; }
.trn-roster-icon { font-size: 12px; width: 16px; text-align: center; }
.trn-roster-name { flex: 1; }
.trn-score { margin-top: 10px; font-size: 20px; font-weight: 800; color: var(--accent); text-align: center; }
.trn-play-btn { display: block; width: 100%; margin: 4px 0 14px; padding: 12px; background: rgba(106,63,200,0.5); border: 1px solid rgba(106,63,200,0.6); border-radius: var(--radius); color: #fff; font-size: 14px; font-weight: 700; font-family: inherit; cursor: pointer; transition: all var(--transition); }
.trn-play-btn:hover { background: rgba(106,63,200,0.7); }
.trn-result-panel { border-radius: var(--radius); padding: 14px; margin: 0 0 14px; text-align: center; border: 1px solid; }
.trn-result-panel.user-win  { background: var(--green-bg);  border-color: var(--green-border); }
.trn-result-panel.user-loss { background: var(--red-bg);    border-color: var(--red-border); }
.trn-result-icon { font-size: 30px; margin-bottom: 6px; }
.trn-result-text { font-size: 15px; color: var(--text); margin-bottom: 10px; }
.trn-games-summary { display: flex; flex-wrap: wrap; gap: 5px; justify-content: center; margin-bottom: 12px; }
.trn-game-chip { font-size: 11px; padding: 3px 10px; border-radius: 20px; font-weight: 600; }
.trn-game-chip.win-a { background: var(--green-bg); color: var(--green); border: 1px solid var(--green-border); }
.trn-game-chip.win-b { background: var(--red-bg);   color: var(--red);   border: 1px solid var(--red-border); }
.trn-next-btn { padding: 10px 26px; background: var(--accent); border: none; border-radius: var(--radius-sm); color: #06060e; font-size: 13.5px; font-weight: 800; font-family: inherit; cursor: pointer; transition: all var(--transition); }
.trn-next-btn:hover { filter: brightness(1.1); }
.trn-progress { display: flex; align-items: center; justify-content: center; margin-top: 22px; }
.trn-progress-step { display: flex; flex-direction: column; align-items: center; font-size: 10.5px; color: var(--text-muted); padding: 5px 10px; border-radius: var(--radius-sm); transition: all var(--transition); }
.trn-progress-step.done   { color: var(--green); }
.trn-progress-step.active { color: var(--accent); font-weight: 700; background: rgba(200,169,110,0.08); }
.trn-progress-line { width: 28px; height: 2px; background: var(--surface3); }
.trn-done { max-width: 640px; margin: 0 auto; padding: 0 16px 40px; text-align: center; }
.trn-done-icon { font-size: 60px; margin: 26px 0 10px; }
.trn-done-title { font-size: 24px; font-weight: 900; color: var(--accent); margin: 0 0 6px; letter-spacing: -0.3px; }
.trn-done-sub { font-size: 14px; color: var(--text-muted); margin: 0 0 22px; }
.trn-summary { text-align: left; background: var(--surface); border-radius: var(--radius); padding: 14px; margin-bottom: 18px; border: 1px solid var(--border); }
.trn-summary-round { margin-bottom: 12px; }
.trn-summary-round strong { font-size: 10.5px; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); display: block; margin-bottom: 6px; }
.trn-summary-match { display: flex; align-items: center; gap: 8px; font-size: 12.5px; padding: 5px 0; border-bottom: 1px solid var(--border); }
.trn-summary-match:last-child { border-bottom: none; }
.trn-summary-score { font-weight: 700; color: var(--accent); margin: 0 5px; }
.loser-name { color: var(--text-muted); text-decoration: line-through; }
.user-highlight { color: #c8a0f8; font-weight: 700; }
.trn-reset-btn { padding: 12px 34px; background: rgba(106,63,200,0.3); border: 1px solid rgba(106,63,200,0.4); border-radius: var(--radius); color: #c8a0f8; font-size: 14px; font-weight: 700; font-family: inherit; cursor: pointer; transition: all var(--transition); }
.trn-reset-btn:hover { background: rgba(106,63,200,0.5); }

.trn-spin-screen, .trn-pick-screen { max-width: 700px; margin: 0 auto; padding: 0 16px 40px; }
.trn-top-bar { text-align: center; padding: 16px 0 8px; }
.trn-round-label { font-size: 10px; font-weight: 700; letter-spacing: 2.5px; color: rgba(168,120,255,0.7); margin-bottom: 6px; text-transform: uppercase; }
.trn-question { font-size: 22px; font-weight: 900; color: var(--accent); letter-spacing: 1px; margin-bottom: 0; }

.trn-mini-roster { display: flex; gap: 6px; justify-content: center; margin: 14px 0 18px; flex-wrap: nowrap; }
.trn-slot { flex: 1; min-width: 0; max-width: 130px; min-height: 72px; border-radius: var(--radius); border: 1px dashed rgba(255,255,255,0.1); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 8px 6px; text-align: center; }
.trn-slot.empty { background: var(--surface); color: var(--text-muted); }
.trn-slot-num { font-size: 20px; font-weight: 700; color: var(--surface3); }
.trn-slot.filled { background: var(--surface2); border-color: rgba(112,64,208,0.4); border-style: solid; }
.trn-slot-avatar { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; color: #fff; margin-bottom: 4px; }
.trn-slot-name { font-size: 10.5px; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; width: 100%; }
.trn-slot-team { font-size: 9px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; width: 100%; }

.trn-spin-area { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 8px 0; }
.trn-spin-btn { padding: 18px 64px; background: transparent; border: 1px solid var(--accent); border-radius: var(--radius-sm); color: var(--accent); font-size: 18px; font-weight: 900; font-family: inherit; letter-spacing: 3px; cursor: pointer; transition: all var(--transition); }
.trn-spin-btn:hover { background: rgba(200,169,110,0.1); box-shadow: 0 0 24px rgba(200,169,110,0.15); }

.trn-team-options { display: flex; gap: 10px; width: 100%; flex-wrap: nowrap; }
.trn-team-option { flex: 1; min-width: 0; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius); padding: 12px; cursor: pointer; transition: all var(--transition); }
.trn-team-option:hover { border-color: var(--accent); background: rgba(200,169,110,0.06); }
.trn-team-opt-header { display: flex; align-items: center; gap: 7px; margin-bottom: 8px; border-bottom: 1px solid var(--border); padding-bottom: 7px; }
.trn-team-opt-flag { font-size: 18px; flex-shrink: 0; }
.trn-team-opt-name { font-size: 12.5px; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trn-team-opt-year { font-size: 10.5px; color: var(--accent); font-weight: 600; }
.trn-team-opt-roster { display: flex; flex-direction: column; gap: 3px; }
.trn-team-player { display: flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--text-muted); }

.trn-reroll-btn { padding: 7px 18px; background: transparent; border: 1px solid var(--border-strong); border-radius: 20px; color: var(--text-muted); font-size: 12.5px; font-family: inherit; cursor: pointer; transition: all var(--transition); }
.trn-reroll-btn:hover { border-color: var(--accent); color: var(--accent); }
.trn-reroll-count { font-size: 10.5px; opacity: 0.7; margin-left: 3px; }

.trn-team-title { display: flex; align-items: center; gap: 9px; font-size: 18px; font-weight: 800; color: var(--text); margin: 0 0 14px; justify-content: center; }
.trn-player-cards { display: flex; flex-direction: column; gap: 7px; }
.trn-player-pick-card { display: flex; align-items: center; gap: 13px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 11px 14px; cursor: pointer; transition: all var(--transition); }
.trn-player-pick-card:hover:not(.already-picked) { border-color: var(--accent); background: rgba(200,169,110,0.05); }
.trn-player-pick-card.already-picked { opacity: 0.35; cursor: not-allowed; }
.trn-pick-avatar { width: 42px; height: 42px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; color: #fff; flex-shrink: 0; }
.trn-pick-info { flex: 1; }
.trn-pick-name { font-size: 15px; font-weight: 700; color: var(--text); }
.trn-pick-role { font-size: 11.5px; color: var(--text-muted); margin-top: 1px; }
.trn-pick-meta { font-size: 10.5px; color: var(--text-muted); opacity: 0.6; margin-top: 1px; }
.trn-already { font-size: 10.5px; color: var(--text-muted); opacity: 0.5; font-style: italic; }

/* ─── Landing overlay ─── */
.landing-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 20px;
  overflow-y: auto;
  animation: fadeIn 0.3s ease;
  background:
    radial-gradient(ellipse 110% 55% at 50% -2%, rgba(200,169,110,0.13) 0%, transparent 55%),
    radial-gradient(ellipse 55% 90% at -8% 60%, rgba(88,55,220,0.08) 0%, transparent 50%),
    radial-gradient(ellipse 55% 90% at 108% 40%, rgba(0,180,240,0.07) 0%, transparent 50%),
    #060610;
}

/* hex mesh on landing too */
.landing-overlay::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(0deg,   rgba(200,169,110,0.045) 1px, transparent 1px),
    linear-gradient(60deg,  rgba(200,169,110,0.032) 1px, transparent 1px),
    linear-gradient(-60deg, rgba(200,169,110,0.032) 1px, transparent 1px);
  background-size: 32px 55px;
  pointer-events: none;
  z-index: 0;
}

.landing-lang {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 501;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  color: var(--text-muted);
  height: 36px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 800;
  font-family: inherit;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: border-color var(--transition), color var(--transition), background var(--transition);
}
.landing-lang:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(200,169,110,0.07);
}
.landing-lang:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.landing-inner {
  max-width: 580px;
  width: 100%;
  text-align: center;
  padding: 10px 0 40px;
  position: relative;
  z-index: 1;
}

/* ─── Arena SVG ─── */
.landing-arena {
  width: 100%;
  max-width: 560px;
  height: 160px;
  margin: 0 auto 8px;
  display: block;
  opacity: 0.9;
}

/* ─── Season badge ─── */
.landing-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 2.5px;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 16px;
  padding: 5px 14px;
  border: 1px solid rgba(200,169,110,0.25);
  border-radius: 20px;
  background: rgba(200,169,110,0.06);
}

.landing-badge::before, .landing-badge::after {
  content: '';
  width: 20px; height: 1px;
  background: rgba(200,169,110,0.35);
}

.landing-logo {
  display: flex;
  align-items: center;
  gap: 14px;
  justify-content: center;
  margin-bottom: 10px;
}

.landing-logo .logo-icon {
  width: 56px;
  height: 56px;
  font-size: 26px;
  border-radius: var(--radius);
  box-shadow: 0 0 24px rgba(200,169,110,0.3);
}

.landing-logo .logo-text {
  font-size: 40px;
  font-weight: 900;
  letter-spacing: -1px;
  text-shadow: 0 0 30px rgba(200,169,110,0.45);
}

.landing-tagline {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 28px;
  font-weight: 500;
  letter-spacing: 0.15px;
}

.landing-modes {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 24px;
}

.landing-mode-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
  text-align: left;
}

.landing-mode-card:hover {
  border-color: var(--border-strong);
  background: var(--surface2);
}

.lmc-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.lmc-icon {
  font-size: 18px;
  line-height: 1;
  flex-shrink: 0;
}

.lmc-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.lmc-desc {
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.45;
}

.landing-play-btn {
  padding: 15px 64px;
  background: linear-gradient(135deg, var(--accent), var(--accent-dim));
  border: none;
  border-radius: var(--radius-lg);
  color: #06060e;
  font-size: 13.5px;
  font-weight: 900;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition);
  margin-bottom: 20px;
  letter-spacing: 2.5px;
  box-shadow: 0 4px 20px rgba(200,169,110,0.25);
}

.landing-play-btn:hover {
  filter: brightness(1.1);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(200,169,110,0.4);
}
.landing-play-btn:focus-visible { outline: 2px solid var(--accent2); outline-offset: 3px; }
.landing-mode-card:focus-visible { outline: 2px solid var(--border-strong); outline-offset: 2px; }

.landing-socials {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 16px;
}

.landing-social-link {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
  transition: border-color var(--transition), color var(--transition), background var(--transition);
}
.landing-social-link:hover {
  border-color: var(--accent-dim);
  color: var(--accent2);
  background: rgba(200,169,110,0.06);
}

.landing-bottom-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 8px;
}

.landing-bottom-link {
  font-size: 11px;
  color: var(--text-muted);
  opacity: 0.5;
  text-decoration: none;
  transition: opacity var(--transition);
}
.landing-bottom-link:hover { opacity: 1; }

.landing-footer {
  font-size: 11px;
  color: var(--text-muted);
  opacity: 0.5;
  letter-spacing: 0.3px;
}

@media (max-width: 500px) {
  .landing-modes { gap: 8px; }
  .landing-mode-card { padding: 12px 14px; }
  .lmc-icon { font-size: 16px; }
  .lmc-name { font-size: 13px; }
  .lmc-desc { font-size: 10.5px; }
  .landing-logo .logo-text { font-size: 30px; }
  .landing-logo .logo-icon { width: 44px; height: 44px; font-size: 20px; }
  .landing-play-btn { padding: 13px 44px; }
  .landing-arena { height: 110px; }
}

/* ─── Global stats (modal) ─── */
.global-stats {
  background: var(--surface3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 12px;
}
.global-stats-title {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 8px;
}
.global-stats-row {
  display: flex;
  justify-content: space-around;
}
.global-stat {
  text-align: center;
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
}
.global-stat small {
  display: block;
  font-size: 9px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 2px;
}

/* ─── Cookie banner ─── */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 600;
  background: var(--surface2);
  border-top: 1px solid var(--border-strong);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  box-shadow: 0 -4px 24px rgba(0,0,0,0.5);
}

.cookie-text {
  font-size: 13px;
  color: var(--text-muted);
  max-width: 500px;
}

.cookie-link {
  color: var(--accent);
  text-decoration: underline;
  margin-left: 6px;
  font-size: 12px;
}

.cookie-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.cookie-btn {
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
}

.cookie-accept {
  background: var(--accent);
  border: 1px solid var(--accent);
  color: #06060e;
}
.cookie-accept:hover { filter: brightness(1.1); }

.cookie-reject {
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--text-muted);
}
.cookie-reject:hover { border-color: var(--text-muted); color: var(--text); }

/* ─── Reduced motion ─── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
