/* ==================== MiniChess - Styles ==================== */

:root {
  --bg-primary: #090c10;
  --page-bg: #090c10;
  --surface: rgba(18, 24, 34, 0.75);
  --surface2: rgba(26, 34, 48, 0.75);
  --surface3: rgba(33, 44, 62, 0.75);
  --bg-card: rgba(18, 24, 34, 0.75);
  --bg-input: rgba(13, 17, 23, 0.7);
  --border-subtle: rgba(255, 255, 255, 0.05);
  --border-glass: rgba(255, 255, 255, 0.07);
  --border-active: rgba(255, 255, 255, 0.18);
  --border: rgba(255, 255, 255, 0.07);
  --text-primary: #f0f3f7;
  --text-bright: #f0f3f7;
  --text-secondary: #94a3b8;
  --text-dim: #94a3b8;
  --text-muted: #64748b;
  --emerald: #10b981;
  --emerald-hover: #34d399;
  --emerald-glow: rgba(16, 185, 129, 0.35);
  --emerald-subtle: rgba(16, 185, 129, 0.12);
  --emerald-border: rgba(16, 185, 129, 0.35);
  --accent: #10b981;
  --accent-hover: #34d399;
  --green: #10b981;
  --gold: #f59e0b;
  --gold-glow: rgba(245, 158, 11, 0.25);
  --gold-modern: #f59e0b;
  --red: #f43f5e;
  --red-soft: #f43f5e;
  --accent-purple: #8b5cf6;
  --accent-blue: #3b82f6;
  --accent-cyan: #06b6d4;
  --cyan-glow: rgba(6, 182, 212, 0.3);

  /* Slate Chessboard (Higher Contrast) */
  --square-light: #475569;
  --square-dark: #283548;
  --square-highlight: rgba(16, 185, 129, 0.3);
  --square-selected: rgba(16, 185, 129, 0.25);
  --square-possible: rgba(6, 182, 212, 0.8);
  --square-possible-ring: rgba(6, 182, 212, 0.95);
  --square-capture: rgba(244, 63, 94, 0.85);
  --square-check: rgba(239, 68, 68, 0.75);
  --square-last-move: rgba(16, 185, 129, 0.25);

  --clock-bg: #090c10;
  --clock-text: #f0f3f7;
  --clock-low: #f43f5e;

  /* Glassmorphism */
  --glass-bg: rgba(18, 24, 34, 0.75);
  --glass-surface: rgba(18, 24, 34, 0.75);
  --glass-border: rgba(255, 255, 255, 0.07);
  --glass-highlight: rgba(255, 255, 255, 0.04);

  --font-main: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --ease-spring: cubic-bezier(0.16, 1, 0.3, 1);
}

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

body,
h1, h2, h3, h4, h5, h6,
p, span, a, label,
button, input, select, textarea,
.btn, .tab-btn, .mode-card,
.mode-card-title, .mode-card-desc,
.sidebar-nav a, .nav-item, .nav-link,
.card, .bento-card, .menu, .menu-item {
  font-family: var(--font-main);
}

body {
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ==================== Navigation ==================== */

nav:not(.sidebar-nav) {
  width: 100%;
  background: var(--bg-secondary);
  padding: 14px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

nav:not(.sidebar-nav) .logo {
  font-size: 22px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 1px;
}

nav:not(.sidebar-nav) .logo span {
  color: var(--text-primary);
}

nav:not(.sidebar-nav) .nav-links {
  display: flex;
  gap: 20px;
  align-items: center;
}

nav:not(.sidebar-nav) .nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 15px;
  transition: color 0.2s;
}

nav:not(.sidebar-nav) .nav-links a:hover {
  color: var(--accent-hover);
}

nav:not(.sidebar-nav) .user-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

nav:not(.sidebar-nav) .user-info .username {
  color: var(--gold);
  font-weight: 600;
}

nav:not(.sidebar-nav) .user-info .elo {
  color: var(--text-secondary);
  font-size: 13px;
}

nav:not(.sidebar-nav) button {
  background: var(--accent);
  color: white;
  border: none;
  padding: 8px 18px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.2s;
}

nav:not(.sidebar-nav) button:hover {
  background: var(--accent-hover);
}

nav:not(.sidebar-nav) button.secondary {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

nav:not(.sidebar-nav) button.secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ==================== Auth Pages (Login/Register) ==================== */

.auth-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: calc(100vh - 70px);
  width: 100%;
  padding: 20px;
}

.auth-card {
  background: var(--bg-card);
  padding: 40px;
  border-radius: 16px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.auth-card h1 {
  text-align: center;
  color: var(--accent);
  margin-bottom: 8px;
  font-size: 28px;
}

.auth-card .subtitle {
  text-align: center;
  color: var(--text-secondary);
  margin-bottom: 28px;
  font-size: 14px;
}

.auth-card .form-group {
  margin-bottom: 20px;
}

.auth-card label {
  display: block;
  margin-bottom: 6px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
}

.auth-card input {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 15px;
  transition: border 0.2s;
}

.auth-card input:focus {
  outline: none;
  border-color: var(--accent);
}

.auth-card .btn-primary {
  width: 100%;
  padding: 12px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 8px;
  transition: background 0.2s;
}

.auth-card .btn-primary:hover {
  background: var(--accent-hover);
}

.auth-card .switch-link {
  text-align: center;
  margin-top: 18px;
  font-size: 14px;
  color: var(--text-secondary);
}

.auth-card .switch-link a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.auth-card .error-msg {
  color: var(--red);
  font-size: 13px;
  margin-top: 12px;
  text-align: center;
}

/* ==================== Lobby Page ==================== */

.lobby-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 20px;
  width: 100%;
  max-width: 600px;
}

.lobby-card {
  background: var(--bg-card);
  padding: 40px;
  border-radius: 16px;
  width: 100%;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  text-align: center;
}

.lobby-card h1 {
  color: var(--accent);
  font-size: 26px;
  margin-bottom: 6px;
}

.lobby-card .subtitle {
  color: var(--text-secondary);
  margin-bottom: 30px;
}

.lobby-card .stats {
  display: flex;
  justify-content: center;
  gap: 30px;
  margin-bottom: 30px;
}

.lobby-card .stat-item {
  text-align: center;
}

.lobby-card .stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--gold);
}

.lobby-card .stat-label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.lobby-card .find-match-btn {
  width: 100%;
  padding: 16px;
  background: var(--green);
  color: #000;
  border: none;
  border-radius: 12px;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s, background 0.2s;
}

.lobby-card .find-match-btn:hover {
  transform: scale(1.02);
}

.lobby-card .find-match-btn.searching {
  background: var(--red);
  color: white;
  animation: pulse 1.5s infinite;
}

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

.lobby-card .queue-status {
  margin-top: 16px;
  color: var(--text-secondary);
  font-size: 14px;
}

.lobby-card .leaderboard-link {
  margin-top: 24px;
}

.lobby-card .leaderboard-link a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

/* ==================== Game Page ==================== */

.game-container {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 24px 20px 32px;
  width: 100%;
  min-height: calc(100vh - 70px);
}

/* Board wrapper — centers everything vertically */
.board-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 504px;
}

/* ---- Glassmorphism header / info bar ---- */
.board-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 14px;
  background: var(--glass-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  width: 100%;
}

.board-header .player-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.board-header .player-color {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
}

.board-header .player-color.white { background: #fff; border: 1px solid #666; }
.board-header .player-color.black { background: #333; }

.board-header .player-name {
  font-weight: 600;
  font-size: 14px;
}

.board-header .player-elo {
  color: var(--text-secondary);
  font-size: 12px;
}

.board-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent);
  flex-shrink: 0;
}

.board-avatar-placeholder {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #7c3aed);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  border: 2px solid var(--accent);
  flex-shrink: 0;
}

.board-header .turn-indicator {
  font-size: 12px;
  padding: 4px 12px;
  border-radius: 12px;
  background: var(--glass-highlight);
}

.board-header .turn-indicator.active {
  background: var(--green);
  color: #000;
  font-weight: 700;
}

/* ---- Pocket Strips ---- */
.pocket-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: var(--glass-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  width: 100%;
  min-height: 44px;
}

.pocket-strip-label {
  font-size: 11px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  white-space: nowrap;
  flex-shrink: 0;
}

.pocket-strip-pieces {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  flex: 1;
}

.your-pocket {
  border-color: rgba(233, 69, 96, 0.2);
}

.your-pocket .pocket-strip-label {
  color: var(--accent);
}

/* Pocket pieces inside strips */
.pocket-strip .pocket-piece {
  font-size: 26px;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.2s, transform 0.15s;
}

.pocket-strip .pocket-piece:hover {
  background: rgba(233, 69, 96, 0.25);
  transform: scale(1.1);
}

.pocket-strip .pocket-piece.selected-drop {
  background: var(--square-selected);
  border-radius: 6px;
}

.pocket-strip .pocket-piece:active {
  opacity: 0.7;
  transform: scale(0.95);
}

/* ---- Moves Strip ---- */
.moves-strip {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 12px;
  background: var(--glass-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  width: 100%;
}

.moves-strip-label {
  font-size: 11px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  white-space: nowrap;
  flex-shrink: 0;
  padding-top: 1px;
}

.moves-placeholder {
  color: var(--text-secondary);
  font-size: 13px;
  opacity: 0.6;
}

/* ---- Move History (horizontal scroll) ---- */
.move-history {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  flex: 1;
  max-height: 48px;
  overflow-y: auto;
  font-size: 13px;
  color: var(--text-secondary);
}

.move-history .move-pair {
  display: flex;
  gap: 4px;
}

.move-history .move-num {
  color: var(--text-secondary);
  font-size: 11px;
  opacity: 0.7;
}

.move-history .move-white {
  color: #fff;
}

.move-history .move-black {
  color: #bbb;
}

/* ---- Clock ---- */
.clock {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 18px;
  font-weight: 700;
  padding: 6px 14px;
  background: rgba(10, 10, 26, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 8px;
  color: var(--clock-text);
  min-width: 70px;
  text-align: center;
  letter-spacing: 1px;
  border: 1px solid var(--glass-border);
  transition: color 0.3s, border-color 0.3s;
}

.clock.active-clock {
  border-color: var(--green);
  color: #fff;
}

.clock.low-time {
  color: var(--clock-low);
  border-color: var(--clock-low);
  animation: clockPulse 0.5s infinite alternate;
}

@keyframes clockPulse {
  from { opacity: 1; }
  to { opacity: 0.5; }
}

/* ---- Piece Images ---- */

.piece-img {
  width: 100%;
  height: 100%;
  pointer-events: none;
  user-select: none;
}

/* Black pieces glow in the dark for contrast on dark squares */
.square .piece-img[src*="/b"],
.square .piece-img[src*="bp.svg"],
.square .piece-img[src*="bn.svg"],
.square .piece-img[src*="bb.svg"],
.square .piece-img[src*="br.svg"],
.square .piece-img[src*="bk.svg"],
.square .piece-img[src*="bq.svg"],
.piece-img.piece-black,
.square .piece-black,
.piece-ghost.piece-black,
img.piece-black,
.piece-black {
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5)) drop-shadow(0 0 1.5px rgba(255,255,255,0.45));
}

