

:root {
    --navy: #102a55;
    --navy-light: #1e4d8f;
    --navy-dark: #07162e;
    --primary: #ff6b6b;
    --accent-blue: #4ecdc4;
    --accent-yellow: #ffd93d;
    --accent-pink: #ff85a2;
    --accent-purple: #8b5cf6;
    --success: #22c55e;
    --danger: #ef4444;
    --warning: #f59e0b;
    --text-dark: #102a55;
    --text-light: #ffffff;
    --bg-light: #f5f8fb;
    --glass: rgba(255, 255, 255, .14);
    --glass-border: rgba(255, 255, 255, .26);
    --shadow: 0 18px 45px rgba(3, 10, 30, .22);
    --shadow-lg: 0 25px 80px rgba(3, 10, 30, .34);
}

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

html, body {
    width: 100%;
    min-height: 100%;
    overflow-x: hidden;
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text-dark);
    line-height: 1.6;
    min-height: 100vh;
    background:
        radial-gradient(circle at 15% 12%, rgba(255, 217, 61, .25), transparent 25%),
        radial-gradient(circle at 85% 18%, rgba(78, 205, 196, .22), transparent 26%),
        radial-gradient(circle at 50% 90%, rgba(255, 107, 107, .18), transparent 28%),
        linear-gradient(135deg, #061329 0%, #102a55 48%, #1e4d8f 100%);
    position: relative;
}

body::before,
body::after {
    content: "";
    position: fixed;
    width: 360px;
    height: 360px;
    border-radius: 50%;
    filter: blur(12px);
    opacity: .35;
    z-index: -2;
    animation: orbMove 9s ease-in-out infinite alternate;
}

body::before {
    background: #4ecdc4;
    left: -120px;
    top: 120px;
}

body::after {
    background: #ff6b6b;
    right: -130px;
    bottom: 70px;
    animation-delay: -3s;
}

@keyframes orbMove {
    from { transform: translate(0, 0) scale(1); }
    to { transform: translate(80px, -70px) scale(1.18); }
}

@keyframes slideInDown {
    from { opacity: 0; transform: translateY(-35px); }
    to { opacity: 1; transform: translateY(0); }
}

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

@keyframes scaleIn {
    from { opacity: 0; transform: scale(.85); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(-1deg); }
    50% { transform: translateY(-14px) rotate(1deg); }
}

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

@keyframes glowPulse {
    0%, 100% { box-shadow: 0 0 0 rgba(255, 217, 61, .1), var(--shadow); }
    50% { box-shadow: 0 0 35px rgba(255, 217, 61, .55), var(--shadow-lg); }
}

