/* game.css
 * Zeka ve Hafıza Oyunları Özel Stylesheet'i - sondakikahaberleri.net
 */

/* ==========================================
   GENEL OYUN ALANI DÜZENLERİ
   ========================================== */
.game-main-container {
    width: 100%;
    margin: 0 auto;
}

.game-setup-card {
    margin-bottom: 20px;
    border-radius: var(--radius-md);
    padding: 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--color-card-border);
    box-shadow: var(--shadow-sm);
}

.grid-selectors-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.grid-size-btn {
    flex: 1 1 calc(33.33% - 10px);
    min-width: 100px;
    max-width: 200px;
    background: var(--bg-primary);
    border: 1px solid var(--color-card-border);
    color: var(--text-primary);
    padding: 10px 8px;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-weight: 700;
    font-size: 0.95rem;
    transition: var(--transition-all);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
}

.grid-size-btn:hover {
    border-color: var(--color-primary);
    background: var(--color-input-bg);
}

.grid-size-btn.active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: white !important;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.2);
}

.size-desc {
    font-size: 0.7rem;
    font-weight: 500;
    opacity: 0.8;
}

.grid-size-btn.active .size-desc {
    opacity: 0.95;
}

.game-play-card {
    border-radius: var(--radius-md);
    padding: 24px;
    background: var(--bg-secondary);
    border: 1px solid var(--color-card-border);
    box-shadow: var(--shadow-sm);
}

.game-stats-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.stat-item-box {
    background: var(--bg-primary);
    border: 1px solid var(--color-card-border);
    border-radius: var(--radius-md);
    padding: 12px 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.stat-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}

.stat-value {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.1;
}

.stat-value.timer-val {
    color: var(--color-primary);
    font-family: monospace;
}

.stat-value.success-val {
    color: var(--color-success);
}

.stat-value.accent-val {
    color: var(--color-accent);
}

.game-board-outer-wrapper {
    background: var(--bg-primary);
    border: 1px solid var(--color-card-border);
    border-radius: var(--radius-lg);
    padding: 16px;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    overflow: hidden;
    margin-bottom: 20px;
}

/* ==========================================
   1. KART EŞLEŞTİRME OYUNU STYLES
   ========================================== */
#gameBoard {
    display: grid;
    grid-template-columns: repeat(var(--grid-cols, 4), 1fr);
    gap: var(--grid-gap, 8px);
    width: 100%;
    aspect-ratio: 1 / 1;
    perspective: 1200px;
    margin: 0 auto;
    transition: max-width 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

#gameBoard.board-size-4 { max-width: 400px; }
#gameBoard.board-size-6 { max-width: 540px; }
#gameBoard.board-size-8 { max-width: 680px; }

@media (max-height: 900px) and (min-width: 577px) {
    #gameBoard {
        max-height: 70vh;
        width: auto;
    }
}

.game-card {
    position: relative;
    aspect-ratio: 1 / 1;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    will-change: transform;
    container-type: inline-size;
}

.card-inner {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.22s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
}

.game-card.flipped .card-inner {
    transform: rotateY(180deg);
}

.card-front, .card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-card-border);
    transition: background-color 0.2s, border-color 0.2s;
    box-shadow: var(--shadow-sm);
}

.card-back {
    background-color: var(--color-primary);
    border-color: var(--color-primary-hover);
}

.game-card:hover .card-back {
    background-color: var(--color-primary-hover);
    border-color: var(--color-primary);
}

.card-front {
    background-color: #ffffff;
    border-color: #cbd5e1;
    transform: rotateY(180deg);
}

body.dark-theme .card-front {
    background-color: #0f172a;
    border-color: #334155;
}

