
/* ==========================================================
   CONQUEST OF AZEROTH
   Friends-only WotLK-era World of Warcraft private server
   File: static/style.css
   Optional assets:
     static/bg.jpg
     static/hero.jpg
     static/logo.png
   ========================================================== */

/* ---------- Theme ---------- */

:root {
    color-scheme: dark;

    --bg: #12100e;
    --bg-soft: #17130f;
    --card: #1d1915;
    --card-raised: #252019;
    --card-hover: #2b241b;

    --line: #3a3129;
    --line-light: #514333;

    --text: #efe6d8;
    --text-soft: #d6c9b6;
    --muted: #a39785;

    --gold: #d9a441;
    --gold-light: #f0c66e;
    --gold-dark: #9b702b;

    --alliance: #4a8fe0;
    --alliance-soft: #172b43;
    --alliance-light: #a5d0ff;

    --horde: #d6503f;
    --horde-soft: #401d19;
    --horde-light: #ffaaa0;

    --success: #79bd82;
    --success-bg: #18271b;
    --danger: #ff8b7c;
    --danger-bg: #351a17;
    --warning: #e8bd65;

    --radius: 8px;
    --radius-small: 5px;

    --shadow:
        0 12px 32px rgb(0 0 0 / 28%);

    --shadow-deep:
        0 18px 48px rgb(0 0 0 / 45%);

    --focus:
        0 0 0 3px var(--bg),
        0 0 0 5px var(--gold-light);

    --page-width: 1160px;
    --page-padding: 24px;

    --font-body:
        system-ui, -apple-system, BlinkMacSystemFont,
        "Segoe UI", sans-serif;

    --font-heading:
        "Palatino Linotype", Palatino, Georgia, serif;
}

/* ---------- Reset ---------- */

* {
    box-sizing: border-box;
}

html {
    min-width: 320px;
    min-height: 100%;
    scroll-behavior: smooth;
    background: var(--bg);
    scrollbar-color: #65513a var(--bg);
}

