/* Sözbaz - Türkçe Kelime Oyunu */
/* Scrabble Tahtası - Tam Ekran PWA */

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

/* Sistem yazı boyutu ayarlarından etkilenmesin */
html {
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  text-size-adjust: 100%;
  font-size: 16px !important;
}

body {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

:root {
  --bg-dark: #1a0808;
  --bg-gradient-start: #4A0A0A;
  --bg-gradient-mid: #2D0808;
  --bg-gradient-end: #1a0808;
  
  --gold-light: #FFD700;
  --gold-main: #D4AF37;
  --gold-dark: #B8860B;
  --gold-glow: rgba(255, 215, 0, 0.3);
  
  --wood-light: #F5E6A3;
  --wood-main: #E8C078;
  --wood-dark: #A07820;
  --wood-shadow: #6B5020;
  
  /* Varsayılan tema: Klasik */
  --board-bg: #1B5E20;
  --board-border: #0D3A0F;
  --board-cell: #0A6F6C;
  --cell-normal: #0A6F6C;
  --cell-dl: #26C6DA;
  --cell-tl: #1E90FF;
  --cell-dw: #FFC107;
  --cell-tw: #FA4D26;
  --cell-center: #FFD700;
  --cell-text: #FFFFFF;
  --bonus-text: rgba(255,255,255,0.9);
  
  --text-light: #FFF8DC;
  --text-muted: #C9A86C;
  --success: #4CAF50;
  --error: #F44336;
  --overlay: rgba(0, 0, 0, 0.85);
  
  --ad-height: 80px; /* SMART_BANNER (adaptif 50-90px) + margin */
  --header-height: 43px;
  --rack-height: 50px;
  --controls-height: 110px;  /* 85px * 1.3 = 110px - Tuş yüksekliği %30 artırıldı */
  --feedback-height: 45px;
}

/* Embed modunda (iframe içinde) reklam alanı yok */
body.embed-mode {
  --ad-height: 0px;
}

body.embed-mode .ad-container {
  display: none !important;
}

/* Embed modunda (PC - index.php iframe) özel stiller */
body.embed-mode .cell .tile {
  font-size: 1.8rem;
}

body.embed-mode .cell .tile .points {
  font-size: 0.8rem;
}

body.embed-mode .cell-label {
  font-size: 0.85rem;
}

body.embed-mode .feedback.feedback-overlay {
  width: 90%;
  max-width: 90%;
  bottom: 20px;
}

/* Embed modunda raf harfleri %20 küçük */
body.embed-mode .rack-tile {
  width: clamp(27px, 7.6vw, 37px);
  height: clamp(27px, 7.6vw, 37px);
  font-size: 1.1rem;
}

body.embed-mode .rack-tile .points {
  font-size: 0.5rem;
}

/* Embed modunda başlangıç harfleri 2 kat büyük (sonra %30 küçültüldü) */
/* Embed-mode tablet büyütme */
body.embed-mode .starting-tile {
  width: 90px;
  height: 90px;
  font-size: 3.3rem;
  border-radius: 11px;
}

body.embed-mode .starting-tile .points {
  bottom: 5px;
  right: 7px;
  font-size: 1.1rem;
}

body.embed-mode .starting-tile .joker-text {
  font-size: 1.2rem;
}

body.embed-mode .center-start-message {
  padding: 28px 42px;
  border-radius: 17px;
  border-width: 4px;
}

body.embed-mode .center-start-message .start-avatar {
  width: 160px;
  height: 160px;
  margin-bottom: 14px;
  border-width: 4px;
}

body.embed-mode .center-start-message .start-name {
  font-size: 2.4rem;
  margin-bottom: 7px;
}

body.embed-mode .center-start-message .start-text {
  font-size: 1.7rem;
}

body.embed-mode .modal:has(.settings-content) {
  width: 520px;
  max-width: 95vw;
}

/* Tema: Klasik (Scrabble Renkleri) */
[data-theme="klasik"] {
  --board-cell: #0A6F6C;
  --cell-normal: #0A6F6C;
  --cell-dl: #26C6DA;
  --cell-tl: #1E90FF;
  --cell-dw: #FFC107;
  --cell-tw: #FA4D26;
  --cell-text: #FFFFFF;
  --bonus-text: rgba(255,255,255,0.9);
}

/* Tema: Doğa (Orman Tonları) */
[data-theme="doga"] {
  --board-cell: #4A7C59;
  --cell-normal: #4A7C59;
  --cell-dl: #87CEEB;
  --cell-tl: #DEB887;
  --cell-dw: #8FBC8F;
  --cell-tw: #228B22;
  --cell-text: #FFFFFF;
  --bonus-text: rgba(255,255,255,0.9);
  /* Taş: ışıklı krem — yeşil tahtada net */
  --wood-light: #FFF8E0;
  --wood-main: #EED898;
  --wood-dark: #9A8040;
  --wood-shadow: #5A4A20;
}

/* Tema: Modern (Grafit) */
[data-theme="modern"] {
  --board-cell: #37474F;
  --cell-normal: #37474F;
  --cell-dl: #AED581;
  --cell-tl: #FF8A65;
  --cell-dw: #4DD0E1;
  --cell-tw: #BA68C8;
  --cell-text: #FFFFFF;
  --bonus-text: rgba(255,255,255,0.9);
  /* Taş: açık krem — koyu tahtada parlak kontrast */
  --wood-light: #F8F0E0;
  --wood-main: #E0C89A;
  --wood-dark: #907858;
  --wood-shadow: #504030;
}

/* Tema: Pastel (Açık Ferah) */
[data-theme="pastel"] {
  --board-cell: #E8F5E9;
  --cell-normal: #E8F5E9;
  --cell-dl: #BBDEFB;
  --cell-tl: #FFCCBC;
  --cell-dw: #E1BEE7;
  --cell-tw: #FFCDD2;
  --cell-text: #37474F;
  --bonus-text: rgba(55,71,79,0.9);
  /* Taş: neredeyse beyaz — açık pastel tahtada belirgin */
  --wood-light: #FFFDE8;
  --wood-main: #FFF0B0;
  --wood-dark: #C8A840;
  --wood-shadow: #806020;
}

/* Tema: Gri (Soft Gray Tones) */
[data-theme="gri"] {
  --board-cell: #9E9E9E;
  --cell-normal: #9E9E9E;
  --cell-dl: #90CAF9;
  --cell-tl: #CE93D8;
  --cell-dw: #FFCC80;
  --cell-tw: #A1887F;
  --cell-center: #FDD835;
  --cell-text: #FFFFFF;
  --bonus-text: rgba(255,255,255,0.9);
  /* Taş: sıcak krem — gri tahtada sıcak kontrast */
  --wood-light: #FFF8E0;
  --wood-main: #E8D090;
  --wood-dark: #987030;
  --wood-shadow: #584018;
}

/* Tema: Kum (Görseldeki orijinal renkler) */
[data-theme="kum"] {
  --board-bg: #b0b0b0;
  --board-border: #b0b0b0;
  --board-cell: #e2e2e2;
  --cell-normal: #e2e2e2;
  --cell-dl: #a3c1cb;
  --cell-tl: #c0aec0;
  --cell-dw: #a3c19b;
  --cell-tw: #c5a37e;
  --cell-center: #E8D060;
  --cell-text: #4A4A4A;
  --bonus-text: #FFFFFF;
  /* Taş: açık bej-krem — kum tahtasında net */
  --wood-light: #FFFBF0;
  --wood-main: #F0E0C0;
  --wood-dark: #B89060;
  --wood-shadow: #705030;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: 'Nunito', sans-serif;
  background: #5C0000;
  color: var(--text-light);
  height: 100%;
  height: calc(var(--vh, 1vh) * 100);
  overflow: hidden;
  touch-action: manipulation;
}

/* PWA Container */
#app {
  height: 100%;
}

.app-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding-bottom: var(--ad-height);
  overflow: hidden;
  background: var(--bg-gradient-end);
}

/* Header - Sabit, içerik ortalı */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2px 6px 2px 8px;
  padding-top: max(2px, env(safe-area-inset-top, 0px));
  background: linear-gradient(180deg, rgba(139, 0, 0, 0.6) 0%, rgba(139, 0, 0, 0.3) 100%);
  border-bottom: 2px solid var(--gold-dark);
  border-top: none;
  flex-shrink: 0;
}

.logo {
  display: flex;
  align-items: center;
  gap: 4px;
}

.logo img {
  width: 36px;
  height: 36px;
  border-radius: 8px;
}

.logo h1 {
  font-size: 1.76rem;
  font-weight: 800;
  line-height: 1;
  background: linear-gradient(180deg, var(--gold-light) 0%, var(--gold-main) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header-stats {
  display: flex;
  gap: 5px;
  align-items: center;
  flex-shrink: 0;
  position: relative;
}

/* Kaydırma ipucu - kaldırıldı */

.stat {
  text-align: center;
  padding: 1px 1px 0px 1px;
  border-radius: 6px;
  transition: background 0.3s, box-shadow 0.3s;
  min-width: 32px;
  line-height: 1;
  cursor: pointer;
}

.stat.active {
  background: rgba(212, 175, 55, 0.4);
  box-shadow: 0 0 12px var(--gold-glow);
}

.stat-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid var(--gold-dark);
  display: none;
  margin: 0 auto 1px auto;
}

.stat-avatar-placeholder {
  width: 24px;
  height: 24px;
  display: none;
  margin: 0 auto 1px auto;
}

/* 16:9'dan uzun telefonlarda (aspect-ratio < 9/16 = 0.5625) avatarları göster */
@media screen and (max-aspect-ratio: 9/16) {
  .stat-avatar,
  .stat-avatar-placeholder {
    display: block;
  }
  
  /* 16:9'dan uzun telefonlarda kontrol tuşları normal boyutta */
  .controls {
    gap: 6px;
    padding: 6px 10px;
  }
  
  .controls-row {
    gap: 6px;
  }
  
  .btn {
    padding: 4px 12px;
    font-size: min(0.8rem, 3.2vw);
  }
}

/* Tabletler ve geniş ekranlarda da göster */
@media screen and (min-width: 768px) {
  .stat-avatar,
  .stat-avatar-placeholder {
    display: block;
  }
}

.stat[data-player="user"] .stat-avatar {
  border: none !important;
  box-shadow: none !important;
}

.stat.active .stat-avatar {
  border-color: var(--gold-light);
  box-shadow: 0 0 8px var(--gold-glow);
}

.stat.active[data-player="user"] .stat-avatar {
  border: none !important;
  box-shadow: none !important;
}

.header .stat-value {
  font-size: 0.60rem;
  font-weight: 800;
  color: var(--gold-light);
  line-height: 1;
  margin: 0;
}

.header .stat-label {
  font-size: 0.50rem !important;
  color: var(--text-muted);
  text-transform: uppercase;
  margin: 0 0 -5px 0;
  line-height: 1;
}

.bag-count {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: linear-gradient(225deg, var(--wood-light) 0%, var(--wood-main) 50%, var(--wood-dark) 100%);
  color: #2A1A08;
  padding: 1px 0.5px;
  border-radius: 5px;
  font-weight: 800;
  line-height: 1;
  gap: 0;
  margin-left: 2px;
  margin-right: 4px;
  min-width: 28px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18), inset 0 -1px 0 var(--wood-shadow);
}

.bag-icon {
  font-size: 1rem;
  font-weight: 900;
  font-family: 'Nunito', sans-serif;
}

.bag-number {
  font-size: 0.6rem;
  font-weight: 800;
}

/* Hamburger Menu */
.menu-wrapper {
  position: relative;
  margin-left: 5px;
  margin-right: 0;
}

.btn-menu {
  width: 30px;
  height: 32px;
  border-radius: 6px;
  background: linear-gradient(180deg, var(--gold-light) 0%, var(--gold-main) 100%);
  color: #3D2914;
  font-size: 1.2rem;
  font-weight: 800;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 0 var(--gold-dark);
}

.btn-menu:active {
  transform: translateY(1px);
  box-shadow: 0 1px 0 var(--gold-dark);
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 5px;
  background: var(--bg-dark);
  border: 1px solid var(--gold-dark);
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  z-index: 1000;
  min-width: 180px;
  overflow: hidden;
}

.dropdown-menu.hidden {
  display: none;
}

.dropdown-item {
  display: block;
  width: 100%;
  padding: 14px 16px;
  background: none;
  border: none;
  color: var(--text-light);
  font-size: 0.95rem;
  text-align: left;
  cursor: pointer;
  transition: background 0.2s;
}

.dropdown-item:hover {
  background: rgba(212, 175, 55, 0.2);
}

.dropdown-item:not(:last-child) {
  border-bottom: 1px solid rgba(212, 175, 55, 0.2);
}

/* Help Modal */
.help-content {
  text-align: left;
  flex: 1;
  max-height: 55vh;
  overflow-y: scroll;
  padding-right: 5px;
  /* Firefox için scrollbar */
  scrollbar-width: thin;
  scrollbar-color: var(--gold-main) rgba(255, 255, 255, 0.1);
}

/* Modal içindeki help-content - scroll kapalı (modal-content-scroll scroll yapıyor) */
.modal .help-content {
  overflow-y: visible;
  overflow-x: visible;
  max-height: none;
  padding-right: 0;
}

/* Webkit scrollbar stili - her zaman görünür */
.help-content::-webkit-scrollbar {
  width: 10px;
  display: block;
}

.help-content::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 5px;
}

.help-content::-webkit-scrollbar-thumb {
  background: var(--gold-main);
  border-radius: 5px;
  border: 2px solid rgba(255, 255, 255, 0.1);
}

.help-content::-webkit-scrollbar-thumb:hover {
  background: var(--gold-light);
}

.help-content h3 {
  color: var(--gold-light);
  font-size: 1rem;
  margin: 15px 0 8px 0;
}

.help-content h3:first-child {
  margin-top: 0;
}

.help-content p, .help-content li {
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.4;
  margin-bottom: 5px;
}

.help-content ul {
  padding-left: 20px;
}

.help-content .bonus-list {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 5px 10px;
  margin: 10px 0;
}

.help-content .bonus-item {
  display: contents;
}

.help-content .bonus-color {
  width: 20px;
  height: 20px;
  border-radius: 3px;
  display: inline-block;
}

.help-content .bonus-color.dl { background: var(--cell-dl); }
.help-content .bonus-color.tl { background: var(--cell-tl); }
.help-content .bonus-color.dw { background: var(--cell-dw); }
.help-content .bonus-color.tw { background: var(--cell-tw); }

.help-content .letter-points {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  padding: 10px;
  margin: 10px 0;
}

.help-content .letter-points p {
  margin-bottom: 3px;
  font-size: 0.8rem;
}

.help-content .letter-points b {
  color: var(--gold-light);
}

.help-content .highlight-box {
  background: rgba(212, 175, 55, 0.15);
  border-left: 3px solid var(--gold-main);
  padding: 12px 15px;
  border-radius: 0 8px 8px 0;
  margin: 10px 0;
}

.help-content .highlight-box strong {
  color: var(--gold-light);
  display: block;
  margin-bottom: 8px;
}

.help-content .update-date {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-bottom: 15px;
}

/* Game Area - Sabit layout, elemanlar birbirine dayalı */
.game-area {
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 0;
  gap: 0;
  flex: 1;
  width: 100%;
  max-width: 100vw;
  background: linear-gradient(180deg, var(--bg-gradient-start) 0%, var(--bg-gradient-mid) 50%, var(--bg-gradient-end) 100%);
}

/* Board Container - Tahtayı tutar */
.board-container {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow: hidden;
  padding: 0;
  flex-shrink: 0;
  width: 100%;
}

/* Scrabble Board - 15x15 */
.board {
  display: grid;
  grid-template-columns: repeat(15, minmax(0, 1fr));
  grid-template-rows: repeat(15, minmax(0, 1fr));
  gap: 1px;
  background: var(--board-border);
  border: none;
  border-radius: 0;
  /* Kare boyut - her zaman ekran genişliğine eşit */
  --board-size: 100vw;
  width: var(--board-size);
  height: var(--board-size);
  max-width: 100vw;
  box-shadow: none;
  flex-shrink: 0;
  aspect-ratio: 1 / 1;
  overflow: visible;
}