.card-front span {
    font-size: 62cqw;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.game-card.matched {
    opacity: 0.32;
    cursor: default;
    pointer-events: none;
    transition: opacity 0.3s ease-out;
}

.game-card.matched .card-inner {
    transform: rotateY(180deg);
}

.game-card.matched .card-front {
    border-color: var(--color-card-border);
}

.game-controls-row {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

.game-restart-btn {
    padding: 12px 30px;
    border-radius: var(--radius-md);
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-all);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: none;
    font-size: 0.95rem;
    background: var(--color-primary);
    color: white !important;
    box-shadow: 0 4px 6px rgba(37, 99, 235, 0.12);
}

.game-restart-btn:hover {
    background: var(--color-primary-hover);
    box-shadow: 0 6px 12px rgba(37, 99, 235, 0.22);
    transform: translateY(-1px);
}

/* ==========================================
   2. KLASİK SUDOKU OYUNU STYLES
   ========================================== */
#sudokuBoard {
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    grid-template-rows: repeat(9, 1fr);
    width: 100%;
    aspect-ratio: 1 / 1;
    border: 2.5px solid var(--text-primary);
    background-color: var(--bg-secondary);
    box-sizing: border-box;
}

.sudoku-cell {
    border: 0.5px solid var(--color-card-border);
    position: relative;
    aspect-ratio: 1 / 1;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    container-type: inline-size;
    background-color: var(--bg-secondary);
    transition: background-color 0.15s;
}

.sudoku-cell[data-col="2"], .sudoku-cell[data-col="5"] {
    border-right: 2px solid var(--text-primary);
}
.sudoku-cell[data-row="2"], .sudoku-cell[data-row="5"] {
    border-bottom: 2px solid var(--text-primary);
}

.cell-value {
    font-weight: 500;
    font-family: var(--font-heading);
    font-size: 60cqw;
    line-height: 1;
    transition: color 0.1s;
}

.sudoku-cell.clue {
    background-color: var(--bg-primary);
    cursor: default;
}
.sudoku-cell.clue .cell-value {
    color: var(--text-primary);
    font-weight: 800;
}

.sudoku-cell.user-filled .cell-value {
    color: var(--color-primary);
}

.sudoku-cell.error {
    background-color: rgba(239, 68, 68, 0.12) !important;
}
.sudoku-cell.error .cell-value {
    color: var(--color-error) !important;
}

.sudoku-cell.selected {
    background-color: rgba(37, 99, 235, 0.22) !important;
}

.sudoku-cell.highlighted {
    background-color: rgba(37, 99, 235, 0.05);
}

.sudoku-cell.same-number {
    background-color: rgba(37, 99, 235, 0.14) !important;
}

.notes-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0; left: 0;
    box-sizing: border-box;
    padding: 1.5px;
    pointer-events: none;
}

.note-item {
    font-family: var(--font-body);
    font-size: 26cqw;
    font-weight: 500;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.sudoku-actions-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 15px;
}

.sudoku-action-btn {
    flex: 1;
    background: var(--bg-primary);
    border: 1px solid var(--color-card-border);
    color: var(--text-secondary);
    padding: 10px 4px;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    transition: var(--transition-all);
}

.sudoku-action-btn i {
    font-size: 1.1rem;
    color: var(--text-primary);
}

.sudoku-action-btn:hover {
    border-color: var(--color-primary);
    background: var(--color-input-bg);
}

.sudoku-action-btn.active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: white !important;
}

.sudoku-action-btn.active i {
    color: white !important;
}

.sudoku-keypad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    width: 100%;
    max-width: 240px;
    margin: 0 auto;
}

.keypad-btn {
    aspect-ratio: 1 / 1;
    background: var(--bg-primary);
    border: 1px solid var(--color-card-border);
    color: var(--text-primary);
    font-size: 1.35rem;
    font-weight: 800;
    font-family: var(--font-heading);
    border-radius: var(--radius-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-all);
}

.keypad-btn:hover {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: white;
    transform: translateY(-1px);
}

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

/* ==========================================
   3. ORTAK MODALLER (GALİBİYET / OYUN BİTTİ)
   ========================================== */
.victory-modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.victory-modal-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.victory-modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--color-card-border);
    border-radius: var(--radius-lg);
    padding: 35px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: var(--shadow-lg);
}