body {
    min-width: 320px;
    min-height: 100vh;
    margin: 0;

    color: var(--text);
    background-color: var(--bg);
    background-image:
        linear-gradient(
            rgb(18 16 14 / 88%),
            rgb(18 16 14 / 94%)
        ),
        url("bg.jpg");
    background-repeat: repeat;
    background-size: auto, 480px 480px;

    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

body,
input,
button {
    font-family: var(--font-body);
}

img {
    max-width: 100%;
}

a {
    color: var(--gold-light);
    text-decoration: none;
    text-underline-offset: 4px;
    transition:
        color 150ms ease,
        background-color 150ms ease,
        border-color 150ms ease;
}

a:hover {
    color: #ffe0a0;
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
    outline: none;
    box-shadow: var(--focus);
    position: relative;
    z-index: 2;
}

button,
input {
    font-size: inherit;
}

button {
    color: inherit;
}

::selection {
    color: #18120a;
    background: var(--gold-light);
}

h1,
h2 {
    margin-top: 0;
    color: var(--text);
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0.01em;
    text-wrap: balance;
}

h1 {
    margin-bottom: 20px;
    font-size: clamp(1.8rem, 4vw, 2.65rem);
}

h2 {
    margin-bottom: 14px;
    font-size: clamp(1.35rem, 3vw, 1.8rem);
}

p {
    margin-top: 0;
}

p:last-child {
    margin-bottom: 0;
}

code {
    padding: 3px 6px;
    border: 1px solid #41372c;
    border-radius: 4px;
    color: #f0cf88;
    background: #110f0d;
    font-family:
        "Cascadia Code", "SFMono-Regular", Consolas,
        "Liberation Mono", monospace;
    font-size: 0.88em;
    overflow-wrap: anywhere;
}

/* ---------- Top navigation ---------- */

.topbar {
    position: relative;
    z-index: 10;

    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px 24px;

    min-height: 76px;
    padding: 12px max(var(--page-padding), calc((100vw - 1320px) / 2));

    border-bottom: 1px solid #57442b;
    background:
        linear-gradient(
            180deg,
            rgb(37 30 22 / 98%),
            rgb(24 20 16 / 98%)
        );

    box-shadow:
        0 3px 0 rgb(0 0 0 / 20%),
        0 10px 30px rgb(0 0 0 / 18%);
}

.topbar::after {
    position: absolute;
    right: 0;
    bottom: -1px;
    left: 0;
    height: 1px;
    background:
        linear-gradient(
            90deg,
            transparent,
            rgb(217 164 65 / 60%),
            transparent
        );
    content: "";
    pointer-events: none;
}

.brand {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    gap: 12px;

    min-height: 48px;
    color: var(--gold-light);

    font-family: var(--font-heading);
    font-size: 1.32rem;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: 0.045em;
    text-transform: uppercase;
}

.brand::before {
    display: block;
    flex: 0 0 42px;
    width: 42px;
    height: 42px;

    border: 1px solid #82602e;
    border-radius: 8px;

    background-color: #21190f;
    background-image:
        url("logo.png"),
        radial-gradient(
            circle at 50% 40%,
            #584021 0,
            #241b11 72%
        );
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;

    box-shadow:
        inset 0 0 0 3px rgb(0 0 0 / 24%),
        0 2px 8px rgb(0 0 0 / 30%);

    content: "";
}

.brand:hover {
    color: #ffe6a7;
}

.tabs {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 4px;

    min-width: 0;
}

.tabs a {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 44px;
    padding: 9px 13px;

    border: 1px solid transparent;
    border-radius: var(--radius-small);

    color: #c2b5a2;
    font-size: 0.91rem;
    font-weight: 650;
    white-space: nowrap;
}

.tabs a:hover {
    border-color: #473927;
    color: var(--gold-light);
    background: rgb(255 255 255 / 3%);
}

.tabs a.on {
    border-color: #5a462b;
    color: #ffe0a0;
    background:
        linear-gradient(
            180deg,
            #382c1d,
            #261e15
        );

    box-shadow:
        inset 0 1px 0 rgb(255 221 151 / 7%),
        0 2px 6px rgb(0 0 0 / 16%);
}

.who {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px 14px;

    margin-left: auto;
    color: var(--muted);
    font-size: 0.9rem;
}

.who-name {
    max-width: 220px;
    overflow: hidden;
    color: var(--text-soft);
    font-weight: 650;
    text-overflow: ellipsis;
    white-space: nowrap;
}

form.inline {
    display: inline-flex;
    align-items: center;
    margin: 0;
}

form.inline button.link {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 44px;
    padding: 7px 10px;

    border: 1px solid transparent;
    border-radius: 4px;

    color: var(--muted);
    background: transparent;
    cursor: pointer;
    font-size: 0.88rem;
    font-weight: 650;
}

form.inline button.link:hover {
    border-color: #5a3028;
    color: #ffaaa0;
    background: rgb(214 80 63 / 9%);
}

/* ---------- Main page ---------- */

.page {
    width: min(100% - 48px, var(--page-width));
    min-height: calc(100vh - 170px);
    margin: 0 auto;
    padding: 44px 0 64px;
}

.page > h1 {
    margin-bottom: 26px;
}

.page > h1 .count {
    vertical-align: middle;
}

.muted {
    color: var(--muted);
}

.fine {
    color: var(--muted);
    font-size: 0.86rem;
    line-height: 1.6;
}

.fine a {
    color: var(--gold-light);
    text-decoration: underline;
    text-decoration-color: rgb(217 164 65 / 45%);
}

.fine a:hover {
    text-decoration-color: currentColor;
}

/* ---------- Home hero ---------- */

.hero {
    position: relative;
    isolation: isolate;
    overflow: hidden;

    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;

    min-height: 390px;
    padding: clamp(30px, 7vw, 76px);

    border: 1px solid #68502f;
    border-radius: 10px;

    background-color: #211a12;
    background-image:
        linear-gradient(
            90deg,
            rgb(15 12 10 / 96%) 0%,
            rgb(18 14 11 / 85%) 40%,
            rgb(18 14 11 / 44%) 100%
        ),
        linear-gradient(
            0deg,
            rgb(14 11 9 / 45%),
            transparent 70%
        ),
        url("hero.jpg");
    background-position: center, center, center;
    background-repeat: no-repeat;
    background-size: cover;

    box-shadow: var(--shadow-deep);
}

.hero::before {
    position: absolute;
    z-index: -1;
    inset: 0;

    border: 1px solid rgb(240 198 110 / 12%);
    border-radius: inherit;

    background:
        radial-gradient(
            ellipse at 20% 0%,
            rgb(217 164 65 / 10%),
            transparent 50%
        );

    content: "";
    pointer-events: none;
}

.hero h1 {
    max-width: 760px;
    margin-bottom: 18px;

    color: #ffe4aa;
    font-size: clamp(2.4rem, 6vw, 4.5rem);
    line-height: 1.05;
    letter-spacing: 0.015em;

    text-shadow: 0 3px 14px rgb(0 0 0 / 75%);
}

.hero h1::after {
    display: block;
    width: 92px;
    height: 3px;
    margin-top: 24px;

    background:
        linear-gradient(
            90deg,
            var(--gold-light),
            var(--gold-dark)
        );

    content: "";
}

.hero p.lead,
.lead {
    max-width: 650px;
    margin-bottom: 28px;

    color: #e1d5c4;
    font-size: clamp(1rem, 2vw, 1.16rem);
    line-height: 1.85;

    text-shadow: 0 2px 8px rgb(0 0 0 / 85%);
}

.actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

/* ---------- Buttons ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    min-height: 46px;
    padding: 11px 20px;

    border: 1px solid #b98632;
    border-radius: 5px;

    color: #1a1309;
    background:
        linear-gradient(
            180deg,
            #f0c66e 0%,
            #d9a441 55%,
            #bd8730 100%
        );

    box-shadow:
        inset 0 1px 0 rgb(255 255 255 / 25%),
        0 3px 8px rgb(0 0 0 / 22%);

    cursor: pointer;
    font-size: 0.94rem;
    font-weight: 750;
    line-height: 1.25;
    text-align: center;
    text-decoration: none;

    transition:
        filter 140ms ease,
        transform 140ms ease,
        border-color 140ms ease,
        background-color 140ms ease;
}

.btn:hover {
    border-color: #ffda86;
    color: #120e08;
    background:
        linear-gradient(
            180deg,
            #ffdc8b,
            #e7b653
        );
    filter: brightness(1.04);
}

.btn:active {
    transform: translateY(1px);
    box-shadow: inset 0 2px 4px rgb(0 0 0 / 18%);
}

.btn.ghost {
    border-color: #7a6344;
    color: #f0dfc3;
    background:
        linear-gradient(
            180deg,
            rgb(43 34 25 / 96%),
            rgb(29 23 17 / 96%)
        );

    box-shadow: inset 0 1px 0 rgb(255 255 255 / 4%);
}

.btn.ghost:hover {
    border-color: var(--gold);
    color: #ffe2a3;
    background: #35291b;
}

.btn.small {
    min-height: 44px;
    padding: 9px 13px;
    font-size: 0.86rem;
}

.btn.wide {
    width: 100%;
    min-height: 48px;
}

/* ---------- Cards and authentication ---------- */

.card {
    padding: clamp(22px, 4vw, 34px);

    border: 1px solid var(--line);
    border-radius: var(--radius);

    background:
        linear-gradient(
            155deg,
            rgb(39 32 25 / 97%),
            rgb(26 22 18 / 98%) 68%
        );

    box-shadow:
        var(--shadow),
        inset 0 1px 0 rgb(255 255 255 / 2%);
}

.card.narrow {
    width: min(100%, 490px);
    margin-right: auto;
    margin-left: auto;
}

.card h1 {
    margin-bottom: 24px;
    color: #f3d18d;
    font-size: clamp(1.8rem, 5vw, 2.35rem);
}

.card form:not(.inline):not(.search) {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
}

.card label {
    margin-top: 8px;
    color: #dfd1bd;
    font-size: 0.92rem;
    font-weight: 700;
}

.card input,
.search input,
input {
    width: 100%;
    min-width: 0;
    min-height: 46px;
    padding: 11px 13px;

    border: 1px solid #554536;
    border-radius: 5px;

    color: var(--text);
    background: #110f0d;

    font-size: 1rem;
    line-height: 1.4;

    box-shadow: inset 0 2px 5px rgb(0 0 0 / 22%);

    transition:
        border-color 150ms ease,
        background-color 150ms ease;
}

input::placeholder {
    color: #8d8070;
    opacity: 1;
}

input:hover {
    border-color: #766044;
}

input:focus {
    border-color: var(--gold);
    outline: none;
    background-color: #17120d;
}

.card form .btn {
    margin-top: 12px;
}

.card .fine {
    margin-top: 18px;
}

.card .fine a {
    font-weight: 650;
}

/* ---------- Character grid ---------- */

.char-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;

    margin: 0;
    padding: 0;
    list-style: none;
}

