/* =============================================
   Modern layout — 2026 refresh
   ============================================= */

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url('../fonts/inter/inter-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url('../fonts/inter/inter-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
    --color-primary: #2563eb;
    --color-primary-dark: #1d4ed8;
    --color-primary-light: #3b82f6;
    --color-text: #1f2937;
    --color-text-muted: #6b7280;
    --color-text-subtle: #9ca3af;
    --color-bg: #f9fafb;
    --color-surface: #ffffff;
    --color-border: #e5e7eb;
    --color-success: #10b981;
    --color-error: #ef4444;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --radius: 8px;
    --radius-lg: 12px;
}

*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    color: var(--color-text);
    background: var(--color-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color 0.15s ease;
}

a:hover {
    color: var(--color-primary-dark);
}

/* ---- App shell ---- */
.app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ---- Header ---- */
.app-header {
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
}

.app-header__inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.app-header__brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 18px;
    color: var(--color-text);
}

.app-header__brand:hover {
    color: var(--color-text);
}

.app-header__brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius);
    background: var(--color-primary);
    color: #fff;
    font-weight: 700;
    font-size: 16px;
}

.app-header__brand-name {
    letter-spacing: -0.01em;
}

.app-header__nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 4px;
}

.app-header__nav a {
    display: inline-block;
    padding: 8px 12px;
    color: var(--color-text-muted);
    font-size: 14px;
    font-weight: 500;
    border-radius: 6px;
    transition: background 0.15s ease, color 0.15s ease;
}

.app-header__nav a:hover {
    background: var(--color-bg);
    color: var(--color-text);
}

/* ---- Banner ---- */
.app-banner {
    height: 20px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: var(--color-primary);
}

.app-banner--default {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
}

/* ---- Main ---- */
.app-main {
    flex: 1 0 auto;
    padding: 32px 24px 48px;
}

.app-main__inner {
    max-width: 1100px;
    margin: 0 auto;
}

.app-content {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: var(--shadow-sm);
}

/* ---- Footer ---- */
.app-footer {
    background: var(--color-surface);
    border-top: 1px solid var(--color-border);
    margin-top: auto;
}

.app-footer__inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.app-footer__copyright {
    margin: 0;
    font-size: 13px;
    color: var(--color-text-muted);
}

.app-footer__nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 4px;
    align-items: center;
}

.app-footer__nav a {
    display: inline-block;
    padding: 6px 10px;
    font-size: 13px;
    color: var(--color-text-muted);
    border-radius: 4px;
}

.app-footer__nav a:hover {
    color: var(--color-text);
    background: var(--color-bg);
}

/* ---- Notices ---- */
.notice {
    padding: 12px 16px;
    border-radius: var(--radius);
    font-weight: 500;
    margin-bottom: 16px;
    border: 1px solid transparent;
}

.notice--error {
    background: #fef2f2;
    color: #991b1b;
    border-color: #fecaca;
}

.notice--success {
    background: #f0fdf4;
    color: #166534;
    border-color: #bbf7d0;
}

.notice--info {
    background: #eff6ff;
    color: #1e40af;
    border-color: #bfdbfe;
}

.notice--warning {
    background: #fffbeb;
    color: #92400e;
    border-color: #fde68a;
}

/* ---- Quiz search ---- */
.quiz-search {
    margin: 16px 0 32px 0;
    padding: 12px 16px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: var(--radius);
}
.quiz-search__row {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}
.quiz-search__row + .quiz-search__row {
    margin-top: 10px;
}
.quiz-search__input {
    flex: 1 1 240px;
    min-width: 0;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: var(--radius);
    font-size: inherit;
}
.quiz-search__submit,
.quiz-search__reset {
    padding: 8px 16px;
    border-radius: var(--radius);
    border: 1px solid transparent;
    cursor: pointer;
    font-weight: 500;
    text-decoration: none;
    line-height: 1.2;
}
.quiz-search__submit {
    background: #1e40af;
    color: #fff;
}
.quiz-search__reset {
    background: transparent;
    color: #1e40af;
    border-color: #1e40af;
}
.quiz-search__row--threshold {
    font-size: 0.9em;
    color: #4b5563;
}
.quiz-search__label {
    flex: 0 0 auto;
    white-space: nowrap;
}
.quiz-search__slider {
    flex: 1 1 200px;
    max-width: 360px;
}
.quiz-search__hint {
    flex: 0 0 auto;
    font-size: 0.85em;
    color: #6b7280;
    font-style: italic;
}
.quiz-search__hint--loose {
    text-align: right;
}
.quiz-search__hint--strict {
    text-align: left;
}
.quiz-search__spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(30, 64, 175, 0.25);
    border-top-color: #1e40af;
    border-radius: 50%;
    animation: quiz-search-spin 0.8s linear infinite;
}
.quiz-search--loading .quiz-search__spinner {
    display: inline-block;
}
.quiz-search--loading .quiz-search__submit {
    opacity: 0.6;
    cursor: wait;
    pointer-events: none;
}
@keyframes quiz-search-spin {
    to { transform: rotate(360deg); }
}

