:root {
  color-scheme: dark;
  font-family: "Segoe UI", "Microsoft YaHei", system-ui, sans-serif;
  color: #efe6d2;
  background: #071011;
  --ink: #071011;
  --panel: #121b1b;
  --panel-raised: #182323;
  --iron: #415052;
  --iron-bright: #718184;
  --bone: #efe6d2;
  --muted: #a9b0a7;
  --ember: #f49b32;
  --ember-hot: #ffc35a;
  --rust: #9b4c28;
  --teal: #2d8f8b;
  --teal-bright: #5cc8bd;
  --danger: #d8543f;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--ink); }
body {
  margin: 0;
  min-height: 100vh;
  padding: 24px;
  background:
    radial-gradient(circle at 78% 10%, rgba(244, 155, 50, .11), transparent 29rem),
    radial-gradient(circle at 12% 35%, rgba(45, 143, 139, .09), transparent 32rem),
    repeating-linear-gradient(115deg, rgba(255,255,255,.013) 0 1px, transparent 1px 9px),
    #071011;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  background: linear-gradient(rgba(255,255,255,.018), transparent 2px);
  background-size: 100% 4px;
  mix-blend-mode: soft-light;
  opacity: .35;
}

.container { max-width: 1180px; margin: 0 auto; display: grid; gap: 18px; }
.card {
  position: relative;
  overflow: hidden;
  border: 1px solid #3a4a49;
  border-radius: 18px;
  padding: 20px;
  background:
    linear-gradient(135deg, rgba(255,255,255,.025), transparent 38%),
    linear-gradient(180deg, rgba(24,35,35,.98), rgba(12,20,20,.98));
  box-shadow: 0 18px 45px rgba(0,0,0,.35), inset 0 1px rgba(255,255,255,.035);
}
.card::after {
  content: "";
  position: absolute;
  inset: 5px;
  pointer-events: none;
  border: 1px solid rgba(239,230,210,.045);
  border-radius: 13px;
}

.hero {
  min-height: 410px;
  isolation: isolate;
  display: flex;
  align-items: flex-end;
  padding: 0;
  border-color: #6c5638;
  background:
    linear-gradient(90deg, rgba(4,10,11,.94) 0%, rgba(4,10,11,.72) 38%, rgba(4,10,11,.08) 75%),
    url('/assets/assets/endless-road-hero-v2.png') center/cover;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(0deg, #071011 0%, transparent 42%), linear-gradient(90deg, rgba(7,16,17,.5), transparent 60%);
}
.hero::after { border-color: rgba(255,195,90,.11); }
.hero-copy {
  position: relative;
  z-index: 3;
  width: min(620px, 70%);
  padding: 34px;
  text-shadow: 0 3px 18px #000;
}
.hero-copy h1 {
  margin: 2px 0 8px;
  color: #fff4d6;
  font-family: Impact, "Microsoft YaHei", sans-serif;
  font-size: clamp(3rem, 9vw, 6.2rem);
  line-height: .9;
  letter-spacing: -.055em;
  transform: skew(-2deg);
}
.hero-lead { max-width: 55ch; margin: 14px 0; color: #e9e1d1; font-size: 1.04rem; line-height: 1.75; }
.eyebrow, .section-kicker {
  margin: 0 0 6px;
  color: var(--ember-hot);
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.hero-tags { display: flex; flex-wrap: wrap; gap: 7px; margin: 12px 0; }
.hero-tags span, .content-status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 10px;
  border: 1px solid rgba(239,230,210,.22);
  border-radius: 999px;
  color: #d9ded5;
  background: rgba(6,13,14,.7);
  backdrop-filter: blur(6px);
  font-size: .76rem;
}
.content-status { border-color: rgba(244,155,50,.55); color: #ffd48a; }
.hero-vehicle {
  position: absolute;
  z-index: 2;
  right: -2%;
  bottom: -22%;
  width: min(52%, 590px);
  height: auto;
  filter: drop-shadow(0 28px 28px rgba(0,0,0,.7));
  transform: rotate(-1deg);
  animation: vehicle-settle .7s ease-out both;
}
.audio-toggle {
  position: fixed;
  z-index: 110;
  top: 16px;
  right: max(16px, calc((100vw - 1180px) / 2 + 16px));
  min-height: 36px;
  padding: 7px 11px;
  border-radius: 999px;
  font-size: .72rem;
  backdrop-filter: blur(8px);
}
.audio-toggle[aria-pressed="true"] {
  color: #08211e;
  border-color: #71d7ca;
  background: linear-gradient(#8be3d7, #3ca99f);
  box-shadow: inset 0 1px rgba(255,255,255,.35), 0 4px 0 #185b56, 0 0 18px rgba(92,200,189,.24);
}
@keyframes vehicle-settle { from { opacity: 0; transform: translateX(35px) rotate(-1deg); } }

.hero-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.install-status { min-height: 1.1em; margin: 7px 0 0; color: #9fc1bb; font-size: .72rem; line-height: 1.4; }
.connectivity-panel {
  position: fixed;
  z-index: 130;
  left: 50%;
  bottom: max(14px, env(safe-area-inset-bottom));
  width: min(720px, calc(100vw - 24px));
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 14px;
  overflow: hidden;
  padding: 9px;
  transform: translateX(-50%);
  border: 1px solid #b8763a;
  border-radius: 15px;
  background: rgba(7, 17, 18, .96);
  box-shadow: 0 22px 70px rgba(0,0,0,.76), 0 0 0 1px rgba(255,195,90,.08);
  backdrop-filter: blur(14px);
}
.connectivity-panel > img {
  width: 190px;
  height: 107px;
  object-fit: cover;
  border: 1px solid #765238;
  border-radius: 10px;
  background: #081313;
}
.connectivity-copy { min-width: 0; align-self: center; padding: 5px 7px 5px 0; }
.connectivity-copy .section-kicker { margin-bottom: 3px; }
.connectivity-copy > strong { display: block; color: #ffe1a9; font-size: 1.02rem; }
.connectivity-copy > p:not(.section-kicker) { margin: 4px 0 8px; color: #c4cfcb; font-size: .76rem; line-height: 1.45; }
.connectivity-copy button { min-height: 32px; padding: 6px 10px; font-size: .7rem; }
.connectivity-panel[data-state="degraded"] { border-color: #a94d3d; }
.connectivity-panel[data-state="degraded"] .section-kicker,
.connectivity-panel[data-state="degraded"] strong { color: #ffad91; }
.connectivity-panel[data-state="recovering"] { border-color: #3d928a; }
.connectivity-panel[data-state="recovering"] .section-kicker,
.connectivity-panel[data-state="recovering"] strong { color: #8be0d5; }
.connectivity-panel[data-state="online"] { border-color: #4a9d74; }
.connectivity-panel[data-state="online"] .section-kicker,
.connectivity-panel[data-state="online"] strong { color: #9fe4bd; }
body[data-connectivity="offline"] .action-tray,
body[data-connectivity="degraded"] .action-tray,
body[data-connectivity="recovering"] .action-tray { opacity: .58; filter: saturate(.55); }

.briefing-open { min-height: 36px; margin-top: 2px; padding: 7px 12px; font-size: .76rem; }
.mission-briefing {
  width: min(900px, calc(100vw - 24px));
  max-width: none;
  max-height: calc(100dvh - 24px);
  margin: auto;
  padding: 0;
  overflow: auto;
  border: 1px solid #8f6637;
  border-radius: 18px;
  color: var(--bone);
  background: #0b1414;
  box-shadow: 0 28px 90px rgba(0,0,0,.82), 0 0 0 1px rgba(255,195,90,.09);
}
.mission-briefing:not([open]) { display: none; }
.mission-briefing::backdrop {
  background: rgba(2,7,8,.84);
  backdrop-filter: blur(6px) saturate(.7);
}
.briefing-shell { position: relative; min-height: 100%; background: linear-gradient(145deg, #17201f, #091211 72%); }
.briefing-art {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-bottom: 1px solid #75502f;
  background: #071011;
}
.briefing-close {
  position: absolute;
  z-index: 2;
  top: 12px;
  right: 12px;
  width: 38px;
  min-height: 38px;
  padding: 0;
  border-radius: 999px;
  font-size: 1.35rem;
  line-height: 1;
  backdrop-filter: blur(8px);
}
.briefing-content { padding: 20px 24px 24px; }
.briefing-progress-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.briefing-progress { color: #9bdcd4; font-size: .76rem; font-weight: 900; letter-spacing: .08em; }
.briefing-content h2 { margin-top: 2px; }
.briefing-content h2:focus { outline: 2px solid rgba(92,200,189,.6); outline-offset: 4px; border-radius: 4px; }
.briefing-intro { max-width: 70ch; margin: 6px 0 12px; color: var(--muted); line-height: 1.55; }
.briefing-dots {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
}
.briefing-dots li { height: 5px; overflow: hidden; border-radius: 999px; background: #32413f; }
.briefing-dots li[aria-current="step"] { background: linear-gradient(90deg, var(--teal-bright), var(--ember-hot)); box-shadow: 0 0 12px rgba(92,200,189,.3); }
.briefing-step { min-height: 190px; }
.briefing-step-label { margin: 0 0 5px; color: var(--ember-hot); font-size: .7rem; font-weight: 900; letter-spacing: .12em; }
.briefing-step h3 { margin: 4px 0 9px; font-size: clamp(1.15rem, 3vw, 1.45rem); }
.briefing-step > p:not(.briefing-step-label) { max-width: 72ch; margin: 0; color: #c9d2cb; line-height: 1.62; }
.briefing-rule-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin-top: 16px; }
.briefing-rule-grid span { padding: 10px; border: 1px solid #394b48; border-radius: 9px; color: #aab8b2; background: rgba(5,12,12,.55); font-size: .74rem; text-align: center; }
.briefing-rule-grid strong { display: block; margin-bottom: 3px; color: #ffe2a7; font-size: 1rem; }
.briefing-list { display: grid; gap: 8px; margin: 14px 0 0; padding-left: 1.2rem; color: #b9c9c3; line-height: 1.48; }
.briefing-list li::marker { color: var(--teal-bright); }
.briefing-callout { margin-top: 15px; padding: 11px 13px; border-left: 3px solid var(--teal-bright); color: #dff5ef; background: rgba(45,143,139,.12); line-height: 1.5; }
.briefing-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 20px; padding-top: 16px; border-top: 1px solid #2c3c39; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.battle-report-dialog {
  width: min(980px, calc(100vw - 24px));
  max-width: none;
  max-height: calc(100dvh - 24px);
  margin: auto;
  padding: 0;
  overflow: auto;
  border: 1px solid #4a8f88;
  border-radius: 18px;
  color: var(--bone);
  background: #071313;
  box-shadow: 0 28px 90px rgba(0,0,0,.84), 0 0 0 1px rgba(92,200,189,.1);
}
.battle-report-dialog:not([open]) { display: none; }
.battle-report-dialog::backdrop { background: rgba(2,7,8,.87); backdrop-filter: blur(7px) saturate(.72); }
.battle-report-shell { position: relative; padding: 22px; background: radial-gradient(circle at 100% 0, rgba(45,143,139,.16), transparent 36%), linear-gradient(145deg, #182321, #081211 72%); }
.battle-report-close {
  position: absolute;
  z-index: 2;
  top: 14px;
  right: 14px;
  width: 38px;
  min-height: 38px;
  padding: 0;
  border-radius: 999px;
  font-size: 1.35rem;
  line-height: 1;
}
.battle-report-heading { padding-right: 52px; }
.battle-report-heading h2 { margin-top: 2px; }
.battle-report-heading h2:focus { outline: 2px solid rgba(92,200,189,.65); outline-offset: 4px; border-radius: 4px; }
.battle-report-heading > p:last-child { max-width: 76ch; margin: 5px 0 16px; color: #aebcb7; line-height: 1.55; }
.battle-report-canvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  border: 1px solid #80613a;
  border-radius: 11px;
  background: linear-gradient(120deg, #674327, #0d2524 48%, #071313);
  box-shadow: 0 14px 35px rgba(0,0,0,.45);
}
.battle-report-summary { min-height: 1.55em; margin: 13px 0 9px; color: #d9e8e2; line-height: 1.5; }
.battle-report-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 0; }
.battle-report-facts > div { min-width: 0; padding: 9px 10px; border: 1px solid #334a46; border-radius: 9px; background: rgba(4,12,12,.58); }
.battle-report-facts dt { color: #849b96; font-size: .65rem; }
.battle-report-facts dd { margin: 3px 0 0; overflow-wrap: anywhere; color: #f3e7ce; font-size: .78rem; font-weight: 800; }
.battle-report-privacy { margin: 12px 0; padding: 10px 12px; border-left: 3px solid #4aaea3; color: #9db5af; background: rgba(45,143,139,.09); font-size: .7rem; line-height: 1.55; }
.battle-report-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.battle-report-actions button { flex: 1 1 170px; }
.battle-report-status { min-height: 1.4em; margin: 10px 0 0; color: #9bdcd4; font-size: .72rem; }

h1, h2, h3, p { overflow-wrap: anywhere; }
h2 { margin: 2px 0 8px; color: #f7edd7; font-size: clamp(1.35rem, 3vw, 1.8rem); }
h3 { color: #f7edd7; }
.section-copy { max-width: 68ch; margin: 4px 0 16px; color: var(--muted); line-height: 1.65; }
.row { display: flex; gap: 10px; flex-wrap: wrap; }

button {
  min-height: 42px;
  padding: 10px 16px;
  border: 1px solid #b8672c;
  border-radius: 9px;
  color: #211409;
  background: linear-gradient(#ffc65f, #dc7f2c);
  box-shadow: inset 0 1px rgba(255,255,255,.4), 0 4px 0 #6c351c, 0 9px 18px rgba(0,0,0,.22);
  cursor: pointer;
  font: inherit;
  font-weight: 900;
  letter-spacing: .01em;
  transition: transform .14s ease, filter .14s ease, box-shadow .14s ease;
}
button:hover { filter: brightness(1.08); transform: translateY(-1px); }
button:active { transform: translateY(2px); box-shadow: inset 0 1px rgba(255,255,255,.25), 0 2px 0 #6c351c; }
button:focus-visible, input:focus-visible, summary:focus-visible { outline: 3px solid var(--teal-bright); outline-offset: 3px; }
button:disabled { cursor: wait; filter: grayscale(.5); opacity: .55; transform: none; }
button.button-secondary { color: #e8e2d4; border-color: #526261; background: linear-gradient(#344544, #202e2e); box-shadow: inset 0 1px rgba(255,255,255,.12), 0 4px 0 #101817; }
button.retry-pending { border-color: #ffe19a; color: #2a1908; background: #ffd166; box-shadow: 0 0 0 3px rgba(255,209,102,.28), 0 4px 0 #784719; }

label { display: block; margin: 8px 0; color: #d7d1c2; }
input {
  max-width: 100%;
  margin-left: 8px;
  padding: 9px 11px;
  border: 1px solid #4b5e5c;
  border-radius: 8px;
  color: #f4ecd9;
  background: #091211;
}
#authTips { min-height: 1.5em; color: #c9d2c9; }

.world-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
.world-card {
  min-width: 0;
  padding: 14px;
  border: 1px solid #4b5d58;
  border-radius: 12px;
  background: radial-gradient(circle at 100% 0, rgba(231,138,52,.12), transparent 42%), #101a18;
  box-shadow: inset 0 1px rgba(255,255,255,.04), 0 7px 18px rgba(0,0,0,.2);
}
.world-card[data-status="active"] { border-color: #388f85; background: radial-gradient(circle at 100% 0, rgba(64,190,174,.16), transparent 44%), #101d1b; }
.world-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.world-card-title { min-width: 0; }
.world-card-title strong { display: block; color: #fff0d3; font-size: .94rem; }
.world-card-title small { display: block; margin-top: 3px; color: #71817d; font-size: .64rem; }
.world-status {
  flex: 0 0 auto;
  padding: 5px 8px;
  border: 1px solid #66543c;
  border-radius: 999px;
  color: #efc98f;
  background: rgba(57,39,23,.62);
  font-size: .66rem;
  font-weight: 900;
}
.world-card[data-status="active"] .world-status { border-color: #398e86; color: #9ce2d8; background: rgba(20,79,74,.32); }
.world-card-meta { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; margin: 12px 0; }
.world-card-meta span { padding: 7px; border: 1px solid #35433f; border-radius: 8px; color: #9caaa5; font-size: .65rem; text-align: center; background: rgba(5,12,11,.5); }
.world-card-meta strong { display: block; margin-top: 2px; color: #f1e5ca; font-size: .76rem; }
.world-card-ending { min-height: 1.3em; margin: 0 0 10px; color: #9bcfc6; font-size: .7rem; }
.world-card-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.world-card-actions button { flex: 1 1 120px; min-height: 36px; padding: 7px 10px; font-size: .72rem; }
button.button-danger { color: #ffe1d4; border-color: #914f3a; background: linear-gradient(#6d392d, #41241e); box-shadow: inset 0 1px rgba(255,255,255,.1), 0 4px 0 #24110e; }

.game-heading, .route-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.game-heading-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.lobby-toggle, .game-briefing-button, .game-report-button { min-height: 34px; padding: 7px 11px; font-size: .75rem; }
.run-status-badge {
  padding: 8px 12px;
  border: 1px solid #398e86;
  border-radius: 999px;
  color: #9ce2d8;
  background: rgba(20,79,74,.32);
  font-size: .8rem;
}
.route-panel {
  margin: 15px 0;
  padding: 15px 18px 24px;
  border: 1px solid #4d5b57;
  border-radius: 13px;
  background: linear-gradient(90deg, #111a19, #1b201b 58%, #281d14);
}
.route-heading span { color: var(--muted); font-size: .78rem; }
.route-heading strong { color: var(--ember-hot); }
.route-track {
  position: relative;
  height: 13px;
  margin-top: 15px;
  border: 2px solid #070b0b;
  border-radius: 999px;
  background: repeating-linear-gradient(90deg, #273332 0 18px, #1c2726 18px 21px);
  box-shadow: inset 0 2px 5px #000;
}
.route-track > progress {
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border: 0;
  border-radius: inherit;
  appearance: none;
  background: transparent;
}
.route-track > progress::-webkit-progress-bar { background: transparent; }
.route-track > progress::-webkit-progress-value { border-radius: inherit; background: linear-gradient(90deg, #318e84, #f09a36); box-shadow: 0 0 14px rgba(244,155,50,.4); transition: width .45s ease; }
.route-track > progress::-moz-progress-bar { border-radius: inherit; background: linear-gradient(90deg, #318e84, #f09a36); box-shadow: 0 0 14px rgba(244,155,50,.4); }
.route-marker { position: absolute; top: 15px; transform: translateX(-50%); color: #72817d; font-size: .62rem; }
.marker-0 { left: 0; }
.marker-25 { left: 25%; }
.marker-50 { left: 50%; }
.marker-75 { left: 75%; }
.marker-100 { left: 100%; }
.route-nodes {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(132px, 1fr);
  gap: 8px;
  margin: 31px -3px -9px;
  padding: 3px 3px 10px;
  overflow-x: auto;
  scrollbar-color: #73532f #111817;
  scroll-snap-type: x proximity;
}
.route-node {
  min-height: 82px;
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 9px 10px;
  border: 1px solid #34433f;
  border-radius: 9px;
  color: #8d9b97;
  background: #101817;
  scroll-snap-align: center;
}
.route-node span { color: #70807c; font-size: .6rem; font-weight: 900; letter-spacing: .08em; }
.route-node strong { color: #b9c5c1; font-size: .76rem; line-height: 1.25; }
.route-node small { color: #66736f; font-size: .62rem; }
.route-node.cleared { border-color: #286f68; background: linear-gradient(145deg, #102622, #0d1816); }
.route-node.cleared span, .route-node.cleared small { color: #62b9ae; }
.route-node.current { border-color: #e4973f; background: radial-gradient(circle at 100% 0, rgba(244,155,50,.28), transparent 48%), #2a1d12; box-shadow: 0 0 16px rgba(244,155,50,.18); }
.route-node.current span, .route-node.current strong { color: #ffd39a; }
.route-node.milestone { border-style: double; border-width: 3px; }

.status-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 14px 0; }
.status-grid article {
  min-width: 0;
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid #354746;
  border-radius: 11px;
  background: linear-gradient(145deg, #121d1c, #0a1212);
}
.status-grid span, .loadout-card span, .encounter-card span { color: #91a09c; font-size: .72rem; font-weight: 800; letter-spacing: .07em; }
.status-grid strong { color: #f4eddf; font-size: 1rem; }
.meter { width: 100%; height: 5px; overflow: hidden; border: 0; border-radius: 99px; appearance: none; background: #070b0b; }
.meter::-webkit-progress-bar { border-radius: inherit; background: #070b0b; }
.meter::-webkit-progress-value { border-radius: inherit; background: linear-gradient(90deg, #8e2e2e, #e76a3f); transition: width .35s ease; }
.meter::-moz-progress-bar { border-radius: inherit; background: linear-gradient(90deg, #8e2e2e, #e76a3f); }
.meter.energy::-webkit-progress-value { background: linear-gradient(90deg, #226f72, #5cc8bd); }
.meter.energy::-moz-progress-bar { background: linear-gradient(90deg, #226f72, #5cc8bd); }

.loadout-grid { display: grid; grid-template-columns: 1fr 1.25fr 1.3fr; gap: 10px; margin: 14px 0; }
.loadout-card {
  min-width: 0;
  min-height: 116px;
  display: flex;
  align-items: center;
  gap: 12px;
  overflow: hidden;
  padding: 10px;
  border: 1px solid #4d5144;
  border-radius: 13px;
  background: radial-gradient(circle at 15% 15%, rgba(244,155,50,.12), transparent 45%), #101817;
}
.loadout-card strong { display: block; margin-top: 5px; color: #ede4d3; font-size: .82rem; line-height: 1.45; }
.portrait-shell { flex: 0 0 88px; width: 88px; height: 96px; display: grid; place-items: center; overflow: hidden; border: 2px solid #8a6538; border-radius: 11px 11px 40% 40%; background: #21312f; box-shadow: inset 0 0 20px #000; }
.portrait-shell img { width: 100%; height: 100%; object-fit: cover; }
.portrait-shell span { color: #eeb75e; font-family: serif; font-size: 2.2rem; }
.vehicle-card img { flex: 0 0 112px; width: 112px; height: 96px; object-fit: contain; filter: drop-shadow(0 9px 8px #000); }
.build-gem { flex: 0 0 48px; width: 48px; height: 48px; transform: rotate(45deg); border: 2px solid #9bded3; background: radial-gradient(circle at 35% 30%, #b7fff3, #26847e 38%, #102c2c 70%); box-shadow: 0 0 18px rgba(92,200,189,.32), inset 0 0 9px #071010; }
.build-card > div:last-child { min-width: 0; flex: 1 1 auto; }
.build-badges { display: flex; gap: 6px; margin-top: 8px; padding-bottom: 4px; overflow-x: auto; scrollbar-color: #65522d #0c1514; }
.build-badge { flex: 0 0 66px; display: grid; justify-items: center; gap: 4px; margin: 0; padding: 5px; border: 1px solid #40534e; border-radius: 8px; background: #0b1413; }
.build-badge.affix { border-color: #6b5732; background: #19150f; }
.build-badge img { width: 38px; height: 38px; object-fit: cover; border-radius: 7px; box-shadow: 0 3px 8px #000; }
.build-badge figcaption { width: 100%; overflow: hidden; color: #c9d5d1; font-size: .56rem; line-height: 1.2; text-align: center; text-overflow: ellipsis; white-space: nowrap; }
.build-badge.affix figcaption { color: #e6c27e; }

.run-layout { display: grid; grid-template-columns: 1fr minmax(290px, .7fr); gap: 14px; margin: 14px 0; }
.inventory-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(142px, 1fr)); gap: 8px; }
.inventory-stack {
  min-width: 0;
  display: grid;
  grid-template-columns: 44px 1fr;
  align-items: center;
  gap: 8px;
  padding: 7px;
  border: 1px solid #364846;
  border-radius: 10px;
  background: #0c1514;
}
.inventory-icon { width: 44px; height: 44px; object-fit: contain; border-radius: 8px; background: radial-gradient(circle, #293b38, #101716); }
.inventory-item { min-width: 0; color: #d8d4c9; font-size: .76rem; line-height: 1.3; }
.inventory-use { grid-column: 1 / -1; width: 100%; min-height: 29px; padding: 5px 8px; font-size: .68rem; }

.choice-card, .ending-card {
  margin: 14px 0;
  padding: 16px;
  border: 1px solid #8e5c2f;
  border-radius: 13px;
  background: radial-gradient(circle at 100% 0, rgba(244,155,50,.15), transparent 36%), #21170f;
}
.choice-card { display: grid; grid-template-columns: minmax(220px, 34%) 1fr; gap: 16px; align-items: stretch; }
.choice-card > img { width: 100%; height: 100%; min-height: 170px; object-fit: cover; border: 1px solid #705039; border-radius: 9px; }
.choice-body { min-width: 0; align-self: center; }
.choice-body > span, .ending-body > span { color: var(--ember-hot); font-size: .7rem; font-weight: 900; letter-spacing: .12em; }
.choice-body h3, .ending-body h3 { margin: 5px 0 8px; }
.choice-description { margin: 0 0 11px; color: #cbb8a2; font-size: .78rem; line-height: 1.45; }
.choice-list { display: grid; gap: 8px; }
.choice-option { display: grid; gap: 4px; text-align: left; }
.choice-option strong { font-size: .82rem; }
.choice-option span { color: #4d321b; font-size: .68rem; line-height: 1.35; }
.choice-option small { color: #6f4520; font-weight: 700; }
.choice-card[data-kind="trade"] { border-color: #2f8c78; background: radial-gradient(circle at 100% 0, rgba(76,193,161,.18), transparent 40%), #12231e; }
.choice-card[data-kind="trade"] .choice-body > span { color: #79e0c3; }
.choice-card[data-kind="trade"] .choice-option { background: linear-gradient(135deg, #d8ad58, #efcf85); }
.ending-card { display: grid; grid-template-columns: minmax(240px, 42%) 1fr; gap: 0; overflow: hidden; padding: 0; border-color: #2c8f87; background: radial-gradient(circle at 100% 0, rgba(92,200,189,.16), transparent 40%), #0c2422; }
.ending-card > img { width: 100%; height: 100%; min-height: 220px; object-fit: cover; }
.ending-body { min-width: 0; align-self: center; padding: 18px; }
.ending-body > span { color: #74ddd2; }
.ending-body p { color: #c9d8d4; line-height: 1.55; }
.ending-actions { margin-top: 16px; }

.encounter-card {
  min-height: 198px;
  display: grid;
  grid-template-columns: 164px 1fr;
  gap: 13px;
  align-items: center;
  overflow: hidden;
  padding: 9px;
  border: 1px solid #834132;
  border-radius: 13px;
  background: radial-gradient(circle at 10% 10%, rgba(216,84,63,.2), transparent 45%), #211413;
}
.encounter-card.no-art { grid-template-columns: 1fr; }
.encounter-card img { width: 164px; height: 180px; object-fit: cover; border: 1px solid #6c4636; border-radius: 9px; }
.encounter-card strong { display: block; margin: 5px 0 10px; color: #ffdfb6; font-size: 1.02rem; }
.encounter-card p { margin: 5px 0 0; color: #e6b3a8; font-size: .78rem; }

.action-tray { position: sticky; bottom: 8px; z-index: 20; padding: 10px; border: 1px solid #41514e; border-radius: 13px; background: rgba(7,16,17,.92); backdrop-filter: blur(12px); box-shadow: 0 14px 35px #000; }
.action-tray button { flex: 1 1 135px; display: grid; gap: 2px; }
.action-tray button small { color: rgba(33,20,9,.62); font-size: .6rem; letter-spacing: .12em; text-transform: uppercase; }

pre { max-height: 390px; margin: 10px 0 0; padding: 12px; overflow: auto; border: 1px solid #263633; border-radius: 9px; color: #cbd8d4; background: #07100f; font-size: .76rem; }
details { margin-top: 14px; color: #8f9d99; }
summary { cursor: pointer; }
.hidden { display: none !important; }

.account-data { border-color: #5f4938; background: linear-gradient(145deg, rgba(57, 33, 25, .92), rgba(12, 23, 22, .96)); }
.account-data-links { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 13px 0 18px; }
.account-data-links a,
.site-footer a,
.legal-document a,
.legal-nav a { color: #79d8cc; text-underline-offset: 3px; }
.site-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 18px; padding: 10px 16px 28px; color: #71817d; font-size: .72rem; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 14px; }

.delete-account-dialog {
  width: min(92vw, 620px);
  max-height: min(90dvh, 760px);
  padding: 0;
  overflow: auto;
  border: 1px solid #9b463c;
  border-radius: 16px;
  color: var(--text);
  background: #101716;
  box-shadow: 0 28px 90px #000;
}
.delete-account-dialog::backdrop { background: rgba(2, 7, 7, .86); backdrop-filter: blur(4px); }
.delete-account-shell { display: grid; gap: 13px; padding: 26px; }
.delete-account-shell h2 { margin: 0; color: #ffd5c8; }
.delete-account-shell p { margin: 0; color: #cbb8b1; line-height: 1.6; }
.delete-account-shell .delete-account-caveat { padding: 11px; border-left: 3px solid #d87c49; background: rgba(104, 48, 34, .22); font-size: .78rem; }
.delete-account-shell label { color: #f2d8cd; font-weight: 800; }
.delete-account-shell input { width: 100%; border-color: #9b463c; background: #090e0e; }
.delete-account-status { min-height: 1.4em; color: #efac88 !important; }
.delete-account-actions { display: flex; justify-content: flex-end; gap: 10px; }

.legal-body { min-height: 100vh; padding: 24px; color: var(--text); background: radial-gradient(circle at 20% 0, #1c3733 0, #0a1212 45%, #070b0c 100%); }
.legal-container { width: min(100%, 920px); margin: 0 auto; }
.legal-nav { display: flex; flex-wrap: wrap; gap: 12px 20px; padding: 12px 2px 18px; }
.legal-document { padding: clamp(22px, 5vw, 52px); border: 1px solid #3b4f4b; border-radius: 18px; background: rgba(12, 22, 21, .96); box-shadow: 0 22px 70px rgba(0, 0, 0, .45); }
.legal-document h1 { margin: 7px 0 12px; color: #f1e5cf; font-size: clamp(2rem, 6vw, 3.4rem); }
.legal-document h2 { margin-top: 30px; color: #e5b866; }
.legal-document p,
.legal-document li { color: #bac8c3; line-height: 1.75; }
.legal-document li + li { margin-top: 7px; }
.legal-summary { max-width: 720px; font-size: 1rem; }
.legal-notice { margin: 24px 0; padding: 14px 16px; border: 1px solid #8e6638; border-radius: 10px; color: #e9cba4; background: rgba(111, 67, 31, .24); line-height: 1.65; }
.legal-operator { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; margin: 24px 0; }
.legal-operator > div { padding: 12px; border: 1px solid #31433f; border-radius: 9px; background: #0a1413; }
.legal-operator dt { color: #788c87; font-size: .68rem; letter-spacing: .09em; }
.legal-operator dd { margin: 6px 0 0; overflow-wrap: anywhere; color: #e2e6dd; }

@media (max-width: 860px) {
  body { padding: 12px; }
  .hero { min-height: 480px; }
  .hero-copy { width: 86%; padding: 24px; }
  .hero-vehicle { width: 62%; right: -12%; bottom: -8%; opacity: .82; }
  .loadout-grid { grid-template-columns: 1fr 1fr; }
  .build-card { grid-column: 1 / -1; }
  .run-layout { grid-template-columns: 1fr; }
}

@media (max-width: 580px) {
  body { padding: 0; }
  .container { gap: 10px; }
  .card { border-radius: 0; padding: 15px; }
  .card::after { border-radius: 0; }
  .hero { min-height: 540px; }
  .hero-copy { width: 100%; align-self: flex-start; padding: 24px 18px; }
  .audio-toggle { top: 12px; right: 12px; min-height: 34px; padding: 6px 9px; }
  .connectivity-panel {
    bottom: max(8px, env(safe-area-inset-bottom));
    width: calc(100vw - 16px);
    grid-template-columns: 104px 1fr;
    gap: 9px;
    padding: 7px;
    border-radius: 12px;
  }
  .connectivity-panel > img { width: 104px; height: 92px; }
  .connectivity-copy { padding-right: 3px; }
  .connectivity-copy > strong { font-size: .88rem; }
  .connectivity-copy > p:not(.section-kicker) { margin-bottom: 6px; font-size: .66rem; line-height: 1.35; }
  .connectivity-copy button { min-height: 29px; padding: 5px 8px; }
  body.game-active:not(.lobby-open) #hero,
  body.game-active:not(.lobby-open) #auth,
  body.game-active:not(.lobby-open) #worlds,
  body.game-active:not(.lobby-open) #accountData,
  body.game-active:not(.lobby-open) .site-footer { display: none !important; }
  body.game-active:not(.lobby-open) #game { padding-top: 58px; }
  .lobby-toggle {
    position: fixed;
    z-index: 110;
    top: 12px;
    left: 12px;
    min-height: 34px;
    padding: 6px 9px;
  }
  .hero-copy h1 { font-size: clamp(3.4rem, 19vw, 5.4rem); }
  .hero-lead { max-width: 92%; font-size: .92rem; }
  .hero-vehicle { width: 82%; right: -18%; bottom: -12%; }
  .status-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .world-list { grid-template-columns: 1fr; }
  .loadout-grid { grid-template-columns: 1fr; }
  .build-card { grid-column: auto; }
  .choice-card { grid-template-columns: 1fr; }
  .choice-card > img { aspect-ratio: 16 / 9; min-height: 0; }
  .ending-card { grid-template-columns: 1fr; }
  .ending-card > img { aspect-ratio: 16 / 9; min-height: 0; }
  .encounter-card { grid-template-columns: 116px 1fr; min-height: 154px; }
  .encounter-card img { width: 116px; height: 136px; }
  .inventory-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .action-tray { bottom: 0; border-radius: 10px 10px 0 0; }
  .action-tray button { flex-basis: calc(33.333% - 8px); min-width: 0; padding: 8px 5px; font-size: .76rem; }
  .mission-briefing { width: 100vw; max-height: 100dvh; border-radius: 0; }
  .briefing-content { padding: 16px 16px max(18px, env(safe-area-inset-bottom)); }
  .briefing-step { min-height: 225px; }
  .briefing-rule-grid { grid-template-columns: 1fr; }
  .briefing-rule-grid strong { display: inline; margin-right: 5px; }
  .briefing-actions { align-items: stretch; }
  .briefing-actions > button { flex: 0 0 auto; }
  .briefing-actions .row { flex: 1 1 auto; justify-content: flex-end; }
  .briefing-actions .row button { flex: 1 1 auto; padding-inline: 10px; }
  .battle-report-dialog { width: 100vw; max-height: 100dvh; border-radius: 0; }
  .battle-report-shell { padding: 16px 14px max(18px, env(safe-area-inset-bottom)); }
  .battle-report-heading { padding-right: 44px; }
  .battle-report-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .battle-report-actions button { flex-basis: 100%; }
  .delete-account-dialog { width: 100vw; max-height: 100dvh; border-radius: 0; }
  .delete-account-shell { padding: 20px 16px max(20px, env(safe-area-inset-bottom)); }
  .delete-account-actions button { flex: 1 1 50%; }
  .legal-body { padding: 0; }
  .legal-nav { padding: 14px 16px; }
  .legal-document { border-inline: 0; border-radius: 0; padding: 24px 17px 40px; }
  .legal-operator { grid-template-columns: 1fr; }
}

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