/* ---------- TEMEL AYARLAR ---------- */
:root {
  --bg-color: #0b0c0e;
  --card-bg: #17181b;
  --card-border: #2b2c30;
  --text-primary: #f5f3ee;
  --text-secondary: #8f9096;
  --accent: #ff5a1f;
  --accent-hover: #ff7a45;
  --success: #3fb950;
  --error: #f85149;
  --radius: 10px;
  --font-display: 'Bebas Neue', 'Arial Narrow', sans-serif;
  --font-body: 'Manrope', -apple-system, sans-serif;
}

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

html {
  scroll-behavior: smooth;
  -webkit-tap-highlight-color: transparent;
}

::selection {
  background: rgba(240, 128, 48, 0.35);
  color: #fff;
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--card-border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------- LUCIDE ICONS ---------- */
[data-lucide] {
  width: 1em;
  height: 1em;
  stroke-width: 2.25;
  vertical-align: -0.15em;
  flex-shrink: 0;
}

.btn-icon {
  margin-right: 2px;
}

body {
  background-color: var(--bg-color);
  background-image:
    var(--bg-glow),
    linear-gradient(180deg, rgba(10,12,16,0.55) 0%, rgba(10,12,16,0.85) 55%, var(--bg-color) 100%),
    url('/assets/arena-bg.webp');
  background-repeat: no-repeat, no-repeat, no-repeat;
  background-position: center top, center top, center top;
  background-size: cover, cover, cover;
  background-attachment: scroll, scroll, scroll;
  color: var(--text-primary);
  font-family: var(--font-body);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  padding-top: calc(56px + 20px);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overscroll-behavior: none;
}

.app {
  width: 100%;
  max-width: 480px;
}

/* ---------- EKRAN YÖNETİMİ ---------- */
.screen {
  display: none;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 20px;
}

.screen.active {
  display: flex;
}

/* ---------- BAŞLANGIÇ EKRANI ---------- */

.subtitle {
  color: var(--text-secondary);
  font-size: 1rem;
}

/* ---------- BUTONLAR ---------- */
.btn {
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
  position: relative;
  overflow: hidden;
}

.btn:active {
  transform: scale(0.97);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  pointer-events: none;
}

.btn:disabled:hover {
  box-shadow: none;
}

.btn-primary {
  background: var(--accent);
  color: #ffffff;
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
  box-shadow: 0 2px 8px rgba(240, 128, 48, 0.2);
}

.btn-secondary {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--card-border);
}

.btn-secondary:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--text-primary);
}

.btn-danger {
  background: transparent;
  color: var(--error);
  border: 1px solid var(--error);
}

.btn-danger:hover:not(:disabled) {
  background: var(--error);
  color: #ffffff;
}

.profile-section-danger {
  border-top: 1px solid var(--card-border);
  padding-top: 16px;
  margin-top: 8px;
}

.profile-danger-desc {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-bottom: 10px;
  line-height: 1.5;
}

/* ---------- MATCH HUD (SCORE / TIMER / OPPONENT) ---------- */
.match-hud {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  font-size: 0.7rem;
}

.match-hud-side {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.match-hud-you { align-items: flex-start; text-align: left; }
.match-hud-opponent { align-items: flex-end; text-align: right; }

.match-hud-tag {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.match-hud-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 130px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.score,
.timer {
  flex: 1;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 4px 10px;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
}

.score span,
.timer span {
  color: var(--text-primary);
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.15rem;
  letter-spacing: 0.02em;
  line-height: 1.1;
}

.timer {
  display: none;
}

#game-screen.mode-time-attack .timer {
  display: flex;
}

#game-screen.mode-online .timer {
  display: none;
}

#game-screen.mode-time-attack {
  position: relative;
}

#game-screen.mode-time-attack::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  z-index: 90;
  transition: opacity 0.2s ease;
  box-shadow:
    inset 0 0 0 2px rgba(224, 49, 49, 0.2),
    inset 0 0 70px rgba(224, 49, 49, 0.32);
}

#game-screen.mode-time-attack.time-warning::before {
  opacity: 1;
}

#game-screen.mode-time-attack.time-critical::before {
  opacity: 1;
  animation: time-critical-pulse 1s ease-in-out infinite;
}

@keyframes time-critical-pulse {
  0%, 100% {
    box-shadow:
      inset 0 0 0 2px rgba(224, 49, 49, 0.22),
      inset 0 0 60px rgba(224, 49, 49, 0.22);
  }
  50% {
    box-shadow:
      inset 0 0 0 3px rgba(224, 49, 49, 0.4),
      inset 0 0 80px rgba(224, 49, 49, 0.36);
  }
}

/* ---------- TAKIM KARTLARI ---------- */
.teams-container {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.team-card {
  flex: 1;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 20px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  position: relative;
  transition: box-shadow 0.3s ease;
}

.team-logo {
  width: 70px;
  height: 70px;
  object-fit: contain;
}

.team-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}

.vs-badge {
  font-weight: 800;
  color: var(--accent);
  font-size: 0.72rem;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.skip-team-btn {
  font-size: 0.8rem;
  padding: 7px 16px;
  width: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.skip-combo-wrapper {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

#game-screen.mode-time-attack .skip-combo-wrapper {
  display: flex;
}

.skip-combo-track {
  width: 110px;
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
}

.skip-combo-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: 999px;
  transition: width 0.3s ease;
}

.skip-combo-fill.combo-reward {
  transition: width 0.35s ease, box-shadow 0.35s ease;
  box-shadow: 0 0 10px 2px rgba(255, 90, 31, 0.55);
}

@media (prefers-reduced-motion: reduce) {
  .skip-combo-fill {
    transition: none;
  }
  .skip-combo-fill.combo-reward {
    transition: none;
    box-shadow: none;
  }
}

.opponent-name-label {
  min-height: 22px;
  width: 100%;
  display: flex;
  flex-direction: row-reverse;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 0.86rem;
  font-weight: 600;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 4px 10px 4px 4px;
  min-width: 0;
}

.match-hud-you .score {
  justify-content: flex-start;
}

.opponent-inline-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--card-border);
  background: rgba(255, 122, 0, 0.14);
  color: var(--accent);
  font-size: 0.67rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
}

