/* ==========================================================================
   KORİDOR - CSS TASARIM SİSTEMİ (TAŞ TAPINAK - ANCIENT STONE LABYRINTH)
   Antik Taş Tapınak Teması: Mat, Sıcak Taş Tonları, Yontulmuş Bloklar ve Altın Vurgular
   Sıfır Emoji, Sıfır İkon Fontu, Saf Vanilla CSS3
   ========================================================================== */

:root {
  /* Yazı Tipleri */
  --font-title: 'Cinzel', Georgia, 'Times New Roman', serif;
  --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* Tema Renk Paleti (Taş Tapınak) */
  --bg-dark: #14120f;
  --bg-surface: #1d1a15;
  --bg-surface-elevated: #26221b;
  --bg-card: rgba(38, 34, 27, 0.92);
  --bg-card-hover: rgba(48, 43, 34, 0.95);

  --border-subtle: rgba(201, 194, 174, 0.12);
  --border-card: rgba(201, 194, 174, 0.22);
  --border-focus: rgba(212, 160, 23, 0.7);

  --primary: #c99a2e;
  --primary-hover: #a87a1c;
  --primary-glow: transparent;

  --secondary: #8a8272;
  --success: #4d8a5a;
  --success-glow: transparent;
  --warning: #d4a017;
  --danger: #b3312b;
  --danger-glow: transparent;

  --text-main: #f1ead8;
  --text-muted: #cfc7b3;
  --text-dim: #9a927f;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.55);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.75);
  --shadow-glow: none;

  /* Tahta ve Hücre Renkleri */
  --board-bg: #3a342b;
  --board-border: #6b6253;
  --cell-bg: #8a8272;
  --cell-hover: #968e7d;
  --groove-bg: #26221b;
  --wall-stone: #c9c2ae;
  --wall-shadow: rgba(0, 0, 0, 0.6);
  --wall-last: #d4a017;
  --goal-seal: #b3312b;
}

/* Sıfırlama ve Temel Yapı */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
}

::selection {
  background: var(--primary);
  color: #1a1208;
}

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

input,
textarea {
  user-select: auto;
  -webkit-user-select: auto;
}

html,
body {
  width: 100%;
  height: 100%;
  min-height: 100%;
  overflow-x: hidden;
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  background-color: #0e0c0a;
  background-image: url('desktop_bg.png');
  background-position: center center;
  background-repeat: no-repeat;
  background-size: 100% 100%;
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Sabit Tam Ekran Arka Plan Katmanı (Masaüstü & Mobil) */
.bg-layer {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  z-index: 0;
  background-color: #0e0c0a;
  background-image: url('desktop_bg.png');
  background-position: center center;
  background-repeat: no-repeat;
  background-size: 100% 100%;
  pointer-events: none;
}

/* Mobil Cihazlar İçin Özel Arka Plan (Dikey Mobil & Tablet) */
@media (max-width: 768px), (pointer: coarse) and (max-width: 1024px) and (orientation: portrait) {
  html,
  body {
    background-image: url('mobile_bg.png') !important;
    background-size: 100% 100% !important;
    background-position: center center !important;
    background-repeat: no-repeat !important;
    background-attachment: fixed !important;
    background-color: #0e0c0a !important;
  }

  .bg-layer {
    background-image: url('mobile_bg.png') !important;
    background-position: center center !important;
    background-size: 100% 100% !important;
    background-repeat: no-repeat !important;
  }
}

/* Kaydırma Çubuklarını Tamamen Görünmez Yap */
html,
body,
*,
*::before,
*::after {
  -ms-overflow-style: none !important;
  scrollbar-width: none !important;
}

::-webkit-scrollbar,
*::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  background: transparent !important;
}

/* Taş Panel (Mat Yüzey, Hafif Kenarlık) */
.glass-panel {
  background: var(--bg-card);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(201, 194, 174, 0.08);
}

.hidden,
[hidden] {
  display: none !important;
}

/* Reconnecting Banner (Altın Bant - Çentik Uyumlu) */
.reconnecting-banner {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100001;
  background: var(--warning);
  color: #1a1208;
  text-align: center;
  padding: calc(6px + env(safe-area-inset-top, 0px)) 12px 6px 12px;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 0.85rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

/* Toast Bildirimleri (Mat Taş Zemin, Sıfır İkon - Çentik Uyumlu) */
.toast-container {
  position: fixed;
  top: calc(16px + env(safe-area-inset-top, 0px));
  left: 50%;
  transform: translateX(-50%);
  z-index: 100000;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  width: min(92vw, 420px);
}

.toast {
  pointer-events: auto;
  background: var(--bg-surface-elevated);
  color: var(--text-main);
  border: 1px solid var(--border-card);
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.88rem;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  animation: toastIn 0.22s ease-out;
  transition: all 0.25s ease;
}

.toast-success {
  border-color: var(--success);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.6);
}

.toast-error {
  border-color: var(--danger);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.6);
}

.toast-warning {
  border-color: var(--warning);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.6);
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(-12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================================================================
   BUTON BİLEŞENLERİ (STANDART VE SIFIR İKON)
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 0.95rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.18s ease;
  text-decoration: none;
  white-space: nowrap;
  box-sizing: border-box;
  user-select: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
  color: #1a1208;
  font-weight: 900;
  border: 1px solid rgba(212, 160, 23, 0.45);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.55);
  filter: brightness(1.08);
}

