/* Supreme Empires — the game's own look for the website.
   Loaded after empires.css. Colours and shapes follow the Unity client's CocKit: a sky-blue sunburst,
   cream windows with a dark rim and a gloss, blue title plates, green go-buttons and outlined lettering. */

:root {
    --sky-in: #f6fcff;
    --sky: #2a8cd4;
    --sky-deep: #17558f;
    --grass: #479325;
    --grass-light: #8ad648;
    --grass-edge: #33701b;
    --road: #d9b570;
    --road-edge: #a88040;

    --rim: #100d0a;
    --cream: #fbf3df;
    --parchment: #ece1c8;
    --tile: #f4e9cf;
    --field: #fffcf4;
    --field-rim: #8a6a45;
    --tab-idle: #b9a586;
    --brown: #4a331b;
    --brown-soft: #6f5638;

    --green: #7dc82e;
    --green-deep: #4c8a15;
    --yellow: #ffc92b;
    --orange: #f78e1e;
    --blue: #3d9ae8;
    --red: #e53b2c;

    /* names the older stylesheets read */
    --wood: var(--rim);
    --wood-light: var(--field-rim);
    --gold: var(--yellow);
    --gold-sel: var(--yellow);
    --gold-hover: #ffd75a;
    --gold-deep: var(--brown);
    --paper: var(--field);
    --ink: var(--brown);
    --muted: var(--brown-soft);
    --line: rgba(74, 51, 27, 0.18);
    --accent: #1f6fb8;
    --err: #b3261e;
    --ok: #2f7d12;
    --panel: var(--cream);
    --panel-2: var(--tile);
    --glow: rgba(255, 201, 43, 0.25);

    --font-display: "Lilita One", "Eras Bold ITC", "Arial Rounded MT Bold", system-ui, sans-serif;
    --font-ui: "Fredoka", "Arial Rounded MT Bold", system-ui, sans-serif;
    --font-mono: "JetBrains Mono", ui-monospace, monospace;

    --gloss: linear-gradient(rgba(255, 255, 255, 0.28) 0 50%, rgba(255, 255, 255, 0) 50%);
    --drop: 0 6px 0 rgba(0, 0, 0, 0.32);
    --outline:
        -2px -2px 0 var(--rim), 2px -2px 0 var(--rim), -2px 2px 0 var(--rim), 2px 2px 0 var(--rim),
        0 -2px 0 var(--rim), 0 2px 0 var(--rim), -2px 0 0 var(--rim), 2px 0 0 var(--rim),
        0 4px 0 rgba(0, 0, 0, 0.4);
    --outline-sm:
        -1.5px -1.5px 0 var(--rim), 1.5px -1.5px 0 var(--rim), -1.5px 1.5px 0 var(--rim), 1.5px 1.5px 0 var(--rim),
        0 -1.5px 0 var(--rim), 0 1.5px 0 var(--rim), -1.5px 0 0 var(--rim), 1.5px 0 0 var(--rim),
        0 3px 0 rgba(0, 0, 0, 0.35);
}

html { overflow-x: clip; background: var(--sky); }

body.empire {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    color: var(--brown);
    font-family: var(--font-ui);
    font-size: 16px;
    line-height: 1.5;
    background: transparent;
    background-image: none;
}

/* The title screen's sky: soft rays turning slowly around a bright centre. */
body.empire::before {
    content: "";
    position: fixed;
    left: 50%;
    top: 30%;
    width: 260vmax;
    height: 260vmax;
    margin: -130vmax 0 0 -130vmax;
    z-index: -1;
    pointer-events: none;
    background:
        repeating-conic-gradient(from 0deg, rgba(255, 255, 255, 0.14) 0deg 10deg, rgba(255, 255, 255, 0) 10deg 20deg),
        radial-gradient(circle, var(--sky-in) 0%, #a5d6f6 14%, var(--sky) 40%, var(--sky-deep) 75%);
    animation: realm-spin 160s linear infinite;
}

@keyframes realm-spin { to { transform: rotate(360deg); } }

a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: var(--sky-deep); }

:focus-visible {
    outline: 3px solid var(--yellow);
    outline-offset: 2px;
    border-radius: 8px;
}

.outlined {
    color: #fff;
    font-family: var(--font-display);
    font-weight: 400;
    letter-spacing: 0.02em;
    text-shadow: var(--outline);
}

.visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.stage {
    flex: 1 0 auto;
    width: min(1160px, 100%);
    margin: 0 auto;
    padding: 0 16px 48px;
}

/* ——— Top bar: the HUD strip ——— */
.gamebar {
    position: sticky;
    top: 0;
    z-index: 40;
    margin: 0 calc(50% - 50vw);
    padding: 0 max(16px, calc(50vw - 564px));
    background: rgba(8, 36, 70, 0.72);
    background-image: none;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 0;
    border-bottom: 3px solid var(--rim);
    border-radius: 0;
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.18);
    overflow: visible;
}

.gamebar-top {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 0;
    padding: 8px 0 6px;
}

.gamebar-brand {
    display: block;
    flex: none;
    line-height: 0;
    transition: transform 0.15s ease-out;
}
.gamebar-brand:hover { transform: scale(1.04) rotate(-1deg); }
.gamebar-brand img {
    height: 52px;
    width: auto;
    filter: drop-shadow(0 3px 0 rgba(0, 0, 0, 0.3));
}

.gamebar-side {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.gamebar-user {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    max-width: 260px;
    padding: 4px 12px 4px 4px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.35);
    border: 0;
    color: #dbeaf7;
    font-size: 12px;
    line-height: 1.2;
}
.gamebar-user .avatar {
    flex: none;
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2.5px solid var(--rim);
    background: var(--gloss), var(--yellow);
    color: var(--brown);
    font-family: var(--font-display);
    font-size: 16px;
}
.gamebar-user span { display: block; min-width: 0; }
.gamebar-user strong {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
}

.gamebar-tabs {
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    margin: 0;
    padding: 2px 0 10px;
    overflow-x: auto;
    background: transparent;
    border: 0;
    scrollbar-width: none;
}
.gamebar-tabs::-webkit-scrollbar { display: none; }

.tab,
.panel-nav a,
.panel-nav button {
    flex: none;
    display: inline-flex;
    align-items: center;
    height: 34px;
    margin: 0;
    padding: 0 14px;
    border: 2.5px solid var(--rim);
    border-radius: 12px;
    background: var(--gloss), var(--tab-idle);
    color: #fff;
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 400;
    letter-spacing: 0.02em;
    text-transform: none;
    text-decoration: none;
    text-shadow: var(--outline-sm);
    box-shadow: 0 3px 0 rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: transform 0.15s ease-out, filter 0.15s ease-out;
}
.tab img { display: none; }
.tab:hover,
.panel-nav a:hover,
.panel-nav button:hover { color: #fff; filter: brightness(1.08); transform: translateY(-1px); background: var(--gloss), var(--tab-idle); }
.tab:active { transform: scale(0.95); }
.tab.is-on,
.panel-nav .is-on,
.panel-nav [aria-current="page"],
.panel-nav [aria-selected="true"] {
    background: var(--gloss), var(--blue);
    color: #fff;
    box-shadow: 0 3px 0 rgba(0, 0, 0, 0.3);
    border-radius: 12px;
}
.tab-form { display: inline-flex; margin: 0; }

.legal-banner {
    margin: 14px auto 0;
    width: fit-content;
    max-width: 100%;
    padding: 6px 14px;
    border: 0;
    border-radius: 999px;
    background: rgba(8, 36, 70, 0.5);
    box-shadow: none;
    color: #e3f0fb;
    font-family: var(--font-ui);
    font-size: 12px;
    font-weight: 500;
    text-align: center;
    text-shadow: none;
}

.page { margin-top: 24px; }

/* ——— Windows ——— */
.card {
    position: relative;
    padding: 28px 28px 30px;
    border: 4px solid var(--rim);
    border-radius: 28px;
    background: linear-gradient(rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0) 120px), var(--cream);
    background-color: var(--cream);
    box-shadow: var(--drop);
    color: var(--brown);
}
.card + .card { margin-top: 22px; }

h1, h2, h3 {
    color: var(--brown);
    font-family: var(--font-display);
    font-weight: 400;
    letter-spacing: 0.01em;
}
h1 { margin: 0 0 8px; font-size: clamp(28px, 4vw, 40px); line-height: 1.1; }
h3 { margin: 18px 0 8px; font-size: 20px; }