.opponent-inline-avatar.has-photo {
  border-color: rgba(255, 255, 255, 0.28);
}

.opponent-inline-text {
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.you-name-label {
  flex-direction: row;
}

.opponent-inline-avatar svg {
  width: 14px;
  height: 14px;
}

/* ---------- INPUT & AUTOCOMPLETE ---------- */
.input-area {
  width: 100%;
  position: relative;
}

.player-input {
  width: 100%;
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--card-border);
  background: var(--card-bg);
  color: var(--text-primary);
  font-size: 1rem;
  outline: none;
  transition: border-color 0.15s ease;
}

.player-input:focus {
  border-color: var(--accent);
}

.suggestions-list {
  list-style: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  overflow: hidden;
  max-height: 220px;
  overflow-y: auto;
  z-index: 10;
  display: none;
}

.suggestions-list.active {
  display: block;
}

.suggestions-list li {
  padding: 12px 16px;
  cursor: pointer;
  text-align: left;
  font-size: 0.95rem;
  border-bottom: 1px solid var(--card-border);
  transition: background 0.1s ease;
}

.suggestions-list li:last-child {
  border-bottom: none;
}

.suggestions-list li:hover {
  background: rgba(232, 89, 12, 0.15);
  color: var(--accent-hover);
}

/* ---------- GERİ BİLDİRİM MESAJI ---------- */
.feedback-message {
  min-height: 24px;
  font-weight: 600;
  font-size: 0.95rem;
}

.feedback-message.correct {
  color: var(--success);
}

.feedback-message.wrong {
  color: var(--error);
}


/* ---------- OYUN SONU ---------- */
.final-score {
  color: var(--text-secondary);
  font-size: 1.1rem;
}

.final-score span {
  color: var(--accent);
  font-weight: 800;
}

#gameover-screen .btn {
  width: 100%;
  max-width: 320px;
}

/* ---------- KÜÇÜK EKRAN UYUMU ---------- */
@media (max-width: 400px) {
  .team-logo {
    width: 55px;
    height: 55px;
  }
}

/* ---------- ÜST NAVİGASYON BARI ---------- */
.top-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  min-height: 56px;
  background: rgba(15, 17, 21, 0.35);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 100;
  gap: 8px;
}

.top-nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.top-nav-link {
  background: none;
  border: 1px solid transparent;
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
  white-space: nowrap;
}

.top-nav-link:hover {
  color: var(--text-primary);
  border-color: var(--card-border);
  background: rgba(255,255,255,0.04);
}

.top-nav-link-active {
  color: var(--accent) !important;
  border-color: transparent;
  background: transparent;
  box-shadow: inset 0 -2px 0 var(--accent);
}

@media (max-width: 800px) {
  .top-nav-links { display: none; }
  .top-nav { height: 48px; min-height: 48px; }
  body { padding-top: 68px; }
}

.top-nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.account-nav {
  position: relative;
}

.account-pill-btn {
  border: 1px solid var(--card-border);
  background: rgba(20, 27, 46, 0.85);
  border-radius: 999px;
  width: 40px;
  height: 40px;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.account-pill-btn:hover {
  border-color: var(--accent);
}

.hamburger-line {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
}

.account-dropdown {
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  width: min(380px, 94vw);
  background: linear-gradient(180deg, #061127 0%, #020c1d 100%);
  border-left: 1px solid var(--card-border);
  padding: 16px 0 20px;
  z-index: 220;
  box-shadow: -14px 0 30px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  gap: 0;
  transform: translateX(100%);
  transition: transform 0.25s ease;
  overflow-y: auto;
}

.account-dropdown.active {
  transform: translateX(0);
}

.account-panel-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(4, 5, 8, 0.55);
  z-index: 210;
}

.account-panel-backdrop.active {
  display: block;
}

.account-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 16px 16px;
  border-bottom: 1px solid var(--card-border);
}

.account-panel-title {
  font-weight: 800;
  font-size: 1.2rem;
}

.account-panel-close-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--accent);
  background: transparent;
  color: var(--text-primary);
  font-size: 1rem;
  cursor: pointer;
}

.account-panel-btn {
  width: calc(100% - 32px);
  margin: 0 16px;
  border-radius: 999px;
  font-weight: 800;
  letter-spacing: 0.8px;
}

.account-row {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  margin: 16px;
  padding: 14px;
  border: 1px solid var(--card-border);
  border-radius: 14px;
  background: rgba(12, 28, 56, 0.55);
}

.account-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--accent);
  background: rgba(255, 122, 0, 0.12);
  background-size: cover;
  background-position: center;
  color: var(--accent);
  font-weight: 800;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.account-avatar.has-photo {
  border-color: rgba(255, 255, 255, 0.25);
}

.account-row-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

#account-display-name {
  color: var(--text-primary);
  font-size: 0.98rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-label {
  color: var(--text-secondary);
  font-size: 0.76rem;
}

.account-panel-links {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 4px 16px 12px;
  flex: 1;
}

.account-link-btn {
  text-align: left;
  color: var(--text-primary);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 11px 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}

.account-link-btn:hover {
  border-color: var(--card-border);
  background: rgba(255, 255, 255, 0.03);
}


.account-signout-btn {
  margin-top: auto;
  margin-bottom: 10px;
}

.account-signin-btn {
  margin-top: auto;
  margin-bottom: 10px;
}

.account-get-app-btn {
  display: none;
  width: calc(100% - 32px);
  margin: 0 16px 12px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: transparent;
  color: var(--text-primary);
  padding: 11px 14px;
  font-weight: 800;
  font-size: 1.05rem;
  cursor: pointer;
}

.account-social-row {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
}

