:root {
    --primary-color: #FF6B6B;
    --secondary-color: #4ECDC4;
    --accent-color: #FFE66D;
    --text-color: #2C3E50;
    --bg-gradient: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    --card-bg: rgba(255, 255, 255, 0.9);
    --font-main: 'Fredoka', sans-serif;
    --shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    --btn-shadow: 0 4px 0px rgba(0, 0, 0, 0.2);
}

* {
    box-sizing: border-box;
    user-select: none;
    /* Prevent accidental selection by kids */
}

body {
    margin: 0;
    font-family: var(--font-main);
    color: var(--text-color);
    background: var(--bg-gradient);
}

button {
    cursor: pointer;
    font-family: var(--font-main);
    border: none;
    outline: none;
    transition: transform 0.1s;
}

button:active {
    transform: scale(0.95);
}

.screen {
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.5s ease-out;
    overflow-y: auto;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.title {
    font-size: 3rem;
    color: #444;
    text-shadow: 2px 2px 0px #fff;
    margin-bottom: 2rem;
    text-align: center;
    background: white;
    padding: 1rem 2rem;
    border-radius: 20px;
    box-shadow: var(--shadow);
}

/* Grid for Game Menu */
.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    max-width: 900px;
    width: 100%;
    padding-bottom: 40px;
    /* Space for scrolling */
}

.game-card {
    background: white;
    border-radius: 20px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 200px;
    border-bottom: 8px solid rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
    font-size: 1.5rem;
    font-weight: 600;
    color: #555;
}

.game-card:hover {
    transform: translateY(-5px);
    background: #fff9f0;
}

.game-card.addition {
    border-top: 5px solid #FF6B6B;
    color: #FF6B6B;
}

.game-card.subtraction {
    border-top: 5px solid #4ECDC4;
    color: #4ECDC4;
}

.game-card.division {
    border-top: 5px solid #FFE66D;
    color: #D4B91E;
}

.game-card.counting {
    border-top: 5px solid #1A535C;
    color: #1A535C;
}

.game-card.graphs {
    border-top: 5px solid #FF9F1C;
    color: #FF9F1C;
}

.game-card.spatial {
    border-top: 5px solid #9D4EDD;
    color: #9D4EDD;
}

.icon {
    font-size: 3rem;
    margin-bottom: 10px;
}

/* Game Interface */
.game-header {
    width: 100%;
    max-width: 800px;
    display: flex;
    justify-content: space-between;
    font-size: 2rem;
    background: white;
    padding: 10px 30px;
    border-radius: 50px;
    margin-bottom: 30px;
    box-shadow: var(--shadow);
}

.game-area {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(5px);
    border-radius: 30px;
    padding: 40px;
    width: 100%;
    max-width: 800px;
    min-height: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow);
    position: relative;
}

.question {
    font-size: 5rem;
    font-weight: bold;
    margin: 20px 0;
    text-align: center;
}

.options-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    width: 100%;
}

.option-btn {
    background: white;
    border: 2px solid #eee;
    padding: 20px;
    font-size: 2.5rem;
    border-radius: 15px;
    font-weight: bold;
    color: #333;
    border-bottom: 6px solid #ccc;
    transition: all 0.1s;
}

.option-btn:hover {
    background: #f0f0f0;
    transform: translateY(-2px);
}

.option-btn:active {
    border-bottom: 2px solid #ccc;
    transform: translateY(4px);
}

.back-btn {
    position: absolute;
    top: 20px;
    left: 20px;
    background: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow);
}

/* Modal / Feedback */
.feedback-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    z-index: 100;
    animation: fadeIn 0.2s;
}

.feedback-card {
    background: white;
    padding: 40px;
    border-radius: 30px;
    text-align: center;
    font-size: 2rem;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
    from {
        transform: scale(0.5);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    padding: 15px 40px;
    font-size: 1.5rem;
    border-radius: 50px;
    margin-top: 20px;
    border-bottom: 5px solid rgba(0, 0, 0, 0.2);
}

/* Analog Clock Styles */
.clock {
    width: 250px;
    height: 250px;
    background: #fff;
    border-radius: 50%;
    border: 10px solid #2C3E50;
    position: relative;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.1), 0 10px 20px rgba(0, 0, 0, 0.2);
}

.clock-face {
    width: 100%;
    height: 100%;
    position: relative;
}

.hand {
    position: absolute;
    bottom: 50%;
    left: 50%;
    background: #2C3E50;
    transform-origin: bottom center;
    border-radius: 5px;
    z-index: 10;
}

.hour-hand {
    width: 8px;
    height: 60px;
    margin-left: -4px;
}

.min-hand {
    width: 4px;
    height: 90px;
    margin-left: -2px;
    background: #FF6B6B;
}

.center-dot {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    background: #2C3E50;
    border-radius: 50%;
    z-index: 20;
}

.number {
    position: absolute;
    width: 30px;
    height: 30px;
    left: 50%;
    top: 50%;
    margin: -15px 0 0 -15px;
    text-align: center;
    line-height: 30px;
    font-weight: bold;
    font-size: 1.2rem;
    color: #333;
}