/* Backwards compat: keep old classes mapping to new styles */
.error_notice {
    padding: 12px 16px;
    border-radius: var(--radius);
    font-weight: 500;
    margin-bottom: 16px;
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
    width: auto;
}

.success_notice {
    padding: 12px 16px;
    border-radius: var(--radius);
    font-weight: 500;
    margin-bottom: 16px;
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
    width: auto;
}

/* ---- Forms ---- */
input[type="text"],
input[type="password"],
input[type="email"],
select,
textarea {
    font-family: inherit;
    font-size: 14px;
    padding: 8px 12px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    background: var(--color-surface);
    color: var(--color-text);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgb(37 99 235 / 0.1);
}

input[type="submit"],
button {
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    background: var(--color-primary);
    color: #fff;
    cursor: pointer;
    transition: background 0.15s ease;
}

input[type="submit"]:hover,
button:hover {
    background: var(--color-primary-dark);
}

/* =============================================
   Responsive breakpoints
   Tablet:  max-width 900px
   Phone:   max-width 640px
   ============================================= */

/* ---- Tablet (≤ 900px) ---- */
@media (max-width: 900px) {
    .app-header__inner {
        padding: 0 16px;
    }

    .app-main {
        padding: 24px 16px 36px;
    }

    .app-content {
        padding: 24px;
    }

    .quiz-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 12px;
    }

    .podium {
        max-width: 420px;
        gap: 8px;
    }

    .podium__block--1 { height: 95px; }
    .podium__block--2 { height: 72px; }
    .podium__block--3 { height: 56px; }
    .podium__medal { font-size: 24px; }
    .podium__name { font-size: 13px; }

    .leaderboard {
        padding: 16px;
    }

    .ranking-table th,
    .ranking-table td {
        padding: 8px 8px;
    }

    .ranking-table__quizzes {
        width: 60px;
    }

    .quiz_content {
        width: 100% !important;
    }
}

/* ---- Phone (≤ 640px) ---- */
@media (max-width: 640px) {
    html, body {
        font-size: 14px;
    }

    .app-header__inner {
        padding: 0 12px;
        height: 56px;
    }

    .app-header__brand {
        font-size: 16px;
        gap: 8px;
    }

    .app-header__brand-mark {
        width: 28px;
        height: 28px;
        font-size: 14px;
    }

    .app-header__nav a {
        padding: 6px 8px;
        font-size: 13px;
    }

    .app-banner {
        height: 8px;
    }

    .app-main {
        padding: 16px 12px 28px;
    }

    .app-content {
        padding: 16px;
        border-radius: var(--radius);
    }

    /* Footer stacks vertically */
    .app-footer__inner {
        flex-direction: column;
        align-items: flex-start;
        padding: 16px 12px;
        gap: 8px;
    }

    .app-footer__nav ul {
        flex-wrap: wrap;
        gap: 0;
    }

    /* Quiz grid: 2 columns on wider phones, 1 on narrow */
    .quiz-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 10px;
    }

    .quiz-card {
        padding: 12px;
    }

    .quiz-card__title {
        font-size: 13px;
    }

    .quiz-card__score {
        font-size: 11px;
    }

    /* Podium shrinks */
    .podium {
        max-width: 100%;
        gap: 6px;
    }

    .podium__block {
        font-size: 18px;
        padding-top: 8px;
    }

    .podium__block--1 { height: 80px; }
    .podium__block--2 { height: 60px; }
    .podium__block--3 { height: 46px; }

    .podium__medal { font-size: 20px; }
    .podium__name { font-size: 11px; }
    .podium__points { font-size: 10px; }

    /* Leaderboard cards */
    .leaderboards {
        margin-top: 32px;
    }

    .leaderboards__heading {
        font-size: 18px;
    }

    .leaderboard {
        padding: 12px;
        margin-bottom: 16px;
    }

    .leaderboard-slider__btn {
        width: 32px;
        height: 32px;
        font-size: 18px;
    }

    .leaderboard-slider__dots {
        gap: 6px;
    }

    .leaderboard-slider__dot {
        width: 8px;
        height: 8px;
    }

    .leaderboard__title {
        font-size: 16px;
        margin: 0 0 12px;
    }

    /* Ranking table: compact */
    .ranking-table {
        font-size: 13px;
    }

    .ranking-table th,
    .ranking-table td {
        padding: 6px 6px;
    }

    .ranking-table__rank {
        width: 44px;
    }

    .ranking-table__points {
        width: 60px;
    }

    .ranking-table__quizzes {
        display: none;
    }

    .ranking-table th.ranking-table__quizzes {
        display: none;
    }

    /* Quiz execution (question + answers) */
    .quiz_content {
        width: 100% !important;
        padding: 0 !important;
    }

    .question_content,
    .question_answer_result {
        padding-left: 0;
        font-size: 15px;
    }

    .question_answers {
        padding-left: 0;
    }

    .question_answers_title {
        font-size: 16px;
    }

    .question_title {
        font-size: 16px;
    }

    .answer_text {
        font-size: 14px;
    }

    /* Finish page */
    .finish_quiz {
        font-size: 15px;
    }

    .backlink_div {
        font-size: 14px;
        margin-top: 24px;
    }

    /* Language selection */
    .languageselection {
        padding-left: 0;
    }

    .languageselectionoption {
        font-size: 16px;
    }

    .div_table {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    .div_table_tr {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 8px;
    }

    .div_table_td {
        display: block;
    }

    /* Welcome text */
    .welcome_text_title {
        font-size: 20px;
    }

    .welcome_text {
        width: 100% !important;
        font-size: 14px;
    }

    /* Forms: full width inputs */
    .login, .register, .static-page {
        max-width: 100%;
    }

    .login__actions,
    .register__actions {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        text-align: center;
    }

    .login__register-link,
    .register__login-link {
        text-align: center;
    }

    /* Link next (quiz navigation) */
    .link_next {
        margin-top: 16px;
        font-size: 15px;
    }

    .link_next a {
        display: inline-block;
        padding: 10px 20px;
        background: var(--color-primary);
        color: #fff !important;
        border-radius: 6px;
        text-align: center;
        font-weight: 500;
    }

    .link_next a:hover {
        background: var(--color-primary-dark);
        text-decoration: none !important;
    }

    /* Answer feedback comments */
    .answer_comment {
        padding: 10px 12px;
    }

    .feedback_comment {
        font-size: 14px;
    }
}