.cell {
  background: var(--cell-normal);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.5rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.5);
  position: relative;
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
  aspect-ratio: 1 / 1;
  min-width: 0;
  min-height: 0;
  overflow: visible;
}

.cell:hover:not(.has-tile) {
  background: rgba(255, 255, 255, 0.2);
}

.cell.dl { background: var(--cell-dl); }
.cell.tl { background: var(--cell-tl); }
.cell.dw { background: var(--cell-dw); }
.cell.tw { background: var(--cell-tw); }
.cell.center { background: var(--cell-center); }

/* Merkez yıldız büyük */
.cell.center .cell-label {
  font-size: 1rem;
}

/* Ödül hücrelerindeki yazı rengi */
.cell.dl .cell-label,
.cell.tl .cell-label,
.cell.dw .cell-label,
.cell.tw .cell-label {
  color: var(--bonus-text);
}

.cell-label {
  font-size: 0.5rem;
  text-align: center;
  line-height: 1.1;
  pointer-events: none;
  font-weight: 700;
  color: var(--cell-text);
}

.cell.has-tile .cell-label {
  display: none;
}

/* Tile on board */
.cell .tile {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  font-weight: 800;
  background: linear-gradient(225deg, var(--wood-light) 0%, var(--wood-main) 50%, var(--wood-dark) 100%);
  color: #1A0A00;
  border-radius: 3px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18), inset 0 -1px 0 var(--wood-shadow);
  font-family: 'Nunito', sans-serif;
  letter-spacing: 0;
  padding-right: 1px;
  padding-bottom: 1px;
}

.cell .tile.new {
  animation: tilePlace 0.3s ease-out;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18), inset 0 -1px 0 var(--wood-shadow), 0 0 8px var(--gold-light);
}

.cell .tile.cpu-placed {
  animation: cpuBlink 0.5s ease-in-out 6;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18), inset 0 -1px 0 var(--wood-shadow), 0 0 15px var(--gold-light);
}

/* CPU taş giriş animasyonları - ekran kenarından, yavaş */
.cell .tile.cpu-enter-left,
.cell .tile.cpu-enter-top,
.cell .tile.cpu-enter-right {
  z-index: 1000;
  position: absolute;
  inset: 0;
  width: auto;
  height: auto;
}

.cell .tile.cpu-enter-left {
  animation: cpuEnterLeft 0.65s ease-out forwards;
}

.cell .tile.cpu-enter-top {
  animation: cpuEnterTop 0.65s ease-out forwards;
}

.cell .tile.cpu-enter-right {
  animation: cpuEnterRight 0.65s ease-out forwards;
}

/* Kelime yanıp sönme animasyonu - sadece tile etkilenir */
.cell .tile.word-complete {
  animation: wordCompleteBlink 0.5s ease-in-out 3;
  z-index: 10;
}

/* Geçersiz yerleşim - kırmızı titreme */
.cell .tile.invalid-tile {
  animation: invalidShake 0.15s ease-in-out 4;
  box-shadow: 0 0 15px rgba(244, 67, 54, 0.9), inset 0 0 5px rgba(244, 67, 54, 0.5) !important;
  border: 2px solid #f44336 !important;
}

@keyframes invalidShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

/* 1. CPU (Batı - soldan) */
@keyframes cpuEnterLeft {
  0% { 
    transform: translateX(-100vw);
    opacity: 0.8; 
  }
  100% { 
    transform: translateX(0); 
    opacity: 1; 
  }
}

/* 2. CPU (Kuzey - yukarıdan) */
@keyframes cpuEnterTop {
  0% { 
    transform: translateY(-100vh);
    opacity: 0.8; 
  }
  100% { 
    transform: translateY(0); 
    opacity: 1; 
  }
}

/* 3. CPU (Doğu - sağdan) - transform-origin ile düzeltme */
@keyframes cpuEnterRight {
  0% { 
    transform: translateX(100vw);
    opacity: 0.8;
  }
  100% { 
    transform: translateX(0); 
    opacity: 1; 
  }
}

/* Kelime tamamlandı - güçlü yanıp sönme */
@keyframes wordCompleteBlink {
  0%, 100% { 
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18), inset 0 -1px 0 var(--wood-shadow);
    filter: brightness(1);
  }
  50% { 
    box-shadow: 0 0 15px 5px #4CAF50, 0 0 25px 10px rgba(76, 175, 80, 0.5);
    filter: brightness(1.2);
  }
}

/* Puan balonu */
.score-bubble {
  position: absolute !important;
  /* Pozisyon JavaScript tarafından dinamik ayarlanır */
  min-width: 30px;
  height: 30px;
  padding: 2px 6px;
  background: #E53935;
  color: white;
  font-size: 0.85rem;
  font-weight: 800;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  animation: scoreBubblePop 0.3s ease-out;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

@keyframes scoreBubblePop {
  0% { transform: scale(0); }
  70% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

/* Yeşil puan balonu - kırmızı balonla aynı format ama yeşil */
.green-score-bubble {
  position: absolute !important;
  /* Pozisyon JavaScript tarafından dinamik ayarlanır */
  min-width: 30px;
  height: 30px;
  padding: 2px 6px;
  background: #4CAF50;
  color: white;
  font-size: 0.85rem;
  font-weight: 800;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  animation: scoreBubblePop 0.3s ease-out;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.cell .tile .points {
  position: absolute;
  bottom: 0px;
  right: 1px;
  font-size: 0.48rem;
  font-weight: 700;
  color: #1A0A00;
}

@keyframes tilePlace {
  0% { transform: scale(0); opacity: 0; }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); opacity: 1; }
}

/* Player Rack - Tahtaya dayalı */
.rack-container {
  height: var(--rack-height);
  min-height: var(--rack-height);
  max-height: var(--rack-height);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: linear-gradient(180deg, rgba(139, 69, 19, 0.4) 0%, rgba(139, 69, 19, 0.2) 100%);
  border-radius: 0;
  border-top: 2px solid var(--gold-dark);
  border-bottom: 2px solid var(--gold-dark);
  flex-shrink: 0;
  flex-grow: 0;
  margin: 0;
}

.rack {
  display: flex;
  gap: 4px;
  justify-content: center;
  transition: all 0.2s ease;
  padding: 0;
}

/* Tahtadan rafa sürüklerken raf vurgusu */
.rack.drop-target {
  background: rgba(76, 175, 80, 0.3);
  box-shadow: inset 0 0 15px rgba(76, 175, 80, 0.5);
  border-radius: 8px;
}

.rack-tile {
  width: clamp(34px, 9.5vw, 46px);
  height: clamp(34px, 9.5vw, 46px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  font-weight: 700;
  background: linear-gradient(225deg, var(--wood-light) 0%, var(--wood-main) 50%, var(--wood-dark) 100%);
  color: #2A1A08;
  border-radius: 5px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18), inset 0 -1px 0 var(--wood-shadow);
  cursor: grab;
  position: relative;
  transition: transform 0.15s ease-out, box-shadow 0.15s ease-out, order 0.2s ease-out;
  user-select: none;
  font-family: 'Nunito', sans-serif;
  letter-spacing: 0;
}

.rack-tile:active {
  cursor: grabbing;
  transform: scale(1.1);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.5);
}

.rack-tile.selected {
  transform: translateY(-5px) scale(1.05);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.5), 0 0 15px var(--gold-light);
}

.rack-tile.dragging {
  opacity: 0.4;
  transform: scale(0.9);
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

/* Raf içi sürükleme - placeholder (boş yer) */
.rack-placeholder {
  width: clamp(34px, 9.5vw, 46px);
  height: clamp(34px, 9.5vw, 46px);
  background: rgba(255, 215, 0, 0.3);
  border: 2px dashed var(--gold-light);
  border-radius: 5px;
  box-sizing: border-box;
}

/* Yeni gelen harfler animasyonu */
.rack-tile.new-tile {
  animation: newTileSlide 0.4s ease-out forwards;
}

@keyframes newTileSlide {
  0% { 
    transform: translateY(-30px);
    opacity: 0;
  }
  100% { 
    transform: translateY(0);
    opacity: 1;
  }
}

/* Tahtadaki geçici taşlar sürüklenebilir */
.draggable-temp {
  cursor: grab;
}

.draggable-temp.dragging {
  opacity: 0.4;
}

/* Sürükle-bırak drop zone stilleri */
.cell.drop-valid {
  background: rgba(76, 175, 80, 0.5) !important;
  box-shadow: inset 0 0 10px rgba(76, 175, 80, 0.8);
  transform: scale(1.05);
}

.cell.drop-invalid {
  background: rgba(244, 67, 54, 0.4) !important;
  box-shadow: inset 0 0 10px rgba(244, 67, 54, 0.6);
}

/* Ghost element (sürüklerken görünen kopya) */
.drag-ghost {
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 20px var(--gold-light);
  border-radius: 5px;
}

/* Sürüklenen taş puan göstergesi */
#rack-drag-ghost,
#drag-ghost {
  position: relative;
}

#rack-drag-ghost .ghost-points,
#drag-ghost .ghost-points {
  position: absolute;
  bottom: 2px;
  right: 4px;
  font-size: 0.6rem;
  font-weight: 700;
  color: #2A1A08;
}

.rack-tile .points {
  position: absolute;
  bottom: 2px;
  right: 4px;
  font-size: 0.55rem;
  font-weight: 700;
  color: #2A1A08;
}

/* Controls - Rafa dayalı */
.controls {
  height: auto;
  min-height: auto;
  max-height: none;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 6px;
  padding: 6px 10px;
  flex-shrink: 0;
  flex-grow: 0;
  margin: 0;
  max-width: 100vw;
  box-sizing: border-box;
}

.controls-row {
  display: flex;
  justify-content: center;
  gap: 6px;
  max-width: 100%;
  flex-wrap: nowrap;
  width: fit-content;
  margin: 0 auto;
}

.btn {
  padding: 8px 14px;  /* 4px 12px'ten artırıldı - tuşlar daha yüksek */
  font-family: 'Nunito', sans-serif;
  font-size: min(0.85rem, 3.3vw);  /* Font da hafif büyütüldü */
  font-weight: 700;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  white-space: nowrap;
  flex-shrink: 1;
  min-width: 0;
}

.btn-primary {
  background: linear-gradient(180deg, var(--gold-light) 0%, var(--gold-main) 100%);
  color: #3D2914;
  box-shadow: 0 3px 0 var(--gold-dark);
}

.btn-primary:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--gold-dark);
}

.btn-secondary {
  background: linear-gradient(180deg, #555 0%, #333 100%);
  color: #FFF;
  box-shadow: 0 3px 0 #222;
}

.btn-secondary:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #222;
}

.btn-gold {
  background: linear-gradient(180deg, #FFD700 0%, #FFA500 50%, #FF8C00 100%);
  color: #3D2914;
  box-shadow: 0 4px 0 #B8860B, 0 0 20px rgba(255, 215, 0, 0.5);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.3);
}

.btn-gold:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #B8860B;
}

.btn-large {
  padding: 18px 24px;
  font-size: 1.1rem;
  font-weight: 800;
}

.btn-success {
  background: linear-gradient(180deg, #4CAF50 0%, #388E3C 100%);
  color: #FFF;
  box-shadow: 0 3px 0 #2E7D32;
}

.btn-danger {
  background: linear-gradient(180deg, #F44336 0%, #C62828 100%);
  color: #FFF;
  box-shadow: 0 3px 0 #B71C1C;
}

#pass-countdown {
  font-size: 0.75em;
  font-weight: 700;
  opacity: 0.9;
  letter-spacing: 0;
}

.pass-timer-urgent {
  animation: pass-pulse 0.8s ease-in-out infinite;
}

@keyframes pass-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.setting-select {
  background: #2a0a0a;
  color: #FFD700;
  border: 1px solid rgba(255, 215, 0, 0.4);
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 0.85rem;
  cursor: pointer;
  width: 110px;
  min-width: 0;
  flex-shrink: 0;
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
}

.btn-info {
  background: linear-gradient(180deg, #29B6F6 0%, #0288D1 100%);
  color: #FFF;
  box-shadow: 0 3px 0 #01579B;
}

.btn-info:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #01579B;
}

.btn-warning {
  background: linear-gradient(180deg, #FFA726 0%, #F57C00 100%);
  color: #FFF;
  box-shadow: 0 3px 0 #E65100;
}

.btn-warning:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #E65100;
}

.btn-purple {
  background: linear-gradient(180deg, #AB47BC 0%, #7B1FA2 100%);
  color: #FFF;
  box-shadow: 0 3px 0 #4A148C;
}

.btn-purple:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #4A148C;
}

.btn-cyan {
  background: linear-gradient(180deg, #26C6DA 0%, #00ACC1 100%);
  color: #FFF;
  box-shadow: 0 3px 0 #00838F;
}

.btn-cyan:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #00838F;
}

/* Harf değiştirme */
.exchange-rack {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 15px 0;
  flex-wrap: wrap;
}

.exchange-tile {
  width: 48px;
  height: 48px;
  background: linear-gradient(225deg, var(--wood-light) 0%, var(--wood-main) 50%, var(--wood-dark) 100%);
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  color: #2A1A08;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.4);
  position: relative;
}

.exchange-tile-char {
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1;
  color: #2A1A08;
}

.exchange-tile-points {
  font-size: 0.65rem; /* ESKİ HAL */
  font-weight: 700; /* ESKİ HAL */
  color: #2A1A08; /* ESKİ HAL */
  position: absolute;
  bottom: 3px;
  right: 4px;
  line-height: 1;
}

.exchange-tile.joker .exchange-tile-char {
  color: #2A1A08;
}

.exchange-tile.joker {
  background: linear-gradient(225deg, var(--wood-light) 0%, var(--wood-main) 50%, var(--wood-dark) 100%) !important;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.exchange-tile-joker {
  font-size: 0.6rem;
  font-weight: 800;
  color: #2A1A08;
  letter-spacing: 0.5px;
  line-height: 1;
}

.exchange-tile.selected {
  border-color: #FFD700;
  background: linear-gradient(145deg, #FFE4B5 0%, #FFD700 50%, #FFC107 100%);
  transform: scale(1.1);
  box-shadow: 0 4px 8px rgba(255, 215, 0, 0.5), inset 0 1px 0 rgba(255,255,255,0.4);
}

.exchange-info {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.exchange-select-all {
  display: block;
  width: 100%;
  margin: 10px 0;
  padding: 10px;
  font-size: 0.95rem;
}

.exchange-warning {
  text-align: center;
  color: #FF9800;
  font-size: 0.85rem;
  margin-top: 10px;
}

/* Tuş simgeleri */
.btn .icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.2em;
  height: 1.2em;
  margin-right: 4px;
  font-weight: 700;
  font-size: 1em;
}

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

/* Ad Container */
.ad-container {
  height: var(--ad-height);
  min-height: var(--ad-height);
  max-height: var(--ad-height);
  background: rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 0;
  padding-bottom: env(safe-area-inset-bottom, 0);
  border-top: none;
  overflow: hidden;
  width: 100%;
  flex-shrink: 0;
  flex-grow: 0;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 50;
  box-sizing: border-box;
}

.ad-container .adsbygoogle {
  display: block;
  margin: 0 auto;
  text-align: center;
}

.ad-container.hidden {
  display: none;
}

.ad-label {
  display: none;
}

.ad-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  overflow: hidden;
}

/* Feedback */
/* Feedback Area - Sabit alan */
.feedback-area {
  height: var(--feedback-height);
  min-height: var(--feedback-height);
  max-height: var(--feedback-height);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0 10px;
  overflow: hidden;
  flex-shrink: 0;
  flex-grow: 0;
}

/* Tüm feedback mesajları - overlay olarak */
.feedback {
  padding: 15px 25px;
  border-radius: 12px;
  font-size: 1.3rem;
  font-weight: 700;
  text-align: center;
  pointer-events: auto;
}

/* Tüm paneller - rafın altında */
.feedback.feedback-overlay {
  position: fixed;
  top: auto;
  bottom: calc(var(--ad-height) + 5px); /* Genel pozisyon */
  left: 50%;
  transform: translateX(-50%);
  width: 90vw;
  max-width: 90vw;
  z-index: 9999998; /* Banner reklamların üstünde, modalın hemen altında! */
  padding: 18px 20px;
  border-radius: 12px;
  font-size: 1.5rem;
  font-weight: 700;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  box-shadow: 0 -4px 25px rgba(0, 0, 0, 0.6);
  /* Dinamik yükseklik - içerik kadar, max 35vh */
  min-height: auto;
  max-height: 35vh;
}

/* Sıra sende ve Düşünüyor gibi kısa mesajlar */
.feedback.feedback-overlay.info,
.feedback.feedback-overlay.thinking {
  font-size: 1.28rem;
  padding: 24px 20px;
  justify-content: center;
  overflow-y: auto;
}

.feedback.success {
  background: linear-gradient(180deg, #66BB6A 0%, var(--success) 30%, #2E7D32 100%);
  color: #FFF;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
  overflow: hidden !important;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  text-align: left;
  bottom: calc(var(--ad-height) - 5px) !important; /* Anlam paneli 10px aşağı */
}

/* Anlam içeriği - kaydırılabilir alan */
.feedback.success .feedback-scroll-area {
  flex: 1;
  min-height: 0;
  overflow-y: scroll;
  padding-right: 10px;
  /* Scrollbar stilleri - her zaman görünsün */
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.5) rgba(0, 0, 0, 0.2);
}

.feedback.success .feedback-scroll-area::-webkit-scrollbar {
  width: 8px;
}

.feedback.success .feedback-scroll-area::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
}

.feedback.success .feedback-scroll-area::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.5);
  border-radius: 4px;
  min-height: 30px;
}

