:root {
    --background: #f5f6f3;
    --surface: #ffffff;
    --surface-soft: #ecefe9;
    --surface-strong: #e4e8e1;
    --text: #171b18;
    --muted: #6b736d;
    --muted-strong: #4f5852;
    --line: #dde2dc;
    --line-strong: #cbd2cb;
    --brand: #1f5a42;
    --brand-hover: #174934;
    --brand-soft: #e5f0e9;
    --accent: #d9a441;
    --danger: #b13c36;
    --danger-soft: #f8e9e7;
    --success: #2f7758;
    --success-soft: #e7f2eb;
    --radius-xl: 28px;
    --radius-lg: 20px;
    --radius: 14px;
    --radius-sm: 10px;
    --shadow-soft: 0 18px 50px rgba(25, 38, 29, 0.07);
    --shadow-float: 0 18px 56px rgba(20, 32, 24, 0.13);
    --content: 1180px;
    --content-wide: 1480px;
    --sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --serif: Georgia, "Times New Roman", serif;
}

html.dark {
    color-scheme: dark;
    --background: #0c0f0d;
    --surface: #141916;
    --surface-soft: #1b211d;
    --surface-strong: #242c27;
    --text: #f2f4f1;
    --muted: #8d9891;
    --muted-strong: #b8c0bb;
    --line: #29312c;
    --line-strong: #3a443d;
    --brand: #f47a1f;
    --brand-hover: #ff944a;
    --brand-soft: #332117;
    --accent: #f0a35f;
    --danger: #ef8079;
    --danger-soft: #3f2522;
    --success: #78bd98;
    --success-soft: #20372b;
    --shadow-soft: 0 20px 54px rgba(0, 0, 0, 0.24);
    --shadow-float: 0 24px 72px rgba(0, 0, 0, 0.38);
}

* { box-sizing: border-box; }

html { background: var(--background); scroll-behavior: smooth; }

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background:
        radial-gradient(circle at 12% 0%, rgba(31, 90, 66, 0.05), transparent 28rem),
        var(--background);
    color: var(--text);
    font-family: var(--sans);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

html.dark body {
    background:
        radial-gradient(circle at 74% -8%, rgba(244, 122, 31, 0.10), transparent 32rem),
        radial-gradient(circle at 10% 8%, rgba(69, 113, 85, 0.10), transparent 28rem),
        var(--background);
}

a { color: inherit; }

button,
input,
select,
textarea { font: inherit; }

button,
a { -webkit-tap-highlight-color: transparent; }

::selection { background: var(--brand-soft); color: var(--text); }

:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--brand) 35%, transparent);
    outline-offset: 3px;
}

/* Shell */
.topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    width: 100%;
    background: color-mix(in srgb, var(--background) 88%, transparent);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid color-mix(in srgb, var(--line) 75%, transparent);
}

.topbar-inner {
    width: min(var(--content), calc(100% - 40px));
    min-height: 70px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    color: var(--text);
    text-decoration: none;
    flex: 0 0 auto;
}

.brand-sign {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
}
.brand-sign img {
    display: block;
    width: 42px;
    height: 42px;
    object-fit: contain;
    filter: drop-shadow(0 5px 10px rgba(0, 0, 0, 0.10));
}
html.dark .brand-sign img { filter: drop-shadow(0 7px 15px rgba(0, 0, 0, 0.32)); }

.brand-copy {
    display: grid;
    line-height: 1.05;
}