.char {
    position: relative;
    overflow: hidden;

    display: flex;
    flex-direction: column;
    align-items: flex-start;

    min-width: 0;
    min-height: 190px;
    padding: 24px;

    border: 1px solid var(--line);
    border-radius: var(--radius);

    background:
        linear-gradient(
            145deg,
            rgb(42 35 27 / 98%),
            rgb(27 23 19 / 98%)
        );

    box-shadow:
        0 6px 18px rgb(0 0 0 / 18%),
        inset 0 1px 0 rgb(255 255 255 / 3%);

    transition:
        border-color 180ms ease,
        background-color 180ms ease,
        transform 180ms ease;
}

.char::before {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 3px;

    background: var(--gold-dark);
    content: "";
}

.char.faction-alliance::before {
    background:
        linear-gradient(
            90deg,
            #284e7c,
            var(--alliance),
            #8fc5ff
        );
}

.char.faction-horde::before {
    background:
        linear-gradient(
            90deg,
            #6b2822,
            var(--horde),
            #ff9789
        );
}

.char:hover {
    border-color: #6b5740;
    transform: translateY(-2px);
}

.char.faction-alliance:hover {
    border-color: rgb(74 143 224 / 70%);
}

.char.faction-horde:hover {
    border-color: rgb(214 80 63 / 70%);
}

