/* ==========================================================================
   SATRANC — BobRose Tasarım Sistemi & CSS Tokenları
   3 Tema (emerald, wood, midnight) + Mobil-Öncelikli CLS=0 Yerleşim
   ========================================================================== */

/* 1. TEMA DEĞİŞKENLERİ */
:root,
[data-board-theme="emerald"] {
  --sq-light: #EEEED2;
  --sq-dark: #4B7355;
  --board-border: #1E2923;
  --coord-on-light: #4B7355;
  --coord-on-dark: #EEEED2;
  --sq-last-light: #DCE775;
  --sq-last-dark: #7CB342;
  --sq-last-border: rgba(245, 158, 11, 0.45);
  --sq-selected: rgba(16, 185, 129, 0.52);
  --sq-legal-dot: rgba(20, 85, 30, 0.38);
  --sq-legal-capture: rgba(239, 68, 68, 0.55);
  --sq-check-glow: radial-gradient(ellipse at center, rgba(255,0,0,0.95) 0%, rgba(231,0,0,0.85) 25%, rgba(169,0,0,0) 89%);
}

[data-board-theme="wood"] {
  --sq-light: #F0D9B5;
  --sq-dark: #B58863;
  --board-border: #3D271D;
  --coord-on-light: #B58863;
  --coord-on-dark: #F0D9B5;
  --sq-last-light: #F6E58D;
  --sq-last-dark: #CA9E4A;
  --sq-last-border: rgba(217, 119, 6, 0.50);
  --sq-selected: rgba(20, 85, 30, 0.50);
  --sq-legal-dot: rgba(20, 85, 30, 0.38);
  --sq-legal-capture: rgba(239, 68, 68, 0.55);
  --sq-check-glow: radial-gradient(ellipse at center, rgba(255,0,0,0.95) 0%, rgba(231,0,0,0.85) 25%, rgba(169,0,0,0) 89%);
}

[data-board-theme="midnight"] {
  --sq-light: #CBD5E1;
  --sq-dark: #334155;
  --board-border: #0F172A;
  --coord-on-light: #334155;
  --coord-on-dark: #CBD5E1;
  --sq-last-light: #93C5FD;
  --sq-last-dark: #2563EB;
  --sq-last-border: rgba(56, 189, 248, 0.55);
  --sq-selected: rgba(56, 189, 248, 0.45);
  --sq-legal-dot: rgba(15, 23, 42, 0.48);
  --sq-legal-capture: rgba(248, 113, 113, 0.60);
  --sq-check-glow: radial-gradient(ellipse at center, rgba(255,0,0,0.95) 0%, rgba(231,0,0,0.85) 25%, rgba(169,0,0,0) 89%);
}

/* GENEL UYGULAMA RENK TOKENLARI */
:root {
  --bg-app: #0B0F17;
  --bg-panel: #151C28;
  --bg-panel-elevated: #1E293B;
  --text-primary: #F8FAFC;
  --text-muted: #94A3B8;
  --clock-active-bg: #064E3B;
  --clock-active-border: #10B981;
  --clock-low-time-bg: #7F1D1D;
  --clock-low-time-border: #EF4444;
  --armageddon-gold-border: #F59E0B;
  --armageddon-gold-bg: linear-gradient(135deg, rgba(180,83,9,0.28), rgba(120,53,15,0.45));
}

/* 2. GLOBAL RESET & BASE */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  height: 100dvh;
  overflow: hidden;
  background-color: var(--bg-app);
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

html:has(body.lobby-body),
body.lobby-body {
  height: auto;
  min-height: 100dvh;
  overflow-y: auto;
  overflow-x: hidden;
}

/* 3. ANA SAHNE DÜZENİ */
.app-container {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  width: 100vw;
  max-width: 1440px;
  margin: 0 auto;
  overflow: hidden;
}

/* Üst Başlık Çubuğu */
.app-header {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 4px 16px;
  background-color: var(--bg-panel);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.postgame-top-menu {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  padding: 2px 4px;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 8px;
}

.btn-top-menu {
  height: 28px;
  padding: 0 9px;
  border-radius: 5px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: var(--bg-panel-elevated);
  color: var(--text-primary);
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
}

.btn-top-menu:hover {
  background: rgba(255, 255, 255, 0.14);
  transform: translateY(-1px);
}

.btn-top-menu.btn-top-gold {
  background: rgba(245, 158, 11, 0.2);
  border-color: rgba(245, 158, 11, 0.55);
  color: #FCD34D;
}

.btn-top-menu.btn-top-blue {
  background: rgba(37, 99, 235, 0.28);
  border-color: rgba(59, 130, 246, 0.55);
  color: #93C5FD;
}

.btn-top-menu.btn-top-green {
  background: rgba(22, 163, 74, 0.28);
  border-color: rgba(34, 197, 94, 0.55);
  color: #86EFAC;
}

.btn-top-menu.btn-top-purple {
  background: rgba(124, 58, 237, 0.28);
  border-color: rgba(167, 139, 250, 0.55);
  color: #DDD6FE;
}

.btn-top-menu.btn-top-emerald {
  background: rgba(16, 185, 129, 0.25);
  border-color: rgba(16, 185, 129, 0.6);
  color: #6EE7B7;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.5px;
}

.btn-header-lobby {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 28px;
  padding: 0 9px;
  border-radius: 6px;
  background: var(--bg-panel-elevated);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--text-primary);
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  transition: all 0.15s ease;
}

