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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    height: 100vh;
    margin: 0;
    padding: 0;
    transition: background 0.3s ease, color 0.3s ease;
    overflow: hidden;
}

/* ==================== TEMA SİSTEMİ ==================== */

/* Karanlık Tema */
body.theme-dark {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #e0e0e0;
}

body.theme-dark #game-container {
    background: rgba(255, 255, 255, 0.05);
}

body.theme-dark header {
    background: #0f3460;
    color: #e0e0e0;
}

body.theme-dark header h1 {
    color: #e94560;
}

body.theme-dark #game-info > div {
    background: #16213e;
    color: #e0e0e0;
}

body.theme-dark #game-board-container {
    background: rgba(15, 52, 96, 0.8);
}

body.theme-dark #main-board {
    background: #0f3460;
}

body.theme-dark .board-cell {
    background: #16213e;
    border-color: #1a1a2e;
    color: #e0e0e0;
}

body.theme-dark .board-cell:hover {
    background: #e94560;
}

body.theme-dark .player-info {
    background: #16213e;
    color: #e0e0e0;
}

body.theme-dark .triangle-cell {
    background: rgba(255, 255, 255, 0.1);
    border-color: #1a1a2e;
    color: #e0e0e0;
}

body.theme-dark .triangle-cell:hover {
    background: rgba(255, 255, 255, 0.2);
}

body.theme-dark .triangle-cell.filled {
    background: rgba(233, 69, 96, 0.8);
}

body.theme-dark .modal-content {
    background: #16213e;
    color: #e0e0e0;
}

body.theme-dark .modal-content h2,
body.theme-dark .modal-content h3,
body.theme-dark .modal-content h4 {
    color: #e94560;
}

body.theme-dark .player-input-row {
    background: #0f3460;
}

body.theme-dark .player-name-input {
    background: #1a1a2e;
    border-color: #0f3460;
    color: #e0e0e0;
}

body.theme-dark .player-score {
    background: #0f3460;
}

body.theme-dark .achievements-summary,
body.theme-dark .leaderboard-summary,
body.theme-dark .settings-section {
    background: #0f3460;
    border-color: #1a1a2e;
}

body.theme-dark .achievement-item {
    background: #16213e;
    border-color: #1a1a2e;
}

body.theme-dark .achievement-item.unlocked {
    border-color: #e94560;
}

body.theme-dark .leaderboard-table {
    background: #16213e;
}

body.theme-dark .leaderboard-table th {
    background: linear-gradient(135deg, #e94560 0%, #0f3460 100%);
}

body.theme-dark .leaderboard-table td {
    border-color: #1a1a2e;
    color: #e0e0e0;
}

body.theme-dark .language-option {
    background: #16213e;
    border-color: #1a1a2e;
}

body.theme-dark .language-option:hover {
    background: #0f3460;
    border-color: #e94560;
}

body.theme-dark .setting-select {
    background: #1a1a2e;
    border-color: #0f3460;
    color: #e0e0e0;
}

body.theme-dark .inactive-modal-content {
    background: #16213e;
    color: #e0e0e0;
}

body.theme-dark .inactive-modal-content h2 {
    color: #e94560;
}

/* Aydınlık Tema (varsayılan, değişiklik yok) */
body.theme-light {
    /* Mevcut stiller zaten aydınlık tema */
}

#game-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 2px;
    box-sizing: border-box;
}

header {
    background: white;
    padding: 2px 6px;
    border-radius: 4px;
    margin-bottom: 1px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

header h1 {
    text-align: center;
    color: #333;
    margin: 1px 0;
    font-size: 0.9em;
}

#game-info {
    display: flex;
    justify-content: space-around;
    align-items: center;
    flex-wrap: nowrap;
    gap: 6px;
}

#game-info > div {
    background: #f5f5f5;
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: bold;
    font-size: 9px;
}

#current-player {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 3px 8px !important;
    font-size: 9px !important;
    box-shadow: 0 1px 4px rgba(102, 126, 234, 0.4);
    animation: currentPlayerPulse 2s ease-in-out infinite;
}

#current-player #player-name {
    font-size: 10px;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

@keyframes currentPlayerPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
    }
}

.timer-display {
    background: #fff3cd;
    border: 2px solid #ffc107;
}

.time-value {
    font-size: 16px;
    color: #ff6b6b;
    font-weight: bold;
    display: inline-block;
    min-width: 25px;
    text-align: center;
}

.time-value.warning {
    animation: timeWarning 0.5s ease-in-out infinite;
}