.pocket-strip .piece-img {
  width: 100%;
  height: 100%;
}

.promotion-dialog .piece-img {
  width: 48px;
  height: 48px;
}

/* ---- Piece Animations ---- */

.piece-ghost {
  will-change: transform;
}

.piece-captured {
  animation: captureShrink 150ms ease-in forwards;
}

@keyframes captureShrink {
  0% { transform: scale(1); opacity: 1; }
  60% { transform: scale(0.3); opacity: 0.3; }
  100% { transform: scale(0); opacity: 0; }
}

.piece-drop {
  animation: dropIn 250ms ease-out;
}

@keyframes dropIn {
  0% { transform: scale(0) translateY(-16px); opacity: 0; }
  60% { transform: scale(1.15) translateY(4px); opacity: 1; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}

/* ---- Chess Board ---- */
.chess-board {
  display: grid;
  grid-template-columns: repeat(6, 84px);
  grid-template-rows: repeat(6, 84px);
  border: 3px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.6), 0 0 0 1px var(--glass-border);
}

.square {
  width: 84px;
  height: 84px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  font-size: 56px;
  user-select: none;
  transition: background 0.15s;
}

.square.light {
  background: var(--square-light);
}

.square.dark {
  background: var(--square-dark);
}

.square.selected {
  background: var(--square-selected) !important;
}

.square.possible-move::after {
  content: '';
  position: absolute;
  width: 22px;
  height: 22px;
  background: var(--square-possible);
  border-radius: 50%;
  border: 2px solid var(--square-possible-ring);
  box-shadow: 0 0 8px rgba(6, 182, 212, 0.5);
  z-index: 1;
}

.square.possible-capture::after {
  content: '';
  position: absolute;
  width: calc(100% - 6px);
  height: calc(100% - 6px);
  border: 5px solid var(--square-capture);
  border-radius: 50%;
  box-sizing: border-box;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.5);
  z-index: 1;
}

.square.highlight {
  background: var(--square-highlight) !important;
}

.square.in-check {
  background: var(--square-check) !important;
  animation: checkPulse 0.8s infinite alternate;
}

@keyframes checkPulse {
  from { background: var(--square-check); }
  to { background: rgba(239, 68, 68, 0.3); }
}

.square.last-move {
  background: var(--square-last-move) !important;
}

.square.drag-over {
  box-shadow: inset 0 0 0 3px var(--accent);
}

.square.drag-origin {
  opacity: 0.5;
}

/* ---- File labels ---- */
.rank-labels, .file-labels {
  display: flex;
}

.file-labels {
  margin-top: 2px;
  width: 504px;
  justify-content: space-around;
}

.rank-labels {
  flex-direction: column;
  position: absolute;
  left: -20px;
  height: 504px;
  justify-content: space-around;
}

.rank-label, .file-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  width: 20px;
  text-align: center;
}

/* Confetti */
.confetti-piece {
  position: fixed;
  top: -10px;
  width: 10px;
  height: 10px;
  background-color: #f2d74e;
  z-index: 10000;
  pointer-events: none;
  animation: confettiFall 2s linear forwards;
}
@keyframes confettiFall {
  0% { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(100vh) rotate(360deg); opacity: 0; }
}

/* Game over overlay */
.game-over-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
}

.game-over-card {
  background: var(--bg-card);
  padding: 40px;
  border-radius: 16px;
  text-align: center;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.6);
}

.game-over-card h2 {
  font-size: 32px;
  margin-bottom: 12px;
}

.game-over-card .win-text { color: var(--green); }
.game-over-card .lose-text { color: var(--red); }
.game-over-card .draw-text { color: var(--gold); }

.game-over-card .elo-change {
  color: var(--text-secondary);
  margin-bottom: 20px;
  font-size: 15px;
}

.game-over-card button {
  background: var(--accent);
  color: white;
  border: none;
  padding: 12px 30px;
  border-radius: 8px;
  font-size: 16px;
  cursor: pointer;
  margin: 6px;
}

.game-over-card button:hover {
  background: var(--accent-hover);
}

/* Promotion dialog */
.promotion-dialog {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--bg-card);
  padding: 20px;
  border-radius: 12px;
  display: flex;
  gap: 8px;
  z-index: 300;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
}

.promotion-dialog .promo-option {
  font-size: 42px;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 8px;
  background: var(--bg-input);
  transition: background 0.2s;
}

.promotion-dialog .promo-option:hover {
  background: var(--accent);
}

/* ==================== Leaderboard Page ==================== */

.leaderboard-container {
  width: 100%;
  max-width: 700px;
  padding: 30px 20px;
}

.leaderboard-card {
  background: var(--bg-card);
  padding: 30px;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.leaderboard-card h1 {
  text-align: center;
  color: var(--accent);
  margin-bottom: 24px;
}

.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
}

.leaderboard-table th {
  text-align: left;
  padding: 12px 16px;
  color: var(--text-secondary);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-bottom: 1px solid var(--border);
}

.leaderboard-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 15px;
}

.leaderboard-table .rank {
  font-weight: 700;
  color: var(--gold);
  width: 40px;
}

.leaderboard-table .rank.top-1 { color: #fbbf24; }
.leaderboard-table .rank.top-2 { color: #94a3b8; }
.leaderboard-table .rank.top-3 { color: #d97706; }

.leaderboard-table tr:hover {
  background: rgba(233, 69, 96, 0.05);
}

/* ==================== Notifications / Toast ==================== */

.toast {
  position: fixed;
  top: 80px;
  right: 20px;
  padding: 14px 20px;
  border-radius: 8px;
  color: white;
  font-size: 14px;
  z-index: 500;
  animation: slideIn 0.3s ease;
  max-width: 350px;
}

.toast.error { background: var(--red); }
.toast.success { background: var(--green); color: #000; }
.toast.info { background: var(--bg-card); border: 1px solid var(--border); }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.toast-action {
  padding: 4px 12px;
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 6px;
  background: rgba(255,255,255,0.1);
  color: #fff;
  font-size: 12px;
  cursor: pointer;
  margin-left: 6px;
  transition: background 0.2s;
}

.toast-action:hover {
  background: rgba(255,255,255,0.25);
}

/* ==================== Profile Page ==================== */

.profile-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 20px 60px;
  width: 100%;
  max-width: 720px;
  gap: 16px;
}

/* ---- Profile Header ---- */
.profile-header {
  background: var(--bg-card);
  padding: 28px 32px;
  border-radius: 16px;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  flex-wrap: wrap;
  gap: 16px;
}

.profile-header-left {
  display: flex;
  align-items: center;
  gap: 20px;
}

.profile-avatar-wrapper {
  position: relative;
  width: 100px;
  height: 100px;
  flex-shrink: 0;
}

.profile-avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--accent);
  box-shadow: 0 0 0 3px var(--bg-card), 0 0 20px rgba(233, 69, 96, 0.3);
}

.profile-avatar-placeholder {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #7c3aed);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  font-weight: 700;
  border: 3px solid var(--accent);
  box-shadow: 0 0 0 3px var(--bg-card), 0 0 20px rgba(233, 69, 96, 0.3);
}

.avatar-upload-btn {
  position: absolute;
  bottom: -4px;
  right: -4px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  cursor: pointer;
  border: 2px solid var(--bg-card);
  transition: transform 0.2s, background 0.2s;
  z-index: 2;
}

.avatar-upload-btn:hover {
  transform: scale(1.1);
  background: var(--accent-hover);
}

.avatar-cooldown-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  z-index: 3;
}

.profile-header-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.profile-username {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.profile-elo-badge {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.profile-elo-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--gold);
}

.profile-elo-label {
  font-size: 12px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.profile-member-since {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.profile-header-actions {
  display: flex;
  gap: 8px;
}

/* ---- Stats Grid ---- */
.profile-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  width: 100%;
}

.profile-stat-box {
  background: var(--bg-card);
  padding: 18px 12px;
  border-radius: 12px;
  text-align: center;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.profile-stat-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 2px;
}

.profile-stat-value.wins-color { color: var(--green); }
.profile-stat-value.losses-color { color: var(--red); }
.profile-stat-value.draws-color { color: var(--gold); }

.profile-stat-label {
  font-size: 11px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

/* ---- Profile Card (reused for friends, history, etc.) ---- */
.profile-card {
  background: var(--bg-card);
  padding: 30px;
  border-radius: 16px;
  width: 100%;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.profile-card h1 {
  color: var(--accent);
  font-size: 24px;
  margin-bottom: 16px;
}

.profile-card h2 {
  color: var(--text-primary);
  font-size: 18px;
  margin-bottom: 14px;
}

.profile-card .stats {
  display: flex;
  justify-content: center;
  gap: 30px;
  margin-bottom: 6px;
}

.profile-card .stat-item {
  text-align: center;
}

.profile-card .stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--gold);
}

.profile-card .stat-label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* Friend form */
.friend-form {
  display: flex;
  gap: 8px;
}

.friend-form input {
  flex: 1;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 14px;
}

.friend-form input:focus {
  outline: none;
  border-color: var(--accent);
}

.friend-form button,
.btn-accent {
  padding: 10px 20px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  text-decoration: none;
  display: inline-block;
}

.friend-form button:hover,
.btn-accent:hover {
  background: var(--accent-hover);
}

.friend-status {
  margin-top: 8px;
  font-size: 13px;
}

.friend-status.success { color: var(--green); }
.friend-status.error { color: var(--red); }

/* ---- Friends Grid (2-column) ---- */
.friends-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  width: 100%;
}

.friends-card-col {
  align-self: start;
}

.friends-right-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.friends-card-compact {
  padding: 20px;
}

.friends-card-compact h2 {
  font-size: 16px;
  margin-bottom: 10px;
}

/* Friend list */
.friend-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  background: var(--bg-input);
  border-radius: 8px;
  margin-bottom: 6px;
}

.friend-item.pending {
  border-left: 3px solid var(--accent);
}

.friend-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.friend-name {
  font-weight: 600;
  font-size: 14px;
}

.friend-elo {
  font-size: 12px;
  color: var(--text-secondary);
}

