/* ==========================================================================
   ÇİZBİL - CSS TASARIM SİSTEMİ (PURE VANILLA CSS3 - DARK MODE & GLASSMORPHISM)
   ========================================================================== */

:root {
  --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* Renk Paleti */
  --bg-dark: #0a0d14;
  --bg-surface: #111624;
  --bg-surface-elevated: #182033;
  --bg-card: rgba(22, 29, 46, 0.72);
  --bg-card-hover: rgba(29, 39, 62, 0.85);

  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(99, 102, 241, 0.5);
  --border-card: rgba(255, 255, 255, 0.12);

  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-glow: rgba(99, 102, 241, 0.45);
  
  --secondary: #8b5cf6;
  --accent-pink: #ec4899;
  --accent-cyan: #06b6d4;

  --success: #10b981;
  --success-glow: rgba(16, 185, 129, 0.35);
  --warning: #f59e0b;
  --danger: #ef4444;

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

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

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 24px var(--primary-glow);

  --canvas-bg: #ffffff;
}

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

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

html, body {
  width: 100%;
  min-height: 100%;
  overflow-x: hidden;
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body {
  background-color: var(--bg-dark);
  background-image: url('bg.png');
  background-repeat: no-repeat;
  background-position: center center;
  background-size: cover;
  background-attachment: fixed;
}

/* Kaydırma Çubuğu */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.15);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Glassmorphism Paneller */
.glass-panel {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.glass-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.hidden,
[hidden],
.view-screen.hidden,
#lobby-screen.hidden,
#game-screen.hidden,
.fullscreen-modal.hidden,
.overlay-modal.hidden {
  display: none !important;
}

/* ==========================================================================
   ANA UYGULAMA ALANI & EKRANLAR
   ========================================================================== */
.app-container {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 0 !important;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.view-screen {
  width: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* ==========================================================================
   1. LOBİ VE BEKLEME EKRANI (WORDLE DÜZENİ MANTIĞI)
   ========================================================================== */
#lobby-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: calc(100vh - 32px);
  min-height: calc(100dvh - 32px);
  padding: 16px 8px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.lobby-card {
  width: 100%;
  max-width: 520px;
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  background: #ffffff;
  border: 2px solid #000000; /* Beyaz yapının etrafı siyah kaplandı */
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15); /* Neon parlamalar kaldırıldı */
  position: relative;
  margin: auto;
}

.header-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: #a5b4fc;
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.15rem;
  transition: all 0.15s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.header-btn:hover {
  background: rgba(99, 102, 241, 0.2);
  border-color: var(--primary);
  color: #ffffff;
  transform: translateY(-1px);
}

.header-btn:active {
  transform: translateY(1px);
}

/* LOBİ MOD / AYAR SEÇİCİLERİ */
.lobby-mode-box {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #bae6fd;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 2px solid #000000; /* Etrafı siyah kaplandı */
  box-shadow: none; /* Neon parlama kaldırıldı */
}

.section-label {
  font-family: var(--font-heading);
  font-size: clamp(0.8rem, 3.2vw, 0.92rem);
  font-weight: 800;
  color: #000000;
  display: flex;
  align-items: center;
  gap: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

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

.mode-pill {
  flex: 1;
  background: #ffffff;
  border: 2px solid #000000; /* Butonların etrafı siyah kaplandı */
  border-radius: var(--radius-sm);
  color: #000000;
  padding: 10px 6px;
  min-height: 42px;
  cursor: pointer;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: clamp(0.78rem, 3vw, 0.95rem);
  white-space: nowrap;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  transition: all 0.15s ease;
  user-select: none;
  box-shadow: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.mode-pill:hover:not(.active):not(.disabled) {
  background: #f1f5f9;
  border-color: #000000;
  color: #000000;
}

.mode-pill.active,
.mode-pill.active:hover,
.mode-pill.active:focus,
.mode-pill.active:active {
  background: #000000 !important;
  border-color: #000000 !important;
  color: #ffffff !important;
  box-shadow: none !important;
}

.mode-pills.disabled .mode-pill:not(.active) {
  opacity: 0.55;
  cursor: not-allowed;
}

/* LOBİ OYUNCU KUTUSU VE LİSTESİ */
.lobby-players-box {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #bae6fd;
  padding: 16px;
  border-radius: var(--radius-md);
  border: 2px solid #000000; /* Etrafı siyah kaplandı */
  box-shadow: none; /* Neon parlama kaldırıldı */
}

.players-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: clamp(0.85rem, 3.2vw, 0.95rem);
  color: #000000;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.player-count-badge {
  background: #ffffff;
  border: 2px solid #000000;
  color: #000000;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 800;
  white-space: nowrap;
  box-shadow: none;
}

.players-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-height: 114px; /* Tam 2 sıra = 4 oyuncu sığar; 5. oyuncu ve sonrası için kaydırılabilir olur */
  overflow-y: auto;
  overflow-x: hidden;
  width: 100%;
  scrollbar-width: none; /* Firefox için kaydırma çubuğunu gizle */
  -ms-overflow-style: none; /* IE / Edge için kaydırma çubuğunu gizle */
  -webkit-overflow-scrolling: touch;
}

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

/* KİŞİ KARTLARI ÇİPİ (WORDLE BİREBİR KİŞİ KARTI YAPISI) */
.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: 10px 14px;
  background: #ffffff;
  border: 2px solid #000000; /* Kişi kartlarının etrafı siyah kaplandı */
  border-radius: var(--radius-sm);
  box-shadow: none; /* Neon parlama kaldırıldı */
  transition: background 0.15s ease, border-color 0.15s ease;
  transform: none !important;
}

/* Son kart tek kalırsa tam genişlik kaplasın */
.player-card-chip:last-child:nth-child(odd) {
  flex: 1 1 100%;
}

.player-card-chip:hover {
  background: #f8fafc;
  border-color: #000000;
  box-shadow: none;
}

.player-card-chip.is-disconnected {
  opacity: 0.55;
  border-style: dashed;
  background: #f1f5f9;
}

.player-dot.offline {
  color: #94a3b8 !important;
}

.offline-tag {
  font-size: 0.72rem;
  color: #ef4444;
  font-weight: 700;
}

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

.player-dot {
  color: #000000;
  font-size: 1.15rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transform: translateY(-1.5px); /* Nokta ile yazıyı tam dikey eksende kusursuz eşitler */
}

.player-card-name {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.2;
  color: #000000;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-card-right {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  margin-left: 6px;
}

.host-crown-icon {
  color: #000000; /* Kral tacı tamamen siyah yapıldı */
  font-size: 1rem;
  filter: none; /* Neon sarı/parıltı kaldırıldı */
}

/* BUTONLAR (WORDLE DÜZENİ AKSİYON BUTONLARI) */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.btn:active:not(:disabled) {
  transform: translateY(2px);
}

.btn-block {
  width: 100%;
}

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

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: #ffffff;
  box-shadow: 0 4px 16px var(--primary-glow);
}

.btn-primary:hover:not(:disabled) {
  box-shadow: 0 6px 24px var(--primary-glow);
  filter: brightness(1.1);
}

/* Lobi Ekranı Oyunu Başlat ve Lider Bekleniyor Butonları: Lobi butonu lila rengiyle birebir aynı */
#lobby-screen #btn-start-game,
#lobby-screen .btn-primary {
  background: linear-gradient(135deg, #d900ff 0%, #7209b7 100%);
  border: 2px solid #000000; /* Etrafı siyah kaplandı */
  color: #000000; /* Metin siyah yapıldı */
  box-shadow: none; /* Neon parlama kaldırıldı */
  font-weight: 800;
}

#lobby-screen #btn-start-game:hover:not(:disabled),
#lobby-screen .btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #d900ff 0%, #7209b7 100%); /* Renk değişimi kaldırıldı, lila rengi sabit */
  border-color: #000000;
  color: #000000; /* Metin siyah */
  box-shadow: none;
  filter: none;
}

#lobby-screen #btn-start-game:disabled,
#lobby-screen #btn-start-game.disabled {
  background: linear-gradient(135deg, #d900ff 0%, #7209b7 100%);
  border: 2px solid #000000;
  color: rgba(0, 0, 0, 0.6);
  box-shadow: none;
  filter: none;
  opacity: 0.6;
}

.btn-warning {
  background: linear-gradient(135deg, #d900ff 0%, #7209b7 100%);
  border: 2px solid #000000;
  color: #000000; /* Metin siyah yapıldı */
  box-shadow: none;
  cursor: not-allowed;
  font-weight: 800;
}

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

.lobby-footer-btns {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

/* ==========================================================================
   2. OYUN ARENA EKRANI (GAME STAGE)
   ========================================================================== */
#game-screen {
  gap: clamp(8px, 1.2vh, 14px);
  height: calc(100vh - 20px);
  height: calc(100dvh - 20px);
  max-height: calc(100dvh - 20px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  width: 100vw !important;
  max-width: 100vw !important;
  padding-left: clamp(12px, 2vw, 36px) !important;
  padding-right: clamp(12px, 2vw, 36px) !important;
  padding-top: clamp(8px, 1.2vh, 14px) !important;
  padding-bottom: clamp(8px, 1.2vh, 14px) !important;
  box-sizing: border-box !important;
}

@media (min-width: 1500px) {
  #game-screen {
    padding-left: clamp(60px, 8vw, 180px) !important;
    padding-right: clamp(60px, 8vw, 180px) !important;
  }
}

/* Çizim Tuvali Üst Bilgi Barı (İç Üst Siyah Yapı) */
.canvas-top-bar, .game-top-bar {
  padding: 8px clamp(8px, 1.2vw, 16px);
  background: var(--bg-surface);
  border-bottom: 4px solid #000000; /* Çizim tuvali ile üst bilgi barı arasında net siyah ayrım */
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(6px, 1vw, 14px);
  flex-shrink: 0;
  min-height: 48px;
  position: relative;
  z-index: 10;
}

.canvas-bar-left, .bar-left,
.canvas-bar-right, .bar-right {
  display: flex;
  align-items: center;
  gap: clamp(6px, 0.8vw, 10px);
  flex-shrink: 0;
}

.canvas-top-bar .header-btn,
#btn-sound-game {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  padding: 0;
  flex-shrink: 0;
  background: #ffffff;
  border: 2px solid #3b82f6;
  color: #2563eb;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.16);
  cursor: pointer;
  font-size: 0.95rem;
  transition: all 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.canvas-top-bar .header-btn:hover,
#btn-sound-game:hover {
  background: #eff6ff;
  border-color: #1d4ed8;
  color: #1d4ed8;
  transform: translateY(-1px) scale(1.06);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.28);
}

.canvas-top-bar .header-btn:active,
#btn-sound-game:active {
  transform: scale(0.95);
}

.canvas-top-bar .header-btn.muted,
#btn-sound-game.muted {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: #64748b;
  box-shadow: none;
}

.game-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  font-size: clamp(0.72rem, 0.9vw, 0.85rem);
  font-weight: 700;
  white-space: nowrap;
}

.drawer-badge {
  color: #a5b4fc;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.canvas-bar-center, .bar-center {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
}

.secret-word-display {
  display: flex;
  align-items: center;
  gap: 12px;
}

.word-mask-letters {
  font-family: var(--font-heading);
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: 6px;
  color: #ffffff;
  text-shadow: 0 0 12px rgba(255, 255, 255, 0.3);
}

.word-length-tag {
  display: none !important;
}

.turn-timer {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  background: #ffffff;
  border: 2px solid #3b82f6;
  border-radius: var(--radius-full);
  color: #2563eb;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.05rem;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.16);
  transition: all 0.25s ease;
}

.turn-timer.pulse-critical {
  animation: timerPulse 0.8s ease-in-out infinite alternate;
  background: #ef4444;
  border-color: #b91c1c;
  color: #ffffff;
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.7);
}

@keyframes timerPulse {
  0% { transform: scale(1); box-shadow: 0 0 8px rgba(239, 68, 68, 0.3); }
  100% { transform: scale(1.08); box-shadow: 0 0 20px rgba(239, 68, 68, 0.8); }
}

/* Ana Sahne Grid / Layout - Sol (Oyuncular) ve Sağ (Sohbet) Birebir Eşit, Orantılı ve Simetrik */
.game-stage {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, clamp(160px, 22%, 290px)) minmax(0, 1fr) minmax(0, clamp(160px, 22%, 290px));
  gap: clamp(8px, 1.2vw, 14px);
  min-height: 0;
  min-width: 0;
  width: 100%;
  height: 100%;
}

/* Sol Sütun: Oyuncu Sıralaması (Lobi Mavi/Beyaz Yarıtransparan Tasarımı - Sohbet ile Birebir Aynı) */
.stage-sidebar {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: rgba(186, 230, 253, 0.78);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: var(--radius-md);
  border: 2px solid #000000;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  min-height: 0;
  min-width: 0;
  height: 100%;
}

.sidebar-header {
  height: 48px;
  box-sizing: border-box;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid #000000;
  background: rgba(255, 255, 255, 0.2);
}

