/* =====================================================================
   BoutZero — global stylesheet
   Dark "Zerospace" theme: near-black navy field, cyan surge accent.
   ===================================================================== */

:root {
    --bg:          #070b12;
    --bg-alt:      #0a1019;
    --bg-band:     #0b1220;
    --surface:     #0d1524;
    --surface-2:   #111c2e;
    --surface-3:   #16233a;
    --border:      #1b2740;
    --border-soft: #141f33;

    --text:        #e7eef8;
    --text-dim:    #93a1b8;
    --text-mute:   #61708a;

    --cyan:        #29d3ee;
    --cyan-bright: #5be4f7;
    --cyan-deep:   #0e7f92;
    --cyan-glow:   rgba(41, 211, 238, 0.16);

    --gold:        #f5c249;
    --silver:      #c6d2e2;
    --bronze:      #e08a4b;
    --green:       #35d07f;
    --red:         #ff5d73;
    --magenta:     #d16bff;
    --blue:        #5b8bff;
    --amber:       #f6a94b;

    --radius:      14px;
    --radius-sm:   10px;
    --radius-lg:   20px;
    --wrap:        1200px;
    --nav-h:       68px;

    --shadow:      0 20px 50px -25px rgba(0, 0, 0, 0.8);
    --font-display: "Chakra Petch", "Segoe UI", system-ui, sans-serif;
    --font-body:    "Inter", "Segoe UI", system-ui, sans-serif;
}

/* ----------------------------------------------------------- reset ---- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 20px); }

body {
    font-family: var(--font-body);
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
ul { list-style: none; padding: 0; }

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; line-height: 1.08; letter-spacing: 0.01em; }

::selection { background: var(--cyan); color: #04222a; }

.skip-link {
    position: absolute; left: -9999px; top: 0; z-index: 200;
    background: var(--cyan); color: #04222a; padding: 10px 16px; border-radius: 0 0 8px 0; font-weight: 600;
}
.skip-link:focus { left: 0; }

:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }

/* --------------------------------------------------------- layout ---- */
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }

.section { padding: 84px 0; }
.section--tight { padding: 56px 0; }
.section--band { background: var(--bg-band); border-block: 1px solid var(--border-soft); }
.section--alt { background: var(--bg-alt); }

.section-head {
    display: flex; align-items: flex-end; justify-content: space-between;
    gap: 24px; margin-bottom: 38px; flex-wrap: wrap;
}
.section-head h2 { font-size: clamp(1.7rem, 3.4vw, 2.4rem); text-transform: uppercase; }
.kicker {
    display: inline-block; font-family: var(--font-display); font-weight: 600;
    font-size: 0.72rem; letter-spacing: 0.32em; text-transform: uppercase;
    color: var(--cyan); margin-bottom: 12px;
}
.section-sub { color: var(--text-dim); max-width: 52ch; margin-top: 8px; }
.head-link {
    font-family: var(--font-display); font-weight: 600; font-size: 0.8rem;
    letter-spacing: 0.18em; text-transform: uppercase; color: var(--cyan);
    white-space: nowrap; transition: color .15s;
}
.head-link:hover { color: var(--cyan-bright); }

.accent { color: var(--cyan); }
.text-dim { color: var(--text-dim); }

/* --------------------------------------------------------- buttons --- */
.btn {
    --btn-bg: var(--surface-2);
    display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    font-family: var(--font-display); font-weight: 600; letter-spacing: 0.12em;
    text-transform: uppercase; font-size: 0.82rem;
    padding: 14px 26px; border-radius: var(--radius-sm);
    background: var(--btn-bg); border: 1px solid var(--border);
    color: var(--text); transition: transform .12s ease, box-shadow .2s ease, background .2s ease, border-color .2s;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn-sm { padding: 9px 18px; font-size: 0.72rem; }
.btn-lg { padding: 17px 34px; font-size: 0.9rem; }
.btn-block { display: flex; width: 100%; }

.btn-primary {
    background: linear-gradient(180deg, var(--cyan-bright), var(--cyan));
    border-color: var(--cyan);
    color: #04222a;
    box-shadow: 0 10px 30px -10px var(--cyan-glow), inset 0 1px 0 rgba(255,255,255,.35);
}
.btn-primary:hover { box-shadow: 0 16px 40px -12px var(--cyan-glow); }

.btn-outline { background: transparent; border-color: var(--cyan); color: var(--cyan); }
.btn-outline:hover { background: var(--cyan-glow); }

.btn-ghost { background: var(--surface); }
.btn-ghost:hover { border-color: var(--cyan); color: var(--cyan); }

/* --------------------------------------------------------- navbar ---- */
.site-nav {
    position: sticky; top: 0; z-index: 100;
    background: rgba(7, 11, 18, 0.82);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border-soft);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: var(--nav-h); }
.brand { display: flex; align-items: center; }
.brand-logo { display: block; height: 40px; width: auto; }
.nav-links { display: flex; align-items: center; gap: 30px; }
.nav-link {
    font-size: 0.9rem; font-weight: 500; color: var(--text-dim);
    transition: color .15s; position: relative;
}
.nav-link:hover { color: var(--text); }
.nav-link.is-active { color: var(--cyan); }
.nav-link.is-active::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: -24px; height: 2px;
    background: var(--cyan); box-shadow: 0 0 12px var(--cyan);
}
.nav-cta { margin-left: 6px; }