@keyframes timeWarning {
    0%, 100% { color: #ff6b6b; }
    50% { color: #ff0000; }
}

#game-board-container {
    background: rgba(255, 255, 255, 0.95);
    padding: 3px;
    border-radius: 6px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow: auto;
    min-height: 0;
    gap: 0px;
    position: relative;
}

#middle-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0px;
    flex: 0 0 auto;
}

/* Merkezi Oyun Tahtası */
#main-board {
    display: grid;
    grid-template-columns: repeat(12, min(2.9vmin, 27px)); /* v1.5: daha da küçültüldü */
    grid-template-rows: repeat(12, min(2.9vmin, 27px));
    gap: 0;
    background: #000000;
    padding: 4px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
    position: relative;
    z-index: 10;
    border: 4px solid #000000; /* Dış çerçeve */
}

.board-cell {
    background: #d3d3d3; /* Açık gri */
    border-right: 2px solid #000000; /* Dikey çizgi 2k */
    border-bottom: 3px solid #000000; /* Yatay çizgi 3k */
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 300; /* İnce font */
    font-family: 'Arial', 'Helvetica', sans-serif; /* Sade font */
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    font-size: min(1.35vmin, 11px); /* v1.5: daha küçük punto */
    color: #000000; /* Siyah sayılar */
    min-height: 14px;
    min-width: 14px;
    letter-spacing: -0.2px;
}

/* Faktör 1 & 2 özel sayılar: kalın yerine yarı kalın */
.board-cell.special {
    font-weight: 600;
}

/* Son sütun - sağ kenarda çizgi olmasın */
.board-cell:nth-child(12n) {
    border-right: none;
}

/* Son satır - alt kenarda çizgi olmasın */
.board-cell:nth-child(n+133) {
    border-bottom: none;
}

.board-cell:hover {
    background: #000000;
    color: white;
    transform: scale(1.05);
    z-index: 10;
}

.board-cell.selected {
    cursor: not-allowed;
}

.board-cell.selected:hover {
    transform: scale(1);
}

.board-cell.choosing {
    background: #f39c12;
    color: white;
    border: 3px solid #e67e22;
    transform: scale(1.1);
    z-index: 50;
    animation: choosePulse 0.5s ease-in-out infinite;
}

@keyframes choosePulse {
    0%, 100% { box-shadow: 0 0 5px rgba(243, 156, 18, 0.8); }
    50% { box-shadow: 0 0 15px rgba(243, 156, 18, 1); }
}

/* Oyuncu Pulu - Artık kullanılmıyor (sayı renklendiriliyor) */
.player-token {
    display: none;
}