.sidebar-title {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 0.95rem;
  color: #000000;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.sidebar-header .badge,
#sidebar-player-count {
  background: #ffffff;
  border: 2px solid #000000;
  color: #000000;
  padding: 2px 10px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 800;
  white-space: nowrap;
  box-shadow: none;
}

.game-players-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.game-players-list::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.25);
  border-radius: var(--radius-full);
}

.game-players-list::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.45);
}

.game-players-list::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05);
}

.player-live-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  background: #ffffff;
  border: 2px solid #000000;
  border-radius: var(--radius-sm);
  position: relative;
  transition: all 0.15s ease;
  box-shadow: none;
}

.player-live-card:hover {
  background: #f8fafc;
}

.player-live-card.is-drawer {
  background: #ffffff;
  border: 2.5px solid #000000;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.12);
}

.player-live-card.has-guessed {
  background: #dcfce7;
  border-color: #16a34a;
}

.player-live-dot {
  color: #000000;
  font-size: 1.15rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transform: translateY(-1px);
}

.player-live-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.player-live-name {
  font-family: var(--font-heading);
  font-size: 0.88rem;
  font-weight: 700;
  color: #000000;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-live-score {
  font-family: var(--font-heading);
  font-size: 0.75rem;
  color: #334155;
  font-weight: 700;
}

.player-status-badge {
  font-family: var(--font-heading);
  font-size: 0.72rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.player-status-badge:empty {
  display: none;
}

.player-live-card.is-drawer .player-status-badge {
  background: #000000;
  color: #ffffff;
  padding: 3px 8px;
  border-radius: var(--radius-full);
}

.player-live-card.has-guessed .player-status-badge {
  background: #16a34a;
  color: #ffffff;
  padding: 3px 8px;
  border-radius: var(--radius-full);
}

.player-live-card.is-disconnected {
  opacity: 0.55;
  filter: grayscale(0.5);
  border-style: dashed;
  background: #f8fafc;
}

.player-live-dot.offline {
  color: #94a3b8 !important;
}

.player-status-badge.offline {
  background: rgba(239, 68, 68, 0.12) !important;
  color: #dc2626 !important;
  border: 1px solid rgba(239, 68, 68, 0.35) !important;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  font-size: 0.68rem;
}

/* Orta Sütun: Tuval ve Araçlar */
.stage-canvas-area {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
}

.canvas-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: var(--radius-md);
  position: relative;
  border: 5px solid #000000; /* Çizim alanının etrafına siyah çerçeve (%100 kalınlaştırıldı) */
  background: var(--bg-card);
  min-height: 0;
}

.canvas-container {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #141724; /* Çizim kağıdını net gösteren şık masa/alan arka planı */
  overflow: hidden;
  border-bottom: 4px solid #000000; /* Çizim tuvali ile araç çubuğu arasına net siyah ayrım */
  padding: 8px;
  box-sizing: border-box;
}

/* Arka Plan Resmine Uyumlu Renk Geçişli & Boyut Hissiyatlı Çizim Çerçevesi */
.canvas-board-frame {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: clamp(6px, 0.9vw, 11px);
  background: linear-gradient(135deg, #0284c7 0%, #38bdf8 15%, #6366f1 35%, #a855f7 50%, #ec4899 68%, #f43f5e 82%, #fbbf24 100%);
  border: 3.5px solid #000000;
  border-radius: clamp(12px, 1.4vw, 18px);
  box-shadow: 
    0 6px 0 #000000,
    0 14px 28px rgba(0, 0, 0, 0.45),
    0 0 24px rgba(56, 189, 248, 0.3),
    0 0 35px rgba(236, 72, 153, 0.22),
    inset 0 2px 0 rgba(255, 255, 255, 0.6),
    inset 2px 0 0 rgba(255, 255, 255, 0.4),
    inset 0 -2.5px 0 rgba(0, 0, 0, 0.4),
    inset -2px 0 0 rgba(0, 0, 0, 0.3);
  max-width: 100%;
  max-height: 100%;
  box-sizing: border-box;
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.canvas-board-frame::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.38) 0%, rgba(255, 255, 255, 0.08) 28%, transparent 55%);
  pointer-events: none;
  z-index: 2;
}

#paint-canvas {
  max-width: 100%;
  max-height: 100%;
  aspect-ratio: 800 / 500;
  background-color: #ffffff;
  cursor: crosshair;
  touch-action: none;
  display: block;
  border-radius: clamp(6px, 0.8vw, 10px);
  border: 2px solid #000000;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.14), inset 0 -1px 2px rgba(0, 0, 0, 0.05);
  box-sizing: border-box;
  position: relative;
  z-index: 1;
}

/* ==========================================================================
   KELİME SEÇİM MODALI (ÇİZBİL İMZA MAVİ - BEYAZ RETRO ARCADE TEMASI)
   ========================================================================== */
.overlay-modal {
  position: absolute;
  inset: 0;
  background: rgba(10, 15, 28, 0.76);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 60;
  padding: 16px;
  animation: modalOverlayFadeIn 0.22s ease-out;
}

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

.word-select-card {
  width: 100%;
  max-width: 440px;
  background: #bae6fd !important; /* İmza gökyüzü mavisi zemin */
  border: 3.5px solid #000000 !important;
  border-radius: 22px !important;
  padding: 24px 24px !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 14px !important;
  text-align: center !important;
  box-shadow: 0 8px 0 #000000, 0 20px 40px rgba(0, 0, 0, 0.35) !important;
  position: relative;
  overflow: hidden;
  animation: selectPopIn 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes selectPopIn {
  0% {
    opacity: 0;
    transform: scale(0.88) translateY(12px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.word-select-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.word-select-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  background: #ffffff;
  border: 2px solid #000000;
  border-radius: var(--radius-full);
  padding: 4px 14px;
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 800;
  color: #2563eb;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  box-shadow: 0 2px 0 #000000;
}

.word-select-badge i {
  color: #2563eb;
  font-size: 0.85rem;
}

.word-select-header h3 {
  font-family: var(--font-heading);
  font-size: 1.45rem;
  font-weight: 900;
  color: #000000 !important;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
}

.select-timer-wrapper {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.6);
  border: 2px solid #000000;
  border-radius: var(--radius-full);
  padding: 4px 12px;
  box-sizing: border-box;
  box-shadow: 0 2px 0 #000000;
}

.select-timer-wrapper .timer-icon {
  color: #000000;
  font-size: 0.95rem;
  flex-shrink: 0;
}

.select-timer-bar {
  flex: 1;
  height: 12px;
  background: #ffffff;
  border: 2px solid #000000;
  border-radius: var(--radius-full);
  overflow: hidden;
  padding: 1.5px;
  box-sizing: border-box;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2);
}

.select-timer-progress {
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #38bdf8 0%, #2563eb 100%);
  border-radius: var(--radius-full);
  transition: width 0.3s linear;
}

.select-timer-seconds {
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 0.9rem;
  color: #000000;
  min-width: 28px;
  text-align: right;
  flex-shrink: 0;
}

.word-choices-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 4px 0;
}

.word-choice-btn {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 12px 18px !important;
  background: #ffffff !important;
  border: 3px solid #000000 !important;
  border-radius: 16px !important;
  color: #000000 !important;
  cursor: pointer;
  box-shadow: 0 5px 0 #000000 !important;
  transition: transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 0.15s cubic-bezier(0.34, 1.56, 0.64, 1),
              background 0.15s ease,
              color 0.15s ease !important;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  gap: 12px;
}

.word-choice-num {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #bae6fd;
  border: 2px solid #000000;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 900;
  color: #000000;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.word-choice-text {
  font-family: var(--font-heading);
  font-size: 1.28rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #000000;
  flex: 1;
  text-align: center;
  transition: color 0.15s ease;
}

.word-choice-action {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #f1f5f9;
  border: 2px solid #000000;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  color: #000000;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.word-choice-btn:hover {
  background: #eff6ff !important;
  transform: translateY(-2px);
  box-shadow: 0 7px 0 #000000 !important;
}

.word-choice-btn:hover .word-choice-num {
  background: #2563eb;
  color: #ffffff;
}

.word-choice-btn:hover .word-choice-text {
  color: #1d4ed8;
}

.word-choice-btn:hover .word-choice-action {
  background: #2563eb;
  color: #ffffff;
  transform: translateX(2px);
}

.word-choice-btn:active {
  transform: translateY(3px) !important;
  box-shadow: 0 1px 0 #000000 !important;
  background: #2563eb !important;
  color: #ffffff !important;
}

.word-choice-btn:active .word-choice-num {
  background: #ffffff;
  color: #2563eb;
}

.word-choice-btn:active .word-choice-text {
  color: #ffffff;
}

.word-choice-btn:active .word-choice-action {
  background: #ffffff;
  color: #2563eb;
}

.word-select-hint-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: #ffffff;
  border: 2px solid #000000;
  border-radius: var(--radius-full);
  padding: 5px 14px;
  box-shadow: 0 2px 0 #000000;
  margin: 2px auto 0 auto;
  max-width: 95%;
}

.word-select-hint-box i {
  color: #2563eb;
  font-size: 0.82rem;
  flex-shrink: 0;
}

.word-select-hint {
  font-size: 0.8rem;
  font-weight: 700;
  color: #0f172a !important;
  margin: 0;
  line-height: 1.3;
}

@media (max-width: 600px), (max-height: 540px) {
  .word-select-card {
    max-width: 320px !important;
    padding: 14px 16px !important;
    gap: 10px !important;
    border-radius: 18px !important;
  }
  .word-select-badge {
    padding: 3px 10px !important;
    font-size: 0.72rem !important;
  }
  .word-select-header h3 {
    font-size: 1.15rem !important;
  }
  .select-timer-wrapper {
    padding: 3px 8px !important;
  }
  .select-timer-bar {
    height: 9px !important;
  }
  .select-timer-seconds {
    font-size: 0.8rem !important;
  }
  .word-choices-container {
    gap: 8px !important;
    margin: 2px 0 !important;
  }
  .word-choice-btn {
    padding: 9px 12px !important;
    gap: 8px !important;
    border-radius: 12px !important;
    box-shadow: 0 3.5px 0 #000000 !important;
  }
  .word-choice-num,
  .word-choice-action {
    width: 24px !important;
    height: 24px !important;
    font-size: 0.75rem !important;
  }
  .word-choice-text {
    font-size: 1.05rem !important;
  }
  .word-select-hint-box {
    padding: 4px 10px !important;
  }
  .word-select-hint {
    font-size: 0.72rem !important;
  }
}

/* Çizer Araç Çubuğu (Toolbar) */
.drawer-toolbar {
  padding: 10px 16px;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: nowrap; /* Asla alt satıra geçmez, tek satırda sabit kalır */
  position: relative;
  overflow: visible;
}

/* Tahmin eden oyuncuda çubuk aynı boyutta sabit kalır, içerisindeki renkler ve araçlar gizlenir */
.drawer-toolbar.is-guesser > .tools-left,
.drawer-toolbar.is-guesser > .color-palette-group {
  visibility: hidden;
  pointer-events: none;
  user-select: none;
}

/* PC/Masaüstü ekranda varsayılan olarak gizlidir, tahminci modunda veya mobilde/tablette açılır */
.guesser-quick-guess {
  display: none;
}

.tools-left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

.tool-group {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
}

.tool-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.18s ease;
}

.tool-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-main);
}

.tool-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
  box-shadow: 0 2px 10px var(--primary-glow);
}

.tool-btn.btn-danger-soft:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.4);
}

/* Fırça ve Şekil Seçme Alanındaki Butonlar - Mavi & Beyaz Tema */
.tool-group .tool-btn {
  background: #ffffff;
  border: 2px solid #3b82f6;
  color: #2563eb;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.16);
  font-weight: 700;
  transition: all 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.tool-group .tool-btn:hover {
  background: #eff6ff;
  border-color: #1d4ed8;
  color: #1d4ed8;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.28);
}

.tool-group .tool-btn.active {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  border-color: #1e40af;
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.45);
  transform: translateY(-1px) scale(1.05);
}

.tool-group .tool-btn.active:hover {
  background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
  color: #ffffff;
}

.tool-group .tool-btn:active {
  transform: scale(0.95);
}

/* Araçlar + Butonu */
.tool-btn-plus .plus-icon {
  font-size: 20px;
  font-weight: 800;
  line-height: 1;
  display: inline-block;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
}

.tool-btn-plus.active-open {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%) !important;
  border-color: #1e40af !important;
  color: #ffffff !important;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.45) !important;
}

.tool-btn-plus.active-open .plus-icon {
  transform: rotate(45deg);
}

/* Açılır paneldeki araçlardan biri aktifse + butonunun mavi vurgusu */
.tool-btn-plus.has-active-tool {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%) !important;
  border-color: #1e40af !important;
  color: #ffffff !important;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.45) !important;
}

