/* Shadows of War 2.0 – app shell styles (menus, widgets, screens). HUD styles live in hud.css. */

/* ------------------------------------------------------------------ fonts (SIL OFL 1.1, bundled) */
@font-face { font-family: 'Saira Stencil One'; src: url('../assets/fonts/SairaStencilOne-Regular.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Black Ops One'; src: url('../assets/fonts/BlackOpsOne-Regular.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Barlow Condensed'; src: url('../assets/fonts/BarlowCondensed-Regular.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Barlow Condensed'; src: url('../assets/fonts/BarlowCondensed-Medium.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Barlow Condensed'; src: url('../assets/fonts/BarlowCondensed-SemiBold.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Barlow Condensed'; src: url('../assets/fonts/BarlowCondensed-Bold.woff2') format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Rajdhani'; src: url('../assets/fonts/Rajdhani-Regular.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Rajdhani'; src: url('../assets/fonts/Rajdhani-Medium.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Rajdhani'; src: url('../assets/fonts/Rajdhani-SemiBold.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Rajdhani'; src: url('../assets/fonts/Rajdhani-Bold.woff2') format('woff2'); font-weight: 700; font-display: swap; }

/* ------------------------------------------------------------------ tokens */
:root {
  --f-stencil: 'Saira Stencil One', 'Black Ops One', system-ui, sans-serif;
  --f-display: 'Black Ops One', 'Saira Stencil One', system-ui, sans-serif;
  --f-ui: 'Barlow Condensed', system-ui, sans-serif;
  --f-num: 'Rajdhani', 'Barlow Condensed', system-ui, sans-serif;

  --c-bg: #14170f;
  --c-panel: rgba(28, 32, 22, 0.92);
  --c-panel-2: #232a1c;
  --c-panel-3: #2c3423;
  --c-line: #4d5636;
  --c-line-2: #6a7349;
  --c-text: #d9cfae;
  --c-dim: #a39a7c;
  --c-paper: #e6dcbf;
  --c-ink: #1d1b14;
  --c-brass: #d8b25a;
  --c-brass-2: #b8913e;
  --c-rust: #b4482f;
  --c-ok: #7fae4e;
  --c-team0: #5299ff;
  --c-team1: #f24d40;
  --ui-scale: 1;

  --r: 3px;
  --gap: 0.75rem;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.55);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}
html.cb { --c-team1: #ff9e1a; }

*, *::before, *::after { box-sizing: border-box; }
/* The UI is laid out for 1280×720 at 16 px and grows with the viewport up to 1.35× (1920×1080 and up). */
html { font-size: calc(var(--ui-scale) * clamp(16px, min(2.2222vh, 1.25vw), 21.6px)); background: var(--c-bg); color: var(--c-text); }
html, body { margin: 0; height: 100%; overflow: hidden; }
body { font-family: var(--f-ui); font-weight: 500; line-height: 1.35; -webkit-font-smoothing: antialiased; user-select: none; }
button, input, select, textarea { font: inherit; color: inherit; }
input, textarea { user-select: text; }
a { color: var(--c-brass); }
a:hover { color: var(--c-paper); }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--c-brass); outline-offset: 2px; }
/* Headings/stages focused by the router for screen readers are not interactive: no ring. */
[tabindex='-1']:focus, [tabindex='-1']:focus-visible { outline: none; }
::selection { background: var(--c-brass); color: var(--c-ink); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.25); }
::-webkit-scrollbar-thumb { background: var(--c-line); border: 2px solid rgba(0, 0, 0, 0.3); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: var(--c-line-2); }

/* ------------------------------------------------------------------ layers */
#game { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; background: #0b0d08; }
#ui { position: fixed; inset: 0; pointer-events: none; z-index: 1; }
#ui.no-attract::before {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgba(10, 12, 8, 0.35), rgba(10, 12, 8, 0.75)), url('../assets/img/title_keyart.webp') center / cover no-repeat;
}
.screen-host { position: absolute; inset: 0; pointer-events: none; }
.screen-host.hidden { display: none; }
.screen {
  position: absolute; inset: 0; pointer-events: auto; overflow: hidden;
  display: flex; flex-direction: column;
  animation: screen-in 180ms var(--ease);
}
.screen.leaving { animation: screen-out 180ms var(--ease) forwards; pointer-events: none; }
@keyframes screen-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes screen-out { to { opacity: 0; } }
/* Sub-screens keep the attract battle visible but dim it for legible text. */
.screen:not(.screen-menu):not(.screen-loading):not(.screen-intro) {
  background: linear-gradient(180deg, rgba(12, 14, 9, 0.78) 0%, rgba(12, 14, 9, 0.66) 50%, rgba(12, 14, 9, 0.8) 100%);
}
.screen.attract-bg { background: radial-gradient(ellipse at 50% 40%, rgba(10, 12, 8, 0.05) 0%, rgba(10, 12, 8, 0.55) 70%, rgba(10, 12, 8, 0.8) 100%); }
.screen.dim-bg { background: linear-gradient(90deg, rgba(12, 14, 9, 0.9) 0%, rgba(12, 14, 9, 0.72) 45%, rgba(12, 14, 9, 0.6) 100%); }
.screen-inner { position: relative; width: min(1320px, 100% - 3rem); margin: 0 auto; height: 100%; display: flex; flex-direction: column; padding: 1.25rem 0 1rem; min-height: 0; }
.screen-body { flex: 1; min-height: 0; overflow: auto; padding: 0.25rem 0.25rem 1rem; }

/* ------------------------------------------------------------------ panels */
.panel {
  position: relative; background:
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.012) 0 2px, transparent 2px 6px),
    linear-gradient(180deg, rgba(43, 51, 33, 0.94), rgba(26, 30, 20, 0.95));
  border: 1px solid var(--c-line); border-radius: var(--r); box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  padding: 1rem 1.1rem;
}
.panel::before, .panel::after {
  content: ''; position: absolute; width: 7px; height: 7px; border-radius: 50%; top: 6px;
  background: radial-gradient(circle at 35% 35%, #8f8a6c, #3f3d2c 60%, #1d1c14);
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.6);
}
.panel::before { left: 6px; }
.panel::after { right: 6px; }
.panel.flat::before, .panel.flat::after { display: none; }
.panel-title, .sec-title {
  font-family: var(--f-stencil); font-weight: 400; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--c-brass); font-size: 1.05rem; margin: 0 0 0.75rem; display: flex; align-items: center; gap: 0.5rem;
}
.panel-title .ico, .sec-title .ico { width: 1.15rem; height: 1.15rem; }
.paper {
  background: linear-gradient(180deg, #e9dfc3, #d9cca7); color: var(--c-ink); border: 1px solid #a8996f; border-radius: 2px;
  box-shadow: var(--shadow); padding: 1rem 1.2rem;
}
.muted, .dim { color: var(--c-dim); }
.small { font-size: 0.875rem; }
.row { display: flex; align-items: center; gap: var(--gap); }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: var(--gap); }
.hr { height: 1px; background: var(--c-line); margin: 0.75rem 0; border: 0; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.stamp {
  display: inline-block; font-family: var(--f-display); color: var(--c-rust); text-transform: uppercase; letter-spacing: 0.08em;
  border: 3px double var(--c-rust); padding: 0.15rem 0.6rem; transform: rotate(-4deg); opacity: 0.88; font-size: 0.85rem;
  mix-blend-mode: normal;
}

/* ------------------------------------------------------------------ icons, flags, insignia */
.ico { width: 1.25rem; height: 1.25rem; flex: none; display: inline-block; vertical-align: middle; }
.flag { width: 1.8rem; height: 1.2rem; flex: none; display: inline-block; vertical-align: middle; border-radius: 1px; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.45); object-fit: cover; }
.flag.lg { width: 3rem; height: 2rem; }
.insignia { width: 2rem; height: 2rem; flex: none; display: inline-block; vertical-align: middle; }
.insignia.lg { width: 3.4rem; height: 3.4rem; }
.unit-sil { width: 4rem; height: 2rem; color: var(--c-dim); }
.unit-art, .sup-art { display: block; max-width: 100%; }