/* Oyuncu Alanları */
.player-area {
    flex-shrink: 0;
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.player-area.player-top,
.player-area.player-bottom {
    width: 100%; /* Merkez ile aynı genişlik */
    max-width: calc(12 * min(4.2vmin, 40px) + 14px);
}

.player-area.player-left,
.player-area.player-right {
    flex-direction: row;
    align-items: center;
}

.player-info {
    display: flex;
    justify-content: space-between;
    padding: 1px 3px;
    background: rgba(248, 249, 250, 0.9);
    border-radius: 2px;
    font-weight: bold;
    font-size: 8px;
    width: 100%;
    box-sizing: border-box;
}

.player-area.player-top .player-info {
    margin-bottom: 0px;
    margin-top: 3px;
    order: 2; /* Info üstte göster */
}

.player-area.player-bottom .player-info {
    margin-top: 0px;
    margin-bottom: 3px;
    order: 2; /* Info altta göster */
}

.player-area.player-left .player-info {
    margin-right: 0px;
    margin-left: 3px;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    width: auto;
    order: 2; /* Info solda göster */
}

.player-area.player-right .player-info {
    margin-left: 0px;
    margin-right: 3px;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    width: auto;
    order: 2; /* Info sağda göster */
}

.player-label {
    font-size: 8px;
}

.pass-count {
    font-size: 7px;
    color: #666;
}

/* Oyuncu Tahtası Wrapper - Tahta + Satır Puanları */
.player-board-wrapper {
    display: flex;
    gap: 14px; /* v1.5: sıra parlaklığı satır puanlarını kapatmasın */
    align-items: center;
    order: 1;
}

/* Oyuncu Tahtaları (Üçgen) */
.player-board {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    padding: 6px; /* Dış çerçeve 6px */
    border-radius: 4px;
    transition: all 0.3s ease;
    border: 6px solid #000000; /* Dış çerçeve siyah 6k */
    position: relative;
    z-index: 1;
    background: #000000; /* Siyah arka plan (çizgiler için) */
}

.player-board.yellow-player {
    /* Sarı oyuncu - seviye bazlı tonlar */
}

.player-board.red-player {
    /* Kırmızı oyuncu - seviye bazlı tonlar */
}

.player-board.blue-player {
    /* Mavi oyuncu - seviye bazlı tonlar */
}

.player-board.green-player {
    /* Yeşil oyuncu - seviye bazlı tonlar */
}

/* Satır Puanları */
.row-scores {
    display: flex;
    flex-direction: column;
    gap: 1px;
    font-size: min(1.6vmin, 14px); /* v1.5: daha büyük punto */
    font-weight: bold;
    color: #111;
    position: relative;
    z-index: 6; /* parlaklığın üstünde kalsın */
}

.row-score {
    min-width: min(4.6vmin, 46px); /* v1.5: daha geniş kutular */
    height: min(3.3vmin, 33px);
    min-height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff; /* v1.5: açık zemin, koyu yazı = okunaklı */
    color: #111111;
    border: 2px solid #333333;
    border-radius: 4px;
    padding: 0 5px;
    font-weight: 800;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}
.row-score.filled { background: #fff3b0; border-color: #b8860b; }
.row-score.partial { background: #ffffff; }
.row-score.empty { background: #e9e9ee; color: #888; }

.level-score.empty {
    opacity: 0.5;
    color: rgba(255, 255, 255, 0.5);
}

.level-score.partial {
    background: #000000;
    color: #FFD700;
    font-weight: bold;
    opacity: 0.85;
    font-style: italic;
}

.level-score.filled {
    background: #000000;
    color: white;
    font-weight: bold;
    opacity: 1;
}

/* Üçgen Seviyeleri */
.board-row {
    display: flex;
    gap: 0;
}

.triangle-cell {
    width: min(3vmin, 30px);
    height: min(3vmin, 30px);
    min-width: 18px;
    min-height: 18px;
    background: rgba(255, 255, 255, 0.95);
    border-right: 2px solid #000000; /* Dikey çizgi 2k */
    border-bottom: 4px solid #000000; /* Yatay çizgi 4k */
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    border-radius: 0px;
    font-size: min(1.5vmin, 13px);
    color: #333;
}

/* Son hücre - sağda çizgi olmasın */
.triangle-cell:last-child {
    border-right: none;
}

/* Son satır - altta çizgi olmasın */
.board-row:last-child .triangle-cell {
    border-bottom: none;
}

/* Seviye bazlı renkler - SARI OYUNCU */
.yellow-player .board-row[data-row="1"] .triangle-cell,
.yellow-player .board-row[data-row="2"] .triangle-cell {
    background: #fff9c4; /* Açık sarı (1-2 seviye) */
}

.yellow-player .board-row[data-row="3"] .triangle-cell,
.yellow-player .board-row[data-row="4"] .triangle-cell {
    background: #fbc02d; /* Koyu sarı (3-4 seviye) */
}

.yellow-player .board-row[data-row="5"] .triangle-cell,
.yellow-player .board-row[data-row="6"] .triangle-cell {
    background: #fff9c4; /* Açık sarı (5-6 seviye) */
}

.yellow-player .board-row[data-row="7"] .triangle-cell,
.yellow-player .board-row[data-row="8"] .triangle-cell {
    background: #fbc02d; /* Koyu sarı (7-8 seviye) */
}

/* Seviye bazlı renkler - KIRMIZI OYUNCU */
.red-player .board-row[data-row="1"] .triangle-cell,
.red-player .board-row[data-row="2"] .triangle-cell {
    background: #ffcdd2; /* Açık kırmızı (1-2 seviye) */
}

.red-player .board-row[data-row="3"] .triangle-cell,
.red-player .board-row[data-row="4"] .triangle-cell {
    background: #e53935; /* Koyu kırmızı (3-4 seviye) */
}

.red-player .board-row[data-row="5"] .triangle-cell,
.red-player .board-row[data-row="6"] .triangle-cell {
    background: #ffcdd2; /* Açık kırmızı (5-6 seviye) */
}

.red-player .board-row[data-row="7"] .triangle-cell,
.red-player .board-row[data-row="8"] .triangle-cell {
    background: #e53935; /* Koyu kırmızı (7-8 seviye) */
}

/* Seviye bazlı renkler - MAVİ OYUNCU */
.blue-player .board-row[data-row="1"] .triangle-cell,
.blue-player .board-row[data-row="2"] .triangle-cell {
    background: #bbdefb; /* Açık mavi (1-2 seviye) */
}

.blue-player .board-row[data-row="3"] .triangle-cell,
.blue-player .board-row[data-row="4"] .triangle-cell {
    background: #1e88e5; /* Koyu mavi (3-4 seviye) */
}

.blue-player .board-row[data-row="5"] .triangle-cell,
.blue-player .board-row[data-row="6"] .triangle-cell {
    background: #bbdefb; /* Açık mavi (5-6 seviye) */
}

.blue-player .board-row[data-row="7"] .triangle-cell,
.blue-player .board-row[data-row="8"] .triangle-cell {
    background: #1e88e5; /* Koyu mavi (7-8 seviye) */
}

/* Seviye bazlı renkler - YEŞİL OYUNCU */
.green-player .board-row[data-row="1"] .triangle-cell,
.green-player .board-row[data-row="2"] .triangle-cell {
    background: #c8e6c9; /* Açık yeşil (1-2 seviye) */
}

.green-player .board-row[data-row="3"] .triangle-cell,
.green-player .board-row[data-row="4"] .triangle-cell {
    background: #43a047; /* Koyu yeşil (3-4 seviye) */
}

.green-player .board-row[data-row="5"] .triangle-cell,
.green-player .board-row[data-row="6"] .triangle-cell {
    background: #c8e6c9; /* Açık yeşil (5-6 seviye) */
}

.green-player .board-row[data-row="7"] .triangle-cell,
.green-player .board-row[data-row="8"] .triangle-cell {
    background: #43a047; /* Koyu yeşil (7-8 seviye) */
}

.triangle-cell:hover {
    background: #000000;
    color: white;
    transform: scale(1.08);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.triangle-cell.filled {
    cursor: default;
    font-weight: bold;
    color: #000000 !important; /* Siyah sayı */
}

.triangle-cell.filled:hover {
    transform: scale(1);
}

.triangle-cell.empty-cell {
    background: rgba(200, 200, 200, 0.5);
    color: #999;
    cursor: default;
    font-style: italic;
    border: 1px dashed rgba(150, 150, 150, 0.5);
}

.triangle-cell.empty-cell:hover {
    transform: scale(1);
    background: rgba(200, 200, 200, 0.5);
}

.triangle-cell.highlight {
    border-color: #f39c12;
    animation: pulse 0.5s ease-in-out;
}

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

/* Oyuncu Pozisyonları */
.player-top {
    display: flex;
    flex-direction: column-reverse; /* Info üstte, tahta altta */
    align-items: center;
    flex-shrink: 0;
    width: 100%;
    margin-bottom: -2px; /* Ana tahtaya yapış */
}

.player-bottom {
    display: flex;
    flex-direction: column; /* Tahta üstte, info altta */
    align-items: center;
    flex-shrink: 0;
    width: 100%;
    margin-top: -2px; /* Ana tahtaya yapış */
}

.player-left, .player-right {
    display: flex;
    justify-content: center;
    flex-shrink: 0;
}

.player-left {
    flex-direction: row-reverse; /* Info solda, tahta sağda */
    align-items: center;
    margin-right: -2px; /* Ana tahtaya yapış */
}

.player-right {
    flex-direction: row; /* Tahta solda, info sağda */
    align-items: center;
    margin-left: -2px; /* Ana tahtaya yapış */
}

/* Kontrol Paneli */
#control-panel {
    margin-top: 1px;
    display: flex;
    justify-content: center;
    gap: 3px;
    flex-shrink: 0;
}

.btn {
    padding: 2px 6px;
    font-size: 9px;
    font-weight: bold;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

#pause-btn {
    background: #f39c12;
    color: white;
}

#pause-btn:hover {
    background: #e67e22;
    transform: translateY(-2px);
}

#pause-btn.paused {
    background: #27ae60;
}

#pause-btn.paused:hover {
    background: #229954;
}

#pass-btn {
    background: #e74c3c;
    color: white;
}

