:root {
    --primary: #3b82f6;
    --secondary: #f43f5e;
    --bg-gradient: linear-gradient(135deg, #dbeafe, #bfdbfe, #93c5fd);
    --glass-bg: rgba(255, 255, 255, 0.85);
    --text-dark: #1e293b;
    --success: #22c55e;
    --error: #ef4444;
}

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

body {
    font-family: 'Kantumruy Pro', 'Outfit', sans-serif;
    background: var(--bg-gradient);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    color: var(--text-dark);
}

.app-container {
    width: 100%; max-width: 600px;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border-radius: 24px;
    padding: 30px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    text-align: center;
}

.btn-back {
    display: inline-block; padding: 8px 16px;
    background: var(--primary); color: #fff;
    border-radius: 20px; text-decoration: none;
    margin-bottom: 20px; font-weight: 600;
}

.app-header h1 { font-size: 2.5rem; color: var(--primary); }
.app-header p { margin-bottom: 20px; color: #475569; }

.status-bar {
    display: flex; justify-content: space-between;
    font-size: 1.5rem; font-weight: 700;
    margin-bottom: 20px; padding: 15px;
    background: #fff; border-radius: 12px;
}
.score { color: var(--primary); }
.timer { color: var(--secondary); }

.screen { display: none; }
.screen.active { display: block; animation: fadeIn 0.3s; }

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

.btn-large {
    background: var(--primary); color: white;
    border: none; padding: 15px 30px;
    font-size: 1.5rem; font-family: inherit;
    border-radius: 12px; cursor: pointer;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}
.btn-large:hover { background: #2563eb; transform: translateY(-2px); }

.equation-box {
    font-size: 4rem; font-weight: 700; font-family: 'Outfit', sans-serif;
    margin: 30px 0; display: flex; justify-content: center; gap: 15px;
}
.question-mark { color: var(--secondary); }

.options-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 15px;
}
.option-btn {
    background: #fff; border: 2px solid var(--primary);
    color: var(--primary); font-size: 2rem; font-weight: 700;
    padding: 20px; border-radius: 16px; cursor: pointer;
    transition: all 0.2s; font-family: 'Outfit', sans-serif;
}
.option-btn:hover { background: var(--primary); color: #fff; }
.option-btn.correct { background: var(--success); border-color: var(--success); color: #fff; }
.option-btn.wrong { background: var(--error); border-color: var(--error); color: #fff; }

#end-screen h2 { font-size: 3rem; color: var(--secondary); margin-bottom: 10px; }
#end-screen p { font-size: 1.5rem; margin-bottom: 30px; }

/* name-spinner specific styles */
:root {
    --primary: #14b8a6; /* Teal */
    --bg-gradient: linear-gradient(135deg, #ccfbf1, #99f6e4, #5eead4);
}

.spinner-area {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    align-items: flex-start;
}

.input-section {
    flex: 1;
    min-width: 250px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    background: rgba(255,255,255,0.5);
    padding: 20px;
    border-radius: 16px;
}

textarea {
    width: 100%;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #ccc;
    font-family: 'Kantumruy Pro', sans-serif;
    font-size: 1.1rem;
    resize: vertical;
}

.btn-secondary {
    background: #fff;
    color: var(--primary);
    border: 2px solid var(--primary);
    padding: 10px;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    font-size: 1.1rem;
    font-family: inherit;
    transition: 0.3s;
}

.btn-secondary:hover {
    background: var(--primary);
    color: #fff;
}

.wheel-section {
    flex: 2;
    min-width: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.wheel-container {
    position: relative;
    width: 400px;
    height: 400px;
    filter: drop-shadow(0 10px 15px rgba(0,0,0,0.2));
}

#wheel-canvas {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    transition: transform cubic-bezier(0.17, 0.67, 0.12, 0.99);
}

.pointer {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 3rem;
    color: #ef4444;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    z-index: 10;
}

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

.modal.hidden {
    display: none;
}

.modal-content {
    background: #fff;
    padding: 40px;
    border-radius: 24px;
    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
    animation: popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    min-width: 300px;
}

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

@media (max-width: 768px) {
    .wheel-container { width: 300px; height: 300px; }
}
