* { box-sizing: border-box; margin: 0; padding: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
body { background: #f2f5f9; color: #1e293b; padding: 16px; font-size: 15px; }
.container { max-width: 480px; margin: 0 auto; }
h1, h2, h3 { margin-bottom: 12px; }
h1 { font-size: 22px; }
h2 { font-size: 18px; }
.card { background: #fff; border-radius: 12px; padding: 16px; margin-bottom: 14px; box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.btn { display: block; width: 100%; padding: 12px; border: none; border-radius: 10px; background: #2563eb; color: #fff; font-size: 16px; font-weight: 600; cursor: pointer; text-align: center; text-decoration: none; margin-bottom: 8px; }
.btn:active { opacity: .85; }
.btn-secondary { background: #64748b; }
.btn-danger { background: #dc2626; }
.btn-success { background: #16a34a; }
.btn-small { padding: 8px; font-size: 14px; }
input, textarea, select { width: 100%; padding: 10px; border: 1px solid #cbd5e1; border-radius: 8px; font-size: 15px; margin-bottom: 10px; }
label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.option { display: flex; align-items: center; gap: 8px; background: #f8fafc; border: 1px solid #e2e8f0; padding: 12px; border-radius: 10px; margin-bottom: 8px; cursor: pointer; }
.option input { width: auto; margin: 0; }
.option.selected { background: #dbeafe; border-color: #2563eb; }
.timer { position: sticky; top: 0; background: #2563eb; color: white; padding: 10px; text-align: center; font-size: 18px; font-weight: 700; border-radius: 8px; margin-bottom: 12px; z-index: 10; }
.timer.warning { background: #dc2626; animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .6; } }
.badge { display: inline-block; padding: 3px 8px; border-radius: 6px; font-size: 12px; font-weight: 600; }
.badge-open { background: #dcfce7; color: #166534; }
.badge-closed { background: #fee2e2; color: #991b1b; }
.badge-wait { background: #fef9c3; color: #854d0e; }
.rank-list { list-style: none; }
.rank-list li { display: flex; justify-content: space-between; padding: 10px; border-bottom: 1px solid #e2e8f0; }
.rank-list li:last-child { border: none; }
.rank-1 { background: #fef9c3; font-weight: 700; }
.rank-2 { background: #f1f5f9; }
.rank-3 { background: #fed7aa; }
.nav { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.nav a { flex: 1; text-align: center; padding: 10px; background: #fff; border-radius: 8px; text-decoration: none; color: #2563eb; font-weight: 600; font-size: 13px; box-shadow: 0 1px 4px rgba(0,0,0,0.05); }
.alert { padding: 10px; border-radius: 8px; margin-bottom: 12px; font-size: 14px; }
.alert-error { background: #fee2e2; color: #991b1b; }
.alert-success { background: #dcfce7; color: #166534; }
.alert-info { background: #dbeafe; color: #1e40af; }
.banner {
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 60%, #16a34a 100%);
    color: #fff;
    padding: 14px 16px;
    border-radius: 12px;
    text-align: center;
    margin-bottom: 14px;
    box-shadow: 0 2px 10px rgba(37,99,235,0.25);
}
.banner h1 {
    font-size: 17px;
    font-weight: 800;
    letter-spacing: 0.5px;
    margin: 0;
    text-shadow: 0 1px 2px rgba(0,0,0,0.15);
}
.banner p {
    font-size: 11px;
    opacity: 0.9;
    margin-top: 3px;
    letter-spacing: 0.3px;
}
/* ===== List peringkat dengan scroll internal ===== */
.rank-list.scrollable {
    max-height: 340px;
    overflow-y: auto;
    padding-right: 4px;
    -webkit-overflow-scrolling: touch;
}
.rank-list.scrollable::-webkit-scrollbar {
    width: 6px;
}
.rank-list.scrollable::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}
.rank-list.scrollable::-webkit-scrollbar-track {
    background: transparent;
}

/* Petunjuk kecil di bawah list */
.scroll-hint {
    font-size: 11px;
    color: #94a3b8;
    text-align: center;
    margin-top: 6px;
    font-style: italic;
}
/* ===== Collapse item (peringkat per kuis) ===== */
.collapse-item {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    margin-bottom: 8px;
    overflow: hidden;
    background: #fff;
}
.collapse-item:last-child { margin-bottom: 0; }

.collapse-toggle {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    background: #f8fafc;
    border: none;
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
    transition: background .15s;
}
.collapse-toggle:active { background: #e2e8f0; }
.collapse-toggle.open { background: #dbeafe; color: #1e40af; }

.collapse-toggle .chevron {
    display: inline-block;
    transition: transform .2s;
    font-size: 12px;
    color: #64748b;
}
.collapse-toggle.open .chevron {
    transform: rotate(180deg);
    color: #2563eb;
}

.collapse-body {
    padding: 10px 12px 12px;
    border-top: 1px solid #e2e8f0;
    background: #fff;
}
.collapse-body .rank-list {
    margin: 0;
}
.collapse-body .scroll-hint {
    font-size: 11px;
    color: #94a3b8;
    text-align: center;
    margin-top: 6px;
    font-style: italic;
}

/* Scroll internal peringkat */
.rank-list.scrollable {
    max-height: 300px;
    overflow-y: auto;
    padding-right: 4px;
}
.rank-list.scrollable::-webkit-scrollbar { width: 6px; }
.rank-list.scrollable::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}