#pass-btn:hover {
    background: #c0392b;
    transform: translateY(-2px);
}

#pass-btn:disabled {
    background: #95a5a6;
    cursor: not-allowed;
    transform: none;
}

#restart-btn {
    background: #3498db;
    color: white;
}

#restart-btn:hover {
    background: #2980b9;
    transform: translateY(-2px);
}

#show-scores-btn {
    background: #2ecc71;
    color: white;
}

#show-scores-btn:hover {
    background: #27ae60;
    transform: translateY(-2px);
}

.btn-settings {
    background: #95a5a6;
    color: white;
    font-size: 16px;
    padding: 4px 10px;
}

.btn-settings:hover {
    background: #7f8c8d;
    transform: translateY(-2px);
}

.btn-stats {
    background: #3498db;
    color: white;
    font-size: 16px;
    padding: 4px 10px;
}

.btn-stats:hover {
    background: #2980b9;
    transform: translateY(-2px);
}

/* Modal */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 10px;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}

/* Oyuncu İsimleri Modal */
#player-names-modal .modal-content {
    max-width: 600px;
}

.player-name-inputs {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 25px;
}

.player-input-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px solid transparent;
    transition: all 0.3s;
}

.player-input-row:has(input[type="radio"]:checked) {
    background: #e3f2fd;
    border: 2px solid #2196f3;
}