.account-social-btn {
  border: 1px solid var(--card-border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  border-radius: 10px;
  padding: 6px 8px;
  font-size: 0.72rem;
  font-weight: 700;
  min-width: 34px;
}

.nav-logo {
  font-weight: 800;
  font-size: 1.15rem;
  cursor: pointer;
  user-select: none;
  transition: opacity 0.15s ease;
  display: flex;
  align-items: center;
  min-width: 0;
  max-height: 40px;
}

.nav-logo:hover {
  opacity: 0.8;
}

.nav-logo-img {
  display: block;
  width: auto;
  height: clamp(32px, 5vw, 40px);
  max-height: 40px;
  object-fit: contain;
  object-position: left center;
}

.nav-logo-fallback {
  color: var(--accent);
  display: none;
}

/* ==========================================
   REDESIGN — Tarzı Yeni Bileşenler
   ========================================== */
:root {
  --bg-glow:
    radial-gradient(circle at 50% -10%, rgba(255, 90, 31, 0.10), transparent 55%);
  --card-bg-hover: #1e1f23;
  --card-border-hover: var(--accent);
  --accent-glow: rgba(255, 90, 31, 0.45);
}

/* Geniş ekran modu (ana menü / lobi hub) */
.app:has(.screen-wide.active) {
  max-width: 1100px;
}

/* ---------- HERO ---------- */
.hero {
  text-align: center;
  max-width: 700px;
  margin: 0 auto;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 6vw, 3.1rem);
  font-weight: 400;
  letter-spacing: 0.01em;
  line-height: 1.05;
  text-transform: uppercase;
  text-wrap: balance;
}

.hero-title span {
  color: var(--accent);
  background: linear-gradient(180deg, transparent 62%, rgba(255, 90, 31, 0.28) 62%);
  padding: 0 2px;
}

.hero-subtitle {
  color: var(--text-secondary);
  margin-top: 10px;
  font-size: 0.95rem;
  font-family: var(--font-body);
}

/* ---------- MOD KARTLARI ---------- */
.mode-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 240px));
  justify-content: center;
  gap: 20px;
  width: 100%;
  margin-top: 24px;
}

.mode-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-top: 3px solid var(--card-border);
  border-radius: var(--radius);
  padding: 28px 18px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  min-height: 260px;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.mode-card:hover {
  transform: translateY(-4px);
  border-top-color: var(--accent);
  border-color: var(--card-border-hover);
  box-shadow: 0 10px 26px rgba(0,0,0,0.5);
}

.mode-card-featured {
  border-top-color: var(--accent);
}


.mode-icon {
  font-size: 2.2rem;
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-color);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  margin-bottom: 4px;
}

.mode-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.mode-desc {
  color: var(--text-primary);
  font-size: 0.76rem;
  flex-grow: 1;
}

.btn-pill {
  border-radius: 100px;
  margin-top: 4px;
  width: 100%;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.btn-pill:hover {
  box-shadow: none;
}

/* ---------- LOBİ HUB (TAB YAPISI) ---------- */
.lobby-tabs {
  display: flex;
  gap: 24px;
  border-bottom: 1px solid var(--card-border);
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
}

.lobby-tab {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1rem;
  font-weight: 700;
  padding: 12px 4px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.lobby-tab.active {
  color: var(--text-primary);
  border-bottom-color: var(--accent);
}

.lobby-panel {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: 100%;
  max-width: 480px;
  margin: 20px auto 0;
}

.lobby-panel.active {
  display: flex;
}

.panel-subheading {
  color: var(--text-secondary);
  font-size: 0.95rem;
  align-self: flex-start;
  margin-top: 10px;
}

.rooms-list {
  list-style: none;
  width: 100%;
  max-height: 240px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rooms-list li {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 12px 16px;
  text-align: left;
  cursor: pointer;
  font-size: 0.9rem;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.rooms-list li:hover {
  border-color: var(--accent);
  background: var(--card-bg-hover);
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  width: 100%;
}

@media (max-width: 800px) {
  .hero { margin-bottom: 4px; }
  .hero-title { font-size: 1.3rem; }
  .hero-subtitle { font-size: 0.78rem; margin-top: 4px; }

  .mode-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-top: 14px;
  }

  .mode-card {
    padding: 14px 6px 12px;
    min-height: auto;
    gap: 6px;
  }

  .mode-icon {
    font-size: 1.5rem;
    width: 44px;
    height: 44px;
  }

  .mode-title {
    font-size: 0.7rem;
    line-height: 1.15;
  }

  .mode-desc {
    display: none;
  }

  .btn-pill {
    font-size: 0.65rem;
    padding: 8px 4px;
  }
}

/* ---------- TOAST BILDIRIMI ---------- */
.toast {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%) translateY(-120px);
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 12px 24px;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-primary);
  z-index: 300;
  pointer-events: none;
  transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1);
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  max-width: 90vw;
  text-align: center;
}

.toast.active {
  transform: translateX(-50%) translateY(0);
}

.toast.toast-error {
  border-color: var(--error);
  color: #ffb4b4;
}

.toast.toast-success {
  border-color: var(--success);
  color: #a3e2b0;
}

/* ---------- CONFIRM DIALOG ---------- */
#confirm-dialog {
  z-index: 240; 
}
.modal-card.confirm-dialog-card {
  max-width: 360px;
  padding: 28px 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  text-align: center;
}

.confirm-dialog-title {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.4;
}

.confirm-dialog-actions {
  display: flex;
  gap: 10px;
}

.confirm-dialog-actions .btn {
  flex: 1;
}

/* ---------- CONNECTION INDICATOR ---------- */
.connection-indicator {
  position: fixed;
  top: 100px;
  left: 50%;
  transform: translateX(-50%) translateY(-100px);
  background: var(--error);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 6px 16px;
  border-radius: 100px;
  z-index: 250;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
  white-space: nowrap;
}