/* Section titles wear the game's blue plate. */
h2 {
    display: inline-block;
    width: auto;
    max-width: 100%;
    margin: 26px 0 14px;
    padding: 6px 18px 7px;
    border: 3px solid var(--rim);
    border-radius: 14px;
    background: var(--gloss), var(--blue);
    color: #fff;
    font-size: 20px;
    line-height: 1.15;
    letter-spacing: 0.02em;
    text-transform: none;
    text-shadow: var(--outline-sm);
    box-shadow: 0 3px 0 rgba(0, 0, 0, 0.28);
}
h2:first-child { margin-top: 0; }

.lede {
    max-width: 44rem;
    margin: 0 0 14px;
    color: var(--brown-soft);
    font-size: 16px;
    font-weight: 500;
    line-height: 1.55;
}
.muted { color: var(--brown-soft); }

.page-head { display: flex; align-items: center; gap: 16px; margin-bottom: 10px; }
.page-head img.head-art,
.page-head .head-art {
    width: 72px;
    height: 72px;
    object-fit: cover;
    border: 3px solid var(--rim);
    border-radius: 18px;
    background: var(--tile);
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.25);
    filter: none;
}

/* ——— Buttons: chunky, glossy, squash when pressed ——— */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 8px 18px;
    border: 3px solid var(--rim);
    border-radius: 14px;
    background: var(--gloss), var(--blue);
    color: #fff;
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 400;
    letter-spacing: 0.02em;
    line-height: 1.1;
    text-transform: none;
    text-decoration: none;
    text-shadow: var(--outline-sm);
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.32);
    cursor: pointer;
    transition: transform 0.15s ease-out, filter 0.15s ease-out, box-shadow 0.15s ease-out;
}
.btn:hover { color: #fff; filter: brightness(1.07); transform: scale(1.04); background: var(--gloss), var(--blue); }
.btn:active { transform: scale(0.95); box-shadow: 0 1px 0 rgba(0, 0, 0, 0.32); }
.btn img { width: 22px; height: 22px; object-fit: contain; opacity: 1; filter: drop-shadow(0 1px 0 rgba(0, 0, 0, 0.4)); }
.btn .muted { color: rgba(255, 255, 255, 0.85); font-family: var(--font-ui); font-size: 13px; text-shadow: none; }
.btn-primary,
.btn-primary:hover { background: var(--gloss), var(--green); color: #fff; border-color: var(--rim); }
.btn-danger,
.btn-danger:hover { background: var(--gloss), var(--red); color: #fff; border-color: var(--rim); box-shadow: 0 4px 0 rgba(0, 0, 0, 0.32); }
.btn-gold,
.btn-gold:hover { background: var(--gloss), var(--yellow); }
.btn-sm { min-height: 34px; padding: 4px 12px; font-size: 15px; border-width: 2.5px; border-radius: 11px; }
.btn-lg { min-height: 54px; padding: 10px 24px; font-size: 22px; border-radius: 16px; }
.btn-xl { min-height: 66px; padding: 12px 34px; font-size: 30px; border-radius: 20px; border-width: 4px; box-shadow: 0 6px 0 rgba(0, 0, 0, 0.32); }
.btn[disabled], .btn.is-disabled { opacity: 0.5; pointer-events: none; }

.btn-play::before {
    content: "";
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0.36em 0 0.36em 0.58em;
    border-color: transparent transparent transparent #fff;
    filter: drop-shadow(1.5px 0 0 var(--rim)) drop-shadow(-1.5px 0 0 var(--rim)) drop-shadow(0 1.5px 0 var(--rim)) drop-shadow(0 -1.5px 0 var(--rim));
}

.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 18px; }

/* ——— Fields ——— */
label { display: block; margin: 14px 0 6px; color: var(--brown); font-size: 15px; font-weight: 600; }

input, select, textarea {
    width: 100%;
    min-height: 46px;
    padding: 9px 14px;
    border: 3px solid var(--field-rim);
    border-radius: 14px;
    background: var(--field);
    color: var(--brown);
    font: inherit;
    font-size: 17px;
    transition: border-color 0.15s ease-out, box-shadow 0.15s ease-out;
}
textarea { min-height: 96px; }
input::placeholder, textarea::placeholder { color: rgba(74, 51, 27, 0.45); }
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--blue);
    box-shadow: 0 0 0 4px rgba(61, 154, 232, 0.25);
}
input[type="checkbox"], input[type="radio"] {
    width: 22px;
    height: 22px;
    min-height: 0;
    accent-color: var(--green);
}
.check-row { display: flex; align-items: center; gap: 10px; margin: 14px 0 6px; font-weight: 600; }
.check-row input { width: 22px; margin: 0; }

