@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700;900&family=Rajdhani:wght@300;400;500;600;700&display=swap');

:root {
  --gold: #D4AF37;
  --gold-light: #F0D060;
  --gold-dark: #9A7D1A;
  --dark: #0A0A0F;
  --dark2: #111118;
  --dark3: #1A1A24;
  --dark4: #22222E;
  --dark5: #2A2A3A;
  --light: #E8E8F0;
  --muted: #6B6B85;
  --green: #5D8A5E;
  --red: #8A3A3A;
  --blue: #3A6A8A;
  --white-sq: #F0D9B5;
  --black-sq: #B58863;
  --board-border: #8B6914;
}

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

body {
  font-family: 'Rajdhani', sans-serif;
  background: var(--dark);
  color: var(--light);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Animated background */
body::before {
  content: '';
  position: fixed;
  top:0; left:0; right:0; bottom:0;
  background: 
    radial-gradient(ellipse at 20% 50%, rgba(212,175,55,0.04) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(212,175,55,0.03) 0%, transparent 40%),
    radial-gradient(ellipse at 60% 80%, rgba(93,138,94,0.03) 0%, transparent 40%);
  pointer-events: none;
  z-index: 0;
}

/* Scrollbar */
::-webkit-scrollbar { width:6px; }
::-webkit-scrollbar-track { background: var(--dark2); }
::-webkit-scrollbar-thumb { background: var(--gold-dark); border-radius:3px; }

/* NAVBAR */
.navbar {
  position: fixed; top:0; left:0; right:0; z-index: 1000;
  background: rgba(10,10,15,0.95);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(212,175,55,0.2);
  padding: 0 2rem;
  height: 60px;
  display: flex; align-items: center; justify-content: space-between;
}

.nav-logo {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none;
  font-family: 'Cinzel', serif;
  font-weight: 700;
  font-size: 1.4rem;
  color: var(--gold);
  letter-spacing: 2px;
}
.nav-logo .logo-icon { font-size: 1.8rem; }

.nav-links { display: flex; align-items: center; gap: 1.5rem; }
.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  transition: color 0.2s;
  position: relative;
}
.nav-links a:hover, .nav-links a.active { color: var(--gold); }
.nav-links a::after {
  content:''; position:absolute; bottom:-5px; left:0; right:0;
  height:1px; background:var(--gold);
  transform:scaleX(0); transition:transform 0.2s;
}
.nav-links a:hover::after, .nav-links a.active::after { transform:scaleX(1); }