.brand-name {
    font-family: var(--serif);
    font-size: 21px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.brand-note {
    margin-top: 4px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.navigation {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 5px;
    min-width: 0;
}

.navigation a,
.nav-link-button {
    position: relative;
    min-height: 38px;
    padding: 9px 10px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--muted-strong);
    font-size: 13px;
    font-weight: 650;
    text-decoration: none;
    cursor: pointer;
    transition: color .15s ease, background .15s ease;
}

.navigation a:hover,
.nav-link-button:hover { color: var(--text); background: var(--surface-soft); }

.navigation a.active { color: var(--text); }
.navigation a.active::after {
    content: "";
    position: absolute;
    left: 10px;
    right: 10px;
    bottom: 3px;
    height: 2px;
    border-radius: 999px;
    background: var(--brand);
}

.navigation .nav-cta {
    margin-left: 4px;
    padding-inline: 14px;
    background: var(--text);
    color: var(--surface);
}
.navigation .nav-cta:hover { background: var(--brand); color: #fff; }
.navigation .nav-cta.active::after { display: none; }

.nav-user {
    max-width: 150px;
    padding: 0 5px 0 11px;
    overflow: hidden;
    color: var(--muted);
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nav-logout-form { margin: 0; }

.theme-toggle {
    display: inline-grid;
    place-items: center;
    width: 38px;
    height: 38px;
    min-height: 38px;
    margin-left: 5px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--muted-strong);
    cursor: pointer;
    transition: background .15s ease, color .15s ease, transform .15s ease;
}
.theme-toggle:hover { background: var(--surface-soft); color: var(--text); }
.theme-toggle:active { transform: scale(.96); }
.theme-icon {
    grid-area: 1 / 1;
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: opacity .18s ease, transform .18s ease;
}
.theme-icon-moon { opacity: 1; transform: scale(1) rotate(0); }
.theme-icon-sun { opacity: 0; transform: scale(.75) rotate(-18deg); }
html.dark .theme-icon-moon { opacity: 0; transform: scale(.75) rotate(18deg); }
html.dark .theme-icon-sun { opacity: 1; transform: scale(1) rotate(0); }

.page {
    width: min(var(--content), calc(100% - 40px));
    margin: 0 auto;
    padding: 64px 0 88px;
    flex: 1;
}

.page:has(#questionsForm) { width: min(var(--content-wide), calc(100% - 40px)); }

.footer {
    width: min(var(--content), calc(100% - 40px));
    margin: 0 auto;
    padding: 24px 0 34px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    color: var(--muted);
    font-size: 12px;
    border-top: 1px solid var(--line);
}
.footer p { margin: 0; }
.footer a { color: var(--muted-strong); font-weight: 750; text-decoration: none; }
.footer a:hover { color: var(--brand); }

/* Type */
.eyebrow {
    margin: 0 0 11px;
    color: var(--brand);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

h1, h2, h3, p { overflow-wrap: anywhere; }

h1 {
    margin: 0;
    max-width: 900px;
    font-size: clamp(40px, 6.4vw, 72px);
    line-height: 0.98;
    letter-spacing: -0.045em;
    font-weight: 720;
}

h2 { letter-spacing: -0.025em; }

.muted { color: var(--muted); }

.page-header {
    max-width: 820px;
    margin-bottom: 38px;
}
.page-header h1 { font-size: clamp(38px, 5.5vw, 58px); }
.page-header > p:not(.eyebrow) {
    max-width: 680px;
    margin: 16px 0 0;
    color: var(--muted);
    font-size: 16px;
    line-height: 1.65;
}

/* Actions */
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 10px 17px;
    border: 0;
    border-radius: 11px;
    font-size: 14px;
    font-weight: 750;
    text-decoration: none;
    cursor: pointer;
    transition: transform .15s ease, background .15s ease, color .15s ease;
}
.button:hover { transform: translateY(-1px); }
.button:active { transform: translateY(0); }

.button-primary { background: var(--text); color: var(--surface); }
.button-primary:hover { background: var(--brand); color: #fff; }

.button-secondary { background: var(--surface-soft); color: var(--text); }
.button-secondary:hover { background: var(--surface-strong); }

.button-danger { background: var(--danger-soft); color: var(--danger); }
.button-danger:hover { background: var(--danger); color: #fff; }

/* Home */
.hero {
    position: relative;
}

.home-page .topbar {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 50;
    background: linear-gradient(180deg, rgba(4, 5, 5, .72) 0%, rgba(4, 5, 5, .30) 68%, transparent 100%);
    backdrop-filter: none;
    border-bottom: 0;
}

.home-page .brand,
.home-page .navigation a,
.home-page .nav-link-button,
.home-page .theme-toggle {
    color: rgba(255, 255, 255, .86);
}

.home-page .brand-name { color: #fff; }
.home-page .brand-note,
.home-page .nav-user { color: rgba(255, 255, 255, .58); }

.home-page .navigation a:hover,
.home-page .nav-link-button:hover,
.home-page .theme-toggle:hover {
    color: #fff;
    background: rgba(255, 255, 255, .10);
}

.home-page .navigation .nav-cta {
    background: rgba(255, 255, 255, .94);
    color: #111512;
}
.home-page .navigation .nav-cta:hover { background: #fff; color: #111512; }

.home-page .page {
    width: 100%;
    max-width: none;
    padding: 0 0 88px;
}

.hero-cover {
    min-height: 100vh;
    min-height: 100svh;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
    isolation: isolate;
    background: #090b0a;
}

.hero-cover-media,
.hero-cover-shade {
    position: absolute;
    inset: 0;
}

.hero-cover-media { z-index: -3; }
.hero-cover-media img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: center 52%;
    transform: scale(1.01);
}

.hero-cover-shade {
    z-index: -2;
    background:
        linear-gradient(90deg, rgba(4, 6, 5, .86) 0%, rgba(4, 6, 5, .70) 36%, rgba(4, 6, 5, .24) 72%, rgba(4, 6, 5, .35) 100%),
        linear-gradient(180deg, rgba(4, 5, 5, .18) 0%, rgba(4, 5, 5, .10) 42%, rgba(4, 5, 5, .82) 100%);
}

.hero-cover::after {
    content: "";
    position: absolute;
    inset: auto 0 0;
    height: 28%;
    z-index: -1;
    background: linear-gradient(180deg, transparent, rgba(4, 6, 5, .54));
    pointer-events: none;
}

.hero-cover .hero-content {
    width: min(var(--content), calc(100% - 40px));
    max-width: none;
    margin: 0 auto;
    padding: clamp(170px, 23vh, 270px) 0 clamp(90px, 12vh, 132px);
    color: #fff;
}

.hero-cover .eyebrow {
    color: #ff974f;
    text-shadow: 0 1px 18px rgba(0, 0, 0, .35);
}

.hero-cover h1 {
    max-width: 820px;
    color: #fff;
    font-size: clamp(48px, 7.6vw, 92px);
    line-height: .94;
    text-wrap: balance;
    text-shadow: 0 4px 28px rgba(0, 0, 0, .30);
}

.hero-cover .hero-text {
    max-width: 660px;
    margin: 26px 0 0;
    color: rgba(255, 255, 255, .78);
    font-size: clamp(18px, 2vw, 22px);
    line-height: 1.58;
    text-shadow: 0 2px 18px rgba(0, 0, 0, .30);
}

.hero-cover .hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 32px;
}

.hero-cover .button-primary {
    background: #f47a1f;
    color: #fff;
}
.hero-cover .button-primary:hover { background: #ff9140; color: #fff; }

.hero-cover .button-secondary {
    background: rgba(255, 255, 255, .12);
    color: #fff;
    backdrop-filter: blur(14px);
}
.hero-cover .button-secondary:hover { background: rgba(255, 255, 255, .20); }

.hero-cycle {
    position: absolute;
    right: max(20px, calc((100vw - var(--content)) / 2));
    bottom: 42px;
    display: grid;
    gap: 4px;
    max-width: 330px;
    color: #fff;
    text-align: right;
}
.hero-cycle span {
    color: rgba(255, 255, 255, .52);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .14em;
    text-transform: uppercase;
}
.hero-cycle strong {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: -.01em;
}

.home-page .features {
    width: min(var(--content), calc(100% - 40px));
    margin: 0 auto;
    padding-top: 10px;
}

.features {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 0;
}
.feature-card {
    position: relative;
    padding: 34px 34px 12px 0;
    background: transparent;
}
.feature-card + .feature-card { padding-left: 34px; border-left: 1px solid var(--line); }
.feature-index {
    display: inline-block;
    margin-bottom: 42px;
    color: var(--muted);
    font-family: var(--serif);
    font-size: 15px;
}
.feature-card h2 { margin: 0 0 10px; font-size: 20px; }
.feature-card p { margin: 0; color: var(--muted); line-height: 1.7; }

/* Shared surface patterns */
.placeholder-card,
.settings-card,
.dashboard-panel,
.auth-card,
.server-card {
    background: var(--surface);
    border: 0;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
}

.placeholder-card { max-width: 720px; padding: 32px; }
.placeholder-card h2 { margin: 0 0 9px; }
.placeholder-card p { margin: 0 0 20px; color: var(--muted); line-height: 1.7; }

.status-message,
.global-status {
    padding: 12px 14px;
    border: 0;
    border-radius: var(--radius-sm);
    background: var(--brand-soft);
    color: var(--brand);
}
.global-status { width: min(760px, 100%); margin: 0 auto 22px; }

/* Auth */
.auth-card {
    width: min(560px, 100%);
    margin: 24px auto 0;
    padding: clamp(28px, 5vw, 48px);
}
.auth-card h1 {
    margin-bottom: 28px;
    font-size: clamp(38px, 6vw, 54px);
}
.auth-help { margin: -10px 0 24px; color: var(--muted); line-height: 1.65; }
.auth-form { display: grid; gap: 18px; }
.auth-form label:not(.auth-checkbox) { display: grid; gap: 7px; font-size: 13px; font-weight: 750; }
.auth-form input[type="text"],
.auth-form input[type="email"],
.auth-form input[type="password"] {
    width: 100%;
    min-height: 48px;
    padding: 11px 13px;
    border: 1px solid transparent;
    border-radius: 11px;
    outline: 0;
    background: var(--surface-soft);
    color: var(--text);
    transition: background .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.auth-form input:focus {
    background: var(--surface);
    border-color: var(--brand);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 12%, transparent);
}
.auth-form > a { justify-self: start; color: var(--muted-strong); font-size: 13px; font-weight: 650; }
.auth-checkbox { display: flex; align-items: center; gap: 9px; color: var(--muted-strong); font-size: 13px; }
.auth-checkbox input { width: 17px; height: 17px; accent-color: var(--brand); }
.form-error { color: var(--danger); font-size: 12px; font-weight: 600; }
.auth-switch { margin: 24px 0 0; color: var(--muted); font-size: 14px; }
.auth-switch a { color: var(--text); font-weight: 750; }

/* Account */
.account-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.settings-card { padding: 30px; }
.settings-card h1 { margin-bottom: 26px; font-size: clamp(36px, 5vw, 50px); }
.settings-card h2 { margin: 0 0 20px; font-size: 21px; }
.settings-card .auth-help { margin: 0 0 20px; }
.account-card-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.danger-zone { background: color-mix(in srgb, var(--danger-soft) 50%, var(--surface)); box-shadow: none; }
.secret-code,
.recovery-codes,
.uri-code {
    padding: 16px;
    border-radius: var(--radius-sm);
    background: var(--surface-soft);
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    word-break: break-all;
}
.secret-code, .recovery-codes { margin: 18px 0; }
.recovery-codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 18px; }
.uri-code { display: block; margin: 12px 0 20px; overflow-wrap: anywhere; }

/* Dashboard */
.dashboard-welcome {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 40px;
    padding: 18px 0 44px;
    border-bottom: 1px solid var(--line);
}
.dashboard-welcome h1 { max-width: 760px; font-size: clamp(40px, 6vw, 64px); }
.dashboard-welcome p:not(.eyebrow) { max-width: 640px; margin: 16px 0 0; color: var(--muted); line-height: 1.7; }
.dashboard-actions { display: flex; flex-wrap: wrap; gap: 9px; flex: 0 0 auto; }
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin: 0 0 28px;
    border-bottom: 1px solid var(--line);
}
.dashboard-stats article { padding: 25px 24px 25px 0; }
.dashboard-stats article + article { padding-left: 24px; border-left: 1px solid var(--line); }
.dashboard-stats strong { display: block; font-size: 31px; line-height: 1.1; letter-spacing: -0.035em; }
.dashboard-stats span { display: block; margin-top: 7px; color: var(--muted); font-size: 12px; }
.dashboard-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.dashboard-panel { padding: 27px; }
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 10px; }
.section-heading h2 { margin: 0; font-size: 20px; }
.section-heading .eyebrow { margin-bottom: 5px; }
.section-heading > a { color: var(--muted-strong); font-size: 12px; font-weight: 750; text-decoration: none; white-space: nowrap; }
.section-heading > a:hover { color: var(--brand); }
.dashboard-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 15px 0;
    border-top: 1px solid var(--line);
    color: var(--text);
    text-decoration: none;
}
.dashboard-row:hover strong { color: var(--brand); }
.dashboard-row span:first-child { display: grid; gap: 4px; min-width: 0; }
.dashboard-row strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; transition: color .15s ease; }
.dashboard-row small { color: var(--muted); }
.dashboard-row b { font-size: 17px; }
.dashboard-empty { padding: 24px 0 6px; border-top: 1px solid var(--line); color: var(--muted); }
.dashboard-empty a { color: var(--brand); font-weight: 750; }
.editor-page-header, .player-page-header { margin-bottom: 28px; }

/* Share & history */
.share-panel { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line); }
.share-row { display: flex; flex-wrap: wrap; gap: 9px; align-items: center; }
#shareUrl {
    flex: 1 1 360px;
    min-height: 42px;
    padding: 9px 12px;
    border: 1px solid transparent;
    border-radius: 9px;
    background: var(--surface-soft);
    color: var(--text);
}
.share-hint, .history-meta, .history-score span { color: var(--muted); font-size: 13px; }
.share-hint { margin-top: 9px; }
.shared-banner { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 18px; }
.history-list, .history-details { display: grid; gap: 10px; }
.history-card {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    padding: 19px 2px;
    border-bottom: 1px solid var(--line);
    color: var(--text);
    text-decoration: none;
}
.history-card:first-child { border-top: 1px solid var(--line); }
.history-card:hover strong { color: var(--brand); }
.history-meta { margin-top: 5px; }
.history-score { display: grid; text-align: right; }
.history-score strong { font-size: 22px; }
.history-answer {
    position: relative;
    padding: 24px 26px 24px 31px;
    border-radius: var(--radius);
    background: var(--surface);
}
.history-answer::before {
    content: "";
    position: absolute;
    left: 0;
    top: 18px;
    bottom: 18px;
    width: 3px;
    border-radius: 999px;
}
.history-answer.is-correct::before { background: var(--success); }
.history-answer.is-wrong::before { background: var(--danger); }
.history-answer h2 { margin: 0 0 13px; font-size: 18px; }
.history-answer p { margin: 7px 0; color: var(--muted-strong); }
.history-back { margin-top: 24px; }
.history-back a { color: var(--muted-strong); font-weight: 750; text-decoration: none; }
.history-back a:hover { color: var(--brand); }
.history-pagination { margin-top: 24px; }