.char-name {
    max-width: 100%;
    margin-bottom: 7px;

    color: #f4e5cb;
    font-family: var(--font-heading);
    font-size: clamp(1.2rem, 2.5vw, 1.6rem);
    font-weight: 700;
    line-height: 1.3;

    overflow-wrap: anywhere;
}

.faction-alliance .char-name {
    color: var(--alliance-light);
}

.faction-horde .char-name {
    color: var(--horde-light);
}

.char-meta {
    margin-bottom: 14px;
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.7;
    overflow-wrap: anywhere;
}

.char-badges {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;

    margin-bottom: 20px;
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 28px;
    padding: 4px 10px;

    border: 1px solid #514333;
    border-radius: 4px;

    color: #d5c5ad;
    background: #282118;

    font-size: 0.76rem;
    font-weight: 750;
    line-height: 1.3;
    letter-spacing: 0.035em;
}

.badge.alliance {
    border-color: #345b88;
    color: #b6d8ff;
    background: #1a2b40;
}

.badge.horde {
    border-color: #74382f;
    color: #ffb3a9;
    background: #3a201c;
}

.badge.on {
    border-color: #386346;
    color: #a9e5b2;
    background: #192b1e;
}

.badge.wait {
    border-color: #79602e;
    color: #f1d18b;
    background: #342817;
}