/* Ekstra Araçlar Açılır Paneli (Tray) */
.extra-tools-tray {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(15, 20, 30, 0.97);
  border: 2px solid #000000;
  border-radius: var(--radius-md);
  padding: 6px 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.75), 0 0 16px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 100;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(6px) scale(0.96);
  transition: opacity 0.2s cubic-bezier(0.34, 1.56, 0.64, 1),
              transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1),
              visibility 0.2s ease;
}

.extra-tools-tray::after {
  content: '';
  position: absolute;
  left: 92px; /* + Butonunun tam üzerine denk gelen üçgen ok */
  bottom: -6px;
  transform: rotate(45deg);
  width: 10px;
  height: 10px;
  background: rgba(15, 20, 30, 0.97);
  border-bottom: 2px solid #000000;
  border-right: 2px solid #000000;
}

.extra-tools-tray.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

/* Temizle Butonu (Tehlike Uyarısı Kırmızı/Beyaz Kontrast) */
.tool-group .tool-btn.btn-danger-soft {
  background: #ffffff;
  border: 2px solid #ef4444;
  color: #ef4444;
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.16);
}

.tool-group .tool-btn.btn-danger-soft:hover {
  background: #fef2f2;
  border-color: #dc2626;
  color: #b91c1c;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.28);
}

.tool-divider {
  width: 1px;
  height: 24px;
  background: var(--border-subtle);
}

.brush-size-group {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
}

.size-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  background: #ffffff;
  border: 2px solid #3b82f6;
  border-radius: var(--radius-sm);
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.16);
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.size-btn:hover {
  background: #eff6ff;
  border-color: #1d4ed8;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.28);
}

.size-btn.active {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  border-color: #1e40af;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.45);
  transform: translateY(-1px) scale(1.05);
}

.size-btn:active {
  transform: scale(0.95);
}

/* Kalınlık + Butonu (Mavi-Beyaz Tema) */
.size-btn-plus {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 800;
  color: #2563eb;
  background: #ffffff;
  border: 2px solid #3b82f6;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.16);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  transition: all 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.size-btn-plus:hover {
  background: #eff6ff;
  border-color: #1d4ed8;
  color: #1d4ed8;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.28);
}

.size-btn-plus .plus-icon {
  display: inline-block;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
}

.size-btn-plus.active-open {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%) !important;
  border-color: #1e40af !important;
  color: #ffffff !important;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.45) !important;
}

.size-btn-plus.active-open .plus-icon {
  transform: rotate(45deg);
}

.size-btn-plus.has-active-size {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%) !important;
  border-color: #1e40af !important;
  color: #ffffff !important;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.45) !important;
}

/* Ekstra Kalınlıklar Açılır Paneli (Tray) */
.extra-sizes-tray {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(15, 20, 30, 0.97);
  border: 2px solid #000000;
  border-radius: var(--radius-md);
  padding: 6px 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.75), 0 0 16px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 100;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(6px) scale(0.96);
  transition: opacity 0.2s cubic-bezier(0.34, 1.56, 0.64, 1),
              transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1),
              visibility 0.2s ease;
}

.extra-sizes-tray::after {
  content: '';
  position: absolute;
  left: 48px; /* + Butonunun tam üzerine denk gelen üçgen ok */
  bottom: -6px;
  transform: rotate(45deg);
  width: 10px;
  height: 10px;
  background: rgba(15, 20, 30, 0.97);
  border-bottom: 2px solid #000000;
  border-right: 2px solid #000000;
}

.extra-sizes-tray.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.size-dot {
  background: #2563eb;
  border-radius: 50%;
  transition: background 0.18s ease;
}

.size-btn.active .size-dot {
  background: #ffffff !important;
}
.dot-sm { width: 4px; height: 4px; }
.dot-md { width: 8px; height: 8px; }
.dot-lg { width: 14px; height: 14px; }
.dot-xl { width: 20px; height: 20px; }

.color-palette-group {
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
}

/* Hamleyi Geri Al / İleri Al Butonları */
.history-actions-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.undo-redo-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: #ffffff;
  border: 2px solid #3b82f6;
  color: #2563eb;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.16);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
  flex-shrink: 0;
}

.undo-redo-btn:not(:disabled):hover {
  background: #eff6ff;
  border-color: #1d4ed8;
  color: #1d4ed8;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.28);
}

.undo-redo-btn:not(:disabled):active {
  transform: scale(0.95);
}

.undo-redo-btn:disabled {
  opacity: 0.38;
  cursor: not-allowed;
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #94a3b8;
  box-shadow: none;
  transform: none;
  pointer-events: none;
}

.bucket-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: #ffffff;
  border: 2px solid #3b82f6;
  color: #2563eb;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.16);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
  flex-shrink: 0;
}

.bucket-btn:hover {
  background: #eff6ff;
  border-color: #1d4ed8;
  color: #1d4ed8;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.28);
}

.bucket-btn.active {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  border-color: #1e40af;
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.45);
  transform: translateY(-1px) scale(1.05);
}

.bucket-btn.active:hover {
  background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
  color: #ffffff;
}

.bucket-btn:active {
  transform: scale(0.95);
}

.color-palette {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
}

.color-swatch {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background-color: var(--c);
  border: 2px solid rgba(255, 255, 255, 0.25);
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
  transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1),
              border-color 0.18s ease,
              box-shadow 0.18s ease;
}

.color-swatch:hover {
  transform: scale(1.2);
  border-color: #ffffff;
}

.color-swatch.active {
  transform: scale(1.25);
  border-color: #ffffff;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.6);
}

/* 5. Buton: Renk Butonu ile Aynı Yuvarlak Boyutta (26px Daire) + Butonu */
.color-swatch-plus {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.35);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  position: relative;
  user-select: none;
  transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1),
              background 0.2s ease,
              border-color 0.2s ease,
              box-shadow 0.2s ease;
}

.color-swatch-plus .plus-icon {
  font-size: 16px;
  font-weight: 800;
  line-height: 1;
  display: inline-block;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
}

.color-swatch-plus:hover {
  transform: scale(1.2);
  border-color: #ffffff;
  background: rgba(255, 255, 255, 0.22);
}

.color-swatch-plus.active-open {
  transform: scale(1.18);
  border-color: var(--primary);
  background: var(--primary);
  box-shadow: 0 0 10px var(--primary-glow);
}

.color-swatch-plus.active-open .plus-icon {
  transform: rotate(45deg);
}

/* Seçili ekstra renk varsa + butonunun üzerinde göstergesi */
.color-swatch-plus.has-active-color {
  border-color: var(--active-extra-color, #ffffff);
  box-shadow: 0 0 10px var(--active-extra-color, rgba(255, 255, 255, 0.6));
}

.color-swatch-plus.has-active-color::after {
  content: '';
  position: absolute;
  inset: 2px;
  border-radius: 50%;
  background: var(--active-extra-color);
  opacity: 0.9;
  z-index: 1;
}

.color-swatch-plus.has-active-color .plus-icon {
  position: relative;
  z-index: 2;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
}

/* Diğer Renkler: + tıklandığında aynı satırda kalarak diğer özelliklerin üstüne kayan overlay */
.extra-colors-tray {
  position: absolute;
  right: calc(100% + 8px);
  top: 50%;
  transform: translateY(-50%) translateX(10px) scale(0.96);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(15, 20, 30, 0.97);
  border: 2px solid #000000;
  border-radius: var(--radius-full);
  padding: 4px 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.75), 0 0 16px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 100;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s cubic-bezier(0.34, 1.56, 0.64, 1),
              transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1),
              visibility 0.2s ease;
}

.extra-colors-tray::after {
  content: '';
  position: absolute;
  right: -6px;
  top: 50%;
  transform: translateY(-50%) rotate(45deg);
  width: 9px;
  height: 9px;
  background: rgba(15, 20, 30, 0.97);
  border-top: 2px solid #000000;
  border-right: 2px solid #000000;
}

.extra-colors-tray.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(-50%) translateX(0) scale(1);
}

@media (max-width: 680px) {
  .extra-colors-tray {
    right: 32px;
  }
  .extra-colors-tray::after {
    display: none;
  }
}

/* Ekstra Renkler Açılır Popover Yedek Desteği */
.extra-colors-popover {
  position: absolute;
  bottom: calc(100% + 12px);
  right: 0;
  background: var(--bg-surface-elevated);
  border: 2.5px solid #000000;
  border-radius: var(--radius-md);
  padding: 10px 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.65), 0 0 15px rgba(0, 0, 0, 0.3);
  z-index: 100;
  transform: translateY(10px) scale(0.9);
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1),
              opacity 0.2s ease,
              visibility 0.2s ease;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.extra-colors-popover.open {
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
}

.extra-colors-grid {
  display: grid;
  grid-template-columns: repeat(4, 26px);
  gap: 8px;
}

/* Sağ Sütun: Canlı Sohbet ve Tahmin (Lobi Mavi/Beyaz Yarıtransparan Tasarımı - Oyuncular ile Birebir Aynı) */
.stage-chat {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: rgba(186, 230, 253, 0.78);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: var(--radius-md);
  border: 2px solid #000000;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  min-height: 0;
  min-width: 0;
  height: 100%;
}

.chat-header {
  height: 48px;
  box-sizing: border-box;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid #000000;
  background: rgba(255, 255, 255, 0.2);
}

.chat-title {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 0.95rem;
  color: #000000;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chat-messages::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.25);
  border-radius: var(--radius-full);
}

.chat-messages::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.45);
}

.chat-messages::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05);
}

.chat-msg {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.88rem;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: #ffffff;
  border: 2px solid #000000;
  word-break: break-word;
  color: #000000;
  box-shadow: none;
}

.chat-sender {
  font-family: var(--font-heading);
  font-weight: 800;
  color: #000000;
  font-size: 0.82rem;
}

.chat-text {
  color: #000000;
  font-weight: 600;
}

.chat-msg.correct-guess-msg {
  background: #dcfce7;
  border: 2px solid #16a34a;
  color: #15803d;
  font-weight: 700;
}

.chat-msg.close-guess-msg {
  background: #fef3c7;
  border: 2px solid #d97706;
  color: #b45309;
  font-weight: 700;
}

.chat-msg.system-msg {
  background: #ffffff;
  border: 2px solid #000000;
  border-left: 5px solid #0284c7;
  color: #0f172a;
  font-size: 0.82rem;
  font-style: italic;
  font-weight: 600;
}

.chat-input-wrapper {
  padding: 12px;
  background: rgba(255, 255, 255, 0.35);
  border-top: 2px solid #000000;
}

.chat-form {
  display: flex;
  gap: 8px;
}

.chat-input {
  flex: 1;
  min-width: 0;
  padding: 10px 14px;
  background: #ffffff;
  border: 2px solid #000000;
  border-radius: var(--radius-sm);
  color: #000000;
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 600;
  outline: none;
  transition: all 0.15s ease;
}

.chat-input::placeholder {
  color: #64748b;
  font-weight: 500;
}

.chat-input:focus {
  border-color: #000000;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.15);
}

.chat-send-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  background: #000000;
  border: 2px solid #000000;
  border-radius: var(--radius-sm);
  color: #ffffff;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.chat-send-btn:hover {
  background: #1e293b;
  transform: scale(1.04);
}

.chat-send-btn:active {
  transform: translateY(1px);
}

.guessed-status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: #dcfce7;
  border: 2px solid #16a34a;
  border-radius: var(--radius-sm);
  color: #15803d;
  font-size: 0.85rem;
  font-weight: 700;
}

/* ==========================================================================
   3. TUR SONU VE OYUN BİTTİ MODALLARI
   ========================================================================== */
.fullscreen-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(10, 13, 20, 0.85);
  backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: modalFadeIn 0.25s ease-out;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

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

.rules-card {
  width: 100%;
  max-width: 520px;
  padding: clamp(20px, 4vw, 32px);
  display: flex;
  flex-direction: column;
  gap: 18px;
  text-align: center;
  box-shadow: var(--shadow-lg);
}

/* ==========================================================================
   TUR SONU & GİZLİ KELİME MODALI (ÇİZBİL İMZA MAVİ - BEYAZ RETRO ARCADE TEMASI)
   ========================================================================== */
.round-ended-card {
  width: 100% !important;
  max-width: 460px !important;
  max-height: 92vh !important;
  overflow-y: auto !important;
  background: #bae6fd !important; /* İmza gökyüzü mavisi zemin */
  border: 3.5px solid #000000 !important;
  border-radius: 24px !important;
  padding: 24px 22px !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 12px !important;
  text-align: center !important;
  box-shadow: 0 8px 0 #000000, 0 20px 45px rgba(0, 0, 0, 0.45) !important;
  box-sizing: border-box !important;
  position: relative !important;
  animation: selectPopIn 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
}

.round-ended-card::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

.round-ended-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  background: #ffffff;
  border: 2px solid #000000;
  border-radius: var(--radius-full);
  padding: 4px 16px;
  margin: 0 auto;
  box-shadow: 0 2.5px 0 #000000;
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 900;
  color: #2563eb;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.round-ended-badge i {
  color: #2563eb;
  font-size: 0.9rem;
}