.player-input-row input[type="radio"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.player-color {
    padding: 6px 12px;
    border-radius: 5px;
    font-weight: bold;
    min-width: 70px;
    text-align: center;
    font-size: 12px;
}

.yellow-bg {
    background: linear-gradient(135deg, #f9d423 0%, #e65c00 100%);
    color: white;
}

.red-bg {
    background: linear-gradient(135deg, #eb3349 0%, #f45c43 100%);
    color: white;
}

.blue-bg {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
}

.green-bg {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    color: white;
}

.player-name-input {
    flex: 1;
    padding: 10px 15px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    font-weight: bold;
    transition: border 0.3s;
}

.player-name-input:focus {
    outline: none;
    border-color: #2196f3;
}

.you-label {
    color: #4caf50;
    font-weight: bold;
    font-size: 12px;
    opacity: 0;
    transition: opacity 0.3s;
}

.player-input-row:has(input[type="radio"]:checked) .you-label {
    opacity: 1;
}

.btn-large {
    width: 100%;
    padding: 15px;
    font-size: 18px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: bold;
}

/* Zorluk Seçici */
.difficulty-selector {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.difficulty-option {
    cursor: pointer;
}

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

.difficulty-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px 10px;
    border: 2px solid #ddd;
    border-radius: 10px;
    background: white;
    transition: all 0.3s;
    text-align: center;
}

.difficulty-label:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.difficulty-option input[type="radio"]:checked + .difficulty-label {
    border-color: #667eea;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.difficulty-icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.difficulty-name {
    font-weight: bold;
    font-size: 16px;
    margin-bottom: 5px;
}

.difficulty-desc {
    font-size: 11px;
    opacity: 0.8;
}

.difficulty-option input[type="radio"]:checked + .difficulty-label.easy {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

.difficulty-option input[type="radio"]:checked + .difficulty-label.easy-medium {
    background: linear-gradient(135deg, #90f7a3 0%, #7be495 100%);
}

.difficulty-option input[type="radio"]:checked + .difficulty-label.medium {
    background: linear-gradient(135deg, #f9d423 0%, #e65c00 100%);
}

.difficulty-option input[type="radio"]:checked + .difficulty-label.medium-hard {
    background: linear-gradient(135deg, #ff9a56 0%, #ff6a4f 100%);
}

.difficulty-option input[type="radio"]:checked + .difficulty-label.hard {
    background: linear-gradient(135deg, #eb3349 0%, #f45c43 100%);
}

.close {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #aaa;
}

.close:hover {
    color: #000;
}

#score-details {
    margin: 20px 0;
}

.player-score {
    margin: 20px 0;
    padding: 15px;
    border-radius: 8px;
    background: #f8f9fa;
}

.player-score h3 {
    margin-bottom: 10px;
    font-size: 1.3em;
}

.score-breakdown {
    margin-left: 20px;
    line-height: 1.8;
}

.winner {
    background: linear-gradient(135deg, #f9d423 0%, #e65c00 100%);
    color: white;
    font-weight: bold;
    padding: 20px;
    text-align: center;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 1.5em;
}

/* Sıra Göstergesi - ÇOOK BELİRGİN */
.active-turn {
    border: 5px solid #FFD700 !important;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.9),
                0 0 18px rgba(255, 215, 0, 0.5),
                inset 0 0 14px rgba(255, 215, 0, 0.3) !important;
    animation: activePulse 1s ease-in-out infinite;
    /* v1.5: büyütme (scale) kaldırıldı; parlaklık satır puanlarını kapatmıyor */
    position: relative;
    z-index: 5;
}

/* Devre Dışı Oyuncu */
.player-board.inactive-player {
    opacity: 0.5;
    filter: grayscale(70%);
    border: 3px dashed rgba(255, 0, 0, 0.5) !important;
}

.player-area.inactive-player .player-info {
    background: rgba(255, 0, 0, 0.2);
    border: 2px solid rgba(255, 0, 0, 0.5);
}

.player-area.inactive-player .player-label::after {
    content: " (DEVRE DIŞI)";
    color: red;
    font-weight: bold;
    font-size: 8px;
}

.active-turn::before {
    content: "⭐ SİRADA ⭐";
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    background: #FFD700;
    color: #000;
    padding: 3px 10px;
    border-radius: 15px;
    font-weight: bold;
    font-size: 9px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    animation: bounceText 0.5s ease-in-out infinite alternate;
    z-index: 101;
    white-space: nowrap;
}

@keyframes activePulse {
    0%, 100% {
        box-shadow: 0 0 8px rgba(255, 215, 0, 0.9),
                    0 0 14px rgba(255, 215, 0, 0.5),
                    inset 0 0 12px rgba(255, 215, 0, 0.3);
    }
    50% {
        box-shadow: 0 0 12px rgba(255, 215, 0, 1),
                    0 0 20px rgba(255, 215, 0, 0.7),
                    inset 0 0 18px rgba(255, 215, 0, 0.5);
    }
}

@keyframes bounceText {
    from { transform: translateX(-50%) translateY(0); }
    to { transform: translateX(-50%) translateY(-5px); }
}

/* Responsive - Basitleştirilmiş */
@media (max-width: 1100px) {
    #main-board {
        grid-template-columns: repeat(12, 16px);
        grid-template-rows: repeat(12, 16px);
    }

    .board-cell {
        font-size: 6px;
    }

    .triangle-cell {
        width: 13px;
        height: 13px;
        font-size: 6px;
    }
}

@media (max-width: 900px) {
    #main-board {
        grid-template-columns: repeat(12, 14px);
        grid-template-rows: repeat(12, 14px);
    }

    .board-cell {
        font-size: 6px;
    }

    .triangle-cell {
        width: 12px;
        height: 12px;
        font-size: 5px;
    }
}

@media (max-width: 700px) {
    #main-board {
        grid-template-columns: repeat(12, 13px);
        grid-template-rows: repeat(12, 13px);
    }

    .board-cell {
        font-size: 5px;
    }

    .triangle-cell {
        width: 10px;
        height: 10px;
        font-size: 5px;
    }
}

/* ==================== İNAKTİF OYUNCU BİLDİRİMİ ==================== */

.inactive-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.3s ease-out;
}

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

.inactive-modal-content {
    background: white;
    padding: 40px;
    border-radius: 15px;
    text-align: center;
    max-width: 500px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    animation: scaleIn 0.3s ease-out;
}

@keyframes scaleIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.inactive-icon {
    font-size: 72px;
    margin-bottom: 20px;
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-10deg); }
    75% { transform: rotate(10deg); }
}

.inactive-modal-content h2 {
    color: #e74c3c;
    font-size: 28px;
    margin-bottom: 15px;
}

.inactive-modal-content p {
    font-size: 16px;
    color: #666;
    margin-bottom: 10px;
    line-height: 1.6;
}

.inactive-modal-content p strong {
    color: #333;
    font-weight: bold;
}

.inactive-timer {
    margin: 25px 0;
    display: flex;
    justify-content: center;
}

.timer-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.5);
    animation: pulse 1s ease-in-out infinite;
}