.feedback.success .feedback-scroll-area::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.7);
}

/* İkincil anlam paneli (tıklanan söz) - yeşilin koyu tonu */
.feedback.success.nested-meaning-active,
.feedback.warning.nested-meaning-active {
  background: linear-gradient(180deg, #2E7D32 0%, #1B5E20 30%, #0D3B12 100%);
}

.feedback.error {
  background: linear-gradient(180deg, #EF5350 0%, var(--error) 30%, #B71C1C 100%);
  color: #FFF;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
  bottom: calc(var(--ad-height) + 60px) !important; /* 60px yukarı */
}

/* Çevrimdışı paneli - ekrana ortalı */
.feedback.error.offline-panel {
  font-size: 1.1rem;
  padding: 20px 25px;
  position: fixed;
  top: 50%;
  bottom: auto !important; /* Override - ekrana ortalı kalsın */
  left: 50%;
  transform: translate(-50%, -50%);
  width: calc(100% - 40px);
  max-width: 400px;
}

.feedback.warning {
  background: linear-gradient(180deg, #FFB74D 0%, #FF9800 30%, #E65100 100%);
  color: #FFF;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
  bottom: calc(var(--ad-height) + 60px) !important; /* 60px yukarı */
}

.feedback.thinking {
  background: linear-gradient(180deg, #42A5F5 0%, #2196F3 30%, #1565C0 100%);
  color: #FFF;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
  padding: 12px 20px;
  bottom: calc(var(--ad-height) + 60px) !important; /* 60px yukarı */
}

.thinking-content {
  display: flex;
  align-items: center;
  gap: 16px;
}

.thinking-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
  flex-shrink: 0;
}

.thinking-right {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.thinking-text {
  font-size: 1.1rem;
  font-weight: 600;
}

.thinking-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: #FFF;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.feedback.info {
  background: linear-gradient(180deg, #4FC3F7 0%, #29B6F6 30%, #0288D1 100%);
  color: #FFF;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
  bottom: calc(var(--ad-height) + 60px) !important; /* 60px yukarı */
}

.feedback .meaning {
  font-size: 1.1rem;
  font-weight: 400;
  margin-top: 5px;
  opacity: 0.9;
}

.feedback .meanings {
  font-size: 1.05rem;
  font-weight: 400;
  margin-top: 8px;
  text-align: left;
  line-height: 1.5;
  width: 100%;
}

.feedback .meanings b {
  color: #FFD700;
  font-weight: 700;
}

/* Anlam paneli özel stilleri */
.feedback-close {
  position: absolute;
  top: 8px;
  right: 12px;
  cursor: pointer;
  opacity: 0.7;
  font-size: 1rem;
  transition: opacity 0.2s;
}

.feedback-close:hover {
  opacity: 1;
}

.feedback-content {
  padding-right: 25px;
}

/* Pause butonu - alt orta */
.feedback-pause-btn {
  display: inline-block;
  margin-top: 15px;
  padding: 6px 20px;
  cursor: pointer;
  font-size: 0.9rem;
  opacity: 0.9;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  transition: all 0.2s;
}

.feedback-pause-btn:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.3);
}

.feedback-pause-btn.paused {
  background: rgba(244, 67, 54, 0.4);
}

/* Duraklat tuşunu gizle ama yer kaplasın */
.feedback-pause-btn.hidden-keep-space {
  visibility: hidden;
}

/* Geri Dön butonu */
.feedback-back-btn,
.feedback-first-btn {
  display: inline-block;
  margin-top: 15px;
  margin-right: 10px;
  padding: 6px 20px;
  cursor: pointer;
  font-size: 0.9rem;
  opacity: 0.9;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  transition: all 0.2s;
}

.feedback-back-btn:hover,
.feedback-first-btn:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.3);
}

/* Butonlar yan yana - ortalı ve sabit (koyu yeşil panel) */
.feedback-buttons,
.feedback-btn-container.feedback-buttons {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4px;
  margin-top: auto;
  padding: 12px 0 0 0 !important;
  width: 100%;
  flex-shrink: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.feedback-buttons .feedback-back-btn,
.feedback-buttons .feedback-first-btn,
.feedback-btn-container.feedback-buttons .feedback-back-btn,
.feedback-btn-container.feedback-buttons .feedback-first-btn {
  padding: 4px 10px;
  font-size: 0.95rem;
}

.feedback-buttons .feedback-back-btn,
.feedback-buttons .feedback-first-btn,
.feedback-buttons .feedback-pause-btn {
  margin-top: 0;
  margin-right: 0;
}

/* Anlam panelinde tuş container'ı ortalı ve sabit */
.feedback.success .feedback-btn-container {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  margin-top: auto;
  padding: 0;
  flex-shrink: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.feedback.success .feedback-btn-container .feedback-pause-btn {
  padding: 2px 12px;
  font-size: 0.95rem;
}

/* Tıklanabilir sözler (anlam panelinde) */
.clickable-word {
  cursor: pointer;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 2px;
}

.clickable-word:hover {
  text-decoration-style: solid;
}

@keyframes feedbackPop {
  0% { transform: translate(-50%, -50%) scale(0); opacity: 0; }
  50% { transform: translate(-50%, -50%) scale(1.1); }
  100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999999; /* Banner reklamların üstünde! */
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
  pointer-events: none !important; /* Overlay kendisi tıklanamaz, sadece içindeki modal */
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  position: relative;
  background: linear-gradient(180deg, var(--bg-gradient-start) 0%, var(--bg-gradient-mid) 100%);
  border: 3px solid var(--gold-main);
  border-radius: 16px;
  padding: 18px;
  max-width: 90%;
  width: 340px;
  max-height: calc(80vh + 30px);
  display: flex;
  flex-direction: column;
  text-align: center;
  transform: scale(0.8);
  transition: transform 0.3s;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
  overflow: hidden; /* Modal kendisi scroll DEĞİL */
  pointer-events: auto !important;
}

/* Modal içerik scroll alanı - help-content ile AYNI YAPI */
.modal-content-scroll {
  flex: 1 1 auto;
  overflow-y: scroll; /* scroll - Android WebView'de çalışıyor */
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch; /* iOS smooth scroll */
  padding-right: 5px;
  min-height: 0;
  
  /* Firefox scrollbar */
  scrollbar-width: thin;
  scrollbar-color: var(--gold-main) rgba(255, 255, 255, 0.1);
}

/* Webkit scrollbar */
.modal-content-scroll::-webkit-scrollbar {
  width: 10px;
  display: block; /* Android için gerekli */
}

.modal-content-scroll::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 5px;
}

.modal-content-scroll::-webkit-scrollbar-thumb {
  background: var(--gold-main);
  border-radius: 5px;
  border: 2px solid rgba(255, 255, 255, 0.1);
}

.modal-content-scroll::-webkit-scrollbar-thumb:hover {
  background: var(--gold-light);
}

/* iOS'ta scrollbar'ları her zaman görünür kıl */
@supports (-webkit-touch-callout: none) {
  .modal-content-scroll,
  .feedback-scroll-area,
  .help-content,
  .player-list-container {
    -webkit-overflow-scrolling: touch;
  }

  .modal-content-scroll::-webkit-scrollbar,
  .feedback-scroll-area::-webkit-scrollbar,
  .help-content::-webkit-scrollbar,
  .player-list-container::-webkit-scrollbar {
    width: 5px;
    -webkit-appearance: none;
    appearance: none;
    display: block !important;
  }

  .modal-content-scroll::-webkit-scrollbar-track,
  .feedback-scroll-area::-webkit-scrollbar-track,
  .help-content::-webkit-scrollbar-track,
  .player-list-container::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 3px;
  }

  .modal-content-scroll::-webkit-scrollbar-thumb,
  .feedback-scroll-area::-webkit-scrollbar-thumb,
  .help-content::-webkit-scrollbar-thumb,
  .player-list-container::-webkit-scrollbar-thumb {
    background: #FFD700;
    border-radius: 3px;
    min-height: 44px;
    /* Her zaman görünür - opacity yok */
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.2);
  }
}

/* Joker seçim panelinde scrollbar gizle */
.modal:has(.joker-keyboard) {
  scrollbar-gutter: auto;
}

.modal:has(.joker-keyboard) .modal-content-scroll {
  overflow-y: hidden; /* Scrollbar gizle */
  padding-right: 0; /* Scrollbar yoksa padding gereksiz */
}

/* Harf değiştir modalında da scrollbar gizle */
.modal:has(.exchange-rack) .modal-content-scroll {
  overflow-y: hidden;
  padding-right: 0;
}

/* Modal kapat butonu */
.modal-close {
  position: absolute;
  top: 10px;
  right: 14px;
  cursor: pointer;
  font-size: 1.2rem;
  color: var(--text-muted);
  opacity: 0.7;
  transition: opacity 0.2s, color 0.2s;
  z-index: 10;
}

.modal-close:hover {
  opacity: 1;
  color: var(--gold-light);
}

.modal::-webkit-scrollbar {
  width: 8px;
}

.modal::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
}

.modal::-webkit-scrollbar-thumb {
  background: var(--gold-main);
  border-radius: 4px;
}

.modal::-webkit-scrollbar-thumb:hover {
  background: var(--gold-light);
}

.modal-overlay.active .modal {
  transform: scale(1);
}

.modal h2 {
  font-size: 1.3rem;
  background: linear-gradient(180deg, var(--gold-light) 0%, var(--gold-main) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 10px;
  flex-shrink: 0;
}

.modal p {
  color: var(--text-muted);
  margin-bottom: 8px;
  font-size: 0.85rem;
}

.modal .final-score {
  font-size: 2.5rem;
  font-weight: 900;
  color: var(--gold-light);
  margin: 15px 0;
}

/* Oyun Sonu Mesajı */
.end-message {
  font-size: 1.1rem;
  color: var(--text-light);
  margin-bottom: 15px;
}

.end-message b {
  color: var(--gold-light);
  font-size: 1.3rem;
}

/* Oyun Sonu Skor Listesi */
.end-score-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 15px 0;
  padding: 10px;
  background: rgba(0,0,0,0.2);
  border-radius: 8px;
}

.end-score-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: rgba(255,255,255,0.05);
  border-radius: 6px;
  transition: all 0.2s;
}

.end-score-item.winner {
  background: linear-gradient(90deg, rgba(255,215,0,0.2) 0%, rgba(255,215,0,0.1) 100%);
  border: 1px solid var(--gold-main);
}

.end-score-name {
  font-size: 0.95rem;
  color: var(--text-light);
}

.end-score-item.winner .end-score-name {
  color: var(--gold-light);
  font-weight: bold;
}

.end-score-value {
  font-size: 1.1rem;
  font-weight: bold;
  color: var(--text-muted);
}

.end-score-item.winner .end-score-value {
  color: var(--gold-light);
  font-size: 1.2rem;
}

/* Oyun Sonu Detaylı Puan Gösterimi */
.end-score-detail {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 12px 0;
  padding: 10px;
  background: rgba(0,0,0,0.2);
  border-radius: 8px;
  max-height: calc(50vh + 30px); /* 30px artırıldı */
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--gold-main) rgba(0, 0, 0, 0.2);
  scrollbar-gutter: stable; /* Scrollbar her zaman alan kaplasın */
}

.end-score-detail::-webkit-scrollbar {
  width: 8px;
}

.end-score-detail::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
}

.end-score-detail::-webkit-scrollbar-thumb {
  background: var(--gold-main);
  border-radius: 4px;
}

.end-score-detail::-webkit-scrollbar-thumb:hover {
  background: var(--gold-light);
}


.end-score-row {
  padding: 8px 10px;
  background: rgba(255,255,255,0.05);
  border-radius: 6px;
}

.end-score-row.winner {
  background: linear-gradient(90deg, rgba(255,215,0,0.2) 0%, rgba(255,215,0,0.1) 100%);
  border: 1px solid var(--gold-main);
}

