/* Kroon: design tokens and controls shared by the start page and the game page.
   Direction: a clean, flat game surface. A light warm-grey table, white surfaces separated by
   hairlines, one typeface (Schibsted Grotesk, self-hosted) used with strong weight contrast,
   the family logo red as the only accent (actions, your turn), tabular numbers for money. */

@font-face {
    font-family: "Schibsted Grotesk";
    font-style: normal;
    font-display: swap;
    font-weight: 400 900;
    src: url("../fonts/schibsted-grotesk-latin-ext-wght-normal.woff2") format("woff2-variations");
    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;
}

@font-face {
    font-family: "Schibsted Grotesk";
    font-style: normal;
    font-display: swap;
    font-weight: 400 900;
    src: url("../fonts/schibsted-grotesk-latin-wght-normal.woff2") format("woff2-variations");
    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;
}

.kroon {
    --bg: #edebe6;
    --surface: #ffffff;
    --surface-2: #f5f4f0;
    --line: #e2e0da;
    --line-strong: #cfccc4;
    --ink: #16171a;
    --ink-2: #5c5e64;
    --ink-3: #8c8e94;
    --red: #b3261e;
    --red-dark: #941d16;
    --red-soft: #fbece9;
    --ok: #2f8150;
    --font: "Schibsted Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
    --radius: 10px;
    --radius-sm: 6px;
    --radius-lg: 16px;

    font-family: var(--font);
    font-size: 16px;
    color: var(--ink);
    background: var(--bg);
    font-feature-settings: "ss01";
    -webkit-font-smoothing: antialiased;
}

.kroon :focus-visible {
    outline: 2px solid var(--red);
    outline-offset: 2px;
}

.kroon h1,
.kroon h2,
.kroon h3 {
    font-family: var(--font);
    font-weight: 750;
    letter-spacing: -0.02em;
    line-height: 1.1;
    margin: 0 0 0.5em;
}

.surface {
    background: var(--surface);
    color: var(--ink);
}

.num {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.nowrap {
    white-space: nowrap;
}

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

.small {
    font-size: 0.875rem;
}

.form-error {
    color: var(--red);
    margin: 0.4em 0 0;
}

.form-error:empty {
    display: none;
}

/* ---------- Buttons ---------- */

.k-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45em;
    min-height: 2.75rem;
    padding: 0.55em 1.05em;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--ink);
    font: 600 0.975rem/1.2 var(--font);
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}

.k-btn:hover:not(:disabled) {
    background: var(--surface-2);
    border-color: var(--ink-3);
}

.k-btn:active:not(:disabled) {
    transform: translateY(1px);
}

.k-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.k-btn-go {
    background: var(--red);
    border-color: var(--red);
    color: #fff;
}

.k-btn-go:hover:not(:disabled) {
    background: var(--red-dark);
    border-color: var(--red-dark);
}

.k-btn-danger {
    background: var(--ink);
    border-color: var(--ink);
    color: #fff;
}

.k-btn-danger:hover:not(:disabled) {
    background: #000;
    border-color: #000;
}

.k-btn-quiet {
    border-color: transparent;
    background: transparent;
    color: var(--ink-2);
}

.k-btn-quiet:hover:not(:disabled) {
    background: var(--surface-2);
    border-color: transparent;
    color: var(--ink);
}

.k-btn-big {
    min-height: 3.25rem;
    padding-inline: 1.5em;
    font-size: 1.075rem;
}

.k-link {
    border: 0;
    padding: 0;
    background: none;
    color: var(--red);
    font: 600 inherit var(--font);
    font-size: inherit;
    cursor: pointer;
}

.k-link:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.k-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.k-row-end {
    justify-content: flex-end;
    margin-top: 1.25rem;
}

.k-inline {
    display: inline-flex;
    gap: 0.4rem;
}

/* ---------- Inputs ---------- */

.k-input {
    min-height: 2.75rem;
    padding: 0.45em 0.75em;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--ink);
    font: 1rem var(--font);
}

.k-input:focus {
    border-color: var(--ink);
    outline: none;
    box-shadow: 0 0 0 3px rgba(22, 23, 26, 0.08);
}

.k-input-num {
    width: 7.5em;
    font-variant-numeric: tabular-nums;
}

.k-check {
    display: flex;
    gap: 0.6em;
    align-items: flex-start;
    cursor: pointer;
}

.k-check input {
    margin-top: 0.15em;
    accent-color: var(--red);
    width: 1.1em;
    height: 1.1em;
}

.k-segmented {
    display: inline-flex;
    padding: 3px;
    gap: 3px;
    border-radius: var(--radius);
    background: var(--surface-2);
    border: 1px solid var(--line);
}

.k-segmented button {
    border: 0;
    border-radius: 7px;
    padding: 0.5em 0.85em;
    background: transparent;
    color: var(--ink-2);
    font: 600 0.9rem var(--font);
    cursor: pointer;
}

.k-segmented button.is-on {
    background: var(--surface);
    color: var(--ink);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* ---------- Dialogs & toast ---------- */

.k-dialog {
    width: min(28rem, calc(100vw - 2rem));
    max-height: calc(100dvh - 2rem);
    padding: 1.5rem;
    border: 0;
    border-radius: var(--radius-lg);
    background: var(--surface);
    color: var(--ink);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.22);
}

.k-dialog-wide {
    width: min(46rem, calc(100vw - 2rem));
}

.k-dialog::backdrop {
    background: rgba(22, 23, 26, 0.45);
}

.toast {
    position: fixed;
    left: 50%;
    bottom: max(1rem, env(safe-area-inset-bottom));
    transform: translateX(-50%);
    z-index: 60;
    max-width: min(32rem, calc(100vw - 2rem));
    padding: 0.8rem 1.1rem;
    border-radius: var(--radius);
    background: var(--ink);
    color: #fff;
    font-weight: 500;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

.turnstile-box:empty {
    display: none;
}