.char > .btn {
    margin-top: auto;
}

/* ---------- Character modal ---------- */

/* Keep hidden by default and visible only when targeted. */
.modal {
    position: fixed;
    z-index: 1000;
    inset: 0;

    display: none;
    align-items: center;
    justify-content: center;

    overflow-y: auto;
    padding: 20px;

    background: rgb(0 0 0 / 72%);
    backdrop-filter: blur(4px);
}

.modal:target {
    display: flex;
}

.modal-bg {
    position: fixed;
    z-index: 0;
    inset: 0;
    display: block;
    background: transparent;
    cursor: default;
}

.modal-box {
    position: relative;
    z-index: 1;

    width: min(100%, 560px);
    max-height: calc(100vh - 40px);
    overflow-y: auto;

    padding: clamp(22px, 5vw, 36px);

    border: 1px solid #705632;
    border-radius: 9px;

    color: var(--text);
    background:
        linear-gradient(
            145deg,
            #2a231b,
            #191511 75%
        );

    box-shadow:
        0 24px 80px rgb(0 0 0 / 65%),
        inset 0 1px 0 rgb(255 255 255 / 4%);
}

.modal-box h2 {
    padding-right: 35px;
    color: #f3d18d;
}

.modal-x {
    position: absolute;
    top: 14px;
    right: 14px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 44px;
    height: 44px;

    border: 1px solid #514333;
    border-radius: 5px;

    color: #d8c9b5;
    background: #211b14;

    font-size: 1.5rem;
    line-height: 1;
}

.modal-x:hover {
    border-color: var(--horde);
    color: #ffb3a9;
    background: var(--horde-soft);
}

.char-class {
    margin-bottom: 22px;
    color: var(--muted);
    font-size: 0.94rem;
}

.option {
    margin-top: 14px;
    padding: 16px;

    border: 1px solid #473a2b;
    border-radius: 6px;

    background: rgb(0 0 0 / 13%);
}

.option form {
    margin: 0;
}

.option .btn {
    width: 100%;
}

.option p.fine {
    margin-top: 10px;
}

.notice {
    margin-top: 20px;
    padding: 13px 15px;

    border: 1px solid #69502c;
    border-left: 3px solid var(--gold);
    border-radius: 4px;

    color: #e4d0a9;
    background: #2b2114;

    font-size: 0.9rem;
    line-height: 1.65;
}

/* ---------- Online players / commands ---------- */

.count {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-width: 34px;
    min-height: 30px;
    margin-left: 7px;
    padding: 3px 9px;

    border: 1px solid #65502f;
    border-radius: 5px;

    color: var(--gold-light);
    background: #2b2114;

    font-family: var(--font-body);
    font-size: 0.82rem;
    font-weight: 750;
    line-height: 1.3;
    vertical-align: 0.2em;
}

.search {
    display: flex;
    align-items: stretch;
    gap: 10px;

    width: 100%;
    margin: 0 0 24px;
}

.search input {
    flex: 1 1 auto;
    width: auto;
}

.search .btn {
    flex: 0 0 auto;
    align-self: stretch;
}

.table {
    width: 100%;
    border: 1px solid var(--line);
    border-spacing: 0;
    border-collapse: separate;
    border-radius: 7px;
    overflow: hidden;

    background: rgb(29 25 21 / 96%);

    box-shadow: var(--shadow);
    font-size: 0.92rem;
    text-align: left;
}

.table thead {
    background:
        linear-gradient(
            180deg,
            #33291c,
            #282016
        );
}

.table th {
    padding: 14px 16px;

    border-bottom: 1px solid #69502f;

    color: #f0d39b;
    font-size: 0.82rem;
    font-weight: 750;
    letter-spacing: 0.045em;
    text-transform: uppercase;
}

