:root {
    --bg: #120f0c;
    --bg-soft: #19140f;
    --panel: #211a14;
    --panel-2: #2a2119;
    --panel-3: #33271d;
    --line: #5a4127;
    --line-soft: rgba(196, 144, 69, 0.22);
    --gold: #d5a44e;
    --gold-light: #f2cf83;
    --gold-dark: #8d5e23;
    --silver: #aeb5bd;
    --silver-light: #e5e8ec;
    --red: #8c281d;
    --red-light: #b84632;
    --green: #7fa94f;
    --green-light: #a8cf6c;
    --blue: #607f9e;
    --text: #f1e5cf;
    --text-soft: #c8b89e;
    --muted: #958775;
    --danger: #d55f4f;
    --warning: #e0a94c;
    --shadow: 0 18px 55px rgba(0, 0, 0, 0.35);
    --radius: 12px;
    --radius-sm: 8px;
    --sidebar-width: 252px;
    --topbar-height: 78px;
    color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-height: 100%; scroll-behavior: smooth; }
body {
    min-height: 100%;
    margin: 0;
    color: var(--text);
    background:
        radial-gradient(circle at 85% -10%, rgba(148, 81, 25, 0.18), transparent 34rem),
        linear-gradient(180deg, #17120e 0%, var(--bg) 55%, #0c0a08 100%);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 15px;
    line-height: 1.5;
}

body::before {
    position: fixed;
    inset: 0;
    z-index: -1;
    content: "";
    opacity: 0.14;
    pointer-events: none;
    background-image: url("../img/noise.svg");
    background-size: 180px 180px;
}

a { color: var(--gold-light); text-decoration: none; }
a:hover { color: #ffe0a0; }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
img { display: block; max-width: 100%; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3, .brand-lockup strong, .mobile-brand {
    font-family: Georgia, "Times New Roman", serif;
    letter-spacing: 0.02em;
}
h1 { margin-bottom: 0.45rem; font-size: clamp(2rem, 4vw, 3.15rem); line-height: 1.06; }
h2 { margin-bottom: 0.4rem; font-size: 1.35rem; line-height: 1.2; }
h3 { margin-bottom: 0.35rem; }
p { color: var(--text-soft); }
code {
    padding: 0.16rem 0.38rem;
    color: var(--gold-light);
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid var(--line-soft);
    border-radius: 5px;
    font: 0.88em ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* Shared controls */
.button {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.68rem 1rem;
    border: 1px solid transparent;
    border-radius: 7px;
    cursor: pointer;
    font-weight: 750;
    line-height: 1;
    text-align: center;
    transition: transform 130ms ease, border-color 130ms ease, background 130ms ease, opacity 130ms ease;
}
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button:active:not(:disabled) { transform: translateY(0); }
.button:disabled { cursor: not-allowed; opacity: 0.42; }
.button-primary {
    color: #fff8e8;
    background: linear-gradient(180deg, #a33a2a, #711b14);
    border-color: #bd4c35;
    box-shadow: inset 0 1px rgba(255, 255, 255, 0.12), 0 6px 20px rgba(99, 20, 13, 0.26);
}
.button-primary:hover:not(:disabled) { color: #fff; background: linear-gradient(180deg, #b84431, #7f2117); }
.button-secondary {
    color: var(--gold-light);
    background: linear-gradient(180deg, #382a1d, #251c15);
    border-color: #74522d;
}
.button-secondary:hover:not(:disabled) { background: #423020; border-color: var(--gold-dark); }
.button-danger { color: #ffe4df; background: rgba(146, 39, 28, 0.68); border-color: rgba(213, 95, 79, 0.52); }
.button-ghost { color: var(--text-soft); background: transparent; border-color: var(--line-soft); }
.button-large { min-height: 50px; padding-inline: 1.3rem; font-size: 1rem; }
.button-block { width: 100%; }
.icon-button {
    display: inline-grid;
    width: 42px;
    height: 42px;
    place-items: center;
    color: var(--gold-light);
    background: var(--panel-2);
    border: 1px solid var(--line);
    border-radius: 8px;
    cursor: pointer;
}
.text-link { color: var(--gold-light); font-size: 0.88rem; font-weight: 700; white-space: nowrap; }
.positive { color: var(--green-light); }
.negative { color: var(--danger); }
.muted { color: var(--muted); }
.eyebrow {
    margin-bottom: 0.35rem;
    color: var(--gold);
    font-size: 0.72rem;
    font-weight: 850;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}
.alert { margin-bottom: 1rem; padding: 0.82rem 1rem; border: 1px solid; border-radius: 8px; }
.alert-error { color: #ffd7d1; background: rgba(128, 33, 24, 0.35); border-color: rgba(208, 78, 61, 0.55); }
.alert-success { color: #dff6ba; background: rgba(72, 103, 39, 0.32); border-color: rgba(126, 169, 79, 0.52); }
.alert-warning { color: #ffe7b4; background: rgba(126, 82, 20, 0.3); border-color: rgba(224, 169, 76, 0.5); }

.field { display: grid; gap: 0.35rem; }
.field > span { color: var(--text-soft); font-size: 0.82rem; font-weight: 750; }
.field > small { color: var(--muted); font-size: 0.76rem; }
input, select, textarea {
    width: 100%;
    min-height: 44px;
    padding: 0.7rem 0.78rem;
    color: var(--text);
    background: rgba(10, 8, 7, 0.55);
    border: 1px solid #5a4631;
    border-radius: 7px;
    outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(213, 164, 78, 0.12); }
.form-stack { display: grid; gap: 1rem; }
.form-grid-two { display: grid; grid-template-columns: 1fr 1fr; gap: 0.9rem; }
.inline-form { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 0.65rem; }

.resource-icon { width: 27px; height: 27px; object-fit: contain; }
.resource-icon-sm { width: 18px; height: 18px; }
.summary-icon { width: 46px; height: 46px; flex: 0 0 46px; object-fit: contain; }
.text-icon {
    display: inline-grid;
    place-items: center;
    color: var(--gold-light);
    background: rgba(117, 72, 25, 0.35);
    border: 1px solid var(--line);
    border-radius: 50%;
    font: 700 1.15rem Georgia, serif;
}
.cost-list { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.cost-item { display: inline-flex; align-items: center; gap: 0.2rem; color: var(--text); font-weight: 750; }

.progress {
    height: 7px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.42);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 999px;
}
.progress > span { display: block; height: 100%; background: linear-gradient(90deg, #7f993a, #b0cb58); border-radius: inherit; }
.progress-health > span { background: linear-gradient(90deg, #6f8c3d, #aaca62); }
.progress-morale > span { background: linear-gradient(90deg, #8f6d26, #d4aa4e); }
.progress-fatigue > span { background: linear-gradient(90deg, #774b2e, #bf6f38); }
.progress-animated > span { width: 60%; animation: progress-pulse 1.8s ease-in-out infinite alternate; }
@keyframes progress-pulse { from { transform: translateX(-35%); } to { transform: translateX(105%); } }

/* Authentication */
.auth-body { overflow-x: hidden; }
.auth-shell { display: grid; min-height: 100vh; grid-template-columns: minmax(400px, 1.15fr) minmax(430px, 0.85fr); }
.auth-visual {
    position: relative;
    display: flex;
    min-height: 100vh;
    flex-direction: column;
    justify-content: space-between;
    padding: clamp(2rem, 5vw, 5rem);
    overflow: hidden;
    background: #17110c url("../img/auth-ludus-hero.jpg") center/cover no-repeat;
}
.auth-visual::after {
    position: absolute;
    inset: auto 0 0;
    height: 45%;
    content: "";
    background: linear-gradient(transparent, rgba(11, 8, 6, 0.95));
}
.auth-visual-overlay {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 72% 24%, transparent 0, rgba(13, 9, 6, 0.2) 28%, rgba(12, 8, 6, 0.82) 100%);
}
.brand-lockup {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text);
}
.brand-lockup:hover { color: var(--text); }
.brand-lockup img { filter: drop-shadow(0 6px 15px rgba(0, 0, 0, 0.4)); }
.brand-lockup span { display: grid; }
.brand-lockup strong { color: var(--gold-light); font-size: 1.35rem; letter-spacing: 0.06em; text-transform: uppercase; }
.brand-lockup small { color: var(--muted); font-size: 0.62rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; }
.brand-lockup-large strong { font-size: 1.9rem; }
.auth-pitch { position: relative; z-index: 2; max-width: 680px; }
.auth-pitch h1 { max-width: 620px; color: #fff1cf; font-size: clamp(2.4rem, 5vw, 4.7rem); }
.auth-pitch p:last-child { max-width: 570px; color: #d2c0a7; font-size: 1.08rem; }
.auth-main { display: grid; place-items: center; padding: clamp(1.25rem, 5vw, 4.5rem); background: linear-gradient(135deg, rgba(38, 28, 20, 0.92), rgba(16, 13, 10, 0.98)); }
.auth-card { width: min(100%, 440px); }
.auth-card-wide { width: min(100%, 560px); }
.auth-card h2 { margin-bottom: 0.45rem; font-size: 2rem; }
.auth-subtitle { margin-bottom: 1.5rem; }
.auth-switch { margin: 1.25rem 0 0; color: var(--muted); text-align: center; }

/* Main shell */
.app-shell { display: grid; min-height: 100vh; grid-template-columns: var(--sidebar-width) 1fr; }
.sidebar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    height: 100vh;
    flex-direction: column;
    padding: 1.1rem 0.9rem;
    background: linear-gradient(180deg, rgba(29, 23, 18, 0.99), rgba(15, 12, 10, 0.99));
    border-right: 1px solid var(--line);
    box-shadow: 12px 0 40px rgba(0, 0, 0, 0.2);
}
.sidebar .brand-lockup { min-height: 66px; padding: 0 0.45rem 1rem; border-bottom: 1px solid var(--line-soft); }
.sidebar .brand-lockup { min-width: 0; }
.sidebar .brand-lockup > span { min-width: 0; }
.sidebar .brand-lockup strong {
    max-width: 100%;
    font-size: 1rem;
    line-height: 1.08;
    letter-spacing: .035em;
    overflow-wrap: anywhere;
}
.sidebar .brand-lockup small { font-size: .56rem; line-height: 1.15; }
.sidebar-nav { display: grid; gap: 0.26rem; margin-top: 1rem; }
.nav-link {
    display: flex;
    min-height: 44px;
    align-items: center;
    gap: 0.75rem;
    padding: 0.62rem 0.72rem;
    color: var(--text-soft);
    border: 1px solid transparent;
    border-radius: 8px;
    font-weight: 680;
}
.nav-link:hover { color: var(--text); background: rgba(255, 255, 255, 0.03); }
.nav-link.is-active { color: #fff3d5; background: linear-gradient(90deg, rgba(139, 39, 29, 0.88), rgba(94, 26, 19, 0.58)); border-color: rgba(183, 68, 49, 0.45); }
.nav-icon { display: inline-grid; width: 25px; height: 25px; place-items: center; color: var(--gold-light); font-size: 1.05rem; }
.nav-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-attention-badge { display: inline-grid; min-width: 22px; height: 22px; margin-left: auto; padding: 0 0.38rem; place-items: center; color: #fff; background: #c43d31; border: 1px solid rgba(255, 174, 160, 0.62); border-radius: 999px; box-shadow: 0 0 0 3px rgba(196, 61, 49, 0.12), 0 4px 12px rgba(0, 0, 0, 0.28); font-size: 0.65rem; font-weight: 900; line-height: 1; }
.nav-link.is-active .nav-attention-badge { background: #ed5a49; border-color: rgba(255, 220, 211, 0.72); }
.nav-attention-dot { width: 10px; height: 10px; flex: 0 0 10px; margin-left: auto; background: #e04a3b; border: 1px solid rgba(255, 210, 202, .78); border-radius: 50%; box-shadow: 0 0 0 3px rgba(196, 61, 49, .14), 0 0 10px rgba(224, 74, 59, .42); }
.nav-link.is-active .nav-attention-dot { background: #ff6756; }
.sidebar-footer { display: grid; gap: 0.8rem; margin-top: auto; padding-top: 1rem; border-top: 1px solid var(--line-soft); }
.owner-block { display: flex; align-items: center; gap: 0.65rem; padding: 0.3rem; }
.owner-block > span:last-child { display: grid; min-width: 0; }
.owner-block strong { overflow: hidden; font-size: 0.84rem; text-overflow: ellipsis; white-space: nowrap; }
.owner-block small { color: var(--muted); font-size: 0.7rem; }
.supporter-badge { display: inline-flex; width: fit-content; align-items: center; gap: .25rem; padding: .18rem .45rem; color: #eee9df; background: linear-gradient(145deg, rgba(206, 211, 216, .24), rgba(93, 101, 109, .26)); border: 1px solid rgba(215, 222, 228, .55); border-radius: 999px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16); font-size: .62rem; font-style: normal; font-weight: 800; letter-spacing: .025em; line-height: 1.2; text-transform: uppercase; }
.supporter-badge::before { content: "◉"; color: #d9dee3; font-size: .66rem; }
.supporter-badge-compact { margin-top: .24rem; }
.supporter-badge-inline { display: inline-flex; margin-left: .28rem; vertical-align: .16em; }
.supporter-membership-card { border-color: rgba(204, 211, 218, .42); }
.retired-feature-card { grid-column: 1 / -1; }
.owner-avatar { display: inline-grid; width: 37px; height: 37px; flex: 0 0 37px; place-items: center; color: var(--gold-light); background: #2f241a; border: 1px solid var(--gold-dark); border-radius: 50%; font: 700 1rem Georgia, serif; }
.main-column { min-width: 0; }
.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    min-height: var(--topbar-height);
    padding: 0.75rem clamp(1rem, 2vw, 2rem);
    background: rgba(15, 12, 10, 0.93);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(14px);
}
.mobile-brand-row { display: none; }
.resource-strip { display: flex; min-height: 52px; align-items: center; justify-content: flex-end; gap: clamp(0.45rem, 1.4vw, 1.1rem); }
.resource-pill { display: flex; min-width: 105px; align-items: center; gap: 0.5rem; padding: 0.35rem 0.5rem; }
.resource-pill span { display: grid; }
.resource-pill strong { color: #f7ead2; font-size: 0.92rem; }
.resource-pill small { color: var(--muted); font-size: 0.65rem; }
.resource-pill-wide { min-width: 118px; }
.resource-pill-food { border: 1px solid transparent; border-radius: 9px; transition: background 160ms ease, border-color 160ms ease, box-shadow 160ms ease; }
.resource-pill-food.is-warning { background: rgba(135, 85, 18, 0.28); border-color: rgba(224, 169, 76, 0.5); }
.resource-pill-food.is-warning strong, .resource-pill-food.is-warning small { color: #ffe0a0; }
.resource-pill-food.is-critical { background: rgba(137, 34, 26, 0.42); border-color: rgba(231, 89, 71, 0.72); box-shadow: 0 0 0 3px rgba(194, 60, 47, 0.12); animation: food-critical-pulse 1.8s ease-in-out infinite; }
.resource-pill-food.is-critical strong { color: #fff0ed; }
.resource-pill-food.is-critical small { color: #ffb9ad; font-weight: 800; letter-spacing: 0.02em; }
.food-shortage-alert a { font-weight: 800; }
@keyframes food-critical-pulse { 0%, 100% { box-shadow: 0 0 0 3px rgba(194, 60, 47, 0.10); } 50% { box-shadow: 0 0 0 6px rgba(194, 60, 47, 0.20); } }
@media (prefers-reduced-motion: reduce) { .resource-pill-food.is-critical { animation: none; } }
.world-calendar-pill {
    display: flex;
    min-width: 228px;
    align-items: center;
    gap: 0.55rem;
    padding: 0.42rem 0.7rem;
    background: rgba(128, 83, 32, 0.13);
    border: 1px solid rgba(203, 151, 75, 0.3);
    border-radius: 999px;
}
.world-calendar-pill > span:last-child { display: grid; min-width: 0; }
.world-calendar-pill strong { overflow: hidden; color: var(--gold-light); font-size: 0.76rem; text-overflow: ellipsis; white-space: nowrap; }
.world-calendar-pill small { color: var(--muted); font-size: 0.62rem; }
.world-calendar-symbol { display: inline-grid; width: 27px; height: 27px; flex: 0 0 27px; place-items: center; color: var(--gold-light); background: rgba(222, 170, 91, 0.1); border: 1px solid rgba(222, 170, 91, 0.28); border-radius: 50%; font-size: 0.9rem; }
.page-content { width: min(100%, 1660px); margin: 0 auto; padding: clamp(1rem, 2.5vw, 2rem); }
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 1.5rem; margin-bottom: 1.45rem; }
.page-header > div:first-child { max-width: 780px; }
.page-header h1 { margin-bottom: 0.35rem; }
.page-header p:last-child { margin-bottom: 0; }
.header-stat { display: grid; min-width: 180px; padding: 0.78rem 1rem; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-sm); text-align: right; }
.header-stat strong { color: var(--gold-light); font-size: 1.15rem; }
.header-stat span { color: var(--muted); font-size: 0.7rem; }
.panel { background: linear-gradient(155deg, rgba(40, 31, 23, 0.96), rgba(27, 21, 16, 0.98)); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.section-panel { margin-bottom: 1.4rem; padding: clamp(1rem, 2vw, 1.4rem); }
.panel-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.panel-header h2, .panel-header p { margin-bottom: 0; }

/* Dashboard */
.hero-panel {
    position: relative;
    display: flex;
    min-height: 330px;
    align-items: flex-end;
    justify-content: space-between;
    gap: 2rem;
    margin-bottom: 1.25rem;
    padding: clamp(1.4rem, 4vw, 3.4rem);
    overflow: hidden;
    background: #21180f url("../img/ludus-panorama.svg") center 44%/cover no-repeat;
    border: 1px solid #76542c;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.hero-panel::before { position: absolute; inset: 0; content: ""; background: linear-gradient(90deg, rgba(17, 12, 8, 0.97) 0%, rgba(20, 14, 9, 0.77) 46%, rgba(17, 12, 8, 0.16) 100%), linear-gradient(0deg, rgba(12, 8, 5, 0.85), transparent 66%); }
.hero-content, .next-event-card { position: relative; z-index: 1; }
.hero-content { max-width: 690px; }
.hero-content h1 { color: #fff0c9; }
.hero-content > p:not(.eyebrow) { max-width: 630px; color: #ddcbb0; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 1.1rem 0 1.2rem; }
.level-progress { max-width: 460px; }
.level-progress-label { display: flex; justify-content: space-between; margin-bottom: 0.35rem; color: var(--text-soft); font-size: 0.72rem; }
.next-event-card { display: flex; max-width: 300px; align-items: center; gap: 0.85rem; padding: 1rem; background: rgba(20, 14, 10, 0.86); border: 1px solid rgba(213, 164, 78, 0.58); border-radius: 10px; backdrop-filter: blur(10px); }
.next-event-card > div { display: grid; }
.next-event-card small, .next-event-card span:last-child { color: var(--muted); font-size: 0.68rem; }
.next-event-card strong { color: var(--gold-light); font-size: 1.03rem; }
.next-event-icon { display: inline-grid; width: 44px; height: 44px; flex: 0 0 44px; place-items: center; color: var(--gold-light); background: rgba(124, 49, 26, 0.45); border: 1px solid var(--gold-dark); border-radius: 50%; font-size: 1.25rem; }
.summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.85rem; margin-bottom: 1.25rem; }
.summary-card { display: flex; min-height: 104px; align-items: center; gap: 0.85rem; padding: 1rem; background: linear-gradient(145deg, #2a2119, #1d1712); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 26px rgba(0, 0, 0, 0.22); }
.summary-card > div { display: grid; min-width: 0; }
.summary-card small { color: var(--muted); font-size: 0.68rem; text-transform: uppercase; }
.summary-card strong { color: var(--gold-light); font-size: 1.34rem; }
.summary-card span { overflow: hidden; color: var(--text-soft); font-size: 0.72rem; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-grid { display: grid; grid-template-columns: 1.25fr 1fr; gap: 1rem; }
.dashboard-grid > .panel { min-width: 0; padding: 1.1rem; }
.panel-span-2 { grid-column: 1 / -1; }
.roster-row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0.7rem; }
.roster-mini-card { position: relative; display: grid; min-width: 0; padding: 0.5rem; color: var(--text); background: rgba(10, 8, 6, 0.32); border: 1px solid var(--line-soft); border-radius: 9px; }
.roster-mini-card:hover { color: var(--text); border-color: var(--gold-dark); transform: translateY(-1px); }
.roster-mini-card > img { width: 100%; aspect-ratio: 4/5; margin-bottom: 0.55rem; object-fit: cover; object-position: center 16%; background: #261b13; border-radius: 6px; }
.roster-mini-card strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.roster-mini-card small { overflow: hidden; color: var(--muted); font-size: 0.67rem; text-overflow: ellipsis; white-space: nowrap; }
.status-dot { position: absolute; top: 0.76rem; right: 0.76rem; width: 10px; height: 10px; background: var(--muted); border: 2px solid #211810; border-radius: 50%; box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.25); }
.status-dot.status-active { background: var(--green-light); }
.status-dot.status-training { background: var(--gold); }
.status-dot.status-palaestra_reserved { background: #c79b54; box-shadow: 0 0 0 3px rgba(199, 155, 84, .13); }
.status-dot.status-focused_training { background: #b47b42; box-shadow: 0 0 0 3px rgba(180, 123, 66, .13); }
.status-dot.status-injured { background: var(--danger); }
.mini-stat { display: flex; justify-content: space-between; margin-top: 0.5rem; padding-top: 0.45rem; border-top: 1px solid var(--line-soft); font-size: 0.67rem; }
.mini-stat span { color: var(--muted); }
.mini-stat b { color: var(--gold-light); }
.compact-list { display: grid; gap: 0.55rem; }
.compact-list-item { display: flex; min-width: 0; align-items: center; gap: 0.65rem; padding: 0.55rem; background: rgba(0, 0, 0, 0.18); border: 1px solid var(--line-soft); border-radius: 8px; }
.compact-list-item > div { display: grid; min-width: 0; flex: 1; }
.compact-list-item strong { overflow: hidden; font-size: 0.78rem; text-overflow: ellipsis; white-space: nowrap; }
.compact-list-item span, .compact-list-item time { color: var(--muted); font-size: 0.67rem; }
.compact-list-item time { color: var(--gold-light); white-space: nowrap; }
.list-avatar { width: 38px; height: 38px; object-fit: cover; object-position: center 18%; border-radius: 6px; }
.facility-mini-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.55rem; }
.facility-mini { display: flex; min-width: 0; align-items: center; gap: 0.6rem; padding: 0.58rem; color: var(--text); background: rgba(0, 0, 0, 0.18); border: 1px solid var(--line-soft); border-radius: 8px; }
.facility-mini:hover { color: var(--text); border-color: var(--gold-dark); }
.facility-mini img { width: 45px; height: 45px; flex: 0 0 45px; object-fit: cover; border-radius: 6px; }
.facility-mini > span { display: grid; min-width: 0; flex: 1; }
.facility-mini strong { overflow: hidden; font-size: 0.76rem; text-overflow: ellipsis; white-space: nowrap; }
.facility-mini small, .facility-mini b { color: var(--muted); font-size: 0.65rem; }
.facility-mini b { color: var(--gold-light); }
.result-badge { display: inline-grid; width: 30px; height: 30px; flex: 0 0 30px; place-items: center; border-radius: 50%; font-weight: 900; }
.result-win { color: #dff7b9; background: rgba(93, 134, 51, 0.45); border: 1px solid #739f48; }
.result-loss { color: #ffd4cf; background: rgba(142, 46, 34, 0.45); border: 1px solid #a84d3f; }
.fight-list-item > b { color: var(--green-light); font-size: 0.72rem; }
.activity-list { display: grid; gap: 0.72rem; }
.activity-list article { display: flex; gap: 0.65rem; }
.activity-list article > div { min-width: 0; }
.activity-list p { margin: 0; color: var(--text-soft); font-size: 0.74rem; }
.activity-list time { color: var(--muted); font-size: 0.63rem; }
.activity-marker { width: 8px; height: 8px; flex: 0 0 8px; margin-top: 0.38rem; background: var(--gold); border-radius: 50%; box-shadow: 0 0 0 3px rgba(213, 164, 78, 0.1); }
.activity-marker.category-fight { background: var(--red-light); }
.activity-marker.category-training { background: var(--green); }
.activity-marker.category-facility { background: var(--blue); }

/* Empty states */
.empty-state { display: grid; justify-items: center; padding: 1.5rem; color: var(--muted); text-align: center; }
.empty-state p { margin-bottom: 0.75rem; color: var(--muted); }
.empty-state.compact { padding: 1rem; }
.empty-icon { display: inline-grid; min-width: 48px; min-height: 48px; place-items: center; margin-bottom: 0.6rem; color: var(--gold-light); background: rgba(95, 64, 30, 0.25); border: 1px solid var(--line); border-radius: 50%; font-weight: 800; }
.page-empty-state { min-height: 360px; align-content: center; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }

/* Gladiators */
.capacity-banner { display: grid; grid-template-columns: minmax(260px, auto) minmax(240px, 1fr); align-items: center; gap: 1.5rem; margin-bottom: 1.2rem; padding: 0.9rem 1rem; background: rgba(42, 33, 25, 0.88); border: 1px solid var(--line); border-radius: 10px; }
.capacity-banner > div:first-child { display: flex; align-items: center; gap: 0.7rem; }
.capacity-banner > div:first-child span { display: grid; }
.capacity-banner small { color: var(--muted); font-size: 0.7rem; }
.gladiator-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.gladiator-card { overflow: hidden; background: linear-gradient(160deg, #2b2119, #1c1611); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.gladiator-card-portrait { position: relative; height: 210px; overflow: hidden; background: #281d14; }
.gladiator-card-portrait::after { position: absolute; inset: auto 0 0; height: 42%; content: ""; background: linear-gradient(transparent, #241a13); }
.gladiator-card-portrait img { width: 100%; height: 100%; object-fit: cover; object-position: center 18%; }
.status-badge { display: inline-flex; align-items: center; padding: 0.22rem 0.48rem; border: 1px solid; border-radius: 999px; font-size: 0.62rem; font-weight: 800; text-transform: uppercase; }
.gladiator-card-portrait .status-badge { position: absolute; z-index: 2; top: 0.75rem; left: 0.75rem; }
.status-active { color: #dff3b9; background: rgba(66, 100, 34, 0.66); border-color: #6e9847; }
.status-training { color: #ffe0a0; background: rgba(112, 72, 21, 0.72); border-color: #b07a2d; }
.status-palaestra_reserved { color: #f3ddb5; background: rgba(83, 61, 31, .78); border-color: #bd8d48; }
.status-focused_training { color: #f1d09d; background: rgba(91, 55, 28, .78); border-color: #a36d38; }
.status-injured { color: #ffd7d1; background: rgba(119, 35, 26, 0.75); border-color: #b75041; }
.status-resting { color: #d6e8fb; background: rgba(51, 78, 103, 0.7); border-color: #587a99; }
.level-medallion { position: absolute; z-index: 2; right: 0.75rem; bottom: 0.75rem; display: inline-grid; width: 48px; height: 48px; place-items: center; color: #22150b; background: radial-gradient(circle at 35% 28%, #f4cf79, #a16b28 70%); border: 2px solid #f4d68c; border-radius: 50%; box-shadow: 0 6px 14px rgba(0, 0, 0, 0.35); font: 800 0.85rem Georgia, serif; }
.gladiator-card-body { padding: 1rem; }
.gladiator-title-row, .market-title { display: flex; justify-content: space-between; gap: 1rem; }
.gladiator-title-row h2, .gladiator-title-row p, .market-title h2, .market-title p { margin-bottom: 0; }
.gladiator-title-row p, .market-title p { color: var(--gold); font-size: 0.72rem; }
.power-score, .market-title > strong { display: grid; color: var(--gold-light); font-size: 1.15rem; text-align: right; }
.power-score small, .market-title > strong small { color: var(--muted); font: 600 0.58rem Inter, sans-serif; text-transform: uppercase; }
.card-description { min-height: 40px; margin: 0.6rem 0 0.75rem; color: var(--muted); font-size: 0.72rem; }
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.45rem; margin-bottom: 0.85rem; }
.stat-grid > div { display: grid; padding: 0.48rem; background: rgba(0, 0, 0, 0.2); border: 1px solid var(--line-soft); border-radius: 6px; text-align: center; }
.stat-grid span { color: var(--muted); font-size: 0.58rem; }
.stat-grid strong { color: var(--text); }
.micro-progress { height: 3px; margin-top: 0.3rem; overflow: hidden; background: #110e0b; border-radius: 99px; }
.micro-progress i { display: block; height: 100%; background: var(--gold-dark); }
.condition-list { display: grid; gap: 0.38rem; }
.condition-list > div { display: grid; grid-template-columns: 1fr auto; align-items: center; column-gap: 0.7rem; }
.condition-list span, .condition-list b { font-size: 0.65rem; }
.condition-list span { color: var(--muted); }
.condition-list .progress { grid-column: 1/-1; height: 5px; }
.xp-row { display: grid; gap: 0.3rem; margin-top: 0.75rem; }
.xp-row > span { color: var(--muted); font-size: 0.62rem; }
.record-row { display: flex; justify-content: space-between; margin-top: 0.75rem; padding-top: 0.65rem; color: var(--muted); border-top: 1px solid var(--line-soft); font-size: 0.7rem; }
.record-row strong { color: var(--text); }
.manage-panel { margin-top: 0.75rem; border: 1px solid var(--line-soft); border-radius: 7px; }
.manage-panel summary { padding: 0.62rem 0.7rem; color: var(--gold-light); cursor: pointer; font-size: 0.72rem; font-weight: 750; }
.manage-panel[open] summary { border-bottom: 1px solid var(--line-soft); }
.manage-panel form { margin: 0.7rem; }

/* Training */
.active-job-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; }
.active-job-card { display: flex; align-items: center; gap: 0.75rem; padding: 0.7rem; background: rgba(0, 0, 0, 0.18); border: 1px solid var(--line-soft); border-radius: 8px; }
.active-job-card img { width: 56px; height: 56px; flex: 0 0 56px; object-fit: cover; object-position: center 16%; border-radius: 7px; }
.active-job-card > div { display: grid; min-width: 0; flex: 1; }
.active-job-card span { color: var(--muted); font-size: 0.68rem; }
.active-job-card .progress { margin-top: 0.4rem; }
.active-job-card time { color: var(--gold-light); font-size: 0.76rem; white-space: nowrap; }
.training-form { display: grid; gap: 1rem; }
.training-select { max-width: 640px; }
.program-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0.7rem; }
.program-card { position: relative; display: grid; min-width: 0; align-content: start; padding: 0.85rem; background: rgba(10, 8, 6, 0.24); border: 1px solid var(--line-soft); border-radius: 9px; cursor: pointer; transition: border-color 130ms ease, transform 130ms ease, background 130ms ease; }
.program-card:hover { transform: translateY(-1px); border-color: var(--gold-dark); }
.program-card.is-selected { background: linear-gradient(150deg, rgba(116, 61, 25, 0.32), rgba(31, 23, 17, 0.86)); border-color: var(--gold); box-shadow: 0 0 0 2px rgba(213, 164, 78, 0.08); }
.program-card input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.program-icon { display: inline-grid; width: 42px; height: 42px; place-items: center; margin-bottom: 0.65rem; color: var(--gold-light); background: rgba(111, 68, 25, 0.32); border: 1px solid var(--line); border-radius: 50%; font-size: 1.05rem; }
.program-card > strong { margin-bottom: 0.3rem; }
.program-card > p { min-height: 58px; margin-bottom: 0.6rem; color: var(--muted); font-size: 0.68rem; }
.program-gains { display: flex; flex-wrap: wrap; gap: 0.25rem; margin-bottom: 0.7rem; }
.program-gains span { padding: 0.16rem 0.32rem; color: var(--green-light); background: rgba(80, 108, 44, 0.2); border-radius: 4px; font-size: 0.57rem; font-weight: 750; }
.program-quote { display: grid; gap: 0.3rem; margin-top: auto; padding-top: 0.55rem; border-top: 1px solid var(--line-soft); }
.program-quote span { color: var(--text-soft); font-size: 0.65rem; }
.program-quote b { color: var(--gold-light); font-size: 0.68rem; }
.training-rule-banner { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1rem; padding: 0.78rem 0.9rem; color: var(--text-soft); background: rgba(104, 72, 29, 0.18); border: 1px solid var(--gold-dark); border-radius: 9px; font-size: 0.72rem; }
.training-rule-banner strong { flex: 0 0 auto; color: var(--gold-light); }
.training-rule-banner b { color: var(--text); }
.training-availability-panel .panel-header p { max-width: 760px; }
.training-blocker-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; }
.training-blocker-card { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; align-items: center; gap: 0.75rem; padding: 0.8rem; background: rgba(0, 0, 0, 0.18); border: 1px solid var(--line-soft); border-radius: 9px; }
.training-blocker-card img { width: 64px; height: 72px; object-fit: cover; border-radius: 7px; }
.training-blocker-copy { min-width: 0; }
.training-blocker-copy > div { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.35rem 0.75rem; }
.training-blocker-copy > div span { color: var(--muted); font-size: 0.64rem; }
.training-blocker-copy ul { display: grid; gap: 0.24rem; margin: 0.45rem 0 0; padding-left: 1rem; color: var(--text-soft); font-size: 0.66rem; }
.training-blocker-copy li::marker { color: var(--danger-light); }

/* Facilities */
.construction-banner { display: grid; grid-template-columns: 70px 1fr minmax(180px, 0.5fr); align-items: center; gap: 0.85rem; margin-bottom: 1rem; padding: 0.75rem; background: linear-gradient(90deg, rgba(109, 66, 25, 0.28), rgba(35, 27, 20, 0.92)); border: 1px solid var(--gold-dark); border-radius: 10px; }
.construction-banner img { width: 70px; height: 60px; object-fit: cover; border-radius: 6px; }
.construction-banner > div:nth-child(2) { display: grid; }
.construction-banner small { color: var(--muted); }
.construction-banner span { color: var(--gold-light); font-size: 0.78rem; }
.facility-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.facility-card { display: grid; grid-template-columns: 190px 1fr; min-width: 0; overflow: hidden; background: linear-gradient(155deg, #2b2119, #1b1511); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.facility-art { position: relative; min-height: 300px; overflow: hidden; }
.facility-art::after { position: absolute; inset: 0; content: ""; background: linear-gradient(90deg, transparent 40%, #241a13 100%), linear-gradient(0deg, rgba(20, 14, 10, 0.65), transparent 50%); }
.facility-art img { width: 100%; height: 100%; object-fit: cover; }
.facility-art > span { position: absolute; z-index: 2; bottom: 0.75rem; left: 0.75rem; padding: 0.25rem 0.5rem; color: var(--gold-light); background: rgba(18, 12, 8, 0.8); border: 1px solid var(--gold-dark); border-radius: 99px; font-size: 0.68rem; font-weight: 800; }
.facility-body { display: flex; min-width: 0; flex-direction: column; padding: 1rem; }
.facility-heading { display: flex; justify-content: space-between; gap: 0.75rem; }
.facility-heading p { color: var(--muted); font-size: 0.7rem; }
.facility-level { color: var(--gold-light); font: 700 1.65rem Georgia, serif; white-space: nowrap; }
.facility-level small { color: var(--muted); font-size: 0.7rem; }
.effect-comparison { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 0.6rem; margin: 0.5rem 0 0.8rem; padding: 0.65rem; background: rgba(0, 0, 0, 0.18); border: 1px solid var(--line-soft); border-radius: 7px; }
.effect-comparison > div { display: grid; }
.effect-comparison small { color: var(--muted); font-size: 0.58rem; }
.effect-comparison strong { font-size: 0.68rem; }
.effect-comparison > span { color: var(--gold); }
.upgrade-details { display: flex; align-items: flex-end; justify-content: space-between; gap: 0.75rem; margin-top: auto; margin-bottom: 0.75rem; }
.upgrade-details small { display: block; margin-bottom: 0.25rem; color: var(--muted); font-size: 0.6rem; }
.upgrade-details > div:last-child { text-align: right; }
.upgrade-status, .max-level-banner { margin-top: auto; padding: 0.75rem; color: var(--gold-light); background: rgba(102, 65, 24, 0.25); border: 1px solid var(--gold-dark); border-radius: 7px; text-align: center; }
.upgrade-status { display: flex; justify-content: space-between; }

/* Market */
.market-meta { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.65rem; margin-bottom: 1rem; }
.market-meta > div { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; padding: 0.7rem 0.85rem; background: rgba(40, 31, 23, 0.82); border: 1px solid var(--line); border-radius: 8px; }
.market-meta span { color: var(--muted); font-size: 0.68rem; }
.market-meta strong { color: var(--gold-light); font-size: 0.78rem; }
.market-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.market-card { overflow: hidden; background: linear-gradient(160deg, #2b2119, #1a1410); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.market-portrait { position: relative; height: 190px; overflow: hidden; }
.market-portrait::after { position: absolute; inset: auto 0 0; height: 45%; content: ""; background: linear-gradient(transparent, #241a13); }
.market-portrait img { width: 100%; height: 100%; object-fit: cover; object-position: center 18%; }
.market-portrait span { position: absolute; z-index: 2; right: 0.7rem; bottom: 0.7rem; padding: 0.2rem 0.45rem; color: var(--gold-light); background: rgba(17, 12, 8, 0.82); border: 1px solid var(--gold-dark); border-radius: 99px; font-size: 0.64rem; font-weight: 750; }
.market-body { padding: 0.9rem; }
.market-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.35rem; margin: 0.75rem 0; }
.market-stats span { display: grid; padding: 0.4rem; color: var(--muted); background: rgba(0, 0, 0, 0.2); border-radius: 5px; font-size: 0.57rem; text-align: center; }
.market-stats b { color: var(--text); font-size: 0.78rem; }
.market-condition { display: flex; justify-content: space-between; margin-bottom: 0.75rem; color: var(--muted); font-size: 0.64rem; }

/* Trade */
.trade-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.trade-card { display: grid; grid-template-columns: 90px 1fr; overflow: hidden; background: linear-gradient(150deg, #2a2119, #1b1511); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.trade-house-mark { display: grid; min-height: 260px; place-items: center; background: radial-gradient(circle, rgba(151, 81, 29, 0.42), rgba(22, 16, 12, 0.2)), url("../img/noise.svg"); border-right: 1px solid var(--line); }
.trade-house-mark span { display: inline-grid; width: 57px; height: 57px; place-items: center; color: #2a180b; background: radial-gradient(circle at 32% 25%, #f0ca76, #9c6222); border: 3px double #f4d589; border-radius: 50%; box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3); font: 800 1.8rem Georgia, serif; }
.trade-card-body { padding: 1rem; }
.trade-card-body h2 { margin-bottom: 0.45rem; }
.trade-card-body > p:not(.eyebrow) { min-height: 48px; color: var(--text-soft); font-size: 0.75rem; }
.trade-exchange { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 0.45rem; margin: 0.75rem 0; padding: 0.65rem; background: rgba(0, 0, 0, 0.2); border: 1px solid var(--line-soft); border-radius: 7px; }
.trade-exchange span { display: flex; align-items: center; justify-content: center; gap: 0.25rem; font-size: 0.68rem; text-align: center; }
.trade-exchange b { color: var(--gold); font-size: 0.62rem; }
.offer-expiry { display: block; margin-top: 0.55rem; color: var(--muted); text-align: center; }
.offer-expiry .countdown { color: var(--gold-light); }

/* Arena / table */
.arena-explainer { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; padding: 1rem; background: linear-gradient(90deg, rgba(113, 42, 27, 0.32), rgba(34, 26, 19, 0.92)); border: 1px solid #814731; border-radius: 10px; }
.arena-explainer > div { display: flex; align-items: center; gap: 0.85rem; }
.arena-explainer p { margin-bottom: 0; color: var(--text-soft); font-size: 0.72rem; }
.arena-icon { display: inline-grid; width: 48px; height: 48px; flex: 0 0 48px; place-items: center; color: var(--gold-light); background: rgba(100, 42, 25, 0.45); border: 1px solid var(--gold-dark); border-radius: 50%; font-size: 1.2rem; }
.table-panel { overflow: hidden; }
.responsive-table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td { padding: 0.8rem; border-bottom: 1px solid var(--line-soft); text-align: left; vertical-align: middle; }
.data-table th { color: var(--gold-light); background: rgba(0, 0, 0, 0.2); font-size: 0.64rem; letter-spacing: 0.06em; text-transform: uppercase; }
.data-table td { color: var(--text-soft); font-size: 0.72rem; }
.data-table tbody tr:hover { background: rgba(255, 255, 255, 0.018); }
.data-table time { display: grid; white-space: nowrap; }
.data-table time small { color: var(--muted); }
.power-comparison { color: var(--text); font-weight: 750; white-space: nowrap; }
.power-comparison small { color: var(--muted); font-weight: 500; }

/* Settings */
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.settings-grid .section-panel { margin: 0; }
.settings-stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.5rem; }
.settings-stat-grid > div { display: grid; padding: 0.7rem; background: rgba(0, 0, 0, 0.2); border: 1px solid var(--line-soft); border-radius: 7px; }
.settings-stat-grid small, .settings-stat-grid span { color: var(--muted); font-size: 0.6rem; }
.settings-stat-grid strong { color: var(--gold-light); font-size: 1.05rem; }
.settings-note { margin: 0.9rem 0 0; color: var(--muted); font-size: 0.72rem; }
.feature-list { display: grid; }
.feature-list > div { display: flex; justify-content: space-between; gap: 1rem; padding: 0.66rem 0; border-bottom: 1px solid var(--line-soft); }
.feature-list > div:last-child { border-bottom: 0; }
.feature-list span { color: var(--text-soft); }
.feature-list strong { font-size: 0.72rem; }
.feature-on { color: var(--green-light); }
.feature-off { color: var(--muted); }
.hook-cloud { display: flex; flex-wrap: wrap; gap: 0.45rem; }

/* Mobile navigation and overlays */
.mobile-bottom-nav { display: none; }
.sidebar-scrim { display: none; }
.toast-stack { position: fixed; z-index: 100; right: 1rem; bottom: 1rem; display: grid; width: min(94vw, 430px); gap: 0.65rem; pointer-events: none; }
.toast { position: relative; display: grid; grid-template-columns: 30px minmax(0, 1fr) 24px; align-items: start; gap: 0.7rem; padding: 0.85rem 0.8rem; color: var(--text); background: rgba(35, 27, 20, 0.98); border: 1px solid var(--line); border-left: 4px solid var(--gold); border-radius: 9px; box-shadow: 0 18px 42px rgba(0, 0, 0, 0.42); animation: toast-in 180ms ease-out; pointer-events: auto; }
.toast-icon { display: grid; place-items: center; width: 28px; height: 28px; color: var(--gold-light); background: rgba(213, 164, 78, 0.12); border: 1px solid rgba(213, 164, 78, 0.38); border-radius: 50%; font-size: 0.82rem; font-weight: 850; }
.toast-content { min-width: 0; }
.toast-title { display: block; margin: 0 0 0.22rem; color: var(--text); font-size: 0.78rem; line-height: 1.25; }
.toast-message { margin: 0; color: var(--text-soft); font-size: 0.69rem; line-height: 1.48; }
.toast-action { display: inline-flex; margin-top: 0.5rem; color: var(--gold-light); font-size: 0.65rem; font-weight: 750; text-decoration: none; }
.toast-action:hover, .toast-action:focus-visible { color: #ffe0a2; text-decoration: underline; }
.toast-close { width: 24px; height: 24px; min-height: 0; padding: 0; color: var(--muted); background: transparent; border: 0; border-radius: 4px; font-size: 1.05rem; line-height: 1; cursor: pointer; }
.toast-close:hover, .toast-close:focus-visible { color: var(--text); background: rgba(255, 255, 255, 0.06); }
.toast-error { border-left-color: var(--danger); }
.toast-error .toast-icon { color: #ffb5a8; background: rgba(194, 71, 53, 0.14); border-color: rgba(194, 71, 53, 0.48); }
.toast-success { border-left-color: var(--green); }
.toast-success .toast-icon { color: var(--green-light); background: rgba(75, 139, 91, 0.14); border-color: rgba(75, 139, 91, 0.48); }
.toast-warning { border-left-color: #d28b31; }
.toast-warning .toast-icon { color: #ffd28d; background: rgba(210, 139, 49, 0.14); border-color: rgba(210, 139, 49, 0.5); }
.toast-info { border-left-color: #8da9c4; }
.toast-info .toast-icon { color: #c7def2; background: rgba(107, 144, 177, 0.14); border-color: rgba(107, 144, 177, 0.5); }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } }

@media (max-width: 1280px) {
    .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .program-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .gladiator-grid, .market-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .facility-card { grid-template-columns: 150px 1fr; }
}

@media (max-width: 1050px) {
    :root { --sidebar-width: 224px; }
    .dashboard-grid { grid-template-columns: 1fr; }
    .panel-span-2 { grid-column: auto; }
    .roster-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .facility-grid { grid-template-columns: 1fr; }
    .facility-card { grid-template-columns: 210px 1fr; }
    .settings-grid { grid-template-columns: 1fr; }
}

@media (max-width: 880px) {
    :root { --topbar-height: auto; }
    .app-shell { display: block; }
    .sidebar {
        position: fixed;
        left: 0;
        transform: translateX(-105%);
        width: min(86vw, 290px);
        transition: transform 180ms ease;
    }
    body.sidebar-open { overflow: hidden; }
    body.sidebar-open .sidebar { transform: translateX(0); }
    .sidebar-scrim { position: fixed; inset: 0; z-index: 25; background: rgba(0, 0, 0, 0.58); backdrop-filter: blur(2px); }
    body.sidebar-open .sidebar-scrim { display: block; }
    .topbar { padding: 0.55rem 0.7rem 0.45rem; }
    .mobile-brand-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.35rem; }
    .mobile-brand { color: var(--gold-light); font-size: 1.13rem; letter-spacing: 0.08em; text-transform: uppercase; }
    .resource-strip { justify-content: flex-start; gap: 0.25rem; overflow-x: auto; scrollbar-width: none; }
    .resource-strip::-webkit-scrollbar { display: none; }
    .resource-pill { min-width: 104px; padding: 0.25rem 0.35rem; }
    .world-calendar-pill { min-width: 205px; padding: 0.32rem 0.55rem; }
    .world-calendar-pill strong { font-size: 0.7rem; }
    .resource-pill .resource-icon { width: 23px; height: 23px; }
    .page-content { padding: 1rem 0.8rem 6rem; }
    .mobile-bottom-nav {
        position: fixed;
        z-index: 22;
        right: 0;
        bottom: 0;
        left: 0;
        display: grid;
        grid-template-columns: repeat(6, 1fr);
        min-height: 64px;
        padding-bottom: env(safe-area-inset-bottom);
        background: rgba(18, 14, 11, 0.97);
        border-top: 1px solid var(--line);
        backdrop-filter: blur(12px);
    }
    .mobile-bottom-nav a, .mobile-bottom-nav button { display: grid; place-items: center; align-content: center; gap: 0.05rem; color: var(--muted); background: none; border: 0; font-size: 1rem; }
    .mobile-bottom-nav small { font-size: 0.54rem; }
    .mobile-bottom-nav .is-active { color: var(--gold-light); background: linear-gradient(0deg, rgba(125, 37, 26, 0.4), transparent); }
    .hero-panel { min-height: 380px; flex-direction: column; align-items: flex-start; justify-content: flex-end; }
    .hero-panel::before { background: linear-gradient(0deg, rgba(14, 9, 6, 0.97) 0%, rgba(17, 11, 7, 0.68) 70%, rgba(17, 11, 7, 0.24) 100%); }
    .next-event-card { max-width: 100%; }
    .trade-grid { grid-template-columns: 1fr; }
    .arena-explainer { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 760px) {
    .auth-shell { grid-template-columns: 1fr; }
    .auth-visual { min-height: 310px; padding: 1.4rem; }
    .auth-pitch h1 { font-size: 2.35rem; }
    .auth-pitch p:last-child { display: none; }
    .brand-lockup-large strong { font-size: 1.35rem; }
    .auth-main { min-height: calc(100vh - 310px); padding: 1.4rem 1rem 2.5rem; }
    .page-header { align-items: stretch; flex-direction: column; }
    .page-header > form .button { width: 100%; }
    .header-stat { min-width: 0; text-align: left; }
    .summary-grid, .market-meta { grid-template-columns: 1fr 1fr; }
    .roster-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .gladiator-grid, .market-grid { grid-template-columns: 1fr; }
    .program-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .active-job-grid, .training-blocker-grid { grid-template-columns: 1fr; }
    .facility-card { grid-template-columns: 145px 1fr; }
    .facility-art { min-height: 330px; }
    .construction-banner { grid-template-columns: 58px 1fr; }
    .construction-banner img { width: 58px; height: 52px; }
    .construction-banner .progress { grid-column: 1/-1; }
    .settings-stat-grid { grid-template-columns: 1fr 1fr; }
    .capacity-banner { grid-template-columns: 1fr; gap: 0.8rem; }
    .responsive-table-wrap { border-radius: var(--radius); }
    .data-table { min-width: 920px; }
}

@media (max-width: 520px) {
    body { font-size: 14px; }
    .auth-visual { min-height: 265px; }
    .auth-pitch h1 { font-size: 1.85rem; }
    .auth-main { min-height: calc(100vh - 265px); }
    .form-grid-two, .inline-form { grid-template-columns: 1fr; }
    .summary-grid { grid-template-columns: 1fr; }
    .summary-card { min-height: 86px; }
    .hero-panel { min-height: 420px; padding: 1rem; background-position: 58% center; }
    .hero-actions .button { flex: 1; }
    .roster-row { grid-template-columns: 1fr 1fr; }
    .roster-mini-card:nth-child(n+5) { display: none; }
    .facility-mini-grid { grid-template-columns: 1fr; }
    .program-grid { grid-template-columns: 1fr; }
    .training-rule-banner { align-items: flex-start; flex-direction: column; gap: 0.3rem; }
    .training-blocker-card { grid-template-columns: 54px minmax(0, 1fr); }
    .training-blocker-card img { width: 54px; height: 64px; }
    .training-blocker-card .button { grid-column: 1 / -1; }
    .program-card > p { min-height: 0; }
    .facility-card { grid-template-columns: 1fr; }
    .facility-art { height: 185px; min-height: 0; }
    .facility-art::after { background: linear-gradient(0deg, #241a13 0%, transparent 72%); }
    .effect-comparison { grid-template-columns: 1fr; }
    .effect-comparison > span { transform: rotate(90deg); text-align: center; }
    .market-meta { grid-template-columns: 1fr; }
    .trade-card { grid-template-columns: 60px 1fr; }
    .trade-house-mark { min-height: 300px; }
    .trade-house-mark span { width: 42px; height: 42px; font-size: 1.3rem; }
    .trade-exchange { grid-template-columns: 1fr; }
    .settings-stat-grid { grid-template-columns: 1fr 1fr; }
    .mobile-bottom-nav small { font-size: 0.49rem; }
    .mobile-bottom-nav { min-height: 61px; }
    .toast-stack { right: 0.6rem; bottom: 4.8rem; width: calc(100vw - 1.2rem); }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* Ludus View ------------------------------------------------------------- */
.ludus-page-header { align-items: flex-end; }
.ludus-header-meta { display: grid; min-width: min(100%, 430px); grid-template-columns: repeat(3, minmax(0, 1fr)); overflow: hidden; background: rgba(26, 19, 14, .92); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.ludus-header-meta span { display: grid; padding: .72rem .85rem; border-left: 1px solid var(--line-soft); }
.ludus-header-meta span:first-child { border-left: 0; }
.ludus-header-meta small { color: var(--muted); font-size: .6rem; text-transform: uppercase; }
.ludus-header-meta strong { overflow: hidden; color: var(--gold-light); font-size: .78rem; text-overflow: ellipsis; white-space: nowrap; }
.ludus-view-panel { padding: 0; overflow: hidden; }
.ludus-view-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.15rem; background: linear-gradient(90deg, rgba(47, 34, 24, .96), rgba(28, 21, 16, .98)); border-bottom: 1px solid var(--line); }
.ludus-view-toolbar h2, .ludus-view-toolbar p { margin-bottom: 0; }
.ludus-view-toolbar > div:first-child > p:last-child { max-width: 760px; color: var(--muted); font-size: .72rem; }
.ludus-view-controls { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .45rem; }
.button-small { min-height: 34px; padding: .45rem .65rem; font-size: .66rem; }
.ludus-stage { position: relative; width: 100%; aspect-ratio: 16 / 9; min-height: 480px; overflow: hidden; isolation: isolate; background: #16100b; user-select: none; }
.ludus-stage-art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ludus-stage-light { position: absolute; inset: 0; z-index: 1; pointer-events: none; background: linear-gradient(180deg, rgba(255, 218, 145, .07), transparent 35%, rgba(12, 7, 4, .18)), radial-gradient(circle at 52% 42%, transparent 0 42%, rgba(8, 4, 2, .2) 100%); }
.ludus-hotspot { position: absolute; z-index: 12; display: grid; min-width: 98px; padding: .35rem .55rem; color: #f6dfad; text-align: center; transform: translate(-50%, -50%); background: rgba(19, 14, 10, .96); border: 1px solid rgba(217, 171, 89, .72); border-radius: 4px; box-shadow: 0 5px 14px rgba(0, 0, 0, .52); }
.ludus-hotspot:hover { z-index: 95; color: #fff0c8; border-color: var(--ludus-accent-soft); transform: translate(-50%, -52%) scale(1.03); }
.ludus-hotspot strong { font-family: Georgia, serif; font-size: .67rem; letter-spacing: .04em; text-transform: uppercase; }
.ludus-hotspot span { color: #d8c19b; font-size: .54rem; }
.ludus-hotspot.status-upgrading { border-color: #78a4c0; }
.ludus-actor { position: absolute; z-index: 30; width: 78px; height: 92px; color: #fff1ca; text-align: center; transform: translate(-50%, -63%); transition-property: left, top; transition-timing-function: linear; will-change: left, top; }
.ludus-actor:hover, .ludus-actor:focus-visible { z-index: 100 !important; color: #fff5d6; }
.ludus-actor-shadow { position: absolute; left: 50%; bottom: 12px; width: 48px; height: 13px; transform: translateX(-50%); background: rgba(0, 0, 0, .5); border-radius: 50%; filter: blur(2px); }
.ludus-actor-motion { position: absolute; left: 50%; bottom: 17px; width: 58px; height: 70px; transform: translateX(-50%); transform-origin: center bottom; }
.ludus-actor-avatar { position: absolute; inset: 0; display: block; overflow: hidden; background: #24170f; border: 3px solid #c58d43; border-radius: 42% 42% 48% 48% / 34% 34% 58% 58%; box-shadow: 0 5px 12px rgba(0, 0, 0, .66), inset 0 0 0 1px rgba(255, 226, 166, .25); }
.ludus-actor-avatar::after { position: absolute; inset: 0; content: ""; pointer-events: none; background: linear-gradient(180deg, rgba(255,255,255,.08), transparent 38%, rgba(25,12,5,.16)); }
.ludus-actor-avatar img { width: 100%; height: 100%; object-fit: cover; object-position: center 18%; }
.ludus-actor.kind-staff .ludus-actor-avatar { border-width: 4px; }
.ludus-actor.role-doctore .ludus-actor-avatar { border-color: #d5a44e; box-shadow: 0 5px 13px rgba(0,0,0,.68), 0 0 0 2px rgba(126, 47, 25, .72); }
.ludus-actor.role-medicus .ludus-actor-avatar { border-color: #9cb887; box-shadow: 0 5px 13px rgba(0,0,0,.68), 0 0 0 2px rgba(47, 93, 73, .74); }
.ludus-staff-badge { position: absolute; right: -5px; bottom: -5px; z-index: 5; display: grid; place-items: center; width: 22px; height: 22px; color: #1a1009; font-family: Georgia, serif; font-size: .66rem; font-weight: 900; background: #dfb45f; border: 2px solid #2a190e; border-radius: 50%; box-shadow: 0 2px 6px rgba(0,0,0,.58); }
.role-medicus .ludus-staff-badge { background: #a9c79a; }
.ludus-actor.is-facing-left .ludus-actor-motion { transform: translateX(-50%) rotate(-1deg); }
.ludus-actor-name { position: absolute; bottom: -2px; left: 50%; display: none; min-width: 104px; padding: .27rem .4rem; transform: translateX(-50%); background: rgba(18, 12, 8, .92); border: 1px solid rgba(215, 169, 87, .62); border-radius: 4px; box-shadow: 0 4px 12px rgba(0, 0, 0, .42); }
.ludus-actor-name strong, .ludus-actor-name small { display: block; white-space: nowrap; }
.ludus-actor-name strong { font-size: .62rem; }
.ludus-actor-name small { color: #d1bb96; font-size: .49rem; }
.ludus-actor:hover .ludus-actor-name, .ludus-actor:focus-visible .ludus-actor-name { display: block; }
.ludus-speech { position: absolute; z-index: 8; right: 50%; bottom: 86px; width: max-content; max-width: 155px; padding: .38rem .5rem; color: var(--ludus-bubble-text); font-size: .61rem; font-weight: 750; line-height: 1.25; text-align: left; transform: translateX(50%) translateY(7px) scale(.95); transform-origin: center bottom; visibility: hidden; opacity: 0; background: var(--ludus-bubble); border: 1px solid rgba(89, 55, 27, .62); border-radius: 7px; box-shadow: 0 5px 15px rgba(0, 0, 0, .38); transition: opacity .16s ease, transform .16s ease, visibility .16s; }
.ludus-speech::after { position: absolute; bottom: -7px; left: 50%; width: 13px; height: 13px; content: ""; transform: translateX(-50%) rotate(45deg); background: var(--ludus-bubble); border-right: 1px solid rgba(89, 55, 27, .62); border-bottom: 1px solid rgba(89, 55, 27, .62); }
.ludus-speech.is-visible { visibility: visible; opacity: 1; transform: translateX(50%) translateY(0) scale(1); }
.ludus-actor.is-performing.activity-sparring .ludus-actor-motion,
.ludus-actor.is-performing.activity-training_defense .ludus-actor-motion { animation: ludus-spar .8s ease-in-out infinite alternate; }
.ludus-actor.is-performing.activity-training_strength .ludus-actor-motion { animation: ludus-lift 1s ease-in-out infinite; }
.ludus-actor.is-performing.activity-training_agility .ludus-actor-motion,
.ludus-actor.is-performing.activity-training_endurance .ludus-actor-motion { animation: ludus-run .55s ease-in-out infinite alternate; }
.ludus-actor.is-performing.activity-injured .ludus-actor-motion,
.ludus-actor.is-performing.activity-resting .ludus-actor-motion { animation: ludus-rest 2.2s ease-in-out infinite; }
.ludus-actor.is-performing.activity-doctore_instructing .ludus-actor-motion { animation: ludus-spar 1.15s ease-in-out infinite alternate; }
.ludus-actor.is-performing.activity-medicus_tending .ludus-actor-motion { animation: ludus-rest 2.4s ease-in-out infinite; }
.ludus-stage.is-paused .ludus-actor { transition-duration: 0s !important; }
.ludus-stage.is-paused .ludus-actor-motion { animation-play-state: paused !important; }
@keyframes ludus-spar { from { transform: rotate(-4deg) translateX(-2px); } to { transform: rotate(5deg) translateX(3px); } }
@keyframes ludus-lift { 0%, 100% { transform: translateY(0); } 45% { transform: translateY(-7px); } 60% { transform: translateY(-5px); } }
@keyframes ludus-run { from { transform: translateY(0) rotate(-2deg); } to { transform: translateY(-4px) rotate(2deg); } }
@keyframes ludus-rest { 0%, 100% { transform: rotate(-1deg) translateY(1px); } 50% { transform: rotate(1deg) translateY(3px); } }
.ludus-stage-caption { display: flex; flex-wrap: wrap; gap: .55rem 1.2rem; padding: .65rem 1rem; color: var(--muted); background: #1b1511; border-top: 1px solid var(--line-soft); font-size: .62rem; }
.ludus-stage-caption b { color: var(--gold-light); }
.ludus-lower-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(320px, .75fr); gap: 1rem; margin-top: 1rem; }
.ludus-lower-grid .section-panel { margin-bottom: 0; }
.ludus-activity-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .45rem; }
.ludus-activity-grid a { display: grid; grid-template-columns: 42px 1fr 10px; align-items: center; gap: .6rem; min-width: 0; padding: .45rem; color: var(--text); background: rgba(8, 6, 4, .22); border: 1px solid var(--line-soft); border-radius: 7px; }
.ludus-activity-grid a:hover { color: var(--text); border-color: var(--gold-dark); }
.ludus-activity-grid img { width: 42px; height: 42px; object-fit: cover; object-position: center 18%; border-radius: 6px; }
.ludus-activity-grid span { display: grid; min-width: 0; }
.ludus-activity-grid strong, .ludus-activity-grid small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ludus-activity-grid small { color: var(--muted); font-size: .61rem; }
.ludus-activity-grid .status-dot { position: static; width: 8px; height: 8px; }
.ludus-tier-panel > p { color: var(--muted); font-size: .7rem; }
.tier-progress-list { display: grid; gap: .45rem; margin: .8rem 0; }
.tier-progress-list article { display: grid; grid-template-columns: 70px 1fr; gap: .1rem .65rem; padding: .58rem .65rem; background: rgba(7, 5, 4, .2); border: 1px solid var(--line-soft); border-radius: 7px; }
.tier-progress-list article.is-active { background: rgba(120, 65, 26, .25); border-color: var(--gold); }
.tier-progress-list span { grid-row: 1 / 3; align-self: center; color: var(--gold); font-size: .58rem; font-weight: 750; text-transform: uppercase; }
.tier-progress-list strong { font-size: .72rem; }
.tier-progress-list small { color: var(--muted); font-size: .58rem; }
@media (max-width: 1050px) {
    .ludus-stage { min-height: 420px; }
    .ludus-lower-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
    .ludus-page-header { align-items: stretch; }
    .ludus-header-meta { min-width: 0; }
    .ludus-view-toolbar { align-items: stretch; flex-direction: column; }
    .ludus-view-controls { justify-content: flex-start; }
    .ludus-stage { min-height: 0; aspect-ratio: 4 / 3; }
    .ludus-stage-art { object-position: center; }
    .ludus-hotspot { min-width: 76px; padding: .25rem .35rem; }
    .ludus-hotspot strong { font-size: .52rem; }
    .ludus-hotspot span { font-size: .44rem; }
    .ludus-actor { width: 64px; height: 78px; transform: translate(-50%, -60%) scale(.86); }
    .ludus-speech { max-width: 130px; font-size: .55rem; }
    .ludus-activity-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
    .ludus-header-meta { grid-template-columns: 1fr; }
    .ludus-header-meta span { border-top: 1px solid var(--line-soft); border-left: 0; }
    .ludus-header-meta span:first-child { border-top: 0; }
    .ludus-stage { aspect-ratio: 1 / 1; }
    .ludus-stage-art { width: 134%; max-width: none; left: -17%; }
    .ludus-hotspot { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    .ludus-actor, .ludus-actor-motion, .ludus-speech { transition: none !important; animation: none !important; }
}

/* Arena calendar and opt-in entry ---------------------------------------- */
.next-arena-event { margin-bottom: 1rem; overflow: hidden; }
.next-arena-banner { position: relative; display: flex; min-height: 225px; align-items: flex-end; justify-content: space-between; gap: 1.2rem; padding: clamp(1.1rem, 3vw, 2rem); overflow: hidden; background: radial-gradient(circle at 82% 18%, rgba(209, 151, 58, .26), transparent 34%), linear-gradient(120deg, rgba(21, 14, 9, .96), rgba(50, 28, 18, .88)), url('../img/ludus-panorama.svg') center 43% / cover; border-bottom: 1px solid var(--line); }
.next-arena-banner::before { position: absolute; inset: 0; content: ""; background: linear-gradient(90deg, rgba(13, 9, 6, .9), rgba(13, 9, 6, .32)); }
.next-arena-banner > * { position: relative; z-index: 1; }
.next-arena-banner > div:first-child { max-width: 760px; }
.next-arena-banner h2 { margin-bottom: .4rem; color: #fff0c7; font-size: clamp(1.5rem, 3vw, 2.35rem); }
.next-arena-banner p:not(.eyebrow) { color: #e4d0ad; }
.event-sponsor { display: inline-block; padding: .28rem .5rem; color: var(--gold-light); background: rgba(0, 0, 0, .35); border: 1px solid rgba(213, 164, 78, .45); border-radius: 999px; font-size: .62rem; }
.arena-countdown-stack { display: grid; min-width: 210px; gap: .5rem; }
.arena-countdown-stack span { display: grid; padding: .6rem .75rem; background: rgba(12, 8, 5, .78); border: 1px solid rgba(213, 164, 78, .45); border-radius: 7px; }
.arena-countdown-stack small { color: var(--muted); font-size: .57rem; text-transform: uppercase; }
.arena-countdown-stack strong { color: var(--gold-light); font-size: .92rem; }
.next-arena-body { padding: 1rem; }
.arena-reward-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .55rem; margin-bottom: 1rem; }
.arena-reward-grid > div { display: grid; padding: .7rem; background: rgba(7, 5, 4, .22); border: 1px solid var(--line-soft); border-radius: 7px; }
.arena-reward-grid small { color: var(--muted); font-size: .58rem; text-transform: uppercase; }
.arena-reward-grid strong { color: var(--gold-light); }
.decision-entered { color: var(--green-light) !important; }
.decision-declined, .decision-withdrawn, .decision-missed { color: var(--muted) !important; }
.decision-pending { color: var(--gold-light) !important; }
.entered-gladiator-card { display: flex; align-items: center; gap: .8rem; margin-bottom: .8rem; padding: .7rem; background: rgba(45, 68, 37, .2); border: 1px solid rgba(104, 157, 83, .42); border-radius: 8px; }
.entered-gladiator-card img { width: 62px; height: 62px; flex: 0 0 62px; object-fit: cover; object-position: center 18%; border-radius: 7px; }
.entered-gladiator-card > div { display: grid; min-width: 0; flex: 1; }
.entered-gladiator-card small, .entered-gladiator-card span { color: var(--muted); font-size: .64rem; }
.entered-gladiator-card strong { color: var(--green-light); }
.arena-decision-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(260px, .65fr); gap: .75rem; align-items: end; }
.arena-entry-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .55rem; align-items: end; }
.arena-entry-form .form-help { grid-column: 1 / -1; }
.form-help { margin: .25rem 0 0; color: var(--muted); font-size: .6rem; }
.event-notice { display: grid; gap: .15rem; padding: .8rem; background: rgba(0, 0, 0, .2); border: 1px solid var(--line-soft); border-radius: 7px; }
.event-notice span { color: var(--muted); font-size: .68rem; }
.arena-calendar-panel { margin-top: 1rem; }
.arena-calendar-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .7rem; }
.arena-calendar-card { display: grid; min-height: 215px; align-content: start; padding: .8rem; background: linear-gradient(155deg, rgba(43, 31, 22, .9), rgba(25, 19, 15, .96)); border: 1px solid var(--line-soft); border-radius: 9px; }
.arena-calendar-card.is-next { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(213, 164, 78, .08); }
.arena-calendar-card > div { display: flex; justify-content: space-between; gap: .4rem; }
.event-type-chip, .decision-chip { display: inline-block; padding: .2rem .38rem; background: rgba(0, 0, 0, .28); border: 1px solid var(--line-soft); border-radius: 999px; font-size: .52rem; text-transform: uppercase; }
.arena-calendar-card h3 { margin: .65rem 0 .15rem; font-size: .9rem; }
.arena-calendar-card > p { margin-bottom: .45rem; color: var(--gold); font-size: .62rem; }
.arena-calendar-card > span { color: var(--muted); font-size: .64rem; }
.arena-calendar-card footer { display: flex; justify-content: space-between; gap: .4rem; margin-top: auto; padding-top: .7rem; border-top: 1px solid var(--line-soft); }
.arena-calendar-card footer b { color: var(--green-light); font-size: .58rem; }
.arena-calendar-card footer time { color: var(--gold-light); font-size: .58rem; }
.arena-results-panel { margin-top: 1rem; }
.table-heading { padding: 1rem 1rem 0; }
@media (max-width: 1150px) {
    .arena-calendar-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .arena-reward-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
    .next-arena-banner { align-items: stretch; flex-direction: column; }
    .arena-countdown-stack { min-width: 0; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .arena-decision-grid, .arena-entry-form { grid-template-columns: 1fr; }
    .arena-entry-form .form-help { grid-column: auto; }
    .entered-gladiator-card { align-items: flex-start; flex-wrap: wrap; }
    .entered-gladiator-card form { width: 100%; }
    .entered-gladiator-card form .button { width: 100%; }
}
@media (max-width: 520px) {
    .arena-calendar-grid, .arena-reward-grid, .arena-countdown-stack { grid-template-columns: 1fr; }
}

/* Arena roster reservation state */
.arena-reserved-badge {
    position: absolute;
    left: 12px;
    bottom: 12px;
    z-index: 3;
    padding: 5px 8px;
    border: 1px solid rgba(231, 180, 82, .72);
    border-radius: 999px;
    background: rgba(28, 17, 10, .88);
    color: #f0c875;
    font-size: .67rem;
    font-weight: 800;
    letter-spacing: .055em;
    text-transform: uppercase;
    box-shadow: 0 5px 14px rgba(0, 0, 0, .32);
}
.compact-alert { margin: 12px 0; padding: 10px 12px; font-size: .82rem; }

/* Pluggable art-theme selector */
.art-theme-choice-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }
.art-theme-choice { position: relative; display: grid; grid-template-rows: 118px auto; overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius); background: rgba(255,255,255,.025); cursor: pointer; transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease; }
.art-theme-choice:hover { transform: translateY(-2px); border-color: rgba(217,171,89,.6); }
.art-theme-choice.is-selected, .art-theme-choice:has(input:checked) { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(217,171,89,.12), 0 14px 30px rgba(0,0,0,.2); }
.art-theme-choice input { position: absolute; inset: 10px 10px auto auto; z-index: 2; width: 18px; height: 18px; accent-color: var(--gold); }
.art-theme-choice img { width: 100%; height: 118px; object-fit: cover; filter: saturate(.9) contrast(1.03); }
.art-theme-choice > span { display: grid; gap: 5px; padding: 12px 13px 14px; }
.art-theme-choice strong { color: var(--text); }
.art-theme-choice small { color: var(--muted); line-height: 1.45; }
.ludus-actor-layer { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.ludus-actor-layer .ludus-actor { pointer-events: auto; }
@media (max-width: 480px) {
    .ludus-actor:nth-of-type(n+10) { display: none; }
}
.next-event-card { color: var(--text); text-decoration: none; }
.next-event-card:hover { color: var(--text); border-color: var(--gold-light); transform: translateY(-1px); }

/* Gladiator dossiers and responsive high-resolution portrait browser */
.page-header-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .65rem; }
.gladiator-browser { display: grid; grid-template-columns: minmax(285px, 330px) minmax(0, 1fr); gap: 1rem; align-items: start; }
.gladiator-roster-panel { position: sticky; top: calc(var(--topbar-height) + 1rem); max-height: calc(100vh - var(--topbar-height) - 2rem); padding: .85rem; overflow: hidden; }
.roster-browser-heading { display: flex; align-items: center; justify-content: space-between; margin: -.1rem 0 .7rem; padding: .15rem .2rem .65rem; border-bottom: 1px solid var(--line-soft); }
.roster-browser-heading > div { display: flex; align-items: baseline; justify-content: space-between; width: 100%; gap: 1rem; }
.roster-browser-heading span { color: var(--gold-light); font: 700 1rem Georgia, serif; }
.roster-browser-heading strong { color: var(--muted); font-size: .68rem; text-transform: uppercase; }
.roster-browser-filters { display: grid; grid-template-columns: minmax(0, 1fr) 118px; gap: .55rem; margin-bottom: .7rem; }
.compact-field { display: grid; min-width: 0; gap: .24rem; }
.compact-field > span { color: var(--muted); font-size: .58rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.compact-field input, .compact-field select { min-height: 38px; padding: .52rem .6rem; font-size: .74rem; }
.gladiator-roster-list { display: grid; max-height: calc(100vh - var(--topbar-height) - 172px); gap: .45rem; padding-right: .25rem; overflow-x: hidden; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--gold-dark) rgba(0,0,0,.2); }
.gladiator-roster-item { display: grid; width: 100%; grid-template-columns: 62px minmax(0, 1fr); align-items: center; gap: .65rem; padding: .48rem; color: var(--text); background: rgba(8, 6, 5, .28); border: 1px solid var(--line-soft); border-radius: 8px; cursor: pointer; text-align: left; transition: border-color .16s ease, background .16s ease, transform .16s ease; }
.gladiator-roster-item:hover { background: rgba(77, 54, 31, .28); border-color: rgba(213,164,78,.52); }
.gladiator-roster-item.is-active { background: linear-gradient(135deg, rgba(126, 58, 30, .38), rgba(72, 47, 26, .28)); border-color: var(--gold); box-shadow: inset 3px 0 0 var(--gold); }
.gladiator-roster-item[hidden] { display: none; }
.gladiator-roster-item img { width: 62px; height: 77px; object-fit: cover; background: #1d150f; border: 1px solid rgba(222,177,91,.28); border-radius: 6px; }
.roster-item-copy { display: grid; min-width: 0; gap: .16rem; }
.roster-item-copy > span:not(.roster-item-title) { overflow: hidden; color: var(--muted); font-size: .64rem; text-overflow: ellipsis; white-space: nowrap; }
.roster-item-title { display: flex; min-width: 0; align-items: center; justify-content: space-between; gap: .4rem; }
.roster-item-title strong { overflow: hidden; color: var(--gold-light); font-size: .82rem; text-overflow: ellipsis; white-space: nowrap; }
.roster-item-title .status-badge { flex: 0 0 auto; padding: .12rem .3rem; font-size: .48rem; }
.roster-item-condition { display: flex !important; justify-content: space-between; gap: .45rem; color: var(--text-soft) !important; }
.empty-filter-message { margin: .8rem .25rem .2rem; color: var(--muted); font-size: .72rem; text-align: center; }
.gladiator-dossier-stage { min-width: 0; }
.gladiator-dossier { min-width: 0; overflow: hidden; }
.gladiator-dossier[hidden] { display: none; }
.gladiator-dossier-hero { display: grid; grid-template-columns: minmax(260px, 350px) minmax(0, 1fr); min-height: 430px; background: radial-gradient(circle at 18% 12%, rgba(181,116,49,.2), transparent 38%), linear-gradient(145deg, rgba(48,37,28,.98), rgba(22,17,13,.98)); border-bottom: 1px solid var(--line); }
.dossier-portrait-frame { position: relative; min-height: 430px; margin: 0; overflow: hidden; background: #17110d; border-right: 1px solid var(--line); }
.dossier-portrait-frame::after { position: absolute; inset: auto 0 0; height: 24%; content: ""; pointer-events: none; background: linear-gradient(transparent, rgba(17,12,9,.86)); }
.dossier-portrait-frame img { width: 100%; height: 100%; min-height: 430px; object-fit: cover; image-rendering: auto; filter: saturate(.98) contrast(1.025); }
.dossier-portrait-frame figcaption { position: absolute; right: .9rem; bottom: .8rem; left: .9rem; z-index: 2; display: flex; align-items: flex-end; justify-content: space-between; gap: .8rem; }
.dossier-portrait-frame figcaption span { color: var(--text-soft); font-size: .68rem; font-weight: 750; text-transform: uppercase; }
.dossier-portrait-frame figcaption strong { color: var(--gold-light); font: 700 1rem Georgia, serif; }
.dossier-hero-copy { display: flex; min-width: 0; flex-direction: column; justify-content: center; padding: clamp(1.1rem, 2.4vw, 2rem); }
.dossier-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.dossier-title-row h2 { margin: 0; color: #f5deb0; font-size: clamp(1.8rem, 3vw, 2.8rem); }
.dossier-title-row .status-badge { margin-top: .3rem; }
.dossier-role-description { max-width: 700px; margin: .55rem 0 1rem; }
.dossier-headline-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .55rem; }
.dossier-headline-stats > div { display: grid; min-width: 0; gap: .15rem; padding: .65rem .7rem; background: rgba(0,0,0,.2); border: 1px solid var(--line-soft); border-radius: 7px; }
.dossier-headline-stats span { display: flex; align-items: center; gap: .3rem; color: var(--muted); font-size: .58rem; text-transform: uppercase; }
.dossier-headline-stats strong { display: flex; align-items: center; gap: .25rem; color: var(--gold-light); font-size: 1rem; white-space: nowrap; }
.xp-progress-block { display: grid; gap: .35rem; margin-top: .75rem; }
.xp-progress-block > div:first-child { display: flex; justify-content: space-between; gap: 1rem; color: var(--muted); font-size: .67rem; }
.xp-progress-block > div:first-child span { display: flex; align-items: center; gap: .3rem; }
.xp-progress-block strong { color: var(--text-soft); }
.dossier-quick-links { display: flex; flex-wrap: wrap; gap: .55rem; margin-top: 1rem; }
.dossier-tabs { display: flex; min-width: 0; padding: 0 .75rem; overflow-x: auto; background: rgba(12,9,7,.64); border-bottom: 1px solid var(--line); scrollbar-width: thin; }
.dossier-tab { min-height: 48px; padding: .7rem .9rem; color: var(--muted); background: transparent; border: 0; border-bottom: 2px solid transparent; cursor: pointer; font-size: .72rem; font-weight: 800; white-space: nowrap; }
.dossier-tab:hover { color: var(--text); }
.dossier-tab.is-active { color: var(--gold-light); border-bottom-color: var(--gold); }
.dossier-panel { padding: clamp(.9rem, 2vw, 1.25rem); }
.dossier-panel[hidden] { display: none; }
.dossier-overview-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .85rem; }
.dossier-section { min-width: 0; padding: .9rem; background: rgba(8,6,5,.2); border: 1px solid var(--line-soft); border-radius: 9px; }
.dossier-section h3 { margin-bottom: .35rem; color: var(--gold-light); font-size: 1rem; }
.dossier-section > p { font-size: .74rem; }
.section-heading-row { display: flex; align-items: baseline; justify-content: space-between; gap: .8rem; margin-bottom: .75rem; }
.section-heading-row h3 { margin: 0; }
.section-heading-row > span { color: var(--muted); font-size: .58rem; text-align: right; text-transform: uppercase; }
.dossier-stat-list { display: grid; gap: .62rem; }
.dossier-stat-row { display: grid; grid-template-columns: minmax(116px, .8fr) minmax(80px, 1.5fr) 38px; align-items: center; gap: .6rem; }
.dossier-stat-label { display: flex; align-items: center; gap: .36rem; color: var(--text-soft); font-size: .72rem; }
.dossier-stat-label > span:first-child { display: inline-grid; width: 21px; height: 21px; place-items: center; color: var(--gold); }
.dossier-stat-meter { height: 6px; overflow: hidden; background: rgba(0,0,0,.45); border-radius: 999px; }
.dossier-stat-meter > span { display: block; height: 100%; background: linear-gradient(90deg, #8b6b30, #d4a74f); border-radius: inherit; }
.dossier-stat-row > strong { color: var(--text); text-align: right; }
.condition-stat-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .55rem; }
.condition-stat-cards article { display: grid; gap: .35rem; padding: .65rem; background: rgba(0,0,0,.2); border: 1px solid var(--line-soft); border-radius: 7px; }
.condition-stat-cards article > span { display: flex; align-items: center; gap: .3rem; color: var(--muted); font-size: .62rem; }
.condition-stat-cards strong { color: var(--text); }
.condition-stat-cards small { color: var(--muted); font-size: .57rem; line-height: 1.35; }
.progress.health > span { background: linear-gradient(90deg, #597d36, #a4c65c); }
.progress.morale > span { background: linear-gradient(90deg, #846120, #d1a746); }
.progress.fatigue > span { background: linear-gradient(90deg, #a14526, #d87b3d); }
.recovery-breakdown-card { background: linear-gradient(145deg, rgba(75,50,25,.25), rgba(8,6,5,.2)); }
.recovery-breakdown { display: grid; margin: 0; gap: .45rem; }
.recovery-breakdown > div { display: grid; grid-template-columns: minmax(115px, .48fr) minmax(0, 1fr); gap: .8rem; padding: .45rem 0; border-bottom: 1px solid var(--line-soft); }
.recovery-breakdown > div:last-child { border-bottom: 0; }
.recovery-breakdown dt { color: var(--muted); font-size: .65rem; }
.recovery-breakdown dd { margin: 0; color: var(--text-soft); font-size: .68rem; text-align: right; }
.recovery-breakdown dd strong { color: var(--gold-light); }
.appearance-chip-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .45rem; }
.appearance-chip-grid > span { display: grid; min-width: 0; gap: .15rem; padding: .52rem .58rem; color: var(--text-soft); background: rgba(0,0,0,.18); border: 1px solid var(--line-soft); border-radius: 6px; font-size: .68rem; }
.appearance-chip-grid small { color: var(--muted); font-size: .52rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.career-summary-section { grid-column: 1 / -1; }
.career-summary-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); margin: 0; gap: .5rem; }
.career-summary-grid > div { display: grid; min-width: 0; gap: .2rem; padding: .58rem; background: rgba(0,0,0,.18); border: 1px solid var(--line-soft); border-radius: 7px; }
.career-summary-grid dt { color: var(--muted); font-size: .55rem; text-transform: uppercase; }
.career-summary-grid dd { display: flex; min-width: 0; align-items: center; gap: .25rem; margin: 0; overflow: hidden; color: var(--text); font-size: .72rem; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.history-panel-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: .85rem; }
.history-panel-heading h3 { margin: 0; color: var(--gold-light); font-size: 1.15rem; }
.history-panel-heading strong { color: var(--text-soft); font-size: .72rem; }
.dossier-history-list { display: grid; gap: .55rem; }
.dossier-history-item { display: grid; grid-template-columns: 42px minmax(0, 1fr) minmax(170px, auto); align-items: center; gap: .75rem; padding: .7rem; background: rgba(0,0,0,.2); border: 1px solid var(--line-soft); border-radius: 8px; }
.history-item-icon, .fight-result-mark { display: inline-grid; width: 42px; height: 42px; place-items: center; color: var(--gold-light); background: rgba(104,67,29,.35); border: 1px solid var(--line); border-radius: 50%; font-weight: 900; }
.history-item-main { display: grid; min-width: 0; gap: .18rem; }
.history-item-main > span { overflow: hidden; color: var(--muted); font-size: .62rem; text-overflow: ellipsis; white-space: nowrap; }
.history-item-title-row { display: flex; align-items: center; justify-content: space-between; gap: .6rem; }
.history-item-title-row strong { overflow: hidden; color: var(--text); font-size: .76rem; text-overflow: ellipsis; white-space: nowrap; }
.history-status, .fight-outcome { flex: 0 0 auto; padding: .15rem .35rem; border: 1px solid var(--line-soft); border-radius: 999px; color: var(--muted); font-size: .5rem; font-weight: 850; text-transform: uppercase; }
.history-status-completed, .fight-outcome-win { color: var(--green-light); border-color: rgba(127,169,79,.45); }
.history-status-active { color: var(--gold-light); border-color: rgba(213,164,78,.48); }
.history-status-cancelled, .fight-outcome-loss { color: var(--danger); border-color: rgba(213,95,79,.45); }
.history-badge-list { display: flex; max-width: 330px; flex-wrap: wrap; justify-content: flex-end; gap: .3rem; }
.history-gain { padding: .2rem .36rem; color: var(--text-soft); background: rgba(0,0,0,.26); border: 1px solid var(--line-soft); border-radius: 999px; font-size: .53rem; font-weight: 750; white-space: nowrap; }
.history-gain-xp, .history-gain-reputation { color: var(--gold-light); }
.history-gain-gold { color: var(--silver-light); border-color: rgba(190, 198, 207, .35); }
.history-gain-fatigue, .history-gain-damage { color: #efaa78; }
.history-gain-injury { color: var(--danger); }
.fight-result-mark { color: var(--danger); background: rgba(117,35,26,.34); border-color: rgba(183,80,65,.5); }
.outcome-win .fight-result-mark { color: var(--green-light); background: rgba(63,96,34,.34); border-color: rgba(110,152,71,.52); }
.history-empty { display: grid; justify-items: center; min-height: 220px; align-content: center; padding: 1rem; text-align: center; border: 1px dashed var(--line-soft); border-radius: 9px; }
.history-empty strong { color: var(--gold-light); }
.history-empty p { max-width: 460px; margin: .4rem 0 0; font-size: .74rem; }
.management-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .85rem; }
.inline-action-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: .65rem; }
.inline-action-form label { display: grid; gap: .3rem; }
.inline-action-form label > span { color: var(--muted); font-size: .62rem; }
.danger-zone { border-color: rgba(183,80,65,.35); background: rgba(74,22,17,.16); }

/* Accessible tooltip popover used by stat explanations on mouse, keyboard, and touch. */
.info-tip { display: inline-grid; width: 18px; height: 18px; flex: 0 0 18px; place-items: center; padding: 0; color: var(--gold-light); background: rgba(109,73,32,.3); border: 1px solid rgba(213,164,78,.48); border-radius: 50%; cursor: help; font-size: .58rem; font-weight: 900; line-height: 1; }
.info-tip:hover, .info-tip:focus-visible, .info-tip[aria-expanded="true"] { color: #fff1c8; background: rgba(155,99,38,.5); border-color: var(--gold-light); outline: none; }
.app-tooltip { position: fixed; z-index: 10000; width: min(340px, calc(100vw - 24px)); padding: .72rem .8rem; color: var(--text-soft); background: rgba(20,15,11,.98); border: 1px solid var(--gold-dark); border-radius: 8px; box-shadow: 0 18px 45px rgba(0,0,0,.52); pointer-events: none; opacity: 0; transform: translateY(4px); transition: opacity .12s ease, transform .12s ease; }
.app-tooltip.is-visible { opacity: 1; transform: translateY(0); }
.app-tooltip strong { display: block; margin-bottom: .28rem; color: var(--gold-light); font: 700 .82rem Georgia, serif; }
.app-tooltip span { display: block; font-size: .68rem; line-height: 1.55; }

@media (max-width: 1280px) {
    .gladiator-browser { grid-template-columns: 280px minmax(0, 1fr); }
    .dossier-headline-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .condition-stat-cards { grid-template-columns: 1fr; }
    .career-summary-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 980px) {
    .gladiator-browser { grid-template-columns: 1fr; }
    .gladiator-roster-panel { position: static; max-height: none; }
    .gladiator-roster-list { grid-auto-columns: minmax(250px, 290px); grid-auto-flow: column; grid-template-rows: repeat(2, auto); max-height: none; padding: 0 0 .35rem; overflow-x: auto; overflow-y: hidden; }
    .gladiator-roster-item { min-height: 88px; }
    .gladiator-dossier-hero { grid-template-columns: minmax(240px, 315px) minmax(0, 1fr); }
    .dossier-overview-grid { grid-template-columns: 1fr; }
    .career-summary-section { grid-column: auto; }
    .appearance-chip-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
    .gladiator-page-header .page-header-actions, .gladiator-page-header .page-header-actions .button { width: 100%; }
    .gladiator-page-header .page-header-actions { display: grid; grid-template-columns: 1fr 1fr; }
    .roster-browser-filters { grid-template-columns: minmax(0, 1fr) 124px; }
    .gladiator-roster-list { grid-template-rows: 1fr; }
    .gladiator-dossier-hero { grid-template-columns: 1fr; }
    .dossier-portrait-frame { min-height: min(110vw, 560px); border-right: 0; border-bottom: 1px solid var(--line); }
    .dossier-portrait-frame img { min-height: min(110vw, 560px); }
    .dossier-headline-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .appearance-chip-grid, .career-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dossier-history-item { grid-template-columns: 38px minmax(0, 1fr); }
    .history-badge-list { grid-column: 1 / -1; max-width: none; justify-content: flex-start; padding-left: 46px; }
    .management-grid { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
    .gladiator-page-header .page-header-actions { grid-template-columns: 1fr; }
    .roster-browser-filters { grid-template-columns: 1fr; }
    .gladiator-roster-list { grid-auto-columns: minmax(230px, 86vw); }
    .dossier-hero-copy { padding: 1rem; }
    .dossier-title-row { align-items: flex-start; }
    .dossier-title-row h2 { font-size: 2rem; }
    .dossier-headline-stats { grid-template-columns: 1fr 1fr; }
    .dossier-quick-links { display: grid; grid-template-columns: 1fr; }
    .dossier-quick-links .button { width: 100%; }
    .dossier-tabs { padding: 0 .35rem; }
    .dossier-tab { padding-inline: .7rem; }
    .dossier-panel { padding: .7rem; }
    .dossier-section { padding: .72rem; }
    .dossier-stat-row { grid-template-columns: minmax(100px, .85fr) minmax(65px, 1fr) 32px; gap: .42rem; }
    .appearance-chip-grid, .career-summary-grid { grid-template-columns: 1fr; }
    .recovery-breakdown > div { grid-template-columns: 1fr; gap: .18rem; }
    .recovery-breakdown dd { text-align: left; }
    .history-panel-heading { align-items: flex-start; flex-direction: column; }
    .dossier-history-item { padding: .6rem; }
    .history-item-main > span { white-space: normal; }
    .history-item-title-row { align-items: flex-start; flex-direction: column; }
    .history-badge-list { padding-left: 0; }
    .inline-action-form { grid-template-columns: 1fr; }
}

/* Version 1.3: staff, shared arena, aging, and avatar-only ludus actors */
.status-deceased, .status-promoted { opacity: .72; }
.status-dot.status-deceased { background: #6f7074; }
.status-dot.status-promoted, .status-dot.status-working { background: #d2a553; }
.status-badge.status-deceased { color: #d7d7d9; border-color: #707174; background: rgba(61, 62, 65, .45); }
.status-badge.status-promoted { color: #f2d49b; border-color: #9d7338; background: rgba(83, 53, 20, .45); }

.staff-impact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 16px; margin-bottom: 18px; }
.staff-impact-card { display: flex; align-items: center; gap: 18px; padding: 20px; }
.staff-impact-card h2 { margin: 3px 0 6px; font-size: clamp(1.1rem, 2vw, 1.45rem); }
.staff-impact-card p { margin: 0; color: var(--muted); }
.staff-role-icon { display: grid; flex: 0 0 54px; place-items: center; width: 54px; height: 54px; color: #241409; font-family: Georgia, serif; font-size: 1.5rem; font-weight: 900; background: linear-gradient(145deg, #e2b969, #9f6d2c); border: 2px solid #5d3919; border-radius: 50%; box-shadow: 0 6px 16px rgba(0,0,0,.34); }
.medicus-card .staff-role-icon, .staff-role-icon.medicus { background: linear-gradient(145deg, #bdd0aa, #728f6a); border-color: #3e5940; }
.interpres-card .staff-role-icon, .staff-role-icon.interpres { background: linear-gradient(145deg, #c7b4d8, #756385); border-color: #493a58; }
.staff-roster-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(430px, 100%), 1fr)); gap: 18px; margin-bottom: 18px; }
.staff-card { display: grid; grid-template-columns: minmax(190px, .72fr) minmax(0, 1fr); overflow: hidden; min-height: 390px; }
.staff-card.is-vacant { display: grid; place-items: center; padding: 28px; }
.staff-portrait-wrap { position: relative; min-height: 390px; background: #17110d; }
.staff-portrait-wrap img { width: 100%; height: 100%; object-fit: cover; }
.staff-portrait-wrap > span { position: absolute; left: 12px; bottom: 12px; padding: 5px 9px; color: #f4d9a4; font-family: Georgia, serif; text-transform: uppercase; letter-spacing: .08em; background: rgba(19,12,8,.86); border: 1px solid #7d582d; }
.staff-card-body { display: flex; flex-direction: column; gap: 14px; padding: 20px; }
.staff-card-body form { margin-top: auto; }
.staff-detail-list { display: grid; gap: 0; margin: 0; }
.staff-detail-list > div { display: grid; grid-template-columns: minmax(100px, .42fr) minmax(0, 1fr); gap: 12px; padding: 10px 0; border-bottom: 1px solid rgba(215,176,105,.14); }
.staff-detail-list dt { color: var(--muted); }
.staff-detail-list dd { margin: 0; color: var(--text); text-align: right; }
.staff-detail-list.compact > div { padding: 7px 0; }
.staff-vacancy { max-width: 430px; }
.staff-vacancy .staff-role-icon { margin: 0 auto 12px; }
.promotion-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }
.promotion-card { display: grid; grid-template-columns: 64px minmax(0,1fr) auto; align-items: center; gap: 12px; padding: 10px; background: rgba(255,255,255,.025); border: 1px solid rgba(215,176,105,.16); border-radius: 8px; }
.promotion-card img { width: 64px; height: 74px; object-fit: cover; border-radius: 6px; }
.promotion-card strong, .promotion-card small { display: block; }
.promotion-card small { margin-top: 4px; color: var(--muted); }

.market-section { margin-top: 24px; }
.market-section-header { margin-bottom: 12px; }
.market-section-intro { max-width: 880px; color: var(--muted); }
.staff-market-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(430px, 100%), 1fr)); gap: 16px; }
.staff-market-card { display: grid; grid-template-columns: minmax(128px, .7fr) minmax(0, 1.3fr); overflow: hidden; padding: 0; min-height: 320px; }
.staff-market-card > img { width: 100%; height: 100%; min-height: 320px; object-fit: cover; background: #18110c; }
.staff-market-card.role-medicus { border-color: rgba(130,166,120,.42); }
.staff-market-card.role-interpres { border-color: rgba(166,137,190,.45); }
.staff-market-body { display: flex; min-width: 0; flex-direction: column; gap: 12px; padding: 16px 18px; }
.staff-market-body .panel-header { align-items: flex-start; }
.staff-market-body .panel-header > div { min-width: 0; }
.staff-market-body .panel-header h3 { overflow-wrap: anywhere; }
.staff-market-body form { margin-top: auto; }

.staff-card.is-locked { border-style: dashed; opacity: .82; }
.interpres-office { margin-top: 18px; }
.interpres-office-empty { padding-block: 30px; }
.interpres-office-empty .staff-role-icon { margin: 0 auto 12px; }
.interpres-risk-explainer { display:grid; gap:5px; margin:14px 0 18px; padding:12px 14px; border:1px solid rgba(232,194,123,.28); border-radius:7px; background:rgba(151,110,55,.10); }
.interpres-risk-explainer strong { color:#ead6ad; }
.interpres-risk-explainer span { color:var(--text-soft); line-height:1.5; }
.interpres-active-mission { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(280px, .85fr); gap: 18px; margin: 16px 0 20px; padding: 18px; background: rgba(109, 82, 126, .13); border: 1px solid rgba(180, 151, 201, .34); border-radius: 8px; }
.interpres-active-mission h3 { margin: 3px 0 6px; }
.interpres-active-mission p { margin: 0; color: var(--muted); }
.interpres-active-mission__facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.interpres-active-mission__facts > span { padding: 10px; background: rgba(0,0,0,.18); border: 1px solid rgba(215,176,105,.14); border-radius: 6px; }
.interpres-active-mission__facts small, .interpres-active-mission__facts strong { display: block; }
.interpres-active-mission__facts small { color: var(--muted); }
.interpres-mission-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 14px; margin-top: 16px; }
.interpres-mission-card { display: flex; flex-direction: column; gap: 12px; padding: 16px; background: rgba(255,255,255,.025); border: 1px solid rgba(180,151,201,.28); border-radius: 8px; }
.interpres-mission-card.is-disabled { opacity: .68; }
.interpres-mission-card > p { margin: 0; color: var(--muted); }
.interpres-mission-card form { margin-top: auto; }
.interpres-risk-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; margin: 0; }
.interpres-risk-grid > div { padding: 8px 9px; background: rgba(0,0,0,.16); border: 1px solid rgba(215,176,105,.12); border-radius: 5px; }
.interpres-risk-grid dt, .interpres-risk-grid dd { margin: 0; }
.interpres-risk-grid dt { color: var(--muted); font-size: .78rem; }
.interpres-risk-grid dd { margin-top: 2px; font-weight: 700; }
.interpres-risk-grid .is-danger dd, .interpres-active-mission__facts .is-danger strong { color: #e9a79c; }
.interpres-risk-grid .is-warning dd, .interpres-active-mission__facts .is-warning strong { color: #e8c27b; }
.interpres-reward { padding: 10px; background: rgba(111,139,96,.13); border: 1px solid rgba(137,169,121,.26); border-radius: 6px; }
.interpres-reward small, .interpres-reward strong { display: block; }
.interpres-reward small { color: var(--muted); }
.interpres-history { margin-top: 22px; padding-top: 18px; border-top: 1px solid rgba(215,176,105,.16); }
.interpres-history-list { display: grid; gap: 9px; }
.interpres-history-list > article { display: grid; grid-template-columns: minmax(180px,.7fr) minmax(0,1.3fr) auto; gap: 12px; align-items: center; padding: 11px; background: rgba(0,0,0,.13); border: 1px solid rgba(215,176,105,.12); border-radius: 6px; }
.interpres-history-list strong, .interpres-history-list small { display: block; }
.interpres-history-list small, .interpres-history-list p { color: var(--muted); }
.interpres-history-list p { margin: 0; }
.interpres-history-tags { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.tag-warning { color: #efc77c; border-color: rgba(217,166,74,.54); background: rgba(122,82,23,.28); }
.tag-danger { color: #efaaa0; border-color: rgba(199,91,76,.52); background: rgba(115,44,37,.28); }

.event-header-stats { display: flex; flex-wrap: wrap; gap: 8px; }
.event-header-stats span { min-width: 110px; padding: 8px 12px; text-align: right; background: rgba(255,255,255,.025); border: 1px solid rgba(215,176,105,.16); border-radius: 6px; }
.event-header-stats small, .event-header-stats strong { display: block; }
.event-header-stats small { color: var(--muted); }
.tag-gold { color: #f1ca7c; border-color: #9a6b2c; background: rgba(105,67,22,.3); }
.inline-warning { padding: 10px 12px; color: #e7c5a8; background: rgba(119,54,34,.22); border: 1px solid rgba(194,104,73,.36); border-radius: 6px; }

.dashboard-staff-list { display: grid; gap: 9px; }
.dashboard-staff-list > a { display: grid; grid-template-columns: 48px minmax(0,1fr); align-items: center; gap: 10px; padding: 8px; color: inherit; background: rgba(255,255,255,.025); border: 1px solid rgba(216,167,81,.13); border-radius: 6px; }
.dashboard-staff-list img, .staff-placeholder { width: 48px; height: 56px; object-fit: cover; border-radius: 5px; }
.staff-placeholder { display: grid; place-items: center; color: #1f130a; font-family: Georgia, serif; font-size: 1.15rem; font-weight: 900; background: #c99649; }
.staff-placeholder.medicus { background: #8fab85; }
.dashboard-staff-list strong, .dashboard-staff-list small { display: block; }
.dashboard-staff-list small { margin-top: 3px; color: var(--muted); }

.former-roster-panel { margin-top: 18px; }
.former-roster-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(260px,1fr)); gap: 10px; }
.former-gladiator-card { display: grid; grid-template-columns: 60px minmax(0,1fr); align-items: center; gap: 11px; padding: 9px; background: rgba(255,255,255,.02); border: 1px solid rgba(216,167,81,.13); border-radius: 7px; }
.former-gladiator-card.status-deceased { border-color: rgba(116,116,120,.3); filter: saturate(.62); }
.former-gladiator-card img { width: 60px; height: 70px; object-fit: cover; border-radius: 5px; }
.former-gladiator-card strong, .former-gladiator-card span, .former-gladiator-card small { display: block; }
.former-gladiator-card span, .former-gladiator-card small { color: var(--muted); }

@media (max-width: 980px) {
    .staff-roster-grid { grid-template-columns: 1fr; }
    .staff-card { grid-template-columns: minmax(150px,.62fr) minmax(0,1fr); }
    .interpres-active-mission { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
    .staff-impact-grid { grid-template-columns: 1fr; }
    .staff-card, .staff-market-card { grid-template-columns: 1fr; }
    .interpres-history-list > article { grid-template-columns: 1fr; }
    .interpres-history-tags { justify-content: flex-start; }
    .staff-portrait-wrap { min-height: 320px; }
    .staff-market-card > img { height: 320px; min-height: 0; }
    .promotion-card { grid-template-columns: 54px minmax(0,1fr); }
    .promotion-card form { grid-column: 1 / -1; }
}
.fight-result-tags { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }

/* Version 1.4: combat profiles, global exchange, and public leaderboards */
.combat-profile-card { background: linear-gradient(145deg, rgba(116,78,34,.12), rgba(0,0,0,.08)); }
.combat-profile-card .settings-note { margin: 0 0 .75rem; }
.combat-profile-list .dossier-stat-meter span { background: linear-gradient(90deg, #8e572d, #d7aa55); }

.market-disruption-banner { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 18px; margin-bottom: 18px; padding: 18px 20px; border-color: rgba(210,137,64,.55); background: linear-gradient(105deg, rgba(110,48,23,.42), rgba(28,20,14,.92)); }
.market-disruption-banner h2, .market-disruption-banner p { margin: 0; }
.market-disruption-banner h2 { margin-bottom: 4px; color: var(--gold-light); }
.market-disruption-banner > strong { max-width: 170px; color: #efc577; text-align: right; }
.market-disruption-icon { display: grid; width: 58px; height: 58px; place-items: center; background: rgba(0,0,0,.22); border: 1px solid rgba(214,168,84,.34); border-radius: 50%; }
.market-disruption-icon .resource-icon { width: 34px; height: 34px; }

.exchange-rate-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px; margin-bottom: 18px; }
.exchange-rate-card { padding: 18px; }
.exchange-card-heading { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 12px; }
.exchange-card-heading h2 { margin: 1px 0 0; }
.rate-change { padding: 4px 7px; color: var(--muted); background: rgba(255,255,255,.03); border: 1px solid var(--line-soft); border-radius: 999px; font-size: .64rem; font-weight: 800; }
.rate-change.is-up { color: #e8aa79; border-color: rgba(206,119,69,.35); }
.rate-change.is-down { color: var(--green-light); border-color: rgba(116,159,75,.35); }
.exchange-rate-details { display: grid; gap: 0; margin: 15px 0; }
.exchange-rate-details > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid rgba(215,176,105,.13); }
.exchange-rate-details dt { color: var(--muted); }
.exchange-rate-details dd { display: flex; align-items: center; gap: 4px; margin: 0; color: var(--text); font-weight: 750; text-align: right; }
.exchange-action-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
.exchange-action-form { display: grid; gap: 7px; }
.exchange-action-form label { display: grid; gap: 4px; }
.exchange-action-form label > span { color: var(--muted); font-size: .62rem; }

.player-market-layout { display: grid; grid-template-columns: minmax(230px,.34fr) minmax(0,1fr); gap: 18px; align-items: start; }
.trade-form-card { display: grid; gap: 10px; padding: 14px; background: rgba(0,0,0,.18); border: 1px solid var(--line-soft); border-radius: 8px; }
.trade-form-card h3 { margin: 0 0 2px; }
.trade-form-card label { display: grid; gap: 5px; }
.trade-form-card label > span { color: var(--muted); font-size: .65rem; }
.responsive-table { width: 100%; overflow-x: auto; border: 1px solid var(--line-soft); border-radius: 8px; }
.responsive-table table { width: 100%; min-width: 620px; border-collapse: collapse; }
.responsive-table th, .responsive-table td { padding: 11px 12px; text-align: left; border-bottom: 1px solid rgba(215,176,105,.12); }
.responsive-table th { color: var(--muted); background: rgba(0,0,0,.18); font-size: .61rem; text-transform: uppercase; letter-spacing: .055em; }
.responsive-table td { color: var(--text-soft); font-size: .72rem; }
.responsive-table tbody tr:last-child td { border-bottom: 0; }
.responsive-table tbody tr:hover { background: rgba(215,176,105,.035); }
.responsive-table form { margin: 0; }
.table-note { display: block; margin-top: 3px; color: var(--gold); font-size: .56rem; }
.own-offer-history { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line-soft); }
.own-offer-history summary { color: var(--gold-light); cursor: pointer; font-weight: 750; }
.own-offer-history .compact-list { margin-top: 10px; }

.leaderboard-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px; }
.leaderboard-panel { overflow: hidden; padding: 0; }
.leaderboard-panel > .panel-header { padding: 18px 18px 12px; }
.leaderboard-panel .responsive-table { border: 0; border-top: 1px solid var(--line-soft); border-radius: 0; }
.leaderboard-panel table { min-width: 480px; }
.leaderboard-table td:last-child, .leaderboard-table th:last-child { text-align: right; }
.leaderboard-rank { display: inline-grid; width: 28px; height: 28px; place-items: center; color: var(--muted); border: 1px solid var(--line-soft); border-radius: 50%; font-weight: 900; }
.leaderboard-rank.rank-1 { color: #f5d27f; border-color: #b88936; background: rgba(143,94,28,.28); }
.leaderboard-rank.rank-2 { color: #ded9ca; border-color: #85827b; background: rgba(106,104,99,.18); }
.leaderboard-rank.rank-3 { color: #d89b69; border-color: #98613b; background: rgba(116,64,35,.18); }

@media (max-width: 1180px) {
    .exchange-rate-grid { grid-template-columns: 1fr; }
    .exchange-rate-card { display: grid; grid-template-columns: minmax(190px,.62fr) minmax(210px,.72fr) minmax(300px,1fr); align-items: center; gap: 18px; }
    .exchange-rate-details { margin: 0; }
}
@media (max-width: 900px) {
    .player-market-layout, .leaderboard-grid { grid-template-columns: 1fr; }
    .exchange-rate-card { display: block; }
    .exchange-rate-details { margin: 15px 0; }
}
@media (max-width: 620px) {
    .market-disruption-banner { grid-template-columns: auto minmax(0,1fr); }
    .market-disruption-banner > strong { grid-column: 1 / -1; max-width: none; text-align: left; }
    .exchange-action-grid { grid-template-columns: 1fr; }
    .exchange-card-heading { grid-template-columns: auto minmax(0,1fr); }
    .exchange-card-heading .rate-change { grid-column: 2; justify-self: start; }
}

/* Version 1.4 interface refinements -------------------------------------- */
.market-event-banner { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 18px; margin-bottom: 18px; padding: 18px 20px; border-color: rgba(210,137,64,.55); background: linear-gradient(105deg, rgba(110,48,23,.42), rgba(28,20,14,.92)); }
.market-event-banner h2, .market-event-banner p { margin: 0; }
.market-event-banner h2 { margin-bottom: 4px; color: var(--gold-light); }
.market-event-icon { display: grid; width: 58px; height: 58px; place-items: center; background: rgba(0,0,0,.22); border: 1px solid rgba(214,168,84,.34); border-radius: 50%; }
.market-event-icon .resource-icon { width: 34px; height: 34px; }
.market-event-effect { max-width: 190px; color: #efc577; font-size: .72rem; font-weight: 800; text-align: right; }
.exchange-panel { margin-bottom: 18px; }
.exchange-explainer { margin: -.25rem 0 1rem; color: var(--muted); font-size: .72rem; }
.exchange-resource-heading { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 12px; }
.exchange-resource-heading h3 { margin: 0; color: var(--gold-light); }
.exchange-resource-heading > div span { color: var(--muted); font-size: .64rem; }
.exchange-quotes { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; margin: 15px 0; }
.exchange-quotes > div { display: grid; gap: 3px; padding: 10px; background: rgba(0,0,0,.18); border: 1px solid var(--line-soft); border-radius: 7px; }
.exchange-quotes small, .exchange-quotes span { color: var(--muted); font-size: .57rem; }
.exchange-quotes strong { display: flex; align-items: center; gap: 4px; color: var(--text); font-size: .78rem; }
.exchange-rate-card form { display: grid; gap: 7px; }
.exchange-rate-card form label { display: grid; gap: 4px; }
.exchange-rate-card form label > span { color: var(--muted); font-size: .62rem; }
.player-listing-form-card { position: sticky; top: calc(var(--topbar-height) + 1rem); }
.public-listings-card { min-width: 0; }
.public-listings-card > p, .envoy-offers-panel > p { color: var(--muted); font-size: .72rem; }
.market-table { width: 100%; min-width: 760px; border-collapse: collapse; }
.market-table th, .market-table td { padding: 11px 12px; border-bottom: 1px solid rgba(215,176,105,.12); text-align: left; vertical-align: middle; }
.market-table th { color: var(--muted); background: rgba(0,0,0,.18); font-size: .61rem; letter-spacing: .055em; text-transform: uppercase; }
.market-table td { color: var(--text-soft); font-size: .72rem; }
.market-table tbody tr:last-child td { border-bottom: 0; }
.market-table tbody tr:hover { background: rgba(215,176,105,.035); }
.market-table td strong, .market-table td small { display: block; }
.market-table td small { margin-top: 2px; color: var(--gold); font-size: .55rem; }
.market-table td:nth-child(2), .market-table td:nth-child(4) { white-space: nowrap; }
.market-table .resource-icon { vertical-align: middle; }
.market-table .is-own-offer { background: rgba(153,104,42,.08); }
.own-listings-panel, .envoy-offers-panel { margin-top: 18px; }
.compact-list-item > form { margin-left: auto; }

.affinity-tag { display: inline-flex; align-items: center; margin-left: .3rem; padding: .13rem .34rem; color: var(--muted); background: rgba(0,0,0,.2); border: 1px solid var(--line-soft); border-radius: 999px; font-size: .48rem; font-weight: 900; letter-spacing: .04em; line-height: 1.2; text-transform: uppercase; white-space: nowrap; }
.affinity-signature { color: #f3cf78; background: rgba(143,94,28,.22); border-color: rgba(215,165,74,.52); }
.affinity-strong { color: #d8ba80; border-color: rgba(190,145,72,.38); }
.affinity-standard { color: var(--text-soft); }
.affinity-secondary { color: #b8a58c; opacity: .82; }
.style-affinity-note { margin: .7rem 0 0; padding: .65rem .7rem; color: var(--muted); background: rgba(0,0,0,.16); border-left: 3px solid var(--gold-dark); border-radius: 0 6px 6px 0; font-size: .66rem; line-height: 1.5; }
.doctore-preparation-note { display: grid; grid-template-columns: 34px minmax(0,1fr); align-items: center; gap: .65rem; margin-top: .75rem; padding: .7rem; background: linear-gradient(90deg, rgba(120,75,29,.22), rgba(0,0,0,.12)); border: 1px solid rgba(215,176,105,.18); border-radius: 7px; }
.doctore-preparation-note > span { display: grid; width: 34px; height: 34px; place-items: center; color: var(--gold-light); background: rgba(0,0,0,.24); border: 1px solid var(--line); border-radius: 50%; }
.doctore-preparation-note strong, .doctore-preparation-note small { display: block; }
.doctore-preparation-note small { margin-top: .15rem; color: var(--muted); font-size: .62rem; }
.leaderboard-table { width: 100%; border-collapse: collapse; }
.leaderboard-table th, .leaderboard-table td { padding: 12px; border-bottom: 1px solid rgba(215,176,105,.12); text-align: left; vertical-align: middle; }
.leaderboard-table th { color: var(--muted); background: rgba(0,0,0,.18); font-size: .61rem; letter-spacing: .055em; text-transform: uppercase; }
.leaderboard-table td { color: var(--text-soft); font-size: .73rem; }
.leaderboard-table tbody tr:last-child td { border-bottom: 0; }
.leaderboard-table tbody tr:hover { background: rgba(215,176,105,.035); }
.leaderboard-table .leaderboard-rank.rank-1 { color: #f5d27f; border-color: #b88936; background: rgba(143,94,28,.28); }
.leaderboard-table .leaderboard-rank.rank-2 { color: #ded9ca; border-color: #85827b; background: rgba(106,104,99,.18); }
.leaderboard-table .leaderboard-rank.rank-3 { color: #d89b69; border-color: #98613b; background: rgba(116,64,35,.18); }

@media (max-width: 900px) {
    .player-listing-form-card { position: static; }
}
@media (max-width: 620px) {
    .market-event-banner { grid-template-columns: auto minmax(0,1fr); }
    .market-event-effect { grid-column: 1 / -1; max-width: none; text-align: left; }
    .exchange-quotes { grid-template-columns: 1fr; }
    .exchange-resource-heading { grid-template-columns: auto minmax(0,1fr); }
    .exchange-resource-heading .rate-change { grid-column: 2; justify-self: start; }
    .affinity-tag { margin-left: .15rem; font-size: .44rem; }
}


/* Version 1.5: portrait clarity, community, patronage, and arena refinements */
.gladiator-card-portrait::after,
.market-portrait::after,
.ludus-actor-avatar::after,
.dossier-portrait-frame::after {
    display: none !important;
    content: none !important;
    background: none !important;
    backdrop-filter: none !important;
    filter: none !important;
}
.gladiator-card-portrait img,
.market-portrait img,
.ludus-actor-avatar img,
.dossier-portrait-frame img {
    image-rendering: auto;
    filter: none;
    transform: translateZ(0);
}
.dossier-portrait-frame figcaption {
    right: .65rem;
    bottom: .65rem;
    left: .65rem;
    padding: .65rem .75rem;
    background: rgba(12, 9, 7, .86);
    border: 1px solid rgba(216, 167, 81, .28);
    border-radius: 6px;
    box-shadow: 0 5px 18px rgba(0, 0, 0, .34);
}
.market-portrait span {
    right: .55rem;
    bottom: .55rem;
    background: rgba(17, 12, 8, .92);
}
.character-biography,
.staff-biography,
.market-biography {
    margin: .75rem 0 0;
    color: var(--text-soft);
    font-family: Georgia, serif;
    font-size: .72rem;
    line-height: 1.62;
}
.market-biography {
    display: -webkit-box;
    min-height: 3.45rem;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}
.character-origin,
.character-personality,
.market-character-meta {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem .85rem;
    margin-top: .55rem;
    color: var(--muted);
    font-size: .62rem;
}


.community-grid,
.patronage-grid,
.admin-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    align-items: start;
}
.community-grid-wide { grid-template-columns: minmax(280px, .78fr) minmax(0, 1.22fr); }
.patronage-grid { grid-template-columns: repeat(2, minmax(280px, 1fr)); }
.admin-grid { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.community-card,
.patronage-card,
.admin-card { min-width: 0; }
.benefit-list {
    display: grid;
    gap: .65rem;
    margin: 1rem 0;
    padding: 0;
    list-style: none;
}
.benefit-list li {
    position: relative;
    padding-left: 1.4rem;
    color: var(--text-soft);
    line-height: 1.5;
}
.benefit-list li::before {
    position: absolute;
    top: .1rem;
    left: 0;
    color: var(--gold-light);
    content: "✦";
}
.button-row {
    display: flex;
    flex-wrap: wrap;
    gap: .65rem;
    align-items: center;
}
.button-row form { margin: 0; }
.form-help-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: .75rem;
    color: var(--muted);
    font-size: .68rem;
}
.form-help-row a { color: var(--gold-light); }

.donation-options,
.membership-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .7rem;
    margin: 1rem 0;
}
.choice-card {
    position: relative;
    display: grid;
    gap: .25rem;
    padding: .85rem;
    cursor: pointer;
    background: rgba(0, 0, 0, .18);
    border: 1px solid var(--line-soft);
    border-radius: 7px;
    transition: border-color .16s ease, background .16s ease, transform .16s ease;
}
.choice-card:hover { transform: translateY(-1px); border-color: rgba(216, 167, 81, .5); }
.choice-card:has(input:checked) { background: rgba(128, 79, 28, .25); border-color: var(--gold); }
.choice-card input { position: absolute; opacity: 0; }
.choice-card strong { color: var(--gold-light); font: 700 1.05rem Georgia, serif; }
.choice-card small { color: var(--muted); }
.membership-status {
    display: grid;
    gap: .45rem;
    margin: .9rem 0;
    padding: .85rem;
    background: rgba(0, 0, 0, .2);
    border: 1px solid var(--line-soft);
    border-radius: 7px;
}
.membership-status > div { display: flex; justify-content: space-between; gap: .8rem; }
.membership-status span { color: var(--muted); }

.ticket-list,
.suggestion-list,
.admin-suggestion-list,
.news-list,
.message-thread {
    display: grid;
    gap: .7rem;
}
.ticket-row,
.suggestion-row,
.news-post,
.thread-message {
    padding: .85rem .95rem;
    background: rgba(0, 0, 0, .17);
    border: 1px solid var(--line-soft);
    border-radius: 7px;
}
.ticket-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .75rem; align-items: center; }
.ticket-row:hover { border-color: rgba(216, 167, 81, .4); }
.ticket-row strong,
.ticket-row small,
.suggestion-row strong,
.suggestion-row small { display: block; }
.ticket-row small,
.suggestion-row small { margin-top: .2rem; color: var(--muted); }
.ticket-meta,
.suggestion-meta,
.news-meta { display: flex; flex-wrap: wrap; gap: .45rem .75rem; color: var(--muted); font-size: .61rem; }
.thread-message { line-height: 1.55; }
.thread-message.is-staff { border-color: rgba(214, 168, 84, .42); background: rgba(112, 68, 27, .16); }
.thread-message header { display: flex; justify-content: space-between; gap: .8rem; margin-bottom: .45rem; }
.thread-message header small { color: var(--muted); }
.news-post h2,
.news-post h3 { margin-bottom: .3rem; }
.news-post .news-body { color: var(--text-soft); line-height: 1.65; white-space: pre-line; }
.news-post.is-pinned { border-color: rgba(216, 167, 81, .48); box-shadow: inset 3px 0 0 var(--gold-dark); }
.admin-form { display: grid; gap: .75rem; }
.admin-form textarea { min-height: 150px; }

@media (max-width: 980px) {
    .community-grid,
    .community-grid-wide,
    .patronage-grid { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
    .donation-options,
    .membership-options { grid-template-columns: 1fr; }
    .ticket-row { grid-template-columns: 1fr; flex-direction: column; align-items: flex-start; }
    .button-row { align-items: stretch; }
    .button-row > *, .button-row form, .button-row .button { width: 100%; }
}

/* Version 1.5 application screens */
.plain-benefit-list {
    display: grid;
    gap: .55rem;
    margin: 1rem 0;
    padding: 0;
    list-style: none;
}
.plain-benefit-list li {
    position: relative;
    padding-left: 1.25rem;
    color: var(--text-soft);
    line-height: 1.5;
}
.plain-benefit-list li::before {
    position: absolute;
    left: 0;
    color: var(--gold-light);
    content: "✦";
}
.compact-definition-list {
    display: grid;
    gap: .45rem;
    margin: 1rem 0;
}
.compact-definition-list > div {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: .45rem;
    border-bottom: 1px solid var(--line-soft);
}
.compact-definition-list dt { color: var(--muted); }
.compact-definition-list dd { margin: 0; color: var(--text); text-align: right; }
.status-line { margin: .8rem 0; padding: .65rem .75rem; border-radius: 6px; }
.status-good { color: #b7df8a; background: rgba(73, 112, 40, .16); border: 1px solid rgba(123, 176, 74, .28); }
.notice-box {
    margin: .8rem 0;
    padding: .75rem .85rem;
    color: var(--text-soft);
    background: rgba(131, 89, 35, .16);
    border: 1px solid rgba(218, 171, 87, .27);
    border-radius: 6px;
}
.dev-grant-form { margin-top: .75rem; }
.community-list-panel { margin-top: 18px; }
.simple-table-wrap { overflow-x: auto; }
.simple-table { width: 100%; border-collapse: collapse; }
.simple-table th,
.simple-table td { padding: .75rem; text-align: left; border-bottom: 1px solid var(--line-soft); }
.simple-table th { color: var(--gold-light); font-size: .66rem; text-transform: uppercase; letter-spacing: .06em; }
.simple-table td { color: var(--text-soft); }

.support-layout,
.admin-queue-layout {
    display: grid;
    grid-template-columns: minmax(280px, .78fr) minmax(0, 1.22fr);
    gap: 18px;
    align-items: start;
}
.ticket-list,
.suggestion-list,
.news-admin-list { display: grid; gap: .65rem; }
.ticket-list-item {
    display: grid;
    gap: .22rem;
    padding: .8rem .9rem;
    color: var(--text-soft);
    text-decoration: none;
    background: rgba(0, 0, 0, .16);
    border: 1px solid var(--line-soft);
    border-radius: 7px;
}
.ticket-list-item:hover,
.ticket-list-item.is-active { color: var(--text); border-color: rgba(216, 167, 81, .5); background: rgba(116, 72, 27, .18); }
.ticket-list-item strong { color: var(--gold-light); }
.ticket-list-item span { color: var(--muted); font-size: .65rem; }
.conversation-panel { min-width: 0; }
.conversation-thread { display: grid; gap: .8rem; margin: 1rem 0; }
.conversation-message {
    padding: .8rem .9rem;
    background: rgba(0, 0, 0, .17);
    border: 1px solid var(--line-soft);
    border-radius: 7px;
}
.conversation-message.is-admin { border-color: rgba(216, 167, 81, .4); background: rgba(109, 65, 24, .17); }
.conversation-message header { display: flex; justify-content: space-between; gap: .75rem; margin-bottom: .4rem; }
.conversation-message time { color: var(--muted); font-size: .62rem; }
.conversation-message p { margin: 0; color: var(--text-soft); line-height: 1.58; }
.reply-form { margin-top: 1rem; }
.status-form { margin-top: .75rem; }
.status-badge {
    display: inline-flex;
    align-items: center;
    width: max-content;
    padding: .22rem .5rem;
    color: #e4c88e;
    background: rgba(119, 74, 27, .2);
    border: 1px solid rgba(212, 160, 74, .3);
    border-radius: 999px;
    font-size: .58rem;
    text-transform: uppercase;
    letter-spacing: .05em;
}
.suggestion-item,
.suggestion-admin-card,
.news-admin-item {
    padding: .9rem;
    background: rgba(0, 0, 0, .16);
    border: 1px solid var(--line-soft);
    border-radius: 7px;
}
.suggestion-item header,
.suggestion-admin-card header,
.news-admin-item header { display: flex; justify-content: space-between; gap: .8rem; align-items: flex-start; }
.suggestion-item header div,
.suggestion-admin-card header div { display: grid; gap: .18rem; }
.suggestion-item header span,
.suggestion-admin-card header span,
.news-admin-item small { color: var(--muted); font-size: .62rem; }
.suggestion-item > p,
.suggestion-admin-card > p { color: var(--text-soft); line-height: 1.55; }
.admin-response {
    margin-top: .8rem;
    padding: .7rem .8rem;
    background: rgba(105, 64, 23, .16);
    border-left: 3px solid var(--gold-dark);
}
.admin-response p { margin: .3rem 0 0; }
.admin-suggestion-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 18px; }
.news-feed { display: grid; gap: 18px; }
.news-post header { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; }
.news-post time { color: var(--muted); font-size: .65rem; white-space: nowrap; }
.news-summary { color: var(--gold-light); font-weight: 700; }
.news-body { color: var(--text-soft); line-height: 1.7; }

.character-biography h3 { margin: 0 0 .35rem; color: var(--gold-light); font-size: .82rem; }
.character-biography p { margin: 0; }
.character-origin span { display: grid; gap: .05rem; }
.character-origin small { color: var(--muted); font-size: .53rem; text-transform: uppercase; letter-spacing: .06em; }
.character-origin strong { color: var(--text-soft); font-weight: 600; }
.market-character-meta { margin-bottom: .75rem; }
.staff-biography { margin-bottom: .9rem; }

.auth-visual { background-image: url("../img/auth-ludus-hero.jpg"); }
.auth-visual-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(90deg, rgba(14, 10, 7, .2), rgba(14, 10, 7, .55)), linear-gradient(0deg, rgba(14, 10, 7, .7), transparent 55%);
}
.auth-visual > *:not(.auth-visual-overlay) { position: relative; z-index: 1; }
.brand-lockup img { object-fit: contain; }

@media (max-width: 980px) {
    .support-layout,
    .admin-queue-layout { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
    .compact-definition-list > div,
    .conversation-message header,
    .news-post header,
    .suggestion-item header,
    .suggestion-admin-card header,
    .news-admin-item header { flex-direction: column; }
    .compact-definition-list dd { text-align: left; }
}

/* Version 1.6 dashboard development goal */
.dashboard-development-goal { margin: 1rem 0; padding: 1rem; }
.dashboard-development-goal__content { display: grid; grid-template-columns: 150px minmax(0,1fr) 90px; gap: 1rem; align-items: center; }
.dashboard-development-goal__content > img { width: 100%; aspect-ratio: 16/10; object-fit: cover; border: 1px solid var(--line); border-radius: 8px; }
.dashboard-development-goal__content p { margin-bottom: .65rem; }
.dashboard-development-goal__resources { display: flex; flex-wrap: wrap; gap: .45rem; margin-bottom: .55rem; }
.dashboard-development-goal__resources > span { display: inline-flex; align-items: center; gap: .3rem; padding: .3rem .45rem; color: var(--text-soft); background: rgba(0,0,0,.2); border: 1px solid var(--line-soft); border-radius: 6px; font-size: .78rem; }
.dashboard-development-goal__resources > span.is-ready { color: var(--green-light); border-color: rgba(127,169,79,.42); }
.dashboard-development-goal__resources svg { width: 18px; height: 18px; }
.dashboard-development-goal__building { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .55rem .65rem; color: var(--gold-light); background: rgba(213,164,78,.08); border: 1px solid var(--line-soft); border-radius: 7px; }
.dashboard-development-goal__building strong { white-space: nowrap; }
.dashboard-development-goal__content > strong { color: var(--gold-light); font: 800 1.8rem Georgia,serif; text-align: center; }
.dashboard-development-goal__content > strong small { display: block; color: var(--muted); font: 600 .62rem Inter, sans-serif; text-transform: uppercase; letter-spacing: .08em; }
.dashboard-development-goal__empty { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.dashboard-development-goal__empty p { margin: 0; }
@media (max-width: 760px) {
    .dashboard-development-goal__content { grid-template-columns: 100px minmax(0,1fr); }
    .dashboard-development-goal__content > strong { grid-column: 1/-1; text-align: left; }
    .dashboard-development-goal__empty { align-items: stretch; flex-direction: column; }
}
@media (max-width: 480px) {
    .dashboard-development-goal__content { grid-template-columns: 1fr; }
    .dashboard-development-goal__content > img { max-height: 180px; }
}

/* Ludus development integration for facility upgrades. */
.page-callout {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
    padding: 1rem 1.15rem;
    border: 1px solid rgba(196, 151, 73, .32);
    border-radius: var(--radius, 12px);
    background: linear-gradient(135deg, rgba(102, 67, 29, .24), rgba(25, 20, 15, .82));
}
.page-callout div { display: grid; gap: .2rem; }
.page-callout span { color: var(--muted); }
.construction-stack { display: grid; gap: .75rem; margin-bottom: 1.25rem; }
.facility-development-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .65rem;
    margin: .85rem 0;
}
.facility-development-meta > span {
    display: grid;
    gap: .15rem;
    padding: .7rem .8rem;
    border: 1px solid rgba(196, 151, 73, .2);
    border-radius: 8px;
    background: rgba(13, 11, 9, .42);
}
.facility-development-meta small { color: var(--muted); }
.locked-upgrade-message {
    margin: .75rem 0;
    padding: .75rem .85rem;
    border-left: 3px solid #b58a48;
    background: rgba(117, 78, 31, .17);
    color: #e8d5ad;
}
@media (max-width: 680px) {
    .page-callout { align-items: flex-start; flex-direction: column; }
    .facility-development-meta { grid-template-columns: 1fr; }
}

/* Version 1.8.6: persistent long-term injuries */
.roster-injury-summary {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    gap: .3rem;
    margin-top: .2rem;
    padding: .16rem .38rem;
    color: #f3d39a;
    background: rgba(116, 70, 25, .22);
    border: 1px solid rgba(213, 156, 76, .38);
    border-radius: 999px;
    font-size: .58rem;
    font-weight: 800;
    text-transform: uppercase;
}
.roster-injury-summary.severity-serious,
.roster-injury-summary.severity-severe { color: #ffc0ae; background: rgba(126, 36, 22, .28); border-color: rgba(224, 92, 61, .48); }
.active-injury-banner {
    display: grid;
    gap: .25rem;
    margin: .15rem 0 .9rem;
    padding: .72rem .82rem;
    background: rgba(100, 59, 22, .2);
    border: 1px solid rgba(207, 148, 69, .42);
    border-left: 4px solid #bd7b2f;
    border-radius: 8px;
}
.active-injury-banner > div { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; }
.active-injury-banner span { display: inline-flex; align-items: center; gap: .3rem; color: var(--muted); font-size: .62rem; font-weight: 800; text-transform: uppercase; }
.active-injury-banner strong { color: #f3d29b; font-size: .84rem; }
.active-injury-banner small { color: var(--text-soft); }
.active-injury-banner.severity-serious,
.active-injury-banner.severity-severe { background: rgba(105, 29, 20, .24); border-color: rgba(215, 79, 50, .5); border-left-color: #c34b36; }
.active-injuries-section { grid-column: 1 / -1; }
.injury-card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
.injury-card-grid.compact { grid-template-columns: repeat(auto-fit, minmax(245px, 1fr)); }
.injury-card {
    display: grid;
    min-width: 0;
    gap: .6rem;
    padding: .82rem;
    background: linear-gradient(145deg, rgba(33, 24, 18, .88), rgba(16, 12, 9, .88));
    border: 1px solid rgba(178, 125, 60, .34);
    border-left: 4px solid #a66d2c;
    border-radius: 9px;
}
.injury-card.severity-moderate { border-left-color: #c47c2f; }
.injury-card.severity-serious { border-left-color: #c44e35; }
.injury-card.severity-severe { border-left-color: #9d271f; box-shadow: inset 0 0 30px rgba(119, 25, 18, .12); }
.injury-card.is-recovered { opacity: .78; border-left-color: #65785e; }
.injury-card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: .7rem; }
.injury-card-heading > div { display: grid; gap: .12rem; }
.injury-card-heading span,
.injury-card-heading small { color: var(--muted); font-size: .58rem; font-weight: 800; text-transform: uppercase; }
.injury-card-heading strong { color: var(--gold-light); font-size: .94rem; }
.injury-card p { margin: 0; color: var(--text-soft); font-size: .72rem; line-height: 1.5; }
.injury-status { padding: .18rem .42rem; border: 1px solid var(--line); border-radius: 999px; white-space: nowrap; }
.injury-status-active { color: #f0b77e !important; border-color: rgba(211, 126, 53, .48); }
.injury-status-recovered { color: #bcd0ad !important; border-color: rgba(110, 151, 91, .45); }
.injury-permissions { display: flex; flex-wrap: wrap; gap: .4rem; }
.injury-permissions span { padding: .2rem .42rem; border-radius: 5px; font-size: .59rem; font-weight: 800; text-transform: uppercase; }
.injury-permissions .allowed { color: #bdd5ad; background: rgba(74, 111, 58, .22); border: 1px solid rgba(99, 148, 79, .35); }
.injury-permissions .blocked { color: #f1aaa0; background: rgba(123, 38, 29, .22); border: 1px solid rgba(194, 67, 50, .4); }
.injury-progress { display: grid; gap: .3rem; }
.injury-progress > div:first-child { display: flex; justify-content: space-between; gap: .6rem; color: var(--muted); font-size: .63rem; }
.injury-progress .progress { height: 7px; }
.injury-progress .progress > span { background: linear-gradient(90deg, #7c542c, #c7964e); }
.injury-progress small { color: var(--muted); }
.injury-effects { padding-top: .45rem; border-top: 1px solid var(--line-soft); }
.injury-effects summary { color: var(--gold-light); cursor: pointer; font-size: .66rem; font-weight: 800; }
.injury-effect-list { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .45rem; }
.injury-effect-list span { padding: .18rem .4rem; color: #f0b49f; background: rgba(112, 40, 26, .2); border-radius: 4px; font-size: .61rem; }

@media (max-width: 760px) {
    .injury-card-grid { grid-template-columns: 1fr; }
    .active-injury-banner > div { align-items: flex-start; flex-direction: column; }
}

/* Free Training Plans / Standing Orders */
.training-plans-panel { scroll-margin-top: 88px; }
.training-plan-lock { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; align-items: center; gap: 0.9rem; padding: 1rem; background: rgba(94, 65, 26, 0.17); border: 1px solid var(--gold-dark); border-radius: 10px; }
.training-plan-lock > span { display: grid; width: 52px; height: 52px; place-items: center; color: var(--gold-light); background: rgba(0, 0, 0, 0.24); border: 1px solid var(--line); border-radius: 50%; font-size: 1.3rem; }
.training-plan-lock p { margin-top: 0.25rem; color: var(--muted); font-size: 0.72rem; }
.training-plan-principles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.7rem; margin-bottom: 1rem; }
.training-plan-principles > div { display: grid; gap: 0.22rem; padding: 0.75rem; background: rgba(0, 0, 0, 0.18); border: 1px solid var(--line-soft); border-radius: 8px; }
.training-plan-principles strong { color: var(--gold-light); font-size: 0.75rem; }
.training-plan-principles span { color: var(--muted); font-size: 0.66rem; }
.training-plan-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.9rem; margin-bottom: 1rem; }
.training-plan-card { min-width: 0; padding: 0.9rem; background: linear-gradient(155deg, rgba(43, 33, 25, 0.94), rgba(22, 17, 13, 0.96)); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); }
.training-plan-card.is-paused, .training-plan-card.is-completed { opacity: 0.82; }
.training-plan-card-head { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; align-items: center; gap: 0.72rem; }
.training-plan-card-head img { width: 64px; height: 72px; object-fit: cover; border-radius: 7px; }
.training-plan-card-head h3 { margin: 0; font-size: 1rem; }
.training-plan-card-head > strong { display: grid; color: var(--gold-light); font: 700 1.25rem Georgia, serif; text-align: right; }
.training-plan-card-head > strong small { color: var(--muted); font: 700 0.54rem Inter, sans-serif; letter-spacing: 0.08em; text-transform: uppercase; }
.training-plan-status { display: inline-flex; width: fit-content; margin-top: 0.28rem; padding: 0.2rem 0.42rem; border: 1px solid var(--line-soft); border-radius: 99px; font-size: 0.58rem; font-weight: 800; text-transform: uppercase; }
.training-plan-status.status-active { color: var(--green-light); border-color: rgba(126, 169, 79, 0.48); }
.training-plan-status.status-finishing { color: var(--gold-light); border-color: var(--gold-dark); }
.training-plan-status.status-paused, .training-plan-status.status-completed { color: var(--muted); }
.training-plan-sequence { display: grid; gap: 0.35rem; margin: 0.8rem 0; padding: 0; list-style: none; }
.training-plan-sequence li { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; gap: 0.5rem; min-width: 0; padding: 0.45rem 0.52rem; background: rgba(0, 0, 0, 0.16); border: 1px solid var(--line-soft); border-radius: 7px; }
.training-plan-sequence li > span { display: grid; width: 24px; height: 24px; place-items: center; color: var(--muted); background: rgba(255, 255, 255, 0.03); border-radius: 50%; font-size: 0.62rem; font-weight: 800; }
.training-plan-sequence li b { overflow: hidden; font-size: 0.68rem; text-overflow: ellipsis; white-space: nowrap; }
.training-plan-sequence li small { color: var(--gold-light); font-size: 0.56rem; font-weight: 800; text-transform: uppercase; }
.training-plan-sequence li.is-next { background: rgba(98, 66, 29, 0.24); border-color: var(--gold-dark); }
.training-plan-sequence li.is-next > span { color: #1b140e; background: var(--gold); }
.training-plan-rules { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.45rem; }
.training-plan-rules > span { display: grid; gap: 0.16rem; padding: 0.5rem; background: rgba(0, 0, 0, 0.18); border-radius: 6px; text-align: center; }
.training-plan-rules small { color: var(--muted); font-size: 0.55rem; text-transform: uppercase; }
.training-plan-rules strong { color: var(--text); font-size: 0.68rem; }
.training-plan-reserves { display: grid; gap: 0.2rem; margin-top: 0.55rem; padding: 0.55rem; color: var(--text-soft); background: rgba(0, 0, 0, 0.14); border-radius: 6px; font-size: 0.63rem; }
.training-plan-reserves small { color: var(--muted); font-size: 0.55rem; text-transform: uppercase; }
.training-plan-waiting, .training-plan-ready { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0.5rem; margin-top: 0.62rem; padding: 0.58rem; border: 1px solid; border-radius: 7px; font-size: 0.64rem; }
.training-plan-waiting { color: #ffe7b4; background: rgba(126, 82, 20, 0.22); border-color: rgba(224, 169, 76, 0.4); }
.training-plan-ready { color: #dff6ba; background: rgba(72, 103, 39, 0.2); border-color: rgba(126, 169, 79, 0.4); }
.training-plan-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.45rem; margin-top: 0.75rem; padding-top: 0.7rem; border-top: 1px solid var(--line-soft); }
.training-plan-edit { flex: 1 1 100%; border: 1px solid var(--line-soft); border-radius: 7px; }
.training-plan-edit summary, .training-plan-builder > summary { padding: 0.68rem 0.75rem; color: var(--gold-light); cursor: pointer; font-size: 0.72rem; font-weight: 800; }
.training-plan-edit[open] summary, .training-plan-builder[open] > summary { border-bottom: 1px solid var(--line-soft); }
.training-plan-builder { margin-top: 1rem; background: rgba(0, 0, 0, 0.13); border: 1px solid var(--line); border-radius: 9px; }
.training-plan-form { display: grid; gap: 0.9rem; padding: 0.85rem; }
.training-plan-step-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.65rem; }
.training-plan-safeguards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.65rem; padding: 0.75rem; background: rgba(0, 0, 0, 0.16); border: 1px solid var(--line-soft); border-radius: 8px; }
.input-suffix { display: grid; grid-template-columns: minmax(0, 1fr) 40px; }
.input-suffix input { border-radius: 7px 0 0 7px; }
.input-suffix b { display: grid; place-items: center; color: var(--muted); background: rgba(0, 0, 0, 0.32); border: 1px solid #5a4631; border-left: 0; border-radius: 0 7px 7px 0; }
.checkbox-row { display: flex; align-items: flex-start; gap: 0.62rem; }
.checkbox-row > input { width: 18px; min-height: 18px; margin-top: 0.12rem; padding: 0; }
.checkbox-row > span { display: grid; gap: 0.12rem; }
.checkbox-row small { color: var(--muted); font-size: 0.65rem; }
.training-plan-repeat { padding: 0.7rem; background: rgba(0, 0, 0, 0.13); border: 1px solid var(--line-soft); border-radius: 8px; }

@media (max-width: 980px) {
    .training-plan-grid, .training-plan-principles { grid-template-columns: 1fr; }
    .training-plan-step-grid, .training-plan-safeguards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
    .training-plan-lock { grid-template-columns: 44px minmax(0, 1fr); }
    .training-plan-lock > span { width: 44px; height: 44px; }
    .training-plan-lock .button { grid-column: 1 / -1; }
    .training-plan-card-head { grid-template-columns: 54px minmax(0, 1fr); }
    .training-plan-card-head img { width: 54px; height: 64px; }
    .training-plan-card-head > strong { grid-column: 1 / -1; grid-template-columns: auto auto; justify-content: start; gap: 0.35rem; text-align: left; }
    .training-plan-rules, .training-plan-step-grid, .training-plan-safeguards { grid-template-columns: 1fr; }
}

/* Training page live progression */
.training-live-shell { position: relative; }
.training-live-status {
    position: fixed;
    top: 82px;
    right: 24px;
    z-index: 85;
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    max-width: min(360px, calc(100vw - 32px));
    padding: 0.62rem 0.78rem;
    color: var(--text);
    background: rgba(28, 22, 17, 0.96);
    border: 1px solid var(--line);
    border-radius: 999px;
    box-shadow: var(--shadow);
    font-size: 0.67rem;
    backdrop-filter: blur(10px);
}
.training-live-status[hidden] { display: none; }
.training-live-status > span {
    width: 12px;
    height: 12px;
    flex: 0 0 12px;
    border: 2px solid rgba(255, 255, 255, 0.24);
    border-top-color: var(--gold-light);
    border-radius: 50%;
}
.training-live-status.is-updating > span { animation: training-live-spin 0.72s linear infinite; }
.training-live-status.is-success { border-color: rgba(126, 169, 79, 0.55); }
.training-live-status.is-success > span { background: var(--green-light); border: 0; box-shadow: 0 0 0 3px rgba(126, 169, 79, 0.16); }
.training-live-status.is-warning { border-color: rgba(224, 169, 76, 0.55); }
.training-live-status.is-warning > span { background: var(--gold); border: 0; box-shadow: 0 0 0 3px rgba(224, 169, 76, 0.14); }
.training-live-status.is-error { border-color: rgba(185, 79, 59, 0.65); }
.training-live-status.is-error > span { background: #c46c56; border: 0; box-shadow: 0 0 0 3px rgba(196, 108, 86, 0.15); }
.training-refresh-enter {
    opacity: 0.58;
    transform: translateY(5px);
}
.training-refresh-enter.training-refresh-enter-active {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.42s ease, transform 0.42s ease;
}
.training-plan-sequence li.is-in-progress {
    background: linear-gradient(90deg, rgba(72, 103, 39, 0.34), rgba(98, 66, 29, 0.2));
    border-color: rgba(126, 169, 79, 0.62);
    box-shadow: inset 3px 0 0 var(--green-light);
}
.training-plan-sequence li.is-in-progress > span {
    color: #17200f;
    background: var(--green-light);
    animation: training-step-pulse 1.8s ease-in-out infinite;
}
.training-plan-sequence li.is-in-progress small { color: var(--green-light); }

@keyframes training-live-spin { to { transform: rotate(360deg); } }
@keyframes training-step-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(126, 169, 79, 0.28); }
    50% { box-shadow: 0 0 0 5px rgba(126, 169, 79, 0); }
}

@media (max-width: 760px) {
    .training-live-status { top: 68px; right: 12px; }
}

@media (prefers-reduced-motion: reduce) {
    .training-live-status.is-updating > span,
    .training-plan-sequence li.is-in-progress > span { animation: none; }
    .training-refresh-enter.training-refresh-enter-active { transition: none; }
}
.training-job-plan-step { color: var(--green-light); font-weight: 800; letter-spacing: 0.03em; text-transform: uppercase; }

/* Version 1.11.6 — durable notification navigation target. */
.notification-target-pulse {
    animation: notification-target-pulse 1.05s ease-out 2;
    outline: 2px solid rgba(146, 220, 255, .86);
    outline-offset: 5px;
}
@keyframes notification-target-pulse {
    0% { outline-color: rgba(146, 220, 255, .95); box-shadow: 0 0 0 0 rgba(94, 185, 235, .42); }
    100% { outline-color: rgba(146, 220, 255, .18); box-shadow: 0 0 0 18px rgba(94, 185, 235, 0); }
}
@media (prefers-reduced-motion: reduce) {
    .notification-target-pulse { animation: none; }
}

.economy-tick-pill {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-width: 132px;
	padding: 7px 10px;
	border: 1px solid rgba(127, 187, 209, .24);
	border-radius: 12px;
	background: rgba(75, 132, 153, .08);
}

.economy-tick-pill span:last-child,
.economy-tick-pill strong,
.economy-tick-pill small {
	display: block;
}

.economy-tick-pill strong {
	font-variant-numeric: tabular-nums;
	color: #b8dce8;
}

.economy-tick-pill small {
	font-size: .66rem;
	color: var(--text-muted);
}

.economy-tick-symbol {
	font-size: 1.1rem;
	color: #86bfd2;
}

/* v1.15 grouped navigation keeps the growing ludus command surface scannable. */
.sidebar-nav-group { border-bottom: 1px solid rgba(255,255,255,.055); padding-bottom: .28rem; }
.sidebar-nav-group > summary { display:flex; align-items:center; justify-content:space-between; gap:.7rem; padding:.5rem .7rem .36rem; cursor:pointer; color:var(--muted); font-size:.68rem; font-weight:800; letter-spacing:.12em; text-transform:uppercase; list-style:none; user-select:none; }
.sidebar-nav-group > summary::-webkit-details-marker { display:none; }
.sidebar-nav-group > summary span { transition:transform .18s ease; }
.sidebar-nav-group:not([open]) > summary span { transform:rotate(-90deg); }
.sidebar-nav-group > div { display:grid; gap:.22rem; }
.sidebar-nav-group:not([open]) > div { display:none; }
.leaderboard-section { margin-top: 2rem; }
.leaderboard-subheader { align-items:end; margin-bottom: 1rem; }
.leaderboard-table td small,.leaderboard-honor { display:block; color:var(--muted); font-size:.72rem; margin-top:.18rem; }
.fallen-champions { margin-top:2rem; }
.memorial-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(240px,1fr)); gap:1rem; }
.memorial-grid article { padding:1rem; border:1px solid rgba(181,69,52,.28); border-radius:12px; background:linear-gradient(145deg,rgba(85,23,18,.14),rgba(0,0,0,.08)); }
.memorial-grid h3 { margin:.2rem 0; }
.memorial-grid dl { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:.45rem; margin:1rem 0; }
.memorial-grid dl div { padding:.55rem; background:rgba(255,255,255,.035); border-radius:8px; }
.memorial-grid dt { color:var(--muted); font-size:.68rem; }
.memorial-grid dd { margin:.2rem 0 0; font-weight:800; }
.memorial-grid footer { color:var(--muted); font-size:.78rem; }
@media(max-width:640px){.memorial-grid dl{grid-template-columns:1fr}.page-header-actions{display:grid;width:100%}}

/* Version 1.16.1 — stable portrait framing across dossiers, market, and staff. */
.gladiator-dossier-hero {
    align-items: start;
}
.dossier-portrait-frame {
    width: 100%;
    height: auto;
    min-height: 0;
    aspect-ratio: 4 / 5;
    align-self: start;
}
.dossier-portrait-frame img {
    width: 100%;
    height: 100%;
    min-height: 0;
    object-fit: cover;
}
.market-portrait {
    height: auto;
    aspect-ratio: 4 / 5;
    background: #17110d;
}
.market-portrait img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.staff-card {
    grid-template-columns: minmax(225px, .8fr) minmax(0, 1.2fr);
    min-height: 0;
    align-items: start;
}
.staff-portrait-wrap {
    width: 100%;
    min-height: 0;
    aspect-ratio: 4 / 5;
    align-self: start;
}
.staff-portrait-wrap img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.staff-market-card {
    grid-template-columns: 180px minmax(250px, 1fr);
    min-height: 0;
    align-items: start;
}
.staff-market-card > img {
    display: block;
    width: 100%;
    height: auto;
    min-height: 0;
    aspect-ratio: 4 / 5;
    object-fit: cover;
    background: #18110c;
}

@media (max-width: 720px) {
    .dossier-portrait-frame {
        height: min(110vw, 560px);
        min-height: 0;
        aspect-ratio: auto;
    }
    .dossier-portrait-frame img {
        height: 100%;
        min-height: 0;
    }
}

@media (max-width: 640px) {
    .staff-card,
    .staff-market-card {
        grid-template-columns: 1fr;
    }
    .staff-portrait-wrap,
    .staff-market-card > img {
        width: min(100%, 420px);
        justify-self: center;
        aspect-ratio: 4 / 5;
    }
}

/* Version 1.16.6: collapsible milestone-driven new-player help. */
.new-player-help-shell { position: relative; z-index: 1450; }
.new-player-help-backdrop[hidden],
.new-player-help-banner[hidden] { display: none !important; }
.new-player-help-banner {
    position: fixed;
    z-index: 1440;
    right: 18px;
    bottom: 18px;
    display: flex;
    width: min(430px, calc(100vw - 36px));
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 13px 14px 13px 16px;
    color: var(--text);
    background: linear-gradient(145deg, rgba(42, 31, 23, 0.985), rgba(20, 15, 12, 0.99));
    border: 1px solid var(--gold-dark);
    border-radius: 12px;
    box-shadow: 0 14px 38px rgba(0, 0, 0, 0.46);
}
.new-player-help-banner-copy { display: grid; min-width: 0; gap: 3px; }
.new-player-help-banner-copy .eyebrow { margin: 0; color: var(--gold-light); font-size: 0.58rem; }
.new-player-help-banner-copy strong { color: var(--text); font: 700 0.82rem Georgia, serif; }
.new-player-help-banner-copy span { color: var(--muted); font-size: 0.62rem; line-height: 1.4; }
.new-player-help-banner .button { flex: 0 0 auto; white-space: nowrap; }
.new-player-help-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1450;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(8, 6, 5, 0.76);
    backdrop-filter: blur(5px);
}
.new-player-help-dialog {
    width: min(820px, 100%);
    max-height: min(86vh, 840px);
    overflow: auto;
    color: var(--text);
    background: linear-gradient(155deg, rgba(38, 29, 22, 0.99), rgba(18, 14, 11, 0.995));
    border: 1px solid var(--gold-dark);
    border-radius: 14px;
    box-shadow: 0 24px 72px rgba(0, 0, 0, 0.58);
}
.new-player-help-header {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 22px 16px;
    background: linear-gradient(180deg, rgba(35, 27, 21, 0.995), rgba(35, 27, 21, 0.94));
    border-bottom: 1px solid var(--line-soft);
}
.new-player-help-header h2 { margin: 3px 0 0; font-size: clamp(1.25rem, 2.6vw, 1.8rem); }
.new-player-help-close {
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    padding: 0;
    color: var(--muted);
    background: rgba(0, 0, 0, 0.22);
    border: 1px solid var(--line-soft);
    border-radius: 50%;
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
}
.new-player-help-close:hover,
.new-player-help-close:focus-visible { color: var(--text); border-color: var(--gold-dark); }
.new-player-help-steps { padding: 22px; }
.new-player-help-step {
    display: grid;
    grid-template-columns: 62px minmax(0, 1fr);
    gap: 18px;
    min-height: 340px;
}
.new-player-help-step[hidden] { display: none; }
.new-player-help-step-icon {
    display: grid;
    width: 58px;
    height: 58px;
    place-items: center;
    color: var(--gold-light);
    background: rgba(105, 72, 30, 0.22);
    border: 1px solid var(--gold-dark);
    border-radius: 50%;
    font-size: 1.55rem;
}
.new-player-help-step h3 { margin: 0 0 8px; color: var(--gold-light); font: 700 1.08rem Georgia, serif; }
.new-player-help-step p { margin: 0 0 12px; color: var(--text-soft); line-height: 1.65; }
.new-player-help-step ol { display: grid; gap: 8px; margin: 0 0 16px; padding-left: 22px; color: var(--text-soft); line-height: 1.5; }
.new-player-help-step .button { margin-top: 4px; }
.new-player-help-note,
.new-player-help-warning {
    padding: 11px 13px;
    background: rgba(0, 0, 0, 0.18);
    border: 1px solid var(--line-soft);
    border-radius: 9px;
}
.new-player-help-warning { display: grid; gap: 4px; border-color: rgba(196, 108, 86, 0.48); }
.new-player-help-warning strong { color: #f0b29f; }
.new-player-help-warning span { color: var(--text-soft); font-size: 0.72rem; line-height: 1.5; }
.new-player-help-resource-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
    margin: 14px 0 16px;
}
.new-player-help-resource-grid > div {
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr);
    align-items: center;
    gap: 9px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.18);
    border: 1px solid var(--line-soft);
    border-radius: 8px;
}
.new-player-help-resource-grid .resource-icon { width: 28px; height: 28px; }
.new-player-help-resource-grid span { display: grid; gap: 2px; }
.new-player-help-resource-grid strong { color: var(--text); font-size: 0.75rem; }
.new-player-help-resource-grid small { color: var(--muted); font-size: 0.62rem; line-height: 1.35; }
.new-player-help-archetypes {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin: 12px 0 16px;
}
.new-player-help-archetypes > div {
    display: grid;
    gap: 3px;
    padding: 10px 11px;
    background: rgba(0, 0, 0, 0.17);
    border: 1px solid var(--line-soft);
    border-radius: 8px;
}
.new-player-help-archetypes strong { color: var(--gold-light); font-size: 0.72rem; }
.new-player-help-archetypes span { color: var(--muted); font-size: 0.61rem; line-height: 1.4; }
.new-player-help-footer {
    position: sticky;
    bottom: 0;
    z-index: 2;
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    align-items: center;
    gap: 10px;
    padding: 14px 22px;
    background: linear-gradient(0deg, rgba(27, 21, 17, 0.995), rgba(27, 21, 17, 0.95));
    border-top: 1px solid var(--line-soft);
}
.new-player-help-progress { display: flex; justify-content: center; gap: 7px; }
.new-player-help-progress span { width: 7px; height: 7px; background: rgba(255, 255, 255, 0.14); border-radius: 50%; }
.new-player-help-progress span.is-active { background: var(--gold); box-shadow: 0 0 0 3px rgba(224, 169, 76, 0.12); }
.new-player-help-dismiss-text {
    padding: 6px 2px;
    color: var(--muted);
    background: none;
    border: 0;
    font-size: 0.62rem;
    text-decoration: underline;
    cursor: pointer;
}
.new-player-help-dismiss-text:hover,
.new-player-help-dismiss-text:focus-visible { color: var(--text); }

@media (max-width: 700px) {
    .new-player-help-banner {
        right: 10px;
        bottom: calc(72px + env(safe-area-inset-bottom));
        left: 10px;
        width: auto;
        gap: 10px;
        padding: 11px 12px;
    }
    .new-player-help-banner-copy span { font-size: 0.59rem; }
    .new-player-help-banner .button { padding-inline: 10px; }
    .new-player-help-backdrop { align-items: end; padding: 10px; }
    .new-player-help-dialog { max-height: 91vh; border-radius: 13px 13px 8px 8px; }
    .new-player-help-header { padding: 16px; }
    .new-player-help-steps { padding: 16px; }
    .new-player-help-step { grid-template-columns: 1fr; gap: 10px; min-height: 0; }
    .new-player-help-step-icon { width: 44px; height: 44px; font-size: 1.15rem; }
    .new-player-help-resource-grid,
    .new-player-help-archetypes { grid-template-columns: 1fr; }
    .new-player-help-footer { grid-template-columns: auto 1fr auto; padding: 12px 16px; }
    .new-player-help-dismiss-text { grid-column: 1 / -1; justify-self: center; }
}
body.new-player-help-open { overflow: hidden; }

/* v1.17.0 admin resource gift toast */
.toast-admin-gift {
  border-color: rgba(216, 173, 79, 0.7);
  border-left-color: #e1b75a;
  background:
    radial-gradient(circle at 12% 15%, rgba(225, 183, 90, 0.16), transparent 38%),
    linear-gradient(145deg, rgba(47, 35, 22, 0.99), rgba(31, 24, 19, 0.99));
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.48), 0 0 26px rgba(213, 164, 78, 0.12);
}
.toast-admin-gift .toast-icon {
  color: #ffe3a1;
  background: rgba(213, 164, 78, 0.18);
  border-color: rgba(225, 183, 90, 0.58);
  box-shadow: 0 0 14px rgba(225, 183, 90, 0.12);
}
.toast-admin-gift .toast-title { color: #ffe7af; }