.btn-secondary {
  background: var(--bg-surface-elevated);
  border-color: var(--board-border);
  color: var(--text-main);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}

.btn-secondary:hover:not(:disabled) {
  background: #302b22;
  border-color: #827765;
  color: #ffffff;
}

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

.btn-outline:hover:not(:disabled) {
  background: rgba(201, 194, 174, 0.08);
  color: var(--text-main);
}

.btn-success {
  background: var(--success);
  color: #ffffff;
  border: 1px solid rgba(77, 138, 90, 0.6);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

.btn-warning {
  background: linear-gradient(135deg, var(--warning) 0%, #a87a1c 100%);
  color: #1a1208;
  font-weight: 800;
  border: 1px solid rgba(212, 160, 23, 0.5);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

.btn-danger {
  background: var(--danger);
  color: #ffffff;
  border: 1px solid rgba(179, 49, 43, 0.6);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

.btn-text {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 6px 12px;
  font-size: 0.85rem;
  font-weight: 700;
}

.btn-text:hover {
  color: var(--text-main);
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.82rem;
  border-radius: var(--radius-sm);
  min-height: 38px;
}

.btn-large {
  padding: 14px 28px;
  font-size: 1.05rem;
}

.btn-block {
  width: 100%;
}

.btn:disabled,
.btn.disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* Form Elemanları */
.form-input {
  width: 100%;
  padding: 12px 16px;
  background: rgba(14, 12, 10, 0.65);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1rem; /* iOS Safari otomatik yakınlaştırmasını (auto-zoom) önlemek için min 16px */
  outline: none;
  transition: all 0.18s ease;
  box-sizing: border-box;
}

.form-input:focus {
  border-color: var(--border-focus);
  box-shadow: none;
  background: rgba(14, 12, 10, 0.85);
}

.form-input::placeholder {
  color: var(--text-dim);
  font-weight: 500;
}

.input-error-msg {
  color: var(--danger);
  font-size: 0.78rem;
  font-weight: 700;
  margin-top: 4px;
}

/* ==========================================================================
   ANA UYGULAMA ALANI & EKRANLAR
   ========================================================================== */
.app-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1280px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  box-sizing: border-box;
}

.view-screen {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.25s ease-out;
}

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

/* ==========================================================================
   1. LOBİ VE BEKLEME EKRANI (TAŞ TAPINAK LOBİSİ)
   ========================================================================== */
#lobby-screen {
  min-height: calc(100vh - 20px);
  min-height: calc(100dvh - 20px);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.lobby-card {
  width: 100%;
  max-width: 520px;
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: auto;
  border: 2px solid var(--warning);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.65);
}

.lobby-header-titles {
  text-align: center;
  margin-bottom: 2px;
}

.lobby-game-title {
  font-family: var(--font-title);
  font-weight: 800;
  font-size: 1.85rem;
  color: var(--text-main);
  letter-spacing: 0.1em;
  text-shadow: 0 3px 6px rgba(0, 0, 0, 0.85), 0 0 2px rgba(212, 160, 23, 0.45);
}

.lobby-subtitle {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-top: 2px;
}

/* LOBİ OYUNCU KUTUSU VE LİSTESİ */
.lobby-players-box {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: rgba(14, 12, 10, 0.45);
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.players-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-title);
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

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

.btn-lobby-sound-badge {
  position: relative;
  width: 28px;
  height: 28px;
  min-width: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
  background: rgba(212, 160, 23, 0.16);
  border: 1px solid rgba(212, 160, 23, 0.45);
  color: var(--warning);
  transition: background 0.18s ease, border-color 0.18s ease;
  user-select: none;
  -webkit-user-select: none;
  flex-shrink: 0;
  box-sizing: border-box;
}

/* WCAG 44x44px dokunmatik hedef alanı */
.btn-lobby-sound-badge::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
}

#btn-game-sound,
#btn-restart-game {
  position: relative;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
  background: rgba(212, 160, 23, 0.16);
  border: 1px solid rgba(212, 160, 23, 0.45);
  color: var(--warning);
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
  user-select: none;
  -webkit-user-select: none;
  flex-shrink: 0;
  box-sizing: border-box;
}

#btn-game-sound::after,
#btn-restart-game::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
}

#btn-game-sound .sound-icon,
#btn-restart-game .restart-icon {
  width: 20px;
  height: 20px;
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.25, 1);
}

.btn-lobby-sound-badge:hover,
#btn-game-sound:hover,
#btn-restart-game:hover {
  background: rgba(212, 160, 23, 0.25);
  border-color: rgba(212, 160, 23, 0.65);
}

#btn-restart-game:hover .restart-icon {
  transform: rotate(-90deg);
}

#btn-restart-game:active {
  transform: scale(0.92);
}

.btn-lobby-sound-badge:active,
#btn-game-sound:active {
  background: rgba(212, 160, 23, 0.32);
}

.btn-lobby-sound-badge.sound-muted,
#btn-game-sound.sound-muted {
  background: rgba(22, 19, 16, 0.65);
  border-color: rgba(120, 113, 108, 0.35);
  color: #8c827a;
}