.victory-modal-overlay.open .victory-modal-content {
    transform: scale(1);
}

.victory-badge {
    font-size: 4rem;
    margin-bottom: 12px;
}

.victory-modal-content h2 {
    font-size: 1.75rem;
    color: var(--text-primary);
    margin: 0 0 8px 0;
}

.victory-modal-content p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin: 0 0 20px 0;
}

.victory-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 20px;
    background: var(--bg-primary);
    padding: 12px;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-card-border);
}

.v-stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.v-label {
    font-size: 0.65rem;
    color: var(--text-secondary);
    font-weight: 700;
    letter-spacing: 0.05em;
    margin-bottom: 2px;
}

.v-val {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text-primary);
}

.victory-record-banner {
    background: linear-gradient(135deg, #f97316, #ea580c);
    color: white;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-weight: 800;
    font-size: 0.8rem;
    margin-bottom: 20px;
}

.v-play-again-btn {
    width: 100%;
    background: var(--color-primary);
    color: white !important;
    border: none;
    padding: 12px 20px;
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition-all);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.v-play-again-btn:hover {
    background: var(--color-primary-hover);
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.2);
}

/* ==========================================
   4. MOBİL RESPONSIVE TASARIM AYARLARI
   ========================================== */
@media (max-width: 576px) {
    .container-primary {
        padding: 8px !important;
    }

    /* Eşleştirme Oyunu Mobil */
    .grid-size-btn {
        flex: 1 1 calc(33.33% - 8px);
        font-size: 0.85rem;
        padding: 8px 6px;
    }

    .game-stats-container {
        gap: 8px;
        margin-bottom: 15px;
        grid-template-columns: repeat(4, 1fr) !important;
    }

    .stat-item-box {
        padding: 8px 4px;
    }

    .stat-label {
        font-size: 0.6rem;
    }

    .stat-value {
        font-size: 1.05rem;
    }

    .game-board-outer-wrapper {
        padding: 0px !important;
        background: transparent !important;
        border: none !important;
        margin-bottom: 15px;
    }

    #gameBoard {
        gap: 5px !important;
    }
    #gameBoard.board-size-6 {
        gap: 3px !important;
    }
    #gameBoard.board-size-8 {
        gap: 2px !important;
    }

    .game-play-card {
        padding: 8px !important;
    }

    .game-restart-btn {
        padding: 10px 20px;
        font-size: 0.85rem;
    }

    /* Sudoku Oyunu Mobil */
    .game-setup-card {
        padding: 10px;
        margin-bottom: 12px;
    }

    .grid-size-btn {
        padding: 8px;
        font-size: 0.85rem;
    }

    .sudoku-difficulty-val {
        font-size: 0.95rem;
    }

    .sudoku-actions-row {
        gap: 6px;
        margin-bottom: 12px;
    }

    .sudoku-action-btn {
        padding: 8px 2px;
        font-size: 0.65rem;
    }

    .sudoku-action-btn i {
        font-size: 0.95rem;
    }

    .sudoku-keypad {
        grid-template-columns: repeat(9, 1fr) !important;
        max-width: 100% !important;
        gap: 4px !important;
    }

    .keypad-btn {
        font-size: 1.15rem;
    }
}

/* ==========================================
   5. SUDOKU VE GENEL OYUN EK STRA YAPILANDIRMALARI
   ========================================== */
.game-board-outer-wrapper.sudoku-board-wrapper {
    padding: 10px;
}

.sudoku-difficulty-val {
    color: var(--color-primary);
    font-size: 1.15rem;
    text-transform: uppercase;
}

.game-restart-btn.secondary {
    background: var(--color-card-border);
    color: var(--text-primary) !important;
    box-shadow: none;
    border: 1px solid var(--color-card-border);
}

.game-restart-btn.secondary:hover {
    background: var(--bg-primary);
    border-color: var(--text-secondary);
}

/* ==========================================
   6. ZEKA OYUNLARI LİSTE SAYFASI (PORTAL)
   ========================================== */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
    margin-top: 10px;
}