.btn-header-lobby:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
}

.brand-logo {
  font-size: 18px;
}

.brand-status-badge {
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(16, 185, 129, 0.18);
  color: #10B981;
  border: 1px solid rgba(16, 185, 129, 0.35);
  font-weight: 600;
  white-space: nowrap;
}

.brand-status-badge.status-live {
  background: rgba(16, 185, 129, 0.18);
  color: #10B981;
  border-color: rgba(16, 185, 129, 0.35);
}

.brand-status-badge.status-warn {
  background: rgba(245, 158, 11, 0.18);
  color: #FBBF24;
  border-color: rgba(245, 158, 11, 0.35);
}

.brand-status-badge.status-error {
  background: rgba(239, 68, 68, 0.18);
  color: #F87171;
  border-color: rgba(239, 68, 68, 0.35);
}

.spectator-count-badge {
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-muted);
  font-weight: 600;
  white-space: nowrap;
}

.spectator-mode-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(56, 189, 248, 0.18);
  border: 1px solid rgba(56, 189, 248, 0.45);
  color: #7DD3FC;
  font-weight: 700;
  white-space: nowrap;
}

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

.btn-icon {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-primary);
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.15s ease;
}

.btn-icon:hover {
  background: var(--bg-panel-elevated);
}

.theme-selector {
  background: var(--bg-panel-elevated);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-primary);
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
  outline: none;
}

/* Ana Oyun Alanı */
.game-viewport {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  overflow: hidden;
  gap: 24px;
}

/* Sol Taraf: Oyuncu Barı + Tahta + Oyuncu Barı */
.board-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  max-width: 100%;
}

/* Oyuncu / Rakip Bilgi Kartları */
.player-card {
  width: 100%;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px;
  background-color: var(--bg-panel);
  border-radius: 8px;
  margin: 4px 0;
  flex-shrink: 0;
}

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

.player-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg-panel-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  border: 1px solid rgba(255,255,255,0.1);
}

.player-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.player-name {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  max-width: 180px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.bot-thinking-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.16);
  border: 1px solid rgba(56, 189, 248, 0.45);
  color: #7DD3FC;
  animation: thinkingPulse 1s infinite alternate;
}

@keyframes thinkingPulse {
  from { opacity: 0.65; }
  to { opacity: 1; }
}

.player-sub {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-muted);
  min-height: 20px;
}

.captured-pieces {
  display: inline-flex;
  align-items: center;
  gap: 1px;
  min-height: 20px;
  padding: 1px 4px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.04);
}

.captured-pieces:empty {
  display: none;
}

.material-diff {
  font-weight: 700;
  font-size: 11px;
  color: #FBBF24;
  background: rgba(245, 158, 11, 0.16);
  border: 1px solid rgba(245, 158, 11, 0.35);
  padding: 1px 5px;
  border-radius: 4px;
}

.material-diff:empty {
  display: none;
}

/* Dijital Fischer Saati */
.fischer-clock {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-variant-numeric: tabular-nums;
  font-size: 20px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 6px;
  background: var(--bg-panel-elevated);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  min-width: 90px;
  text-align: center;
  transition: background-color 0.2s, border-color 0.2s;
}

.fischer-clock.active {
  background: var(--clock-active-bg);
  border-color: var(--clock-active-border);
  color: #34D399;
}

.fischer-clock.low-time {
  background: var(--clock-low-time-bg);
  border-color: var(--clock-low-time-border);
  color: #FCA5A5;
  animation: clockPulse 1s infinite alternate;
}

@keyframes clockPulse {
  from { opacity: 0.85; }
  to { opacity: 1; filter: drop-shadow(0 0 6px rgba(239, 68, 68, 0.6)); }
}

/* 4. SATRANÇ TAHTASI (CHESSBOARD) */
.chess-board-wrapper {
  position: relative;
  border: 6px solid var(--board-border);
  border-radius: 6px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.6), 0 8px 10px -6px rgba(0, 0, 0, 0.6);
  touch-action: none;
  overflow: hidden;
  flex-shrink: 0;
}

/* Maç Öncesi Başlatma & 5 Saniye Geri Sayım Katmanı */
.pregame-overlay {
  position: absolute;
  inset: 0;
  z-index: 25;
  background: rgba(11, 15, 23, 0.76);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
}