.revealed-word-box {
  background: #ffffff;
  border: 3px solid #000000;
  border-radius: 16px;
  padding: 12px 16px;
  box-shadow: 0 4px 0 #000000;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.revealed-word-label {
  font-family: var(--font-heading);
  font-size: 0.78rem;
  font-weight: 800;
  color: #64748b;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.highlight-word {
  font-family: var(--font-heading);
  font-size: clamp(1.7rem, 5vw, 2.3rem);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: #1d4ed8 !important;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.9);
  margin: 0;
  line-height: 1.15;
  background: none !important;
  -webkit-background-clip: unset !important;
  -webkit-text-fill-color: initial !important;
}

.round-stats-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 2px 0;
}

.stat-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: #ffffff;
  border: 2px solid #000000;
  border-radius: 14px;
  box-shadow: 0 3px 0 #000000;
}

.stat-icon-wrap {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #bae6fd;
  border: 2px solid #000000;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  color: #000000;
  flex-shrink: 0;
}

.stat-info {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.stat-label {
  font-size: 0.72rem;
  font-weight: 800;
  color: #64748b;
  text-transform: uppercase;
}

.stat-value {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 900;
  color: #000000;
}

.round-points-list {
  background: #ffffff;
  border: 2.5px solid #000000;
  border-radius: 16px;
  padding: 8px 12px;
  max-height: 130px;
  overflow-y: auto;
  box-shadow: 0 3px 0 #000000;
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
  scrollbar-width: none !important; /* Firefox */
  -ms-overflow-style: none !important; /* IE and Edge */
}

.round-points-list::-webkit-scrollbar {
  display: none !important; /* Chrome, Safari, Opera */
  width: 0 !important;
  height: 0 !important;
}

.points-list-title {
  font-family: var(--font-heading);
  font-size: 0.82rem;
  font-weight: 800;
  color: #000000;
  display: flex;
  align-items: center;
  gap: 6px;
}

.points-list-title i {
  color: #eab308;
}

.scores-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.score-row-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  background: #f8fafc;
  border: 1.5px solid rgba(0, 0, 0, 0.12);
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 800;
  color: #000000;
}

.score-row-item strong {
  color: #15803d;
  font-family: var(--font-heading);
  font-weight: 900;
}

.intermission-countdown-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  background: #ffffff;
  border: 2px solid #000000;
  border-radius: var(--radius-full);
  padding: 7px 16px;
  box-shadow: 0 2.5px 0 #000000;
  font-family: var(--font-heading);
  font-size: 0.88rem;
  font-weight: 800;
  color: #000000;
  margin: 2px auto 0;
}

.intermission-countdown-box i {
  color: #2563eb;
  font-size: 0.95rem;
}

.intermission-countdown-box strong {
  color: #2563eb;
  font-size: 1.15rem;
  font-weight: 900;
}

/* ==========================================================================
   OYUN BİTTİ & ŞAMPİYONLAR PODYUMU (ÇİZBİL İMZA MAVİ - BEYAZ RETRO ARCADE TEMASI)
   ========================================================================== */
.game-over-card {
  width: 100% !important;
  max-width: 480px !important;
  max-height: 92vh !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;
  margin: auto !important;
  background: #bae6fd !important; /* İmza açık gökyüzü mavisi zemin */
  border: 3.5px solid #000000 !important;
  border-radius: 24px !important;
  padding: 24px 22px !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 12px !important;
  text-align: center !important;
  box-shadow: 0 8px 0 #000000, 0 20px 45px rgba(0, 0, 0, 0.45) !important;
  position: relative !important;
  box-sizing: border-box !important;
  animation: selectPopIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  scrollbar-width: none !important; /* Firefox */
  -ms-overflow-style: none !important; /* IE ve Edge */
}

.game-over-card::-webkit-scrollbar {
  display: none !important; /* Chrome, Safari, Opera */
  width: 0 !important;
  height: 0 !important;
}

.trophy-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #ffffff;
  border: 2px solid #000000;
  border-radius: var(--radius-full);
  padding: 4px 16px;
  margin: 0 auto;
  box-shadow: 0 2.5px 0 #000000;
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 900;
  color: #b45309;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.trophy-badge i {
  color: #f59e0b;
  font-size: 1rem;
}

.game-over-title {
  font-family: var(--font-heading);
  font-size: clamp(1.4rem, 4vw, 1.75rem);
  font-weight: 900;
  color: #000000 !important;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin: 0;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
}

.game-over-sub {
  font-size: 0.88rem;
  font-weight: 700;
  color: #0f172a !important;
  margin: 0;
}

/* Şampiyonlar Podyumu */
.podium-container {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: clamp(8px, 1.8vw, 14px);
  padding: 10px 0 0;
  margin-top: 2px;
  border-bottom: 3px solid #000000;
}

.podium-place {
  flex: 1;
  max-width: 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.champion-crown {
  font-size: 1.45rem;
  color: #eab308;
  margin-bottom: 2px;
  filter: drop-shadow(0 2px 0 #000000);
  animation: crownBob 1.6s ease-in-out infinite alternate;
}

@keyframes crownBob {
  from { transform: translateY(0); }
  to { transform: translateY(-5px) rotate(2deg); }
}

.podium-medal {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2.5px solid #000000;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 1.05rem;
  box-shadow: 0 2.5px 0 #000000;
  margin-bottom: 4px;
}

.medal-gold {
  background: linear-gradient(135deg, #fef08a 0%, #eab308 100%);
  color: #713f12;
}

.medal-silver {
  background: linear-gradient(135deg, #ffffff 0%, #cbd5e1 100%);
  color: #334155;
}

.medal-bronze {
  background: linear-gradient(135deg, #fed7aa 0%, #f97316 100%);
  color: #7c2d12;
}

.podium-name {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 800;
  color: #000000;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.podium-score {
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 800;
  color: #1d4ed8;
  background: #ffffff;
  border: 1.5px solid #000000;
  border-radius: var(--radius-full);
  padding: 1px 8px;
  margin: 3px 0 5px;
  box-shadow: 0 1.5px 0 #000000;
}

.podium-pillar {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 1.45rem;
  border: 2.5px solid #000000;
  border-bottom: none;
  box-sizing: border-box;
}

.pillar-1 {
  height: 100px;
  background: linear-gradient(180deg, #facc15 0%, #eab308 100%);
  border-radius: 14px 14px 0 0;
  color: #000000;
  box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.6);
}

.pillar-2 {
  height: 72px;
  background: #ffffff;
  border-radius: 12px 12px 0 0;
  color: #000000;
  box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.9);
}

.pillar-3 {
  height: 52px;
  background: linear-gradient(180deg, #fdba74 0%, #fb923c 100%);
  border-radius: 10px 10px 0 0;
  color: #000000;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.5);
}

/* Genel Sıralama Kutusu */
.final-rankings-wrapper {
  background: #ffffff;
  border: 2.5px solid #000000;
  border-radius: 16px;
  padding: 8px 10px;
  max-height: 135px;
  overflow-y: auto;
  box-shadow: 0 3px 0 #000000;
  box-sizing: border-box;
  scrollbar-width: none !important; /* Firefox */
  -ms-overflow-style: none !important; /* IE ve Edge */
}

.final-rankings-wrapper::-webkit-scrollbar {
  display: none !important; /* Chrome, Safari, Opera */
  width: 0 !important;
  height: 0 !important;
}

.final-rankings-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.ranking-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  background: #f8fafc;
  border: 1.5px solid rgba(0, 0, 0, 0.12);
  border-radius: 8px;
  font-size: 0.88rem;
}

.ranking-player {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 800;
  color: #000000;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ranking-idx {
  color: #2563eb;
  font-weight: 900;
  font-size: 0.85rem;
}

.ranking-score {
  color: #15803d;
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 0.88rem;
  flex-shrink: 0;
}

/* Oyun Sonu Aksiyon Butonları */
.game-over-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  margin-top: 4px;
}

#back-to-lobby-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px 20px;
  background: #2563eb;
  border: 3px solid #000000;
  border-radius: 14px;
  color: #ffffff;
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  box-shadow: 0 4.5px 0 #000000;
  cursor: pointer;
  transition: all 0.15s ease;
}

#back-to-lobby-btn:hover {
  background: #1d4ed8;
  transform: translateY(-2px);
  box-shadow: 0 6.5px 0 #000000;
}

#back-to-lobby-btn:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #000000;
}

#back-to-lobby-btn.hidden,
#back-to-lobby-btn[hidden],
.game-over-waiting.hidden,
.game-over-waiting[hidden],
#btn-mobile-lobby.hidden,
#btn-mobile-lobby[hidden] {
  display: none !important;
}

.game-over-waiting {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 10px 16px;
  background: #ffffff;
  border: 2px solid #000000;
  border-radius: var(--radius-full);
  color: #0f172a;
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 800;
  box-shadow: 0 2.5px 0 #000000;
  box-sizing: border-box;
}

.game-over-waiting i {
  color: #2563eb;
  font-size: 0.95rem;
}

@media (orientation: landscape) and (max-height: 560px) {
  #game-over-modal {
    align-items: flex-start !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    padding: 10px 12px 24px !important;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
  }
  #game-over-modal::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
  }
  .game-over-card {
    max-width: 360px !important;
    margin: 8px auto !important;
    padding: 14px 14px !important;
    gap: 8px !important;
    border-radius: 18px !important;
    max-height: none !important; /* Tüm kart modal üzerinden rahatça aşağı-yukarı kaydırılabilsin */
  }
  .trophy-badge {
    padding: 3px 12px !important;
    font-size: 0.72rem !important;
  }
  .game-over-title {
    font-size: 1.25rem !important;
  }
  .game-over-sub {
    font-size: 0.75rem !important;
  }
  .podium-container {
    gap: 6px !important;
    padding: 4px 0 0 !important;
  }
  .champion-crown {
    font-size: 1.1rem !important;
  }
  .podium-medal {
    width: 26px !important;
    height: 26px !important;
    font-size: 0.8rem !important;
  }
  .podium-name {
    font-size: 0.72rem !important;
  }
  .podium-score {
    font-size: 0.7rem !important;
    padding: 1px 5px !important;
  }
  .podium-pillar {
    font-size: 1.1rem !important;
  }
  .pillar-1 { height: 60px !important; }
  .pillar-2 { height: 42px !important; }
  .pillar-3 { height: 30px !important; }
  .final-rankings-wrapper {
    max-height: 100px !important;
    padding: 6px 8px !important;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
  }
  .final-rankings-wrapper::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
  }
  .ranking-item {
    padding: 4px 8px !important;
    font-size: 0.76rem !important;
  }
  #back-to-lobby-btn {
    padding: 9px 14px !important;
    font-size: 0.98rem !important;
  }
  .game-over-waiting {
    padding: 8px 12px !important;
    font-size: 0.75rem !important;
  }
  .round-ended-card {
    max-width: 325px !important;
    padding: 14px 14px !important;
    gap: 8px !important;
    border-radius: 18px !important;
  }
  .round-ended-badge {
    padding: 3px 12px !important;
    font-size: 0.72rem !important;
  }
  .revealed-word-box {
    padding: 8px 12px !important;
  }
  .highlight-word {
    font-size: 1.45rem !important;
  }
  .stat-box {
    padding: 8px 10px !important;
    gap: 8px !important;
  }
  .stat-icon-wrap {
    width: 28px !important;
    height: 28px !important;
    font-size: 0.82rem !important;
  }
  .stat-label {
    font-size: 0.65rem !important;
  }
  .stat-value {
    font-size: 0.95rem !important;
  }
  .round-points-list {
    max-height: 95px !important;
    padding: 6px 8px !important;
  }
  .score-row-item {
    padding: 4px 8px !important;
    font-size: 0.76rem !important;
  }
  .intermission-countdown-box {
    padding: 5px 12px !important;
    font-size: 0.75rem !important;
  }
}

@media (orientation: landscape) and (max-height: 520px) {
  #game-over-modal {
    align-items: flex-start !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    padding: 10px 16px 36px !important;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
  }
  #game-over-modal::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
  }
  .game-over-card {
    margin: 8px auto 24px !important;
    max-width: 440px !important;
    gap: 6px !important;
    padding: 12px 16px !important;
  }
  .podium-container {
    padding: 2px 0 0 !important;
    gap: 6px !important;
  }
  .pillar-1 { height: 48px !important; }
  .pillar-2 { height: 34px !important; }
  .pillar-3 { height: 24px !important; }
  .podium-medal {
    width: 24px !important;
    height: 24px !important;
    font-size: 0.75rem !important;
  }
  .final-rankings-wrapper {
    max-height: 85px !important;
    overflow-y: auto !important;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
  }
  .final-rankings-wrapper::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
  }
}

/* ==========================================================================
   KANZI STANDARDI FLOATING (i) BUTTON & NASIL OYNANIR MODALI (BEYAZ & AÇIK MAVİ LOBİ TEMASI)
   ========================================================================== */
