/* ===== CSS VARIABLES ===== */
:root {
    --primary-pink: #FE9EC7;
    --primary-pink-dark: #fd7eb3;
    --cream-yellow: #F9F6C4;
    --cream-yellow-dark: #f5efaa;
    --accent-purple: #E8B4F8;
    --accent-blue: #A8D8F8;
    --accent-green: #B8F8B4;
    --accent-orange: #F8D8A8;
    --text-dark: #2D3436;
    --text-light: #636E72;
    --white: #FFFFFF;
    --shadow: rgba(254, 158, 199, 0.3);
    --gradient-1: linear-gradient(135deg, #FE9EC7 0%, #E8B4F8 100%);
    --gradient-2: linear-gradient(135deg, #F9F6C4 0%, #F8D8A8 100%);
    --gradient-3: linear-gradient(135deg, #A8D8F8 0%, #B8F8B4 100%);
}

/* ===== RESET & BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Nunito', sans-serif;
    background: linear-gradient(135deg, var(--cream-yellow) 0%, var(--primary-pink) 50%, var(--accent-purple) 100%);
    min-height: 100vh;
    overflow-x: hidden;
    overflow-y: auto;
    position: relative;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    touch-action: manipulation;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(circle at 20% 30%, rgba(254, 158, 199, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(249, 246, 196, 0.4) 0%, transparent 50%),
        radial-gradient(circle at 40% 80%, rgba(232, 180, 248, 0.3) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* ===== FLOATING ELEMENTS ===== */
.floating-elements {
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.float-item {
    position: absolute;
    font-size: 2rem;
    animation: float 15s ease-in-out infinite;
    opacity: 0.7;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.1));
}

.float-item.star { top: 10%; left: 10%; animation-delay: 0s; font-size: 2.5rem; }
.float-item.heart { top: 20%; right: 15%; animation-delay: 2s; font-size: 2rem; }
.float-item.star2 { bottom: 30%; left: 8%; animation-delay: 4s; font-size: 1.8rem; }
.float-item.balloon { top: 60%; right: 10%; animation-delay: 6s; font-size: 2.5rem; }
.float-item.rainbow { bottom: 10%; left: 50%; animation-delay: 8s; font-size: 2.2rem; }

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-20px) rotate(5deg); }
    50% { transform: translateY(-10px) rotate(-5deg); }
    75% { transform: translateY(-30px) rotate(3deg); }
}

/* ===== CONTAINER ===== */
.container {
    position: relative;
    z-index: 10;
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ===== SCREENS ===== */
.screen {
    display: none;
    width: 100%;
    animation: fadeInUp 0.6s ease-out;
}

.screen.active {
    display: block;
}

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

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

/* ===== WELCOME SCREEN ===== */
.welcome-content {
    text-align: center;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 40px;
    padding: 50px 40px;
    box-shadow: 0 20px 60px var(--shadow), 0 0 0 1px rgba(255,255,255,0.5);
}

.logo-animation {
    margin-bottom: 40px;
}

.bounce-text {
    font-size: 5rem;
    animation: bounce 2s ease-in-out infinite;
    display: inline-block;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-20px) scale(1.1); }
}

.main-title {
    font-size: 3rem;
    font-weight: 900;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 10px 0;
    text-shadow: 0 4px 20px rgba(254, 158, 199, 0.4);
}

.subtitle {
    font-size: 1.3rem;
    color: var(--text-light);
    font-weight: 600;
}

/* ===== NAME INPUT ===== */
.name-input-container {
    margin: 40px 0;
}

.input-label {
    display: block;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 15px;
}

.input-label i {
    color: var(--primary-pink);
    margin-right: 8px;
}

.name-input {
    width: 100%;
    max-width: 400px;
    padding: 18px 25px;
    font-size: 1.3rem;
    font-family: 'Nunito', sans-serif;
    font-weight: 600;
    border: 3px solid var(--primary-pink);
    border-radius: 25px;
    outline: none;
    transition: all 0.3s ease;
    background: var(--cream-yellow);
    color: var(--text-dark);
}

.name-input:focus {
    border-color: var(--accent-purple);
    box-shadow: 0 0 0 5px rgba(232, 180, 248, 0.3);
    transform: scale(1.02);
}

