:root {
  color-scheme: dark;
  --ink: #0c0908;
  --bg: #130f0c;
  --bg-2: #1a120e;
  --panel: rgba(32, 23, 18, .92);
  --panel-2: rgba(44, 30, 22, .86);
  --line: rgba(224, 172, 105, .2);
  --line-strong: rgba(231, 184, 113, .46);
  --text: #f7efe4;
  --muted: #baa99a;
  --gold: #e7b871;
  --gold-light: #ffe0a2;
  --copper: #b7653d;
  --copper-light: #dc8651;
  --red: #8f3025;
  --green: #78ab7e;
  --shadow: 0 24px 70px rgba(0, 0, 0, .38);
  --radius: 24px;
  --radius-sm: 14px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  font-family: "Noto Serif SC", "Songti SC", STSong, "Microsoft YaHei", system-ui, sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }

html {
  min-width: 320px;
  min-height: 100%;
  scroll-behavior: smooth;
  background: var(--ink);
}

body {
  min-width: 320px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 50% -10%, rgba(177, 92, 48, .28), transparent 38rem),
    linear-gradient(145deg, #100c0a 0%, #18100c 48%, #0d0b0a 100%);
  line-height: 1.65;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  opacity: .12;
  background-image:
    linear-gradient(30deg, transparent 48%, rgba(255,255,255,.08) 49%, transparent 51%),
    linear-gradient(-30deg, transparent 48%, rgba(255,255,255,.05) 49%, transparent 51%);
  background-size: 11px 11px;
  mask-image: linear-gradient(to bottom, #000, transparent 75%);
}

button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
button:not(:disabled), a { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .46; }
[hidden] { display: none !important; }

:focus-visible {
  outline: 3px solid var(--gold-light);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  top: calc(var(--safe-top) + 8px);
  left: max(12px, var(--safe-left));
  z-index: 100;
  padding: 10px 14px;
  border-radius: 8px;
  color: #1a100a;
  background: var(--gold-light);
  transform: translateY(-180%);
  transition: transform .18s ease;
}
.skip-link:focus { transform: translateY(0); }

.atmosphere { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.atmosphere i { position: absolute; display: block; }
.atmosphere i:first-child {
  top: 8%; left: 50%; width: min(72vw, 780px); aspect-ratio: 1;
  border: 1px solid rgba(226, 174, 104, .11); border-radius: 50%; transform: translateX(-50%);
  box-shadow: 0 0 100px rgba(170, 86, 46, .09), inset 0 0 100px rgba(170, 86, 46, .07);
}
.atmosphere i:nth-child(2), .atmosphere i:nth-child(3) {
  top: 18%; width: 34vw; max-width: 460px; height: 76vh; opacity: .22;
  border: 2px solid rgba(221, 167, 98, .18); border-bottom: 0; border-radius: 50% 50% 0 0;
}
.atmosphere i:nth-child(2) { left: -18vw; }
.atmosphere i:nth-child(3) { right: -18vw; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: calc(66px + var(--safe-top));
  padding: calc(8px + var(--safe-top)) max(16px, var(--safe-right)) 8px max(16px, var(--safe-left));
  border-bottom: 1px solid rgba(230, 182, 112, .14);
  background: rgba(15, 11, 9, .78);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

.brand { display: inline-flex; align-items: center; gap: 10px; min-height: 48px; color: var(--text); text-decoration: none; }
.brand img { width: 42px; height: 42px; filter: drop-shadow(0 5px 12px rgba(0,0,0,.4)); }
.brand span { display: grid; line-height: 1.1; }
.brand strong { font-size: 1rem; letter-spacing: .08em; }
.brand small { margin-top: 5px; color: var(--muted); font-size: .65rem; letter-spacing: .16em; }
.topbar nav { display: flex; gap: 6px; }
.topbar nav button {
  display: inline-grid; grid-template-columns: auto auto; align-items: center; gap: 5px;
  min-width: 56px; min-height: 44px; padding: 8px 10px; border: 1px solid transparent; border-radius: 12px;
  color: var(--muted); background: transparent; font-size: .8rem;
}
.topbar nav button:hover { color: var(--gold-light); border-color: var(--line); background: rgba(255,255,255,.03); }
.topbar nav b { color: var(--gold); font-size: .9rem; }

#app { width: min(1180px, 100%); min-height: calc(100dvh - 150px); margin: 0 auto; padding: 24px max(16px, var(--safe-right)) 64px max(16px, var(--safe-left)); }
.view { animation: view-in .5s cubic-bezier(.16,.8,.3,1) both; }
@keyframes view-in { from { opacity: 0; transform: translateY(12px); } }

.panel {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(47, 32, 23, .94), rgba(25, 19, 15, .96));
  box-shadow: var(--shadow), inset 0 1px rgba(255,255,255,.035);
  overflow: hidden;
}
.panel::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
  background: linear-gradient(120deg, rgba(255,255,255,.025), transparent 30%, transparent 70%, rgba(202,116,70,.035));
}
.notice { padding: 16px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); color: var(--gold-light); background: rgba(89,49,29,.5); }

h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 12px; font-size: clamp(2rem, 9vw, 4.6rem); line-height: 1.13; letter-spacing: -.045em; }
h2 { margin-bottom: 8px; font-size: clamp(1.35rem, 4vw, 2rem); line-height: 1.25; }
h3 { line-height: 1.35; }
em { color: var(--gold-light); font-style: normal; }
.eyebrow { display: flex; align-items: center; gap: 9px; margin-bottom: 10px; color: var(--gold); font-size: .72rem; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; }
.eyebrow > i { width: 22px; height: 1px; background: linear-gradient(90deg, var(--copper), var(--gold)); box-shadow: 8px -3px var(--copper); }
.chip { display: inline-flex; align-items: center; min-height: 32px; padding: 5px 10px; border: 1px solid var(--line-strong); border-radius: 99px; color: var(--gold-light); background: rgba(181,101,61,.11); font-size: .72rem; white-space: nowrap; }