.nav-user { display:flex; align-items:center; gap:1rem; }
.nav-rating {
  background: linear-gradient(135deg, rgba(212,175,55,0.15), rgba(212,175,55,0.05));
  border: 1px solid rgba(212,175,55,0.3);
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 0.85rem;
  color: var(--gold);
  font-weight: 600;
}
.btn {
  padding: 8px 20px;
  border: none; border-radius: 4px;
  cursor: pointer;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  text-decoration: none;
  display: inline-flex; align-items: center; gap: 6px;
  transition: all 0.2s;
}
.btn-gold {
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: var(--dark);
}
.btn-gold:hover { background: linear-gradient(135deg, var(--gold-light), var(--gold)); transform: translateY(-1px); box-shadow: 0 4px 15px rgba(212,175,55,0.3); }
.btn-outline {
  background: transparent;
  border: 1px solid var(--gold);
  color: var(--gold);
}
.btn-outline:hover { background: rgba(212,175,55,0.1); }
.btn-dark {
  background: var(--dark4);
  color: var(--light);
  border: 1px solid var(--dark5);
}
.btn-dark:hover { background: var(--dark5); border-color: var(--gold); color: var(--gold); }
.btn-green { background: linear-gradient(135deg, #5D8A5E, #3D5E3E); color: white; }
.btn-green:hover { background: linear-gradient(135deg, #6D9A6E, #4D6E4E); transform: translateY(-1px); }
.btn-red { background: linear-gradient(135deg, #8A3A3A, #5E2A2A); color: white; }
.btn-red:hover { transform: translateY(-1px); }
.btn-lg { padding: 14px 32px; font-size: 1.05rem; }
.btn-sm { padding: 5px 12px; font-size: 0.8rem; }

/* MAIN CONTENT */
.main-content { margin-top: 60px; position: relative; z-index: 1; }

/* HERO */
.hero {
  min-height: calc(100vh - 60px);
  display: flex; align-items: center; justify-content: center;
  padding: 4rem 2rem;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '♛';
  position: absolute;
  font-size: 40vw;
  color: rgba(212,175,55,0.03);
  right: -5%;
  top: 50%;
  transform: translateY(-50%);
  line-height: 1;
  pointer-events: none;
}
.hero-content { text-align: center; max-width: 700px; }
.hero-tag {
  display: inline-block;
  border: 1px solid rgba(212,175,55,0.4);
  color: var(--gold);
  padding: 5px 16px;
  border-radius: 20px;
  font-size: 0.8rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
  animation: fadeInDown 0.6s ease;
}
.hero h1 {
  font-family: 'Cinzel', serif;
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 900;
  line-height: 1.1;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, var(--gold-light), var(--gold), var(--gold-dark));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: fadeInDown 0.7s ease;
}
.hero p {
  color: var(--muted);
  font-size: 1.15rem;
  line-height: 1.7;
  margin-bottom: 2.5rem;
  animation: fadeInDown 0.8s ease;
}
.hero-btns { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; animation: fadeInUp 0.9s ease; }

/* CARDS */
.card {
  background: var(--dark2);
  border: 1px solid var(--dark5);
  border-radius: 8px;
  overflow: hidden;
  transition: all 0.3s;
}
.card:hover { border-color: rgba(212,175,55,0.3); transform: translateY(-2px); box-shadow: 0 8px 30px rgba(0,0,0,0.4); }

/* SECTION */
.section { padding: 5rem 2rem; max-width: 1300px; margin: 0 auto; }
.section-title {
  font-family: 'Cinzel', serif;
  font-size: 2rem;
  color: var(--gold);
  margin-bottom: 0.5rem;
}
.section-sub { color: var(--muted); margin-bottom: 3rem; }

/* GRID */
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.5rem; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1.5rem; }
.grid-4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; }

/* GAME MODE CARDS */
.mode-card {
  background: var(--dark2);
  border: 1px solid var(--dark5);
  border-radius: 12px;
  padding: 2rem;
  cursor: pointer;
  transition: all 0.3s;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.mode-card::before {
  content: '';
  position: absolute; top:0; left:0; right:0; bottom:0;
  background: linear-gradient(135deg, rgba(212,175,55,0.05), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}
.mode-card:hover { border-color: var(--gold); transform: translateY(-4px); box-shadow: 0 12px 40px rgba(0,0,0,0.5); }
.mode-card:hover::before { opacity: 1; }
.mode-icon { font-size: 3.5rem; margin-bottom: 1rem; display: block; }
.mode-title { font-family: 'Cinzel', serif; font-size: 1.2rem; color: var(--gold); margin-bottom: 0.5rem; }
.mode-desc { color: var(--muted); font-size: 0.9rem; line-height: 1.6; }

/* LEVEL BADGE */
.level-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid currentColor;
  opacity: 0.9;
}

/* RATING BAR */
.rating-bar {
  background: var(--dark4);
  border-radius: 4px;
  height: 6px;
  overflow: hidden;
  margin-top: 4px;
}
.rating-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold-dark), var(--gold));
  border-radius: 4px;
  transition: width 1s ease;
}

/* LEADERBOARD */
.leader-row {
  display: flex; align-items: center; gap: 1rem;
  padding: 0.8rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  transition: background 0.2s;
}
.leader-row:hover { background: rgba(212,175,55,0.05); }
.leader-rank { width:30px; text-align:center; font-weight:700; color:var(--muted); }
.leader-rank.top1 { color:#FFD700; font-size:1.2rem; }
.leader-rank.top2 { color:#C0C0C0; font-size:1.1rem; }
.leader-rank.top3 { color:#CD7F32; }
.leader-name { flex:1; font-weight:600; }
.leader-rating { color:var(--gold); font-weight:700; }
.online-dot { width:8px; height:8px; border-radius:50%; }
.online-dot.online { background:#5D8A5E; box-shadow:0 0 6px #5D8A5E; }
.online-dot.offline { background:var(--muted); }

/* MODAL */
.modal-overlay {
  position: fixed; inset:0; z-index: 2000;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s;
}
.modal-overlay.active { opacity: 1; pointer-events: all; }
.modal {
  background: var(--dark2);
  border: 1px solid rgba(212,175,55,0.3);
  border-radius: 12px;
  padding: 2.5rem;
  width: 100%; max-width: 420px;
  position: relative;
  transform: scale(0.95) translateY(20px);
  transition: transform 0.3s;
}
.modal-overlay.active .modal { transform: scale(1) translateY(0); }
.modal-close {
  position: absolute; top:1rem; right:1rem;
  background: none; border: none;
  color: var(--muted); cursor: pointer;
  font-size: 1.5rem; line-height:1;
}
.modal-close:hover { color: var(--gold); }
.modal-title {
  font-family: 'Cinzel', serif;
  font-size: 1.5rem;
  color: var(--gold);
  margin-bottom: 0.3rem;
}
.modal-sub { color: var(--muted); font-size: 0.9rem; margin-bottom: 1.5rem; }

/* FORM */
.form-group { margin-bottom: 1rem; }
.form-label { display:block; color:var(--muted); font-size:0.85rem; margin-bottom:6px; letter-spacing:1px; text-transform:uppercase; }
.form-input {
  width: 100%;
  background: var(--dark);
  border: 1px solid var(--dark5);
  border-radius: 6px;
  padding: 10px 14px;
  color: var(--light);
  font-family: 'Rajdhani', sans-serif;
  font-size: 1rem;
  transition: border-color 0.2s;
}
.form-input:focus { outline:none; border-color: var(--gold); }
.form-input::placeholder { color: var(--muted); }
.form-error { color: #E74C3C; font-size: 0.85rem; margin-top: 0.5rem; }
.form-success { color: #5D8A5E; font-size: 0.85rem; margin-top: 0.5rem; }

/* TABS */
.tabs { display:flex; border-bottom:1px solid var(--dark5); margin-bottom:1.5rem; }
.tab-btn {
  flex:1; padding:10px; text-align:center;
  background:none; border:none; border-bottom:2px solid transparent;
  color:var(--muted); cursor:pointer;
  font-family:'Rajdhani',sans-serif; font-size:0.95rem;
  font-weight:600; letter-spacing:1px; text-transform:uppercase;
  transition:all 0.2s;
}
.tab-btn.active { color:var(--gold); border-bottom-color:var(--gold); }

/* CHESS BOARD */
.board-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.chess-board {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  border: 3px solid var(--board-border);
  border-radius: 4px;
  box-shadow: 0 0 40px rgba(0,0,0,0.8), inset 0 0 0 1px rgba(212,175,55,0.2);
  user-select: none;
}
.chess-square {
  aspect-ratio: 1;
  display: flex; align-items: center; justify-content: center;
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  cursor: pointer;
  position: relative;
  transition: filter 0.15s;
}
.chess-square.light { background: var(--white-sq); }
.chess-square.dark { background: var(--black-sq); }
.chess-square.selected { background: rgba(255,255,100,0.6) !important; }
.chess-square.possible-move::after {
  content: '';
  position: absolute;
  width: 30%; height: 30%;
  background: rgba(0,0,0,0.25);
  border-radius: 50%;
}
.chess-square.possible-capture::after {
  content: '';
  position: absolute;
  inset: 0;
  border: 4px solid rgba(0,0,0,0.25);
  border-radius: 50%;
}
.chess-square.last-move-from, .chess-square.last-move-to { background: rgba(207,210,90,0.5) !important; }
.chess-square.in-check { background: rgba(200,50,50,0.6) !important; }

.coord-file, .coord-rank {
  position: absolute;
  font-size: 0.65rem;
  font-weight: 700;
  opacity: 0.7;
}
.coord-file { bottom: 1px; right: 2px; }
.coord-rank { top: 1px; left: 2px; }
.light .coord-file, .light .coord-rank { color: var(--black-sq); }
.dark .coord-file, .dark .coord-rank { color: var(--white-sq); }

.chess-piece { cursor: grab; position: relative; z-index: 2; transition: transform 0.1s; line-height:1; }
.chess-piece:active { cursor: grabbing; transform: scale(1.15); }

/* PLAYER PANEL */
.player-panel {
  background: var(--dark2);
  border: 1px solid var(--dark5);
  border-radius: 8px;
  padding: 1rem 1.2rem;
  display: flex; align-items: center; gap: 1rem;
  margin: 8px 0;
}
.player-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-dark), var(--dark5));
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
  border: 2px solid var(--dark5);
}
.player-info { flex: 1; }
.player-name { font-weight: 700; font-size: 1rem; }
.player-rating-small { color: var(--gold); font-size: 0.85rem; }
.clock {
  font-family: 'Cinzel', monospace;
  font-size: 1.3rem;
  font-weight: 700;
  padding: 6px 14px;
  background: var(--dark);
  border-radius: 6px;
  border: 1px solid var(--dark5);
  min-width: 90px;
  text-align: center;
}
.clock.active { color: var(--gold); border-color: var(--gold); }
.clock.low { color: #E74C3C; border-color: #E74C3C; animation: pulse 1s infinite; }

/* MOVE LIST */
.move-list {
  background: var(--dark);
  border: 1px solid var(--dark5);
  border-radius: 8px;
  padding: 0.5rem;
  height: 200px;
  overflow-y: auto;
  font-size: 0.9rem;
}
.move-row { display: flex; align-items: center; padding: 2px 4px; border-radius: 4px; }
.move-row:hover { background: var(--dark4); }
.move-num { width: 28px; color: var(--muted); font-size: 0.8rem; }
.move-san { padding: 2px 6px; border-radius: 3px; cursor: pointer; }
.move-san:hover { background: rgba(212,175,55,0.15); color: var(--gold); }
.move-san.current { background: rgba(212,175,55,0.25); color: var(--gold); }

/* GAME CONTROLS */
.game-controls { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.5rem; }
.ctrl-btn {
  flex: 1; min-width: 60px;
  padding: 8px;
  background: var(--dark4);
  border: 1px solid var(--dark5);
  border-radius: 6px;
  color: var(--light);
  cursor: pointer;
  font-size: 1.1rem;
  transition: all 0.2s;
  text-align: center;
}
.ctrl-btn:hover { background: var(--dark5); border-color: var(--gold); color: var(--gold); }

/* BOT LEVELS */
.bot-levels { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.5rem; margin: 1rem 0; }
.bot-level-btn {
  padding: 10px 8px;
  border-radius: 8px;
  border: 1px solid var(--dark5);
  background: var(--dark);
  color: var(--light);
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
  font-family: 'Rajdhani', sans-serif;
}
.bot-level-btn:hover, .bot-level-btn.selected { border-color: var(--gold); background: rgba(212,175,55,0.1); color: var(--gold); }
.bot-level-btn .bot-lvl-num { font-size: 1.4rem; font-weight: 700; }
.bot-level-btn .bot-lvl-label { font-size: 0.7rem; color: var(--muted); margin-top: 2px; }

/* TIME CONTROLS */
.time-controls { display: flex; gap: 0.5rem; flex-wrap: wrap; margin: 1rem 0; }
.time-btn {
  flex: 1; min-width: 70px;
  padding: 8px;
  border-radius: 8px;
  border: 1px solid var(--dark5);
  background: var(--dark);
  color: var(--light);
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
}
.time-btn:hover, .time-btn.selected { border-color: var(--gold); background: rgba(212,175,55,0.1); color: var(--gold); }

/* STATS */
.stat-box {
  background: var(--dark3);
  border: 1px solid var(--dark5);
  border-radius: 8px;
  padding: 1.2rem;
  text-align: center;
}
.stat-num { font-family: 'Cinzel', serif; font-size: 1.8rem; color: var(--gold); font-weight: 700; }
.stat-label { color: var(--muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 1px; margin-top: 2px; }

/* TOAST */
.toast-container { position: fixed; bottom: 2rem; right: 2rem; z-index: 9999; display: flex; flex-direction: column; gap: 0.5rem; }
.toast {
  background: var(--dark2);
  border: 1px solid var(--dark5);
  border-radius: 8px;
  padding: 0.8rem 1.2rem;
  color: var(--light);
  font-size: 0.9rem;
  min-width: 200px;
  transform: translateX(120%);
  transition: transform 0.3s;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}
.toast.show { transform: translateX(0); }
.toast.success { border-color: #5D8A5E; }
.toast.error { border-color: #8A3A3A; }
.toast.info { border-color: var(--gold); }

/* PROMOTION */
.promotion-modal {
  position: fixed; inset: 0; z-index: 3000;
  background: rgba(0,0,0,0.9);
  display: flex; align-items: center; justify-content: center;
}
.promotion-pieces {
  display: flex; gap: 1rem;
  background: var(--dark2);
  border: 2px solid var(--gold);
  border-radius: 12px;
  padding: 1.5rem;
}
.promo-piece {
  font-size: 3rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 8px;
  border: 2px solid transparent;
  transition: all 0.2s;
}
.promo-piece:hover { border-color: var(--gold); background: rgba(212,175,55,0.1); transform: scale(1.1); }

/* GAME RESULT */
.result-overlay {
  position: fixed; inset: 0; z-index: 2500;
  background: rgba(0,0,0,0.9);
  backdrop-filter: blur(10px);
  display: flex; align-items: center; justify-content: center;
}
.result-card {
  text-align: center;
  background: var(--dark2);
  border: 2px solid var(--gold);
  border-radius: 16px;
  padding: 3rem;
  animation: scaleIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.result-icon { font-size: 5rem; margin-bottom: 1rem; }
.result-title { font-family: 'Cinzel', serif; font-size: 2rem; color: var(--gold); margin-bottom: 0.5rem; }
.result-sub { color: var(--muted); margin-bottom: 2rem; }
.rating-change { font-size: 1.2rem; margin-bottom: 1.5rem; }
.rating-change .plus { color: #5D8A5E; }
.rating-change .minus { color: #E74C3C; }

/* ONLINE USERS SIDEBAR */
.sidebar-users { display: flex; flex-direction: column; gap: 0.5rem; }
.user-row {
  display: flex; align-items: center; gap: 0.8rem;
  padding: 0.6rem;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
}
.user-row:hover { background: rgba(212,175,55,0.05); }
.user-ava {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--dark4), var(--dark5));
  display: flex; align-items: center; justify-content: center;
  font-size: 0.9rem;
  border: 2px solid var(--dark5);
  flex-shrink: 0;
}
.user-info-row { flex: 1; }
.user-name-row { font-weight: 600; font-size: 0.9rem; }
.user-rating-row { color: var(--gold); font-size: 0.8rem; }

/* MISC */
.divider { height: 1px; background: var(--dark5); margin: 1rem 0; }
.text-gold { color: var(--gold); }
.text-muted { color: var(--muted); }
.text-center { text-align: center; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.w-full { width: 100%; }
.hidden { display: none !important; }

/* ANIMATIONS */
@keyframes fadeInDown { from { opacity:0; transform:translateY(-20px); } to { opacity:1; transform:none; } }
@keyframes fadeInUp { from { opacity:0; transform:translateY(20px); } to { opacity:1; transform:none; } }
@keyframes fadeIn { from { opacity:0; } to { opacity:1; } }
@keyframes scaleIn { from { opacity:0; transform:scale(0.5); } to { opacity:1; transform:scale(1); } }
@keyframes pulse { 0%,100% { opacity:1; } 50% { opacity:0.5; } }
@keyframes shimmer { 0% { background-position: -1000px 0; } 100% { background-position: 1000px 0; } }

/* BOARD FLIP */
.board-flipped .chess-square { transform: rotate(180deg); }
.board-flipped .chess-piece { transform: rotate(180deg); }

/* RESPONSIVE */
@media (max-width: 768px) {
  .navbar { padding: 0 1rem; }
  .nav-links { display: none; }
  .section { padding: 3rem 1rem; }
  .chess-square { font-size: 1.8rem; }
  .modal { padding: 1.5rem; }
}

/* ===== MOBILE FIXES (appended) ===== */

/* Ensure chess squares are square on all screens */
.chess-board {
  display: grid !important;
  grid-template-columns: repeat(8, 1fr) !important;
  grid-template-rows: repeat(8, 1fr) !important;
  width: 100% !important;
  height: 100% !important;
}
.chess-square {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: pointer;
  user-select: none;
  aspect-ratio: 1;
}

/* Mobile navbar: hide text links */
@media (max-width: 680px) {
  .nav-links { display: none; }
  .navbar { padding: 0 0.8rem; }
  .nav-logo { font-size: 1.1rem; }
  .nav-logo .logo-icon { font-size: 1.4rem; }
}

/* Index page: stack leaderboard below on mobile */
@media (max-width: 900px) {
  .section-grid {
    grid-template-columns: 1fr !important;
  }
}

/* Mode cards stack on small screens */
@media (max-width: 500px) {
  .grid-3 { grid-template-columns: 1fr !important; }
  .grid-2 { grid-template-columns: 1fr !important; }
  .hero h1 { font-size: 2rem !important; }
  .hero p { font-size: 1rem !important; }
  .hero-btns { flex-direction: column; align-items: center; }
  .btn-lg { width: 100%; justify-content: center; }
}

/* Leaderboard table on mobile */
@media (max-width: 600px) {
  .leader-row { padding: 0.6rem 0.5rem; gap: 0.5rem; }
  .leader-row > div:last-child { display: none; } /* hide WR on mobile */
}

/* Profile: stats grid smaller */
@media (max-width: 480px) {
  .stat-box { padding: 0.8rem 0.5rem; }
  .stat-num { font-size: 1.3rem; }
}

/* Fix modal on very small screens */
@media (max-width: 420px) {
  .modal { padding: 1.2rem; }
  .modal-title { font-size: 1.2rem; }
}