.connection-indicator.active {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.connection-indicator.reconnecting {
  background: var(--accent);
}

/* ---------- MATCHMAKING OVERLAY ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
}

.modal-overlay.active {
  display: flex;
}

.modal-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 36px 48px;
  text-align: center;
}

.auth-modal-card {
  width: min(400px, calc(100vw - 28px));
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-align: left;
  border-radius: 16px;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-secondary);
  font-size: 0.78rem;
  margin: 2px 0;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--card-border);
}

.google-signin-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: #ffffff;
  color: #1f1f1f;
  border: 1px solid #dadce0;
  border-radius: var(--radius);
  padding: 10px 20px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: box-shadow 0.15s ease, background 0.15s ease;
}

.google-signin-btn:hover {
  background: #f7f7f7;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
}

.google-signin-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.auth-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.auth-close-btn {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 1.05rem;
  cursor: pointer;
}

.auth-tabs {
  display: flex;
  gap: 8px;
}

.auth-tab {
  flex: 1;
  border: 1px solid var(--card-border);
  background: transparent;
  color: var(--text-secondary);
  border-radius: 10px;
  padding: 8px 10px;
  font-weight: 700;
  cursor: pointer;
}

.auth-tab.active {
  border-color: var(--accent);
  color: var(--text-primary);
  background: rgba(255, 122, 0, 0.12);
}

.auth-form {
  display: none;
  flex-direction: column;
  gap: 10px;
}

.auth-form.active {
  display: flex;
}

.profile-modal-card {
  width: min(440px, calc(100vw - 28px));
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-align: left;
  border-radius: 16px;
}

.profile-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--card-border);
  border-radius: 14px;
  background: rgba(12, 28, 56, 0.4);
}

.profile-section-title {
  font-weight: 800;
  font-size: 0.85rem;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--accent);
}

.profile-avatar-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.profile-avatar-preview {
  width: 56px;
  height: 56px;
  font-size: 1.1rem;
}

.profile-avatar-presets {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.profile-avatar-option {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--card-border);
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.profile-avatar-option:hover {
  border-color: var(--accent);
  background: rgba(255, 122, 0, 0.12);
}

.profile-connection-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--accent);
  background: rgba(255, 122, 0, 0.1);
  color: var(--text-primary);
  font-size: 0.9rem;
  font-weight: 600;
}

.profile-connection-badge--muted {
  border-color: var(--card-border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-secondary);
}

.profile-forgot-link {
  align-self: flex-start;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.82rem;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
}

.profile-forgot-link:hover {
  color: var(--accent-hover);
}

.time-attack-gameover-overlay {
  background: rgba(4, 5, 8, 0.72);
  backdrop-filter: blur(10px);
}

.time-attack-gameover-card {
  width: min(460px, calc(100vw - 32px));
  padding: 36px 32px 32px;
  border-color: rgba(232, 89, 12, 0.42);
  background:
    radial-gradient(circle at 50% 0%, rgba(232, 89, 12, 0.22), transparent 58%),
    linear-gradient(160deg, rgba(26, 29, 36, 0.98), rgba(10, 12, 16, 0.98));
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.58), inset 0 0 0 1px rgba(255,255,255,0.04);
}

.time-attack-gameover-card h2 {
  font-size: 2.1rem;
  line-height: 1.15;
  margin-bottom: 16px;
}

.time-attack-gameover-kicker {
  color: var(--accent-hover);
  font-size: 0.8rem;
  font-weight: 850;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.time-attack-gameover-card .final-score {
  width: 100%;
  padding: 20px;
  margin: 10px 0 24px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
}

.time-attack-gameover-card .final-score span:last-child {
  display: block;
  margin-top: 4px;
  font-size: 2.7rem;
  line-height: 1;
  color: var(--text-primary);
}

.time-attack-gameover-card .btn {
  width: 100%;
  margin-top: 12px;
}

.modal-title {
  font-weight: 700;
  margin-top: 16px;
}

.modal-hint {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-top: 6px;
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--card-border);
  border-top-color: var(--accent);
  border-radius: 50%;
  margin: 0 auto;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ---------- TUTORIAL MODAL ---------- */
.tutorial-card {
  width: min(460px, calc(100vw - 32px));
  padding: 32px 28px 24px;
  text-align: left;
  position: relative;
  max-height: 85vh;
  overflow-y: auto;
}

.tutorial-close-btn {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--card-border);
  background: transparent;
  color: var(--text-secondary);
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tutorial-title {
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 20px;
  color: var(--text-primary);
}

.tutorial-steps {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 20px;
}

.tutorial-step {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.tutorial-step-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 122, 0, 0.14);
  border: 1px solid var(--accent);
  color: var(--accent);
  font-weight: 800;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}

.tutorial-step-content strong {
  display: block;
  color: var(--text-primary);
  font-size: 0.95rem;
  margin-bottom: 2px;
}

.tutorial-step-content p {
  color: var(--text-secondary);
  font-size: 0.85rem;
  line-height: 1.4;
}

.tutorial-card .btn-primary {
  width: 100%;
}

/* ---------- PAYLAŞIM KARTI ---------- */
/* ---------- PAYLAŞIM EKRANI ---------- */
.share-wrapper {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 360px;
  width: 100%;
  pointer-events: auto;
}

.share-card {
  background: linear-gradient(160deg, #161a22, #0a0c10);
  border: 1px solid rgba(232, 89, 12, 0.4);
  border-radius: var(--radius);
  padding: 28px 24px;
  text-align: center;
}

.share-card-logo {
  font-weight: 800;
  font-size: 0.8rem;
  color: var(--text-secondary);
  letter-spacing: 1px;
}

.share-card-champion {
  color: var(--accent);
  font-weight: 800;
  font-size: 0.85rem;
  letter-spacing: 2px;
  margin-top: 14px;
}

.share-card-score {
  font-size: 3.5rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.1;
  margin-top: 4px;
}

.share-card-label {
  color: var(--text-secondary);
  font-size: 0.75rem;
  letter-spacing: 1px;
  font-weight: 600;
  margin-top: 2px;
}

.share-card-taunt {
  margin-top: 14px;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--accent-hover);
}

.share-card-players {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin-top: 12px;
}

.share-player-badge {
  background: rgba(232, 89, 12, 0.15);
  border: 1px solid rgba(232, 89, 12, 0.4);
  border-radius: 20px;
  padding: 4px 10px;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
}

.share-actions-label {
  color: var(--text-secondary);
  font-size: 0.75rem;
  letter-spacing: 1.5px;
  font-weight: 700;
  margin-top: 10px;
}

.share-platform-row {
  display: flex;
  gap: 10px;
}