.global-how-to-btn {
  position: fixed;
  bottom: calc(clamp(12px, 3vw, 20px) + env(safe-area-inset-bottom, 0px));
  left: calc(clamp(12px, 3vw, 20px) + env(safe-area-inset-left, 0px));
  width: clamp(42px, 9vw, 50px);
  height: clamp(42px, 9vw, 50px);
  border-radius: 50%;
  background: #bae6fd; /* Lobi açık mavi */
  border: 2px solid #000000; /* Siyah çerçeve */
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 999999;
  outline: none;
  transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.25s ease, background-color 0.2s ease;
  user-select: none;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

.how-to-btn-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #000000;
  transition: transform 0.25s ease;
}

.how-to-icon {
  width: clamp(20px, 4.5vw, 24px);
  height: clamp(20px, 4.5vw, 24px);
  stroke: #000000;
  transition: stroke 0.25s ease, transform 0.25s ease;
}

.global-how-to-btn:hover {
  transform: translateY(-3px) scale(1.1);
  background: #ffffff;
  border-color: #000000;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

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

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

.btn-glow-ring {
  display: none; /* Mor neon halka kaldırıldı */
}

.global-how-to-modal {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999999;
  padding: clamp(8px, 2.5vw, 18px);
  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: #bae6fd; /* Açık mavi modal kartı */
  border: 2px solid #000000; /* Siyah kalın çerçeve */
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
  color: #000000;
  padding: clamp(16px, 3.8vw, 26px) clamp(12px, 3.2vw, 24px);
  border-radius: clamp(14px, 3vw, 20px);
  width: min(94vw, 530px);
  max-width: 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;
  overscroll-behavior: contain;
  font-family: var(--font-body);
  scrollbar-width: none;
  -ms-overflow-style: none;
  box-sizing: border-box;
}

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

.global-how-to-close {
  position: absolute;
  top: clamp(8px, 2vw, 14px);
  right: clamp(10px, 2.2vw, 16px);
  z-index: 10;
  width: clamp(32px, 7vw, 36px) !important;
  height: clamp(32px, 7vw, 36px) !important;
  padding: 0 !important;
  border: none !important;
  background: transparent !important;
  color: #000000;
  font-size: clamp(1.4rem, 4.5vw, 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;
}

.global-how-to-close:hover {
  color: #ef4444;
  transform: scale(1.15);
}

.global-how-to-title {
  font-family: var(--font-heading);
  font-size: clamp(1.15rem, 4vw, 1.55rem);
  font-weight: 900;
  color: #000000;
  text-align: center;
  margin-bottom: 4px;
  padding: 0 clamp(28px, 7vw, 42px);
  line-height: 1.25;
  letter-spacing: 0.5px;
  word-break: break-word;
}

.global-how-to-subtitle {
  text-align: center;
  color: #000000;
  font-weight: 700;
  font-size: clamp(0.76rem, 2.5vw, 0.9rem);
  margin-bottom: clamp(12px, 2.8vw, 18px);
  line-height: 1.35;
}

.global-how-to-content {
  display: flex;
  flex-direction: column;
  gap: clamp(10px, 2.2vw, 14px);
}

.global-how-to-content .rules-section {
  background: #ffffff; /* Beyaz iç kural kutuları */
  border: 2px solid #000000; /* Siyah çerçeve */
  border-radius: clamp(10px, 2.2vw, 14px);
  padding: clamp(12px, 2.6vw, 16px) clamp(12px, 2.8vw, 18px);
  box-sizing: border-box;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.global-how-to-content h4 {
  font-family: var(--font-heading);
  font-size: clamp(0.88rem, 3vw, 1.02rem);
  font-weight: 800;
  color: #000000;
  margin-bottom: clamp(6px, 1.5vw, 8px);
  display: flex;
  align-items: center;
  gap: 6px;
  letter-spacing: 0.3px;
}

.global-how-to-content p, 
.global-how-to-content li {
  font-size: clamp(0.78rem, 2.5vw, 0.9rem);
  line-height: 1.55;
  color: #000000;
  font-weight: 600;
  word-break: break-word;
  overflow-wrap: break-word;
}

.global-how-to-content ul {
  padding-left: clamp(14px, 3.5vw, 20px);
  display: flex;
  flex-direction: column;
  gap: clamp(4px, 1.2vw, 6px);
  margin: 0;
}

/* Toast Bildirimleri */
.toast-container {
  position: fixed;
  top: 70px;
  right: 20px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  padding: 10px 16px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 0.88rem;
  font-weight: 600;
  box-shadow: var(--shadow-md);
  animation: toastIn 0.25s ease-out forwards;
}

.toast.toast-success { border-color: var(--success); }
.toast.toast-error { border-color: var(--danger); }

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

/* ==========================================================================
   4. MOBİL VE TABLET UYUMLULUĞU (RESPONSIVE VE EKRAN KONTROLLERİ)
   ========================================================================== */

/* Mobil Hızlı Kaydırma FAB Butonu (PC'de Asla Görünmez) */
.mobile-scroll-fab {
  display: none !important;
}

/* Oyun İçi Hub Kontrolleri (Tüm Cihazlar: PC, Tablet, Mobil) */
.mobile-chat-controls {
  display: inline-flex !important;
  align-items: center;
  gap: 7px;
  margin-left: auto;
}

.mobile-hub-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  box-sizing: border-box;
  flex-shrink: 0;
  transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.15s ease, box-shadow 0.18s ease;
}

.mobile-hub-btn:hover {
  transform: translateY(-2px) scale(1.08);
  filter: brightness(1.08);
}

.mobile-hub-btn:active {
  transform: scale(0.92);
}

/* 1) Nasıl Oynanır: Mavi zemin (#bae6fd), siyah çerçeve, orijinal Kanzi (i) SVG ikonu */
.hub-howto-btn {
  background: #bae6fd !important;
  color: #000000 !important;
  border: 2px solid #000000 !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25) !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.hub-howto-btn .how-to-btn-inner {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  height: 100% !important;
  color: #000000 !important;
}

.hub-howto-btn .how-to-icon {
  width: 18px !important;
  height: 18px !important;
  stroke: #000000 !important;
  stroke-width: 2.5 !important;
  fill: none !important;
  display: block !important;
  margin: auto !important;
}

/* 2) Lobi Butonu: GameHub orijinal mor degrade, sarı kontur (#ffde00) */
.hub-lobby-btn {
  background: linear-gradient(135deg, #d900ff 0%, #7209b7 100%) !important;
  color: #ffffff !important;
  border: 2px solid #ffde00 !important;
  box-shadow: 0 0 8px rgba(217, 0, 255, 0.5), 0 2px 6px rgba(0, 0, 0, 0.35) !important;
  font-size: 0.85rem !important;
}

/* 3) Odadan Çık Butonu: Oyuncu için kırmızı (#ff4757), Lobi Lideri için (#ff758c) */
.hub-exit-btn {
  background: #ff4757 !important;
  color: #ffffff !important;
  border: 2px solid #2b1111 !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3) !important;
  font-size: 0.85rem !important;
}

.hub-exit-btn.is-host {
  background: #ff758c !important;
}

/* Oyun içi ekrandayken sol alttaki sabit Nasıl Oynanır gizlenir (başlığa taşındığı için) */
#app-container.in-game ~ #globalHowToBtn,
#game-screen.active ~ #globalHowToBtn,
.in-game ~ #globalHowToBtn,
#globalHowToBtn.hidden {
  display: none !important;
}

/* Hızlı Tahmin Giriş Alanı Genel Tasarımı (Mobil ve Tablet) */
.quick-guess-form {
  display: flex !important;
  width: 100% !important;
  height: 100% !important;
  align-items: center !important;
  gap: 8px !important;
}

.quick-guess-input-wrap {
  flex: 1 !important;
  height: 36px !important;
  min-height: 36px !important;
  display: flex !important;
  align-items: center !important;
  background: rgba(255, 255, 255, 0.12) !important;
  border: 2px solid rgba(255, 255, 255, 0.28) !important;
  border-radius: var(--radius-full) !important;
  padding: 0 16px !important;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease !important;
}

.quick-guess-input-wrap:focus-within {
  border-color: #38bdf8 !important;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.45) !important;
  background: rgba(255, 255, 255, 0.18) !important;
}

.quick-guess-input {
  flex: 1 !important;
  background: transparent !important;
  border: none !important;
  outline: none !important;
  color: #ffffff !important;
  font-family: var(--font-body) !important;
  font-size: 0.9rem !important;
  font-weight: 600 !important;
  padding: 0 !important;
  width: 100% !important;
}

.quick-guess-input::placeholder {
  color: rgba(255, 255, 255, 0.5) !important;
  font-weight: 500 !important;
}

.quick-guess-btn {
  width: 36px !important;
  height: 36px !important;
  min-width: 36px !important;
  min-height: 36px !important;
  padding: 0 !important;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
  border: 2px solid rgba(255, 255, 255, 0.35) !important;
  border-radius: 50% !important;
  color: #ffffff !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  flex-shrink: 0 !important;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4) !important;
  transition: transform 0.15s ease, filter 0.15s ease !important;
}

.quick-guess-btn svg {
  width: 17px !important;
  height: 17px !important;
  fill: currentColor !important;
  display: block !important;
  transform: translateX(1px) !important;
}

.quick-guess-btn:active {
  transform: scale(0.92) !important;
  filter: brightness(1.1) !important;
}

/* ==========================================================================
   MOBİL CİHAZLAR DİK EKRAN (PORTRAIT) TAM EKRAN TEMASLI DİZİLİMİ
   - Üstte Çizim Alanı
   - Sol Altta Küçültülmüş Oyuncular Paneli
   - Sağ Altta Geniş Canlı Sohbet Paneli
   - Tüm yapılar birbiriyle temas halinde (gap: 0, sıfır boşluk, 100% ekran)
   ========================================================================== */
#portrait-warning {
  display: none !important;
}

@media (max-width: 900px) and (orientation: portrait) {
  /* 2. Madde: Gizli ekranlar (özellikle lobi ekranındayken oyun ekranı) ASLA görünmez */
  .hidden,
  [hidden],
  .view-screen.hidden,
  #game-screen.hidden,
  #lobby-screen.hidden,
  #portrait-warning {
    display: none !important;
  }

  /* 4. Madde & 5. Madde: Ekranın altında ve üstündeki ufak boşlukları sıfırla, tüm ekranı %100 kapla */
  html, body {
    width: 100% !important;
    height: 100% !important;
    height: 100dvh !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    position: fixed !important;
    inset: 0 !important;
  }

  #app-container {
    width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
    height: 100dvh !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
  }

  /* Lobi ekranı mobilde tam ekranı kaplar ve içerik taştığında kaydırılabilir */
  #lobby-screen.active {
    width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
    padding: 12px 8px !important;
  }

  /* 2. Madde: Yalnızca oyun ekranı aktif olduğunda görünür */
  #game-screen.active {
    width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
    background: transparent !important;
    box-sizing: border-box !important;
  }

  /* 3. Madde: Oyuncular sütununu %30 büyüt, küçük cihazlarda responsive dengele */
  .game-stage {
    display: grid !important;
    grid-template-columns: clamp(110px, 33vw, 148px) minmax(0, 1fr) !important;
    grid-template-rows: auto 1fr !important;
    grid-template-areas:
      "canvas canvas"
      "players chat" !important;
    gap: 0 !important;
    width: 100% !important;
    height: 100% !important;
    height: 100dvh !important;
    min-height: 0 !important;
    min-width: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }

  /* 1. ÜST ALAN: ÇİZİM ALANI VE TUVAL */
  .stage-canvas-area {
    grid-area: canvas !important;
    grid-column: 1 / -1 !important;
    grid-row: 1 !important;
    width: 100% !important;
    min-height: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    padding: 0 !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    position: relative !important;
    z-index: 20 !important;
  }

  /* Araç tepsilerinin (+ popup) yukarıya taşabilmesi için card overflow visible */
  .stage-canvas-area .canvas-card {
    border-radius: 0 !important;
    border: none !important;
    border-bottom: 2.5px solid #000000 !important;
    box-shadow: none !important;
    display: flex !important;
    flex-direction: column !important;
    background: #0f172a !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    overflow: visible !important;
    position: relative !important;
  }

  /* Süre, Tur, Çizen ve Gizli Kelime Barı - Ufak Cihazlar Dahil Tam Responsive */
  .canvas-top-bar,
  .game-top-bar {
    height: 38px !important;
    min-height: 38px !important;
    padding: 2px 6px !important;
    border-radius: 0 !important;
    border: none !important;
    border-bottom: 2px solid #000000 !important;
    box-shadow: none !important;
    background: #0d1117 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 3px !important;
    width: 100% !important;
    box-sizing: border-box !important;
    flex-shrink: 0 !important;
  }

  .canvas-bar-left {
    display: flex !important;
    align-items: center !important;
    gap: 3px !important;
    flex-shrink: 1 !important;
    min-width: 0 !important;
  }

  .canvas-top-bar .game-badge {
    padding: 2px 5px !important;
    font-size: clamp(0.60rem, 1.8vw, 0.72rem) !important;
    border-radius: 6px !important;
    border: 1.5px solid #334155 !important;
    white-space: nowrap !important;
    line-height: 1.2 !important;
  }

  .drawer-badge {
    max-width: clamp(50px, 14vw, 85px) !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  .canvas-bar-center {
    flex: 1 1 auto !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    min-width: 0 !important;
    padding: 0 2px !important;
  }

  .secret-word-display {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    max-width: 100% !important;
  }

  .word-mask-letters {
    font-size: clamp(0.82rem, 3.2vw, 1.15rem) !important;
    letter-spacing: clamp(1px, 0.8vw, 3px) !important;
    font-weight: 800 !important;
    color: #ffffff !important;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.3) !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    max-width: 100% !important;
  }

  .canvas-bar-right {
    display: flex !important;
    align-items: center !important;
    gap: 3px !important;
    flex-shrink: 0 !important;
  }

  .canvas-top-bar .header-btn,
  #btn-sound-game {
    width: 28px !important;
    height: 28px !important;
    font-size: 0.78rem !important;
    border-radius: 50% !important;
    padding: 0 !important;
    border-width: 1.5px !important;
  }

  .turn-timer {
    min-width: 30px !important;
    height: 28px !important;
    padding: 2px 5px !important;
    font-size: 0.84rem !important;
    font-weight: 900 !important;
    border-radius: 6px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-width: 1.5px !important;
  }

  /* Tuval Konteynırı (Çizim Alanı) */
  .canvas-container {
    flex: 1 !important;
    min-height: clamp(165px, 28vh, 245px) !important;
    max-height: clamp(185px, 34vh, 280px) !important;
    padding: 4px !important;
    border-bottom: 2px solid #000000 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: hidden !important;
    background: #141724 !important;
    position: relative !important;
  }

  .canvas-board-frame {
    padding: 3px !important;
    border-radius: 8px !important;
    border-width: 2px !important;
    box-shadow: 0 3px 0 #000000, 0 6px 14px rgba(0, 0, 0, 0.4) !important;
  }

  #paint-canvas {
    max-width: 100% !important;
    max-height: 100% !important;
    aspect-ratio: 800 / 500 !important;
    border-radius: 6px !important;
  }

  /* Çizer Araç Çubuğu ve + Popup Tepsileri */
  .drawer-toolbar {
    height: auto !important;
    min-height: 36px !important;
    padding: 3px 5px !important;
    border-radius: 0 !important;
    border: none !important;
    box-shadow: none !important;
    background: #0d1117 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 3px !important;
    overflow: visible !important;
    overflow-x: visible !important;
    position: relative !important;
    z-index: 100 !important;
  }

  .tool-group,
  .brush-size-group,
  .color-palette-group,
  .color-palette {
    position: relative !important;
    overflow: visible !important;
  }

  /* Fırça Araçları + Tepsisi (Yukarı açılır popup) */
  .extra-tools-tray {
    position: absolute !important;
    bottom: calc(100% + 8px) !important;
    left: 0 !important;
    z-index: 99999 !important;
    background: rgba(15, 23, 42, 0.98) !important;
    border: 2px solid #000000 !important;
    border-radius: 10px !important;
    padding: 6px 8px !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.8), 0 2px 0 #000 !important;
    display: none !important;
    gap: 5px !important;
    align-items: center !important;
    white-space: nowrap !important;
  }

  .extra-tools-tray.open {
    display: inline-flex !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    transform: none !important;
  }

  .extra-tools-tray::after {
    left: 65px !important;
    bottom: -6px !important;
  }

  /* Kalınlıklar + Tepsisi */
  .extra-sizes-tray {
    position: absolute !important;
    bottom: calc(100% + 8px) !important;
    left: 20px !important;
    z-index: 99999 !important;
    background: rgba(15, 23, 42, 0.98) !important;
    border: 2px solid #000000 !important;
    border-radius: 10px !important;
    padding: 6px 8px !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.8), 0 2px 0 #000 !important;
    display: none !important;
    gap: 5px !important;
    align-items: center !important;
    white-space: nowrap !important;
  }

  .extra-sizes-tray.open {
    display: inline-flex !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    transform: none !important;
  }

  .extra-sizes-tray::after {
    left: 36px !important;
    bottom: -6px !important;
  }

  /* Renkler + Tepsisi */
  .extra-colors-tray {
    z-index: 99999 !important;
    bottom: calc(100% + 8px) !important;
    top: auto !important;
    right: 0 !important;
    left: auto !important;
    transform: none !important;
  }

  .extra-colors-tray.open {
    display: inline-flex !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    transform: none !important;
  }

  .drawer-toolbar.is-guesser {
    display: none !important;
  }

  .drawer-toolbar .tool-btn {
    width: 27px !important;
    height: 27px !important;
    font-size: 0.72rem !important;
    border-radius: 6px !important;
    padding: 0 !important;
  }

  .drawer-toolbar .tool-btn svg {
    width: 14px !important;
    height: 14px !important;
  }

  .drawer-toolbar .size-btn {
    width: 25px !important;
    height: 25px !important;
  }

  .drawer-toolbar .color-swatch,
  .drawer-toolbar .color-swatch-plus {
    width: 19px !important;
    height: 19px !important;
  }

  /* 3. SOL ALT ALAN: %30 BÜYÜTÜLMÜŞ OYUNCULAR SÜTUNU */
  .stage-sidebar {
    grid-area: players !important;
    grid-column: 1 !important;
    grid-row: 2 !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    border-radius: 0 !important;
    border: none !important;
    border-right: 2.5px solid #000000 !important;
    box-shadow: none !important;
    background: #bae6fd !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    margin: 0 !important;
    box-sizing: border-box !important;
  }

  .sidebar-header {
    height: 36px !important;
    min-height: 36px !important;
    padding: 4px 6px !important;
    border-bottom: 2px solid #000000 !important;
    background: rgba(255, 255, 255, 0.3) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
  }

  .sidebar-title {
    font-size: 0.76rem !important;
    font-weight: 800 !important;
    color: #000000 !important;
    white-space: nowrap !important;
  }

  #sidebar-player-count {
    font-size: 0.68rem !important;
    padding: 1px 5px !important;
    border-width: 1.5px !important;
    background: #ffffff !important;
  }

  .game-players-list {
    flex: 1 !important;
    padding: 4px !important;
    gap: 4px !important;
    overflow-y: auto !important;
    scrollbar-width: none !important;
  }

  .game-players-list::-webkit-scrollbar {
    display: none !important;
  }

  .player-live-card {
    padding: 5px 6px !important;
    gap: 5px !important;
    border-radius: 7px !important;
    border-width: 1.5px !important;
    box-shadow: 0 1.5px 0 rgba(0, 0, 0, 0.2) !important;
  }

  .player-live-dot {
    font-size: 0.95rem !important;
  }

  .player-live-info {
    gap: 1px !important;
    overflow: hidden !important;
  }

  .player-live-name {
    font-size: 0.73rem !important;
    max-width: 76px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    font-weight: 800 !important;
  }

  .player-live-score {
    font-size: 0.66rem !important;
    color: #1e293b !important;
    font-weight: 700 !important;
  }

  .player-live-status {
    font-size: 0.70rem !important;
  }

  /* 4. SAĞ ALT ALAN: SOHBET & BİLGİSAYAR VERSİYONUYLA BİREBİR AYNI BUTON TASARIMLARI */
  .stage-chat {
    grid-area: chat !important;
    grid-column: 2 !important;
    grid-row: 2 !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    border-radius: 0 !important;
    border: none !important;
    box-shadow: none !important;
    background: #bae6fd !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    margin: 0 !important;
    box-sizing: border-box !important;
  }

  .chat-header {
    height: 36px !important;
    min-height: 36px !important;
    padding: 4px 8px !important;
    border-bottom: 2px solid #000000 !important;
    background: rgba(255, 255, 255, 0.3) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
  }

  .chat-title {
    font-size: 0.76rem !important;
    font-weight: 800 !important;
    color: #000000 !important;
  }

  .mobile-chat-controls {
    display: flex !important;
    align-items: center !important;
    gap: 5px !important;
  }

  /* 1. Madde: Sohbet Başlığı Butonları (Bilgisayar Versiyonuyla Birebir Aynı Tasarım: Yuvarlak & Orijinal Renkler) */
  .mobile-hub-btn {
    width: 28px !important;
    height: 28px !important;
    border-radius: 50% !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    flex-shrink: 0 !important;
    border: 2px solid #000000 !important;
    transition: transform 0.15s ease !important;
  }

  .mobile-hub-btn:active {
    transform: scale(0.92) !important;
  }

  .hub-howto-btn {
    background: #bae6fd !important;
    color: #000000 !important;
    border: 2px solid #000000 !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25) !important;
  }

  .hub-lobby-btn {
    background: linear-gradient(135deg, #d900ff 0%, #7209b7 100%) !important;
    color: #ffffff !important;
    border: 2px solid #ffde00 !important;
    box-shadow: 0 0 8px rgba(217, 0, 255, 0.5), 0 2px 6px rgba(0, 0, 0, 0.35) !important;
    font-size: 0.78rem !important;
  }

  .hub-exit-btn {
    background: #ff4757 !important;
    color: #ffffff !important;
    border: 2px solid #2b1111 !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3) !important;
    font-size: 0.78rem !important;
  }

  .chat-messages {
    flex: 1 !important;
    min-height: 0 !important;
    padding: 6px 8px !important;
    gap: 4px !important;
    overflow-y: auto !important;
    scrollbar-width: none !important;
    background: rgba(255, 255, 255, 0.45) !important;
  }

  .chat-messages::-webkit-scrollbar {
    display: none !important;
  }

  .chat-msg {
    padding: 3px 6px !important;
    font-size: 0.76rem !important;
    border-radius: 6px !important;
    line-height: 1.3 !important;
  }

  .chat-input-wrapper {
    padding: 5px 6px !important;
    background: #bae6fd !important;
    border-top: 2px solid #000000 !important;
    box-sizing: border-box !important;
  }

  .chat-form {
    display: flex !important;
    gap: 5px !important;
    align-items: center !important;
  }

  .chat-input {
    flex: 1 !important;
    min-width: 0 !important;
    height: 36px !important;
    font-size: 0.82rem !important;
    padding: 4px 10px !important;
    border: 2px solid #000000 !important;
    border-radius: var(--radius-sm) !important;
    box-sizing: border-box !important;
    background: #ffffff !important;
    color: #000000 !important;
    font-family: var(--font-heading) !important;
    font-weight: 600 !important;
    box-shadow: none !important;
  }

  /* 1. Madde: Tahmin Gönder Butonu (Bilgisayar Versiyonuyla Birebir Aynı Siyah Tasarım) */
  .chat-send-btn {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 36px !important;
    height: 36px !important;
    background: #000000 !important;
    border: 2px solid #000000 !important;
    border-radius: var(--radius-sm) !important;
    color: #ffffff !important;
    cursor: pointer !important;
    transition: all 0.15s ease !important;
    flex-shrink: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
  }

  .chat-send-btn:hover {
    background: #1e293b !important;
    transform: scale(1.04) !important;
  }

  .chat-send-btn:active {
    transform: translateY(1px) !important;
  }

  .chat-send-btn svg {
    width: 16px !important;
    height: 16px !important;
    fill: currentColor !important;
  }

  .mobile-scroll-fab {
    display: none !important;
  }

  /* 5. Madde: KELİME SEÇME, GİZLİ KELİME VE ŞAMPİYONLAR TABLOSU EKRANIN TAM ORTASINDA ÇIKACAK */
  #word-select-overlay {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    z-index: 99999 !important;
    background: rgba(10, 13, 20, 0.88) !important;
    backdrop-filter: blur(14px) !important;
    -webkit-backdrop-filter: blur(14px) !important;
    display: none;
    align-items: center !important;
    justify-content: center !important;
    padding: 16px !important;
    box-sizing: border-box !important;
  }

  #word-select-overlay:not(.hidden) {
    display: flex !important;
  }

  .word-select-card {
    width: 92% !important;
    max-width: 360px !important;
    margin: auto !important;
    max-height: 88dvh !important;
    overflow-y: auto !important;
    scrollbar-width: none !important;
    box-sizing: border-box !important;
  }

  #round-ended-modal {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    z-index: 99999 !important;
    background: rgba(10, 13, 20, 0.88) !important;
    backdrop-filter: blur(14px) !important;
    -webkit-backdrop-filter: blur(14px) !important;
    display: none;
    align-items: center !important;
    justify-content: center !important;
    padding: 16px !important;
    box-sizing: border-box !important;
  }

  #round-ended-modal:not(.hidden) {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .round-ended-card {
    width: 92% !important;
    max-width: 360px !important;
    margin: auto !important;
    max-height: 88dvh !important;
    overflow-y: auto !important;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
    box-sizing: border-box !important;
  }
  .round-ended-card::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
  }

  #game-over-modal {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    z-index: 99999 !important;
    background: rgba(10, 13, 20, 0.88) !important;
    backdrop-filter: blur(14px) !important;
    -webkit-backdrop-filter: blur(14px) !important;
    display: none;
    align-items: center !important;
    justify-content: center !important;
    padding: 16px !important;
    box-sizing: border-box !important;
  }

  #game-over-modal:not(.hidden) {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .game-over-card {
    width: 92% !important;
    max-width: 380px !important;
    margin: auto !important;
    max-height: 90dvh !important;
    padding: 18px 16px !important;
    gap: 10px !important;
    border-radius: 20px !important;
    overflow-y: auto !important;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
    box-sizing: border-box !important;
  }
  .game-over-card::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
  }
}