.empty-list {
  color: var(--text-secondary);
  font-size: 13px;
  text-align: center;
  padding: 12px;
}

.btn-danger-sm {
  padding: 6px 12px;
  background: transparent;
  border: 1px solid var(--red);
  color: var(--red);
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-danger-sm:hover {
  background: rgba(239, 68, 68, 0.15);
}

.btn-accept-sm {
  padding: 6px 12px;
  background: var(--green);
  color: #000;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-accept-sm:hover {
  opacity: 0.85;
}

.btn-decline-sm {
  padding: 6px 12px;
  background: transparent;
  border: 1px solid var(--text-secondary);
  color: var(--text-secondary);
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.btn-decline-sm:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: var(--red);
  color: var(--red);
}

.btn-secondary-sm {
  padding: 8px 18px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}

.btn-secondary-sm:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ==================== Private Room (Lobby) ==================== */

.private-room-card {
  background: var(--glass-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--glass-border);
}

.copy-link-box {
  display: flex;
  gap: 8px;
}

.copy-link-box input {
  flex: 1;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 13px;
  font-family: inherit;
}

.copy-link-box input:focus {
  outline: none;
}

.copy-link-box button {
  padding: 10px 16px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
}

.copy-link-box button:hover {
  background: var(--accent-hover);
}

/* ==================== Dice Display ==================== */

.dice-display {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  background: var(--glass-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--accent);
  border-radius: 12px;
  width: 100%;
}

.dice-icon {
  font-size: 28px;
}

.dice-info {
  flex: 1;
  font-size: 14px;
  color: var(--text-primary);
}

.dice-info span {
  font-weight: 700;
  color: var(--gold);
}

.btn-skip {
  padding: 6px 14px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}

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

.dice-card {
  background: var(--glass-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--accent);
}

/* ==================== Join Page ==================== */

.join-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: calc(100vh - 70px);
  width: 100%;
  padding: 20px;
}

.join-card {
  background: var(--bg-card);
  padding: 40px;
  border-radius: 16px;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  text-align: center;
}

.join-card h1 {
  color: var(--accent);
  font-size: 24px;
  margin-bottom: 16px;
}

.join-status {
  color: var(--text-secondary);
  font-size: 15px;
}

.join-error {
  color: var(--red);
  font-size: 15px;
  padding: 12px;
  background: rgba(239, 68, 68, 0.1);
  border-radius: 8px;
}

/* ==================== Replay Banner ==================== */

.replay-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: 432px;
  padding: 8px 16px;
  background: var(--glass-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--gold);
  border-radius: 8px;
  margin: 12px auto 0;
  font-size: 14px;
  color: var(--gold);
}

.replay-banner .win-text { color: var(--green); font-weight: 700; }
.replay-banner .lose-text { color: var(--red); font-weight: 700; }
.replay-banner .draw-text { color: var(--gold); font-weight: 700; }

/* ==================== Match History (Profile) ==================== */

.match-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--bg-input);
  border-radius: 8px;
  margin-bottom: 6px;
  text-decoration: none;
  transition: background 0.2s;
  cursor: pointer;
}

.match-row:hover {
  background: rgba(233, 69, 96, 0.08);
}

.match-result {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  min-width: 48px;
  text-align: center;
  text-transform: uppercase;
}

.match-win {
  background: rgba(74, 222, 128, 0.2);
  color: var(--green);
}

.match-loss {
  background: rgba(239, 68, 68, 0.2);
  color: var(--red);
}

.match-draw {
  background: rgba(251, 191, 36, 0.2);
  color: var(--gold);
}

.match-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.match-opponent {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.match-color {
  font-size: 12px;
  color: var(--text-secondary);
}

.match-date {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
}

/* ==================== Match Pagination ==================== */

.match-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
}

.page-btn {
  padding: 6px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-primary);
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.page-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.page-btn:disabled {
  opacity: 0.4;
  cursor: default;
}

.page-btn:disabled:hover {
  background: var(--bg-input);
  border-color: var(--border);
  color: var(--text-primary);
}

.page-info {
  font-size: 13px;
  color: var(--text-secondary);
}

/* Friend name as link */
.friend-name-link {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-primary);
  text-decoration: none;
  transition: color 0.2s;
}

.friend-name-link:hover {
  color: var(--accent);
}

/* ==================== Responsive ==================== */

@media (max-width: 500px) {
  .board-wrapper {
    width: 288px;
  }

  .chess-board {
    grid-template-columns: repeat(6, 48px);
    grid-template-rows: repeat(6, 48px);
  }

  .square {
    width: 48px;
    height: 48px;
    font-size: 32px;
  }

  .file-labels {
    width: 288px;
  }

  .board-header,
  .pocket-strip,
  .moves-strip {
    padding: 6px 10px;
  }

  .pocket-strip .pocket-piece {
    font-size: 22px;
    width: 28px;
    height: 28px;
  }

  .clock {
    font-size: 15px;
    min-width: 58px;
    padding: 4px 10px;
  }
}

@media (max-width: 360px) {
  .board-wrapper {
    width: 252px;
  }

  .chess-board {
    grid-template-columns: repeat(6, 42px);
    grid-template-rows: repeat(6, 42px);
  }

  .square {
    width: 42px;
    height: 42px;
    font-size: 26px;
  }

  .file-labels {
    width: 252px;
  }
}

/* ==================== Modern Game Page Redesign ==================== */

body.game-page {
  --page-bg: #090c10;
  --surface: rgba(18, 24, 34, 0.75);
  --surface2: rgba(26, 34, 48, 0.75);
  --surface3: rgba(33, 44, 62, 0.75);
  --border-subtle: rgba(255,255,255,0.05);
  --border-glass: rgba(255,255,255,0.07);
  --text-bright: #f0f3f7;
  --text-dim: #94a3b8;
  --text-muted: #64748b;
  --emerald: #10b981;
  --emerald-glow: rgba(16, 185, 129, 0.35);
  --gold-modern: #f59e0b;
  --red-soft: #f43f5e;
  --accent-purple: #8b5cf6;
  --accent-blue: #3b82f6;
  --accent-cyan: #06b6d4;
  --glass-surface: rgba(18, 24, 34, 0.75);
  --game-square-size: clamp(54px, 6.1vw, 82px);
  --board-frame-pad: 10px;

  display: block;
  align-items: initial;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 18% 12%, rgba(16, 185, 129, 0.07), transparent 28%),
    radial-gradient(circle at 82% 30%, rgba(124, 58, 237, 0.07), transparent 30%),
    var(--page-bg);
  color: var(--text-bright);
  font-family: var(--font-main);
}

.game-dashboard {
  display: grid;
  grid-template-columns: 180px 1fr;
  min-height: 100vh;
  width: 100%;
}

.game-page .sidebar {
  background: #111318;
  border-right: 1px solid rgba(255,255,255,0.05);
  padding: 20px 0;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 10;
}

.game-page .sidebar-logo {
  padding: 0 8px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  margin-bottom: 4px;
}

.game-page .sidebar-nav {
  flex: 1;
  padding: 0 6px;
  display: flex;
  flex-direction: column;
  gap: 0;
  justify-content: flex-start;
}

.game-page .sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 0 8px;
  border-radius: 8px;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.game-page .sidebar-nav a:hover {
  background: rgba(255,255,255,0.04);
  color: var(--text-bright);
}

.game-page .sidebar-nav a.active {
  background: rgba(63,185,80,0.12);
  color: var(--emerald);
  font-weight: 600;
}

.game-page .sidebar-nav a .nav-icon {
  font-size: 18px;
  width: 22px;
  text-align: center;
  opacity: 0.8;
}

.game-page .sidebar-footer {
  padding: 16px;
  border-top: 1px solid rgba(255,255,255,0.05);
}

.game-page .sidebar-footer .user-mini {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.game-page .sidebar-footer .user-avatar,
.game-page .sidebar-footer .user-avatar-img {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  flex-shrink: 0;
}

.game-page .sidebar-footer .user-avatar {
  background: var(--emerald);
  color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  overflow: hidden;
}

.game-page .sidebar-footer .user-avatar-img {
  object-fit: cover;
}

.game-page .sidebar-footer .user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-bright);
  max-width: 96px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.game-page .sidebar-footer .user-elo-sm {
  font-size: 11px;
  color: var(--gold-modern);
  font-weight: 600;
}

.game-page .sidebar-footer .sidebar-stats {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}

.game-page .sidebar-footer .sidebar-stat {
  flex: 1;
  background: var(--surface2);
  border-radius: 6px;
  padding: 5px 4px;
  text-align: center;
}

.game-page .sidebar-footer .sidebar-stat .sb-val {
  font-size: 14px;
  font-weight: 700;
}

.game-page .sidebar-footer .sidebar-stat .sb-lbl {
  font-size: 9px;
  color: var(--text-muted);
  text-transform: uppercase;
}

.game-page .sidebar-footer .sb-win .sb-val { color: var(--emerald); }
.game-page .sidebar-footer .sb-loss .sb-val { color: var(--red-soft); }
.game-page .sidebar-footer .sb-draw .sb-val { color: var(--text-dim); }

.game-page .logout-btn,
.game-actions button.secondary,
.game-page .btn-skip {
  border: 1px solid var(--border-glass);
  background: transparent;
  color: var(--text-dim);
  border-radius: 8px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.game-page .logout-btn {
  width: 100%;
  padding: 7px 12px;
}

.game-page .logout-btn:hover,
.game-actions button.secondary:hover,
.game-page .btn-skip:hover {
  border-color: var(--emerald);
  color: var(--emerald);
  background: rgba(63,185,80,0.08);
}

.game-actions button.danger-action:hover {
  border-color: var(--red-soft);
  color: var(--red-soft);
  background: rgba(248,81,73,0.08);
}

.game-main {
  padding: 28px 32px;
  overflow-y: auto;
  max-height: 100vh;
}

.game-main::-webkit-scrollbar { width: 6px; }
.game-main::-webkit-scrollbar-track { background: transparent; }
.game-main::-webkit-scrollbar-thumb { background: var(--border-glass); border-radius: 3px; }

.game-shell {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
}

.game-top-card,
.game-board-card,
.game-panel-card {
  background: var(--glass-surface);
  border: 1px solid var(--border-glass);
  border-radius: 16px;
  backdrop-filter: blur(12px);
  box-shadow: 0 18px 42px rgba(0,0,0,0.24);
}

.game-top-card {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 24px 28px;
  margin-bottom: 18px;
  overflow: hidden;
}

.game-top-card::before {
  content: '';
  position: absolute;
  inset: -40% auto auto -10%;
  width: 60%;
  height: 180%;
  background: radial-gradient(circle, rgba(63,185,80,0.08), transparent 60%);
  pointer-events: none;
}

.game-top-card > * {
  position: relative;
  z-index: 1;
}

.game-page .section-title,
.game-page .panel-eyebrow {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.3px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.game-top-card h1 {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.6px;
  color: var(--text-bright);
  margin-bottom: 4px;
}

.game-top-card p,
.game-panel-card p {
  color: var(--text-dim);
  font-size: 14px;
  line-height: 1.55;
}

.game-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.game-actions button.secondary {
  padding: 10px 18px;
  border-radius: 10px;
}

.game-layout {
  display: grid;
  grid-template-columns: minmax(0, auto) minmax(260px, 320px);
  justify-content: center;
  align-items: start;
  gap: 18px;
}

.game-board-card {
  padding: 18px;
  overflow: hidden;
}

.game-page .board-wrapper {
  width: calc((var(--game-square-size) * 6) + (var(--board-frame-pad) * 2));
  gap: 8px;
}

.game-page .board-header,
.game-page .pocket-strip,
.game-page .dice-display {
  width: 100%;
  background: rgba(31,34,41,0.82);
  border: 1px solid var(--border-glass);
  border-radius: 14px;
  backdrop-filter: blur(12px);
  box-shadow: none;
}

.game-page .board-header {
  padding: 10px 12px;
  min-height: 60px;
}

.game-page .board-header .player-info {
  min-width: 0;
  gap: 10px;
}

.game-page .player-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.game-page .board-header .player-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-bright);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 180px;
}

