/* ==========================================================================
   Nullvald — dark fantasy theme
   ========================================================================== */
:root {
    --bg: #13100d;
    --bg-2: #1a1612;
    --panel: #201b16;
    --panel-2: #29221b;
    --border: #3a3027;
    --border-2: #4d3f31;
    --text: #ece3d4;
    --muted: #a3937d;
    --gold: #d9a94e;
    --gold-2: #f0c66e;
    --ember: #e3632c;
    --ember-2: #ff8a4c;
    --good: #79c27d;
    --bad: #e05d55;
    --info: #6aa6dc;
    --energy: #4fae5b;
    --courage: #d9822b;
    --health: #c9433d;
    --xp: #8a6fd1;
    --radius: 10px;
    --shadow: 0 6px 24px rgba(0, 0, 0, .35);
    --font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --display: 'Cinzel', Georgia, serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    background: radial-gradient(ellipse at top, #241a12 0%, var(--bg) 55%) fixed, var(--bg);
    color: var(--text);
    font: 15px/1.5 var(--font);
    min-height: 100vh;
}
a { color: var(--gold-2); text-decoration: none; }
a:hover { color: var(--ember-2); text-decoration: underline; }
h1, h2, h3 { font-family: var(--display); font-weight: 700; letter-spacing: .02em; margin: 0 0 .6em; line-height: 1.25; }
h1 { font-size: 1.8rem; }
h2 { font-size: 1.15rem; color: var(--gold-2); }
h2 .small { font-family: var(--font); font-weight: 400; letter-spacing: 0; margin-left: .5em; }
h3 { font-size: 1rem; }
.card .table + h3, .card dl + h3, .card p + h3 { margin-top: 18px; }
p { margin: 0 0 .8em; }
code { background: var(--panel-2); padding: 1px 5px; border-radius: 4px; font-size: .9em; }
.muted { color: var(--muted); }
.small { font-size: .85em; }
.center { text-align: center; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.good { color: var(--good); }
.bad { color: var(--bad); }
.plain { list-style: none; padding: 0; margin: 0; }
.plain li { padding: 4px 0; }
.inline { display: inline; }

/* ---------- Top bar ---------- */
.topbar {
    position: sticky; top: 0; z-index: 30;
    display: flex; align-items: center; gap: 12px;
    padding: 10px 20px;
    background: rgba(19, 16, 13, .92);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
}
.brand { white-space: nowrap; font-family: var(--display); font-size: 1.35rem; font-weight: 700; color: var(--gold-2); letter-spacing: .06em; }
.brand:hover { text-decoration: none; color: var(--gold-2); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
/* Your name, level and XP in the top bar */
.top-me { display: flex; align-items: center; gap: 8px; margin-left: 24px; min-width: 150px; max-width: 220px; flex: 0 1 220px; }
.top-me-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.top-me-head { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.top-me-name { font-family: var(--display); font-weight: 700; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.top-me-name:hover { color: var(--gold-2); text-decoration: none; }
.top-me-level { flex: none; font-size: .74rem; font-weight: 600; color: var(--gold-2); }
.top-me .bar-xp { height: 7px; }
/* Energy, courage and health in the top bar */
.top-stats { display: flex; align-items: center; gap: 14px; margin-left: 18px; flex: 1 1 auto; min-width: 0; max-width: 760px; }
.top-stats.bars { margin-bottom: 0; padding: 6px 10px; }
.top-stat.bar-row + .top-stat.bar-row { margin-top: 0; }
.top-stat { flex: 1 1 0; min-width: 0; display: flex; align-items: center; gap: 8px; color: var(--text); padding: 3px 6px; border-radius: 8px; }
.top-stat:hover { background: var(--panel-2); text-decoration: none; }
.top-stat-icon { font-size: 1.05rem; line-height: 1; }
.top-stat-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.top-stat-head { display: flex; justify-content: space-between; gap: 6px; font-size: .74rem; font-weight: 600; line-height: 1.1; white-space: nowrap; }
.top-stat-label { color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-size: .66rem; }
.top-stat .bar { display: block; height: 7px; }
.top-stat .bar-fill { display: block; }
.top-stat .bar-foot { display: block; margin-top: 0; font-size: .64rem; line-height: 1.1; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.gold-pill { white-space: nowrap; background: var(--panel-2); border: 1px solid var(--border-2); border-radius: 999px; padding: 4px 12px; font-weight: 600; color: var(--gold-2); }
.icon-link { position: relative; font-size: 1.15rem; padding: 4px 6px; border-radius: 8px; }
.icon-link:hover { background: var(--panel-2); text-decoration: none; }
.icon-link .badge { position: absolute; top: -4px; right: -6px; }
.nav-toggle { display: none; background: none; border: 1px solid var(--border-2); color: var(--text); border-radius: 8px; font-size: 1.1rem; padding: 3px 10px; cursor: pointer; }

/* ---------- Shell ---------- */
.shell { display: grid; grid-template-columns: 260px minmax(0, 1fr); max-width: 1320px; margin: 0 auto; }
.sidebar {
    padding: 18px 14px; border-right: 1px solid var(--border);
    position: sticky; top: 53px; height: calc(100vh - 53px); overflow-y: auto;
}
.content { padding: 24px 28px 60px; min-width: 0; }
.page-title { margin-bottom: 18px; }

/* ---------- Sidebar: player block ---------- */
.me { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; margin-bottom: 12px; }
.me-name { font-family: var(--display); font-size: 1.1rem; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.me-name a { color: var(--text); }
.race-icon { font-size: 1.4rem; }
.me-meta { color: var(--muted); font-size: .85rem; margin-bottom: 8px; }

.bars { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; margin-bottom: 12px; }
.bar-row + .bar-row { margin-top: 10px; }
.bar-head { display: flex; justify-content: space-between; font-size: .82rem; font-weight: 600; margin-bottom: 3px; }
.bar-val { color: var(--muted); font-variant-numeric: tabular-nums; }
.bar-foot { font-size: .72rem; color: var(--muted); margin-top: 2px; }
.bar { position: relative; height: 10px; background: #0d0b09; border: 1px solid var(--border); border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 999px; transition: width .4s ease; }
.bar-energy .bar-fill { background: linear-gradient(90deg, #2f7d3a, var(--energy)); }
.bar-courage .bar-fill { background: linear-gradient(90deg, #a5561b, var(--courage)); }
.bar-health .bar-fill { background: linear-gradient(90deg, #8d2a26, var(--health)); }
.bar-focus .bar-fill { background: linear-gradient(90deg, #3e5f8a, #8fb6e8); }
.top-timers { display: flex; gap: 6px; margin-left: auto; }
.top-timers + .topbar-right { margin-left: 10px; }
.use-many { display: flex; gap: 4px; align-items: center; }
.use-many input { width: 58px; padding: 4px 6px; }
.cooldown-note { margin-top: -6px; }
.top-timer { white-space: nowrap; font-size: .78rem; font-weight: 600; color: var(--muted); background: var(--panel-2); border: 1px solid var(--border-2); border-radius: 999px; padding: 3px 8px; font-variant-numeric: tabular-nums; }
.top-timer.timer-focus { color: #8fb6e8; border-color: rgba(143, 182, 232, .5); }
.bar-xp { height: 16px; }
.bar-xp .bar-fill { background: linear-gradient(90deg, #5b45a3, var(--xp)); }
.bar-label { position: absolute; inset: 0; font-size: .68rem; line-height: 14px; text-align: center; color: #fff; text-shadow: 0 1px 2px #000; }

.status-box { display: block; border-radius: var(--radius); padding: 10px 12px; margin-bottom: 12px; font-weight: 600; border: 1px solid; }
.status-box span { display: block; font-variant-numeric: tabular-nums; font-size: 1.2rem; }
.status-box:hover { text-decoration: none; }
.status-infirmary { background: rgba(201, 67, 61, .15); border-color: rgba(201, 67, 61, .5); color: #f1a29d; }

/* ---------- Sidebar nav ---------- */
.nav a, .nav-btn {
    display: flex; align-items: center; gap: 10px; width: 100%;
    padding: 7px 10px; border-radius: 8px; color: var(--text); font: inherit; font-size: .93rem;
    background: none; border: 0; cursor: pointer; text-align: left;
}
.nav a:hover, .nav-btn:hover { background: var(--panel-2); text-decoration: none; color: var(--gold-2); }
.nav a.active { background: linear-gradient(90deg, rgba(217, 169, 78, .18), transparent); color: var(--gold-2); box-shadow: inset 3px 0 0 var(--gold); }
.nav-icon { width: 22px; text-align: center; }
.nav-group { font-size: .7rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin: 14px 10px 4px; }
.nav > a:first-child { margin-bottom: 2px; }
.nav .badge { margin-left: auto; }
.badge { background: var(--ember); color: #fff; font-size: .7rem; font-weight: 700; border-radius: 999px; padding: 1px 7px; line-height: 1.4; }

/* ---------- Cards & layout helpers ---------- */
.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 18px; box-shadow: var(--shadow); }
.card.narrow { max-width: 620px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.grid-2 > .card, .grid-3 > .card { margin-bottom: 0; }
.grid-2, .grid-3 { margin-bottom: 18px; }
form.card .grid-2 { margin-bottom: 0; gap: 12px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }

.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 8px 16px; border-radius: 8px; border: 1px solid var(--border-2);
    background: var(--panel-2); color: var(--text); font: inherit; font-weight: 600; font-size: .9rem;
    cursor: pointer; transition: background .15s, border-color .15s, transform .05s; white-space: nowrap;
}
.btn:hover { background: #352c23; border-color: var(--gold); color: var(--text); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: linear-gradient(180deg, #c98d34, #a8701f); border-color: #d9a94e; color: #1a1209; }
.btn-primary:hover { background: linear-gradient(180deg, #ddA040, #b97c25); color: #1a1209; }
.btn-danger { background: linear-gradient(180deg, #b63e35, #8f2c25); border-color: #d05a50; color: #fff; }
.btn-danger:hover { background: linear-gradient(180deg, #c84a40, #a0342c); color: #fff; }
.btn-small { padding: 4px 10px; font-size: .8rem; }
.btn-large { padding: 12px 26px; font-size: 1.05rem; }
.btn-block { width: 100%; }
.btn[disabled], .btn.disabled { opacity: .45; cursor: not-allowed; pointer-events: none; }

/* ---------- Forms ---------- */
.form label, label { display: block; font-size: .85rem; color: var(--muted); margin-bottom: 12px; }
input, select, textarea {
    display: block; width: 100%; margin-top: 4px;
    background: #110e0b; color: var(--text); border: 1px solid var(--border-2); border-radius: 8px;
    padding: 8px 10px; font: inherit; font-size: .95rem;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(217, 169, 78, .2); }
.row input, .row select { width: auto; margin-top: 0; flex: 1; min-width: 70px; }
input.qty, .row input[type=number] { max-width: 90px; flex: 0 0 90px; }
label.check, label.radio { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: .95rem; }
label.check input, label.radio input { width: auto; margin: 0; }
fieldset { border: 0; padding: 0; margin: 0 0 14px; }
legend { font-size: .85rem; color: var(--muted); margin-bottom: 6px; }

/* ---------- Tables ---------- */
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th { text-align: left; font-weight: 600; color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; padding: 6px 8px; border-bottom: 1px solid var(--border-2); }
.table td { padding: 8px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr:hover td { background: rgba(255, 255, 255, .02); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table tr.total td { font-weight: 700; border-top: 1px solid var(--border-2); }
.table tr.selected td { background: rgba(217, 169, 78, .08); }
.table tr.unread td { font-weight: 700; }
.table tr.banned td { opacity: .55; }
.card > .table { margin: -4px 0; }

/* ---------- Tags, chips, tabs ---------- */
.tag { display: inline-block; font-size: .75rem; padding: 2px 8px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--border-2); color: var(--text); white-space: nowrap; }
.tag-good { border-color: rgba(121, 194, 125, .6); color: var(--good); }
.tag-risk { border-color: rgba(224, 93, 85, .6); color: #f19a94; }
.tag-gold { border-color: var(--gold); color: var(--gold-2); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; overflow-x: auto; }
.tab { padding: 9px 16px; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; font-weight: 600; }
.tab:hover { color: var(--text); text-decoration: none; }
.tab.active { color: var(--gold-2); border-bottom-color: var(--gold); }
.filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.chip { padding: 4px 12px; border-radius: 999px; border: 1px solid var(--border-2); color: var(--muted); font-size: .85rem; }
.chip:hover { text-decoration: none; color: var(--text); }
.chip.active { background: var(--gold); border-color: var(--gold); color: #1a1209; font-weight: 600; }

/* ---------- Flash & notices ---------- */
.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; border: 1px solid; }
.flash-success { background: rgba(121, 194, 125, .12); border-color: rgba(121, 194, 125, .45); color: #b9e6bb; }
.flash-error { background: rgba(224, 93, 85, .12); border-color: rgba(224, 93, 85, .5); color: #f6b8b3; }
.notice { padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; background: rgba(217, 169, 78, .1); border: 1px solid rgba(217, 169, 78, .4); color: var(--gold-2); }
.result { border-left: 4px solid var(--border-2); }
.result-good { border-left-color: var(--good); }
.result-bad { border-left-color: var(--bad); }
.result-meh { border-left-color: var(--muted); }

/* ---------- Home ---------- */
.quick-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.quick { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 16px; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); font-weight: 600; }
.quick span { font-size: 1.8rem; }
.quick:hover { border-color: var(--gold); text-decoration: none; color: var(--gold-2); transform: translateY(-2px); transition: transform .15s; }
.news + .news { border-top: 1px solid var(--border); padding-top: 12px; margin-top: 12px; }
.news h3 { margin-bottom: 2px; }
.news p { margin-top: 6px; }
.events { list-style: none; padding: 0; margin: 0; }
.events li { padding: 8px 0 8px 12px; border-bottom: 1px solid var(--border); border-left: 3px solid transparent; }
.events li:last-child { border-bottom: 0; }
.events li.unseen { border-left-color: var(--ember); background: rgba(227, 99, 44, .05); }

/* ---------- Gym ---------- */
.gym-head { display: flex; justify-content: space-between; gap: 20px; align-items: center; flex-wrap: wrap; }
.gym-meta { display: flex; gap: 24px; }
.gym-meta div { text-align: center; }
.gym-meta b { display: block; font-size: 1.5rem; color: var(--gold-2); font-family: var(--display); }
.gym-meta span { font-size: .78rem; color: var(--muted); }
.gym-head-main p { margin: 4px 0; }
.gym-next .btn { margin-left: 6px; }
.gym-meta b.focus-mult { color: #8fb6e8; }
.focus-hot { color: #8fb6e8; font-weight: 600; }
.gym-programmes { flex-basis: 100%; border-top: 1px solid var(--border); padding-top: 10px; }
.gym-programmes > summary { cursor: pointer; color: var(--gold-2); font-weight: 600; font-size: .9rem; }
.table-compact td, .table-compact th { padding-top: 5px; padding-bottom: 5px; }
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat-card { text-align: center; margin: 0; display: flex; flex-direction: column; }
.stat-icon { font-size: 2rem; }
.stat-value { font-family: var(--display); font-size: 1.5rem; color: var(--gold-2); font-variant-numeric: tabular-nums; }
.stat-card p { flex: 1; }
.train-row { display: flex; gap: 6px; justify-content: center; }
.train-row input { width: 64px; margin: 0; text-align: center; }

/* ---------- Quests ---------- */
.quest { display: flex; gap: 18px; align-items: center; }
.quest.locked { opacity: .5; }
.quest-main { flex: 1; }
.quest-main h3 { margin-bottom: 2px; }
.quest-meta { display: flex; gap: 6px; flex-wrap: wrap; }
.quest-side { text-align: center; min-width: 110px; }
.chance { font-family: var(--display); font-size: 1.6rem; color: var(--gold-2); margin-bottom: 6px; }
.monster-icon { font-size: 2.6rem; width: 68px; height: 68px; flex: 0 0 68px; display: grid; place-items: center; background: var(--panel-2); border: 1px solid var(--border-2); border-radius: 14px; }
.quest-main h3 .small { font-family: var(--font); font-weight: 400; margin-left: 4px; }
.threat { font-family: var(--display); font-weight: 700; font-size: 1.05rem; margin-bottom: 8px; line-height: 1.2; }
.threat small { display: block; font-family: var(--font); font-weight: 500; font-size: .75rem; color: var(--muted); }
.threat-easy { color: var(--good); }
.threat-fair { color: var(--gold-2); }
.threat-risky { color: var(--courage); }
.threat-danger { color: var(--bad); }
.threat-deadly { color: #ff4d6d; text-shadow: 0 0 10px rgba(255, 77, 109, .35); }
.log-toggle { margin-top: 6px; }
.more-monsters { margin: 4px 0 18px; }
.more-monsters > summary { cursor: pointer; color: var(--gold-2); font-weight: 600; padding: 10px 0; }
.log-toggle summary { cursor: pointer; color: var(--gold-2); font-weight: 600; font-size: .9rem; }
.log-toggle .fight-log { margin-top: 8px; max-height: 360px; overflow-y: auto; }

/* ---------- Status screens ---------- */
.status-card { text-align: center; }
.big-timer { font-family: var(--display); font-size: 2.6rem; color: var(--gold-2); font-variant-numeric: tabular-nums; margin: 8px 0; }
.status-card .actions { justify-content: center; }
.big-number { font-family: var(--display); font-size: 1.8rem; color: var(--gold-2); }

/* ---------- Items / shops ---------- */
.item-list { display: flex; flex-direction: column; }
.item-row { display: flex; align-items: center; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.item-row:last-child { border-bottom: 0; }
.item-row.equipped .item-icon { box-shadow: 0 0 0 2px var(--good); }
.item-icon { font-size: 1.6rem; width: 46px; height: 46px; display: grid; place-items: center; background: var(--panel-2); border-radius: 10px; flex: 0 0 46px; }
.item-info { flex: 1; min-width: 0; }
.item-actions { display: flex; gap: 6px; align-items: flex-start; }
.dropdown { position: relative; }
.dropdown summary { list-style: none; }
.dropdown summary::-webkit-details-marker { display: none; }
.dropdown-body { position: absolute; right: 0; top: calc(100% + 6px); z-index: 10; width: 290px; background: var(--panel-2); border: 1px solid var(--border-2); border-radius: var(--radius); padding: 12px; box-shadow: var(--shadow); }
.mini-form { margin-bottom: 10px; }
.mini-form label { margin-bottom: 4px; }
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.shop-item { margin: 0; display: flex; flex-direction: column; }
.shop-item.locked { opacity: .55; }
.shop-item p { flex: 1; }
.shop-icon { font-size: 2.2rem; }
.shop-stats { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 8px; }
.price { font-family: var(--display); font-size: 1.25rem; color: var(--gold-2); margin-bottom: 8px; }

/* ---------- Players / profile / combat ---------- */
.search-bar { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.search-bar input[name=q] { max-width: 320px; margin: 0; }
.search-bar label.check { margin: 0; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #555; margin-right: 6px; vertical-align: middle; }
.dot.on { background: var(--good); box-shadow: 0 0 6px var(--good); }
.plink { font-weight: 600; }
.profile-head { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.avatar { font-size: 3rem; width: 80px; height: 80px; display: grid; place-items: center; background: var(--panel-2); border: 2px solid var(--border-2); border-radius: 50%; }
.profile-main { flex: 1; min-width: 220px; }
.profile-main h2 { margin-bottom: 4px; font-size: 1.5rem; }
.profile-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.bio { white-space: normal; }
.versus { display: flex; align-items: center; justify-content: center; gap: 40px; }
.vs-side { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.vs { font-family: var(--display); font-size: 2rem; color: var(--ember); }
.fight-log { padding-left: 24px; margin: 0; }
.fight-log li { padding: 4px 0; }
.fight-log li.atk { color: #f0d6b0; }
.fight-log li.def { color: #b9cde6; }
.fight-log li.crit { font-weight: 700; }
.fight-log li.miss { opacity: .7; }
.fights li { border-bottom: 1px solid var(--border); padding: 6px 0; }

/* ---------- Guilds / messages ---------- */
.post { padding: 10px 0; border-bottom: 1px solid var(--border); }
.post:last-child { border-bottom: 0; }
.post-head { margin-bottom: 4px; }
.message-body { background: var(--bg-2); border: 1px solid var(--border); border-radius: 8px; padding: 14px; }
.danger-zone { border-color: rgba(224, 93, 85, .45); }
.hof .rank { font-size: 1.2rem; width: 40px; }

/* ---------- Admin ---------- */
body.admin .sidebar { background: rgba(0, 0, 0, .15); }
.stat-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.tile { margin: 0; }
.tile-value { font-family: var(--display); font-size: 1.6rem; color: var(--gold-2); }

/* ---------- Public pages ---------- */
body.public { background: radial-gradient(ellipse at 50% -10%, #3a2412 0%, var(--bg) 60%) fixed, var(--bg); }
.public-wrap { max-width: 1040px; margin: 0 auto; padding: 24px 20px 40px; }
.public-brand { display: block; text-align: center; font-family: var(--display); font-size: 1.4rem; font-weight: 700; color: var(--gold-2); margin-bottom: 24px; letter-spacing: .08em; }
.public-brand:hover { text-decoration: none; }
.public-foot { text-align: center; color: var(--muted); font-size: .85rem; margin-top: 40px; }
.hero { text-align: center; padding: 40px 0 30px; }
.hero h1 { font-size: clamp(2.4rem, 7vw, 4.2rem); background: linear-gradient(180deg, #ffe2a3, #d9a94e 60%, #a66b1f); -webkit-background-clip: text; background-clip: text; color: transparent; text-shadow: 0 0 40px rgba(227, 99, 44, .25); margin-bottom: .2em; }
.hero-sub { max-width: 620px; margin: 0 auto 26px; color: var(--muted); font-size: 1.1rem; }
.hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.hero-stats { display: flex; gap: 40px; justify-content: center; margin-top: 34px; }
.hero-stats b { display: block; font-family: var(--display); font-size: 1.8rem; color: var(--gold-2); }
.hero-stats span { color: var(--muted); font-size: .85rem; }
.feature-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 30px; }
.feature { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.feature > span { font-size: 2rem; }
.feature h3 { margin: 8px 0 6px; color: var(--gold-2); }
.feature p { color: var(--muted); margin: 0; }
.auth-card { max-width: 420px; margin: 0 auto; }
.auth-card.wide { max-width: 680px; }

/* ---------- Recovery code ---------- */
.recovery-card { max-width: 640px; border-color: rgba(217, 169, 78, .55); }
.recovery-code { font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-size: clamp(1.2rem, 5vw, 1.9rem); letter-spacing: .12em; text-align: center; padding: 16px; margin: 14px 0 4px; background: #0d0b09; border: 1px dashed var(--gold); border-radius: var(--radius); color: var(--gold-2); user-select: all; word-break: break-all; }
.auth-card .tabs { margin-bottom: 14px; }

/* ---------- Responsive ---------- */
@media (max-width: 1680px) {
    .top-stat-label { display: none; }
}
@media (max-width: 1100px) {
    .top-me { flex-basis: 160px; min-width: 120px; margin-left: 16px; }
    .top-stats { gap: 8px; margin-left: 12px; }
    .top-stat { gap: 5px; }
    .stat-grid, .stat-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
    .nav-toggle { display: inline-block; }
    .shell { grid-template-columns: 1fr; }
    .sidebar { position: fixed; left: 0; top: 53px; width: 280px; z-index: 25; background: var(--bg-2); transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow); }
    body.nav-open .sidebar { transform: none; }
    .content { padding: 18px 16px 50px; }
    .grid-2, .grid-3, .feature-grid { grid-template-columns: 1fr; }
    .quick-actions { grid-template-columns: repeat(2, 1fr); }
    .quest { flex-direction: column; align-items: stretch; }
    .quest-side { display: flex; align-items: center; justify-content: space-between; }
    .monster-icon { width: 52px; height: 52px; flex-basis: 52px; font-size: 2rem; }
    .table { display: block; overflow-x: auto; white-space: nowrap; }
    .gold-pill { font-size: .85rem; padding: 3px 8px; }
    .brand { font-size: 1.05rem; }
    .topbar { padding: 10px 12px; gap: 8px; flex-wrap: wrap; }
    .topbar-right { gap: 4px; }
    /* On small screens your name/level/XP replace the logo, and the meters get their own row */
    .topbar .brand { display: none; }
    .top-me { margin-left: 0; flex: 1 1 auto; min-width: 0; max-width: 200px; }
    .top-me .avatar-xs { width: 26px; height: 26px; }
    .top-stats { order: 3; flex-basis: 100%; max-width: none; margin-left: 0; gap: 8px; }
    .top-stat { padding: 2px 0; gap: 5px; }
    .top-stat-label { display: none; }
    .top-stat-icon { font-size: .9rem; }
    .top-timers { order: 4; flex-basis: 100%; gap: 4px; margin-left: 0; }
    .top-timers + .topbar-right { margin-left: auto; }
    .top-timer { font-size: .72rem; padding: 2px 7px; }
    .versus { gap: 16px; }
    .hero-stats { gap: 22px; }
}
@media (max-width: 400px) {
    .brand-text { display: none; }
}
@media (max-width: 520px) {
    .stat-grid, .stat-tiles { grid-template-columns: 1fr; }
    .item-row { flex-wrap: wrap; }
    .item-actions { width: 100%; justify-content: flex-end; }
    .dropdown-body { width: min(290px, 86vw); }
}

/* Sign-up honeypot: invisible to people, tempting to bots */
.hp-field { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.cf-turnstile { margin: 8px 0 4px; }

/* Regions, travel and bosses */
.status-travel { background: rgba(80, 140, 220, .15); border-color: rgba(80, 140, 220, .5); color: #a9c8f2; }
.status-boss { background: rgba(230, 160, 40, .14); border-color: rgba(230, 160, 40, .55); color: #f3c76b; }
/* Awake bosses: one compact line each, under Regions in the menu */
.nav-bosses { display: flex; flex-direction: column; gap: 2px; margin: 0 0 12px; padding: 6px; border: 1px solid rgba(230, 160, 40, .55); border-radius: var(--radius); background: rgba(230, 160, 40, .1); }
.nav-boss { display: flex; align-items: center; gap: 6px; padding: 3px 6px; border-radius: 6px; font-size: .82rem; font-weight: 600; line-height: 1.35; color: #f3c76b; }
.nav-boss:hover { background: rgba(230, 160, 40, .18); color: #f3c76b; text-decoration: none; }
.nav-boss-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-boss-time { flex: none; font-variant-numeric: tabular-nums; opacity: .85; }
.status-box small { display: block; font-weight: 400; opacity: .85; font-size: .8rem; }
.location { display: block; margin: 0 0 12px; padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); font-weight: 600; }
.location:hover { text-decoration: none; border-color: var(--gold); }
.region-hero { display: flex; gap: 16px; align-items: flex-start; }
.region-hero .region-icon { font-size: 2.6rem; line-height: 1; }
.region-hero h2 { margin: 0 0 4px; }
.region-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.region-tile { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; display: flex; flex-direction: column; gap: 6px; background: rgba(255,255,255,.02); }
.region-tile.here { border-color: var(--gold); }
.region-tile h3 { margin: 0; font-size: 1rem; }
.region-tile .actions { margin-top: auto; }
.boss-card { border-color: rgba(230, 160, 40, .6); background: linear-gradient(135deg, rgba(230,160,40,.10), rgba(201,67,61,.08)); }
.boss-card .monster-icon { font-size: 3rem; }
.boss-alerts .boss-alert { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.boss-alert + .boss-alert { border-top: 1px solid var(--border); padding-top: 8px; margin-top: 8px; }
.section-title { margin: 24px 0 10px; font-size: 1.15rem; }

/* Battle screen */
.battle-arena { display: grid; grid-template-columns: 1fr auto 1fr; gap: 16px; align-items: center; }
.fighter { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.fighter-icon { font-size: 4rem; line-height: 1; }
.fighter .bar { width: 100%; max-width: 260px; }
.fighter .hp-text { font-variant-numeric: tabular-nums; }
.battle-arena .vs { display: flex; flex-direction: column; align-items: center; font-family: var(--display); font-size: 1.6rem; color: var(--gold); }
.battle-arena .vs small { font-family: var(--font); font-size: .8rem; }
.battle-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.battle-actions .heal-form { display: inline-flex; gap: 6px; align-items: center; }
.battle-actions select { max-width: 260px; }
.battle-help { flex-basis: 100%; margin: 4px 0 0; }
.battle-log { max-height: 420px; overflow-y: auto; }
.battle-log li.heal { color: var(--good); }
.battle-log li.fresh { animation: battle-flash .8s ease-out; }
@keyframes battle-flash { from { background: rgba(217, 169, 78, .25); } to { background: transparent; } }
.status-battle { background: rgba(201, 67, 61, .15); border-color: rgba(201, 67, 61, .6); color: #f1a29d; }
@media (max-width: 640px) {
    .battle-arena { grid-template-columns: 1fr; }
    .fighter-icon { font-size: 3rem; }
}

/* ---------- Conversations & trades ---------- */
.convo-start { gap: 8px; flex-wrap: wrap; }
.convo-start input { flex: 1; min-width: 180px; }
.convo-list { list-style: none; margin: 0; padding: 0; }
.convo-list li + li { border-top: 1px solid var(--border); }
.convo-list a { display: flex; align-items: center; gap: 12px; padding: 12px 6px; color: var(--text); text-decoration: none; }
.convo-list a:hover { background: var(--panel-2); }
.convo-list li.unread b { color: var(--gold-2); }
.convo-icon { font-size: 1.6rem; }
.convo-main { flex: 1; min-width: 0; }
.convo-snippet { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge-inline { display: inline-block; background: var(--ember); color: #fff; border-radius: 999px; padding: 0 8px; font-size: .75rem; margin-left: 4px; }
.convo-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.convo-head h2 { margin: 0; font-size: 1.25rem; }
.convo-head .row { gap: 8px; }
.chat { max-height: 60vh; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 4px 2px 10px; }
.chat-line { display: flex; flex-direction: column; max-width: 78%; }
.chat-line.mine { align-self: flex-end; align-items: flex-end; }
.chat-line.theirs { align-self: flex-start; }
.bubble { padding: 9px 13px; border-radius: 14px; background: var(--panel-2); border: 1px solid var(--border); line-height: 1.45; overflow-wrap: anywhere; }
.chat-line.mine .bubble { background: rgba(217, 169, 78, .16); border-color: rgba(217, 169, 78, .45); border-bottom-right-radius: 4px; }
.chat-line.theirs .bubble { border-bottom-left-radius: 4px; }
.chat-system { align-self: center; text-align: center; font-size: .9rem; color: var(--muted); max-width: 92%; }
.chat-system b { color: var(--text); }
.trade-done { background: rgba(121, 194, 125, .08); border: 1px solid rgba(121, 194, 125, .45); border-radius: var(--radius); padding: 8px 14px; color: var(--text); margin-bottom: 2px; }
.chat-compose { display: flex; gap: 8px; align-items: flex-end; border-top: 1px solid var(--border); padding-top: 12px; margin-top: 6px; }
.chat-compose textarea { flex: 1; resize: vertical; margin: 0; }
.trade-card { border-color: rgba(217, 169, 78, .55); }
.trade-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.trade-side { background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; }
.trade-side h3 { margin: 0 0 8px; font-size: 1rem; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.trade-items { list-style: none; margin: 0 0 10px; padding: 0; }
.trade-items li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 0; border-bottom: 1px dashed var(--border); }
.trade-items .trade-gold { color: var(--gold-2); border-bottom: 0; }
.trade-side .mini-form { gap: 6px; flex-wrap: wrap; }
.trade-side .mini-form select { flex: 1; min-width: 140px; }
.trade-side .mini-form input[type=number] { width: 110px; }
.trade-side .mini-form input.qty { width: 70px; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); padding: 2px 8px; }
.btn-ghost:hover { color: var(--bad); }
@media (max-width: 640px) {
    .trade-grid { grid-template-columns: 1fr; }
    .chat-line { max-width: 92%; }
}
.trade-grid > * { min-width: 0; }
.trade-side .mini-form { display: flex; flex-wrap: wrap; }
@media (max-width: 640px) {
    .trade-side .mini-form select { flex: 1 1 100%; min-width: 0; width: 100%; }
}

/* ---------- Martial schools ---------- */
.school-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.school-card { background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.school-card p { margin: 0; }
.school-card.school-mine { border-color: var(--gold); box-shadow: 0 0 0 1px rgba(217, 169, 78, .35); }
.school-top { display: flex; align-items: center; gap: 10px; }
.school-icon { font-size: 1.8rem; }
.school-action { display: flex; gap: 6px; margin-top: auto; flex-wrap: wrap; }
/* Your own school (Training Hall) */
.my-school h3 { font-size: 1rem; margin: 18px 0 8px; }
.my-school .grid-2 > div { min-width: 0; }
.my-school-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.my-school-icon { font-size: 2.6rem; line-height: 1; }
.my-school-title { flex: 1 1 260px; }
.my-school-title h2 { margin: 2px 0 0; }
.my-school-title h2 .muted { font-size: .9rem; font-family: var(--font); font-weight: 500; }
.my-school-rank { flex: 0 1 280px; min-width: 220px; display: flex; flex-direction: column; gap: 4px; }
.my-school-status { margin-top: 14px; }
.good-box { background: rgba(79, 160, 90, .1); border: 1px solid rgba(79, 160, 90, .35); border-radius: var(--radius); padding: 10px 12px; font-size: .92rem; }
.trait-list { margin: 0; padding-left: 18px; }
.trait-list li { margin: 5px 0; }
.trait-list.tips li { color: var(--text); }
.locked-row td { color: var(--muted); }
.rank-ladder { display: flex; flex-wrap: wrap; gap: 6px; }
.rank-chip { font-size: .74rem; padding: 3px 8px; border-radius: 999px; border: 1px solid var(--border-2); color: var(--muted); }
.rank-chip.done { color: var(--text); border-color: rgba(217, 169, 78, .45); }
.rank-chip.current { color: #1a140c; background: var(--gold-2); border-color: var(--gold-2); font-weight: 700; }
.switch-school > summary { cursor: pointer; color: var(--gold-2); font-weight: 600; }
.switch-list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.switch-row { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-2); }
.switch-info { flex: 1; min-width: 0; }
.switch-actions { flex: none; }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--border); }
.section-title .small { font-family: var(--font); font-weight: 400; }

/* ---------- Avatars ---------- */
.pixel-avatar { image-rendering: pixelated; image-rendering: crisp-edges; display: inline-block; object-fit: contain; vertical-align: middle; }
.pixel-avatar.flip { transform: scaleX(-1); }
.avatar-xs { width: 32px; height: 32px; font-size: 1.4rem; }
.avatar-sm { width: 48px; height: 48px; font-size: 1.6rem; }
.avatar-md { width: 80px; height: 80px; font-size: 3rem; }
.avatar-lg { width: 128px; height: 128px; font-size: 4rem; }
.avatar:has(.pixel-avatar) { overflow: hidden; border-radius: var(--radius); }
.race-icon { display: inline-flex; text-decoration: none; }
.fighter-icon .avatar-lg { margin: 0 auto; }
.avatar-picker { display: flex; flex-wrap: wrap; gap: 12px; align-items: stretch; }
.avatar-option { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px; border: 2px solid var(--border); border-radius: var(--radius); background: var(--bg-2); cursor: pointer; }
.avatar-option input { position: absolute; opacity: 0; pointer-events: none; }
.avatar-option:hover { border-color: var(--border-2); }
.avatar-option.chosen, .avatar-option:has(input:checked) { border-color: var(--gold); box-shadow: 0 0 0 1px rgba(217, 169, 78, .4); }
.avatar-save { flex-basis: 100%; }
@media (max-width: 640px) { .avatar-lg { width: 96px; height: 96px; } }

/* ---------- Battle backgrounds (one picture per area: assets/backgrounds/<area>.png) ---------- */
.battle-arena.has-bg {
    /* the picture itself is set on the element (style attribute) so its address works wherever the game is installed */
    background-size: cover; background-position: center 70%; background-repeat: no-repeat;
    image-rendering: pixelated; min-height: 300px; align-items: end; padding-top: 40px;
}
/* areas whose best part sits high in the picture */
.battle-arena.bg-frostpeak { background-position: center 30%; }
.battle-arena.bg-stormcrag { background-position: center 25%; }
.battle-arena.bg-emberveil { background-position: center 40%; }
.battle-arena.has-bg .fighter { padding: 6px 12px; }
.battle-arena.has-bg .fighter b, .battle-arena.has-bg .fighter span { text-shadow: 0 0 1px #000, 1px 1px 0 #000, -1px 1px 0 #000, 1px -1px 0 #000, -1px -1px 0 #000, 0 0 8px rgba(0, 0, 0, .95); color: var(--text); }
.battle-arena.has-bg .fighter .bar { box-shadow: 0 1px 4px rgba(0, 0, 0, .8); }
.battle-arena.has-bg .fighter-icon { filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .6)); }
.battle-arena.has-bg .vs, .battle-arena.has-bg .vs small { text-shadow: 0 0 1px #000, 1px 1px 0 #000, -1px 1px 0 #000, 1px -1px 0 #000, -1px -1px 0 #000, 0 0 8px rgba(0, 0, 0, .95); align-self: center; }
.battle-arena.has-bg .vs small { color: var(--text); }

/* Lodgings */
.notice-bad { background: rgba(224, 93, 85, .1); border-color: rgba(224, 93, 85, .45); color: #f19a94; }
.notice .inline { margin-left: 8px; }
.lodge-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.lodge-icon { font-size: 2.8rem; line-height: 1; }
.lodge-main { flex: 1 1 280px; min-width: 0; }
.lodge-main h2 { margin: 0 0 4px; }
.lodge-facts { display: flex; gap: 18px; flex-wrap: wrap; }
.lodge-facts > div { display: flex; flex-direction: column; min-width: 90px; }
.lodge-facts b { font-family: var(--display); font-size: 1.15rem; color: var(--gold-2); }
.lodge-sell { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.lodge-invite { display: flex; align-items: flex-end; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.lodge-invite label { display: flex; flex-direction: column; gap: 4px; flex: 0 1 520px; min-width: 0; font-size: .9rem; }
.lodge-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.lodge-requests li { padding: 6px 0; border-bottom: 1px solid var(--border); }
.lodge-requests li:last-child { border-bottom: 0; }
.pledge-form input[type=text] { flex: 0 1 320px; min-width: 0; }
.pledge-card h3 { margin-top: 18px; }
/* Live updates: wrappers that mustn't change the layout */
.side-live { display: contents; }
.top-timers:empty { display: none; }
.top-timers:empty + .topbar-right { margin-left: auto; }
.badge[hidden] { display: none; }
.care-steps { display: flex; gap: 3px; margin: 8px 0 12px; max-width: 420px; }
.care-steps span { flex: 1; height: 8px; border-radius: 3px; background: var(--panel-2); border: 1px solid var(--border-2); }
.care-steps span.on { background: linear-gradient(180deg, #e0605a, #b63e35); border-color: #d05a50; }
/* Bank investments */
.invest-terms { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 12px 0; }
.invest-term { margin: 0; cursor: pointer; }
.invest-term input { position: absolute; opacity: 0; pointer-events: none; }
.invest-term span { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px; border: 1px solid var(--border-2); border-radius: var(--radius); background: var(--bg-2); color: var(--text); }
.invest-term span small { color: var(--good); font-size: .85rem; }
.invest-term input:checked + span { border-color: var(--gold); box-shadow: 0 0 0 1px rgba(217, 169, 78, .45); background: rgba(217, 169, 78, .08); }
.invest-term input:focus-visible + span { outline: 2px solid var(--gold); }
.invest-form .row label { margin-bottom: 0; flex: 1 1 180px; }
.invest-form .row select, .invest-form .row input, .invest-form .row input[type=number] { width: 100%; max-width: none; margin-top: 4px; }
.invest-warning .kv { margin-bottom: 12px; }
.invest-form .row .btn { align-self: flex-end; }
.invest-warning { border: 1px solid rgba(224, 160, 60, .6); background: rgba(224, 160, 60, .08); border-radius: var(--radius); padding: 14px 16px; margin: 12px 0; }
.invest-warning h3 { margin: 0 0 10px; color: var(--gold-2); }
.invest-confirm label.check { margin: 12px 0; }
.invest h3 { margin-top: 18px; }
.shop-grid-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.shop-grid-5 .shop-item { padding: 12px; }
.shop-grid-5 .shop-item h3 { font-size: .95rem; }
.shop-grid-5 .shop-item .row input[type=number] { flex-basis: 54px; max-width: 54px; }
@media (max-width: 1280px) { .shop-grid-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) { .shop-grid-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 460px) { .shop-grid-5 { grid-template-columns: 1fr; } }
.tabs-sub { margin-top: 4px; }
/* Armour worn (inventory) */
.worn-armour { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin: 4px 0 14px; }
.worn-slot { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-2); font-size: .88rem; min-width: 0; }
.worn-slot > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.worn-slot small { color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; }
.worn-slot.empty { opacity: .6; }
.worn-icon { font-size: 1.4rem; }
.worn-total { grid-column: 1 / -1; font-size: .9rem; color: var(--muted); }
@media (max-width: 760px) { .worn-armour { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* Logo */
.brand { display: inline-flex; align-items: center; gap: 8px; }
.public-brand { display: flex; align-items: center; justify-content: center; gap: 10px; }
.brand-logo { flex: none; display: block; filter: drop-shadow(0 0 6px rgba(227, 99, 44, .35)); }
.hero-logo { display: block; margin: 0 auto 6px; width: 192px; height: 192px; image-rendering: pixelated; filter: drop-shadow(0 0 24px rgba(227, 99, 44, .35)); }
@media (max-width: 560px) { .hero-logo { width: 128px; height: 128px; } }
.hero h1.hero-title { margin: 0 0 .3em; line-height: 0; background: none; -webkit-background-clip: border-box; background-clip: border-box; text-shadow: none; }
.hero-wordmark { display: inline-block; width: min(490px, 92vw); height: auto; image-rendering: pixelated; filter: drop-shadow(0 4px 18px rgba(227, 99, 44, .3)); }
.brand-wordmark { display: block; height: 32px; width: auto; }
/* Attack alert (top of every page until dismissed or the events page is opened) */
.attack-alert { border: 1px solid rgba(224, 93, 85, .6); background: rgba(224, 93, 85, .12); border-radius: var(--radius); padding: 10px 14px; margin-bottom: 14px; }
.attack-alert.pop { animation: alert-pop .6s ease-out 2; }
.attack-alert-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 4px; color: #f3a29c; }
.attack-alert ul { margin: 0; }
.attack-alert li { padding: 2px 0; }
@keyframes alert-pop { 0% { box-shadow: 0 0 0 0 rgba(224, 93, 85, .7); } 100% { box-shadow: 0 0 0 12px rgba(224, 93, 85, 0); } }
@media (max-width: 640px) { .fight-table .hide-sm { display: none; } }
.guild-nav { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; margin: -6px 0 10px; }
.table tr.row-mine td { background: rgba(217, 169, 78, .07); }
/* Guild wars */
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.grid-4 > .card { margin-bottom: 0; }
.war-record .big-number { font-size: 1.6rem; }
@media (max-width: 760px) { .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.war-banner { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 14px; margin-bottom: 12px; border-radius: var(--radius);
    border: 1px solid rgba(224, 93, 85, .55); background: linear-gradient(90deg, rgba(224, 93, 85, .18), rgba(224, 93, 85, .05)); }
.war-banner > span:nth-child(2) { flex: 1; min-width: 200px; }
.war-banner-icon { font-size: 1.4rem; }
.war-note { padding: 8px 12px; border-radius: 8px; background: rgba(224, 93, 85, .1); border: 1px solid rgba(224, 93, 85, .4); }
.war-rules li { padding: 3px 0; }
.war-head.war-live { border-color: rgba(224, 93, 85, .55); }
.war-sides { display: flex; align-items: center; justify-content: center; gap: 28px; margin-bottom: 14px; text-align: center; }
.war-side { flex: 1; max-width: 260px; }
.war-tag { font-family: var(--display); font-size: 1.15rem; }
.war-table .hide-sm { white-space: nowrap; }
@media (max-width: 640px) { .war-table .hide-sm { display: none; } .war-sides { gap: 10px; } }
.profile-war { margin-top: 6px; color: #f3a29c; }
/* Herald lines in the Home news */
.herald-block { padding: 8px 12px; border-radius: 8px; background: var(--bg-2); border: 1px solid var(--border); }
.news + .herald-block, .herald-block + .news { margin-top: 12px; }
.herald { display: flex; gap: 8px; align-items: baseline; padding: 3px 0; font-size: .92rem; }
.herald + .herald { border-top: 1px dashed var(--border); }
.herald time { margin-left: auto; white-space: nowrap; color: var(--muted); font-size: .78rem; }
@media (max-width: 640px) { .hof .hide-sm { display: none; } }
.plain-link { color: inherit; text-decoration: none; } .plain-link:hover { color: var(--gold-2); }
/* Gathering */
.skill-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-bottom: 10px; }
.skill-tile { border: 1px solid var(--border); border-radius: var(--radius); padding: 10px; background: var(--bg-2); display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.skill-head { display: flex; align-items: center; gap: 8px; }
.skill-head > span:last-child { display: flex; flex-direction: column; line-height: 1.2; }
.skill-head small { color: var(--muted); font-size: .78rem; }
.skill-icon { font-size: 1.5rem; }
.bar-skill .bar-fill { background: linear-gradient(90deg, #6b5a2a, var(--gold)); }
@media (max-width: 860px) { .skill-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.gather-zone-head { display: flex; gap: 14px; align-items: flex-start; }
.gather-zone-head h2 { margin-bottom: 4px; }
.gather-zone-head .region-icon { font-size: 2.4rem; line-height: 1; }
.gather-nodes { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.gather-node { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); background: rgba(255,255,255,.02); }
.gather-node.locked { opacity: .55; }
.gather-node-icon { font-size: 1.6rem; width: 2rem; text-align: center; flex: none; }
.gather-node-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.gather-node-side { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; max-width: 45%; text-align: right; }
@media (max-width: 640px) { .gather-node { flex-wrap: wrap; } .gather-node-side { max-width: none; width: 100%; justify-content: flex-start; text-align: left; } }
.gather-mats { font-size: 1.3rem; letter-spacing: 4px; }
.gather-got { display: inline-block; margin-right: 12px; }
.level-up { color: var(--gold-2); }
/* Inventory search and tabs */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.search-box { margin-bottom: 12px; max-width: 520px; flex: 1; min-width: 200px; }
.search-box input { width: 100%; padding: 10px 14px; font-size: 1rem; margin: 0; }
.suggest-wrap { position: relative; display: block; }
.row > .suggest-wrap, .search-bar > .suggest-wrap { flex: 1; min-width: 180px; }
.search-bar > .suggest-wrap { max-width: 320px; }
.search-bar .suggest-wrap input[name=q] { max-width: none; width: 100%; }
.pledge-form > .suggest-wrap { flex: 0 1 320px; min-width: 0; }
.suggest-wrap > input { width: 100%; }
label > .suggest-wrap { margin: 4px 0 6px; }
.suggest-list { position: absolute; z-index: 40; left: 0; right: 0; top: calc(100% + 4px); min-width: 240px; margin: 0; padding: 4px; list-style: none; background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 10px 30px rgba(0,0,0,.5); max-height: 340px; overflow-y: auto; text-align: left; font-weight: 400; }
.suggest-list li { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 6px; cursor: pointer; color: var(--text); }
.suggest-list li:hover, .suggest-list li.active { background: rgba(217, 169, 78, .14); }
.suggest-icon { font-size: 1.15rem; width: 1.6rem; text-align: center; flex: none; }
.suggest-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.suggest-name mark { background: none; color: var(--gold-2); font-weight: 700; }
.suggest-meta { color: var(--muted); font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 55%; }
[data-suggest-name][hidden], [data-scope-group][hidden], [data-scope-none][hidden] { display: none !important; }
.admin-items-head { align-items: center; margin-bottom: 12px; }
.admin-items-head .search-box { margin-bottom: 0; }
.inv-tabs .tab .muted { font-weight: 400; }
.item-row.flash-row { animation: row-flash 1.6s ease-out; }
@keyframes row-flash { 0%, 30% { background: rgba(217, 169, 78, .22); } 100% { background: transparent; } }
/* Arms & Armour */
.gear-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.gear-total { display: flex; align-items: center; gap: 10px; min-width: 0; }
.gear-total > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.gear-total small { color: var(--muted); font-size: .8rem; }
.gear-total-icon { font-size: 1.8rem; }
.gear-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; }
.gear-grid > .card { margin-bottom: 0; }
.gear-slot-head { font-family: var(--display); color: var(--gold-2); font-size: 1.05rem; display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.gear-slot-head span { font-size: 1.3rem; }
.gear-slot.empty { border-style: dashed; }
.gear-item { display: flex; align-items: center; gap: 12px; padding: 6px 0; }
.gear-item + .gear-item { border-top: 1px solid var(--border); }
.gear-item-main { flex: 1; min-width: 0; }
.gear-none { margin: 4px 0 8px; }
.gear-options { margin-top: 8px; }
.gear-options summary { cursor: pointer; color: var(--gold-2); font-weight: 600; font-size: .9rem; padding: 4px 0; }
@media (max-width: 860px) { .gear-grid, .gear-summary { grid-template-columns: 1fr; } }