/* =============================================
   Quiz selection — cards, podium, ranking
   ============================================= */

.welcome_text_title {
    font-size: 24px;
    font-weight: 700;
    color: var(--color-text);
    margin: 0 0 8px;
}

.welcome_text {
    font-size: 15px;
    color: var(--color-text-muted);
    margin-bottom: 24px;
}

.quizselection_available_quiz {
    font-size: 18px;
    font-weight: 600;
    color: var(--color-text);
    margin: 8px 0 16px;
}

.quiz-groups {
    display: flex;
    flex-direction: column;
    gap: 32px;
    margin-bottom: 32px;
}

.quiz-tabs__nav {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 0 0 0 4px;
    border-bottom: 1px solid var(--color-border);
    margin-bottom: 24px;
}

.quiz-tabs__tab {
    appearance: none;
    border: 1px solid var(--color-border);
    border-bottom: none;
    background: var(--color-bg);
    color: var(--color-text-muted);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    padding: 10px 18px;
    border-top-left-radius: var(--radius);
    border-top-right-radius: var(--radius);
    cursor: pointer;
    margin-bottom: -1px;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.quiz-tabs__tab:hover {
    background: var(--color-surface);
    color: var(--color-text);
}

.quiz-tabs__tab--active {
    background: var(--color-surface);
    color: var(--color-primary);
    border-color: var(--color-border);
    border-bottom-color: var(--color-surface);
    position: relative;
}

.quiz-tabs__tab--active::after {
    content: '';
    position: absolute;
    inset: -1px -1px auto -1px;
    height: 3px;
    background: var(--color-primary);
    border-top-left-radius: var(--radius);
    border-top-right-radius: var(--radius);
}

.quiz-tabs__panel {
    display: none;
    flex-direction: column;
    gap: 32px;
    margin-bottom: 32px;
}

.quiz-tabs__panel--active {
    display: flex;
}

.quiz-tabs__panel[hidden] {
    display: none;
}

.quiz-cluster {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 32px;
}

.quiz-cluster__title {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    color: var(--color-text);
    padding-bottom: 8px;
    border-bottom: 2px solid var(--color-primary);
}

.quiz-topic {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.quiz-topic__title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.quiz-topic-breadcrumb {
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 8px;
}

.open-rounds {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 32px;
    padding: 16px;
    background: #fef3c7;
    border: 1px solid #fcd34d;
    border-radius: var(--radius-lg);
}

.open-rounds__title {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #92400e;
}

.open-rounds__list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 12px;
}

.open-round-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 14px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--color-text);
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.open-round-card:hover {
    transform: translateY(-1px);
    border-color: var(--color-primary);
    box-shadow: var(--shadow);
    color: var(--color-text);
}

.open-round-card__title {
    font-size: 15px;
    font-weight: 600;
}

.open-round-card__topic {
    font-size: 11px;
    font-weight: 500;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.open-round-card__progress {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 4px;
}

.open-round-card__progress-bar {
    height: 6px;
    background: var(--color-border);
    border-radius: 3px;
    overflow: hidden;
}

.open-round-card__progress-fill {
    height: 100%;
    background: var(--color-primary);
    transition: width 0.2s ease;
}

.open-round-card__progress-text {
    font-size: 12px;
    color: var(--color-text-muted);
    font-variant-numeric: tabular-nums;
}

.open-round-card__action {
    margin-top: 4px;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-primary);
}