/* ==========================================================================
   MOBİL TELEFON YATAY EKRAN DİZİLİMİ (Sadece Kısa Ekranlı Telefonlar İçin)
   ========================================================================== */
@media (max-width: 960px) and (max-height: 520px) and (orientation: landscape) {
  #game-screen {
    width: 100vw !important;
    max-width: 100vw !important;
    padding: 0 !important;
    height: 100vh !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch !important;
    scroll-behavior: smooth;
    gap: 0 !important;
  }

  /* 1. Ekranın tamamı çizim alanı (1. Görünüm) + Aşağıda Sohbet & Oyuncular (2. Görünüm) */
  .game-stage {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    grid-template-rows: 100dvh minmax(280px, calc(100dvh - 16px)) !important;
    gap: 12px !important;
    padding: 4px 6px 24px 6px !important;
    width: 100% !important;
    box-sizing: border-box !important;
    height: auto !important;
    min-height: auto !important;
  }

  /* 1. EKRANIN TAMAMI ÇİZİM ALANI OLACAK */
  .stage-canvas-area {
    grid-column: 1 / -1 !important;
    grid-row: 1 !important;
    height: 100dvh !important;
    min-height: 100dvh !important;
    max-height: 100dvh !important;
    width: 100% !important;
    padding: 2px !important;
    box-sizing: border-box !important;
  }

  .stage-canvas-area .canvas-card {
    height: 100% !important;
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    border-radius: var(--radius-sm) !important;
  }

  /* 2. AŞAĞI KAYDIRILDIĞINDA OYUNCULAR VE SOHBET GÖZÜKECEK */
  .stage-sidebar {
    grid-column: 1 !important;
    grid-row: 2 !important;
    height: calc(100dvh - 20px) !important;
    min-height: 280px !important;
    max-height: calc(100dvh - 20px) !important;
    border-radius: var(--radius-sm) !important;
  }

  .stage-chat {
    grid-column: 2 !important;
    grid-row: 2 !important;
    height: calc(100dvh - 20px) !important;
    min-height: 280px !important;
    max-height: calc(100dvh - 20px) !important;
    border-radius: var(--radius-sm) !important;
  }

  /* Mobil Hızlı Kaydırma / Geçiş Butonu (Ekranın sağ tam ortasında dikey kapsül) */
  .mobile-scroll-fab {
    display: inline-flex !important;
    flex-direction: column !important;
    position: fixed;
    top: 50%;
    right: calc(6px + env(safe-area-inset-right, 0px));
    transform: translateY(-50%);
    bottom: auto;
    z-index: 999;
    align-items: center !important;
    justify-content: center !important;
    gap: 4px;
    background: rgba(0, 0, 0, 0.9);
    color: #ffffff;
    border: 2px solid rgba(255, 255, 255, 0.85);
    border-radius: var(--radius-full);
    padding: 8px 6px;
    font-family: var(--font-heading);
    font-size: 0.70rem;
    font-weight: 800;
    line-height: 1.1;
    text-align: center;
    white-space: nowrap;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
    cursor: pointer;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: transform 0.15s ease, background 0.15s ease;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
  }

  .mobile-scroll-fab #fab-main-icon {
    font-size: 0.82rem;
  }

  .mobile-scroll-fab #fab-text {
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.02em;
  }

  .mobile-scroll-fab #fab-arrow-icon {
    font-size: 0.68rem;
  }

  .mobile-scroll-fab:active {
    transform: translateY(-50%) scale(0.93);
  }

  /* Üst Bilgi Barı Mobil */
  .game-top-bar, .canvas-top-bar {
    height: 38px !important;
    min-height: 36px !important;
    padding: 2px 8px !important;
    gap: 6px !important;
  }

  .canvas-top-bar .header-btn {
    width: 28px !important;
    height: 28px !important;
    font-size: 0.75rem !important;
  }

  .game-badge {
    padding: 3px 8px !important;
    font-size: 0.74rem !important;
  }

  .word-mask-letters {
    font-size: clamp(1rem, 2.2vw, 1.25rem) !important;
    letter-spacing: clamp(3px, 0.6vw, 5px) !important;
  }

  .turn-timer {
    padding: 3px 10px !important;
    font-size: 0.95rem !important;
  }

  /* Çizim Araçları Çubuğu Mobil */
  .drawer-toolbar {
    height: 44px !important;
    min-height: 42px !important;
    padding: 4px 8px !important;
    gap: 8px !important;
  }

  /* Çizim Yapmayan Oyuncu (Tahminci) Hızlı Tahmin Barı Mobil */
  .drawer-toolbar.is-guesser {
    justify-content: center !important;
    padding: 4px 10px !important;
  }

  .drawer-toolbar.is-guesser > .tools-left,
  .drawer-toolbar.is-guesser > .color-palette-group {
    display: none !important;
  }

  .drawer-toolbar.is-guesser > .guesser-quick-guess {
    display: flex !important;
    visibility: visible !important;
    pointer-events: auto !important;
    user-select: auto !important;
    width: 100% !important;
    height: 100% !important;
    align-items: center !important;
  }

  .quick-guess-form {
    display: flex !important;
    width: 100% !important;
    height: 100% !important;
    align-items: center !important;
    gap: 8px !important;
  }

  .quick-guess-input-wrap {
    flex: 1 !important;
    height: 34px !important;
    min-height: 34px !important;
    display: flex !important;
    align-items: center !important;
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1.5px solid rgba(255, 255, 255, 0.22) !important;
    border-radius: var(--radius-full) !important;
    padding: 0 14px !important;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease !important;
  }

  .quick-guess-input-wrap:focus-within {
    border-color: #38bdf8 !important;
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.35) !important;
    background: rgba(255, 255, 255, 0.14) !important;
  }

  .quick-guess-input {
    flex: 1 !important;
    background: transparent !important;
    border: none !important;
    outline: none !important;
    color: #ffffff !important;
    font-family: var(--font-body) !important;
    font-size: 0.85rem !important;
    font-weight: 600 !important;
    padding: 0 !important;
    width: 100% !important;
  }

  .quick-guess-input::placeholder {
    color: rgba(255, 255, 255, 0.45) !important;
    font-weight: 500 !important;
  }

  .quick-guess-btn {
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
    min-height: 34px !important;
    padding: 0 !important;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    border: 1.5px solid rgba(255, 255, 255, 0.3) !important;
    border-radius: 50% !important;
    color: #ffffff !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    flex-shrink: 0 !important;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.35) !important;
    transition: transform 0.15s ease, filter 0.15s ease !important;
  }

  .quick-guess-btn svg {
    width: 16px !important;
    height: 16px !important;
    fill: currentColor !important;
    display: block !important;
    transform: translateX(1px) !important;
  }

  .quick-guess-btn:active {
    transform: scale(0.92) !important;
    filter: brightness(1.1) !important;
  }

  .tool-btn, .bucket-btn, .undo-redo-btn {
    width: 32px !important;
    height: 32px !important;
  }

  .size-btn {
    width: 28px !important;
    height: 28px !important;
  }

  .color-swatch, .color-swatch-plus {
    width: 22px !important;
    height: 22px !important;
  }

  .color-swatch-plus .plus-icon {
    font-size: 12px !important;
  }

  .extra-colors-grid {
    grid-template-columns: repeat(4, 20px) !important;
    gap: 6px !important;
  }

  /* Oyuncular ve Sohbet Kartları Mobil */
  .sidebar-header, .chat-header {
    height: 38px !important;
    box-sizing: border-box !important;
    padding: 6px 10px !important;
  }

  .sidebar-title, .chat-title {
    font-size: 0.8rem !important;
  }

  .player-live-card {
    padding: 6px 8px !important;
    gap: 6px !important;
  }

  .player-live-name {
    font-size: 0.78rem !important;
  }

  .player-live-score {
    font-size: 0.7rem !important;
  }

  .player-status-badge {
    font-size: 11px !important;
  }

  .chat-msg {
    padding: 5px 8px !important;
    font-size: 0.8rem !important;
  }

  .chat-input {
    padding: 6px 10px !important;
    font-size: 0.82rem !important;
  }

  .chat-send-btn {
    width: 34px !important;
    height: 34px !important;
  }

  /* Mobil Sohbet Başlığı ve Hub Kontrolleri */
  .chat-header {
    height: 42px !important;
    box-sizing: border-box !important;
    padding: 4px 10px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
  }

  .mobile-chat-controls {
    display: inline-flex !important;
    align-items: center !important;
    gap: 7px !important;
    margin-left: auto !important;
  }

  .mobile-hub-btn {
    width: 30px !important;
    height: 30px !important;
    border-radius: 50% !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    flex-shrink: 0 !important;
    transition: transform 0.15s ease, filter 0.15s ease !important;
  }

  .mobile-hub-btn:active {
    transform: scale(0.92) !important;
  }

  /* 1) Nasıl Oynanır: Mavi zemin (#bae6fd), siyah çerçeve, orijinal Kanzi (i) SVG ikonu */
  .hub-howto-btn {
    background: #bae6fd !important;
    color: #000000 !important;
    border: 2px solid #000000 !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25) !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .hub-howto-btn .how-to-btn-inner {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    height: 100% !important;
    color: #000000 !important;
  }

  .hub-howto-btn .how-to-icon {
    width: 17px !important;
    height: 17px !important;
    stroke: #000000 !important;
    stroke-width: 2.5 !important;
    fill: none !important;
    display: block !important;
    margin: auto !important;
  }

  /* 2) Lobi Butonu: GameHub orijinal mor degrade, sarı kontur (#ffde00) */
  .hub-lobby-btn {
    background: linear-gradient(135deg, #d900ff 0%, #7209b7 100%) !important;
    color: #ffffff !important;
    border: 2px solid #ffde00 !important;
    box-shadow: 0 0 8px rgba(217, 0, 255, 0.5), 0 2px 6px rgba(0, 0, 0, 0.35) !important;
    font-size: 0.82rem !important;
  }

  /* 3) Odadan Çık Butonu: Oyuncu için kırmızı (#ff4757), Lobi Lideri için (#ff758c) */
  .hub-exit-btn {
    background: #ff4757 !important;
    color: #ffffff !important;
    border: 2px solid #2b1111 !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3) !important;
    font-size: 0.82rem !important;
  }

  .hub-exit-btn.is-host {
    background: #ff758c !important;
  }

  /* Oyun içi mobilde sol alttaki sabit Nasıl Oynanır gizlenir (çünkü sohbet başlığına taşındı) */
  .in-game ~ #globalHowToBtn,
  #game-screen.active ~ #globalHowToBtn {
    display: none !important;
  }
}