.timer-circle span {
    color: white;
    font-size: 36px;
    font-weight: bold;
}

/* ==================== BAŞARIM SİSTEMİ ==================== */

.achievement-notification {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 20px;
    border-radius: 10px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    gap: 15px;
    min-width: 300px;
    animation: slideIn 0.5s ease-out;
}

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

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

.achievement-icon {
    font-size: 48px;
    line-height: 1;
}

.achievement-content {
    flex: 1;
}

.achievement-title {
    font-size: 12px;
    text-transform: uppercase;
    opacity: 0.9;
    margin-bottom: 5px;
}

.achievement-name {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 5px;
}

.achievement-desc {
    font-size: 13px;
    opacity: 0.85;
}

/* ==================== SEVİYE SİSTEMİ ==================== */

.level-up-notification {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10000;
    background: linear-gradient(135deg, #f9d423 0%, #e65c00 100%);
    color: white;
    padding: 40px 60px;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    animation: levelUpBounce 0.6s ease-out;
}

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

@keyframes fadeOut {
    to {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
}

.level-up-content {
    display: flex;
    align-items: center;
    gap: 20px;
}

.level-up-icon {
    font-size: 64px;
}

.level-up-title {
    font-size: 24px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 10px;
}

.level-up-level {
    font-size: 36px;
    font-weight: bold;
    margin-bottom: 5px;
}

.level-up-xp {
    font-size: 18px;
    opacity: 0.9;
}

/* ==================== İLERLEME BAR ==================== */

.player-progress {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 10px;
    margin: 20px 0;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    font-weight: bold;
    font-size: 18px;
    margin-bottom: 10px;
}

.xp-bar {
    background: rgba(255, 255, 255, 0.3);
    height: 30px;
    border-radius: 15px;
    overflow: hidden;
    margin-bottom: 5px;
    position: relative;
}

.xp-fill {
    background: linear-gradient(90deg, #f9d423 0%, #e65c00 100%);
    height: 100%;
    border-radius: 15px;
    transition: width 1s ease-out;
    box-shadow: 0 0 10px rgba(249, 212, 35, 0.8);
}

.xp-text {
    text-align: center;
    font-size: 14px;
    opacity: 0.9;
}

/* ==================== BAŞARIMLAR ÖZET ==================== */

.achievements-summary {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin: 20px 0;
}

.achievements-summary h4 {
    margin-bottom: 15px;
    color: #333;
}

.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
}

.achievement-item {
    background: white;
    padding: 15px 10px;
    border-radius: 8px;
    text-align: center;
    transition: all 0.3s;
    border: 2px solid transparent;
}

.achievement-item.unlocked {
    border-color: #4caf50;
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
}

.achievement-item.locked {
    opacity: 0.5;
    filter: grayscale(100%);
}

.achievement-icon-display {
    font-size: 32px;
    margin-bottom: 8px;
}

.achievement-name-display {
    font-size: 11px;
    font-weight: bold;
    color: #333;
}

/* ==================== LİDERLİK TABLOSU ==================== */

.leaderboard-summary {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin: 20px 0;
}

.leaderboard-summary h4 {
    margin-bottom: 15px;
    color: #333;
}

.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
}

.leaderboard-table th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px;
    text-align: left;
    font-weight: bold;
}