.pregame-card {
  background: rgba(21, 28, 40, 0.97);
  border: 1px solid rgba(245, 158, 11, 0.45);
  border-radius: 14px;
  padding: 12px 16px;
  max-width: 380px;
  width: 100%;
  max-height: 96%;
  overflow: hidden;
  text-align: center;
  box-shadow: 0 20px 35px rgba(0, 0, 0, 0.75);
}

.pregame-room-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 800;
  color: #FBBF24;
  background: rgba(245, 158, 11, 0.16);
  border: 1px solid rgba(245, 158, 11, 0.35);
  padding: 3px 10px;
  border-radius: 999px;
  margin-bottom: 4px;
}

.pregame-rules-summary {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.pregame-icon {
  font-size: 28px;
  margin-bottom: 2px;
}

.pregame-countdown-num {
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  contain: layout paint;
  font-size: 64px;
  font-weight: 900;
  line-height: 1;
  color: #FBBF24;
  text-shadow: 0 0 24px rgba(245, 158, 11, 0.75);
  margin: 2px 0 6px;
  animation: countdownPop 0.9s ease-out infinite;
}

.pregame-countdown-num.is-hidden {
  display: none !important;
}

@keyframes countdownPop {
  0% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.85; }
}

.pregame-title {
  font-size: 17px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.pregame-desc {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.35;
  margin-bottom: 8px;
}

.pregame-nick-box {
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 6px 10px;
  margin-bottom: 8px;
  text-align: left;
}

.pregame-nick-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 5px;
}

.pregame-nick-row {
  display: flex;
  gap: 6px;
}

.pregame-nick-input {
  flex: 1;
  min-width: 0;
  height: 36px;
  padding: 0 10px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: var(--bg-panel-elevated);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
  outline: none;
}

.pregame-nick-input:focus {
  border-color: #38BDF8;
}

.btn-save-nick {
  height: 36px;
  padding: 0 12px;
  border-radius: 6px;
  border: 1px solid rgba(56, 189, 248, 0.45);
  background: rgba(37, 99, 235, 0.35);
  color: #BAE6FD;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.btn-save-nick:hover {
  background: rgba(37, 99, 235, 0.55);
}

.invite-bridge-box {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-radius: 10px;
  padding: 8px 10px;
  margin-bottom: 8px;
}

.invite-bridge-label {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  color: #6EE7B7;
  margin-bottom: 8px;
}

.invite-bridge-btns {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.btn-invite-copy,
.btn-invite-wa {
  width: 100%;
  min-height: 40px;
  border-radius: 7px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 10px;
  transition: transform 0.15s ease, background 0.15s ease;
}

.btn-invite-copy {
  background: var(--bg-panel-elevated);
  border: 1px solid rgba(56, 189, 248, 0.45);
  color: #E0F2FE;
}

.btn-invite-copy:hover {
  background: rgba(56, 189, 248, 0.2);
}

.btn-invite-wa {
  background: #16A34A;
  border: none;
  color: #FFFFFF;
}

.btn-invite-wa:hover {
  background: #15803D;
}

.pregame-feedback {
  margin-top: 6px;
  font-size: 11.5px;
  font-weight: 600;
  color: #34D399;
  background: rgba(16, 185, 129, 0.14);
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-radius: 5px;
  padding: 4px 8px;
  text-align: center;
}

.btn-start-match {
  width: 100%;
  min-height: 44px;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, #10B981, #059669);
  color: #FFFFFF;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn-start-match:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(16, 185, 129, 0.6);
}

.btn-start-match:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.chess-board {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  grid-template-rows: repeat(8, 1fr);
  width: min(85vw, calc(100dvh - 200px));
  height: min(85vw, calc(100dvh - 200px));
  max-width: 640px;
  max-height: 640px;
  aspect-ratio: 1 / 1;
}

/* Kareler */
.square {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

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

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

/* Koordinat Etiketleri */
.coord-rank {
  position: absolute;
  top: 2px;
  left: 3px;
  font-size: 10px;
  font-weight: 700;
  pointer-events: none;
}

.coord-file {
  position: absolute;
  bottom: 2px;
  right: 3px;
  font-size: 10px;
  font-weight: 700;
  pointer-events: none;
}

.square.light .coord-rank,
.square.light .coord-file {
  color: var(--coord-on-light);
}

.square.dark .coord-rank,
.square.dark .coord-file {
  color: var(--coord-on-dark);
}

/* Kare Vurguları — Açık ve Koyu Kare Kimliğini Koruyan BobRose Paleti */
.square.light.last-move {
  background-color: var(--sq-last-light);
  box-shadow: inset 0 0 0 2px var(--sq-last-border);
}

.square.dark.last-move {
  background-color: var(--sq-last-dark);
  box-shadow: inset 0 0 0 2px var(--sq-last-border);
}

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

.square.in-check {
  background: var(--sq-check-glow) !important;
}

/* 2 Aşamalı Taş Alma (Capture) Koreografisi — Aşama 1: Kurban Kırmızı Işık (~1 sn) */
.square.capture-attacker-origin {
  box-shadow: inset 0 0 0 3px rgba(245, 158, 11, 0.9) !important;
}

.square.capture-target-red {
  background: radial-gradient(circle at center, rgba(254, 202, 202, 0.92) 0%, rgba(239, 68, 68, 0.88) 55%, rgba(153, 27, 27, 0.95) 100%) !important;
  box-shadow: inset 0 0 0 3px #FCA5A5, 0 0 18px rgba(239, 68, 68, 0.85) !important;
  animation: captureVictimPulse 0.32s ease-in-out infinite alternate;
  z-index: 4;
}

.square.capture-target-red svg.chess-piece {
  animation: victimPieceShake 0.28s ease-in-out infinite alternate;
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.9));
}