/* ------------------------------------------------------------------ buttons */
.btn {
  --b-bg: linear-gradient(180deg, #3a4330, #2a3122);
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: 2.25rem; padding: 0.4rem 1rem; border: 1px solid var(--c-line-2); border-radius: var(--r);
  background: var(--b-bg); color: var(--c-paper); cursor: pointer; text-transform: uppercase; letter-spacing: 0.05em;
  font-weight: 600; font-size: 0.95rem; white-space: nowrap; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07), 0 2px 4px rgba(0, 0, 0, 0.35);
  transition: background 120ms, border-color 120ms, transform 80ms, color 120ms;
}
.btn:hover:not(:disabled) { border-color: var(--c-brass); color: #fff; background: linear-gradient(180deg, #46513a, #313a28); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn kbd, kbd {
  font-family: var(--f-num); font-weight: 700; font-size: 0.75rem; padding: 0.05rem 0.35rem; border-radius: 2px;
  border: 1px solid var(--c-line-2); background: rgba(0, 0, 0, 0.35); color: var(--c-dim); letter-spacing: 0;
}
.btn-primary { --b-bg: linear-gradient(180deg, #e2bf6a, #b38b3b); color: var(--c-ink); border-color: #f0d38d; text-shadow: 0 1px 0 rgba(255, 255, 255, 0.25); }
.btn-primary:hover:not(:disabled) { background: linear-gradient(180deg, #f0cf7d, #c49a45); color: #000; border-color: #fff1c4; }
.btn-primary kbd { color: var(--c-ink); border-color: rgba(0, 0, 0, 0.35); background: rgba(255, 255, 255, 0.2); }
.btn-ghost { --b-bg: transparent; border-color: var(--c-line); box-shadow: none; color: var(--c-text); }
.btn-ghost:hover:not(:disabled) { background: rgba(216, 178, 90, 0.1); }
.btn-danger { --b-bg: linear-gradient(180deg, #a3442d, #74301f); border-color: #d0694f; }
.btn-danger:hover:not(:disabled) { background: linear-gradient(180deg, #b9503a, #853826); border-color: #f09a7f; }
.btn-icon { padding: 0.35rem; min-width: 2.25rem; }
.btn-lg { min-height: 3rem; font-size: 1.15rem; padding: 0.6rem 1.6rem; }
.btn-sm { min-height: 2rem; padding: 0.25rem 0.6rem; font-size: 0.85rem; }
.btn-back { --b-bg: rgba(20, 23, 15, 0.7); }
.btn-label { overflow: hidden; text-overflow: ellipsis; }
.btn-block { width: 100%; }

/* ------------------------------------------------------------------ form controls */
.field { display: flex; flex-direction: column; gap: 0.3rem; min-width: 0; }
.field-label { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--c-dim); font-weight: 600; }
.field-hint { font-size: 0.8rem; color: var(--c-dim); }
.field-error { font-size: 0.85rem; color: #ff8f73; min-height: 1.1em; }
.input {
  width: 100%; min-height: 2.25rem; padding: 0.35rem 0.6rem; border-radius: var(--r);
  border: 1px solid var(--c-line); background: rgba(8, 10, 6, 0.6); color: var(--c-paper); font-weight: 500;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4);
}
.input::placeholder { color: #7f7860; }
.input:focus { border-color: var(--c-brass); }
.input[aria-invalid='true'] { border-color: var(--c-rust); }
textarea.input { resize: vertical; min-height: 4.5rem; }
select.input { appearance: none; padding-right: 2rem; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--c-brass) 50%), linear-gradient(135deg, var(--c-brass) 50%, transparent 50%);
  background-position: calc(100% - 15px) 50%, calc(100% - 10px) 50%; background-size: 5px 5px; background-repeat: no-repeat; background-color: rgba(8, 10, 6, 0.6); }
select.input option { background: #1c2016; color: var(--c-text); }

.seg { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--c-line); border-radius: var(--r); overflow: hidden; background: rgba(0, 0, 0, 0.3); }
.seg-btn {
  display: inline-flex; align-items: center; gap: 0.35rem; min-height: 2.1rem; padding: 0.3rem 0.8rem; border: 0; border-right: 1px solid var(--c-line);
  background: transparent; color: var(--c-dim); cursor: pointer; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; font-size: 0.9rem;
}
.seg-btn:last-child { border-right: 0; }
.seg-btn:hover:not(:disabled) { color: var(--c-paper); background: rgba(216, 178, 90, 0.08); }
.seg-btn.active, .seg-btn.active:hover:not(:disabled) { background: linear-gradient(180deg, #d9b863, #ad883a); color: var(--c-ink); }
.seg-btn:disabled { cursor: not-allowed; opacity: 0.5; }

.toggle { display: inline-flex; align-items: center; gap: 0.6rem; cursor: pointer; min-height: 2rem; }
.toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.toggle-track { position: relative; width: 2.6rem; height: 1.35rem; border-radius: 1rem; background: #11140c; border: 1px solid var(--c-line-2); transition: background 120ms; flex: none; }
.toggle-thumb { position: absolute; top: 2px; left: 2px; width: calc(1.35rem - 6px); height: calc(1.35rem - 6px); border-radius: 50%; background: var(--c-dim); transition: transform 140ms var(--ease), background 120ms; }
.toggle input:checked + .toggle-track { background: #5d6b34; border-color: var(--c-brass); }
.toggle input:checked + .toggle-track .toggle-thumb { transform: translateX(1.25rem); background: var(--c-paper); }
.toggle input:focus-visible + .toggle-track { outline: 2px solid var(--c-brass); outline-offset: 2px; }
.toggle.disabled { opacity: 0.5; cursor: not-allowed; }
.toggle-label { color: var(--c-text); }

.slider-wrap { display: flex; align-items: center; gap: 0.75rem; min-width: 12rem; }
.slider {
  --p: 50%; flex: 1; appearance: none; height: 0.4rem; border-radius: 1rem; cursor: pointer;
  background: linear-gradient(90deg, var(--c-brass) 0 var(--p), #11140c var(--p) 100%); border: 1px solid var(--c-line);
}
.slider::-webkit-slider-thumb { appearance: none; width: 1.05rem; height: 1.05rem; border-radius: 2px; background: var(--c-paper); border: 2px solid var(--c-brass-2); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.6); transform: rotate(45deg); }
.slider::-moz-range-thumb { width: 1rem; height: 1rem; border-radius: 2px; background: var(--c-paper); border: 2px solid var(--c-brass-2); }
.slider-val { font-family: var(--f-num); font-weight: 700; min-width: 3.4rem; text-align: right; color: var(--c-paper); }

.stepper { display: inline-flex; align-items: center; border: 1px solid var(--c-line); border-radius: var(--r); background: rgba(0, 0, 0, 0.3); }
.stepper .stepper-btn { min-height: 2rem; min-width: 2rem; border: 0; box-shadow: none; border-radius: 0; font-size: 1.1rem; }
.stepper-val { min-width: 4.5rem; text-align: center; font-family: var(--f-num); font-weight: 700; font-size: 1.05rem; color: var(--c-paper); padding: 0 0.3rem; }
.stepper.disabled { opacity: 0.5; }

/* ------------------------------------------------------------------ avatars */
.avatar { position: relative; width: 2.5rem; height: 2.5rem; flex: none; border-radius: 3px; overflow: hidden; border: 1px solid var(--c-line-2); background: #0f120b; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar.sm { width: 1.8rem; height: 1.8rem; }
.avatar.md { width: 3.2rem; height: 3.2rem; }
.avatar.lg { width: 6.5rem; height: 6.5rem; border: 2px solid var(--c-brass-2); }
.avatar-bot { display: grid; place-items: center; color: var(--c-dim); }
.avatar-bot .ico { width: 70%; height: 70%; }

/* ------------------------------------------------------------------ dialogs, toasts, tooltip */
.dialog-layer { position: fixed; inset: 0; z-index: 50; pointer-events: none; }
.dialog-backdrop {
  position: absolute; inset: 0; display: grid; place-items: center; pointer-events: auto;
  background: rgba(6, 8, 4, 0.66); animation: fade-in 160ms var(--ease);
}
.dialog-backdrop.leaving { animation: fade-out 180ms var(--ease) forwards; }
.dialog {
  width: min(32rem, calc(100vw - 2rem)); max-height: calc(100vh - 2rem); overflow: auto;
  background: linear-gradient(180deg, #2d3524, #1d2216); border: 1px solid var(--c-line-2); border-top: 3px solid var(--c-brass-2);
  border-radius: var(--r); box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7); padding: 1rem 1.2rem 1.1rem; animation: pop-in 180ms var(--ease);
}
.dialog.wide { width: min(52rem, calc(100vw - 2rem)); }
.dialog-head { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.75rem; }
.dialog-title { flex: 1; margin: 0; font-family: var(--f-stencil); font-weight: 400; text-transform: uppercase; letter-spacing: 0.05em; color: var(--c-brass); font-size: 1.3rem; }
.dialog-x { min-width: 2rem; min-height: 2rem; }
.dialog-text { margin: 0; color: var(--c-text); line-height: 1.45; }
.dialog-body { display: flex; flex-direction: column; gap: 0.75rem; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 0.6rem; margin-top: 1rem; flex-wrap: wrap; }
@keyframes fade-in { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }
@keyframes pop-in { from { opacity: 0; transform: translateY(8px) scale(0.98); } }

.toasts { position: fixed; top: 1rem; left: 50%; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; align-items: center; gap: 0.5rem; pointer-events: none; }
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: 0.6rem; max-width: min(36rem, calc(100vw - 2rem));
  padding: 0.55rem 1rem; border-radius: var(--r); background: rgba(28, 32, 22, 0.97); border: 1px solid var(--c-line-2); border-left: 4px solid var(--c-brass);
  box-shadow: var(--shadow); color: var(--c-paper); animation: toast-in 200ms var(--ease);
}
.toast-error { border-left-color: var(--c-rust); }
.toast-ok { border-left-color: var(--c-ok); }
.toast.leaving { animation: fade-out 280ms var(--ease) forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } }

.tooltip {
  position: fixed; left: 0; top: 0; z-index: 70; pointer-events: none; opacity: 0; max-width: 22rem;
  background: rgba(16, 19, 12, 0.97); border: 1px solid var(--c-line-2); border-radius: var(--r); padding: 0.5rem 0.7rem; box-shadow: var(--shadow);
  font-size: 0.9rem; color: var(--c-text); transition: opacity 100ms;
}
.tooltip.show { opacity: 1; }

/* ------------------------------------------------------------------ screen header */
.screen-head { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; flex: none; }
.screen-titles { flex: 1; min-width: 0; }
.screen-title {
  margin: 0; font-family: var(--f-stencil); font-weight: 400; text-transform: uppercase; letter-spacing: 0.05em;
  font-size: clamp(1.6rem, 2.6vw, 2.4rem); color: var(--c-paper); text-shadow: 0 2px 0 rgba(0, 0, 0, 0.6), 0 0 24px rgba(0, 0, 0, 0.5); line-height: 1.05;
}
.screen-title:focus { outline: none; }
.screen-sub { color: var(--c-dim); font-size: 1rem; margin-top: 0.15rem; }
.screen-head-right { display: flex; align-items: center; gap: 0.6rem; }

.spinner { display: inline-flex; gap: 0.3rem; align-items: center; }
.spinner span { width: 0.45rem; height: 0.45rem; background: var(--c-brass); border-radius: 1px; animation: blink 900ms infinite ease-in-out; }
.spinner span:nth-child(2) { animation-delay: 150ms; }
.spinner span:nth-child(3) { animation-delay: 300ms; }
@keyframes blink { 0%, 100% { opacity: 0.2; } 50% { opacity: 1; } }

.empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.4rem; padding: 2rem 1rem; color: var(--c-dim); text-align: center; }
.empty .ico { width: 2rem; height: 2rem; opacity: 0.7; }
.empty-text { color: var(--c-text); font-size: 1.05rem; }
.empty-hint { font-size: 0.9rem; }

.xpbar { height: 0.55rem; background: #0e110a; border: 1px solid var(--c-line); border-radius: 1rem; overflow: hidden; }
.xpbar-fill { height: 100%; background: linear-gradient(90deg, #a07c32, var(--c-brass)); box-shadow: 0 0 8px rgba(216, 178, 90, 0.5); }
.progress { height: 0.5rem; background: #0e110a; border: 1px solid var(--c-line); border-radius: 1rem; overflow: hidden; }
.progress-fill { height: 100%; width: 0; background: linear-gradient(90deg, #8e7a3a, var(--c-brass)); transition: width 220ms var(--ease); }

/* tabs */
.tabs { display: flex; flex-wrap: wrap; gap: 0.25rem; border-bottom: 1px solid var(--c-line); margin-bottom: 1rem; }
.tab {
  display: inline-flex; align-items: center; gap: 0.45rem; min-height: 2.4rem; padding: 0.4rem 1rem; border: 1px solid transparent; border-bottom: 0;
  background: transparent; color: var(--c-dim); cursor: pointer; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; border-radius: var(--r) var(--r) 0 0;
}
.tab:hover { color: var(--c-paper); }
.tab.active { color: var(--c-brass); background: rgba(43, 51, 33, 0.92); border-color: var(--c-line); margin-bottom: -1px; }

/* tables */
.table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.table th { text-align: left; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--c-dim); font-weight: 600; padding: 0.4rem 0.5rem; border-bottom: 1px solid var(--c-line); position: sticky; top: 0; background: #20261a; }
.table td { padding: 0.4rem 0.5rem; border-bottom: 1px solid rgba(77, 86, 54, 0.45); vertical-align: middle; }
.table td.num, .table th.num { text-align: right; font-family: var(--f-num); font-weight: 600; }
.table tbody tr:hover { background: rgba(216, 178, 90, 0.06); }
.table tr.clickable { cursor: pointer; }
.table tr.me { background: rgba(216, 178, 90, 0.14); }
.cell-player { display: flex; align-items: center; gap: 0.55rem; min-width: 0; }
.cell-player .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ------------------------------------------------------------------ loading */
.screen-loading { background: #0c0e09; justify-content: center; align-items: center; }
.screen-loading::before {
  content: ''; position: absolute; inset: 0; opacity: 0.32; filter: grayscale(0.4) contrast(1.1);
  background: url('../assets/img/title_keyart.webp') center / cover no-repeat;
}
.screen-loading::after { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse at center, transparent 0%, rgba(8, 9, 6, 0.85) 75%); }
.loading-card { position: relative; z-index: 1; width: min(40rem, calc(100vw - 2rem)); padding: 1.4rem 1.8rem 1.2rem; margin-top: 4.5rem; }
.loading-card .stamp { max-width: 14rem; font-size: 0.72rem; flex: none; }
.loading-card .paper-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.loading-title { margin: 0.2rem 0 0; font-family: var(--f-stencil); font-weight: 400; font-size: 2.2rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--c-ink); line-height: 1; }
.loading-op { font-family: var(--f-display); color: #5b5131; letter-spacing: 0.06em; text-transform: uppercase; margin-top: 0.3rem; }
.loading-steps { list-style: none; margin: 0.9rem 0 0.8rem; padding: 0; display: grid; gap: 0.15rem; font-family: var(--f-num); font-weight: 600; font-size: 1.02rem; }
.loading-step { display: flex; align-items: center; gap: 0.55rem; color: #6c6448; }
.loading-step .ico { width: 1.05rem; height: 1.05rem; opacity: 0; }
.loading-step.active { color: var(--c-ink); }
.loading-step.active .ico { opacity: 1; animation: blink 900ms infinite; }
.loading-step.done { color: #2f3b1d; }
.loading-step.done .ico { opacity: 1; color: #4b6a24; }
.loading-step.fail { color: #8d3a25; }
.loading-step.fail .ico { opacity: 1; }
.paper .progress { background: rgba(0, 0, 0, 0.15); border-color: #a8996f; }
.paper .progress-fill { background: linear-gradient(90deg, #5c6b2d, #7e8f3a); }
.loading-tip { margin-top: 0.9rem; min-height: 2.6em; color: #3f3a28; font-size: 0.98rem; }
.loading-tip b { font-family: var(--f-display); font-weight: 400; color: var(--c-rust); text-transform: uppercase; letter-spacing: 0.05em; margin-right: 0.35rem; }
.loading-ready { margin-top: 1rem; display: flex; flex-direction: column; align-items: center; gap: 0.6rem; }
.loading-hint { color: #4b4430; font-size: 0.95rem; animation: pulse 1.6s infinite ease-in-out; }
@keyframes pulse { 0%, 100% { opacity: 0.55; } 50% { opacity: 1; } }
.loading-lang { display: flex; align-items: center; gap: 0.6rem; justify-content: center; margin-top: 0.4rem; color: #4b4430; }
.loading-lang .seg { background: rgba(0, 0, 0, 0.12); border-color: #a8996f; }
.loading-lang .seg-btn { color: #4b4430; border-color: #a8996f; }
.loading-lang .seg-btn.active { color: var(--c-ink); }
.loading-foot { position: absolute; z-index: 1; bottom: 1rem; left: 0; right: 0; display: flex; justify-content: center; gap: 1.5rem; color: var(--c-dim); font-size: 0.9rem; }
.loading-brand { position: absolute; z-index: 1; top: 1.4rem; left: 0; right: 0; text-align: center; }
.brand-title { font-family: var(--f-stencil); font-weight: 400; text-transform: uppercase; letter-spacing: 0.04em; color: var(--c-paper); font-size: clamp(2.2rem, 5vw, 4.4rem); line-height: 0.95; text-shadow: 0 3px 0 rgba(0, 0, 0, 0.65), 0 0 40px rgba(0, 0, 0, 0.6); margin: 0; }
.brand-sub { font-family: var(--f-display); color: var(--c-brass); letter-spacing: 0.32em; text-transform: uppercase; font-size: clamp(0.85rem, 1.4vw, 1.2rem); text-shadow: 0 2px 0 rgba(0, 0, 0, 0.6); }

/* match loading overlay */
.match-loading { position: fixed; inset: 0; z-index: 40; pointer-events: auto; display: grid; place-items: center; background: rgba(8, 10, 6, 0.92); }
.match-loading .panel { width: min(34rem, calc(100vw - 2rem)); text-align: center; }
.match-loading .panel-title { justify-content: center; font-size: 1.5rem; }
.match-loading .loading-tip { color: var(--c-dim); }
.match-loading .loading-tip b { color: var(--c-brass); }

/* ------------------------------------------------------------------ intro */
.screen-intro { background: #000; cursor: pointer; }
.intro-img { position: absolute; inset: -4%; background-size: cover; background-position: center; opacity: 0; transition: opacity 900ms ease; will-change: transform, opacity; }
.intro-img.show { opacity: 1; animation: kenburns 9s ease-out forwards; }
.intro-img.alt.show { animation-name: kenburns-alt; }
@keyframes kenburns { from { transform: scale(1.02) translate(0, 0); } to { transform: scale(1.12) translate(-1.5%, -1%); } }
@keyframes kenburns-alt { from { transform: scale(1.12) translate(1%, 0); } to { transform: scale(1.03) translate(-1%, 1%); } }
.screen-intro::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, rgba(0, 0, 0, 0.55) 0%, transparent 25%, transparent 55%, rgba(0, 0, 0, 0.85) 100%); }
.intro-sub {
  position: absolute; z-index: 2; left: 50%; bottom: 9%; transform: translateX(-50%); width: min(60rem, calc(100vw - 3rem));
  text-align: center; font-size: clamp(1.15rem, 2vw, 1.65rem); color: #f3ead0; font-weight: 500; line-height: 1.35;
  text-shadow: 0 2px 4px #000, 0 0 18px rgba(0, 0, 0, 0.9); opacity: 0; transition: opacity 500ms;
}
.intro-sub.show { opacity: 1; }
.intro-skip { position: absolute; z-index: 3; top: 1.2rem; right: 1.4rem; display: flex; align-items: center; gap: 0.7rem; }
.intro-skip-hint { color: var(--c-dim); font-size: 0.9rem; text-shadow: 0 1px 2px #000; }
.intro-dots { position: absolute; z-index: 2; bottom: 4%; left: 50%; transform: translateX(-50%); display: flex; gap: 0.45rem; }
.intro-dots span { width: 1.6rem; height: 3px; background: rgba(255, 255, 255, 0.22); }
.intro-dots span.on { background: var(--c-brass); }
.intro-brand { position: absolute; z-index: 2; top: 1.2rem; left: 1.4rem; font-family: var(--f-stencil); color: rgba(230, 220, 191, 0.75); letter-spacing: 0.08em; text-transform: uppercase; }

/* ------------------------------------------------------------------ main menu */
.screen-menu { background: linear-gradient(90deg, rgba(10, 12, 8, 0.88) 0%, rgba(10, 12, 8, 0.55) 38%, rgba(10, 12, 8, 0.1) 62%, rgba(10, 12, 8, 0.35) 100%); }
.menu-wrap { position: relative; height: 100%; display: grid; grid-template-columns: minmax(20rem, 30rem) 1fr minmax(18rem, 24rem); gap: 2rem; padding: 2rem 2.5rem 1.2rem; min-height: 0; }
.menu-left { display: flex; flex-direction: column; min-height: 0; }
.menu-brand { margin-bottom: 0.8rem; }
.menu-brand .brand-title { font-size: clamp(2.1rem, 3.6vw, 2.9rem); }
.menu-welcome { color: var(--c-paper); font-size: 1.15rem; margin: 0.2rem 0 0.1rem; display: flex; align-items: center; gap: 0.5rem; }
.menu-first { color: var(--c-brass); font-size: 0.95rem; margin-bottom: 0.6rem; }
.menu-nav { display: flex; flex-direction: column; gap: 0.35rem; overflow: auto; padding: 0.2rem 0.3rem 0.2rem 0; }
.menu-btn {
  display: grid; grid-template-columns: 2.4rem 1fr auto; align-items: center; gap: 0.75rem; text-align: left; min-height: 3rem;
  padding: 0.3rem 0.9rem 0.3rem 0.6rem; border: 1px solid rgba(106, 115, 73, 0.6); border-left: 4px solid var(--c-line-2); border-radius: var(--r);
  background: linear-gradient(90deg, rgba(36, 42, 28, 0.94), rgba(26, 30, 20, 0.82)); color: var(--c-paper); cursor: pointer;
  transition: border-color 120ms, background 120ms, transform 120ms var(--ease);
}
.menu-btn .ico { width: 1.7rem; height: 1.7rem; color: var(--c-brass); justify-self: center; }
.menu-btn-label { display: block; font-family: var(--f-stencil); text-transform: uppercase; letter-spacing: 0.05em; font-size: 1.12rem; line-height: 1.1; }
.menu-btn-desc { display: block; font-size: 0.88rem; color: var(--c-dim); line-height: 1.2; }
.menu-btn:hover:not(:disabled), .menu-btn:focus-visible { border-left-color: var(--c-brass); background: linear-gradient(90deg, rgba(56, 64, 40, 0.96), rgba(32, 37, 25, 0.88)); transform: translateX(4px); }
.menu-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.menu-btn.primary { border-left-color: var(--c-brass); background: linear-gradient(90deg, rgba(92, 78, 36, 0.95), rgba(40, 38, 22, 0.88)); }
.menu-btn.primary .menu-btn-label { color: #ffe7a6; }
.menu-right { display: flex; flex-direction: column; gap: 1rem; min-height: 0; overflow: auto; grid-column: 3; }
.server-box .row { gap: 0.5rem; }
.server-dot { width: 0.65rem; height: 0.65rem; border-radius: 50%; background: var(--c-dim); flex: none; box-shadow: 0 0 6px currentColor; }
.server-dot.online { background: var(--c-ok); color: var(--c-ok); }
.server-dot.offline { background: var(--c-rust); color: var(--c-rust); }
.server-dot.connecting { background: var(--c-brass); color: var(--c-brass); animation: blink 900ms infinite; }
.server-line { color: var(--c-paper); font-weight: 600; }
.news-item { padding: 0.55rem 0; border-top: 1px solid rgba(77, 86, 54, 0.55); }
.news-item:first-of-type { border-top: 0; padding-top: 0; }
.news-title { color: var(--c-paper); font-weight: 600; font-size: 1.02rem; }
.news-body { color: var(--c-dim); font-size: 0.92rem; }
.menu-foot { position: absolute; left: 2.5rem; right: 2.5rem; bottom: 0.9rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; color: var(--c-dim); font-size: 0.9rem; pointer-events: none; }
.menu-foot > * { pointer-events: auto; }
.menu-wrap { padding-top: 1.4rem; padding-bottom: 3.4rem; }

/* ------------------------------------------------------------------ battle form (skirmish / create) */
.form-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
.form-col { display: flex; flex-direction: column; gap: 1rem; min-width: 0; }
.form-sec .fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); gap: 0.8rem 1rem; }
.form-sec .fields.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.mode-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr)); gap: 0.5rem; margin-bottom: 0.9rem; }
.mode-card, .map-card, .nation-btn {
  position: relative; display: flex; flex-direction: column; gap: 0.25rem; text-align: left; padding: 0.55rem 0.65rem; min-height: 3rem;
  border: 1px solid var(--c-line); border-radius: var(--r); background: rgba(10, 12, 8, 0.45); color: var(--c-text); cursor: pointer;
  transition: border-color 120ms, background 120ms;
}
.mode-card:hover, .map-card:hover, .nation-btn:hover { border-color: var(--c-line-2); background: rgba(216, 178, 90, 0.07); }
.mode-card.active, .map-card.active, .nation-btn.active { border-color: var(--c-brass); background: linear-gradient(180deg, rgba(216, 178, 90, 0.2), rgba(216, 178, 90, 0.06)); box-shadow: inset 0 0 0 1px rgba(216, 178, 90, 0.35); }
.mode-card .ico { width: 1.4rem; height: 1.4rem; color: var(--c-brass); }
/* long German compounds ("Sektorenkontrolle") shrink to the card width instead of breaking mid-word */
.mode-name { font-family: var(--f-stencil); text-transform: uppercase; font-size: min(0.8rem, 8.6cqi); letter-spacing: 0; color: var(--c-paper); line-height: 1.1; overflow-wrap: break-word; }
.mode-card, .map-card { min-width: 0; }
.mode-card { container-type: inline-size; }
.mode-desc { color: var(--c-dim); font-size: 0.92rem; margin: -0.3rem 0 0.9rem; min-height: 2.4em; }
.map-list { position: relative; display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); gap: 0.5rem; max-height: 17rem; overflow: auto; padding-right: 0.2rem; }
.form-sec > .field .seg { align-self: flex-start; }
.map-card canvas { width: 100%; height: 2.6rem; display: block; border-radius: 2px; background: #11140c; }
.map-name { color: var(--c-paper); font-weight: 600; line-height: 1.15; }
.map-meta { color: var(--c-dim); font-size: 0.82rem; display: flex; flex-wrap: wrap; gap: 0.15rem 0.6rem; }
.nation-grid { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.nation-btn { flex-direction: row; align-items: center; gap: 0.5rem; min-height: 2.6rem; padding: 0.35rem 0.7rem; }
.nation-btn .flag { width: 1.8rem; height: 1.2rem; }
.slot-list { display: flex; flex-direction: column; gap: 0.35rem; }
.slot-row { display: grid; grid-template-columns: 1.8rem 1fr minmax(7rem, 9rem); align-items: center; gap: 0.6rem; padding: 0.3rem 0.5rem; border: 1px solid rgba(77, 86, 54, 0.6); border-radius: var(--r); background: rgba(10, 12, 8, 0.35); }
.slot-row .flag { width: 1.6rem; height: 1.05rem; }
.slot-row.me { border-color: var(--c-brass-2); }
.slot-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team-label { display: flex; align-items: center; gap: 0.5rem; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--c-dim); margin: 0.4rem 0 0.2rem; font-weight: 600; }
.team-label::before { content: ''; width: 0.6rem; height: 0.6rem; border-radius: 1px; background: var(--c-team0); }
.team-label.t1::before { background: var(--c-team1); }
.rule-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: 0.35rem 1rem; margin-top: 0.8rem; }
.form-foot { flex: none; display: flex; align-items: center; justify-content: flex-end; gap: 1rem; padding-top: 0.8rem; border-top: 1px solid var(--c-line); margin-top: 0.4rem; }
.form-summary { flex: 1; color: var(--c-paper); font-family: var(--f-display); letter-spacing: 0.05em; font-size: 1.1rem; display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.form-summary .dim { font-family: var(--f-ui); letter-spacing: 0; font-size: 0.95rem; }

/* ------------------------------------------------------------------ settings */
.st-panel { max-width: 56rem; }
.st-row { display: grid; grid-template-columns: minmax(12rem, 1fr) minmax(14rem, 1.3fr); align-items: center; gap: 1rem; padding: 0.55rem 0; border-bottom: 1px solid rgba(77, 86, 54, 0.45); }
.st-row:last-child { border-bottom: 0; }
.st-label { color: var(--c-paper); font-weight: 600; }
.st-hint { color: var(--c-dim); font-size: 0.86rem; font-weight: 500; }
.kb-table td:last-child { text-align: right; }
.kb-keys { display: inline-flex; flex-wrap: wrap; gap: 0.25rem; justify-content: flex-end; }

/* ------------------------------------------------------------------ credits */
.credits-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 1rem; align-items: start; }
.credit-big { font-family: var(--f-stencil); font-size: 2rem; color: var(--c-paper); text-transform: uppercase; letter-spacing: 0.04em; }
.credit-role { display: flex; justify-content: space-between; gap: 1rem; padding: 0.35rem 0; border-bottom: 1px solid rgba(77, 86, 54, 0.45); }
.credit-list { max-height: max(16rem, calc(100vh - 12.5rem)); overflow: auto; font-size: 0.9rem; }
.credit-list li { padding: 0.3rem 0; border-bottom: 1px solid rgba(77, 86, 54, 0.35); }
.credit-list ul { list-style: none; margin: 0; padding: 0; }
.credit-meta { color: var(--c-dim); font-size: 0.84rem; }

/* ------------------------------------------------------------------ online */
.on-grid { display: grid; grid-template-columns: minmax(16rem, 21rem) minmax(0, 1fr) minmax(16rem, 21rem); gap: 1rem; height: 100%; min-height: 0; }
.on-col { display: flex; flex-direction: column; gap: 1rem; min-height: 0; }
.lobby-panel { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.lobby-filters { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin-bottom: 0.6rem; }
.lobby-filters .input { width: auto; flex: 1; min-width: 10rem; }
.lobby-filters select.input { flex: 0 1 9rem; min-width: 7rem; }
.lobby-table-wrap { flex: 1; overflow: auto; min-height: 8rem; border: 1px solid rgba(77, 86, 54, 0.5); border-radius: var(--r); }
.state-tag { display: inline-block; padding: 0.05rem 0.45rem; border-radius: 2px; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 700; border: 1px solid currentColor; }
.state-waiting { color: var(--c-ok); }
.state-countdown { color: var(--c-brass); }
.state-ingame, .state-full { color: var(--c-rust); }
.chat-box { display: flex; flex-direction: column; min-height: 12rem; flex: 1; }
.lb-grid .chat-box { min-height: 14rem; max-height: 20rem; }
.chat-log { flex: 1; overflow: auto; font-size: 0.92rem; padding: 0.3rem 0.1rem; display: flex; flex-direction: column; gap: 0.2rem; min-height: 6rem; }
.chat-line { word-wrap: break-word; overflow-wrap: anywhere; }
.chat-line .who { color: var(--c-brass); font-weight: 600; margin-right: 0.35rem; }
.chat-line.system { color: var(--c-dim); font-style: italic; }
.chat-form { display: flex; gap: 0.4rem; margin-top: 0.5rem; }
.form-error { color: #ff8f73; font-size: 0.88rem; min-height: 1.2em; }

/* ------------------------------------------------------------------ lobby */
.lb-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(18rem, 1fr); gap: 1rem; height: 100%; min-height: 0; }
.lb-teams { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 1rem; align-content: start; }
.lb-team { border-top: 3px solid var(--c-team0); }
.lb-team.t1 { border-top-color: var(--c-team1); }
.lb-slot { display: grid; grid-template-columns: auto 1fr auto; gap: 0.6rem; align-items: center; padding: 0.45rem 0.5rem; border: 1px solid rgba(77, 86, 54, 0.55); border-radius: var(--r); background: rgba(10, 12, 8, 0.35); margin-bottom: 0.4rem; min-height: 3.4rem; }
.lb-slot.me { border-color: var(--c-brass-2); background: rgba(216, 178, 90, 0.08); }
.lb-slot.empty { border-style: dashed; color: var(--c-dim); grid-template-columns: 1fr auto; }
.lb-slot.empty > span { white-space: nowrap; }
.lb-slot.bot-edit .lb-slot-actions { grid-column: 1 / -1; justify-content: flex-start; }
.lb-slot.bot-edit .lb-slot-actions select.input { flex: 1; min-width: 0; }
.lb-slot-name { display: flex; align-items: center; gap: 0.4rem; min-width: 0; font-weight: 600; color: var(--c-paper); }
.lb-slot-name .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-slot-sub { display: flex; align-items: center; gap: 0.4rem; color: var(--c-dim); font-size: 0.85rem; flex-wrap: wrap; }
.lb-slot-actions { display: flex; align-items: center; gap: 0.35rem; flex-wrap: wrap; justify-content: flex-end; }
.lb-slot-actions select.input { width: auto; min-height: 2rem; padding-top: 0.15rem; padding-bottom: 0.15rem; }
.ready-tag { font-size: 0.78rem; text-transform: uppercase; font-weight: 700; letter-spacing: 0.06em; color: var(--c-dim); }
.ready-tag.ok { color: var(--c-ok); }
.host-crown { color: var(--c-brass); width: 1rem; height: 1rem; }
.lb-code { font-family: var(--f-display); font-size: 1.3rem; color: var(--c-brass); letter-spacing: 0.12em; }
.lb-countdown { font-family: var(--f-display); font-size: 1.6rem; color: var(--c-brass); text-align: center; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 0.25rem 0.8rem; font-size: 0.95rem; }
.kv dt { color: var(--c-dim); }
.kv dd { margin: 0; color: var(--c-paper); text-align: right; }

/* ------------------------------------------------------------------ profile */
.pf-head { display: grid; grid-template-columns: auto 1fr auto; gap: 1.2rem; align-items: center; margin-bottom: 1rem; }
.pf-name { font-family: var(--f-stencil); font-size: 1.8rem; text-transform: uppercase; color: var(--c-paper); line-height: 1.05; overflow-wrap: anywhere; }
.pf-rank { display: flex; align-items: center; gap: 0.5rem; color: var(--c-brass); font-weight: 600; }
.pf-meta { display: flex; flex-wrap: wrap; gap: 0.3rem 1rem; color: var(--c-dim); font-size: 0.92rem; align-items: center; margin-top: 0.3rem; }
.pf-bio { margin-top: 0.5rem; color: var(--c-text); white-space: pre-wrap; overflow-wrap: anywhere; }
.pf-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr)); gap: 0.5rem; }
.stat { background: rgba(10, 12, 8, 0.4); border: 1px solid rgba(77, 86, 54, 0.55); border-radius: var(--r); padding: 0.45rem 0.6rem; }
.stat-val { font-family: var(--f-num); font-weight: 700; font-size: 1.35rem; color: var(--c-paper); line-height: 1.1; }
.stat-label { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--c-dim); }
.ach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); gap: 0.5rem; }
.ach { display: flex; gap: 0.5rem; align-items: flex-start; padding: 0.45rem 0.55rem; border: 1px solid var(--c-line); border-radius: var(--r); background: rgba(216, 178, 90, 0.08); }
.ach .ico { color: var(--c-brass); width: 1.5rem; height: 1.5rem; }
.ach.locked { opacity: 0.45; filter: grayscale(1); background: transparent; }
.ach-name { color: var(--c-paper); font-weight: 600; line-height: 1.15; }
.ach-desc { color: var(--c-dim); font-size: 0.82rem; line-height: 1.2; }
.hist-row { display: grid; grid-template-columns: 6rem 1fr auto; gap: 0.6rem; align-items: center; padding: 0.35rem 0; border-bottom: 1px solid rgba(77, 86, 54, 0.4); font-size: 0.92rem; }
.hist-outcome { font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }
.hist-outcome.win { color: var(--c-ok); }
.hist-outcome.loss { color: var(--c-rust); }
.hist-outcome.draw { color: var(--c-brass); }
.avatar-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(3.4rem, 1fr)); gap: 0.4rem; max-height: 12rem; overflow: auto; padding: 0.2rem; }
.avatar-pick { padding: 0; border: 2px solid transparent; border-radius: 4px; background: none; cursor: pointer; }
.avatar-pick.active { border-color: var(--c-brass); }
.avatar-pick .avatar { width: 100%; height: auto; aspect-ratio: 1; }
.drop-zone { border: 2px dashed var(--c-line-2); border-radius: var(--r); padding: 0.8rem; text-align: center; color: var(--c-dim); }
.drop-zone.over { border-color: var(--c-brass); color: var(--c-paper); }
.crop-wrap { display: flex; flex-direction: column; align-items: center; gap: 0.6rem; }
.crop-canvas { width: 16rem; height: 16rem; border: 1px solid var(--c-line-2); cursor: grab; touch-action: none; background: #000; }

/* ------------------------------------------------------------------ responsive */
@media (max-width: 1180px) {
  .menu-wrap { grid-template-columns: minmax(18rem, 28rem) 1fr; }
  .menu-right { grid-column: 2; }
  .on-grid { grid-template-columns: minmax(15rem, 19rem) minmax(0, 1fr); }
  .on-grid > .on-col:last-child { grid-column: 1 / -1; }
}
@media (max-width: 900px) {
  .menu-wrap { grid-template-columns: 1fr; overflow: auto; }
  .menu-right { grid-column: 1; }
  .form-grid, .credits-grid, .pf-grid, .lb-grid, .on-grid { grid-template-columns: 1fr; height: auto; }
  .st-row { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
  .intro-img.show { animation: none; }
}