/* ==========================================================================
   TABLET DİKEY EKRAN DİZİLİMİ (PORTRAIT: iPad & Android Tabletler)
   ========================================================================== */
@media (min-width: 681px) and (orientation: portrait) {
  #game-screen {
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    padding: 8px 12px !important;
    overflow: hidden !important;
    gap: 8px !important;
    box-sizing: border-box !important;
  }

  /* 2 Katmanlı Düzen: Üstte Tuval ve Araçlar, Altta Sol Oyuncu + Sağ Sohbet */
  .game-stage {
    display: grid !important;
    grid-template-columns: minmax(240px, 38%) minmax(0, 1fr) !important;
    grid-template-rows: minmax(0, 56%) minmax(0, 44%) !important;
    gap: 8px !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    min-width: 0 !important;
  }

  /* 1. Satır: Tuval ve Araçlar Tam Genişlik */
  .stage-canvas-area {
    grid-column: 1 / -1 !important;
    grid-row: 1 !important;
    height: 100% !important;
    min-height: 0 !important;
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
  }

  .stage-canvas-area .canvas-card {
    height: 100% !important;
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    border: 4px solid #000000 !important;
    border-radius: var(--radius-md) !important;
    overflow: hidden !important;
  }

  .canvas-container {
    flex: 1 !important;
    min-height: 0 !important;
    padding: 6px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: hidden !important;
  }

  .canvas-board-frame {
    padding: 6px !important;
    border-width: 2.5px !important;
    border-radius: 12px !important;
    box-shadow: 0 4px 0 #000000, 0 10px 20px rgba(0, 0, 0, 0.4) !important;
  }

  #paint-canvas {
    max-width: 100% !important;
    max-height: 100% !important;
    aspect-ratio: 800 / 500 !important;
    object-fit: contain !important;
  }

  /* 2. Satır: Sol Oyuncular, Sağ Sohbet */
  .stage-sidebar {
    grid-column: 1 !important;
    grid-row: 2 !important;
    height: 100% !important;
    min-height: 0 !important;
    border: 2px solid #000000 !important;
    border-radius: var(--radius-md) !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
  }

  .stage-chat {
    grid-column: 2 !important;
    grid-row: 2 !important;
    height: 100% !important;
    min-height: 0 !important;
    border: 2px solid #000000 !important;
    border-radius: var(--radius-md) !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
  }

  /* Tablette FAB butonuna gerek yok, her iki panel de aynı anda altta görünür */
  .mobile-scroll-fab {
    display: none !important;
  }

  /* Sohbet başlığındaki Hub kontrolleri */
  .mobile-chat-controls {
    display: inline-flex !important;
    gap: 6px !important;
  }

  .mobile-hub-btn {
    width: 32px !important;
    height: 32px !important;
  }

  /* Üst Bilgi Barı Tablet Dikey */
  .canvas-top-bar, .game-top-bar {
    height: 44px !important;
    min-height: 42px !important;
    padding: 4px 12px !important;
    gap: 8px !important;
  }

  .game-badge {
    padding: 4px 10px !important;
    font-size: 0.82rem !important;
  }

  .drawer-badge {
    max-width: 130px !important;
  }

  .word-mask-letters {
    font-size: clamp(1.2rem, 3vw, 1.45rem) !important;
    letter-spacing: clamp(4px, 0.8vw, 6px) !important;
  }

  .turn-timer {
    padding: 4px 12px !important;
    font-size: 1rem !important;
  }

  #btn-sound-game {
    width: 34px !important;
    height: 34px !important;
    font-size: 0.9rem !important;
  }

  /* Çizim Araçları Tablet Dikey */
  .drawer-toolbar {
    height: 48px !important;
    min-height: 46px !important;
    padding: 6px 12px !important;
    gap: 10px !important;
    justify-content: space-between !important;
    flex-wrap: nowrap !important;
  }

  .tool-btn, .undo-redo-btn, .bucket-btn {
    width: 36px !important;
    height: 36px !important;
  }

  .size-btn {
    width: 30px !important;
    height: 30px !important;
  }

  .color-swatch, .color-swatch-plus {
    width: 24px !important;
    height: 24px !important;
  }

  .color-swatch-plus .plus-icon {
    font-size: 14px !important;
  }

  /* Tahminci durumunda hızlı tahmin çubuğu tuvalin hemen altında açılır */
  .drawer-toolbar.is-guesser {
    justify-content: center !important;
    padding: 4px 12px !important;
  }

  .drawer-toolbar.is-guesser > .tools-left,
  .drawer-toolbar.is-guesser > .color-palette-group {
    display: none !important;
  }

  .drawer-toolbar.is-guesser > .guesser-quick-guess {
    display: flex !important;
    visibility: visible !important;
    pointer-events: auto !important;
    user-select: auto !important;
    width: 100% !important;
    max-width: 580px !important;
    height: 100% !important;
    align-items: center !important;
  }

  /* Oyuncu ve Sohbet Kartları */
  .sidebar-header, .chat-header {
    height: 42px !important;
    padding: 6px 12px !important;
  }

  .sidebar-title, .chat-title {
    font-size: 0.88rem !important;
  }

  .player-live-card {
    padding: 7px 10px !important;
    gap: 8px !important;
  }

  .player-live-name {
    font-size: 0.84rem !important;
  }

  .player-live-score {
    font-size: 0.78rem !important;
  }

  .chat-msg {
    padding: 7px 10px !important;
    font-size: 0.84rem !important;
  }

  .chat-input {
    padding: 8px 12px !important;
    font-size: 0.88rem !important;
  }

  .chat-send-btn {
    width: 36px !important;
    height: 36px !important;
  }
}