.table td {
    padding: 13px 16px;
    border-bottom: 1px solid #342b22;
    color: var(--text-soft);
    vertical-align: middle;
    overflow-wrap: anywhere;
}

.table tbody tr:last-child td {
    border-bottom: 0;
}

.table tbody tr {
    background: rgb(255 255 255 / 0%);
    transition: background-color 120ms ease;
}

.table tbody tr:nth-child(even) {
    background: rgb(255 255 255 / 2%);
}

.table tbody tr:hover {
    background: rgb(217 164 65 / 6%);
}

.table .nowrap,
.nowrap {
    white-space: nowrap;
}

/* ---------- Flash messages ---------- */

.flash {
    margin: 0 0 22px;
    padding: 14px 18px;

    border: 1px solid var(--line-light);
    border-left: 4px solid var(--gold);
    border-radius: 5px;

    color: var(--text);
    background: var(--card);

    font-size: 0.94rem;
    line-height: 1.6;

    overflow-wrap: anywhere;
}

.flash.good {
    border-color: #34583b;
    border-left-color: var(--success);
    color: #c3e8c8;
    background: var(--success-bg);
}

.flash.bad {
    border-color: #65342d;
    border-left-color: var(--danger);
    color: #ffc0b6;
    background: var(--danger-bg);
}

/* ---------- Footer ---------- */

.foot {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px 18px;

    min-height: 76px;
    padding: 22px 24px;

    border-top: 1px solid #33291e;

    color: #8f8270;
    background:
        linear-gradient(
            180deg,
            #17130f,
            #110f0d
        );

    font-size: 0.84rem;
    line-height: 1.6;
    text-align: center;
}

.foot a {
    color: #c4a56e;
}

.foot a:hover {
    color: var(--gold-light);
}

/* ---------- Responsive: tablets ---------- */

@media (max-width: 960px) {
    .topbar {
        justify-content: center;
        gap: 8px 16px;
        padding: 12px 20px;
    }

    .brand {
        margin-right: auto;
    }

    .tabs {
        order: 3;
        flex: 1 0 100%;
        justify-content: flex-start;
        padding-top: 5px;
        border-top: 1px solid rgb(255 255 255 / 5%);
    }

    .who {
        margin-left: auto;
    }

    .page {
        padding-top: 34px;
    }

    .hero {
        min-height: 340px;
    }

    .char-grid {
        gap: 14px;
    }
}

/* ---------- Responsive: phones ---------- */