.game-card-item {
    background: var(--bg-secondary);
    border: 1px solid var(--color-card-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-all);
    display: flex;
    flex-direction: column;
}

.game-card-item:hover:not(.disabled) {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    border-color: var(--color-primary) !important;
}

.game-card-img-wrapper {
    height: 180px;
    background: linear-gradient(135deg, #6366f1, #3b82f6);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.game-card-item.disabled .game-card-img-wrapper {
    background: linear-gradient(135deg, #475569, #1e293b);
}

.game-card-img-wrapper::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0) 40%, rgba(0,0,0,0.3));
    z-index: 1;
}

.game-emoji {
    font-size: 4.5rem;
    z-index: 2;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.25));
    transition: var(--transition-all);
}

.game-card-item:hover:not(.disabled) .game-emoji {
    transform: scale(1.1) rotate(5deg);
}

.game-card-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--color-success);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    z-index: 3;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    text-transform: uppercase;
}

.game-card-badge.delay {
    background: #e2e8f0;
    color: #475569;
}

body.dark-theme .game-card-badge.delay {
    background: #334155;
    color: #cbd5e1;
}

.game-card-body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.game-card-body h3 {
    margin: 0 0 10px 0;
    font-size: 1.35rem;
    color: var(--text-primary);
    font-weight: 700;
}

.game-card-body p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.5;
    margin: 0 0 20px 0;
    flex-grow: 1;
}

.play-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--color-primary);
    color: white !important;
    padding: 12px 20px;
    border-radius: var(--radius-md);
    font-weight: 700;
    text-align: center;
    transition: var(--transition-all);
    gap: 8px;
    box-shadow: 0 4px 6px rgba(37, 99, 235, 0.15);
}

.play-btn:hover {
    background: var(--color-primary-hover);
    box-shadow: 0 6px 12px rgba(37, 99, 235, 0.25);
    transform: translateY(-1px);
}

.play-btn-disabled {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--color-card-border);
    color: var(--text-muted) !important;
    padding: 12px 20px;
    border-radius: var(--radius-md);
    font-weight: 700;
    text-align: center;
    width: 100%;
    border: 1px solid var(--color-card-border);
    cursor: not-allowed;
    gap: 8px;
}

/* ==========================================
   7. MODAL HATA DURUMU GÖRSELLERİ
   ========================================== */
.victory-modal-content.error-modal {
    border-color: var(--color-error);
}

.victory-badge.error-badge {
    color: var(--color-error);
}

.v-play-again-btn.error-btn {
    background-color: var(--color-error);
}

.v-play-again-btn.error-btn:hover {
    background-color: #dc2626; /* Kırmızı hover */
}

/* ==========================================
   8. SUDOKU DESKTOP LAYOUT GRID
   ========================================== */
.sudoku-layout-grid {
    display: grid;
    grid-template-columns: minmax(320px, 480px) 1fr;
    gap: 32px;
    align-items: center;
    max-width: 900px;
    margin: 0 auto;
}

.sudoku-board-column {
    width: 100%;
}

.sudoku-controls-column {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
}



@media (max-width: 768px) {
    .sudoku-layout-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .sudoku-controls-column {
        gap: 16px;
    }

    .sudoku-keypad {
        grid-template-columns: repeat(9, 1fr) !important;
        max-width: 100% !important;
        gap: 6px !important;
    }

    .keypad-btn {
        font-size: 1.15rem;
    }
}

/* ==========================================
   9. MODAL SCROLL LOCK & OVERLAY FIXES
   ========================================== */
body.modal-open {
    overflow: hidden !important;
    height: 100vh !important;
}

.victory-modal-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
}

/* ==========================================
   10. SUDOKU TOP BAR & DIFFICULTY SELECTOR
   ========================================== */
.sudoku-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--color-card-border);
}

.sudoku-difficulty-selector {
    flex: 1.2;
    max-width: 480px;
}

.sudoku-difficulty-selector .grid-selectors-row {
    justify-content: space-between;
    width: 100%;
}

