:root {
    --primary-bg: #0f172a;
    --secondary-bg: #1e293b;
    --accent: #f59e0b;
    --accent-hover: #fbbf24;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --board-bg: rgba(255, 255, 255, 0.1);
    --tile-bg: #ffffff;
    --tile-text: #0f172a;
    --success: #10b981;
    --danger: #ef4444;
}

/* Global styles removed to avoid Bootstrap conflict */

.game-container {
    font-family: 'Outfit', sans-serif;
    color: var(--text-main);
    width: 100%;
    max-width: 1200px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin: 0 auto;
}

/* HEADER */
.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--board-bg);
    backdrop-filter: blur(10px);
    padding: 1.5rem 2rem;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.game-header h1 {
    font-size: 2rem;
    font-weight: 800;
    text-transform: uppercase;
    background: linear-gradient(90deg, #fbbf24, #f59e0b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 2px;
}

.score-board {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.5rem;
}

.player-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.player-name {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-muted);
}

.player-score {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--accent);
    background: rgba(0, 0, 0, 0.3);
    padding: 0.5rem 1rem;
    border-radius: 10px;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.message-box {
    font-size: 1rem;
    font-weight: 400;
    color: var(--success);
    min-height: 1.5rem;
    transition: all 0.3s ease;
}

/* BOARD */
.board-container {
    background: var(--board-bg);
    backdrop-filter: blur(15px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

.category {
    font-size: 1.2rem;
    font-weight: 600;
    letter-spacing: 2px;
    color: var(--accent);
    margin-bottom: 1.5rem;
    text-align: center;
    background: rgba(0, 0, 0, 0.3);
    padding: 0.5rem 2rem;
    border-radius: 20px;
}

.puzzle-board {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    max-width: 800px;
}

.tile {
    width: 3.5rem;
    height: 4.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2.5rem;
    font-weight: 800;
    color: transparent; /* Text hidden by default */
    text-transform: uppercase;
    transition: transform 0.6s;
    transform-style: preserve-3d;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.tile.space {
    background: transparent;
    border-color: transparent;
    box-shadow: none;
}

.tile.revealed {
    background: var(--tile-bg);
    border-color: var(--tile-bg);
    color: var(--tile-text);
    transform: rotateY(360deg);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.5);
}

/* MAIN ACTION AREA */
.main-action-area {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
    justify-content: space-between;
}

/* CONTROLS */
.controls-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    flex: 1;
}

.action-btn {
    padding: 1.2rem;
    font-family: inherit;
    font-size: 1.1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--text-main);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

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

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

.spin-btn {
    background: linear-gradient(135deg, #10b981, #059669);
    border: 1px solid #34d399;
}
.spin-btn:hover:not(:disabled) {
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.5);
}

.vowel-btn {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    border: 1px solid #60a5fa;
}
.vowel-btn:hover:not(:disabled) {
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.5);
}

.solve-btn {
    background: linear-gradient(135deg, #8b5cf6, #6d28d9);
    border: 1px solid #a78bfa;
}
.solve-btn:hover:not(:disabled) {
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.5);
}

/* WHEEL */
.wheel-container {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 1;
    filter: drop-shadow(0 15px 25px rgba(0,0,0,0.5));
}

.pointer {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 0; 
    height: 0; 
    border-left: 20px solid transparent;
    border-right: 20px solid transparent;
    border-top: 30px solid var(--text-main);
    z-index: 10;
    filter: drop-shadow(0 4px 4px rgba(0,0,0,0.5));
}

#wheel-canvas {
    border-radius: 50%;
    border: 8px solid rgba(255, 255, 255, 0.1);
    transition: transform 4s cubic-bezier(0.17, 0.67, 0.12, 0.99); /* Smooth spin */
    max-width: 100%;
    height: auto;
}

/* KEYBOARD */
.keyboard-container {
    flex: 1.5;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    background: var(--board-bg);
    backdrop-filter: blur(10px);
    padding: 1.5rem;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.key-btn {
    width: 3rem;
    height: 3.5rem;
    font-family: inherit;
    font-size: 1.2rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.key-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.key-btn:disabled {
    background: rgba(0, 0, 0, 0.4);
    color: rgba(255, 255, 255, 0.2);
    border-color: transparent;
    cursor: not-allowed;
}

/* MODAL */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

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

.game-modal {
    background: var(--secondary-bg);
    padding: 3rem;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    text-align: center;
    width: 90%;
    max-width: 500px;
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.modal-overlay.active .game-modal {
    transform: translateY(0);
}

.game-modal h2 {
    color: var(--accent);
    margin-bottom: 1rem;
    font-size: 2rem;
}

.game-modal p {
    margin-bottom: 1.5rem;
    color: var(--text-muted);
}

.game-modal input {
    width: 100%;
    padding: 1rem;
    font-size: 1.2rem;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-main);
    border-radius: 10px;
    margin-bottom: 2rem;
    text-transform: uppercase;
}
.game-modal input:focus {
    outline: none;
    border-color: var(--accent);
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.cancel-btn {
    background: transparent;
    border: 1px solid var(--danger);
    color: var(--danger);
}
.cancel-btn:hover {
    background: rgba(239, 68, 68, 0.1);
}
.modal-actions .action-btn {
    padding: 1rem 2rem;
}
.modal-actions #modal-confirm {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

/* RESPONSIVE */
@media (max-width: 1024px) {
    .main-action-area {
        flex-direction: column;
        align-items: center;
    }
    .wheel-container, .keyboard-container, .controls-container {
        width: 100%;
        max-width: 100%;
    }
}
@media (max-width: 600px) {
    .game-container {
        padding: 1rem;
        gap: 1rem;
    }
    .board-container {
        padding: 1rem;
    }
    .game-header {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
        padding: 1rem;
    }
    .game-header h1 {
        font-size: 1.5rem;
    }
    .score-board {
        align-items: center;
    }
    .tile {
        width: 1.8rem;
        height: 2.2rem;
        font-size: 1.2rem;
        border-width: 1px;
    }
    .category {
        font-size: 0.9rem;
        padding: 0.5rem 1rem;
    }
    .key-btn {
        width: 2.2rem;
        height: 2.5rem;
        font-size: 0.9rem;
    }
    .action-btn {
        padding: 0.8rem;
        font-size: 0.9rem;
    }
    .game-modal {
        padding: 1.5rem;
    }
    .game-modal h2 {
        font-size: 1.5rem;
    }
    .pointer {
        top: -10px;
        border-left: 15px solid transparent;
        border-right: 15px solid transparent;
        border-top: 25px solid var(--text-main);
    }
}