.err, .flash.err { color: var(--err); font-weight: 600; }

/* ——— Notices ——— */
.flash {
    margin-bottom: 16px;
    padding: 12px 16px 12px 18px;
    border: 3px solid var(--rim);
    border-left-width: 10px;
    border-radius: 16px;
    background: var(--cream);
    color: var(--brown);
    font-weight: 600;
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.25);
}
.flash.ok { border-left-color: var(--green); color: var(--brown); }
.flash.err { border-left-color: var(--red); color: var(--brown); }
.flash.warn { border-left-color: var(--yellow); background: var(--cream); }

.badge {
    display: inline-block;
    padding: 2px 10px;
    border: 2px solid var(--rim);
    border-radius: 999px;
    background: var(--gloss), var(--yellow);
    color: var(--brown);
    font-family: var(--font-ui);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.5;
    vertical-align: middle;
}
.badge-warn { background: var(--gloss), #ff8a7a; color: #4a1208; border-color: var(--rim); }

/* ——— Stat tiles, lists, tables ——— */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }

.stat {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border: 3px solid var(--rim);
    border-radius: 18px;
    background: var(--gloss), var(--tile);
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.22);
    transition: transform 0.15s ease-out;
}
.stat:hover { transform: translateY(-2px); border-color: var(--rim); }
.stat img { width: 40px; height: 40px; object-fit: contain; border-radius: 10px; }
.stat b { display: block; color: var(--brown); font-family: var(--font-display); font-size: 22px; font-weight: 400; line-height: 1.1; }
.stat span { color: var(--brown-soft); font-size: 12px; font-weight: 600; letter-spacing: 0.02em; text-transform: uppercase; }

.list li,
.compact-storage li {
    padding: 10px 4px;
    background: transparent;
    border-top: 2px dashed var(--line);
    border-color: var(--line);
}
.list li:first-child { border-top: 0; }

.sprite {
    border: 3px solid var(--rim);
    border-radius: 14px;
    background: var(--tile);
    box-shadow: 0 3px 0 rgba(0, 0, 0, 0.22);
}

.table,
table { width: 100%; border-collapse: separate; border-spacing: 0; color: var(--brown); font-size: 15px; }
.table th,
table th {
    padding: 10px 12px;
    background: var(--parchment);
    color: var(--brown);
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 400;
    letter-spacing: 0.02em;
    text-align: left;
    border-bottom: 3px solid var(--rim);
}
.table th:first-child, table th:first-child { border-top-left-radius: 12px; }
.table th:last-child, table th:last-child { border-top-right-radius: 12px; }
.table td,
table td { padding: 10px 12px; border-bottom: 2px dashed var(--line); }
.table tbody tr:hover td,
table tbody tr:hover td { background: rgba(255, 201, 43, 0.12); }

.panel-nav {
    gap: 8px;
    padding: 14px 18px 10px;
    background: var(--parchment);
    border-bottom: 3px solid var(--rim);
}