@keyframes captureVictimPulse {
  from {
    box-shadow: inset 0 0 0 2px #FEE2E2, 0 0 10px rgba(239, 68, 68, 0.7);
  }
  to {
    box-shadow: inset 0 0 0 4px #FFFFFF, 0 0 24px rgba(239, 68, 68, 1);
  }
}

@keyframes victimPieceShake {
  0% { transform: scale(1.06) rotate(-4deg); }
  100% { transform: scale(1.12) rotate(4deg); }
}

/* 2 Aşamalı Taş Alma Koreografisi — Aşama 2: Gelen Taş Yeşil Işık (~0.9 sn) */
.square.capture-landed-green {
  background: radial-gradient(circle at center, rgba(167, 243, 208, 0.92) 0%, rgba(16, 185, 129, 0.85) 58%, rgba(6, 95, 70, 0.92) 100%) !important;
  box-shadow: inset 0 0 0 3px #6EE7B7, 0 0 18px rgba(16, 185, 129, 0.85) !important;
  animation: captureLandedGlow 0.9s ease-out forwards;
  z-index: 4;
}

.square.capture-landed-green svg.chess-piece {
  animation: attackerPieceLand 0.45s cubic-bezier(0.22, 1, 0.36, 1);
  filter: drop-shadow(0 0 8px rgba(16, 185, 129, 0.9));
}

@keyframes captureLandedGlow {
  0% {
    box-shadow: inset 0 0 0 4px #A7F3D0, 0 0 24px rgba(16, 185, 129, 1);
  }
  100% {
    box-shadow: inset 0 0 0 2px rgba(16, 185, 129, 0.4), 0 0 4px rgba(16, 185, 129, 0.2);
  }
}

@keyframes attackerPieceLand {
  0% { transform: scale(1.22); }
  100% { transform: scale(1); }
}

/* Yasal Hamle Noktası (Boş Kareler için %28 Daire) */
.square.legal-move::after {
  content: "";
  position: absolute;
  width: 28%;
  height: 28%;
  border-radius: 50%;
  background-color: var(--sq-legal-dot);
  pointer-events: none;
  z-index: 2;
}

/* Yasal Alış Halkası (Dolu Kareler için Çerçeve) */
.square.legal-capture::after {
  content: "";
  position: absolute;
  width: 88%;
  height: 88%;
  border-radius: 50%;
  border: 4px solid var(--sq-legal-capture);
  pointer-events: none;
  z-index: 2;
}

/* Taşlar */
.square svg.chess-piece {
  width: 88%;
  height: 88%;
  pointer-events: none;
  transition: transform 0.1s ease;
  z-index: 1;
}

.chess-piece.white-piece {
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.35));
}

.chess-piece.black-piece {
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.5));
}

/* Sürükleme Hayaleti (Drag Ghost) */
.drag-ghost {
  position: fixed;
  pointer-events: none;
  z-index: 999;
  width: 64px;
  height: 64px;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 10px 15px rgba(0, 0, 0, 0.6));
}

/* 5. SAĞ PANEL (MASAÜSTÜ) */
.side-panel {
  width: 360px;
  height: min(85vw, calc(100dvh - 200px));
  max-height: 640px;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-panel);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
}

/* Armageddon Altın Bilgi Bandı */
.armageddon-banner {
  padding: 8px 12px;
  background: var(--armageddon-gold-bg);
  border-bottom: 2px solid var(--armageddon-gold-border);
  color: #FBBF24;
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.armageddon-badge {
  background: #F59E0B;
  color: #000;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 3px;
  font-weight: 800;
  text-transform: uppercase;
}

/* SAN Hamle Tablosu */
.moves-history-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 8px;
}

.moves-header {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  padding: 4px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.moves-scroll-box {
  flex: 1;
  overflow-y: auto;
  padding: 4px 0;
}

.moves-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  font-family: ui-monospace, monospace;
}

.moves-table td {
  padding: 4px 8px;
}

.moves-table tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.02);
}

.moves-table .move-idx {
  color: var(--text-muted);
  width: 38px;
}

.moves-table .move-san {
  cursor: pointer;
  border-radius: 4px;
  padding: 2px 4px;
}

.moves-table .move-san:hover {
  background: var(--bg-panel-elevated);
}