/* ==========================================================================
   TABLET YATAY EKRAN DİZİLİMİ (LANDSCAPE: 681px - 1366px, Yükseklik > 520px)
   ========================================================================== */
@media (min-width: 681px) and (max-width: 1366px) and (min-height: 521px) and (orientation: landscape) {
  #game-screen {
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    padding: clamp(6px, 1.2vh, 10px) clamp(10px, 1.8vw, 22px) !important;
    overflow: hidden !important;
    gap: 8px !important;
    box-sizing: border-box !important;
  }

  /* 3 Sütunlu Dengeli Simetrik Düzen */
  .game-stage {
    display: grid !important;
    grid-template-columns: clamp(165px, 20vw, 220px) minmax(0, 1fr) clamp(195px, 24vw, 270px) !important;
    grid-template-rows: 1fr !important;
    gap: clamp(8px, 1vw, 12px) !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    min-width: 0 !important;
  }

  .stage-sidebar {
    grid-column: 1 !important;
    grid-row: 1 !important;
    height: 100% !important;
    min-height: 0 !important;
    border: 2px solid #000000 !important;
    border-radius: var(--radius-md) !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
  }

  .stage-canvas-area {
    grid-column: 2 !important;
    grid-row: 1 !important;
    height: 100% !important;
    min-height: 0 !important;
    min-width: 0 !important;
    display: flex !important;
    flex-direction: column !important;
  }

  .stage-canvas-area .canvas-card {
    height: 100% !important;
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    border: 4px solid #000000 !important;
    border-radius: var(--radius-md) !important;
    overflow: hidden !important;
  }

  .canvas-container {
    flex: 1 !important;
    min-height: 0 !important;
    padding: 6px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: hidden !important;
  }

  .canvas-board-frame {
    padding: 6px !important;
    border-width: 2.5px !important;
    border-radius: 12px !important;
    box-shadow: 0 4px 0 #000000, 0 10px 20px rgba(0, 0, 0, 0.4) !important;
  }

  #paint-canvas {
    max-width: 100% !important;
    max-height: 100% !important;
    aspect-ratio: 800 / 500 !important;
    object-fit: contain !important;
  }

  .stage-chat {
    grid-column: 3 !important;
    grid-row: 1 !important;
    height: 100% !important;
    min-height: 0 !important;
    border: 2px solid #000000 !important;
    border-radius: var(--radius-md) !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
  }

  .mobile-scroll-fab {
    display: none !important;
  }

  /* Üst Bilgi Barı Tablet Yatay */
  .canvas-top-bar, .game-top-bar {
    height: 42px !important;
    min-height: 40px !important;
    padding: 4px 10px !important;
    gap: 8px !important;
  }

  .game-badge {
    padding: 3px 8px !important;
    font-size: 0.78rem !important;
  }

  .drawer-badge {
    max-width: 115px !important;
  }

  .word-mask-letters {
    font-size: clamp(1.15rem, 2vw, 1.4rem) !important;
    letter-spacing: clamp(3px, 0.5vw, 6px) !important;
  }

  .turn-timer {
    padding: 3px 10px !important;
    font-size: 0.95rem !important;
  }

  #btn-sound-game {
    width: 32px !important;
    height: 32px !important;
    font-size: 0.85rem !important;
  }

  /* Çizim Araçları Çubuğu Tablet Yatay */
  .drawer-toolbar {
    height: 46px !important;
    min-height: 44px !important;
    padding: 4px 10px !important;
    gap: 8px !important;
    justify-content: space-between !important;
    flex-wrap: nowrap !important;
  }

  .tools-left {
    gap: 6px !important;
  }

  .tool-group {
    gap: 4px !important;
  }

  .tool-btn, .undo-redo-btn, .bucket-btn {
    width: 33px !important;
    height: 33px !important;
  }

  .brush-size-group {
    gap: 4px !important;
  }

  .size-btn {
    width: 28px !important;
    height: 28px !important;
  }

  .color-palette-group {
    gap: 8px !important;
  }

  .history-actions-group {
    gap: 4px !important;
  }

  .color-palette {
    gap: 4px !important;
  }

  .color-swatch, .color-swatch-plus {
    width: 22px !important;
    height: 22px !important;
  }

  .color-swatch-plus .plus-icon {
    font-size: 13px !important;
  }

  /* Tahminci durumunda hızlı tahmin çubuğu tuvalin hemen altında açılır */
  .drawer-toolbar.is-guesser {
    justify-content: center !important;
    padding: 4px 12px !important;
  }

  .drawer-toolbar.is-guesser > .tools-left,
  .drawer-toolbar.is-guesser > .color-palette-group {
    display: none !important;
  }

  .drawer-toolbar.is-guesser > .guesser-quick-guess {
    display: flex !important;
    visibility: visible !important;
    pointer-events: auto !important;
    user-select: auto !important;
    width: 100% !important;
    max-width: 580px !important;
    height: 100% !important;
    align-items: center !important;
  }

  /* Sohbet ve Oyuncu Başlıkları */
  .sidebar-header, .chat-header {
    height: 42px !important;
    padding: 6px 10px !important;
  }

  .sidebar-title, .chat-title {
    font-size: 0.85rem !important;
  }

  .player-live-card {
    padding: 6px 8px !important;
    gap: 6px !important;
  }

  .player-live-name {
    font-size: 0.8rem !important;
  }

  .player-live-score {
    font-size: 0.74rem !important;
  }

  .chat-msg {
    padding: 6px 9px !important;
    font-size: 0.82rem !important;
  }

  .chat-input {
    padding: 6px 10px !important;
    font-size: 0.84rem !important;
  }

  .chat-send-btn {
    width: 34px !important;
    height: 34px !important;
  }

  .mobile-chat-controls {
    display: inline-flex !important;
    gap: 6px !important;
  }

  .mobile-hub-btn {
    width: 30px !important;
    height: 30px !important;
  }
}

/* ==========================================================================
   TABLET LOBİ EKRANI DÜZENİ (681px - 1024px)
   ========================================================================== */
@media (min-width: 681px) and (max-width: 1024px) {
  .lobby-card {
    max-width: 540px !important;
    padding: 26px 22px !important;
    gap: 16px !important;
  }

  .players-list {
    max-height: 140px !important;
  }
}

@media (max-width: 720px) and (orientation: portrait) {
  body {
    background-image: url('mobile_bg.png') !important;
    background-size: cover !important;
    background-position: center center !important;
    background-repeat: no-repeat !important;
    background-attachment: fixed !important;
  }

  .app-container {
    padding: 8px;
  }

  /* Lobi Ekranı Mobil Optimizasyonları (Dikey Telefon) */
  .lobby-card {
    padding: 22px 16px;
    gap: 16px;
    max-width: 480px;
  }

  .lobby-players-box, .lobby-mode-box {
    padding: 12px 14px;
    gap: 10px;
  }
}

/* Standart Akıllı Telefonlar Dikey Görünüm (iPhone, Samsung vb.) */
@media (max-width: 480px) and (orientation: portrait) {
  .lobby-card {
    padding: 16px 12px;
    gap: 12px;
    border-radius: var(--radius-md);
  }

  .lobby-players-box, .lobby-mode-box {
    padding: 10px 10px;
    gap: 8px;
  }

  .player-card-chip {
    height: 46px;
    min-height: 46px;
    max-height: 46px;
    padding: 6px 10px;
  }

  .player-card-name {
    font-size: clamp(0.72rem, 3.2vw, 0.88rem);
  }

  .mode-pills {
    gap: 6px;
  }

  .mode-pill {
    padding: 8px 4px;
    font-size: clamp(0.7rem, 2.8vw, 0.86rem);
  }

  .btn-large {
    padding: 13px 18px;
    font-size: 0.95rem;
  }
}

/* Küçük Ekranlı Telefonlar Dikey Görünüm (iPhone SE, Galaxy A01 vb.) */
@media (max-width: 360px) and (orientation: portrait) {
  .lobby-card {
    padding: 12px 8px;
    gap: 10px;
  }

  .lobby-players-box, .lobby-mode-box {
    padding: 8px 6px;
    gap: 6px;
  }

  .player-card-chip {
    padding: 4px 6px;
    height: 44px;
    min-height: 44px;
  }

  .player-dot {
    font-size: 1rem;
  }

  .mode-pill {
    padding: 6px 2px;
    font-size: 0.72rem;
  }
}

/* Düşük Yükseklikli Ekranlarda Sadece Lobi Kartı Kaydırması (Yatay Oyun Ekranı Orijinaldir) */
@media (max-height: 600px) and (orientation: portrait) {
  #lobby-screen {
    padding: 8px 4px;
    align-items: flex-start;
  }

  .lobby-card {
    padding: 12px 16px;
    gap: 8px;
    margin: 8px auto;
  }

  .players-list {
    max-height: 90px;
  }

  .lobby-players-box, .lobby-mode-box {
    padding: 8px 12px;
    gap: 6px;
  }

  .btn-large {
    padding: 10px 16px;
  }
}