.end-score-row .end-score-name {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.end-score-row.winner .end-score-name {
  color: var(--gold-light);
  font-weight: bold;
}

.end-score-formula {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  font-size: 0.9rem;
}

.end-original {
  color: var(--text-light);
  font-weight: 600;
}

.end-minus {
  color: #F44336;
  font-weight: bold;
  margin: 0 2px;
}

.end-plus {
  color: #4CAF50;
  font-weight: bold;
  margin: 0 2px;
}

.end-bonus {
  color: #4CAF50;
  font-weight: 600;
  font-size: 0.85rem;
}

.end-letters {
  display: flex;
  gap: 2px;
  flex-wrap: wrap;
}

.end-tile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 26px;
  height: 26px;
  background: linear-gradient(145deg, #f5e6c8 0%, #d4c4a8 100%);
  border: 1px solid #a89070;
  border-radius: 3px;
  font-size: 0.8rem;
  font-weight: bold;
  color: #2d2d2d;
  box-shadow: 1px 1px 2px rgba(0,0,0,0.2);
  margin: 1px;
}

.end-tile sub {
  position: absolute;
  bottom: 0px;
  right: 1px;
  font-size: 0.55rem;
  font-weight: bold;
  color: #333;
  line-height: 1;
}

.end-tile.joker {
  background: linear-gradient(145deg, #3d3d3d 0%, #2d2d2d 100%);
  color: #ffd700;
}

.end-rack-score {
  color: #F44336;
  font-size: 0.75rem;
  margin-left: 2px;
}

.end-equals {
  color: var(--text-muted);
  margin: 0 4px;
}

.end-final {
  color: var(--text-light);
  font-weight: bold;
  font-size: 1rem;
}

.end-final.winner {
  color: var(--gold-light);
  font-size: 1.1rem;
}

/* Pratik Bitiş Paneli */
.end-stats-panel {
  text-align: center;
}

.end-stats-score {
  font-size: 2.5rem;
  font-weight: 900;
  color: var(--gold-light);
  margin-bottom: 4px;
}

.end-stats-deduction {
  color: #F44336;
  font-size: 0.8rem;
  margin-bottom: 12px;
}

.end-stats-list {
  background: rgba(0,0,0,0.2);
  border-radius: 8px;
  padding: 8px;
  text-align: left;
}

.end-stats-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 8px;
  font-size: 0.85rem;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.end-stats-row:last-child {
  border-bottom: none;
}

.end-stats-row span:first-child {
  color: var(--text-muted);
}

.end-stats-row span:last-child {
  color: var(--text-light);
  font-weight: 500;
}

/* Altın Buton (Sertifika) */
.btn-gold {
  background: linear-gradient(180deg, var(--gold-light) 0%, var(--gold-main) 50%, var(--gold-dark) 100%);
  color: #1a1a2e;
  font-weight: bold;
  border: none;
}

.btn-gold:hover {
  background: linear-gradient(180deg, #FFE082 0%, var(--gold-light) 50%, var(--gold-main) 100%);
  transform: scale(1.02);
}

/* Başarı Sertifikası */
.certificate {
  background: #1a2a4a;
  border-radius: 10px;
  padding: 3px;
  margin: 4px auto;
  box-shadow: 0 0 20px rgba(218, 165, 32, 0.3);
  max-width: 340px;
  width: 95%;
  display: flex;
}

.cert-border {
  border: 2px solid #DAA520;
  border-radius: 8px;
  padding: 10px 14px;
  background: #1a2a4a;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.cert-inner {
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex: 1;
}

.cert-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-bottom: 6px;
}

.cert-logo-img {
  width: 48px;
  height: 48px;
  border-radius: 8px;
}

.cert-logo-text {
  color: #DAA520;
  font-size: 1rem;
  font-weight: bold;
  letter-spacing: 2px;
}

.cert-title {
  color: #FFD700 !important;
  font-size: 1.1rem;
  margin: 0 0 6px 0;
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
  background: none !important;
  -webkit-background-clip: unset !important;
  -webkit-text-fill-color: #FFD700 !important;
  background-clip: unset !important;
  padding: 0;
}

.cert-mastery {
  margin-bottom: 6px;
}

.cert-mastery-label {
  display: none;
}

.cert-mastery-score {
  color: #FFD700;
  font-size: 2rem;
  font-weight: bold;
  text-shadow: 0 0 15px rgba(255, 215, 0, 0.4);
  line-height: 1;
}

.cert-message {
  color: #FFD700;
  font-size: 0.75rem;
  line-height: 1.4;
  margin-bottom: 8px;
  padding: 0 4px;
}

.cert-message strong {
  font-weight: bold;
}

.cert-score-table {
  background: #1a2a4a;
  border: 1px solid #DAA520;
  border-radius: 5px;
  padding: 6px 10px;
  margin-bottom: 6px;
  max-height: calc(40vh + 30px); /* 30px artırıldı */
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: #DAA520 rgba(0, 0, 0, 0.2);
  scrollbar-gutter: stable; /* Scrollbar her zaman alan kaplasın */
}

.cert-score-table::-webkit-scrollbar {
  width: 8px;
}

.cert-score-table::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
}

.cert-score-table::-webkit-scrollbar-thumb {
  background: #DAA520;
  border-radius: 4px;
}

.cert-score-table::-webkit-scrollbar-thumb:hover {
  background: #FFD700;
}


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

.cert-score-table th {
  color: #DAA520;
  font-size: 0.6rem;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(218, 165, 32, 0.3);
}

.cert-score-table th:first-child {
  text-align: left;
  padding-left: 4px;
}

.cert-score-table th:last-child {
  text-align: right;
  padding-right: 4px;
}

.cert-score-table td {
  padding: 3px 0;
  vertical-align: middle;
}

.cert-score-table td:first-child {
  padding-left: 4px;
}

.cert-score-table td:last-child {
  padding-right: 4px;
}

.cert-player-name {
  color: #ccc;
  font-size: 0.7rem;
  text-align: left;
  white-space: nowrap;
}

.cert-player-name.winner {
  color: #FFD700;
  font-weight: bold;
}

.cert-player-score {
  color: #ccc;
  font-size: 0.8rem;
  text-align: right;
  font-weight: 600;
}

.cert-player-score.winner {
  color: #FFD700;
  font-weight: bold;
}

/* Puan Dökümü Paneli */
.score-breakdown {
  text-align: left;
}

.breakdown-explanation {
  background: rgba(255, 215, 0, 0.1);
  border-left: 3px solid #FFD700;
  padding: 10px 12px;
  margin-bottom: 15px;
  font-size: 0.85rem;
  color: var(--text-light);
  line-height: 1.4;
}

.breakdown-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: calc(50vh + 30px); /* 30px artırıldı */
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--gold-main) rgba(0, 0, 0, 0.2);
  scrollbar-gutter: stable; /* Scrollbar her zaman alan kaplasın */
}

.breakdown-list::-webkit-scrollbar {
  width: 8px;
}

.breakdown-list::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
}

.breakdown-list::-webkit-scrollbar-thumb {
  background: var(--gold-main);
  border-radius: 4px;
}

.breakdown-list::-webkit-scrollbar-thumb:hover {
  background: var(--gold-light);
}


.breakdown-row {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 10px 12px;
}

.breakdown-row.winner {
  background: rgba(255, 215, 0, 0.1);
  border: 1px solid rgba(255, 215, 0, 0.3);
}

.breakdown-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-light);
  margin-bottom: 6px;
}

.breakdown-row.winner .breakdown-name {
  color: #FFD700;
}

.breakdown-formula {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.breakdown-original {
  color: var(--text-light);
  font-weight: 600;
}

.breakdown-operator {
  color: var(--text-muted);
}

.breakdown-deduction {
  color: #F44336;
  font-weight: 600;
}

.breakdown-bonus {
  color: #4CAF50;
  font-weight: 600;
}

.breakdown-final {
  color: var(--text-light);
  font-weight: 700;
  font-size: 1rem;
}

.breakdown-final.winner {
  color: #FFD700;
}

.breakdown-tiles {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.breakdown-tiles.empty {
  color: var(--text-muted);
  font-size: 0.8rem;
  font-style: italic;
}

.breakdown-tile {
  width: 28px;
  height: 28px;
  background: linear-gradient(145deg, #F5DEB3 0%, #DEB887 50%, #D2B48C 100%);
  border-radius: 3px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.4);
}

.breakdown-tile.joker {
  background: linear-gradient(145deg, #FFE082 0%, #FFD54F 50%, #FFC107 100%);
}

.breakdown-tile-letter {
  font-size: 0.85rem;
  font-weight: 800;
  color: #3D2914;
  line-height: 1;
}

.breakdown-tile.joker .breakdown-tile-letter {
  color: #B8860B;
}

.breakdown-tile-joker {
  font-size: 0.45rem;
  font-weight: 800;
  color: #B8860B;
  line-height: 1;
  text-transform: uppercase;
}

.breakdown-tile-points {
  font-size: 0.45rem;
  font-weight: 700;
  color: #5D4E37;
  position: absolute;
  bottom: 1px;
  right: 2px;
}

.cert-player-formula {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 3px;
  font-size: 0.7rem;
  flex-wrap: wrap;
}

.cert-original {
  color: var(--text-light);
  font-weight: 600;
}

.cert-minus {
  color: #F44336;
  font-weight: bold;
}

.cert-letters {
  display: inline-flex;
  gap: 1px;
}

.cert-tile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  background: linear-gradient(145deg, #f5e6c8 0%, #d4c4a8 100%);
  border: 1px solid #a89070;
  border-radius: 2px;
  font-size: 0.55rem;
  font-weight: bold;
  color: #2d2d2d;
}

.cert-rack-score {
  color: #F44336;
  font-size: 0.6rem;
}

.cert-equals {
  color: var(--text-muted);
}

.cert-final {
  color: var(--text-light);
  font-weight: bold;
}

.cert-final.winner {
  color: #FFD700;
}

.cert-date {
  color: #888;
  font-size: 0.65rem;
  margin-bottom: 4px;
}

.cert-slogan {
  color: #DAA520;
  font-size: 0.65rem;
  font-style: italic;
  border-top: 1px solid rgba(218, 165, 32, 0.3);
  padding-top: 6px;
  margin-top: 4px;
  line-height: 1.3;
}

/* Eski sertifika stilleri - geriye uyumluluk */
.cert-logo .logo-icon-img {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.cert-logo .logo-text {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--gold-light);
  letter-spacing: 4px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
  margin-top: 8px;
}

.cert-main-text {
  font-size: 1.1rem;
  color: var(--text-light);
  line-height: 1.6;
  margin: 15px 0;
  text-align: center;
}

.cert-main-text strong {
  color: var(--gold-light);
  font-size: 1.2rem;
}

.cert-score-highlight {
  font-size: 2.5rem;
  font-weight: 900;
  color: #4CAF50;
  display: block;
  margin: 10px 0 0 0;
  text-shadow: 0 0 20px rgba(76, 175, 80, 0.5);
}

.cert-win-text {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-muted);
  display: block;
  margin-top: 2px;
}

.cert-subtitle {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin: 5px 0;
}

.cert-winner {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--gold-light);
  margin: 10px 0;
}

.cert-text {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin: 5px 0;
}

.cert-score {
  font-size: 2.5rem;
  font-weight: 900;
  color: var(--gold-light);
  margin: 15px 0;
  text-shadow: 0 0 20px rgba(255,215,0,0.5);
}

.cert-detail {
  color: #4CAF50;
  font-size: 0.9rem;
  font-weight: 600;
  margin: 10px 0;
}

.cert-footer {
  display: flex;
  justify-content: space-between;
  margin-top: 15px;
  padding-top: 10px;
  border-top: 1px solid var(--gold-dark);
  font-size: 0.7rem;
  color: var(--text-muted);
}

.modal-buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
  justify-content: center;
  align-items: center;
  margin-top: 10px;
  flex-shrink: 0;
  padding-top: 8px;
  border-top: 1px solid rgba(212, 175, 55, 0.3);
}

.modal-buttons button {
  width: 100%;
  max-width: 280px;
  font-size: 0.9rem !important;
  padding: 10px 16px !important;
  border-radius: 6px !important;
  font-family: 'Nunito', sans-serif !important;
  font-weight: 700 !important;
}

/* Ayarlar modalında buton içeride */
.settings-content + .modal-buttons,
.settings-content ~ .modal-buttons {
  margin-top: 10px;
  border-top: none;
  padding-top: 0;
}

/* Main Screen */
.main-screen {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  padding: 10px 15px;
  text-align: center;
}

.main-logo {
  width: 100px;
  height: 100px;
  border-radius: 20px;
  box-shadow: 0 0 30px var(--gold-glow);
  margin-bottom: 8px;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.main-title {
  font-size: 2.2rem;
  font-weight: 900;
  background: linear-gradient(180deg, var(--gold-light) 0%, var(--gold-main) 50%, var(--gold-dark) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 4px;
}

.main-subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 15px;
}

.game-modes {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  max-width: 280px;
}

.mode-btn {
  padding: 12px 15px;
  background: linear-gradient(180deg, rgba(139, 0, 0, 0.6) 0%, rgba(139, 0, 0, 0.3) 100%);
  border: 2px solid var(--gold-dark);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.mode-btn:hover, .mode-btn:active {
  transform: scale(1.03);
  border-color: var(--gold-light);
  box-shadow: 0 0 20px var(--gold-glow);
}

.mode-btn h3 {
  color: var(--gold-light);
  font-size: 1.1rem;
  margin-bottom: 2px;
}

.mode-btn p {
  color: var(--text-muted);
  font-size: 0.75rem;
}

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

.mode-btn.disabled:hover, .mode-btn.disabled:active {
  transform: none;
  border-color: var(--gold-dark);
  box-shadow: none;
}

/* High Scores */
.high-scores {
  margin-top: 20px;
  width: 100%;
  max-width: 280px;
}

.high-scores h3 {
  color: var(--gold-light);
  font-size: 0.9rem;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.score-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 12px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 8px;
  margin-bottom: 3px;
  font-size: 0.85rem;
  gap: 8px;
}

.score-item .rank { 
  color: var(--gold-main); 
  font-weight: 700;
  min-width: 22px;
}
.score-item .name { 
  flex: 1;
  color: var(--text-muted); 
}
.score-item .score { 
  color: var(--text-light);
  font-weight: 600;
}

.score-item.user-score {
  background: rgba(212, 175, 55, 0.15);
  border: 1px solid rgba(212, 175, 55, 0.3);
}
.score-item.user-score .name {
  color: var(--gold-light);
  font-weight: 600;
}

/* Loading */
.loading-screen {
  position: fixed;
  inset: 0;
  background: linear-gradient(180deg, var(--bg-gradient-start) 0%, var(--bg-gradient-mid) 50%, var(--bg-gradient-end) 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999993; /* Banner reklamların üstünde! */
  transition: opacity 0.4s, visibility 0.4s;
}

.loading-screen.hidden {
  opacity: 0;
  visibility: hidden;
}

.loading-logo {
  width: 100px;
  height: 100px;
  border-radius: 20px;
  box-shadow: 0 0 30px var(--gold-glow);
  animation: pulse-glow 1.5s ease-in-out infinite;
}

.loading-text {
  margin-top: 15px;
  font-size: 1.3rem;
  font-weight: 700;
  background: linear-gradient(180deg, var(--gold-light) 0%, var(--gold-main) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.loading-dots {
  display: flex;
  gap: 6px;
  margin-top: 12px;
}

.loading-dot {
  width: 8px;
  height: 8px;
  background: var(--gold-main);
  border-radius: 50%;
  animation: bounce 0.6s ease-in-out infinite;
}

.loading-dot:nth-child(2) { animation-delay: 0.1s; }
.loading-dot:nth-child(3) { animation-delay: 0.2s; }

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 30px var(--gold-glow); }
  50% { box-shadow: 0 0 50px rgba(255, 215, 0, 0.6); }
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* Checking word indicator */
.checking {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.8);
  padding: 15px 25px;
  border-radius: 10px;
  color: var(--gold-light);
  font-weight: 600;
  z-index: 150;
  display: flex;
  align-items: center;
  gap: 10px;
}

.checking-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--gold-dark);
  border-top-color: var(--gold-light);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* PWA safe area */
@supports (padding: env(safe-area-inset-top)) {
  .header {
    padding-top: max(2px, env(safe-area-inset-top));
  }
  
  .ad-container {
    padding-bottom: env(safe-area-inset-bottom);
    height: calc(var(--ad-height) + env(safe-area-inset-bottom));
    min-height: calc(var(--ad-height) + env(safe-area-inset-bottom));
    max-height: calc(var(--ad-height) + env(safe-area-inset-bottom));
  }
}

/* Word preview */
.word-preview {
  position: fixed;
  bottom: calc(var(--ad-height) + var(--rack-height) + var(--controls-height) + 20px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.8);
  padding: 8px 16px;
  border-radius: 20px;
  border: 2px solid var(--gold-dark);
  color: var(--gold-light);
  font-size: 1.1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  z-index: 50;
  display: none;
}

.word-preview.visible {
  display: block;
  animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateX(-50%) translateY(10px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* Scrollbar hide */
::-webkit-scrollbar { display: none; }
* { scrollbar-width: none; }

/* Offline Banner - Feedback area içinde */
.offline-banner {
  background: linear-gradient(135deg, #ff6b6b, #ee5a5a);
  color: white;
  text-align: center;
  padding: 25px 20px;
  font-size: 1.2rem;
  font-weight: 600;
  border-radius: 12px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.4);
  line-height: 1.5;
  width: calc(100% - 20px);
  margin: 0 10px;
  box-sizing: border-box;
  min-height: 100px;
}


/* Joker Stili - Normal taşla aynı renk */
.tile.joker {
  background: linear-gradient(225deg, var(--wood-light) 0%, var(--wood-main) 50%, var(--wood-dark) 100%) !important;
}

.rack-tile.joker {
  background: linear-gradient(225deg, var(--wood-light) 0%, var(--wood-main) 50%, var(--wood-dark) 100%) !important;
  color: #2A1A08;
  position: relative;
}

/* Joker Klavye Modal */
/* Joker harf seçimi */
.joker-content {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
}

.joker-content p {
  color: var(--text-muted);
  margin-bottom: 15px;
  text-align: center;
}

.joker-keyboard {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 5px;
  max-width: 100%;
  width: 100%;
  margin: 0 auto;
  padding: 0;
  box-sizing: border-box;
  justify-items: stretch;
}


.joker-letter {
  width: 100%;
  aspect-ratio: 1; /* Her zaman kare */
  height: auto;
  border: none;
  border-radius: 4px;
  background: linear-gradient(225deg, var(--wood-light) 0%, var(--wood-main) 50%, var(--wood-dark) 100%);
  color: #2A1A08;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.4);
  transition: transform 0.1s, box-shadow 0.1s;
  position: relative;
  padding: 2px;
  min-width: 0;
}


.joker-letter-char {
  font-size: 1.17rem; /* 1.3rem'den %10 küçültüldü */
  font-weight: 800;
  line-height: 1;
  color: #1A0A00;
  font-family: 'Nunito', sans-serif;
}

.joker-letter-points {
  font-size: 0.55rem; /* ESKİ HAL */
  font-weight: 700; /* ESKİ HAL */
  color: #1A0A00; /* ESKİ HAL */
  position: absolute;
  bottom: 2px;
  right: 3px;
  line-height: 1;
}

.joker-letter:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.4);
  background: linear-gradient(225deg, #FFF0C0 0%, var(--wood-main) 50%, var(--wood-dark) 100%);
}

.joker-letter:active {
  transform: translateY(1px);
  box-shadow: 0 1px 2px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.4);
}


/* Joker Text */
.joker-text {
  font-size: 0.7rem;
  font-weight: 800;
  color: #2A1A08;
  letter-spacing: 1px;
}

.rack-tile.joker {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* Quad mode - 4 oyuncu için daha kompakt header */
.header.quad-mode .header-stats {
  gap: 2px;
}

.header.quad-mode .stat {
  padding: 1px 1px 0px 1px;
  min-width: 28px;
}

.header.quad-mode .bag-count {
  padding: 2px 4px;
  margin-right: 2px;
}

.header.quad-mode .bag-icon {
  font-size: 0.75rem;
}

.header.quad-mode .bag-number {
  font-size: 0.6rem;
}

.header.quad-mode .menu-wrapper {
  margin-left: 0;
}

/* Küçük ekranlar için */
/* Ayarlar Modal Stilleri */
.settings-content {
  padding: 0 4px;
  box-sizing: border-box;
  width: 100%;
}

/* Ayarlar modalı daha geniş */
.modal:has(.settings-content) {
  width: min(460px, 92vw);
  max-height: 85vh;
}

.modal:has(.settings-content) .modal-content-scroll {
  overflow-x: visible;
  padding-right: 8px;
  padding-left: 4px;
}

.setting-item {
  padding: 7px 0;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.setting-item:last-child {
  border-bottom: none;
}

.setting-item:nth-child(odd) {
  background: rgba(255,255,255,0.02);
  margin: 0 -12px;
  padding: 7px 12px;
  border-radius: 6px;
}

.setting-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  gap: 8px;
  overflow: hidden;
}

.setting-text {
  flex: 1;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-light);
  text-align: left;
}

.setting-desc {
  display: none;
}

/* Toggle Switch */
.setting-label input[type="checkbox"] {
  display: none;
}

.toggle-switch {
  position: relative;
  width: 44px;
  height: 22px;
  background: #444;
  border-radius: 11px;
  transition: all 0.3s;
  flex-shrink: 0;
}

.toggle-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  transition: all 0.3s;
}

.setting-label input[type="checkbox"]:checked + .toggle-switch {
  background: var(--gold-main);
}

.setting-label input[type="checkbox"]:checked + .toggle-switch::after {
  left: 24px;
}

/* Tema Seçici */
.theme-selector {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 8px;
}

.theme-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 6px;
  border: 2px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  background: rgba(255,255,255,0.05);
  transition: all 0.2s;
  gap: 6px;
}

