/* Modern civic design layer — loaded after the legacy stylesheet. */
:root {
    color-scheme: light;
    --bg-dark: #f4f7fb;
    --bg-card: #ffffff;
    --surface: #ffffff;
    --surface-soft: #f8fafc;
    --surface-muted: #eef3f8;
    --primary-color: #0756a3;
    --primary-hover: #064783;
    --primary-gradient: linear-gradient(135deg, #0756a3 0%, #0c75c7 100%);
    --accent-color: #0b72b9;
    --accent-gradient: linear-gradient(135deg, #0756a3, #168bd2);
    --secondary-gradient: linear-gradient(135deg, #e8f1fa, #f5f9fd);
    --text-primary: #142033;
    --text-secondary: #526176;
    --text-accent: #0756a3;
    --text-color: #142033;
    --border-color: #dce4ed;
    --border-highlight: #91bce1;
    --success-color: #178247;
    --warning-color: #a66305;
    --danger-color: #c73737;
    --focus-ring: 0 0 0 3px rgba(11, 114, 185, .22);
    --shadow-sm: 0 1px 3px rgba(15, 35, 60, .08);
    --shadow-md: 0 12px 32px rgba(15, 35, 60, .1);
    --shadow-lg: 0 24px 60px rgba(15, 35, 60, .14);
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 22px;
    --transition-smooth: 180ms ease;
    --glow-shadow: none;
}

html { scroll-behavior: smooth; }

body {
    background: #f4f7fb;
    color: var(--text-primary);
    font-size: 16px;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -2;
    background:
        radial-gradient(circle at 8% 4%, rgba(30, 126, 197, .08), transparent 24rem),
        radial-gradient(circle at 92% 20%, rgba(20, 107, 178, .07), transparent 26rem),
        #f4f7fb;
}

.bg-glow { display: none; }

.skip-link {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 9999;
    transform: translateY(-160%);
    padding: 10px 16px;
    border-radius: 8px;
    background: #fff;
    color: var(--primary-color);
    box-shadow: var(--shadow-md);
    font-weight: 700;
}

.skip-link:focus { transform: translateY(0); }

:where(a, button, input, select, textarea, [tabindex]):focus-visible {
    outline: 2px solid transparent;
    box-shadow: var(--focus-ring) !important;
}

.site-header-banner {
    min-height: 160px;
    border: 0;
    background-color: #063e78;
    background-size: cover;
    background-position: center;
    position: relative;
}

.site-header-banner::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(3, 40, 78, .88), rgba(4, 69, 126, .56));
}

.site-header-banner .banner-content {
    position: relative;
    z-index: 1;
    width: min(1180px, calc(100% - 40px));
    margin-inline: auto;
    padding: 32px 0;
    text-align: left;
}

.banner-title {
    max-width: 850px;
    color: #fff;
    font-size: clamp(1.45rem, 3vw, 2.25rem);
    line-height: 1.25;
    letter-spacing: -.02em;
    text-shadow: 0 2px 12px rgba(0, 0, 0, .25);
}

.banner-subtitle {
    margin-top: 10px;
    color: #d9ecff;
    font-size: clamp(.9rem, 1.5vw, 1.05rem);
    font-weight: 650;
    letter-spacing: .04em;
}

.app-header {
    min-height: 72px;
    padding: 10px max(24px, calc((100% - 1180px) / 2));
    background: rgba(255, 255, 255, .96);
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 4px 16px rgba(15, 35, 60, .05);
    backdrop-filter: blur(14px);
}

.logo { gap: 12px; color: var(--text-primary); }
.header-icon {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: #e6f1fb;
    color: var(--primary-color);
    filter: none;
}

.logo-copy { display: flex; flex-direction: column; line-height: 1.15; }
.logo-copy strong { color: #063e78; font-size: .95rem; letter-spacing: .04em; }
.logo-copy small { margin-top: 4px; color: var(--text-secondary); font-size: .72rem; font-weight: 500; }
.nav-menu { gap: 4px; }
.nav-link {
    min-height: 42px;
    padding: 9px 12px;
    border-radius: 9px;
    color: #445268;
    font-size: .9rem;
    font-weight: 600;
}
.nav-link:hover { color: var(--primary-color); background: #f0f6fc; border-color: transparent; }
.nav-link.active { color: #0756a3; background: #e5f1fb; border-color: #c7def2; }
.nav-toggle {
    display: none;
    width: 44px;
    height: 44px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: #fff;
    color: var(--primary-color);
    cursor: pointer;
}

.main-content { align-items: center; padding: 38px 24px 64px; }
.view-section { max-width: 1180px; animation: modernFade .25s ease both; }
@keyframes modernFade { from { opacity: 0; transform: translateY(5px); } }

.glass-card,
.hero-card,
.info-card,
.login-card,
.quiz-main,
.quiz-sidebar,
.leaderboard-container,
.admin-container,
.admin-dashboard-container {
    background: #fff;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    backdrop-filter: none;
}

.glass-card { border-radius: var(--radius-lg); padding: clamp(22px, 4vw, 38px); }
.glass-card:hover { border-color: var(--border-color); }
.hero-card {
    overflow: hidden;
    padding: clamp(24px, 5vw, 48px);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.intro-topics-banner {
    overflow: hidden;
    border: 1px solid #cfe0f0 !important;
    border-radius: 16px !important;
    background: #f6faff !important;
    box-shadow: none !important;
}
.banner-header { background: #e5f1fb !important; color: #0756a3 !important; }
.topic-tag { background: #fff !important; color: #26435e !important; border-color: #cfe0f0 !important; }
.banner-footer { color: var(--text-secondary) !important; border-color: #dce7f1 !important; }

.countdown-label { color: var(--text-secondary); font-weight: 600; }
.countdown-timer { gap: clamp(8px, 2vw, 16px); }
.time-box {
    min-width: 88px;
    padding: 15px 12px;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    background: var(--surface-soft);
    box-shadow: none;
}
.time-box > span:first-child { color: #0756a3; font-variant-numeric: tabular-nums; }
.time-label { color: var(--text-secondary); }

.btn {
    min-height: 44px;
    padding: 10px 18px;
    border-radius: 10px;
    font-size: .94rem;
    box-shadow: none;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--primary-gradient); box-shadow: 0 5px 14px rgba(7, 86, 163, .18); }
.btn-primary:hover { background: linear-gradient(135deg, #064783, #0969ad); box-shadow: 0 8px 18px rgba(7, 86, 163, .23); }
.btn-secondary { background: #f3f6f9; color: #314259; border: 1px solid #d6e0e9; }
.btn-secondary:hover { background: #e9eff5; color: #17263a; border-color: #c5d2dd; }
.btn-success { background: #178247; color: #fff; }
.btn-danger { background: #c73737; color: #fff; }
.btn-large { min-height: 52px; padding: 13px 25px; }
.btn-small { min-height: 38px; padding: 8px 13px; }
#btn-bypass-countdown { display: none !important; }

.info-grid { gap: 18px; margin-top: 22px; }
.info-card { border-radius: 16px; padding: 26px; text-align: left; transition: transform .18s ease, box-shadow .18s ease; }
.info-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: #c7d5e1; }
.info-icon {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    margin: 0 0 18px;
    border-radius: 12px;
    background: #e5f1fb;
    color: var(--primary-color);
    font-size: 1.15rem;
    filter: none;
}
.info-card h3 { color: #18283d; font-size: 1.08rem; }
.info-card p { color: var(--text-secondary); font-size: .94rem; }

.page-content-title,
.section-title,
.leaderboard-title { color: #142033; letter-spacing: -.02em; }
.page-content-title::after { background: var(--primary-color); }
.page-content-body,
.ql-editor { color: #25364b; }
.ql-editor a { color: #0756a3; }

.login-card { max-width: 760px; margin-inline: auto; border-radius: var(--radius-lg); box-shadow: var(--shadow-md); }
.form-group label { color: #26374d; font-weight: 650; }
.form-group input,
.form-group select,
.form-group textarea,
.form-input,
input[type="text"], input[type="password"], input[type="number"], input[type="tel"], select, textarea {
    min-height: 46px;
    border: 1px solid #ccd7e2 !important;
    border-radius: 10px !important;
    background: #fff !important;
    color: #142033 !important;
    transition: border-color .18s ease, box-shadow .18s ease;
}
.form-group textarea, textarea { min-height: 96px; }
.form-group input::placeholder, .form-input::placeholder, textarea::placeholder { color: #8996a7; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus, .form-input:focus {
    border-color: #4f94ce !important;
    outline: none;
    box-shadow: var(--focus-ring) !important;
}
.field-error { margin-top: 6px; color: var(--danger-color); font-size: .82rem; font-weight: 600; }
.is-invalid { border-color: var(--danger-color) !important; }

.alert-box { border-radius: 12px; }
.alert-warning { color: #765015; background: #fff8e8 !important; border-color: #eed6a5 !important; }

.quiz-layout { gap: 22px; align-items: start; }
.quiz-main, .quiz-sidebar { border-radius: 18px; box-shadow: var(--shadow-sm); }
.quiz-header { border-color: var(--border-color); }
.quiz-timer { color: #9b3a1f; background: #fff1eb; border: 1px solid #f0cabb; border-radius: 10px; }
.progress-bar-container { background: #e5ebf1; }
.progress-bar-fill { background: var(--primary-gradient); }
.question-title { color: #17263a; line-height: 1.55; }
.option-item {
    min-height: 58px;
    border: 1px solid #d6e0e9;
    border-radius: 12px;
    background: #fff;
    color: #26374d;
}
.option-item:hover { border-color: #7caed5; background: #f4f9fd; transform: none; }
.option-item.selected { border-color: #237ab9; background: #e9f4fc; color: #073d68; box-shadow: 0 0 0 2px rgba(35, 122, 185, .1); }
.option-letter { background: #edf2f6; color: #314259; }
.option-item.selected .option-letter { background: #0756a3; color: #fff; }
.question-grid { gap: 8px; }
.grid-btn { background: #f3f6f9; color: #425269; border-color: #d5dfe8; }
.grid-btn.current { border-color: #0756a3; color: #0756a3; background: #e5f1fb; }
.grid-btn.answered { background: #178247; border-color: #178247; color: #fff; }

.leaderboard-header, .leaderboard-controls { color: var(--text-primary); }
.leaderboard-tabs, .individual-tabs, .collective-tabs, .admin-tabs {
    padding: 5px;
    border-radius: 12px;
    background: #edf2f6;
    border: 1px solid #dfe6ed;
}
.ldb-tab-btn, .ind-tab-btn, .coll-tab-btn, .tab-link {
    min-height: 42px;
    border-radius: 8px !important;
    color: #526176 !important;
    border: 0 !important;
}
.ldb-tab-btn.active, .ind-tab-btn.active, .coll-tab-btn.active, .tab-link.active {
    background: #fff !important;
    color: #0756a3 !important;
    box-shadow: var(--shadow-sm);
}
.table-wrapper, .table-responsive { border: 1px solid var(--border-color); border-radius: 14px; background: #fff; overflow: auto; }
table { color: #23344a; background: #fff; }
thead th { position: sticky; top: 0; z-index: 1; background: #edf4fa !important; color: #26435e !important; border-color: #dce5ed !important; }
tbody td { border-color: #e7edf2 !important; }
tbody tr:hover { background: #f7fafc !important; }
.rank-badge { box-shadow: none; }

.admin-container, .admin-dashboard-container { max-width: 1180px; border-radius: var(--radius-lg); box-shadow: var(--shadow-md); }
.admin-header { border-color: var(--border-color); }
.admin-header h2 { color: #142033 !important; }
.admin-tabs { gap: 5px; overflow-x: auto; }
.tab-link { white-space: nowrap; }
.admin-section-header { border-color: var(--border-color); }
.admin-section-header h3 { color: #142033; }
.question-card-admin { background: #f8fafc; border-color: var(--border-color); color: #22334a; }
.question-toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 14px; }
.question-toolbar .btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.question-count { display: inline-grid; min-width: 24px; height: 24px; place-items: center; padding: 0 7px; margin-left: 2px; border-radius: 999px; background: rgba(255, 255, 255, .14); color: inherit; font-size: .78rem; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.btn-secondary .question-count { background: #dce9f4; color: #164d79; }
.candidate-count { display: inline-grid; min-width: 23px; height: 23px; place-items: center; padding: 0 6px; margin-left: 3px; border-radius: 999px; background: rgba(255, 255, 255, .2); font-size: .78rem; font-weight: 800; }
.schedule-settings-card { max-width: 680px; padding: 24px; border: 1px solid var(--border-color); border-radius: 16px; background: #f8fafc; }
.schedule-settings-card input[type="datetime-local"] { width: 100%; min-height: 48px; }
.schedule-settings-card small { display: block; margin-top: 7px; color: var(--text-secondary); }
.schedule-mode-status { margin: 18px 0; padding: 14px 16px; border-radius: 11px; background: #eaf3fb; color: #174f7d; font-weight: 600; }
.schedule-mode-status.is-test { background: #fff5dc; color: #79530c; }
.question-empty-state { display: grid; justify-items: center; gap: 10px; padding: 42px 20px; border: 1px dashed #b9c8d6; border-radius: 16px; background: #f8fafc; color: #526176; text-align: center; }
.question-empty-state i { font-size: 2rem; color: #7d91a5; }
.delete-all-dialog { max-width: 590px; }
.delete-all-warning { margin: 8px 0 20px; padding: 16px; border: 1px solid #efc7c7; border-radius: 12px; background: #fff4f4; color: #7c2525; }
.delete-all-warning p { margin: 6px 0 0; color: #874444; }
.delete-all-actions { flex-wrap: wrap; }
.ql-toolbar.ql-snow { border-color: #ccd7e2 !important; background: #f6f8fa; }
.ql-container.ql-snow { border-color: #ccd7e2 !important; background: #fff !important; color: #142033 !important; }
.ql-snow .ql-stroke { stroke: #43546a !important; }
.ql-snow .ql-fill { fill: #43546a !important; }

.modal-overlay { padding: 20px; background: rgba(13, 28, 47, .62); backdrop-filter: blur(4px); }
.modal-content { width: min(620px, 100%); max-height: min(86vh, 760px); overflow-y: auto; background: #fff; color: #142033; box-shadow: var(--shadow-lg); }
.modal-header { position: sticky; top: 0; z-index: 2; padding-bottom: 12px; background: #fff; }
.modal-header h3 { color: #142033 !important; }
.btn-close { color: #526176 !important; }

.site-footer-banner { margin-top: auto; background: #062f5b; color: #fff; border: 0; }
.footer-banner-container { width: min(1180px, calc(100% - 40px)); padding: 48px 0 24px; }
.footer-banner-title { color: #fff; font-size: clamp(1.1rem, 2vw, 1.45rem); }
.footer-info-grid { gap: 40px; }
.footer-info-col h3 { color: #b9daf7; }
.footer-info-col p { color: #e3effa; }
.footer-copyright { color: #bdd0e1; border-color: rgba(255, 255, 255, .15); }

.toast-region { position: fixed; right: 20px; bottom: 20px; z-index: 10000; display: grid; gap: 10px; width: min(380px, calc(100% - 40px)); }
.app-toast { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border: 1px solid var(--border-color); border-left: 4px solid #0756a3; border-radius: 12px; background: #fff; color: #24364b; box-shadow: var(--shadow-lg); animation: toastIn .2s ease both; }
.app-toast.success { border-left-color: var(--success-color); }
.app-toast.error { border-left-color: var(--danger-color); }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } }

.skeleton { position: relative; overflow: hidden; color: transparent !important; background: #e9eef3 !important; border-radius: 8px; }
.skeleton::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255,255,255,.7), transparent); animation: shimmer 1.3s infinite; }
@keyframes shimmer { to { transform: translateX(100%); } }

@media (max-width: 1024px) {
    .app-header { padding-inline: 20px; }
    .nav-toggle { display: inline-grid; place-items: center; }
    .nav-menu {
        position: absolute;
        top: calc(100% + 1px);
        left: 16px;
        right: 16px;
        display: none;
        flex-direction: column;
        gap: 3px;
        padding: 10px;
        border: 1px solid var(--border-color);
        border-radius: 0 0 14px 14px;
        background: #fff;
        box-shadow: var(--shadow-md);
    }
    .nav-menu.is-open { display: flex; }
    .nav-link { width: 100%; }
    .quiz-layout { grid-template-columns: 1fr !important; }
    .quiz-sidebar { position: static !important; width: 100% !important; }
}

@media (max-width: 768px) {
    .site-header-banner { min-height: 132px; }
    .site-header-banner .banner-content { width: min(100% - 32px, 1180px); padding: 24px 0; }
    .main-content { padding: 24px 14px 46px; }
    .hero-card, .glass-card, .login-card { border-radius: 16px; padding: 20px; }
    .info-grid { grid-template-columns: 1fr; }
    .countdown-timer { display: grid; grid-template-columns: repeat(4, 1fr); width: 100%; }
    .time-box { min-width: 0; padding: 12px 4px; }
    .time-box > span:first-child { font-size: 1.4rem; }
    .quiz-controls { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
    #btn-submit { grid-column: 1 / -1; }
    .leaderboard-tabs, .individual-tabs, .collective-tabs { display: grid; grid-template-columns: 1fr 1fr; }
    .admin-header { align-items: flex-start; }
    .admin-header-actions { width: 100%; }
    .admin-header-actions .btn { flex: 1; }
    .admin-section-header { align-items: stretch; }
    .admin-section-header > div { display: grid !important; grid-template-columns: 1fr; width: 100%; }
    .question-toolbar { display: grid; grid-template-columns: 1fr 1fr; }
    .question-toolbar .btn { width: 100%; }
    .table-wrapper, .table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    table { min-width: 720px; }
    .footer-info-grid { grid-template-columns: 1fr; gap: 24px; }
}

@media (max-width: 480px) {
    .logo-copy small { display: none; }
    .banner-title { font-size: 1.25rem; }
    .countdown-label { text-align: center; }
    .time-label { font-size: .68rem; }
    .hero-actions .btn { width: 100%; }
    .quiz-controls { grid-template-columns: 1fr; }
    #btn-submit { grid-column: auto; }
    .modal-overlay { padding: 10px; }
    .modal-content { padding: 20px !important; max-height: 92vh; }
    .question-toolbar { grid-template-columns: 1fr; }
    .delete-all-actions .btn { width: 100%; }
}

/* Color accents for homepage information, statistics and participation flow. */
.info-grid .info-card { position: relative; overflow: hidden; border-top: 3px solid var(--card-accent); background: linear-gradient(145deg, var(--card-tint), #142238 58%); }
.info-grid .info-card::after { content: ""; position: absolute; top: -50px; right: -50px; width: 130px; height: 130px; border-radius: 50%; background: var(--card-glow); filter: blur(4px); opacity: .34; pointer-events: none; }
.info-grid .info-card:nth-child(1) { --card-accent: #39c4ef; --card-tint: rgba(28, 112, 151, .3); --card-glow: rgba(57, 196, 239, .2); }
.info-grid .info-card:nth-child(2) { --card-accent: #4ed092; --card-tint: rgba(29, 112, 79, .3); --card-glow: rgba(78, 208, 146, .2); }
.info-grid .info-card:nth-child(3) { --card-accent: #e9bb51; --card-tint: rgba(128, 92, 27, .3); --card-glow: rgba(233, 187, 81, .22); }
.info-grid .info-card:nth-child(1) .info-icon { color: #64d7f7; background: #153b53; box-shadow: 0 0 0 5px rgba(57, 196, 239, .08); }
.info-grid .info-card:nth-child(2) .info-icon { color: #72dfad; background: #183d31; box-shadow: 0 0 0 5px rgba(78, 208, 146, .08); }
.info-grid .info-card:nth-child(3) .info-icon { color: #f1c96d; background: #40341c; box-shadow: 0 0 0 5px rgba(233, 187, 81, .08); }
.info-grid .info-card:nth-child(1) h3 { color: #8ce2fa; }
.info-grid .info-card:nth-child(2) h3 { color: #91e5ba; }
.info-grid .info-card:nth-child(3) h3 { color: #f3d48c; }

.contest-stats .stat-item { position: relative; overflow: hidden; --stat-color: #51cef4; --stat-bg: #17364f; }
.contest-stats .stat-item::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--stat-color); transform: scaleX(.72); transform-origin: center; opacity: .82; transition: transform .2s ease; }
.contest-stats .stat-item:hover::after { transform: scaleX(1); }
.contest-stats .stat-item:hover i { transform: scale(1.08) rotate(-3deg); }
.contest-stats .stat-item:nth-child(1) { --stat-color: #43c9f1; --stat-bg: #153a52; }
.contest-stats .stat-item:nth-child(2) { --stat-color: #a985f5; --stat-bg: #302956; }
.contest-stats .stat-item:nth-child(3) { --stat-color: #f09a5a; --stat-bg: #463024; }
.contest-stats .stat-item:nth-child(4) { --stat-color: #edc052; --stat-bg: #40351d; }
.contest-stats .stat-item i { color: var(--stat-color); background: var(--stat-bg); transition: transform .2s ease; }
.contest-stats .stat-item strong { color: var(--stat-color); }

.participation-steps { border-color: #334b66; background: linear-gradient(145deg, #172740, #111e31); }
.steps-track::before { height: 2px; background: linear-gradient(90deg, #39c5ee 0 25%, #a07af0 25% 50%, #4bcf8f 50% 75%, #e7b84d 75% 100%); opacity: .65; }
.step-card { --step-color: #4bc8ee; --step-bg: #173b52; --step-border: #376b84; animation: stepReveal .42s ease both; }
.step-card:nth-child(2) { --step-color: #ad8af5; --step-bg: #322a57; --step-border: #665699; animation-delay: .08s; }
.step-card:nth-child(3) { --step-color: #59d49a; --step-bg: #193e32; --step-border: #34765b; animation-delay: .16s; }
.step-card:nth-child(4) { --step-color: #edc35b; --step-bg: #41361e; --step-border: #76612f; animation-delay: .24s; }
.step-card > i { color: var(--step-color); background: var(--step-bg); border-color: var(--step-border); box-shadow: 0 0 0 5px color-mix(in srgb, var(--step-color) 8%, transparent); }
.step-card .step-number { display: grid; place-items: center; width: 25px; height: 25px; border-radius: 8px; color: var(--step-color); background: var(--step-bg); }
.step-card:hover { border-color: var(--step-border); background: color-mix(in srgb, var(--step-bg) 52%, #192a42); }
.step-card:hover h3 { color: var(--step-color); }
@keyframes stepReveal { from { opacity: 0; transform: translateY(14px); } }

/* Stronger but controlled prize hierarchy. */
.prize-row-wt.first-prize { background: linear-gradient(100deg, rgba(108, 78, 18, .38), #15243a 62%) !important; box-shadow: inset 3px 0 #e7b94e; }
.prize-row-wt.second-prize { background: linear-gradient(100deg, rgba(74, 97, 116, .34), #15243a 62%) !important; box-shadow: inset 3px 0 #afc3d2; }
.prize-row-wt.third-prize { background: linear-gradient(100deg, rgba(112, 63, 31, .34), #15243a 62%) !important; box-shadow: inset 3px 0 #c98653; }
.prize-row-wt.consolation-prize { background: linear-gradient(100deg, rgba(24, 91, 112, .3), #15243a 62%) !important; box-shadow: inset 3px 0 #45b7da; }
.prize-row-wt.first-prize .prize-medal-wrapper { background: linear-gradient(135deg, #ffe590, #d9a82f); color: #684900; box-shadow: 0 4px 12px rgba(226, 178, 54, .22); }
.prize-row-wt.second-prize .prize-medal-wrapper { background: linear-gradient(135deg, #edf4f7, #91a8ba); color: #334554; }
.prize-row-wt.third-prize .prize-medal-wrapper { background: linear-gradient(135deg, #efb37d, #a86236); color: #4d2812; }
.prize-row-wt.consolation-prize .prize-medal-wrapper { background: linear-gradient(135deg, #78d9ed, #2788aa); color: #073849; }
.prize-row-wt.first-prize .prize-amount-box { background: rgba(122, 91, 25, .3); border-color: rgba(236, 193, 83, .48); color: #f0cb72; }
.prize-row-wt.second-prize .prize-amount-box { background: rgba(74, 96, 114, .28); border-color: rgba(182, 202, 217, .4); color: #cad8e2; }
.prize-row-wt.third-prize .prize-amount-box { background: rgba(112, 64, 32, .28); border-color: rgba(210, 139, 87, .42); color: #e8a979; }
.prize-row-wt.consolation-prize .prize-amount-box { background: rgba(24, 91, 112, .26); border-color: rgba(75, 190, 222, .4); color: #71d3ec; }

@media (max-width: 600px) {
    .steps-track { padding-left: 22px; }
    .steps-track::before { display: block; top: 26px; bottom: 26px; left: 8px; right: auto; width: 2px; height: auto; background: linear-gradient(180deg, #39c5ee, #a07af0, #4bcf8f, #e7b84d); }
    .step-card { text-align: left; }
    .step-card > i { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

@media print {
    .app-header, .site-header-banner, .site-footer-banner, .btn, .bg-glow { display: none !important; }
    body, .glass-card { background: #fff !important; color: #000 !important; box-shadow: none !important; }
    .main-content { padding: 0; }
}

/* 2026-08 refinement: slate canvas, responsive campaign banners and prize system. */
:root {
    color-scheme: dark;
    --bg-dark: #0b1424;
    --bg-card: #152238;
    --surface: #152238;
    --surface-soft: #1a2941;
    --surface-muted: #20314b;
    --primary-color: #35b8ee;
    --primary-hover: #65caf3;
    --primary-gradient: linear-gradient(135deg, #087bbb 0%, #16a8dc 100%);
    --accent-color: #3cc7f4;
    --accent-gradient: linear-gradient(135deg, #0c8ac4, #38c3ed);
    --secondary-gradient: linear-gradient(135deg, #1c2c45, #233653);
    --text-primary: #eef5fd;
    --text-secondary: #aab9cd;
    --text-accent: #68d2f7;
    --text-color: #eef5fd;
    --border-color: #2c405d;
    --border-highlight: #417093;
    --success-color: #45c78a;
    --warning-color: #f0b65b;
    --danger-color: #f07272;
    --focus-ring: 0 0 0 3px rgba(56, 195, 237, .24);
    --shadow-sm: 0 2px 8px rgba(2, 8, 20, .2);
    --shadow-md: 0 18px 44px rgba(2, 8, 20, .3);
    --shadow-lg: 0 28px 70px rgba(2, 8, 20, .42);
}

body {
    background: #0b1424;
    color: var(--text-primary);
}

body::before {
    background:
        radial-gradient(circle at 8% 6%, rgba(19, 143, 199, .12), transparent 28rem),
        radial-gradient(circle at 92% 26%, rgba(40, 105, 173, .1), transparent 30rem),
        linear-gradient(180deg, #0b1424 0%, #0e192a 48%, #0b1424 100%);
}

.skip-link,
.app-header,
.nav-menu,
.glass-card,
.hero-card,
.info-card,
.login-card,
.quiz-main,
.quiz-sidebar,
.leaderboard-container,
.admin-container,
.admin-dashboard-container,
.modal-content,
.modal-header,
.app-toast {
    background: #152238;
    color: var(--text-primary);
}

.app-header {
    background: rgba(14, 26, 43, .94);
    border-bottom-color: #29405e;
    box-shadow: 0 8px 24px rgba(1, 8, 18, .28);
}

.logo,
.admin-header h2,
.admin-section-header h3,
.page-content-title,
.section-title,
.leaderboard-title,
.question-title,
.modal-header h3 { color: var(--text-primary) !important; }
.logo-copy strong { color: #eff8ff; }
.logo-copy small { color: #9eb0c6; }
.header-icon { background: #1b3550; color: #52c7f1; }
.nav-link { color: #afbed0; }
.nav-link:hover { color: #eaf7ff; background: #1b2d46; }
.nav-link.active { color: #72d6f7; background: #173550; border-color: #2e6283; }
.nav-toggle { background: #182942; color: #68d2f7; border-color: #304764; }

/* The source art is intentionally ultra-wide; keep both edge illustrations on desktop. */
.site-header-banner {
    height: clamp(118px, 8.25vw, 160px);
    min-height: 118px;
    padding: 0;
    background-color: #20568e;
    background-image: url('/assets/header_banner.webp');
    background-size: 100% 100%;
    background-position: center;
    box-shadow: 0 8px 28px rgba(2, 10, 25, .3);
}

.site-header-banner::after {
    background: linear-gradient(90deg,
        rgba(12, 49, 88, .05) 0%,
        rgba(10, 45, 82, .16) 24%,
        rgba(10, 46, 84, .5) 42%,
        rgba(10, 46, 84, .5) 62%,
        rgba(10, 46, 84, .1) 82%,
        rgba(10, 46, 84, .02) 100%);
}

.site-header-banner .banner-content {
    width: min(54vw, 920px);
    margin-inline: auto;
    padding: 20px 0;
    align-items: center;
    text-align: center;
}

.banner-title {
    max-width: 900px;
    margin: 0;
    color: #f4fbff;
    font-size: clamp(1.05rem, 1.85vw, 1.9rem);
    line-height: 1.28;
    text-align: center;
    text-shadow: 0 2px 12px rgba(2, 19, 40, .7);
}

.banner-subtitle {
    margin-top: 7px;
    color: #c9eeff;
    font-size: clamp(.72rem, 1.05vw, 1rem);
    text-align: center;
    text-shadow: 0 2px 8px rgba(2, 19, 40, .65);
}

.glass-card,
.hero-card,
.info-card,
.login-card,
.quiz-main,
.quiz-sidebar,
.admin-dashboard-container {
    border-color: #2a3d59;
    box-shadow: var(--shadow-sm);
}

.hero-card { box-shadow: var(--shadow-md); }
.intro-topics-banner { background: #182942 !important; border-color: #2e4968 !important; }
.banner-header { background: #1d3550 !important; color: #7cdafa !important; }
.topic-tag { background: #132137 !important; color: #d8e8f7 !important; border-color: #304963 !important; }
.banner-footer { color: #aebed0 !important; border-color: #2c415c !important; }

.time-box { background: #192840; border-color: #30455f; }
.time-box > span:first-child { color: #6dd8fa; }
.countdown-label, .time-label, .info-card p { color: var(--text-secondary); }
.info-icon { background: #1c3550; color: #65cef3; }
.info-card h3 { color: #eff6fd; }

.btn-secondary { background: #1c2c44; color: #d9e5f1; border-color: #354b66; }
.btn-secondary:hover { background: #243851; color: #fff; border-color: #486581; }
.page-content-body, .ql-editor { color: #d3deeb; }
.ql-editor a { color: #6ed8fb; }

.form-group label { color: #dce7f3; }
.form-group input,
.form-group select,
.form-group textarea,
.form-input,
input[type="text"], input[type="password"], input[type="number"], input[type="tel"], select, textarea {
    background: #101c2f !important;
    color: #eef5fd !important;
    border-color: #344b67 !important;
}
.form-group input::placeholder, .form-input::placeholder, textarea::placeholder { color: #718299; }
.alert-warning { color: #f4d49a; background: #31291b !important; border-color: #66512d !important; }

.option-item { background: #142238; color: #dbe6f1; border-color: #304761; }
.option-item:hover { background: #1a2e47; border-color: #4783a9; }
.option-item.selected { background: #153a55; color: #e9f9ff; border-color: #39a9d8; }
.option-letter, .grid-btn { background: #203149; color: #c4d0df; border-color: #354d68; }
.table-wrapper, .table-responsive, table { background: #132137; color: #dbe6f1; border-color: #2d425d; }
thead th { background: #1c3049 !important; color: #cce8fa !important; border-color: #334c67 !important; }
tbody td { border-color: #283c55 !important; }
tbody tr:hover { background: #192a40 !important; }
.leaderboard-tabs, .individual-tabs, .collective-tabs, .admin-tabs { background: #101d30; border-color: #2d425d; }
.ldb-tab-btn.active, .ind-tab-btn.active, .coll-tab-btn.active, .tab-link.active { background: #203650 !important; color: #70d6f7 !important; }
.question-card-admin { background: #101e31; border-color: #2d435e; color: #d8e4ef; }
.structured-page-form { background: #101c2e !important; }
.ql-toolbar.ql-snow { background: #1b2b43; border-color: #344b67 !important; }
.ql-container.ql-snow { background: #101c2f !important; color: #eef5fd !important; border-color: #344b67 !important; }
.ql-snow .ql-stroke { stroke: #b8c9da !important; }
.ql-snow .ql-fill { fill: #b8c9da !important; }

/* Prize system */
.prizes-home-section {
    max-width: 1180px;
    margin: 28px auto 36px;
}

#prizes-home-container.ql-editor { padding: 0; }

.prizes-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
    width: 100%;
    align-items: stretch;
}

.prize-card-dark-theme {
    display: flex;
    min-width: 0;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #334a66 !important;
    border-radius: 18px;
    background: linear-gradient(155deg, #17263d 0%, #111d30 100%) !important;
    box-shadow: 0 18px 42px rgba(1, 8, 20, .28);
    backdrop-filter: none;
}

.prize-card-dark-theme .prize-card-header,
.prize-card-personal .prize-card-header {
    min-height: 78px;
    padding: 15px 18px;
    background: linear-gradient(110deg, #1c3553 0%, #174b6a 100%) !important;
    border-bottom: 1px solid #345471;
}

.prize-card-personal .prize-card-header {
    background: linear-gradient(110deg, #183c3b 0%, #166159 100%) !important;
    border-bottom-color: #337268;
}

.prize-card-dark-theme .prize-header-left { min-width: 0; }
.prize-card-dark-theme .prize-icon-wrapper {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    background: rgba(255, 255, 255, .1) !important;
    color: #f5c95c;
}
.prize-card-dark-theme .title-meta { min-width: 0; }
.prize-card-dark-theme .title-meta span:first-child { color: #b7cada; opacity: 1; }
.prize-card-dark-theme .title-meta span:last-child { color: #f4f8fc !important; line-height: 1.25; }
.prize-card-dark-theme .prize-count-badge {
    flex: 0 0 auto;
    background: rgba(8, 20, 34, .36) !important;
    color: #d9f5ff !important;
    border-color: rgba(169, 227, 248, .28) !important;
    box-shadow: none;
}

.prize-card-dark-theme .prize-card-body {
    flex: 1;
    gap: 10px;
    padding: 16px;
}

.prize-row-wt {
    min-height: 70px;
    padding: 10px 12px;
    border-width: 1px;
    background: #15243a !important;
}
.prize-row-wt:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(1, 8, 20, .22); }
.prize-row-wt.first-prize { border-color: rgba(231, 189, 83, .38); }
.prize-row-wt.second-prize { border-color: rgba(166, 190, 210, .3); }
.prize-row-wt.third-prize { border-color: rgba(195, 129, 75, .34); }
.prize-row-wt.consolation-prize { border-color: rgba(62, 170, 201, .3); }
.prize-card-dark-theme .prize-left-info { min-width: 0; }
.prize-card-dark-theme .prize-medal-wrapper { width: 36px; height: 36px; flex: 0 0 36px; }
.prize-card-dark-theme .prize-title-wrapper { min-width: 0; }
.prize-card-dark-theme .prize-title-wrapper span:first-child { color: #eff5fb; }
.prize-card-dark-theme .prize-title-wrapper span:last-child {
    margin-top: 4px;
    padding: 2px 7px;
    background: #202f45;
    color: #aab9ca;
}
.prize-card-dark-theme .prize-amount-box {
    width: 138px;
    min-height: 45px;
    padding: 7px 10px;
    font-size: 1rem;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.prize-card-dark-theme .prize-amount-box span { color: #a5b4c5; opacity: 1; }

.prize-card-dark-theme .prize-card-footer {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr) auto;
    align-items: center;
    column-gap: 9px;
    min-height: 68px;
    padding: 12px 16px;
    background: #0e192a;
    border-top: 1px solid #2d425d !important;
}

.prize-card-dark-theme .prize-total-label {
    display: contents;
    margin: 0;
    color: #72d7f6 !important;
    line-height: 1.25;
}

.prize-card-dark-theme .prize-total-label i {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 9px;
    background: #18324a;
    color: #69d7f8;
    line-height: 1;
}

.prize-card-dark-theme .prize-total-label span {
    align-self: center;
    min-width: 0;
    color: #72d7f6;
    font-size: .88rem;
    font-weight: 700;
    line-height: 1;
}

.prize-card-personal .prize-total-label,
.prize-card-personal .prize-total-value { color: #57d69e !important; }
.prize-card-personal .prize-total-label i { background: #17382f; color: #57d69e; }
.prize-card-personal .prize-total-label span { color: #57d69e; }

.prize-card-dark-theme .prize-total-value {
    margin: 0;
    color: #72d7f6;
    font-size: clamp(1.05rem, 1.6vw, 1.28rem);
    line-height: 1.2;
    text-align: right;
    text-shadow: none !important;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

/* Footer banner uses its source composition and reserves the robot area. */
.site-footer-banner {
    min-height: clamp(290px, 17.65vw, 360px);
    margin-top: 0;
    padding: 42px max(24px, calc((100% - 1180px) / 2)) 24px;
    background-color: #174d83;
    background-image:
        linear-gradient(90deg, rgba(8, 31, 59, .2) 0%, rgba(8, 31, 59, .72) 30%, rgba(8, 31, 59, .82) 100%),
        url('/assets/footer_banner.webp');
    background-size: 100% 100%;
    background-position: center;
    border-top: 1px solid #315e85;
    box-shadow: 0 -12px 32px rgba(1, 8, 20, .22);
}

.footer-banner-container {
    width: min(920px, 70vw);
    margin-left: auto;
    margin-right: 0;
    padding: 0;
    align-items: stretch;
}
.footer-banner-title { width: 100%; text-align: left; color: #f2f8ff; }
.footer-info-grid { width: 100%; gap: 38px; }
.footer-info-col h3 { color: #76d7f7; }
.footer-info-col p { color: #dceaf6; }
.footer-copyright { color: #aec7da; border-color: rgba(190, 222, 242, .2); }

@media (max-width: 1024px) {
    .nav-menu { background: #152238; }
    .site-header-banner {
        height: 136px;
        background-size: auto 100%;
        background-position: center;
    }
    .site-header-banner .banner-content { width: min(60vw, 650px); }
    .banner-title { font-size: clamp(1rem, 2.25vw, 1.45rem); }
    .prizes-grid { grid-template-columns: 1fr; max-width: 720px; margin-inline: auto; }
    .footer-banner-container { width: min(76vw, 760px); }
}

@media (max-width: 768px) {
    .site-header-banner {
        height: 132px;
        min-height: 132px;
        background-image: url('/assets/header_banner_mobile.webp');
        background-size: cover;
        background-position: left center;
    }
    .site-header-banner::after { background: linear-gradient(90deg, rgba(8, 38, 70, .12), rgba(8, 38, 70, .82) 42%, rgba(8, 38, 70, .76)); }
    .site-header-banner .banner-content { width: 54%; margin: 0 11% 0 auto; padding: 14px 0; }
    .banner-title { font-size: clamp(.82rem, 3.25vw, 1.2rem); }
    .banner-subtitle { font-size: clamp(.62rem, 2.3vw, .82rem); letter-spacing: .02em; }
    .prizes-home-section { margin-top: 22px; }
    .prize-card-dark-theme .prize-card-header { align-items: center; flex-direction: row; }
    .prize-card-dark-theme .prize-card-footer { grid-template-columns: 1fr auto; }
    .site-footer-banner {
        min-height: 360px;
        padding: 36px 22px 22px;
        background-image:
            linear-gradient(90deg, rgba(8, 31, 59, .16) 0%, rgba(8, 31, 59, .72) 34%, rgba(8, 31, 59, .88) 100%),
            url('/assets/footer_banner_mobile.webp');
        background-position: center;
        background-size: 100% 100%;
    }
    .footer-banner-container { width: 78%; margin-left: auto; }
    .footer-info-grid { grid-template-columns: 1fr; gap: 18px; }
}

@media (max-width: 540px) {
    .site-header-banner { background-position: left center; }
    .site-header-banner .banner-content { width: 58%; margin-right: 9%; }
    .prizes-grid { gap: 16px; }
    .prize-card-dark-theme .prize-card-header {
        min-height: auto;
        padding: 13px 14px;
        align-items: flex-start;
        flex-direction: column;
    }
    .prize-card-dark-theme .prize-card-body { padding: 12px; }
    .prize-row-wt { align-items: stretch; flex-direction: column; gap: 10px; }
    .prize-card-dark-theme .prize-amount-box { width: 100%; align-items: flex-start; text-align: left; }
    .prize-card-dark-theme .prize-card-footer {
        grid-template-columns: 32px minmax(0, 1fr) auto;
        column-gap: 8px;
        padding: 12px 14px;
    }
    .prize-card-dark-theme .prize-total-label span { font-size: .76rem; }
    .prize-card-dark-theme .prize-total-value { padding-left: 0; font-size: .98rem; text-align: right; }
    .site-footer-banner {
        min-height: 390px;
        background-position: center;
        background-size: 100% 100%;
    }
    .footer-banner-container { width: 72%; }
    .footer-banner-title { font-size: 1rem; }
    .footer-info-col p { font-size: .78rem; }
}

/* Experience layer: live hero, participation flow, previews and result feedback. */
.contest-status-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}
.contest-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 34px;
    padding: 7px 12px;
    border: 1px solid #745d2f;
    border-radius: 999px;
    background: #302819;
    color: #f4ca76;
    font-size: .78rem;
    font-weight: 750;
}
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #e8ad45; box-shadow: 0 0 0 4px rgba(232, 173, 69, .12); }
.contest-status-badge.is-open { color: #7ae5af; background: #123229; border-color: #285d49; }
.contest-status-badge.is-open .status-dot { background: #4bd38d; box-shadow: 0 0 0 4px rgba(75, 211, 141, .14); animation: statusPulse 2s ease-in-out infinite; }
@keyframes statusPulse { 50% { box-shadow: 0 0 0 8px rgba(75, 211, 141, 0); } }
.contest-eyebrow { color: #94a9bf; font-size: .78rem; font-weight: 650; letter-spacing: .04em; text-transform: uppercase; }
.hero-introduction { max-width: 760px; margin: 0 auto 24px; text-align: center; }
.hero-introduction h2 { color: #f1f7fd; font-size: clamp(1.35rem, 2.6vw, 2rem); line-height: 1.3; letter-spacing: -.025em; }
.hero-introduction p { max-width: 650px; margin: 10px auto 0; color: #a8b9cb; font-size: .94rem; line-height: 1.65; }

.contest-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1px;
    overflow: hidden;
    margin: 22px 0;
    border: 1px solid #2d425d;
    border-radius: 16px;
    background: #2d425d;
    box-shadow: var(--shadow-sm);
}
.stat-item {
    display: grid;
    grid-template-columns: 36px 1fr;
    grid-template-rows: auto auto;
    column-gap: 11px;
    padding: 18px 20px;
    background: #142238;
}
.stat-item i { grid-row: 1 / 3; align-self: center; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; color: #68d4f6; background: #1c3550; }
.stat-item strong { color: #f4f8fc; font-size: 1.35rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat-item span { color: #91a5ba; font-size: .78rem; }

.participation-steps { margin-top: 26px; padding: clamp(22px, 4vw, 34px); border: 1px solid #2d425d; border-radius: 20px; background: #142238; box-shadow: var(--shadow-sm); }
.section-heading { margin-bottom: 24px; text-align: center; }
.section-heading > span, .section-kicker { color: #62c9ed; font-size: .74rem; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.section-heading h2, .preview-heading h2 { margin-top: 5px; color: #eff6fd; font-size: clamp(1.25rem, 2vw, 1.65rem); letter-spacing: -.02em; }
.steps-track { position: relative; display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.steps-track::before { content: ""; position: absolute; top: 42px; left: 12%; right: 12%; height: 1px; background: linear-gradient(90deg, transparent, #3c6b89 12%, #3c6b89 88%, transparent); }
.step-card { position: relative; z-index: 1; padding: 18px 14px; text-align: center; border: 1px solid transparent; border-radius: 14px; transition: transform .2s ease, background .2s ease, border-color .2s ease; }
.step-card:hover { transform: translateY(-4px); background: #192a42; border-color: #304963; }
.step-card > i { display: grid; place-items: center; width: 48px; height: 48px; margin: 0 auto 13px; border: 1px solid #38617e; border-radius: 14px; background: #18354e; color: #6dd5f5; font-size: 1.1rem; }
.step-number { position: absolute; top: 10px; right: 12px; color: #486078; font-size: .7rem; font-weight: 800; }
.step-card h3 { color: #edf5fc; font-size: .96rem; }
.step-card p { margin-top: 5px; color: #96a9bd; font-size: .78rem; line-height: 1.55; }

.leaderboard-error-state { height: 180px; color: #91a6ba !important; }
.leaderboard-error-state i, .leaderboard-error-state strong, .leaderboard-error-state span { display: block; margin: 5px auto; }
.leaderboard-error-state i { color: #5fcbed; font-size: 1.9rem; }
.leaderboard-error-state strong { color: #e4edf6; }
.leaderboard-error-state span { font-size: .78rem; font-weight: 400; }

.prize-row-wt.first-prize { position: relative; overflow: hidden; }
.prize-row-wt.first-prize::after { content: ""; position: absolute; top: -50%; bottom: -50%; left: -35%; width: 18%; transform: rotate(18deg); background: linear-gradient(90deg, transparent, rgba(255,255,255,.22), transparent); animation: prizeShine 1.1s .6s ease-out 1 both; pointer-events: none; }
@keyframes prizeShine { to { left: 125%; } }
.prize-row-wt.first-prize::before { content: "NỔI BẬT"; position: absolute; top: 5px; right: -25px; width: 92px; padding: 2px 0; transform: rotate(34deg); color: #5a4206; background: #e8bd52; font-size: .52rem; font-weight: 900; text-align: center; letter-spacing: .05em; }

.flag-question-btn { display: inline-flex; align-items: center; gap: 7px; min-height: 36px; margin: 0 0 14px auto; padding: 7px 11px; border: 1px solid #3b4f67; border-radius: 9px; color: #aebed0; background: #17253a; cursor: pointer; transition: all .18s ease; }
.flag-question-btn:hover { border-color: #806b3e; color: #f0c96d; }
.flag-question-btn.is-flagged { color: #f2c967; background: #342c1c; border-color: #826d38; }
.grid-btn.flagged { color: #302408 !important; background: #e8b94e !important; border-color: #f0ca6c !important; box-shadow: 0 0 0 2px rgba(232, 185, 78, .14); }
.dot.flagged { background: #e8b94e; }

.result-modal-card { max-width: 620px; padding: clamp(26px, 5vw, 46px) !important; text-align: center; }
.result-success-icon { display: grid; place-items: center; width: 68px; height: 68px; margin: 0 auto 16px; border-radius: 50%; color: #071b13; background: linear-gradient(135deg, #75e2ae, #35b976); box-shadow: 0 0 0 10px rgba(72, 203, 137, .1); animation: resultPop .45s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes resultPop { from { opacity: 0; transform: scale(.6) rotate(-12deg); } }
.result-kicker { color: #62d39c; font-size: .75rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.result-modal-card h2 { margin-top: 7px; color: #f2f7fc; font-size: clamp(1.35rem, 3vw, 1.85rem); }
.result-candidate-name { margin-top: 6px; color: #9fb2c6; }
.result-score-ring { display: grid; place-items: center; width: 132px; height: 132px; margin: 24px auto; border: 8px solid #1d3b52; border-top-color: #43c4ee; border-right-color: #43c4ee; border-radius: 50%; background: #101d30; box-shadow: inset 0 0 24px rgba(49, 167, 210, .08); }
.result-score-ring strong { color: #72d8f8; font-size: 1.65rem; line-height: 1; font-variant-numeric: tabular-nums; }
.result-score-ring span { margin-top: -25px; color: #8196aa; font-size: .68rem; text-transform: uppercase; }
.result-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.result-metrics > div { display: flex; min-width: 0; flex-direction: column; align-items: center; gap: 4px; padding: 14px 8px; border: 1px solid #2e445e; border-radius: 12px; background: #101e31; }
.result-metrics i { color: #5dc9ec; }
.result-metrics strong { color: #eff6fd; font-size: 1rem; font-variant-numeric: tabular-nums; }
.result-metrics span { color: #8297ab; font-size: .7rem; }
.result-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; margin-top: 22px; }

.option-item, .grid-btn, .btn, .nav-link, .info-card { will-change: transform; }
.btn[aria-busy="true"] { cursor: wait; opacity: .72; }
.btn[aria-busy="true"]::after { content: ""; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .65s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.form-group:has(input:valid:not(:placeholder-shown)) input,
.form-group:has(textarea:valid:not(:placeholder-shown)) textarea { border-color: #347c61 !important; background-image: radial-gradient(circle at calc(100% - 16px) 50%, #4dcb8d 0 4px, transparent 5px) !important; }

@media (max-width: 768px) {
    .contest-stats { grid-template-columns: repeat(2, 1fr); }
    .steps-track { grid-template-columns: repeat(2, 1fr); }
    .steps-track::before { display: none; }
}
@media (max-width: 480px) {
    .contest-status-row { align-items: flex-start; flex-direction: column; }
    .contest-eyebrow { display: none; }
    .stat-item { padding: 14px 12px; }
    .stat-item strong { font-size: 1.1rem; }
    .steps-track { grid-template-columns: 1fr; }
    .result-metrics { gap: 6px; }
    .result-actions { grid-template-columns: 1fr; }
}

/* Final cascade enforcement for single-line banner titles. */
.site-header-banner .banner-content {
    width: 100%;
    max-width: none;
    margin-inline: auto;
    padding: 20px 14% 20px 21%;
    box-sizing: border-box;
}
.banner-title,
.footer-banner-title {
    max-width: none;
    overflow: visible;
    white-space: nowrap;
    word-break: keep-all;
    text-wrap: nowrap;
    letter-spacing: -.025em;
}
.banner-title { width: 100%; font-size: clamp(.75rem, 1.48vw, 1.7rem); line-height: 1.12; }
.footer-banner-title { width: 100%; font-size: clamp(.7rem, 1.42vw, 1.55rem); line-height: 1.15; }
@media (max-width: 1024px) {
    .site-header-banner .banner-content { width: 100%; padding-inline: 18% 12%; }
    .banner-title { font-size: clamp(.62rem, 1.48vw, .95rem); }
    .footer-banner-title { font-size: clamp(.6rem, 1.42vw, .9rem); }
}
@media (max-width: 768px) {
    .site-header-banner .banner-content { width: 100%; margin: 0; padding: 14px 3%; }
    .banner-title { font-size: clamp(.42rem, 2vw, .95rem); text-shadow: 0 2px 8px rgba(3, 18, 36, .9), 0 0 3px rgba(3, 18, 36, .8); }
    .footer-banner-title { font-size: clamp(.4rem, 1.62vw, .78rem); }
}
@media (max-width: 420px) {
    .banner-title { font-size: 2vw; }
    .footer-banner-title { font-size: 1.58vw; }
}

/* Always-visible navigation on mobile/tablet. Keep last to override legacy rules. */
@media (max-width: 1024px) {
    .app-header {
        position: sticky;
        top: 0;
        z-index: 1000;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        min-height: 0;
        padding: 10px 0 8px;
        overflow: hidden;
    }
    .app-header .logo {
        align-self: flex-start;
        min-width: 0;
        margin-inline: max(16px, env(safe-area-inset-left));
    }
    .app-header .logo-copy strong { white-space: nowrap; }
    .nav-toggle, .nav-backdrop { display: none !important; }
    body.mobile-nav-open { overflow: auto; touch-action: auto; }

    .nav-menu,
    .nav-menu.is-open {
        position: static;
        display: flex;
        flex-direction: row;
        width: 100%;
        max-height: none;
        gap: 6px;
        padding: 2px max(16px, env(safe-area-inset-right)) 4px max(16px, env(safe-area-inset-left));
        overflow-x: auto;
        overflow-y: hidden;
        overscroll-behavior-x: contain;
        scroll-snap-type: x proximity;
        scrollbar-width: none;
        border: 0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
        -webkit-overflow-scrolling: touch;
        -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 14px, #000 calc(100% - 20px), transparent 100%);
        mask-image: linear-gradient(90deg, transparent 0, #000 14px, #000 calc(100% - 20px), transparent 100%);
    }
    .nav-menu::-webkit-scrollbar { display: none; }
    .nav-menu .nav-link {
        flex: 0 0 auto;
        width: auto;
        min-height: 44px;
        padding: 10px 13px;
        scroll-snap-align: center;
        white-space: nowrap;
        border: 1px solid #29445f;
        border-radius: 10px;
        background: #172a42;
        font-size: .88rem;
    }
    .nav-menu .nav-link.active { background: #173f5d; border-color: #3a779c; }
}

@media (max-width: 600px) {
    .app-header { gap: 7px; padding-block: 9px 7px; }
    .app-header .header-icon { width: 38px; height: 38px; flex: 0 0 38px; }
    .app-header .logo { gap: 9px; font-size: 1rem; }
    .app-header .logo-copy strong { font-size: .88rem; }
    .nav-menu .nav-link { min-height: 42px; padding: 9px 12px; font-size: .84rem; }
}

@media (max-width: 360px) {
    .app-header .logo-copy small { display: none; }
    .nav-menu .nav-link { padding-inline: 10px; }
}