.sudoku-difficulty-selector .grid-size-btn {
    flex: 1 1 calc(25% - 8px);
    min-width: 75px;
    max-width: 120px;
    padding: 12px 6px;
}

.sudoku-top-bar .game-stats-container {
    flex: 0.8;
    margin-bottom: 0;
    max-width: 320px;
}

.game-stats-container.stats-count-3 {
    grid-template-columns: repeat(3, 1fr) !important;
}

@media (max-width: 768px) {
    .sudoku-top-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    .sudoku-difficulty-selector,
    .sudoku-top-bar .game-stats-container {
        max-width: 100%;
    }
    .sudoku-difficulty-selector .grid-size-btn {
        flex: 1 1 calc(50% - 6px) !important;
        max-width: none;
    }
}

/* ==========================================
   11. KELİME OYUNU (WORDLE) STYLES
   ========================================== */
.word-settings-bar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--color-card-border);
    flex-wrap: wrap;
}

.word-settings-group {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 180px;
}

.settings-group-title {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.switches-row-wrapper {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 24px;
    min-height: 42px;
}

.setting-switch-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.switch-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
    cursor: pointer;
}

/* iOS Style Switch */
.ios-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.ios-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.switch-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: var(--color-card-border);
    transition: .3s;
    border-radius: 24px;
}

.switch-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.ios-switch input:checked + .switch-slider {
    background-color: var(--color-success);
}

.ios-switch input:focus + .switch-slider {
    box-shadow: 0 0 1px var(--color-success);
}

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

/* Stats Count 4 */
.game-stats-container.stats-count-4 {
    grid-template-columns: repeat(4, 1fr) !important;
}

/* Word Layout Grid */
.word-layout-grid {
    display: grid;
    grid-template-columns: minmax(320px, 420px) 1fr;
    gap: 40px;
    align-items: center;
    max-width: 1040px;
    margin: 0 auto;
}

.word-board-column {
    width: 100%;
}

.word-controls-column {
    display: flex;
    flex-direction: column;
    gap: 24px;
    width: 100%;
}

/* Grid Box Board */
.word-board-wrapper {
    padding: 20px;
}

#wordGrid {
    display: grid;
    grid-template-rows: repeat(6, 1fr);
    gap: 8px;
    width: 100%;
    aspect-ratio: var(--grid-aspect, 5 / 6);
    max-width: 420px;
    margin: 0 auto;
}

#wordGrid.word-length-4 {
    --grid-aspect: 4 / 6;
}

#wordGrid.word-length-5 {
    --grid-aspect: 5 / 6;
}

#wordGrid.word-length-6 {
    --grid-aspect: 6 / 6;
}

.word-row {
    display: grid;
    grid-template-columns: repeat(var(--word-cols, 5), 1fr);
    gap: 8px;
}