/* ——— Footer: the loading screen's meadow and road ——— */
.legal {
    position: relative;
    margin: 56px 0 0;
    padding: 34px 16px 28px;
    border: 0;
    border-top: 6px solid var(--grass-edge);
    background: linear-gradient(var(--grass-light), var(--grass) 70px);
    color: #fff;
    text-align: center;
}
.legal .foot,
.legal .foot-discord,
.legal .legal-text { color: #fff; }
.legal .foot {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 10px;
    font-family: var(--font-display);
    font-size: 22px;
    text-shadow: var(--outline-sm);
}
.legal .foot img { width: 28px; height: 28px; filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.35)); }
.legal .foot .badge { margin-left: 4px; font-size: 12px; text-shadow: none; font-family: var(--font-ui); }
.legal .foot-discord { margin: 0 0 14px; font-weight: 600; }
.legal .foot-discord a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.22);
    color: #fff;
    text-decoration: none;
}
.legal .foot-discord a:hover { background: rgba(0, 0, 0, 0.36); }
.legal .legal-text {
    max-width: 46rem;
    margin: 0 auto;
    color: rgba(255, 255, 255, 0.9);
    font-size: 13px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

/* ——— Landing ——— */
.bleed { margin-left: calc(50% - 50vw); margin-right: calc(50% - 50vw); }

body.is-landing .page { margin-top: 0; }
body.is-landing .legal-banner { display: none; }

.realm-hero {
    position: relative;
    padding: clamp(28px, 5vw, 64px) 16px 0;
    overflow: hidden;
}
.realm-hero-inner {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
    align-items: center;
    gap: clamp(16px, 4vw, 48px);
    width: min(1160px, 100%);
    margin: 0 auto;
    padding-bottom: 150px;
}
.realm-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 18px;
    padding: 6px 14px;
    border-radius: 999px;
    background: rgba(8, 36, 70, 0.55);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
}
.realm-kicker .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 0 3px rgba(125, 200, 46, 0.35);
    animation: realm-pulse 2s ease-in-out infinite;
}
@keyframes realm-pulse { 50% { box-shadow: 0 0 0 7px rgba(125, 200, 46, 0); } }

.realm-hero h1 {
    margin: 0 0 14px;
    color: #fff;
    font-size: clamp(42px, 7vw, 76px);
    line-height: 1;
    text-shadow:
        -3px -3px 0 var(--rim), 3px -3px 0 var(--rim), -3px 3px 0 var(--rim), 3px 3px 0 var(--rim),
        0 -3px 0 var(--rim), 0 3px 0 var(--rim), -3px 0 0 var(--rim), 3px 0 0 var(--rim),
        0 7px 0 rgba(0, 0, 0, 0.35);
}
.realm-hero h1 .gold { color: var(--yellow); }
.realm-lede {
    max-width: 34rem;
    margin: 0 0 24px;
    color: #fff;
    font-size: clamp(17px, 2vw, 20px);
    font-weight: 500;
    line-height: 1.5;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.45);
}
.realm-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.realm-cta .btn-xl { animation: realm-breathe 2.6s ease-in-out infinite; }
.realm-cta .btn-xl:hover { animation: none; }
@keyframes realm-breathe { 50% { transform: scale(1.035); } }

.realm-pitch { display: grid; gap: 10px; margin: 26px 0 0; padding: 0; list-style: none; }
.realm-pitch li {
    display: flex;
    align-items: center;
    gap: 12px;
    width: fit-content;
    max-width: 100%;
    padding: 6px 16px 6px 6px;
    border-radius: 999px;
    background: rgba(4, 40, 77, 0.5);
    color: #fff;
    font-weight: 600;
}
.realm-pitch img {
    width: 36px;
    height: 36px;
    flex: none;
    padding: 3px;
    border: 2.5px solid var(--rim);
    border-radius: 50%;
    object-fit: contain;
    background: radial-gradient(circle, #fff, #cfe8fb);
}

.realm-hero-art { position: relative; display: grid; place-items: center; }
.realm-hero-art img {
    width: min(640px, 100%);
    height: auto;
    filter: drop-shadow(0 10px 0 rgba(0, 0, 0, 0.14));
    animation: realm-float 5s ease-in-out infinite;
}
@keyframes realm-float { 50% { transform: translateY(-10px) rotate(0.6deg); } }

.realm-ground {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 120px;
    border-top: 6px solid var(--grass-edge);
    background: linear-gradient(var(--grass-light), var(--grass) 60%);
}
.realm-ground::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 26px;
    height: 46px;
    background: var(--road);
    border-top: 4px solid var(--road-edge);
    border-bottom: 4px solid var(--road-edge);
}