.quiz-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.quiz-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    text-decoration: none;
    color: var(--color-text);
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.quiz-card__status {
    position: absolute;
    top: 10px;
    right: 10px;
    margin-top: -8px;
}

.traffic-light {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #d1d5db;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.traffic-light--none {
    background: #d1d5db;
}

.traffic-light--red {
    background: #ef4444;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.15), 0 0 6px rgba(239, 68, 68, 0.55);
}

.traffic-light--yellow {
    background: #f59e0b;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.15), 0 0 6px rgba(245, 158, 11, 0.55);
}

.traffic-light--green {
    background: #10b981;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.15), 0 0 6px rgba(16, 185, 129, 0.55);
}

.quiz-card__score {
    margin-top: 6px;
    font-size: 13px;
    color: var(--color-text-muted);
    font-variant-numeric: tabular-nums;
}

.quiz-card__score--none {
    font-style: italic;
}

.quiz-card__score-percent {
    color: var(--color-text-subtle);
}

.quiz-card:hover {
    transform: translateY(-2px);
    border-color: var(--color-primary);
    box-shadow: var(--shadow);
    color: var(--color-text);
}

.quiz-card__image {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: var(--radius);
    background: var(--color-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}

.quiz-card__image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.quiz-card__title {
    font-size: 15px;
    font-weight: 600;
    text-align: center;
}

/* ---- Leaderboards ---- */
.leaderboards {
    margin-top: 48px;
}

.leaderboards__heading {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 24px;
    color: var(--color-text);
}

.leaderboard {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
}

.leaderboard__title {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 20px;
    color: var(--color-text);
}

.leaderboard__empty {
    color: var(--color-text-muted);
    font-style: italic;
    margin: 0;
}

/* ---- Podium ---- */
.podium {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    align-items: end;
    gap: 12px;
    margin-bottom: 24px;
    max-width: 560px;
    margin-left: auto;
    margin-right: auto;
}

.podium__slot {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.podium__user {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    min-height: 70px;
}

.podium__medal {
    font-size: 28px;
    line-height: 1;
}

.podium__names {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    margin-top: 4px;
}

.podium__name {
    font-weight: 600;
    font-size: 14px;
    color: var(--color-text);
    word-break: break-word;
    line-height: 1.25;
}

.podium__points {
    font-size: 13px;
    color: var(--color-text-muted);
}

.podium__block {
    width: 100%;
    color: #fff;
    font-weight: 700;
    font-size: 24px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 12px;
    border-radius: var(--radius) var(--radius) 0 0;
}

.podium__block--1 {
    height: 110px;
    background: linear-gradient(180deg, #fbbf24 0%, #d97706 100%);
    box-shadow: 0 -2px 8px rgba(251, 191, 36, 0.3);
}

.podium__block--2 {
    height: 85px;
    background: linear-gradient(180deg, #d1d5db 0%, #9ca3af 100%);
}

.podium__block--3 {
    height: 65px;
    background: linear-gradient(180deg, #d97706 0%, #92400e 100%);
}

/* ---- Ranking table ---- */
.ranking-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.ranking-table thead {
    background: var(--color-bg);
}

.ranking-table th,
.ranking-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
}

.ranking-table th {
    font-weight: 600;
    color: var(--color-text-muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.ranking-table__rank {
    width: 70px;
    text-align: center;
    font-weight: 600;
}

.ranking-table__rank-num {
    font-size: 12px;
    color: var(--color-text-muted);
    font-weight: 500;
    margin-left: 2px;
}

.ranking-table__points {
    width: 100px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.ranking-table__quizzes {
    width: 80px;
    text-align: right;
    font-variant-numeric: tabular-nums;
    color: var(--color-text-muted);
}

.leaderboard--overall {
    border: 2px solid var(--color-primary);
    background: linear-gradient(180deg, rgba(37, 99, 235, 0.03) 0%, var(--color-surface) 80%);
}

.leaderboard--overall .leaderboard__title {
    color: var(--color-primary);
}

.ranking-table__row--top {
    background: rgba(251, 191, 36, 0.06);
}

.ranking-table__row--me {
    background: rgba(37, 99, 235, 0.08);
    font-weight: 600;
}

.ranking-table__row--me.ranking-table__row--top {
    background: rgba(37, 99, 235, 0.12);
}

/* ---- Leaderboard slider ---- */
.leaderboard-slider {
    margin-top: 8px;
}

.leaderboard-slider__nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 16px;
}

.leaderboard-slider__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    color: var(--color-text);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
    padding: 0;
    flex-shrink: 0;
}

.leaderboard-slider__btn:hover {
    background: var(--color-bg);
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.leaderboard-slider__dots {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.leaderboard-slider__dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: none;
    background: var(--color-border);
    cursor: pointer;
    padding: 0;
    transition: background 0.2s ease, transform 0.2s ease;
}

.leaderboard-slider__dot:hover {
    background: var(--color-primary-light);
    transform: scale(1.2);
}

.leaderboard-slider__dot--active {
    background: var(--color-primary);
    transform: scale(1.2);
}

.leaderboard-slider__icon {
    width: 14px;
    height: 14px;
}

.leaderboard-slider__btn--pause {
    margin-left: 4px;
}

.leaderboard-slider__viewport {
    position: relative;
    overflow: hidden;
    height: 600px;
    max-height: 600px;
    overflow-y: auto;
}

.leaderboard-slider__viewport .leaderboard {
    margin-bottom: 0;
}

.leaderboard-slider__slide {
    display: none;
}

.leaderboard-slider__slide--active {
    display: block;
}

.leaderboard-slider__slide--animating {
    animation: sliderFadeIn 0.35s ease;
}

@keyframes sliderFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* (podium responsive rules consolidated in main responsive section above) */

/* =============================================
   Answer comments (feedback view)
   ============================================= */

.answer_comments {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
    margin-bottom: 20px;
}

.answer_comment {
    padding: 12px 16px;
    border-radius: var(--radius);
    border-left: 3px solid var(--color-border);
    background: var(--color-bg);
}

.answer_comment--valid {
    border-left-color: var(--color-success);
    background: #f0fdf4;
}

.answer_comment--invalid {
    border-left-color: var(--color-error);
    background: #fef2f2;
}

.answer_comment__answer {
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--color-text);
    font-size: 14px;
}

.answer_comment__text {
    font-size: 14px;
    color: var(--color-text);
}

/* =============================================
   Static pages (imprint, etc.)
   ============================================= */

.static-page {
    max-width: 600px;
    margin: 0 auto;
}

.static-page__title {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 20px;
}

.static-page__address {
    font-style: normal;
    font-size: 15px;
    line-height: 1.6;
}

/* =============================================
   Login form
   ============================================= */

.login {
    max-width: 400px;
    margin: 0 auto;
}

.login__title {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 20px;
}

.login__form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.login__field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.login__field label {
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text);
}

.login__field input {
    width: 100%;
}

.login__actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 8px;
}

.login__register-link {
    font-size: 14px;
}

/* =============================================
   Registration form
   ============================================= */

.register {
    max-width: 500px;
    margin: 0 auto;
}

.register__title {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 8px;
}

.register__intro {
    color: var(--color-text-muted);
    margin: 0 0 24px;
}

.register__form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.register__field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.register__field label {
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text);
}

.register__field input[type="text"],
.register__field input[type="email"],
.register__field input[type="password"] {
    width: 100%;
}

.register__field input[readonly] {
    background: var(--color-bg);
    color: var(--color-text-muted);
}

.register__required {
    color: var(--color-error);
}

.register__hint {
    font-size: 13px;
    color: var(--color-text-muted);
    line-height: 1.4;
}

.register__error {
    font-size: 13px;
    color: var(--color-error);
    font-weight: 500;
}

.register__actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 8px;
}

.register__login-link {
    font-size: 14px;
}

/* =============================================
   Application styles (legacy)
   ============================================= */

.center {
    text-align: center;
}

.middle {
    vertical-align: middle !important;
}

.error_notice{
    width: 99%;
    background-color: yellow;
    opacity: 0.7;
    /*color: #fff;*/
    color: #000;
    font-weight: bold;
    /*border: 1px dashed #5F5F5F;*/
    border: 1px dashed red;
    padding: 5px;
}

.javascript, #cookies_disabled {
    width: auto !important;
}

