:root {
  --gold: #e3b95f;
  --gold-b: #f8dc92;
  --gold-d: #8a6a2c;
  --gold-dd: #4f3a14;
  --ink: #2b1b0e;
  --parch: #ecdcb2;
  --parch-d: #d4bd88;
  --wood: #2a1a0f;
  --wood-l: #3d2717;
  --blood: #a62e24;
  --royal: #2f64c4;
  --cream: #f3e6c4;
  --muted: #bda67a;
  --serif: 'IM Fell English', Georgia, 'Times New Roman', serif;
  --caps: 'Cinzel', Georgia, serif;
  --deco: 'Cinzel Decorative', 'Cinzel', Georgia, serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { width: 100%; height: 100%; overflow: hidden; background: #120b06; color: var(--cream); font-family: var(--serif); user-select: none; -webkit-user-select: none; touch-action: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
svg { fill: currentColor; }
input, select { font: inherit; user-select: text; -webkit-user-select: text; }

#game { position: fixed; inset: 0; width: 100%; height: 100%; display: block; outline: none; }
#vignette { position: fixed; inset: 0; pointer-events: none; background: radial-gradient(ellipse at center, transparent 55%, rgba(10, 5, 2, 0.55) 100%); z-index: 1; }

/* ── Screens ─────────────────────────────────────────── */
.screen, .hud { position: fixed; inset: 0; z-index: 5; display: none; }
.screen.active, .hud.active { display: block; }
.hud { pointer-events: none; }
.hud > * { pointer-events: auto; }

/* ── Ornamented panels ───────────────────────────────── */
.panel {
  position: relative;
  background: linear-gradient(180deg, rgba(48, 30, 17, 0.96), rgba(26, 16, 9, 0.96));
  border: 1px solid var(--gold-d);
  box-shadow: 0 0 0 1px #000, inset 0 0 0 3px rgba(0, 0, 0, 0.35), inset 0 0 0 4px rgba(227, 185, 95, 0.25), 0 12px 40px rgba(0, 0, 0, 0.55);
  border-radius: 6px;
}
.panel::before, .panel::after {
  content: ''; position: absolute; width: 10px; height: 10px; background: var(--gold); transform: rotate(45deg);
  box-shadow: 0 0 0 2px #2a1a0f; top: -5px; left: -5px;
}
.panel::after { left: auto; right: -5px; }

.parchment {
  color: var(--ink);
  background-color: var(--parch);
  background-image:
    radial-gradient(ellipse at 20% 15%, rgba(255, 250, 230, 0.6), transparent 45%),
    radial-gradient(ellipse at 85% 90%, rgba(120, 80, 30, 0.25), transparent 50%),
    radial-gradient(ellipse at 50% 50%, transparent 60%, rgba(110, 70, 25, 0.35) 100%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .35 0 0 0 0 .24 0 0 0 0 .1 0 0 0 .18 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  box-shadow: inset 0 0 40px rgba(90, 55, 15, 0.45), 0 10px 40px rgba(0, 0, 0, 0.6);
}

/* ── Buttons ─────────────────────────────────────────── */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-family: var(--caps); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; font-size: 15px;
  color: #2a1708; padding: 12px 22px; border-radius: 4px;
  background: linear-gradient(180deg, #fbe7a7 0%, #e9be5f 45%, #c48f36 55%, #dcae55 100%);
  border: 1px solid #5a3a10;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7), inset 0 -2px 0 rgba(90, 50, 10, 0.4), 0 3px 0 #3d260a, 0 6px 14px rgba(0, 0, 0, 0.45);
  text-shadow: 0 1px 0 rgba(255, 240, 200, 0.6);
  transition: transform 0.12s, filter 0.12s, box-shadow 0.12s;
}
.btn svg { width: 20px; height: 20px; flex: none; }
.btn small { display: block; font-family: var(--serif); text-transform: none; letter-spacing: 0; font-weight: 400; font-style: italic; font-size: 13px; opacity: 0.8; }
.btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn:active { transform: translateY(2px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 1px 0 #3d260a, 0 3px 6px rgba(0, 0, 0, 0.4); }
.btn:disabled { filter: grayscale(0.8) brightness(0.7); cursor: not-allowed; transform: none; }
.btn-dark {
  color: var(--gold-b);
  background: linear-gradient(180deg, #4a2f1a 0%, #2e1c0f 100%);
  border: 1px solid var(--gold-d);
  box-shadow: inset 0 1px 0 rgba(255, 220, 150, 0.15), inset 0 0 0 1px rgba(0, 0, 0, 0.5), 0 3px 0 #120a04, 0 6px 14px rgba(0, 0, 0, 0.45);
  text-shadow: 0 1px 2px #000;
}
.btn-sm { padding: 8px 14px; font-size: 13px; }
.btn-big { font-size: 20px; padding: 16px 30px; }
.btn-battle {
  color: #fff3d6; font-size: 19px; padding: 14px 28px;
  background: linear-gradient(180deg, #e2604a 0%, #b5352a 50%, #8a1f18 100%);
  border: 1px solid #f0c060;
  box-shadow: inset 0 1px 0 rgba(255, 200, 170, 0.6), 0 0 0 2px #3a0d08, 0 4px 0 #3a0d08, 0 8px 22px rgba(160, 30, 20, 0.5);
  text-shadow: 0 2px 2px rgba(0, 0, 0, 0.6);
}
.btn-battle:not(:disabled) { animation: pulse 2.2s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { box-shadow: inset 0 1px 0 rgba(255, 200, 170, 0.6), 0 0 0 2px #3a0d08, 0 4px 0 #3a0d08, 0 8px 22px rgba(160, 30, 20, 0.5); } 50% { box-shadow: inset 0 1px 0 rgba(255, 200, 170, 0.6), 0 0 0 2px #3a0d08, 0 4px 0 #3a0d08, 0 8px 34px rgba(255, 90, 50, 0.85); } }

.icon-btn {
  width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%;
  color: var(--gold-b);
  background: radial-gradient(circle at 35% 30%, #5a3a20, #24150b 70%);
  border: 2px solid var(--gold-d);
  box-shadow: 0 0 0 2px #120a04, 0 4px 12px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 220, 150, 0.2);
  transition: transform 0.12s, color 0.12s;
}
.icon-btn svg { width: 22px; height: 22px; }
.icon-btn:hover { transform: scale(1.07); color: #fff2c4; }
.icon-btn.off { color: #7b6a50; }

/* ── Crest & logo ───────────────────────────────────── */
.crest {
  width: 92px; height: 100px; margin: 0 auto 6px;
  background: url("../assets/emblem-256.webp") center / contain no-repeat;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.7));
}
.crest.big { width: 158px; height: 171px; margin-bottom: 2px; animation: float 5s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-6px); } }
.logo {
  font-family: var(--deco); font-weight: 900; font-size: clamp(30px, 8.6vw, 92px); letter-spacing: 0.04em; line-height: 1;
  background: linear-gradient(180deg, #fff5cf 0%, #f3cf74 42%, #b8822e 52%, #f2d38a 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 2px 0 #3b2208) drop-shadow(0 6px 18px rgba(0, 0, 0, 0.8));
  text-align: center;
}
.tagline { font-family: var(--caps); font-weight: 700; letter-spacing: 0.4em; color: var(--muted); text-align: center; margin-top: 10px; font-size: clamp(12px, 1.6vw, 16px); text-shadow: 0 2px 6px #000; }

/* ── Loader ─────────────────────────────────────────── */
#loader {
  z-index: 50; display: none; overflow: hidden;
  background:
    radial-gradient(ellipse 60% 45% at 50% 42%, rgba(196, 120, 40, 0.28), transparent 70%),
    radial-gradient(ellipse 120% 70% at 50% 110%, rgba(150, 60, 20, 0.35), transparent 60%),
    radial-gradient(ellipse at center, #2f1d0f 0%, #160c05 60%, #070402 100%);
  transition: opacity 0.6s ease, visibility 0s linear 0.6s;
}
#loader.active { display: grid; place-items: center; }
#loader.leaving { opacity: 0; visibility: hidden; pointer-events: none; }
.loader-inner { position: relative; text-align: center; padding: 0 20px; }
.loader-inner .logo { font-size: clamp(36px, 7vw, 72px); animation: ld-rise 0.9s cubic-bezier(.2, .8, .3, 1) 0.15s both; }
.ld-tag { font: 700 clamp(11px, 1.5vw, 14px) var(--caps); letter-spacing: 0.42em; color: #cdb68a; margin-top: 8px; text-shadow: 0 2px 6px #000; animation: ld-rise 0.9s cubic-bezier(.2, .8, .3, 1) 0.3s both; }

/* the crest rises in and glows */
.ld-crest { position: relative; width: 150px; height: 162px; margin: 0 auto 10px; animation: ld-crest 1s cubic-bezier(.2, .8, .3, 1) both; }
.ld-crest .crest { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; animation: ld-float 5s ease-in-out 1s infinite; }
.ld-halo { position: absolute; inset: -30%; border-radius: 50%; background: radial-gradient(circle, rgba(255, 200, 110, 0.32) 0%, rgba(255, 170, 70, 0.12) 38%, transparent 66%); animation: ld-glow 3.2s ease-in-out infinite; }
@keyframes ld-crest { from { opacity: 0; transform: translateY(26px) scale(0.86); filter: blur(4px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes ld-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes ld-float { 50% { transform: translateY(-6px); } }
@keyframes ld-glow { 50% { opacity: 0.55; transform: scale(0.94); } }

/* gilded progress bar with a running glint */
.loader-bar {
  position: relative; width: min(320px, 72vw); height: 12px; margin: 30px auto 12px; padding: 2px; border-radius: 8px;
  background: linear-gradient(#1a0f07, #0d0704); border: 1px solid #b8862e;
  box-shadow: 0 0 0 2px #120a04, 0 0 0 3px rgba(233, 196, 106, 0.35), inset 0 1px 3px rgba(0, 0, 0, 0.8), 0 8px 24px rgba(0, 0, 0, 0.55);
  animation: ld-rise 0.9s cubic-bezier(.2, .8, .3, 1) 0.45s both;
}
.loader-bar::before, .loader-bar::after { content: ''; position: absolute; top: 50%; width: 10px; height: 10px; background: linear-gradient(135deg, #fff1c0, #c8902e); border: 1px solid #5a3a10; transform: translateY(-50%) rotate(45deg); }
.loader-bar::before { left: -9px; } .loader-bar::after { right: -9px; }
.loader-bar span {
  position: relative; display: block; height: 100%; width: 8%; border-radius: 5px; overflow: hidden;
  background: linear-gradient(180deg, #ffe9a0, #e0aa45 55%, #a8721f);
  box-shadow: 0 0 10px rgba(255, 196, 90, 0.6);
  transition: width 0.45s cubic-bezier(.3, .8, .3, 1);
  animation: ld-pre 2.4s ease-out forwards;
}
.loader-bar span::after { content: ''; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, 0.75) 50%, transparent 70%); transform: translateX(-100%); animation: ld-glint 1.6s ease-in-out infinite; }
@keyframes ld-pre { to { width: 32%; } } /* while the game's code downloads */
@keyframes ld-glint { to { transform: translateX(100%); } }
.loader-text { font-style: italic; color: #e8d3a2; text-shadow: 0 2px 6px #000; min-height: 1.4em; }
.ld-tip { margin: 18px auto 0; max-width: 420px; min-height: 2.6em; font: italic 15px/1.35 var(--serif); color: rgba(240, 222, 178, 0.88); opacity: 0; transform: translateY(4px); transition: opacity 0.35s ease, transform 0.35s ease; }
.ld-tip.in { opacity: 1; transform: none; }

/* drifting embers and a low fog */
.ld-embers, .ld-embers i { position: absolute; inset: 0; pointer-events: none; }
.ld-embers i {
  background-image:
    radial-gradient(2px 2px at 12% 80%, #ffcf7a, transparent), radial-gradient(1.5px 1.5px at 28% 60%, #ffb35a, transparent),
    radial-gradient(2px 2px at 46% 90%, #ffd98a, transparent), radial-gradient(1.5px 1.5px at 63% 70%, #ff9d48, transparent),
    radial-gradient(2.5px 2.5px at 78% 85%, #ffcf7a, transparent), radial-gradient(1.5px 1.5px at 90% 65%, #ffb35a, transparent),
    radial-gradient(2px 2px at 35% 98%, #ffe2a0, transparent), radial-gradient(1.5px 1.5px at 55% 55%, #ffb35a, transparent);
  background-size: 100% 100%; opacity: 0.7; animation: ld-ember 9s linear infinite; filter: drop-shadow(0 0 3px #ff9a3a);
}
.ld-embers i:nth-child(2) { animation-duration: 13s; animation-delay: -5s; transform: scaleX(-1); opacity: 0.5; }
.ld-embers i:nth-child(3) { animation-duration: 17s; animation-delay: -9s; opacity: 0.35; background-size: 70% 100%; }
@keyframes ld-ember { from { transform: translateY(20%) translateX(0); opacity: 0; } 15% { opacity: 0.7; } 85% { opacity: 0.5; } to { transform: translateY(-70%) translateX(3%); opacity: 0; } }
.ld-fog { position: absolute; left: -20%; right: -20%; bottom: -10%; height: 45%; background: radial-gradient(ellipse at 30% 80%, rgba(120, 80, 45, 0.25), transparent 60%), radial-gradient(ellipse at 75% 90%, rgba(110, 70, 40, 0.22), transparent 60%); filter: blur(18px); animation: ld-fog 14s ease-in-out infinite alternate; pointer-events: none; }
@keyframes ld-fog { to { transform: translateX(6%); } }
@media (max-height: 560px) { .ld-crest { width: 92px; height: 100px; } .loader-bar { margin-top: 16px; } .ld-tip { margin-top: 8px; } }
@media (prefers-reduced-motion: reduce) { .ld-embers, .ld-fog, .ld-halo { display: none; } .ld-crest, .ld-crest .crest, .loader-inner .logo, .ld-tag, .loader-bar { animation: none; } }

/* ── Title ──────────────────────────────────────────── */
#title.active { display: grid; place-items: center; background: radial-gradient(ellipse at center, rgba(15, 8, 3, 0.15) 0%, rgba(15, 8, 3, 0.65) 75%); }
.title-wrap { display: flex; flex-direction: column; align-items: center; animation: rise 0.9s cubic-bezier(.2, .8, .2, 1) both; padding: 20px; }
@keyframes rise { from { opacity: 0; transform: translateY(30px); } }
.menu { display: flex; flex-direction: column; gap: 12px; margin-top: 34px; width: min(360px, 86vw); }
.menu .btn { width: 100%; flex-direction: column; gap: 2px; }
.menu .btn-big { flex-direction: row; gap: 12px; }
.menu .btn span { display: block; }
.ig-link {
  position: absolute; left: 50%; bottom: calc(20px + var(--safe-b)); transform: translateX(-50%);
  display: flex; align-items: center; gap: 8px; color: var(--gold-b); text-decoration: none; font-family: var(--caps); font-weight: 700; letter-spacing: 0.08em;
  padding: 8px 16px; border-radius: 30px; background: rgba(20, 10, 4, 0.65); border: 1px solid var(--gold-d);
}
.ig-link svg { width: 20px; height: 20px; }
.ig-link:hover { color: #fff; }
.corner-tr { position: absolute; top: 16px; right: 16px; }

/* ── Campaign ───────────────────────────────────────── */
#campaign.active { display: flex; flex-direction: column; background: rgba(12, 7, 3, 0.72); backdrop-filter: blur(3px); }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; }
.topbar h2 { font-family: var(--deco); font-weight: 900; font-size: clamp(22px, 3.2vw, 36px); color: var(--gold-b); text-shadow: 0 2px 0 #3b2208, 0 4px 14px #000; text-align: center; }
.star-total { display: flex; align-items: center; gap: 6px; font-family: var(--caps); font-weight: 900; font-size: 22px; color: var(--gold-b); }
.star-total svg { width: 26px; height: 26px; color: #f5c84c; filter: drop-shadow(0 0 6px rgba(255, 200, 80, 0.6)); }
.star-total small { font-size: 14px; color: var(--muted); }
.campaign-body { flex: 1; display: grid; grid-template-columns: 270px 1fr; gap: 18px; padding: 0 20px 20px; min-height: 0; }
#region-list { display: flex; flex-direction: column; gap: 10px; overflow-y: auto; padding: 4px; }
.region-tab {
  text-align: left; padding: 12px 14px; border-radius: 6px; display: flex; gap: 12px; align-items: center;
  background: linear-gradient(180deg, rgba(60, 38, 20, 0.95), rgba(30, 18, 10, 0.95)); border: 1px solid #5a4020; color: var(--cream);
  transition: transform 0.15s, border-color 0.15s;
}
.region-tab:hover { transform: translateX(3px); border-color: var(--gold-d); }
.region-tab.on { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold), 0 0 18px rgba(227, 185, 95, 0.35); }
.region-tab.locked { opacity: 0.5; }
.region-tab .sw { width: 42px; height: 42px; border-radius: 50%; flex: none; border: 2px solid var(--gold-d); box-shadow: inset 0 -6px 10px rgba(0, 0, 0, 0.35); }
.region-tab .rn { font-family: var(--caps); font-weight: 700; font-size: 16px; color: var(--gold-b); }
.region-tab .rs { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 4px; }
.region-tab .rs svg { width: 13px; height: 13px; color: #f5c84c; }

#region-map { position: relative; border-radius: 8px; overflow: hidden; min-height: 0; border: 3px solid #5a3d14; box-shadow: 0 0 0 2px #1a0f06, 0 0 0 5px var(--gold-d), 0 20px 50px rgba(0, 0, 0, 0.6); }
.rm-head { position: absolute; top: 16px; left: 0; right: 0; text-align: center; z-index: 2; pointer-events: none; }
.rm-head h3 { font-family: var(--deco); font-weight: 900; font-size: clamp(24px, 3vw, 38px); color: #4a2a0c; text-shadow: 0 1px 0 rgba(255, 245, 210, 0.7); }
.rm-head p { font-style: italic; color: #5a3d1c; font-size: 16px; margin-top: 2px; }
#region-map svg.art { position: absolute; inset: 0; width: 100%; height: 100%; }
.node {
  position: absolute; transform: translate(-50%, -50%); width: 74px; height: 74px; border-radius: 50%;
  display: grid; place-items: center; z-index: 3;
  background: radial-gradient(circle at 35% 30%, #d9483a, #8c1d16 65%, #5a0f0b);
  border: 3px solid #f0c968; box-shadow: 0 0 0 3px #3a1508, 0 8px 18px rgba(0, 0, 0, 0.5), inset 0 -6px 10px rgba(0, 0, 0, 0.35);
  font-family: var(--caps); font-weight: 900; font-size: 24px; color: #fff3d0; text-shadow: 0 2px 2px rgba(0, 0, 0, 0.6);
  transition: transform 0.15s;
}
.node:hover { transform: translate(-50%, -50%) scale(1.1); }
.node.boss { width: 92px; height: 92px; font-size: 18px; background: radial-gradient(circle at 35% 30%, #4a4a52, #1e1e24 65%, #0d0d10); }
.node.done { background: radial-gradient(circle at 35% 30%, #4d86e0, #1f4590 65%, #12295a); }
.node.locked { background: radial-gradient(circle at 35% 30%, #8a7a62, #4e4334 70%); border-color: #8a7550; color: #d8c8a8; cursor: not-allowed; }
.node.locked svg { width: 26px; height: 26px; }
.node .stars { position: absolute; bottom: -18px; display: flex; gap: 1px; }
.node .stars svg { width: 18px; height: 18px; color: #6b5a40; filter: drop-shadow(0 1px 0 #2a1708); }
.node .stars svg.on { color: #f7c948; filter: drop-shadow(0 0 4px rgba(255, 200, 60, 0.9)) drop-shadow(0 1px 0 #2a1708); }
.node .label { position: absolute; top: 100%; margin-top: 22px; white-space: nowrap; font-family: var(--caps); font-size: 12px; font-weight: 700; color: #3d240b; text-shadow: 0 1px 0 rgba(255, 245, 210, 0.8); }
.node.next::after { content: ''; position: absolute; inset: -10px; border-radius: 50%; border: 3px solid #f8dc92; animation: ring 1.6s ease-out infinite; }
@keyframes ring { from { transform: scale(0.85); opacity: 1; } to { transform: scale(1.3); opacity: 0; } }

/* ── HUD (deploy & battle) ──────────────────────────── */
.hud-top { position: absolute; top: 12px; left: 12px; right: 12px; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; pointer-events: none; }
.hud-top > * { pointer-events: auto; }
.hud-right { display: flex; gap: 8px; }
.title-plate {
  text-align: center; padding: 8px 28px 10px; min-width: 260px; max-width: 54vw;
  background: linear-gradient(180deg, rgba(48, 30, 17, 0.94), rgba(26, 16, 9, 0.94));
  border: 1px solid var(--gold-d); border-top: 0; border-radius: 0 0 14px 14px; margin-top: -12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), inset 0 -2px 0 rgba(227, 185, 95, 0.25);
  pointer-events: none !important;
}
.tp-name { font-family: var(--caps); font-weight: 900; font-size: clamp(15px, 2vw, 22px); color: var(--gold-b); text-shadow: 0 2px 4px #000; }
.tp-sub { font-style: italic; color: var(--muted); font-size: 14px; }

.treasury, .enemy-plate {
  position: absolute; top: 72px; display: flex; align-items: center; gap: 10px; padding: 8px 16px 8px 10px;
  background: linear-gradient(180deg, rgba(48, 30, 17, 0.92), rgba(26, 16, 9, 0.92)); border: 1px solid var(--gold-d); border-radius: 40px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
}
.treasury { left: 12px; }
.enemy-plate { right: 12px; flex-direction: column; align-items: flex-end; gap: 0; border-radius: 12px; padding: 8px 14px; }
.coin {
  width: 40px; height: 40px; border-radius: 50%; flex: none;
  background: radial-gradient(circle at 35% 30%, #fff3bf, #f0c45a 40%, #a8741f 80%);
  border: 2px solid #6b4612; box-shadow: inset 0 0 0 4px rgba(255, 240, 190, 0.35), 0 2px 6px rgba(0, 0, 0, 0.5);
  position: relative;
}
.coin::after { content: 'M'; position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--deco); font-weight: 900; color: #7a4e14; font-size: 18px; }
.t-label { font-family: var(--caps); font-size: 11px; letter-spacing: 0.18em; color: var(--muted); text-transform: uppercase; }
.t-amount { font-family: var(--caps); font-weight: 900; font-size: 24px; color: var(--gold-b); line-height: 1.05; }
.t-amount small { font-size: 14px; color: var(--muted); font-weight: 700; }
.treasury.bump .coin { animation: bump 0.35s; }
@keyframes bump { 40% { transform: scale(1.25) rotate(-12deg); } }
.ep-val { font-family: var(--caps); font-weight: 700; font-size: 15px; color: #ffb3a6; }
.ep-units { display: flex; gap: 4px; margin-top: 4px; flex-wrap: wrap; justify-content: flex-end; max-width: 260px; }
.ep-units span { display: flex; align-items: center; gap: 2px; font-family: var(--caps); font-size: 12px; color: var(--cream); }
.ep-units .uicon { width: 18px; height: 18px; padding: 2px; border-radius: 50%; background: #7a2a20; fill: #ffe9d6; }

.hint {
  position: absolute; left: 50%; bottom: calc(184px + var(--safe-b)); transform: translateX(-50%); pointer-events: none !important;
  font-style: italic; font-size: 16px; color: #fff4d8; text-shadow: 0 2px 6px #000, 0 0 12px #000; white-space: nowrap; text-align: center;
}

.tray-wrap {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 10px 12px calc(12px + var(--safe-b));
  display: flex; align-items: flex-end; gap: 12px;
  background: linear-gradient(0deg, rgba(14, 8, 4, 0.92) 0%, rgba(14, 8, 4, 0.7) 70%, transparent 100%);
}
#unit-tray { flex: 1; display: flex; gap: 8px; overflow-x: auto; padding: 14px 4px 6px; scrollbar-width: thin; scrollbar-color: var(--gold-d) transparent; touch-action: pan-x; }
.tray-actions { display: flex; flex-direction: column; gap: 8px; align-items: stretch; padding-bottom: 6px; }


#sel-panel { position: absolute; left: 12px; bottom: calc(196px + var(--safe-b)); padding: 12px 14px; width: 250px; }
#sel-panel.hidden { display: none; }
.sp-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.sp-head .uicon { width: 34px; height: 34px; padding: 5px; border-radius: 50%; fill: #1e140a; border: 2px solid #3a2410; }
.sp-head b { font-family: var(--caps); color: var(--gold-b); font-size: 15px; display: block; }
.sp-head small { color: var(--muted); font-style: italic; }
.sp-row { display: flex; gap: 6px; }
.sp-row .btn { flex: 1; padding: 8px 6px; font-size: 11px; gap: 4px; }
.sp-row .btn svg { width: 16px; height: 16px; }
.stance { margin-top: 8px; display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--gold-d); border-radius: 5px; overflow: hidden; }
.stance button { padding: 7px 4px; font-family: var(--caps); font-size: 11px; font-weight: 700; color: var(--muted); display: flex; align-items: center; justify-content: center; gap: 4px; }
.stance button svg { width: 14px; height: 14px; }
.stance button.on { background: linear-gradient(180deg, #f2d48a, #c79a45); color: #2a1708; }

/* Battle HUD */
.strength { flex: 1; max-width: 720px; display: flex; align-items: center; gap: 10px; padding: 8px 14px; background: linear-gradient(180deg, rgba(48, 30, 17, 0.92), rgba(26, 16, 9, 0.92)); border: 1px solid var(--gold-d); border-radius: 30px; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45); pointer-events: none !important; }
.strength .side { flex: 1; display: flex; align-items: center; gap: 8px; }
.strength .bar { flex: 1; height: 14px; border-radius: 8px; background: #140b05; border: 1px solid #000; overflow: hidden; box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.6); }
.strength .bar span { display: block; height: 100%; transition: width 0.3s; }
.strength .blue .bar span { background: linear-gradient(180deg, #7aa8ff, #2f64c4 60%, #1d3a78); margin-left: auto; }
.strength .blue .bar { display: flex; }
.strength .red .bar span { background: linear-gradient(180deg, #ff8a78, #c0352b 60%, #6e1a16); }
.strength .cnt { font-family: var(--caps); font-weight: 900; font-size: 16px; min-width: 32px; text-align: center; }
.strength .blue .cnt { color: #9cc0ff; }
.strength .red .cnt { color: #ffab9c; }
.clock { font-family: var(--caps); font-weight: 900; font-size: 20px; color: var(--gold-b); min-width: 64px; text-align: center; }
.speed { position: absolute; right: 12px; bottom: calc(16px + var(--safe-b)); display: flex; border: 1px solid var(--gold-d); border-radius: 30px; overflow: hidden; background: rgba(26, 16, 9, 0.92); box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45); }
.speed button { padding: 10px 14px; font-family: var(--caps); font-weight: 900; color: var(--muted); min-width: 50px; }
.speed button.on { background: linear-gradient(180deg, #f2d48a, #c79a45); color: #2a1708; }

/* ── Announce ───────────────────────────────────────── */
#announce { position: fixed; inset: 0; z-index: 30; display: none; place-items: center; pointer-events: none; }
#announce.show { display: grid; }
.an-inner { text-align: center; animation: slam 2.4s cubic-bezier(.2, .9, .2, 1) both; }
.an-text { font-family: var(--deco); font-weight: 900; font-size: clamp(54px, 11vw, 140px); line-height: 1; background: linear-gradient(180deg, #fff5cf, #f3cf74 42%, #b8822e 52%, #f2d38a); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 3px 0 #3b2208) drop-shadow(0 10px 30px rgba(0, 0, 0, 0.9)); }
.an-sub { font-family: var(--caps); font-weight: 700; letter-spacing: 0.3em; color: var(--cream); text-shadow: 0 2px 8px #000; margin-top: 8px; font-size: clamp(14px, 2vw, 20px); }
@keyframes slam { 0% { opacity: 0; transform: scale(2.2); } 12% { opacity: 1; transform: scale(0.95); } 18% { transform: scale(1); } 80% { opacity: 1; transform: scale(1.04); } 100% { opacity: 0; transform: scale(1.1); } }

/* ── Modal ──────────────────────────────────────────── */
.modal { position: fixed; inset: 0; z-index: 40; display: none; place-items: center; background: rgba(8, 4, 2, 0.62); backdrop-filter: blur(3px); padding: 16px; }
.modal.show { display: grid; animation: fade 0.25s both; }
@keyframes fade { from { opacity: 0; } }
.modal-card { position: relative; width: min(620px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; border-radius: 6px; padding: 30px 32px 26px; animation: pop 0.35s cubic-bezier(.2, .9, .3, 1.2) both; }
@keyframes pop { from { transform: scale(0.9) translateY(20px); opacity: 0; } }
.modal-card.wide { width: min(860px, 100%); }
.modal-card .x { position: absolute; top: 10px; right: 12px; font-size: 26px; color: #6b4a1c; width: 36px; height: 36px; }
.modal-card h2 { font-family: var(--deco); font-weight: 900; color: #4a2a0c; font-size: clamp(24px, 4vw, 34px); text-align: center; line-height: 1.1; text-shadow: 0 1px 0 rgba(255, 245, 210, 0.7); }
.modal-card h3 { font-family: var(--caps); font-weight: 900; color: #5a3608; font-size: 16px; letter-spacing: 0.1em; margin: 18px 0 8px; text-transform: uppercase; }
.modal-card p { font-size: 17px; line-height: 1.45; color: #3a2512; }
.modal-card .sub { text-align: center; font-style: italic; color: #6b4a22; font-size: 17px; margin-top: 4px; }
.divider { height: 14px; margin: 14px auto; width: 70%; background: radial-gradient(circle, #8a6a2c 3px, transparent 4px) center / 14px 14px no-repeat, linear-gradient(90deg, transparent, #8a6a2c 20%, #8a6a2c 80%, transparent) center / 100% 1px no-repeat; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 22px; }
.brief-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.stat { background: rgba(90, 55, 15, 0.12); border: 1px solid rgba(90, 55, 15, 0.35); border-radius: 5px; padding: 10px 12px; }
.stat .k { font-family: var(--caps); font-weight: 700; font-size: 11px; letter-spacing: 0.15em; color: #7a5a2a; text-transform: uppercase; }
.stat .v { font-family: var(--caps); font-weight: 900; font-size: 22px; color: #3a1f06; }
.stat .v.gold { color: #8a5a08; }
.stat .v.red { color: #8a2015; }
.army-list { display: flex; flex-wrap: wrap; gap: 8px; }
.army-list .chip { display: flex; align-items: center; gap: 6px; padding: 4px 10px 4px 4px; border-radius: 20px; background: rgba(90, 55, 15, 0.14); border: 1px solid rgba(90, 55, 15, 0.35); font-family: var(--caps); font-weight: 700; font-size: 13px; }
.army-list .chip .uicon { width: 26px; height: 26px; padding: 4px; border-radius: 50%; fill: #1e140a; }
.codebox { display: flex; align-items: center; gap: 8px; justify-content: center; margin-top: 14px; flex-wrap: wrap; }
.codebox code { font-family: var(--caps); font-weight: 900; font-size: 20px; letter-spacing: 0.06em; color: #4a2a0c; background: rgba(255, 250, 230, 0.5); border: 1px dashed #8a6a2c; padding: 6px 14px; border-radius: 4px; user-select: all; -webkit-user-select: all; }
.field { display: flex; gap: 8px; margin-top: 10px; }
.field input, .field select, .forge select {
  flex: 1; padding: 12px 14px; border-radius: 4px; border: 2px solid #8a6a2c; background: rgba(255, 250, 230, 0.65); color: #2a1708;
  font-family: var(--caps); font-weight: 700; font-size: 17px; letter-spacing: 0.05em; outline: none;
}
.field input:focus { border-color: #c48f36; box-shadow: 0 0 0 3px rgba(227, 185, 95, 0.4); }
.forge { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.forge label { display: flex; flex-direction: column; gap: 4px; font-family: var(--caps); font-weight: 700; font-size: 12px; letter-spacing: 0.1em; color: #6b4a1c; text-transform: uppercase; }
.forge select { font-size: 15px; padding: 9px 10px; }
.forge input[type=range] { accent-color: #a8741f; }
.forge .val { font-size: 18px; color: #3a1f06; }
.result-title { text-align: center; }
.result-title .rt { font-family: var(--deco); font-weight: 900; font-size: clamp(46px, 9vw, 76px); line-height: 1; }
.result-title .rt.win { background: linear-gradient(180deg, #ffe9a0, #d99a2b 55%, #8a5208); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 2px 0 rgba(255, 245, 210, 0.8)); }
.result-title .rt.lose { color: #6e1a12; text-shadow: 0 2px 0 rgba(255, 245, 210, 0.6); }
.bigstars { display: flex; justify-content: center; gap: 12px; margin: 14px 0 4px; }
.bigstars svg { width: 64px; height: 64px; color: #8a7a5c; filter: drop-shadow(0 2px 0 #3a2208); transform: scale(0); animation: starpop 0.5s cubic-bezier(.2, 1.6, .4, 1) forwards; }
.bigstars svg:nth-child(2) { width: 82px; height: 82px; margin-top: -12px; }
.bigstars svg.on { color: #f6c445; filter: drop-shadow(0 0 12px rgba(255, 200, 60, 0.9)) drop-shadow(0 2px 0 #5a3a10); }
@keyframes starpop { to { transform: scale(1); } }
.share-preview { display: block; max-width: 100%; max-height: 52vh; margin: 12px auto 0; border: 3px solid #5a3d14; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); border-radius: 4px; }
.note { font-size: 14px !important; color: #6b4a22 !important; font-style: italic; text-align: center; margin-top: 10px; }
.help-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.help-unit { display: flex; gap: 10px; align-items: flex-start; padding: 8px; border-radius: 5px; background: rgba(90, 55, 15, 0.1); border: 1px solid rgba(90, 55, 15, 0.25); }
.help-unit .uicon { width: 34px; height: 34px; padding: 5px; border-radius: 50%; fill: #1e140a; flex: none; }
.help-unit b { font-family: var(--caps); font-size: 13px; color: #3a1f06; }
.help-unit p { font-size: 14px !important; line-height: 1.3 !important; }
.help-unit .gb { font-size: 12px; color: #2d6a2a; font-family: var(--caps); font-weight: 700; }
.help-unit .gb.b { color: #8a2015; }
ul.tips { margin: 6px 0 0 20px; font-size: 16px; line-height: 1.5; color: #3a2512; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid rgba(90, 55, 15, 0.25); font-family: var(--caps); font-weight: 700; color: #3a1f06; }

/* ── Tooltip & toast ────────────────────────────────── */
#tooltip { position: fixed; z-index: 45; display: none; pointer-events: none; width: 250px; padding: 12px 14px; border-radius: 6px; }
#tooltip.show { display: block; }
#tooltip h4 { font-family: var(--caps); font-weight: 900; color: var(--gold-b); font-size: 15px; display: flex; justify-content: space-between; align-items: center; }
#tooltip h4 em { font-style: normal; font-size: 11px; padding: 2px 8px; border-radius: 10px; color: #1e140a; }
#tooltip p { font-size: 13.5px; color: var(--cream); margin: 6px 0; line-height: 1.35; }
#tooltip .bars { display: grid; grid-template-columns: 60px 1fr; gap: 3px 8px; align-items: center; font-family: var(--caps); font-size: 10.5px; color: var(--muted); }
#tooltip .bars i { display: block; height: 6px; border-radius: 3px; background: #140b05; overflow: hidden; }
#tooltip .bars i b { display: block; height: 100%; background: linear-gradient(90deg, #a87a2c, #f8dc92); }
#tooltip .gb { font-size: 12px; margin-top: 6px; color: #9ee08a; }
#tooltip .gb.b { color: #ff9c8a; margin-top: 2px; }
#toast { position: fixed; left: 50%; top: 130px; transform: translateX(-50%) translateY(-10px); z-index: 60; opacity: 0; pointer-events: none; transition: opacity 0.25s, transform 0.25s; padding: 10px 18px; border-radius: 30px; background: rgba(26, 16, 9, 0.95); border: 1px solid var(--gold-d); font-family: var(--caps); font-weight: 700; font-size: 14px; color: var(--gold-b); box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5); text-align: center; max-width: 90vw; }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── Responsive ─────────────────────────────────────── */
@media (max-width: 820px) {
  .campaign-body { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  #region-list { flex-direction: row; overflow-x: auto; overflow-y: hidden; }
  .region-tab { flex: none; padding: 8px 10px; }
  .region-tab .sw { width: 30px; height: 30px; }
  .node { width: 58px; height: 58px; font-size: 19px; }
  .node.boss { width: 70px; height: 70px; font-size: 14px; }
  .node .label { display: none; }
  .title-plate { min-width: 0; padding: 6px 14px 8px; }
  .tp-sub { display: none; }
  .treasury { top: 64px; padding: 5px 12px 5px 6px; }
  .coin { width: 30px; height: 30px; }
  .t-amount { font-size: 19px; }
  .enemy-plate { top: 64px; }
  .ep-units { display: none; }
  .tray-actions .btn-battle { font-size: 15px; padding: 12px 14px; }
  .hint { bottom: calc(160px + var(--safe-b)); font-size: 13px; white-space: normal; width: 90vw; }
  #sel-panel { bottom: calc(166px + var(--safe-b)); width: 220px; }
  .strength { padding: 6px 10px; gap: 6px; }
  .clock { font-size: 16px; min-width: 46px; }
  .modal-card { padding: 24px 18px 20px; }
  .brief-grid, .forge { grid-template-columns: 1fr 1fr; }
  .hud-right .icon-btn, .hud-top > .icon-btn { width: 38px; height: 38px; }
}
@media (max-width: 480px) {
  .hud-right [data-act=help] { display: none; }
  .tray-wrap { flex-direction: column; align-items: stretch; gap: 4px; }
  .tray-actions { flex-direction: row; padding-bottom: 0; }
  .tray-actions .btn-battle { flex: 1; }
  .hint { bottom: calc(210px + var(--safe-b)); }
  #sel-panel { bottom: calc(214px + var(--safe-b)); }
}

/* ── Film replay ────────────────────────────────────── */
.film-opts { display: flex; gap: 10px; flex-wrap: wrap; }
.film-opt {
  flex: 1; min-width: 120px; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 10px; border-radius: 6px;
  background: rgba(90, 55, 15, 0.1); border: 2px solid rgba(90, 55, 15, 0.35); color: #3a1f06; transition: border-color 0.15s, background 0.15s;
}
.film-opt b { font-family: var(--caps); font-size: 14px; }
.film-opt small { font-style: italic; color: #6b4a22; }
.film-opt .ratio { height: 64px; border: 2px solid #6b4a22; border-radius: 4px; background: linear-gradient(160deg, #8fb85a, #5e8a3a); margin-bottom: 4px; }
.film-opt.on { border-color: #c48f36; background: rgba(255, 220, 120, 0.35); box-shadow: 0 0 0 2px rgba(227, 185, 95, 0.5); }
.film-preview { display: block; margin: 12px auto 0; max-width: 100%; max-height: 46vh; object-fit: contain; border: 3px solid #5a3d14; border-radius: 4px; background: #000; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); }
.film-bar { width: min(360px, 90%); height: 12px; margin: 14px auto 6px; border: 1px solid #8a6a2c; border-radius: 6px; background: rgba(60, 35, 10, 0.25); overflow: hidden; }
.film-bar span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #a87a2c, #f3cf74); transition: width 0.2s; }
.film-video { max-height: 50vh; background: #000; }

.postfx #vignette { display: none; } /* the post-processing grade has its own vignette */

/* ════════════════════════════════════════════════════════
   Mobile & touch
   ════════════════════════════════════════════════════════ */
html, body { overscroll-behavior: none; -webkit-touch-callout: none; -webkit-text-size-adjust: 100%; }
button, a, .ucard { touch-action: manipulation; }
.modal-card, .help-grid { touch-action: pan-y; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
#region-list { touch-action: pan-x pan-y; overscroll-behavior: contain; }
.modal { padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left)); }
.modal-card { max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); }
.film-preview { width: auto; height: auto; }
.share-preview, .film-video { max-height: 52dvh; }

/* safe areas (notches, rounded corners, home indicator) */
.hud-top { top: max(12px, env(safe-area-inset-top)); left: max(12px, env(safe-area-inset-left)); right: max(12px, env(safe-area-inset-right)); }
.title-plate { margin-top: calc(-1 * max(12px, env(safe-area-inset-top))); padding-top: calc(8px + env(safe-area-inset-top)); }
.treasury { top: calc(72px + env(safe-area-inset-top)); left: max(12px, env(safe-area-inset-left)); }
.enemy-plate { top: calc(72px + env(safe-area-inset-top)); right: max(12px, env(safe-area-inset-right)); }
.tray-wrap { padding-left: max(12px, env(safe-area-inset-left)); padding-right: max(12px, env(safe-area-inset-right)); }
.speed { right: max(12px, env(safe-area-inset-right)); }
#sel-panel { left: max(12px, env(safe-area-inset-left)); }
.corner-tr { top: max(16px, env(safe-area-inset-top)); right: max(16px, env(safe-area-inset-right)); display: flex; gap: 8px; }
.no-fs .fs-btn { display: none; }
#title.active { overflow-y: auto; }
.title-wrap { padding: max(20px, env(safe-area-inset-top)) 20px calc(70px + env(safe-area-inset-bottom)); }
#campaign .topbar { padding-top: max(14px, env(safe-area-inset-top)); padding-left: max(20px, env(safe-area-inset-left)); padding-right: max(20px, env(safe-area-inset-right)); }
#campaign .campaign-body { padding-left: max(20px, env(safe-area-inset-left)); padding-right: max(20px, env(safe-area-inset-right)); padding-bottom: max(20px, env(safe-area-inset-bottom)); }


.rotate-tip {
  position: fixed; left: 50%; top: calc(128px + env(safe-area-inset-top)); z-index: 55; opacity: 0; pointer-events: none;
  transform: translateX(-50%) translateY(-8px); transition: opacity 0.4s, transform 0.4s; width: max-content; max-width: 86vw; text-align: center;
  padding: 10px 16px; border-radius: 30px; background: rgba(26, 16, 9, 0.94); border: 1px solid var(--gold-d); color: var(--gold-b);
  font-family: var(--caps); font-weight: 700; font-size: 13px; box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
}
.rotate-tip.show { opacity: 1; transform: translateX(-50%); }

/* Phones & tablets: drop costly backdrop blur over the 3D canvas, no hover lifts */
@media (pointer: coarse) {
  #campaign.active, .modal { backdrop-filter: none; -webkit-backdrop-filter: none; }
  #campaign.active { background: rgba(12, 7, 3, 0.82); }
  .modal { background: rgba(8, 4, 2, 0.74); }
  .btn:hover, .region-tab:hover { transform: none; filter: none; }
  .sp-row .btn { padding: 10px 6px; }
  .stance button { padding: 10px 4px; }
}

/* Portrait phones */
@media (max-width: 600px) and (orientation: portrait) {
  #sel-panel { right: max(8px, env(safe-area-inset-right)); left: max(8px, env(safe-area-inset-left)); width: auto; display: grid; grid-template-columns: 1fr auto; gap: 8px 10px; align-items: center; padding: 10px 12px; }
  #sel-panel.hidden { display: none; }
  #sel-panel .sp-head { margin: 0; }
  #sel-panel .stance { grid-column: 1 / -1; margin: 0; }
  .brief-grid { grid-template-columns: 1fr 1fr; }
  .modal-card { padding: 22px 16px 18px; }
  .modal-card h2 { font-size: 24px; }
  .actions .btn { flex: 1 1 auto; }
  #tooltip { width: min(260px, 86vw); }
  .rm-head p { font-size: 14px; padding: 0 12px; }
}

/* Landscape phones (short screens) */
@media (max-height: 500px) and (orientation: landscape) {
  .hud-top { top: max(6px, env(safe-area-inset-top)); }
  .title-plate { padding: calc(4px + env(safe-area-inset-top)) 16px 6px; min-width: 0; }
  .tp-name { font-size: 15px; }
  .tp-sub { display: none; }
  .icon-btn, .hud-right .icon-btn, .hud-top > .icon-btn { width: 36px; height: 36px; }
  .icon-btn svg { width: 18px; height: 18px; }
  .treasury, .enemy-plate { top: calc(50px + env(safe-area-inset-top)); }
  .treasury { padding: 4px 10px 4px 5px; }
  .coin { width: 28px; height: 28px; }
  .coin::after { font-size: 13px; }
  .t-amount { font-size: 17px; }
  .t-label { font-size: 9px; }
  .enemy-plate { padding: 5px 10px; }
  .ep-units { display: none; }
  .tray-wrap { padding-top: 2px; padding-bottom: calc(6px + env(safe-area-inset-bottom)); gap: 8px; }
  #unit-tray { padding: 12px 2px 2px; gap: 6px; }
  .tray-actions { gap: 6px; padding-bottom: 2px; }
  .tray-actions .btn-battle { font-size: 14px; padding: 10px 14px; }
  .tray-actions .btn-sm { padding: 6px 10px; font-size: 11px; }
  .hint { bottom: calc(130px + env(safe-area-inset-bottom)); font-size: 12.5px; }
  #sel-panel { bottom: calc(132px + env(safe-area-inset-bottom)); width: 220px; padding: 8px 10px; }
  .sp-head { margin-bottom: 6px; }
  .strength { padding: 4px 10px; }
  .clock { font-size: 15px; }
  .speed button { padding: 7px 10px; min-width: 40px; }
  .crest.big { width: 78px; height: 84px; }
  .logo { font-size: 38px; }
  .tagline { margin-top: 4px; letter-spacing: 0.3em; }
  .menu { margin-top: 14px; display: grid; grid-template-columns: 1fr 1fr; width: min(560px, 90vw); gap: 8px; }
  .menu .btn-big { grid-column: 1 / -1; font-size: 16px; padding: 10px; }
  .menu .btn { padding: 8px 12px; font-size: 13px; }
  .menu .btn small { font-size: 11px; }
  .title-wrap { padding-top: max(10px, env(safe-area-inset-top)); padding-bottom: 50px; }
  .ig-link { bottom: max(8px, env(safe-area-inset-bottom)); padding: 5px 12px; font-size: 12px; }
  #campaign .topbar { padding-top: max(6px, env(safe-area-inset-top)); padding-bottom: 6px; }
  .topbar h2 { font-size: 20px; }
  #campaign .campaign-body { grid-template-columns: 190px 1fr; grid-template-rows: 1fr; gap: 10px; padding-bottom: max(8px, env(safe-area-inset-bottom)); }
  #region-list { flex-direction: column; overflow-y: auto; overflow-x: hidden; }
  .region-tab { padding: 6px 8px; gap: 8px; }
  .region-tab .sw { width: 26px; height: 26px; }
  .region-tab .rn { font-size: 13px; }
  .node { width: 50px; height: 50px; font-size: 16px; }
  .node.boss { width: 60px; height: 60px; font-size: 12px; }
  .node .stars svg { width: 14px; height: 14px; }
  .rm-head { top: 6px; }
  .rm-head h3 { font-size: 20px; }
  .rm-head p { display: none; }
  .modal-card { padding: 16px 18px 14px; }
  .modal-card h2 { font-size: 22px; }
  .modal-card h3 { margin: 10px 0 6px; }
  .modal-card p { font-size: 15px; }
  .divider { margin: 8px auto; }
  .brief-grid { grid-template-columns: repeat(4, 1fr); gap: 6px; }
  .stat { padding: 6px 8px; }
  .stat .v { font-size: 16px; }
  .actions { margin-top: 12px; }
  .bigstars { margin: 6px 0 2px; }
  .bigstars svg { width: 44px; height: 44px; }
  .bigstars svg:nth-child(2) { width: 56px; height: 56px; margin-top: -8px; }
  .result-title .rt { font-size: 40px; }
  .film-opt .ratio { height: 40px; }
  .film-opt { padding: 8px; }
  .film-preview { max-height: 46dvh; }
  .rotate-tip { display: none; }
}

/* ════════════════════════════════════════════════════════
   Troop cards
   ════════════════════════════════════════════════════════ */
@property --spin { syntax: '<angle>'; inherits: false; initial-value: 0deg; }

#unit-tray { perspective: 900px; padding-top: 24px; gap: 10px; }
.ucard {
  --rx: 0deg; --ry: 0deg; --mx: 50%; --lift: 0px; --scale: 1;
  position: relative; flex: none; width: 100px; height: 142px; padding: 0; border-radius: 12px; color: inherit;
  transform-style: preserve-3d;
  transform: translateY(var(--lift)) scale(var(--scale)) rotateX(var(--rx)) rotateY(var(--ry));
  transition: transform 0.5s cubic-bezier(0.2, 0.9, 0.25, 1.2), filter 0.35s ease, opacity 0.3s ease;
  will-change: transform;
  outline: none;
}
.ucard:focus-visible .uc-card { border-color: #f8dc92; }
.uc-card {
  position: absolute; inset: 0; border-radius: 12px; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: space-between; padding: 8px 7px 8px;
  background:
    radial-gradient(130% 55% at 50% -6%, color-mix(in srgb, var(--role) 55%, transparent), transparent 72%),
    linear-gradient(180deg, #3d2817 0%, #24160d 55%, #170d07 100%);
  border: 1px solid #8a6a2c;
  box-shadow: inset 0 1px 0 rgba(255, 228, 170, 0.28), inset 0 0 0 1px rgba(0, 0, 0, 0.55), inset 0 -18px 24px rgba(0, 0, 0, 0.35),
    0 10px 18px -6px rgba(0, 0, 0, 0.75), 0 2px 0 #120a04;
  transition: box-shadow 0.4s ease, border-color 0.4s ease;
}
.uc-card::before { /* role stripe */
  content: ''; position: absolute; left: 12px; right: 12px; top: 0; height: 3px; border-radius: 0 0 3px 3px;
  background: linear-gradient(90deg, transparent, var(--role), transparent);
  box-shadow: 0 0 12px var(--role);
}
.uc-card::after { /* fine inner gold frame */
  content: ''; position: absolute; inset: 3px; border-radius: 9px; border: 1px solid rgba(227, 185, 95, 0.16); pointer-events: none;
}
.uc-head { width: 100%; display: flex; justify-content: space-between; align-items: center; padding: 0 2px; font-family: var(--caps); font-weight: 700; text-transform: uppercase; }
.uc-role { font-size: 8px; letter-spacing: 0.14em; color: color-mix(in srgb, var(--role) 70%, #fff); }
.uc-men { font-size: 10px; letter-spacing: 0.02em; color: #cdb68a; }
.uc-crest {
  position: relative; width: 50px; height: 56px; display: grid; place-items: center;
  border-radius: 9px 9px 50% 50% / 9px 9px 62% 62%;
  background: radial-gradient(circle at 35% 22%, color-mix(in srgb, var(--role) 45%, #fff) 0%, var(--role) 45%, color-mix(in srgb, var(--role) 50%, #000) 100%);
  box-shadow: inset 0 0 0 2px rgba(255, 236, 190, 0.5), inset 0 -9px 12px rgba(0, 0, 0, 0.35), 0 0 0 2px #2a1a0c, 0 0 0 3px #b98d3a, 0 7px 12px rgba(0, 0, 0, 0.6);
  transition: transform 0.5s cubic-bezier(0.2, 0.9, 0.25, 1.35), box-shadow 0.4s ease;
}
.uc-crest .uicon { width: 30px; height: 30px; fill: #21150a; margin-top: -4px; filter: drop-shadow(0 1px 0 rgba(255, 240, 200, 0.55)); }
.uc-name {
  min-height: 24px; display: grid; place-items: center; text-align: center;
  font-family: var(--caps); font-weight: 700; font-size: 10.5px; line-height: 1.12; letter-spacing: 0.02em; color: #f3e6c4; text-shadow: 0 1px 2px #000;
}
.uc-cost {
  display: flex; align-items: center; gap: 5px; padding: 3px 10px 3px 4px; border-radius: 20px;
  background: linear-gradient(180deg, #120a05, #2a1a0d); border: 1px solid #8a6a2c; box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.7);
  transition: border-color 0.3s ease;
}
.uc-cost i { width: 15px; height: 15px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff3bf, #e0a93a 55%, #8a5a14); border: 1px solid #5a3a10; box-shadow: 0 0 6px rgba(255, 200, 80, 0.45); }
.uc-cost b { font-family: var(--caps); font-weight: 900; font-size: 14px; color: #f8dc92; transition: color 0.3s ease; }
.uc-glow { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity 0.4s ease; background: radial-gradient(65% 45% at var(--mx) 34%, rgba(255, 230, 160, 0.22), transparent 70%); }
.uc-shine { position: absolute; top: -25%; bottom: -25%; left: -70%; width: 45%; pointer-events: none; transform: skewX(-18deg); background: linear-gradient(100deg, transparent, rgba(255, 245, 210, 0.32), transparent); }

/* hover (mouse only) */
@media (hover: hover) and (pointer: fine) {
  .ucard:not(.locked):hover { --lift: -12px; }
  .ucard:not(.locked):hover .uc-card {
    border-color: #e3b95f;
    box-shadow: inset 0 1px 0 rgba(255, 228, 170, 0.35), inset 0 0 0 1px rgba(0, 0, 0, 0.55), inset 0 -18px 24px rgba(0, 0, 0, 0.3),
      0 20px 30px -8px rgba(0, 0, 0, 0.85), 0 0 20px color-mix(in srgb, var(--role) 45%, transparent);
  }
  .ucard:not(.locked):hover .uc-glow { opacity: 1; }
  .ucard:not(.locked):hover .uc-crest { transform: translateZ(20px) scale(1.08); }
  .ucard:not(.locked):hover .uc-shine { animation: cardShine 0.9s ease; }
}
@keyframes cardShine { to { left: 135%; } }
.ucard:not(.locked):active { --scale: 0.95; transition-duration: 0.12s; }

/* selected: lifted, glowing, with a rotating gold rim */
.ucard.sel { --lift: -16px; }
.ucard.sel::before {
  content: ''; position: absolute; inset: -2px; border-radius: 14px; z-index: -1;
  background: conic-gradient(from var(--spin), #f8dc92, #8a5a14, #fff3c4, #a8741f, #f8dc92);
  animation: rimSpin 2.4s linear infinite;
}
@keyframes rimSpin { to { --spin: 360deg; } }
.ucard.sel .uc-card { border-color: transparent; box-shadow: 0 0 0 1px #2a1708, 0 0 28px rgba(255, 205, 100, 0.6), 0 20px 30px -8px rgba(0, 0, 0, 0.85); }
.ucard.sel .uc-glow { opacity: 1; }
.ucard.sel .uc-crest {
  transform: translateZ(20px) scale(1.1);
  box-shadow: inset 0 0 0 2px rgba(255, 236, 190, 0.7), inset 0 -9px 12px rgba(0, 0, 0, 0.3), 0 0 0 2px #2a1a0c, 0 0 0 3px #f8dc92, 0 0 18px rgba(255, 210, 110, 0.75);
}

/* can't afford */
.ucard.poor:not(.locked) { filter: saturate(0.3) brightness(0.72); }
.ucard.poor .uc-cost { border-color: #8a2a20; }
.ucard.poor .uc-cost b { color: #ff9c8a; }

/* locked */
.ucard.locked { cursor: not-allowed; }
.ucard.locked .uc-card { filter: grayscale(1) brightness(0.42); }
.ucard .lk {
  position: absolute; inset: 0; border-radius: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  font-family: var(--caps); font-weight: 700; font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: #f3e6c4;
  background: radial-gradient(circle at 50% 42%, rgba(20, 12, 6, 0.15), rgba(20, 12, 6, 0.7));
}
.ucard .lk svg { width: 24px; height: 24px; color: #e3b95f; filter: drop-shadow(0 2px 3px #000); }

/* regiment count badge */
.ucard .qty {
  position: absolute; top: -9px; right: -7px; z-index: 2; min-width: 24px; height: 24px; padding: 0 6px; border-radius: 12px; display: grid; place-items: center;
  background: radial-gradient(circle at 35% 30%, #74a2f2, #2f64c4 60%, #1d3a78); color: #fff;
  font-family: var(--caps); font-weight: 900; font-size: 12.5px; border: 2px solid #f0d08a; box-shadow: 0 3px 8px rgba(0, 0, 0, 0.55);
  transform: translateZ(30px);
}
.ucard .qty[hidden] { display: none; }
.ucard .qty.pop { animation: qtyPop 0.55s cubic-bezier(0.2, 1.7, 0.4, 1); }
@keyframes qtyPop { from { transform: translateZ(30px) scale(0.3); } to { transform: translateZ(30px) scale(1); } }
.ucard.pop .uc-card { animation: cardPulse 0.6s ease-out; }
@keyframes cardPulse { from { box-shadow: 0 0 0 0 rgba(255, 215, 120, 0.95), 0 10px 18px -6px rgba(0, 0, 0, 0.75); } to { box-shadow: 0 0 0 16px rgba(255, 215, 120, 0), 0 10px 18px -6px rgba(0, 0, 0, 0.75); } }

.ucard.dragging { --lift: -18px; --scale: 0.92; opacity: 0.55; }

/* staggered entrance when the tray opens */
#unit-tray.enter .ucard { animation: cardIn 0.65s cubic-bezier(0.2, 0.9, 0.25, 1.15) backwards; animation-delay: calc(var(--i) * 42ms + 120ms); }
@keyframes cardIn { from { opacity: 0; transform: translateY(46px) scale(0.85) rotateX(24deg); } }

/* tray backdrop */
.tray-wrap { background: linear-gradient(0deg, rgba(12, 7, 3, 0.96) 0%, rgba(12, 7, 3, 0.84) 60%, rgba(12, 7, 3, 0) 100%); }

/* war chest feedback */
.treasury.bump .t-amount { animation: goldFlash 0.6s ease; }
.treasury.gain .t-amount { animation-name: goldGain; }
@keyframes goldFlash { 25% { color: #fff6d8; text-shadow: 0 0 14px rgba(255, 210, 110, 0.95); } }
@keyframes goldGain { 25% { color: #c8ffb0; text-shadow: 0 0 14px rgba(140, 255, 120, 0.8); } }

/* tooltip: fade & rise instead of popping */
#tooltip {
  display: block; visibility: hidden; opacity: 0; transform: translateY(8px) scale(0.97); transform-origin: 50% 100%;
  transition: opacity 0.18s ease, transform 0.28s cubic-bezier(0.2, 0.9, 0.3, 1.2), visibility 0s linear 0.28s;
}
#tooltip.show { visibility: visible; opacity: 1; transform: none; transition: opacity 0.18s ease, transform 0.28s cubic-bezier(0.2, 0.9, 0.3, 1.2), visibility 0s; }

/* smaller screens */
@media (max-width: 820px) {
  #unit-tray { gap: 8px; padding-top: 20px; }
  .ucard { width: 84px; height: 122px; }
  .uc-card { padding: 7px 5px 7px; }
  .uc-crest { width: 42px; height: 47px; }
  .uc-crest .uicon { width: 25px; height: 25px; }
  .uc-role { font-size: 7px; letter-spacing: 0.1em; }
  .uc-men { font-size: 9px; }
  .uc-name { font-size: 9.5px; min-height: 22px; }
  .uc-cost { padding: 2px 8px 2px 3px; }
  .uc-cost b { font-size: 12.5px; }
  .uc-cost i { width: 13px; height: 13px; }
}
@media (max-height: 500px) and (orientation: landscape) {
  #unit-tray { padding-top: 16px; gap: 7px; }
  .ucard { width: 70px; height: 100px; }
  .uc-card { padding: 6px 4px 5px; }
  .uc-role { display: none; }
  .uc-head { justify-content: flex-end; }
  .uc-crest { width: 34px; height: 38px; }
  .uc-crest .uicon { width: 20px; height: 20px; margin-top: -3px; }
  .uc-name { font-size: 8.5px; min-height: 18px; }
  .uc-cost { padding: 1px 7px 1px 3px; gap: 4px; }
  .uc-cost b { font-size: 11px; }
  .uc-cost i { width: 11px; height: 11px; }
  .ucard .qty { min-width: 20px; height: 20px; font-size: 11px; top: -7px; }
  .ucard.sel { --lift: -10px; }
}
@media (pointer: coarse) {
  .ucard.sel { --lift: -10px; }
}
@media (prefers-reduced-motion: reduce) {
  .ucard, .uc-crest, #tooltip { transition: none; }
  #unit-tray.enter .ucard, .ucard.sel::before, .uc-shine, .ucard.pop .uc-card, .ucard .qty.pop { animation: none !important; }
}

/* ════════════════════════════════════════════════════════
   Instagram follow gate
   ════════════════════════════════════════════════════════ */
#gate.active {
  display: grid; place-items: center; z-index: 20; overflow-y: auto;
  padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
  background: radial-gradient(ellipse at center, rgba(15, 8, 3, 0.3), rgba(15, 8, 3, 0.85));
}
.gate-card { width: min(540px, 100%); border-radius: 8px; padding: 26px 26px 18px; text-align: center; animation: pop 0.55s cubic-bezier(0.2, 0.9, 0.3, 1.2) both; touch-action: pan-y; }
.gate-card .crest { width: 74px; height: 80px; margin: -4px auto 4px; }
.gate-card h2 { font-family: var(--deco); font-weight: 900; font-size: clamp(26px, 6vw, 36px); color: #4a2a0c; text-shadow: 0 1px 0 rgba(255, 245, 210, 0.7); }
.gate-card .sub { font-style: italic; color: #6b4a22; font-size: 16px; margin-top: 4px; }
.gate-card .sub b { font-style: normal; font-family: var(--caps); color: #4a2a0c; }
.gate-steps { list-style: none; margin: 18px 0 10px; display: grid; gap: 10px; text-align: left; }
.g-step {
  display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 12px; padding: 12px; border-radius: 8px;
  background: rgba(90, 55, 15, 0.07); border: 1px solid rgba(90, 55, 15, 0.22); opacity: 0.62;
  transition: background 0.35s ease, border-color 0.35s ease, opacity 0.35s ease, transform 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.3), box-shadow 0.35s ease;
}
.g-step.active { opacity: 1; background: rgba(255, 220, 130, 0.3); border-color: #c48f36; box-shadow: 0 0 0 2px rgba(227, 185, 95, 0.35); transform: scale(1.015); }
.g-step.done { opacity: 0.9; }
.g-step.warn { background: rgba(200, 60, 40, 0.14); border-color: #a83a2a; box-shadow: 0 0 0 2px rgba(200, 60, 40, 0.25); }
.g-num {
  position: relative; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  font-family: var(--caps); font-weight: 900; color: #fff3d0;
  background: radial-gradient(circle at 35% 30%, #d9483a, #8c1d16 70%); border: 2px solid #f0c968; box-shadow: 0 0 0 2px #3a1508;
  transition: background 0.35s ease;
}
.g-step.done .g-num { color: transparent; background: radial-gradient(circle at 35% 30%, #6cc25a, #2d6a22 70%); }
.g-step.done .g-num::after { content: '✓'; position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-family: sans-serif; font-weight: 900; }
.g-body b { display: block; font-family: var(--caps); font-size: 14px; color: #3a1f06; }
.g-body small { display: block; font-size: 13.5px; color: #6b4a22; font-style: italic; line-height: 1.35; }
.g-code code {
  display: inline-block; margin-top: 6px; padding: 4px 12px; border-radius: 6px; cursor: pointer;
  font-family: var(--caps); font-weight: 900; font-size: 24px; letter-spacing: 0.12em; color: #4a2a0c;
  background: rgba(255, 250, 230, 0.65); border: 1px dashed #8a6a2c; user-select: all; -webkit-user-select: all;
}
.g-code code.flash { animation: codeFlash 0.8s ease; }
@keyframes codeFlash { 30% { background: #fff2c0; box-shadow: 0 0 0 4px rgba(227, 185, 95, 0.5); } }
.g-step .btn { white-space: nowrap; }
.g-spinner { width: 24px; height: 24px; border-radius: 50%; border: 3px solid rgba(138, 106, 44, 0.25); border-top-color: #a8741f; animation: gSpin 0.9s linear infinite; transition: opacity 0.3s; }
.g-step:not(.active) .g-spinner { opacity: 0; }
@keyframes gSpin { to { transform: rotate(360deg); } }
.g-skip { margin-top: 4px; font-size: 12px; color: #8a6a2c; text-decoration: underline; }
@media (max-width: 480px) {
  .gate-card { padding: 22px 16px 16px; }
  .g-step { grid-template-columns: 30px 1fr; gap: 10px; }
  .g-step > .btn, .g-step > .g-spinner { grid-column: 1 / -1; }
  .g-step > .btn { justify-self: stretch; }
  .g-step > .g-spinner { justify-self: center; }
  .g-num { width: 30px; height: 30px; }
}
@media (max-height: 500px) and (orientation: landscape) {
  .gate-card { padding: 14px 18px 10px; width: min(640px, 100%); }
  .gate-card .crest { display: none; }
  .gate-card h2 { font-size: 22px; }
  .gate-card .sub { font-size: 14px; }
  .gate-steps { margin: 10px 0 6px; gap: 6px; }
  .g-step { padding: 7px 10px; }
  .g-code code { font-size: 18px; }
}

a.btn { text-decoration: none; }

/* guest option */
.g-or { display: flex; align-items: center; gap: 12px; margin: 6px 0 10px; color: #8a6a2c; font-family: var(--caps); font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; }
.g-or::before, .g-or::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, rgba(138, 106, 44, 0.6), transparent); }
.g-guest { width: 100%; margin-bottom: 10px; }
.g-guest[hidden], .join-btn[hidden] { display: none; }
.join-btn { position: absolute; top: max(16px, env(safe-area-inset-top)); left: max(16px, env(safe-area-inset-left)); }
@media (max-height: 500px) and (orientation: landscape) { .g-or { margin: 2px 0 6px; } .g-guest { margin-bottom: 6px; padding: 8px; } }

/* ════════════════════════════════════════════════════════
   Parchment windows (generated by the paper builder)
   ════════════════════════════════════════════════════════ */
:root {
  --paper-fibers: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%27320%27%20height%3D%27320%27%3E%3Cfilter%20id%3D%27f%27%3E%3CfeTurbulence%20type%3D%27fractalNoise%27%20baseFrequency%3D%270.006%200.32%27%20numOctaves%3D%273%27%20seed%3D%2711%27%20stitchTiles%3D%27stitch%27%2F%3E%3CfeColorMatrix%20values%3D%270%200%200%200%20.45%200%200%200%200%20.3%200%200%200%200%20.12%200%200%200%20.14%20-.03%27%2F%3E%3C%2Ffilter%3E%3Crect%20width%3D%27100%25%27%20height%3D%27100%25%27%20filter%3D%27url(%23f)%27%2F%3E%3C%2Fsvg%3E");
  --paper-grain: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%27200%27%20height%3D%27200%27%3E%3Cfilter%20id%3D%27g%27%3E%3CfeTurbulence%20type%3D%27fractalNoise%27%20baseFrequency%3D%27.9%27%20numOctaves%3D%273%27%20seed%3D%274%27%20stitchTiles%3D%27stitch%27%2F%3E%3CfeColorMatrix%20values%3D%270%200%200%200%20.35%200%200%200%200%20.24%200%200%200%200%20.1%200%200%200%20.16%200%27%2F%3E%3C%2Ffilter%3E%3Crect%20width%3D%27100%25%27%20height%3D%27100%25%27%20filter%3D%27url(%23g)%27%2F%3E%3C%2Fsvg%3E");
  --paper-mottle: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%27480%27%20height%3D%27480%27%3E%3Cfilter%20id%3D%27m%27%3E%3CfeTurbulence%20type%3D%27fractalNoise%27%20baseFrequency%3D%27.012%27%20numOctaves%3D%274%27%20seed%3D%2723%27%20stitchTiles%3D%27stitch%27%2F%3E%3CfeColorMatrix%20values%3D%270%200%200%200%20.6%200%200%200%200%20.42%200%200%200%200%20.18%200%200%200%20.28%20-.11%27%2F%3E%3C%2Ffilter%3E%3Crect%20width%3D%27100%25%27%20height%3D%27100%25%27%20filter%3D%27url(%23m)%27%2F%3E%3C%2Fsvg%3E");
  --torn-t: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%27240%27%20height%3D%2716%27%20viewBox%3D%270%200%20240%2016%27%20preserveAspectRatio%3D%27none%27%3E%3Cpath%20d%3D%27M0%2016%20L0%203.3%20L7.1%202.1%20L14.1%203.4%20L21.2%202.4%20L28.2%203.8%20L35.3%204.8%20L42.4%206.6%20L49.4%205.9%20L56.5%2010.5%20L63.5%2010%20L70.6%2010%20L77.6%207.9%20L84.7%2010%20L91.8%2010%20L98.8%2010%20L105.9%209.3%20L112.9%2010%20L120%208.1%20L127.1%207.7%20L134.1%2010%20L141.2%2010%20L148.2%207.6%20L155.3%207.9%20L162.4%207.5%20L169.4%2011%20L176.5%2010%20L183.5%2010%20L190.6%2010%20L197.6%209.5%20L204.7%208.7%20L211.8%207.8%20L218.8%208.4%20L225.9%2010%20L232.9%2010%20L240%203.3%20L240%2016Z%27%20fill%3D%27black%27%2F%3E%3C%2Fsvg%3E");
  --torn-b: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%27240%27%20height%3D%2716%27%20viewBox%3D%270%200%20240%2016%27%20preserveAspectRatio%3D%27none%27%3E%3Cpath%20d%3D%27M0%200%20L0%2010%20L7.1%207.6%20L14.1%206.4%20L21.2%206%20L28.2%206.9%20L35.3%206%20L42.4%208.1%20L49.4%2010.5%20L56.5%208.9%20L63.5%206.1%20L70.6%206%20L77.6%206.199999999999999%20L84.7%208.2%20L91.8%206.1%20L98.8%206%20L105.9%206%20L112.9%208.7%20L120%207.5%20L127.1%206.9%20L134.1%206%20L141.2%206%20L148.2%206%20L155.3%206.699999999999999%20L162.4%208.8%20L169.4%2011.5%20L176.5%2010.8%20L183.5%2013.4%20L190.6%2014.5%20L197.6%2014.1%20L204.7%2014.5%20L211.8%2014.5%20L218.8%2014.5%20L225.9%2013.4%20L232.9%209.9%20L240%2010%20L240%200Z%27%20fill%3D%27black%27%2F%3E%3C%2Fsvg%3E");
  --torn-l: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%2716%27%20height%3D%27240%27%20viewBox%3D%270%200%2016%20240%27%20preserveAspectRatio%3D%27none%27%3E%3Cpath%20d%3D%27M16%200%20L4%200%20L9.6%207.1%20L10%2014.1%20L10%2021.2%20L10%2028.2%20L8.6%2035.3%20L10%2042.4%20L8.5%2049.4%20L10%2056.5%20L9.2%2063.5%20L10%2070.6%20L10%2077.6%20L8.3%2084.7%20L10%2091.8%20L10%2098.8%20L10%20105.9%20L10%20112.9%20L10%20120%20L10%20127.1%20L9.9%20134.1%20L9.6%20141.2%20L10%20148.2%20L10%20155.3%20L10%20162.4%20L11%20169.4%20L9.9%20176.5%20L8.3%20183.5%20L7.1%20190.6%20L8%20197.6%20L5.7%20204.7%20L7.4%20211.8%20L9.7%20218.8%20L11%20225.9%20L10%20232.9%20L4%20240%20L16%20240Z%27%20fill%3D%27black%27%2F%3E%3C%2Fsvg%3E");
  --torn-r: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%2716%27%20height%3D%27240%27%20viewBox%3D%270%200%2016%20240%27%20preserveAspectRatio%3D%27none%27%3E%3Cpath%20d%3D%27M0%200%20L12.5%200%20L11%207.1%20L9.8%2014.1%20L9.2%2021.2%20L10.9%2028.2%20L12.5%2035.3%20L13.9%2042.4%20L11.2%2049.4%20L10.3%2056.5%20L10.8%2063.5%20L13.3%2070.6%20L11.6%2077.6%20L13.5%2084.7%20L13.4%2091.8%20L14.5%2098.8%20L11%20105.9%20L12.3%20112.9%20L11.9%20120%20L5.699999999999999%20127.1%20L6.199999999999999%20134.1%20L5.4%20141.2%20L5%20148.2%20L6.5%20155.3%20L6%20162.4%20L6.300000000000001%20169.4%20L6%20176.5%20L6%20183.5%20L6.800000000000001%20190.6%20L6.9%20197.6%20L6.5%20204.7%20L6%20211.8%20L6%20218.8%20L6%20225.9%20L6.300000000000001%20232.9%20L12.5%20240%20L0%20240Z%27%20fill%3D%27black%27%2F%3E%3C%2Fsvg%3E");
  --corner-tl: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%2734%27%20height%3D%2734%27%20viewBox%3D%270%200%2034%2034%27%3E%3Cg%20transform%3D%27rotate(0%2017%2017)%27%20fill%3D%27none%27%20stroke%3D%27%236b4a1c%27%20stroke-width%3D%271.3%27%20stroke-linecap%3D%27round%27%3E%3Cpath%20d%3D%27M4%2030%20V10%20Q4%204%2010%204%20H30%27%2F%3E%3Cpath%20d%3D%27M8%2030%20V13%20Q8%208%2013%208%20H30%27%20opacity%3D%27.55%27%2F%3E%3Cpath%20d%3D%27M13%2013%20q4%20-1%205%203%20q-4%201%20-5%20-3z%27%20fill%3D%27%236b4a1c%27%20stroke%3D%27none%27%2F%3E%3Ccircle%20cx%3D%274%27%20cy%3D%2730%27%20r%3D%271.6%27%20fill%3D%27%236b4a1c%27%20stroke%3D%27none%27%2F%3E%3Ccircle%20cx%3D%2730%27%20cy%3D%274%27%20r%3D%271.6%27%20fill%3D%27%236b4a1c%27%20stroke%3D%27none%27%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E");
  --corner-tr: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%2734%27%20height%3D%2734%27%20viewBox%3D%270%200%2034%2034%27%3E%3Cg%20transform%3D%27rotate(90%2017%2017)%27%20fill%3D%27none%27%20stroke%3D%27%236b4a1c%27%20stroke-width%3D%271.3%27%20stroke-linecap%3D%27round%27%3E%3Cpath%20d%3D%27M4%2030%20V10%20Q4%204%2010%204%20H30%27%2F%3E%3Cpath%20d%3D%27M8%2030%20V13%20Q8%208%2013%208%20H30%27%20opacity%3D%27.55%27%2F%3E%3Cpath%20d%3D%27M13%2013%20q4%20-1%205%203%20q-4%201%20-5%20-3z%27%20fill%3D%27%236b4a1c%27%20stroke%3D%27none%27%2F%3E%3Ccircle%20cx%3D%274%27%20cy%3D%2730%27%20r%3D%271.6%27%20fill%3D%27%236b4a1c%27%20stroke%3D%27none%27%2F%3E%3Ccircle%20cx%3D%2730%27%20cy%3D%274%27%20r%3D%271.6%27%20fill%3D%27%236b4a1c%27%20stroke%3D%27none%27%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E");
  --corner-br: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%2734%27%20height%3D%2734%27%20viewBox%3D%270%200%2034%2034%27%3E%3Cg%20transform%3D%27rotate(180%2017%2017)%27%20fill%3D%27none%27%20stroke%3D%27%236b4a1c%27%20stroke-width%3D%271.3%27%20stroke-linecap%3D%27round%27%3E%3Cpath%20d%3D%27M4%2030%20V10%20Q4%204%2010%204%20H30%27%2F%3E%3Cpath%20d%3D%27M8%2030%20V13%20Q8%208%2013%208%20H30%27%20opacity%3D%27.55%27%2F%3E%3Cpath%20d%3D%27M13%2013%20q4%20-1%205%203%20q-4%201%20-5%20-3z%27%20fill%3D%27%236b4a1c%27%20stroke%3D%27none%27%2F%3E%3Ccircle%20cx%3D%274%27%20cy%3D%2730%27%20r%3D%271.6%27%20fill%3D%27%236b4a1c%27%20stroke%3D%27none%27%2F%3E%3Ccircle%20cx%3D%2730%27%20cy%3D%274%27%20r%3D%271.6%27%20fill%3D%27%236b4a1c%27%20stroke%3D%27none%27%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E");
  --corner-bl: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%2734%27%20height%3D%2734%27%20viewBox%3D%270%200%2034%2034%27%3E%3Cg%20transform%3D%27rotate(270%2017%2017)%27%20fill%3D%27none%27%20stroke%3D%27%236b4a1c%27%20stroke-width%3D%271.3%27%20stroke-linecap%3D%27round%27%3E%3Cpath%20d%3D%27M4%2030%20V10%20Q4%204%2010%204%20H30%27%2F%3E%3Cpath%20d%3D%27M8%2030%20V13%20Q8%208%2013%208%20H30%27%20opacity%3D%27.55%27%2F%3E%3Cpath%20d%3D%27M13%2013%20q4%20-1%205%203%20q-4%201%20-5%20-3z%27%20fill%3D%27%236b4a1c%27%20stroke%3D%27none%27%2F%3E%3Ccircle%20cx%3D%274%27%20cy%3D%2730%27%20r%3D%271.6%27%20fill%3D%27%236b4a1c%27%20stroke%3D%27none%27%2F%3E%3Ccircle%20cx%3D%2730%27%20cy%3D%274%27%20r%3D%271.6%27%20fill%3D%27%236b4a1c%27%20stroke%3D%27none%27%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E");
  --ink-line: rgba(107, 74, 28, 0.42);
}

/* aged paper surface */
.parchment, .paper {
  color: var(--ink);
  background-color: #efdfba;
  background-image:
    radial-gradient(ellipse at 20% 10%, rgba(255, 250, 230, 0.7), transparent 45%),
    radial-gradient(circle at 84% 18%, rgba(140, 88, 30, 0.13) 0 5%, rgba(140, 88, 30, 0.05) 9%, transparent 15%),
    radial-gradient(circle at 10% 82%, rgba(140, 88, 30, 0.12) 0 7%, rgba(140, 88, 30, 0.04) 12%, transparent 19%),
    radial-gradient(ellipse at 72% 94%, rgba(120, 72, 22, 0.12), transparent 42%),
    radial-gradient(ellipse at center, transparent 58%, rgba(110, 66, 20, 0.28) 100%),
    var(--paper-mottle), var(--paper-fibers), var(--paper-grain),
    linear-gradient(170deg, #f5e9c9, #eddcb2 55%, #e6d2a2);
  background-size: auto, auto, auto, auto, auto, 480px 480px, 320px 320px, 200px 200px, auto;
  box-shadow: inset 0 0 20px rgba(110, 66, 20, 0.38), inset 0 0 60px rgba(150, 95, 35, 0.14);
}

/* torn, deckled edges + soft shadow (shadow lives on the wrapper because masks clip shadows) */
.paper-edge {
  --e: 16px;
  border-radius: 0;
  -webkit-mask-image: var(--torn-t), var(--torn-b), var(--torn-l), var(--torn-r), linear-gradient(#000, #000);
  -webkit-mask-repeat: repeat-x, repeat-x, repeat-y, repeat-y, no-repeat;
  -webkit-mask-position: left top, left bottom, left top, right top, center;
  -webkit-mask-size: 240px var(--e), 240px var(--e), var(--e) 240px, var(--e) 240px, calc(100% - 2 * var(--e) + 4px) calc(100% - 2 * var(--e) + 4px);
  mask-image: var(--torn-t), var(--torn-b), var(--torn-l), var(--torn-r), linear-gradient(#000, #000);
  mask-repeat: repeat-x, repeat-x, repeat-y, repeat-y, no-repeat;
  mask-position: left top, left bottom, left top, right top, center;
  mask-size: 240px var(--e), 240px var(--e), var(--e) 240px, var(--e) 240px, calc(100% - 2 * var(--e) + 4px) calc(100% - 2 * var(--e) + 4px);
}
/* manuscript frame: double ink rule + corner flourishes, drawn as fixed background layers so it stays put while scrolling */
.paper-edge.parchment {
  background-image:
    var(--corner-tl), var(--corner-tr), var(--corner-br), var(--corner-bl),
    linear-gradient(var(--ink-line), var(--ink-line)), linear-gradient(var(--ink-line), var(--ink-line)),
    linear-gradient(var(--ink-line), var(--ink-line)), linear-gradient(var(--ink-line), var(--ink-line)),
    linear-gradient(var(--ink-line), var(--ink-line)), linear-gradient(var(--ink-line), var(--ink-line)),
    linear-gradient(var(--ink-line), var(--ink-line)), linear-gradient(var(--ink-line), var(--ink-line)),
    radial-gradient(ellipse at 20% 10%, rgba(255, 250, 230, 0.7), transparent 45%),
    radial-gradient(circle at 84% 18%, rgba(140, 88, 30, 0.13) 0 5%, rgba(140, 88, 30, 0.05) 9%, transparent 15%),
    radial-gradient(circle at 10% 82%, rgba(140, 88, 30, 0.12) 0 7%, rgba(140, 88, 30, 0.04) 12%, transparent 19%),
    radial-gradient(ellipse at 72% 94%, rgba(120, 72, 22, 0.12), transparent 42%),
    radial-gradient(ellipse at center, transparent 58%, rgba(110, 66, 20, 0.3) 100%),
    var(--paper-mottle), var(--paper-fibers), var(--paper-grain),
    linear-gradient(170deg, #f5e9c9, #eddcb2 55%, #e6d2a2);
  background-repeat:
    no-repeat, no-repeat, no-repeat, no-repeat,
    no-repeat, no-repeat, no-repeat, no-repeat, no-repeat, no-repeat, no-repeat, no-repeat,
    no-repeat, no-repeat, no-repeat, no-repeat, no-repeat, repeat, repeat, repeat, no-repeat;
  background-position:
    left 20px top 20px, right 20px top 20px, right 20px bottom 20px, left 20px bottom 20px,
    left 28px top 24px, left 28px bottom 24px, left 24px top 28px, right 24px top 28px,
    left 32px top 28px, left 32px bottom 28px, left 28px top 32px, right 28px top 32px,
    0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0;
  background-size:
    34px 34px, 34px 34px, 34px 34px, 34px 34px,
    calc(100% - 56px) 1px, calc(100% - 56px) 1px, 1px calc(100% - 56px), 1px calc(100% - 56px),
    calc(100% - 64px) 1px, calc(100% - 64px) 1px, 1px calc(100% - 64px), 1px calc(100% - 64px),
    auto, auto, auto, auto, auto, 480px 480px, 320px 320px, 200px 200px, auto;
}
.paper-drop { display: grid; width: min(620px, 100%); max-height: 100%; filter: drop-shadow(0 18px 26px rgba(0, 0, 0, 0.6)) drop-shadow(0 3px 3px rgba(0, 0, 0, 0.45)); }
.paper-drop:has(.wide) { width: min(860px, 100%); }
.paper-drop > .modal-card { width: 100%; }
.modal-card.paper-edge { padding: 40px 42px 34px; border-radius: 0; }
.gate-drop { width: min(560px, 100%); }
.gate-card.paper-edge { width: 100%; padding: 36px 34px 26px; border-radius: 0; }
.modal-card .x { top: 34px; right: 40px; z-index: 2; }

/* small parchment panels: tooltip & selected regiment */
#tooltip.paper, #sel-panel.paper { border: 1px solid rgba(107, 74, 28, 0.6); border-radius: 4px; box-shadow: inset 0 0 18px rgba(92, 52, 14, 0.55), 0 12px 26px rgba(0, 0, 0, 0.55); }
#sel-panel.paper::before, #sel-panel.paper::after { display: none; }
#tooltip.paper h4 { color: #4a2a0c; }
#tooltip.paper p { color: #3a2512; }
#tooltip.paper .bars { color: #6b4a22; }
#tooltip.paper .bars i { background: rgba(90, 55, 15, 0.2); box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.2); }
#tooltip.paper .bars i b { background: linear-gradient(90deg, #8a5a14, #c99336); }
#tooltip.paper .gb { color: #2d6a22; }
#tooltip.paper .gb.b { color: #9a2a1a; }
#sel-panel.paper .sp-head b { color: #4a2a0c; text-shadow: none; }
#sel-panel.paper .sp-head small { color: #6b4a22; }
#sel-panel.paper .stance { border-color: rgba(107, 74, 28, 0.6); background: rgba(90, 55, 15, 0.08); }
#sel-panel.paper .stance button { color: #6b4a22; }
#sel-panel.paper .stance button.on { color: #2a1708; }

@media (max-width: 600px) {
  .modal-card.paper-edge { padding: 34px 22px 26px; }
  .gate-card.paper-edge { padding: 32px 20px 22px; }
  .paper-edge { --e: 12px; }
}
@media (max-height: 500px) and (orientation: landscape) {
  .modal-card.paper-edge { padding: 26px 30px 20px; }
  .gate-card.paper-edge { padding: 22px 26px 14px; }
}

.gate-card.paper-edge { padding-bottom: 42px; }
.parchment a:not(.btn) { color: #7a2a18; }
@media (max-height: 500px) and (orientation: landscape) { .gate-card.paper-edge { padding-bottom: 32px; } }

/* ════════════════════════════════════════════════════════
   Ink & stamps: everything on parchment looks printed onto it
   ════════════════════════════════════════════════════════ */
:is(.parchment, .paper) { --ink-dark: #3b1f08; --ink-mid: rgba(59, 31, 8, 0.72); --ink-soft: rgba(90, 55, 15, 0.38); --ink-wash: rgba(120, 75, 25, 0.1); }

/* text soaks into the paper: multiply lets the grain show through, a faint bleed softens the edges */
:is(.parchment, .paper) :is(h2, h3, h4, p, li, b, small, label, .sub, .note, .k, .v, .rt, .uc-name, .g-body, .sp-head, .bars, .gb, .toggle-row > span, .result-title) {
  mix-blend-mode: multiply;
}
:is(.parchment, .paper) h2 { color: var(--ink-dark); text-shadow: 0 0 1px rgba(59, 31, 8, 0.35); }
:is(.parchment, .paper) h3 { color: #5a3008; text-shadow: 0 0 0.6px rgba(90, 48, 8, 0.4); }
:is(.parchment, .paper) p, :is(.parchment, .paper) li { color: #3a2410; text-shadow: 0 0 0.5px rgba(58, 36, 16, 0.35); }
:is(.parchment, .paper) .sub, :is(.parchment, .paper) .note { color: #6b4320; }
.parchment .result-title .rt.lose { color: #7a1a10; text-shadow: 0 0 1px rgba(122, 26, 16, 0.4); }

/* ── buttons ── */
:is(.parchment, .paper) .btn { transition: transform 0.15s ease, background-color 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease; }

/* inked box (secondary) */
:is(.parchment, .paper) .btn-dark {
  color: var(--ink-dark); background: transparent; border: 1.5px solid var(--ink-mid); border-radius: 3px;
  box-shadow: inset 0 0 0 3px transparent, inset 0 0 0 4px var(--ink-soft);
  text-shadow: 0 0 0.6px rgba(59, 31, 8, 0.4); mix-blend-mode: multiply;
}
:is(.parchment, .paper) .btn-dark:hover { background: var(--ink-wash); filter: none; transform: none; }
:is(.parchment, .paper) .btn-dark:active { background: rgba(120, 75, 25, 0.2); transform: translateY(1px); box-shadow: inset 0 0 0 3px transparent, inset 0 0 0 4px var(--ink-soft); }

/* gold-leaf foil stamp (default) */
:is(.parchment, .paper) .btn:not(.btn-dark):not(.btn-battle) {
  color: #4a2a06; border: 1px solid #8a5d18; border-radius: 3px;
  background: linear-gradient(180deg, #f6e09a 0%, #e2b85a 48%, #cf9d3e 52%, #e2b860 100%);
  box-shadow: inset 0 1px 0 rgba(255, 250, 220, 0.75), inset 0 -1px 0 rgba(110, 65, 12, 0.35), 0 1px 0 rgba(255, 248, 225, 0.55), 0 2px 3px rgba(70, 38, 6, 0.28);
  text-shadow: 0 1px 0 rgba(255, 240, 200, 0.6);
}
:is(.parchment, .paper) .btn:not(.btn-dark):not(.btn-battle):hover { filter: brightness(1.05) saturate(1.05); transform: translateY(-1px); }
:is(.parchment, .paper) .btn:not(.btn-dark):not(.btn-battle):active { transform: translateY(1px); box-shadow: inset 0 1px 3px rgba(90, 50, 8, 0.45); }

/* red wax seal (primary) */
:is(.parchment, .paper) .btn-battle {
  color: #ffe6d4; border: none; border-radius: 16px 22px 18px 24px / 22px 16px 24px 18px; animation: none;
  background: radial-gradient(ellipse at 30% 22%, #e0584a 0%, #b02a1c 45%, #7c160d 100%);
  box-shadow: inset 0 2px 2px rgba(255, 180, 160, 0.4), inset 0 -4px 6px rgba(60, 0, 0, 0.5), inset 0 0 0 2px rgba(120, 20, 10, 0.5),
    0 0 0 3px rgba(150, 30, 18, 0.25), 0 2px 0 rgba(90, 14, 6, 0.55), 0 5px 10px rgba(70, 20, 5, 0.35);
  text-shadow: 0 -1px 0 rgba(70, 0, 0, 0.7), 0 1px 0 rgba(255, 170, 150, 0.25);
}
:is(.parchment, .paper) .btn-battle:hover { filter: brightness(1.08); transform: translateY(-1px) rotate(-0.4deg); }
:is(.parchment, .paper) .btn-battle:active { transform: translateY(1px) scale(0.98); box-shadow: inset 0 3px 6px rgba(60, 0, 0, 0.6), 0 1px 0 rgba(90, 14, 6, 0.5); }

/* close cross: inked */
.parchment .x { color: var(--ink-mid); mix-blend-mode: multiply; transition: transform 0.2s ease; }
.parchment .x:hover { transform: rotate(90deg); color: var(--ink-dark); }

/* ── ruled boxes, chips, fields ── */
.parchment .stat { background: transparent; border: 1px solid var(--ink-soft); box-shadow: inset 0 0 0 3px transparent, inset 0 0 0 4px rgba(90, 55, 15, 0.14); }
.parchment .stat .k { color: #7a5226; }
.parchment .army-list .chip { background: transparent; border: 1px solid rgba(90, 55, 15, 0.42); color: var(--ink-dark); }
.parchment .army-list .chip .uicon { box-shadow: 0 0 0 1px rgba(59, 31, 8, 0.45); }
.parchment .codebox code, .parchment .g-code code { background: transparent; border: 1.5px dashed rgba(90, 55, 15, 0.6); color: var(--ink-dark); mix-blend-mode: multiply; }
.parchment .field input, .parchment .field textarea, .parchment .field select, .parchment .forge select, .parchment textarea {
  background: rgba(255, 250, 235, 0.22) !important; border: none !important; border-bottom: 2px solid var(--ink-mid) !important; border-radius: 0 !important;
  color: var(--ink-dark); box-shadow: none !important; font-family: var(--serif);
}
.parchment .field input { font-family: var(--caps); }
.parchment .field input:focus, .parchment textarea:focus { border-bottom-color: #8a2a18 !important; background: rgba(255, 250, 235, 0.38) !important; outline: none; }
.parchment .forge input[type=range] { accent-color: #8a5a14; }
.parchment .toggle-row { border-bottom-color: rgba(90, 55, 15, 0.28); }
.parchment .help-unit { background: transparent; border: 1px solid rgba(90, 55, 15, 0.3); }
.parchment .film-opt { background: transparent; border: 1.5px solid rgba(90, 55, 15, 0.35); transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease; }
.parchment .film-opt:hover { background: var(--ink-wash); }
.parchment .film-opt.on { background: rgba(201, 150, 60, 0.16); border-color: var(--ink-mid); box-shadow: inset 0 0 0 3px rgba(239, 223, 186, 0), inset 0 0 0 4px rgba(90, 55, 15, 0.25); }

/* sign-in steps: inked boxes */
.parchment .g-step { background: transparent; border: 1px solid rgba(90, 55, 15, 0.28); }
.parchment .g-step.active { background: rgba(201, 150, 60, 0.14); border-color: rgba(120, 70, 20, 0.7); box-shadow: inset 0 0 0 3px rgba(239, 223, 186, 0), inset 0 0 0 4px rgba(120, 70, 20, 0.22); }
.parchment .g-step.warn { background: rgba(160, 40, 25, 0.07); border-color: rgba(150, 40, 25, 0.7); box-shadow: none; }
.parchment .g-num { box-shadow: 0 0 0 2px rgba(90, 20, 8, 0.35), inset 0 2px 2px rgba(255, 180, 160, 0.35), inset 0 -3px 4px rgba(60, 0, 0, 0.45); border: none; }

/* small paper panels: stance switch as ink */
.paper .stance button.on { background: rgba(120, 75, 25, 0.18); color: var(--ink-dark); }
.paper .sp-head .uicon { box-shadow: 0 0 0 1px rgba(59, 31, 8, 0.45); border: none; }

@media (prefers-reduced-motion: reduce) {
  :is(.parchment, .paper) .btn, .parchment .x { transition: none; }
}

/* unearned stars: pressed (debossed) into the paper */
.parchment .bigstars svg:not(.on) { color: rgba(150, 110, 55, 0.22); filter: drop-shadow(0 1px 0 rgba(255, 248, 225, 0.7)) drop-shadow(0 -1px 0 rgba(90, 55, 15, 0.35)); }

/* ════════════════════════════════════════════════════════
   Volume sliders (settings)
   ════════════════════════════════════════════════════════ */
.vol-row { display: grid; grid-template-columns: 6.2em 1fr 3.2em; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid rgba(90, 55, 15, 0.28); font-family: var(--caps); font-weight: 700; color: #3a1f06; cursor: pointer; }
.vol-row > span, .vol-row > output { mix-blend-mode: multiply; }
.vol-row > output { text-align: right; font-variant-numeric: tabular-nums; color: #6b4320; font-size: 0.92em; }
input.vol { -webkit-appearance: none; appearance: none; width: 100%; height: 26px; margin: 0; background: transparent; cursor: pointer; touch-action: pan-y; }
input.vol:focus { outline: none; }
input.vol::-webkit-slider-runnable-track {
  height: 6px; border-radius: 3px;
  background: linear-gradient(90deg, rgba(122, 32, 18, 0.85) 0 var(--p, 50%), rgba(90, 55, 15, 0.18) var(--p, 50%) 100%);
  box-shadow: inset 0 1px 1px rgba(59, 31, 8, 0.35), 0 1px 0 rgba(255, 248, 225, 0.6);
}
input.vol::-moz-range-track { height: 6px; border-radius: 3px; background: rgba(90, 55, 15, 0.18); box-shadow: inset 0 1px 1px rgba(59, 31, 8, 0.35), 0 1px 0 rgba(255, 248, 225, 0.6); }
input.vol::-moz-range-progress { height: 6px; border-radius: 3px; background: rgba(122, 32, 18, 0.85); }
input.vol::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 22px; height: 22px; margin-top: -8px; border: none; border-radius: 50% 46% 52% 48%;
  background: radial-gradient(circle at 34% 28%, #e0584a 0%, #b02a1c 48%, #7c160d 100%);
  box-shadow: inset 0 2px 2px rgba(255, 180, 160, 0.4), inset 0 -3px 4px rgba(60, 0, 0, 0.5), 0 0 0 2px rgba(150, 30, 18, 0.22), 0 2px 4px rgba(70, 20, 5, 0.4);
  transition: transform 0.15s ease;
}
input.vol::-moz-range-thumb {
  width: 22px; height: 22px; border: none; border-radius: 50% 46% 52% 48%;
  background: radial-gradient(circle at 34% 28%, #e0584a 0%, #b02a1c 48%, #7c160d 100%);
  box-shadow: inset 0 2px 2px rgba(255, 180, 160, 0.4), inset 0 -3px 4px rgba(60, 0, 0, 0.5), 0 0 0 2px rgba(150, 30, 18, 0.22), 0 2px 4px rgba(70, 20, 5, 0.4);
}
input.vol:hover::-webkit-slider-thumb, input.vol:focus-visible::-webkit-slider-thumb { transform: scale(1.12); }
input.vol:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 3px rgba(201, 150, 60, 0.6), 0 2px 4px rgba(70, 20, 5, 0.4); }
input.vol:active::-webkit-slider-thumb { transform: scale(1.05); }
@media (max-width: 420px) { .vol-row { grid-template-columns: 5.2em 1fr 2.8em; gap: 8px; } }
@media (prefers-reduced-motion: reduce) { input.vol::-webkit-slider-thumb { transition: none; } }

/* ── In-game volume popover (opens from the speaker button) ── */
.vol-pop {
  position: fixed; z-index: 35; width: 264px; padding: 12px 16px 6px; border: 1px solid rgba(107, 74, 28, 0.6); border-radius: 6px;
  box-shadow: inset 0 0 18px rgba(92, 52, 14, 0.5), 0 14px 30px rgba(0, 0, 0, 0.55);
  opacity: 0; visibility: hidden; transform: translateY(-6px) scale(0.96); transform-origin: calc(100% - var(--arrow, 22px)) 0;
  transition: opacity 0.16s ease, transform 0.18s cubic-bezier(.2, .9, .3, 1.2), visibility 0s linear 0.18s;
}
.vol-pop.show { opacity: 1; visibility: visible; transform: none; transition: opacity 0.16s ease, transform 0.2s cubic-bezier(.2, .9, .3, 1.2); }
/* little paper tab pointing at the speaker */
.vol-pop::before {
  content: ''; position: absolute; top: -7px; right: calc(var(--arrow, 22px) - 7px); width: 13px; height: 13px; transform: rotate(45deg);
  background: #f1e3c0; border-left: 1px solid rgba(107, 74, 28, 0.6); border-top: 1px solid rgba(107, 74, 28, 0.6);
}
.vol-pop .vol-row { grid-template-columns: 4.3em 1fr 2.7em; gap: 9px; padding: 7px 0; font-size: 13px; }
.vol-pop .vol-row:last-child { border-bottom: none; }
.vol-pop .vp-head { display: grid; grid-template-columns: 34px 1fr; align-items: center; gap: 8px; border-bottom: 1px solid rgba(90, 55, 15, 0.28); padding-bottom: 4px; }
.vol-pop .vp-main { grid-template-columns: 1fr 2.9em; border-bottom: none; padding: 6px 0; }
.vol-pop .vp-main > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); } /* label for screen readers only */
.vol-pop .vp-main > output { font-size: 14px; color: #4a2a0c; }
.vol-pop .vp-sub > span { color: #6b4320; font-size: 12px; }
.vol-pop .vp-sub input.vol { height: 22px; }
.vol-pop .vp-sub input.vol::-webkit-slider-thumb { width: 18px; height: 18px; margin-top: -6px; }
.vol-pop .vp-sub input.vol::-moz-range-thumb { width: 18px; height: 18px; }
.vp-mute {
  width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; cursor: pointer; color: #4a2a0c;
  background: transparent; border: 1.5px solid rgba(59, 31, 8, 0.55); box-shadow: inset 0 0 0 3px transparent, inset 0 0 0 4px rgba(90, 55, 15, 0.2);
  mix-blend-mode: multiply; transition: background-color 0.15s ease, transform 0.12s ease;
}
.vp-mute svg { width: 17px; height: 17px; }
.vp-mute:hover { background: rgba(120, 75, 25, 0.12); }
.vp-mute:active { transform: scale(0.94); }
.vp-mute.off { color: #8a2a18; border-color: rgba(138, 42, 24, 0.6); }
.icon-btn.snd.open { color: #fff2c4; box-shadow: 0 0 0 2px #120a04, 0 0 0 4px rgba(233, 196, 106, 0.45), 0 4px 12px rgba(0, 0, 0, 0.5); }
@media (max-width: 480px) { .vol-pop { width: min(264px, calc(100vw - 16px)); } }
@media (prefers-reduced-motion: reduce) { .vol-pop, .vol-pop.show { transition: opacity 0.12s ease; transform: none; } }

/* title crest: give way to the menu on shorter screens */
@media (max-height: 860px) { .crest.big { width: 116px; height: 126px; } }
@media (max-height: 700px) { .crest.big { width: 84px; height: 91px; } }
@media (max-height: 560px) { .crest.big { width: 60px; height: 65px; } }

/* ════════════════════════════════════════════════════════
   Field manual (How to Play)
   ════════════════════════════════════════════════════════ */
.mtabs { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 4px 0 16px; padding-bottom: 12px; border-bottom: 1px solid rgba(90, 55, 15, 0.3); }
.mtabs button {
  font-family: var(--caps); font-weight: 700; font-size: 13px; letter-spacing: 0.06em; color: #6b4320; cursor: pointer;
  padding: 7px 14px; background: transparent; border: 1.5px solid rgba(90, 55, 15, 0.35); border-radius: 3px; mix-blend-mode: multiply;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.mtabs button:hover { background: rgba(120, 75, 25, 0.1); color: #3b1f08; }
.mtabs button.on { color: #fff1dc; background: radial-gradient(ellipse at 30% 22%, #c94a3c 0%, #9a2618 55%, #6e140c 100%); border-color: #6e140c; mix-blend-mode: normal; box-shadow: inset 0 1px 1px rgba(255, 190, 170, 0.35), 0 1px 2px rgba(60, 10, 0, 0.35); }
.mpage.turn { animation: mturn 0.28s ease; }
@keyframes mturn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.mpage h4 { font-family: var(--caps); font-weight: 900; font-size: 15px; color: #3b1f08; margin: 0 0 2px; mix-blend-mode: multiply; }
.mpage p { margin: 0; font-size: 14.5px; line-height: 1.4; }
.mlead { font-style: italic; text-align: center; margin: 0 auto 16px !important; max-width: 640px; color: #4a2c0c !important; font-size: 15.5px !important; }
.mnote { margin-top: 14px; padding: 10px 14px; border: 1px dashed rgba(90, 55, 15, 0.45); border-radius: 3px; font-size: 14px; color: #4a2c0c; text-align: center; mix-blend-mode: multiply; }

/* numbered steps with wax seals */
.msteps { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.mstep { display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; border: 1px solid rgba(90, 55, 15, 0.28); border-radius: 3px; }
.mseal {
  flex: none; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 48% 52% 50% 46%;
  font-family: var(--deco); font-weight: 900; font-size: 18px; color: #ffe6d4; text-shadow: 0 -1px 0 rgba(70, 0, 0, 0.7);
  background: radial-gradient(ellipse at 32% 26%, #e0584a 0%, #b02a1c 48%, #7c160d 100%);
  box-shadow: inset 0 2px 2px rgba(255, 180, 160, 0.4), inset 0 -3px 5px rgba(60, 0, 0, 0.5), 0 0 0 2px rgba(150, 30, 18, 0.2), 0 2px 4px rgba(70, 20, 5, 0.35);
}

/* controls table */
.mtable { width: 100%; border-collapse: collapse; font-size: 14px; }
.mtable th, .mtable td { padding: 8px 10px; text-align: left; vertical-align: top; border-bottom: 1px solid rgba(90, 55, 15, 0.22); mix-blend-mode: multiply; }
.mtable thead th { font-family: var(--caps); font-size: 12px; letter-spacing: 0.08em; color: #7a5226; border-bottom: 1.5px solid rgba(90, 55, 15, 0.45); }
.mtable tbody th { font-family: var(--caps); font-weight: 700; color: #3b1f08; white-space: nowrap; width: 1%; }
.mtable td { color: #3a2410; }
.mpage kbd { display: inline-block; min-width: 1.6em; padding: 1px 6px; margin: 0 1px; text-align: center; font: 700 12px/1.5 var(--caps); color: #3b1f08; border: 1px solid rgba(59, 31, 8, 0.55); border-bottom-width: 2.5px; border-radius: 4px; background: rgba(255, 248, 225, 0.45); }

/* troop cards */
.mtroops { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.mtroop { padding: 12px; border: 1px solid rgba(90, 55, 15, 0.3); border-radius: 3px; display: flex; flex-direction: column; gap: 6px; }
.mt-head { display: flex; gap: 10px; align-items: center; }
.mt-head small { color: #7a5226; font-size: 12px; }
.mt-icon { flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; box-shadow: 0 0 0 1.5px rgba(59, 31, 8, 0.5), inset 0 2px 3px rgba(255, 255, 255, 0.25); }
.mt-icon .uicon { width: 24px; height: 24px; fill: #1e140a; }
.mbars { display: grid; gap: 3px; margin: 2px 0; }
.mb { display: grid; grid-template-columns: 6.4em 1fr; align-items: center; gap: 8px; font: 700 11px var(--caps); letter-spacing: 0.04em; color: #6b4320; }
.mb i { height: 6px; border-radius: 3px; background: rgba(90, 55, 15, 0.16); overflow: hidden; box-shadow: inset 0 1px 1px rgba(59, 31, 8, 0.25); }
.mb b { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, #8a2a18, #b0402a); }
.mtroop .gb { font-size: 12px; color: #2d6a2a; font-family: var(--caps); font-weight: 700; mix-blend-mode: multiply; }
.mtroop .gb.b { color: #8a2015; }

/* art of war tips */
.mtips { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 10px 16px; }
.mtip { display: flex; gap: 12px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid rgba(90, 55, 15, 0.2); }
.mtip-i { flex: none; width: 36px; height: 36px; display: grid; place-items: center; font-size: 19px; border-radius: 50%; border: 1.5px solid rgba(90, 55, 15, 0.4); background: rgba(255, 248, 225, 0.35); filter: sepia(0.35) saturate(0.85); }

@media (max-width: 560px) {
  .mtabs button { padding: 6px 9px; font-size: 12px; }
  .mtable { font-size: 13px; }
  .mtable thead { display: none; }
  .mtable tr { display: grid; grid-template-columns: 1fr 1fr; padding: 6px 0; border-bottom: 1px solid rgba(90, 55, 15, 0.22); }
  .mtable tbody th { grid-column: 1 / -1; width: auto; border: none; padding: 2px 4px; }
  .mtable td { border: none; padding: 2px 4px; font-size: 12.5px; }
  .mtable td:nth-of-type(1)::before { content: 'Mouse · '; color: #7a5226; font: 700 11px var(--caps); }
  .mtable td:nth-of-type(2)::before { content: 'Touch · '; color: #7a5226; font: 700 11px var(--caps); }
}
@media (prefers-reduced-motion: reduce) { .mpage.turn { animation: none; } }

/* ════════════════════════════════════════════════════════
   Sandbox
   ════════════════════════════════════════════════════════ */
.menu .menu-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; grid-column: 1 / -1; }
.menu .menu-row .btn small { font-size: 11px; }

/* setup page over a live preview of the battlefield */
.modal.preview { background: radial-gradient(ellipse at center, rgba(8, 4, 2, 0.05) 30%, rgba(8, 4, 2, 0.45) 100%); backdrop-filter: none; }
.sb-field { margin-top: 14px; text-align: center; }
.sb-field .v { font-size: 20px; }
.sb-blurb { font-style: italic; color: #6b4a22; font-size: 14px; margin-top: 2px; mix-blend-mode: multiply; }
.sb-maps { justify-content: center; }
.sb-maps code { min-width: 9em; text-align: center; }
.sb-keep { margin-top: 8px; }
.sb-keep input { width: 20px; height: 20px; accent-color: #8a2a18; }

/* which host you are deploying */
.side-switch {
  position: absolute; top: calc(78px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%);
  display: none; gap: 6px; align-items: center; pointer-events: auto; z-index: 3;
  padding: 5px; border-radius: 30px; background: rgba(26, 16, 9, 0.88); border: 1px solid var(--gold-d); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5);
}
#hud-deploy.sandbox .side-switch { display: flex; }
.side-switch button {
  display: flex; align-items: center; gap: 7px; padding: 7px 14px; border-radius: 22px; cursor: pointer;
  font: 700 13px var(--caps); letter-spacing: 0.04em; color: #cdb68a; background: transparent; border: 1px solid transparent;
  transition: background-color 0.18s ease, color 0.18s ease, transform 0.12s ease;
}
.side-switch button:hover { color: #fff2c4; }
.side-switch button:active { transform: scale(0.96); }
.side-switch [data-side="0"].on { color: #fff; background: linear-gradient(180deg, #4a82e0, #2f64c4 60%, #1d3a78); border-color: #8fb4ff; box-shadow: 0 0 12px rgba(80, 140, 255, 0.45); }
.side-switch [data-side="1"].on { color: #fff; background: linear-gradient(180deg, #e0574a, #c0352b 60%, #6e1a16); border-color: #ffb0a0; box-shadow: 0 0 12px rgba(255, 90, 70, 0.45); }
.ss-flag { width: 10px; height: 14px; clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 78%, 0 100%); }
.ss-flag.blue { background: #6f9cff; }
.ss-flag.red { background: #ff7a6a; }
.side-switch .ss-mirror { color: #e8c06a; border-left: 1px solid rgba(201, 150, 60, 0.35); border-radius: 0 22px 22px 0; padding-left: 12px; }
#hud-deploy.sandbox [data-act=poster] { display: none; }

/* sandbox results: both hosts side by side */
.sb-compare { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 0; margin: 16px auto 4px; max-width: 460px; }
.sb-compare > div { padding: 8px 10px; border-bottom: 1px solid rgba(90, 55, 15, 0.22); mix-blend-mode: multiply; }
.sb-compare .k { font: 700 13px var(--caps); color: #7a5226; }
.sb-compare .v { text-align: center; font: 900 16px var(--caps); color: #3b1f08; }
.sbc-head { font: 900 13px var(--caps); letter-spacing: 0.06em; text-align: center; border-bottom: 1.5px solid rgba(90, 55, 15, 0.45) !important; }
.sbc-head.blue { color: #1d3a78; }
.sbc-head.red { color: #8a1e14; }
.parchment .result-title .rt.red-win { color: #8a1e14; }

@media (max-width: 760px) { .side-switch { top: calc(112px + env(safe-area-inset-top)); } .side-switch button { padding: 6px 10px; font-size: 12px; } }
@media (max-width: 380px) { .side-switch .ss-mirror { padding-left: 8px; } .side-switch button { padding: 6px 8px; gap: 5px; } }
@media (max-height: 860px) { .menu { margin-top: 20px; gap: 9px; } .menu .menu-row { gap: 9px; } }
/* the side switch sits below the gold plates wherever those drop to a second row */
@media (max-width: 820px) { .side-switch { top: calc(136px + env(safe-area-inset-top)); } }
@media (max-height: 500px) and (orientation: landscape) { .side-switch { top: calc(48px + env(safe-area-inset-top)); } .side-switch button { padding: 5px 10px; } }
/* landscape phones: the title menu goes three across so the extra Sandbox button costs no height */
@media (max-height: 500px) and (orientation: landscape) {
  .menu { grid-template-columns: repeat(3, 1fr); width: min(660px, 92vw); }
  .menu .menu-row { display: contents; }
}
@media (max-height: 500px) and (orientation: landscape) {
  .menu { margin-top: 8px; gap: 6px; }
  .menu .btn { padding: 6px 10px; }
  .menu .btn small { font-size: 10.5px; }
}

/* ── Colour-blind mode: the second host is orange ── */
body.cb .strength .red .bar span { background: linear-gradient(180deg, #ffc070, #ea8a1a 60%, #8a4a0c); }
body.cb .side-switch [data-side="1"].on { background: linear-gradient(180deg, #ffb04a, #ea8a1a 60%, #8a4a0c); border-color: #ffd49a; box-shadow: 0 0 12px rgba(255, 160, 40, 0.45); }
body.cb .ss-flag.red { background: #ffaa44; clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 72%, 0 100%); }
body.cb .sbc-head.red, body.cb .parchment .result-title .rt.red-win { color: #9a5208; }

/* ── Game logo (GPT Image) ── */
.title-logo { margin: 0; line-height: 0; text-align: center; animation: float 6s ease-in-out infinite; }
.title-logo img, .ld-crest img {
  display: block; margin: 0 auto; width: auto; height: auto;
  max-width: min(600px, 90vw); max-height: 34vh;
  filter: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.75)) drop-shadow(0 2px 4px rgba(0, 0, 0, 0.6));
}
.ld-crest { width: auto; height: auto; margin-bottom: 4px; }
.ld-crest img { max-width: min(560px, 86vw); max-height: 40vh; position: relative; animation: ld-float 5s ease-in-out 1s infinite; }
.ld-halo { inset: 0 10%; }
@media (max-height: 700px) { .title-logo img { max-height: 30vh; } }
@media (max-height: 500px) and (orientation: landscape) { .title-logo img { max-height: 26vh; } .ld-crest img { max-height: 34vh; } }

/* ════════════════════════════════════════════════════════
   Guided first battle (coach)
   ════════════════════════════════════════════════════════ */
.coach {
  position: fixed; z-index: 38; padding: 14px 16px 12px; border-radius: 6px; border: 1px solid rgba(107, 74, 28, 0.6);
  box-shadow: inset 0 0 18px rgba(92, 52, 14, 0.45), 0 14px 34px rgba(0, 0, 0, 0.6);
  transition: left 0.35s cubic-bezier(.3, .8, .3, 1), top 0.35s cubic-bezier(.3, .8, .3, 1);
  opacity: 0; transform: translateY(6px) scale(0.98);
}
.coach.in { opacity: 1; transform: none; transition: left 0.35s cubic-bezier(.3, .8, .3, 1), top 0.35s cubic-bezier(.3, .8, .3, 1), opacity 0.25s ease, transform 0.3s cubic-bezier(.2, .9, .3, 1.2); }
.coach::after { content: ''; position: absolute; left: calc(var(--ax, 50%) - 8px); width: 14px; height: 14px; background: #f1e3c0; transform: rotate(45deg); display: none; }
.coach[data-arrow="up"]::after { display: block; top: -8px; border-left: 1px solid rgba(107, 74, 28, 0.6); border-top: 1px solid rgba(107, 74, 28, 0.6); }
.coach[data-arrow="down"]::after { display: block; bottom: -8px; border-right: 1px solid rgba(107, 74, 28, 0.6); border-bottom: 1px solid rgba(107, 74, 28, 0.6); background: #e9d6aa; }
.coach-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 4px; }
.coach-head b { font: 900 16px var(--caps); color: #3b1f08; mix-blend-mode: multiply; }
.coach-dots { display: flex; gap: 4px; }
.coach-dots i { width: 7px; height: 7px; border-radius: 50%; background: rgba(90, 55, 15, 0.22); }
.coach-dots i.done { background: rgba(138, 42, 24, 0.55); }
.coach-dots i.on { background: #a8301c; box-shadow: 0 0 0 2px rgba(168, 48, 28, 0.25); }
.coach p { margin: 0 0 10px; font-size: 15px; line-height: 1.4; color: #3a2410; }
.coach-actions { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.coach-skip { background: none; border: none; padding: 4px 0; font: italic 13px var(--serif); color: #7a5226; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.coach-skip:empty { visibility: hidden; }
.coach-wait { font: italic 13px var(--serif); color: #8a2a18; animation: coach-blink 1.6s ease-in-out infinite; }
@keyframes coach-blink { 50% { opacity: 0.45; } }
.coach-ring {
  position: fixed; z-index: 37; display: none; pointer-events: none; border-radius: 12px;
  border: 2px solid #ffd27a; box-shadow: 0 0 0 4px rgba(255, 210, 122, 0.25), 0 0 26px rgba(255, 190, 90, 0.65);
  transition: left 0.35s cubic-bezier(.3, .8, .3, 1), top 0.35s cubic-bezier(.3, .8, .3, 1), width 0.35s ease, height 0.35s ease;
  animation: coach-pulse 1.4s ease-in-out infinite;
}
@keyframes coach-pulse { 50% { box-shadow: 0 0 0 9px rgba(255, 210, 122, 0.08), 0 0 34px rgba(255, 190, 90, 0.85); } }
@media (prefers-reduced-motion: reduce) { .coach-ring, .coach-wait { animation: none; } .coach, .coach.in { transition: opacity 0.2s ease; transform: none; } }

/* ════════════════════════════════════════════════════════
   Campaign: painted world map
   ════════════════════════════════════════════════════════ */
#campaign.active { display: block; background: #0d0805; backdrop-filter: none; overflow: hidden; }
.cmp-map { position: absolute; inset: 0; overflow: hidden; }
.cmp-world { position: absolute; left: 0; top: 0; width: 1600px; height: 900px; transform-origin: 0 0; transition: transform 0.9s cubic-bezier(.3, .8, .25, 1); }
.cmp-world.moving { will-change: transform; }
.cmp-art { position: absolute; inset: 0; width: 100%; height: 100%; display: block; user-select: none; }
.cmp-map { background: #173d55; }
.cmp-world.instant { transition: none; }
.cmp-roads { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.cmp-road { fill: none; stroke: rgba(70, 30, 10, 0.75); stroke-width: 3; stroke-dasharray: 2 9; stroke-linecap: round; vector-effect: non-scaling-stroke; filter: drop-shadow(0 1px 0 rgba(255, 230, 180, 0.6)); }
.cmp-road.won { stroke: #f2c25a; stroke-dasharray: none; stroke-width: 3.5; filter: drop-shadow(0 0 4px rgba(255, 200, 80, 0.8)); }
.cmp-nodes { position: absolute; inset: 0; }
.cmp-shade { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse at 55% 55%, transparent 45%, rgba(8, 4, 2, 0.6) 100%), linear-gradient(180deg, rgba(8, 4, 2, 0.75) 0%, transparent 18%, transparent 80%, rgba(8, 4, 2, 0.55) 100%); }

/* medallions keep their on-screen size whatever the zoom */
.cmp-node { position: absolute; transform: translate(-50%, -50%) scale(var(--inv, 1)); background: none; border: none; padding: 0; cursor: pointer; display: grid; justify-items: center; transition: transform 0.25s cubic-bezier(.3, .9, .3, 1.3); z-index: 2; }
.cmp-node:hover, .cmp-node.sel { transform: translate(-50%, -50%) scale(calc(var(--inv, 1) * 1.12)); z-index: 3; }
.cn-medal {
  width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center;
  font: 900 22px var(--deco); color: #fff4d8; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.5);
  background: radial-gradient(circle at 35% 30%, #8a7a62, #4e4334 70%);
  border: 3px solid #e2b04f; box-shadow: 0 0 0 2px #2a1708, inset 0 2px 3px rgba(255, 240, 200, 0.4), inset 0 -4px 6px rgba(0, 0, 0, 0.45), 0 6px 14px rgba(0, 0, 0, 0.6);
}
.cn-medal svg { width: 24px; height: 24px; fill: currentColor; }
.cmp-node.done .cn-medal { background: radial-gradient(circle at 35% 30%, #5b92ea, #1f4590 65%, #12295a); }
.cmp-node.next .cn-medal { background: radial-gradient(circle at 35% 30%, #e0584a, #b02a1c 50%, #7c160d); animation: cn-glow 1.8s ease-in-out infinite; }
@keyframes cn-glow { 50% { box-shadow: 0 0 0 2px #2a1708, inset 0 2px 3px rgba(255, 240, 200, 0.4), inset 0 -4px 6px rgba(0, 0, 0, 0.45), 0 0 26px 6px rgba(255, 170, 80, 0.75); } }
.cmp-node.locked { cursor: not-allowed; }
.cmp-node.locked .cn-medal { filter: grayscale(0.6) brightness(0.75); border-color: #8a7550; color: #d8c8a8; }
.cmp-node.boss .cn-medal { width: 76px; height: 76px; background: radial-gradient(circle at 35% 30%, #4a4a52, #1e1e24 65%, #0d0d10); border-width: 4px; }
.cmp-node.boss.done .cn-medal { background: radial-gradient(circle at 35% 30%, #5b92ea, #1f4590 65%, #12295a); }
.cmp-node.boss .cn-medal svg { width: 34px; height: 34px; color: #f2c25a; }
.cn-flag { position: absolute; left: 50%; bottom: 100%; width: 3px; height: 34px; margin-left: -1px; background: #3b2208; }
.cn-flag::after { content: ''; position: absolute; left: 3px; top: 0; width: 24px; height: 16px; background: linear-gradient(180deg, #e0584a, #a8261a); clip-path: polygon(0 0, 100% 0, 78% 50%, 100% 100%, 0 100%); animation: cn-wave 1.2s ease-in-out infinite; transform-origin: left center; }
@keyframes cn-wave { 50% { transform: skewY(-6deg) scaleX(0.9); } }
.cn-stars { display: flex; gap: 1px; margin-top: -8px; position: relative; }
.cn-stars svg { width: 17px; height: 17px; color: #4a3a26; filter: drop-shadow(0 1px 0 #1a0f06); }
.cn-stars svg.on { color: #f7c948; filter: drop-shadow(0 0 4px rgba(255, 200, 60, 0.9)) drop-shadow(0 1px 0 #2a1708); }
.cn-name { margin-top: 3px; padding: 3px 10px; white-space: nowrap; border-radius: 4px; font: 700 12px var(--caps); color: #fff1cf; background: rgba(20, 11, 5, 0.78); border: 1px solid rgba(201, 150, 60, 0.45); opacity: 0; transform: translateY(-4px); transition: opacity 0.2s ease, transform 0.2s ease; pointer-events: none; }
.cmp-node:hover .cn-name, .cmp-node.sel .cn-name, .cmp-node.next .cn-name { opacity: 1; transform: none; }
.cmp-label { position: absolute; transform: translate(-50%, -50%) scale(var(--inv, 1)); opacity: 0; pointer-events: none; transition: opacity 0.4s ease; text-align: center; }
.cmp-label span { display: inline-block; padding: 6px 16px; font: 900 22px var(--deco); color: #fff1cf; text-shadow: 0 2px 0 #3b2208, 0 3px 10px #000; background: radial-gradient(ellipse, rgba(10, 5, 2, 0.6), transparent 72%); }
.cmp-label.locked span { color: #b9a988; }
.cmp-world.overview .cmp-label { opacity: 1; pointer-events: auto; cursor: pointer; }
.cmp-world.overview .cmp-node { opacity: 0.0; pointer-events: none; }

/* top bar */
.cmp-top { position: absolute; top: 0; left: 0; right: 0; z-index: 4; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: max(14px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) 12px max(18px, env(safe-area-inset-left)); }
.cmp-titles { text-align: center; }
.cmp-titles h2 { font: 900 clamp(22px, 3vw, 36px) var(--deco); color: var(--gold-b); text-shadow: 0 2px 0 #3b2208, 0 4px 14px #000; }
.cmp-prog { display: flex; align-items: center; gap: 10px; justify-content: center; margin-top: 4px; }
.cmp-prog-bar { width: min(240px, 40vw); height: 7px; border-radius: 4px; background: rgba(20, 11, 5, 0.85); border: 1px solid #8a5d18; overflow: hidden; }
.cmp-prog-bar i { display: block; height: 100%; background: linear-gradient(90deg, #a87a2c, #f8dc92); box-shadow: 0 0 8px rgba(255, 200, 90, 0.6); transition: width 0.6s ease; }
.cmp-prog small { font: italic 13px var(--serif); color: #e8d3a2; text-shadow: 0 1px 4px #000; }
.cmp-realm-title { position: absolute; z-index: 3; left: 50%; top: calc(86px + env(safe-area-inset-top)); transform: translateX(-50%); text-align: center; pointer-events: none; width: min(560px, 80vw); }
.cmp-realm-title h3 { font: 900 clamp(20px, 2.4vw, 30px) var(--deco); color: #fff1cf; text-shadow: 0 2px 0 #3b2208, 0 3px 14px #000; }
.cmp-realm-title p { font: italic 15px var(--serif); color: #f0e0bc; text-shadow: 0 1px 6px #000; margin-top: 2px; }
.cmp-realm-title .btn { pointer-events: auto; margin-top: 8px; }

/* realm banners */
.cmp-realms { position: absolute; z-index: 4; left: max(16px, env(safe-area-inset-left)); top: calc(96px + env(safe-area-inset-top)); bottom: 18px; width: 238px; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; padding: 4px; }
.cmp-realm {
  position: relative; display: flex; align-items: center; gap: 10px; padding: 8px 12px 8px 8px; cursor: pointer; text-align: left;
  border-radius: 6px; border: 1px solid rgba(201, 150, 60, 0.35); background: linear-gradient(90deg, rgba(20, 11, 5, 0.9), rgba(20, 11, 5, 0.72));
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.45); transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.cmp-realm:hover { transform: translateX(4px); border-color: var(--gold-d); }
.cmp-realm.on { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold), 0 0 20px rgba(227, 185, 95, 0.35), 0 6px 16px rgba(0, 0, 0, 0.45); }
.cmp-realm.locked { opacity: 0.55; }
.cr-flag { flex: none; width: 40px; height: 50px; display: grid; place-items: center; background: linear-gradient(160deg, var(--rc1), var(--rc2) 55%, var(--rc3)); clip-path: polygon(0 0, 100% 0, 100% 78%, 50% 100%, 0 78%); box-shadow: inset 0 0 0 2px rgba(255, 220, 140, 0.6); position: relative; }
.cr-flag b { font: 900 15px var(--deco); color: #fff4d8; text-shadow: 0 1px 2px #000, 0 0 6px rgba(0, 0, 0, 0.7); }
.cr-flag svg { position: absolute; bottom: 9px; width: 13px; height: 13px; fill: #fff4d8; }
.cr-text { flex: 1; min-width: 0; display: grid; gap: 3px; }
.cr-name { font: 700 15px var(--caps); color: var(--gold-b); }
.cr-sub { display: flex; align-items: center; gap: 4px; font: 12px var(--serif); color: var(--muted); }
.cr-sub svg { width: 12px; height: 12px; color: #f5c84c; }
.cr-bar { height: 4px; border-radius: 2px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.cr-bar i { display: block; height: 100%; background: linear-gradient(90deg, #a87a2c, #f8dc92); }
.cmp-realm.conquered::after { content: '✓'; position: absolute; right: 10px; top: 8px; font: 900 14px var(--caps); color: #9fd48a; }

/* briefing panel */
.cmp-brief {
  position: absolute; z-index: 5; right: max(16px, env(safe-area-inset-right)); top: calc(90px + env(safe-area-inset-top)); bottom: 18px; width: min(380px, 92vw); overflow-y: auto;
  padding: 22px 22px 18px; border-radius: 4px; border: 1px solid rgba(107, 74, 28, 0.6);
  box-shadow: inset 0 0 22px rgba(92, 52, 14, 0.5), 0 18px 40px rgba(0, 0, 0, 0.6);
  transform: translateX(calc(100% + 40px)); opacity: 0; transition: transform 0.45s cubic-bezier(.3, .8, .25, 1), opacity 0.3s ease; pointer-events: none;
}
.cmp-brief.open { transform: none; opacity: 1; pointer-events: auto; }
.cmp-brief .x { position: absolute; top: 12px; right: 14px; }
.cb-kicker { font: 700 12px var(--caps); letter-spacing: 0.08em; color: #8a5a22; text-transform: uppercase; }
.cmp-brief h2 { font: 900 24px var(--deco); color: #3b1f08; margin: 4px 26px 6px 0; line-height: 1.15; }
.cb-lord { font-size: 14.5px; line-height: 1.4; }
.cb-odds { margin: 14px 0 6px; padding: 10px 12px; border: 1px solid rgba(90, 55, 15, 0.3); border-radius: 3px; }
.cb-odds-row { display: flex; justify-content: space-between; font: 700 13px var(--caps); color: #6b4320; }
.cb-odds-row b { font: 900 16px var(--caps); }
.cb-odds-row b.gold { color: #8a5a0c; } .cb-odds-row b.red { color: #8a1e14; }
.cb-odds-bar { height: 8px; margin: 6px 0; border-radius: 4px; background: linear-gradient(90deg, #8a1e14, #c0352b); overflow: hidden; box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3); }
.cb-odds-bar i { display: block; height: 100%; background: linear-gradient(90deg, #f8dc92, #c8902e); border-right: 2px solid #fff4d8; }
.cmp-brief h3 { font: 900 14px var(--caps); color: #5a3008; margin: 12px 0 6px; letter-spacing: 0.04em; }
.cb-army { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; }
.cb-unit { display: grid; grid-template-columns: 30px 1fr; grid-template-rows: auto auto; column-gap: 6px; align-items: center; padding: 5px 6px; border: 1px solid rgba(90, 55, 15, 0.3); border-radius: 3px; }
.cb-ui { grid-row: 1 / 3; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; box-shadow: 0 0 0 1px rgba(59, 31, 8, 0.5); }
.cb-ui .uicon { width: 18px; height: 18px; fill: #1e140a; }
.cb-unit b { font: 900 14px var(--caps); color: #3b1f08; }
.cb-unit small { font-size: 11px; color: #6b4320; line-height: 1.1; }
.cb-new { margin-top: 10px; padding: 8px 10px; border: 1px dashed rgba(196, 143, 54, 0.8); border-radius: 3px; background: rgba(255, 220, 120, 0.18); font-size: 13.5px; color: #3b1f08; }
.cb-new span { display: block; font: 700 11px var(--caps); color: #8a5a0c; letter-spacing: 0.06em; text-transform: uppercase; }
.cb-best { display: flex; align-items: center; gap: 10px; margin-top: 12px; font: 13px var(--serif); color: #6b4320; }
.cb-best > span:first-child { font: 700 12px var(--caps); text-transform: uppercase; letter-spacing: 0.06em; }
.cb-stars { display: flex; gap: 1px; }
.cb-stars svg { width: 18px; height: 18px; color: rgba(90, 55, 15, 0.3); }
.cb-stars svg.on { color: #e0a82a; filter: drop-shadow(0 1px 0 rgba(90, 50, 8, 0.6)); }
.cb-actions { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 16px; }
.cb-actions .btn-battle { flex: 1; }

@media (max-width: 820px) {
  .cmp-realms { left: 0; right: 0; top: auto; bottom: max(8px, env(safe-area-inset-bottom)); width: auto; flex-direction: row; overflow-x: auto; overflow-y: hidden; padding: 4px 12px; gap: 8px; }
  .cmp-realm { flex: none; padding: 6px 10px 6px 6px; }
  .cmp-realm:hover { transform: none; }
  .cr-flag { width: 30px; height: 38px; }
  .cr-name { font-size: 13px; }
  .cmp-realm-title { top: calc(92px + env(safe-area-inset-top)); }
  .cmp-realm-title p { display: none; }
  .cmp-brief { left: 0; right: 0; top: auto; bottom: 0; width: auto; max-height: 72vh; border-radius: 12px 12px 0 0; transform: translateY(105%); padding-bottom: max(18px, env(safe-area-inset-bottom)); }
  .cn-medal { width: 50px; height: 50px; font-size: 19px; }
  .cmp-node.boss .cn-medal { width: 62px; height: 62px; }
}
@media (max-height: 500px) and (orientation: landscape) {
  .cmp-top { padding-top: max(6px, env(safe-area-inset-top)); padding-bottom: 6px; }
  .cmp-realms { top: calc(70px + env(safe-area-inset-top)); width: 190px; }
  .cmp-realm-title { top: calc(64px + env(safe-area-inset-top)); }
  .cmp-realm-title p { display: none; }
  .cmp-brief { top: calc(64px + env(safe-area-inset-top)); }
}
@media (prefers-reduced-motion: reduce) { .cmp-world { transition: none; } .cmp-node.next .cn-medal, .cn-flag::after { animation: none; } }

/* ════════════════════════════════════════════════════════
   Field conditions, formations & orders, veterans, weekly
   ════════════════════════════════════════════════════════ */
.tp-cond, .cond-row { display: flex; flex-wrap: wrap; gap: 5px; justify-content: center; margin-top: 5px; }
.cond-row { justify-content: flex-start; margin: 8px 0 4px; }
.cond { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px 3px 6px; border-radius: 999px; font: 700 11.5px var(--caps); letter-spacing: 0.02em; color: #f3e6c4; background: rgba(20, 12, 6, 0.72); border: 1px solid rgba(232, 192, 106, 0.45); cursor: help; white-space: nowrap; }
.cond b { font-size: 13px; line-height: 1; }
.cond .wind { display: inline-block; font-style: normal; font-weight: 900; color: #9fe0ff; margin-left: 2px; }
.cond.wx-rain, .cond.wx-fog, .cond.wx-wind, .cond.wx-snow { border-color: #8fc4e0; }
.modal-card .cond, .cmp-brief .cond { color: #3b1f08; background: rgba(255, 246, 220, 0.6); border-color: rgba(107, 74, 28, 0.45); }
.modal-card .cond .wind, .cmp-brief .cond .wind { color: #1f5a8a; }

#sel-panel { width: 270px; }
.sp-label { margin: 9px 0 4px; font: 700 10.5px var(--caps); letter-spacing: 0.08em; text-transform: uppercase; color: var(--gold-d); }
.seg { display: flex; flex-wrap: wrap; gap: 4px; }
.seg button { flex: 1 1 auto; min-width: 0; padding: 6px 7px; border-radius: 4px; border: 1px solid rgba(201, 150, 60, 0.45); background: rgba(20, 12, 6, 0.55); font: 700 11px var(--caps); color: var(--muted); cursor: pointer; white-space: nowrap; }
.seg button:hover { color: #fff1cf; border-color: var(--gold-d); }
.seg button.on { background: linear-gradient(180deg, #f2d48a, #c79a45); color: #2a1708; border-color: #f2d48a; }
.sp-desc { margin-top: 7px; font: 12.5px/1.35 var(--serif); color: #e8d6ae; }
.sp-desc b { color: var(--gold-b); }
.sp-vet { margin-top: 7px; padding: 4px 8px; border-radius: 4px; background: rgba(255, 210, 100, 0.12); border: 1px solid rgba(255, 210, 100, 0.35); font: 700 12px var(--caps); color: #ffd96a; }
.tt-vet { margin: 4px 0 6px; padding: 5px 8px; border-radius: 4px; background: rgba(255, 210, 100, 0.18); font-size: 13px; }

.ucard.vet .uc-card { background: linear-gradient(170deg, #4a3410, #241707 60%, #160d04); box-shadow: inset 0 0 0 2px #e8c06a, 0 0 14px rgba(255, 200, 80, 0.35), 0 6px 14px rgba(0, 0, 0, 0.5); }
.ucard.vet .uc-name { font-size: 11px; line-height: 1.1; color: #ffe7a8; }
.uc-stars { display: block; font-size: 11px; letter-spacing: 1px; color: #ffd96a; text-shadow: 0 0 6px rgba(255, 200, 60, 0.8); line-height: 1; }
.ucard.used { opacity: 0.35; filter: grayscale(0.6); pointer-events: none; }
.tray-sep { flex: none; width: 2px; align-self: stretch; margin: 10px 4px; background: linear-gradient(180deg, transparent, rgba(232, 192, 106, 0.6), transparent); }

.battle-feed { position: absolute; left: 50%; top: calc(70px + env(safe-area-inset-top)); transform: translateX(-50%); display: grid; gap: 6px; justify-items: center; pointer-events: none; z-index: 5; }
.feed-item { padding: 6px 14px; border-radius: 999px; font: 700 14px var(--caps); color: #fff1cf; background: rgba(20, 12, 6, 0.8); border: 1px solid rgba(232, 192, 106, 0.55); box-shadow: 0 6px 16px rgba(0, 0, 0, 0.45); animation: feed-in 0.35s cubic-bezier(.2, .9, .3, 1.3); transition: opacity 0.5s ease, transform 0.5s ease; white-space: nowrap; }
.feed-item.good { border-color: #8fd36a; color: #e6ffd8; }
.feed-item.bad { border-color: #e0584a; color: #ffd8d0; }
.feed-item.out { opacity: 0; transform: translateY(-8px); }
@keyframes feed-in { from { opacity: 0; transform: translateY(-10px) scale(0.92); } }

.btn-weekly { background: linear-gradient(180deg, #6a3d9a, #3f1f63); color: #f4e8ff; border-color: #b58ae0; }
.btn-weekly small { color: #dcc8f2; }
.wk-kicker { font: 700 12px var(--caps); letter-spacing: 0.1em; text-transform: uppercase; color: #6a3d9a; text-align: center; }
.wk-rules { display: grid; gap: 8px; margin: 4px 0 12px; }
.wk-rule { display: grid; grid-template-columns: 40px 1fr; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 4px; background: linear-gradient(90deg, rgba(106, 61, 154, 0.16), rgba(106, 61, 154, 0.04)); border: 1px solid rgba(106, 61, 154, 0.4); }
.wk-ri { width: 40px; height: 40px; display: grid; place-items: center; font-size: 22px; border-radius: 50%; background: rgba(106, 61, 154, 0.2); }
.wk-rule b { font: 900 15px var(--caps); color: #3b1f08; display: block; }
.wk-rule small { font-size: 13px; color: #5a3a1a; }
.wk-board { list-style: none; margin: 6px 0 10px; padding: 0; display: grid; gap: 3px; }
.wk-board li { display: grid; grid-template-columns: 30px 1fr auto 70px; gap: 8px; align-items: center; padding: 5px 10px; border-radius: 3px; background: rgba(90, 55, 15, 0.08); font-size: 14px; }
.wk-board li.top { background: rgba(232, 192, 106, 0.28); }
.wk-board li.muted { display: block; font-style: italic; color: #7a5a32; }
.wr { font: 900 14px var(--caps); color: #8a5a0c; }
.wn { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #3b1f08; }
.ws { color: #c48f1a; font-size: 12px; }
.wg { text-align: right; font: 900 14px var(--caps); color: #3b1f08; }
.wk-name { display: flex; align-items: center; gap: 10px; margin: 4px 0 8px; font: 700 12px var(--caps); color: #6b4320; }
.wk-name input { flex: 1; padding: 7px 10px; border-radius: 4px; border: 2px solid #8a6a2c; background: rgba(255, 250, 230, 0.65); font: 15px var(--serif); color: #3b1f08; }
.wk-result { margin: 10px 0 4px; padding: 9px 12px; text-align: center; border-radius: 4px; background: rgba(106, 61, 154, 0.12); border: 1px solid rgba(106, 61, 154, 0.4); font-size: 15px; color: #3b1f08; }

.vet-report { margin-top: 12px; }
.vet-report h3 { margin-bottom: 6px; }
.vr { display: grid; grid-template-columns: 30px 1fr auto; gap: 9px; align-items: center; padding: 5px 8px; border-radius: 3px; background: rgba(90, 55, 15, 0.08); margin-bottom: 4px; }
.vr-i { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: #c9a24f; }
.vr-i .uicon { width: 18px; height: 18px; fill: #1e140a; }
.vr b { font: 900 14px var(--caps); color: #3b1f08; display: block; }
.vr small { font-size: 12.5px; color: #6b4320; }
.vr.promoted { background: rgba(232, 192, 106, 0.35); }
.vr.enlisted { background: rgba(127, 211, 106, 0.18); }
.vr.lost { background: rgba(192, 53, 43, 0.14); }
.vr.lost b { text-decoration: line-through; color: #8a1e14; }
.vr-stars { color: #c48f1a; letter-spacing: 1px; }

.cmp-right { display: flex; align-items: center; gap: 12px; }
.co-list { display: grid; gap: 6px; }
.co-row { display: grid; grid-template-columns: 36px 1fr auto auto; gap: 10px; align-items: center; padding: 7px 10px; border-radius: 4px; background: rgba(90, 55, 15, 0.08); border: 1px solid rgba(90, 55, 15, 0.2); }
.co-i { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; box-shadow: 0 0 0 1px rgba(59, 31, 8, 0.5); }
.co-i .uicon { width: 22px; height: 22px; fill: #1e140a; }
.co-main b { font: 900 15px var(--caps); color: #3b1f08; display: block; }
.co-main small { font-size: 12.5px; color: #6b4320; }
.co-xp { display: block; height: 5px; margin-top: 4px; border-radius: 3px; background: rgba(59, 31, 8, 0.15); overflow: hidden; }
.co-xp i { display: block; height: 100%; background: linear-gradient(90deg, #a87a2c, #f8dc92); }
.co-stars { color: #c48f1a; letter-spacing: 1px; font-size: 15px; }
@media (max-width: 640px) {
  .cmp-co { padding: 6px 8px; font-size: 11px; }
  #sel-panel { width: 240px; }
  .feed-item { font-size: 12px; }
}
#cmp-world-btn[hidden] { display: none; }

/* Film options: style & hook */
.film-opt.style { flex: 1 1 220px; text-align: left; align-items: flex-start; }
.film-opt.style small { display: block; font-size: 12px; line-height: 1.3; margin-top: 3px; white-space: normal; }
.hook-box h3 small { font: italic 12px var(--serif); text-transform: none; letter-spacing: 0; color: #7a5a32; }
.hook-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.hook-chip { padding: 7px 11px; border-radius: 999px; border: 2px solid rgba(90, 55, 15, 0.35); background: rgba(255, 250, 230, 0.5); font: 15px/1.1 "Anton", "Arial Black", sans-serif; letter-spacing: 0.02em; color: #2a1708; cursor: pointer; }
.hook-chip.on { background: #ffd400; border-color: #111; box-shadow: 0 2px 0 #111; }
.hook-input { width: 100%; margin-top: 8px; padding: 9px 12px; border-radius: 4px; border: 2px solid #8a6a2c; background: rgba(255, 250, 230, 0.65); font: 16px "Anton", "Arial Black", sans-serif; letter-spacing: 0.02em; text-transform: uppercase; color: #2a1708; }
@media (max-width: 640px) {
  .cmp-co .co-label { display: none; }
  .cmp-right { gap: 8px; }
  .cmp-titles h2 { font-size: 20px; }
}


/* ════════════════════════════════════════════════════════
   Account screen (v2)
   ════════════════════════════════════════════════════════ */
.gate-card { width: min(430px, 92vw); }
.g-tabs { position: relative; display: grid; grid-template-columns: 1fr 1fr; margin: 14px 0 16px; padding: 4px; border-radius: 999px; overflow: visible;
  background: linear-gradient(180deg, #2a1a0c, #3b2512); border: 1px solid #8a6a2c; box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.55), 0 1px 0 rgba(255, 240, 200, 0.5); }
.g-thumb { position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 4px); border-radius: 999px;
  background: linear-gradient(180deg, #f7dc94, #d6a64a 55%, #b5852c); box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.6);
  transition: transform 0.32s cubic-bezier(.3, .9, .3, 1.15); }
.g-tabs[data-mode="in"] .g-thumb { transform: translateX(100%); }
.g-tabs button { position: relative; z-index: 1; padding: 10px 6px; border: 0; background: none; font: 700 13px var(--caps); letter-spacing: 0.05em; color: #d9c29a; cursor: pointer; transition: color 0.25s; }
.g-tabs button.on { color: #2a1708; }
.g-form { display: grid; gap: 12px; text-align: left; }
.g-field { position: relative; display: block; }
.gate-card label.g-field, .modal-card .hall-list li, .modal-card .wk-board li { mix-blend-mode: normal; }
.g-field input {
  width: 100%; height: 56px; padding: 22px 46px 6px 46px; border-radius: 12px; -webkit-appearance: none; appearance: none; background-clip: padding-box;
  border: 1.5px solid #8a6a2c; background: linear-gradient(180deg, #24160a, #33210f);
  box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.55), 0 1px 0 rgba(255, 240, 200, 0.55);
  font: 18px var(--serif); color: #fff1cf; caret-color: #f2c25a; transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.g-field input:hover { border-color: #c48f36; }
.g-field input:focus { outline: none; border-color: #f2c25a; background: linear-gradient(180deg, #2a1a0c, #3b2613); box-shadow: 0 0 0 3px rgba(242, 194, 90, 0.3), 0 0 18px rgba(242, 194, 90, 0.25), inset 0 3px 8px rgba(0, 0, 0, 0.5); }
.g-field input:-webkit-autofill { -webkit-text-fill-color: #fff1cf; -webkit-box-shadow: inset 0 0 0 40px #2d1c0d; transition: background-color 9999s; }
.g-lab { position: absolute; left: 46px; top: 18px; font: 16px var(--serif); color: #bfa47a; pointer-events: none; transition: transform 0.18s ease, font-size 0.18s ease, color 0.18s ease, top 0.18s ease; }
.g-field input:focus + .g-lab, .g-field input:not(:placeholder-shown) + .g-lab { top: 8px; font: 700 10.5px var(--caps); letter-spacing: 0.1em; text-transform: uppercase; color: #f2c25a; }
.g-ic { position: absolute; left: 15px; top: 17px; width: 21px; height: 21px; fill: #c9a24f; pointer-events: none; transition: fill 0.2s; }
.g-field:focus-within .g-ic { fill: #f2c25a; }
.g-eye { position: absolute; right: 8px; top: 10px; width: 36px; height: 36px; display: grid; place-items: center; border: 0; border-radius: 50%; background: none; cursor: pointer; }
.g-eye svg { width: 21px; height: 21px; fill: #9c8460; transition: fill 0.2s; }
.g-eye:hover svg, .g-eye.on svg { fill: #f2c25a; }
.g-confirm[hidden] { display: none; }
.g-err { display: flex; align-items: center; gap: 7px; min-height: 0; padding: 0 2px; font: italic 14.5px var(--serif); color: #a8261a; }
.g-err:not(:empty)::before { content: '!'; flex: none; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; background: #a8261a; color: #fff; font: 900 12px var(--caps); font-style: normal; }
.g-submit { width: 100%; height: 54px; margin-top: 4px; font-size: 17px; letter-spacing: 0.06em; border-radius: 12px; }
.g-submit:disabled { opacity: 0.75; cursor: wait; }

/* ════════════════════════════════════════════════════════
   Profiles, coat of arms editor, Hall of Marshals
   ════════════════════════════════════════════════════════ */
.arms { display: block; width: 100%; height: 100%; overflow: visible; }
.me-chip { position: absolute; top: max(14px, env(safe-area-inset-top)); left: max(14px, env(safe-area-inset-left)); z-index: 3; display: flex; align-items: center; gap: 10px;
  padding: 5px 16px 5px 6px; border-radius: 999px; cursor: pointer; text-align: left;
  background: linear-gradient(180deg, rgba(42, 26, 12, 0.92), rgba(24, 14, 6, 0.92)); border: 1px solid var(--gold-d); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45); transition: transform 0.2s, border-color 0.2s; }
.me-chip:hover { transform: translateY(-1px); border-color: var(--gold); }
.me-chip[hidden] { display: none; }
.me-arms { width: 34px; height: 41px; flex: none; }
.me-txt b { display: block; font: 700 15px var(--caps); color: var(--gold-b); line-height: 1.1; }
.me-txt small { display: block; font: italic 12.5px var(--serif); color: #d9c29a; }

.pf-loading { display: grid; justify-items: center; gap: 12px; padding: 40px 10px; text-align: center; }
.pf-loading .g-spinner { width: 34px; height: 34px; opacity: 1; }
.pf-hero { display: grid; grid-template-columns: 150px 1fr; gap: 22px; align-items: center; padding: 18px 20px; margin: -6px -6px 14px; border-radius: 6px;
  background: radial-gradient(ellipse at 18% 50%, color-mix(in srgb, var(--pf1) 55%, transparent), transparent 70%), linear-gradient(135deg, rgba(59, 31, 8, 0.1), rgba(59, 31, 8, 0.02));
  border: 1px solid rgba(107, 74, 28, 0.35); }
.pf-arms { width: 150px; height: 180px; filter: drop-shadow(0 10px 14px rgba(40, 20, 5, 0.45)); animation: pf-rise 0.5s cubic-bezier(.2, .9, .3, 1.2); }
@keyframes pf-rise { from { transform: translateY(14px) scale(0.92); opacity: 0; } }
.pf-title { font: 700 12.5px var(--caps); letter-spacing: 0.14em; text-transform: uppercase; color: #8a2a18; }
.pf-name { font: 900 clamp(24px, 4.2vw, 40px) var(--deco); color: #3b1f08; margin: 2px 0 4px; line-height: 1.05; overflow-wrap: anywhere; }
.pf-motto { font: italic 18px var(--serif); color: #5a3a1a; margin-bottom: 6px; }
.pf-meta { font: 13px var(--serif); color: #7a5a32; }
.pf-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 14px; }
.pf-tile { padding: 10px 10px 9px; border-radius: 5px; text-align: center; background: rgba(90, 55, 15, 0.08); border: 1px solid rgba(107, 74, 28, 0.3); }
.pf-tile b { display: block; font: 900 24px var(--caps); color: #3b1f08; line-height: 1.1; }
.pf-tile b i { font-style: normal; font-size: 14px; color: #8a6a44; }
.pf-tile span { display: block; font: 700 11px var(--caps); letter-spacing: 0.08em; text-transform: uppercase; color: #8a5a22; margin-top: 2px; }
.pf-tile small { display: block; font: italic 12px var(--serif); color: #7a5a32; margin-top: 2px; }
.pf-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.pf-cols h3 small { font: italic 12px var(--serif); text-transform: none; letter-spacing: 0; color: #8a6a44; }
.pf-unit, .pf-co { display: grid; grid-template-columns: 36px 1fr auto; gap: 10px; align-items: center; padding: 7px 9px; border-radius: 4px; background: rgba(90, 55, 15, 0.08); margin-bottom: 5px; }
.pf-unit { grid-template-columns: 36px 1fr; }
.pf-co-i { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; box-shadow: 0 0 0 1px rgba(59, 31, 8, 0.5); }
.pf-co-i .uicon { width: 22px; height: 22px; fill: #1e140a; }
.pf-unit b, .pf-co b { display: block; font: 900 14px var(--caps); color: #3b1f08; }
.pf-unit small, .pf-co small { display: block; font-size: 12.5px; color: #6b4320; line-height: 1.3; }
.pf-co-st { color: #c48f1a; letter-spacing: 1px; }
.pf-honours { display: flex; flex-wrap: wrap; gap: 5px; }
.pf-honours span { padding: 4px 10px; border-radius: 999px; font: 700 11.5px var(--caps); color: #3b1f08; background: linear-gradient(180deg, #f7dc94, #d6a64a); border: 1px solid #a8741f; box-shadow: 0 1px 0 rgba(255, 255, 255, 0.5) inset; cursor: help; }
.pf-empty { font: italic 14px var(--serif); color: #8a6a44; }
.pf-wks { display: flex; flex-wrap: wrap; gap: 6px; }
.pf-wk { padding: 6px 10px; border-radius: 4px; background: rgba(106, 61, 154, 0.1); border: 1px solid rgba(106, 61, 154, 0.35); text-align: center; min-width: 74px; }
.pf-wk span { display: block; font: 700 10.5px var(--caps); color: #6a3d9a; letter-spacing: 0.06em; text-transform: uppercase; }
.pf-wk b { display: block; font: 900 20px var(--caps); color: #3b1f08; }
.pf-wk small { font-size: 11.5px; color: #6b4320; }
.pf-wk.gold { background: linear-gradient(180deg, #f7dc94, #d6a64a); border-color: #a8741f; }

.pe { display: grid; grid-template-columns: 210px 1fr; gap: 20px; margin-top: 8px; }
.pe-preview { position: sticky; top: 0; align-self: start; display: grid; justify-items: center; gap: 4px; padding: 14px 10px; border-radius: 6px; background: rgba(90, 55, 15, 0.08); border: 1px solid rgba(107, 74, 28, 0.3); text-align: center; }
.pe-arms { width: 170px; height: 204px; filter: drop-shadow(0 10px 14px rgba(40, 20, 5, 0.45)); }
.pe-name { font: 900 clamp(15px, 2.2vw, 21px) var(--deco); color: #3b1f08; margin-top: 6px; overflow-wrap: anywhere; line-height: 1.15; max-width: 100%; }
.pe-title { font: 700 12px var(--caps); letter-spacing: 0.12em; text-transform: uppercase; color: #8a2a18; }
.pe-motto { font: italic 14px var(--serif); color: #5a3a1a; min-height: 18px; margin-bottom: 6px; }
.pe-controls { display: grid; gap: 11px; }
.pe-row { display: grid; gap: 5px; }
.pe-row > label { font: 700 11px var(--caps); letter-spacing: 0.1em; text-transform: uppercase; color: #6b4320; }
.pe-opts { display: flex; flex-wrap: wrap; gap: 6px; }
.pe-mini { width: 46px; height: 54px; padding: 4px; border-radius: 6px; border: 2px solid transparent; background: rgba(90, 55, 15, 0.08); cursor: pointer; transition: transform 0.15s, border-color 0.15s; }
.pe-mini:hover { transform: translateY(-2px); }
.pe-mini.on { border-color: #8a2a18; background: rgba(255, 220, 130, 0.45); }
.pe-sigils { max-height: 128px; overflow-y: auto; padding: 2px; }
.pe-sig { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 6px; border: 2px solid transparent; background: rgba(90, 55, 15, 0.1); cursor: pointer; }
.pe-sig svg { width: 24px; height: 24px; fill: #3b1f08; }
.pe-sig.on { border-color: #8a2a18; background: rgba(255, 220, 130, 0.5); }
.pe-sw { display: flex; flex-wrap: wrap; gap: 6px; }
.pe-sw button { width: 30px; height: 30px; border-radius: 50%; background: var(--c); border: 2px solid rgba(59, 31, 8, 0.45); box-shadow: inset 0 -3px 5px rgba(0, 0, 0, 0.25), inset 0 2px 3px rgba(255, 255, 255, 0.35); cursor: pointer; transition: transform 0.15s; }
.pe-sw button:hover { transform: scale(1.12); }
.pe-sw button.on { box-shadow: 0 0 0 2px #f6ead0, 0 0 0 5px #8a2a18, inset 0 -3px 5px rgba(0, 0, 0, 0.25); }
.pe-controls select, .pe-controls input { width: 100%; padding: 9px 11px; border-radius: 8px; border: 1.5px solid rgba(107, 74, 28, 0.55); background: linear-gradient(180deg, #fffaf0, #f3e3bd); font: 15px var(--serif); color: #2a1708; }
.pe-controls select:focus, .pe-controls input:focus { outline: none; border-color: #c48f36; box-shadow: 0 0 0 3px rgba(227, 185, 95, 0.3); }
.pe-err { min-height: 0; font: italic 14px var(--serif); color: #a8261a; text-align: center; }

.hall-tabs { flex-wrap: wrap; }
.hall-list, .wk-board { list-style: none; padding: 0; }
.hall-list { margin: 8px 0 10px; display: grid; gap: 5px; max-height: min(56vh, 520px); overflow-y: auto; }
.hall-list li { display: grid; grid-template-columns: 30px 34px 1fr auto; gap: 10px; align-items: center; padding: 6px 12px; border-radius: 5px; background: rgba(90, 55, 15, 0.08); border: 1px solid transparent; cursor: pointer; transition: background 0.15s, border-color 0.15s, transform 0.15s; }
.hall-list li:hover, .hall-list li:focus-visible, .wk-board li.link:hover { background: rgba(255, 220, 130, 0.35); border-color: rgba(168, 116, 31, 0.6); transform: translateX(3px); outline: none; }
.hall-list li.top { background: linear-gradient(90deg, rgba(247, 220, 148, 0.55), rgba(247, 220, 148, 0.1)); }
.hall-list li.mine { border-color: #8a2a18; }
.hall-list li.muted { display: block; cursor: default; font-style: italic; color: #7a5a32; transform: none; }
.hr { font: 900 16px var(--caps); color: #8a5a0c; text-align: center; }
.h-arms, .w-arms { width: 30px; height: 36px; }
.hn b { display: block; font: 900 15px var(--caps); color: #3b1f08; }
.hn small { display: block; font: italic 12.5px var(--serif); color: #8a2a18; }
.hv { font: 900 16px var(--caps); color: #3b1f08; text-align: right; }
.hv i { font: italic 12px var(--serif); color: #7a5a32; }
.wk-board li { grid-template-columns: 26px 26px 1fr auto 64px; }
.wk-board li.link { cursor: pointer; transition: background 0.15s, transform 0.15s; }
.w-arms { width: 24px; height: 29px; }
@media (max-width: 640px) {
  .pf-hero { grid-template-columns: 96px 1fr; gap: 14px; padding: 14px; }
  .pf-arms { width: 96px; height: 116px; }
  .pf-tiles { grid-template-columns: 1fr 1fr; }
  .pf-cols { grid-template-columns: 1fr; gap: 6px; }
  .pe { grid-template-columns: 1fr; }
  .pe-preview { position: static; grid-template-columns: 90px 1fr; text-align: left; justify-items: start; column-gap: 12px; }
  .pe-arms { width: 90px; height: 108px; grid-row: span 4; }
  .pe-name { margin-top: 0; }
  .me-txt small { display: none; }
  .me-chip { padding-right: 12px; }
  .me-arms { width: 28px; height: 34px; }
}

/* ════════════════════════════════════════════════════════
   Gold coins, Royal Armoury, skins
   ════════════════════════════════════════════════════════ */
.coin { display: inline-block; width: 1.05em; height: 1.05em; vertical-align: -0.17em; filter: drop-shadow(0 1px 1px rgba(60, 35, 0, 0.45)); flex: none; }
.btn-armoury { background: linear-gradient(180deg, #7a5410, #4a3006); color: #ffe9a8; border-color: #f2c442; box-shadow: 0 0 14px rgba(242, 196, 66, 0.35), inset 0 1px 0 rgba(255, 240, 190, 0.35); }
.btn-armoury small { color: #ffd96a; font-weight: 700; display: inline-flex; align-items: center; gap: 4px; justify-content: center; }
.me-coins { display: inline-flex; align-items: center; gap: 4px; margin-left: 4px; padding: 3px 9px 3px 6px; border-radius: 999px; background: rgba(242, 196, 66, 0.14); border: 1px solid rgba(242, 196, 66, 0.5); font: 900 14px var(--caps); color: #ffd96a; }
.me-coins .coin { width: 17px; height: 17px; }

.ar-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-right: 54px; }
.ar-head h2 { text-align: left !important; margin: 0; }
.ar-kicker { font: 700 11.5px var(--caps); letter-spacing: 0.14em; text-transform: uppercase; color: #8a5a0c; }
.ar-purse { display: flex; align-items: center; gap: 8px; padding: 8px 16px 8px 10px; border-radius: 999px; background: linear-gradient(180deg, #3b2610, #22150a); border: 1.5px solid #c99a2e; box-shadow: 0 4px 14px rgba(60, 35, 0, 0.4), 0 0 16px rgba(242, 196, 66, 0.25); mix-blend-mode: normal !important; }
.ar-purse .coin { width: 30px; height: 30px; }
.ar-purse b { font: 900 24px var(--caps); color: #ffd96a; }
.ar-purse small { font: italic 12.5px var(--serif); color: #d9c29a; }
.ar-tabs { display: flex; gap: 6px; margin: 14px 0 12px; border-bottom: 2px solid rgba(107, 74, 28, 0.25); }
.ar-tabs button { padding: 9px 16px; border: 0; border-radius: 6px 6px 0 0; background: none; font: 700 14px var(--caps); letter-spacing: 0.05em; color: #7a5a32; cursor: pointer; position: relative; top: 2px; border-bottom: 3px solid transparent; }
.ar-tabs button:hover { color: #3b1f08; }
.ar-tabs button.on { color: #3b1f08; border-bottom-color: #b8861f; background: rgba(242, 196, 66, 0.16); }
.ar-tools { display: flex; gap: 8px; align-items: center; }
.ar-search { flex: 1; position: relative; }
.ar-search svg { position: absolute; left: 12px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); fill: #c9a24f; pointer-events: none; }
.ar-search input, .ar-tools select { width: 100%; height: 42px; padding: 0 12px 0 38px; border-radius: 10px; border: 1.5px solid #8a6a2c; background: linear-gradient(180deg, #24160a, #33210f); color: #fff1cf; font: 16px var(--serif); box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.5); -webkit-appearance: none; appearance: none; }
.ar-tools select { width: auto; min-width: 190px; padding: 0 34px 0 12px; cursor: pointer; background-image: linear-gradient(45deg, transparent 50%, #c9a24f 50%), linear-gradient(135deg, #c9a24f 50%, transparent 50%), linear-gradient(180deg, #24160a, #33210f); background-position: right 16px center, right 11px center, 0 0; background-size: 5px 5px, 5px 5px, 100% 100%; background-repeat: no-repeat; }
.ar-search input:focus, .ar-tools select:focus { outline: none; border-color: #f2c25a; box-shadow: 0 0 0 3px rgba(242, 194, 90, 0.28), inset 0 2px 6px rgba(0, 0, 0, 0.5); }
.ar-search input::placeholder { color: #a08a68; font-style: italic; }
.ar-filters { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin: 10px 0 6px; }
.ar-chips, .ar-seg { display: flex; flex-wrap: wrap; gap: 5px; }
.ar-chips button, .ar-seg button { padding: 6px 12px; border-radius: 999px; border: 1.5px solid rgba(107, 74, 28, 0.45); background: rgba(255, 246, 220, 0.35); font: 700 12px var(--caps); letter-spacing: 0.03em; color: #5a3a1a; cursor: pointer; transition: background 0.15s, color 0.15s; }
.ar-seg { padding: 3px; border-radius: 999px; background: linear-gradient(180deg, #2a1a0c, #3b2512); border: 1px solid #8a6a2c; gap: 2px; }
.ar-seg button { border: 0; background: none; color: #d9c29a; }
.ar-chips button.on { background: #3b1f08; color: #ffe9a8; border-color: #3b1f08; }
.ar-seg button.on { background: linear-gradient(180deg, #f7dc94, #d6a64a); color: #2a1708; }
.ar-count { font: italic 13px var(--serif); color: #6b4320; margin: 4px 2px 8px; }
.ar-count b { font-style: normal; font-family: var(--caps); }
.ar-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 12px; max-height: min(52vh, 560px); overflow-y: auto; padding: 4px 4px 10px; }
.ar-empty { grid-column: 1 / -1; padding: 30px; text-align: center; font: italic 15px var(--serif); color: #7a5a32; }
.sk-card { --rc: #c99a2e; position: relative; display: grid; gap: 3px; padding: 8px 8px 10px; border-radius: 12px; text-align: left; cursor: pointer;
  background: linear-gradient(180deg, #2c1c0d, #1d1208); border: 1.5px solid color-mix(in srgb, var(--rc) 70%, #3b2512);
  box-shadow: 0 6px 14px rgba(40, 20, 5, 0.35); transition: transform 0.18s cubic-bezier(.3, .9, .3, 1.3), box-shadow 0.18s, border-color 0.18s; mix-blend-mode: normal !important; }
.sk-card:hover, .sk-card:focus-visible { transform: translateY(-4px); border-color: var(--rc); box-shadow: 0 12px 22px rgba(40, 20, 5, 0.45), 0 0 18px color-mix(in srgb, var(--rc) 45%, transparent); outline: none; }
.sk-card.r-noble { --rc: #e3a63a; }
.sk-card.r-royal { --rc: #ffd75a; }
.sk-card.equipped { border-color: #8fd36a; box-shadow: 0 0 0 2px rgba(143, 211, 106, 0.5), 0 8px 18px rgba(40, 20, 5, 0.4); }
.sk-art { position: relative; display: block; aspect-ratio: 1; border-radius: 9px; overflow: hidden; background: radial-gradient(circle at 50% 42%, color-mix(in srgb, var(--rc) 55%, #3b2512) 0%, #24160a 68%); }
.sk-art img { position: absolute; inset: 4%; width: 92%; height: 92%; object-fit: contain; filter: drop-shadow(0 8px 8px rgba(0, 0, 0, 0.5)); transition: transform 0.25s; }
.sk-card:hover .sk-art img { transform: scale(1.06) rotate(-1deg); }
.sk-rays { position: absolute; inset: -30%; background: repeating-conic-gradient(from 0deg, rgba(255, 230, 150, 0.12) 0 8deg, transparent 8deg 24deg); animation: sk-spin 24s linear infinite; }
@keyframes sk-spin { to { transform: rotate(360deg); } }
.sk-rar { position: absolute; top: 7px; left: 7px; padding: 2px 8px; border-radius: 999px; font: 900 9.5px var(--caps); letter-spacing: 0.12em; text-transform: uppercase; color: #2a1708; background: var(--rc); }
.sk-eq { position: absolute; top: 7px; right: 7px; padding: 2px 8px; border-radius: 999px; font: 900 9.5px var(--caps); letter-spacing: 0.08em; text-transform: uppercase; color: #12300a; background: #9fe07e; }
.sk-name { font: 900 14px var(--caps); color: #ffe9a8; margin-top: 4px; line-height: 1.15; }
.sk-meta { display: flex; align-items: center; gap: 6px; font: 12px var(--serif); color: #cdb38a; }
.sk-meta i { width: 8px; height: 8px; border-radius: 50%; }
.sk-foot { margin-top: 3px; }
.sk-price { display: inline-flex; align-items: center; gap: 5px; font: 900 16px var(--caps); color: #ffd96a; }
.sk-price .coin { width: 19px; height: 19px; }
.sk-price.poor { color: #b9a07a; }
.sk-state { font: 700 12px var(--caps); color: #d9c29a; letter-spacing: 0.04em; }
.sk-state.on { color: #9fe07e; }
.sk-dot { width: 32px; height: 32px; border-radius: 50%; display: inline-grid; place-items: center; flex: none; box-shadow: 0 0 0 1px rgba(59, 31, 8, 0.5); }
.sk-dot .uicon { width: 19px; height: 19px; fill: #1e140a; }

.ar-back { margin-bottom: 8px; padding: 4px 0; border: 0; background: none; font: 700 13px var(--caps); color: #8a5a0c; cursor: pointer; }
.ar-back:hover { color: #3b1f08; }
.skd { --rc: #c99a2e; display: grid; grid-template-columns: minmax(240px, 1fr) 1fr; gap: 20px; align-items: start; }
.skd.r-noble { --rc: #e3a63a; } .skd.r-royal { --rc: #ffd75a; }
.skd-stage { position: relative; aspect-ratio: 1; border-radius: 14px; overflow: hidden; background: radial-gradient(circle at 50% 42%, color-mix(in srgb, var(--rc) 60%, #3b2512) 0%, #1d1208 70%); border: 2px solid var(--rc); box-shadow: 0 10px 26px rgba(40, 20, 5, 0.5), 0 0 26px color-mix(in srgb, var(--rc) 35%, transparent); }
.skd-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.skd-stage.bought { animation: skd-glow 1.2s ease; }
@keyframes skd-glow { 30% { box-shadow: 0 0 0 6px rgba(255, 220, 120, 0.6), 0 0 60px rgba(255, 210, 90, 0.9); } }
.skd-toggle { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); display: flex; padding: 3px; border-radius: 999px; background: rgba(20, 12, 6, 0.8); border: 1px solid #8a6a2c; }
.skd-toggle button { padding: 6px 14px; border: 0; border-radius: 999px; background: none; font: 700 12px var(--caps); color: #d9c29a; cursor: pointer; }
.skd-toggle button.on { background: linear-gradient(180deg, #f7dc94, #d6a64a); color: #2a1708; }
.skd-rar { font: 900 11px var(--caps); letter-spacing: 0.14em; text-transform: uppercase; color: #8a5a0c; }
.skd-info h3 { font: 900 clamp(22px, 3vw, 30px) var(--deco) !important; color: #3b1f08 !important; margin: 2px 0 8px !important; text-transform: none !important; letter-spacing: 0 !important; }
.skd-unit { display: flex; align-items: center; gap: 9px; font: 700 13px var(--caps); color: #5a3a1a; }
.skd-info p { margin: 10px 0; font-size: 15px; line-height: 1.45; }
.skd-perks { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 5px; }
.skd-perks li { padding-left: 22px; position: relative; font-size: 14px; color: #4a2e14; }
.skd-perks li::before { content: '✦'; position: absolute; left: 3px; color: #b8861f; }
.skd-price { display: flex; align-items: center; gap: 7px; font: 13px var(--serif); color: #6b4320; margin-bottom: 10px; }
.skd-price .coin { width: 26px; height: 26px; }
.skd-price b { font: 900 26px var(--caps); color: #3b1f08; }
.skd-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.skd-actions .btn .coin { width: 20px; height: 20px; }
.skd-actions .btn[disabled] { opacity: 0.55; cursor: not-allowed; filter: grayscale(0.4); }
.skd-badge { font: 700 13px var(--caps); color: #2e6a1c; }
.skd-badge.muted { color: #7a5a32; font-style: italic; font-family: var(--serif); font-weight: 400; }

.ar-note { font: italic 14px var(--serif); color: #5a3a1a; margin: 2px 0 10px; }
.lo-list { display: grid; gap: 7px; max-height: min(54vh, 580px); overflow-y: auto; padding: 2px; }
.lo-row { display: grid; grid-template-columns: 190px 1fr; gap: 12px; align-items: center; padding: 8px 10px; border-radius: 8px; background: rgba(90, 55, 15, 0.08); border: 1px solid rgba(107, 74, 28, 0.25); }
.lo-unit { display: flex; align-items: center; gap: 10px; }
.lo-unit b { display: block; font: 900 14px var(--caps); color: #3b1f08; }
.lo-unit small { font: italic 12px var(--serif); color: #7a5a32; }
.lo-opts { display: flex; gap: 8px; flex-wrap: wrap; }
.lo-opt { position: relative; width: 92px; padding: 4px 4px 6px; border-radius: 10px; border: 2px solid rgba(107, 74, 28, 0.35); background: radial-gradient(circle at 50% 38%, #4a3214, #1d1208 72%); cursor: pointer; display: grid; justify-items: center; gap: 2px; transition: transform 0.15s, border-color 0.15s; mix-blend-mode: normal !important; }
.lo-opt:hover { transform: translateY(-2px); border-color: #c99a2e; }
.lo-opt img { width: 76px; height: 76px; object-fit: contain; }
.lo-opt span { font: 700 11.5px var(--caps); color: #ffe9a8; }
.lo-opt.on { border-color: #8fd36a; box-shadow: 0 0 0 2px rgba(143, 211, 106, 0.45), 0 0 14px rgba(143, 211, 106, 0.3); }
.lo-opt i { position: absolute; top: 4px; right: 6px; font: 900 13px var(--caps); font-style: normal; color: #9fe07e; }
.lo-opt.locked img { filter: grayscale(0.75) brightness(0.6); }
.lo-opt em { position: absolute; top: 4px; left: 4px; display: inline-flex; align-items: center; gap: 2px; padding: 1px 6px; border-radius: 999px; background: rgba(20, 12, 6, 0.85); font: 900 11px var(--caps); font-style: normal; color: #ffd96a; }
.lo-opt em .coin { width: 12px; height: 12px; }

.earn-hero { display: grid; grid-template-columns: 90px 1fr; gap: 16px; align-items: center; margin-bottom: 12px; }
.earn-hero .coin.big { width: 86px; height: 86px; animation: coin-flip 3.2s ease-in-out infinite; }
@keyframes coin-flip { 0%, 100% { transform: rotateY(0) translateY(0); } 50% { transform: rotateY(180deg) translateY(-6px); } }
.earn-hero h3 { margin: 0 0 4px !important; }
.earn-table { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 6px; margin-bottom: 12px; }
.earn-row { display: flex; justify-content: space-between; align-items: center; padding: 9px 12px; border-radius: 8px; background: rgba(90, 55, 15, 0.08); border: 1px solid rgba(107, 74, 28, 0.25); font: 700 13px var(--caps); color: #5a3a1a; }
.earn-row b { display: inline-flex; align-items: center; gap: 5px; font-size: 17px; color: #3b1f08; }
.earn-row.podium { background: linear-gradient(90deg, rgba(247, 220, 148, 0.6), rgba(247, 220, 148, 0.15)); border-color: #b8861f; }

.wk-prizes { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 12px; padding: 8px 10px; border-radius: 8px; background: linear-gradient(90deg, rgba(247, 220, 148, 0.45), rgba(247, 220, 148, 0.08)); border: 1px solid rgba(184, 134, 31, 0.5); }
.wk-prize-h { display: inline-flex; align-items: center; gap: 5px; font: 900 12px var(--caps); letter-spacing: 0.08em; text-transform: uppercase; color: #8a5a0c; margin-right: 4px; }
.wk-prize { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; background: rgba(59, 31, 8, 0.85); font: 700 12px var(--caps); color: #ffe9a8; mix-blend-mode: normal !important; }
.wk-prize b { color: #d9c29a; font-weight: 700; margin-right: 2px; }

.pf-skins { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 6px; }
.pf-skin { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: rgba(90, 55, 15, 0.12); opacity: 0.4; }
.pf-skin .uicon { width: 17px; height: 17px; fill: #5a3a1a; }
.pf-skin.has { opacity: 1; background: radial-gradient(circle at 35% 30%, #fff1b0, #f0c03e 55%, #a8761a); box-shadow: 0 0 8px rgba(242, 196, 66, 0.6); }
.pf-skin.has .uicon { fill: #3b2208; }

.spoils { text-align: center; }
.spoils-coins { position: relative; height: 84px; margin-bottom: 4px; }
.spoils-coins .coin { position: absolute; top: 10px; width: 62px; height: 62px; animation: spoils-drop 0.7s cubic-bezier(.2, .9, .3, 1.3) both; }
.spoils-coins .c1 { left: calc(50% - 82px); animation-delay: 0.05s; transform: rotate(-14deg); }
.spoils-coins .c2 { left: calc(50% - 31px); top: 0; width: 70px; height: 70px; animation-delay: 0.2s; }
.spoils-coins .c3 { left: calc(50% + 24px); animation-delay: 0.35s; transform: rotate(12deg); }
@keyframes spoils-drop { from { opacity: 0; transform: translateY(-40px) scale(0.6); } }
.spoils-list { display: grid; gap: 5px; margin: 14px auto 10px; max-width: 360px; }
.spoils-row { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center; padding: 8px 12px; border-radius: 8px; background: rgba(90, 55, 15, 0.08); font: 700 14px var(--caps); color: #5a3a1a; }
.spoils-row b { font-size: 18px; color: #3b1f08; }
.spoils-row em { display: inline-flex; align-items: center; gap: 4px; font-style: normal; color: #8a5a0c; }
.spoils-row.podium { background: linear-gradient(90deg, rgba(247, 220, 148, 0.7), rgba(247, 220, 148, 0.2)); }
.spoils-total { display: inline-flex; align-items: center; gap: 8px; font: 900 30px var(--caps); color: #3b1f08; }
.spoils-total .coin { width: 34px; height: 34px; }
.spoils-total small { font: italic 14px var(--serif); color: #6b4320; }

.ucard.gilded .uc-card { box-shadow: inset 0 0 0 2px #f2c442, 0 0 14px rgba(242, 196, 66, 0.55), 0 6px 14px rgba(0, 0, 0, 0.5); }
.ucard.gilded .uc-crest { filter: drop-shadow(0 0 6px rgba(255, 210, 90, 0.9)) sepia(0.6) saturate(2.2) hue-rotate(-8deg) brightness(1.15); }

@media (max-width: 640px) {
  .ar-head { flex-wrap: wrap; padding-right: 26px; }
  .ar-tools { flex-wrap: wrap; }
  .ar-tools select { width: 100%; }
  .ar-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .skd { grid-template-columns: 1fr; }
  .lo-row { grid-template-columns: 1fr; }
  .earn-hero { grid-template-columns: 60px 1fr; }
  .earn-hero .coin.big { width: 58px; height: 58px; }
}
@media (prefers-reduced-motion: reduce) { .sk-rays, .earn-hero .coin.big { animation: none; } }
/* light text on dark pieces inside parchment must not soak into the paper */
.modal-card :is(.ar-purse, .sk-card, .lo-opt, .wk-prize, .skd-toggle, .ar-seg, .ar-chips, .skd-stage, .ar-search, .ar-tools) * { mix-blend-mode: normal !important; }

/* ════════════════════════════════════════════════════════
   Royal Armoury v2: full-screen treasury
   ════════════════════════════════════════════════════════ */
#armoury { --g1: #f7dc94; --g2: #e8b84a; --g3: #b8861f; --ink: #fff1cf; --mut: #b9a27c; --line: rgba(232, 192, 106, 0.2);
  position: fixed; inset: 0; z-index: 15; display: none; color: var(--ink); font-family: var(--serif); }
#armoury.active { display: flex; flex-direction: column; animation: av-in 0.35s ease both; }
@keyframes av-in { from { opacity: 0; } }
.r-gilded { --rc: #e8b84a; --rc2: #8a5a12; }
.r-noble { --rc: #5aa8ff; --rc2: #1d4f9a; }
.r-royal { --rc: #c08bff; --rc2: #5b2a9a; }
.r-plain { --rc: #9c8460; --rc2: #4a3a24; }

.av-bg { position: absolute; inset: 0; z-index: -1; overflow: hidden;
  background: radial-gradient(ellipse 70% 50% at 50% -8%, rgba(240, 190, 90, 0.2), transparent 60%),
    radial-gradient(ellipse 60% 60% at 100% 110%, rgba(140, 70, 20, 0.28), transparent 60%),
    radial-gradient(ellipse 50% 50% at -10% 80%, rgba(90, 50, 120, 0.18), transparent 60%),
    repeating-linear-gradient(45deg, rgba(232, 192, 106, 0.025) 0 2px, transparent 2px 26px),
    repeating-linear-gradient(-45deg, rgba(232, 192, 106, 0.025) 0 2px, transparent 2px 26px),
    linear-gradient(180deg, #120c07, #090604); }
.av-bg i { position: absolute; left: 0; top: 100%; width: 3px; height: 3px; border-radius: 50%; background: #ffd77a;
  box-shadow: 8vw -10vh 0 #ffd77a, 21vw -40vh 0 #ffcf6a, 33vw -18vh 0 #fff0b0, 47vw -62vh 0 #ffd77a, 58vw -30vh 0 #ffcf6a, 71vw -75vh 0 #fff0b0, 84vw -22vh 0 #ffd77a, 93vw -55vh 0 #ffcf6a, 14vw -85vh 0 #ffd77a, 66vw -95vh 0 #fff0b0;
  opacity: 0.5; animation: av-dust 18s linear infinite; filter: blur(0.4px); }
.av-bg i:nth-child(2) { animation-duration: 26s; animation-delay: -8s; transform: scale(0.7); opacity: 0.35; left: 4vw; }
.av-bg i:nth-child(3) { animation-duration: 34s; animation-delay: -20s; opacity: 0.25; left: -3vw; }
@keyframes av-dust { to { transform: translateY(-120vh); } }

.av-top { display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 20px;
  padding: max(14px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-right)) 14px max(24px, env(safe-area-inset-left)); }
.av-back { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; border: 1px solid var(--line); background: rgba(255, 240, 200, 0.05); transition: background 0.2s, border-color 0.2s; }
.av-back svg { width: 22px; height: 22px; fill: var(--g1); }
.av-back:hover { background: rgba(255, 220, 140, 0.12); border-color: var(--g2); }
.av-kicker { display: block; font: 700 11px var(--caps); letter-spacing: 0.22em; text-transform: uppercase; color: var(--g3); }
.av-brand h1 { margin: 0; font: 900 clamp(26px, 3.2vw, 40px) var(--deco); line-height: 1.05; background: linear-gradient(180deg, #fff6d4 10%, #f2c25a 55%, #b8861f 95%); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 2px 10px rgba(240, 180, 70, 0.25)); }
.av-tabs { display: flex; padding: 4px; gap: 2px; border-radius: 999px; background: rgba(0, 0, 0, 0.35); border: 1px solid var(--line); box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.5); }
.av-tabs button { padding: 10px 20px; border: 0; border-radius: 999px; background: none; cursor: pointer; font: 700 13px var(--caps); letter-spacing: 0.08em; text-transform: uppercase; color: var(--mut); transition: color 0.2s, background 0.2s; white-space: nowrap; }
.av-tabs button:hover { color: var(--ink); }
.av-tabs button.on { color: #2a1708; background: linear-gradient(180deg, var(--g1), var(--g2) 60%, var(--g3)); box-shadow: 0 2px 12px rgba(240, 180, 70, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.6); }
.av-purse { display: flex; align-items: center; gap: 10px; padding: 7px 18px 7px 8px; border-radius: 999px; cursor: pointer; text-align: left;
  border: 1px solid rgba(242, 196, 66, 0.55); background: linear-gradient(180deg, rgba(70, 45, 12, 0.9), rgba(30, 18, 6, 0.9)); box-shadow: 0 0 22px rgba(242, 196, 66, 0.2), inset 0 1px 0 rgba(255, 230, 160, 0.2); }
.av-purse .coin { width: 38px; height: 38px; animation: av-coinspin 6s ease-in-out infinite; }
@keyframes av-coinspin { 0%, 80%, 100% { transform: rotateY(0); } 90% { transform: rotateY(180deg); } }
.av-purse b { display: block; font: 900 24px var(--caps); line-height: 1; color: var(--g1); }
.av-purse b.bump { animation: av-bump 0.5s cubic-bezier(.2, .9, .3, 1.4); }
@keyframes av-bump { 40% { transform: scale(1.35); color: #fff; } }
.av-purse small { font: italic 12px var(--serif); color: var(--mut); }

.av-main { flex: 1; min-height: 0; display: grid; gap: 18px; padding: 4px max(24px, env(safe-area-inset-right)) max(22px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left)); }
.av-main.shop { grid-template-columns: 250px minmax(0, 1fr) clamp(320px, 30vw, 430px); }
.av-main.loadout { grid-template-columns: minmax(0, 1fr) clamp(320px, 30vw, 430px); }
.av-main.earn { display: flex; justify-content: center; }
.av-side, .av-center, .av-detail, .av-earn { min-height: 0; border-radius: 18px; border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(38, 27, 15, 0.86), rgba(18, 12, 7, 0.9)); box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 230, 170, 0.08); backdrop-filter: blur(6px); }

/* custom scrollbars */
.av-scroll { overflow-y: auto; scrollbar-width: thin; scrollbar-color: #b8861f rgba(0, 0, 0, 0.25); }
.av-scroll::-webkit-scrollbar { width: 10px; height: 10px; }
.av-scroll::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.25); border-radius: 10px; margin: 10px; }
.av-scroll::-webkit-scrollbar-thumb { border-radius: 10px; border: 2px solid transparent; background: linear-gradient(180deg, #f2c25a, #8a5a12) padding-box; }
.av-scroll::-webkit-scrollbar-thumb:hover { background: linear-gradient(180deg, #ffe08a, #b8861f) padding-box; }

/* sidebar */
.av-side { padding: 16px; display: flex; flex-direction: column; gap: 18px; }
.av-search { position: relative; display: block; }
.av-search svg { position: absolute; left: 13px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); fill: var(--g3); pointer-events: none; }
.av-search input { width: 100%; height: 44px; padding: 0 14px 0 40px; border-radius: 12px; border: 1px solid var(--line); background: rgba(0, 0, 0, 0.35); color: var(--ink); font: 16px var(--serif); box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.4); transition: border-color 0.2s, box-shadow 0.2s; }
.av-search input::placeholder { color: #8a7656; font-style: italic; }
.av-search input:focus { outline: none; border-color: var(--g2); box-shadow: 0 0 0 3px rgba(232, 184, 74, 0.2), inset 0 2px 6px rgba(0, 0, 0, 0.4); }
.av-sec h4 { margin: 0 0 8px; font: 700 10.5px var(--caps); letter-spacing: 0.2em; text-transform: uppercase; color: var(--g3); }
.av-progress { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; background: rgba(0, 0, 0, 0.28); }
.av-progress svg { width: 56px; height: 56px; transform: rotate(-90deg); flex: none; }
.av-progress circle { fill: none; stroke-width: 7; }
.av-progress .trk { stroke: rgba(255, 255, 255, 0.08); }
.av-progress .val { stroke: url(#cg-fill); stroke: var(--g2); stroke-linecap: round; transition: stroke-dashoffset 0.8s cubic-bezier(.3, .8, .3, 1); filter: drop-shadow(0 0 4px rgba(240, 190, 80, 0.6)); }
.av-progress b { display: block; font: 900 22px var(--caps); color: var(--g1); line-height: 1; }
.av-progress b small { font-size: 14px; color: var(--mut); }
.av-progress span { font: italic 12.5px var(--serif); color: var(--mut); }
.av-seg { display: grid; grid-template-columns: repeat(3, 1fr); padding: 3px; gap: 2px; border-radius: 12px; background: rgba(0, 0, 0, 0.35); border: 1px solid var(--line); }
.av-seg button { display: grid; gap: 1px; justify-items: center; padding: 7px 2px; border: 0; border-radius: 9px; background: none; cursor: pointer; font: 700 11.5px var(--caps); color: var(--mut); transition: background 0.2s, color 0.2s; }
.av-seg button em { font: 700 10px var(--caps); font-style: normal; opacity: 0.7; }
.av-seg button.on { background: linear-gradient(180deg, var(--g1), var(--g2) 60%, var(--g3)); color: #2a1708; }
.av-list { display: grid; gap: 3px; }
.av-list button { display: grid; grid-template-columns: 12px 1fr auto; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; border: 1px solid transparent; background: none; cursor: pointer; text-align: left; font: 15px var(--serif); color: var(--ink); transition: background 0.15s, border-color 0.15s; }
.av-list button i { width: 10px; height: 10px; border-radius: 3px; transform: rotate(45deg); box-shadow: 0 0 6px rgba(0, 0, 0, 0.6); }
.av-list button em { min-width: 26px; padding: 1px 7px; border-radius: 999px; text-align: center; font: 700 11px var(--caps); font-style: normal; color: var(--mut); background: rgba(255, 255, 255, 0.06); }
.av-list button:hover:not(:disabled) { background: rgba(255, 230, 170, 0.06); }
.av-list button.on { background: rgba(232, 184, 74, 0.14); border-color: rgba(232, 184, 74, 0.45); }
.av-list button.on em { background: var(--g2); color: #2a1708; }
.av-list button:disabled { opacity: 0.35; cursor: default; }
.av-rars { display: flex; flex-wrap: wrap; gap: 6px; }
.av-rar-btn { display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: 999px; cursor: pointer; border: 1px solid color-mix(in srgb, var(--rc) 40%, transparent); background: rgba(0, 0, 0, 0.3); font: 700 12px var(--caps); color: var(--mut); transition: all 0.15s; }
.av-rar-btn i { width: 9px; height: 9px; transform: rotate(45deg); background: var(--rc); box-shadow: 0 0 8px var(--rc); }
.av-rar-btn.on { color: #fff; background: color-mix(in srgb, var(--rc) 28%, transparent); border-color: var(--rc); box-shadow: 0 0 14px color-mix(in srgb, var(--rc) 35%, transparent); }
.av-select { position: relative; }
.av-select::after { content: ''; position: absolute; right: 14px; top: 50%; width: 8px; height: 8px; border-right: 2px solid var(--g2); border-bottom: 2px solid var(--g2); transform: translateY(-70%) rotate(45deg); pointer-events: none; }
.av-select select { width: 100%; height: 42px; padding: 0 36px 0 12px; border-radius: 12px; border: 1px solid var(--line); background: rgba(0, 0, 0, 0.35); color: var(--ink); font: 15px var(--serif); -webkit-appearance: none; appearance: none; cursor: pointer; }
.av-select select:focus { outline: none; border-color: var(--g2); }
.av-select option { background: #1d140a; color: var(--ink); }

/* centre */
.av-center { display: flex; flex-direction: column; padding: 16px 6px 6px 18px; }
.av-center-head { display: flex; align-items: baseline; gap: 12px; padding: 0 12px 12px 0; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.av-center-head h2 { margin: 0; font: 900 22px var(--caps); letter-spacing: 0.04em; color: var(--ink); }
.av-count { font: italic 14px var(--serif); color: var(--mut); }
.av-grid { flex: 1; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); align-content: start; gap: 16px; padding: 12px 12px 16px 2px; }
.av-empty { grid-column: 1 / -1; display: grid; gap: 4px; justify-items: center; padding: 60px 20px; color: var(--mut); }
.av-empty b { font: 900 18px var(--caps); color: var(--ink); }
.av-card { --rc: #e8b84a; position: relative; display: flex; flex-direction: column; padding: 0; border-radius: 16px; overflow: hidden; cursor: pointer; text-align: left;
  background: linear-gradient(180deg, #241910, #130c06); border: 1px solid rgba(255, 255, 255, 0.07);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.45); transition: transform 0.25s cubic-bezier(.2, .9, .3, 1.2), box-shadow 0.25s, border-color 0.25s; }
.av-card::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 3px; z-index: 2; background: linear-gradient(90deg, transparent, var(--rc), transparent); }
.av-card:hover, .av-card:focus-visible { transform: translateY(-6px); border-color: color-mix(in srgb, var(--rc) 70%, transparent); box-shadow: 0 18px 30px rgba(0, 0, 0, 0.55), 0 0 26px color-mix(in srgb, var(--rc) 30%, transparent); outline: none; }
.av-card.sel { border-color: var(--rc); box-shadow: 0 0 0 2px var(--rc), 0 18px 30px rgba(0, 0, 0, 0.55), 0 0 30px color-mix(in srgb, var(--rc) 40%, transparent); }
.av-card-art { position: relative; display: block; aspect-ratio: 1 / 1; overflow: hidden;
  background: radial-gradient(circle at 50% 62%, color-mix(in srgb, var(--rc) 50%, transparent) 0%, transparent 62%), linear-gradient(180deg, #2c1f12, #100a05); }
.av-card-art::after { content: ''; position: absolute; left: 22%; right: 22%; bottom: 10%; height: 9%; border-radius: 50%; background: radial-gradient(ellipse, rgba(0, 0, 0, 0.55), transparent 70%); }
.av-card-art img { position: absolute; inset: 6% 6% 9%; width: 88%; height: 85%; object-fit: contain; z-index: 1; filter: drop-shadow(0 10px 10px rgba(0, 0, 0, 0.5)); transition: transform 0.35s cubic-bezier(.2, .9, .3, 1.2); }
.av-card:hover .av-card-art img { transform: scale(1.08) translateY(-2%); }
.av-rays { position: absolute; inset: -40%; background: repeating-conic-gradient(from 0deg, color-mix(in srgb, var(--rc) 16%, transparent) 0 7deg, transparent 7deg 22deg); animation: sk-spin 30s linear infinite; opacity: 0.7; }
.av-tag { position: absolute; top: 10px; right: 10px; z-index: 2; padding: 3px 9px; border-radius: 999px; font: 900 10px var(--caps); letter-spacing: 0.1em; text-transform: uppercase; }
.av-tag.eq { background: #8fe06a; color: #10300a; box-shadow: 0 0 12px rgba(143, 224, 106, 0.5); }
.av-tag.own { background: rgba(0, 0, 0, 0.6); color: var(--ink); border: 1px solid rgba(255, 255, 255, 0.2); }
.av-card-body { display: grid; gap: 4px; padding: 11px 14px 4px; }
.av-rar { display: inline-flex; align-items: center; gap: 6px; font: 900 10px var(--caps); letter-spacing: 0.16em; text-transform: uppercase; color: var(--rc); }
.av-rar i { width: 7px; height: 7px; transform: rotate(45deg); background: var(--rc); box-shadow: 0 0 8px var(--rc); }
.av-card-name { font: 900 16px var(--caps); line-height: 1.15; color: var(--ink); }
.av-card-unit { display: flex; align-items: center; gap: 6px; font: 13px var(--serif); color: var(--mut); }
.av-card-unit i { width: 7px; height: 7px; border-radius: 50%; }
.av-card-foot { padding: 6px 14px 14px; }
.av-price { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px 4px 5px; border-radius: 999px; background: rgba(0, 0, 0, 0.4); border: 1px solid rgba(242, 196, 66, 0.4); }
.av-price .coin { width: 22px; height: 22px; }
.av-price b { font: 900 16px var(--caps); color: var(--g1); }
.av-price.poor { border-color: rgba(255, 255, 255, 0.1); }
.av-price.poor b { color: var(--mut); }
.av-state { font: 700 12px var(--caps); letter-spacing: 0.04em; color: var(--mut); }
.av-state.on { color: #8fe06a; }

/* detail */
.av-detail { --rc: #e8b84a; display: flex; flex-direction: column; padding: 14px; }
.av-sheet-x { display: none; }
.av-stage { position: relative; flex: none; aspect-ratio: 1; border-radius: 14px; overflow: hidden; border: 1px solid color-mix(in srgb, var(--rc) 45%, transparent);
  background: radial-gradient(circle at 50% 70%, color-mix(in srgb, var(--rc) 40%, transparent), transparent 60%), radial-gradient(circle at 50% 0%, rgba(255, 240, 200, 0.12), transparent 50%), linear-gradient(180deg, #2a1d10, #0e0904); }
.av-halo { position: absolute; inset: -30%; background: repeating-conic-gradient(from 0deg, color-mix(in srgb, var(--rc) 14%, transparent) 0 6deg, transparent 6deg 20deg); animation: sk-spin 40s linear infinite; }
.av-pedestal { position: absolute; left: 18%; right: 18%; bottom: 9%; height: 13%; border-radius: 50%;
  background: radial-gradient(ellipse at 50% 35%, color-mix(in srgb, var(--rc) 55%, #fff) 0%, color-mix(in srgb, var(--rc) 45%, transparent) 30%, transparent 70%); filter: blur(2px); opacity: 0.8; }
.av-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.av-stage.bought { animation: skd-glow 1.2s ease; }
.av-compare { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); display: flex; padding: 3px; border-radius: 999px; background: rgba(0, 0, 0, 0.65); border: 1px solid var(--line); backdrop-filter: blur(4px); }
.av-compare button { padding: 7px 16px; border: 0; border-radius: 999px; background: none; cursor: pointer; font: 700 12px var(--caps); color: var(--mut); }
.av-compare button.on { background: linear-gradient(180deg, var(--g1), var(--g2)); color: #2a1708; }
.av-info { padding: 16px 6px 4px; }
.av-rar.big { font-size: 11px; }
.av-rar.plain { color: var(--mut); }
.av-info h2 { margin: 6px 0 8px; font: 900 clamp(24px, 2.3vw, 32px) var(--deco); line-height: 1.08; background: linear-gradient(180deg, #fff6d4, #f2c25a 60%, #c8902e); -webkit-background-clip: text; background-clip: text; color: transparent; }
.av-unitline { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; font: 700 14px var(--caps); color: var(--ink); }
.av-unitline em { font: italic 13px var(--serif); color: var(--mut); }
.av-dot { width: 30px; height: 30px; border-radius: 50%; display: inline-grid; place-items: center; flex: none; box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.5); }
.av-dot .uicon { width: 18px; height: 18px; fill: #1e140a; }
.av-desc { margin: 12px 0; font-size: 15.5px; line-height: 1.5; color: #e6d4b0; }
.av-hint { font: italic 13.5px var(--serif); color: var(--mut); }
.av-perks { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 7px; }
.av-perks li { position: relative; padding-left: 20px; font-size: 14px; color: #d9c6a2; }
.av-perks li::before { content: ''; position: absolute; left: 3px; top: 7px; width: 7px; height: 7px; transform: rotate(45deg); background: var(--rc); box-shadow: 0 0 6px var(--rc); }
.av-buy { display: grid; gap: 10px; padding-top: 14px; border-top: 1px solid var(--line); }
.av-pricerow { display: flex; align-items: center; gap: 8px; }
.av-pricerow .coin { width: 34px; height: 34px; }
.av-pricerow b { font: 900 32px var(--caps); color: var(--g1); line-height: 1; }
.av-pricerow span { font: italic 14px var(--serif); color: var(--mut); }
.av-cta { position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 54px; padding: 0 20px; border: 0; border-radius: 14px; cursor: pointer;
  font: 900 16px var(--caps); letter-spacing: 0.06em; text-transform: uppercase; color: #2a1708;
  background: linear-gradient(180deg, #fff0b8, #f2c25a 45%, #c8902e); box-shadow: 0 8px 22px rgba(240, 180, 70, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.7), inset 0 -3px 0 rgba(120, 70, 10, 0.4); transition: transform 0.15s, box-shadow 0.2s, filter 0.2s; }
.av-cta .coin { width: 22px; height: 22px; }
.av-cta::after { content: ''; position: absolute; top: 0; bottom: 0; width: 40%; left: -60%; background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.55), transparent); transform: skewX(-20deg); animation: av-shine 3.2s ease-in-out infinite; }
@keyframes av-shine { 0%, 60% { left: -60%; } 100% { left: 130%; } }
.av-cta:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(240, 180, 70, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.7), inset 0 -3px 0 rgba(120, 70, 10, 0.4); }
.av-cta:active:not(:disabled) { transform: translateY(1px); }
.av-cta:disabled { cursor: not-allowed; color: #8a7656; background: linear-gradient(180deg, #3a2d1c, #2a1f12); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05); }
.av-cta:disabled::after, .av-cta.ghost::after { display: none; }
.av-cta.ghost { color: var(--g1); background: rgba(0, 0, 0, 0.3); border: 1px solid rgba(242, 196, 66, 0.5); box-shadow: none; }
.av-owned { font: 700 14px var(--caps); color: #8fe06a; letter-spacing: 0.03em; }
.av-need { border: 0; background: none; cursor: pointer; font: italic 14px var(--serif); color: var(--mut); text-align: center; }
.av-need u { color: var(--g1); }

/* loadout */
.av-slots { flex: 1; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); align-content: start; gap: 14px; padding: 12px 12px 16px 2px; }
.av-slot { position: relative; display: grid; gap: 10px; padding: 12px; border-radius: 16px; cursor: pointer; background: linear-gradient(180deg, #241910, #130c06); border: 1px solid rgba(255, 255, 255, 0.07); box-shadow: 0 10px 22px rgba(0, 0, 0, 0.45); transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s; --rc: #9c8460; }
.av-slot.gold { --rc: #e8b84a; }
.av-slot:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--rc) 60%, transparent); }
.av-slot.sel { border-color: var(--rc); box-shadow: 0 0 0 2px var(--rc), 0 14px 26px rgba(0, 0, 0, 0.5); }
.av-slot-art { position: relative; aspect-ratio: 1.6 / 1; border-radius: 12px; overflow: hidden; background: radial-gradient(circle at 50% 70%, color-mix(in srgb, var(--rc) 45%, transparent), transparent 62%), linear-gradient(180deg, #2c1f12, #100a05); }
.av-slot-art img { position: absolute; inset: 4% 20% 6%; width: 60%; height: 90%; object-fit: contain; filter: drop-shadow(0 8px 8px rgba(0, 0, 0, 0.5)); }
.av-slot-name { display: flex; align-items: center; gap: 10px; }
.av-slot-name b { display: block; font: 900 15px var(--caps); color: var(--ink); }
.av-slot-name small { font: italic 12.5px var(--serif); color: var(--mut); }
.av-variants { display: flex; gap: 8px; }
.av-variant { position: relative; flex: 1; display: grid; justify-items: center; gap: 2px; padding: 6px 4px 8px; border-radius: 12px; cursor: pointer; border: 1.5px solid rgba(255, 255, 255, 0.08); background: rgba(0, 0, 0, 0.35); transition: border-color 0.15s, background 0.15s; }
.av-variant img { width: 64px; height: 64px; object-fit: contain; }
.av-variant span { font: 700 11.5px var(--caps); color: var(--mut); }
.av-variant:hover { border-color: rgba(242, 196, 66, 0.5); }
.av-variant.on { border-color: #8fe06a; background: rgba(143, 224, 106, 0.1); box-shadow: 0 0 14px rgba(143, 224, 106, 0.25); }
.av-variant.on span { color: #c9f5b0; }
.av-variant.on::after { content: '✓'; position: absolute; top: 4px; right: 7px; font: 900 13px var(--caps); color: #8fe06a; }
.av-variant.locked img { filter: grayscale(0.85) brightness(0.55); }
.av-variant em { position: absolute; top: 5px; left: 5px; display: inline-flex; align-items: center; gap: 3px; padding: 2px 7px 2px 3px; border-radius: 999px; font: 900 11px var(--caps); font-style: normal; color: var(--g1); background: rgba(0, 0, 0, 0.75); border: 1px solid rgba(242, 196, 66, 0.4); }
.av-variant em .coin { width: 14px; height: 14px; }

/* earn */
.av-earn { width: min(920px, 100%); padding: 28px clamp(18px, 4vw, 44px); display: grid; gap: 26px; align-content: start; }
.av-earn-hero { display: grid; grid-template-columns: 130px 1fr; gap: 24px; align-items: center; }
.av-earn-hero h2 { margin: 4px 0 8px; font: 900 clamp(26px, 3vw, 38px) var(--deco); background: linear-gradient(180deg, #fff6d4, #f2c25a 60%, #c8902e); -webkit-background-clip: text; background-clip: text; color: transparent; }
.av-earn-hero p { margin: 0; font-size: 16px; line-height: 1.55; color: #e6d4b0; }
.av-bigcoin .coin { width: 128px; height: 128px; filter: drop-shadow(0 0 30px rgba(242, 196, 66, 0.5)); animation: coin-flip 4s ease-in-out infinite; }
.av-podium { display: grid; grid-template-columns: repeat(3, 1fr); align-items: end; gap: 14px; max-width: 620px; width: 100%; margin: 0 auto; }
.av-pod { display: grid; justify-items: center; gap: 10px; }
.av-pod-coins { display: flex; align-items: center; gap: 6px; font: 900 28px var(--caps); color: var(--g1); }
.av-pod-coins .coin { width: 34px; height: 34px; }
.av-pod-block { width: 100%; display: grid; place-items: start center; padding-top: 14px; border-radius: 12px 12px 4px 4px; font: 900 20px var(--caps); color: #2a1708; box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.6), 0 14px 30px rgba(0, 0, 0, 0.45); }
.av-pod.p1 .av-pod-block { height: 160px; background: linear-gradient(180deg, #fff0b8, #f2c25a 40%, #a8761a); }
.av-pod.p2 .av-pod-block { height: 118px; background: linear-gradient(180deg, #ffffff, #c9d0da 45%, #7c8796); }
.av-pod.p3 .av-pod-block { height: 92px; background: linear-gradient(180deg, #ffd9b0, #c98a4a 45%, #7a4a1c); }
.av-pod.p1 .av-pod-coins { font-size: 36px; }
.av-pod.p1 .av-pod-coins .coin { width: 44px; height: 44px; }
.av-tiers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.av-tier { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-radius: 12px; background: rgba(0, 0, 0, 0.3); border: 1px solid var(--line); font: 700 13px var(--caps); color: var(--mut); }
.av-tier b { display: inline-flex; align-items: center; gap: 5px; font: 900 18px var(--caps); color: var(--g1); }
.av-tier .coin { width: 20px; height: 20px; }
.av-timer { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 18px 20px; border-radius: 16px; background: linear-gradient(90deg, rgba(232, 184, 74, 0.14), rgba(232, 184, 74, 0.03)); border: 1px solid rgba(232, 184, 74, 0.35); }
.av-timer b { display: block; font: 900 30px var(--caps); color: var(--ink); margin: 2px 0; }
.av-timer small { font: italic 13px var(--serif); color: var(--mut); }
.av-timer .av-cta { width: auto; flex: none; }

/* tablets & phones */
@media (max-width: 1100px) {
  .av-main.shop { grid-template-columns: 220px minmax(0, 1fr) 330px; }
}
@media (max-width: 900px) {
  .av-top { grid-template-columns: auto 1fr auto; row-gap: 10px; padding-left: 14px; padding-right: 14px; }
  .av-tabs { grid-column: 1 / -1; grid-row: 2; justify-content: stretch; }
  .av-tabs button { flex: 1; padding: 9px 8px; font-size: 12px; }
  .av-purse { grid-column: 3; grid-row: 1; padding-right: 12px; }
  .av-purse small { display: none; }
  .av-main { padding: 0 10px 10px; gap: 10px; }
  .av-main.shop { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); }
  .av-main.loadout { grid-template-columns: 1fr; }
  .av-side { flex-direction: row; overflow-x: auto; overflow-y: hidden; gap: 10px; padding: 10px; align-items: flex-start; border-radius: 14px; }
  .av-side .av-sec h4 { display: none; }
  .av-sec-progress { display: none; }
  .av-search { flex: 0 0 200px; }
  .av-side .av-sec { flex: none; }
  .av-list { display: flex; gap: 4px; }
  .av-list button { grid-template-columns: 10px auto auto; padding: 8px 10px; white-space: nowrap; }
  .av-seg { min-width: 250px; }
  .av-select select { width: 170px; }
  .av-center { padding: 12px 4px 4px 12px; border-radius: 14px; }
  .av-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
  .av-slots { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
  .av-detail { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; max-height: 88vh; border-radius: 22px 22px 0 0; padding: 18px 16px max(16px, env(safe-area-inset-bottom));
    transform: translateY(105%); transition: transform 0.4s cubic-bezier(.2, .9, .3, 1); box-shadow: 0 -20px 50px rgba(0, 0, 0, 0.7); background: linear-gradient(180deg, #2a1d10, #120b06); }
  .av-detail.open { transform: none; }
  .av-detail .av-stage { width: min(320px, 70vw); margin: 0 auto; }
  .av-sheet-x { display: grid; place-items: center; position: absolute; top: 10px; right: 12px; z-index: 3; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: rgba(0, 0, 0, 0.5); color: var(--ink); font-size: 16px; cursor: pointer; }
  .av-earn-hero { grid-template-columns: 80px 1fr; gap: 14px; }
  .av-bigcoin .coin { width: 78px; height: 78px; }
  .av-tiers { grid-template-columns: 1fr; }
  .av-timer { flex-direction: column; align-items: stretch; }
  .av-timer .av-cta { width: 100%; }
}
@media (prefers-reduced-motion: reduce) { .av-bg i, .av-rays, .av-halo, .av-cta::after, .av-purse .coin, .av-bigcoin .coin { animation: none; } }
/* armoury fixes: cards size to their content, art never squashes; lighter compositing */
.av-grid, .av-slots { grid-auto-rows: max-content; }
.av-card { height: auto; }
.av-card-art, .av-slot-art, .av-stage { flex: none; width: 100%; }
.av-side, .av-center, .av-detail, .av-earn { backdrop-filter: none; }
.av-card .av-rays, .av-slot .av-rays { animation: none; }
/* the Armoury is opaque: the battlefield behind it is hidden and paused */
body.in-armoury #game { visibility: hidden; }
.av-side, .av-center, .av-detail, .av-earn { background: linear-gradient(180deg, #261b0f, #140d07); }
.av-purse { background: linear-gradient(180deg, #45300f, #1e1206); }
.av-seg, .av-tabs, .av-search input, .av-select select, .av-progress, .av-tier, .av-price, .av-variant, .av-compare { background-color: #120c06; }
.av-tabs { background: #0e0904; }
.av-search input, .av-select select { background: #100a05; }
.av-progress { background: #1a1209; }
.av-tier { background: #1a1209; }
.av-price { background: #100a05; }
.av-variant { background: #160f08; }
.av-compare { background: #0e0904; }
.av-list button.on { background: #3a2a12; }
.av-list button em { background: #2a1d10; }
.av-rar-btn { background: #160f08; }
.av-timer { background: linear-gradient(90deg, #3a2a10, #1e150a); }
.av-grid { grid-template-columns: repeat(auto-fill, minmax(clamp(190px, 14vw, 250px), 1fr)); gap: 18px; }
.av-card-name { font-size: 17px; }
.av-rar { font-size: 10.5px; }
@media (max-width: 900px) { .av-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; } }
.av-slots { grid-template-columns: repeat(auto-fill, minmax(clamp(210px, 15vw, 270px), 1fr)); gap: 16px; }
.av-main.earn { align-items: flex-start; }
.av-earn { max-height: 100%; }
.av-bigcoin .coin { animation: av-sway 4s ease-in-out infinite; }
@keyframes av-sway { 0%, 100% { transform: rotateY(-25deg) translateY(0); } 50% { transform: rotateY(25deg) translateY(-8px); } }
/* no sunburst rays: a soft spotlight and floor glow instead */
.av-rays, .av-halo { display: none; }
.av-card-art, .av-slot-art { background: radial-gradient(ellipse 60% 45% at 50% 72%, color-mix(in srgb, var(--rc) 38%, transparent), transparent 70%), radial-gradient(ellipse 70% 60% at 50% 0%, rgba(255, 240, 200, 0.08), transparent 70%), linear-gradient(180deg, #24190f, #0f0a05); }
.av-stage { background: radial-gradient(ellipse 55% 40% at 50% 78%, color-mix(in srgb, var(--rc) 42%, transparent), transparent 70%), radial-gradient(ellipse 70% 60% at 50% 0%, rgba(255, 240, 200, 0.1), transparent 70%), linear-gradient(180deg, #24190f, #0c0804); }