.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: 0; padding: 8px; }
.nav-toggle span { width: 24px; height: 2px; background: var(--text); transition: .2s; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ----------------------------------------------------- page header -- */
.page-head {
    position: relative; padding: 66px 0 54px;
    background:
        radial-gradient(680px 320px at 12% -10%, rgba(41,211,238,.12), transparent 70%),
        var(--bg-alt);
    border-bottom: 1px solid var(--border-soft);
    overflow: hidden;
}
.page-head::before {
    content: ""; position: absolute; inset: 0;
    background-image: linear-gradient(var(--border-soft) 1px, transparent 1px), linear-gradient(90deg, var(--border-soft) 1px, transparent 1px);
    background-size: 46px 46px; opacity: .35; mask-image: radial-gradient(circle at 30% 0%, #000, transparent 75%);
}
.page-head .wrap { position: relative; }
.page-head-inner { display: flex; align-items: center; justify-content: space-between; gap: 30px; flex-wrap: wrap; }
.page-head h1 { font-size: clamp(2.1rem, 5vw, 3.2rem); text-transform: uppercase; }
.page-head p { color: var(--text-dim); max-width: 56ch; margin-top: 14px; }

/* ------------------------------------------------------------ cards - */
.card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 26px;
}
.card--hover { transition: transform .16s ease, border-color .2s ease, box-shadow .2s ease; }
.card--hover:hover { transform: translateY(-4px); border-color: var(--cyan-deep); box-shadow: var(--shadow); }

/* =====================================================================
   HOME
   ===================================================================== */
.hero { position: relative; overflow: hidden; padding: 72px 0 10px; }
.hero::before {
    content: ""; position: absolute; inset: 0; z-index: 0;
    background:
        radial-gradient(720px 420px at 78% 8%, rgba(209,107,255,.14), transparent 68%),
        radial-gradient(760px 500px at 8% 0%, rgba(41,211,238,.14), transparent 66%);
}
.hero::after {
    content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
    background-image: linear-gradient(var(--border-soft) 1px, transparent 1px), linear-gradient(90deg, var(--border-soft) 1px, transparent 1px);
    background-size: 52px 52px; opacity: .3;
    mask-image: radial-gradient(circle at 50% 0%, #000, transparent 78%);
}
.hero .wrap { position: relative; z-index: 1; }
.hero-grid { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 56px; align-items: center; }
.hero h1 {
    font-size: clamp(2.4rem, 5.6vw, 4rem); text-transform: uppercase; letter-spacing: 0.01em;
}
.hero h1 .line-2 { color: var(--cyan); }
.hero h1 .cursor { color: var(--cyan); font-weight: 400; -webkit-text-stroke: 0; animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.hero p.lead { color: var(--text-dim); font-size: 1.02rem; max-width: 46ch; margin: 22px 0 30px; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }

.hero-art {
    position: relative; border: 1px solid var(--border); border-radius: var(--radius-lg);
    background: linear-gradient(160deg, #10203a, #0a1220 60%);
    aspect-ratio: 4 / 3; overflow: hidden; box-shadow: var(--shadow);
}
.hero-art img { width: 100%; height: 100%; object-fit: cover; }
.hero-art .tag {
    position: absolute; left: 16px; top: 14px; font-family: var(--font-display);
    font-size: 0.66rem; letter-spacing: 0.3em; color: var(--cyan); text-transform: uppercase;
    z-index: 2;
}

/* CyberZero chassis cut-out. It's a tall render in a 4:3 panel, so it's
   contained rather than cropped, lit from behind and given a floor shadow so it
   reads as standing in the frame instead of pasted onto it. */
.hero-art--bot::before {
    content: ''; position: absolute; inset: 0; pointer-events: none;
    background:
        radial-gradient(ellipse 50% 56% at 50% 44%, rgba(45, 212, 255, .20), transparent 72%),
        radial-gradient(ellipse 30% 6% at 50% 89%, rgba(0, 0, 0, .55), transparent 75%);
}
.hero-art--bot img {
    position: relative; object-fit: contain; object-position: 50% 100%;
    padding: 20px 24px 12px;
    filter: drop-shadow(0 14px 22px rgba(0, 0, 0, .5));
    animation: hero-float 7s ease-in-out infinite;
}
.hero-art-caption {
    position: absolute; right: 16px; bottom: 14px; z-index: 2;
    font-family: var(--font-display); font-size: 0.62rem; letter-spacing: 0.22em;
    text-transform: uppercase; color: var(--text-mute);
}
@keyframes hero-float {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-9px); }
}

/* status strip */
.status-strip {
    display: grid; grid-template-columns: repeat(3, 1fr);
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    overflow: hidden; margin-top: 40px;
}
.status-cell { padding: 18px 26px; display: flex; align-items: center; gap: 14px; }
.status-cell + .status-cell { border-left: 1px solid var(--border); }
.status-cell--wide { grid-column: 1 / -1; }
.status-cell .s-label { font-size: 0.62rem; letter-spacing: 0.24em; text-transform: uppercase; color: var(--text-mute); }
.status-cell .s-value { font-family: var(--font-display); font-weight: 600; font-size: 0.98rem; }
.live-dot {
    width: 9px; height: 9px; border-radius: 50%; background: var(--green);
    box-shadow: 0 0 0 0 rgba(53,208,127,.55); animation: pulse 2s infinite; flex-shrink: 0;
}
.live-dot--off { background: var(--text-mute); box-shadow: none; animation: none; }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px rgba(53,208,127,0); } 100% { box-shadow: 0 0 0 0 rgba(53,208,127,0); } }

/* stat tiles */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.stat-tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 26px 24px; text-align: center; }
.stat-tile .n { font-family: var(--font-display); font-weight: 700; font-size: clamp(1.7rem, 3.6vw, 2.4rem); color: #fff; }
.stat-tile .l { font-size: 0.66rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--text-mute); margin-top: 6px; }

/* feature cards */
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.feature-card .f-icon {
    width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center;
    background: var(--cyan-glow); color: var(--cyan); margin-bottom: 16px;
}
.feature-card h3 { font-size: 1.05rem; margin-bottom: 8px; }
.feature-card p { color: var(--text-dim); font-size: 0.92rem; }

/* ranking table */
.ladder {
    width: 100%; border-collapse: collapse; background: var(--surface);
    border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
}
.ladder thead th {
    text-align: left; font-family: var(--font-display); font-weight: 600;
    font-size: 0.66rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--text-mute);
    padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.ladder tbody td { padding: 16px 20px; border-bottom: 1px solid var(--border-soft); font-size: 0.92rem; }