.btn-lobby-sound-badge.sound-muted:hover,
#btn-game-sound.sound-muted:hover {
  background: rgba(32, 28, 24, 0.85);
  border-color: rgba(168, 162, 158, 0.45);
}

.sound-icon {
  display: block;
  flex-shrink: 0;
}

.sound-wave,
.sound-wave-1,
.sound-wave-2 {
  opacity: 1;
}

.player-count-badge {
  background: rgba(212, 160, 23, 0.16);
  border: 1px solid rgba(212, 160, 23, 0.45);
  color: var(--warning);
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-family: var(--font-heading);
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
}

.players-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-height: 120px;
  overflow-y: auto;
  overflow-x: hidden;
  width: 100%;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
}

.players-list::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

/* KİŞİ KARTLARI ÇİPİ */
.player-card-chip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex: 1 1 calc(50% - 4px);
  height: 52px;
  min-height: 52px;
  max-height: 52px;
  box-sizing: border-box;
  padding: 8px 14px;
  background: rgba(36, 30, 22, 0.85);
  border: 1px solid rgba(201, 154, 46, 0.45);
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
  overflow: hidden;
}

.player-card-chip.is-self {
  border: 1.5px solid rgba(212, 160, 23, 0.9);
  background: rgba(44, 36, 26, 0.92);
}

.players-list .player-card-chip:last-child:nth-child(odd) {
  flex: 1 1 100%;
}

.player-card-chip.is-disconnected {
  opacity: 0.5;
  border-style: dashed;
  background: rgba(14, 12, 10, 0.3);
}

.player-card-left {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  min-width: 0;
  flex: 1 1 auto;
}

.player-card-name {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 0.92rem;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  flex: 1 1 auto;
}

.offline-tag {
  font-size: 0.7rem;
  color: var(--danger);
  font-weight: 800;
  margin-left: 4px;
  flex-shrink: 0;
  white-space: nowrap;
}

.player-card-right {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-left: 8px;
  height: 22px;
}

.leader-crown-icon {
  display: block;
  flex-shrink: 0;
  width: 24px;
  height: 20px;
}

/* LOBİ MOD / AYAR SEÇİCİLERİ */
.lobby-mode-box {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: rgba(14, 12, 10, 0.45);
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.lobby-setting-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

html.is-multiplayer #bot-difficulty-box,
body.is-multiplayer #bot-difficulty-box,
.is-multiplayer #bot-difficulty-box {
  display: none !important;
}

.lobby-setting-group + .lobby-setting-group:not(.hidden) {
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
}

.setting-title-row {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.host-only-hint {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--warning);
}

.section-label {
  font-family: var(--font-title);
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.mode-pills {
  display: flex;
  gap: 6px;
}

.mode-pill {
  flex: 1;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  padding: 8px 6px;
  min-height: 42px;
  cursor: pointer;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  transition: all 0.15s ease;
  user-select: none;
}

.mode-pill:hover:not(.active):not(.disabled) {
  background: #302b22;
  color: var(--text-main);
  border-color: #827765;
}

.mode-pill.active {
  background: var(--primary);
  border-color: #d4a017;
  color: #1a1208;
  font-weight: 900;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.mode-pills.disabled .mode-pill {
  opacity: 0.6;
  cursor: not-allowed;
}

.mode-pill:disabled,
.mode-pill.disabled {
  opacity: 0.42;
  cursor: not-allowed;
  filter: grayscale(0.5);
}

/* Lobi Aksiyon Butonları */
.lobby-footer-btns {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}

.lobby-wait-hint {
  text-align: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-dim);
}

.lobby-aux-row {
  display: flex;
  justify-content: center;
  align-items: center;
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
}

/* ==========================================================================
   KANZI STANDARDI SABİT (i) NASIL OYNANIR BUTONU (SOL ALT KÖŞE - TAŞ TAPINAK)
   ========================================================================== */
.global-how-to-btn {
  position: fixed;
  bottom: calc(36px + env(safe-area-inset-bottom, 0px)) !important;
  left: calc(20px + env(safe-area-inset-left, 0px)) !important;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #383024 0%, #211c15 70%, #14120e 100%);
  border: 2px solid var(--primary);
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.75),
    inset 0 1px 2px rgba(255, 255, 255, 0.25),
    inset 0 -2px 6px rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 999999;
  outline: none;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.25s ease, border-color 0.25s ease, opacity 0.25s ease, visibility 0.25s ease;
  user-select: none;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

#app-container {
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.how-to-btn-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.8));
  transition: color 0.25s ease, transform 0.25s ease;
}

.how-to-icon {
  width: 24px;
  height: 24px;
  stroke: var(--primary);
  transition: stroke 0.25s ease, transform 0.25s ease;
}

.global-how-to-btn:hover {
  transform: translateY(-3px) scale(1.1);
  border-color: #f1ead8;
  box-shadow:
    0 12px 30px rgba(0, 0, 0, 0.85),
    inset 0 1px 2px rgba(255, 255, 255, 0.4);
}

.global-how-to-btn:hover .how-to-icon {
  stroke: #f1ead8;
  transform: scale(1.1);
}

.global-how-to-btn:active {
  transform: translateY(1px) scale(0.95);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.8);
}