.share-platform-btn {
  flex: 1;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 12px 0;
  color: var(--text-primary);
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.share-platform-btn:hover {
  border-color: var(--accent);
  background: var(--card-bg-hover);
}

/* ---------- DİL DEĞİŞTİRİCİ ---------- */
.lang-switcher {
  position: relative;
  overflow: visible;
}

.lang-toggle-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--card-border);
  color: var(--text-primary);
  padding: 6px 12px;
  border-radius: 100px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.lang-toggle-btn:hover {
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.1);
}

.lang-dropdown {
  list-style: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  overflow: hidden;
  min-width: 140px;
  z-index: 150;
  display: none;
  box-shadow: 0 10px 30px rgba(0,0,0,0.35);
}

.lang-dropdown.active {
  display: block;
}

.lang-option {
  padding: 10px 16px;
  cursor: pointer;
  font-size: 0.9rem;
  text-align: left;
  transition: background 0.1s ease, color 0.1s ease;
}

.lang-option:hover {
  background: rgba(232, 89, 12, 0.15);
  color: var(--accent-hover);
}

@media (max-width: 420px) {
  .top-nav {
    height: 64px;
    padding: 0 12px;
  }

  .nav-logo-img {
    max-height: 48px;
  }

  body {
    padding-top: 64px;
  }

  .share-platform-row {
    flex-wrap: wrap;
  }
  .share-platform-btn {
    flex: 1 1 40%;
  }
}

@keyframes team-card-land {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(232, 89, 12, 0);
  }
  40% {
    transform: scale(1.02);
    box-shadow: 0 0 0 2px var(--accent), 0 0 8px 2px rgba(232, 89, 12, 0.2);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 1px var(--accent), 0 0 0 0 rgba(232, 89, 12, 0);
  }
}

.team-card-landed {
  animation: team-card-land 0.3s cubic-bezier(0.25, 1, 0.5, 1);
  border-color: var(--accent);
}


/* Gerçek rulet bobini: sabit yükseklikte pencere içinde şerit sürekli aşağıya kayar */
.team-reel-window {
  width: 100%;
  overflow: hidden;
  position: relative;
}

.team-reel-strip {
  display: flex;
  flex-direction: column;
  will-change: transform;
}

.team-reel-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.team-reel-strip-spinning {
  filter: blur(1.6px);
}

.vs-badge-pulsing {
  animation: vs-badge-pulse 0.55s ease-in-out infinite;
}

@keyframes vs-badge-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(1.08); }
}

.online-series-tracker {
  display: none;
  width: 100%;
  margin-top: 0;
  margin-bottom: 0;
  padding: 9px 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(232, 89, 12, 0.2), rgba(232, 89, 12, 0.04) 45%, rgba(20, 24, 32, 0.96) 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04), 0 8px 24px rgba(0, 0, 0, 0.3);
}

.online-series-tracker.active {
  display: block;
}

.series-finals-score {
  font-size: 1.2rem;
  font-weight: 900;
  color: var(--text-primary);
  line-height: 1;
}

.series-finals-dots {
  margin-top: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.series-group {
  display: inline-flex;
  gap: 5px;
}

.series-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: inline-block;
}

.series-dot-mine {
  background: linear-gradient(180deg, #ffae42, #ff7b1f);
  box-shadow: 0 0 10px rgba(232, 89, 12, 0.5);
}

.series-dot-opp {
  background: linear-gradient(180deg, #b8beca, #8e95a4);
}

.series-vs {
  color: #c2c8d4;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.9px;
  margin: 0 2px;
}

/* ---------- TAHMİN BUBBLE'LARI ---------- */
.guess-bubble-track {
  position: relative;
  width: 100%;
  height: 0;
  z-index: 30;
}

.guess-bubble {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 100px;
  padding: 8px 16px;
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
  color: var(--text-primary);
  box-shadow: 0 6px 18px rgba(0,0,0,0.35);
  animation: bubble-float 2.4s ease forwards;
  pointer-events: none;
  z-index: 20;
}

.guess-bubble-mine {
  border-color: var(--accent);
  color: var(--accent-hover);
}

.guess-bubble-warning {
  border-color: var(--error);
  color: var(--error);
}

@keyframes bubble-float {
  0% { opacity: 0; transform: translate(-50%, 10px) scale(0.9); }
  12% { opacity: 1; transform: translate(-50%, 0) scale(1); }
  75% { opacity: 1; transform: translate(-50%, -60px) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -90px) scale(0.95); }
}

/* ---------- ONLINE OYUN BİTİŞ EKRANI ---------- */
.online-final-series {
  font-size: 2.4rem;
  font-weight: 800;
  color: var(--accent);
}

.guess-history-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  width: 100%;
}

.guess-history-col {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 16px;
  text-align: left;
}

.guess-history-heading {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
  margin-bottom: 10px;
  text-transform: uppercase;
}

.guess-history-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.guess-history-list li {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 10px;
  background: rgba(255,255,255,0.03);
  border-radius: 8px;
}

.guess-history-player {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
}

.guess-history-teams {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.guess-history-empty {
  color: var(--text-secondary) !important;
  font-weight: 500 !important;
  font-style: italic;
}

#online-gameover-screen .btn {
  width: 100%;
  max-width: 320px;
}

@media (max-width: 480px) {
  .guess-history-columns {
    grid-template-columns: 1fr;
  }
}


/* ---------- LIDERLIK TABLOSU ---------- */
.leaderboard-header {
  width: 100%;
  text-align: center;
  margin-bottom: 8px;
}

.leaderboard-title {
  font-size: 1.3rem;
  font-weight: 800;
}

/* Pill segmented control -- matches the button-primary/pill tokens per DESIGN.md */
.leaderboard-timeframe-toggle {
  display: flex;
  gap: 2px;
  width: 100%;
  max-width: 280px;
  margin-bottom: 20px;
  padding: 3px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 100px;
}

.leaderboard-timeframe-btn {
  flex: 1;
  padding: 8px 14px;
  border: none;
  border-radius: 100px;
  background: transparent;
  color: var(--text-secondary);
  font-weight: 700;
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, transform 0.1s ease;
}