.ladder tbody tr:last-child td { border-bottom: 0; }
.ladder tbody tr { transition: background .15s; }
.ladder tbody tr:hover { background: var(--surface-2); }
.ladder .col-num { text-align: right; }
.ladder .col-rate, .ladder .col-rating { text-align: right; }
.rank-n { font-family: var(--font-display); font-weight: 700; color: var(--text-dim); }
tr.top-1 .rank-n { color: var(--gold); }
tr.top-2 .rank-n { color: var(--silver); }
tr.top-3 .rank-n { color: var(--bronze); }
.pilot-cell { display: flex; align-items: center; gap: 12px; }
.pilot-cell .uname { font-weight: 600; letter-spacing: 0.02em; }
.bot-trigger {
    background: none; border: 0; padding: 0; font: inherit; color: inherit;
    cursor: pointer; text-align: left;
}
.bot-trigger:hover, .bot-trigger:focus-visible { color: var(--cyan); }
.pilot-online { width: 7px; height: 7px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 8px var(--cyan); display: inline-block; }
.clan-tag { color: var(--text-dim); font-family: var(--font-display); font-size: 0.8rem; letter-spacing: 0.08em; }
.chassis-chip {
    font-family: var(--font-display); font-size: 0.58rem; letter-spacing: 0.1em; text-transform: uppercase;
    padding: 3px 8px; border-radius: 5px; border: 1px solid var(--border); flex-shrink: 0;
}
.chassis-patch  { color: var(--cyan);    background: rgba(41,211,238,.12); }
.chassis-surge  { color: var(--magenta); background: rgba(209,107,255,.12); }
.chassis-ram    { color: var(--amber);   background: rgba(246,169,75,.12); }
.chassis-none   { color: var(--text-mute); }
.rate-up { color: var(--green); font-weight: 600; }
.rating-v { font-family: var(--font-display); font-weight: 700; color: #fff; }
.muted-v { color: var(--text-mute); }

/* news teaser rows (home) */
/* minmax(0, 1fr): a grid column is otherwise as wide as its widest unbreakable
   content, and the one-line (nowrap) excerpt below stretched every card past
   the page instead of ending in an ellipsis. */
.thread-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.thread-row {
    display: flex; align-items: center; gap: 22px;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 20px 24px; transition: border-color .2s, transform .14s;
}
.thread-row:hover { border-color: var(--cyan-deep); transform: translateX(4px); }
.thread-main { flex: 1; min-width: 0; }
.thread-meta { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.cat-badge {
    font-family: var(--font-display); font-size: 0.6rem; letter-spacing: 0.16em; text-transform: uppercase;
    padding: 4px 9px; border-radius: 5px; border: 1px solid var(--border);
    color: var(--cyan); background: var(--cyan-glow);
}
.cat-badge[data-accent="green"]   { color: var(--green);   background: rgba(53,208,127,.12); }
.cat-badge[data-accent="amber"]   { color: var(--amber);   background: rgba(246,169,75,.12); }
.cat-badge[data-accent="magenta"] { color: var(--magenta); background: rgba(209,107,255,.12); }
.cat-badge[data-accent="blue"]    { color: var(--blue);    background: rgba(91,139,255,.12); }
.thread-time { font-size: 0.74rem; color: var(--text-mute); }
.thread-title { font-family: var(--font-display); font-weight: 600; font-size: 1rem; }
.thread-row:hover .thread-title { color: var(--cyan); }
.thread-excerpt { color: var(--text-dim); font-size: 0.86rem; margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread-replies { text-align: center; flex-shrink: 0; }
.thread-replies .n { font-family: var(--font-display); font-weight: 700; font-size: 1.3rem; color: #fff; }
.thread-replies .l { font-size: 0.58rem; letter-spacing: 0.18em; color: var(--text-mute); text-transform: uppercase; }

/* donation tiers */
.tier-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.tier-card {
    position: relative; background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 28px 24px; display: flex; flex-direction: column;
}
.tier-card.popular { border-color: var(--cyan); box-shadow: 0 0 0 1px var(--cyan-deep), 0 20px 50px -30px var(--cyan-glow); }
.tier-flag {
    position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
    background: var(--cyan); color: #04222a; font-family: var(--font-display); font-weight: 700;
    font-size: 0.6rem; letter-spacing: 0.18em; text-transform: uppercase; padding: 5px 14px; border-radius: 20px;
    white-space: nowrap;
}
.tier-name { font-family: var(--font-display); font-weight: 700; text-transform: uppercase; font-size: 1.15rem; }
.tier-sub { font-size: 0.62rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--text-mute); margin-top: 4px; }
.tier-price { font-family: var(--font-display); font-weight: 700; font-size: 2rem; color: #fff; margin: 16px 0 2px; }
.tier-price small { font-size: 0.8rem; font-weight: 500; color: var(--text-mute); }
.tier-perks { display: grid; gap: 10px; margin: 18px 0 22px; padding-top: 18px; border-top: 1px solid var(--border-soft); }
.tier-perks li { display: flex; gap: 10px; font-size: 0.86rem; color: var(--text-dim); }
.tier-perks li svg { flex-shrink: 0; color: var(--cyan); margin-top: 3px; }
.tier-card .btn { margin-top: auto; }

/* gigas shop */
.shop-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; margin-bottom: 26px; }
.chip-row { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
    font-family: var(--font-display); font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase;
    padding: 8px 14px; border-radius: 8px; background: var(--surface); border: 1px solid var(--border);
    color: var(--text-dim); transition: .15s;
}
.chip:hover { color: var(--cyan); border-color: var(--cyan-deep); }
.chip.is-active { background: var(--cyan); border-color: var(--cyan); color: #04222a; }

/* =====================================================================
   MEMBERSHIP + COIN PACKS (donate)
   ===================================================================== */
.member-card {
    max-width: 560px; background: var(--surface);
    border: 1px solid var(--cyan-deep); border-radius: var(--radius-lg);
    padding: 30px; box-shadow: 0 0 0 1px rgba(41,211,238,.12), 0 24px 60px -40px var(--cyan-glow);
}
.member-price { display: flex; align-items: baseline; gap: 8px; margin-bottom: 22px; }
.mp-amount { font-family: var(--font-display); font-weight: 700; font-size: 2.6rem; color: #fff; }
.mp-period { font-size: 0.9rem; color: var(--text-mute); }
.member-perks { display: grid; gap: 12px; margin-bottom: 24px; }
.member-perks li { display: flex; gap: 11px; font-size: 0.92rem; color: var(--text-dim); }
.member-perks li svg { flex-shrink: 0; color: var(--cyan); margin-top: 4px; }
.member-note { margin-top: 12px; font-size: 0.76rem; color: var(--text-mute); text-align: center; }

/* compact membership teaser on the home page */
.member-strip {
    display: flex; align-items: center; gap: 30px; flex-wrap: wrap;
    background: var(--surface); border: 1px solid var(--cyan-deep);
    border-radius: var(--radius); padding: 22px 26px;
}
.ms-price { display: flex; align-items: baseline; gap: 6px; }
.ms-price .mp-amount { font-size: 2rem; }
.ms-perks { flex: 1; min-width: 260px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 20px; }
.ms-perks li { display: flex; gap: 9px; font-size: 0.84rem; color: var(--text-dim); }
.ms-perks li svg { flex-shrink: 0; color: var(--cyan); margin-top: 3px; }

.pack-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.pack-card {
    position: relative; background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 24px 22px; text-align: center;
    display: flex; flex-direction: column; gap: 6px;
}
.pack-card.is-best { border-color: var(--cyan); }
.pack-flag {
    position: absolute; top: -11px; left: 50%; transform: translateX(-50%);
    background: var(--cyan); color: #04222a; font-family: var(--font-display); font-weight: 700;
    font-size: 0.58rem; letter-spacing: 0.16em; text-transform: uppercase;
    padding: 4px 12px; border-radius: 20px; white-space: nowrap;
}
.pack-coins { font-family: var(--font-display); font-weight: 700; font-size: 1.5rem; color: #fff; }
.pack-coins .c { color: var(--amber); }
.pack-price { font-family: var(--font-display); font-weight: 600; font-size: 1.1rem; color: var(--cyan); }
.pack-rate { font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-mute); margin-bottom: 14px; }
.pack-card .btn { margin-top: auto; }

/* accepted payment methods (crypto only) */
.pay-methods { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pay-label {
    font-family: var(--font-display); font-size: 0.72rem; letter-spacing: 0.18em;
    text-transform: uppercase; color: var(--text-mute);
}
.coin { display: inline-flex; }
.coin svg { width: 26px; height: 26px; display: block; }

.select-field {
    display: flex; align-items: center; gap: 8px; font-size: 0.78rem; color: var(--text-mute);
}
.select-field select {
    font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border);
    border-radius: 8px; padding: 8px 10px;
}

/* auto-fill rather than a fixed column count: the tiles are small enough that
   the right number per row is whatever fits, and it needs no breakpoints. */
.item-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(155px, 1fr)); gap: 14px; }
.item-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; transition: transform .15s, border-color .2s; }
.item-card:hover { transform: translateY(-4px); border-color: var(--cyan-deep); }
.item-art { position: relative; aspect-ratio: 1 / 1; background: radial-gradient(circle at 50% 35%, #1a2b47, #0a1017); }
/* greyed-out chassis placeholder: contain (not cover) so the whole bot reads,
   and dim enough that it never competes with a real 3D preview beside it */
.item-art img.item-placeholder {
    width: 100%; height: 100%; object-fit: contain;
    padding: 16%; opacity: .3;
}
/* the client's own 2D icon, for items with no mesh (skills, packs, trans bots,
   mercenaries, coupons). Shown at full strength -- unlike the placeholder it
   IS the item, so it should read clearly. 64px source, so cap the upscale and
   keep the pixels crisp rather than smearing them. */
.item-art--icon { background: radial-gradient(circle at 50% 40%, #22314e, #0a1017); }
.item-art img.item-icon {
    position: absolute; inset: 0; margin: auto;
    width: 64px; height: 64px; max-width: 62%; max-height: 62%;
    object-fit: contain; image-rendering: -webkit-optimize-contrast;
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .55));
}
/* No mesh AND no icon -- a handful of skills the client ships no art for. Name
   the part plainly rather than borrowing a bot silhouette, which would imply
   the item is a chassis part. */
.item-noart {
    position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
    padding: 14%; text-align: center;
    font-family: var(--font-display); font-size: 0.6rem; font-weight: 600;
    letter-spacing: 0.18em; text-transform: uppercase; color: var(--text-mute);
    border: 1px dashed var(--border); border-radius: var(--radius-sm); margin: 18%;
}
/* 3D preview: the spinning canvas fades in over the flat art, which stays as
   the backdrop so a tile is never blank while the model loads (or if WebGL /
   the export is unavailable -- see .is-flat). */
.item-canvas {
    position: absolute; inset: 0; width: 100%; height: 100%;
    opacity: 0; transition: opacity .35s ease; pointer-events: none;
}
.item-art.has-3d.is-loaded .item-canvas { opacity: 1; }
/* display:none, not opacity:0 -- the renderer uses alpha:true, so every pixel
   the model doesn't cover is transparent and would show the placeholder
   pentagon ghosted around the item. The tile's own gradient is the backdrop. */
.item-art.has-3d.is-loaded img { display: none; }
.item-art.is-flat .item-canvas { display: none; }
.tag-badge {
    position: absolute; top: 7px; right: 7px; z-index: 2; font-family: var(--font-display);
    font-size: 0.5rem; letter-spacing: 0.12em; text-transform: uppercase;
    padding: 3px 6px; border-radius: 4px; font-weight: 700;
}
.tag-cyan  { background: rgba(41,211,238,.18); color: var(--cyan);  border: 1px solid var(--cyan-deep); }
.tag-amber { background: rgba(246,169,75,.18); color: var(--amber); border: 1px solid #927327; }
.enh-badge {
    position: absolute; top: 7px; left: 7px; z-index: 2; font-family: var(--font-display);
    font-size: 0.55rem; font-weight: 700; padding: 2px 5px; border-radius: 4px;
    background: rgba(209,107,255,.18); color: var(--magenta); border: 1px solid #7d3fae;
}
.item-body { padding: 10px 12px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.item-body .nm { font-family: var(--font-display); font-weight: 600; font-size: 0.78rem; line-height: 1.25; }
.item-body .pt { font-size: 0.58rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-mute); }
.item-price { font-family: var(--font-display); font-weight: 700; font-size: 0.82rem; white-space: nowrap; text-align: right; }
/* the tile shows the cheapest of several duration variants -- say so */
.item-price .from {
    display: block; font-family: var(--font-body); font-weight: 400;
    font-size: 0.56rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-mute);
}
.item-price .g { color: var(--cyan); }
.item-price .c { color: var(--amber); }

/* the bag is exactly 10 slots -- lay it out 5 + 5 so it reads evenly, rather
   than letting auto-fill leave an orphan row (6 + 4). Doubled class so it
   still wins under the narrow-screen .item-grid override further down. */
.item-grid.item-grid--bag { grid-template-columns: repeat(5, 1fr); }
@media (max-width: 680px) { .item-grid.item-grid--bag { grid-template-columns: repeat(2, 1fr); } }

/* empty bag slot: a plain dashed square that lines up with the item tiles, so
   an empty (or half-full) bag still reads as a 10-slot bag. */
.item-card--empty { background: transparent; border-style: dashed; }
.item-card--empty:hover { transform: none; border-color: var(--border); }
.item-art--empty {
    background: repeating-linear-gradient(-45deg, transparent 0 9px, rgba(255,255,255,.02) 9px 18px),
                rgba(255,255,255,.012);
}
.item-card--empty .item-body { justify-content: center; }
.item-card--empty .nm {
    color: var(--text-mute); font-size: 0.62rem; letter-spacing: 0.18em; text-transform: uppercase;
}

/* per-tile buy control. margin-top:auto pins it to the bottom of the card so
   buttons line up across tiles whose names wrap to different heights. */
.item-buy { margin-top: auto; padding: 0 12px 12px; }
.buy-form { display: flex; flex-direction: column; gap: 6px; }
.buy-variant {
    font: inherit; font-size: 0.72rem; color: var(--text); width: 100%;
    background: var(--surface-2); border: 1px solid var(--border);
    border-radius: 8px; padding: 6px 8px;
}
.buy-go { width: 100%; justify-content: center; text-align: center; }
.buy-note {
    font-size: 0.6rem; letter-spacing: 0.08em; text-transform: uppercase;
    color: var(--text-mute); text-align: center; padding: 6px 0;
}
.buy-hint { font-size: 0.64rem; color: var(--amber); min-height: 0.9em; text-align: center; }

/* balance line under the shop page heading */
.shop-balance { margin-top: 12px; font-size: 0.9rem; color: var(--text-dim); }
.shop-balance strong { color: var(--text); font-family: var(--font-display); font-weight: 600; }
.shop-balance .c { color: var(--amber); }
.shop-balance .g { color: var(--cyan); }

/* balance chips in the nav */
.nav-balance { display: inline-flex; align-items: center; gap: 6px; }
.nav-bal {
    font-family: var(--font-display); font-weight: 600; font-size: 0.7rem;
    padding: 3px 8px; border-radius: 999px;
    border: 1px solid var(--border); background: var(--surface-2); white-space: nowrap;
}
.nav-bal i { font-style: normal; margin-left: 3px; font-size: 0.6rem; opacity: .8; }
.nav-bal--coins { color: var(--amber); }
.nav-bal--gigas { color: var(--cyan); }

/* CTA band */
.cta-band {
    position: relative; text-align: center; padding: 90px 0;
    background:
        radial-gradient(600px 300px at 50% 0%, rgba(209,107,255,.16), transparent 70%),
        radial-gradient(700px 340px at 50% 120%, rgba(41,211,238,.16), transparent 70%),
        var(--bg-band);
    border-block: 1px solid var(--border-soft);
}
.cta-band h2 { font-size: clamp(1.9rem, 4.5vw, 2.9rem); text-transform: uppercase; }
.cta-band p { color: var(--text-dim); margin: 14px auto 28px; max-width: 44ch; }
.cta-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.cta-note { margin-top: 18px; font-size: 0.74rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-mute); }

/* =====================================================================
   RANKINGS PAGE
   ===================================================================== */
.rank-controls { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; margin-bottom: 26px; }
.tab-row { display: flex; gap: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 5px; }
.tab {
    background: none; border: 0; cursor: pointer;
    font-family: var(--font-display); font-size: 0.78rem; letter-spacing: 0.06em;
    padding: 9px 18px; border-radius: 7px; color: var(--text-dim); transition: .15s;
}
.tab:hover { color: var(--text); }
.tab.is-active { background: var(--cyan); color: #04222a; font-weight: 600; }
.search-box { position: relative; }
.search-box input {
    background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
    padding: 11px 16px 11px 40px; color: var(--text); width: 240px; font: inherit;
}
.search-box input::placeholder { color: var(--text-mute); }
.search-box svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-mute); }

.pager { display: flex; gap: 8px; justify-content: center; margin-top: 32px; }
.pager a, .pager span {
    min-width: 40px; height: 40px; display: grid; place-items: center; padding: 0 8px;
    border-radius: 9px; border: 1px solid var(--border); background: var(--surface);
    font-family: var(--font-display); font-size: 0.85rem; color: var(--text-dim); transition: .15s;
}
.pager a:hover { border-color: var(--cyan-deep); color: var(--cyan); }
.pager .is-active { background: var(--cyan); border-color: var(--cyan); color: #04222a; font-weight: 700; }
.pager .gap { border: 0; background: none; }

.empty-state { text-align: center; padding: 60px 20px; color: var(--text-mute); }

/* =====================================================================
   DOWNLOAD PAGE
   ===================================================================== */
.dl-grid { display: grid; grid-template-columns: 1.55fr 1fr; gap: 26px; align-items: start; }
.dl-main { display: grid; gap: 20px; }
.dl-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 30px; }
.dl-card.featured { border-color: var(--cyan-deep); background: linear-gradient(160deg, #0e1a2c, var(--surface)); }
.dl-flag {
    display: inline-block; font-family: var(--font-display); font-size: 0.6rem; letter-spacing: 0.2em;
    text-transform: uppercase; color: var(--cyan); background: var(--cyan-glow);
    padding: 5px 12px; border-radius: 6px; margin-bottom: 14px;
}
.dl-card h3 { font-size: 1.3rem; display: flex; align-items: center; gap: 12px; }
.dl-card p { color: var(--text-dim); font-size: 0.92rem; margin: 10px 0 20px; }
.dl-row { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.dl-specs { font-size: 0.78rem; color: var(--text-mute); line-height: 1.8; }
.dl-specs b { color: var(--text-dim); font-weight: 600; }
.dl-secondary { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; }

.req-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 26px; position: sticky; top: calc(var(--nav-h) + 20px); }
.req-card h3 { display: flex; align-items: center; gap: 10px; font-size: 1rem; margin-bottom: 18px; }
.req-list { display: grid; gap: 14px; }
.req-list div { display: grid; gap: 2px; }
.req-list .k { font-size: 0.62rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--text-mute); }
.req-list .v { font-size: 0.9rem; }
.req-note { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border-soft); font-size: 0.78rem; color: var(--text-mute); }

.install-card { margin-top: 20px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.install-card h3 { font-size: 0.95rem; margin-bottom: 14px; }
.step { display: flex; gap: 12px; align-items: flex-start; font-size: 0.86rem; color: var(--text-dim); padding: 7px 0; }
.step .num {
    width: 22px; height: 22px; border-radius: 50%; background: var(--cyan-glow); color: var(--cyan);
    font-family: var(--font-display); font-size: 0.72rem; font-weight: 700; display: grid; place-items: center; flex-shrink: 0;
}

/* =====================================================================
   NEWS / ANNOUNCEMENTS
   ===================================================================== */
.news-list { display: grid; gap: 16px; max-width: 820px; }
.news-item {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 22px 26px;
}
.news-item.is-pinned { border-color: var(--cyan-deep); }
.news-meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.news-pin, .news-date, .news-author { font-size: 0.74rem; color: var(--text-mute); }
.news-title { font-size: 1.15rem; margin-bottom: 8px; }
.news-summary { color: var(--text-dim); font-size: 0.92rem; }
.news-body { margin-top: 12px; display: grid; gap: 10px; }
.news-body p { color: var(--text-dim); font-size: 0.88rem; line-height: 1.7; }

/* =====================================================================
   FOOTER
   ===================================================================== */
.site-footer { background: var(--bg-alt); border-top: 1px solid var(--border-soft); padding-top: 60px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; padding-bottom: 44px; }
.brand-logo--footer { height: 34px; }
.footer-brand p { color: var(--text-mute); font-size: 0.88rem; max-width: 40ch; margin-top: 14px; }
.footer-col h4 { font-size: 0.72rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--text-dim); margin-bottom: 16px; }
.footer-col li { margin-bottom: 10px; }
.footer-col a { font-size: 0.88rem; color: var(--text-mute); transition: color .15s; }
.footer-col a:hover { color: var(--cyan); }
.footer-bottom {
    display: flex; align-items: center; justify-content: space-between; gap: 18px;
    padding: 22px 24px; border-top: 1px solid var(--border-soft); flex-wrap: wrap;
}
.footer-bottom p { font-size: 0.78rem; color: var(--text-mute); }
.footer-bottom-right { display: flex; align-items: center; gap: 26px; flex-wrap: wrap; }
.footer-legal { display: flex; gap: 20px; }
.footer-legal a { font-size: 0.78rem; color: var(--text-mute); }
.footer-legal a:hover { color: var(--cyan); }
.footer-social { display: flex; gap: 14px; }
.footer-social a { color: var(--text-mute); transition: color .15s; }
.footer-social a:hover { color: var(--cyan); }
.footer-social svg { width: 18px; height: 18px; }

/* =====================================================================
   AUTH (sign in / register / account)
   ===================================================================== */
.nav-logout { display: inline; margin: 0; }
.nav-linkish { background: none; border: 0; cursor: pointer; padding: 0; font: inherit; }

.flash-wrap { padding-top: 18px; display: grid; gap: 10px; }
.flash {
    border-radius: var(--radius-sm); padding: 12px 16px; font-size: 0.88rem;
    border: 1px solid var(--border); background: var(--surface);
}
.flash-ok    { border-color: var(--cyan-deep); color: var(--cyan); background: var(--cyan-glow); }
.flash-error { border-color: #7d2b38; color: var(--red); background: rgba(255,93,115,.1); }

.auth-card {
    max-width: 420px; margin: 0 auto; background: var(--surface);
    border: 1px solid var(--border); border-radius: var(--radius); padding: 28px;
}
.auth-form { display: grid; gap: 16px; }
/* Account › Security: the change-password card above the 2FA cards */
.pw-card { display: grid; gap: 14px; margin-bottom: 30px; }
.pw-card h2 { margin: 0; }
.pw-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.pw-section-title { margin: 0 0 14px; }
@media (max-width: 640px) { .pw-grid { grid-template-columns: minmax(0, 1fr); } }
.field { display: grid; gap: 6px; }
.field-label {
    font-size: 0.66rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-mute);
}
.field-hint { text-transform: none; letter-spacing: 0; opacity: .8; }
.field input {
    font: inherit; color: var(--text); background: var(--bg-alt);
    border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 11px 13px;
}
.field input:focus-visible { border-color: var(--cyan-deep); }
.form-error {
    margin-bottom: 18px; border-radius: var(--radius-sm); padding: 11px 14px;
    font-size: 0.86rem; color: var(--red);
    border: 1px solid #7d2b38; background: rgba(255,93,115,.1);
}
.auth-alt {
    margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border-soft);
    font-size: 0.84rem; color: var(--text-dim); text-align: center;
}
.auth-alt a { color: var(--cyan); }

/* =====================================================================
   CHARACTER PROFILE
   ===================================================================== */
/* The landing page's 84px section rhythm is meant to let marketing blocks
   breathe; a profile is dense reference data and reads better tightened up. */
.page-head--tight { padding: 38px 0 26px; }
.section--profile { padding: 32px 0; }
.section--profile .section-head { margin-bottom: 20px; }

.char-head-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.char-guild { color: var(--text-dim); font-size: 0.95rem; }
.char-guild .clan-tag { margin-left: 4px; }
.back-link {
    display: inline-flex; align-items: center; gap: 6px; margin-bottom: 16px;
    font-family: var(--font-display); font-size: 0.78rem; letter-spacing: 0.08em;
    text-transform: uppercase; color: var(--text-dim); transition: color .15s;
}
.back-link:hover { color: var(--cyan); }

.xp-track { width: 100%; height: 8px; border-radius: 4px; background: var(--surface-3); overflow: hidden; margin-top: 10px; }
.xp-fill { height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--cyan-deep), var(--cyan)); }
.xp-caption { margin-top: 6px; font-size: 0.72rem; color: var(--text-mute); }