.name-input::placeholder {
    color: var(--text-light);
    opacity: 0.7;
}

.name-suggestions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 15px;
    flex-wrap: wrap;
    min-height: 50px;
}

.name-suggestions:empty {
    display: none;
}

.suggestion-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 20px;
    background: var(--gradient-1);
    color: white;
    font-family: 'Nunito', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.suggestion-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(254, 158, 199, 0.4);
}

/* ===== BUTTONS ===== */
.btn-primary {
    padding: 18px 50px;
    font-size: 1.4rem;
    font-weight: 700;
    font-family: 'Nunito', sans-serif;
    border: none;
    border-radius: 30px;
    background: var(--gradient-1);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 30px rgba(254, 158, 199, 0.4);
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(254, 158, 199, 0.5);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-primary:not(:disabled) {
    opacity: 1;
    cursor: pointer;
    pointer-events: auto;
}

.btn-secondary {
    padding: 15px 35px;
    font-size: 1.1rem;
    font-weight: 600;
    font-family: 'Nunito', sans-serif;
    border: 2px solid var(--primary-pink);
    border-radius: 25px;
    background: white;
    color: var(--primary-pink);
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.btn-secondary:hover {
    background: var(--primary-pink);
    color: white;
    transform: translateY(-3px);
}

/* Home button style */
.btn-home {
    width: 50px;
    height: 50px;
    padding: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
}

/* Logout button style */
.btn-logout {
    padding: 12px 25px;
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid #FF6B6B;
    border-radius: 20px;
    color: #FF6B6B;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-logout:hover {
    background: #FF6B6B;
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(255, 107, 107, 0.3);
}

.pulse-animation {
    animation: pulse 2s ease-in-out infinite;
}

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

/* ===== PLAYERS REPORT SCREEN ===== */
.reports-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.reports-header {
    text-align: center;
    margin-bottom: 30px;
    position: relative;
}

.back-btn-small {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    padding: 15px;
    background: rgba(255, 255, 255, 0.9);
    border: 3px solid var(--primary-pink);
    border-radius: 50%;
    color: var(--primary-pink);
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 55px;
    height: 55px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(254, 158, 199, 0.3);
}

.back-btn-small:hover {
    background: var(--primary-pink);
    color: white;
    transform: translateY(-50%) scale(1.15);
    box-shadow: 0 6px 20px rgba(254, 158, 199, 0.5);
}

.reports-header h2 {
    font-size: 2rem;
    font-weight: 800;
    color: white;
    text-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.reports-summary {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.summary-card-small {
    background: white;
    border-radius: 20px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    min-width: 140px;
}

.summary-card-small i {
    font-size: 2rem;
}

.summary-info-small {
    display: flex;
    flex-direction: column;
}

.summary-count {
    font-size: 1.8rem;
    font-weight: 900;
    color: var(--primary-pink);
}

.summary-label-small {
    font-size: 0.85rem;
    color: var(--text-gray);
    font-weight: 600;
}

/* ===== RANKING LIST ===== */
.players-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.player-rank-card {
    background: white;
    border-radius: 20px;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    animation: slideInUp 0.5s ease backwards;
}

.player-rank-card:hover {
    transform: translateX(5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
}

.player-rank-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 5px;
    height: 100%;
}

.player-rank-card:nth-child(1)::before {
    background: linear-gradient(180deg, #FFD700, #FFA500);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
}

.player-rank-card:nth-child(2)::before {
    background: linear-gradient(180deg, #C0C0C0, #808080);
    box-shadow: 0 0 20px rgba(192, 192, 192, 0.3);
}

.player-rank-card:nth-child(3)::before {
    background: linear-gradient(180deg, #CD7F32, #8B4513);
    box-shadow: 0 0 20px rgba(205, 127, 50, 0.3);
}

.player-rank-card:nth-child(n+4)::before {
    background: linear-gradient(180deg, #E8B4F8, #A8D8F8);
    box-shadow: 0 0 15px rgba(232, 180, 248, 0.2);
}

.rank-number {
    font-size: 2.5rem;
    font-weight: 900;
    min-width: 60px;
    text-align: center;
    flex-shrink: 0;
}

.rank-number.gold {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.rank-number.silver {
    background: linear-gradient(135deg, #C0C0C0, #808080);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.rank-number.bronze {
    background: linear-gradient(135deg, #CD7F32, #8B4513);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.rank-number.blue {
    color: #9CA3DB;
    font-weight: 900;
}

.rank-trophy {
    font-size: 2.5rem;
    min-width: 60px;
    text-align: center;
}

.rank-medal {
    font-size: 2rem;
    min-width: 60px;
    text-align: center;
}

.player-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-blue));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

.player-info {
    flex: 1;
    min-width: 0;
}

.player-name-text {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--dark);
    margin-bottom: 5px;
}

.player-stats {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.player-stat {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.95rem;
    color: var(--text-gray);
}

.player-stat i {
    color: var(--primary-pink);
}

.player-score-badge {
    background: linear-gradient(135deg, var(--primary-pink), var(--accent-purple));
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 1rem;
}

.total-quizzes-badge {
    background: var(--cream-yellow);
    color: var(--dark);
    padding: 5px 15px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.95rem;
}

/* ===== EMPTY STATE ===== */
.empty-reports {
    text-align: center;
    padding: 60px 20px;
}

.empty-reports i {
    font-size: 4rem;
    color: var(--text-light);
    margin-bottom: 20px;
}

.empty-reports h3 {
    font-size: 1.5rem;
    color: var(--text-gray);
    margin-bottom: 10px;
}

.empty-reports p {
    color: var(--text-light);
}

/* ===== THEME SCREEN ===== */
.theme-header {
    text-align: center;
    margin-bottom: 40px;
}

.theme-header h2 {
    font-size: 2.5rem;
    font-weight: 800;
    color: white;
    text-shadow: 0 4px 15px rgba(0,0,0,0.2);
    margin-bottom: 10px;
}

.theme-header p {
    font-size: 1.3rem;
    color: rgba(255,255,255,0.9);
}

.name-highlight {
    /* Soft purple that blends well with pink/cream background */
    background: linear-gradient(135deg, #E8B4F8 0%, #C084FC 50%, #A855F7 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 900;
    /* Subtle text shadow for better readability */
    filter: drop-shadow(0 1px 2px rgba(168, 85, 247, 0.3));
}

.theme-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.theme-card {
    background: white;
    border-radius: 30px;
    padding: 30px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.theme-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--gradient-1);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.theme-card:hover {
    transform: translateY(-10px) rotate(2deg);
    box-shadow: 0 20px 50px rgba(254, 158, 199, 0.4);
}

.theme-card:hover::before {
    opacity: 0.1;
}

.theme-card .card-icon {
    font-size: 4rem;
    margin-bottom: 15px;
    position: relative;
    z-index: 1;
    animation: iconBounce 3s ease-in-out infinite;
}

@keyframes iconBounce {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-10px) rotate(-5deg); }
    75% { transform: translateY(-5px) rotate(5deg); }
}

.theme-card h3 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 8px;
    position: relative;
    z-index: 1;
}

.theme-card p {
    font-size: 0.95rem;
    color: var(--text-light);
    position: relative;
    z-index: 1;
}

.card-decoration {
    position: absolute;
    bottom: 10px;
    right: 15px;
    font-size: 1.2rem;
    opacity: 0.5;
}

/* Pattern styles */
.chart-pattern {
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    opacity: 0.1;
    background: radial-gradient(circle, #9333ea 2px, transparent 2px);
    background-size: 10px 10px;
}

/* Theme-specific styles */
.islam-card {
    background: linear-gradient(135deg, #fff 0%, #f0f8ff 100%);
    border: 3px solid var(--accent-green);
}

.islam-card .card-icon {
    animation-delay: 0s;
}

.demon-hunter-card {
    background: linear-gradient(135deg, #fff 0%, #fff5f5 100%);
    border: 3px solid var(--accent-orange);
}

.demon-hunter-card .card-icon {
    animation-delay: 0.5s;
}

.frozen-card {
    background: linear-gradient(135deg, #fff 0%, #e8f4ff 100%);
    border: 3px solid var(--accent-blue);
}

.frozen-card .card-icon {
    animation-delay: 1s;
}

.iqro-card {
    background: linear-gradient(135deg, #fff 0%, #fffbf0 100%);
    border: 3px solid var(--cream-yellow-dark);
}

.iqro-card .card-icon {
    animation-delay: 1.5s;
}

.reports-card {
    background: linear-gradient(135deg, #fff 0%, #f0f8ff 100%);
    border: 3px solid #9333ea;
    cursor: pointer;
}

.reports-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 35px rgba(147, 51, 234, 0.25);
}

.reports-card .card-icon {
    animation-delay: 2s;
}

/* ===== JILID SCREEN ===== */
.jilid-header {
    text-align: center;
    margin-bottom: 30px;
}

.jilid-header h2 {
    font-size: 2.5rem;
    font-weight: 800;
    color: white;
    text-shadow: 0 4px 15px rgba(0,0,0,0.2);
    margin-bottom: 10px;
}

.jilid-header p {
    font-size: 1.3rem;
    color: rgba(255,255,255,0.9);
}

.jilid-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.jilid-card {
    background: white;
    border-radius: 25px;
    padding: 25px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 3px solid transparent;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.jilid-card:hover {
    border-color: var(--primary-pink);
    transform: translateY(-8px) scale(1.05);
    box-shadow: 0 15px 40px rgba(254, 158, 199, 0.3);
}

.jilid-number {
    width: 60px;
    height: 60px;
    background: var(--gradient-1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    font-weight: 900;
    color: white;
    margin: 0 auto 15px;
    box-shadow: 0 5px 15px rgba(254, 158, 199, 0.4);
}

.jilid-content i {
    font-size: 2rem;
    color: var(--primary-pink);
    margin-bottom: 10px;
}

.jilid-content p {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 0.95rem;
}

/* ===== QUIZ SCREEN ===== */
.quiz-header {
    position: relative;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 25px;
    padding: 20px 25px;
    padding-left: 70px; /* Space for exit button */
    margin-bottom: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.quiz-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.player-name, .theme-badge {
    background: var(--cream-yellow);
    padding: 8px 18px;
    border-radius: 20px;
    font-weight: 700;
    color: var(--text-dark);
    font-size: 0.95rem;
}

.theme-badge {
    background: var(--gradient-1);
    color: white;
}

.progress-container {
    margin-top: 10px;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-dark);
}

.score-badge {
    background: var(--gradient-1);
    color: white !important;
    padding: 6px 15px;
    border-radius: 15px;
    font-size: 0.9rem !important;
}

.progress-bar {
    width: 100%;
    height: 12px;
    background: #eee;
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--gradient-1);
    border-radius: 10px;
    transition: width 0.5s ease;
    width: 0%;
}

/* ===== QUIZ CONTENT ===== */
.quiz-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 30px;
    padding: 30px;
    box-shadow: 0 15px 50px rgba(0,0,0,0.1);
}

.question-container {
    text-align: center;
    margin-bottom: 30px;
}

.question-header {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.speak-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    background: var(--gradient-3);
    color: white;
    font-size: 1.3rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 5px 15px rgba(168, 216, 248, 0.4);
}

.speak-btn:hover {
    transform: scale(1.1);
}

.speak-btn.speaking {
    animation: speakPulse 0.5s ease-in-out infinite;
}

@keyframes speakPulse {
    0%, 100% { transform: scale(1); box-shadow: 0 5px 15px rgba(168, 216, 248, 0.4); }
    50% { transform: scale(1.15); box-shadow: 0 8px 25px rgba(168, 216, 248, 0.6); }
}

.question-number {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-light);
}

.question-visual {
    font-size: 5rem;
    margin: 20px 0;
    animation: visualPop 0.5s ease-out;
}

.question-visual-image {
    font-size: 0;
    padding: 0;
}

.question-visual-image img {
    max-width: 100%;
    max-height: 300px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    object-fit: contain;
}

.question-visual-none {
    font-size: 3rem;
    opacity: 0.5;
}

@keyframes visualPop {
    0% { transform: scale(0); opacity: 0; }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); opacity: 1; }
}

.question-text {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1.4;
    margin-bottom: 20px;
}

/* ===== ANSWERS ===== */
.answers-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.answer-btn {
    background: white;
    border: 3px solid #eee;
    border-radius: 20px;
    padding: 20px;
    font-family: 'Nunito', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-dark);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 15px;
    text-align: left;
}

.answer-btn:hover:not(:disabled) {
    border-color: var(--primary-pink);
    background: var(--cream-yellow);
    transform: translateY(-3px);
}

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

.answer-btn .answer-letter {
    width: 40px;
    height: 40px;
    background: var(--gradient-1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 800;
    flex-shrink: 0;
}

.answer-btn.correct {
    border-color: #00b894;
    background: #d4fce4;
    animation: correctShake 0.5s ease;
}

.answer-btn.wrong {
    border-color: #e74c3c;
    background: #fde8e8;
    animation: wrongShake 0.5s ease;
}

@keyframes correctShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

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

.quiz-footer {
    text-align: center;
}

.btn-next {
    padding: 18px 50px;
    font-size: 1.3rem;
    font-weight: 700;
    font-family: 'Nunito', sans-serif;
    border: none;
    border-radius: 30px;
    background: var(--gradient-1);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 8px 30px rgba(254, 158, 199, 0.4);
}

.btn-next:hover:not(:disabled) {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(254, 158, 199, 0.5);
}

.btn-next:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-next span {
    animation: slideArrow 1.5s ease-in-out infinite;
}

@keyframes slideArrow {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(5px); }
}

/* ===== CONFETTI ===== */
.confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    overflow: hidden;
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    background: var(--primary-pink);
    animation: confettiFall 3s ease-out forwards;
}

@keyframes confettiFall {
    0% {
        transform: translateY(-100px) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

/* ===== RESULT SCREEN ===== */
.result-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 40px;
    padding: 50px 40px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.1);
}

.result-animation {
    font-size: 6rem;
    margin-bottom: 20px;
    animation: resultBounce 1s ease-out;
}

@keyframes resultBounce {
    0% { transform: scale(0) rotate(-180deg); opacity: 0; }
    50% { transform: scale(1.2) rotate(10deg); }
    100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

.result-title {
    font-size: 2.8rem;
    font-weight: 900;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
}

.result-subtitle {
    font-size: 1.3rem;
    color: var(--text-light);
    margin-bottom: 30px;
}

/* ===== SCORE CIRCLE ===== */
.score-circle {
    position: relative;
    width: 200px;
    height: 200px;
    margin: 0 auto 30px;
}

.score-inner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.score-number {
    font-size: 4rem;
    font-weight: 900;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
}

.score-total {
    font-size: 1.5rem;
    color: var(--text-light);
    font-weight: 600;
}

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

.ring-bg {
    fill: none;
    stroke: #eee;
    stroke-width: 12;
}

.ring-progress {
    fill: none;
    stroke: url(#scoreGradient);
    stroke-width: 12;
    stroke-linecap: round;
    stroke-dasharray: 565.48;
    stroke-dashoffset: 565.48;
    transition: stroke-dashoffset 1.5s ease-out;
}

.score-ring svg {
    filter: drop-shadow(0 4px 10px rgba(254, 158, 199, 0.3));
}

/* ===== SCORE MESSAGE ===== */
.score-message {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 30px;
    padding: 20px;
    background: var(--cream-yellow);
    border-radius: 20px;
    animation: messagePop 0.5s ease-out;
}

@keyframes messagePop {
    0% { transform: scale(0.8); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* ===== RESULT STATS ===== */
.result-stats {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 30px;
}

.stat-item {
    text-align: center;
    padding: 20px 30px;
    border-radius: 20px;
    min-width: 120px;
}

.stat-item i {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.stat-item span {
    font-size: 2.5rem;
    font-weight: 900;
    display: block;
}

.stat-item p {
    font-size: 1rem;
    font-weight: 600;
    margin-top: 5px;
}

.stat-item.correct {
    background: linear-gradient(135deg, #d4fce4 0%, #b8f8c8 100%);
    color: #00b894;
}

.stat-item.wrong {
    background: linear-gradient(135deg, #fde8e8 0%, #fcc8c8 100%);
    color: #e74c3c;
}

.result-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ===== REPORT SCREEN ===== */
.report-header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 25px;
    padding: 25px;
    text-align: center;
    margin-bottom: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.report-header h2 {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 10px;
}

.report-header p {
    font-size: 1.2rem;
    color: var(--text-light);
}

.report-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 30px;
    padding: 30px;
    box-shadow: 0 15px 50px rgba(0,0,0,0.1);
}

/* ===== REPORT SUMMARY ===== */
.report-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.summary-card {
    background: var(--cream-yellow);
    border-radius: 20px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: transform 0.3s ease;
}

.summary-card:hover {
    transform: translateY(-5px);
}

.summary-card i {
    font-size: 2rem;
    color: var(--primary-pink);
}

.summary-info {
    display: flex;
    flex-direction: column;
}

.summary-label {
    font-size: 0.85rem;
    color: var(--text-light);
    font-weight: 600;
}

.summary-value {
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--text-dark);
}

/* ===== CHART ===== */
.chart-container {
    margin-bottom: 30px;
}

.chart-container h3 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.chart-container h3 i {
    color: var(--primary-pink);
}

.chart {
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    height: 200px;
    background: var(--cream-yellow);
    border-radius: 20px;
    padding: 20px;
    gap: 15px;
}

.chart-bar {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    max-width: 80px;
}

.bar-fill {
    width: 100%;
    background: var(--gradient-1);
    border-radius: 10px 10px 0 0;
    transition: height 1s ease-out;
    position: relative;
    min-height: 5px;
}

.bar-value {
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-dark);
}

.bar-label {
    margin-top: 10px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-dark);
    text-align: center;
}

/* ===== HISTORY ===== */
.history-list h3 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.history-list h3 i {
    color: var(--primary-pink);
}

.history-items {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 250px;
    overflow-y: auto;
}

.history-item {
    background: var(--cream-yellow);
    border-radius: 15px;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: transform 0.3s ease;
}

.history-item:hover {
    transform: translateX(5px);
}

.history-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.history-icon {
    font-size: 1.8rem;
}

.history-details {
    display: flex;
    flex-direction: column;
}

.history-theme {
    font-weight: 700;
    color: var(--text-dark);
}

.history-date {
    font-size: 0.8rem;
    color: var(--text-light);
}

.history-score {
    font-size: 1.5rem;
    font-weight: 900;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--cream-yellow);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-pink);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-pink-dark);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .main-title {
        font-size: 2rem;
    }

    .bounce-text {
        font-size: 3.5rem;
    }

    .theme-cards {
        grid-template-columns: repeat(2, 1fr);
    }

    .answers-container {
        grid-template-columns: 1fr;
    }

    .result-stats {
        flex-direction: column;
        gap: 15px;
    }

    .stat-item {
        padding: 15px 20px;
    }

    .score-circle {
        width: 160px;
        height: 160px;
    }

    .score-number {
        font-size: 3rem;
    }

    .chart {
        height: 150px;
    }

    .result-buttons {
        flex-direction: column;
    }

    .result-buttons button {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .welcome-content,
    .result-content {
        padding: 30px 20px;
    }

    .theme-cards {
        grid-template-columns: 1fr;
    }

    .jilid-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .quiz-info {
        flex-direction: column;
        align-items: flex-start;
    }

    .question-text {
        font-size: 1.2rem;
    }

    .question-visual {
        font-size: 3.5rem;
    }
}

/* ===== ADMIN LINK ===== */
.admin-link {
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 50px;
    height: 50px;
    background: var(--gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.3rem;
    box-shadow: 0 4px 15px rgba(254, 158, 199, 0.4);
    transition: all 0.3s ease;
    z-index: 100;
    text-decoration: none;
    opacity: 0.7;
}

.admin-link:hover {
    transform: scale(1.1) rotate(90deg);
    opacity: 1;
    box-shadow: 0 6px 20px rgba(254, 158, 199, 0.6);
}

.admin-link:active {
    transform: scale(0.95) rotate(90deg);
}

/* ===== EXIT BUTTON ===== */
.exit-btn {
    position: absolute;
    top: 15px;
    left: 15px;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: linear-gradient(135deg, #FFB6C1, #FE9EC7);
    border: 3px solid white;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(254, 158, 199, 0.3);
    transition: all 0.3s ease;
    z-index: 10;
}

.exit-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(254, 158, 199, 0.5);
    background: linear-gradient(135deg, #FF8FAB, #FD7EB3);
}

.exit-btn:active {
    transform: scale(0.95);
}

/* ===== MODAL ===== */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 25px;
    padding: 30px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(254, 158, 199, 0.3);
    animation: slideUp 0.3s ease;
    border: 4px solid #FE9EC7;
}

.exit-modal {
    background: linear-gradient(135deg, #FFF5F7, #FFFFFF);
}

.modal-emoji {
    font-size: 4rem;
    margin-bottom: 15px;
    animation: bounce 1s ease infinite;
}

.exit-modal h3 {
    color: #FE9EC7;
    font-size: 1.5rem;
    margin-bottom: 10px;
    font-weight: 800;
}

.exit-modal p {
    color: #666;
    font-size: 1rem;
    margin-bottom: 25px;
    line-height: 1.5;
}

/* Logout modal style */
.logout-modal {
    background: linear-gradient(135deg, #FFF5F5, #FFFFFF);
}

.logout-modal h3 {
    color: #FF6B6B;
    font-size: 1.6rem;
    margin-bottom: 10px;
    font-weight: 800;
}

.logout-modal p {
    color: #666;
    font-size: 1rem;
    margin-bottom: 25px;
    line-height: 1.5;
}

.modal-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.btn-modal {
    padding: 12px 25px;
    border-radius: 15px;
    border: none;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    min-width: 120px;
    justify-content: center;
}

.btn-modal-secondary {
    background: #f0f0f0;
    color: #666;
}

.btn-modal-secondary:hover {
    background: #e0e0e0;
    transform: translateY(-2px);
}

.btn-modal-danger {
    background: linear-gradient(135deg, #FE9EC7, #FD7EB3);
    color: white;
}

.btn-modal-danger:hover {
    background: linear-gradient(135deg, #FD7EB3, #FC6CB9);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(254, 158, 199, 0.4);
}

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

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

/* ===== LOADING ANIMATION ===== */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== MOBILE RESPONSIVE ===== */
@media (max-width: 768px) {
    /* General */
    body {
        font-size: 14px;
    }

    /* Welcome Screen */
    .welcome-content {
        max-width: 95%;
        padding: 20px 15px;
    }

    .main-title {
        font-size: 2rem !important;
    }

    .subtitle {
        font-size: 1rem !important;
    }

    .name-input {
        font-size: 16px !important; /* Prevent zoom on iOS */
        padding: 15px 20px !important;
    }

    .name-suggestions {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .suggestion-btn {
        font-size: 0.9rem;
        padding: 10px 8px;
    }

    /* Theme Screen */
    .theme-header h2 {
        font-size: 1.8rem !important;
    }

    .theme-header p {
        font-size: 1rem !important;
    }

    .name-highlight {
        font-size: 0.9em;
    }

    .theme-cards {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        gap: 15px;
    }

    .theme-card {
        padding: 20px 15px;
        min-height: 160px;
    }

    .theme-card h3 {
        font-size: 1.2rem !important;
    }

    .theme-card p {
        font-size: 0.9rem !important;
    }

    /* Jilid Screen */
    .jilid-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .jilid-card {
        padding: 20px 15px;
        min-height: 120px;
    }

    .jilid-number {
        font-size: 2rem !important;
    }

    /* Quiz Screen */
    .quiz-header {
        padding: 15px 15px;
        padding-left: 60px;
    }

    .exit-btn {
        width: 40px;
        height: 40px;
        top: 10px;
        left: 10px;
        font-size: 1rem;
    }

    .quiz-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        margin-bottom: 10px;
    }

    .player-name,
    .theme-badge {
        font-size: 0.85rem;
        padding: 6px 12px;
    }

    .progress-container {
        width: 100%;
    }

    .progress-info {
        justify-content: space-between;
        font-size: 0.85rem;
    }

    .question-header {
        justify-content: center;
        padding: 10px 15px;
    }

    .speak-btn {
        width: 45px;
        height: 45px;
        font-size: 1.1rem;
    }

    .question-visual {
        font-size: 4rem !important;
        min-height: 100px;
    }

    .question-visual-image img {
        max-height: 150px;
    }

    .question-text {
        font-size: 1.1rem !important;
        padding: 15px;
    }

    .answers-container {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    .answer-btn {
        width: 100%;
        padding: 15px 20px;
        font-size: 1rem;
    }

    .answer-letter {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }

    .btn-next {
        padding: 15px 30px;
        font-size: 1rem;
    }

    /* Result Screen */
    .result-content {
        max-width: 95%;
        padding: 30px 20px;
    }

    .result-animation {
        font-size: 3rem !important;
    }

    .result-title {
        font-size: 1.8rem !important;
    }

    .score-circle {
        width: 180px !important;
        height: 180px !important;
    }

    .final-score {
        font-size: 2.5rem !important;
    }

    /* Report Screen */
    .report-content {
        max-width: 95%;
        padding: 30px 20px;
    }

    .summary-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .summary-card {
        padding: 15px;
        min-height: 100px;
    }

    .summary-card i {
        font-size: 1.8rem;
    }

    .summary-label {
        font-size: 0.8rem;
    }

    .summary-value {
        font-size: 1.3rem;
    }

    /* Buttons */
    .btn-primary,
    .btn-secondary {
        width: 100%;
        padding: 15px 20px;
        font-size: 1rem;
        min-height: 50px;
    }

    .result-buttons {
        flex-direction: column;
        gap: 12px;
    }

    /* Modal */
    .modal-content {
        max-width: 90%;
        padding: 25px 20px;
    }

    .modal-emoji {
        font-size: 3rem;
    }

    .modal-buttons {
        flex-direction: column;
        gap: 10px;
    }

    .btn-modal {
        width: 100%;
        min-height: 50px;
    }

    /* Admin link */
    .admin-link {
        width: 45px;
        height: 45px;
        bottom: 15px;
        left: 15px;
        font-size: 1.1rem;
    }

    /* Floating elements */
    .floating-elements {
        display: none; /* Hide on mobile for better performance */
    }

    /* Reports Screen */
    .reports-container {
        padding: 15px;
    }

    .reports-header h2 {
        font-size: 1.5rem !important;
    }

    .back-btn-small {
        padding: 8px 15px;
        font-size: 0.85rem;
    }

    .reports-summary {
        gap: 10px;
        margin-bottom: 20px;
    }

    .summary-card-small {
        padding: 15px;
        min-width: 100px;
        flex: 1;
    }

    .summary-card-small i {
        font-size: 1.5rem;
    }

    .summary-count {
        font-size: 1.4rem !important;
    }

    .summary-label-small {
        font-size: 0.75rem !important;
    }

    .player-rank-card {
        padding: 12px 15px;
        gap: 10px;
    }

    .rank-trophy,
    .rank-medal {
        font-size: 1.8rem !important;
        min-width: 40px !important;
    }

    .rank-number {
        font-size: 1.8rem !important;
        min-width: 40px !important;
    }

    .player-avatar {
        width: 45px !important;
        height: 45px !important;
        font-size: 1.2rem !important;
    }

    .player-name-text {
        font-size: 1rem !important;
    }

    .player-score-badge {
        font-size: 0.9rem !important;
    }

    .total-quizzes-badge {
        font-size: 0.8rem !important;
    }

    .player-stat i {
        font-size: 0.8rem !important;
    }
}

/* Extra Small Mobile */
@media (max-width: 380px) {
    .theme-cards {
        grid-template-columns: repeat(2, 1fr);
    }

    .theme-card {
        min-height: 140px;
        padding: 15px 10px;
    }

    .theme-card h3 {
        font-size: 1rem !important;
    }

    .theme-card p {
        font-size: 0.8rem !important;
    }

    .jilid-cards {
        grid-template-columns: 1fr;
    }

    .question-text {
        font-size: 1rem !important;
    }
}

/* Landscape Mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .welcome-content,
    .result-content,
    .report-content {
        padding: 15px;
    }

    .main-title {
        font-size: 1.5rem !important;
    }

    .theme-header h2 {
        font-size: 1.3rem !important;
    }

    .quiz-header {
        padding: 10px 15px;
        padding-left: 55px;
    }

    .exit-btn {
        width: 35px;
        height: 35px;
        top: 8px;
        left: 8px;
        font-size: 0.9rem;
    }

    .theme-cards {
        grid-template-columns: repeat(3, 1fr);
    }

    .theme-card {
        min-height: 130px;
        padding: 15px 10px;
    }

    .answer-btn {
        padding: 12px 15px;
        font-size: 0.9rem;
    }
}

/* ===== SVG GRADIENT ===== */
.svg-defs {
    position: absolute;
    width: 0;
    height: 0;
}