.word-cell {
    border: 2px solid var(--color-card-border);
    aspect-ratio: 1 / 1;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    font-weight: 800;
    text-transform: uppercase;
    font-family: var(--font-heading);
    color: var(--text-primary);
    background-color: var(--bg-secondary);
    user-select: none;
    transition: border-color 0.1s ease, background-color 0.15s ease, color 0.15s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.word-cell.active-input {
    border-color: var(--text-primary);
    animation: cellBounce 0.12s ease-out;
}

/* Letter States and Flips */
.word-cell.flip-tile {
    animation: tileFlip 0.5s ease-in-out forwards;
}

.word-cell.correct {
    background-color: var(--color-success) !important;
    border-color: var(--color-success) !important;
    color: white !important;
}

.word-cell.misplaced {
    background-color: var(--color-accent) !important;
    border-color: var(--color-accent) !important;
    color: white !important;
}

.word-cell.absent {
    background-color: #64748b !important;
    border-color: #64748b !important;
    color: white !important;
}

body.dark-theme .word-cell.absent {
    background-color: #334155 !important;
    border-color: #334155 !important;
}

/* Animations */
@keyframes cellBounce {
    0% { transform: scale(1); }
    50% { transform: scale(1.12); }
    100% { transform: scale(1); }
}

@keyframes tileFlip {
    0% { transform: rotateX(0deg); }
    45% { transform: rotateX(90deg); }
    55% { transform: rotateX(90deg); }
    100% { transform: rotateX(0deg); }
}

@keyframes rowShake {
    0%, 100% { transform: translateX(0); }
    15%, 45%, 75% { transform: translateX(-8px); }
    30%, 60%, 90% { transform: translateX(8px); }
}

.word-row.shake {
    animation: rowShake 0.4s ease-in-out;
}

/* Turkish Keyboard */
.turkish-keyboard {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.keyboard-row {
    display: flex;
    justify-content: center;
    gap: 6px;
    width: 100%;
}

.key-btn {
    flex: 1;
    height: 54px;
    background-color: var(--bg-primary);
    border: 1px solid var(--color-card-border);
    color: var(--text-primary);
    font-size: 1.15rem;
    font-weight: 700;
    border-radius: var(--radius-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-all);
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.key-btn:hover {
    background-color: var(--color-input-bg);
    border-color: var(--text-secondary);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
}

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

/* Custom colors for GİRİŞ (ENTER) & SİL (DELETE) keys */
.key-btn[data-key="ENTER"] {
    background-color: #10b981 !important;
    border-color: #10b981 !important;
    color: white !important;
    font-weight: 800;
    box-shadow: 0 4px 8px rgba(16, 185, 129, 0.25) !important;
    letter-spacing: 0.02em;
}

.key-btn[data-key="ENTER"]:hover {
    background-color: #059669 !important;
    border-color: #059669 !important;
    box-shadow: 0 6px 12px rgba(16, 185, 129, 0.4) !important;
    transform: translateY(-1px);
}

.key-btn[data-key="DELETE"] {
    background-color: #ef4444 !important;
    border-color: #ef4444 !important;
    color: white !important;
    font-weight: 800;
    box-shadow: 0 4px 8px rgba(239, 68, 68, 0.25) !important;
    letter-spacing: 0.02em;
}

.key-btn[data-key="DELETE"]:hover {
    background-color: #dc2626 !important;
    border-color: #dc2626 !important;
    box-shadow: 0 6px 12px rgba(239, 68, 68, 0.4) !important;
    transform: translateY(-1px);
}

.key-btn.wide-key {
    flex: 1.6;
    font-size: 0.85rem;
}

/* Keyboard Key Status Coloring */
.key-btn.correct {
    background-color: var(--color-success) !important;
    border-color: var(--color-success) !important;
    color: white !important;
}

.key-btn.misplaced {
    background-color: var(--color-accent) !important;
    border-color: var(--color-accent) !important;
    color: white !important;
}

.key-btn.absent {
    background-color: #64748b !important;
    border-color: #64748b !important;
    color: white !important;
    opacity: 0.5;
}

body.dark-theme .key-btn.absent {
    background-color: #334155 !important;
    border-color: #334155 !important;
}

/* Examples in Help Modal */
.help-example-row {
    display: flex;
    gap: 6px;
    margin: 10px 0;
}

.help-cell {
    width: 36px;
    height: 36px;
    border: 2px solid var(--color-card-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    border-radius: 4px;
    font-size: 1.15rem;
    text-transform: uppercase;
    color: var(--text-primary);
}

.help-cell.correct {
    background-color: var(--color-success);
    border-color: var(--color-success);
    color: white;
}

.help-cell.misplaced {
    background-color: var(--color-accent);
    border-color: var(--color-accent);
    color: white;
}

.help-cell.absent {
    background-color: #64748b;
    border-color: #64748b;
    color: white;
}

body.dark-theme .help-cell.absent {
    background-color: #334155;
    border-color: #334155;
}

.word-victory-stats {
    grid-template-columns: repeat(auto-fit, minmax(60px, 1fr)) !important;
}

/* Mobile Responsiveness for Word Game */
@media (max-width: 768px) {
    .word-settings-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    
    .word-settings-group {
        min-width: 100%;
    }
    
    .switches-row-wrapper {
        justify-content: space-between;
        width: 100%;
        gap: 12px;
    }
    
    .word-layout-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .key-btn {
        height: 48px;
        font-size: 0.95rem;
    }
    
    .key-btn.wide-key {
        font-size: 0.75rem;
        flex: 1.4;
    }

    .word-cell {
        font-size: 1.85rem;
    }
}

@media (max-width: 480px) {
    .keyboard-row {
        gap: 4px;
    }
    
    .key-btn {
        height: 44px;
        font-size: 0.85rem;
    }
    
    .key-btn.wide-key {
        font-size: 0.65rem;
        flex: 1.3;
    }
    
    .switches-row-wrapper {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .setting-switch-item {
        justify-content: space-between;
    }

    .word-cell {
        font-size: 1.5rem;
    }
}

/* ==========================================
   12. HARF ARISI (SPELLING BEE) STYLES
   ========================================== */
.bee-layout-grid {
    display: grid;
    grid-template-columns: minmax(300px, 420px) 1fr;
    gap: 48px;
    align-items: flex-start;
    max-width: 960px;
    margin: 0 auto;
}

.bee-play-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.bee-stats-column {
    display: flex;
    flex-direction: column;
    gap: 24px;
    width: 100%;
}

/* Word Preview Box */
.bee-preview-wrapper {
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    width: 100%;
    max-width: 320px;
    border-bottom: 3px solid var(--color-card-border);
}

#beeWordPreview {
    font-size: 2rem;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--text-primary);
    letter-spacing: 0.08em;
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    font-family: var(--font-heading);
}

.bee-preview-placeholder {
    color: var(--text-muted) !important;
    font-size: 1.15rem !important;
    font-weight: 500 !important;
    letter-spacing: 0px !important;
    font-family: var(--font-body) !important;
}

.bee-preview-cursor {
    display: inline-block;
    width: 3px;
    height: 28px;
    background-color: #f59e0b;
    margin-left: 2px;
    animation: previewBlink 0.8s infinite;
}

@keyframes previewBlink {
    0%, 100% { opacity: 0; }
    50% { opacity: 1; }
}

/* Honeycomb Container */
.hive-container {
    position: relative;
    width: 100%;
    max-width: 300px;
    aspect-ratio: 1 / 1;
    margin: 0 auto 24px auto;
}

/* Honeycomb Cell (Regular pointy-topped Hexagon) */
.hive-cell {
    position: absolute;
    width: 28%;
    height: 28%;
    transform: translate(-50%, -50%);
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    background-color: var(--bg-primary);
    border: 1px solid var(--color-card-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.65rem;
    font-weight: 800;
    color: var(--text-primary);
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.1s cubic-bezier(0.25, 0.46, 0.45, 0.94), background-color 0.15s ease, box-shadow 0.15s ease;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.05);
}

/* Percentage placements for regular honeycomb layout spacing */
.hive-cell.center-cell {
    top: 50%;
    left: 50%;
    background-color: #f59e0b !important;
    color: white !important;
    font-size: 1.85rem;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.35);
}

.hive-cell.center-cell:hover {
    background-color: #d97706 !important;
}

.hive-cell[data-idx="0"] { top: 20%; left: 50%; }
.hive-cell[data-idx="1"] { top: 35%; left: 76%; }
.hive-cell[data-idx="2"] { top: 65%; left: 76%; }
.hive-cell[data-idx="3"] { top: 80%; left: 50%; }
.hive-cell[data-idx="4"] { top: 65%; left: 24%; }
.hive-cell[data-idx="5"] { top: 35%; left: 24%; }

.hive-cell:hover:not(.center-cell) {
    background-color: var(--color-input-bg);
    border-color: var(--text-secondary);
}

.hive-cell:active {
    transform: translate(-50%, -50%) scale(0.92);
}

/* Action Controls button row */
.bee-action-controls {
    display: flex;
    justify-content: center;
    gap: 12px;
    width: 100%;
    max-width: 320px;
}

.bee-ctrl-btn {
    flex: 1;
    padding: 10px 16px;
    border-radius: 24px;
    font-weight: 700;
    border: 1px solid var(--color-card-border);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    cursor: pointer;
    font-size: 0.85rem;
    transition: var(--transition-all);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.bee-ctrl-btn:hover {
    background-color: var(--color-input-bg);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
}

.bee-ctrl-btn.success {
    background-color: #10b981 !important;
    border-color: #10b981 !important;
    color: white !important;
    box-shadow: 0 4px 8px rgba(16, 185, 129, 0.2) !important;
}
.bee-ctrl-btn.success:hover {
    background-color: #059669 !important;
    border-color: #059669 !important;
}

.bee-ctrl-btn.error {
    background-color: #ef4444 !important;
    border-color: #ef4444 !important;
    color: white !important;
    box-shadow: 0 4px 8px rgba(239, 68, 68, 0.2) !important;
}
.bee-ctrl-btn.error:hover {
    background-color: #dc2626 !important;
    border-color: #dc2626 !important;
}

.animate-spin-hover:hover {
    transform: rotate(60deg);
}

/* Ranks Dashboard style */
.bee-ranks-dashboard {
    background: var(--bg-secondary);
    border: 1px solid var(--color-card-border);
    padding: 20px;
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: var(--shadow-sm);
}

.bee-rank-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.bee-rank-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
}

.bee-rank-value {
    font-weight: 800;
    font-size: 1.35rem;
    color: #f59e0b;
}

.bee-score-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    border-bottom: 1px solid var(--color-card-border);
    padding-bottom: 8px;
    margin-bottom: 8px;
}

.bee-points-value {
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.bee-max-value {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
}

/* Ranks Progress Bar */
.bee-progress-wrapper {
    position: relative;
    height: 20px;
    margin-top: 8px;
}

.bee-progress-track {
    height: 8px;
    background-color: var(--color-card-border);
    border-radius: 4px;
    overflow: hidden;
    width: 100%;
    position: absolute;
    top: 6px;
    left: 0;
}

.bee-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #f59e0b, #d97706);
    border-radius: 4px;
    transition: width 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    width: 0%;
}

.bee-progress-dots {
    position: absolute;
    top: 5px;
    left: 0;
    width: 100%;
    height: 10px;
}

.progress-dot {
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--color-card-border);
    border: 2px solid var(--bg-secondary);
    transform: translate(-50%, -1px);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.progress-dot.active {
    background-color: #f59e0b;
    border-color: #f59e0b;
    box-shadow: 0 0 4px rgba(245, 158, 11, 0.6);
}

/* Found Words card wrapper */
.bee-words-card {
    background: var(--bg-secondary);
    border: 1px solid var(--color-card-border);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 160px;
    box-shadow: var(--shadow-sm);
}

.words-card-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.words-card-body {
    width: 100%;
}

.bee-words-inline-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    max-height: 240px;
    overflow-y: auto;
    padding: 4px;
}

.empty-list-msg {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-style: italic;
}

/* Word tags inside found list */
.found-word-tag {
    background-color: var(--bg-primary);
    border: 1px solid var(--color-card-border);
    color: var(--text-primary);
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    animation: popIn 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    user-select: none;
}

.found-word-tag.pangram {
    background: linear-gradient(135deg, #f59e0b, #ea580c) !important;
    color: white !important;
    border-color: #ea580c !important;
    box-shadow: 0 2px 5px rgba(245, 158, 11, 0.3);
}

@keyframes popIn {
    0% { transform: scale(0.6); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* Mobile responsive styles for Spelling Bee */
@media (max-width: 768px) {
    .bee-layout-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    
    .hive-container {
        max-width: 260px;
    }
    
    .bee-preview-wrapper {
        margin-bottom: 15px;
    }
    
    .bee-words-card {
        min-height: 120px;
    }
}