.moves-table .move-san.active-san {
  background: rgba(37, 99, 235, 0.35);
  color: #60A5FA;
  font-weight: bold;
}

/* Teklif / Bildirim Alanı */
.offer-banner {
  margin: 6px 8px;
  padding: 8px;
  border-radius: 6px;
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid #3B82F6;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.offer-actions {
  display: flex;
  gap: 6px;
}

.btn-offer-accept {
  background: #10B981;
  color: white;
  border: none;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: bold;
  cursor: pointer;
}

.btn-offer-reject {
  background: #EF4444;
  color: white;
  border: none;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: bold;
  cursor: pointer;
}

/* Aksiyon Butonları */
.action-controls-bar {
  display: flex;
  gap: 6px;
  padding: 8px;
  background: rgba(0, 0, 0, 0.2);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.btn-action {
  flex: 1;
  min-height: 44px;
  min-width: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: var(--bg-panel-elevated);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-action:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.25);
}

.btn-action:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-action.btn-danger {
  color: #F87171;
}

.btn-action.btn-danger:hover:not(:disabled) {
  background: rgba(239, 68, 68, 0.2);
}

/* 6. MODAL PENCERELER (TERFİ & OYUN SONU) */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-card {
  position: relative;
  background: var(--bg-panel);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 28px 24px 24px;
  max-width: 400px;
  width: 90%;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.8);
  text-align: center;
}

.modal-close-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.modal-close-btn:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.5);
  color: #FCA5A5;
}

.modal-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
}

.modal-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 20px;
  line-height: 1.4;
}

/* Terfi Butonları */
.promotion-options {
  display: flex;
  justify-content: center;
  gap: 12px;
}

.btn-promo-piece {
  width: 64px;
  height: 64px;
  min-width: 56px;
  min-height: 56px;
  border-radius: 8px;
  border: 2px solid rgba(255, 255, 255, 0.15);
  background: var(--bg-panel-elevated);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  transition: transform 0.15s, border-color 0.15s;
}

.btn-promo-piece:hover {
  transform: translateY(-2px);
  border-color: #38BDF8;
  background: rgba(56, 189, 248, 0.1);
}

.btn-promo-piece svg {
  width: 100%;
  height: 100%;
}

/* Oyun Sonu Butonları & GAMEnya.com Görsel Paylaşım Kartı */
.modal-card-gameover {
  max-width: 500px;
  padding: 22px 20px 18px;
}

.modal-top-menu-bar {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  padding: 8px;
  margin-bottom: 12px;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
}

@media (min-width: 480px) {
  .modal-top-menu-bar {
    grid-template-columns: repeat(4, 1fr);
  }
}

.btn-pgn-menu {
  width: 100%;
  min-height: 44px;
  background: #D97706;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  font-size: 12.5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0 6px;
}

.btn-pgn-menu:hover {
  background: #B45309;
}

.share-preview-box {
  margin: 0 auto 12px;
  display: flex;
  justify-content: center;
}

.share-preview-img {
  width: 100%;
  max-width: 240px;
  max-height: 270px;
  object-fit: contain;
  border-radius: 8px;
  border: 1px solid rgba(245, 158, 11, 0.4);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.55);
}

.share-feedback {
  font-size: 12px;
  font-weight: 600;
  color: #34D399;
  background: rgba(16, 185, 129, 0.14);
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-radius: 6px;
  padding: 6px 10px;
  margin-bottom: 10px;
}

