
:root {
    --primary: #6c5ce7;
    --secondary: #a29bfe;
    --success: #00b894;
    --danger: #d63031;
    --warning: #fdcb6e;
    --bg-gradient: linear-gradient(135deg, #a29bfe 0%, #74b9ff 100%);
    --container-bg: #ffffff;
    --nav-bg: #f1f2f6;
    --text-color: #2d3436;
    --input-border: #ddd;
    --card-bg: #ffffff;
    --modal-overlay: rgba(0,0,0,0.7);
    --square-bg: #f8f9fa;
    --square-border: #6c5ce7;
    --shadow: rgba(0,0,0,0.1);
}

[data-theme="dark"] {
    --primary: #a29bfe;
    --secondary: #6c5ce7;
    --bg-gradient: linear-gradient(135deg, #1e272e 0%, #000000 100%);
    --container-bg: #1e272e;
    --nav-bg: #2d3436;
    --text-color: #ffffff;
    --input-border: #4b4b4b;
    --card-bg: #2d3436;
    --modal-overlay: rgba(0,0,0,0.9);
    --square-bg: #2d3436;
    --square-border: #a29bfe;
    --shadow: rgba(0,0,0,0.5);
}

body {
    font-family: 'Comic Sans MS', sans-serif;
    background: var(--bg-gradient);
    color: var(--text-color);
    margin: 0; padding: 0;
    display: flex; justify-content: center; align-items: center;
    min-height: 100vh;
    transition: all 0.3s ease;
}

#game-container {
    background: var(--container-bg);
    padding: 20px;
    border-radius: 30px;
    box-shadow: 0 20px 50px var(--shadow);
    width: 95%; max-width: 420px;
    text-align: center;
    position: relative;
    min-height: 550px;
    display: flex; flex-direction: column;
}

.theme-toggle {
    position: absolute; top: 15px; right: 20px;
    background: var(--primary); color: white;
    border: none; border-radius: 20px;
    padding: 8px 16px; font-size: 0.85rem; font-weight: bold;
    cursor: pointer; z-index: 100;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

#nav-bar {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px; background: var(--nav-bg); border-radius: 20px;
    margin-bottom: 15px; border: 1px solid var(--input-border);
}

.nav-btn {
    background: var(--secondary); color: white;
    border: none; padding: 10px 15px; border-radius: 12px;
    font-weight: bold; cursor: pointer;
}

.arcade-btn, .subject-btn {
    width: 100%; padding: 18px; margin-bottom: 12px;
    border-radius: 20px; border: none;
    background: var(--primary); color: white;
    font-weight: bold; font-size: 1.1rem;
    box-shadow: 0 6px 0 #4834d4; cursor: pointer;
}

[data-theme="dark"] .arcade-btn, [data-theme="dark"] .subject-btn {
    box-shadow: 0 6px 0 #2a1a8a;
}

.arcade-btn:active { transform: translateY(3px); box-shadow: 0 2px 0 #4834d4; }

/* TIC TAC TOE */
#grid-container {
    display: grid; grid-template-columns: repeat(3, 1fr);
    gap: 15px; margin: 30px auto; width: 300px; height: 300px;
}

.grid-square {
    background: var(--square-bg);
    border: 5px solid var(--square-border);
    border-radius: 20px;
    display: flex; justify-content: center; align-items: center;
    font-size: 3.5rem; cursor: pointer;
    box-shadow: 0 8px 0 var(--shadow);
    transition: all 0.1s;
}

.grid-square:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--shadow); }

/* MODAL */
.modal {
    position: fixed; z-index: 2000; left: 0; top: 0; width: 100%; height: 100%;
    background: var(--modal-overlay);
    display: flex; justify-content: center; align-items: center;
    backdrop-filter: blur(5px);
}

.modal-content {
    background: var(--container-bg);
    color: var(--text-color);
    padding: 30px; border-radius: 30px;
    width: 90%; max-width: 380px;
    box-shadow: 0 30px 60px rgba(0,0,0,0.5);
    border: 2px solid var(--primary);
}

.option-btn {
    width: 100%; margin-bottom: 12px; padding: 15px;
    border-radius: 18px; border: 2px solid var(--input-border);
    background: var(--card-bg); color: var(--text-color);
    font-weight: bold; font-size: 1rem; cursor: pointer;
}

.option-btn.selected { background: var(--primary); color: white; border-color: var(--primary); }

#feedback { padding: 15px; border-radius: 15px; margin: 15px 0; font-weight: bold; }
.correct-msg { background: rgba(0, 184, 148, 0.2); color: #00b894; }
.wrong-msg { background: rgba(214, 48, 49, 0.2); color: #d63031; }

.hidden { display: none !important; }