.theme-option:hover {
  background: rgba(255,255,255,0.1);
}

.theme-option.selected {
  border-color: var(--gold-main);
  background: rgba(255,215,0,0.1);
}

.theme-option input[type="radio"] {
  display: none;
}

.theme-preview {
  width: 48px;
  height: 32px;
  border-radius: 4px;
  overflow: hidden;
  flex-shrink: 0;
  border: 2px solid #FFD700;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

/* Tema önizleme renkleri - 45 derece açı */
.theme-preview.theme-klasik {
  background: linear-gradient(45deg, #0A6F6C 25%, #1E90FF 25%, #1E90FF 50%, #26C6DA 50%, #26C6DA 75%, #FA4D26 75%);
}

.theme-preview.theme-doga {
  background: linear-gradient(45deg, #4A7C59 25%, #228B22 25%, #228B22 50%, #DEB887 50%, #DEB887 75%, #87CEEB 75%);
}

.theme-preview.theme-modern {
  background: linear-gradient(45deg, #37474F 25%, #BA68C8 25%, #BA68C8 50%, #FF8A65 50%, #FF8A65 75%, #AED581 75%);
}

.theme-preview.theme-pastel {
  background: linear-gradient(45deg, #E8F5E9 25%, #FFCDD2 25%, #FFCDD2 50%, #FFCCBC 50%, #FFCCBC 75%, #BBDEFB 75%);
}

.theme-preview.theme-gri {
  background: linear-gradient(45deg, #9E9E9E 25%, #A1887F 25%, #A1887F 50%, #CE93D8 50%, #CE93D8 75%, #90CAF9 75%);
}

.theme-preview.theme-kum {
  background: linear-gradient(45deg, #e2e2e2 25%, #c5a37e 25%, #c5a37e 50%, #c0aec0 50%, #c0aec0 75%, #a3c1cb 75%);
}

.theme-name {
  font-size: 0.75rem;
  color: var(--text-light);
  font-weight: 600;
}

/* Başlangıç Taşları - Kimin başlayacağını belirleme */
.starting-tile {
  position: fixed;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  font-weight: 800;
  background: linear-gradient(225deg, var(--wood-light) 0%, var(--wood-main) 50%, var(--wood-dark) 100%);
  color: #1A0A00;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5), 0 0 20px rgba(255, 215, 0, 0.5);
  border: 2px solid var(--gold-main);
  z-index: 1000;
  transform: translate(-50%, -50%) scale(0);
  opacity: 0;
  transition: transform 0.45s ease-out, opacity 0.45s ease-out;
}

.starting-tile .points {
  position: absolute;
  bottom: 3px;
  right: 5px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #1A0A00;
}

.starting-tile.visible {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
}

.starting-tile .joker-text {
  font-size: 0.8rem;
  color: #1A0A00;
}

/* Kazanan harf yanıp sönme */
.starting-tile.winner-blink {
  animation: winnerBlink 0.4s ease-in-out 5;
}

@keyframes winnerBlink {
  0%, 100% {
    transform: translate(-50%, -50%) scale(1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5), 0 0 20px rgba(255, 215, 0, 0.5);
  }
  50% {
    transform: translate(-50%, -50%) scale(1.2);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.6), 0 0 40px rgba(255, 215, 0, 0.9), 0 0 60px rgba(76, 175, 80, 0.7);
    border-color: #4CAF50;
  }
}

/* Tahtanın ortasında başlangıç mesajı */
.center-start-message {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  background: linear-gradient(180deg, rgba(30, 30, 30, 0.97) 0%, rgba(15, 15, 15, 0.98) 100%);
  color: var(--gold-light);
  padding: 20px 30px;
  border-radius: 16px;
  border: 3px solid var(--gold-main);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8), 0 0 30px rgba(255, 215, 0, 0.4);
  z-index: 1500;
  opacity: 0;
  transition: all 0.3s ease-out;
  text-align: center;
}

.center-start-message .start-avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  margin: 0 auto 12px;
  border: 4px solid var(--gold-main);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6), 0 0 15px rgba(255, 215, 0, 0.4);
  animation: avatarBounce 0.6s ease-out;
  object-fit: cover;
}

@keyframes avatarBounce {
  0% { transform: scale(0) rotate(-10deg); }
  50% { transform: scale(1.2) rotate(5deg); }
  100% { transform: scale(1) rotate(0); }
}

.center-start-message .start-name {
  font-size: 1.5rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 5px;
}

.center-start-message .start-text {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--gold-main);
}

.center-start-message.visible {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

/* İstatistik Butonu */
/* Rakip Seviyesi Panel */
.difficulty-panel {
  width: 100%;
  max-width: 280px;
  margin-top: 10px;
  padding: 10px 15px;
  background: linear-gradient(180deg, rgba(139, 0, 0, 0.6) 0%, rgba(139, 0, 0, 0.3) 100%);
  border: 2px solid var(--gold-dark);
  border-radius: 12px;
}

.difficulty-panel h3 {
  color: var(--gold-light);
  font-size: 0.95rem;
  margin-bottom: 8px;
  text-align: center;
}

.difficulty-dropdown {
  width: 100%;
  padding: 10px 14px;
  background: linear-gradient(180deg, rgba(139, 0, 0, 0.8) 0%, rgba(100, 0, 0, 0.9) 100%);
  color: #fff;
  border: 2px solid var(--gold-main);
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23D4AF37' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

.difficulty-dropdown:focus {
  outline: none;
  border-color: var(--gold-light);
  box-shadow: 0 0 10px var(--gold-glow);
}

.difficulty-dropdown option {
  background: #2a1a1a;
  color: #fff;
  padding: 12px;
}

.difficulty-dropdown option:disabled {
  color: #888;
}

/* İstatistiklerim Butonu - Kapat butonu ile aynı */
.stats-btn {
  margin-top: 12px;
  padding: 10px 20px;
  background: linear-gradient(180deg, var(--gold-light) 0%, var(--gold-main) 100%);
  color: #3D2914;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 3px 0 var(--gold-dark);
  transition: all 0.2s;
}

.stats-btn:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--gold-dark);
}

/* İstatistik Modalı */
.stats-content {
  text-align: left;
  max-height: 60vh;
  overflow-y: scroll;
  scrollbar-width: thin;
  scrollbar-color: var(--gold-main) rgba(0,0,0,0.2);
  padding-right: 4px;
}

.stats-section {
  margin-bottom: 20px;
}

.stats-section h4 {
  color: var(--gold-main);
  margin-bottom: 12px;
  font-size: 0.95rem;
  border-bottom: 1px solid rgba(255,255,255,0.2);
  padding-bottom: 6px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.stat-item {
  background: rgba(0,0,0,0.3);
  padding: 10px;
  border-radius: 8px;
  text-align: center;
}

.stat-item .stat-value {
  display: block;
  font-size: 1.4rem;
  font-weight: 800;
  color: #fff;
}

.stat-item .stat-label {
  display: block;
  font-size: 0.7rem;
  color: #aaa;
  margin-top: 4px;
}

/* Söz Uzunluk Dağılımı Bar */
.stat-bars {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stat-bar-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.stat-bar-label {
  width: 50px;
  font-size: 0.75rem;
  color: #aaa;
}

.stat-bar-container {
  flex: 1;
  height: 16px;
  background: rgba(0,0,0,0.4);
  border-radius: 4px;
  overflow: hidden;
}

.stat-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold-main), var(--gold-light));
  border-radius: 4px;
  transition: width 0.3s;
}

.stat-bar-value {
  width: 40px;
  font-size: 0.75rem;
  color: #fff;
  text-align: right;
}

/* Seviye Bazlı İstatistik */
.level-stats-header {
  display: grid;
  grid-template-columns: 1fr 60px 60px 60px;
  gap: 8px;
  font-size: 0.7rem;
  color: #888;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.level-stat-row {
  display: grid;
  grid-template-columns: 1fr 60px 60px 60px;
  gap: 8px;
  font-size: 0.8rem;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.level-stat-name {
  color: #fff;
}

.level-stat-games,
.level-stat-wins {
  text-align: center;
  color: #aaa;
}

.level-stat-diff {
  text-align: right;
}

.level-stat-diff.positive {
  color: #4CAF50;
}

.level-stat-diff.negative {
  color: #F44336;
}

/* Kullanıcı Unvanı */
.user-title-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 16px 20px;
  margin-bottom: 20px;
  background: linear-gradient(180deg, rgba(255,215,0,0.15) 0%, rgba(255,215,0,0.05) 100%);
  border-radius: 12px;
  border: 1px solid rgba(255,215,0,0.3);
}

.user-title-name {
  font-size: 1.3rem;
  font-weight: 800;
  color: #FFD700;
  text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.user-title-stars {
  font-size: 1.6rem;
  letter-spacing: 4px;
  color: #FFD700;
  text-shadow: 0 1px 3px rgba(0,0,0,0.4);
}

/* Duraklatma Ekranı */
.pause-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-mid) 50%, var(--bg-gradient-end) 100%);
  padding: 20px;
}

.pause-content {
  text-align: center;
  animation: fadeIn 0.3s ease;
}

.pause-logo {
  width: 120px;
  height: 120px;
  border-radius: 24px;
  margin-bottom: 20px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.pause-title {
  font-size: 2.5rem;
  font-weight: 900;
  color: var(--gold-light);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  margin: 0 0 10px 0;
  letter-spacing: 3px;
}

.pause-subtitle {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin: 0 0 30px 0;
}

.btn-gold {
  background: linear-gradient(180deg, var(--gold-light) 0%, var(--gold-main) 50%, var(--gold-dark) 100%);
  color: #1a0505;
  font-weight: 800;
  border: none;
  padding: 16px 48px;
  font-size: 1.2rem;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(212, 175, 55, 0.4);
  transition: transform 0.2s, box-shadow 0.2s;
}

.btn-gold:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(212, 175, 55, 0.5);
}

.btn-gold:active {
  transform: translateY(0);
}

.btn-gold .icon {
  margin-right: 8px;
}

.btn-large {
  padding: 16px 48px;
  font-size: 1.2rem;
}

/* Durdur butonu stili - koyu gri */
.btn-pause {
  background: linear-gradient(180deg, #607D8B 0%, #546E7A 50%, #455A64 100%);
  color: #fff;
}

.btn-pause .icon {
  font-size: 0.7em;
}

.btn-pause:hover {
  background: linear-gradient(180deg, #78909C 0%, #607D8B 50%, #546E7A 100%);
}

/* Bitir butonu - pratik mod */
#btn-end-practice .icon {
  font-family: Arial, sans-serif;
}

@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

/* Pratik mod header */
.header.practice-mode .header-stats {
  justify-content: center;
}

/* Difficulty Modal */
.difficulty-modal-content {
  padding: 10px 0;
}

.difficulty-modal-content .difficulty-dropdown {
  width: 100%;
  padding: 12px 16px;
  font-size: 1rem;
}

/* Oyuncu Listesi */
.player-list-container {
  margin-top: 12px;
}

.player-list-hint {
  color: var(--text-muted);
  font-size: 0.75rem;
  text-align: center;
  margin-bottom: 4px;
}

.player-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 238px;
  overflow-y: scroll; /* scroll - Android WebView'de çalışıyor */
  -webkit-overflow-scrolling: touch;
  padding-right: 5px;
  
  /* Firefox scrollbar */
  scrollbar-width: thin;
  scrollbar-color: var(--gold-dark) rgba(255, 255, 255, 0.1);
}

/* Webkit scrollbar */
.player-list::-webkit-scrollbar {
  width: 8px;
  display: block; /* Android için gerekli */
}

.player-list::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

.player-list::-webkit-scrollbar-thumb {
  background: var(--gold-dark);
  border-radius: 4px;
  border: 2px solid rgba(255, 255, 255, 0.05);
}

.player-list::-webkit-scrollbar-thumb:hover {
  background: var(--gold-main);
}

