:root {
    --bg: #0f172a;
    --card: #1e293b;
    --primary: #8b5cf6;
    --gold: #f59e0b;
    --text: #f8fafc;
    --text-muted: #94a3b8;
    --green: #10b981;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Outfit', sans-serif;
    color: var(--text);
    background-color: var(--bg);
    overflow: hidden;
    /* Since it's a presentation screen */
}

/* Background Animations */
.bg-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, #1e1b4b 0%, #020617 100%);
    z-index: -1;
}

/* Screen Management */
.screen {
    display: none;
    width: 100vw;
    height: 100vh;
    padding: 2rem;
    flex-direction: column;
}

.screen.active {
    display: flex;
}

.full-center {
    justify-content: center;
    align-items: center;
    text-align: center;
}

/* Typography */
.arabic-text,
.arabic-answer {
    font-family: 'Amiri', serif;
    direction: rtl;
    line-height: 2;
    margin-bottom: 15px;
}

.arabic-text {
    font-size: 3.5rem;
    color: var(--gold);
    text-shadow: 0 4px 6px rgba(0, 0, 0, 0.5);
}

.arabic-answer {
    font-size: 2.5rem;
    color: #ffd700;
}

.malay-text {
    font-size: 1.5rem;
    color: var(--text);
    font-weight: 500;
    margin-bottom: 25px;
    letter-spacing: 0.5px;
}

.malay-answer {
    font-size: 1.25rem;
    color: #cbd5e1;
}

/* Layout */
.main-title {
    font-size: 4rem;
    font-weight: 800;
    background: linear-gradient(to right, #d946ef, #8b5cf6);
    -webkit-background-clip: text;
    color: transparent;
    margin-bottom: 10px;
}

.glow-btn {
    background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
    color: white;
    padding: 18px 40px;
    border-radius: 50px;
    border: none;
    font-size: 1.5rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(99, 102, 241, 0.4);
    transition: transform 0.2s, box-shadow 0.2s;
    font-family: 'Outfit';
    margin-top: 30px;
}

.glow-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 30px rgba(99, 102, 241, 0.6);
}

.glow-btn:disabled {
    background: #475569;
    box-shadow: none;
    cursor: progress;
}

.rules-card {
    background: rgba(30, 41, 59, 0.7);
    padding: 30px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    max-width: 600px;
    margin: 40px auto;
    text-align: left;
    backdrop-filter: blur(10px);
}

.rules-card h3 {
    margin-bottom: 15px;
    color: var(--gold);
}

.rules-card li {
    font-size: 1.1rem;
    margin-bottom: 15px;
    list-style-position: inside;
}

.highlight {
    color: var(--gold);
    background: rgba(245, 158, 11, 0.2);
    padding: 2px 8px;
    border-radius: 4px;
}

/* Header Game */
.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.phase-badge {
    background: rgba(16, 185, 129, 0.2);
    color: var(--green);
    border: 1px solid var(--green);
    padding: 10px 24px;
    border-radius: 30px;
    font-size: 1.25rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.phase-badge.ujian {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border-color: #ef4444;
}

.timer-box {
    font-size: 4rem;
    font-weight: 800;
    background: rgba(255, 255, 255, 0.05);
    padding: 10px 30px;
    border-radius: 20px;
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.timer-box .sec-label {
    font-size: 1.5rem;
    color: var(--text-muted);
}

.timer-icon {
    font-size: 2.5rem;
}

/* Pulse animation for phase */
@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

/* Card Presentation */
.content-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.card-container {
    background: var(--card);
    width: 90%;
    max-width: 1400px;
    padding: 60px;
    border-radius: 30px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
    text-align: center;
}

.top-meta {
    position: absolute;
    top: 30px;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 40px;
}

#questionCounter {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-muted);
}

#topicBadge {
    background: rgba(139, 92, 246, 0.2);
    color: #c4b5fd;
    padding: 5px 15px;
    border-radius: 20px;
    font-weight: 600;
}

/* Answer Box logic */
.answer-box {
    margin-top: 40px;
    padding-top: 40px;
    border-top: 2px dashed rgba(255, 255, 255, 0.1);
    transition: opacity 0.3s;
}

.answer-box.hidden {
    opacity: 0;
    pointer-events: none;
}

/* Teacher Controls */
.admin-controls {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: flex;
    gap: 10px;
    opacity: 0.1;
    /* Almost invisible so it doesn't distract */
    transition: opacity 0.3s;
}

.admin-controls:hover {
    opacity: 1;
}

.ctrl-btn {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
}

.ctrl-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Progress */
.progress-container {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-bar {
    height: 100%;
    background: var(--gold);
    width: 100%;
    transition: width 1s linear;
}

@media (max-width: 1200px) {
    .arabic-text {
        font-size: 2.5rem;
    }

    .malay-text {
        font-size: 1.25rem;
    }

    .arabic-answer {
        font-size: 2rem;
    }
}