.leaderboard-timeframe-btn:hover:not(.active) {
  color: var(--text-primary);
}

.leaderboard-timeframe-btn.active {
  color: #ffffff;
  background: var(--accent);
  box-shadow: 0 2px 8px rgba(255, 90, 31, 0.35);
}

.leaderboard-timeframe-btn:active {
  transform: scale(0.97);
}

.leaderboard-grid {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  width: 100%;
  max-width: 1000px;
  align-items: stretch;
}

.leaderboard-panel {
  flex: 1 1 400px;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.leaderboard-panel-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 10px;
  text-align: center;
}

.leaderboard-panel-title [data-lucide] {
  color: var(--text-secondary);
  width: 0.9em;
  height: 0.9em;
}

/* The frame is the single elevated surface for this panel -- rows inside it
   stay flat to avoid nesting a card inside a card. */
.leaderboard-frame {
  flex: 1;
  width: 100%;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 10px;
}

.leaderboard-content {
  width: 100%;
}

@media (max-width: 720px) {
  .leaderboard-grid {
    flex-direction: column;
  }

  .leaderboard-panel {
    flex: 1 1 auto;
    width: 100%;
  }
}

/* ---------- Skeleton loading state ---------- */
.leaderboard-skeleton {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px 4px;
}

.leaderboard-skeleton-row {
  display: grid;
  grid-template-columns: 28px 28px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
}

.sk {
  display: block;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--card-border) 25%, rgba(255, 255, 255, 0.07) 37%, var(--card-border) 63%);
  background-size: 400% 100%;
  animation: sk-shimmer 1.4s ease-in-out infinite;
}

.sk-rank,
.sk-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
}

.sk-name {
  height: 12px;
  width: 60%;
}

.sk-score {
  height: 12px;
  width: 34px;
  justify-self: end;
}

@keyframes sk-shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: 0 0; }
}

@media (prefers-reduced-motion: reduce) {
  .sk {
    animation: none;
    opacity: 0.5;
  }
}

.leaderboard-loading,
.mystats-loading {
  color: var(--text-secondary);
  text-align: center;
  padding: 40px 0;
}

.leaderboard-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  width: 100%;
}

/* Flat row, not a card -- avoids stacking a card inside the .leaderboard-frame card. */
.leaderboard-item {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 10px;
  border-bottom: 1px solid var(--card-border);
  transition: background 0.15s ease;
  animation: lb-item-in 0.28s cubic-bezier(0.25, 1, 0.5, 1) backwards;
}

.leaderboard-list .leaderboard-item:last-child {
  border-bottom: none;
}

.leaderboard-item:hover {
  background: var(--card-bg-hover);
}

.leaderboard-item.is-you {
  background: rgba(255, 90, 31, 0.08);
  border-radius: 10px;
}

@keyframes lb-item-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

.leaderboard-item:nth-child(1) { animation-delay: 0.02s; }
.leaderboard-item:nth-child(2) { animation-delay: 0.05s; }
.leaderboard-item:nth-child(3) { animation-delay: 0.08s; }
.leaderboard-item:nth-child(4) { animation-delay: 0.11s; }
.leaderboard-item:nth-child(5) { animation-delay: 0.14s; }
.leaderboard-item:nth-child(6) { animation-delay: 0.17s; }
.leaderboard-item:nth-child(7) { animation-delay: 0.2s; }
.leaderboard-item:nth-child(8) { animation-delay: 0.23s; }
.leaderboard-item:nth-child(9) { animation-delay: 0.26s; }
.leaderboard-item:nth-child(10) { animation-delay: 0.29s; }

@media (prefers-reduced-motion: reduce) {
  .leaderboard-item {
    animation: none;
  }
}

/* Rank chip: only rank 1 gets the accent (the single saturated color).
   2nd/3rd read as "top tier" through brightness, not a second/third hue. */
.leaderboard-rank {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.leaderboard-rank.top-1 {
  color: #ffffff;
  background: var(--accent);
  box-shadow: 0 2px 8px rgba(255, 90, 31, 0.4);
}

.leaderboard-rank.top-2 {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.09);
}

.leaderboard-rank.top-3 {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.leaderboard-player {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.leaderboard-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 122, 0, 0.12);
  border: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  font-weight: 800;
  color: var(--accent);
  flex-shrink: 0;
  background-size: cover;
  background-position: center;
}

.leaderboard-avatar.has-photo {
  border-color: rgba(255, 255, 255, 0.2);
}

.leaderboard-username {
  font-weight: 600;
  font-size: 0.88rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leaderboard-score {
  font-weight: 800;
  color: var(--accent);
  font-size: 0.9rem;
}

.leaderboard-score-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.leaderboard-score-sub {
  font-weight: 600;
  font-size: 0.68rem;
  color: var(--text-secondary);
}

.leaderboard-empty {
  text-align: center;
  color: var(--text-secondary);
  padding: 30px 10px;
  font-size: 0.9rem;
}

.leaderboard-motivation {
  text-align: center;
  color: var(--accent);
  font-weight: 700;
  font-size: 0.92rem;
  padding: 14px 10px;
  margin-bottom: 10px;
}

/* ---------- ISTATISTIKLERIM ---------- */
.mystats-header {
  width: 100%;
  text-align: center;
  margin-bottom: 12px;
}

.mystats-title {
  font-size: 1.3rem;
  font-weight: 800;
}

.mystats-content {
  width: 100%;
  max-width: 480px;
}

.mystats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: 100%;
}

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

.mystats-card-value {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1.2;
}

.mystats-card-label {
  font-size: 0.72rem;
  color: var(--text-secondary);
  margin-top: 4px;
  font-weight: 600;
}

.mystats-empty {
  text-align: center;
  color: var(--text-secondary);
  padding: 30px 0;
  font-size: 0.9rem;
}

/* ---------- GUEST HISTORY WARNING ---------- */
.guest-history-warning {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: linear-gradient(135deg, rgba(255, 90, 31, 0.12), var(--bg-color));
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 16px;
}

.guest-history-warning i {
  color: var(--accent);
  flex-shrink: 0;
  margin-top: 2px;
  width: 20px;
  height: 20px;
}