.player-card {
  display: flex;
  align-items: center;
  gap: 10px; /* 12px'ten 10px'e */
  padding: 6px 10px; /* 8px 12px'ten azaltıldı */
  background: rgba(0, 0, 0, 0.3);
  border: 2px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.player-card:hover {
  background: rgba(212, 175, 55, 0.1);
  border-color: rgba(212, 175, 55, 0.3);
}

.player-card.selected {
  background: rgba(212, 175, 55, 0.2);
  border-color: var(--gold-main);
  box-shadow: 0 0 8px rgba(212, 175, 55, 0.3);
}

.player-card-avatar {
  width: 58px; /* 64px'ten %10 azaltıldı */
  height: 58px;
  border-radius: 50%;
  border: 2px solid var(--gold-dark);
}

.player-card.selected .player-card-avatar {
  border-color: var(--gold-light);
}

.player-card-name {
  color: var(--text-light);
  font-size: 1rem;
  font-weight: 600;
  flex: 1;
  text-align: left;
}

.player-card.selected .player-card-name {
  color: var(--gold-light);
}

.player-card-info {
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 4px;
  background: var(--gold-main);
  color: var(--bg-dark);
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

.player-card-info:hover {
  background: var(--gold-light);
  transform: scale(1.1);
}

/* Seçim Özeti */
.player-selection-summary {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 6px;
  font-size: 0.8rem;
  flex-wrap: wrap;
}

.summary-selected {
  color: var(--gold-light);
  font-weight: 500;
}

.summary-random {
  color: var(--text-muted);
}

.summary-divider {
  color: var(--text-muted);
  opacity: 0.5;
}

.btn-clear-selection {
  background: linear-gradient(180deg, var(--gold-light) 0%, var(--gold-main) 100%);
  border: 1px solid var(--gold-dark);
  color: #3D2914;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  margin-left: 8px;
}

.btn-clear-selection:hover {
  background: linear-gradient(180deg, var(--gold-main) 0%, var(--gold-dark) 100%);
}

/* Seçim limiti modal */
.selection-limit-overlay {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  background: rgba(0, 0, 0, 0.85) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  z-index: 99999999 !important; /* EN ÜSTTE! */
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none !important; /* Overlay kendisi tıklanamaz */
}

.selection-limit-overlay.active {
  opacity: 1;
}

.selection-limit-modal {
  background: linear-gradient(180deg, #2a1810 0%, #1a0f0a 100%);
  border: 2px solid var(--gold-main);
  border-radius: 12px;
  padding: 20px 24px;
  text-align: center;
  max-width: 280px;
  max-height: 80vh;
  overflow: hidden; /* scroll modal-content-scroll'da */
  transform: scale(0.9);
  transition: transform 0.2s;
  pointer-events: auto !important;
  display: flex; /* flex layout için */
  flex-direction: column;
}

.selection-limit-overlay.active .selection-limit-modal {
  transform: scale(1);
}

.selection-limit-modal p {
  color: var(--text-light);
  font-size: 1rem;
  margin-bottom: 16px;
}

.selection-limit-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.selection-limit-buttons button {
  padding: 10px 16px;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.selection-limit-buttons .btn-remove-selection {
  background: linear-gradient(180deg, var(--gold-light) 0%, var(--gold-main) 100%);
  border: 1px solid var(--gold-dark);
  color: #3D2914;
}

.selection-limit-buttons .btn-close-limit {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: var(--text-light);
}

/* Oyuncu Bilgi Paneli */
/* İlk Açılış Hoşgeldin Modalı */
.welcome-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999996; /* Banner reklamların üstünde! */
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
}

.welcome-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.welcome-modal {
  position: relative;
  background: linear-gradient(180deg, #2a1810 0%, #1a0f0a 100%);
  border: 3px solid var(--gold-main);
  border-radius: 16px;
  padding: 24px 20px 20px 20px;
  text-align: center;
  max-width: 90%;
  width: 340px;
  max-height: 85vh;
  overflow-y: scroll; /* scroll - Android WebView için */
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8), 0 0 20px var(--gold-glow);
  transform: scale(0.9);
  transition: transform 0.3s;
  
  /* Firefox scrollbar */
  scrollbar-width: thin;
  scrollbar-color: var(--gold-main) rgba(255, 255, 255, 0.1);
}

/* Webkit scrollbar */
.welcome-modal::-webkit-scrollbar {
  width: 10px;
  display: block; /* Android için gerekli */
}

.welcome-modal::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 5px;
}

.welcome-modal::-webkit-scrollbar-thumb {
  background: var(--gold-main);
  border-radius: 5px;
  border: 2px solid rgba(255, 255, 255, 0.1);
}

.welcome-modal::-webkit-scrollbar-thumb:hover {
  background: var(--gold-light);
}

.welcome-modal-overlay.active .welcome-modal {
  transform: scale(1);
}

.welcome-modal-close {
  position: absolute;
  top: 8px;
  right: 10px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.4rem;
  cursor: pointer;
  padding: 5px;
  line-height: 1;
  transition: color 0.2s;
}

.welcome-modal-close:hover {
  color: var(--gold-light);
}

.welcome-modal-logo {
  width: 80px;
  height: 80px;
  border-radius: 16px;
  margin-bottom: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.welcome-modal-icon {
  font-size: 3rem;
  margin-bottom: 12px;
}

.welcome-modal-title {
  font-size: 1.3rem;
  background: linear-gradient(180deg, var(--gold-light) 0%, var(--gold-main) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 16px;
  font-weight: 800;
}

.welcome-modal-text {
  color: var(--text-light);
  font-size: 0.95rem;
  line-height: 1.5;
  margin-bottom: 20px;
}

.welcome-modal-button {
  padding: 10px 24px;
  background: linear-gradient(180deg, var(--gold-light) 0%, var(--gold-main) 100%);
  color: #3D2914;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 3px 0 var(--gold-dark);
  transition: all 0.2s;
}

.welcome-modal-button:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--gold-dark);
}

/* Oyuncu Bilgi Paneli */
.player-info-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  background: linear-gradient(180deg, #2a1810 0%, #1a0f0a 100%);
  border: 3px solid var(--gold-main);
  border-radius: 16px;
  padding: 20px;
  text-align: center;
  z-index: 2147483647 !important; /* MAX INT32 - HER ŞEYİN ÜSTÜNDE! */
  min-width: 250px;
  max-width: 300px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8), 0 0 20px var(--gold-glow);
  opacity: 0;
  transition: all 0.2s ease-out;
  pointer-events: auto !important; /* Panel tıklanabilir */
}

.player-info-panel.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.player-info-close {
  position: absolute;
  top: 8px;
  right: 10px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 5px;
  line-height: 1;
  transition: color 0.2s;
}

.player-info-close:hover {
  color: var(--gold-light);
}

.player-info-avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 4px solid var(--gold-main);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6), 0 0 15px var(--gold-glow);
  margin-bottom: 12px;
}

.player-info-name {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--gold-light);
  margin-bottom: 4px;
}

.player-info-level {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.player-info-score {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--gold-main);
  margin-bottom: 12px;
}

.player-info-bio {
  font-size: 0.85rem;
  color: var(--text-light);
  line-height: 1.5;
  opacity: 0.9;
}

.player-info-karakter {
  font-size: 0.8rem;
  color: var(--accent);
  line-height: 1.4;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(212, 175, 55, 0.2);
  font-style: italic;
}

.player-info-fav-btn {
  margin-top: 14px;
  padding: 8px 18px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  width: 100%;
}

.player-info-fav-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.player-info-fav-btn.fav-active {
  background: rgba(255, 60, 80, 0.25);
  border-color: #ff4060;
  color: #ff8090;
}

/* Torba Bilgi Paneli */
.bag-info-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  background: linear-gradient(180deg, #2a1810 0%, #1a0f0a 100%);
  border: 3px solid var(--gold-main);
  border-radius: 16px;
  padding: 24px 32px;
  text-align: center;
  z-index: 9999995; /* Banner reklamların üstünde! */
  min-width: 200px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8), 0 0 20px var(--gold-glow);
  opacity: 0;
  transition: all 0.2s ease-out;
}

.bag-info-panel.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.bag-info-close {
  position: absolute;
  top: 8px;
  right: 10px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 5px;
  line-height: 1;
  transition: color 0.2s;
}

.bag-info-close:hover {
  color: var(--gold-light);
}

.bag-info-icon {
  margin-bottom: 10px;
  line-height: 1;
}

.bag-icon-img {
  width: 92px;
  height: 92px;
}

.bag-info-count {
  font-size: 3.5rem;
  font-weight: 800;
  color: var(--gold-light);
  margin-bottom: 8px;
  line-height: 1;
}

.bag-info-text {
  font-size: 0.95rem;
  color: var(--text-muted);
}

/* Oyun İstatistikleri Paneli */
.game-stats-panel {
  padding: 5px 0;
}

.stats-section {
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(212, 175, 55, 0.2);
}

.stats-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.stats-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 3px 0;
}

.stats-label {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.stats-value {
  color: var(--text-light);
  font-weight: 600;
  font-size: 0.9rem;
}

.stats-value.highlight {
  color: var(--gold-light);
}

.stats-subtitle {
  color: var(--gold-main);
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 6px;
  text-align: center;
}

.stats-length-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
}

.stats-length-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(0, 0, 0, 0.3);
  padding: 5px;
  border-radius: 6px;
}

.stats-length-item .len {
  color: var(--text-muted);
  font-size: 0.7rem;
}

.stats-length-item .count {
  color: var(--gold-light);
  font-size: 1rem;
  font-weight: 700;
}

.stats-empty {
  text-align: center;
  color: var(--text-muted);
  font-style: italic;
  padding: 6px;
}


/* Devam Eden Oyun - Oyuncu Listesi */
.resume-players-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 15px 0;
}

.resume-player-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 15px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 10px;
  border: 1px solid transparent;
  transition: all 0.2s;
}

.resume-player-item.current-turn {
  background: rgba(212, 175, 55, 0.15);
  border-color: var(--gold-main);
}

.resume-player-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--gold-dark);
  object-fit: cover;
}

.resume-player-item.current-turn .resume-player-avatar {
  border-color: var(--gold-light);
  box-shadow: 0 0 8px var(--gold-glow);
}

.resume-player-name {
  flex: 1;
  color: var(--text-light);
  font-weight: 500;
  font-size: 0.95rem;
}

.resume-player-score {
  color: var(--gold-light);
  font-weight: 700;
  font-size: 1.1rem;
  min-width: 40px;
  text-align: right;
}


/* Hedef Göstergesi - Sürükleme sırasında */
#target-indicator {
  position: fixed;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.85);
  border-radius: 12px;
  border: 2px solid var(--gold-main);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6), 0 0 15px rgba(255, 215, 0, 0.3);
  z-index: 9999994; /* Banner reklamların üstünde! */
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease-out;
}

#target-indicator.visible {
  opacity: 1;
}

#target-indicator .target-tile {
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  font-weight: 800;
  background: linear-gradient(225deg, var(--wood-light) 0%, var(--wood-main) 50%, var(--wood-dark) 100%);
  color: #2A1A08;
  border-radius: 6px;
  position: relative;
  border: 2px solid var(--gold-main);
}

#target-indicator .target-tile.bonus-dl {
  box-shadow: 0 0 10px var(--bonus-dl), inset 0 0 10px rgba(100, 181, 246, 0.3);
}

#target-indicator .target-tile.bonus-tl {
  box-shadow: 0 0 10px var(--bonus-tl), inset 0 0 10px rgba(76, 175, 80, 0.3);
}

#target-indicator .target-tile.bonus-dw,
#target-indicator .target-tile.bonus-star {
  box-shadow: 0 0 10px var(--bonus-dw), inset 0 0 10px rgba(255, 138, 101, 0.3);
}

#target-indicator .target-tile.bonus-tw {
  box-shadow: 0 0 10px var(--bonus-tw), inset 0 0 10px rgba(239, 83, 80, 0.3);
}

#target-indicator .target-points {
  position: absolute;
  bottom: 2px;
  right: 4px;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--wood-shadow);
}

#target-indicator .target-coord {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--gold-main);
  font-family: 'Nunito', sans-serif;
}

#target-indicator .target-bonus {
  font-size: 0.75rem;
  font-weight: 600;
  color: #81C784;
  background: rgba(76, 175, 80, 0.2);
  padding: 2px 8px;
  border-radius: 10px;
}

/* Büyüteç - Sürükleme sırasında hedef hücreyi gösterir */
#drag-magnifier {
  position: fixed;
  transform: translateX(-50%);
  background: rgba(20, 30, 40, 0.95);
  border: 2px solid var(--gold-main);
  border-radius: 12px;
  padding: 8px;
  z-index: 9999994; /* Banner reklamların üstünde! */
  pointer-events: none;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6), 0 0 15px rgba(255, 215, 0, 0.3);
  transition: opacity 0.15s ease-out;
}

#drag-magnifier .magnifier-grid {
  display: grid;
  grid-template-columns: repeat(3, 32px);
  grid-template-rows: repeat(3, 32px);
  gap: 2px;
}

#drag-magnifier .mag-cell {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  background: var(--board-cell);
  border: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
}

#drag-magnifier .mag-cell.mag-outside {
  background: transparent;
  border: 1px dashed rgba(255, 255, 255, 0.2);
}

#drag-magnifier .mag-cell.mag-target {
  background: linear-gradient(180deg, #FFE082 0%, #FFD54F 50%, #FFCA28 100%);
  border: 2px solid var(--gold-main);
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

#drag-magnifier .mag-cell.mag-filled {
  background: linear-gradient(225deg, var(--wood-light) 0%, var(--wood-main) 100%);
}

#drag-magnifier .mag-cell.mag-dl {
  background: var(--bonus-dl);
}

#drag-magnifier .mag-cell.mag-tl {
  background: var(--bonus-tl);
}

#drag-magnifier .mag-cell.mag-dw {
  background: var(--bonus-dw);
}

#drag-magnifier .mag-cell.mag-tw {
  background: var(--bonus-tw);
}

#drag-magnifier .mag-letter {
  font-size: 1.1rem;
  font-weight: 800;
  color: #3D2914;
}

#drag-magnifier .mag-points {
  position: absolute;
  bottom: 1px;
  right: 2px;
  font-size: 0.5rem;
  font-weight: 700;
  color: var(--wood-shadow);
}

#drag-magnifier .mag-bonus {
  font-size: 0.6rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.8);
}

#drag-magnifier .magnifier-coord {
  text-align: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--gold-main);
  margin-top: 4px;
  font-family: 'Nunito', sans-serif;
}

/* Tablet için büyüteç - daha küçük hücreler */
@media (min-width: 600px) {
  #drag-magnifier .magnifier-grid {
    grid-template-columns: repeat(3, 20px);
    grid-template-rows: repeat(3, 20px);
  }
  
  #drag-magnifier .mag-cell {
    width: 20px;
    height: 20px;
  }
  
  #drag-magnifier .mag-letter {
    font-size: 0.75rem;
  }
  
  #drag-magnifier .mag-points {
    font-size: 0.4rem;
  }
  
  #drag-magnifier .mag-bonus {
    font-size: 0.45rem;
  }
  
  #drag-magnifier .magnifier-coord {
    font-size: 0.65rem;
  }
}

/* Büyük tablet için daha da küçük */
@media (min-width: 900px) {
  #drag-magnifier .magnifier-grid {
    grid-template-columns: repeat(3, 18px);
    grid-template-rows: repeat(3, 18px);
  }
  
  #drag-magnifier .mag-cell {
    width: 18px;
    height: 18px;
  }
  
  #drag-magnifier .mag-letter {
    font-size: 0.65rem;
  }
  
  #drag-magnifier .mag-points {
    font-size: 0.35rem;
  }
  
  #drag-magnifier .mag-bonus {
    font-size: 0.4rem;
  }
}

/* Disabled butonlar */
.btn.disabled {
  opacity: 0.4;
  pointer-events: none;
}

/* Anlam paneli yeni format */
.meanings {
  width: 100%;
  text-align: left;
}

.meaning-word-title {
  font-size: 1.2rem;
  font-weight: 700;
  text-align: left;
  margin-bottom: 8px;
  color: #FFD700;
}

.meaning-single {
  text-align: left;
  line-height: 1.5;
}

.meaning-list {
  text-align: left;
  line-height: 1.5;
}

.meaning-item {
  margin-bottom: 6px;
  display: flex;
  align-items: flex-start;
}

.meaning-number {
  font-weight: 700;
  color: #FFD700;
  margin-right: 6px;
  flex-shrink: 0;
  min-width: 18px;
}

.meaning-text {
  flex: 1;
}

.meaning-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.2);
  margin: 12px 0;
}

/* Yanlış yazılış/kullanım paneli (!5) */
.wrong-usage-label {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.85);
  background: rgba(0, 0, 0, 0.2);
  border-radius: 6px;
  padding: 4px 8px;
  margin: 0 0 10px 0;
  font-style: italic;
  line-height: 1.4;
}

.wrong-usage-dogrusu {
  font-size: 0.82rem;
  font-weight: 700;
  color: #FFD700;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ========================================
   Hakkında Sayfası
   ======================================== */
.about-content {
  text-align: center;
  padding: 10px 0;
}

.about-logo {
  margin-bottom: 15px;
}

.about-icon {
  width: 80px;
  height: 80px;
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.about-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: #FFD700;
  margin-bottom: 12px;
}

.about-desc {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-secondary);
  margin: 0 auto 15px;
  max-width: 300px;
}

.about-divider {
  height: 1px;
  background: var(--border-color);
  margin: 15px auto;
  max-width: 200px;
}

.about-developer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.about-label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.about-name {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.about-email {
  font-size: 0.82rem;
  color: #FFD700;
  text-decoration: none;
  opacity: 0.85;
}

.about-email:hover {
  opacity: 1;
  text-decoration: underline;
}

.about-store-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 16px 24px;
  border: 2px solid #FFD700;
  border-radius: 12px;
  background: rgba(255, 215, 0, 0.08);
  margin-top: 5px;
}

.about-store-title {
  font-size: 1rem;
  font-weight: 600;
  color: #FFD700;
  text-align: center;
}