.game-page .board-header .player-elo {
  font-family: var(--font-mono);
  color: var(--gold-modern);
  font-size: 12px;
  font-weight: 700;
}

.game-page .board-header .player-color {
  width: 11px;
  height: 11px;
  box-shadow: 0 0 0 3px rgba(255,255,255,0.04);
}

.game-page .board-header .player-color.white { background: #f8fafc; border: 1px solid rgba(0,0,0,0.35); }
.game-page .board-header .player-color.black { background: #020617; border: 1px solid rgba(255,255,255,0.22); }

.game-page .board-avatar,
.game-page .board-avatar-placeholder {
  width: 34px;
  height: 34px;
  border: 2px solid rgba(63,185,80,0.55);
}

.game-page .board-avatar-placeholder {
  background: linear-gradient(135deg, var(--emerald), var(--accent-cyan));
  color: #06130a;
}

.game-page .player-state {
  display: flex;
  align-items: center;
  gap: 8px;
}

.game-page .clock {
  min-width: 80px;
  padding: 8px 14px;
  background: #090c10;
  border: 1px solid var(--border-glass);
  border-radius: 10px;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-align: center;
  opacity: 0.6;
  transition: all 0.25s var(--ease-spring);
}

.game-page .clock.active-clock {
  opacity: 1;
  border-color: var(--emerald);
  color: #fff;
  box-shadow: 0 0 16px var(--emerald-glow), inset 0 0 12px rgba(16, 185, 129, 0.12);
}

.game-page .clock.low-time {
  color: var(--red-soft);
  border-color: var(--red-soft);
  box-shadow: 0 0 16px rgba(244, 63, 94, 0.4);
}

.game-page .board-header .turn-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-glass);
  color: var(--text-dim);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.game-page .board-header .turn-indicator.active {
  background: var(--emerald-subtle);
  border-color: var(--emerald-border);
  color: var(--emerald);
  box-shadow: 0 0 12px var(--emerald-glow);
}

.game-page .pocket-strip {
  min-height: 56px;
  padding: 8px 14px;
  gap: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.game-page .pocket-strip-header {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.game-page .pocket-strip-label,
.game-page .moves-strip-label {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.game-page .your-pocket {
  border-color: rgba(16, 185, 129, 0.35);
}

.game-page .your-pocket .pocket-strip-label {
  color: var(--emerald);
}

.game-page .opponent-pocket {
  border-color: rgba(255,255,255,0.08);
}

.game-page .pocket-slots-grid,
.game-page .pocket-strip-pieces {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex: 1;
}

.game-page .pocket-slot,
.pocket-slot {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s var(--ease-spring);
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.game-page .pocket-slot.empty-slot,
.pocket-slot.empty-slot {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  cursor: default;
}

.game-page .pocket-slot.empty-slot .pocket-piece-visual img,
.game-page .pocket-slot.empty-slot .pocket-piece-visual.silhouette img,
.pocket-slot.empty-slot .pocket-piece-visual img,
.pocket-slot.empty-slot .pocket-piece-visual.silhouette img {
  filter: brightness(0) invert(1);
  opacity: 0.4;
  color: rgba(255, 255, 255, 0.4);
  transform: scale(0.9);
}

.game-page .pocket-slot.has-pieces,
.pocket-slot.has-pieces {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid var(--emerald);
  box-shadow: 0 0 14px var(--emerald-glow), inset 0 0 8px rgba(16, 185, 129, 0.15);
  cursor: pointer;
}

.game-page .pocket-slot.has-pieces:hover,
.pocket-slot.has-pieces:hover {
  transform: translateY(-2px);
  border-color: var(--emerald-hover);
  box-shadow: 0 0 18px var(--emerald-glow), 0 6px 14px rgba(0, 0, 0, 0.4);
}

.game-page .pocket-slot.has-pieces .pocket-piece-visual img,
.pocket-slot.has-pieces .pocket-piece-visual img {
  opacity: 1;
  color: #ffffff;
  filter: brightness(0) invert(1) drop-shadow(0 0 3px rgba(255, 255, 255, 0.5));
  transition: transform 0.15s ease;
}

.game-page .pocket-slot.has-pieces:hover .pocket-piece-visual img,
.pocket-slot.has-pieces:hover .pocket-piece-visual img {
  transform: scale(1.1);
}

.game-page .pocket-slot.selected-drop,
.pocket-slot.selected-drop {
  background: rgba(16, 185, 129, 0.2) !important;
  border: 2px solid var(--emerald) !important;
  box-shadow: 0 0 20px var(--emerald-glow), inset 0 0 10px rgba(16, 185, 129, 0.25) !important;
  transform: translateY(-2px) scale(1.06);
  animation: slotPulse 1.6s infinite alternate ease-in-out;
}

@keyframes slotPulse {
  0% { box-shadow: 0 0 12px rgba(16, 185, 129, 0.35); }
  100% { box-shadow: 0 0 24px rgba(16, 185, 129, 0.7); }
}

.game-page .pocket-count-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  background: var(--emerald);
  color: #041009;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5), 0 0 8px var(--emerald-glow);
  letter-spacing: -0.3px;
  pointer-events: none;
  z-index: 2;
  line-height: 1.3;
}

.game-page .opponent-slot .pocket-count-badge {
  background: #334155;
  color: #f8fafc;
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.game-page .pocket-piece-visual {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.game-page .pocket-piece-visual img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.game-page .dice-display {
  padding: 10px 12px;
  border-color: rgba(6,182,212,0.35);
  background: rgba(6,182,212,0.08);
}

.game-page .dice-icon {
  font-size: 24px;
}

.game-page .dice-info {
  color: var(--text-bright);
  font-size: 13px;
}

.game-page .dice-info span {
  color: var(--accent-cyan);
}

.game-page .btn-skip {
  padding: 7px 12px;
  border-radius: 8px;
}

.game-page .board-frame {
  width: 100%;
  padding: var(--board-frame-pad);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.08), rgba(255,255,255,0.02)),
    #0b0f14;
  border: 1px solid rgba(255,255,255,0.09);
  box-shadow: 0 22px 50px rgba(0,0,0,0.38);
}

.game-page .chess-board {
  grid-template-columns: repeat(6, var(--game-square-size));
  grid-template-rows: repeat(6, var(--game-square-size));
  position: relative;
  border: 0;
  border-radius: 12px;
  box-shadow: none;
  width: calc(var(--game-square-size) * 6);
  height: calc(var(--game-square-size) * 6);
}

.game-page .square {
  width: var(--game-square-size);
  height: var(--game-square-size);
  font-size: calc(var(--game-square-size) * 0.65);
  transition: filter 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.game-page .square.light { background: var(--square-light); }
.game-page .square.dark { background: var(--square-dark); }

.game-page .square:hover {
  filter: brightness(1.08);
}

.game-page .square.selected {
  background: rgba(16, 185, 129, 0.25) !important;
  box-shadow: inset 0 0 0 2px var(--emerald), 0 0 14px rgba(16, 185, 129, 0.35) !important;
}

.game-page .square.last-move {
  background: rgba(16, 185, 129, 0.25) !important;
  box-shadow: inset 0 0 0 1px rgba(16, 185, 129, 0.55) !important;
}

.game-page .square.possible-move::after {
  width: 20px;
  height: 20px;
  background: rgba(6,182,212,0.75);
  border-color: rgba(103,232,249,0.92);
}

.game-page .square.possible-capture::after {
  border-color: rgba(248,81,73,0.9);
}

.game-page .square.drag-over {
  box-shadow: inset 0 0 0 4px var(--emerald);
}

.game-controls-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  width: 100%;
  margin-top: 10px;
}

.game-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(18, 24, 34, 0.85);
  border: 1px solid var(--border-glass);
  color: var(--text-bright);
  font-family: var(--font-main);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s var(--ease-spring);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.game-action-btn:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.game-action-btn.draw-btn:hover {
  border-color: var(--gold);
  color: var(--gold);
  box-shadow: 0 8px 20px var(--gold-glow);
}

.game-action-btn.resign-btn.danger-action:hover {
  border-color: var(--red-soft);
  color: var(--red-soft);
  box-shadow: 0 8px 20px rgba(244, 63, 94, 0.3);
}

.game-action-btn.leave-btn:hover {
  border-color: var(--text-dim);
  color: #fff;
}

.game-action-btn svg,
.game-action-btn .lucide {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.game-page .file-labels {
  width: calc(var(--game-square-size) * 6);
  margin-top: 0;
  padding: 0 10px;
}

.game-page .file-label {
  font-family: var(--font-mono);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
}

.game-side-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.game-panel-card {
  padding: 20px;
}

.game-panel-card h2 {
  margin-bottom: 8px;
  color: var(--text-bright);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.3px;
}

.game-page .moves-strip {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  width: 100%;
  min-height: 360px;
}

.game-page .move-history {
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  gap: 6px;
  max-height: 480px;
  overflow-y: auto;
  color: var(--text-dim);
  font-size: 13px;
  padding-right: 4px;
}

.game-page .move-history::-webkit-scrollbar { width: 5px; }
.game-page .move-history::-webkit-scrollbar-thumb { background: var(--border-glass); border-radius: 3px; }

.game-page .move-history .move-pair {
  display: grid;
  grid-template-columns: 34px 1fr 1fr;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: rgba(13,17,23,0.42);
  border: 1px solid rgba(255,255,255,0.04);
  border-radius: 10px;
}

.game-page .move-history .move-num {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
}

.game-page .move-history .move-white,
.game-page .move-history .move-black {
  color: var(--text-bright);
  font-weight: 600;
}

.game-page .move-history .move-white.active-move,
.game-page .move-history .move-black.active-move {
  color: var(--emerald) !important;
  background: rgba(16, 185, 129, 0.18);
  border-radius: 4px;
  padding: 1px 4px;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.35);
}

.game-page .move-history .move-black {
  color: var(--text-dim);
}

.game-page .moves-placeholder {
  color: var(--text-muted);
  font-size: 13px;
}

.game-page .replay-banner {
  max-width: none;
  width: 100%;
  margin: 0 0 14px;
  padding: 12px 16px;
  border-radius: 14px;
  background: rgba(210,153,29,0.08);
  border-color: rgba(210,153,29,0.32);
  color: var(--gold-modern);
  font-weight: 700;
}

.game-page .replay-banner .win-text { color: var(--emerald); }
.game-page .replay-banner .lose-text { color: var(--red-soft); }
.game-page .replay-banner .draw-text { color: var(--gold-modern); }

.game-page .promotion-dialog {
  background: var(--glass-surface);
  border: 1px solid var(--border-glass);
  border-radius: 16px;
  box-shadow: 0 18px 60px rgba(0,0,0,0.55);
}

.game-page .promotion-dialog .promo-option {
  background: var(--surface2);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
}

.game-page .promotion-dialog .promo-option:hover {
  background: rgba(63,185,80,0.16);
  border-color: var(--emerald);
}

.game-page .game-over-overlay {
  background: rgba(4, 7, 12, 0.76);
  backdrop-filter: blur(8px);
}

.game-page .game-over-card {
  background: var(--glass-surface);
  border: 1px solid var(--border-glass);
  border-radius: 18px;
  min-width: min(360px, calc(100vw - 32px));
}

.game-page .game-over-card .win-text { color: var(--emerald); }
.game-page .game-over-card .lose-text { color: var(--red-soft); }
.game-page .game-over-card .draw-text { color: var(--gold-modern); }

.go-players {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  margin: 24px 0;
}

.go-player {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 100px;
}

.go-avatar, .go-avatar-placeholder {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.1);
  object-fit: cover;
  flex-shrink: 0;
}

.go-avatar-placeholder {
  background: linear-gradient(135deg, var(--emerald), var(--accent-cyan));
  color: #06130a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 700;
}

.go-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-bright);
}

.go-elo {
  font-size: 13px;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 6px;
}

.go-elo-diff {
  font-weight: 700;
}
.go-elo-diff.positive { color: var(--emerald); }
.go-elo-diff.negative { color: var(--red-soft); }
.go-elo-diff.neutral { color: var(--text-muted); }

.go-vs {
  font-size: 18px;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.2);
  text-transform: uppercase;
}