@media (max-width: 600px) {
    :root {
        --page-padding: 16px;
    }

    body {
        font-size: 14px;
        line-height: 1.65;
        background-size: auto, 320px 320px;
    }

    .topbar {
        gap: 8px;
        padding: 12px 16px;
    }

    .brand {
        gap: 9px;
        min-height: 44px;
        font-size: clamp(0.95rem, 4vw, 1.2rem);
        letter-spacing: 0.015em;
    }

    .brand::before {
        flex-basis: 36px;
        width: 36px;
        height: 36px;
    }

    .who {
        gap: 4px;
        font-size: 0.82rem;
    }

    .who-name {
        max-width: 105px;
    }

    form.inline button.link {
        padding-right: 7px;
        padding-left: 7px;
        font-size: 0.82rem;
    }

    .tabs {
        display: flex;
        flex-wrap: nowrap;
        justify-content: flex-start;
        gap: 5px;

        overflow-x: auto;
        overscroll-behavior-x: contain;
        scrollbar-width: thin;

        padding: 5px 0 8px;
    }

    .tabs a {
        flex: 0 0 auto;
        min-height: 44px;
        padding: 9px 12px;
        font-size: 0.85rem;
    }

    .page {
        width: calc(100% - 32px);
        min-height: calc(100vh - 190px);
        padding: 26px 0 42px;
    }

    .page > h1 {
        margin-bottom: 21px;
    }

    .hero {
        min-height: 340px;
        padding: 26px 22px;

        background-image:
            linear-gradient(
                90deg,
                rgb(15 12 10 / 95%),
                rgb(18 14 11 / 76%)
            ),
            linear-gradient(
                0deg,
                rgb(14 11 9 / 35%),
                transparent
            ),
            url("hero.jpg");

        background-position: center;
        border-radius: 7px;
    }

    .hero h1 {
        font-size: clamp(2.05rem, 9vw, 3rem);
    }

    .hero h1::after {
        margin-top: 18px;
    }

    .hero p.lead,
    .lead {
        margin-bottom: 24px;
        font-size: 1rem;
        line-height: 1.75;
    }

    .actions {
        align-items: stretch;
        width: 100%;
        gap: 10px;
    }

    .actions .btn {
        flex: 1 1 100%;
        width: 100%;
    }

    .card {
        padding: 22px 18px;
    }

    .card.narrow {
        width: 100%;
    }

    .card h1 {
        font-size: 1.85rem;
    }

    .char-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 14px;
    }

    .char {
        min-height: 170px;
        padding: 21px 18px;
    }

    .char-name {
        font-size: 1.4rem;
    }

    .char-badges {
        margin-bottom: 17px;
    }

    .char > .btn {
        width: 100%;
    }

    .search {
        gap: 8px;
        margin-bottom: 18px;
    }

    .search input {
        min-width: 0;
        padding: 10px;
    }

    .search .btn {
        padding: 9px 12px;
    }

    /* Preserve every table column without shrinking text
       to an unreadable size. Scroll horizontally as needed. */
    .table {
        display: block;
        width: 100%;
        max-width: 100%;
        overflow-x: auto;
        overscroll-behavior-x: contain;
        -webkit-overflow-scrolling: touch;

        font-size: 0.86rem;
    }

    .table table {
        width: 100%;
    }

    .table th,
    .table td {
        padding: 12px 13px;
    }

    .table th {
        font-size: 0.76rem;
    }

    .table .nowrap,
    .nowrap {
        white-space: nowrap;
    }

    .count {
        min-width: 30px;
        min-height: 28px;
        margin-left: 4px;
        padding: 3px 7px;
        font-size: 0.76rem;
    }

    .modal {
        align-items: center;
        padding: 12px;
    }

    .modal-box {
        width: 100%;
        max-height: calc(100dvh - 24px);
        padding: 24px 18px;
        border-radius: 7px;
    }

    .modal-x {
        top: 9px;
        right: 9px;
    }

    .option {
        padding: 13px;
    }

    .flash {
        padding: 12px 14px;
        margin-bottom: 18px;
    }

    .foot {
        gap: 6px 12px;
        padding: 20px 16px;
        font-size: 0.8rem;
    }
}

/* ---------- Small phones ---------- */

@media (max-width: 380px) {
    .brand {
        font-size: 0.92rem;
    }

    .brand::before {
        flex-basis: 32px;
        width: 32px;
        height: 32px;
    }

    .who-name {
        max-width: 85px;
    }

    .page {
        width: calc(100% - 28px);
    }

    .hero {
        min-height: 320px;
        padding: 23px 17px;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .card {
        padding: 20px 15px;
    }

    .table th,
    .table td {
        padding: 11px 10px;
    }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ---------- High contrast preference ---------- */

@media (prefers-contrast: more) {
    :root {
        --line: #766858;
        --muted: #c1b4a2;
        --gold: #ffcf61;
    }

    .btn.ghost,
    .badge,
    .tabs a {
        border-color: #8a765c;
    }

    input {
        border-color: #8a765c;
    }
}
/* Fix (Claude): on phones keep table cells on one line and scroll sideways instead of crushing columns. */
@media (max-width: 600px) {
    .table th,
    .table td {
        white-space: nowrap;
        overflow-wrap: normal;
    }
}