.modal-btn-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.share-btn-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.share-btn-grid-sub {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

@media (min-width: 520px) {
  .share-btn-grid-sub {
    grid-template-columns: repeat(4, 1fr);
  }
}

.rematch-offer-box {
  background: rgba(245, 158, 11, 0.16);
  border: 1px solid rgba(245, 158, 11, 0.55);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}

.rematch-offer-text {
  font-size: 13px;
  font-weight: 700;
  color: #FDE68A;
}

.rematch-offer-actions {
  display: flex;
  gap: 8px;
  width: 100%;
  justify-content: center;
}

.btn-rematch-accept,
.btn-rematch-reject {
  min-height: 38px;
  padding: 0 14px;
  border-radius: 6px;
  border: none;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}

.btn-rematch-accept {
  background: #10B981;
  color: #FFFFFF;
}

.btn-rematch-accept:hover {
  background: #059669;
}

.btn-rematch-reject {
  background: rgba(239, 68, 68, 0.25);
  border: 1px solid rgba(239, 68, 68, 0.55);
  color: #FCA5A5;
}

.btn-rematch-reject:hover {
  background: rgba(239, 68, 68, 0.4);
}

.btn-rematch {
  width: 100%;
  min-height: 44px;
  background: linear-gradient(135deg, #10B981, #059669);
  color: #FFFFFF;
  border: none;
  border-radius: 6px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0 8px;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.btn-rematch:hover:not(:disabled) {
  transform: translateY(-1px);
}

.btn-rematch:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-primary {
  width: 100%;
  min-height: 44px;
  background: #2563EB;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0 8px;
}

.btn-primary:hover {
  background: #1D4ED8;
}

.btn-whatsapp {
  width: 100%;
  min-height: 44px;
  background: #16A34A;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0 8px;
}

.btn-whatsapp:hover {
  background: #15803D;
}

.btn-social {
  width: 100%;
  min-height: 44px;
  background: #7C3AED;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0 8px;
}

.btn-social:hover {
  background: #6D28D9;
}

.btn-secondary {
  width: 100%;
  min-height: 44px;
  background: var(--bg-panel-elevated);
  color: var(--text-primary);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  font-weight: 600;
  font-size: 12px;
  cursor: pointer;
  padding: 0 6px;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* 7. MOBİL UYUMLULUK VE ERGONOMİ (MUSTAFA'NIN ÖZEL VURGUSU < 1024px) */
@media (max-width: 1023px) {
  .app-header {
    height: 36px;
    padding: 0 10px;
  }

  .game-viewport {
    flex-direction: column;
    padding: 4px;
    gap: 4px;
    justify-content: flex-start;
  }

  .board-column {
    height: auto;
    width: 100%;
    align-items: center;
  }

  .player-card {
    height: 44px;
    margin: 2px 0;
    max-width: min(96vw, calc(100dvh - 236px));
  }

  .fischer-clock {
    font-size: 17px;
    padding: 2px 8px;
    min-width: 76px;
  }

  .chess-board-wrapper {
    border-width: 4px;
  }

  .chess-board {
    width: min(96vw, calc(100dvh - 236px));
    height: min(96vw, calc(100dvh - 236px));
    max-width: 100%;
    max-height: 100%;
  }

  /* Masaüstü sağ paneli mobilde alt bant haline getir */
  .side-panel {
    width: 100%;
    max-width: min(96vw, calc(100dvh - 236px));
    height: auto;
    max-height: none;
    background: transparent;
    border: none;
  }

  /* Mobilde hamleler yatay şerit halinde akar */
  .moves-history-container {
    height: 34px;
    flex: none;
    padding: 0;
  }

  .moves-header {
    display: none;
  }

  .moves-scroll-box {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    gap: 8px;
    align-items: center;
    padding: 2px 4px;
    border-radius: 4px;
    background: var(--bg-panel);
    border: 1px solid rgba(255, 255, 255, 0.06);
  }

  .moves-table {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
  }

  .moves-table tbody {
    display: flex;
    gap: 8px;
  }

  .moves-table tr {
    display: inline-flex;
    align-items: center;
    gap: 4px;
  }

  .moves-table td {
    padding: 0;
  }

  /* Alt Aksiyon Çubuğu Parmak Dostu (min 44px) */
  .action-controls-bar {
    width: 100%;
    padding: 4px 0;
    background: transparent;
    border-top: none;
    gap: 6px;
  }

  .btn-action {
    min-height: 44px;
    font-size: 11px;
    padding: 0 4px;
  }

  /* Mobilde Armageddon Altın Bandı Kompakt Olarak Gösterilir */
  .armageddon-banner {
    padding: 4px 8px;
    font-size: 11px;
    border-radius: 4px;
    margin-bottom: 2px;
    width: 100%;
    max-width: min(96vw, calc(100dvh - 236px));
    justify-content: center;
  }
}

/* 8. YARDIMCI SINIFLAR & SIFIR INLINE STYLE */
.is-hidden {
  display: none !important;
}

.captured-piece-icon {
  display: inline-flex;
  width: 18px;
  height: 18px;
  align-items: center;
  justify-content: center;
}

.captured-piece-icon svg.chess-piece {
  width: 100%;
  height: 100%;
}

.captured-piece-icon.captured-piece-new {
  animation: capturedPop 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes capturedPop {
  0% { transform: scale(1.65); filter: drop-shadow(0 0 6px #10B981); }
  100% { transform: scale(1); }
}

/* 9. CANLI MİSAFİR & AÇIK OYUN LOBİSİ (INDEX.HTML) */
.lobby-body {
  background: radial-gradient(circle at top, #182235 0%, #0B0F17 100%);
  color: var(--text-primary);
  padding: 0;
}

.lobby-shell {
  max-width: 1360px;
  margin: 0 auto;
  padding: 16px 20px 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Lobi Üst Başlık ve Misafir Kimliği Barı */
.lobby-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  padding: 14px 18px;
  background: var(--bg-panel);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
}

.lobby-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.lobby-brand-icon {
  font-size: 32px;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.5));
}

.lobby-brand-text {
  display: flex;
  flex-direction: column;
}

.lobby-brand-title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.3px;
  line-height: 1.2;
}

.lobby-brand-domain {
  color: #FBBF24;
  font-weight: 700;
  font-size: 16px;
}

.lobby-brand-sub {
  font-size: 12px;
  color: var(--text-muted);
}

.lobby-identity-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 8px 12px;
  border-radius: 10px;
}

.lobby-nick-label {
  font-size: 12.5px;
  font-weight: 700;
  color: #CBD5E1;
  white-space: nowrap;
}

.lobby-nick-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
}

.lobby-nick-input {
  width: 180px;
  height: 36px;
  padding: 0 10px;
  border-radius: 7px;
  border: 1px solid rgba(56, 189, 248, 0.4);
  background: var(--bg-panel-elevated);
  color: var(--text-primary);
  font-size: 13.5px;
  font-weight: 700;
  outline: none;
  transition: border-color 0.15s ease;
}

.lobby-nick-input:focus {
  border-color: #38BDF8;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}

.lobby-nick-saved {
  font-size: 11px;
  font-weight: 700;
  color: #34D399;
  white-space: nowrap;
}

/* Hızlı Tek Tıkla Bot Maçı Şeridi */
.quick-bot-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px 16px;
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.9), rgba(21, 28, 40, 0.95));
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 12px;
}

.quick-bot-info {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.quick-bot-badge {
  background: rgba(56, 189, 248, 0.2);
  border: 1px solid rgba(56, 189, 248, 0.45);
  color: #7DD3FC;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
}

.quick-bot-label {
  font-size: 13px;
  font-weight: 600;
  color: #E2E8F0;
}

.quick-bot-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-quick-bot {
  min-height: 40px;
  padding: 6px 14px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: var(--bg-panel-elevated);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.15s ease;
}

.btn-quick-bot:hover {
  background: rgba(37, 99, 235, 0.25);
  border-color: #38BDF8;
  transform: translateY(-1px);
}

.btn-quick-bot-featured {
  border-color: rgba(16, 185, 129, 0.5);
  background: rgba(16, 185, 129, 0.15);
}

.quick-bot-meta {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
}

/* Ana Lobi 2 Sütunlu Grid */
.lobby-main-grid {
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 20px;
  align-items: start;
}

.lobby-panel {
  background: var(--bg-panel);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 18px;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.45);
}

.lobby-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 12px;
  margin-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.lobby-panel-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.lobby-panel-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-primary);
}