.realm-stats {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    width: min(880px, 100%);
    margin: -70px auto 0;
}
.realm-stat {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border: 4px solid var(--rim);
    border-radius: 22px;
    background: var(--gloss), var(--cream);
    box-shadow: var(--drop);
}
.realm-stat img { width: 50px; height: 50px; padding: 3px; border-radius: 14px; border: 2.5px solid var(--rim); object-fit: contain; background: radial-gradient(circle, #fff, #cfe8fb); }
.realm-stat b { display: block; font-family: var(--font-display); font-size: 24px; font-weight: 400; line-height: 1.1; }
.realm-stat span { color: var(--brown-soft); font-size: 13px; font-weight: 600; }
.realm-stat .on { color: var(--ok); }

.realm-section { margin-top: 64px; }
.realm-section-head { margin: 0 0 22px; text-align: center; }
.realm-section-head h2 {
    margin: 0 0 10px;
    padding: 8px 28px 10px;
    font-size: clamp(24px, 3vw, 32px);
    border-width: 4px;
    border-radius: 18px;
}
.realm-section-head p {
    max-width: 40rem;
    margin: 0 auto;
    color: #fff;
    font-size: 17px;
    font-weight: 500;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.45);
}

.realm-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin: 0; padding: 0; list-style: none; }
.realm-step { position: relative; padding: 34px 22px 22px; text-align: center; }
.realm-step .num {
    position: absolute;
    top: -24px;
    left: 50%;
    transform: translateX(-50%);
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border: 4px solid var(--rim);
    border-radius: 50%;
    background: var(--gloss), var(--yellow);
    color: #fff;
    font-family: var(--font-display);
    font-size: 24px;
    text-shadow: var(--outline-sm);
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.3);
}
.realm-step h3 { margin: 4px 0 6px; font-size: 22px; }
.realm-step p { margin: 0; color: var(--brown-soft); font-weight: 500; }

.realm-features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.realm-feature {
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
    text-decoration: none;
    color: var(--brown);
    transition: transform 0.15s ease-out;
}
a.realm-feature:hover { color: var(--brown); transform: translateY(-4px) rotate(-0.4deg); }
.realm-steps > .card,
.realm-features > .card,
.realm-faq > .card { margin-top: 0; }

.realm-feature .art {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-bottom: 4px solid var(--rim);
    background:
        radial-gradient(ellipse 70% 22% at 50% 82%, rgba(51, 112, 27, 0.35), transparent 70%),
        radial-gradient(circle at 50% 45%, #ffffff 0%, #d7edfc 45%, #93caf1 100%);
}
.realm-feature .art img {
    width: 100%;
    height: 100%;
    padding: 14px 14px 46px;
    object-fit: contain;
    filter: drop-shadow(0 6px 4px rgba(0, 0, 0, 0.18));
    transition: transform 0.3s ease-out;
}
a.realm-feature:hover .art img { transform: scale(1.06); }
.realm-feature .plate {
    position: absolute;
    left: 14px;
    bottom: 12px;
    padding: 4px 14px 6px;
    border: 3px solid var(--rim);
    border-radius: 12px;
    background: var(--gloss), var(--blue);
    color: #fff;
    font-family: var(--font-display);
    font-size: 20px;
    text-shadow: var(--outline-sm);
    box-shadow: 0 3px 0 rgba(0, 0, 0, 0.3);
}
.realm-feature .body { padding: 16px 20px 20px; }
.realm-feature p { margin: 0; color: var(--brown-soft); font-weight: 500; }

.realm-faq { display: grid; gap: 12px; width: min(820px, 100%); margin: 0 auto; }
.realm-faq details { padding: 0; }
.realm-faq summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 22px;
    cursor: pointer;
    list-style: none;
    font-family: var(--font-display);
    font-size: 20px;
}
.realm-faq summary::-webkit-details-marker { display: none; }
.realm-faq summary::after {
    content: "+";
    flex: none;
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border: 3px solid var(--rim);
    border-radius: 10px;
    background: var(--gloss), var(--green);
    color: #fff;
    font-size: 22px;
    line-height: 1;
    text-shadow: var(--outline-sm);
    transition: transform 0.2s ease-out;
}
.realm-faq details[open] summary::after { content: "\2013"; background: var(--gloss), var(--blue); }
.realm-faq details p { margin: 0; padding: 0 22px 18px; color: var(--brown-soft); font-weight: 500; }