.guest-history-warning p {
  color: var(--text-primary);
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.45;
}

/* ---------- GAME HISTORY LIST ---------- */
.history-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.history-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 12px 14px;
}

.history-row-mode {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text-primary);
  flex: 1;
}

.history-row-score {
  font-weight: 800;
  color: var(--accent);
  font-size: 0.95rem;
}

.history-result {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 3px 8px;
  border-radius: 6px;
}

.history-result.win {
  color: var(--success);
  background: rgba(63, 185, 80, 0.12);
}

.history-result.loss {
  color: var(--error);
  background: rgba(248, 81, 73, 0.12);
}

.history-row-date {
  font-size: 0.72rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

/* ---------- GOREVLER (CHALLENGES) ---------- */
.challenges-header {
  width: 100%;
  text-align: center;
  margin-bottom: 8px;
}

.challenges-title {
  font-size: 1.3rem;
  font-weight: 800;
}

.challenges-tabs {
  display: flex;
  gap: 8px;
  width: 100%;
  max-width: 400px;
  margin-bottom: 16px;
}

.challenges-tab {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--card-border);
  border-radius: 10px;
  background: transparent;
  color: var(--text-secondary);
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.challenges-tab.active {
  border-color: var(--accent);
  color: var(--text-primary);
  background: rgba(255, 122, 0, 0.12);
}

.challenge-content {
  width: 100%;
  max-width: 480px;
}

.challenge-loading {
  color: var(--text-secondary);
  text-align: center;
  padding: 40px 0;
}

.challenge-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}

.challenge-card-title {
  font-size: 1.1rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.challenge-card-desc {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-bottom: 12px;
}

.challenge-teams-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 16px;
}

.challenge-team-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 0.85rem;
  font-weight: 700;
}

.challenge-team-badge img {
  width: 50px;
  height: 50px;
}

.challenge-vs {
  color: var(--accent);
  font-weight: 800;
  font-size: 0.7rem;
  letter-spacing: 1px;
}

.challenge-countdown {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.82rem;
  margin-bottom: 12px;
}

.challenge-score-display {
  text-align: center;
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent);
  margin-bottom: 8px;
}

.challenge-submit-btn {
  width: 100%;
  margin-top: 8px;
}

.challenge-submitted-badge {
  text-align: center;
  color: var(--success);
  font-weight: 700;
  font-size: 0.9rem;
  padding: 8px;
  border: 1px solid var(--success);
  border-radius: 10px;
  margin-top: 8px;
}

.challenge-leaderboard-title {
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 10px;
  margin-top: 16px;
}

.crossover-test-launch-btn {
  margin-bottom: 16px;
}

/* ---------- CROSSOVER INTERSECTION CHALLENGE ---------- */
.crossover-back-btn {
  align-self: flex-start;
}

.crossover-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  width: 100%;
  max-width: 420px;
  padding: 24px 16px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
}

.crossover-team-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.crossover-team-logo {
  width: 64px;
  height: 64px;
  object-fit: contain;
}

.crossover-team-name {
  font-family: var(--font-display);
  font-size: 1.1rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--text-primary);
}

.crossover-vs {
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--accent);
  flex: 0 0 auto;
}

.crossover-guesses-section {
  width: 100%;
  max-width: 420px;
}

.crossover-guesses-title {
  text-align: left;
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--text-secondary);
}

.crossover-guesses-count {
  color: var(--accent);
}

.crossover-guesses-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 320px;
  overflow-y: auto;
  padding-right: 2px;
}

.crossover-guess-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-left: 3px solid var(--success);
  border-radius: var(--radius);
  text-align: left;
  animation: crossover-guess-in 0.25s ease;
}

.crossover-guess-avatar {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 90, 31, 0.15);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 800;
}

.crossover-guess-name {
  flex: 1;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-primary);
}

.crossover-guess-check {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  color: var(--success);
}

@keyframes crossover-guess-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.shake-error {
  animation: crossover-shake 0.35s ease;
  border-color: var(--error) !important;
}

@keyframes crossover-shake {
  10%, 90% { transform: translateX(-1px); }
  20%, 80% { transform: translateX(2px); }
  30%, 50%, 70% { transform: translateX(-4px); }
  40%, 60% { transform: translateX(4px); }
}

.crossover-submit-btn {
  margin-top: 8px;
}

.crossover-submit-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ---------- ALT MENÜ ---------- */
.bottom-nav {
  display: none; /* desktop: gizli */
}

@media (max-width: 800px) {
  .bottom-nav {
    display: flex;
    align-items: center;
    justify-content: space-around;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: 64px;
    padding-bottom: env(safe-area-inset-bottom);
    background: rgba(15, 17, 21, 0.85);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    z-index: 150;
    gap: 0;
  }

  body {
    padding-bottom: calc(78px + env(safe-area-inset-bottom));
  }

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 0.6rem;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.15s ease;
  position: relative;
  z-index: 1;
}

.bottom-nav-item .bn-icon {
  font-size: 1.15rem;
  transition: transform 0.15s ease;
}

.bottom-nav-item.active {
  color: var(--accent);
}

.bottom-nav-item:active .bn-icon {
  transform: scale(0.85);
}

.bottom-nav-play {
  background: var(--accent);
  color: #fff;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  transform: translateY(-14px);
  box-shadow: 0 4px 10px rgba(255, 122, 0, 0.25), 0 0 0 4px var(--bg-color);
  z-index: 2;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.bottom-nav-play:hover {
  box-shadow: 0 6px 24px rgba(255, 122, 0, 0.6), 0 0 0 4px var(--bg-color);
}

.bottom-nav-play:active {
  transform: translateY(-10px) scale(0.95);
}

.lobby-owner-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
}

/* ---------- ADMIN ANALYTICS DASHBOARD ---------- */
.account-admin-link-btn {
  color: var(--accent);
}

.account-admin-link-btn:hover {
  border-color: var(--accent);
  background: rgba(255, 90, 31, 0.08);
}