.lobby-panel-tag {
  font-size: 11px;
  font-weight: 700;
  color: #FBBF24;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.35);
  padding: 2px 8px;
  border-radius: 999px;
}

.lobby-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.2);
  border: 1px solid rgba(56, 189, 248, 0.45);
  color: #7DD3FC;
  font-size: 12px;
  font-weight: 800;
}

.lobby-count-badge.lobby-count-live {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.45);
  color: #FCA5A5;
}

.btn-refresh-lobby {
  height: 30px;
  padding: 0 10px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: var(--bg-panel-elevated);
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.btn-refresh-lobby:hover {
  background: rgba(255, 255, 255, 0.12);
}

.lobby-live-hint {
  font-size: 11.5px;
  color: var(--text-muted);
  font-weight: 600;
}

/* Yeni Masa Kurma Formu */
.create-match-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 12.5px;
  font-weight: 700;
  color: #CBD5E1;
}

.form-label-opt {
  font-weight: 500;
  color: var(--text-muted);
  font-size: 11.5px;
}

.form-input {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: var(--bg-panel-elevated);
  color: var(--text-primary);
  font-size: 13.5px;
  font-weight: 600;
  outline: none;
  transition: border-color 0.15s ease;
}

.form-input:focus {
  border-color: #38BDF8;
}

.segmented-control {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 6px;
}

.seg-btn {
  min-height: 40px;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(15, 23, 42, 0.6);
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.seg-btn:hover {
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.28);
}

.seg-btn.active {
  background: rgba(37, 99, 235, 0.32);
  border-color: #38BDF8;
  color: #FFFFFF;
}

/* Zaman Temposu Şablon Grid */
.tempo-presets-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}

.tempo-btn {
  min-height: 48px;
  padding: 4px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(15, 23, 42, 0.6);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  transition: all 0.15s ease;
}

.tempo-btn:hover {
  border-color: rgba(255, 255, 255, 0.3);
  color: var(--text-primary);
}

.tempo-btn.active {
  background: rgba(16, 185, 129, 0.24);
  border-color: #10B981;
  color: #FFFFFF;
}

.tempo-btn-main {
  font-size: 12.5px;
  font-weight: 800;
}

.tempo-btn-sub {
  font-size: 10px;
  opacity: 0.85;
}

.custom-tempo-box {
  margin-top: 6px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.custom-tempo-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.custom-tempo-label {
  font-size: 12px;
  color: #CBD5E1;
}

.custom-tempo-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.form-range {
  flex: 1;
  accent-color: #10B981;
  cursor: pointer;
}

.form-number-sm {
  width: 58px;
  height: 32px;
  text-align: center;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: var(--bg-panel-elevated);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 700;
}

/* Masa & Turnuva Kuralları Checkbox Kartları */
.rules-check-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rule-check-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 9px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.12);
  cursor: pointer;
}