/* Ambient Pulsing Aura Effect (Altın Halka) */
.btn-glow-ring {
  display: none !important;
}

@keyframes auraPulse {
  0% { transform: scale(0.92); opacity: 0.85; }
  50% { transform: scale(1.18); opacity: 0.15; }
  100% { transform: scale(0.92); opacity: 0.85; }
}

/* ==========================================================================
   2. OYUN ARENASI (GAME ARENA & BOARD)
   ========================================================================== */
#game-screen {
  width: 100%;
  height: 100vh;
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  box-sizing: border-box;
  padding: 4px 0;
  gap: 8px;
}

/* Üst Durum Barı (Oyun Alanı Genişliğini Aşmaz, Alt Bar İle Birebir Aynı Boyutta) */
.game-top-bar {
  width: min(calc(100vw - 20px), calc(100dvh - 190px), 560px);
  max-width: 100%;
  height: 58px;
  min-height: 58px;
  margin: 0 auto;
  padding: 6px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-shrink: 0;
  border-radius: var(--radius-md);
  box-sizing: border-box;
}

.top-bar-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex-shrink: 1;
}

.top-bar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Sıra Göstergesi - Krem Rengi Arkaplan (Alt Butonlarla Eşit 44px Yükseklik) */
.active-turn-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  min-height: 44px;
  padding: 0 16px;
  background: linear-gradient(135deg, #f7f1e3 0%, #ebe1c9 100%);
  border: 1px solid rgba(212, 160, 23, 0.45);
  border-radius: var(--radius-full);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 0.94rem;
  color: #1f1811;
  letter-spacing: 0.01em;
  transition: all 0.2s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 260px;
  box-sizing: border-box;
}

.active-turn-badge.is-my-turn {
  background: linear-gradient(135deg, #fff9ee 0%, #f3e6ca 100%);
  border-color: #d4a017;
  box-shadow: 0 2px 10px rgba(212, 160, 23, 0.4);
  color: #171007;
  font-weight: 900;
}

.turn-player-name {
  color: inherit;
  font-family: inherit;
  font-weight: inherit;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.goal-info-badge {
  display: none !important;
}

/* Süre Kutusu (Timer) - Sıranın Sağında, Ses Butonunun Solunda (44px Yükseklik) */
.timer-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0 12px;
  background: rgba(28, 24, 19, 0.9);
  border-radius: var(--radius-full);
  border: 1px solid rgba(212, 160, 23, 0.4);
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 1.05rem;
  color: var(--warning);
  line-height: 1;
  box-sizing: border-box;
  transition: all 0.2s ease;
}

.timer-box.timer-critical {
  border-color: var(--danger);
  color: var(--danger);
  background: rgba(179, 49, 43, 0.25);
  box-shadow: 0 0 8px rgba(179, 49, 43, 0.4);
  animation: timerPulse 0.7s infinite alternate;
}

@keyframes timerPulse {
  0% { transform: scale(1); }
  100% { transform: scale(1.08); }
}

/* Oyuncular ve Duvar Skorları Şeridi (Oyun İçi Kişi Kartları - Tamamen Kaldırıldı) */
.game-players-bar,
.player-status-pill {
  display: none !important;
}

/* ==========================================================================
   KORİDOR TAHTASI KONTEYNERİ (17x17 GRID MİMARİSİ)
   ========================================================================== */
.board-stage {
  flex: 0 0 auto;
  min-height: 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  padding: 0;
  margin: 0;
  box-sizing: border-box;
}

.board-container {
  width: min(calc(100vw - 20px), calc(100dvh - 190px), 560px);
  height: min(calc(100vw - 20px), calc(100dvh - 190px), 560px);
  aspect-ratio: 1 / 1;
  max-width: 100%;
  max-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

/* Tahta (Antik Taş Karo Zemin, Çift Hat Kenarlık) */
.koridor-board {
  width: 100%;
  height: 100%;
  background: var(--board-bg);
  border: 3px solid var(--board-border);
  border-radius: var(--radius-md);
  box-shadow:
    0 12px 35px rgba(0, 0, 0, 0.8),
    inset 0 0 18px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(201, 194, 174, 0.12);
  display: grid;
  grid-template-columns: 
    1fr clamp(4px, 1.2vw, 8px) 1fr clamp(4px, 1.2vw, 8px) 1fr clamp(4px, 1.2vw, 8px)
    1fr clamp(4px, 1.2vw, 8px) 1fr clamp(4px, 1.2vw, 8px) 1fr clamp(4px, 1.2vw, 8px)
    1fr clamp(4px, 1.2vw, 8px) 1fr clamp(4px, 1.2vw, 8px) 1fr;
  grid-template-rows: 
    1fr clamp(4px, 1.2vw, 8px) 1fr clamp(4px, 1.2vw, 8px) 1fr clamp(4px, 1.2vw, 8px)
    1fr clamp(4px, 1.2vw, 8px) 1fr clamp(4px, 1.2vw, 8px) 1fr clamp(4px, 1.2vw, 8px)
    1fr clamp(4px, 1.2vw, 8px) 1fr clamp(4px, 1.2vw, 8px) 1fr;
  padding: clamp(6px, 1.5vw, 12px);
  box-sizing: border-box;
  position: relative;
  touch-action: manipulation;
}

.koridor-board.wall-mode-active {
  touch-action: none;
}

/* Tahta Kareleri (9x9 Yontulmuş Taş Karo) */
.board-cell {
  background-color: var(--cell-bg);
  background-image: radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.03) 0%, transparent 80%);
  border-radius: clamp(3px, 0.8vw, 6px);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 10;
  cursor: pointer;
  transition: background-color 0.15s ease, box-shadow 0.15s ease;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    inset 0 -2px 0 rgba(0, 0, 0, 0.25),
    0 2px 4px rgba(0, 0, 0, 0.35);
}