.stat-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px 28px; }
.stat-list .sl { display: flex; flex-direction: column; gap: 3px; }
.stat-list .sl .k { font-size: 0.62rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-mute); }
.stat-list .sl .v { font-family: var(--font-display); font-weight: 700; font-size: 1.02rem; color: #fff; }

/* account page: the single character, as a panel rather than a one-row table */
.char-summary { display: flex; flex-direction: column; gap: 18px; align-items: flex-start; }
.char-summary-head { display: flex; flex-direction: column; gap: 6px; }
.char-summary h3 { font-size: 1.25rem; text-transform: uppercase; letter-spacing: 0.02em; }
.char-summary .stat-list { width: 100%; max-width: 420px; }

.equip-grid { display: grid; grid-template-columns: 1fr minmax(280px, 360px) 1fr; gap: 20px; align-items: start; }
.equip-slots { display: grid; gap: 10px; }
.equip-slot {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
    padding: 12px 14px; display: flex; flex-direction: column; gap: 3px;
}
.equip-slot .sl-label { font-size: 0.6rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-mute); }
.equip-slot .sl-value { font-family: var(--font-display); font-weight: 600; font-size: 0.86rem; }
.equip-slot.is-empty .sl-value { color: var(--text-mute); font-weight: 400; font-style: italic; }