.realm-final {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 22px;
    margin-top: 64px;
    padding: 22px 28px;
}
.realm-final img { width: 120px; height: 120px; padding: 8px; border: 4px solid var(--rim); border-radius: 24px; object-fit: contain; background: radial-gradient(circle, #fff, #cfe8fb); box-shadow: 0 4px 0 rgba(0, 0, 0, 0.25); }
.realm-final h2 { margin: 0 0 6px; }
.realm-final p { margin: 0; color: var(--brown-soft); font-weight: 500; }

/* ——— Sign in / create empire: the game's sign-in screen ——— */
.realm-auth {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 480px);
    align-items: center;
    gap: clamp(20px, 5vw, 56px);
    min-height: min(76vh, 760px);
    padding: 24px 0 8px;
}
.realm-auth-side { text-align: center; }
.realm-auth-side img.logo { width: min(520px, 100%); height: auto; filter: drop-shadow(0 6px 0 rgba(0, 0, 0, 0.18)); }
.realm-auth-side .outlined { margin: 6px 0 18px; font-size: clamp(26px, 3.4vw, 36px); }
.realm-auth-side .realm-pitch { justify-items: center; margin-top: 0; }

.realm-window { padding: 58px 32px 26px; }
.realm-window > .title {
    position: absolute;
    top: -32px;
    left: 50%;
    transform: translateX(-50%);
    min-width: min(320px, 80%);
    margin: 0;
    padding: 9px 26px 11px;
    border: 4px solid var(--rim);
    border-radius: 20px;
    background: var(--gloss), var(--blue);
    color: #fff;
    font-family: var(--font-display);
    font-size: 32px;
    line-height: 1.1;
    text-align: center;
    white-space: nowrap;
    text-shadow: var(--outline);
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.3);
}
.realm-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 8px; }
.realm-tabs a {
    display: grid;
    place-items: center;
    min-height: 44px;
    border: 3px solid var(--rim);
    border-radius: 14px;
    background: var(--gloss), var(--tab-idle);
    color: #fff;
    font-family: var(--font-display);
    font-size: 18px;
    text-decoration: none;
    text-shadow: var(--outline-sm);
    box-shadow: 0 3px 0 rgba(0, 0, 0, 0.28);
}
.realm-tabs a[aria-current="page"] { background: var(--gloss), var(--blue); }
.realm-tabs a.is-create[aria-current="page"] { background: var(--gloss), var(--green); }
.realm-tabs a:hover { color: #fff; filter: brightness(1.07); }
.realm-window .hint { margin: 6px 0 0; color: var(--brown-soft); font-size: 14px; }
.realm-window .submit { width: 100%; margin-top: 18px; }
.realm-window .switch { margin: 14px 0 0; text-align: center; color: var(--brown-soft); font-weight: 500; }
.realm-window .switch a { font-weight: 700; }

/* ——— Account page ——— */
.realm-launch {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
    margin: 18px 0 6px;
    padding: 16px 18px;
    border: 3px solid var(--rim);
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(125, 200, 46, 0.22), rgba(61, 154, 232, 0.16)), var(--tile);
}
.realm-launch p { flex: 1 1 260px; margin: 0; font-weight: 500; }

@media (max-width: 960px) {
    .realm-hero-inner { grid-template-columns: 1fr; text-align: center; padding-bottom: 130px; }
    .realm-hero-art { order: -1; }
    .realm-hero-art img { width: min(440px, 88%); }
    .realm-lede { margin-left: auto; margin-right: auto; }
    .realm-cta { justify-content: center; }
    .realm-pitch { justify-items: center; }
    .realm-features { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .realm-auth { grid-template-columns: 1fr; min-height: 0; }
    .realm-auth-side .realm-pitch { display: none; }
    .realm-auth-side img.logo { width: min(360px, 80%); }
}

@media (max-width: 720px) {
    .gamebar-brand img { height: 40px; }
    .gamebar-user { display: none; }
    .realm-stats { grid-template-columns: 1fr; margin-top: -60px; }
    .realm-steps { grid-template-columns: 1fr; gap: 34px; }
    .realm-features { grid-template-columns: 1fr; }
    .realm-final { grid-template-columns: 1fr; text-align: center; justify-items: center; }
    .card { padding: 22px 18px 24px; border-radius: 24px; }
    .realm-window { padding: 54px 20px 22px; }
    .realm-window > .title { font-size: 26px; }
    .btn-xl { font-size: 26px; padding: 10px 26px; }
}

@media (prefers-reduced-motion: reduce) {
    body.empire::before,
    .realm-hero-art img,
    .realm-cta .btn-xl,
    .realm-kicker .dot { animation: none; }
    .btn, .tab, .stat, .realm-feature { transition: none; }
}