@keyframes rainbowBorder {
    0% { border-color: #4ecdc4; }
    25% { border-color: #ffd93d; }
    50% { border-color: #ff6b6b; }
    75% { border-color: #8b5cf6; }
    100% { border-color: #4ecdc4; }
}

@keyframes shine {
    from { transform: translateX(-120%) rotate(18deg); }
    to { transform: translateX(160%) rotate(18deg); }
}

@keyframes wiggle {
    0%, 100% { transform: rotate(0); }
    25% { transform: rotate(-2deg); }
    75% { transform: rotate(2deg); }
}

@keyframes timerDanger {
    0%, 100% { transform: scale(1); color: #fff; }
    50% { transform: scale(1.08); color: #ffd93d; }
}

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

.container {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 18px;
}

.page-wrapper {
    min-height: calc(100vh - 86px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 34px 0;
    animation: scaleIn .55s ease both;
}

header {
    background: rgba(7, 22, 46, .72);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(255, 255, 255, .2);
    box-shadow: 0 12px 35px rgba(0, 0, 0, .18);
    position: sticky;
    top: 0;
    z-index: 100;
    animation: slideInDown .6s ease both;
}

.header-content {
    max-width: 1180px;
    margin: 0 auto;
    min-height: 78px;
    padding: 0 20px;
    display: flex;
    gap: 16px;
    align-items: center;
    justify-content: space-between;
}

.logo {
    color: white;
    font-size: 24px;
    font-weight: 900;
    letter-spacing: .3px;
    display: flex;
    align-items: center;
    gap: 12px;
    text-shadow: 0 8px 24px rgba(0,0,0,.25);
}


.card,
.form-wrapper,
.result-card,
.leaderboard-card,
.question-card {
    background: rgba(255, 255, 255, .94);
    border: 1px solid rgba(255, 255, 255, .58);
    border-radius: 28px;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
    animation: slideInUp .7s ease both;
}

.card::before,
.form-wrapper::before,
.result-card::before,
.leaderboard-card::before,
.question-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 -45%;
    width: 35%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.55), transparent);
    pointer-events: none;
    animation: shine 4.8s ease-in-out infinite;
}

.card {
    padding: 32px;
}

.card:hover,
.form-wrapper:hover,
.result-card:hover,
.leaderboard-card:hover,
.question-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
}

.card-header {
    text-align: center;
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 3px dashed rgba(78, 205, 196, .65);
}

.card-header h2 {
    font-size: clamp(28px, 4vw, 44px);
    color: var(--navy);
    font-weight: 900;
    line-height: 1.12;
}

.card-header p {
    margin-top: 8px;
    color: #52627a;
    font-size: 16px;
}

.home-wrapper {
    min-height: calc(100vh - 78px);
    padding: 28px 20px 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.home-content {
    width: 100%;
    max-width: 1050px;
    display: grid;
    grid-template-columns: .95fr 1.05fr;
    gap: 34px;
    align-items: center;
}

.home-illustration {
    min-height: 380px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: float 3s ease-in-out infinite;
}

.home-illustration svg {
    max-width: 100%;
    height: auto;
    filter: drop-shadow(0 22px 30px rgba(0,0,0,.25));
}

.form-wrapper {
    padding: 38px;
    border-top: 8px solid var(--accent-yellow);
}

.form-wrapper h1 {
    font-size: clamp(30px, 4vw, 44px);
    color: var(--navy);
    font-weight: 900;
    margin-bottom: 8px;
}

.form-wrapper p {
    color: #52627a;
    margin-bottom: 24px;
}

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    font-weight: 800;
    color: var(--navy);
    margin-bottom: 8px;
}

input[type="text"],
input[type="email"],
input[type="number"],
input[type="password"],
input[type="date"],
select,
textarea {
    width: 100%;
    padding: 15px 16px;
    border: 2px solid #d9e6f2;
    border-radius: 16px;
    background: #f8fbff;
    font-size: 16px;
    outline: none;
    font-family: inherit;
    transition: .22s ease;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--accent-blue);
    background: #fff;
    box-shadow: 0 0 0 5px rgba(78, 205, 196, .16);
    transform: translateY(-2px);
}

button, .btn {
    border: 0;
    border-radius: 18px;
    padding: 13px 22px;
    font-size: 15px;
    font-weight: 900;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    color: white;
    font-family: inherit;
    box-shadow: var(--shadow);
    transition: .22s ease;
    position: relative;
    overflow: hidden;
}

button::after, .btn::after {
    content: "";
    position: absolute;
    width: 42px;
    height: 130%;
    top: -15%;
    left: -60px;
    background: rgba(255,255,255,.38);
    transform: rotate(18deg);
    transition: .35s ease;
}

button:hover::after, .btn:hover::after {
    left: calc(100% + 30px);
}

button:hover, .btn:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: var(--shadow-lg);
}

.btn-primary {
    background: linear-gradient(135deg, #ff6b6b, #ff3d7f);
}

.btn-success {
    background: linear-gradient(135deg, #22c55e, #14b8a6);
}

.btn-blue {
    background: linear-gradient(135deg, #4ecdc4, #2563eb);
}

.btn-yellow {
    background: linear-gradient(135deg, #ffd93d, #ff9f1c);
    color: #102a55;
}

.btn-secondary {
    background: linear-gradient(135deg, #64748b, #334155);
}

.rules-section {
    margin: 24px 0;
    padding: 24px;
    border-radius: 24px;
    background:
        linear-gradient(135deg, rgba(255, 249, 230, .98), rgba(255,255,255,.95));
    border: 2px solid rgba(255, 217, 61, .45);
    border-left: 9px solid var(--accent-yellow);
    box-shadow: 0 18px 40px rgba(255, 217, 61, .12);
    animation: glowPulse 3s ease-in-out infinite;
}

.rules-section h3 {
    color: var(--navy);
    font-size: 24px;
    margin-bottom: 12px;
    font-weight: 900;
}

.rules-section ol {
    margin-left: 22px;
}

.rules-section li {
    margin: 9px 0;
    color: var(--text-dark);
}

.menu-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
    margin: 30px 0 4px;
}

.menu-item {
    min-height: 260px;
    padding: 30px 24px;
    border-radius: 30px;
    text-align: center;
    text-decoration: none;
    color: var(--text-dark);
    background:
        radial-gradient(circle at 30% 20%, rgba(255,255,255,.85), transparent 32%),
        linear-gradient(135deg, #ffffff, #eef8ff);
    box-shadow: var(--shadow);
    border: 3px solid transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    animation: slideInUp .7s ease both, rainbowBorder 5s linear infinite;
    position: relative;
    overflow: hidden;
}

.menu-item:nth-child(1) { animation-delay: .05s; }
.menu-item:nth-child(2) { animation-delay: .16s; }
.menu-item:nth-child(3) { animation-delay: .27s; }

.menu-item::before {
    content: "";
    position: absolute;
    width: 160px;
    height: 160px;
    right: -60px;
    top: -60px;
    border-radius: 50%;
    background: rgba(78,205,196,.18);
    transition: .25s ease;
}

.menu-item:hover::before {
    transform: scale(1.8);
}

.menu-item:hover {
    transform: translateY(-14px) scale(1.035) rotate(-1deg);
    background: linear-gradient(135deg, #ffffff, #fff8d5);
}

.menu-item div:first-child,
.latihan-icon {
    animation: bounceSoft 2s ease-in-out infinite;
    filter: drop-shadow(0 10px 10px rgba(0,0,0,.18));
}

.menu-item h3 {
    color: var(--navy);
    font-size: 28px;
    font-weight: 900;
}

.menu-item p {
    color: #52627a;
}

.latihan-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
    margin-top: 26px;
}

.latihan-item {
    min-height: 210px;
    padding: 26px 20px;
    border-radius: 28px;
    cursor: pointer;
    text-align: center;
    background: linear-gradient(135deg, #fff, #f0fbff);
    box-shadow: var(--shadow);
    border: 3px solid rgba(255,255,255,.8);
    transition: .23s ease;
    animation: scaleIn .65s ease both;
}

.latihan-item:nth-child(1) { border-bottom: 8px solid var(--accent-blue); }
.latihan-item:nth-child(2) { border-bottom: 8px solid var(--accent-yellow); }
.latihan-item:nth-child(3) { border-bottom: 8px solid var(--primary); }
.latihan-item:nth-child(4) { border-bottom: 8px solid var(--accent-purple); }

.latihan-item:hover {
    transform: translateY(-12px) rotate(1deg) scale(1.03);
    box-shadow: var(--shadow-lg);
}

.latihan-icon {
    font-size: 58px;
    margin-bottom: 12px;
}

.latihan-item h3 {
    color: var(--navy);
    font-size: 22px;
    font-weight: 900;
}

.latihan-item p {
    color: #52627a;
    font-size: 14px;
}

.quiz-container {
    width: min(900px, 94vw);
    padding: 0;
}

.quiz-header {
    background:
        radial-gradient(circle at 20% 20%, rgba(255, 217, 61, .24), transparent 30%),
        linear-gradient(135deg, rgba(16,42,85,.97), rgba(30,77,143,.97));
    color: white;
    padding: 24px;
    border-radius: 28px;
    box-shadow: var(--shadow-lg);
    margin-bottom: 22px;
    border: 1px solid rgba(255,255,255,.23);
}

.quiz-info {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.info-item {
    padding: 18px 14px;
    border-radius: 22px;
    text-align: center;
    background: rgba(255, 255, 255, .13);
    border: 1px solid rgba(255,255,255,.2);
    backdrop-filter: blur(10px);
}

.info-item strong {
    display: block;
    opacity: .8;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: .6px;
}

.info-item span {
    display: block;
    margin-top: 6px;
    font-size: 26px;
    font-weight: 900;
}

.timer.warning {
    color: var(--accent-yellow);
    animation: wiggle .5s ease-in-out infinite;
}

.timer.danger {
    color: #fff;
    animation: timerDanger .55s ease-in-out infinite;
}

.progress-bar {
    margin-top: 18px;
    height: 12px;
    background: rgba(255,255,255,.18);
    border-radius: 999px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, var(--accent-blue), var(--accent-yellow), var(--primary));
    border-radius: 999px;
    transition: width .3s ease;
}

.question-card {
    padding: 26px;
    margin-bottom: 18px;
    border-top: 7px solid var(--accent-blue);
}

.question-number {
    color: var(--accent-purple);
    font-size: 13px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .7px;
}

.question-text {
    margin: 16px 0;
    min-height: 80px;
    padding: 20px;
    border-radius: 24px;
    background:
        radial-gradient(circle at 15% 25%, rgba(78, 205, 196, .2), transparent 35%),
        linear-gradient(135deg, #eefaff, #fff8db);
    color: var(--navy);
    font-size: clamp(28px, 5vw, 46px);
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.answer-input {
    text-align: center;
    font-size: 24px !important;
    font-weight: 900;
    border-width: 3px !important;
}

.answer-input.correct {
    border-color: var(--success) !important;
    background: #ecfdf5 !important;
}

.answer-input.incorrect {
    border-color: var(--danger) !important;
    background: #fef2f2 !important;
    animation: shake .45s ease;
}

.button-group {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 18px;
}

.button-group .btn,
.button-group button {
    flex: 1;
    min-width: 160px;
}

.result-container {
    width: min(560px, 94vw);
}

.result-card {
    padding: 38px;
    text-align: center;
}

.result-icon {
    font-size: 82px;
    animation: bounceSoft 1.7s ease-in-out infinite;
}

.result-score {
    font-size: clamp(54px, 10vw, 88px);
    font-weight: 900;
    line-height: 1;
    margin: 16px 0;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-yellow), var(--primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.result-message {
    color: var(--navy);
    font-size: 25px;
    font-weight: 900;
}

.result-details {
    margin: 22px 0;
    padding: 18px;
    border-radius: 22px;
    background: #f2f7ff;
    text-align: left;
}

.result-details div {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding: 11px 0;
    border-bottom: 1px dashed #cbd5e1;
}

.result-details div:last-child {
    border-bottom: 0;
}

.result-details strong {
    color: var(--navy);
}

.leaderboard-container {
    width: min(1050px, 96vw);
}

.leaderboard-card {
    padding: 30px;
}

.leaderboard-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 22px;
}

.tab-btn {
    background: #eaf4ff;
    color: var(--navy);
    border: 2px solid #d7e6f5;
}

.tab-btn.active {
    color: white;
    background: linear-gradient(135deg, var(--accent-blue), var(--navy-light));
}

.leaderboard-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 10px;
}

.leaderboard-table thead th {
    color: white;
    background: var(--navy);
    padding: 14px;
    text-align: left;
}

.leaderboard-table thead th:first-child {
    border-radius: 16px 0 0 16px;
}

.leaderboard-table thead th:last-child {
    border-radius: 0 16px 16px 0;
}

.leaderboard-table tbody tr {
    background: #f8fbff;
    box-shadow: 0 8px 24px rgba(16,42,85,.08);
    transition: .22s ease;
}

.leaderboard-table tbody tr:hover {
    transform: translateX(7px) scale(1.01);
    background: #fff8dc;
}

.leaderboard-table td {
    padding: 14px;
}

.leaderboard-table td:first-child {
    border-radius: 16px 0 0 16px;
}

.leaderboard-table td:last-child {
    border-radius: 0 16px 16px 0;
}

.rank-badge {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    color: white;
    background: linear-gradient(135deg, #64748b, #334155);
}

.rank-badge.gold {
    color: #3a2a00;
    background: linear-gradient(135deg, #ffd700, #fff1a8);
}

.rank-badge.silver {
    color: #333;
    background: linear-gradient(135deg, #c0c0c0, #f2f2f2);
}

.rank-badge.bronze {
    background: linear-gradient(135deg, #cd7f32, #f0b070);
}

.score-badge {
    padding: 8px 13px;
    border-radius: 999px;
    font-weight: 900;
    display: inline-block;
}

.score-badge.high {
    color: #065f46;
    background: #d1fae5;
}

.score-badge.medium {
    color: #854d0e;
    background: #fef3c7;
}

.score-badge.low {
    color: #991b1b;
    background: #fee2e2;
}

.alert {
    position: fixed;
    top: 92px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 999;
    padding: 14px 20px;
    border-radius: 18px;
    color: white;
    font-weight: 800;
    box-shadow: var(--shadow-lg);
    animation: slideInDown .35s ease both;
}

.alert-success { background: var(--success); }
.alert-error { background: var(--danger); }
.alert-info { background: var(--accent-blue); }

.text-center { text-align: center; }
.text-white { color: white; }
.text-dark { color: var(--text-dark); }
.mt-20 { margin-top: 20px; }
.mb-20 { margin-bottom: 20px; }
.mt-40 { margin-top: 40px; }
.mb-40 { margin-bottom: 40px; }
.hidden { display: none !important; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-10 { gap: 10px; }
.gap-20 { gap: 20px; }
.rounded { border-radius: 14px; }
.shadow { box-shadow: var(--shadow); }
.shadow-lg { box-shadow: var(--shadow-lg); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #e9f3ff; }
::-webkit-scrollbar-thumb {
    background: linear-gradient(var(--accent-blue), var(--navy-light));
    border-radius: 999px;
}

@media (max-width: 900px) {
    .home-content {
        grid-template-columns: 1fr;
    }

    .home-illustration {
        min-height: 240px;
        order: 2;
    }

    .menu-grid {
        grid-template-columns: 1fr;
    }

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

    .quiz-info {
        grid-template-columns: 1fr;
    }

    .page-wrapper {
        align-items: flex-start;
    }
}

@media (max-width: 620px) {
    .header-content {
        flex-direction: column;
        padding: 14px;
    }

    .logo {
        font-size: 20px;
    }

    .form-wrapper,
    .card,
    .leaderboard-card,
    .result-card {
        padding: 22px;
        border-radius: 24px;
    }

    .latihan-grid {
        grid-template-columns: 1fr;
    }

    .leaderboard-card {
        overflow-x: auto;
    }

    .leaderboard-table {
        min-width: 760px;
    }

    .button-group {
        flex-direction: column;
    }

    .button-group .btn,
    .button-group button {
        width: 100%;
    }

    .rules-section {
        padding: 18px;
    }
}


.logo {
    color: white;
    font-size: 24px;
    font-weight: 900;
    letter-spacing: .3px;
    display: flex;
    align-items: center;
    gap: 12px;
    text-shadow: 0 8px 24px rgba(0,0,0,.25);
}

.logo-img {
    width: 50px;
    height: 50px;
    border-radius: 14px;
    object-fit: cover;
    flex-shrink: 0;
    display: block;
    box-shadow: 0 8px 20px rgba(0,0,0,.25);
}

.logo-text {
    display: block;
    line-height: 1;
    color: white;
}