.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  min-height: 52px; padding: 12px 22px; border: 1px solid transparent; border-radius: 14px;
  font-weight: 800; letter-spacing: .06em; text-decoration: none; transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, filter .18s ease;
}
.button:not(:disabled):active { transform: translateY(1px) scale(.99); }
.button.primary { color: #1b100a; background: linear-gradient(135deg, #ffd79b 0%, #d89450 52%, #b85e38 100%); box-shadow: 0 12px 30px rgba(177,86,45,.22), inset 0 1px rgba(255,255,255,.42); }
.button.primary:not(:disabled):hover { filter: brightness(1.08); box-shadow: 0 16px 36px rgba(177,86,45,.34); transform: translateY(-2px); }
.button.ghost { border-color: var(--line-strong); color: var(--gold-light); background: rgba(255,255,255,.025); }
.button.ghost:hover { border-color: var(--gold); background: rgba(229,178,107,.08); }

.welcome { display: grid; min-height: calc(100dvh - 190px); align-items: center; }
.hero { display: grid; min-height: min(680px, calc(100dvh - 160px)); isolation: isolate; }
.hero::before { content: ""; position: absolute; inset: auto -20% -45% 20%; z-index: -1; height: 80%; background: radial-gradient(ellipse, rgba(190,93,49,.23), transparent 68%); }
.hero__copy { z-index: 2; padding: clamp(30px, 7vw, 78px) clamp(22px, 6vw, 72px); }
.hero h1 em { text-shadow: 0 8px 30px rgba(216,126,74,.18); }
.lead { max-width: 42rem; margin-bottom: 28px; color: #c9b8a8; font-size: clamp(.98rem, 3vw, 1.15rem); }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); max-width: 460px; margin: 0 0 30px; border-block: 1px solid var(--line); }
.facts span { padding: 13px 6px; color: var(--muted); font-size: .75rem; text-align: center; }
.facts span + span { border-left: 1px solid var(--line); }
.facts b { display: block; color: var(--gold-light); font-size: 1.25rem; }
.hero .button { width: min(100%, 360px); margin-bottom: 10px; }
.local-note { margin: 9px 0 0; color: #887b70; font-size: .75rem; }
.hero__art { display: none; position: relative; min-height: 430px; align-items: center; justify-content: center; isolation: isolate; }
.hero__art::before { content: ""; position: absolute; width: 390px; height: 390px; border: 1px solid var(--line); border-radius: 50%; box-shadow: inset 0 0 80px rgba(197,109,60,.1), 0 0 80px rgba(197,109,60,.1); }
.hero__art > p { position: absolute; bottom: 16%; margin: 0; color: rgba(239,198,132,.45); font-family: Georgia, serif; font-size: .78rem; letter-spacing: .4em; text-align: center; }
.hero__art > p strong { color: var(--gold); font-size: 1.1rem; }
.helmet { position: relative; width: 210px; height: 270px; filter: drop-shadow(0 35px 30px rgba(0,0,0,.45)); transform: rotate(3deg); }
.helmet::before { content: ""; position: absolute; top: 35px; left: 20px; width: 175px; height: 195px; border: 2px solid #d4975c; border-radius: 48% 50% 32% 34%; background: linear-gradient(105deg, #3b241a, #b96d43 48%, #302019 49%, #120e0b 88%); clip-path: polygon(5% 0,95% 0,100% 72%,78% 100%,60% 80%,40% 80%,22% 100%,0 72%); }
.helmet::after { content: ""; position: absolute; top: 105px; left: 48px; width: 122px; height: 52px; border-block: 10px solid #24150f; background: linear-gradient(90deg,#080605 0 38%,#9c5936 39% 60%,#080605 61%); clip-path: polygon(0 15%,40% 0,50% 35%,60% 0,100% 15%,90% 100%,57% 70%,50% 100%,43% 70%,10% 100%); }
.helmet i { position: absolute; top: -8px; left: 46px; width: 122px; height: 94px; z-index: -1; border-radius: 70% 18% 0 0; background: repeating-linear-gradient(88deg,#642c22 0 8px,#a64b33 9px 14px,#351914 15px 20px); transform: skew(-8deg); }
.helmet b { position: absolute; top: 58px; left: 101px; z-index: 2; width: 12px; height: 170px; background: linear-gradient(#e3a56a,#6e3826); clip-path: polygon(50% 0,100% 12%,74% 100%,25% 100%,0 12%); }

.heading, .subheading { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; }
.heading { margin: 10px 0 22px; }
.heading h1 { margin-bottom: 0; font-size: clamp(1.9rem, 6vw, 3.3rem); }
.subheading { margin: 32px 2px 16px; }
.subheading h2, .subheading p { margin-bottom: 0; }
.subheading > p, .subheading > span { color: var(--muted); font-size: .78rem; }
.stock-dot { display: inline-block; width: 7px; height: 7px; margin-right: 5px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px var(--green); }

.stepper { display: grid; grid-template-columns: repeat(3, 1fr); padding: 0; margin: 0 0 18px; list-style: none; }
.stepper li { position: relative; display: grid; justify-items: center; gap: 5px; color: #74675d; font-size: .68rem; text-align: center; }
.stepper li:not(:last-child)::after { content: ""; position: absolute; top: 16px; left: calc(50% + 23px); right: calc(-50% + 23px); height: 1px; background: var(--line); }
.stepper b { display: grid; width: 34px; height: 34px; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: var(--bg); }
.stepper .current { color: var(--gold-light); }
.stepper .current b { border-color: var(--gold); color: #1c110b; background: var(--gold); box-shadow: 0 0 22px rgba(231,184,113,.2); }

.badge-form { display: grid; gap: 20px; padding: 22px; }
.badge-form > div { display: flex; align-items: center; gap: 14px; }
.badge-form h2, .badge-form p { margin-bottom: 2px; }
.badge-form p { color: var(--muted); font-size: .82rem; }
.big-icon { display: grid; flex: 0 0 54px; height: 54px; place-items: center; border: 1px solid var(--line-strong); border-radius: 15px; color: var(--gold); background: rgba(205,116,67,.08); font-size: 1.5rem; }
.badge-form label { display: grid; gap: 7px; color: var(--muted); font-size: .78rem; }
.badge-form label > span { display: flex; align-items: center; min-height: 52px; border: 1px solid var(--line-strong); border-radius: 13px; background: rgba(8,6,5,.4); overflow: hidden; }
.badge-form input { width: 100%; min-width: 0; min-height: 50px; padding: 8px 14px; border: 0; outline: 0; color: var(--text); background: transparent; font-size: 1.2rem; }
.badge-form label b { padding: 0 15px; color: var(--gold); }

.talent-grid { display: grid; gap: 12px; }
.talent-card {
  position: relative; display: grid; grid-template-columns: 52px 1fr; grid-template-areas: "meta meta" "icon title" "icon copy"; gap: 2px 12px;
  min-height: 148px; padding: 16px; border: 1px solid var(--line); border-radius: 18px; color: var(--text); text-align: left;
  background: linear-gradient(145deg, rgba(52,35,25,.88), rgba(25,19,15,.94)); overflow: hidden; transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.talent-card::after { content: ""; position: absolute; right: -35px; bottom: -45px; width: 110px; height: 110px; border: 1px solid var(--line); border-radius: 50%; opacity: .5; }
.talent-card:hover:not(:disabled) { transform: translateY(-2px); border-color: var(--line-strong); box-shadow: 0 14px 30px rgba(0,0,0,.24); }
.talent-card[aria-pressed="true"] { border-color: var(--gold); background: linear-gradient(145deg,rgba(102,59,35,.92),rgba(30,21,16,.98)); box-shadow: 0 0 0 2px rgba(231,184,113,.12),0 16px 35px rgba(0,0,0,.32); }
.talent-card > span { grid-area: meta; display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.talent-card > span i { color: #76675c; font-size: .68rem; font-style: normal; letter-spacing: .12em; }
.talent-card > span b { padding: 3px 8px; border-radius: 99px; color: var(--green); background: rgba(113,165,120,.08); font-size: .66rem; font-weight: 500; }
.talent-card > em { grid-area: icon; display: grid; width: 52px; height: 52px; place-items: center; border: 1px solid var(--line); border-radius: 14px; color: var(--gold); background: rgba(0,0,0,.18); font-size: 1.45rem; font-style: normal; }
.talent-card > strong { grid-area: title; align-self: end; font-size: 1.03rem; }
.talent-card > small { grid-area: copy; max-width: 25rem; color: var(--muted); line-height: 1.5; }
.sticky-action { position: sticky; z-index: 8; bottom: max(10px, var(--safe-bottom)); display: grid; gap: 10px; margin-top: 20px; padding: 12px; border: 1px solid var(--line); border-radius: 18px; background: rgba(18,13,10,.88); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); box-shadow: 0 20px 50px rgba(0,0,0,.42); }
.sticky-action p { margin: 0; color: var(--muted); font-size: .8rem; text-align: center; }

.game-head { align-items: center; }
.save-status { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: .72rem; }
.save-status i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); }
.timeline { display: grid; grid-template-columns: repeat(6, 1fr); margin: 0 0 18px; padding: 0; list-style: none; }
.timeline li { position: relative; display: grid; justify-items: center; gap: 3px; color: #786b61; }
.timeline li:not(:last-child)::after { content: ""; position: absolute; top: 16px; left: calc(50% + 18px); right: calc(-50% + 18px); height: 1px; background: var(--line); }
.timeline b { z-index: 1; display: grid; width: 34px; height: 34px; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: var(--bg); font-size: .78rem; }
.timeline small { font-size: .6rem; }
.timeline .current { color: var(--gold-light); }
.timeline .current b { border-color: var(--gold); color: #1b100a; background: var(--gold); }

.resources { display: grid; grid-template-columns: 1fr 1fr; margin-bottom: 16px; }
.resources > * { display: flex; align-items: center; gap: 10px; min-height: 76px; padding: 13px; border: 0; color: inherit; text-align: left; background: transparent; }
.resources > *:nth-child(odd) { border-right: 1px solid var(--line); }
.resources > *:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
.resources i { display: grid; flex: 0 0 34px; height: 34px; place-items: center; border-radius: 50%; color: var(--gold); background: rgba(230,177,105,.08); font-style: normal; }
.resources span { display: grid; min-width: 0; }
.resources small { color: var(--muted); font-size: .66rem; }
.resources strong { overflow: hidden; font-size: 1.05rem; text-overflow: ellipsis; white-space: nowrap; }
.resources button:hover { background: rgba(255,255,255,.025); }

.game-layout { display: grid; gap: 16px; }
.mode-card { display: grid; margin-bottom: 16px; }
.mode-card > div:last-child { padding: 22px; }
.mode-card h2 em { padding: 0 6px; font-size: .72em; }
.mode-card p { color: var(--muted); }
.arena { display: flex; min-height: 155px; align-items: center; justify-content: center; gap: 18px; border-bottom: 1px solid var(--line); background: radial-gradient(circle at 50% 100%,rgba(193,103,58,.28),transparent 62%),linear-gradient(rgba(10,8,7,.1),rgba(10,8,7,.62)),repeating-linear-gradient(90deg,transparent 0 20px,rgba(255,255,255,.018) 21px 22px); }
.arena span { color: var(--copper-light); font-size: 4rem; filter: drop-shadow(0 16px 14px rgba(0,0,0,.5)); }
.arena span:last-child { transform: scaleX(-1); }
.arena b { display: grid; width: 46px; height: 46px; place-items: center; border: 1px solid var(--line-strong); border-radius: 50%; color: var(--gold-light); background: #1b120e; font: 700 .75rem Georgia,serif; }
.reward { display: flex; justify-content: space-between; gap: 12px; margin: 16px 0 0; padding-top: 13px; border-top: 1px solid var(--line); font-size: .8rem; }
.reward strong { color: var(--gold-light); }

.allocation { display: grid; gap: 16px; }
.choice { min-width: 0; margin: 0; padding: 20px; }
.choice legend { padding: 0 7px; font-weight: 800; }
.choice legend b, .rules h3 b { margin-right: 8px; color: var(--copper-light); font-size: .7rem; letter-spacing: .1em; }
.choice > p { margin-bottom: 16px; color: var(--muted); font-size: .78rem; }
.point-cards { display: grid; grid-template-columns: repeat(4, minmax(68px, 1fr)); gap: 8px; }
.point-cards button { position: relative; display: grid; min-width: 0; min-height: 128px; place-items: center; padding: 10px 5px; border: 1px solid var(--line); border-radius: 12px; color: var(--text); background: linear-gradient(155deg,rgba(77,47,31,.74),rgba(18,14,11,.96)); overflow: hidden; }
.point-cards button::before { content: ""; position: absolute; inset: 5px; border: 1px solid rgba(231,184,113,.12); border-radius: 8px; }
.point-cards small, .point-cards span { z-index: 1; color: var(--muted); font-size: .58rem; }
.point-cards strong { z-index: 1; color: var(--gold-light); font: 700 clamp(1.6rem,7vw,2.5rem) Georgia,serif; }
.point-cards button[aria-pressed="true"] { border-color: var(--gold); background: linear-gradient(155deg,#74422a,#23150e); box-shadow: 0 0 0 2px rgba(231,184,113,.12); transform: translateY(-3px); }
.point-cards button:disabled { filter: grayscale(.75); }

.weapon-control { display: grid; gap: 12px; }
.step-control { display: grid; grid-template-columns: 48px 1fr 48px; min-height: 58px; border: 1px solid var(--line-strong); border-radius: 14px; background: rgba(6,5,4,.25); overflow: hidden; }
.step-control button { min-width: 48px; min-height: 48px; border: 0; color: var(--gold-light); background: rgba(255,255,255,.03); font-size: 1.6rem; }
.step-control button:hover { background: rgba(231,184,113,.1); }
.step-control output { display: grid; place-items: center; border-inline: 1px solid var(--line); font: 700 1.6rem Georgia,serif; }
.switch-card { display: grid; grid-template-columns: 38px 1fr auto; align-items: center; gap: 10px; min-height: 68px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 14px; color: var(--text); text-align: left; background: rgba(255,255,255,.025); }
.switch-card > i { position: relative; width: 38px; height: 22px; border-radius: 99px; background: #51443b; }
.switch-card > i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #a99b8f; transition: transform .18s ease; }
.switch-card[aria-checked="true"] { border-color: var(--gold); }
.switch-card[aria-checked="true"] > i { background: var(--copper); }
.switch-card[aria-checked="true"] > i::after { background: var(--gold-light); transform: translateX(16px); }
.switch-card > span { display: grid; }
.switch-card small { color: var(--muted); }
.switch-card > b { color: var(--gold); font-size: .7rem; }

.predictions { display: grid; gap: 8px; }
.predictions button { display: grid; grid-template-columns: 42px 1fr auto; align-items: center; gap: 10px; min-height: 64px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 13px; color: var(--text); text-align: left; background: rgba(255,255,255,.02); }
.predictions button > i, .ranking li > i, .final-ranking li > i { display: grid; width: 42px; height: 42px; place-items: center; border: 1px solid var(--line); border-radius: 50%; color: var(--gold-light); background: rgba(181,96,56,.12); font-size: .75rem; font-style: normal; }
.predictions button > span { display: grid; }
.predictions small { color: var(--muted); }
.predictions button > b { color: var(--muted); font-size: .7rem; }
.predictions button[aria-pressed="true"] { border-color: var(--gold); background: rgba(179,94,54,.14); box-shadow: inset 3px 0 var(--gold); }
.confirm { display: grid; gap: 12px; padding: 16px; }
.confirm > span { display: grid; text-align: center; }
.confirm small { color: var(--muted); }
.confirm > span strong { color: var(--gold-light); }

.ranking { align-self: start; padding: 20px; }
.ranking .subheading { align-items: center; margin: 0 0 14px; }
.ranking .subheading > span { padding: 4px 8px; border: 1px solid var(--line); border-radius: 99px; }
.ranking ol, .final-ranking ol { display: grid; gap: 7px; margin: 0; padding: 0; list-style: none; }
.ranking li { display: grid; grid-template-columns: 24px 42px 1fr auto; align-items: center; gap: 9px; min-height: 64px; padding: 9px; border: 1px solid transparent; border-radius: 13px; }
.ranking li.me { border-color: var(--line); background: rgba(208,126,74,.08); }
.ranking li > b { color: var(--muted); text-align: center; }
.ranking li > span { display: grid; }
.ranking li small { color: var(--muted); }
.ranking li > em { color: var(--gold-light); font-size: .85rem; font-style: normal; }
.ranking > p { margin: 12px 0 0; color: #776a60; font-size: .68rem; text-align: center; }

.result { padding: clamp(28px,8vw,72px) 20px; text-align: center; background: radial-gradient(circle at 50% 35%,rgba(197,105,61,.28),transparent 38%),linear-gradient(150deg,rgba(50,32,22,.96),rgba(20,15,12,.98)); }
.result .eyebrow { justify-content: center; }
.result__seal { display: grid; width: 94px; height: 94px; margin: 16px auto; place-items: center; border: 2px solid var(--gold); border-radius: 50%; color: var(--gold-light); background: rgba(23,15,11,.82); box-shadow: 0 0 0 8px rgba(231,184,113,.06),0 16px 35px rgba(0,0,0,.35); font: 700 2.2rem Georgia,serif; }
.result > small, .finale > small { color: var(--gold); letter-spacing: .14em; }
.result h1 { margin-top: 7px; font-size: clamp(2rem,8vw,3.6rem); }
.result > p:not(.eyebrow) { color: var(--muted); }
.result > div { display: grid; grid-template-columns: 1fr 1px 1fr 1px 1fr; align-items: center; max-width: 520px; margin: 30px auto 0; }
.result > div > i { width: 1px; height: 42px; background: var(--line); }
.result > div span { display: grid; }
.result > div small { color: var(--muted); }
.result > div strong { color: var(--gold-light); font-size: 1.3rem; }
.settlement-grid { display: grid; gap: 16px; margin-top: 16px; }
.breakdown, .feed { padding: 20px; }
.breakdown .subheading { margin: 0 0 12px; }
.breakdown dl { margin: 0; }
.breakdown dl > div { display: flex; justify-content: space-between; gap: 15px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.breakdown dl > div:last-child { border-bottom: 0; }
.breakdown dt { color: var(--muted); }
.breakdown dd { margin: 0; color: var(--gold-light); font-weight: 800; }
.feed ol { position: relative; display: grid; gap: 15px; margin: 15px 0 0; padding: 0 0 0 18px; list-style: none; }
.feed ol::before { content: ""; position: absolute; top: 8px; bottom: 8px; left: 4px; width: 1px; background: var(--line-strong); }
.feed li { position: relative; }
.feed li::before { content: ""; position: absolute; top: 8px; left: -18px; width: 9px; height: 9px; border-radius: 50%; background: var(--copper-light); box-shadow: 0 0 0 4px rgba(183,101,61,.1); }
.feed time { color: var(--gold); font-size: .68rem; }
.feed p { margin-bottom: 0; color: var(--muted); font-size: .86rem; }

.finale { padding: clamp(34px,9vw,82px) 20px; text-align: center; background: radial-gradient(circle at 50% 25%,rgba(232,184,112,.2),transparent 36%),linear-gradient(145deg,rgba(57,36,24,.96),rgba(18,14,11,.98)); }
.finale .eyebrow { justify-content: center; }
.finale > b { display: block; margin: 12px 0 4px; color: var(--gold); font-size: 5rem; line-height: 1; filter: drop-shadow(0 12px 25px rgba(223,158,83,.2)); }
.finale h1 { margin-top: 10px; font-size: clamp(2rem,8vw,3.8rem); }
.finale > p:last-child { max-width: 42rem; margin: 0 auto; color: var(--muted); }
.final-ranking { margin-top: 16px; padding: 20px; }
.final-ranking .subheading { margin: 0 0 16px; }
.final-ranking li { display: grid; grid-template-columns: 38px 42px 1fr auto; align-items: center; gap: 10px; min-height: 72px; padding: 10px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.015); }
.final-ranking li.champion { border-color: var(--gold); background: linear-gradient(90deg,rgba(201,120,65,.18),rgba(255,255,255,.015)); }
.final-ranking li > b { color: var(--gold); font: 700 1.25rem Georgia,serif; text-align: center; }
.final-ranking li > span, .final-ranking li > em { display: grid; }
.final-ranking li small { color: var(--muted); }
.final-ranking li > em { text-align: right; font-style: normal; }
.final-ranking li > em strong { color: var(--gold-light); font-size: 1.25rem; }
.final-actions { display: grid; gap: 10px; margin-top: 16px; }

body > footer { display: flex; justify-content: center; gap: 12px; padding: 24px max(16px,var(--safe-right)) calc(24px + var(--safe-bottom)) max(16px,var(--safe-left)); color: #6f6258; font-size: .7rem; letter-spacing: .1em; }
body > footer b { color: var(--copper); }

.dialog { width: min(720px, calc(100% - 24px)); max-width: none; max-height: min(88dvh, 920px); padding: 0; border: 1px solid var(--line-strong); border-radius: 22px; color: var(--text); background: #19120e; box-shadow: 0 40px 100px rgba(0,0,0,.7); overflow: hidden; }
.dialog.wide { width: min(960px, calc(100% - 24px)); }
.dialog::backdrop { background: rgba(5,4,3,.8); -webkit-backdrop-filter: blur(7px); backdrop-filter: blur(7px); }
.dialog__frame { display: grid; grid-template-rows: auto minmax(0,1fr); max-height: inherit; }
.dialog header { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 18px 18px 14px; border-bottom: 1px solid var(--line); background: linear-gradient(90deg,rgba(178,91,51,.12),transparent); }
.dialog header h2 { margin: 0; }
.dialog header button { flex: 0 0 44px; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 50%; color: var(--muted); background: rgba(255,255,255,.025); font-size: 1.5rem; }
.dialog header button:hover { color: var(--gold-light); border-color: var(--gold); }
.dialog__body { overflow-y: auto; overscroll-behavior: contain; padding: 20px; scrollbar-color: var(--copper) transparent; }
.rules { display: grid; gap: 12px; }
.rules section { padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.018); }
.rules h3 { margin-bottom: 7px; }
.rules p { margin-bottom: 0; color: var(--muted); }
.rules strong { color: var(--text); }
.rules .digital { border-color: rgba(231,184,113,.38); background: linear-gradient(145deg,rgba(134,75,42,.16),rgba(255,255,255,.012)); }
.rules ul { display: grid; gap: 10px; margin: 10px 0 0; padding-left: 1.25rem; color: var(--muted); }
.rules li::marker { color: var(--gold); }
.talent-intro { padding: 16px; border-left: 3px solid var(--copper); color: var(--muted); background: rgba(181,101,61,.08); }
.codex { display: grid; gap: 10px; margin: 18px 0 0; padding: 0; list-style: none; }
.codex li { display: grid; grid-template-columns: 48px 1fr; gap: 12px; padding: 15px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.018); }
.codex li > b { display: grid; width: 48px; height: 48px; place-items: center; border: 1px solid var(--line-strong); border-radius: 13px; color: var(--gold); background: rgba(181,101,61,.08); font-size: 1.25rem; }
.codex h3 { margin-bottom: 4px; }
.codex p { margin-bottom: 0; color: var(--muted); }

.toast { position: fixed; left: 50%; bottom: calc(20px + var(--safe-bottom)); z-index: 60; display: flex; align-items: center; gap: 10px; width: max-content; max-width: calc(100% - 32px); min-height: 50px; padding: 10px 16px; border: 1px solid var(--line-strong); border-radius: 14px; color: var(--text); background: rgba(24,17,13,.96); box-shadow: 0 18px 40px rgba(0,0,0,.45); transform: translateX(-50%); }
.toast b { display: grid; width: 25px; height: 25px; place-items: center; border-radius: 50%; color: #152117; background: var(--green); }
.toast p { margin: 0; }

@media (min-width: 560px) {
  #app { padding-top: 32px; }
  .badge-form { grid-template-columns: 1.2fr .8fr; align-items: end; }
  .badge-form > div { grid-column: 1 / -1; }
  .talent-grid { grid-template-columns: 1fr 1fr; }
  .sticky-action { grid-template-columns: 1fr auto; align-items: center; padding-left: 20px; }
  .sticky-action p { text-align: left; }
  .resources { grid-template-columns: repeat(4,1fr); }
  .resources > * { border-right: 1px solid var(--line); border-bottom: 0 !important; }
  .resources > *:last-child { border-right: 0; }
  .weapon-control { grid-template-columns: minmax(180px,.7fr) 1.3fr; }
  .predictions { grid-template-columns: 1fr 1fr; }
  .confirm { grid-template-columns: 1fr auto; align-items: center; }
  .confirm > span { text-align: left; }
  .settlement-grid { grid-template-columns: 1fr 1fr; }
  .final-actions { grid-template-columns: 1fr 1fr; }
  .codex { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 820px) {
  .topbar { padding-inline: max(calc((100% - 1180px)/2),24px); }
  .topbar nav button { min-width: 70px; }
  .hero { grid-template-columns: minmax(0,1.15fr) minmax(330px,.85fr); }
  .hero__art { display: flex; }
  .badge-form { grid-template-columns: 1fr 240px auto; }
  .badge-form > div { grid-column: auto; }
  .talent-grid { grid-template-columns: repeat(3,1fr); }
  .game-layout { grid-template-columns: minmax(0,1fr) 330px; align-items: start; }
  .ranking { position: sticky; top: calc(86px + var(--safe-top)); }
  .mode-card { grid-template-columns: minmax(270px,.8fr) 1.2fr; }
  .arena { min-height: 100%; border-right: 1px solid var(--line); border-bottom: 0; }
  .dialog header { padding: 22px 24px 17px; }
  .dialog__body { padding: 24px; }
}

@media (min-width: 1100px) {
  .topbar { min-height: calc(76px + var(--safe-top)); }
  #app { padding-block: 42px 80px; }
  .hero { min-height: 670px; }
  .talent-card { min-height: 166px; padding: 18px; }
}

@media (max-width: 390px) {
  .brand small { display: none; }
  .topbar nav button { grid-template-columns: 1fr; gap: 0; min-width: 46px; padding: 5px; font-size: .65rem; }
  .facts span { font-size: .68rem; }
  .heading .chip { display: none; }
  .point-cards { gap: 5px; }
  .point-cards button { min-height: 112px; }
  .result > div small { font-size: .65rem; }
  .final-ranking li { grid-template-columns: 28px 36px 1fr auto; gap: 7px; padding-inline: 7px; }
  .final-ranking li > i { width: 36px; height: 36px; }
}

@media (orientation: landscape) and (max-height: 560px) {
  .topbar { position: relative; }
  .welcome { min-height: auto; }
  .hero { min-height: auto; }
  .hero__copy { padding-block: 28px; }
  .hero__art { min-height: 360px; }
  .dialog { max-height: calc(100dvh - 12px); }
}

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

@media (prefers-contrast: more) {
  :root { --line: rgba(255,220,165,.48); --line-strong: rgba(255,224,173,.78); --muted: #d2c5b9; }
  .panel, .talent-card { border-width: 2px; }
}

@media print {
  .topbar, .sticky-action, body > footer, .button, .toast { display: none !important; }
  body { color: #111; background: #fff; }
  .panel, .dialog { color: #111; background: #fff; box-shadow: none; }
}

/* Runtime-rendered game views -------------------------------------------------
   The semantic shell and dialogs above remain useful before JavaScript loads;
   app.mjs replaces only #app with the active, saveable game state. */
.screen-enter { animation: view-in .45s cubic-bezier(.16,.8,.3,1) both; }
.primary-button,
.secondary-button,
.ghost-button,
.back-button,
.icon-button,
.text-button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: 14px;
  font-weight: 800;
  letter-spacing: .04em;
  transition: transform .18s ease, border-color .18s ease, filter .18s ease, background .18s ease;
}
.primary-button { color: #1b100a; background: linear-gradient(135deg,#ffe0a2,#d89450 55%,#b85e38); box-shadow: 0 12px 30px rgba(177,86,45,.25); }
.primary-button:hover { filter: brightness(1.07); transform: translateY(-1px); }
.secondary-button,
.ghost-button,
.back-button,
.icon-button { border-color: var(--line-strong); color: var(--gold-light); background: rgba(255,255,255,.03); }
.text-button { min-height: 44px; padding-inline: 8px; color: var(--gold); background: transparent; }
.wide { width: 100%; }

.hero-screen { display: grid; justify-items: center; min-height: calc(100dvh - 190px); padding: clamp(38px,8vw,90px) 0 24px; text-align: center; }
.hero-screen::before { content: ""; position: absolute; z-index: -1; width: min(82vw,680px); aspect-ratio: 1; border: 1px solid var(--line); border-radius: 50%; background: radial-gradient(circle,rgba(173,80,43,.18),transparent 67%); box-shadow: inset 0 0 90px rgba(201,115,64,.08); }
.hero-crown { display: grid; width: 78px; height: 78px; place-items: center; margin-bottom: 10px; border: 1px solid var(--line-strong); border-radius: 50%; color: var(--gold-light); background: rgba(79,43,26,.55); box-shadow: 0 0 55px rgba(205,117,61,.19); font-size: 2.2rem; }
.hero-screen .eyebrow { justify-content: center; }
.hero-screen h1 { margin-bottom: 8px; font-size: clamp(3rem,14vw,6.5rem); }
.hero-screen h1 span { display: block; color: var(--gold-light); font-size: .38em; letter-spacing: .42em; text-indent: .42em; }
.hero-copy { max-width: 580px; margin: 4px auto 20px; color: var(--muted); }
.arena-emblem { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; width: min(100%,420px); margin: 8px 0 20px; color: var(--gold); }
.arena-emblem i { height: 1px; background: linear-gradient(90deg,transparent,var(--line-strong)); }
.arena-emblem i:nth-of-type(2) { background: linear-gradient(90deg,var(--line-strong),transparent); }
.arena-emblem strong { font-family: Georgia,serif; font-size: 1.4rem; }
.arena-emblem small { grid-column: 1/-1; color: #817269; font-size: .65rem; letter-spacing: .28em; }
.start-panel { display: grid; gap: 10px; width: min(100%,430px); padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(145deg,rgba(48,31,22,.94),rgba(22,17,14,.96)); box-shadow: var(--shadow); text-align: left; }
.start-panel > label { color: var(--gold-light); font-weight: 800; }
.start-panel > p { margin: -2px 2px 5px; color: var(--muted); font-size: .75rem; }
.badge-input-wrap { display: grid; grid-template-columns: 48px 1fr; min-height: 54px; overflow: hidden; border: 1px solid var(--line-strong); border-radius: 13px; background: rgba(4,3,3,.35); }
.badge-input-wrap span { display: grid; place-items: center; border-right: 1px solid var(--line); color: var(--gold); font-size: 1.25rem; }
.badge-input-wrap input { min-width: 0; border: 0; outline: 0; padding: 8px 14px; color: var(--text); background: transparent; font-size: 1.35rem; font-weight: 800; }
.quick-links { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
.quick-links button { min-height: 44px; border: 0; color: var(--muted); background: transparent; }
.quick-links span { color: var(--copper); font-size: .6rem; }

.content-screen { width: 100%; }
.screen-heading,
.round-header,
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.screen-heading { margin: 4px 0 20px; }
.screen-heading h1,
.round-header h1 { margin: 0; font-size: clamp(1.8rem,6vw,3.4rem); }
.screen-heading .back-button,
.screen-heading .icon-button { flex: 0 0 46px; width: 46px; padding: 0; }
.draft-intro { display: flex; align-items: center; gap: 15px; margin-bottom: 14px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: linear-gradient(90deg,rgba(116,53,32,.18),rgba(255,255,255,.018)); }
.draft-intro p { margin: 3px 0 0; color: var(--muted); font-size: .84rem; }
.torch { display: grid; flex: 0 0 48px; height: 48px; place-items: center; border-radius: 50%; color: var(--gold-light); background: rgba(184,94,51,.18); box-shadow: 0 0 24px rgba(215,119,62,.14); font-size: 1.35rem; }
.badge-order { display: grid; grid-template-columns: repeat(4,1fr); gap: 8px; margin-bottom: 26px; }
.badge-rank { display: grid; grid-template-columns: auto 1fr; gap: 0 8px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.018); }
.badge-rank > b { grid-row: 1/3; display: grid; width: 28px; height: 28px; place-items: center; border-radius: 50%; color: var(--gold); background: rgba(0,0,0,.25); }
.badge-rank span { font-weight: 800; }
.badge-rank em { color: var(--muted); font-size: .68rem; }
.badge-rank.is-you { border-color: var(--gold); background: rgba(196,105,57,.1); }
.section-kicker { display: flex; justify-content: space-between; align-items: center; margin: 0 2px 14px; color: var(--gold-light); font-weight: 800; }
.section-kicker span { color: var(--muted); font-size: .72rem; font-weight: 400; }
.content-screen .talent-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
.content-screen .talent-card { display: grid; grid-template: "num icon" auto "title icon" auto "copy copy" 1fr "stock stock" auto / 1fr auto; min-height: 190px; padding: 18px; text-align: left; }
.content-screen .talent-card > .talent-number { grid-area: num; color: #796b60; font-size: .68rem; letter-spacing: .15em; }
.content-screen .talent-card > i { grid-area: icon; display: grid; width: 50px; height: 50px; place-items: center; border: 1px solid var(--line); border-radius: 14px; color: var(--gold); background: rgba(0,0,0,.2); font-size: 1.4rem; font-style: normal; }
.content-screen .talent-card > strong { grid-area: title; align-self: end; margin-top: 10px; font-size: 1.08rem; }
.content-screen .talent-card > small { grid-area: copy; margin-top: 8px; color: var(--muted); line-height: 1.5; }
.content-screen .talent-card > em { grid-area: stock; width: max-content; margin-top: 13px; padding: 3px 8px; border-radius: 99px; color: var(--green); background: rgba(113,165,120,.08); font-size: .66rem; }
.content-screen .talent-card.is-empty { filter: grayscale(.65); }

.round-header { margin: 4px 0 18px; }
.round-header .eyebrow { margin-bottom: 4px; }
.round-orb { display: grid; grid-template: "icon value" auto "label label" auto / auto auto; align-items: center; gap: 0 8px; min-width: 112px; padding: 10px 14px; border: 1px solid var(--line-strong); border-radius: 18px; background: rgba(75,42,27,.35); }
.round-orb span { grid-area: icon; color: var(--gold); font-size: 1.35rem; }
.round-orb b { grid-area: value; color: var(--gold-light); font-size: 1.5rem; }
.round-orb small { grid-area: label; color: var(--muted); font-size: .65rem; }
.round-track { display: grid; grid-template-columns: repeat(6,1fr); margin-bottom: 14px; }
.round-track span { position: relative; display: grid; justify-items: center; gap: 3px; color: #65594f; }
.round-track span:not(:last-child)::after { content: ""; position: absolute; top: 17px; left: calc(50% + 18px); right: calc(-50% + 18px); height: 1px; background: var(--line); }
.round-track i { z-index: 1; display: grid; width: 34px; height: 34px; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: var(--bg); font-style: normal; }
.round-track b { font-size: .65rem; }
.round-track .done i { color: var(--green); border-color: rgba(120,171,126,.5); }
.round-track .active { color: var(--gold-light); }
.round-track .active i { color: #1c110b; border-color: var(--gold); background: var(--gold); box-shadow: 0 0 20px rgba(231,184,113,.2); }
.resource-ribbon { display: grid; grid-template-columns: .7fr .7fr 1.6fr; margin-bottom: 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: rgba(35,24,18,.75); overflow: hidden; }
.resource-ribbon > span { display: grid; grid-template: "icon value" auto "icon label" auto / auto 1fr; align-items: center; gap: 0 9px; min-height: 70px; padding: 11px 14px; }
.resource-ribbon > span + span { border-left: 1px solid var(--line); }
.resource-ribbon i { grid-area: icon; color: var(--gold); font-style: normal; }
.resource-ribbon b { grid-area: value; overflow: hidden; color: var(--gold-light); text-overflow: ellipsis; white-space: nowrap; }
.resource-ribbon small { grid-area: label; color: var(--muted); font-size: .65rem; }
.game-layout { display: grid; gap: 14px; }
.allocation-panel,
.standings-panel { padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(145deg,rgba(43,29,21,.94),rgba(23,17,14,.97)); box-shadow: var(--shadow); }
.panel-heading { margin-bottom: 14px; }
.panel-heading h2 { margin: 0; }
.scenario-card { display: flex; align-items: center; gap: 15px; margin-bottom: 16px; padding: 16px; border: 1px solid var(--line-strong); border-radius: 16px; background: linear-gradient(100deg,rgba(127,54,36,.2),rgba(0,0,0,.13)); }
.scenario-card p { margin: 3px 0 0; color: var(--muted); font-size: .79rem; }
.scenario-seal { display: grid; flex: 0 0 54px; height: 54px; place-items: center; border: 1px solid var(--line-strong); border-radius: 50%; color: var(--gold-light); background: rgba(0,0,0,.22); font-size: 1.55rem; }
.scenario-card.lions { background: linear-gradient(100deg,rgba(143,48,37,.25),rgba(0,0,0,.13)); }
.choice-block { margin: 0 0 12px; padding: 15px; border: 1px solid var(--line); border-radius: 16px; }
.choice-block legend { padding: 0 7px; color: var(--gold-light); font-weight: 800; }
.choice-block legend span { display: inline-grid; width: 25px; height: 25px; margin-right: 5px; place-items: center; border-radius: 50%; color: #21130c; background: var(--gold); font-size: .68rem; }
.point-cards { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; }
.point-card { position: relative; min-width: 0; }
.point-card input { position: absolute; opacity: 0; pointer-events: none; }
.point-card span { display: grid; min-height: 84px; place-items: center; align-content: center; border: 1px solid var(--line); border-radius: 12px; background: rgba(4,3,3,.23); transition: border-color .18s ease, transform .18s ease, background .18s ease; }
.point-card small,
.point-card em { color: var(--muted); font-size: .57rem; font-style: normal; letter-spacing: .12em; }
.point-card b { color: var(--gold-light); font-family: Georgia,serif; font-size: 1.65rem; line-height: 1.15; }
.point-card.selected span,
.point-card:has(input:checked) span { border-color: var(--gold); background: linear-gradient(145deg,rgba(125,66,37,.5),rgba(22,16,13,.9)); transform: translateY(-2px); }
.talent-toggle { display: grid; margin-top: 10px; cursor: pointer; }
.talent-toggle input { position: absolute; opacity: 0; }
.talent-toggle span { display: grid; grid-template: "icon title" auto "icon copy" auto / auto 1fr; align-items: center; gap: 0 10px; min-height: 62px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.018); }
.talent-toggle i { grid-area: icon; color: var(--gold); font-size: 1.3rem; font-style: normal; }
.talent-toggle b { grid-area: title; }
.talent-toggle small { grid-area: copy; color: var(--muted); font-size: .68rem; }
.talent-toggle:has(input:checked) span { border-color: var(--gold); background: rgba(185,97,52,.12); }
.weapon-control { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; }
.weapon-control input[type="range"] { width: 100%; accent-color: var(--gold); }
.weapon-control output { display: grid; min-width: 100px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 11px; text-align: center; }
.weapon-control output b { color: var(--gold-light); font-size: 1.3rem; }
.weapon-control output small { color: var(--muted); font-size: .6rem; }
.select-label { display: grid; gap: 7px; color: var(--muted); font-size: .74rem; }
.select-label select { width: 100%; min-height: 48px; padding: 8px 12px; border: 1px solid var(--line-strong); border-radius: 11px; color: var(--text); background: #1a120e; }
.microcopy { margin: 9px 0 0; color: #887b70; font-size: .68rem; }
.commit-bar { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding-top: 4px; }
.commit-bar > span { color: var(--muted); }
.commit-bar > span b { color: var(--gold-light); font-size: 1.4rem; }
.player-list { display: grid; gap: 8px; }
.player-row { display: grid; grid-template-columns: 28px 40px minmax(0,1fr) auto auto; align-items: center; gap: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.018); }
.player-row.is-you { border-color: var(--line-strong); background: rgba(190,101,55,.08); }
.rank-number { color: var(--gold); text-align: center; }
.avatar { display: grid; width: 38px; height: 38px; place-items: center; border: 1px solid var(--line); border-radius: 50%; color: var(--gold-light); background: rgba(0,0,0,.22); }
.player-identity { display: grid; min-width: 0; }
.player-identity small { overflow: hidden; color: var(--muted); font-size: .62rem; text-overflow: ellipsis; white-space: nowrap; }
.score,.coin { display: grid; justify-items: end; }
.score b,.coin b { color: var(--gold-light); }
.score small,.coin small { color: var(--muted); font-size: .57rem; }
.arena-tip { display: flex; gap: 10px; margin-top: 12px; padding: 12px; border: 1px dashed var(--line); border-radius: 12px; color: var(--muted); font-size: .72rem; }
.arena-tip span { color: var(--gold); }
.arena-tip p { margin: 0; }
.arena-tip b { display: block; color: var(--text); }

.result-screen,
.final-screen { display: grid; justify-items: center; width: min(760px,100%); min-height: calc(100dvh - 190px); margin: 0 auto; padding: clamp(28px,7vw,68px) 0; text-align: center; }
.result-icon,
.final-crown { display: grid; width: 88px; height: 88px; place-items: center; margin: 4px 0 18px; border: 1px solid var(--line-strong); border-radius: 50%; color: var(--gold-light); background: radial-gradient(circle,rgba(184,91,49,.3),rgba(26,18,14,.95)); box-shadow: 0 0 60px rgba(183,91,48,.17); font-size: 2.4rem; }
.result-screen h1,
.final-screen h1 { margin-bottom: 8px; font-size: clamp(2.1rem,8vw,4.2rem); }
.result-lead,
.final-lead { max-width: 560px; color: var(--muted); }
.result-table,
.podium-list { display: grid; gap: 8px; width: 100%; margin: 22px 0; text-align: left; }
.result-row { display: grid; grid-template-columns: 36px 42px minmax(0,1fr) auto auto; align-items: center; gap: 10px; min-height: 68px; padding: 10px 13px; border: 1px solid var(--line); border-radius: 14px; background: rgba(38,26,19,.88); }
.result-row.is-you { border-color: var(--gold); }
.result-row > span:nth-child(3) { display: grid; }
.result-row small { color: var(--muted); font-size: .65rem; }
.result-place { color: var(--gold); text-align: center; }
.result-row em { color: var(--muted); font-size: .75rem; }
.result-row em.positive { color: var(--green); }
.coin-delta { min-width: 64px; text-align: right; }
.result-next { min-width: min(100%,310px); }
.final-crown { width: 104px; height: 104px; font-size: 3rem; }
.podium-row { display: grid; grid-template-columns: 42px 44px minmax(0,1fr) auto; align-items: center; gap: 12px; min-height: 74px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 15px; background: rgba(38,26,19,.88); }
.podium-row.place-1 { border-color: var(--gold); background: linear-gradient(100deg,rgba(139,72,39,.35),rgba(32,22,17,.92)); }
.podium-row.is-you { box-shadow: inset 3px 0 var(--gold); }
.podium-row > span:nth-child(3) { display: grid; }
.podium-row small { color: var(--muted); font-size: .67rem; }
.podium-row > b { color: var(--gold-light); font-size: 1.4rem; }
.podium-row > b small { margin-left: 3px; }
.medal { color: var(--gold); font-family: Georgia,serif; font-size: 1.2rem; }
.final-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.toast[data-tone="danger"] { border-color: rgba(197,72,59,.8); }
.toast[data-tone="success"] { border-color: rgba(120,171,126,.75); }

@media (min-width: 760px) {
  .content-screen .talent-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .game-layout { grid-template-columns: minmax(0,1.65fr) minmax(280px,.85fr); align-items: start; }
  .standings-panel { position: sticky; top: 92px; }
  .point-cards { grid-template-columns: repeat(6,1fr); }
}

@media (max-width: 620px) {
  #app { padding-top: 18px; }
  .brand small { display: none; }
  .topbar nav button { grid-template-columns: 1fr; min-width: 48px; font-size: 0; }
  .topbar nav b { font-size: 1rem; }
  .badge-order { grid-template-columns: repeat(2,1fr); }
  .content-screen .talent-grid { grid-template-columns: 1fr; }
  .round-header { align-items: flex-start; }
  .round-orb { min-width: 90px; }
  .resource-ribbon { grid-template-columns: repeat(2,1fr); }
  .resource-ribbon > span:nth-child(3) { grid-column: 1/-1; border-top: 1px solid var(--line); border-left: 0; }
  .point-cards { grid-template-columns: repeat(3,1fr); }
  .weapon-control { grid-template-columns: 1fr; }
  .commit-bar { position: sticky; bottom: calc(8px + var(--safe-bottom)); z-index: 5; margin: 0 -5px -5px; padding: 10px; border: 1px solid var(--line-strong); border-radius: 15px; background: rgba(22,16,13,.94); backdrop-filter: blur(12px); }
  .commit-bar .primary-button { padding-inline: 14px; }
  .player-row { grid-template-columns: 24px 36px minmax(0,1fr) auto; }
  .player-row .coin { display: none; }
  .result-row { grid-template-columns: 32px 38px minmax(0,1fr) auto; }
  .result-row .coin-delta { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .screen-enter { animation: none; }
  .primary-button,
  .secondary-button,
  .talent-card,
  .point-card span { transition: none; }
}

/* 运行时视图：app.mjs 会用下列屏幕替换静态渐进增强骨架。 */
.screen-enter { animation: view-in .5s cubic-bezier(.16,.8,.3,1) both; }
.hero-screen {
  position: relative;
  display: grid;
  width: min(760px, 100%);
  min-height: calc(100dvh - 190px);
  margin: 0 auto;
  padding: clamp(34px, 8vw, 76px) clamp(20px, 7vw, 68px);
  align-content: center;
  justify-items: center;
  border: 1px solid var(--line);
  border-radius: clamp(22px, 5vw, 34px);
  text-align: center;
  background:
    radial-gradient(circle at 50% 17%, rgba(220,139,78,.17), transparent 27%),
    linear-gradient(150deg, rgba(47,31,22,.95), rgba(18,14,11,.98));
  box-shadow: var(--shadow), inset 0 1px rgba(255,255,255,.04);
  overflow: hidden;
  isolation: isolate;
}
.hero-screen::before, .hero-screen::after {
  content: "";
  position: absolute;
  z-index: -1;
  width: 380px;
  height: 560px;
  border: 1px solid rgba(231,184,113,.08);
  border-radius: 50% 50% 0 0;
  opacity: .65;
}
.hero-screen::before { left: -250px; bottom: -210px; transform: rotate(16deg); }
.hero-screen::after { right: -250px; bottom: -210px; transform: rotate(-16deg); }
.hero-crown {
  display: grid;
  width: 88px;
  height: 88px;
  margin-bottom: 20px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--gold);
  background: radial-gradient(circle, rgba(201,111,63,.18), rgba(14,10,8,.9));
  box-shadow: 0 0 0 9px rgba(231,184,113,.025), 0 16px 35px rgba(0,0,0,.35);
  font-size: 2.5rem;
}
.hero-crown span { transform: translateY(-2px); filter: drop-shadow(0 7px 10px rgba(0,0,0,.45)); }
.hero-screen > .eyebrow { justify-content: center; margin-bottom: 14px; }
.hero-screen > .eyebrow::before, .hero-screen > .eyebrow::after { content: ""; width: 22px; height: 1px; background: var(--copper); }
.hero-screen h1 { margin-bottom: 12px; font-size: clamp(2.8rem, 14vw, 6.1rem); line-height: .96; letter-spacing: -.08em; }
.hero-screen h1 span { display: block; color: var(--gold-light); text-shadow: 0 14px 34px rgba(192,93,49,.24); }
.hero-copy { max-width: 35rem; margin-bottom: 16px; color: var(--muted); font-size: clamp(.92rem, 2.7vw, 1.08rem); }
.arena-emblem { display: grid; grid-template-columns: 1fr auto 1fr; width: min(360px,100%); align-items: center; gap: 12px; margin: 6px auto 22px; }
.arena-emblem i { height: 1px; background: linear-gradient(90deg,transparent,var(--line-strong)); }
.arena-emblem i:nth-of-type(2) { background: linear-gradient(90deg,var(--line-strong),transparent); }
.arena-emblem strong { display: grid; width: 54px; height: 54px; place-items: center; border: 1px solid var(--line-strong); border-radius: 50%; color: var(--gold-light); background: #1a110d; font: 700 1.35rem Georgia,serif; }
.arena-emblem small { grid-column: 1/-1; margin-top: -7px; color: #806f62; font-size: .62rem; letter-spacing: .24em; }
.start-panel { display: grid; width: min(400px,100%); gap: 10px; padding: 18px; border: 1px solid var(--line); border-radius: 18px; text-align: left; background: rgba(8,6,5,.25); }
.start-panel > label { color: var(--gold-light); font-size: .8rem; font-weight: 700; }
.start-panel > p { margin: -2px 0 4px; color: #8f8176; font-size: .7rem; }
.badge-input-wrap { display: grid; grid-template-columns: 46px 1fr; min-height: 52px; align-items: center; border: 1px solid var(--line-strong); border-radius: 12px; background: rgba(0,0,0,.22); overflow: hidden; }
.badge-input-wrap > span { display: grid; height: 100%; place-items: center; border-right: 1px solid var(--line); color: var(--gold); font-size: 1.2rem; }
.badge-input-wrap input { width: 100%; min-width: 0; min-height: 50px; padding: 8px 13px; border: 0; outline: 0; color: var(--text); background: transparent; font-size: 1.2rem; font-weight: 800; }
.primary-button, .secondary-button {
  display: inline-flex;
  min-height: 52px;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 12px 22px;
  border: 1px solid transparent;
  border-radius: 14px;
  font-weight: 800;
  letter-spacing: .05em;
  transition: transform .18s ease, filter .18s ease, border-color .18s ease, background .18s ease;
}
.primary-button { color: #1b100a; background: linear-gradient(135deg,#ffe0a3,#d89250 54%,#b45a36); box-shadow: 0 12px 28px rgba(178,83,42,.25),inset 0 1px rgba(255,255,255,.45); }
.primary-button:hover { filter: brightness(1.08); transform: translateY(-2px); }
.secondary-button { border-color: var(--line-strong); color: var(--gold-light); background: rgba(255,255,255,.025); }
.secondary-button:hover { border-color: var(--gold); background: rgba(231,184,113,.07); }
.primary-button.wide, .secondary-button.wide { width: 100%; }
.quick-links { display: flex; align-items: center; gap: 14px; margin-top: 17px; }
.quick-links button, .text-button { min-height: 44px; padding: 7px 6px; border: 0; color: var(--muted); background: transparent; }
.quick-links button:hover, .text-button:hover { color: var(--gold-light); }
.quick-links > span { color: var(--copper); font-size: .55rem; }
.hero-screen > .local-note { margin-top: 18px; }

.content-screen, .result-screen, .final-screen { width: 100%; }
.screen-heading { display: grid; grid-template-columns: 48px 1fr 48px; align-items: center; gap: 10px; margin-bottom: 18px; }
.screen-heading > div { text-align: center; }
.screen-heading .eyebrow { justify-content: center; margin-bottom: 4px; }
.screen-heading h1 { margin: 0; font-size: clamp(1.45rem,5.5vw,2.6rem); letter-spacing: -.03em; }
.back-button, .icon-button { display: grid; width: 44px; height: 44px; place-items: center; border: 1px solid var(--line); border-radius: 50%; color: var(--gold-light); background: rgba(255,255,255,.025); font-size: 1.05rem; }
.back-button:hover, .icon-button:hover { border-color: var(--gold); background: rgba(231,184,113,.07); }
.draft-intro { display: grid; grid-template-columns: 54px 1fr; align-items: center; gap: 14px; margin-bottom: 14px; padding: 17px; border: 1px solid var(--line); border-radius: 17px; background: linear-gradient(105deg,rgba(137,67,38,.17),rgba(255,255,255,.016)); }
.draft-intro .torch { display: grid; width: 54px; height: 54px; place-items: center; border: 1px solid var(--line-strong); border-radius: 50%; color: var(--gold); background: rgba(0,0,0,.2); font-size: 1.5rem; }
.draft-intro p { margin: 2px 0 0; color: var(--muted); font-size: .78rem; }
.badge-order { display: grid; grid-template-columns: repeat(2,1fr); gap: 7px; margin-bottom: 24px; }
.badge-rank { display: grid; grid-template-columns: 26px 1fr auto; align-items: center; gap: 7px; min-height: 48px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 12px; color: var(--muted); background: rgba(255,255,255,.015); }
.badge-rank > b { display: grid; width: 26px; height: 26px; place-items: center; border-radius: 50%; color: #130d09; background: #756052; font-size: .68rem; }
.badge-rank > span { overflow: hidden; color: var(--text); font-size: .8rem; text-overflow: ellipsis; white-space: nowrap; }
.badge-rank > em { color: var(--gold); font-size: .68rem; font-style: normal; }
.badge-rank.is-you { border-color: var(--gold); background: rgba(181,94,52,.1); }
.badge-rank.is-you > b { background: var(--gold); }
.section-kicker { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 2px 12px; color: var(--text); font-weight: 800; }
.section-kicker > span { color: var(--muted); font-size: .7rem; font-weight: 400; }

.content-screen .talent-grid { grid-template-columns: 1fr; }
.content-screen .talent-card { display: grid; grid-template-columns: 48px 1fr auto; grid-template-areas: "number number stock" "icon title stock" "icon copy stock"; min-height: 146px; gap: 2px 12px; align-items: center; }
.content-screen .talent-card > .talent-number { grid-area: number; display: block; margin: 0; color: #76685d; font-size: .68rem; }
.content-screen .talent-card > i { grid-area: icon; display: grid; width: 48px; height: 48px; place-items: center; border: 1px solid var(--line); border-radius: 13px; color: var(--gold); background: rgba(0,0,0,.18); font-size: 1.25rem; font-style: normal; }
.content-screen .talent-card > strong { grid-area: title; align-self: end; }
.content-screen .talent-card > small { grid-area: copy; align-self: start; color: var(--muted); }
.content-screen .talent-card > em { grid-area: stock; display: block; width: auto; height: auto; padding: 4px 8px; border: 0; border-radius: 99px; color: var(--green); background: rgba(113,165,120,.08); font-size: .66rem; font-style: normal; white-space: nowrap; }
.content-screen .talent-card.is-empty { filter: grayscale(.8); }

.round-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.round-header h1 { margin: 0; font-size: clamp(1.6rem,6vw,3.2rem); }
.round-orb { display: grid; grid-template-columns: 28px auto; grid-template-rows: auto auto; flex: 0 0 76px; min-height: 72px; align-items: center; justify-content: center; border: 1px solid var(--line-strong); border-radius: 18px; background: radial-gradient(circle,rgba(176,91,49,.18),rgba(10,8,7,.2)); }
.round-orb > span { grid-row: 1/3; color: var(--gold); font-size: 1.2rem; }
.round-orb > b { color: var(--gold-light); font: 700 1.45rem Georgia,serif; line-height: 1; }
.round-orb > small { color: var(--muted); font-size: .52rem; line-height: 1; }
.round-track { display: grid; grid-template-columns: repeat(6,1fr); margin-bottom: 14px; }
.round-track > span { position: relative; display: grid; justify-items: center; gap: 2px; color: #6e6259; }
.round-track > span:not(:last-child)::after { content: ""; position: absolute; top: 18px; left: calc(50% + 20px); right: calc(-50% + 20px); height: 1px; background: var(--line); }
.round-track i { z-index: 1; display: grid; width: 36px; height: 36px; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: var(--bg); font-style: normal; }
.round-track b { font-size: .6rem; }
.round-track .done { color: var(--muted); }
.round-track .done i { border-color: #655348; background: #37261d; }
.round-track .active { color: var(--gold-light); }
.round-track .active i { border-color: var(--gold); color: #1b100a; background: var(--gold); box-shadow: 0 0 18px rgba(231,184,113,.18); }
.resource-ribbon { display: grid; grid-template-columns: 1fr 1fr; margin-bottom: 15px; border: 1px solid var(--line); border-radius: 17px; background: linear-gradient(135deg,rgba(49,33,24,.92),rgba(22,16,13,.96)); overflow: hidden; box-shadow: 0 14px 35px rgba(0,0,0,.2); }
.resource-ribbon > span { display: grid; grid-template-columns: 28px 1fr; grid-template-rows: auto auto; min-width: 0; min-height: 68px; align-content: center; padding: 10px; border-right: 1px solid var(--line); }
.resource-ribbon > span:nth-child(2) { border-right: 0; }
.resource-ribbon > span:nth-child(3) { grid-column: 1/-1; border-top: 1px solid var(--line); border-right: 0; }
.resource-ribbon i { grid-row: 1/3; align-self: center; color: var(--gold); font-style: normal; }
.resource-ribbon b { overflow: hidden; color: var(--gold-light); text-overflow: ellipsis; white-space: nowrap; }
.resource-ribbon small { overflow: hidden; color: var(--muted); font-size: .58rem; text-overflow: ellipsis; white-space: nowrap; }
.arena-screen .game-layout { display: grid; gap: 15px; }
.allocation-panel, .standings-panel { position: relative; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(145deg,rgba(45,31,23,.94),rgba(23,17,14,.98)); box-shadow: var(--shadow); overflow: hidden; }
.allocation-panel { padding: 18px; }
.standings-panel { align-self: start; padding: 18px; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.panel-heading h2, .panel-heading p { margin-bottom: 0; }
.scenario-card { display: grid; grid-template-columns: 58px 1fr; align-items: center; gap: 13px; margin-bottom: 16px; padding: 14px; border: 1px solid var(--line-strong); border-radius: 16px; background: linear-gradient(110deg,rgba(148,72,41,.17),rgba(255,255,255,.015)); }
.scenario-card.lions { background: linear-gradient(110deg,rgba(151,96,38,.17),rgba(255,255,255,.015)); }
.scenario-seal { display: grid; width: 58px; height: 58px; place-items: center; border: 1px solid var(--line-strong); border-radius: 50%; color: var(--gold); background: #1a120e; font-size: 1.55rem; }
.scenario-card p { margin: 3px 0 0; color: var(--muted); font-size: .76rem; line-height: 1.5; }
.choice-block { min-width: 0; margin: 0 0 12px; padding: 15px; border: 1px solid var(--line); border-radius: 16px; background: rgba(6,5,4,.15); }
.choice-block legend { padding: 0 7px; font-weight: 800; }
.choice-block legend span { display: inline-grid; width: 26px; height: 26px; margin-right: 6px; place-items: center; border-radius: 50%; color: #21130c; background: var(--gold); font-size: .68rem; }
.choice-block .point-cards { display: grid; grid-template-columns: repeat(auto-fit,minmax(68px,1fr)); gap: 7px; }
.choice-block .point-card { position: relative; display: block; min-width: 0; min-height: 116px; border: 1px solid var(--line); border-radius: 12px; background: linear-gradient(155deg,rgba(74,45,30,.78),rgba(17,13,11,.97)); overflow: hidden; }
.choice-block .point-card input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.choice-block .point-card > span { position: absolute; inset: 5px; display: grid; place-items: center; padding: 8px 2px; border: 1px solid rgba(231,184,113,.11); border-radius: 8px; }
.choice-block .point-card small, .choice-block .point-card em { color: var(--muted); font-size: .56rem; font-style: normal; }
.choice-block .point-card b { color: var(--gold-light); font: 700 clamp(1.55rem,7vw,2.35rem) Georgia,serif; }
.choice-block .point-card.selected { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(231,184,113,.1); transform: translateY(-2px); }
.choice-block .weapon-control { display: grid; grid-template-columns: 1fr 88px; align-items: center; gap: 12px; }
.weapon-control input[type="range"] { width: 100%; height: 44px; margin: 0; accent-color: var(--gold); }
.choice-block .weapon-control output { display: grid; min-height: 58px; place-items: center; padding: 7px; border: 1px solid var(--line); border-radius: 12px; background: rgba(0,0,0,.2); text-align: center; }
.choice-block .weapon-control output b { color: var(--gold-light); font: 700 1.45rem Georgia,serif; line-height: 1; }
.choice-block .weapon-control output small { color: var(--muted); font-size: .52rem; }
.talent-toggle { position: relative; display: block; margin-top: 10px; }
.talent-toggle > input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.talent-toggle > span { display: grid; grid-template-columns: 40px 1fr; grid-template-rows: auto auto; min-height: 62px; align-content: center; padding: 9px 12px; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.018); }
.talent-toggle > span > i { grid-row: 1/3; display: grid; width: 32px; height: 32px; align-self: center; place-items: center; border-radius: 50%; color: var(--gold); background: rgba(181,94,52,.12); font-style: normal; }
.talent-toggle small { color: var(--muted); font-size: .66rem; }
.talent-toggle input:checked + span { border-color: var(--gold); background: rgba(181,94,52,.12); box-shadow: inset 3px 0 var(--gold); }
.select-label { display: grid; gap: 7px; color: var(--muted); font-size: .75rem; }
.select-label select { width: 100%; min-height: 50px; padding: 8px 38px 8px 12px; border: 1px solid var(--line-strong); border-radius: 12px; color: var(--text); background: #1b1410; }
.microcopy { margin: 9px 0 0; color: #897a6e; font-size: .66rem; }
.commit-bar { position: sticky; bottom: max(8px,var(--safe-bottom)); z-index: 5; display: grid; gap: 10px; align-items: center; padding: 11px; border: 1px solid var(--line); border-radius: 16px; background: rgba(15,11,9,.9); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }
.commit-bar > span { color: var(--muted); font-size: .75rem; text-align: center; }
.commit-bar > span b { color: var(--gold-light); font-size: 1.2rem; }
.player-list { display: grid; gap: 6px; }
.player-row { display: grid; grid-template-columns: 25px 40px 1fr auto auto; align-items: center; gap: 7px; min-height: 61px; padding: 8px; border: 1px solid transparent; border-radius: 12px; }
.player-row.is-you { border-color: var(--line); background: rgba(181,94,52,.09); }
.rank-number { color: var(--muted); text-align: center; }
.player-row .avatar, .result-row .avatar, .podium-row .avatar { display: grid; width: 40px; height: 40px; place-items: center; border: 1px solid var(--line); border-radius: 50%; color: var(--gold-light); background: rgba(181,94,52,.1); }
.player-identity { display: grid; min-width: 0; }
.player-identity strong, .player-identity small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player-identity small { color: var(--muted); font-size: .6rem; }
.player-row .score, .player-row .coin { display: grid; justify-items: end; }
.player-row .score b { color: var(--gold-light); }
.player-row .score small, .player-row .coin small { color: var(--muted); font-size: .56rem; }
.player-row .coin { min-width: 38px; }
.arena-tip { display: grid; grid-template-columns: 32px 1fr; gap: 9px; margin-top: 13px; padding: 12px; border-top: 1px solid var(--line); color: var(--muted); }
.arena-tip > span { color: var(--copper-light); font-size: 1.25rem; }
.arena-tip p { margin: 0; font-size: .7rem; }
.arena-tip b { display: block; color: var(--text); }

.result-screen, .final-screen { position: relative; display: grid; min-height: calc(100dvh - 190px); align-content: center; justify-items: center; padding: clamp(28px,7vw,66px) 0; text-align: center; overflow: hidden; }
.result-screen > .eyebrow, .final-screen > .eyebrow { justify-content: center; }
.result-icon { display: grid; width: 96px; height: 96px; margin: 14px 0; place-items: center; border: 2px solid var(--gold); border-radius: 50%; color: var(--gold-light); background: radial-gradient(circle,rgba(184,95,53,.2),rgba(14,10,8,.9)); box-shadow: 0 0 0 9px rgba(231,184,113,.035),0 18px 38px rgba(0,0,0,.34); font-size: 2.2rem; }
.result-icon.lions { color: #f0b866; }
.result-screen h1, .final-screen h1 { margin: 4px 0 8px; font-size: clamp(2rem,8vw,4rem); }
.result-lead, .final-lead { max-width: 38rem; color: var(--muted); }
.result-table, .podium-list { display: grid; width: min(720px,100%); gap: 7px; margin: 18px auto; text-align: left; }
.result-row { display: grid; grid-template-columns: 30px 40px minmax(0,1fr) auto auto; align-items: center; gap: 8px; min-height: 66px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.018); }
.result-row.is-you { border-color: var(--gold); background: rgba(181,94,52,.11); }
.result-place { color: var(--gold); text-align: center; }
.result-row > span:nth-child(3) { display: grid; min-width: 0; }
.result-row > span:nth-child(3) small { color: var(--muted); }
.result-row > em { min-width: 52px; color: var(--muted); font-size: .7rem; font-style: normal; text-align: right; }
.result-row > em.positive { color: var(--gold-light); }
.result-row > em.coin-delta { color: var(--copper-light); }
.result-next { width: min(360px,100%); margin-top: 6px; }
.victory-rays { position: absolute; top: -120px; left: 50%; z-index: -1; width: 660px; height: 660px; transform: translateX(-50%); opacity: .16; background: repeating-conic-gradient(from 0deg,rgba(232,185,112,.55) 0deg 6deg,transparent 6deg 18deg); mask-image: radial-gradient(circle,#000,transparent 66%); animation: rays 32s linear infinite; }
@keyframes rays { to { transform: translateX(-50%) rotate(1turn); } }
.final-crown { color: var(--gold); font-size: clamp(4rem,16vw,7rem); line-height: 1; filter: drop-shadow(0 15px 24px rgba(221,151,74,.2)); }
.podium-row { display: grid; grid-template-columns: 36px 40px minmax(0,1fr) auto; align-items: center; gap: 9px; min-height: 70px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.018); }
.podium-row.place-1 { border-color: var(--gold); background: linear-gradient(90deg,rgba(194,110,60,.18),rgba(255,255,255,.016)); }
.podium-row.is-you { box-shadow: inset 3px 0 var(--gold); }
.podium-row .medal { color: var(--gold); font: 700 1.25rem Georgia,serif; text-align: center; }
.podium-row > span:nth-child(3) { display: grid; min-width: 0; }
.podium-row > span:nth-child(3) strong, .podium-row > span:nth-child(3) small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.podium-row > span:nth-child(3) small { color: var(--muted); }
.podium-row > b { display: grid; color: var(--gold-light); font: 700 1.4rem Georgia,serif; text-align: right; }
.podium-row > b small { color: var(--muted); font: .55rem var(--font,system-ui); }
.final-screen .final-actions { width: min(520px,100%); }
.final-screen > .local-note { margin-top: 12px; }

@media (min-width: 560px) {
  .content-screen .talent-grid { grid-template-columns: 1fr 1fr; }
  .badge-order { grid-template-columns: repeat(4,1fr); }
  .resource-ribbon { grid-template-columns: 1fr 1fr 1.45fr; }
  .resource-ribbon > span:nth-child(2) { border-right: 1px solid var(--line); }
  .resource-ribbon > span:nth-child(3) { grid-column: auto; border-top: 0; }
  .commit-bar { grid-template-columns: 1fr auto; }
  .commit-bar > span { text-align: left; }
}

@media (min-width: 820px) {
  .hero-screen { min-height: 690px; }
  .content-screen .talent-grid { grid-template-columns: repeat(3,1fr); }
  .content-screen .talent-card { grid-template-columns: 50px 1fr; grid-template-areas: "number stock" "icon title" "icon copy"; }
  .content-screen .talent-card > em { justify-self: end; }
  .arena-screen .game-layout { grid-template-columns: minmax(0,1fr) 330px; }
  .standings-panel { position: sticky; top: calc(90px + var(--safe-top)); }
}

@media (max-width: 430px) {
  .result-row { grid-template-columns: 24px 36px minmax(0,1fr) auto; }
  .result-row .avatar { width: 36px; height: 36px; }
  .result-row > em.coin-delta { grid-column: 3/5; justify-self: end; margin-top: -8px; }
  .player-row { grid-template-columns: 21px 36px 1fr auto; }
  .player-row .avatar { width: 36px; height: 36px; }
  .player-row .coin { grid-column: 3/5; justify-self: end; grid-auto-flow: column; gap: 3px; margin-top: -11px; }
  .podium-row { grid-template-columns: 27px 36px minmax(0,1fr) auto; padding-inline: 7px; }
  .podium-row .avatar { width: 36px; height: 36px; }
}