.bot-viewer-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.bot-viewer { position: relative; width: 100%; height: 420px; background: #0a1017; }
.bot-viewer canvas { display: block; }
.bot-viewer-status {
    position: absolute; inset: 0; z-index: 1; display: flex; align-items: center; justify-content: center;
    padding: 20px; text-align: center; font-size: 0.86rem; color: var(--text-dim);
}
.bot-viewer-status.is-error { color: var(--red); }
.bot-viewer-hint {
    padding: 12px 16px; text-align: center; font-size: 0.72rem; letter-spacing: 0.04em;
    color: var(--text-mute); border-top: 1px solid var(--border-soft);
}

/* =====================================================================
   RESPONSIVE
   ===================================================================== */
@media (max-width: 1080px) {
    .hero-grid { grid-template-columns: 1fr; gap: 36px; }
    .hero-art { max-width: 520px; }
    .tier-grid { grid-template-columns: repeat(2, 1fr); }   /* .item-grid auto-fills */
    .feature-grid { grid-template-columns: 1fr; }
    .dl-grid { grid-template-columns: 1fr; }
    .req-card { position: static; }
    .equip-grid { grid-template-columns: 1fr; }
    .equip-grid > .bot-viewer-card { order: -1; }
    .stat-list { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 860px) {
    .nav-toggle { display: flex; }
    .nav-links {
        position: absolute; top: var(--nav-h); left: 0; right: 0;
        flex-direction: column; align-items: stretch; gap: 4px;
        background: var(--bg-alt); border-bottom: 1px solid var(--border);
        padding: 16px 24px 22px; transform: translateY(-140%); transition: transform .25s ease; z-index: -1;
    }
    .site-nav.nav-open .nav-links { transform: translateY(0); }
    .nav-link { padding: 12px 0; }
    .nav-link.is-active::after { display: none; }
    .nav-cta { margin: 8px 0 0; }
    .nav-balance { padding: 8px 0; }
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .status-strip { grid-template-columns: 1fr; }
    .status-cell + .status-cell { border-left: 0; border-top: 1px solid var(--border); }
    .section { padding: 60px 0; }
    .page-head-inner { flex-direction: column; align-items: flex-start; }

    /* let wide tables scroll */
    .table-scroll { overflow-x: auto; }
    .table-scroll .ladder { min-width: 640px; }
}

@media (max-width: 560px) {
    .wrap { padding: 0 18px; }
    .tier-grid, .stat-grid { grid-template-columns: 1fr; }
    .item-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
    .hero-actions .btn, .cta-actions .btn { flex: 1; }
    .thread-row { flex-direction: row; }
    .thread-excerpt { white-space: normal; }
    .search-box input { width: 100%; }
    .rank-controls { flex-direction: column; align-items: stretch; }
    .rank-controls .search-box { width: 100%; }
    .bot-viewer { height: 300px; }
    .stat-list { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
    html { scroll-behavior: auto; }
}

/* order status badges (buyer's /orders page) */
.order-badge {
    display: inline-block; font-family: var(--font-display); font-weight: 600;
    font-size: 0.62rem; letter-spacing: 0.14em; text-transform: uppercase;
    padding: 4px 10px; border-radius: 999px; border: 1px solid var(--border);
    white-space: nowrap;
}
.order-badge--ok    { color: var(--green);   border-color: #1d6b46; background: rgba(53,208,127,.12); }
.order-badge--warn  { color: var(--amber);   border-color: #7d5620; background: rgba(246,169,75,.12); }
.order-badge--bad   { color: var(--red);     border-color: #7a2f3a; background: rgba(255,93,115,.12); }
.order-badge--muted { color: var(--text-mute); }

.order-focus { max-width: 720px; }
.order-focus-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 16px; }
.order-focus-head h2 { font-size: 1.4rem; text-transform: uppercase; }
.order-note { color: var(--text-dim); line-height: 1.6; margin-bottom: 20px; }
.order-note--ok  { color: var(--text); }
.order-note--bad { color: var(--text-dim); }

/* dev-only sandbox payment page */
.sandbox-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.sandbox-actions form { margin: 0; }

/* operator order queue */
.admin-queue { display: flex; flex-direction: column; gap: 14px; }
.admin-order { display: flex; gap: 24px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; }
.admin-order-main { flex: 1 1 460px; }
.admin-order-head { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
.admin-order h3 { font-size: 1.05rem; margin-bottom: 14px; }
.admin-order .stat-list { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px 20px; }
.admin-txid { margin-top: 12px; font-family: Consolas, monospace; font-size: 0.7rem; color: var(--text-mute); word-break: break-all; }
.admin-order-action { display: flex; flex-direction: column; gap: 8px; flex: 0 0 240px; }
.admin-order-action input {
    font: inherit; font-size: 0.8rem; color: var(--text); background: var(--surface-2);
    border: 1px solid var(--border); border-radius: 8px; padding: 9px 10px; width: 100%;
}
@media (max-width: 720px) { .admin-order-action { flex: 1 1 100%; } }

/* sandbox notice: payments here are fake. Loud on purpose -- mistaking
   simulated for live (or the reverse) is the expensive kind of confusion. */
.sandbox-banner {
    background: rgba(246,169,75,.12); border-bottom: 1px solid #7d5620;
    color: var(--amber); text-align: center; padding: 10px 18px; font-size: 0.82rem;
}
.sandbox-banner strong { font-family: var(--font-display); letter-spacing: .1em; text-transform: uppercase; }
.sandbox-banner code { background: rgba(0,0,0,.3); padding: 1px 5px; border-radius: 4px; color: var(--text-dim); }

/* ------------------------------------------------------------- market --- */
.market-head-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* The board cannot escrow a trade; say so once, plainly, at the top. */
.market-notice {
    margin-bottom: 22px; padding: 14px 18px; font-size: 0.86rem;
    color: var(--text-dim); line-height: 1.55; border-left: 2px solid var(--cyan);
}
.market-notice strong { color: var(--text); }
.market-notice em { color: var(--text); font-style: normal; }

.market-count { font-size: 0.76rem; color: var(--text-mute); letter-spacing: .1em; text-transform: uppercase; }

.market-card.is-reserved { opacity: .62; }

/* seller + ownership-proof line, between the item body and the action */
.market-meta {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    padding: 0 12px 8px; font-size: 0.66rem;
}
.market-seller {
    color: var(--text-mute); letter-spacing: .06em; overflow: hidden;
    text-overflow: ellipsis; white-space: nowrap;
}
/* Freshness of the ownership check, not a generic "verified" badge -- the
   distinction matters, so the colour carries the age. */
.market-verified { font-size: 0.8rem; line-height: 1; }
.market-verified--fresh { color: var(--green); }
.market-verified--ok    { color: var(--cyan); }
.market-verified--stale { color: var(--amber); }
.market-verified--none  { color: var(--text-mute); }

.sell-form { display: flex; flex-direction: column; gap: 6px; }
.sell-price { display: flex; gap: 6px; }
.sell-price input, .sell-price select {
    font: inherit; font-size: 0.76rem; color: var(--text);
    background: var(--surface-2); border: 1px solid var(--border);
    border-radius: 8px; padding: 7px 8px; min-width: 0;
}
.sell-price input { flex: 1 1 auto; width: 100%; }
.sell-price select { flex: 0 0 52px; }

.market-act { display: inline; margin: 0; }
.market-row-actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.market-warn-row td {
    color: var(--amber); font-size: 0.78rem; padding-top: 0;
    border-top: 0; background: rgba(246,169,75,.06);
}

/* market: an item the game says cannot be listed */
.item-card.is-blocked { opacity: .55; }
.buy-note--blocked { color: var(--text-mute); text-transform: none; letter-spacing: 0; font-size: 0.64rem; line-height: 1.35; }
.market-age { color: var(--text-mute); }
.market-filter-input {
    font: inherit; font-size: 0.78rem; color: var(--text); background: var(--surface);
    border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; width: 110px;
}

/* ------------------------------------------------------------- wiki ---- */
/* Two shapes: a card grid on /wiki, and a sidebar + article on a page.
   Article typography is deliberately roomier than the rest of the site --
   these are pages people read top to bottom, not scan. */

.wiki-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 18px;
}

.wiki-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    transition: border-color .18s ease, transform .18s ease;
}
.wiki-card:hover { border-color: var(--cyan-deep); transform: translateY(-2px); }

.wiki-card-head { display: flex; gap: 14px; align-items: flex-start; }
.wiki-card-head h2 {
    font-family: var(--font-display);
    font-size: 1.12rem;
    margin: 0 0 3px;
    letter-spacing: .02em;
}
.wiki-card-head p { margin: 0; color: var(--text-mute); font-size: .86rem; }

.wiki-card-icon {
    flex: 0 0 42px;
    width: 42px; height: 42px;
    display: grid; place-items: center;
    border-radius: var(--radius-sm);
    background: var(--cyan-glow);
    border: 1px solid rgba(41, 211, 238, .28);
    color: var(--cyan);
}
.wiki-card-icon svg { width: 22px; height: 22px; }

.wiki-card-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.wiki-card-list a {
    display: block;
    padding: 9px 11px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    border: 1px solid transparent;
}
.wiki-card-list a:hover { background: var(--surface-2); border-color: var(--border-soft); }
.wiki-card-list strong { display: block; color: var(--text); font-size: .93rem; font-weight: 600; }
.wiki-card-list span { display: block; color: var(--text-mute); font-size: .8rem; margin-top: 2px; }

.wiki-foot-note { margin-top: 28px; color: var(--text-mute); font-size: .88rem; text-align: center; }

/* ---- article layout ---- */
.wiki-layout { padding: 34px 0 64px; }
.wiki-layout-inner {
    display: grid;
    grid-template-columns: 246px minmax(0, 1fr);
    gap: 40px;
    align-items: start;
}

.wiki-side {
    position: sticky;
    top: calc(var(--nav-h) + 18px);
    max-height: calc(100vh - var(--nav-h) - 36px);
    overflow-y: auto;
    padding-right: 6px;
}
.wiki-side-home {
    display: block;
    font-size: .82rem;
    letter-spacing: .09em;
    text-transform: uppercase;
    color: var(--text-mute);
    text-decoration: none;
    padding: 6px 10px;
    margin-bottom: 14px;
    border-radius: var(--radius-sm);
}
.wiki-side-home:hover, .wiki-side-home.is-active { color: var(--cyan); background: var(--surface); }

.wiki-side-group { margin-bottom: 20px; }
.wiki-side-group h3 {
    font-family: var(--font-display);
    font-size: .74rem;
    letter-spacing: .13em;
    text-transform: uppercase;
    color: var(--text-mute);
    margin: 0 0 7px 10px;
}
.wiki-side-group ul { list-style: none; margin: 0; padding: 0; }
.wiki-side-group a {
    display: block;
    padding: 6px 10px;
    font-size: .89rem;
    color: var(--text-dim);
    text-decoration: none;
    border-left: 2px solid transparent;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.wiki-side-group a:hover { color: var(--text); background: var(--surface); }
.wiki-side-group a.is-active {
    color: var(--cyan);
    background: var(--surface);
    border-left-color: var(--cyan);
    font-weight: 600;
}

.wiki-main { min-width: 0; }

.wiki-crumbs {
    display: flex; gap: 8px; align-items: center;
    font-size: .82rem; color: var(--text-mute); margin-bottom: 14px;
}
.wiki-crumbs a { color: var(--text-dim); text-decoration: none; }
.wiki-crumbs a:hover { color: var(--cyan); }

/* ---- article typography ---- */
.wiki-article { max-width: 760px; }
.wiki-article h1 {
    font-family: var(--font-display);
    font-size: clamp(1.9rem, 3.4vw, 2.5rem);
    line-height: 1.15;
    margin: 0 0 10px;
}
.wiki-lede { color: var(--text-dim); font-size: 1.04rem; margin: 0 0 26px; }

.wiki-article h2 {
    font-family: var(--font-display);
    font-size: 1.32rem;
    margin: 38px 0 12px;
    padding-bottom: 9px;
    border-bottom: 1px solid var(--border);
}
.wiki-article h3 { font-family: var(--font-display); font-size: 1.06rem; margin: 26px 0 9px; }
.wiki-article h4 { font-size: .95rem; margin: 20px 0 7px; color: var(--text-dim); }

.wiki-article p { line-height: 1.72; margin: 0 0 15px; color: var(--text-dim); }
.wiki-article a { color: var(--cyan); text-decoration: none; border-bottom: 1px solid rgba(41, 211, 238, .3); }
.wiki-article a:hover { color: var(--cyan-bright); border-bottom-color: var(--cyan-bright); }
.wiki-article strong { color: var(--text); font-weight: 600; }
.wiki-article hr { border: 0; border-top: 1px solid var(--border); margin: 30px 0; }

.wiki-list { margin: 0 0 16px; padding-left: 22px; }
.wiki-list li { line-height: 1.7; margin-bottom: 7px; color: var(--text-dim); }
.wiki-list li::marker { color: var(--cyan-deep); }

.wiki-article code {
    font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
    font-size: .86em;
    background: var(--surface-2);
    border: 1px solid var(--border-soft);
    border-radius: 5px;
    padding: 1px 5px;
    color: var(--cyan-bright);
}
.wiki-code {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    overflow-x: auto;
    margin: 0 0 16px;
}
.wiki-code code { background: none; border: 0; padding: 0; color: var(--text-dim); }

.wiki-note {
    margin: 0 0 18px;
    padding: 13px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 3px solid var(--cyan);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    color: var(--text-dim);
    line-height: 1.68;
}

.wiki-table-wrap { overflow-x: auto; margin: 0 0 20px; }
.wiki-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .92rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
}
.wiki-table th {
    text-align: left;
    padding: 10px 14px;
    background: var(--surface-2);
    font-family: var(--font-display);
    font-size: .78rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--text-mute);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.wiki-table td { padding: 10px 14px; border-bottom: 1px solid var(--border-soft); color: var(--text-dim); }
.wiki-table tr:last-child td { border-bottom: 0; }
.wiki-table td:first-child { color: var(--text); }

/* ---- prev/next ---- */
.wiki-pager {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-top: 48px;
    max-width: 760px;
}
.wiki-pager-link {
    display: block;
    padding: 14px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-decoration: none;
    transition: border-color .18s ease;
}
.wiki-pager-link:hover { border-color: var(--cyan-deep); }
.wiki-pager-link span { display: block; font-size: .76rem; letter-spacing: .08em; text-transform: uppercase; color: var(--text-mute); }
.wiki-pager-link strong { display: block; margin-top: 4px; color: var(--text); font-size: .95rem; font-weight: 600; }
.wiki-pager-link--next { text-align: right; }

@media (max-width: 900px) {
    .wiki-layout-inner { grid-template-columns: 1fr; gap: 24px; }
    .wiki-side {
        position: static;
        max-height: none;
        border-bottom: 1px solid var(--border);
        padding-bottom: 12px;
    }
    .wiki-pager { grid-template-columns: 1fr; }
    .wiki-pager-link--next { text-align: left; }
}

/* ------------------------------------------------------------ admin ---- */
/* Staff dashboard: stat tiles, then proportion bars. Deliberately plain --
   an operator is reading numbers, not being sold anything. */

.admin-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    margin-bottom: 22px;
}

.admin-tile {
    background: var(--surface);
    border: 1px solid var(--border);
    border-top: 2px solid var(--cyan);
    border-radius: var(--radius);
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.admin-tile-value {
    font-family: var(--font-display);
    font-size: 1.7rem;
    font-weight: 700;
    line-height: 1.1;
    color: var(--text);
}
.admin-tile-label { font-size: .88rem; color: var(--text-dim); }
.admin-tile-note {
    font-size: .74rem;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--text-mute);
}

.admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 14px;
    /* cards size to their own content; stretching them to the tallest leaves
       a dead half-card under the short ones */
    align-items: start;
    margin-bottom: 14px;
}

.admin-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 20px;
}
.admin-card--wide { margin-bottom: 14px; }
.admin-card h2 {
    font-family: var(--font-display);
    font-size: .8rem;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--text-mute);
    margin: 0 0 14px;
}