.game-page .game-over-card button.go-back-btn {
  background: var(--emerald);
  color: #000;
  border: none;
  border-radius: 10px;
  font-weight: 700;
  transition: all 0.2s ease;
}

.game-page .game-over-card button:hover {
  background: var(--emerald);
  box-shadow: 0 6px 20px var(--emerald-glow);
  transform: translateY(-1px);
}

.game-page .toast {
  top: 24px;
  right: 24px;
  border-radius: 12px;
  font-family: var(--font-main);
  font-weight: 500;
  backdrop-filter: blur(12px);
}

.game-page .toast.info { background: rgba(59,130,246,0.9); border: 0; }
.game-page .toast.success { background: rgba(34,197,94,0.9); color: #000; }
.game-page .toast.error { background: rgba(248,81,73,0.9); }

/* Bot Hint Highlight */
.game-page .square.hint-source {
  background: rgba(16, 185, 129, 0.35) !important;
  box-shadow: inset 0 0 0 3px #10b981, 0 0 16px rgba(16, 185, 129, 0.6) !important;
  animation: pulse-hint 1.4s infinite ease-in-out;
}
.game-page .square.hint-target {
  background: rgba(6, 182, 212, 0.35) !important;
  box-shadow: inset 0 0 0 3px #06b6d4, 0 0 18px rgba(6, 182, 212, 0.6) !important;
  animation: pulse-hint 1.4s infinite ease-in-out;
}
@keyframes pulse-hint {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.82; transform: scale(0.98); }
}
.pocket-piece.hint-pocket {
  box-shadow: 0 0 0 3px #06b6d4, 0 0 14px rgba(6, 182, 212, 0.5) !important;
  animation: pulse-hint 1.4s infinite ease-in-out;
}

/* Post-Game Review Mode Banner */
.review-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 12px;
  margin-bottom: 16px;
  backdrop-filter: blur(8px);
}
.review-banner-left {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 14px;
  color: var(--emerald);
}
.review-banner-actions {
  display: flex;
  gap: 8px;
}
.review-banner-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-bright);
  transition: all 0.2s ease;
}
.review-banner-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
}

/* Game Over Card Actions Row */
.go-actions-row {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  width: 100%;
}
.go-actions-row button {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-bright);
  transition: all 0.2s ease;
}
.go-actions-row button:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--emerald);
  color: var(--emerald);
}
.replay-actions-row {
  margin-top: 10px;
  width: 100%;
}
.replay-action-btn {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}
.replay-action-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--emerald);
  color: var(--emerald);
}

@media (max-width: 1100px) {
  body.game-page {
    --game-square-size: clamp(50px, 7.6vw, 74px);
  }

  .game-layout {
    grid-template-columns: 1fr;
  }

  .game-board-card {
    justify-self: center;
  }

  .game-side-panel {
    width: min(100%, 620px);
    justify-self: center;
  }

  .game-page .moves-strip {
    min-height: 0;
  }

  .game-page .move-history {
    max-height: 180px;
  }
}

@media (max-width: 900px) {
  .game-dashboard {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }

  .game-page .sidebar {
    position: static;
    height: auto;
    flex-direction: row;
    padding: 12px;
    border-right: none;
    border-bottom: 1px solid var(--border-subtle);
  }

  .game-page .sidebar-logo {
    display: none;
  }

  .game-page .sidebar-nav {
    flex-direction: row;
    flex-wrap: wrap;
    padding: 0;
  }

  .game-page .sidebar-footer {
    display: none;
  }

  .game-main {
    padding: 20px 16px 28px;
    max-height: none;
  }
}

@media (max-width: 680px) {
  body.game-page {
    --game-square-size: min(14.2vw, 58px);
    --board-frame-pad: 7px;
  }

  .game-top-card {
    flex-direction: column;
    align-items: flex-start;
    padding: 20px;
  }

  .game-actions {
    justify-content: flex-start;
    width: 100%;
  }

  .game-actions button.secondary {
    flex: 1;
    min-width: 92px;
  }

  .game-board-card {
    width: 100%;
    padding: 12px;
  }

  .game-page .board-wrapper {
    width: calc((var(--game-square-size) * 6) + (var(--board-frame-pad) * 2));
    max-width: 100%;
  }

  .game-page .board-frame {
    border-radius: 14px;
  }

  .game-page .board-header {
    align-items: flex-start;
    gap: 10px;
  }

  .game-page .player-state {
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
  }

  .game-page .clock {
    min-width: 66px;
    font-size: 15px;
    padding: 6px 9px;
  }

  .game-page .board-header .turn-indicator {
    font-size: 11px;
    padding: 5px 8px;
  }

  .game-page .board-header .player-name {
    max-width: 118px;
  }

  .game-page .pocket-strip {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .game-page .pocket-strip-pieces {
    width: 100%;
  }

  .game-page .dice-display {
    flex-wrap: wrap;
  }

  .game-panel-card {
    padding: 16px;
  }
}

@media (max-width: 380px) {
  body.game-page {
    --game-square-size: min(13.6vw, 50px);
  }

  .game-page .board-avatar,
  .game-page .board-avatar-placeholder {
    width: 30px;
    height: 30px;
  }

  .game-page .pocket-strip .pocket-piece {
    width: 30px;
    height: 30px;
  }
}

/* ==================== Modern Bento Grid & Dashboard Architecture ==================== */

/* Universal Lucide alignment */
.lucide, [data-lucide] {
  width: 1.15em;
  height: 1.15em;
  vertical-align: -0.18em;
  display: inline-block;
  stroke-width: 2;
}

/* Card, button, and tab smooth transitions */
.bot-card, .tab-btn, .btn-play, .btn-play-dice, .btn-create-room,
.bento-card, .mode-card, .feed-card, .multiplayer-zone, .friends-zone,
.game-action-btn, .pocket-slot, .logout-btn, .filter-btn {
  transition: all 0.2s var(--ease-spring);
}

/* Bento Mode Selection Cards */
.mode-bento-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  background: transparent;
  padding: 0;
  border: none;
  margin-bottom: 24px;
}

.mode-card.tab-btn {
  background: rgba(18, 24, 34, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 16px;
  padding: 20px;
  text-align: left;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.25);
  transition: all 0.25s var(--ease-spring);
}

#tab-btn-multiplayer {
  background: radial-gradient(circle at 85% 15%, rgba(16, 185, 129, 0.14) 0%, rgba(18, 24, 34, 0.85) 70%);
}
#tab-btn-computer {
  background: radial-gradient(circle at 85% 15%, rgba(139, 92, 246, 0.14) 0%, rgba(18, 24, 34, 0.85) 70%);
}
#tab-btn-friend {
  background: radial-gradient(circle at 85% 15%, rgba(59, 130, 246, 0.14) 0%, rgba(18, 24, 34, 0.85) 70%);
}

.mode-card.tab-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: transparent;
  transition: background 0.2s ease;
}

#tab-btn-multiplayer:hover {
  transform: translateY(-3px);
  border-color: rgba(16, 185, 129, 0.45);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.4), 0 0 20px rgba(16, 185, 129, 0.2);
}
#tab-btn-computer:hover {
  transform: translateY(-3px);
  border-color: rgba(139, 92, 246, 0.45);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.4), 0 0 20px rgba(139, 92, 246, 0.2);
}
#tab-btn-friend:hover {
  transform: translateY(-3px);
  border-color: rgba(59, 130, 246, 0.45);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.4), 0 0 20px rgba(59, 130, 246, 0.2);
}

