/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --success-color: #22c55e;
    --success-bg: #dcfce7;
    --error-color: #ef4444;
    --error-bg: #fee2e2;
    --warning-color: #f59e0b;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --bg-primary: #ffffff;
    --bg-secondary: #f3f4f6;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 9999px;
}

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #1e3a5f 0%, #0f172a 100%);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
}

.app-container {
    width: 100%;
    height: 100%;
    max-width: 100%;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
}

/* Screen Management */
.screen {
    display: none;
    height: 100%;
    padding: 20px;
    flex-direction: column;
}

.screen.active {
    display: flex;
}

/* ============ START SCREEN ============ */
#start-screen {
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #1e3a5f 0%, #0f172a 100%);
}

.start-content {
    text-align: center;
    animation: fadeInUp 0.8s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.logo {
    font-size: 100px;
    margin-bottom: 20px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

#start-screen h1 {
    font-size: 36px;
    font-weight: 900;
    color: #fff;
    margin-bottom: 10px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.subtitle {
    font-size: 20px;
    color: rgba(255,255,255,0.7);
    margin-bottom: 50px;
}

.start-btn {
    display: inline-block;
    padding: 20px 80px;
    font-size: 24px;
    font-weight: 800;
    color: #ffffff;
    background-color: #22c55e;
    background-image: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    opacity: 1;
    visibility: visible;
    transition: all 0.3s ease;
    box-shadow: 0 8px 30px rgba(34, 197, 94, 0.4);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.start-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(34, 197, 94, 0.5);
}

.start-btn:active {
    transform: translateY(0);
}

/* ============ QUIZ SCREEN ============ */
#quiz-screen {
    background: linear-gradient(180deg, #1e3a5f 0%, #0f172a 100%);
    padding: 15px;
    gap: 10px;
}

.quiz-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 5px;
}

.question-counter {
    font-size: 18px;
    font-weight: 700;
    color: rgba(255,255,255,0.6);
}

.question-counter #current-question {
    font-size: 24px;
    color: #fff;
}

.timer-container {
    position: relative;
}

.timer-ring {
    width: 60px;
    height: 60px;
    position: relative;
}

.timer-ring svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.timer-progress {
    stroke-linecap: round;
    transition: stroke-dasharray 0.1s linear;
}

.timer-progress.warning {
    stroke: #f59e0b;
}

.timer-progress.danger {
    stroke: #ef4444;
}

.timer-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 22px;
    font-weight: 800;
    color: #fff;
}

.timer-text.warning {
    color: #f59e0b;
}

.timer-text.danger {
    color: #ef4444;
    animation: shake 0.5s infinite;
}

@keyframes shake {
    0%, 100% { transform: translate(-50%, -50%) rotate(0); }
    25% { transform: translate(-50%, -50%) rotate(-5deg); }
    75% { transform: translate(-50%, -50%) rotate(5deg); }
}

/* Settings Button & Dropdown */
.settings-btn {
    background: rgba(255,255,255,0.1);
    padding: 10px 15px;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.settings-btn:hover {
    background: rgba(255,255,255,0.2);
}

.gear-icon {
    font-size: 20px;
}

.timer-dropdown {
    position: absolute;
    top: 70px;
    right: 15px;
    background: #1e293b;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 12px;
    padding: 12px;
    display: none;
    flex-direction: column;
    gap: 8px;
    z-index: 100;
    min-width: 140px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}

.timer-dropdown.show {
    display: flex;
}

.dropdown-title {
    font-size: 12px;
    color: rgba(255,255,255,0.5);
    text-transform: uppercase;
    letter-spacing: 1px;
    padding-bottom: 5px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.timer-option {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    color: #fff;
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
    text-align: center;
}

.timer-option:hover {
    background: rgba(255,255,255,0.15);
}

.timer-option.active {
    background: #22c55e;
    border-color: #22c55e;
}

/* Question */
.question-container {
    text-align: center;
    padding: 10px 0;
}

.question-title {
    font-size: 22px;
    font-weight: 700;
    color: #fff;
}

/* Sign Container */
.sign-container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 180px;
    max-height: 250px;
}

.sign-image {
    max-width: 200px;
    max-height: 200px;
    display: flex;
    justify-content: center;
    align-items: center;
    filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.5));
}