.about-store-link {
  display: block;
  transition: transform 0.2s;
}

.about-store-link:hover {
  transform: scale(1.05);
}

.about-store-link:active {
  transform: scale(0.98);
}

.about-store-icon {
  width: 97px;
  height: auto;
  object-fit: contain;
}

.about-store-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(180deg, var(--gold-light) 0%, var(--gold-main) 100%);
  color: #3D2914;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 10px 20px;
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.2s ease;
  box-shadow: 0 3px 0 var(--gold-dark);
}

.about-store-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 0 var(--gold-dark);
}

.about-store-btn:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--gold-dark);
}

.about-store-btn-icon {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

/* ========================================
   Büyük Ekranlar - 720px üzeri
   ======================================== */
@media (min-width: 720px) {
  /* Ayarlar modalı tablette daha geniş */
  .modal:has(.settings-content) {
    width: min(560px, 90vw);
  }
  /* Tahta artık ekran genişliği kadar değil, %80'i */
  .board {
    --board-size: 80vw;
    width: var(--board-size);
    height: var(--board-size);
    max-width: var(--board-size);
  }
  
  /* Board container'ı ortala */
  .board-container {
    justify-content: center;
  }
  
  /* Tahta üzerindeki taşlar için daha büyük fontlar */
  .cell .tile {
    font-size: 1.8rem;
  }
  
  .cell .tile .points {
    font-size: 0.75rem;
  }
  
  /* Bonus hücrelerindeki yazılar (2H, 3H vb.) */
  .cell-label {
    font-size: 0.8rem;
  }
  
  /* Merkez yıldız */
  .cell.center .cell-label {
    font-size: 1.6rem;
  }
  
  /* Raft hücreleri için daha büyük fontlar */
  .rack-tile {
    font-size: 2.4rem;
  }
  
  .rack-tile .points {
    font-size: 0.85rem;
  }
  
  /* Feedback panellerinin genişliğini tahta genişliğine eşitle */
  .feedback.feedback-overlay {
    width: calc(var(--board-size) - 20px);
  }
}

/* ========================================
   Yatay Ekran (Landscape) - Tahta yüksekliğe göre boyutlandır
   ======================================== */
@media (orientation: landscape) {
  /* Tahta boyutunu yüksekliğe göre ayarla */
  .board {
    --board-size: calc(100vh - var(--header-height) - var(--rack-height) - var(--controls-height) - var(--feedback-height) - var(--ad-height));
    width: var(--board-size);
    height: var(--board-size);
    max-width: var(--board-size);
  }
  
  /* Board container'ı ortala */
  .board-container {
    align-items: center;
    justify-content: center;
  }
  
  /* Main content'i de ortala */
  .main-content {
    align-items: center;
  }
  
  /* Feedback panellerinin genişliğini tahta genişliğine eşitle */
  .feedback.feedback-overlay {
    width: calc(var(--board-size) - 20px);
  }
}

/* ========================================
   Çok Küçük ve Kısa Ekranlar - 320px ve altı, 16:9'dan kısa
   ======================================== */
@media (max-width: 320px) {
  /* Hamburger menü ve torba sayısını küçült */
  .btn-menu {
    width: 26px;
    height: 26px;
    font-size: 1rem;
  }
  
  .bag-count {
    min-width: 24px;
    padding: 3px 1px;
    font-size: 0.75rem;
  }
  
  .bag-count-icon {
    font-size: 0.75rem;
  }
  
  .bag-count-number {
    font-size: 0.7rem;
  }

  /* Başlangıç taşları - vw bazlı */
  .starting-tile {
    width: 12vw !important;
    height: 12vw !important;
    font-size: 8.5vw !important;
    border-radius: 5px !important;
  }

  .starting-tile .points {
    font-size: 2.2vw !important;
    bottom: 1px;
    right: 2px;
  }

  /* Başlayan oyuncu paneli */
  .center-start-message {
    padding: 12px 18px !important;
    width: min(280px, 88vw) !important;
  }

  .center-start-message .start-avatar {
    width: 60px !important;
    height: 60px !important;
    margin-bottom: 6px !important;
    border-width: 2px !important;
  }

  .center-start-message .start-name {
    font-size: 1.05rem !important;
    margin-bottom: 3px !important;
  }

  .center-start-message .start-text {
    font-size: 0.82rem !important;
  }

  /* Tahta taş fontları - çok az küçült */
  .cell .tile {
    font-size: 0.82rem;
  }

  .cell .tile .points {
    font-size: 0.36rem;
  }

  .cell-label {
    font-size: 0.38rem;
  }
  
  /* Sözbaz iconunu kaldır */
  .logo img {
    display: none;
  }
  
  /* Logo başlığını küçült */
  .logo h1 {
    font-size: 1.4rem;
  }
  
  /* Header padding'i azalt */
  .header {
    padding: 1px 4px 2px 6px;
  }
  
  /* Raftaki harfleri büyüt ve boşlukları azalt */
  .rack-tile {
    font-size: 1.15rem;
    width: clamp(30px, 8.5vw, 36px);
    height: clamp(30px, 8.5vw, 36px);
  }
  
  .rack-tile .points {
    font-size: 0.48rem;
  }
  
  /* Raft üst/alt boşluğunu daha da azalt */
  .rack-container {
    padding: 0;
  }
  
  .rack {
    margin: -5px 0;
  }
  
  /* Controls (butonlar) ile raft arası boşluğu azalt */
  .controls {
    padding: 2px 8px;
    gap: 3px;
  }
  
  .controls-row {
    gap: 4px;
  }
  
  /* Bonus hücrelerindeki yazıları küçült (2H, 3H vb.) */
  .cell-label {
    font-size: 0.4rem;
  }
  
  /* Merkez yıldız */
  .cell.center .cell-label {
    font-size: 0.75rem;
  }
  
  /* Kontrol tuşlarındaki yazıların üst/alt padding'ini düzenle */
  .btn {
    padding: 3px 8px;
    font-size: min(0.7rem, 2.8vw);
  }
  
  /* Modal butonları */
  .modal-buttons button {
    padding: 6px 10px !important;
    font-size: 0.75rem !important;
  }
  
  /* Hepsini Değiştir butonu - orta boy */
  .btn-primary {
    padding: 5px 10px;
  }
  
  /* Modal başlık küçült */
  .modal h2 {
    font-size: 0.8rem;
    margin-bottom: 0;
    padding-top: 0;
    line-height: 1.2;
  }
  
  /* Modal yüksekliği artır */
  .modal {
    padding: 5px;
    width: 250px;
    max-height: calc(100vh - 60px);
  }
  
  /* Rakip seçim - liste yüksekliğini azalt */
  .player-list {
    gap: 0;
    max-height: 170px;
  }
  
  .player-card {
    gap: 2px;
    padding: 0 2px;
  }
  
  .player-card-avatar {
    width: 24px;
    height: 24px;
  }
  
  .player-card-name {
    font-size: 0.58rem;
    line-height: 1;
  }
  
  .player-card-info {
    width: 13px;
    height: 13px;
    font-size: 8px;
  }
  
  /* Player list hint küçült */
  .player-list-hint {
    font-size: 0.58rem;
    margin-bottom: 0;
    line-height: 1.1;
  }
  
  /* Player list container üst boşluğu azalt */
  .player-list-container {
    margin-top: 0;
  }
  
  /* Dropdown (Tüm Oyuncular) daha da küçült */
  .difficulty-dropdown {
    padding: 2px 5px;
    font-size: 0.68rem;
    line-height: 1;
    min-height: 22px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23D4AF37' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
  }
  
  .difficulty-dropdown option {
    padding: 1px;
  }
  
  /* Difficulty panel padding azalt */
  .difficulty-panel {
    padding: 2px 5px;
    margin-top: 1px;
  }
  
  .difficulty-panel h3 {
    font-size: 0.68rem;
    margin-bottom: 0;
    line-height: 1.1;
  }
  
  /* Modal buttons padding çok azalt - !important ile eziyoruz */
  .modal-buttons {
    gap: 4px !important;
    margin-top: 4px !important;
  }
  
  .modal-buttons button {
    padding: 3px 8px !important;
    font-size: 0.7rem !important;
  }
}

/* ========================================
   16:9'dan kısa (geniş) ekranlar - tuşları küçült
   ======================================== */
@media (min-aspect-ratio: 9/16) {
  /* Kontrol tuşları arası boşluğu artır */
  .controls {
    gap: 8px;
  }
  
  .controls-row {
    gap: 8px;
  }
  
  /* Standart butonları daha ince yap */
  .btn {
    padding: 3px 10px;
    font-size: min(0.75rem, 3vw);
  }
  
  /* Modal butonları */
  .modal-buttons button {
    padding: 6px 10px;
    font-size: 0.75rem;
  }
  
  /* Harf değiştirme modalı - yüksekliği artır */
  .exchange-tile {
    width: 52px;
    height: 52px;
    font-size: 1.6rem;
  }
  
  .exchange-tile-char {
    font-size: 1.6rem;
  }
  
  .exchange-tile-points {
    font-size: 0.7rem;
  }
  
  /* Hepsini Değiştir butonu - diğer modal butonlarla aynı yükseklik */
  .exchange-select-all {
    padding: 6px 10px !important;
  }
  
  /* Ayarlar paneli - tema bölümünü küçült */
  .theme-selector {
    gap: 6px;
    margin-top: 6px;
  }
  
  .theme-option {
    padding: 5px 4px;
    gap: 4px;
  }
  
  .theme-preview {
    width: 38px;
    height: 26px;
  }
  
  .theme-name {
    font-size: 0.65rem;
  }
  
  .setting-item {
    padding: 8px 0;
  }
  
  .setting-item:nth-child(odd) {
    padding: 8px;
  }
  
  .setting-text {
    font-size: 0.9rem;
  }
  
  /* Bitmemiş oyun modalı - oyuncular arası boşlukları kaldır */
  .resume-players-list {
    gap: 4px;
  }
  
  .resume-player-item {
    gap: 8px;
    padding: 6px 10px;
  }
  
  .resume-player-avatar {
    width: 32px;
    height: 32px;
  }
  
  .resume-player-name {
    font-size: 0.8rem;
  }
  
  .resume-player-score {
    font-size: 0.9rem;
    min-width: 35px;
  }
  
  /* Rakip seçim modalı - yüksekliği azalt */
  .modal {
    padding: 10px;
    width: 270px;
  }
  
  .modal h2 {
    font-size: 0.95rem;
    margin-bottom: 3px;
    padding-top: 2px;
  }
  
  .player-list-container {
    margin-top: 3px;
  }
  
  .player-list {
    gap: 1px;
    max-height: 180px;
  }
  
  .player-card {
    gap: 8px;
    padding: 3px 6px;
  }
  
  .player-card-avatar {
    width: 40px;
    height: 40px;
  }
  
  .player-card-name {
    font-size: 0.8rem;
  }
  
  .player-card-info {
    width: 20px;
    height: 20px;
    font-size: 12px;
  }
  
  .player-list-hint {
    font-size: 0.7rem;
    margin-bottom: 3px;
  }
  
  .difficulty-panel {
    padding: 5px 10px;
    margin-top: 4px;
  }
  
  .difficulty-panel h3 {
    font-size: 0.85rem;
    margin-bottom: 4px;
  }
  
  .difficulty-dropdown {
    padding: 5px 10px;
    font-size: 0.85rem;
    line-height: 1.2;
  }
  
  .difficulty-dropdown option {
    padding: 4px;
  }
  
  .modal-buttons {
    gap: 6px;
    margin-top: 6px;
  }
  
  /* Anlam paneli - iki hücre boyu + 30px daha aşağıdan başla (tahtadan uzaklaş, reklama yaklaş) */
  .feedback.feedback-overlay {
    bottom: calc(var(--ad-height) + 5px - 2 * (100vw / 15) - 30px);
    width: calc(100vw - 20px);
  }
  
  /* Başlıyor paneli - tablette biraz büyük */
  .starting-tile {
    width: 72px;
    height: 72px;
    font-size: 2.6rem;
  }
  
  .starting-tile .points {
    font-size: 0.85rem;
    bottom: 4px;
    right: 6px;
  }
  
  .starting-tile .joker-text {
    font-size: 0.9rem;
  }
  
  /* Başlıyor - avatar ve mesaj */
  .center-start-message {
    padding: 20px 32px;
  }
  
  .center-start-message .start-avatar {
    width: 120px;
    height: 120px;
    margin-bottom: 12px;
    border: 4px solid var(--gold-main);
  }
  
  .center-start-message .start-name {
    font-size: 1.8rem;
    margin-bottom: 6px;
  }
  
  .center-start-message .start-text {
    font-size: 1.3rem;
  }
  
  /* Düşünüyor paneli - avatar küçült, yükseklik azalt */
  .feedback.thinking {
    padding: 8px 16px;
  }
  
  .thinking-content {
    gap: 12px;
  }
  
  .thinking-avatar {
    width: 54px;
    height: 54px;
    border: 2px solid rgba(255, 255, 255, 0.9);
  }
  
  .thinking-text {
    font-size: 0.88rem;
  }
  
  .thinking-spinner {
    width: 22px;
    height: 22px;
    border-width: 2.5px;
  }
  
  /* Anlam paneli - başlık küçült, padding azalt */
  .feedback.success {
    padding: 12px 18px;
  }
  
  .meaning-word-title {
    font-size: 1rem;
    margin-bottom: 6px;
  }
  
  /* Rakip seçim paneli - modal boyutu %40 azalt */
  .modal {
    width: 280px;
    padding: 14px;
  }
  
  .modal h2 {
    font-size: 1.05rem;
    margin-bottom: 8px;
  }
  
  /* Player info paneli */
  .player-info-panel {
    padding: 14px;
    min-width: 200px;
    max-width: 240px;
  }
  
  .player-info-avatar {
    width: 80px;
    height: 80px;
    border: 3px solid var(--gold-main);
    margin-bottom: 8px;
  }
  
  .player-info-name {
    font-size: 1.1rem;
    margin-bottom: 3px;
  }
  
  .player-info-level {
    font-size: 0.75rem;
    margin-bottom: 6px;
  }
  
  .player-info-score {
    font-size: 0.9rem;
    margin-bottom: 8px;
  }
  
  .player-info-bio {
    font-size: 0.7rem;
  }
  
  .player-info-karakter {
    font-size: 0.65rem;
    margin-top: 6px;
    padding-top: 6px;
  }
  
  /* Hakkında Modal Optimizasyonu */
  .about-content {
    padding: 5px 0;
    max-height: calc(100vh - 140px);
    overflow-y: auto;
  }
  
  .about-logo {
    margin-bottom: 8px;
  }
  
  .about-icon {
    width: 60px;
    height: 60px;
  }
  
  .about-title {
    font-size: 1.3rem;
    margin-bottom: 6px;
  }
  
  .about-desc {
    font-size: 0.85rem;
    line-height: 1.4;
    margin: 0 auto 8px;
  }
  
  .about-divider {
    margin: 8px auto;
  }
  
  .about-developer {
    gap: 2px;
  }
  
  .about-label {
    font-size: 0.75rem;
  }
  
  .about-name {
    font-size: 0.95rem;
  }
  
  /* Diğer Uygulamalar panelini küçült */
  .about-store-box {
    padding: 8px 12px;
    gap: 6px;
    margin-top: 3px;
  }
  
  .about-store-title {
    font-size: 0.85rem;
  }
  
  /* Google Play butonu yüksekliğini azalt */
  .about-store-btn {
    padding: 6px 12px;
    font-size: 0.8rem;
  }
  
  .about-store-btn-icon {
    width: 20px;
    height: 20px;
  }
}

/* ========================================
   Tablet/Desktop - 400px üzeri genişlik
   ======================================== */
@media (min-width: 400px) {
  /* Kontrol tuşlarının yüksekliğini %70 artır */
  .btn {
    padding: 6.8px 12px;
  }
  
  /* Anlam panelini 20px aşağı al */
  .feedback.feedback-overlay {
    bottom: calc(var(--ad-height) + 5px - 20px);
  }
  
  /* Logo iconunu büyüt */
  .logo img {
    width: 44px;
    height: 44px;
  }
  
  /* Avatarları göster */
  .stat-avatar,
  .stat-avatar-placeholder {
    display: block;
  }
  
  /* Raft için daha fazla padding */
  .rack {
    padding: 4px 0;
  }
  
  /* Tahta üzerindeki taşlar için daha büyük fontlar */
  .cell .tile {
    font-size: 1.15rem;
  }
  
  .cell .tile .points {
    font-size: 0.56rem;
  }
  
  /* Bonus hücrelerindeki yazılar (2H, 3H vb.) */
  .cell-label {
    font-size: 0.55rem;
  }
  
  /* Merkez yıldız */
  .cell.center .cell-label {
    font-size: 1.1rem;
  }
  
  /* Raft hücreleri için daha büyük fontlar */
  .rack-tile {
    font-size: 1.65rem;
  }
  
  .rack-tile .points {
    font-size: 0.62rem;
  }
}

/* ========================================
   Tahta Zoom - Çift tıklama ile yakınlaştırma
   ======================================== */
.board.zoomed {
  transform-origin: 0 0;
  transition: transform 0.3s ease-out;
}

.board.zoom-out {
  transition: transform 0.3s ease-out;
}

/* Zoom göstergesi */
.zoom-indicator {
  position: fixed;
  top: 60px;
  right: 10px;
  background: rgba(0, 0, 0, 0.7);
  color: var(--gold-light);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  z-index: 200;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s;
  border: 1px solid var(--gold-dark);
}

.zoom-indicator.visible {
  opacity: 1;
}

/* ========================================
   Dışa/İçe Aktar Modalleri
   ======================================== */
.modal.export-import-modal {
  width: 400px;
  max-width: 95%;
  height: 80vh;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
}

/* Export/import modal içerik alanı - textarea'nın büyümesi için flex */
.export-modal-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  gap: 0;
}