#tab-btn-multiplayer.active {
  border-color: #10b981;
  background: radial-gradient(circle at 85% 15%, rgba(16, 185, 129, 0.22) 0%, rgba(18, 24, 34, 0.95) 70%);
  box-shadow: 0 0 0 1px #10b981, 0 14px 36px rgba(0, 0, 0, 0.45), 0 0 24px rgba(16, 185, 129, 0.35);
}
#tab-btn-multiplayer.active::before {
  background: linear-gradient(90deg, #10b981, #06b6d4);
}
#tab-btn-multiplayer.active .mode-pill-badge {
  background: rgba(16, 185, 129, 0.18);
  color: #10b981;
  border-color: rgba(16, 185, 129, 0.4);
}

#tab-btn-computer.active {
  border-color: #8b5cf6;
  background: radial-gradient(circle at 85% 15%, rgba(139, 92, 246, 0.22) 0%, rgba(18, 24, 34, 0.95) 70%);
  box-shadow: 0 0 0 1px #8b5cf6, 0 14px 36px rgba(0, 0, 0, 0.45), 0 0 24px rgba(139, 92, 246, 0.35);
}
#tab-btn-computer.active::before {
  background: linear-gradient(90deg, #8b5cf6, #c084fc);
}
#tab-btn-computer.active .mode-pill-badge {
  background: rgba(139, 92, 246, 0.18);
  color: #a78bfa;
  border-color: rgba(139, 92, 246, 0.4);
}

#tab-btn-friend.active {
  border-color: #3b82f6;
  background: radial-gradient(circle at 85% 15%, rgba(59, 130, 246, 0.22) 0%, rgba(18, 24, 34, 0.95) 70%);
  box-shadow: 0 0 0 1px #3b82f6, 0 14px 36px rgba(0, 0, 0, 0.45), 0 0 24px rgba(59, 130, 246, 0.35);
}
#tab-btn-friend.active::before {
  background: linear-gradient(90deg, #3b82f6, #38bdf8);
}
#tab-btn-friend.active .mode-pill-badge {
  background: rgba(59, 130, 246, 0.18);
  color: #60a5fa;
  border-color: rgba(59, 130, 246, 0.4);
}

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

.mode-icon-box {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
}

.mode-icon-box .lucide {
  width: 22px;
  height: 22px;
}

.mode-card.tab-btn:hover .mode-icon-box {
  transform: scale(1.08);
}

.mode-icon-box.glow-emerald {
  background: rgba(16, 185, 129, 0.14);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.2);
}

.mode-icon-box.glow-purple {
  background: rgba(139, 92, 246, 0.14);
  color: #a78bfa;
  border: 1px solid rgba(139, 92, 246, 0.3);
  box-shadow: 0 0 14px rgba(139, 92, 246, 0.2);
}

.mode-icon-box.glow-blue {
  background: rgba(59, 130, 246, 0.14);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
  box-shadow: 0 0 14px rgba(59, 130, 246, 0.2);
}

.mode-pill-badge {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-dim);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.mode-card.tab-btn.active .mode-pill-badge {
  background: rgba(16, 185, 129, 0.15);
  color: var(--emerald);
  border-color: rgba(16, 185, 129, 0.3);
}

.mode-card-title {
  font-size: 17px;
  font-weight: 800;
  color: var(--text-bright);
  letter-spacing: -0.3px;
}

.mode-card-desc {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.45;
  font-weight: 400;
}

/* Bento Bottom Grid Modules */
.lobby-bottom-bento {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 24px;
  width: 100%;
}

.bento-card {
  background: rgba(18, 24, 34, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 16px;
  padding: 24px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.bento-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 14px;
}

.bento-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.bento-icon-wrapper {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(16, 185, 129, 0.12);
  color: var(--emerald);
  border: 1px solid rgba(16, 185, 129, 0.25);
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.15);
}

.bento-icon-wrapper .lucide {
  width: 20px;
  height: 20px;
}

.bento-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-bright);
  letter-spacing: -0.3px;
}

.bento-subtitle {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 2px;
}

.bento-action-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--emerald);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 8px;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.2);
  transition: all 0.2s ease;
}

.bento-action-link:hover {
  background: rgba(16, 185, 129, 0.18);
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.25);
  transform: translateX(2px);
}

/* Battlepass Progress Bar in Bento */
.bp-progress-wrapper {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 16px;
  background: rgba(13, 17, 23, 0.55);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.bp-progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
}

.bp-xp-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  color: var(--text-bright);
}

.bp-xp-label .lucide {
  color: var(--gold);
  width: 14px;
  height: 14px;
}

.bp-xp-count {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--gold);
}

.progress-bar-track {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  position: relative;
}

.progress-bar-track.small {
  height: 5px;
  width: 100px;
}

.progress-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--emerald) 0%, #06b6d4 100%);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
  transition: width 0.4s var(--ease-spring);
}

/* Quests List */
.quests-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.quest-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 10px;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.quest-item:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
}

.quest-item.completed {
  background: rgba(16, 185, 129, 0.04);
  border-color: rgba(16, 185, 129, 0.15);
}

.quest-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.quest-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-bright);
}

.quest-desc {
  font-size: 12px;
  color: var(--text-dim);
}

.quest-progress-col {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
}

.quest-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
}

.quest-count {
  font-family: var(--font-mono);
  color: var(--text-muted);
  font-weight: 600;
}

.quest-count.completed-badge {
  color: var(--emerald);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.quest-xp {
  font-family: var(--font-mono);
  font-weight: 800;
  color: var(--emerald);
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(16, 185, 129, 0.1);
}

/* Mini Leaderboard Table */
.mini-lb-table-wrapper {
  overflow-x: auto;
}

.mini-lb-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.mini-lb-table th {
  text-align: left;
  padding: 8px 10px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.mini-lb-table td {
  padding: 10px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  color: var(--text-bright);
  vertical-align: middle;
}

.mini-lb-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.mini-lb-rank,
.mini-lb-table .lb-rank {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-dim);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.mini-lb-rank.rank-1,
.mini-lb-table .lb-rank.rank-1 {
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.14);
  border: 1px solid rgba(251, 191, 36, 0.35);
  box-shadow: 0 0 10px rgba(251, 191, 36, 0.2);
}

.mini-lb-rank.rank-2,
.mini-lb-table .lb-rank.rank-2 {
  color: #cbd5e1;
  background: rgba(203, 213, 225, 0.14);
  border: 1px solid rgba(203, 213, 225, 0.3);
  box-shadow: 0 0 8px rgba(203, 213, 225, 0.15);
}

.mini-lb-rank.rank-3,
.mini-lb-table .lb-rank.rank-3 {
  color: #d97706;
  background: rgba(217, 119, 6, 0.14);
  border: 1px solid rgba(217, 119, 6, 0.3);
  box-shadow: 0 0 8px rgba(217, 119, 6, 0.15);
}

.mini-lb-player,
.mini-lb-table .lb-user {
  font-weight: 700;
  color: var(--text-bright);
}

.mini-lb-table .lb-user-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mini-lb-record,
.mini-lb-table .lb-record {
  font-size: 12px;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

.mini-lb-elo,
.mini-lb-table .lb-rating {
  font-family: var(--font-mono);
  font-weight: 800;
  color: var(--gold);
}

.lb-loading, .lb-empty {
  text-align: center;
  color: var(--text-dim);
  padding: 20px 0;
  font-size: 13px;
}

/* ==================== Universal Modern Transitions & Hover Lift ==================== */
button,
.btn,
.btn-primary,
.btn-secondary,
.btn-play,
.btn-play-dice,
.btn-create-room,
.btn-skip,
.game-action-btn,
.filter-btn,
.bot-play-btn,
.rejoin-link,
.logout-btn,
.go-back-btn,
.replay-nav-btn,
.action-btn,
.tab-btn,
.subtab-btn,
.mode-card,
.card,
.panel-card,
.dashboard-card,
.game-panel-card,
.bento-card,
.quests-card,
.mini-leaderboard-card,
.rejoin-card,
.bot-card,
.feed-card,
.lobby-card,
.auth-card,
.match-card,
.activity-card,
.shop-card,
.tier-card,
.profile-card,
.quest-item {
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

button:hover:not(:disabled),
.btn:hover:not(:disabled),
.btn-primary:hover:not(:disabled),
.btn-secondary:hover:not(:disabled),
.btn-play:hover,
.btn-play-dice:hover,
.btn-create-room:hover,
.game-action-btn:hover,
.filter-btn:hover,
.bot-play-btn:hover,
.rejoin-link:hover,
.logout-btn:hover,
.go-back-btn:hover,
.replay-nav-btn:hover,
.action-btn:hover,
.tab-btn:hover,
.mode-card:hover,
.bot-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px var(--emerald-glow);
}

.bento-card:hover,
.quests-card:hover,
.mini-leaderboard-card:hover,
.feed-card:hover,
.game-panel-card:hover,
.match-card:hover,
.tier-card:hover,
.quest-item:hover {
  border-color: rgba(16, 185, 129, 0.25);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35), 0 0 12px rgba(16, 185, 129, 0.12);
}

/* Coordinates, Clocks, ELOs, and Statistics Numbers strictly restricted to JetBrains Mono */
.rank-labels, .file-labels, .rank-label, .file-label, .game-page .file-label {
  font-family: var(--font-mono) !important;
  font-variant-numeric: tabular-nums;
}

.clock, .timer, #playerClock, #opponentClock,
.player-elo, .user-elo, .sidebar-stat .sb-val, .hero-stats-badge .badge-value, 
.bot-elo, .bot-depth, .mini-lb-elo, .lb-rating, .lb-elo, .user-info .elo,
.sb-val, .st-val, #profileElo, #heroElo, .user-elo-sm,
.bp-xp-count, .quest-count, .quest-xp, .mini-lb-rank, .lb-record, .mini-lb-record {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

/* 5x2 Bot Grid & Selected Bot Card */
.bot-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}

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

.bot-card.selected {
  border-color: #8b5cf6 !important;
  box-shadow: 0 0 0 1px #8b5cf6, 0 8px 24px rgba(139, 92, 246, 0.35) !important;
}

/* Match History Left Border Indicators */
.match-row-win,
.match-row:has(.match-win) {
  border-left: 3px solid #10b981 !important;
}

.match-row-loss,
.match-row:has(.match-loss) {
  border-left: 3px solid #ef4444 !important;
}

.match-row-draw,
.match-row:has(.match-draw) {
  border-left: 3px solid #64748b !important;
}

/* Multiplayer Features Badges & Tip Strip */
.mp-features-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 18px;
}

.mp-feature-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  transition: all 0.2s ease;
}

.mp-feature-badge:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(16, 185, 129, 0.3);
  transform: translateY(-2px);
}