#cookies_disabled {
    /*display: none;*/
}

#toggle_filter{
    padding-bottom: 15px;
}

.success_notice{
    width: 99%;
    background-color: green;
    opacity: 0.7;
    /*color: #fff;*/
    color: #fff;
    font-weight: bold;
    /*border: 1px dashed #5F5F5F;*/
    border: 1px dashed #fff;;
    padding: 5px;
}

#sf_admin_container ul.sf_admin_td_actions li a{
    padding-left: 20px !important;
}

div#mainBottom {
    padding: 0;
}

div#mainBottomCenter div#content {
    /*color:#000000;*/
    color: #5F5F5F !important;
}

div#content {
    margin-top: 20px;
    margin-bottom: 20px;
}

div#content table tbody {
    /*color:#000000;
    font-size:11px;*/
    /*min-height: 285px;*/
    /*height: 285px;*/
    color: #5F5F5F !important;
}

div#content {
    /*display: none;*/
}

.sf_admin_filter{
    display: block;
    position: fixed;
    padding-left: 10px;
    /*position: relative;*/
}

.parent {
    border-top: 1px solid #CDCDCD;
}

ul li{
    /*list-style: none !important;*/
    list-style: none;
}

.menuheading {
    color:#1A60AB;
    font-size:14px;
    font-weight:bold;
    padding-left: 5px;
}

#sf_admin_container th {
    /*background-color: #1A60AB;
    color: #fff;*/
    background-color: #fff;
    color: #535353;
    white-space:nowrap;
}