.leaderboard-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #eee;
    color: #333;
}

.leaderboard-table tbody tr:hover {
    background: #f0f0f0;
}

.leaderboard-table .highlight-row {
    background: #fff3cd !important;
    font-weight: bold;
}

.leaderboard-table tbody tr:last-child td {
    border-bottom: none;
}

/* ==================== AYARLAR MODALI ==================== */

.settings-section {
    margin: 25px 0;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.settings-section:last-child {
    border-bottom: none;
}

.settings-section h3 {
    color: #333;
    font-size: 16px;
    margin-bottom: 15px;
}

/* Dil Seçici Grid */
.language-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
}

.language-option {
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: white;
}

.language-option:hover {
    border-color: #667eea;
    background: #f0f0ff;
    transform: translateY(-2px);
}

.language-option.active {
    border-color: #667eea;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.language-flag {
    font-size: 32px;
    margin-bottom: 5px;
    pointer-events: none;
}

.language-name {
    font-size: 12px;
    font-weight: bold;
    pointer-events: none;
}

/* Switch Toggle */
.switch-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
}

.switch-container input[type="checkbox"] {
    display: none;
}

.switch-slider {
    position: relative;
    width: 50px;
    height: 26px;
    background: #ccc;
    border-radius: 34px;
    cursor: pointer;
    transition: 0.3s;
}

.switch-slider::before {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: 0.3s;
}

.switch-container input:checked + .switch-slider {
    background: #4caf50;
}

.switch-container input:checked + .switch-slider::before {
    transform: translateX(24px);
}

/* Select Dropdown */
.setting-select {
    width: 100%;
    padding: 10px 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    background: white;
    cursor: pointer;
    transition: border 0.3s;
}

.setting-select:focus {
    outline: none;
    border-color: #667eea;
}

/* Danger Zone */
.danger-zone {
    background: #fff5f5;
    padding: 20px;
    border-radius: 8px;
    border: 2px solid #ffebee !important;
}

.btn-danger {
    background: #e74c3c;
    color: white;
    width: 100%;
}

.btn-danger:hover {
    background: #c0392b;
}

/* RTL Destek */
body.rtl {
    direction: rtl;
}

body.rtl .player-left {
    order: 3;
}

body.rtl .player-right {
    order: 1;
}