/* Admin */
.admin-header { max-width: none; }
.admin-header h1 { margin-bottom: 24px; }
.admin-tabs,
.admin-filter-tabs { display: flex; flex-wrap: wrap; gap: 18px; }
.admin-tabs a,
.admin-filter-tabs a {
    position: relative;
    padding: 4px 0 8px;
    color: var(--muted);
    text-decoration: none;
    font-size: 13px;
    font-weight: 750;
}
.admin-tabs a:hover,
.admin-filter-tabs a:hover,
.admin-tabs a.active,
.admin-filter-tabs a.active { color: var(--text); }
.admin-tabs a.active::after,
.admin-filter-tabs a.active::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2px;
    border-radius: 999px;
    background: var(--brand);
}
.admin-filter-tabs { margin-bottom: 18px; }
.admin-stats {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    margin-bottom: 26px;
    border-block: 1px solid var(--line);
}
.admin-stats article { padding: 20px 18px 20px 0; }
.admin-stats article + article { padding-left: 18px; border-left: 1px solid var(--line); }
.admin-stats strong { display: block; font-size: 28px; letter-spacing: -.03em; }
.admin-stats span { color: var(--muted); font-size: 12px; }
.admin-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.admin-list { display: grid; }
.admin-list > a,
.admin-list > span {
    display: grid;
    gap: 3px;
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
    color: var(--text);
    text-decoration: none;
}
.admin-list > a:first-child,
.admin-list > span:first-child { border-top: 1px solid var(--line); }
.admin-list > a:hover strong { color: var(--brand); }
.admin-list span, .admin-list small { color: var(--muted); }
.admin-search { display: flex; gap: 9px; margin-bottom: 18px; }
.admin-search input {
    flex: 1;
    min-height: 45px;
    padding: 10px 13px;
    border: 1px solid transparent;
    border-radius: 11px;
    outline: 0;
    background: var(--surface);
    color: var(--text);
}
.admin-search input:focus { border-color: var(--brand); }
.admin-table-wrap { overflow-x: auto; background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-soft); }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th, .admin-table td { padding: 14px 16px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.admin-table tbody tr:last-child td { border-bottom: 0; }
.admin-table th { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .09em; }
.admin-table a { color: var(--text); text-decoration: none; }
.admin-table a:hover { color: var(--brand); }
.admin-table small { color: var(--muted); }
.admin-badge { display: inline-block; margin: 2px 3px 2px 0; padding: 4px 8px; border-radius: 999px; background: var(--surface-soft); font-size: 10px; font-weight: 800; }
.admin-badge.ok { color: var(--success); }
.admin-badge.danger { color: var(--danger); background: var(--danger-soft); }
.admin-text-danger { border: 0; padding: 0; background: transparent; color: var(--danger); font: inherit; font-weight: 750; cursor: pointer; }
.admin-pagination { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 20px; color: var(--muted); }
.admin-dl { display: grid; grid-template-columns: minmax(120px, .7fr) 1.3fr; gap: 10px 18px; }
.admin-dl dt { color: var(--muted); }
.admin-dl dd { margin: 0; }
.admin-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 22px; }
.report-list { margin-top: 18px; }
.report-box { margin: 12px 0 20px; color: var(--muted); }
.report-box summary { cursor: pointer; font-weight: 750; color: var(--muted-strong); }
.report-form { width: min(600px, 100%); display: grid; gap: 12px; margin-top: 12px; padding: 20px; border-radius: var(--radius); background: var(--surface); }
.report-form label { display: grid; gap: 6px; font-weight: 700; color: var(--text); }
.report-form select, .report-form textarea { width: 100%; padding: 10px 12px; border: 1px solid transparent; border-radius: 9px; background: var(--surface-soft); color: var(--text); }
.report-form select:focus, .report-form textarea:focus { border-color: var(--brand); outline: none; }