.rule-check-card.rule-check-gold {
  background: rgba(180, 83, 9, 0.14);
  border-color: rgba(245, 158, 11, 0.35);
}

.rule-checkbox {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: #10B981;
  cursor: pointer;
  flex-shrink: 0;
}

.rule-check-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.rule-check-title {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-primary);
}

.rule-check-desc {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.35;
}

/* Taş Rengi Tercihi */
.color-pref-group {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.color-pref-btn {
  min-height: 40px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(15, 23, 42, 0.6);
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.color-pref-btn:hover {
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.3);
}

.color-pref-btn.active {
  background: rgba(37, 99, 235, 0.32);
  border-color: #38BDF8;
  color: #FFFFFF;
}

.form-error-banner {
  padding: 8px 10px;
  border-radius: 7px;
  background: rgba(239, 68, 68, 0.16);
  border: 1px solid rgba(239, 68, 68, 0.45);
  color: #FCA5A5;
  font-size: 12px;
  font-weight: 600;
}

.btn-create-match {
  width: 100%;
  min-height: 48px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, #10B981, #059669);
  color: #FFFFFF;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(16, 185, 129, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn-create-match:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(16, 185, 129, 0.5);
}

.btn-create-match:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Sağ Sütun: Canlı Masalar Listesi */
.lobby-tables-column {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

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

.lobby-empty-state {
  padding: 28px 16px;
  text-align: center;
  background: rgba(15, 23, 42, 0.45);
  border: 1px dashed rgba(255, 255, 255, 0.14);
  border-radius: 10px;
}

.lobby-empty-icon {
  font-size: 30px;
  display: block;
  margin-bottom: 6px;
}

.lobby-empty-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #E2E8F0;
  margin-bottom: 4px;
}

.lobby-empty-desc {
  font-size: 12px;
  color: var(--text-muted);
}

/* Lobi Masa Kartları */
.lobby-match-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 11px;
  background: var(--bg-panel-elevated);
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.lobby-match-card:hover {
  border-color: rgba(56, 189, 248, 0.45);
  transform: translateY(-1px);
}

.match-card-main {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  flex: 1;
}

.match-card-top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.match-room-title {
  font-size: 14.5px;
  font-weight: 800;
  color: var(--text-primary);
}

.match-seat-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.18);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #6EE7B7;
}

.match-spectator-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #CBD5E1;
}

.match-players-line {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 13px;
  color: #E2E8F0;
}

.match-vs-dot {
  color: var(--text-muted);
}

.match-open-seat {
  color: #38BDF8;
  font-weight: 600;
  font-size: 12.5px;
}

.match-vs-badge {
  font-size: 10px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.1);
  color: #94A3B8;
}

.match-tags-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.match-tag {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 5px;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #CBD5E1;
}

.match-tag-tempo {
  color: #7DD3FC;
  border-color: rgba(56, 189, 248, 0.35);
}

.match-tag-gold {
  color: #FCD34D;
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.4);
}

.match-tag-lock {
  color: #FCA5A5;
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.35);
}

.match-tag-open {
  color: #6EE7B7;
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.3);
}

.match-tag-live {
  color: #FCA5A5;
  background: rgba(239, 68, 68, 0.16);
  border-color: rgba(239, 68, 68, 0.4);
}

.match-tag-muted {
  color: var(--text-muted);
}

.match-card-action {
  flex-shrink: 0;
}

.btn-join-table,
.btn-watch-table {
  min-height: 42px;
  padding: 0 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.15s ease, background 0.15s ease;
}

.btn-join-table {
  border: none;
  background: linear-gradient(135deg, #2563EB, #1D4ED8);
  color: #FFFFFF;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

.btn-join-table:hover {
  background: linear-gradient(135deg, #3B82F6, #2563EB);
  transform: translateY(-1px);
}

.btn-watch-table {
  border: 1px solid rgba(56, 189, 248, 0.45);
  background: rgba(56, 189, 248, 0.14);
  color: #BAE6FD;
}

.btn-watch-table:hover {
  background: rgba(56, 189, 248, 0.26);
}

/* Şifreli Masa Modal Formu */
.password-modal-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-action-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.lobby-footer {
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  padding: 8px 0;
}

/* Mobil Lobi Ergonomisi (< 1024px ve 360px-430px) */
@media (max-width: 1023px) {
  .lobby-shell {
    padding: 10px 10px 24px;
    gap: 12px;
  }

  .lobby-header {
    padding: 12px;
    flex-direction: column;
    align-items: stretch;
  }

  .lobby-identity-box {
    justify-content: space-between;
  }

  .lobby-nick-input {
    width: 150px;
  }

  .lobby-main-grid {
    grid-template-columns: 1fr;
  }

  .tempo-presets-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .lobby-match-card {
    flex-direction: column;
    align-items: stretch;
  }

  .btn-join-table,
  .btn-watch-table {
    width: 100%;
    min-height: 44px;
  }
}