body.rtl .language-option {
    text-align: center;
}

/* ==================== İSTATİSTİKLER SAYFASI ==================== */

.modal-large .modal-content {
    max-width: 900px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin: 25px 0;
}

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    transition: transform 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-icon {
    font-size: 36px;
    margin-bottom: 10px;
}

.stat-value {
    font-size: 32px;
    font-weight: bold;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 12px;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stats-charts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.chart-container {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
}

.chart-container h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 16px;
}

.chart-container canvas {
    max-height: 250px;
}

/* Karanlık tema için istatistikler */
body.theme-dark .stat-card {
    background: linear-gradient(135deg, #e94560 0%, #0f3460 100%);
}

body.theme-dark .chart-container {
    background: #16213e;
}

body.theme-dark .chart-container h3 {
    color: #e0e0e0;
}

/* ============================================
   Tutorial / Rehber Sistemi
   ============================================ */

.tutorial-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    z-index: 9998;
    animation: fadeIn 0.3s ease-out;
}

.tutorial-tooltip {
    position: fixed;
    background: white;
    border-radius: 16px;
    padding: 0;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    z-index: 9999;
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.tutorial-tooltip.active {
    opacity: 1;
    transform: scale(1);
}

.tutorial-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 16px 16px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tutorial-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.tutorial-skip {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    line-height: 1;
}

.tutorial-skip:hover {
    background: rgba(255, 255, 255, 0.3);
}

.tutorial-tooltip p {
    color: #444;
    padding: 20px;
    margin: 0;
    font-size: 15px;
    line-height: 1.6;
}

.tutorial-footer {
    padding: 15px 20px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #eee;
}

.tutorial-step {
    color: #888;
    font-size: 13px;
    font-weight: 600;
}

.tutorial-buttons {
    display: flex;
    gap: 10px;
}

.tutorial-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.tutorial-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.tutorial-btn.tutorial-prev {
    background: linear-gradient(135deg, #95a5a6 0%, #7f8c8d 100%);
}

.tutorial-btn.tutorial-prev:hover {
    box-shadow: 0 4px 12px rgba(127, 140, 141, 0.4);
}

.tutorial-highlight {
    position: relative;
    z-index: 9999 !important;
    box-shadow: 0 0 0 4px #f39c12, 0 0 30px rgba(243, 156, 18, 0.8) !important;
    border-radius: 8px;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 4px #f39c12, 0 0 30px rgba(243, 156, 18, 0.8);
    }
    50% {
        box-shadow: 0 0 0 4px #f39c12, 0 0 40px rgba(243, 156, 18, 1);
    }
}

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

/* Karanlık tema için tutorial */
body.theme-dark .tutorial-tooltip {
    background: #16213e;
}

body.theme-dark .tutorial-tooltip p {
    color: #e0e0e0;
}

body.theme-dark .tutorial-footer {
    border-top-color: #1a1a2e;
}

body.theme-dark .tutorial-step {
    color: #999;
}

/* Tutorial butonu */
.btn-tutorial {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    font-size: 18px;
}

.btn-tutorial:hover {
    box-shadow: 0 4px 15px rgba(243, 156, 18, 0.4);
}


/* ==================== v1.7: Okunaklı oyuncu bilgileri ==================== */
.player-info {
    width: auto !important;
    justify-content: center;
    align-items: center;
    gap: 10px;
    padding: 3px 12px;
    border-radius: 14px;
    font-size: 13px;
    background: rgba(255, 255, 255, 0.95);
    color: #1d1f33;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
    white-space: nowrap;
}
.player-label { font-size: 14px; font-weight: 800; }
.pass-count { font-size: 12px; color: #555; font-weight: 600; }
/* Yan oyuncular: dikey yazı yerine tahtanın üstünde yatay */
.player-area.player-left, .player-area.player-right { flex-direction: column; }
.player-area.player-left .player-info, .player-area.player-right .player-info {
    writing-mode: horizontal-tb;
    order: -1;
    margin: 0 0 6px 0;
}
.player-area.player-top .player-info { margin: 0 0 6px 0; }
.player-area.player-bottom .player-info { margin: 6px 0 0 0; }
body.theme-dark .player-info { background: #24273a; color: #f0f0f5; }
body.theme-dark .pass-count { color: #b8bbd0; }
@media (max-width: 900px) {
    .player-info { font-size: 11px; gap: 6px; padding: 2px 8px; }
    .player-label { font-size: 12px; }
    .pass-count { font-size: 10px; }
}