#sf_admin_container th a, #sf_admin_container th a:hover, #sf_admin_container label {
    color: #535353;
}

.div_table{
    display: table;
}

.div_table_tr{
    display: table-row;
}

.div_table_td{
    display: table-cell;
    vertical-align: top;
}

.question_answers {
    margin-top: 15px;
}

.question_answers .div_table {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.question_answers .div_table_tr,
.question_answers label.answer_row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 0;
}

.question_answers .div_table_td {
    display: block;
}

/* Radio/checkbox column: fixed width, never shrink */
.question_answers .div_table_td:first-child {
    flex: 0 0 auto;
    padding-top: 3px;
}

/* Answer text column: takes remaining space, wraps naturally */
.question_answers .div_table_td.answer_text {
    flex: 1 1 0%;
    min-width: 0;
}

.answer_row {
    cursor: pointer;
}

.answer_row:hover .answer_text {
    color: var(--color-primary, #2563eb);
}

/* Disabled state when question was already answered */
.question_answers--disabled {
    opacity: 0.55;
    pointer-events: none;
}

.question_answers--disabled .answer_row {
    cursor: default;
}

/* "Next" link styled as button (reused in multiple contexts) */
.btn-next {
    display: inline-block;
    padding: 10px 20px;
    background: var(--color-primary);
    color: #fff;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.15s ease;
}

.btn-next:hover {
    background: var(--color-primary-dark);
    color: #fff;
}

.td_separator{
    width: 15px;
    text-align: center;
}

.languageselection{
    vertical-align: middle;
    font-weight: bold;
    color: #898989;
    padding-left: 15px;
}

.languageselection, .languageselection a{
    font-weight: bold;
    color: #898989 !important;
    padding-right: 15px;
    text-decoration: none;
}

.languageselectionoption{
    font-size: 20px;
    padding-bottom: 10px;
}

.flag-icon{
    width: 48px;
    height: auto;
    display: inline-block;
    vertical-align: middle;
    border: 1px solid var(--color-border);
    border-radius: 3px;
}

.languageselect_div{
    padding-top: 0px;
    float: right;
}

/* (link_next styling handled via .btn-next class) */

.languageselection_form{
    padding-left: 15px;
}

.placeholder{
    width: 100%;
    display: block;
    height: 20px;
}

.quizselection, .quizselection a, .quizselection a:hover{
    font-weight: bold;
    font-size: 16px;
    color: #898989 !important;
    padding-right: 15px;
}

.quizselection a:hover{
    color: #898989 !important;
    text-decoration: underline !important;
}

.quizselection_logo{
    max-width: 250px;
    width: 100%;
}

.div_table_td.quizselection{
    padding-bottom: 40px;
    width: 100%;
    max-width: 250px;
}

.td_contentwrap_image{
    width: 100%;
}

.td_contentwrap_text{
    width: 100%;
    text-align: center;
    padding-top: 10px;
}

.clickable{
    cursor: pointer;
}

/* #main #content { */
.bg {
    background-image: url(/images/quizlogo.jpg);
    background-repeat: no-repeat;
    background-position: center right;
}

.backlink_div {
    margin-top: 24px;
}

.backlink_div a {
    display: inline-block;
    padding: 10px 20px;
    background: var(--color-primary);
    color: #fff;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.15s ease;
}

.backlink_div a:hover,
.backlink_div a:visited {
    color: #fff;
    background: var(--color-primary-dark);
    text-decoration: none;
}

.question_title {
    font-size: 18px;
    font-weight: bold;
}

/* Original template values to override */
div#mainBottomCenter #content p {
    color:#5F5F5F;
}

.quiz_content {
    width: 100%;
    max-width: 620px;
    padding: 10px;
}

.question_content, .question_answer_result {
    margin-top: 40px;
    font-size: 16px;
    padding-left: 20px;
}

.question_content img {
    max-width: 100%;
    height: auto;
}

.question_answers_title {
    font-size: 18px;
    font-weight: bold;
    margin-top: 40px;
}

.question_answers {
    padding-left: 20px;
}

.question_answers_submit{
    margin-top: 15px;
}

/* (question_answers layout handled above via flex) */

#error_report_link{
    margin-top: 15px;
}

.answer_select {
    float: left;
    width: 20px;
}

.answer_text {
    padding-left: 5px;
    /*padding-top: 5px;*/
    padding-top: 0px;
    /*float: left;*/
    width: auto;
}

.submit {
    padding: 10px 5px 10px 5px;
}

.answer_valid{
    color: green;
    font-size: 16px;
}

.answer_wrong{
    color: red;
    font-size: 16px;
}

.finish_quiz{
    width: 100%;
    /*text-align: center;*/
    font-size: 16px;
}

.welcome_text {
    width: 100%;
    max-width: 620px;
    font-size: 16px;
    padding-bottom: 20px;
}