.board-cell:has(.pawn-token) {
  z-index: 40;
}

.board-cell:hover {
  background-color: var(--cell-hover);
}

/* Merkez Hedef Karesi (Orta Kareye Ulaş Modu - Lider Tacı İkonu) */
.board-cell.center-cell-target {
  background: radial-gradient(circle, rgba(212, 160, 23, 0.24) 0%, rgba(179, 49, 43, 0.18) 50%, var(--cell-bg) 85%);
  border: 2px dashed var(--warning);
  box-shadow: 0 0 10px rgba(212, 160, 23, 0.35), inset 0 0 6px rgba(212, 160, 23, 0.2);
}

.center-goal-crown {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60%;
  height: 60%;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 15;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.8));
  opacity: 0.95;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.center-goal-crown .leader-crown-icon {
  width: 100%;
  height: 100%;
  display: block;
}

.board-cell:has(.pawn-token) .center-goal-crown {
  opacity: 0.25;
  transform: translate(-50%, -50%) scale(0.8);
}

/* Hedef Kenar Kareleri (Taş Tapınak Hafif Oyma Vurgusu - İkon Yok) */
.board-cell.my-goal-cell {
  box-shadow: inset 0 0 0 1px rgba(212, 160, 23, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.12), inset 0 -2px 0 rgba(0, 0, 0, 0.25);
}

.lobby-mode-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 8px;
  line-height: 1.4;
}

/* Geçerli Piyon Hamlesi Olan Kareler */
.board-cell.valid-move {
  background: rgba(77, 138, 90, 0.35) !important;
  box-shadow: inset 0 0 8px rgba(77, 138, 90, 0.3) !important;
}

.board-cell.valid-move::before {
  content: '';
  width: clamp(12px, 3.2vw, 18px);
  height: clamp(12px, 3.2vw, 18px);
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 2px #e8f5ea, 0 2px 6px rgba(0, 0, 0, 0.5);
  animation: movePulse 0.9s infinite alternate;
}

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

/* Piyon Görseli (Belirgin Kontrast, 2px Açık Kenarlık, 1-4 Numarası) */
.pawn-token {
  width: 76%;
  height: 76%;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: clamp(0.85rem, 2.5vw, 1.25rem);
  color: #14110d;
  border: 2px solid #f3ecd8;
  box-shadow:
    0 3px 6px rgba(0, 0, 0, 0.55),
    inset 0 2px 3px rgba(255, 255, 255, 0.35);
  z-index: 40;
  pointer-events: none;
  will-change: transform;
}

.pawn-number {
  display: inline-block;
  line-height: 1;
  pointer-events: none;
  text-shadow: 0 0 2px rgba(255, 255, 255, 0.95), 0 1px 2px rgba(255, 255, 255, 0.75);
}

/* Aktif Oyuncu Piyonu (2px Altın Dış Halka) */
.pawn-token.active-player-pawn {
  box-shadow:
    0 0 0 2px #d4a017,
    0 4px 12px rgba(0, 0, 0, 0.6),
    inset 0 2px 3px rgba(255, 255, 255, 0.35);
}

.pawn-token.active-player-pawn .pawn-number {
  animation: none !important;
  transform: none !important;
}

/* Son Hamle Karesi (Altın Kenarlık) */
.board-cell.last-move-cell {
  border: 2px solid var(--warning) !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.6) !important;
}

/* Duvar Yuvaları (Oyuk Taş Kanalları) */
.groove-channel {
  background: var(--groove-bg);
  box-shadow: inset 0 0 4px rgba(0, 0, 0, 0.6);
  position: relative;
  z-index: 5;
}

.groove-intersection {
  background: var(--groove-bg);
  box-shadow: inset 0 0 4px rgba(0, 0, 0, 0.6);
  position: relative;
  z-index: 15;
}

