/*
 * The pages outside a world (templates/portal): the landing's night, a brass-rimmed walnut panel.
 * Tokens prefixed --p-, on the landing's palette (landing.css), so that both read as one place.
 */

:root {
    --p-night: #07090d;
    --p-ink: #f3e6c6;
    --p-ink-soft: #c9b48a;
    --p-gold: #d6ad55;
    --p-gold-light: #f6dc98;
    --p-line: rgb(214 173 85 / 0.32);
    --p-panel: rgb(24 16 10 / 0.88);
    --p-field: rgb(7 9 13 / 0.55);
    --p-danger: #f0a59a;
    --p-success: #b9d98a;
    --p-display: "Grenze Gotisch", "Grenze", Georgia, serif;
    --p-text: "Grenze", Georgia, serif;
    --p-ease: cubic-bezier(0.22, 1, 0.36, 1);
    color-scheme: dark;
}

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

body.portal {
    display: grid;
    grid-template-rows: auto 1fr auto;
    min-height: 100svh;
    margin: 0;
    background: var(--p-night);
    color: var(--p-ink);
    font-family: var(--p-text);
    font-size: 18px;
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
}

/* The night town, far and dim behind everything */
body.portal::before {
    content: "";
    position: fixed;
    inset: -2%;
    z-index: -2;
    background: url("/landing/nuit.webp") center 30% / cover no-repeat;
    filter: blur(3px) brightness(0.42) saturate(0.85);
}

body.portal::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(ellipse 60% 55% at 50% 45%, transparent 0%, rgb(7 9 13 / 0.55) 70%, rgb(7 9 13 / 0.92) 100%),
        linear-gradient(180deg, rgb(7 9 13 / 0.6), transparent 25%, transparent 70%, rgb(7 9 13 / 0.8));
}

.portal a { color: var(--p-gold-light); text-underline-offset: 3px; }
.portal a:hover { color: #fff3cf; }
.portal :focus-visible { outline: 2px solid var(--p-gold-light); outline-offset: 3px; }

/* ---- The bar: the name of the game, the account ---- */
.portal-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px max(16px, env(safe-area-inset-left, 0px)) 0;
    padding-right: max(16px, env(safe-area-inset-right, 0px));
}

.portal-brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.portal-brand span { font-family: var(--p-display); font-size: 26px; line-height: 1; color: var(--p-gold-light); text-shadow: 0 2px 12px rgb(0 0 0 / 0.8); }

.portal-account { display: flex; align-items: center; gap: 18px; }
.portal-account form { margin: 0; }
.portal-lord { color: var(--p-ink-soft); }

.portal-link {
    padding: 0;
    border: 0;
    background: none;
    color: var(--p-ink-soft);
    font: inherit;
    font-size: 16px;
    text-decoration: none;
    cursor: pointer;
}
.portal-link:hover { color: var(--p-ink); }
.portal .portal-link-strong { color: var(--p-gold-light); }

/* ---- The panel ---- */
.portal-main {
    display: grid;
    align-content: center;
    justify-items: center;
    gap: 22px;
    padding: 40px max(16px, env(safe-area-inset-left, 0px)) 48px;
    padding-right: max(16px, env(safe-area-inset-right, 0px));
}