/* Feedback */
.feedback-page-header { max-width: 850px; }
.feedback-page-header .button { margin-top: 22px; }
.feedback-form-card { width: min(820px, 100%); }
.feedback-form { display: grid; gap: 20px; }
.feedback-form label,
.feedback-filters label { display: grid; gap: 7px; color: var(--text); font-size: 13px; font-weight: 750; }
.feedback-form input,
.feedback-form select,
.feedback-form textarea,
.feedback-filters select {
    width: 100%;
    min-height: 48px;
    padding: 11px 13px;
    border: 1px solid transparent;
    border-radius: 11px;
    outline: 0;
    background: var(--surface-soft);
    color: var(--text);
    transition: background .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.feedback-form textarea { min-height: 180px; resize: vertical; line-height: 1.6; }
.feedback-form input:focus,
.feedback-form select:focus,
.feedback-form textarea:focus,
.feedback-filters select:focus {
    background: var(--surface);
    border-color: var(--brand);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 12%, transparent);
}
.form-hint { color: var(--muted); font-size: 12px; font-weight: 500; }
.feedback-form-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.feedback-history { padding-block: 8px; }
.feedback-user-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(130px, auto);
    align-items: center;
    gap: 20px;
    padding: 18px 0;
    border-bottom: 1px solid var(--line);
}
.feedback-user-item:last-child { border-bottom: 0; }
.feedback-user-main { display: grid; gap: 4px; min-width: 0; }
.feedback-user-main strong { overflow-wrap: anywhere; }
.feedback-user-main span,
.feedback-user-item time { color: var(--muted); font-size: 12px; }
.feedback-user-item time { text-align: right; white-space: nowrap; }
.feedback-empty { padding: 26px 0; text-align: center; }
.feedback-empty h2 { margin-bottom: 8px; }
.feedback-empty p { margin: 0 0 20px; color: var(--muted); }
.feedback-badge {
    display: inline-flex;
    align-items: center;
    width: max-content;
    padding: 5px 9px;
    border-radius: 999px;
    background: var(--surface-soft);
    color: var(--muted-strong);
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
}
.feedback-badge.is-new { background: var(--brand-soft); color: var(--brand); }
.feedback-badge.is-reviewing { background: color-mix(in srgb, var(--accent) 18%, var(--surface)); color: var(--accent); }
.feedback-badge.is-planned { background: color-mix(in srgb, #7b78dd 18%, var(--surface)); color: #827ee8; }
.feedback-badge.is-implemented { background: var(--success-soft); color: var(--success); }
.feedback-badge.is-rejected { background: var(--danger-soft); color: var(--danger); }
.feedback-filters {
    display: flex;
    align-items: end;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 18px;
}
.feedback-filters label { flex: 1 1 220px; }
.feedback-filters select { background: var(--surface); }
.feedback-detail-header .admin-tabs { margin-top: 24px; }
.feedback-admin-grid { grid-template-columns: minmax(0, 1.35fr) minmax(320px, .65fr); }
.feedback-detail-card h2 { margin-top: 30px; }
.feedback-detail-card a { color: var(--text); }
.feedback-detail-card a:hover { color: var(--brand); }
.feedback-message {
    margin: 0;
    padding: 18px;
    border-radius: var(--radius-sm);
    background: var(--surface-soft);
    color: var(--muted-strong);
    line-height: 1.75;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}
.feedback-delete-form { margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--line); }

/* Old server utility */
.server-card { margin-top: 24px; padding: 26px; }
.server-card h2 { margin-top: 0; }
.server-card p { margin-bottom: 0; color: var(--muted); }
#serverQuizForm { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
#serverQuizForm label { width: 100%; font-weight: 750; }
#serverQuizTitle { flex: 1 1 280px; min-height: 46px; padding: 10px 13px; border: 1px solid transparent; border-radius: 10px; background: var(--surface-soft); color: var(--text); }
#serverQuizTitle:focus { border-color: var(--brand); outline: none; }
#serverQuizMessage { min-height: 24px; color: var(--muted); }

/* Responsive */
@media (max-width: 980px) {
    .topbar-inner { align-items: flex-start; flex-direction: column; gap: 10px; padding: 13px 0 12px; }
    .navigation { width: 100%; justify-content: flex-start; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
    .navigation::-webkit-scrollbar { display: none; }
    .nav-user { display: none; }
    .dashboard-welcome { align-items: flex-start; flex-direction: column; }
    .dashboard-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 0; }
    .dashboard-stats article:nth-child(3) { border-left: 0; }
    .dashboard-stats article:nth-child(n+3) { border-top: 1px solid var(--line); }
    .dashboard-grid { grid-template-columns: 1fr; }
    .admin-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .admin-stats article:nth-child(odd) { border-left: 0; }
    .admin-stats article:nth-child(n+3) { border-top: 1px solid var(--line); }
}

@media (max-width: 760px) {
    .topbar-inner, .page, .footer, .page:has(#questionsForm) { width: min(100% - 28px, var(--content)); }
    .page { padding: 42px 0 64px; }
    .brand-note { display: none; }
    .features { grid-template-columns: 1fr; }
    .feature-card { padding: 26px 0; }
    .feature-card + .feature-card { padding-left: 0; border-left: 0; border-top: 1px solid var(--line); }
    .feature-index { margin-bottom: 22px; }
    .account-grid, .admin-grid { grid-template-columns: 1fr; }
    .settings-card { padding: 24px; }
    .shared-banner, .history-card { align-items: flex-start; flex-direction: column; }
    .history-score { text-align: left; }
    .recovery-codes { grid-template-columns: 1fr; }
    .admin-dl { grid-template-columns: 1fr; gap: 4px; }
    .admin-dl dd { margin-bottom: 10px; }
    .footer { align-items: flex-start; flex-direction: column; }
    .feedback-user-item { grid-template-columns: 1fr auto; gap: 9px 14px; }
    .feedback-user-item time { grid-column: 1 / -1; text-align: left; }
    .feedback-admin-grid { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
    h1 { font-size: clamp(38px, 12vw, 52px); }
    .brand-sign, .brand-sign img { width: 38px; height: 38px; }
    .brand-sign { flex-basis: 38px; }
    .theme-toggle { width: 36px; height: 36px; min-height: 36px; }
    .dashboard-stats { grid-template-columns: 1fr 1fr; }
    .dashboard-actions { width: 100%; }
    .dashboard-actions .button { flex: 1 1 auto; }
    .section-heading { align-items: flex-start; flex-direction: column; }
    .auth-card { margin-top: 0; padding: 25px 20px; }
    .admin-search { flex-direction: column; }
    .feedback-form-actions .button,
    .account-card-actions .button { width: 100%; }
    .feedback-user-item { grid-template-columns: 1fr; }
    .feedback-user-item time { grid-column: auto; }
    .feedback-filters { align-items: stretch; flex-direction: column; }
}


@media (max-width: 980px) {
    .home-page .topbar-inner { padding-bottom: 10px; }
    .hero-cover .hero-content {
        padding-top: clamp(190px, 27vh, 270px);
        padding-bottom: 118px;
    }
    .hero-cycle {
        right: 20px;
        bottom: 28px;
    }
}

@media (max-width: 760px) {
    .home-page .page { padding-bottom: 64px; }
    .hero-cover {
        min-height: 100svh;
        align-items: flex-end;
    }
    .hero-cover-media img { object-position: 58% center; }
    .hero-cover-shade {
        background:
            linear-gradient(180deg, rgba(4, 6, 5, .55) 0%, rgba(4, 6, 5, .24) 32%, rgba(4, 6, 5, .77) 67%, rgba(4, 6, 5, .93) 100%),
            linear-gradient(90deg, rgba(4, 6, 5, .48), rgba(4, 6, 5, .14));
    }
    .hero-cover .hero-content {
        width: min(100% - 28px, var(--content));
        padding-top: 190px;
        padding-bottom: 112px;
    }
    .hero-cover h1 {
        max-width: 680px;
        font-size: clamp(42px, 12vw, 64px);
    }
    .hero-cover .hero-text {
        max-width: 560px;
        font-size: 17px;
    }
    .hero-cycle {
        left: 14px;
        right: 14px;
        bottom: 26px;
        max-width: none;
        text-align: left;
    }
    .home-page .features { width: min(100% - 28px, var(--content)); }
}

@media (max-width: 520px) {
    .hero-cover .hero-content { padding-top: 180px; padding-bottom: 108px; }
    .hero-cover h1 { font-size: clamp(39px, 12.5vw, 54px); }
    .hero-cover .hero-actions { width: 100%; }
    .hero-cover .hero-actions .button { flex: 1 1 150px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}

.admin-pagination a {
    color: var(--muted-strong);
    font-size: 13px;
    font-weight: 750;
    text-decoration: none;
}
.admin-pagination a:hover { color: var(--brand); }