/* Konulmuş Duvarlar (Yontulmuş Açık Taş Blok) */
.placed-wall {
  position: relative;
  width: 100%;
  height: 100%;
  z-index: 25;
  background: linear-gradient(90deg, #d5cfbb 0%, #c9c2ae 50%, #b9b29b 100%);
  border-radius: 3px;
  box-shadow: 0 2px 0 var(--board-border), 0 3px 8px var(--wall-shadow);
  pointer-events: none;
}

/* Son Konulan Duvar (Altın Damarlı Taş Blok) */
.placed-wall.last-placed-wall {
  background: linear-gradient(135deg, #e6b83b 0%, #d4a017 50%, #a87a1c 100%);
  box-shadow:
    0 0 0 1px #8a6410,
    0 0 10px rgba(212, 160, 23, 0.45),
    0 2px 0 var(--board-border),
    0 3px 8px var(--wall-shadow);
}

/* Duvar Önizleme (Neon Yok, Mat Kenarlık ve Gölge) */
.wall-preview {
  position: relative;
  width: 100%;
  height: 100%;
  z-index: 30;
  border-radius: 3px;
  pointer-events: none;
}

.wall-preview.valid {
  background: var(--success);
  opacity: 0.9;
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.wall-preview.invalid {
  background: var(--danger);
  opacity: 0.9;
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

/* Alt Aksiyon Çubuğu (Toolbar - Oyun Alanı Genişliğini Aşmaz, 3 Eşit Buton) */
.game-action-toolbar {
  width: min(calc(100vw - 20px), calc(100dvh - 190px), 560px);
  max-width: 100%;
  height: 58px;
  min-height: 58px;
  margin: 0 auto;
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex-shrink: 0;
  border-radius: var(--radius-md);
  box-sizing: border-box;
}

.action-mode-group {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  flex-shrink: 0;
  box-sizing: border-box;
}

.action-mode-btn {
  flex: 1 1 0;
  min-width: 0;
  width: 0;
  height: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.15s ease;
  box-sizing: border-box;
  text-align: center;
  white-space: nowrap;
}

.action-mode-btn:hover:not(.active) {
  background: #302b22;
  color: var(--text-main);
  border-color: #827765;
}

/* Piyon/Duvar Seçili Durumu (Altın Vurgu, Koyu Yazı) */
.action-mode-btn.active {
  background: var(--primary);
  border-color: #d4a017;
  color: #1a1208;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  font-weight: 900;
}

#btn-toggle-ready:disabled {
  pointer-events: none;
  cursor: not-allowed;
  opacity: 0.85;
}

.modal-footer {
  margin-top: 14px;
  width: 100%;
}

/* Dokunmatik Cihazlar İçin Çift Dokunma Önleme */
.koridor-board,
.board-cell,
.btn,
.mode-pill,
.action-mode-btn,
.global-how-to-btn {
  touch-action: manipulation;
}

.koridor-board.wall-mode-active {
  touch-action: none;
}

.wall-controls-group {
  display: contents;
}

.action-hint-box {
  display: none !important;
}

.action-hint-text {
  font-size: 0.76rem;
  color: var(--text-muted);
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.action-hint-text:empty {
  display: none !important;
}

/* Dokunmatik Mobil Duvar İpucu Rozeti */
.wall-touch-indicator {
  position: fixed;
  z-index: 99999;
  pointer-events: none;
  transform: translate(-50%, -100%);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  white-space: nowrap;
  background: var(--bg-surface-elevated);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  gap: 6px;
  transition: opacity 0.1s ease;
}

.wall-touch-indicator.valid {
  border-color: var(--success);
}

.wall-touch-indicator.invalid {
  border-color: var(--danger);
}

/* ==========================================================================
   MODALLAR VE PENCERELER (TAŞ TAPINAK TEMASI, SIFIR İKON)
   ========================================================================== */
.overlay-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000000;
  background: rgba(14, 12, 10, 0.88);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
}

/* ==========================================================================
   KANZI STANDARDI NASIL OYNANIR MODALI
   ========================================================================== */
.global-how-to-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  background: rgba(14, 12, 10, 0.88);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999999;
  padding: 15px;
  box-sizing: border-box;
  animation: fadeInHowToModal 0.25s ease-out forwards;
}

.global-how-to-modal.hidden {
  display: none !important;
}

@keyframes fadeInHowToModal {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.global-how-to-box {
  background: linear-gradient(165deg, #24201a 0%, #15130f 100%);
  border: 2px solid var(--board-border);
  box-shadow:
    0 0 35px rgba(0, 0, 0, 0.9),
    inset 0 1px 1px rgba(255, 255, 255, 0.1),
    0 0 20px rgba(201, 154, 46, 0.12);
  color: var(--text-main);
  padding: 26px 28px;
  border-radius: 20px;
  width: min(92vw, 530px);
  position: relative;
  max-height: calc(88vh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
  max-height: calc(88dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  font-family: var(--font-heading);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -ms-overflow-style: none;
  scrollbar-width: none;
  box-sizing: border-box;
}

.global-how-to-box::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  background: transparent !important;
}

.global-how-to-close {
  position: absolute;
  top: 14px;
  right: 18px;
  z-index: 10;
  width: 36px !important;
  height: 36px !important;
  padding: 0 !important;
  border: none !important;
  background: transparent !important;
  color: var(--primary);
  font-size: 2rem;
  font-weight: 700;
  cursor: pointer;
  line-height: 1;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: color 0.2s ease, transform 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

/* WCAG 44x44px dokunmatik hedef alanı */
.global-how-to-close::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 44px;
  height: 44px;
}

.global-how-to-close:hover {
  color: var(--text-main);
  transform: scale(1.15);
}

.global-how-to-title {
  font-family: var(--font-title);
  color: var(--warning);
  font-size: 1.4rem;
  font-weight: 800;
  text-align: center;
  margin: 0 0 4px 0;
  padding: 0 35px;
  letter-spacing: 0.08em;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.7);
}

.global-how-to-subtitle {
  color: var(--text-muted);
  font-size: 0.85rem;
  text-align: center;
  margin: 0 0 18px 0;
}

.global-how-to-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.global-how-to-content .rules-section,
.global-how-to-content .rules-card {
  background: linear-gradient(135deg, rgba(212, 160, 23, 0.22) 0%, rgba(191, 141, 19, 0.12) 100%);
  border: 1px solid rgba(212, 160, 23, 0.45);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 0;
  box-sizing: border-box;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.global-how-to-content .rules-section h4,
.global-how-to-content .rules-card h4 {
  font-family: var(--font-title);
  color: #f5c542;
  margin: 0 0 6px 0;
  font-size: 0.98rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

.global-how-to-content .rules-section p,
.global-how-to-content .rules-card p {
  margin: 0;
  font-size: 0.88rem;
  color: #f1ead8;
  font-weight: 500;
  line-height: 1.55;
}

.global-how-to-content strong {
  color: #ffffff;
  font-weight: 800;
}

/* Zafer & Skor Bordu */
.modal-card {
  width: 100%;
  max-width: 500px;
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: 90vh;
  max-height: 90dvh;
  overflow-y: auto;
  box-sizing: border-box;
}

.scoreboard-card {
  text-align: center;
}

.victory-tag {
  display: inline-block;
  padding: 3px 12px;
  background: rgba(212, 160, 23, 0.16);
  border: 1px solid var(--warning);
  color: var(--warning);
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 0.78rem;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.victory-title {
  font-family: var(--font-title);
  font-weight: 800;
  font-size: 1.8rem;
  color: var(--text-main);
  letter-spacing: 0.06em;
  text-shadow: 0 3px 6px rgba(0, 0, 0, 0.8);
}

.victory-subtitle {
  font-size: 0.88rem;
  color: var(--text-muted);
}

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

.stat-box {
  background: rgba(14, 12, 10, 0.5);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-label {
  font-family: var(--font-title);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.stat-value {
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 1.25rem;
  color: var(--text-main);
}

.scoreboard-ranking-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
}

.final-scoreboard-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.final-score-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
}

.final-score-item.is-winner {
  border-color: rgba(212, 160, 23, 0.45);
  background: rgba(212, 160, 23, 0.1);
}

.score-item-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.score-rank-badge {
  font-weight: 800;
  color: var(--text-dim);
}

.score-rank-badge.rank-1 {
  color: var(--warning);
}

.score-player-name {
  font-weight: 800;
  color: var(--text-main);
}

.score-stats-row {
  display: flex;
  gap: 14px;
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--text-muted);
}

.victory-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
}

#btn-play-again:disabled {
  pointer-events: none;
  cursor: not-allowed;
  opacity: 0.85;
}

/* Katılma Hatası Sabit Modalı */
.join-in-progress-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000000;
  background: rgba(14, 12, 10, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.join-in-progress-card {
  width: 100%;
  max-width: 420px;
  padding: 30px 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: linear-gradient(165deg, #24201a 0%, #15130f 100%);
  border: 2px solid var(--board-border);
}

.join-in-progress-title {
  font-family: var(--font-title);
  font-weight: 800;
  font-size: 1.35rem;
  color: var(--warning);
  letter-spacing: 0.08em;
}

.join-in-progress-message {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ==========================================================================
   MOBİL VE FARKLI EKRAN BOYUTLARI (@media)
   320x568, 360x640, 390x844, 844x390, 667x375, 768x1024, 1280x720
   ========================================================================== */
@media (max-width: 768px) {
  .app-container {
    padding: 6px;
  }

  .game-top-bar {
    width: min(calc(100vw - 16px), calc(100dvh - 195px), 520px);
    max-width: 100%;
    margin: 0 auto;
    padding: 6px 8px;
  }

  .game-action-toolbar {
    width: min(calc(100vw - 16px), calc(100dvh - 195px), 520px);
    max-width: 100%;
    margin: 0 auto;
    padding: 6px 8px;
    gap: 4px;
  }

  .board-container {
    width: min(calc(100vw - 16px), calc(100dvh - 195px), 520px);
    height: min(calc(100vw - 16px), calc(100dvh - 195px), 520px);
  }
}

@media (max-width: 600px) {
  .global-how-to-btn {
    width: 44px;
    height: 44px;
    bottom: calc(36px + env(safe-area-inset-bottom, 0px)) !important;
    left: calc(20px + env(safe-area-inset-left, 0px)) !important;
  }

  .how-to-icon {
    width: 20px;
    height: 20px;
  }

  .global-how-to-box {
    padding: 20px 20px;
    border-radius: 16px;
    -ms-overflow-style: none;
    scrollbar-width: none;
  }

  .global-how-to-title {
    font-size: 1.2rem;
  }

  .global-how-to-content .rules-section,
  .global-how-to-content .rules-card {
    padding: 12px 14px;
  }

  .global-how-to-content p {
    font-size: 0.85rem;
    line-height: 1.5;
  }

  .game-top-bar {
    width: min(calc(100vw - 12px), calc(100dvh - 190px));
    max-width: 100%;
    margin: 0 auto;
    padding: 4px 6px;
  }

  .game-action-toolbar {
    width: min(calc(100vw - 12px), calc(100dvh - 190px));
    max-width: 100%;
    margin: 0 auto;
    padding: 4px 6px;
    gap: 4px;
  }

  .action-mode-group {
    gap: 6px;
  }

  .action-mode-btn {
    font-size: 0.82rem;
    padding: 6px 6px;
  }

  .board-container {
    width: min(calc(100vw - 12px), calc(100dvh - 190px));
    height: min(calc(100vw - 12px), calc(100dvh - 190px));
  }
}

@media (max-width: 480px) {
  .lobby-card {
    padding: 24px 16px;
    gap: 14px;
  }

  .player-card-chip {
    padding: 6px 10px;
  }

  .mode-pill {
    padding: 6px 4px;
    font-size: 0.75rem;
  }

  .pill-player-name {
    max-width: 65px;
  }

  .btn-sm {
    padding: 6px 10px;
    font-size: 0.8rem;
  }

  .game-top-bar {
    width: min(calc(100vw - 10px), calc(100dvh - 185px));
    max-width: 100%;
    height: 52px;
    min-height: 52px;
    margin: 0 auto;
    padding: 4px 6px;
  }

  .game-action-toolbar {
    width: min(calc(100vw - 10px), calc(100dvh - 185px));
    max-width: 100%;
    height: 52px;
    min-height: 52px;
    margin: 0 auto;
    padding: 4px 6px;
  }

  .active-turn-badge,
  .timer-box,
  #btn-game-sound {
    height: 42px;
    min-height: 42px;
  }

  #btn-game-sound {
    width: 42px;
    min-width: 42px;
  }

  .board-container {
    width: min(calc(100vw - 10px), calc(100dvh - 185px));
    height: min(calc(100vw - 10px), calc(100dvh - 185px));
  }
}

@media (max-width: 360px) {
  .app-container {
    padding: 3px;
  }

  .lobby-card {
    padding: 16px 10px;
  }

  .player-card-chip {
    padding: 5px 8px;
  }

  .game-top-bar {
    width: min(calc(100vw - 6px), calc(100dvh - 175px));
    max-width: 100%;
    height: 48px;
    min-height: 48px;
    margin: 0 auto;
    padding: 4px;
  }

  .game-action-toolbar {
    width: min(calc(100vw - 6px), calc(100dvh - 175px));
    max-width: 100%;
    height: 48px;
    min-height: 48px;
    margin: 0 auto;
    padding: 4px;
    gap: 4px;
  }

  .action-mode-group {
    gap: 4px;
  }

  .action-mode-btn {
    font-size: 0.78rem;
    padding: 4px;
    height: 38px;
    min-height: 38px;
  }

  .active-turn-badge,
  .timer-box,
  #btn-game-sound {
    height: 38px;
    min-height: 38px;
  }

  #btn-game-sound {
    width: 38px;
    min-width: 38px;
  }

  .board-container {
    width: min(calc(100vw - 6px), calc(100dvh - 175px));
    height: min(calc(100vw - 6px), calc(100dvh - 175px));
  }
}

/* ==========================================================================
   MOBİL YATAY EKRAN ENGELLEYİCİ (ORIENTATION WARNING - KANZI STANDARDI)
   ========================================================================== */
#orientation-warning {
  display: none;
  position: fixed;
  inset: 0;
  width: 100vw;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  background: rgba(14, 11, 8, 0.98);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 99999999;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  box-sizing: border-box;
}

#orientation-warning.force-show {
  display: flex !important;
}

.orientation-warning-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  max-width: 360px;
}