/* label | proportion bar | count -- the bar is the point, so it takes the slack */
.admin-row {
    display: grid;
    grid-template-columns: 82px minmax(0, 1fr) 64px;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}
.admin-row-label { font-size: .85rem; color: var(--text-dim); }
.admin-row-track {
    height: 8px;
    background: var(--bg);
    border: 1px solid var(--border-soft);
    border-radius: 5px;
    overflow: hidden;
}
.admin-row-fill {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, var(--cyan-deep), var(--cyan));
    /* a 0% row still reads as a row, not a gap */
    min-width: 0;
}
.admin-row-fill--dim { background: var(--surface-3); }
.admin-row-value {
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-size: .85rem;
    color: var(--text);
}

.admin-dl { margin: 0; display: grid; grid-template-columns: 1fr auto; gap: 8px 14px; }
.admin-dl dt { font-size: .85rem; color: var(--text-dim); }
.admin-dl dd {
    margin: 0;
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-size: .9rem;
    color: var(--text);
}

.admin-foot { margin: 12px 0 0; font-size: .76rem; color: var(--text-mute); }

.admin-caveat {
    margin: 0 0 14px;
    padding: 10px 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 3px solid var(--amber);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-size: .85rem;
    color: var(--text-dim);
}

.admin-links { display: flex; gap: 10px; flex-wrap: wrap; margin: 20px 0; }

/* The "this cannot delete accounts" panel. Amber, not red: nothing is broken,
   the capability simply does not exist upstream yet. */
.admin-note { border-left: 3px solid var(--amber); }
.admin-note p { margin: 0 0 10px; font-size: .9rem; line-height: 1.65; color: var(--text-dim); }
.admin-note p:last-child { margin-bottom: 0; }
.admin-note code {
    font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
    font-size: .85em;
    background: var(--surface-2);
    border: 1px solid var(--border-soft);
    border-radius: 5px;
    padding: 1px 5px;
    color: var(--cyan-bright);
}

.pager-info { font-variant-numeric: tabular-nums; }

@media (max-width: 520px) {
    .admin-row { grid-template-columns: 74px minmax(0, 1fr) 54px; gap: 8px; }
}