.export-modal-content textarea {
  flex: 1;
  min-height: 0;
}

/* Sertifika modalında çizgi yok */
.modal-content:has(.certificate) .modal-buttons {
  border-top: none;
  padding-top: 0;
}

/* Dışa/İçe Aktar ana modal - sabit yükseklik */
.modal.export-intro-modal {
  width: 400px;
  max-width: 95%;
  height: 470px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* ========================================
   MASAÜSTÜ LAYOUT - 1024px ve üzeri
   ======================================== */
@media (min-width: 1024px) {
  body {
    background: #1a0303;
    overflow-y: auto;
  }
  
  #app {
    max-width: 100%;
    height: auto;
    max-height: none;
  }
  
  .app-container {
    max-width: 100%;
    height: auto;
    max-height: none;
    border-radius: 0;
  }
  
  /* Ana oyun wrapper - 3 sütun */
  .desktop-wrapper {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 20px;
    padding: 20px;
    max-width: 1400px;
    margin: 0 auto;
  }
  
  /* Sol reklam alanı - Skyscraper */
  .desktop-ad-left {
    width: 160px;
    min-width: 160px;
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
  
  .desktop-ad-left .ad-skyscraper {
    width: 160px;
    height: 600px;
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(212,175,55,0.3);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.75rem;
  }
  
  /* Orta oyun alanı */
  .desktop-game-center {
    flex: 0 0 auto;
    width: 750px;
    max-width: 750px;
  }
  
  .desktop-game-center .app-container {
    width: 100%;
    max-width: 750px;
    box-shadow: 0 0 40px rgba(0,0,0,0.5);
    border-radius: 12px;
  }
  
  .desktop-game-center .board-container {
    display: flex;
    justify-content: center;
    align-items: flex-start;
  }
  
  .desktop-game-center .board {
    --board-size: min(100%, 600px);
    width: var(--board-size);
    height: var(--board-size);
    max-width: 600px;
    max-height: 600px;
    aspect-ratio: 1 / 1;
  }
  
  /* PC'de tahtadaki harf ve puan fontları büyük */
  .desktop-game-center .cell .tile {
    font-size: 1.4rem;
  }
  
  .desktop-game-center .cell .tile .points {
    font-size: 0.65rem;
  }
  
  /* PC'de ödül hücre yazıları büyük */
  .desktop-game-center .cell-label {
    font-size: 0.7rem;
  }
  
  /* Masaüstünde hücre ve taş fontları büyük */
  .desktop-game-center .cell {
    font-size: 0.65rem;
  }
  
  .desktop-game-center .cell .tile {
    font-size: 1.4rem;
  }
  
  .desktop-game-center .cell .tile .points {
    font-size: 0.55rem;
  }
  
  /* Mobil reklam container'ı masaüstünde gizle */
  .desktop-game-center .ad-container {
    display: none;
  }
  
  /* Sağ reklam alanı - 3 kare */
  .desktop-ad-right {
    width: 300px;
    min-width: 300px;
    display: flex;
    flex-direction: column;
    gap: 15px;
  }
  
  .desktop-ad-right .ad-square {
    width: 300px;
    height: 250px;
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(212,175,55,0.3);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.75rem;
  }
  
  /* Alt bilgi alanı wrapper - üst wrapper ile aynı hizada */
  .desktop-info-wrapper {
    display: flex;
    justify-content: center;
    padding: 0 20px 40px;
    max-width: 1400px;
    margin: 0 auto;
  }
  
  /* Alt bilgi alanı - Nasıl Oynanır - orta sütunla hizalı */
  .desktop-info-section {
    width: 750px;
    max-width: 750px;
    margin: 0;
    padding: 0;
  }
  
  .desktop-info-section h2 {
    color: var(--gold-main);
    font-size: 1.5rem;
    margin-bottom: 20px;
    text-align: center;
  }
  
  .desktop-info-content {
    background: linear-gradient(180deg, var(--bg-gradient-start) 0%, var(--bg-gradient-mid) 100%);
    border: 2px solid var(--gold-dark);
    border-radius: 12px;
    padding: 30px 40px;
    color: var(--text-light);
  }
  
  .desktop-info-content h3 {
    color: var(--gold-main);
    margin-top: 24px;
    margin-bottom: 12px;
    font-size: 1.1rem;
  }
  
  .desktop-info-content h3:first-child {
    margin-top: 0;
  }
  
  .desktop-info-content p {
    line-height: 1.7;
    margin-bottom: 12px;
  }
  
  .desktop-info-content ul {
    margin-left: 20px;
    margin-bottom: 12px;
  }
  
  .desktop-info-content li {
    margin-bottom: 6px;
    line-height: 1.6;
  }
}

/* 1280px ve üzeri - daha geniş layout */
@media (min-width: 1280px) {
  .desktop-game-center {
    width: 825px;
    max-width: 825px;
  }
  
  .desktop-game-center .app-container {
    max-width: 825px;
  }
  
  .desktop-game-center .board {
    max-width: 700px;
    max-height: 700px;
  }
  
  .desktop-info-section {
    width: 825px;
    max-width: 825px;
  }
}

/* Nasıl Oynanır modal - tam ekran */
.modal.help-modal {
  width: 90vw;
  height: 90vh;
  max-width: 90vw;
  max-height: 90vh;
  padding: 0 10px !important;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-sizing: border-box;
}

.modal.help-modal h2 {
  display: none;
  margin: 0;
  padding: 0;
  height: 0;
}

.modal.help-modal .modal-content-scroll > .help-content {
  flex: 1 1 auto;
  overflow-y: visible; /* Scroll üst div'de (modal-content-scroll) */
  overflow-x: visible;
  padding: 0 !important;
  margin: 0 !important;
  min-height: 0;
  max-height: none; /* Limit yok - üst div scroll yapıyor */
}

.modal.help-modal .modal-buttons {
  flex: 0 0 auto;
  padding: 15px 5px;
  border-top: 1px solid rgba(212,175,55,0.3);
  background: var(--bg-gradient-mid);
}

/* Privacy Modal - Help Modal ile aynı stil */
.modal.privacy-modal {
  width: 90vw;
  height: 90vh;
  max-width: 90vw;
  max-height: 90vh;
  padding: 0 10px !important;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-sizing: border-box;
}

.modal.privacy-modal h2 {
  display: none;
  margin: 0;
  padding: 0;
  height: 0;
}

.modal.privacy-modal .modal-content-scroll > .privacy-content {
  flex: 1 1 auto;
  overflow-y: visible; /* Scroll üst div'de (modal-content-scroll) */
  overflow-x: visible;
  padding: 0 !important;
  margin: 0 !important;
  min-height: 0;
  max-height: none; /* Limit yok - üst div scroll yapıyor */
}

.modal.privacy-modal .modal-buttons {
  flex: 0 0 auto;
  padding: 15px 5px;
  border-top: 1px solid rgba(212,175,55,0.3);
  background: var(--bg-gradient-mid);
}

/* =============================================
   NASIL OYNANIR MODAL İÇERİĞİ
   ============================================= */

/* Modal içindeki nasıl oynanır içeriği */
.help-content .container {
  max-width: 100%;
  margin: 0;
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
}

.help-content .header {
  text-align: center;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 2px solid var(--gold-dark);
  display: flex;
  justify-content: center;
  align-items: center;
  padding-top: 0;
}

.help-content .header h1 {
  font-size: 1.5rem;
  font-weight: 800;
  background: linear-gradient(180deg, var(--gold-light) 0%, var(--gold-main) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 0;
  text-align: center;
}

.help-content .content {
  max-height: none;
  overflow-y: visible;
  padding-right: 0;
}

.help-content h2 {
  color: var(--gold-light);
  font-size: 1.2rem;
  margin: 20px 0 10px 0;
  font-weight: 700;
}

.help-content h2:first-child {
  margin-top: 0;
}

.help-content h3 {
  color: var(--gold-light);
  font-size: 1rem;
  margin: 15px 0 8px 0;
  font-weight: 600;
}

.help-content p {
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.5;
  margin-bottom: 8px;
  text-align: left;
}

.help-content ul, .help-content ol {
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.5;
  margin: 8px 0 12px 20px;
}

.help-content li {
  margin-bottom: 6px;
}

.help-content strong {
  color: var(--gold-light);
  font-weight: 700;
}

/* Bonus tablo */
.help-content .bonus-table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  overflow: hidden;
}

.help-content .bonus-table th,
.help-content .bonus-table td {
  padding: 10px;
  text-align: left;
  font-size: 0.85rem;
}

.help-content .bonus-table th {
  background: rgba(0, 0, 0, 0.3);
  color: var(--gold-light);
  font-weight: 700;
}

.help-content .bonus-table td {
  color: var(--text-muted);
  border-top: 1px solid rgba(212, 175, 55, 0.2);
}

/* Bonus hücre - kare tasarım */
.help-content .bonus-cell {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  border-radius: 4px;
  color: white;
  font-weight: 700;
  text-align: center;
  font-size: 0.65rem;
  line-height: 1.2;
  text-transform: uppercase;
}

.help-content .bonus-cell span {
  display: block;
}

.help-content .bonus-cell .multiplier {
  font-size: 0.9rem;
  font-weight: 800;
}

.help-content .dl { background: var(--cell-dl); }
.help-content .tl { background: var(--cell-tl); }
.help-content .dw { background: var(--cell-dw); color: #1a0808; }
.help-content .tw { background: var(--cell-tw); }

/* Harf puanları grid */
.help-content .letter-points {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 12px 0;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  padding: 12px;
}

.help-content .letter-card {
  text-align: center;
  padding: 8px;
  background: rgba(212, 175, 55, 0.1);
  border-radius: 6px;
  border: 1px solid rgba(212, 175, 55, 0.3);
}

.help-content .letter-card .letters {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-light);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.help-content .letter-card .points {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Highlight, note, warning, tip kutuları */
.help-content .highlight {
  background: rgba(212, 175, 55, 0.2);
  padding: 2px 6px;
  border-radius: 3px;
  font-weight: 700;
  color: var(--gold-light);
}

.help-content .note-box {
  background: rgba(212, 175, 55, 0.15);
  border-left: 3px solid var(--gold-main);
  padding: 12px 15px;
  border-radius: 0 8px 8px 0;
  margin: 12px 0;
}

.help-content .note-box strong {
  color: var(--gold-light);
  display: block;
  margin-bottom: 6px;
  font-size: 0.9rem;
}

.help-content .note-box p {
  margin-bottom: 0;
}

.help-content .warning-box {
  background: rgba(255, 193, 7, 0.1);
  border-left: 3px solid var(--cell-dw);
  padding: 12px 15px;
  border-radius: 0 8px 8px 0;
  margin: 12px 0;
}

.help-content .warning-box strong {
  color: var(--cell-dw);
  display: block;
  margin-bottom: 6px;
  font-size: 0.9rem;
}

.help-content .warning-box p {
  margin-bottom: 0;
}

.help-content .tip-box {
  background: rgba(76, 175, 80, 0.1);
  border-left: 3px solid #4CAF50;
  padding: 12px 15px;
  border-radius: 0 8px 8px 0;
  margin: 12px 0;
}

.help-content .tip-box strong {
  color: #4CAF50;
  display: block;
  margin-bottom: 6px;
  font-size: 0.9rem;
}

.help-content .tip-box p {
  margin-bottom: 0;
}

/* Mobil responsive - help-content */
@media (max-width: 768px) {
  .help-content .header {
    text-align: center;
    padding-top: 15px;
  }
  
  .help-content .header h1 {
    font-size: 1.3rem;
    text-align: center;
  }
  
  .help-content h2 {
    font-size: 1rem;
  }
  
  .help-content h3 {
    font-size: 0.9rem;
  }
  
  .help-content .letter-points {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
    padding: 10px;
  }
  
  .help-content .letter-card {
    padding: 6px;
  }
  
  .help-content .letter-card .letters {
    font-size: 0.75rem;
    letter-spacing: 0.5px;
  }
  
  .help-content .letter-card .points {
    font-size: 0.7rem;
  }
  
  /* Ödül tablosu mobilde */
  .help-content .bonus-table {
    display: block;
    width: 100%;
  }
  
  .help-content .bonus-table thead,
  .help-content .bonus-table tbody,
  .help-content .bonus-table tr {
    display: block;
    width: 100%;
  }
  
  .help-content .bonus-table thead {
    display: none;
  }
  
  .help-content .bonus-table tr {
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 8px;
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
  }
  
  .help-content .bonus-table tr:last-child {
    border-bottom: none;
  }
  
  .help-content .bonus-table td {
    display: block;
    border: none;
    padding: 0;
  }
  
  .help-content .bonus-table td:first-child {
    flex-shrink: 0;
    margin-right: 10px;
  }
  
  .help-content .bonus-table td:last-child {
    flex: 1;
    font-size: 0.75rem;
  }
  
  .help-content .bonus-cell {
    width: 40px;
    height: 40px;
    font-size: 0.55rem;
  }
  
  .help-content .bonus-cell .multiplier {
    font-size: 0.75rem;
  }
}

@media (max-width: 400px) {
  .help-content .letter-card .letters {
    font-size: 0.7rem;
  }
  
  .help-content .bonus-cell {
    width: 36px;
    height: 36px;
    font-size: 0.5rem;
  }
  
  .help-content .bonus-cell .multiplier {
    font-size: 0.7rem;
  }
}


/* Küçük ekranlar (≤360px): font küçült */
/* iPad / Geniş tablet (≥768px): hücre yazıları ve taşlar büyüt */
@media (min-width: 768px) and (max-width: 1023px) {
  .cell .tile {
    font-size: 1.5rem;
  }
  .cell .tile .points {
    font-size: 0.6rem;
  }
  .cell-label {
    font-size: 0.65rem;
  }
  .cell.center .cell-label {
    font-size: 1.4rem;
  }
}
/* ============================================================
   KUTLAMA PANELİ
   ============================================================ */
.celebration-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 9999990;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}

.celebration-panel {
  background: linear-gradient(180deg, var(--bg-gradient-start) 0%, var(--bg-gradient-mid) 100%);
  border: 3px solid var(--gold-main);
  border-radius: 16px;
  padding: 28px 32px;
  max-width: min(380px, 88vw);
  text-align: center;
  box-shadow: 0 8px 32px rgba(0,0,0,0.6), 0 0 20px rgba(255,215,0,0.3);
  animation: celebrationPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.celebration-message {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-light);
  line-height: 1.6;
  margin-bottom: 20px;
}

.celebration-btn {
  margin-top: 4px;
}

@keyframes celebrationPop {
  from { transform: scale(0.7); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

/* Konfeti animasyonu */
@keyframes confettiFall {
  0%   { transform: translateY(-20px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(110vh) rotate(720deg); opacity: 0; }
}