#orientation-warning .phone-rotate-icon {
  color: var(--primary);
  filter: drop-shadow(0 0 16px rgba(212, 160, 23, 0.6));
  animation: rotatePhone 2.2s infinite cubic-bezier(0.4, 0, 0.2, 1);
}

#orientation-warning h2 {
  font-family: var(--font-heading);
  font-size: clamp(1.15rem, 4.5vw, 1.45rem);
  font-weight: 900;
  color: #f7f1e3;
  letter-spacing: 0.05em;
  margin: 0;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
}

#orientation-warning p {
  font-family: var(--font-body);
  font-size: clamp(0.85rem, 2.5vw, 0.96rem);
  color: var(--text-muted);
  line-height: 1.55;
  margin: 0;
}

@keyframes rotatePhone {
  0%, 15% { transform: rotate(0deg); }
  45%, 65% { transform: rotate(-90deg); }
  90%, 100% { transform: rotate(0deg); }
}

@media (pointer: coarse) and (orientation: landscape) and (max-height: 600px),
       (hover: none) and (orientation: landscape) and (max-height: 600px),
       screen and (orientation: landscape) and (max-height: 540px) and (max-width: 960px) {
  #orientation-warning {
    display: flex !important;
  }
}

@media (max-height: 500px) {
  .global-how-to-btn {
    width: 40px;
    height: 40px;
    bottom: calc(10px + env(safe-area-inset-bottom, 0px)) !important;
    left: calc(10px + env(safe-area-inset-left, 0px)) !important;
  }

  .how-to-icon {
    width: 18px;
    height: 18px;
  }

  .global-how-to-box {
    max-height: 90vh;
    padding: 16px 18px;
    -ms-overflow-style: none;
    scrollbar-width: none;
  }
}

/* Erişilebilirlik (Hareket Azaltma Tercihi) */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