.portal-card {
    width: 100%;
    padding: 34px clamp(20px, 5vw, 36px) 30px;
    border: 1px solid var(--p-line);
    border-radius: 14px;
    background: linear-gradient(180deg, rgb(36 25 15 / 0.92), var(--p-panel));
    box-shadow:
        inset 0 1px 0 rgb(246 220 152 / 0.14),
        0 0 0 5px rgb(7 9 13 / 0.35),
        0 30px 80px -20px rgb(0 0 0 / 0.85);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.portal-narrow .portal-card { max-width: 440px; }
.portal-wide .portal-card { max-width: 860px; }

.portal-card-head { display: grid; justify-items: center; gap: 6px; margin-bottom: 22px; text-align: center; }
.portal-card-head img { filter: drop-shadow(0 4px 14px rgb(214 173 85 / 0.35)); }
.portal-card-head h1 {
    margin: 8px 0 0;
    font-family: var(--p-display);
    font-weight: 700;
    font-size: clamp(32px, 6vw, 40px);
    line-height: 1;
    color: var(--p-gold-light);
    text-wrap: balance;
}
.portal-card-head p { margin: 0; color: var(--p-ink-soft); font-size: 17px; }

.portal-card h2 { margin: 26px 0 10px; font-size: 22px; color: var(--p-gold-light); }
.portal-card p { margin: 0 0 12px; }

/* ---- Flashes ---- */
.portal-flash {
    margin: 0 0 16px;
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid;
    font-size: 16px;
}
.portal-flash.flash-success { border-color: rgb(185 217 138 / 0.4); background: rgb(90 120 50 / 0.18); color: var(--p-success); }
.portal-flash.flash-error { border-color: rgb(240 165 154 / 0.45); background: rgb(150 40 30 / 0.2); color: var(--p-danger); }
.portal-flash.flash-info, .portal-flash.flash-warning { border-color: var(--p-line); background: rgb(214 173 85 / 0.1); color: var(--p-gold-light); }

/* ---- Forms ---- */
.portal-form { display: grid; gap: 16px; }
.portal-form label, .portal-form .portal-field { display: grid; gap: 6px; font-size: 16px; color: var(--p-ink-soft); }
.portal-form input[type="email"], .portal-form input[type="password"], .portal-form input[type="text"], .portal-form select, .portal-form textarea {
    width: 100%;
    min-height: 46px;
    padding: 10px 14px;
    border: 1px solid var(--p-line);
    border-radius: 8px;
    background: var(--p-field);
    color: var(--p-ink);
    font: inherit;
    font-size: 17px;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.portal-form input:focus, .portal-form select:focus, .portal-form textarea:focus {
    outline: none;
    border-color: var(--p-gold);
    box-shadow: 0 0 0 3px rgb(214 173 85 / 0.22);
}
.portal-form input::placeholder { color: rgb(201 180 138 / 0.5); }
.portal-form .portal-check { display: flex; align-items: center; gap: 10px; font-size: 16px; }
.portal-form input[type="checkbox"] { width: 18px; height: 18px; margin: 0; accent-color: var(--p-gold); }
.portal-help, .portal-form .form-help, .portal-form .help-text { margin: 0; font-size: 14px; color: rgb(201 180 138 / 0.8); }
.portal-form ul { margin: 0; padding: 0; list-style: none; color: var(--p-danger); font-size: 15px; }
.portal-form div { display: grid; gap: 6px; }

/* The game's gilded button, engraved (the landing's seal) */
.portal-seal {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 50px;
    margin-top: 4px;
    padding: 0 20px;
    border: 0;
    border-radius: 7px;
    background: linear-gradient(180deg, #f6dc98 0%, #d6ad55 55%, #a77c2c 100%);
    box-shadow: 0 0 0 1px #5d3d10, 0 2px 0 #5d3d10, inset 0 1px 0 rgb(255 248 220 / 0.7), 0 12px 28px -12px rgb(214 173 85 / 0.7);
    color: #2a1606;
    font-family: var(--p-text);
    font-weight: 700;
    font-size: 18px;
    text-decoration: none;
    text-shadow: 0 1px 0 rgb(255 240 200 / 0.6);
    cursor: pointer;
    transition: transform 0.2s var(--p-ease), filter 0.2s;
}
.portal .portal-seal { color: #2a1606; }
.portal-seal:hover { transform: translateY(-1px); filter: brightness(1.07); }
.portal-seal:active { transform: translateY(1px); }

.portal-alt { margin: 20px 0 0; padding-top: 18px; border-top: 1px solid rgb(214 173 85 / 0.18); text-align: center; color: var(--p-ink-soft); font-size: 16px; }

/* A second way, beside the seal: bordered in brass, not gilded */
.portal-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 20px;
    border: 1px solid rgb(246 220 152 / 0.55);
    border-radius: 7px;
    color: var(--p-gold-light);
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 0.2s;
}
.portal .portal-ghost { color: var(--p-gold-light); }
.portal-ghost:hover { background: rgb(246 220 152 / 0.12); }

.portal-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin: 0 0 22px; }
.portal-actions .portal-seal { width: auto; margin: 0; }

.portal-seal-small { width: auto; min-height: 42px; margin: 0; font-size: 16px; }

/* ---- The lobby: the worlds, one line each ---- */
.portal-worlds { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.portal-world {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 20px;
    padding: 14px 18px;
    border: 1px solid rgb(214 173 85 / 0.2);
    border-radius: 10px;
    background: rgb(7 9 13 / 0.35);
}
.portal-world > div { display: grid; gap: 2px; min-width: 0; }
.portal-world strong { font-size: 21px; color: var(--p-ink); }
.portal-world span { font-size: 15px; color: var(--p-ink-soft); }
.portal-world form { margin: 0; }
.portal-world-empty { justify-content: center; color: var(--p-ink-soft); text-align: center; }

.portal-invite { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 24px; padding-block: 22px; }
.portal-invite > div { flex: 1 1 280px; min-width: 0; }
.portal-invite h2 { margin: 0 0 4px; }
.portal-invite p { margin: 0; color: var(--p-ink-soft); }

/* ---- The legal pages: text to read ---- */
.legal h1 { margin: 0 0 6px; font-family: var(--p-display); font-size: clamp(32px, 5vw, 42px); line-height: 1.05; color: var(--p-gold-light); text-wrap: balance; }
.legal .muted { color: var(--p-ink-soft); font-size: 15px; }
.legal ul { padding-left: 1.2em; }
.legal li { margin-bottom: 6px; }
.table-wrap { overflow-x: auto; }
.legal table { width: 100%; border-collapse: collapse; font-size: 16px; }
.legal th, .legal td { padding: 10px 12px; border-bottom: 1px solid rgb(214 173 85 / 0.18); text-align: left; vertical-align: top; }
.legal th { color: var(--p-gold-light); font-weight: 700; }
.legal-missing { padding: 0 0.3em; border-radius: 3px; background: rgb(214 173 85 / 0.22); color: var(--p-gold-light); font-weight: 700; }

/* ---- The foot ---- */
.portal-foot {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px 22px;
    padding: 0 16px calc(20px + env(safe-area-inset-bottom, 0px));
    font-size: 14px;
}
.portal-foot a { color: rgb(201 180 138 / 0.75); text-decoration: none; }
.portal-foot a:hover { color: var(--p-ink); }
.portal-version { color: rgb(201 180 138 / 0.75); }

@media (max-width: 480px) {
    .portal-lord { display: none; }
    .portal-brand span { font-size: 22px; }
    .portal-main { padding-top: 24px; }
}

@media (prefers-reduced-motion: reduce) {
    .portal-seal { transition: none; }
}
