/* Design "Scoreboard" (canvas https://claude.ai/code/artifact/81ccf0de-1136-4e61-ad6c-edadcca4c51c).
   Every colour is a token; dark and light themes only change the tokens. The theme is set on <html data-theme>
   before the first paint (App.razor) and switched by site.js. */

:root,
[data-theme="dark"] {
    color-scheme: dark;
    --bg: #0B0D10;
    --panel: #12151A;
    --line: #22262C;
    --text: #E8EAED;
    --muted: #9AA3AE;
    --accent: #FFB020;
    --accent-text: #FFB020;
    --on-accent: #111418;
    --called-bg: #1A1406;
    --called-edge: #FFB020;
    --ok: #3DDC84;
    --ok-bg: #0F2A1B;
    --error: #FF8A8A;
    --error-bg: #2A1215;
    --info: #7CB7FF;
    --info-bg: #10213A;
    --btn: #1E232A;
    --focus: #FFB020;
}

[data-theme="light"] {
    color-scheme: light;
    --bg: #F4F5F7;
    --panel: #FFFFFF;
    --line: #DDE1E6;
    --text: #111418;
    --muted: #4B5563;
    --accent: #B45309;
    --accent-text: #92400E;
    --on-accent: #FFFFFF;
    --called-bg: #FFF4D6;
    --called-edge: #F59E0B;
    --ok: #15803D;
    --ok-bg: #DCFCE7;
    --error: #B91C1C;
    --error-bg: #FEE2E2;
    --info: #1D4ED8;
    --info-bg: #DBEAFE;
    --btn: #E9ECF0;
    --focus: #B45309;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.5;
}

h1,
h2,
h3 {
    font-family: "Chakra Petch", Inter, system-ui, sans-serif;
    font-weight: 700;
    line-height: 1.15;
    margin: 0 0 0.5rem;
}

h1 {
    font-size: clamp(1.6rem, 4vw, 2.2rem);
    letter-spacing: 0.02em;
}

a {
    color: var(--accent-text);
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 2px;
}

/* Blazor moves focus to the page heading after navigation (screen readers start there); the heading itself is not
   interactive, so no outline around it. */
[tabindex="-1"]:focus {
    outline: none;
}

code {
    font-size: 0.9em;
}

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

.small {
    font-size: 0.875rem;
}

/* Header */
.topbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1.5rem;
    padding: 0.75rem 1.25rem;
    padding-top: calc(0.75rem + env(safe-area-inset-top, 0px));
    background: var(--panel);
    border-bottom: 1px solid var(--line);
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--text);
    text-decoration: none;
    font-family: "Chakra Petch", Inter, sans-serif;
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.brand img {
    object-fit: contain;
}

.topnav {
    display: flex;
    gap: 0.25rem;
    flex: 1;
}

.topnav a {
    padding: 0.45rem 0.75rem;
    border-radius: 8px;
    color: var(--text);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
}

.topnav a.active {
    background: var(--btn);
    color: var(--accent-text);
}

.topbar-tools {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.topbar-tools form {
    margin: 0;
}

.lang {
    display: flex;
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
}

.lang a {
    padding: 0.35rem 0.6rem;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--muted);
    text-decoration: none;
}

.lang a.active {
    background: var(--btn);
    color: var(--text);
}

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: var(--btn);
    color: var(--text);
    cursor: pointer;
}

[data-theme="dark"] .icon-sun,
[data-theme="light"] .icon-moon {
    display: none;
}

.user {
    max-width: 14rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.85rem;
    color: var(--muted);
}

/* Page */
.page {
    flex: 1;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem 1.25rem 2rem;
}

.card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 1.5rem;
}

.card.narrow {
    max-width: 28rem;
    margin: 1rem auto;
}

.hero {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1.5rem;
    margin: 1rem 0 2rem;
}

.hero-logo {
    object-fit: contain;
}

.eyebrow {
    margin: 0 0 0.25rem;
    font-size: 0.8rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.14em;
}

.lead {
    font-size: 1.15rem;
    font-weight: 600;
    margin: 0.25rem 0;
}

.big-number {
    margin: 0;
    font-family: "Chakra Petch", Inter, sans-serif;
    font-weight: 700;
    font-size: 4rem;
    line-height: 1;
    color: var(--accent);
}

/* Forms */
.stack {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin: 1rem 0 0;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    font-size: 0.85rem;
    color: var(--muted);
}

.field input {
    min-height: 48px;
    padding: 0 0.9rem;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: var(--bg);
    color: var(--text);
    font: 500 1rem Inter, system-ui, sans-serif;
}

.code-input {
    font-family: "Chakra Petch", Inter, sans-serif !important;
    font-size: 1.6rem !important;
    letter-spacing: 0.3em;
    text-align: center;
}

.hint {
    margin: 0;
    font-size: 0.85rem;
    color: var(--muted);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 1.1rem;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: var(--btn);
    color: var(--text);
    font: 600 0.95rem Inter, system-ui, sans-serif;
    text-decoration: none;
    cursor: pointer;
}

.btn-primary {
    border: 0;
    background: var(--accent);
    color: var(--on-accent);
    font-weight: 700;
}

.btn-ghost {
    background: var(--btn);
}

.btn-sm {
    min-height: 36px;
    padding: 0 0.75rem;
    font-size: 0.85rem;
}

.btn-block {
    width: 100%;
}

.login-intro {
    margin: 0 0 1rem;
    padding-left: 1.2rem;
}

.login-intro li + li {
    margin-top: 0.2rem;
}

/* Provider logo in "Continue with Google / Microsoft". */
.btn-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    margin-right: 0.6rem;
}

.or {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1.25rem 0 0.25rem;
    color: var(--muted);
    font-size: 0.85rem;
}

.or::before,
.or::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--line);
}

.alert {
    margin: 1rem 0 0;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
}

.alert-error {
    background: var(--error-bg);
    color: var(--error);
}

.alert-info {
    background: var(--ok-bg);
    color: var(--ok);
}

/* Footer: privacy · author credit (like the Lhotka app) · version */
.footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem 0.6rem;
    padding: 0.9rem 1.25rem;
    padding-bottom: calc(0.9rem + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.85rem;
}

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

.footer .credit {
    color: var(--accent-text);
    font-weight: 600;
}

.footer .spacer {
    flex: 1;
}

#blazor-error-ui {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 0.75rem 1.25rem;
    background: var(--error-bg);
    color: var(--error);
    font-weight: 600;
}

#blazor-error-ui .dismiss {
    float: right;
    cursor: pointer;
}

@media (max-width: 600px) {
    /* Phone: logo and tools on one row, navigation below. */
    .topbar {
        gap: 0.5rem 0.75rem;
        padding: 0.6rem 0.9rem;
        padding-top: calc(0.6rem + env(safe-area-inset-top, 0px));
    }

    .topbar-tools {
        margin-left: auto;
        flex-wrap: nowrap;
    }

    .topnav {
        order: 3;
        flex-basis: 100%;
        margin-left: -0.5rem;
    }

    .user {
        display: none;
    }
}

@media (max-width: 440px) {
    /* The name does not fit next to the tools: the logo stays, the name is kept for screen readers. */
    .brand span {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
    }
}