.quizselection_available_quiz {
    margin-top: 10px;
    margin-bottom: 10px;
    font-size: 18px;
    font-weight: bold;
}

.welcome_text_title {
    /*margin-top: 10px;*/
    margin-bottom: 10px;
    font-size: 18px;
    font-weight: bold;
}

.link_next {
    margin-top: 20px;
    font-size: 16px;
    text-decoration: none;
}

.error_link a{
    margin-top: 20px;
    color: #5F5F5F !important;
    /*font-size: 16px;
    text-decoration: none;*/
}

.login_table th {
    vertical-align: middle;
    text-align: right;
}

.login_table td {
    vertical-align: middle;
}

.competition_register ul, .competition_register li{
    display: inline;
}

.highscore {
    margin-left: 40px;
    width: 280px;
    font-size: 16px;
    height: 270px;
    overflow-x:hidden;
}

.highscore_list .highscore {
    margin-left: 0px;
}

.highscore .title {
    width: 100%;
    /*font-size: 16px;*/
    font-size: 20px;
    font-weight: bold;
    border-bottom: 1px solid #5F5F5F;
    margin-bottom: 10px;
    /*line-height: 1.5em;*/
}

.highscore .rank {
    width: 60px;
}

.highscore .name {
    width: 110px;
}

.highscore .points {
    width: 110px;
    text-align: right;
}

.finish_quiz .title {
    width: 100%;
    font-size: 20px;
    font-weight: bold;
    /*color: #000;*/
    margin-bottom: 15px;
}

.highscore .div_table {
    /*width: 100%;*/
    width: 280px;
}

.highscore .div_table_td {
    /*padding-right: 35px;*/
    vertical-align: bottom;
    display: inline;
    float: left;
}

.highscore_link {
    
}

.finish_quiz div_table {
    width: 100%;
}

.finish_quiz .div_table_td {
    border-bottom: 1px solid #5F5F5F;
    padding-top: 15px;
}

.div_table_td .legend {
    font-weight: bold;
    width: 180px;
}

.div_table_td .legend .info {
    font-weight: normal;
    vertical-align: bottom;
}

.div_table_td .value {
    text-align: right;
    font-weight: bold;
    font-size: 18px;
    vertical-align: bottom;
    width: 120px;
}

.div_table_td.value.overall, .div_table_td.legend.overall {
    padding-top: 25px;
    font-size: 22px;
    color: red;
}

.competition_register {
    width: 400px;
    padding-bottom: 20px;
    float: left;
}

.competition_comment {
    float: left;
    padding-top: 100px;
    width: 250px;
}

.competition_register .div_table_td {
       padding-top: 15px;
}

span.aButton {
    margin-right: 10px;
}

.error_list li{
    color: red;
}

/* Top navigation */

ul#topNavi {
    list-style: none;
    padding: 0;
    margin: 0;
    float: left;
}

ul#topNavi li {
    display: inline;
    margin-right: 0;
}

ul#topNavi li a {
    color: #878789;
    font-size: 11px;
    margin: 0 2px;
    padding-left: 5px;
    text-decoration: none;
}

ul#topNavi li a:hover {
    color: #1A61B1;
}

.topSeparator {
    color: #878789;
    float: left;
}

/*
 suckerfish menu implementation
*/

.pointerclass{
    cursor: pointer;
}

.topnav{
   /*background-color: #1A2020;*/
    /*background-color: #333;*/
    border: 1px solid #DDDDDD;
    padding: 5px 0px 5px 0px;
    display: block;
    position: relative;
    z-index: 999 !important;
    margin: 20px 0px 20px 0px;
    /*width: 880px;*/
    /*width: auto;*/
    height: 30px;
    text-align: left;
    margin-left: auto;
    margin-right: auto;
    margin-top: 0px;
    
}


#nav{
    /*background-color: #1A2020;*/
    background-color: #fff;
    border: 0px solid #fff;
    z-index: 999 !important;
    padding: 0 0 0 10px;
    margin: 0;
    list-style: none;
    z-index: 999 !important;
}

#nav ul {
    /*background-color: #1A2020;*/
    background-color: #fff;
    border-top: 0px solid #fff;
    border-right: 2px solid #DDDDDD;
    border-bottom: 2px solid #DDDDDD;
    border-left: 1px solid #DDDDDD;
    z-index: 999 !important;
    padding: 5px;
    margin: 0;
    list-style: none;
}

#nav ul li ul{
    /*background-color: #1A2020;*/
    background-color: #fff;
    border-top: 1px solid #DDDDDD;
    border-right: 2px solid #DDDDDD;
    border-bottom: 2px solid #DDDDDD;
    border-left: 0px solid #fff;
    
    z-index: 999 !important;
    padding: 5px;
    margin: 0;
    list-style: none;
}

#nav .menuheading{
    font-size: 10px;
    overflow: hidden;
}

#nav .root {
    overflow: hidden;
}

#nav a {
    z-index: 999 !important;
    display: block;
    width: 10em;
    color: #878789;
    text-decoration: none;
}