#admin-dashboard-screen.admin-dashboard-screen {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: none;
  justify-content: flex-start;
  align-items: flex-start;
  background: var(--bg-color);
  overflow-y: auto;
  width: 100%;
  max-width: none;
  padding: calc(56px + 20px) 20px 40px;
  gap: 0;
}

#admin-dashboard-screen.admin-dashboard-screen.active {
  display: flex;
}

.admin-dashboard-inner {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  text-align: left;
  gap: 24px;
}

.admin-dashboard-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.admin-date-label {
  font-size: 0.82rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.admin-date-picker {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  color: var(--text-primary);
  padding: 8px 12px;
  font-family: var(--font-body);
  font-size: 0.85rem;
  color-scheme: dark;
}

.admin-date-picker:focus {
  outline: 2px solid var(--accent);
}

.admin-refresh-btn {
  padding: 8px 14px;
  font-size: 0.85rem;
}

.admin-dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.admin-dashboard-title {
  font-size: 1.6rem;
  font-weight: 800;
}

.admin-kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  width: 100%;
}

@keyframes admin-pulse-glow {
  0%, 100% { text-shadow: 0 0 18px rgba(255, 90, 31, 0.55); }
  50% { text-shadow: 0 0 32px rgba(255, 90, 31, 0.95); }
}

.admin-stat-pulse {
  animation: admin-pulse-glow 1.6s ease-in-out infinite;
}

.admin-charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  width: 100%;
}

.admin-chart-panel {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 0 20px rgba(255, 90, 31, 0.08);
}

.admin-chart-panel-wide {
  grid-column: 1 / -1;
}

.admin-chart-canvas-wrap {
  position: relative;
  height: 280px;
  width: 100%;
}

.admin-chart-canvas-wrap-short {
  height: 220px;
}

@media (max-width: 800px) {
  .admin-kpi-grid {
    grid-template-columns: 1fr;
  }
  .admin-charts-grid {
    grid-template-columns: 1fr;
  }
  .admin-dashboard-title {
    font-size: 1.3rem;
  }
}

.admin-dashboard-status {
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 600;
  margin-top: -12px;
  min-height: 1.1em;
}

.admin-stat-card {
  background: linear-gradient(135deg, rgba(255, 90, 31, 0.14), var(--card-bg));
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  box-shadow: 0 0 24px rgba(255, 90, 31, 0.18);
}

.admin-stat-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.admin-stat-value {
  font-family: var(--font-display);
  font-size: 2.6rem;
  font-weight: 400;
  color: var(--accent);
  line-height: 1;
  text-shadow: 0 0 18px rgba(255, 90, 31, 0.55);
}

.admin-chart-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.admin-chart-title {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text-secondary);
}


.site-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  padding: 10px 16px;
  padding-bottom: calc(10px + env(safe-area-inset-bottom));
  font-size: 0.72rem;
  color: var(--text-secondary);
  background: rgba(15, 17, 21, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  pointer-events: none;
}

.site-footer-copy,
.site-footer-links a {
  pointer-events: auto;
}

.site-footer-links {
  display: flex;
  gap: 16px;
}

.site-footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
}

.site-footer-links a:hover {
  color: var(--accent);
}

@media (max-width: 800px) {
  .site-footer {
    bottom: 64px;
    padding-bottom: calc(6px + env(safe-area-inset-bottom));
    background: transparent;
    backdrop-filter: none;
  }
}

.legal-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 48px 24px 80px;
  color: var(--text-primary);
  line-height: 1.7;
}

.legal-page h1 {
  font-family: var(--font-display, inherit);
  font-size: 2.4rem;
  margin-bottom: 24px;
}

.legal-page h2 {
  font-size: 1.15rem;
  margin: 28px 0 8px;
  color: var(--accent);
}

.legal-back-link {
  display: inline-block;
  margin-bottom: 24px;
  color: var(--text-secondary);
  text-decoration: none;
}

.cookie-consent-banner[hidden] {
  display: none;
}

.cookie-consent-banner {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 84px;
  z-index: 500;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  max-width: 520px;
  margin: 0 auto;
}

.cookie-consent-text {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin: 0;
  flex: 1 1 220px;
}

.cookie-consent-link {
  color: var(--accent);
  font-size: 0.85rem;
  text-decoration: underline;
  white-space: nowrap;
}

.cookie-consent-ok {
  background: var(--accent);
  color: #0a0f1d;
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  white-space: nowrap;
}

.cookie-consent-ok:hover {
  background: var(--accent-hover);
}

@media (min-width: 768px) {
  .cookie-consent-banner {
    bottom: 24px;
  }
}
/* ---------- Coffee nudge (small, dismissible, bottom-corner) ---------- */
.coffee-nudge {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 60;
  max-width: 280px;
  background: var(--card-bg, #14171d);
  border: 1px solid var(--card-border, rgba(255, 255, 255, 0.1));
  border-radius: var(--radius, 14px);
  padding: 16px 18px 18px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.coffee-nudge.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.coffee-nudge-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--text-secondary, #9aa1ad);
  border-radius: 50%;
  cursor: pointer;
}

.coffee-nudge-close:hover {
  color: var(--text-primary, #f5f6f8);
  background: rgba(255, 255, 255, 0.06);
}

.coffee-nudge-close i {
  width: 15px;
  height: 15px;
}

.coffee-nudge-text {
  font-family: var(--font-body, 'Manrope', sans-serif);
  font-size: 0.85rem;
  line-height: 1.4;
  color: var(--text-primary, #f5f6f8);
  margin: 0 14px 12px 0;
}

.coffee-nudge-btn {
  display: inline-block;
  font-family: var(--font-body, 'Manrope', sans-serif);
  font-weight: 700;
  font-size: 0.82rem;
  color: #0a0c10;
  background: var(--accent, #ff5a1f);
  border-radius: 100px;
  padding: 9px 16px;
  text-decoration: none;
  transition: filter 0.15s ease;
}

.coffee-nudge-btn:hover {
  filter: brightness(1.08);
}

@media (max-width: 380px) {
  .coffee-nudge {
    right: 12px;
    left: 12px;
    bottom: 12px;
    max-width: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .coffee-nudge {
    transition: none;
  }
}

.account-coffee-btn {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}