.mp-feat-icon {
  width: 18px;
  height: 18px;
  color: var(--emerald);
  flex-shrink: 0;
}

.mp-feat-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.mp-feat-val {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-bright);
  white-space: nowrap;
}

.mp-feat-lbl {
  font-size: 10px;
  color: var(--text-muted);
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.mp-tip-strip {
  margin-top: 14px;
  padding: 12px 14px;
  background: rgba(16, 185, 129, 0.06);
  border: 1px solid rgba(16, 185, 129, 0.18);
  border-radius: 10px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.mp-tip-icon {
  color: var(--emerald);
  flex-shrink: 0;
  margin-top: 2px;
}

.mp-tip-icon .lucide {
  width: 16px;
  height: 16px;
}

.mp-tip-content {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.45;
}

.mp-tip-content strong {
  color: var(--emerald);
  font-weight: 700;
}

@media (max-width: 1200px) {
  .lobby-bottom-bento {
    grid-template-columns: 1fr;
  }
}

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

@media (max-width: 800px) {
  .mode-bento-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   Competitive Rank Tier Badges
   ========================================================================== */
.rank-tier-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--tier-color, #94a3b8);
  color: var(--tier-color, #94a3b8);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.2px;
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.3), inset 0 0 10px rgba(255, 255, 255, 0.02);
  transition: all 0.2s ease;
  line-height: 1;
}
.rank-tier-badge.sm {
  padding: 2px 8px;
  font-size: 11px;
  gap: 4px;
}
.rank-tier-badge.md {
  padding: 4px 11px;
  font-size: 12px;
  gap: 6px;
}
.rank-tier-badge.lg {
  padding: 6px 14px;
  font-size: 13px;
  gap: 7px;
}
.rank-tier-badge:hover {
  box-shadow: 0 0 16px var(--tier-color);
  transform: translateY(-1px);
}
.rank-tier-badge .rank-badge-icon {
  width: 13px;
  height: 13px;
  stroke-width: 2.4;
  color: var(--tier-color);
  filter: drop-shadow(0 0 4px var(--tier-color));
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}
.rank-tier-badge.sm .rank-badge-icon {
  width: 11px;
  height: 11px;
}
.rank-tier-badge.md .rank-badge-icon {
  width: 14px;
  height: 14px;
}
.rank-tier-badge.lg .rank-badge-icon {
  width: 16px;
  height: 16px;
}
.rank-tier-badge .tier-sep {
  opacity: 0.45;
  margin: 0 2px;
}
.rank-tier-badge .tier-elo {
  font-family: 'JetBrains Mono', monospace;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
}

/* Tier specific classes */
.rank-tier-bronze { --tier-color: #cd7f32; }
.rank-tier-silver { --tier-color: #94a3b8; }
.rank-tier-gold { --tier-color: #fbbf24; }
.rank-tier-emerald { --tier-color: #10b981; }
.rank-tier-master { --tier-color: #a855f7; }

/* ==========================================================================
   Language Selector (i18n) & Guest Mode Styles
   ========================================================================== */

/* Top-right Language Toggle (index.html / register.html) */
.lang-toggle-top {
  position: fixed;
  top: 18px;
  right: 22px;
  z-index: 1000;
}

/* Compact Modern Language Switcher */
.lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(18, 24, 34, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 5px 10px;
  border-radius: 999px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  font-family: var(--font-main, 'Plus Jakarta Sans', sans-serif);
  user-select: none;
}

.lang-globe-icon {
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  opacity: 0.85;
}

.lang-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  cursor: pointer;
  padding: 3px 6px;
  border-radius: 6px;
  transition: all 0.2s ease;
  line-height: 1;
}

.lang-btn:hover {
  color: #f0f3f7;
}

.lang-btn.active {
  color: #10b981;
  font-weight: 800;
  text-shadow: 0 0 10px rgba(16, 185, 129, 0.65);
  background: rgba(16, 185, 129, 0.14);
}

.lang-sep {
  color: rgba(255, 255, 255, 0.15);
  font-size: 11px;
  font-weight: 400;
}

/* Sidebar Language Toggle Container */
.sidebar-lang-container {
  display: flex;
  justify-content: center;
  margin-bottom: 12px;
  padding: 0 8px;
}

.sidebar-lang-container .lang-toggle {
  width: 100%;
  justify-content: center;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.07);
}

/* Guest Badge */
.guest-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 7px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  border-radius: 5px;
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.38);
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.2);
  margin-left: 6px;
  vertical-align: middle;
  line-height: 1.2;
}

/* Auth Divider (— OR —) */
.auth-divider {
  display: flex;
  align-items: center;
  margin: 16px 0;
  width: 100%;
  text-align: center;
}

.auth-divider-line {
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
}

.auth-divider-text {
  padding: 0 12px;
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* Play as Guest Button */
.btn-guest {
  width: 100%;
  padding: 13px 20px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  color: #f0f3f7;
  font-family: var(--font-main, 'Plus Jakarta Sans', sans-serif);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.1px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.btn-guest:hover {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.4);
  color: #10b981;
  box-shadow: 0 4px 18px rgba(16, 185, 129, 0.2);
  transform: translateY(-1px);
}

.btn-guest .btn-guest-icon,
.btn-guest svg {
  width: 18px;
  height: 18px;
  stroke-width: 2.3;
  color: #10b981;
  filter: drop-shadow(0 0 6px rgba(16, 185, 129, 0.4));
}

/* Sidebar Footer Action Buttons */
.sidebar-footer-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
}

.guest-create-acc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 8px 12px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-radius: 8px;
  color: #10b981;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.15);
}

.guest-create-acc-btn:hover {
  background: #10b981;
  color: #06130a;
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.4);
  transform: translateY(-1px);
}

.guest-create-acc-btn svg {
  width: 14px;
  height: 14px;
}

/* Guest Prompt Modal Backdrop */
.guest-prompt-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: guestFadeIn 0.2s ease;
}

.guest-prompt-modal-backdrop.active {
  display: flex;
}

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

.guest-prompt-card {
  background: rgba(18, 24, 34, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  padding: 28px;
  max-width: 420px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 30px rgba(16, 185, 129, 0.15);
  animation: guestCardPop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes guestCardPop {
  from { transform: scale(0.92); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.guest-prompt-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.25);
}

.guest-prompt-title {
  font-size: 20px;
  font-weight: 800;
  color: #f0f3f7;
  margin-bottom: 10px;
}

.guest-prompt-desc {
  font-size: 14px;
  color: #94a3b8;
  line-height: 1.5;
  margin-bottom: 24px;
}

.guest-prompt-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.guest-prompt-btn-secondary {
  flex: 1;
  padding: 12px 18px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  color: #94a3b8;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.guest-prompt-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #f0f3f7;
}

.guest-prompt-btn-primary {
  flex: 1.3;
  padding: 12px 18px;
  background: #10b981;
  border: 1px solid #10b981;
  border-radius: 10px;
  color: #06130a;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(16, 185, 129, 0.4);
  transition: all 0.2s ease;
}

.guest-prompt-btn-primary:hover {
  background: #059669;
  box-shadow: 0 6px 24px rgba(16, 185, 129, 0.6);
  transform: translateY(-1px);
}

/* Guest-locked nav items and links */
body.is-guest #navBattlepass,
body.is-guest #navShop,
body.is-guest #navProfile,
body.is-guest a[href*="battlepass.html"],
body.is-guest a[href*="shop.html"],
body.is-guest a[href*="profile.html"],
.sidebar-nav a.guest-locked,
a.guest-locked,
[data-guest-locked="true"] {
  opacity: 0.55 !important;
  cursor: not-allowed !important;
  position: relative;
  transition: all 0.2s ease;
  user-select: none;
}

.sidebar-nav a.guest-locked:hover,
a.guest-locked:hover,
[data-guest-locked="true"]:hover {
  background: rgba(255, 255, 255, 0.03) !important;
  color: var(--text-dim) !important;
  opacity: 0.75 !important;
}

.sidebar-nav a.guest-locked .guest-lock-indicator,
a.guest-locked .guest-lock-indicator,
[data-guest-locked="true"] .guest-lock-indicator {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: #f59e0b;
  font-size: 11px;
}

.sidebar-nav a.guest-locked .guest-lock-indicator svg,
a.guest-locked .guest-lock-indicator svg,
[data-guest-locked="true"] .guest-lock-indicator svg {
  width: 13px;
  height: 13px;
  stroke: #f59e0b;
}

/* Guest restricted full-page card */
.guest-restricted-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 120px);
  padding: 40px 20px;
  width: 100%;
}

.guest-restricted-card {
  max-width: 520px;
  width: 100%;
  background: var(--surface, rgba(18, 24, 34, 0.85));
  border: 1px solid var(--border-glass, rgba(255, 255, 255, 0.08));
  border-radius: 20px;
  padding: 42px 32px;
  text-align: center;
  backdrop-filter: blur(16px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
}

.guest-restricted-icon {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 22px auto;
  color: #f59e0b;
}

.guest-restricted-icon svg {
  width: 32px;
  height: 32px;
  stroke: #f59e0b;
}

.guest-restricted-title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text-bright, #f0f3f7);
  letter-spacing: -0.3px;
}