.sign-image svg,
.sign-image img,
.sign-img {
    width: 100%;
    height: 100%;
    max-width: 180px;
    max-height: 180px;
    object-fit: contain;
}

/* Answers */
.answers-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 10px 0;
}

.answer-btn {
    width: 100%;
    padding: 18px 20px;
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255,255,255,0.2);
    border-radius: 15px;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    line-height: 1.3;
}

.answer-btn:hover:not(:disabled):not(.correct):not(.wrong) {
    background: rgba(255,255,255,0.2);
    border-color: rgba(255,255,255,0.4);
    transform: translateX(5px);
}

.answer-btn:active:not(:disabled) {
    transform: scale(0.98);
}

.answer-btn:disabled {
    cursor: not-allowed;
}

.answer-btn.selected {
    background: rgba(37, 99, 235, 0.4);
    border-color: #2563eb;
}

.answer-btn.correct {
    background: rgba(34, 197, 94, 0.3);
    border-color: #22c55e;
    animation: correctPulse 0.5s ease;
}

@keyframes correctPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

.answer-btn.correct::before {
    content: '✓ ';
    font-weight: bold;
}

.answer-btn.wrong {
    background: rgba(239, 68, 68, 0.3);
    border-color: #ef4444;
    animation: wrongShake 0.5s ease;
}

@keyframes wrongShake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-10px); }
    40% { transform: translateX(10px); }
    60% { transform: translateX(-5px); }
    80% { transform: translateX(5px); }
}

.answer-btn.wrong::before {
    content: '✗ ';
    font-weight: bold;
}

.answer-btn.dimmed {
    opacity: 0.4;
}

/* Banner */
.banner-container {
    width: 100%;
    padding: 10px 0;
}

.banner-gif {
    width: 100%;
    height: auto;
    border-radius: 15px;
    display: block;
}

/* ============ RESULT SCREEN ============ */
#result-screen {
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #1e3a5f 0%, #0f172a 100%);
}

.result-content {
    text-align: center;
    animation: fadeInUp 0.8s ease;
    width: 100%;
    max-width: 400px;
}

.result-emoji {
    font-size: 100px;
    margin-bottom: 20px;
    animation: bounce 1s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

#result-title {
    font-size: 32px;
    font-weight: 900;
    color: #fff;
    margin-bottom: 20px;
}

.result-score {
    font-size: 64px;
    font-weight: 900;
    color: #fff;
    margin-bottom: 5px;
}

.result-percentage {
    font-size: 28px;
    font-weight: 700;
    color: #22c55e;
    margin-bottom: 10px;
}

.result-message {
    font-size: 18px;
    color: rgba(255,255,255,0.7);
    margin-bottom: 30px;
    line-height: 1.5;
}

.result-stats {
    display: flex;
    justify-content: center;
    gap: 50px;
    margin-bottom: 40px;
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-value {
    font-size: 42px;
    font-weight: 900;
}

.stat.correct .stat-value {
    color: #22c55e;
}

.stat.wrong .stat-value {
    color: #ef4444;
}

.stat-label {
    font-size: 14px;
    color: rgba(255,255,255,0.6);
    margin-top: 5px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ============ RESPONSIVE ============ */
@media (max-height: 700px) {
    .logo {
        font-size: 70px;
    }

    #start-screen h1 {
        font-size: 28px;
    }

    .sign-container {
        min-height: 140px;
        max-height: 180px;
    }

    .sign-image {
        max-width: 150px;
        max-height: 150px;
    }

    .answer-btn {
        padding: 14px 16px;
        font-size: 14px;
    }

    .question-title {
        font-size: 18px;
    }

    .timer-ring {
        width: 50px;
        height: 50px;
    }

    .timer-text {
        font-size: 18px;
    }
}

@media (max-height: 600px) {
    .sign-container {
        min-height: 100px;
        max-height: 130px;
    }

    .sign-image {
        max-width: 120px;
        max-height: 120px;
    }

    .answer-btn {
        padding: 12px 14px;
        font-size: 13px;
    }

    .answers-container {
        gap: 6px;
    }
}

@media (min-width: 600px) {
    .app-container {
        max-width: 500px;
        margin: 0 auto;
    }

    .answer-btn {
        font-size: 17px;
    }
}

/* Touch feedback for mobile */
@media (hover: none) {
    .start-btn:active,
    .answer-btn:active:not(:disabled) {
        transform: scale(0.97);
    }
}