#nav a:hover {
    text-decoration: underline;
    color: #1A61B1;
}

#nav li {
    z-index: 999 !important;
    float: left;
    padding-top: 3px;
    padding-bottom: 3px;
    width: 132px;
}

#nav li ul {
    z-index: 999 !important;
    position: absolute;
    width: 10em;
    left: -999em;
}

#nav li:hover ul {
    z-index: 999 !important;
    left: auto;
}

#nav li:hover ul, #nav li.sfhover ul {
    z-index: 999 !important;
    left: auto;
}

/* more levels */

/* level 2 */
#nav li ul ul {
    z-index: 999 !important;
    margin: -1em 0 0 10em;
}

/*
#nav, #nav ul {
    z-index: 999 !important;
    padding: 0;
    margin: 0;
    list-style: none; 
    line-height: 1;
}*/

#nav li:hover ul ul, #nav li.sfhover ul ul {
    z-index: 999 !important;
    left: -999em;
}

#nav li:hover ul, #nav li li:hover ul, #nav li.sfhover ul, #nav li li.sfhover ul {
    z-index: 999 !important;
    left: auto;
}

/* level 3 */
#nav li:hover ul ul, #nav li:hover ul ul ul, #nav li.sfhover ul ul, #nav li.sfhover ul ul ul {
    z-index: 999 !important;
    left: -999em;
}

#nav li:hover ul, #nav li li:hover ul, #nav li li li:hover ul, #nav li.sfhover ul, #nav li li.sfhover ul, #nav li li li.sfhover ul {
    z-index: 999 !important;
    left: auto;
}

/* level 4 */
#nav li:hover ul ul, #nav li:hover ul ul ul, #nav li:hover ul ul ul ul, #nav li.sfhover ul ul, #nav li.sfhover ul ul ul, #nav li.sfhover ul ul ul ul {
    z-index: 999 !important;
    left: -999em;
}

#nav li:hover ul, #nav li li:hover ul, #nav li li li:hover ul, #nav li li li li:hover ul, #nav li.sfhover ul, #nav li li.sfhover ul, #nav li li li.sfhover ul, #nav li li li li.sfhover ul {
    z-index: 999 !important;
    left: auto;
}

/* =============================================
   Cloze (Lückentext) styles
   ============================================= */

/* ── Cloze (Lückentext) ─────────────────────────────────────────────────── */

/* Flowing text container — extra line-height so inline inputs don't clip */
.cloze_base_text {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.25rem;
    line-height: 2.6;
    font-size: 1rem;
    white-space: pre-wrap;
    word-break: break-word;
}

/* Inline text input — underline-only style */
.cloze_gap_input {
    display: inline-block;
    min-width: 6ch;
    width: 9ch;       /* starting width; overridden by JS as the user types */
    max-width: 60ch;
    padding: 0.1rem 0.3rem;
    border: none;
    border-bottom: 2px solid var(--color-primary);
    border-radius: 0;
    background: transparent;
    font-size: inherit;
    font-family: inherit;
    color: var(--color-text);
    text-align: center;
    vertical-align: baseline;
    transition: border-bottom-color 0.15s ease, background 0.15s ease, width 0.1s ease;
}

.cloze_gap_input:focus {
    outline: none;
    border-bottom-color: var(--color-primary);
    background: rgba(37, 99, 235, 0.06);
}

.cloze_gap_input--disabled {
    border-bottom-color: var(--color-border);
    cursor: not-allowed;
}

/* Inline dropdown for c_choice_text */
.cloze_gap_select {
    display: inline-block;
    min-width: 10ch;
    padding: 0.05rem 0.25rem;
    border: none;
    border-bottom: 2px solid var(--color-primary);
    border-radius: 0;
    background: transparent;
    font-size: inherit;
    font-family: inherit;
    color: var(--color-text);
    vertical-align: baseline;
    cursor: pointer;
}

.cloze_gap_select:focus {
    outline: none;
    background: rgba(37, 99, 235, 0.06);
}

.cloze_gap_select--disabled {
    border-bottom-color: var(--color-border);
    cursor: not-allowed;
}

.cloze_submit {
    margin-top: 1rem;
}

/* Feedback: inline coloured spans */
.cloze_gap_result {
    display: inline;
    padding: 0.05rem 0.35rem;
    border-radius: 3px;
    font-weight: 600;
}

.cloze_gap--correct {
    background: #d1fae5;
    color: #065f46;
}

.cloze_gap--wrong {
    background: #fee2e2;
    color: #991b1b;
    text-decoration: line-through;
}

/* Correct answer hint shown after a wrong gap */
.cloze_gap_correct_answer {
    display: inline-block;
    margin-left: 0.25rem;
    padding: 0.05rem 0.35rem;
    background: #d1fae5;
    color: #065f46;
    border-radius: 3px;
    font-weight: 600;
    text-decoration: none;
    font-style: normal;
}