.guest-restricted-desc {
  font-size: 14px;
  color: var(--text-dim, #94a3b8);
  line-height: 1.6;
  margin-bottom: 28px;
}

.guest-restricted-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.guest-restricted-btn-primary {
  padding: 10px 22px;
  background: var(--emerald, #10b981);
  color: #06130a;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.35);
  transition: all 0.2s ease;
}

.guest-restricted-btn-primary:hover {
  background: #059669;
  transform: translateY(-1px);
}

.guest-restricted-btn-accent {
  padding: 10px 22px;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #10b981;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.guest-restricted-btn-accent:hover {
  background: rgba(16, 185, 129, 0.25);
  transform: translateY(-1px);
}

.guest-restricted-btn-secondary {
  padding: 10px 20px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-bright, #f0f3f7);
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.guest-restricted-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.2);
}

/* ==================== Sound Toggle Buttons ==================== */
.sound-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: rgba(18, 24, 34, 0.85);
  border: 1px solid var(--border-glass, rgba(255, 255, 255, 0.08));
  color: var(--text-bright, #f0f3f7);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s var(--ease-spring, cubic-bezier(0.16, 1, 0.3, 1));
  backdrop-filter: blur(12px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.sound-toggle-btn:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.sound-toggle-btn.is-muted {
  color: var(--red-soft, #f43f5e);
  border-color: rgba(244, 63, 94, 0.35);
}

.sound-toggle-btn.is-muted:hover {
  border-color: var(--red-soft, #f43f5e);
  box-shadow: 0 8px 20px rgba(244, 63, 94, 0.3);
}

.sound-toggle-btn svg,
.sound-toggle-btn i {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* Lobby Top Bar */
.lobby-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 0 16px 0;
  margin-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.lobby-top-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted, #64748b);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.lobby-live-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--emerald, #10b981);
  box-shadow: 0 0 10px var(--emerald, #10b981);
}

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

.lobby-sound-btn {
  width: 38px;
  height: 38px;
  padding: 0;
}

.hero-welcome-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ==================== Modern Confirm Modal (Resign / Draw) ==================== */
.confirm-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 8, 14, 0.78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.confirm-modal-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

.confirm-modal-card {
  background: #111620;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 30px 26px 26px;
  max-width: 420px;
  width: 90%;
  text-align: center;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.05);
  transform: scale(0.92);
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.confirm-modal-overlay.visible .confirm-modal-card {
  transform: scale(1);
}

.confirm-modal-card::before {
  content: '';
  position: absolute;
  top: -50px;
  left: 50%;
  transform: translateX(-50%);
  width: 200px;
  height: 120px;
  background: radial-gradient(circle, rgba(244, 63, 94, 0.18) 0%, transparent 70%);
  pointer-events: none;
}

.confirm-modal-card.draw-card::before {
  background: radial-gradient(circle, rgba(245, 158, 11, 0.18) 0%, transparent 70%);
}

.confirm-modal-icon-wrap {
  width: 58px;
  height: 58px;
  border-radius: 16px;
  margin: 0 auto 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  position: relative;
  z-index: 1;
}

.confirm-modal-icon-wrap.danger-theme {
  background: rgba(244, 63, 94, 0.15);
  border: 1px solid rgba(244, 63, 94, 0.35);
  color: var(--red-soft, #f43f5e);
  box-shadow: 0 8px 24px rgba(244, 63, 94, 0.25);
}

.confirm-modal-icon-wrap.draw-theme {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: var(--gold, #f59e0b);
  box-shadow: 0 8px 24px rgba(245, 158, 11, 0.25);
}

.confirm-modal-icon-wrap svg {
  width: 28px;
  height: 28px;
}

.confirm-modal-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-bright, #f0f3f7);
  letter-spacing: -0.4px;
  margin-bottom: 10px;
  position: relative;
  z-index: 1;
}

.confirm-modal-desc {
  font-size: 14px;
  color: var(--text-dim, #94a3b8);
  line-height: 1.55;
  margin-bottom: 24px;
  position: relative;
  z-index: 1;
}

.confirm-modal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  position: relative;
  z-index: 1;
}

.confirm-modal-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s var(--ease-spring, cubic-bezier(0.16, 1, 0.3, 1));
  border: none;
}

.confirm-modal-btn.btn-cancel {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-bright, #f0f3f7);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.confirm-modal-btn.btn-cancel:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.confirm-modal-btn.btn-danger {
  background: linear-gradient(135deg, #f43f5e 0%, #be123c 100%);
  color: #ffffff;
  box-shadow: 0 4px 18px rgba(244, 63, 94, 0.4);
}

.confirm-modal-btn.btn-danger:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(244, 63, 94, 0.55);
}

.confirm-modal-btn.btn-primary {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  box-shadow: 0 4px 18px rgba(16, 185, 129, 0.4);
}

.confirm-modal-btn.btn-primary:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(16, 185, 129, 0.55);
}

.confirm-modal-btn svg {
  width: 16px;
  height: 16px;
}

/* ==================== Daily Quests Claim Button ==================== */
.quest-claim-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  padding: 5px 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(16, 185, 129, 0.35);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  animation: quest-pulse-glow 2s infinite;
}

.quest-claim-btn:hover {
  transform: translateY(-1px) scale(1.04);
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.55);
  filter: brightness(1.1);
}

.quest-claim-btn:active {
  transform: translateY(0) scale(0.98);
}

.quest-claim-btn svg {
  width: 13px;
  height: 13px;
}

@keyframes quest-pulse-glow {
  0%, 100% { box-shadow: 0 2px 10px rgba(16, 185, 129, 0.35); }
  50% { box-shadow: 0 2px 18px rgba(16, 185, 129, 0.65); }
}

.quest-item.completed.claimed {
  opacity: 0.82;
}

/* ==================== Spectator Mode Styles ==================== */
.spectator-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px;
  margin-bottom: 16px;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: 12px;
  backdrop-filter: blur(8px);
  color: #fca5a5;
  box-shadow: 0 4px 20px rgba(239, 68, 68, 0.15);
}

.spectator-banner-left {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: #f87171;
}

.live-pulse-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #ef4444;
  box-shadow: 0 0 10px #ef4444;
  animation: pulseLive 1.5s infinite;
}

@keyframes pulseLive {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
  70% { transform: scale(1.15); box-shadow: 0 0 0 7px rgba(239, 68, 68, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.spectator-count-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
}
.spectator-count-pill svg {
  width: 14px;
  height: 14px;
  stroke: #ef4444;
}

/* ==================== Volume Slider Popover ==================== */
.sound-control-group {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.sound-slider-popover {
  display: none;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(18, 24, 34, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 8px 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 1000;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.sound-control-group:hover .sound-slider-popover,
.sound-control-group:focus-within .sound-slider-popover,
.sound-control-group.show-popover .sound-slider-popover {
  display: flex;
}

.sound-slider-popover::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: rgba(18, 24, 34, 0.96);
}

.lobby-top-actions .sound-slider-popover {
  top: calc(100% + 8px);
  bottom: auto;
}
.lobby-top-actions .sound-slider-popover::after {
  top: auto;
  bottom: 100%;
  border-top-color: transparent;
  border-bottom-color: rgba(18, 24, 34, 0.96);
}

.sound-volume-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 86px;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.2);
  outline: none;
  cursor: pointer;
}

.sound-volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
  cursor: pointer;
  transition: transform 0.15s;
}

.sound-volume-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.sound-volume-val {
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  min-width: 32px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ==================== 7-Day Login Streak Widget ==================== */
.streak-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(245, 158, 11, 0.25);
  background: linear-gradient(145deg, rgba(24, 20, 15, 0.8), rgba(18, 24, 34, 0.85));
}

.streak-card::before {
  content: '';
  position: absolute;
  top: -60px;
  right: -60px;
  width: 140px;
  height: 140px;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.18), transparent 70%);
  pointer-events: none;
}

.streak-icon-wrapper {
  background: rgba(245, 158, 11, 0.15) !important;
  color: #f59e0b !important;
  border-color: rgba(245, 158, 11, 0.3) !important;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.2) !important;
}

.streak-badge-counter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(245, 158, 11, 0.14);
  border: 1px solid rgba(245, 158, 11, 0.35);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 800;
  color: #fbbf24;
}

.streak-days-track {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  margin: 6px 0 14px 0;
}

.streak-day-item {
  position: relative;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 12px;
  padding: 10px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.streak-day-item.completed {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.35);
}

.streak-day-item.active {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.6);
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.3);
  transform: translateY(-2px);
}

.streak-day-item.grand-day {
  background: linear-gradient(180deg, rgba(168, 85, 247, 0.15), rgba(245, 158, 11, 0.15));
  border-color: rgba(168, 85, 247, 0.4);
}

.streak-day-item.grand-day.active {
  border-color: #a855f7;
  box-shadow: 0 0 16px rgba(168, 85, 247, 0.45);
}

.streak-day-lbl {
  font-size: 11px;
  font-weight: 800;
  color: #94a3b8;
  letter-spacing: 0.2px;
}

.streak-day-item.active .streak-day-lbl {
  color: #fbbf24;
}

.streak-day-item.completed .streak-day-lbl {
  color: #10b981;
}

.streak-day-icon {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
}

.streak-day-icon svg {
  width: 15px;
  height: 15px;
}

.streak-day-reward {
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
}

.streak-check-mark {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #10b981;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 900;
}

.streak-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 4px;
}

.streak-hint {
  font-size: 12px;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-claim-streak {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 9px 18px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.4);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-claim-streak:hover:not(:disabled) {
  transform: translateY(-1px) scale(1.03);
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.6);
  filter: brightness(1.1);
}

.btn-claim-streak:disabled {
  background: rgba(255, 255, 255, 0.08);
  color: #64748b;
  box-shadow: none;
  cursor: not-allowed;
}

.btn-claim-streak.can-claim {
  animation: streak-glow-pulse 1.8s infinite;
}

@keyframes streak-glow-pulse {
  0%, 100% { box-shadow: 0 0 12px rgba(245, 158, 11, 0.4); }
  50% { box-shadow: 0 0 24px rgba(245, 158, 11, 0.85); transform: scale(1.02); }
}

/* ==================== Live Matches Showcase ==================== */
.live-matches-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.live-matches-card .bento-icon-wrapper {
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.3);
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.18);
}

.live-matches-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.live-match-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.live-match-item:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
  transform: translateY(-1px);
}

.live-match-players {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.live-match-player {
  display: flex;
  align-items: center;
  gap: 8px;
}

.live-match-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.live-match-avatar-placeholder {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
}

.live-match-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-bright, #fff);
}

.live-match-elo {
  font-size: 11px;
  color: #94a3b8;
}

.live-match-vs {
  font-size: 11px;
  font-weight: 800;
  color: #64748b;
  text-transform: uppercase;
  padding: 0 4px;
}

.live-match-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}

.live-match-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  color: #cbd5e1;
}

.live-match-specs {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  color: #f87171;
}

.live-match-specs svg {
  width: 13px;
  height: 13px;
}

.btn-spectate {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 8px;
  background: rgba(239, 68, 68, 0.18);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-spectate:hover {
  background: #ef4444;
  color: #fff;
  border-color: #ef4444;
  box-shadow: 0 0 14px rgba(239, 68, 68, 0.5);
  transform: translateY(-1px);
}

.btn-spectate svg {
  width: 14px;
  height: 14px;
}

.live-match-empty {
  padding: 24px;
  text-align: center;
  color: #64748b;
  font-size: 13px;
}

@media (max-width: 768px) {
  .streak-days-track {
    grid-template-columns: repeat(4, 1fr);
  }
  .live-match-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .live-match-meta {
    width: 100%;
    justify-content: space-between;
  }
}

@media (max-width: 480px) {
  .streak-days-track {
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
  }
  .streak-day-item {
    padding: 8px 3px;
  }
  .streak-day-lbl {
    font-size: 10px;
  }
  .streak-day-reward {
    font-size: 9.5px;
    word-break: break-word;
  }
  .streak-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .btn-claim-streak {
    width: 100%;
    justify-content: center;
  }
}



