/* GIGAWRECK UI theme: glossy blue arcade panels, condensed outlined caps, beveled buttons.
   Fonts: Anton + Fira Sans (SIL OFL, bundled in /fonts). */
/* 0.22.0: Latin subsets (WOFF, about 45 KB each) load first; the full fonts load only for other scripts. */
@font-face { font-family: 'Anton'; src: url('/fonts/Anton-Regular-latin.woff') format('woff'); font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2190-2199, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Anton'; src: url('/fonts/Anton-Regular.ttf') format('truetype'); font-display: swap; unicode-range: U+0100-0130, U+0132-0151, U+0154-02BA, U+02BD-02C5, U+02C7-02D9, U+02DB, U+02DD-1FFF, U+2070-2073, U+2075-20AB, U+20AD-2121, U+2123-218F, U+219A-2211, U+2213-2214, U+2216-FEFE, U+FF00-FFFC, U+FFFE-FFFF; }
@font-face { font-family: 'Fira'; src: url('/fonts/FiraSans-Regular-latin.woff') format('woff'); font-weight: 400; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2190-2199, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Fira'; src: url('/fonts/FiraSans-Regular.ttf') format('truetype'); font-weight: 400; font-display: swap; unicode-range: U+0100-0130, U+0132-0151, U+0154-02BA, U+02BD-02C5, U+02C7-02D9, U+02DB, U+02DD-1FFF, U+2070-2073, U+2075-20AB, U+20AD-2121, U+2123-218F, U+219A-2211, U+2213-2214, U+2216-FEFE, U+FF00-FFFC, U+FFFE-FFFF; }
@font-face { font-family: 'Fira'; src: url('/fonts/FiraSans-SemiBold-latin.woff') format('woff'); font-weight: 600; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2190-2199, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Fira'; src: url('/fonts/FiraSans-SemiBold.ttf') format('truetype'); font-weight: 600; font-display: swap; unicode-range: U+0100-0130, U+0132-0151, U+0154-02BA, U+02BD-02C5, U+02C7-02D9, U+02DB, U+02DD-1FFF, U+2070-2073, U+2075-20AB, U+20AD-2121, U+2123-218F, U+219A-2211, U+2213-2214, U+2216-FEFE, U+FF00-FFFC, U+FFFE-FFFF; }
@font-face { font-family: 'Fira'; src: url('/fonts/FiraSans-ExtraBold-latin.woff') format('woff'); font-weight: 800; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2190-2199, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Fira'; src: url('/fonts/FiraSans-ExtraBold.ttf') format('truetype'); font-weight: 800; font-display: swap; unicode-range: U+0100-0130, U+0132-0151, U+0154-02BA, U+02BD-02C5, U+02C7-02D9, U+02DB, U+02DD-1FFF, U+2070-2073, U+2075-20AB, U+20AD-2121, U+2123-218F, U+219A-2211, U+2213-2214, U+2216-FEFE, U+FF00-FFFC, U+FFFE-FFFF; }

:root {
  --bg0: #051640; --bg1: #0A2A66; --bg2: #0E3A85;
  --panel-hi: #2C8BEE; --panel: #1A68CF; --panel-lo: #1150A8;
  --card: #0B2459; --card-hi: #13397F; --card-line: #3D8EEA;
  --line: #63C6FF; --sub: #8FD5FF; --text: #FFFFFF;
  --ink: #04102E;
  --pink: #FF4FA7; --pink-lo: #C3166F;
  --green: #4BDD62; --green-lo: #1C9B36;
  --gold: #FFCD3C; --gold-lo: #E58A0A;
  --orange: #FF8A1C; --red: #FF3D5A;
  --thermal: #FF7B1C; --cryo: #3FD6FF; --toxic: #8EE04A;
  --dev: #FF4646; --modc: #A6FF34; --tester: #2EE6F2; --supp: #FFA94D; /* name colors: Developers red, moderators lime green, Beta Testers aqua */
  --display: 'Anton', Impact, 'Arial Narrow', sans-serif;
  --body: 'Fira', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --outline: 0 2px 0 var(--ink), 2px 0 0 var(--ink), -2px 0 0 var(--ink), 0 -2px 0 var(--ink), 2px 2px 0 var(--ink), -2px 2px 0 var(--ink), 2px -2px 0 var(--ink), -2px -2px 0 var(--ink), 0 4px 0 var(--ink);
  --outline-sm: 0 1px 0 var(--ink), 1px 0 0 var(--ink), -1px 0 0 var(--ink), 0 -1px 0 var(--ink), 1px 1px 0 var(--ink), -1px 1px 0 var(--ink), 0 2px 0 var(--ink);
  --pattern: repeating-linear-gradient(135deg, rgba(255,255,255,.028) 0 2px, transparent 2px 16px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px); /* above zero when the app runs full screen from the home screen */
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg1) var(--pattern); color: var(--text); font: 600 15px/1.35 var(--body); overscroll-behavior: none; -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: not-allowed; }
img { max-width: 100%; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.hidden { display: none !important; }
#app { height: 100dvh; }
.boot { height: 100dvh; display: grid; place-content: center; text-align: center; font: 64px var(--display); text-shadow: var(--outline); letter-spacing: 1px; }
.boot small { display: block; font: 600 15px var(--body); text-shadow: none; color: var(--sub); }
.loading { display: grid; place-content: center; height: 100%; color: var(--sub); }

/* ---------- type */
.title { font: 40px/1 var(--display); text-transform: uppercase; color: var(--text); margin: 0 0 10px; letter-spacing: .02em; text-shadow: var(--outline); }
.title.sm { font-size: 28px; }
.subhead { font: 20px var(--display); text-transform: uppercase; color: var(--sub); margin: 14px 0 6px; letter-spacing: .03em; text-shadow: var(--outline-sm); }
.fine { font-size: 12px; color: var(--sub); margin: 4px 0; font-weight: 600; }
.good { color: var(--green); font-weight: 800; }
.empty { color: var(--sub); text-align: center; padding: 24px; }
.quote { font-style: italic; margin: 4px 0; color: #E2F2FF; }
kbd { font: 700 10px var(--body); background: var(--ink); color: var(--sub); border: 1px solid var(--card-line); border-radius: 4px; padding: 0 4px; }

/* ---------- buttons */
.btn { --b1: #49AEFF; --b2: #1765D3; font: 20px/1 var(--display); text-transform: uppercase; letter-spacing: .03em; color: #fff; text-shadow: var(--outline-sm);
  background: linear-gradient(180deg, var(--b1), var(--b2)); border: 2px solid var(--ink); border-radius: 9px;
  box-shadow: inset 0 2px 0 rgba(255,255,255,.5), inset 0 -4px 0 rgba(0,0,0,.25), 0 4px 0 var(--ink); padding: 9px 18px 10px;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; white-space: nowrap; transition: transform .06s, filter .1s; }
.btn:hover:not(:disabled) { filter: brightness(1.1); }
.btn:active:not(:disabled) { transform: translateY(3px); box-shadow: inset 0 2px 0 rgba(255,255,255,.5), inset 0 -2px 0 rgba(0,0,0,.25), 0 1px 0 var(--ink); }
.btn.cta { --b1: #FF7CC0; --b2: #D81C7E; }
.btn.go, .btn.glow { --b1: #74EE85; --b2: #22A13B; }
.btn.gold { --b1: #FFE07A; --b2: #F09A0C; }
.btn.alt { --b1: #1D4C95; --b2: #0E2D63; box-shadow: inset 0 0 0 1px var(--card-line), inset 0 2px 0 rgba(255,255,255,.18), 0 4px 0 var(--ink); }
.btn.ghost { --b1: rgba(4,16,46,.55); --b2: rgba(4,16,46,.75); box-shadow: inset 0 0 0 1px var(--card-line), 0 3px 0 var(--ink); }
.btn.danger { --b1: #FF7A8C; --b2: #D3203D; }
.btn.danger-t { --b1: #3A1430; --b2: #2A0C22; box-shadow: inset 0 0 0 1px var(--red), 0 3px 0 var(--ink); color: #FFC0CA; }
.btn:disabled { --b1: #52668E; --b2: #36486F; color: #A9B8D6; box-shadow: inset 0 2px 0 rgba(255,255,255,.15), 0 3px 0 var(--ink); }
.btn.sm { font-size: 15px; padding: 6px 12px 7px; min-height: 36px; border-radius: 8px; box-shadow: inset 0 2px 0 rgba(255,255,255,.45), inset 0 -3px 0 rgba(0,0,0,.25), 0 3px 0 var(--ink); }
.btn.alt.sm, .btn.ghost.sm { box-shadow: inset 0 0 0 1px var(--card-line), 0 3px 0 var(--ink); }
.btn.big { font-size: 28px; padding: 12px 34px; min-height: 60px; }
.btn.slant { clip-path: polygon(14px 0, 100% 0, calc(100% - 14px) 100%, 0 100%); padding-left: 28px; padding-right: 28px; border-radius: 0; }
.btn.glow:not(:disabled) { animation: glow 1.1s ease-in-out infinite; }
.btn.toggle.on { --b1: #74EE85; --b2: #22A13B; }
@keyframes glow { 50% { filter: brightness(1.28) saturate(1.2); } }
.linkbtn { background: none; border: 0; color: var(--sub); text-decoration: underline; font-weight: 800; padding: 6px; }
.iconbtn { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; flex: none; color: #fff; font: 22px var(--display);
  background: linear-gradient(180deg, #21528F, #0D2A5E); border: 2px solid var(--ink); box-shadow: inset 0 0 0 2px var(--card-line), 0 3px 0 var(--ink); }
.iconbtn.discord-btn { background: linear-gradient(180deg, #7B86FF, #4752C4); box-shadow: inset 0 0 0 2px rgba(255,255,255,.35), 0 3px 0 var(--ink); }
.iconbtn.discord-btn:hover { filter: brightness(1.1); }
.btn.discord { background: linear-gradient(180deg, #7B86FF, #4752C4); color: #fff; display: inline-flex; align-items: center; gap: 8px; text-decoration: none; }
.chipbtn { font: 16px var(--display); text-transform: uppercase; letter-spacing: .03em; color: #fff; text-shadow: var(--outline-sm);
  background: linear-gradient(180deg, #1B4A92, #0D2A60); border: 2px solid var(--ink); border-radius: 8px; box-shadow: inset 0 0 0 1px var(--card-line), 0 3px 0 var(--ink); padding: 6px 16px; }
.chipbtn.on { background: linear-gradient(180deg, #FFE07A, #F09A0C); color: var(--ink); text-shadow: none; box-shadow: inset 0 0 0 1px #FFF3C4, 0 3px 0 var(--ink); }

/* ---------- chips, bars, stars */
.chip { display: inline-flex; align-items: center; gap: 4px; background: var(--ink); color: #fff; border: 1px solid var(--card-line); border-radius: 99px; padding: 2px 10px; font: 800 12px var(--body); white-space: nowrap; }
.chip .ic { width: 20px; height: 20px; object-fit: contain; margin: -3px 0; }
.chip.short { background: #5A1020; border-color: var(--red); color: #FFC0CA; }
.chip.warn { background: var(--orange); color: var(--ink); border-color: var(--ink); }
.chip.ok { background: var(--green-lo); border-color: var(--green); }
.chip.mod { background: var(--orange); color: var(--ink); text-transform: uppercase; }
.chip.rare { background: var(--gold); color: var(--ink); border-color: var(--ink); }
.chip.common { background: #8C9BBE; color: var(--ink); border-color: var(--ink); }
.chip.el.thermal { background: var(--thermal); color: var(--ink); border-color: var(--ink); }
.chip.el.cryo { background: var(--cryo); color: var(--ink); border-color: var(--ink); }
.chip.el.toxic { background: var(--toxic); color: var(--ink); border-color: var(--ink); }
.chip.el.neutral { background: #8C9BBE; color: var(--ink); border-color: var(--ink); }
.chip.giga { background: var(--pink); border-color: var(--ink); }
.bar { height: 10px; background: #061634; border: 2px solid var(--ink); border-radius: 99px; overflow: hidden; box-shadow: inset 0 0 0 1px var(--card-line); }
.bar > div { height: 100%; background: linear-gradient(180deg, #8EE6FF, #22A9F0); border-radius: 99px; transition: width .25s; }
.bar.xp > div { background: linear-gradient(180deg, #C69BFF, #8A4BEA); }
.bar.xp.big { height: 16px; }
.bar.q > div { background: linear-gradient(180deg, #8EF59A, #2DB848); }
.bar.tiny { height: 7px; border-width: 1px; }
.bar.hp > div { background: linear-gradient(180deg, #8EF59A, #2DB848); transition: width .1s; }
.bar.charge { height: 7px; }
.bar.charge > div { background: linear-gradient(180deg, #FFE07A, #F0A20C); transition: width .1s; }
.stars { display: inline-flex; gap: 2px; }
.stars i { width: 16px; height: 16px; background: #22365E; clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); }
.stars i.on { background: linear-gradient(180deg, #FFF3B0, #FFC21C); }
.stars.big i { width: 56px; height: 56px; animation: pop .4s backwards; }
.stars.big i:nth-child(2) { animation-delay: .25s; } .stars.big i:nth-child(3) { animation-delay: .5s; }
.rstars { display: inline-flex; gap: 1px; }
.rstars i { width: 13px; height: 13px; background: #C9D6F0; clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); }
.rstars.rare i { background: var(--gold); }
.pips { display: inline-flex; gap: 3px; }
.pips i { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--ink); background: #22365E; }
.pips i.on { background: var(--orange); }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.row.center { justify-content: center; }
.tag { position: absolute; font: 13px var(--display); letter-spacing: .04em; text-transform: uppercase; background: var(--gold); color: var(--ink); border: 2px solid var(--ink); border-radius: 6px; padding: 1px 7px; }
.tag.new { position: static; display: inline-block; background: var(--pink); color: #fff; text-shadow: var(--outline-sm); font-size: 18px; animation: pop .4s .3s backwards; }
.sil { filter: brightness(0) opacity(.6); }
.art-missing { background: repeating-linear-gradient(45deg, #12336C 0 8px, #0D2858 8px 16px); border-radius: 10px; min-height: 40px; min-width: 40px; }

/* ---------- panels & modals */
.panel, .bpanel { background: linear-gradient(180deg, var(--panel-hi), var(--panel) 18%, var(--panel-lo)); border: 2px solid var(--ink); border-radius: 10px;
  box-shadow: inset 0 0 0 2px var(--line), inset 0 4px 0 rgba(255,255,255,.18), 0 6px 0 rgba(4,16,46,.6); color: #fff; }
.modal-back { position: fixed; inset: 0; background: rgba(2,8,26,.78); z-index: 100; display: grid; place-items: center; padding: 12px; animation: fade .15s; }
.modal { position: relative; width: min(460px, 100%); max-height: calc(100dvh - 24px); overflow: auto; padding: 20px; animation: rise .2s;
  background: linear-gradient(180deg, #1F74DB, #1559B8 30%, #0F468F); border: 3px solid var(--ink); border-radius: 12px;
  box-shadow: inset 0 0 0 2px var(--line), inset 0 5px 0 rgba(255,255,255,.18), 0 10px 0 rgba(0,0,0,.45); scrollbar-color: var(--line) var(--card); }
.modal.wide { width: min(800px, 100%); }
.modal.narrow { width: min(400px, 100%); }
.modal-x { position: absolute; top: 10px; right: 10px; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; z-index: 2;
  background: linear-gradient(180deg, #FF7A8C, #D3203D); border: 2px solid var(--ink); box-shadow: inset 0 2px 0 rgba(255,255,255,.45), 0 3px 0 var(--ink); color: #fff; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(18px) scale(.97); opacity: 0; } }
@keyframes pop { 0% { transform: scale(.3); opacity: 0; } 70% { transform: scale(1.12); } }
@keyframes bob { 50% { transform: translateY(-8px); } }
@keyframes spin { to { transform: rotate(360deg); } }
#toasts { position: fixed; top: 132px; left: 50%; transform: translateX(-50%); z-index: 200; display: grid; gap: 6px; width: min(440px, 92vw); pointer-events: none; }
.toast { background: linear-gradient(180deg, #1D4C95, #0E2D63); border: 2px solid var(--ink); box-shadow: inset 0 0 0 2px var(--line), 0 4px 0 var(--ink); border-radius: 10px; padding: 9px 14px; font-weight: 800; animation: rise .2s; transition: opacity .3s; }
.toast.good { box-shadow: inset 0 0 0 2px var(--green), 0 4px 0 var(--ink); } .toast.bad { box-shadow: inset 0 0 0 2px var(--red), 0 4px 0 var(--ink); }
.toast.out { opacity: 0; }
.toast-n { display: inline-block; margin-left: 8px; padding: 0 6px; border-radius: 9px; background: rgba(4,16,46,.55); font: 13px/18px var(--display); letter-spacing: .03em; color: var(--gold); vertical-align: 1px; }
.notice-list li.new { box-shadow: inset 3px 0 0 var(--gold); }
.confirm p { margin: 8px 0 14px; }
.opt, .bp, .munch, .evo, .abil, .upg, .build-opt, .xp-row, .set-row, .bio, .res-row > div, .stats > div, .prep-intel, .prep-rewards, .mitem {
  background: var(--card); border: 2px solid var(--ink); border-radius: 8px; box-shadow: inset 0 0 0 1px var(--card-line); color: #fff; }

/* ---------- auth & onboarding */
.auth { min-height: 100dvh; display: grid; place-items: center; align-content: center; gap: 14px; padding: 20px; background: radial-gradient(ellipse at 50% 30%, #1B5BC0, transparent 70%), var(--pattern); }
.auth-hero { text-align: center; }
.hero-mons { display: flex; justify-content: center; align-items: flex-end; height: clamp(140px, 28vh, 250px); }
.hero-mons .hm { height: 100%; width: auto; object-fit: contain; filter: drop-shadow(0 8px 0 rgba(4,16,46,.6)); }
.hm1 { transform: translateX(18%) scale(.85) rotate(-4deg); } .hm3 { transform: translateX(-18%) scale(.85) rotate(4deg); }
.hm2 { z-index: 1; animation: bob 2.4s ease-in-out infinite; }
.logo { margin: 4px 0 0; font: clamp(64px, 13vw, 128px)/.86 var(--display); letter-spacing: .01em; transform: skew(-6deg) rotate(-2deg); }
.logo span { text-shadow: 0 4px 0 var(--ink), 4px 0 0 var(--ink), -4px 0 0 var(--ink), 0 -4px 0 var(--ink), 4px 4px 0 var(--ink), -4px 4px 0 var(--ink), 4px -4px 0 var(--ink), -4px -4px 0 var(--ink), 0 9px 0 var(--ink); }
.logo .l1 { color: #fff; } .logo .l2 { color: var(--gold); }
.tagline { font: 22px var(--display); text-transform: uppercase; letter-spacing: .04em; margin: 8px 0 0; color: var(--sub); text-shadow: var(--outline-sm); }
.auth-form { display: grid; gap: 10px; padding: 20px; width: min(400px, 100%); }
.auth-form input, textarea, .chat-in { font: 600 16px var(--body); padding: 12px; border: 2px solid var(--ink); border-radius: 8px; background: #061634; color: #fff; width: 100%; box-shadow: inset 0 0 0 1px var(--card-line); }
.auth-form input::placeholder, .chat-in::placeholder { color: #6F8DBE; }
.form-err { color: #FFC0CA; font-weight: 800; margin: 0; min-height: 1em; }
.onboard { min-height: 100dvh; padding: 24px; display: grid; justify-items: center; align-content: start; gap: 14px; text-align: center; }
.sub { max-width: 640px; margin: 0; color: #E2F2FF; }
.ava-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 12px; width: min(900px, 100%); }
.ava-card { display: grid; gap: 6px; justify-items: center; padding: 10px 8px; color: #fff; font: 15px var(--display); text-transform: uppercase; letter-spacing: .03em; text-shadow: var(--outline-sm);
  background: linear-gradient(180deg, #164591, #0B2459); border: 2px solid var(--ink); border-radius: 10px; box-shadow: inset 0 0 0 1px var(--card-line), 0 4px 0 var(--ink); }
.ava-card small { font: 600 12px var(--body); text-transform: none; color: var(--sub); text-shadow: none; }
.ava-card.sel { background: linear-gradient(180deg, #49AEFF, #1765D3); box-shadow: inset 0 0 0 2px #fff, 0 0 0 3px var(--gold), 0 4px 0 var(--ink); transform: translateY(-3px); }
.ava-port { width: 100px; height: 100px; border-radius: 50%; overflow: hidden; border: 3px solid var(--ink); background: radial-gradient(circle at 50% 35%, #7FD6FF, #1F6FD0); box-shadow: 0 0 0 3px var(--line); display: block; }
.ava-port img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.ob-detail { max-width: 560px; min-height: 96px; }
.ob-detail h3 { margin: 0; font: 30px var(--display); text-transform: uppercase; text-shadow: var(--outline); }
.ob-detail em { color: var(--gold); font-weight: 800; }
.starter-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; width: min(1040px, 100%); }
.starter { display: grid; gap: 8px; text-align: center; padding: 12px; color: #fff;
  background: linear-gradient(180deg, #164591, #0B2459); border: 2px solid var(--ink); border-radius: 12px; box-shadow: inset 0 0 0 2px var(--card-line), 0 6px 0 var(--ink); }
.starter.sel { box-shadow: inset 0 0 0 2px #fff, 0 0 0 4px var(--gold), 0 6px 0 var(--ink); transform: translateY(-4px); }
.starter-art { height: 210px; display: grid; place-items: center; border-radius: 8px; border: 2px solid var(--ink); }
.starter-art img { max-height: 200px; object-fit: contain; }
.starter h3 { margin: 0; font: 32px var(--display); text-transform: uppercase; text-shadow: var(--outline); }
.starter .skill, .starter .lore { margin: 0; font-size: 13px; text-align: left; }
.starter .lore { color: var(--sub); }
.el-thermal .starter-art, .el-thermal .mcard-art, .el-thermal.slot, .el-thermal .vat-art, .el-thermal .detail-art, .el-thermal .evo-art, .el-thermal.pt, .el-thermal .bp-art { background: radial-gradient(circle at 50% 40%, #FFB36B, #C64A0C); }
.el-cryo .starter-art, .el-cryo .mcard-art, .el-cryo.slot, .el-cryo .vat-art, .el-cryo .detail-art, .el-cryo .evo-art, .el-cryo.pt, .el-cryo .bp-art { background: radial-gradient(circle at 50% 40%, #A6EEFF, #1C86C9); }
.el-toxic .starter-art, .el-toxic .mcard-art, .el-toxic.slot, .el-toxic .vat-art, .el-toxic .detail-art, .el-toxic .evo-art, .el-toxic.pt, .el-toxic .bp-art { background: radial-gradient(circle at 50% 40%, #CFF79C, #4E9E1C); }
.reveal-screen, .reveal { position: relative; display: grid; justify-items: center; gap: 8px; text-align: center; padding: 20px; overflow: hidden; }
.reveal-screen { min-height: 100dvh; align-content: center; }
.reveal-art { position: relative; z-index: 1; width: min(330px, 70vw); }
.reveal-art img { width: 100%; filter: drop-shadow(0 10px 0 rgba(4,16,46,.55)); }
.pop { animation: pop .5s backwards; }
/* Sunburst behind reveals: a square far larger than any screen, centred, so its rotating corners never show; it fades out toward the edges. */
.burst { position: absolute; left: 50%; top: 42%; width: 260vmax; height: 260vmax; margin: -130vmax 0 0 -130vmax; background: repeating-conic-gradient(from 0deg, rgba(99,198,255,.22) 0 7.5deg, rgba(99,198,255,0) 7.5deg 15deg); -webkit-mask-image: radial-gradient(circle, #000 0, #000 9%, transparent 24%); mask-image: radial-gradient(circle, #000 0, #000 9%, transparent 24%); animation: spin 40s linear infinite; z-index: 0; pointer-events: none; }
.burst.rare { background: repeating-conic-gradient(from 0deg, rgba(255,205,60,.36) 0 7.5deg, rgba(255,79,167,.14) 7.5deg 15deg); }
.reveal > *:not(.burst), .reveal-screen > *:not(.burst), .new-giga > *:not(.burst) { position: relative; z-index: 1; }

/* ---------- shell: HUD on top, tab strip, stage, chat dock */
.shell { display: grid; height: 100dvh; grid-template-columns: 1fr 350px; grid-template-rows: 74px 50px auto 1fr; grid-template-areas: "top top" "nav chat" "tip chat" "main chat"; }
.topbar { grid-area: top; display: flex; align-items: center; gap: 14px; padding: 8px 16px 8px 12px; z-index: 6;
  background: linear-gradient(180deg, #0F3A86, #0A2A66); border-bottom: 3px solid var(--ink); box-shadow: inset 0 -2px 0 var(--line), 0 3px 0 rgba(0,0,0,.3); }
.me-btn { display: flex; align-items: center; gap: 10px; background: none; border: 0; padding: 0; position: relative; text-align: left; min-width: 0; }
.ava { width: 58px; height: 58px; border-radius: 50%; overflow: hidden; border: 3px solid var(--ink); background: radial-gradient(circle at 50% 35%, #7FD6FF, #1F6FD0); box-shadow: 0 0 0 3px var(--line); flex: none; }
.ava img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.lvl { position: absolute; left: 30px; bottom: -6px; font: 15px var(--display); letter-spacing: .03em; color: #fff; text-shadow: var(--outline-sm); background: linear-gradient(180deg, #C69BFF, #7B3FDB); border: 2px solid var(--ink); border-radius: 6px; padding: 0 6px; white-space: nowrap; }
.lvl::before { content: 'LVL '; font-size: 12px; }
.me-name { display: grid; gap: 4px; min-width: 120px; }
.me-name b { font: 22px var(--display); text-transform: uppercase; letter-spacing: .03em; text-shadow: var(--outline-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 200px; }
.pills { display: flex; gap: 22px; margin-left: auto; align-items: center; }
.pill { position: relative; display: flex; align-items: center; height: 40px; padding: 0 14px 0 36px; border-radius: 8px; background: #061634; border: 2px solid var(--ink); box-shadow: inset 0 0 0 1px var(--card-line); min-width: 126px; }
.pill b { font: 22px var(--display); letter-spacing: .03em; text-shadow: var(--outline-sm); }
.pill small { font: 800 12px var(--body); color: var(--sub); margin-left: 3px; }
.pill .pic { position: absolute; left: -14px; top: 50%; transform: translateY(-50%); width: 48px; height: 48px; object-fit: contain; filter: drop-shadow(0 2px 0 var(--ink)); }
.pill.biofuel { min-width: 176px; padding-right: 24px; }
.pill.biofuel { padding-bottom: 7px; }
.pill.biofuel b, .pill.biofuel small { line-height: 1; }
.pill .fillbar { position: absolute; left: 34px; right: 22px; bottom: 4px; height: 4px; border-radius: 3px; background: #0E2350; overflow: hidden; }
.pill .fillbar i { display: block; height: 100%; background: linear-gradient(90deg, #7BE88B, #2DB848); }
.pill .plus { position: absolute; right: -12px; top: 50%; transform: translateY(-50%); width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--ink); background: linear-gradient(180deg, #74EE85, #22A13B); color: #fff; font: 20px/1 var(--display); text-shadow: var(--outline-sm); display: grid; place-items: center; padding: 0; }
.pill.power { min-width: 0; padding-right: 12px; cursor: pointer; color: #fff; }
.pill.power small { font: 15px var(--display); letter-spacing: .06em; color: #9FD3FF; margin-left: 6px; text-shadow: var(--outline-sm); }
.pill.power:hover { filter: brightness(1.15); }
.pill .under { position: absolute; left: 36px; top: 100%; margin-top: 1px; font: 800 11px var(--body); color: var(--sub); display: flex; align-items: center; gap: 3px; white-space: nowrap; }
.pill .under .pic { position: static; transform: none; width: 15px; height: 15px; filter: none; }
.pill.full b, .pill.low b { color: #FF97A6; }
.hudbtns { display: flex; gap: 8px; margin-left: 10px; }
.nav { grid-area: nav; display: flex; align-items: stretch; gap: 0; padding: 7px 14px 0; background: #071F4E; border-bottom: 3px solid var(--ink); box-shadow: inset 0 -2px 0 var(--card-line); z-index: 5; }
.navbtn { position: relative; isolation: isolate; display: flex; align-items: center; gap: 7px; padding: 0 28px; color: #BFE4FF; text-decoration: none; font: 20px var(--display); letter-spacing: .04em; text-shadow: var(--outline-sm); margin-right: -6px; }
.navbtn::before { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, #164591, #0D2A60); clip-path: polygon(13px 0, calc(100% - 13px) 0, 100% 100%, 0 100%); }
.navbtn .navic { width: 32px; height: 32px; object-fit: contain; }
.navbtn:hover { color: #fff; filter: brightness(1.18); }
.navbtn.on { color: #fff; z-index: 1; }
.navbtn.on::before { background: linear-gradient(180deg, #49AEFF, #1765D3); }
.badge { position: absolute; top: -5px; right: 2px; background: linear-gradient(180deg, #74EE85, #22A13B); color: #fff; text-shadow: var(--outline-sm); border: 2px solid var(--ink); border-radius: 6px; font: 13px var(--display); padding: 0 5px; min-width: 20px; text-align: center; font-style: normal; z-index: 2; }
.stage { grid-area: main; position: relative; overflow: auto; min-width: 0; scrollbar-color: var(--line) var(--bg1); }
/* page transitions (0.20.7): out to the side, in from the other; --dx is -1, 0 or 1 by nav order */
.stage.page-out > * { animation: page-out .13s ease-in forwards; pointer-events: none; }
.stage.page-in > * { animation: page-in .32s cubic-bezier(.2,.9,.25,1.12) both; }
@keyframes page-out { to { opacity: 0; transform: translateX(calc(var(--dx, 0) * -28px)) translateY(calc((1 - var(--dx, 0) * var(--dx, 0)) * 10px)) scale(.985); } }
@keyframes page-in { from { opacity: 0; transform: translateX(calc(var(--dx, 0) * 44px)) translateY(calc((1 - var(--dx, 0) * var(--dx, 0)) * 16px)) scale(.99); } }
@media (prefers-reduced-motion: reduce) { .stage.page-out > *, .stage.page-in > * { animation: none; } }
.peek { display: none; }
.pip-guide { grid-area: tip; display: flex; align-items: center; gap: 10px; padding: 6px 14px 6px 8px; z-index: 4; animation: fade .3s;
  background: linear-gradient(90deg, #0F3A86, #0B2C6A); border-bottom: 2px solid var(--ink); box-shadow: inset 0 -1px 0 var(--card-line); }
.pip-face { width: 48px; height: 48px; flex: none; margin: -6px 0; animation: bob 2.6s ease-in-out infinite; }
.pip-face img { width: 100%; height: 100%; object-fit: contain; }
.pip-guide p { flex: 1; margin: 0; font-size: 15px; font-weight: 700; line-height: 1.25; }
.pip-guide p b { font: 17px var(--display); color: var(--gold); letter-spacing: .04em; text-shadow: var(--outline-sm); }
.pip-x { background: none; border: 0; font: 24px/1 var(--display); padding: 0 4px; color: var(--sub); }

/* ---------- chat dock */
.chat { grid-area: chat; display: flex; flex-direction: column; min-height: 0; background: #071A45 var(--pattern); border-left: 3px solid var(--ink); box-shadow: inset 2px 0 0 var(--card-line); }
.chat-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; background: linear-gradient(180deg, #164591, #0D2A60); border-bottom: 2px solid var(--ink); box-shadow: inset 0 -1px 0 var(--card-line); }
.chat-head b { font: 22px var(--display); text-transform: uppercase; letter-spacing: .04em; text-shadow: var(--outline-sm); }
.online { font: 800 12px var(--body); color: var(--sub); }
.online::before { content: ''; display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--green); margin-right: 5px; box-shadow: 0 0 6px var(--green); }
.chat-close { margin-left: auto; display: none; }
.msgs { list-style: none; margin: 0; padding: 8px; overflow-y: auto; overflow-x: hidden; min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 4px; scrollbar-color: var(--line) transparent; }
.msg { display: flex; gap: 8px; align-items: flex-start; padding: 4px 6px; border-radius: 8px; }
.msg:hover { background: rgba(99,198,255,.07); }
.msg-ava { width: 34px; height: 34px; border-radius: 50%; overflow: hidden; border: 2px solid var(--ink); box-shadow: 0 0 0 2px var(--card-line); background: radial-gradient(circle at 50% 35%, #7FD6FF, #1F6FD0); padding: 0; flex: none; }
.msg-ava img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.msg-main { min-width: 0; flex: 1; }
.msg-meta { display: flex; flex-wrap: wrap; gap: 2px 6px; align-items: baseline; font-size: 11px; min-width: 0; }
.msg-user { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-acts { display: inline-flex; flex-wrap: wrap; gap: 0 6px; align-items: baseline; }
.msg-user { background: none; border: 0; padding: 0; font: 16px var(--display); letter-spacing: .03em; color: var(--line); text-transform: uppercase; text-shadow: var(--outline-sm); }
.msg.mine .msg-user { color: var(--gold); }
.msg-meta time { color: #6F8DBE; font-weight: 700; }
.msg-act { background: none; border: 0; padding: 0 2px; font: 700 11px var(--body); color: #6F8DBE; }
.msg-act:hover { color: #fff; text-decoration: underline; }
.msg p { margin: 1px 0 0; word-wrap: break-word; overflow-wrap: anywhere; font-weight: 600; }
.msg-reply { font-size: 12px; color: var(--sub); border-left: 3px solid var(--line); padding-left: 6px; margin-top: 2px; }
/* System lines (0.21.4): an icon, a SYSTEM tag and the time, then the news with tappable names.
   Minor news is pale gold, major news (Legendaries, milestones, factions) full gold, wars red,
   chat notices blue, faction-channel lines green. */
.msg.sys { --sys-a: #FFF1BE; --sys-b: #FFD35A; display: grid; grid-template-columns: 34px 1fr; gap: 8px; align-items: start;
  background: linear-gradient(180deg, var(--sys-a), var(--sys-b)); color: var(--ink); border: 2px solid var(--ink); border-radius: 10px; padding: 6px 9px 7px 6px; }
.msg.sys.major { --sys-a: #FFE58A; --sys-b: #F5A30F; box-shadow: inset 0 0 0 2px rgba(255,255,255,.55), 0 0 0 2px var(--gold); }
.msg.sys.war { --sys-a: #FFC9A8; --sys-b: #FF7348; box-shadow: inset 0 0 0 2px rgba(255,255,255,.45); }
.msg.sys.notice { --sys-a: #E4EEFF; --sys-b: #A8C3F2; }
.sys-ico { width: 34px; height: 34px; border-radius: 9px; border: 2px solid var(--ink); background: radial-gradient(circle at 50% 35%, #2A6FD0, #0B2459); overflow: hidden; display: grid; place-items: center; }
.sys-ico > img { width: 100%; height: 100%; object-fit: contain; }
.sys-ico .pava { width: 100%; height: 100%; }
.sys-ico .pava img { border: 0; box-shadow: none; border-radius: 0; }
.sys-main { min-width: 0; }
.sys-meta { display: flex; align-items: center; gap: 6px; line-height: 1; }
.sys-tag { font: 12px var(--display); letter-spacing: .08em; text-transform: uppercase; color: var(--gold); background: var(--ink); border-radius: 4px; padding: 3px 5px 2px; }
.msg.sys time { margin-left: auto; font: 800 11px var(--body); color: rgba(4,16,46,.62); flex: none; }
.sys-text { margin: 3px 0 0; font: 700 14px/1.3 var(--body); overflow-wrap: anywhere; }
.sys-link { display: inline; background: none; border: 0; padding: 0; color: inherit; font: inherit; font-weight: 900; cursor: pointer;
  text-decoration: underline; text-decoration-style: dotted; text-decoration-thickness: 2px; text-underline-offset: 2px; }
.sys-link:hover, .sys-link:focus-visible { text-decoration-style: solid; }
.sys-link.fac { white-space: nowrap; }
.sys-empty { color: var(--sub); text-align: center; padding: 30px 10px; }
.reply-bar { display: flex; gap: 6px; align-items: center; padding: 4px 10px; font-size: 12px; background: #0D2A60; }
.reply-bar .iconbtn { width: 28px; height: 28px; }
.chat-foot { padding: 8px; border-top: 2px solid var(--ink); background: #0D2A60; box-shadow: inset 0 1px 0 var(--card-line); }
.chat-form { display: flex; gap: 6px; }
.chat-in { flex: 1; min-width: 0; padding: 10px; }
.count { font-size: 10px; color: #6F8DBE; }

/* ---------- screen headers */
.screen-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.screen-head .title { margin: 0; }

/* ---------- home hub */
.home { min-height: 100%; padding: 18px; position: relative; background: #0A2A66 var(--hub-bg, none) center / cover no-repeat; }
.home::before { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(5,22,64,.1), rgba(5,22,64,.6)); pointer-events: none; }
.hub { position: relative; display: grid; gap: 14px; grid-template-columns: 1.55fr 1fr 1fr; grid-template-rows: 220px 196px 164px 150px 170px; grid-template-areas: "wreck rivals rivals" "wreck city create" "gigas lab quests" "faction faction rankings" "event event research"; max-width: 1240px; margin: 0 auto; }
.tile { position: relative; overflow: hidden; border: 3px solid var(--ink); border-radius: 12px; padding: 12px 14px 12px; text-align: left; color: #fff;
  display: flex; flex-direction: column; justify-content: flex-end; align-items: flex-start; gap: 2px;
  background: #123E85 var(--tile-bg, none) center / cover no-repeat; box-shadow: inset 0 0 0 2px var(--line), 0 6px 0 rgba(4,16,46,.7); transition: transform .12s, filter .12s; }
.tile:hover:not(.locked) { transform: translateY(-3px); filter: brightness(1.08); }
.tile::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 40%, rgba(4,16,46,.9)); pointer-events: none; z-index: 1; }
.tile .t-title { position: relative; z-index: 3; font: 42px/1 var(--display); letter-spacing: .02em; text-transform: uppercase; text-shadow: var(--outline); }
.tile .t-sub { position: relative; z-index: 3; max-width: 100%; font: 800 13px/1.25 var(--body); color: var(--sub); text-shadow: 0 1px 0 var(--ink), 0 0 6px var(--ink); }
.tile .t-mons { position: absolute; right: 4px; bottom: 0; top: 8px; display: flex; align-items: flex-end; z-index: 2; }
.tile .t-mons img { height: 100%; width: auto; object-fit: contain; margin-left: -16%; filter: drop-shadow(0 6px 0 rgba(4,16,46,.6)); }
.tile .t-badge { position: absolute; top: 10px; right: 10px; z-index: 4; font-size: 16px; }
.tile.tl-wreck { grid-area: wreck; } .tile.tl-wreck .t-title { font-size: 64px; }
.tile.tl-wreck .t-mons { left: 26%; justify-content: flex-end; top: 30px; }
.tile.tl-rivals { grid-area: rivals; } .tile.tl-faction { grid-area: faction; } .tile.tl-rankings { grid-area: rankings; } .tile.tl-city { grid-area: city; }
.tile .t-div { position: absolute; right: 14px; top: 10px; height: 78%; width: auto; z-index: 2; filter: drop-shadow(0 5px 0 rgba(4,16,46,.6)); }
.tile .t-emb { position: absolute; right: 16px; top: 12px; height: 74%; width: auto; z-index: 2; filter: drop-shadow(0 5px 0 rgba(4,16,46,.6)); }
.tile.tl-faction .t-title { font-size: 36px; } .tile.tl-gigas { grid-area: gigas; } .tile.tl-lab { grid-area: lab; } .tile.tl-quests { grid-area: quests; }
.tile.tl-create { grid-area: create; background: linear-gradient(180deg, rgba(255,111,184,.5), rgba(181,18,108,.82)), #B5126C var(--tile-bg, none) 50% 45% / cover no-repeat; box-shadow: inset 0 0 0 2px #FFC0E0, 0 6px 0 rgba(4,16,46,.7); }
.tile.tl-create .t-icon { width: 46%; height: auto; right: 6px; top: 6px; }
.tile.tl-lab { background: #123E85 var(--tile-bg, none) 50% 40% / cover no-repeat; }
.tile .t-lock { position: absolute; right: 14px; top: 12px; z-index: 4; text-align: right; font: 24px var(--display); letter-spacing: .04em; text-shadow: var(--outline); color: var(--gold); }
.tile .t-lock small { display: block; font: 800 12px var(--body); color: #E2F2FF; text-shadow: 0 1px 0 var(--ink); letter-spacing: 0; }
.tile .t-prog { position: absolute; left: 15px; bottom: 16px; right: 42%; z-index: 3; display: grid; gap: 5px; }
.tile .t-prog .bar { height: 14px; }
.tile .t-boss { position: absolute; top: 12px; left: 12px; z-index: 3; width: 76px; height: 76px; border-radius: 50%; overflow: hidden; border: 3px solid var(--ink); box-shadow: 0 0 0 3px var(--red); background: #6B1A28; }
.tile .t-boss img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.tile .t-icon { position: absolute; right: 12px; top: 12px; width: 84px; height: 84px; object-fit: contain; z-index: 2; filter: drop-shadow(0 4px 0 rgba(4,16,46,.6)); }

/* ---------- lab */
.lab { height: 100%; display: flex; flex-direction: column; }
.scene { flex: 1; overflow-x: auto; overflow-y: hidden; min-height: 0; scrollbar-width: thin; scrollbar-color: var(--line) var(--bg1); }
.scene-inner { position: relative; height: 100%; aspect-ratio: 16 / 9; min-height: 300px; margin: 0 auto; background: #2B6FB8; }
.map-inner.ch-c1 { background: #3E8FD6; } .map-inner.ch-c2 { background: #CFE6F5; } .map-inner.ch-c3 { background: #4F6B3A; }
.scene-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; user-select: none; }
.hotspot { position: absolute; background: transparent; border: 3px solid transparent; border-radius: 14px; transition: background .15s, border-color .15s; }
.hotspot:hover, .hotspot:focus-visible { background: rgba(99,198,255,.16); border-color: var(--line); box-shadow: 0 0 24px rgba(99,198,255,.5); }
.hs-label { position: absolute; left: 50%; bottom: 6%; transform: translateX(-50%); font: clamp(15px, 1.7vw, 22px) var(--display); letter-spacing: .04em; text-transform: uppercase; color: #fff; text-shadow: var(--outline-sm);
  background: linear-gradient(180deg, #49AEFF, #1765D3); border: 2px solid var(--ink); border-radius: 8px; padding: 3px 12px; box-shadow: inset 0 2px 0 rgba(255,255,255,.45), 0 3px 0 var(--ink); white-space: nowrap; }
.floor { position: absolute; left: 0; right: 0; bottom: 2%; height: 30%; display: flex; justify-content: center; align-items: flex-end; gap: 2%; pointer-events: none; }
.floor-mon { pointer-events: auto; background: none; border: 0; padding: 0; height: 100%; aspect-ratio: 1; }
.floor-mon img { width: 100%; height: 100%; object-fit: contain; object-position: bottom; filter: drop-shadow(0 6px 0 rgba(4,16,46,.5)); }
.bob0 { animation: bob 2.2s ease-in-out infinite; } .bob1 { animation: bob 2.6s .3s ease-in-out infinite; } .bob2 { animation: bob 2.4s .6s ease-in-out infinite; }
.lab-bar { display: flex; gap: 10px; justify-content: center; padding: 10px; background: #071F4E; border-top: 3px solid var(--ink); box-shadow: inset 0 2px 0 var(--card-line); flex-wrap: wrap; }
.lab-bar .btn .ic { width: 22px; height: 22px; object-fit: contain; margin-right: 6px; vertical-align: -4px; }
.panel-body { display: grid; gap: 10px; }
.splicer-head { display: flex; gap: 12px; align-items: center; }
.splicer-art { width: 120px; flex: none; animation: bob 2.4s ease-in-out infinite; filter: drop-shadow(0 6px 0 rgba(4,16,46,.5)); }
.splicer-head p { margin: 2px 0; }
.opt { display: flex; gap: 10px; align-items: center; padding: 10px 12px; }
.opt-main { flex: 1; }
.opt-main > b { font: 22px var(--display); letter-spacing: .03em; text-transform: uppercase; text-shadow: var(--outline-sm); }
.opt-main p b { font-weight: 800; color: #fff; } /* emphasis inside the text, not a second title */
.opt-main p { margin: 2px 0 6px; font-size: 13px; color: #D7ECFF; }
.bp-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.bp { display: flex; gap: 8px; align-items: center; padding: 6px; }
.bp-art { width: 58px; height: 58px; object-fit: contain; border-radius: 8px; border: 2px solid var(--ink); flex: none; }
.bp-info { flex: 1; display: grid; gap: 3px; font-size: 13px; }
.bp-info b { font: 18px var(--display); letter-spacing: .03em; text-transform: uppercase; }
.picker { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 10px; scrollbar-color: var(--line) transparent; }
.vat-target { display: flex; gap: 14px; align-items: center; }
.vat-art { width: 130px; height: 130px; border-radius: 10px; border: 2px solid var(--ink); box-shadow: inset 0 0 0 2px rgba(255,255,255,.3); display: grid; place-items: center; flex: none; }
.vat-art img { max-height: 122px; object-fit: contain; }
.vat-art.munching img { animation: munch .5s; }
@keyframes munch { 25% { transform: scale(1.15, .9); } 50% { transform: scale(.92, 1.1); } 75% { transform: scale(1.06, .96); } }
.vat-info { flex: 1; display: grid; gap: 4px; }
.vat-info > b { font: 26px var(--display); letter-spacing: .03em; text-transform: uppercase; text-shadow: var(--outline-sm); }
.munch-list { display: grid; gap: 6px; }
.munch { display: flex; align-items: center; gap: 8px; padding: 6px 8px; }
.munch-art { width: 50px; height: 50px; object-fit: contain; flex: none; }
.munch-info { flex: 1; display: grid; font-size: 13px; }
.munch-info b { font: 17px var(--display); letter-spacing: .03em; text-transform: uppercase; }
.munch-info .have, .mitem .have { font: 22px var(--display); color: var(--gold); text-shadow: var(--outline-sm); }
.qty-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 6px 0 2px; }
.qty-step { display: inline-flex; align-items: stretch; border: 2px solid var(--ink); border-radius: 8px; overflow: hidden; background: #061634; box-shadow: inset 0 0 0 1px var(--card-line); }
.qty-step input { width: 64px; border: 0; border-left: 2px solid var(--ink); border-right: 2px solid var(--ink); border-radius: 0; background: transparent; color: #fff; font: 20px var(--display); text-align: center; padding: 2px 4px; -moz-appearance: textfield; appearance: textfield; }
.qty-step input::-webkit-outer-spin-button, .qty-step input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.qty-b { width: 34px; border: 0; background: linear-gradient(180deg, #3D8BFF, #1F5FD0); color: #fff; font: 22px/1 var(--display); text-shadow: var(--outline-sm); cursor: pointer; }
.qty-b:disabled { filter: grayscale(.7) brightness(.7); cursor: default; }
.qty-b:focus-visible, .qty-step input:focus-visible { outline: 3px solid var(--gold); outline-offset: -3px; }
.qty-quick { display: flex; flex-wrap: wrap; gap: 5px; }
.qty-quick .chipbtn { font-size: 13px; padding: 3px 10px; }
.brew-panel { display: grid; gap: 12px; }
.brew-head { display: flex; gap: 12px; align-items: center; }
.brew-head .munch-art { width: 72px; height: 72px; object-fit: contain; flex: none; }
.brew-head .title { margin: 0; }
.brew-total { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 12px; background: var(--card); border: 2px solid var(--ink); border-radius: 8px; box-shadow: inset 0 0 0 1px var(--card-line); }
.brew-total > span:first-child { font: 18px var(--display); text-transform: uppercase; letter-spacing: .03em; }
.brew-total small { flex-basis: 100%; }
.shop-card.bulk .qty-pick { margin-top: 4px; }
.munch-btns { display: flex; gap: 5px; flex-wrap: wrap; justify-content: flex-end; }
.evo { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: center; padding: 8px; }
.evo.focus { box-shadow: inset 0 0 0 2px var(--gold); }
.evo-pair { display: flex; align-items: center; gap: 4px; }
.evo-art { width: 80px; height: 80px; border-radius: 8px; border: 2px solid var(--ink); display: grid; place-items: center; overflow: hidden; }
.evo-art img { max-height: 74px; object-fit: contain; }
.evo-info { display: grid; gap: 4px; font-size: 13px; }
.evo-info b { font: 18px var(--display); letter-spacing: .03em; text-transform: uppercase; }
.evo.evolving { box-shadow: inset 0 0 0 2px rgba(130,255,170,.7); background-image: radial-gradient(circle at 20% 50%, rgba(130,255,170,.16), transparent 60%); }
.evo-art.cocoon { background: radial-gradient(circle, rgba(130,255,170,.45), rgba(10,60,40,.9)); animation: cocoon 1.6s ease-in-out infinite; }
.evo-art.cocoon img { filter: brightness(0) drop-shadow(0 0 6px #8CFFB0); opacity: .75; }
.arrow.pulse { animation: rs-pulse 1.2s ease-in-out infinite; }
@keyframes cocoon { 50% { box-shadow: 0 0 18px rgba(130,255,170,.8); transform: scale(1.04); } }
.evo-clock { font: 22px var(--display); color: #9DFFB9; text-shadow: var(--outline-sm); }
@media (prefers-reduced-motion: reduce) { .evo-art.cocoon, .arrow.pulse { animation: none; } }
.arrow { font: 24px var(--display); color: var(--gold); }

/* ---------- roster (Gigas screen) */
.gigas, .quests { padding: 16px; padding-bottom: 60px; max-width: 1280px; margin: 0 auto; }
.tabs { display: flex; gap: 0; margin: 0 0 -2px 12px; position: relative; z-index: 1; }
.tabs button { font: 21px var(--display); letter-spacing: .04em; text-transform: uppercase; color: #BFE4FF; text-shadow: var(--outline-sm); border: 0; padding: 11px 38px 8px;
  background: linear-gradient(180deg, #164591, #0D2A60); clip-path: polygon(16px 0, calc(100% - 16px) 0, 100% 100%, 0 100%); margin-right: -10px; }
/* In-screen tabs use gold for the open tab so they never read as a second row of main navigation. */
.tabs button.on { color: var(--ink); text-shadow: none; background: linear-gradient(180deg, #FFE68A, var(--gold) 55%, #F2B321); }
.tabs button:not(.on):hover { color: #fff; filter: brightness(1.15); }
.roster { padding: 16px; }
.team-strip { padding: 10px 12px; margin-bottom: 14px; background: rgba(4,16,46,.35); border-radius: 10px; box-shadow: inset 0 0 0 1px var(--card-line); }
.team-strip h3 { margin: 0 0 6px; font: 22px var(--display); letter-spacing: .04em; text-transform: uppercase; text-shadow: var(--outline-sm); }
.slots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.slot { position: relative; border: 2px solid var(--ink); border-radius: 8px; height: 112px; display: grid; justify-items: center; align-content: end; padding: 4px; overflow: hidden; box-shadow: inset 0 0 0 2px rgba(255,255,255,.25); }
.slot img { position: absolute; inset: 4px 4px 22px; width: calc(100% - 8px); height: calc(100% - 26px); object-fit: contain; }
.slot small { position: relative; font: 15px var(--display); letter-spacing: .03em; text-transform: uppercase; text-shadow: var(--outline-sm); color: #fff; }
.slot.empty { place-content: center; background: rgba(4,16,46,.45); box-shadow: inset 0 0 0 2px var(--card-line); }
.slot .x { position: absolute; top: 3px; right: 7px; font: 18px var(--display); color: #fff; text-shadow: var(--outline-sm); font-style: normal; }
.sortbar { display: flex; gap: 8px; align-items: center; margin: 4px 0 12px; }
.sortbar span { font: 17px var(--display); letter-spacing: .04em; color: var(--sub); }
.sortbar.wrap { flex-wrap: wrap; }
.sortbar .sb-label { font: 15px var(--display); text-transform: uppercase; letter-spacing: .05em; color: var(--sub); min-width: 44px; }
.roster-tools { display: grid; gap: 2px; margin: 4px 0 10px; }
.roster-tools .sortbar { margin: 0 0 6px; }
.ggrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.gcard { position: relative; display: flex; flex-direction: column; height: 186px; padding: 8px 10px 10px; overflow: hidden; text-align: left; color: #fff;
  background: linear-gradient(180deg, #13397F, #0B2459 60%); border: 2px solid var(--ink); border-radius: 8px; box-shadow: inset 0 0 0 2px var(--card-line), 0 4px 0 rgba(4,16,46,.6); }
.gcard:hover { box-shadow: inset 0 0 0 2px #fff, 0 4px 0 rgba(4,16,46,.6); }
.gcard > * { flex: none; }
.gcard .gc-lv { font: 16px var(--display); letter-spacing: .05em; color: var(--sub); text-shadow: var(--outline-sm); z-index: 2; }
.gcard .gc-name { display: grid; z-index: 2; line-height: 1; margin-top: 2px; max-width: 60%; }
.gcard .gc-name small { font: 16px var(--display); letter-spacing: .04em; color: #D7ECFF; text-shadow: var(--outline-sm); text-transform: uppercase; }
.gcard .gc-name b { font: 34px var(--display); letter-spacing: .02em; text-transform: uppercase; text-shadow: var(--outline); white-space: nowrap; }
.gcard .gc-art { position: absolute; right: -4px; top: 2px; bottom: 40px; width: 52%; display: grid; place-items: center end; z-index: 1; }
.gcard .gc-art::before { content: ''; position: absolute; right: 6%; top: 10%; width: 84%; aspect-ratio: 1; border-radius: 50%; opacity: .55; }
.gcard.el-thermal .gc-art::before { background: radial-gradient(circle, var(--thermal), transparent 68%); }
.gcard.el-cryo .gc-art::before { background: radial-gradient(circle, var(--cryo), transparent 68%); }
.gcard.el-toxic .gc-art::before { background: radial-gradient(circle, var(--toxic), transparent 68%); }
.gcard .gc-art img { position: relative; max-height: 100%; max-width: 100%; object-fit: contain; filter: drop-shadow(0 4px 0 rgba(4,16,46,.6)); }
.gcard .gc-mid { display: flex; align-items: center; gap: 8px; z-index: 2; margin-top: auto; margin-bottom: 5px; }
.hexb { width: 34px; height: 38px; display: grid; place-items: center; font: 17px var(--display); color: var(--ink); background: linear-gradient(180deg, #F4F8FF, #9FB2D6); clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); flex: none; }
.hexb.el-thermal { background: linear-gradient(180deg, #FFD0A0, var(--thermal)); } .hexb.el-cryo { background: linear-gradient(180deg, #D6F7FF, var(--cryo)); } .hexb.el-toxic { background: linear-gradient(180deg, #E3FBC6, var(--toxic)); }
.gcard .gc-form { font: 15px var(--display); letter-spacing: .05em; color: var(--sub); text-shadow: var(--outline-sm); }
.gcard .gc-rule { height: 3px; background: linear-gradient(90deg, var(--orange), #FFD08A 50%, var(--orange)); border-radius: 2px; z-index: 2; margin-bottom: 6px; }
.gcard .gc-bar { position: relative; height: 24px; background: #061634; border: 2px solid var(--ink); border-radius: 4px; box-shadow: inset 0 0 0 1px var(--card-line); overflow: hidden; z-index: 2; }
.gcard .gc-bar i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(180deg, #7CD9FF, #1C8FE0); }
.gcard .gc-bar em { position: relative; display: block; text-align: center; font: 16px/20px var(--display); font-style: normal; letter-spacing: .05em; text-shadow: var(--outline-sm); }
.gcard .gc-bar.ready i { background: linear-gradient(180deg, #8EF59A, #2DB848); }
.gcard .tag.team { top: 8px; right: 8px; z-index: 3; }
.mgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.mcard { position: relative; display: grid; grid-template-rows: auto 1fr; padding: 0; overflow: hidden; text-align: left; color: #fff;
  background: var(--card); border: 2px solid var(--ink); border-radius: 8px; box-shadow: inset 0 0 0 1px var(--card-line), 0 3px 0 rgba(4,16,46,.6); }
.mcard.sel { box-shadow: inset 0 0 0 2px #fff, 0 0 0 3px var(--gold); transform: translateY(-2px); }
.mcard-art { height: 120px; display: grid; place-items: center; border-bottom: 2px solid var(--ink); }
.mcard-art img { max-height: 112px; object-fit: contain; }
.mcard .tag.team { top: 6px; left: 6px; }
.tag.evolving { background: #8CFFB0; text-transform: none; white-space: nowrap; }
.gcard .tag.evolving { top: 40px; right: 8px; z-index: 3; }
.mcard .tag.evolving { bottom: 6px; left: 6px; font-size: 11px; z-index: 2; }
.mcard.evolving .mcard-art { filter: saturate(.35) brightness(.8); }
.mcard-info { padding: 5px 8px 8px; display: grid; gap: 3px; }
.mcard-info b { font: 18px var(--display); letter-spacing: .03em; text-transform: uppercase; text-shadow: var(--outline-sm); }
.mcard .lv { font: 800 13px var(--body); color: var(--sub); } .mcard .lv small { opacity: .7; }
.mcard-sub { display: flex; justify-content: space-between; align-items: center; }
.mcard.compact { flex: none; width: 112px; }
.mcard.compact .mcard-art { height: 76px; } .mcard.compact .mcard-art img { max-height: 70px; }
.mcard.compact .mcard-info b { font-size: 15px; }
.munchgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.mitem { display: grid; grid-template-columns: 72px 1fr; gap: 2px 10px; align-items: center; padding: 10px; }
.mitem img { grid-row: 1 / 5; width: 72px; height: 72px; object-fit: contain; }
.mitem b { font: 20px var(--display); letter-spacing: .03em; text-transform: uppercase; text-shadow: var(--outline-sm); }
.mitem small { color: var(--sub); }
.pedia { display: grid; gap: 10px; }
.pedia-row { display: flex; gap: 14px; padding: 12px; align-items: center; flex-wrap: wrap; }
.pedia-forms { display: flex; gap: 6px; }
.pf { width: 92px; display: grid; justify-items: center; font: 14px var(--display); letter-spacing: .03em; text-transform: uppercase; }
.pf img, .pf .art-missing { width: 86px; height: 86px; object-fit: contain; }
.pedia-info { flex: 1; min-width: 200px; }
.pedia-info > b { font: 26px var(--display); letter-spacing: .03em; text-transform: uppercase; text-shadow: var(--outline-sm); }
.pedia-info p { margin: 4px 0 0; font-size: 13px; color: #D7ECFF; }
.detail-top { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.detail-art { width: 180px; height: 180px; border-radius: 10px; border: 2px solid var(--ink); box-shadow: inset 0 0 0 2px rgba(255,255,255,.3); display: grid; place-items: center; flex: none; }
.detail-art img { max-height: 170px; object-fit: contain; }
.detail-head { flex: 1; display: grid; gap: 6px; min-width: 200px; }
.might { font: 18px var(--display); letter-spacing: .04em; color: var(--gold); text-shadow: var(--outline-sm); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(74px, 1fr)); gap: 6px; }
.stats > div { padding: 4px 6px; display: grid; text-align: center; }
.stats small { font: 800 10px var(--body); color: var(--sub); }
.stats b { font: 22px var(--display); letter-spacing: .03em; }
.abil { padding: 7px 10px; }
.abil > b { font: 18px var(--display); letter-spacing: .03em; text-transform: uppercase; color: var(--gold); text-shadow: var(--outline-sm); }
.abil p { margin: 3px 0 0; font-size: 13px; }
.lore { font-style: italic; font-size: 13px; margin: 0; color: #D7ECFF; }

/* ---------- quests */
.qsec { display: grid; gap: 8px; margin-bottom: 8px; }
.quest { display: flex; gap: 12px; align-items: center; padding: 10px 14px; }
.quest.done { opacity: .55; }
.quest.locked { filter: saturate(.3); opacity: .7; }
.q-main { flex: 1; display: grid; gap: 4px; }
.q-main > b { font: 22px var(--display); letter-spacing: .03em; text-transform: uppercase; text-shadow: var(--outline-sm); }
.q-main p { margin: 0; font-size: 13px; color: #E2F2FF; }
.q-prog { display: flex; gap: 8px; align-items: center; }
.q-prog .bar { flex: 1; max-width: 260px; }
.q-prog small { font: 16px var(--display); letter-spacing: .04em; }

/* ---------- city */
.city { position: relative; height: 100%; overflow: hidden; background: linear-gradient(180deg, #F26B3A 0, #FFB347 38%, #1E6B78 41%, #0C3E4E 100%); }
.city-canvas { width: 100%; height: 100%; display: block; touch-action: manipulation; }
.city-hud { position: absolute; top: 10px; left: 12px; right: 12px; display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; flex-wrap: wrap; pointer-events: none; }
.city-hud > * { pointer-events: auto; }
.city-title { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.city-title .title { margin: 0; }
.city-sheet { position: absolute; z-index: 3; left: 50%; bottom: 10px; transform: translateX(-50%); width: min(600px, calc(100% - 16px)); max-height: 48%; overflow: auto; padding: 12px; display: grid; gap: 8px; animation: fade .2s;
  background: linear-gradient(180deg, #1F74DB, #1559B8 30%, #0F468F); border: 3px solid var(--ink); border-radius: 12px; box-shadow: inset 0 0 0 2px var(--line), 0 8px 0 rgba(0,0,0,.4); }
.sheet-head { display: flex; gap: 10px; align-items: flex-start; }
.sheet-head > div { flex: 1; }
.sheet-head p { margin: 2px 0; font-size: 13px; color: #E2F2FF; }
.sheet-head b { font: 17px var(--display); letter-spacing: .04em; color: var(--gold); }
.sheet-art { width: 70px; height: 70px; object-fit: contain; flex: none; }
.upg { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; padding: 6px 8px; }
.upg > b { margin-right: auto; font: 18px var(--display); letter-spacing: .03em; text-transform: uppercase; }
.build-list { display: grid; gap: 6px; }
.build-opt { display: flex; gap: 8px; align-items: center; padding: 6px; }
.bo-art { width: 56px; height: 56px; object-fit: contain; flex: none; }
.bo-info { flex: 1; display: grid; gap: 2px; font-size: 13px; }
.bo-info b { font: 18px var(--display); letter-spacing: .03em; text-transform: uppercase; }
.city-list { position: absolute; inset: 66px 10px 10px; overflow: auto; padding: 12px;
  background: linear-gradient(180deg, #1F74DB, #1559B8 30%, #0F468F); border: 3px solid var(--ink); border-radius: 12px; box-shadow: inset 0 0 0 2px var(--line); }
.tbl { width: 100%; border-collapse: collapse; margin-bottom: 10px; }
.tbl th { font: 17px var(--display); letter-spacing: .04em; text-transform: uppercase; color: var(--sub); text-align: left; padding: 6px; }
.tbl td { text-align: left; padding: 7px 6px; border-top: 1px solid var(--card-line); }

/* ---------- map */
.map { height: 100%; display: flex; flex-direction: column; }
.map-head { display: flex; gap: 10px; align-items: center; padding: 10px 14px; flex-wrap: wrap; }
.map-head .title { margin: 0; }
.map-chapters { display: flex; gap: 6px; flex-wrap: wrap; }
.map-chapters .chipbtn.locked { opacity: .5; }
.map-chapters .chipbtn:not(.on) { min-width: 34px; justify-content: center; }
.chip.villain { gap: 6px; padding: 2px 10px 2px 2px; font-size: 13px; }
.chapter-unlock { display: flex; align-items: center; gap: 12px; margin: 10px auto; padding: 8px 14px 8px 8px; max-width: 360px; border-radius: 16px; background: linear-gradient(135deg, #DFF3FF, #B8DDFB); color: #10204A; box-shadow: 0 0 0 3px #fff, 0 6px 18px rgba(0,0,0,.25); animation: cardIn .45s cubic-bezier(.2,1.4,.4,1) both; }
.chapter-unlock img { width: 64px; height: 64px; object-fit: contain; }
.chapter-unlock div { display: flex; flex-direction: column; text-align: left; }
.chapter-unlock small { text-transform: uppercase; letter-spacing: .08em; font-weight: 800; color: #2A5DB0; }
.chapter-unlock b { font-family: var(--display, inherit); font-size: 20px; }
.chip.villain .chip-face { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; object-position: top; background: #0E2D63; }
.map-scene { flex: 1; }
.map-path { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.path-under { fill: none; stroke: var(--ink); stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; stroke-width: 12px; }
.path-over { fill: none; stroke: #fff; stroke-dasharray: 2 2; stroke-linecap: round; vector-effect: non-scaling-stroke; stroke-width: 5px; }
.node { position: absolute; transform: translate(-50%, -50%); display: grid; justify-items: center; gap: 3px; background: none; border: 0; padding: 0; }
.node-n, .node-face { width: clamp(52px, 6vw, 72px); height: clamp(58px, 6.8vw, 80px); display: grid; place-items: center; font: clamp(24px, 2.8vw, 34px) var(--display); color: #fff; text-shadow: var(--outline);
  background: linear-gradient(180deg, #49AEFF, #1765D3); clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); overflow: hidden; }
.node .node-n, .node .node-face { filter: drop-shadow(0 4px 0 var(--ink)); }
.node-face { width: clamp(72px, 8vw, 98px); height: clamp(80px, 9vw, 110px); background: linear-gradient(180deg, #FF7A8C, #B5122E); }
.node-face img { width: 84%; height: 84%; object-fit: cover; object-position: top; clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); }
.node-label { font: clamp(13px, 1.4vw, 17px) var(--display); letter-spacing: .04em; text-transform: uppercase; background: var(--ink); color: #fff; padding: 2px 10px; border-radius: 6px; box-shadow: inset 0 0 0 1px var(--card-line); white-space: nowrap; }
.node.cleared .node-n { background: linear-gradient(180deg, #74EE85, #22A13B); }
.node.locked { filter: grayscale(1) brightness(.7); }
.node.next .node-n, .node.next .node-face { animation: ping 1.2s ease-in-out infinite; }
@keyframes ping { 50% { filter: drop-shadow(0 4px 0 var(--ink)) drop-shadow(0 0 14px #fff) brightness(1.25); } }
/* Nodes scale with the map picture itself (container units), not the window, so the measured spots
   in NODES never crowd each other whatever the map's size (0.19.2: they overlapped on smaller maps). */
.map-inner { container-type: size; }
.map-inner .node { gap: .35cqh; }
.map-inner .node-n { width: clamp(40px, 7.2cqh, 72px); height: clamp(44px, 8cqh, 80px); font-size: clamp(18px, 3.4cqh, 34px); }
.map-inner .node-face { width: clamp(52px, 10cqh, 98px); height: clamp(58px, 11.2cqh, 110px); }
.map-inner .node-label { font-size: clamp(11px, 1.9cqh, 17px); padding: .1em .6em; border-radius: .4em; }
.map-inner .node .stars i { width: clamp(10px, 2cqh, 16px); height: clamp(10px, 2cqh, 16px); }
.prep-head { display: flex; gap: 12px; align-items: center; }
.prep-head small { font: 15px var(--display); letter-spacing: .05em; color: var(--sub); }
.prep-speaker { width: 92px; height: 92px; border-radius: 50%; overflow: hidden; border: 3px solid var(--ink); box-shadow: 0 0 0 3px var(--line); background: radial-gradient(circle at 50% 35%, #7FD6FF, #1F6FD0); flex: none; }
.prep-speaker img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.prep-head .title { margin: 0; }
.prep-intel, .prep-rewards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px; padding: 10px; }
.prep-intel small, .prep-rewards small { font: 15px var(--display); letter-spacing: .05em; color: var(--sub); display: block; margin-bottom: 4px; text-transform: uppercase; }
.teaser { width: 58px; height: 58px; display: inline-grid; place-items: center; border: 2px dashed var(--line); border-radius: 8px; }
.teaser img { max-height: 52px; }
.prep-go { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.prep-go .short { color: #FF97A6; font-weight: 800; }

/* ---------- battle */
.battle { position: absolute; inset: 0; overflow: hidden; background: #3F4A6E; user-select: none; }
.battle-canvas { width: 100%; height: 100%; display: block; touch-action: none; }
.bhud-top { position: absolute; top: calc(8px + var(--safe-t)); left: 10px; right: 10px; display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: start; }
.bstage { justify-self: center; display: grid; justify-items: center; gap: 3px; width: min(460px, 100%); }
.bstage .dist { color: var(--gold); }
.bstage b { font: 21px var(--display); letter-spacing: .05em; text-transform: uppercase; text-shadow: var(--outline-sm); }
.dpips { display: flex; gap: 4px; width: 100%; }
.dpips i { flex: 1; height: 13px; border-radius: 3px; background: #061634; border: 2px solid var(--ink); box-shadow: inset 0 0 0 1px var(--card-line); }
.dpips i.on { background: linear-gradient(180deg, #FFE07A, #F0A20C); } .dpips i.done { background: linear-gradient(180deg, #8EF59A, #2DB848); }
.bres { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.bres .chip { font: 21px var(--display); letter-spacing: .03em; padding: 3px 12px 3px 6px; text-shadow: var(--outline-sm); background: rgba(4,16,46,.82); border: 2px solid var(--ink); box-shadow: inset 0 0 0 1px var(--card-line); }
.bres .chip .ic { width: 30px; height: 30px; }
.bres .chip.loot { position: relative; min-width: 96px; transition: box-shadow .2s; }
.bres .chip.loot.bump { animation: loot-bump .28s ease-out; }
@keyframes loot-bump { 0% { transform: scale(1); } 40% { transform: scale(1.16); box-shadow: inset 0 0 0 1px var(--card-line), 0 0 18px rgba(255,210,63,.9); } 100% { transform: scale(1); } }
.bres .chip.loot .agent-tag { position: absolute; right: -6px; bottom: -12px; font: 12px var(--display); font-style: normal; padding: 1px 6px; border-radius: 6px;
  background: #8A5CFF; color: #fff; border: 2px solid var(--ink); text-shadow: none; letter-spacing: .02em; }
@media (prefers-reduced-motion: reduce) { .bres .chip.loot.bump { animation: none; } }
.bhud-bot { position: absolute; left: 10px; right: 10px; bottom: calc(10px + var(--safe-b)); display: flex; gap: 10px; align-items: flex-end; }
.bhud-bot::before { content: ''; flex: none; width: 78px; } /* mirrors .bctl so the cards sit in the true centre */
.bcards { flex: 1; display: flex; justify-content: center; gap: 8px; max-width: 800px; margin: 0 auto; }
.bcard { position: relative; flex: 0 1 262px; display: flex; gap: 8px; align-items: center; min-width: 0; cursor: pointer; padding: 6px 8px 6px 6px; color: #fff;
  background: linear-gradient(180deg, #164591, #0B2459); border: 2px solid var(--ink); border-radius: 10px; box-shadow: inset 0 0 0 2px var(--card-line), 0 4px 0 rgba(4,16,46,.7); }
.bcard.sel { box-shadow: inset 0 0 0 2px #fff, 0 0 0 3px var(--gold), 0 4px 0 rgba(4,16,46,.7); transform: translateY(-4px); }
.bcard.ko { filter: grayscale(1); opacity: .55; }
.bc-port { width: 56px; height: 56px; border-radius: 50%; overflow: hidden; border: 2px solid var(--ink); box-shadow: 0 0 0 2px var(--line); flex: none; }
.bc-port img { width: 140%; height: 140%; object-fit: contain; margin: -4% 0 0 -20%; }
.el-thermal .bc-port { background: radial-gradient(circle at 50% 40%, #FFB36B, #C64A0C); } .el-cryo .bc-port { background: radial-gradient(circle at 50% 40%, #A6EEFF, #1C86C9); } .el-toxic .bc-port { background: radial-gradient(circle at 50% 40%, #CFF79C, #4E9E1C); }
.bc-info { flex: 1; min-width: 0; display: grid; gap: 3px; }
.bc-info b { font: 18px var(--display); letter-spacing: .03em; text-transform: uppercase; text-shadow: var(--outline-sm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bc-info b small { font: 700 11px var(--body); color: var(--sub); text-shadow: none; }
.bcard kbd { position: absolute; top: -8px; left: -6px; }
.skillbtn { position: absolute; right: -4px; top: -16px; font: 14px var(--display); letter-spacing: .03em; text-transform: uppercase; color: #A9B8D6; text-shadow: var(--outline-sm);
  background: linear-gradient(180deg, #52668E, #36486F); border: 2px solid var(--ink); border-radius: 7px; padding: 2px 8px; max-width: 110%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.skillbtn.ready { color: #fff; background: linear-gradient(180deg, #FF7CC0, #D81C7E); animation: glow .9s ease-in-out infinite; font-size: 16px; }
.bctl { display: grid; gap: 8px; }
.bctl .btn { width: 78px; height: 78px; border-radius: 50%; padding: 0; font-size: 21px; }
.bhint { position: absolute; left: 50%; top: 46%; transform: translateX(-50%); padding: 8px 16px; font: 26px var(--display); letter-spacing: .04em; text-transform: uppercase; text-shadow: var(--outline-sm); pointer-events: none; animation: bob 1s ease-in-out infinite;
  background: linear-gradient(180deg, #FF7CC0, #D81C7E); border: 2px solid var(--ink); border-radius: 10px; box-shadow: inset 0 2px 0 rgba(255,255,255,.45), 0 4px 0 var(--ink); }
.results { display: grid; justify-items: center; gap: 8px; text-align: center; }
.results h1 { font-size: 64px; color: var(--gold); }
/* Long results (new Giga + new chapter) scroll, but the buttons stay in reach. */
.results > .row:last-child { position: sticky; bottom: -20px; z-index: 3; justify-self: stretch; margin: 0 -20px -20px; padding: 10px 20px 16px; background: linear-gradient(180deg, rgba(15,70,143,0), #0F468F 35%); }
.results.lose h1 { color: #FF97A6; }
.res-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; width: 100%; }
.res-row:has(> div:nth-child(4)) { grid-template-columns: repeat(4, 1fr); } /* raids: Wrecked, Stolen, Haul roll, Infamy */
.res-row > div { padding: 5px; display: grid; }
.res-row small { font: 800 11px var(--body); color: var(--sub); }
.res-row b { font: 28px var(--display); letter-spacing: .03em; }
.new-giga { position: relative; overflow: hidden; display: grid; justify-items: center; padding: 10px; border: 2px solid var(--ink); border-radius: 10px; width: 100%; background: #0B2459; box-shadow: inset 0 0 0 2px var(--gold); }
.new-giga img { max-height: 150px; }
.new-giga b { font: 28px var(--display); letter-spacing: .03em; color: var(--gold); text-shadow: var(--outline); }
.xp-list { display: grid; gap: 4px; width: 100%; }
.xp-row { display: flex; align-items: center; gap: 8px; padding: 3px 8px; font-size: 13px; }
.xp-row img { width: 36px; height: 36px; object-fit: contain; }
.xp-row b, .xp-row small { margin-left: auto; }

/* ---------- profile dossier, settings, help */
.modal.prof-modal { padding: 0; width: min(880px, 100%); }
.prof-banner { position: relative; display: grid; grid-template-columns: auto 1fr auto; gap: 18px; align-items: center; padding: 22px 64px 20px 22px; overflow: hidden;
  background: radial-gradient(circle at 10% 20%, rgba(127,214,255,.55), transparent 45%), linear-gradient(180deg, #2C8BEE, #0E3A85); border-bottom: 3px solid var(--ink); box-shadow: inset 0 -2px 0 var(--line); }
.prof-banner::before { content: ''; position: absolute; inset: 0; background: var(--pattern); pointer-events: none; }
.prof-banner > * { position: relative; }
.prof-banner.role-dev { background: radial-gradient(circle at 10% 20%, rgba(255,120,120,.55), transparent 45%), linear-gradient(180deg, #D3203D, #4A0B1E); box-shadow: inset 0 -2px 0 var(--dev); }
.prof-banner.role-tester { background: radial-gradient(circle at 10% 20%, rgba(150,250,255,.5), transparent 45%), linear-gradient(180deg, #11A6B8, #07384A); box-shadow: inset 0 -2px 0 var(--tester); }
.prof-banner.role-mod { background: radial-gradient(circle at 10% 20%, rgba(200,255,120,.5), transparent 45%), linear-gradient(180deg, #3F9A1C, #123A10); box-shadow: inset 0 -2px 0 var(--modc); }
.prof-ava { position: relative; width: 132px; height: 132px; flex: none; }
.prof-ava .pa-img { display: block; width: 100%; height: 100%; border-radius: 50%; overflow: hidden; border: 4px solid var(--ink); box-shadow: 0 0 0 4px var(--line), 0 6px 0 rgba(4,16,46,.55); background: radial-gradient(circle at 50% 35%, #7FD6FF, #1F6FD0); }
.prof-ava .pa-img img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.prof-ava.role-dev .pa-img { box-shadow: 0 0 0 4px var(--dev), 0 6px 0 rgba(4,16,46,.55); }
.prof-ava.role-tester .pa-img { box-shadow: 0 0 0 4px var(--tester), 0 6px 0 rgba(4,16,46,.55); }
.prof-ava.role-mod .pa-img { box-shadow: 0 0 0 4px var(--modc), 0 6px 0 rgba(4,16,46,.55); }
.prof-lvl { position: absolute; left: -6px; bottom: -4px; min-width: 44px; height: 44px; padding: 0 6px; border-radius: 22px; display: grid; place-items: center; font: 22px var(--display); text-shadow: var(--outline-sm);
  background: linear-gradient(180deg, #C69BFF, #7B3FDB); border: 3px solid var(--ink); box-shadow: inset 0 2px 0 rgba(255,255,255,.4); }
.prof-ava .odot { right: 8px; bottom: 10px; width: 22px; height: 22px; border-width: 3px; }
.prof-id { min-width: 0; }
.prof-name.pname { margin: 0; font: 48px/1.05 var(--display); text-transform: uppercase; letter-spacing: .02em; text-shadow: var(--outline); white-space: normal; overflow-wrap: anywhere; }
.prof-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 4px; }
.prof-tags .chip { font-size: 13px; padding: 3px 10px; }
.prof-div { display: grid; justify-items: center; text-align: center; min-width: 124px; }
.prof-div .divb { display: block; width: 96px; height: 96px; margin-bottom: 10px; filter: drop-shadow(0 5px 0 rgba(4,16,46,.6)); }
.prof-div b { position: relative; z-index: 1; font: 24px/1.1 var(--display); text-transform: uppercase; letter-spacing: .03em; text-shadow: var(--outline-sm); margin-top: 0; }
.prof-div small { font-weight: 800; color: #E2F2FF; text-shadow: 0 1px 0 var(--ink); }
.prof-body { padding: 16px 20px 20px; display: grid; gap: 12px; }
.prof-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.prof-stats > div { display: grid; padding: 8px 12px; background: var(--card); border: 2px solid var(--ink); border-radius: 8px; box-shadow: inset 0 0 0 1px var(--card-line); }
.prof-stats small { font: 800 11px var(--body); color: var(--sub); text-transform: uppercase; letter-spacing: .05em; }
.prof-stats b { font: 28px/1.1 var(--display); letter-spacing: .03em; }
.prof-cols { display: grid; grid-template-columns: 1.15fr 1fr; gap: 16px; }
.prof-cols .subhead { margin-top: 0; }
.prof-team { display: flex; gap: 8px; flex-wrap: wrap; }
.pt { position: relative; width: 112px; border: 2px solid var(--ink); border-radius: 8px; display: grid; justify-items: center; padding: 4px 4px 6px; font: 13px var(--display); letter-spacing: .03em; text-transform: uppercase; text-shadow: var(--outline-sm); }
.pt img { height: 78px; object-fit: contain; }
.pt i { font: 12px var(--display); font-style: normal; color: #fff; }
.pt-tag { position: absolute; top: 4px; left: 4px; font: 11px var(--display); letter-spacing: .04em; background: var(--gold); color: var(--ink); text-shadow: none; border: 1px solid var(--ink); border-radius: 4px; padding: 0 4px; z-index: 1; }
.prof-raids { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.prof-raids li { display: grid; grid-template-columns: 78px 1fr auto auto; gap: 8px; align-items: center; padding: 6px 10px; background: var(--card); border: 2px solid var(--ink); border-radius: 8px; box-shadow: inset 0 0 0 1px var(--card-line); font-size: 13px; }
.prof-raids small { color: #6F8DBE; font-weight: 700; }
.pr-k { font: 13px var(--display); letter-spacing: .05em; text-transform: uppercase; text-align: center; border: 2px solid var(--ink); border-radius: 6px; padding: 1px 4px; }
.prof-raids .atk .pr-k { background: var(--pink-lo); } .prof-raids .def .pr-k { background: #1D4C95; }
.pr-who { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; color: var(--sub); }
.prof-tabs { margin: 2px 0 -12px 4px; }
.prof-tabs button { padding: 8px 22px 6px; font-size: 18px; }
.prof-pane { display: grid; gap: 12px; align-content: start; min-height: 300px; padding: 14px; background: rgba(4,16,46,.28); border: 2px solid var(--ink); border-radius: 10px; box-shadow: inset 0 0 0 1px var(--card-line); }
.prof-pane .subhead { margin: 2px 0 -4px; }
.prof-level { display: flex; gap: 14px; align-items: center; padding: 8px 12px; background: var(--card); border: 2px solid var(--ink); border-radius: 8px; box-shadow: inset 0 0 0 1px var(--card-line); }
.prof-level > span { display: grid; flex: none; min-width: 96px; }
.prof-level > span small { font: 800 11px var(--body); color: var(--sub); text-transform: uppercase; letter-spacing: .05em; }
.prof-level > span b { font: 26px/1.1 var(--display); color: var(--gold); letter-spacing: .03em; }
.prof-level .grow { display: grid; gap: 5px; min-width: 0; }
.prof-level .bar { height: 12px; }
.prof-level .row { gap: 6px; }
.prof-level .chip { font-size: 12px; padding: 2px 8px; }
.prof-recline { margin: -2px 0 6px; }
.prof-staffmedals { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.prof-staffmedals .chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px 2px 3px; background: rgba(4,16,46,.55); color: #fff; }
.medal .art-missing { min-width: 0; min-height: 0; width: 70%; height: 70%; border-radius: 50%; }
.medal.xs { width: 24px; height: 24px; border-width: 2px; }
.medal.xs.t1 { box-shadow: 0 0 0 2px #CD7F32; }
.medal.ex.xs.t1.role-dev { box-shadow: 0 0 0 2px var(--dev); } .medal.ex.xs.t1.role-tester { box-shadow: 0 0 0 2px var(--tester); } .medal.ex.xs.t1.role-mod { box-shadow: 0 0 0 2px var(--modc); }
.pt-tag.q { background: #B98BFF; }
.prof-els { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.prof-elrow { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: center; padding: 6px 10px; background: var(--card); border: 2px solid var(--ink); border-radius: 8px; box-shadow: inset 0 0 0 1px var(--card-line); }
.prof-elrow small { font: 15px var(--display); letter-spacing: .03em; }
.bar.el-thermal > div { background: linear-gradient(180deg, #FFC08A, var(--thermal)); }
.bar.el-cryo > div { background: linear-gradient(180deg, #D6F7FF, var(--cryo)); }
.bar.el-toxic > div { background: linear-gradient(180deg, #E3FBC6, var(--toxic)); }
.prof-dex { display: grid; grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); gap: 4px; max-height: 236px; overflow: auto; padding: 2px; }
.pd { display: grid; place-items: center; aspect-ratio: 1; border: 2px solid var(--ink); border-radius: 8px; overflow: hidden; }
.pd img { width: 92%; height: 92%; object-fit: contain; }
.pd.el-thermal { background: radial-gradient(circle at 50% 40%, #FFB36B, #C64A0C); }
.pd.el-cryo { background: radial-gradient(circle at 50% 40%, #A6EEFF, #1B7FC6); }
.pd.el-toxic { background: radial-gradient(circle at 50% 40%, #C7F28F, #3E8A1A); }
.pd.no { background: #0B2149; }
.pd.no img { opacity: .45; }
.prof-chs { display: grid; gap: 6px; }
.prof-ch { display: grid; grid-template-columns: 34px 1fr auto auto; gap: 12px; align-items: center; padding: 7px 12px; background: var(--card); border: 2px solid var(--ink); border-radius: 8px; box-shadow: inset 0 0 0 1px var(--card-line); }
.prof-ch.locked { opacity: .5; }
.pc-n { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--ink); background: #1D4C95; font: 17px var(--display); text-shadow: var(--outline-sm); }
.pc-main { display: grid; gap: 3px; min-width: 0; }
.pc-main > b { font: 16px var(--display); letter-spacing: .03em; text-transform: uppercase; text-shadow: var(--outline-sm); }
.pc-stars { display: inline-flex; align-items: center; gap: 2px; font: 16px var(--display); white-space: nowrap; }
.prof-medalgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px; }
.prof-medal { display: flex; gap: 10px; align-items: center; padding: 6px 10px; background: var(--card); border: 2px solid var(--ink); border-radius: 8px; box-shadow: inset 0 0 0 1px var(--card-line); }
.prof-medal > span:last-child { display: grid; min-width: 0; }
.prof-medal b { font: 15px var(--display); letter-spacing: .03em; text-transform: uppercase; }
.prof-medal small { font-weight: 700; color: var(--sub); font-size: 12px; }
.prof-medal.no { opacity: .55; }
.prof-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; border-top: 2px solid rgba(4,16,46,.45); padding-top: 12px; }
.grow { flex: 1; }
.linkish { background: none; border: 0; padding: 0; color: #fff; font: inherit; font-weight: 800; text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 2px; }
.bio { padding: 9px; margin: 0; }
.set-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 12px; font-weight: 800; }
.set-row input[type=checkbox] { width: 22px; height: 22px; accent-color: var(--green); }
.set-row input[type=range] { accent-color: var(--line); }
.help h3 { font: 22px var(--display); letter-spacing: .03em; text-transform: uppercase; margin: 10px 0 2px; color: var(--gold); text-shadow: var(--outline-sm); }
.help p { margin: 0 0 6px; font-size: 14px; }

/* ---------- Phase 2 shared pieces: role colors, avatars, badges */
:is(.msg-meta .msg-user, .pname, .peek-text b, .me-name b, .prof-name).role-dev { color: var(--dev); }
:is(.msg-meta .msg-user, .pname, .peek-text b, .me-name b, .prof-name).role-mod { color: var(--modc); }
:is(.msg-meta .msg-user, .pname, .peek-text b, .me-name b, .prof-name).role-tester { color: var(--tester); }
.chip.role { font: 12px var(--display); letter-spacing: .06em; text-transform: uppercase; border-color: var(--ink); padding: 1px 8px; }
.chip.role.role-dev { background: #C8102E; color: #fff; }
.chip.role.role-mod { background: #7BD31A; color: var(--ink); }
.chip.role.role-tester { background: #19C6D6; color: var(--ink); }
.chip.role.role-tester.off { background: #0B2459; color: var(--sub); }
.chip.ftag { background: #0E2D63; border-color: var(--gold); color: var(--gold); font: 12px var(--display); letter-spacing: .06em; }
.chip.ftag .emb { width: 18px; height: 18px; margin: -3px 0; }
.chip.ftag.big { font-size: 22px; padding: 2px 12px; vertical-align: middle; }
.chip.on { background: var(--green-lo); border-color: var(--green); }
.chip.off { color: var(--sub); }
button.chip { cursor: pointer; } button.chip:hover { filter: brightness(1.15); }
:is(b, span, small).bad { color: #FF8A9A; font-weight: 800; }
.bar.gold > div { background: linear-gradient(180deg, #FFE07A, #F09A0C); }
.badge.inline { position: static; display: inline-block; margin-left: 6px; vertical-align: middle; font-size: 13px; }
button.pname { background: none; border: 0; padding: 0; text-align: left; }
.pname { font: 18px var(--display); letter-spacing: .03em; text-transform: uppercase; text-shadow: var(--outline-sm); color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
button.pname:hover { text-decoration: underline; }
.pava { position: relative; display: inline-block; width: 44px; height: 44px; flex: none; }
.pava img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; object-position: top; border: 2px solid var(--ink); box-shadow: 0 0 0 2px var(--card-line); background: radial-gradient(circle at 50% 35%, #7FD6FF, #1F6FD0); }
.pava.sm { width: 32px; height: 32px; } .pava.lg { width: 76px; height: 76px; } .pava.lg img { border-width: 3px; }
.msg-ava .pava { width: 100%; height: 100%; } .msg-ava .pava img { border: 0; box-shadow: none; }
.odot { position: absolute; right: -1px; bottom: -1px; width: 13px; height: 13px; border-radius: 50%; background: var(--green); border: 2px solid var(--ink); box-shadow: 0 0 6px var(--green); }
.me-name b .chip { font-size: 11px; vertical-align: middle; text-shadow: none; }
/* HUD counters (bell, friends, forum, MOD): a small round number pinned to its own button.
   The bell and forum buttons used to have no positioning, so their counter drifted to the top
   bar's corner as a stray green tab. */
.hudbtns .iconbtn { position: relative; }
.hudbtns .badge { top: -3px; right: -3px; min-width: 19px; height: 19px; padding: 0 4px; border-radius: 10px; font: 12px/15px var(--display);
  background: linear-gradient(180deg, #FF7A8C, #D3203D); box-shadow: 0 2px 0 rgba(4,16,46,.55); pointer-events: none; }
.divb { width: 40px; height: 40px; object-fit: contain; flex: none; }
.divb.sm { width: 26px; height: 26px; } .divb.big { width: 128px; height: 128px; filter: drop-shadow(0 6px 0 rgba(4,16,46,.6)); }
.emb { width: 56px; height: 56px; object-fit: contain; flex: none; }
.emb.xs { width: 18px; height: 18px; } .emb.sm { width: 30px; height: 30px; } .emb.md { width: 54px; height: 54px; }
.emb.xl { width: 120px; height: 120px; filter: drop-shadow(0 6px 0 rgba(4,16,46,.6)); }
.ava-card { position: relative; }
.ava-card .ava-tag { font: 12px var(--display); letter-spacing: .05em; text-transform: uppercase; padding: 1px 8px; border-radius: 99px; border: 2px solid var(--ink); background: var(--ink); color: #fff; text-shadow: none; }
.ava-card.role-dev .ava-port { box-shadow: 0 0 0 3px var(--dev); } .ava-card.role-dev .ava-tag { background: #C8102E; }
.ava-card.role-mod .ava-port { box-shadow: 0 0 0 3px var(--modc); } .ava-card.role-mod .ava-tag { background: #7BD31A; color: var(--ink); }
.ava-card.locked { cursor: not-allowed; background: linear-gradient(180deg, #11336F, #0A1E4B); }
.ob-avatars { width: min(900px, 100%); display: grid; justify-items: center; }
.cpreview { display: grid; gap: 3px; overflow: hidden; min-width: 0; padding: 6px; aspect-ratio: 1; border-radius: 8px; border: 2px solid var(--ink); background: linear-gradient(180deg, #2E7444, #1B4C2B); box-shadow: inset 0 0 0 1px rgba(255,255,255,.18); }
.cp-cell { position: relative; display: grid; place-items: center; aspect-ratio: 1; min-width: 0; min-height: 0; overflow: hidden; border-radius: 4px; background: rgba(4,16,46,.22); }
.cp-cell img { width: 100%; height: 100%; min-width: 0; object-fit: contain; }
.cp-cell.def { background: rgba(255,61,90,.32); box-shadow: inset 0 0 0 1px rgba(255,107,128,.8); }
.cp-cell i { position: absolute; right: 1px; bottom: 0; font: 10px var(--display); font-style: normal; text-shadow: var(--outline-sm); }
.hpbar { position: relative; height: 28px; background: #1A0510; border: 2px solid var(--ink); border-radius: 8px; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(255,61,90,.6); }
.hpbar i { display: block; height: 100%; background: linear-gradient(180deg, #FF7A8C, #C3162F); box-shadow: inset 0 3px 0 rgba(255,255,255,.35); transition: width .4s; }
.results .hpbar { justify-self: stretch; width: min(380px, 100%); margin: 0 auto; }
.hpbar span { position: absolute; inset: 0; display: grid; place-items: center; font: 16px var(--display); letter-spacing: .04em; text-shadow: var(--outline-sm); }
.in { font: 600 15px var(--body); padding: 9px 11px; border: 2px solid var(--ink); border-radius: 8px; background: #061634; color: #fff; box-shadow: inset 0 0 0 1px var(--card-line); min-width: 0; }
.in::placeholder { color: #6F8DBE; }
.field { display: grid; gap: 4px; }
.field > span { font: 15px var(--display); text-transform: uppercase; letter-spacing: .04em; color: var(--sub); }
.field .in, .field textarea { width: 100%; }
.tag-in { max-width: 150px; font: 22px var(--display); letter-spacing: .12em; text-transform: uppercase; }
.emb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 8px; }
.emb-pick { display: grid; place-items: center; padding: 6px; border-radius: 10px; background: var(--card); border: 2px solid var(--ink); box-shadow: inset 0 0 0 1px var(--card-line); }
.emb-pick .emb { width: 60px; height: 60px; }
.emb-pick.sel { background: linear-gradient(180deg, #49AEFF, #1765D3); box-shadow: inset 0 0 0 2px #fff, 0 0 0 3px var(--gold); }

/* chat channel tabs */
.chat-tabs { display: flex; gap: 4px; padding: 6px 8px 0; background: #0A2357; border-bottom: 2px solid var(--ink); }
.chat-tabs button { flex: 1; font: 16px var(--display); text-transform: uppercase; letter-spacing: .04em; color: #BFE4FF; text-shadow: var(--outline-sm); border: 2px solid var(--ink); border-bottom: 0;
  border-radius: 8px 8px 0 0; padding: 6px 8px 5px; background: linear-gradient(180deg, #164591, #0D2A60); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-tabs button.on { color: #fff; background: linear-gradient(180deg, var(--panel-hi), var(--panel)); }
.chat-tabs button.muted { opacity: .55; }
.msg.sys.fac { --sys-a: #C9F9BE; --sys-b: #5CC765; }

/* ---------- Rivals */
.rivals { padding: 16px 16px 60px; max-width: 1280px; margin: 0 auto; display: grid; gap: 12px; }
.rivals .tabs, .social .tabs { margin-bottom: -14px; }
.rv-head { display: grid; grid-template-columns: auto 1fr auto; gap: 18px; align-items: center; padding: 14px 20px;
  background: radial-gradient(circle at 8% 50%, rgba(255,205,60,.35), transparent 40%), linear-gradient(180deg, var(--panel-hi), var(--panel) 18%, var(--panel-lo)); }
.rv-me .title { margin: 0; }
.rv-rank { margin: 2px 0 8px; font: 24px var(--display); text-transform: uppercase; letter-spacing: .03em; text-shadow: var(--outline-sm); }
.rv-rank b { color: var(--gold); font-weight: 400; }
.rv-rank small { font: 700 13px var(--body); color: var(--sub); text-transform: none; text-shadow: none; }
.rv-next { display: grid; gap: 3px; max-width: 440px; }
.rv-next .bar { height: 14px; }
.rv-next small { font-weight: 800; color: #E2F2FF; font-size: 12px; }
.rv-status { align-self: start; }
.rv-status .chip { font-size: 14px; padding: 4px 12px; }
.rv-body { padding: 16px; min-height: 320px; }
.rv-tools { justify-content: space-between; margin-bottom: 12px; flex-wrap: nowrap; }
.rv-tools .fine { flex: 1; margin: 0; font-size: 13px; }
.rv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.rv-card { display: grid; gap: 10px; padding: 12px; background: linear-gradient(180deg, #13397F, #0B2459); border: 2px solid var(--ink); border-radius: 12px; box-shadow: inset 0 0 0 1px var(--card-line), 0 4px 0 rgba(4,16,46,.6); transition: transform .12s; }
.rv-card:hover { transform: translateY(-3px); }
.rv-card-top { display: flex; gap: 10px; align-items: center; min-width: 0; }
.rv-card-top > div { min-width: 0; display: grid; gap: 4px; }
.rv-card-top .row { flex-wrap: nowrap; min-width: 0; }
.rv-sub { font: 800 12px var(--body); color: var(--sub); gap: 5px; }
.rv-intel { display: grid; grid-template-columns: 1fr 1fr 1.5fr; gap: 6px; }
.rv-intel span { display: grid; background: rgba(4,16,46,.5); border-radius: 6px; padding: 4px 6px; text-align: center; }
.rv-intel small { font: 800 10px var(--body); color: var(--sub); text-transform: uppercase; letter-spacing: .04em; }
.rv-intel b { font: 18px var(--display); display: inline-flex; align-items: center; justify-content: center; gap: 2px; letter-spacing: .03em; white-space: nowrap; }
.rv-intel b .ic { width: 20px; height: 20px; object-fit: contain; }
.rv-card > .btn { width: 100%; }
.rv-locked { display: grid; justify-items: center; text-align: center; gap: 8px; padding: 10px; }
.rv-lock-art { width: min(520px, 100%); border-radius: 12px; border: 3px solid var(--ink); filter: grayscale(.35) brightness(.85); }
.rv-log { display: grid; gap: 8px; }
.rv-entry { display: grid; grid-template-columns: 84px auto 1fr auto; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 10px; background: var(--card); border: 2px solid var(--ink); box-shadow: inset 0 0 0 1px var(--card-line); }
.rv-entry.won { box-shadow: inset 5px 0 0 var(--green), inset 0 0 0 1px var(--card-line); }
.rv-entry.lost { box-shadow: inset 5px 0 0 var(--red), inset 0 0 0 1px var(--card-line); }
.rv-dir { font: 15px var(--display); text-transform: uppercase; letter-spacing: .04em; text-align: center; padding: 3px 6px; border-radius: 6px; border: 2px solid var(--ink); text-shadow: var(--outline-sm); }
.rv-entry.atk .rv-dir { background: var(--pink-lo); } .rv-entry.def .rv-dir { background: #1D4C95; }
.rv-what { min-width: 0; }
.rv-what p { margin: 0 0 2px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-weight: 800; }
.rv-what small { color: var(--sub); font-weight: 700; }
.rv-acts { display: flex; gap: 6px; }
.podium { display: grid; grid-template-columns: repeat(3, minmax(0, 210px)); justify-content: center; align-items: end; gap: 12px; margin: 6px 0 16px; }
.pod { position: relative; display: grid; justify-items: center; gap: 6px; padding: 10px 6px 0; background: none; border: 0; color: #fff; min-width: 0; }
.pod .pava.lg { width: 84px; height: 84px; }
.pod.p1 .pava.lg { width: 110px; height: 110px; }
.pod.p1 .pava img { box-shadow: 0 0 0 3px var(--gold), 0 0 22px rgba(255,205,60,.6); }
.pod-n { font: 30px var(--display); color: var(--gold); text-shadow: var(--outline); }
.pod.p2 .pod-n { color: #E4EDF9; } .pod.p3 .pod-n { color: #FFB57A; }
.pod .pname { font-size: 20px; }
.pod-base { display: block; width: 100%; border: 2px solid var(--ink); border-bottom: 0; border-radius: 8px 8px 0 0; height: 70px; background: linear-gradient(180deg, #FFE07A, #F09A0C); box-shadow: inset 0 3px 0 rgba(255,255,255,.45); }
.pod.p2 .pod-base { height: 48px; background: linear-gradient(180deg, #F4F8FF, #9DB0CF); }
.pod.p3 .pod-base { height: 32px; background: linear-gradient(180deg, #FFC48A, #C56A1F); }
.rk-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.rk-row { display: grid; grid-template-columns: 44px auto 1fr auto auto; gap: 10px; align-items: center; padding: 6px 10px; border-radius: 8px; background: var(--card); border: 2px solid var(--ink); box-shadow: inset 0 0 0 1px var(--card-line); cursor: pointer; }
.rk-row:hover { filter: brightness(1.15); }
.rk-row.me { box-shadow: inset 0 0 0 2px var(--gold); }
.rk-row small { color: var(--sub); font-weight: 700; }
.rk-n { font: 22px var(--display); text-align: center; color: var(--sub); }
.rk-name { display: flex; align-items: center; gap: 6px; min-width: 0; font-weight: 800; }
.rk-v { font: 20px var(--display); letter-spacing: .03em; }

/* ---------- Factions */
.faction-scr { padding: 16px 16px 60px; max-width: 1200px; margin: 0 auto; display: grid; gap: 14px; }
.fx-hero { display: grid; grid-template-columns: minmax(0, 1.1fr) 1fr; gap: 18px; padding: 14px; align-items: center; }
.fx-hero-art { width: 100%; max-height: min(320px, 42vh); object-fit: cover; border-radius: 10px; border: 3px solid var(--ink); box-shadow: 0 4px 0 rgba(4,16,46,.5); }
.fx-hero-text .title { margin-bottom: 6px; }
.fx-hero-text p { margin: 0 0 12px; }
.fx-browse { padding: 14px; }
.fx-browse > .row .subhead { margin: 0 auto 0 0; }
.fx-browse > .row .in { flex: 1; max-width: 320px; }
.fx-list { display: grid; gap: 8px; margin-top: 12px; }
.fx-row { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 8px 12px; background: var(--card); border: 2px solid var(--ink); border-radius: 10px; box-shadow: inset 0 0 0 1px var(--card-line); }
.fx-row-main { display: grid; gap: 2px; min-width: 0; }
.fx-row-main b { font: 20px var(--display); letter-spacing: .03em; text-transform: uppercase; }
.fx-row-main small { color: var(--sub); font-weight: 800; }
.fx-banner { display: grid; grid-template-columns: auto 1fr auto; gap: 18px; align-items: center; padding: 16px 20px;
  background: radial-gradient(circle at 8% 50%, rgba(255,205,60,.3), transparent 38%), linear-gradient(180deg, var(--panel-hi), var(--panel) 18%, var(--panel-lo)); }
.fx-id { min-width: 0; }
.fx-id .title { margin: 0 0 6px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.fx-desc { margin: 0 0 4px; color: #E2F2FF; }
.fx-acts { display: grid; gap: 8px; justify-items: end; }
.fx-siege { display: grid; grid-template-columns: 210px 1fr 250px; gap: 18px; align-items: center; padding: 14px 18px;
  background: radial-gradient(circle at 12% 55%, rgba(255,61,90,.4), transparent 42%), linear-gradient(180deg, #6A1834, #2A0C22); box-shadow: inset 0 0 0 2px #FF6B80, inset 0 4px 0 rgba(255,255,255,.15), 0 6px 0 rgba(4,16,46,.6); }
.fx-siege-art { display: grid; place-items: center; }
.fx-siege-art img { width: 100%; max-height: 200px; object-fit: contain; filter: drop-shadow(0 8px 0 rgba(4,16,46,.6)); animation: bob 3.2s ease-in-out infinite; }
.fx-siege.sunk .fx-siege-art img { filter: grayscale(1) brightness(.6); transform: rotate(-10deg) translateY(10px); animation: none; }
.fx-siege-main { display: grid; gap: 8px; min-width: 0; }
.fx-siege-main .title { margin: 0; }
.fx-siege-main .fine { color: #FFD3DA; }
.fx-contrib { display: grid; gap: 4px; align-self: stretch; align-content: start; padding: 10px 12px; background: rgba(4,16,46,.45); border-radius: 10px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.12); }
.fx-contrib > small { font: 15px var(--display); text-transform: uppercase; color: var(--gold); letter-spacing: .04em; }
.fx-contrib .row { flex-wrap: nowrap; }
.fx-contrib .row span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 800; }
.fx-contrib .row small { color: #FFD3DA; font-weight: 700; }
/* Faction wars: a scoreboard (our tag, Spoils bar, theirs), my status, both rosters */
.fx-war { padding: 14px 18px; display: grid; gap: 10px;
  background: radial-gradient(circle at 50% 0, rgba(255,120,60,.28), transparent 55%), linear-gradient(180deg, #5A1A2E, #22102A); box-shadow: inset 0 0 0 2px #FF8A5C, inset 0 4px 0 rgba(255,255,255,.1), 0 6px 0 var(--ink); }
.fx-war.idle { background: linear-gradient(180deg, var(--panel-hi), var(--panel) 18%, var(--panel-lo)); box-shadow: inset 0 0 0 2px var(--line), 0 6px 0 var(--ink); }
.fx-war .subhead { margin: 0; color: #FFD0B8; }
.fx-war.idle .subhead { color: var(--sub); }
.fx-war > .row { justify-content: space-between; }
.fx-war p { margin: 0; }
.fx-war.pending p:first-of-type { font-weight: 800; font-size: 17px; }
.war-head { display: grid; grid-template-columns: 1fr minmax(220px, 1.6fr) 1fr; gap: 14px; align-items: center; }
.war-side { display: grid; justify-items: center; gap: 2px; }
.war-side b { font: 34px/1 var(--display); letter-spacing: .02em; text-shadow: var(--outline); }
.war-side small { font: 13px var(--display); letter-spacing: .06em; text-transform: uppercase; color: #FFD0B8; }
.war-side.us b { color: #7FD6FF; } .war-side.them b { color: #FF8A8A; }
.war-mid { display: grid; justify-items: center; gap: 6px; text-align: center; }
.war-mid .title { margin: 0; }
.war-mid > small:first-of-type { font: 17px var(--display); letter-spacing: .04em; color: var(--gold); text-shadow: var(--outline-sm); }
.war-bar { display: flex; width: 100%; height: 16px; border: 2px solid var(--ink); border-radius: 99px; overflow: hidden; background: #061634; }
.war-bar i { display: block; height: 100%; transition: width .4s; }
.war-bar .us { background: linear-gradient(180deg, #8EE6FF, #22A9F0); } .war-bar .them { background: linear-gradient(180deg, #FF9AA6, #D3203D); }
.war-me { align-items: center; gap: 8px; }
.war-rules { color: #FFD3DA; }
.war-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.war-cols .subhead.sm { margin: 0 0 6px; }
.war-list { display: grid; gap: 6px; }
.war-f { display: flex; align-items: center; gap: 10px; padding: 6px 10px; background: rgba(4,16,46,.45); border: 2px solid var(--ink); border-radius: 10px; }
.war-f.gone { opacity: .5; }
.war-f-main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.war-f-main small { color: #FFD0B8; font-weight: 700; }
.war-f .pava { width: 38px; height: 38px; flex: none; }
.war-hist summary { cursor: pointer; font-weight: 800; color: var(--sub); }
.war-hist ul { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 4px; }
.war-res b { display: inline-block; min-width: 46px; padding: 0 6px; border-radius: 6px; border: 2px solid var(--ink); text-align: center; font: 14px var(--display); letter-spacing: .04em; text-transform: uppercase; }
.war-res.won b { background: #2DB848; } .war-res.lost b { background: #D3203D; } .war-res.draw b { background: #6F8DBE; }
.war-form { display: grid; gap: 12px; }
.war-types { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.war-types.two { grid-template-columns: 1fr 1fr; }
.war-type { display: grid; gap: 2px; text-align: left; padding: 10px 12px; color: #fff; background: var(--card); border: 2px solid var(--ink); border-radius: 10px; box-shadow: inset 0 0 0 1px var(--card-line), 0 3px 0 var(--ink); cursor: pointer; }
.war-type b { font: 18px var(--display); letter-spacing: .03em; text-transform: uppercase; }
.war-type span { font: 15px var(--display); color: var(--gold); }
.war-type small { color: var(--sub); font-weight: 700; }
.war-type.on { box-shadow: inset 0 0 0 3px var(--gold), 0 3px 0 var(--ink); background: linear-gradient(180deg, #3A2A10, #1E1608); }
.war-type:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.t-badge.war { background: linear-gradient(180deg, #FF7A8C, #D3203D); }
@media (max-width: 760px) {
  .war-head { grid-template-columns: 1fr 1fr; } .war-mid { grid-column: 1 / -1; grid-row: 1; }
  .war-cols, .war-types, .war-types.two { grid-template-columns: 1fr; }
  .war-side b { font-size: 26px; }
}
.fx-roster { padding: 14px; }
.fx-roster .subhead { margin-top: 0; }
.fx-members { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 8px; }
.fx-member { display: flex; gap: 10px; align-items: center; padding: 8px 10px; background: var(--card); border: 2px solid var(--ink); border-radius: 10px; box-shadow: inset 0 0 0 1px var(--card-line); }
.fx-member.me { box-shadow: inset 0 0 0 2px var(--gold); }
.fx-member-main { flex: 1; min-width: 0; display: grid; gap: 3px; }
.fx-member-main .row { flex-wrap: nowrap; min-width: 0; }
.fx-member-main small { color: var(--sub); font-weight: 700; }

/* ---------- Friends & messages */
.social { padding: 16px 16px 60px; max-width: 1200px; margin: 0 auto; }
.social .screen-head { margin-bottom: 8px; }
.soc-body { padding: 14px; display: grid; gap: 10px; min-height: 0; align-content: start; }
.soc-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 8px; }
.soc-head { align-items: center; gap: 10px; flex-wrap: wrap; }
.soc-head .soc-filter { margin-left: auto; width: min(260px, 100%); }
.soc-row.on { box-shadow: inset 0 0 0 1px var(--card-line), inset 3px 0 0 #4BDD62; }
.soc-acts { flex-wrap: nowrap; flex: none; }
.soc-body > .fine:first-child { margin: 0; }
.soc-body .subhead { margin: 8px 0 0; }
.soc-add { flex-wrap: nowrap; }
.soc-add .in { flex: 1; }
.soc-row, .soc-thread { display: flex; gap: 10px; align-items: center; padding: 8px 10px; background: var(--card); border: 2px solid var(--ink); border-radius: 10px; box-shadow: inset 0 0 0 1px var(--card-line); color: #fff; text-align: left; }
.soc-main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.soc-main .row { flex-wrap: nowrap; min-width: 0; }
.soc-main small { color: var(--sub); font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.soc-threads { display: grid; gap: 6px; }
.soc-thread { width: 100%; }
.soc-thread:hover { filter: brightness(1.12); }
.soc-thread.unread { box-shadow: inset 0 0 0 2px var(--green); }
.soc-thread time { color: #6F8DBE; font: 700 12px var(--body); }
.dm-head { display: flex; align-items: center; gap: 10px; padding-bottom: 10px; border-bottom: 2px solid rgba(4,16,46,.5); }
.dm-msgs { list-style: none; margin: 0; padding: 8px 4px; display: flex; flex-direction: column; gap: 6px; height: min(56vh, 520px); overflow-y: auto; scrollbar-color: var(--line) transparent; }
.dm { position: relative; max-width: 78%; align-self: flex-start; padding: 8px 12px; border-radius: 14px 14px 14px 4px; background: #0D2A60; border: 2px solid var(--ink); box-shadow: inset 0 0 0 1px var(--card-line); }
.dm.mine { align-self: flex-end; border-radius: 14px 14px 4px 14px; background: linear-gradient(180deg, #2C8BEE, #1765D3); }
.dm p { margin: 0; overflow-wrap: anywhere; }
.dm time { display: inline-block; font: 700 10px var(--body); color: #9CC3F0; margin-top: 2px; }
.dm .msg-act { margin-left: 8px; }
.chat-muted { margin: 4px 8px 0; padding: 6px 10px; border-radius: 8px; background: rgba(255,61,90,.18); border: 1px solid rgba(255,61,90,.6); color: #FFD5DC; font-weight: 800; font-size: 13px; }
.splice-busy { margin: 6px 0 0; padding: 6px 10px; border-radius: 10px; background: rgba(4,16,46,.5); border: 1px solid rgba(255,205,60,.5); font-weight: 800; }
.tag.hatching { background: #FFE9A8; color: var(--ink); }
.brew-pay { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.brew-pay .chipbtn { display: inline-flex; align-items: center; gap: 4px; }
.dm.skel { width: 46%; min-height: 34px; opacity: .45; animation: dmSkel 1s ease-in-out infinite alternate; }
.dm.skel.mine { width: 34%; }
@keyframes dmSkel { from { opacity: .25; } to { opacity: .55; } }
/* the open conversation: list grows, composer stays put; no entrance fade on every redraw */
.soc-body.dm-open { grid-template-rows: auto minmax(0, 1fr) auto; }
.soc-body.dm-open > * { animation: none; }
.soc-body.dm-open .dm-head { animation: fadeUp .18s cubic-bezier(.2,.8,.2,1) both; }
.dm-head .name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dm-form .chat-in { min-width: 0; flex: 1; }
@media (prefers-reduced-motion: reduce) { .dm.skel { animation: none; } }
@media (max-width: 720px) {
  .soc-body.dm-open { padding: 10px; height: calc(100dvh - 210px); min-height: 320px; }
  .soc-body.dm-open .dm-msgs { height: auto; min-height: 0; }
  .dm { max-width: 86%; }
  .dm-form { position: sticky; bottom: 0; }
}

/* ---------- achievements */
.quests > .tabs { margin-bottom: 10px; }
.qbody { display: grid; gap: 2px; }
.ach-body { padding: 14px; display: grid; gap: 12px; }
.ach-head { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; }
.ach-head > div:first-child { display: grid; gap: 6px; min-width: 240px; flex: 1; max-width: 460px; }
.ach-head .bar { height: 14px; }
.ach-count { font: 36px/1 var(--display); text-shadow: var(--outline); color: var(--gold); }
.ach-count small { font: 17px var(--display); color: #fff; letter-spacing: .03em; }
.medal-chip { font: 13px var(--display); letter-spacing: .05em; text-transform: uppercase; border-color: var(--ink); }
.medal-chip.t1 { background: #B8702F; } .medal-chip.t2 { background: #A9B7CC; color: var(--ink); } .medal-chip.t3 { background: var(--gold); color: var(--ink); }
.ach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 10px; }
.ach-card { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 10px 12px; background: var(--card); border: 2px solid var(--ink); border-radius: 12px; box-shadow: inset 0 0 0 1px var(--card-line); }
.ach-card.ready { box-shadow: inset 0 0 0 2px var(--green), 0 0 14px rgba(75,221,98,.35); }
.ach-card.done { background: linear-gradient(180deg, #3A2E0C, #241B06); box-shadow: inset 0 0 0 2px var(--gold); }
.ach-main { min-width: 0; display: grid; gap: 4px; }
.ach-main .row { flex-wrap: wrap; row-gap: 4px; min-width: 0; }
.ach-main > .row:first-child { flex-wrap: nowrap; align-items: flex-start; }
.ach-main > .row:first-child b { min-width: 0; white-space: normal; line-height: 1.05; overflow-wrap: anywhere; }
.ach-main > .row:first-child .ach-pips { margin-top: 4px; }
.ach-main .chip { flex: none; }
.ach-main b { font: 20px var(--display); text-transform: uppercase; letter-spacing: .03em; text-shadow: var(--outline-sm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ach-main p { margin: 0; font-size: 13px; color: #E2F2FF; }
.ach-pips { display: inline-flex; gap: 3px; margin-left: auto; flex: none; }
.ach-pips i { width: 13px; height: 13px; border-radius: 50%; background: #0A1C44; border: 2px solid var(--ink); box-shadow: inset 0 0 0 1px var(--card-line); }
.ach-pips i.on.t1 { background: #CD7F32; } .ach-pips i.on.t2 { background: #D9E2EE; } .ach-pips i.on.t3 { background: var(--gold); }
.medal { position: relative; display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; flex: none; border: 3px solid var(--ink);
  background: radial-gradient(circle at 50% 35%, #2A4C8F, #0B2459); box-shadow: 0 0 0 3px #4A6290; }
.medal { grid-template: 100% / 100%; overflow: visible; }
.medal img { width: 82%; height: 82%; max-width: 82%; max-height: 82%; min-height: 0; object-fit: contain; justify-self: center; align-self: center; filter: drop-shadow(0 2px 0 rgba(4,16,46,.6)); }
.medal.t0 img { filter: grayscale(.85) brightness(.7); }
.medal.t1 { background: radial-gradient(circle at 50% 35%, #E9A562, #7A4416); box-shadow: 0 0 0 3px #CD7F32; }
.medal.t2 { background: radial-gradient(circle at 50% 35%, #FFFFFF, #8796B2); box-shadow: 0 0 0 3px #D9E2EE; }
.medal.t3 { background: radial-gradient(circle at 50% 35%, #FFF0A8, #E58A0A); box-shadow: 0 0 0 3px var(--gold), 0 0 16px rgba(255,205,60,.6); }
.medal.ex.t1.role-dev { background: radial-gradient(circle at 50% 35%, #FF8A8A, #8E0F22); box-shadow: 0 0 0 3px var(--dev), 0 0 18px rgba(255,70,70,.6); }
.medal.ex.t1.role-tester { background: radial-gradient(circle at 50% 35%, #B8FBFF, #0E7D8C); box-shadow: 0 0 0 3px var(--tester), 0 0 18px rgba(46,230,242,.55); }
.medal.ex.t1.role-mod { background: radial-gradient(circle at 50% 35%, #D9FF9A, #3F8A12); box-shadow: 0 0 0 3px var(--modc), 0 0 18px rgba(166,255,52,.55); }
.ach-card.locked { opacity: .6; filter: grayscale(.6); }
.ach-body .subhead { margin: 4px 0 0; }
.medal.lg { width: 74px; height: 74px; }
.medal.sm { width: 32px; height: 32px; border-width: 2px; }
.prof-medals { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 8px 12px; background: var(--card); border: 2px solid var(--ink); border-radius: 8px; box-shadow: inset 0 0 0 1px var(--card-line); }
.prof-medals > span { display: grid; }
.prof-medals > span small { font: 800 11px var(--body); color: var(--sub); text-transform: uppercase; letter-spacing: .05em; }
.prof-medals > span b { font: 24px/1.1 var(--display); color: var(--gold); }
.prof-medals .row { gap: 10px; }

/* ---------- motion: screen, dialog, list and number transitions (off with html.no-motion) */
@keyframes screenIn { from { opacity: 0; transform: translateY(10px); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } }
@keyframes cardIn { from { opacity: 0; transform: translateY(12px) scale(.98); } }
@keyframes fadeOut { to { opacity: 0; } }
@keyframes sinkOut { to { opacity: 0; transform: translateY(14px) scale(.96); } }
@keyframes barIn { from { width: 0; } }
@keyframes numPop { 40% { transform: scale(1.18); } }
.stage > * { animation: screenIn .26s cubic-bezier(.2,.8,.2,1) both; }
.stage > .loading { animation-delay: .1s; }
.modal-back.closing { animation: fadeOut .17s ease-in forwards; pointer-events: none; }
.modal-back.closing .modal { animation: sinkOut .17s ease-in forwards; }
.rv-body > *, .soc-body > *, .fx-browse > .fx-list, .qbody, .ach-body > .ach-grid { animation: fadeUp .24s cubic-bezier(.2,.8,.2,1) both; }
.rv-grid > *, .rk-list > *, .podium > *, .fx-list > *, .fx-members > *, .soc-threads > *, .rv-log > *, .prof-raids > * { animation: cardIn .34s cubic-bezier(.2,.8,.2,1) both; }
:is(.rv-grid, .rk-list, .fx-list, .fx-members, .soc-threads, .rv-log, .prof-raids) > :nth-child(2) { animation-delay: .04s; }
:is(.rv-grid, .rk-list, .fx-list, .fx-members, .soc-threads, .rv-log, .prof-raids) > :nth-child(3) { animation-delay: .08s; }
:is(.rv-grid, .rk-list, .fx-list, .fx-members, .soc-threads, .rv-log, .prof-raids) > :nth-child(4) { animation-delay: .12s; }
:is(.rv-grid, .rk-list, .fx-list, .fx-members, .soc-threads, .rv-log, .prof-raids) > :nth-child(5) { animation-delay: .16s; }
:is(.rv-grid, .rk-list, .fx-list, .fx-members, .soc-threads, .rv-log, .prof-raids) > :nth-child(n+6) { animation-delay: .2s; }
.podium > .p2 { animation-delay: .06s; } .podium > .p1 { animation-delay: .14s; } .podium > .p3 { animation-delay: .1s; }
.q-prog .bar > div, .rv-next .bar > div, .ach-head .bar > div, .results .bar > div, .hpbar > i { animation: barIn .7s cubic-bezier(.2,.8,.2,1) both; }
.pill > b.up, .pill > b.down { display: inline-block; animation: numPop .35s ease-out; }
.pill > b.up { color: #A8FFB8; } .pill > b.down { color: #FFB0BC; }
.tile, .btn, .chipbtn, .navbtn, .rv-card, .soc-thread, .emb-pick, .ava-card { transition: transform .14s cubic-bezier(.2,.8,.2,1), filter .14s, box-shadow .18s; }
.tabs button { transition: color .15s, background .2s; }
html.no-motion *, html.no-motion *::before, html.no-motion *::after { animation: none !important; transition: none !important; }

/* ---------- tablet & phone portrait */
@media (max-width: 1023px) {
  .shell { grid-template-columns: 1fr; grid-template-rows: calc(62px + var(--safe-t)) auto 1fr 44px calc(70px + var(--safe-b)); grid-template-areas: "top" "tip" "main" "peek" "nav"; }
  .topbar { padding: calc(6px + var(--safe-t)) 8px 6px; gap: 6px; }
  .me-name { display: none; }
  .ava { width: 46px; height: 46px; }
  .lvl { left: 24px; font-size: 13px; } .lvl::before { content: ''; }
  .pills { gap: 14px; margin-right: 2px; min-width: 0; }
  .pill { min-width: 0; height: 32px; padding: 0 8px 0 24px; }
  .pill.biofuel { min-width: 0; padding-right: 8px; }
  .pill b { font-size: 17px; }
  .pill small, .pill .under, .pill .plus, .pill .fillbar { display: none; }
  .pill.power { display: none; }
  .pill .pic { width: 36px; height: 36px; left: -13px; }
  .hudbtns { margin-left: 0; gap: 5px; }
  .hudbtns .help-btn, .hudbtns .discord-btn { display: none; }
  .iconbtn { width: 36px; height: 36px; }
  .iconbtn svg { width: 20px; height: 20px; }
  .shell { grid-template-columns: minmax(0, 1fr); }
  .topbar { min-width: 0; }
  .nav { padding: 4px 2px var(--safe-b); border-bottom: 0; border-top: 3px solid var(--ink); box-shadow: inset 0 2px 0 var(--card-line); justify-content: space-around; gap: 0; }
  .navbtn { flex-direction: column; justify-content: center; gap: 0; padding: 2px 2px; margin: 0; font-size: 13px; flex: 1; clip-path: none; border-radius: 8px; background: none; }
  .navbtn::before { clip-path: none; border-radius: 8px; background: none; }
  .navbtn.on::before { background: linear-gradient(180deg, #49AEFF, #1765D3); }
  .badge { top: -2px; right: 4px; }
  .navbtn .navic { width: 34px; height: 34px; }
  .badge { right: 4px; }
  .peek { grid-area: peek; display: flex; align-items: center; gap: 8px; border: 0; padding: 0 10px; text-align: left; color: #fff; min-width: 0;
    background: #061634; border-top: 2px solid var(--ink); box-shadow: inset 0 1px 0 var(--card-line); font: 16px var(--display); letter-spacing: .03em; text-transform: uppercase; }
  .peek-text { flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .peek-text b { color: var(--line); font-weight: 400; }
  .peek .badge { position: static; font-size: 15px; }
  .chat { position: fixed; inset: 0; z-index: 60; display: none; border: 0; }
  .chat.open { display: flex; }
  .chat-close { display: grid; }
  .pip-guide p { font-size: 13px; }
  #toasts { top: 70px; }
  .shell.in-battle { grid-template-rows: 0 0 1fr 0 0; }
  .shell.in-battle .topbar, .shell.in-battle .peek, .shell.in-battle .nav { display: none; }
  .gigas, .quests { padding: 10px 10px 30px; }
  .ggrid { grid-template-columns: 1fr; }
  .mgrid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
  .hub { grid-template-columns: 1fr 1fr; grid-template-rows: 220px 160px 150px 140px 140px 160px 140px; grid-template-areas: "wreck wreck" "create rivals" "city gigas" "lab quests" "faction rankings" "event event" "research research"; }
  .tile.tl-faction .t-title { font-size: 24px; }
  .tile .t-title { font-size: 30px; } .tile.tl-wreck .t-title { font-size: 48px; }
  .tile { padding: 10px; } .tile .t-sub { font-size: 12px; }
  .home { padding: 10px; }
  .bcard { flex-direction: column; text-align: center; padding: 4px; }
  .bc-port { width: 44px; height: 44px; }
  .bc-info b small { display: none; }
  .bhud-bot { flex-direction: column; align-items: stretch; }
  .bhud-bot::before { display: none; }
  .bctl { grid-auto-flow: column; justify-content: end; }
  .bctl .btn { width: 60px; height: 60px; font-size: 17px; }
  .skillbtn { top: -14px; right: 50%; transform: translateX(50%); }
  .bhud-top { grid-template-columns: auto 1fr; }
  .bstage b { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  .bres { grid-column: 1 / 3; justify-content: center; }
  .city-sheet { max-height: 54%; }
  .scene-inner { min-height: 260px; }
  .tabs button { padding: 8px 24px 6px; font-size: 17px; }
  .gcard .gc-name b { font-size: 30px; }
  .navbtn { font-size: 12px; } .navbtn .navic { width: 30px; height: 30px; }
  .rivals, .faction-scr, .social { padding: 10px 10px 30px; }
  .rv-head { grid-template-columns: auto 1fr; gap: 10px; padding: 10px 12px; }
  .rv-head .divb.big { width: 76px; height: 76px; }
  .rv-status { grid-column: 1 / -1; }
  .rv-rank { font-size: 18px; }
  .rv-tools { flex-wrap: wrap; }
  .rv-entry { grid-template-columns: auto 1fr; }
  .rv-entry .rv-dir { grid-column: 1 / -1; justify-self: start; }
  .rv-entry .rv-acts { grid-column: 1 / -1; justify-content: flex-end; }
  .podium { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .pod .pava.lg { width: 58px; height: 58px; } .pod.p1 .pava.lg { width: 72px; height: 72px; }
  .pod .pname { font-size: 14px; }
  .rk-row { grid-template-columns: 30px auto 1fr auto; } .rk-row > .divb, .rk-row > small { display: none; }
  .fx-hero, .fx-siege { grid-template-columns: 1fr; }
  .fx-siege-art img { max-height: 140px; }
  .fx-banner { grid-template-columns: auto 1fr; } .fx-banner .emb.xl { width: 72px; height: 72px; }
  .fx-acts { grid-column: 1 / -1; grid-auto-flow: column; justify-content: start; }
  .fx-row { grid-template-columns: auto 1fr; } .fx-row > .row { grid-column: 1 / -1; justify-content: flex-end; }
  .prof-banner { grid-template-columns: auto 1fr; padding: 16px 52px 14px 14px; gap: 12px; }
  .prof-ava { width: 92px; height: 92px; } .prof-lvl { min-width: 34px; height: 34px; font-size: 17px; }
  .prof-name.pname { font-size: 32px; }
  .prof-div { grid-column: 1 / -1; display: flex; gap: 10px; align-items: center; justify-content: flex-start; min-width: 0; }
  .prof-div .divb { width: 52px; height: 52px; margin-bottom: 0; }
  .prof-stats { grid-template-columns: repeat(2, 1fr); }
  .prof-els { grid-template-columns: 1fr; }
  .prof-tabs button { padding: 7px 12px 5px; font-size: 15px; }
  .prof-pane { padding: 10px; }
  .prof-ch { grid-template-columns: 30px 1fr auto; } .prof-ch > .chip { display: none; }
  .prof-level > span { min-width: 76px; }
  .prof-cols { grid-template-columns: 1fr; }
  .prof-body { padding: 12px; }
  .ach-grid { grid-template-columns: 1fr; }
  .ach-card { grid-template-columns: auto 1fr; } .ach-card .q-act { grid-column: 1 / -1; justify-self: end; }
  .medal.lg { width: 58px; height: 58px; }
}
@media (min-width: 1024px) and (max-width: 1439px) {
  .navbtn { padding: 0 16px; font-size: 18px; } .navbtn .navic { width: 28px; height: 28px; }
}
@media (min-width: 1024px) and (max-width: 1200px) {
  .navbtn { padding: 0 10px; font-size: 16px; gap: 5px; } .navbtn .navic { width: 24px; height: 24px; }
  .fx-siege { grid-template-columns: 160px 1fr; } .fx-contrib { grid-column: 1 / -1; }
}
@media (min-width: 1024px) {
  .shell.in-battle { grid-template-rows: 74px 0 0 1fr; }
  .shell.in-battle .nav { display: none; }
}
@media (max-width: 420px) {
  .title { font-size: 32px; }
  .slots { gap: 4px; }
  .slot { height: 92px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition: none !important; }
}

/* ---------------------------------------------------------------- Phase 3: research, festivals, epics */
.chip.epic { background: linear-gradient(180deg, #FF9E5C, #E4570F); color: #fff; border-color: var(--ink); text-shadow: var(--outline-sm); }
.rstars.epic i { background: #FF8A3C; }
.burst.epic { background: repeating-conic-gradient(from 0deg, rgba(255,138,28,.5) 0 10deg, rgba(255,205,60,.28) 10deg 20deg); }
.chip.legendary { background: linear-gradient(180deg, #7FF5E8, #18A9B8); color: #fff; border-color: var(--ink); text-shadow: var(--outline-sm); }
.burst.legendary { background: repeating-conic-gradient(from 0deg, rgba(127,245,232,.45) 0 8deg, rgba(255,210,63,.3) 8deg 16deg); animation: spin 9s linear infinite; }
.chip.ultra { background: linear-gradient(90deg, #FF5FA2, #FFD23F, #5FE3A1, #5FC8FF, #B57BFF); color: #fff; border-color: var(--ink); text-shadow: var(--outline-sm); }
.burst.ultra { background: repeating-conic-gradient(from 0deg, rgba(255,95,162,.45) 0 6deg, rgba(255,210,63,.4) 6deg 12deg, rgba(95,227,161,.4) 12deg 18deg, rgba(95,200,255,.4) 18deg 24deg); animation: spin 6s linear infinite; }
.tile.tl-research { grid-area: research; background: #10306E var(--tile-bg, none) 50% 35% / cover no-repeat; }
.tile.tl-research .t-icon { width: 64px; height: 64px; }
.tile.tl-event { grid-area: event; background: #1D2F6E var(--tile-bg, none) 60% 40% / cover no-repeat; }
.tile.tl-event .t-title { font-size: 38px; }
.tile .t-live { position: absolute; top: 12px; left: 12px; z-index: 4; font: 18px var(--display); letter-spacing: .08em; padding: 2px 10px; border-radius: 6px; border: 2px solid var(--ink);
  background: linear-gradient(180deg, #FF7A8C, #D3203D); text-shadow: var(--outline-sm); animation: glow 1.4s ease-in-out infinite; }

.research, .festival { max-width: 1180px; margin: 0 auto; padding: 14px 18px 40px; }
.rs-matter { display: inline-flex; align-items: center; gap: 8px; padding: 6px 16px 6px 8px; border-radius: 99px; background: var(--card); border: 2px solid var(--ink); box-shadow: inset 0 0 0 1px var(--card-line); }
.rs-matter .ic { width: 34px; height: 34px; }
.rs-matter b { font: 26px var(--display); letter-spacing: .02em; text-shadow: var(--outline-sm); }
.rs-matter small { color: var(--sub); font-weight: 800; }
.rs-intro { display: grid; grid-template-columns: 1fr minmax(200px, 320px); gap: 16px; align-items: center; margin-bottom: 14px; }
.rs-intro p { margin: 0; color: #DDF0FF; font-weight: 600; }
.rs-prog { display: grid; gap: 4px; font: 800 13px var(--body); color: var(--sub); }
.rs-tabs button { display: inline-flex; align-items: center; gap: 8px; padding: 9px 22px 7px; }
.rs-tabs button .ic { width: 28px; height: 28px; }
.rs-tabs button small { font: 800 12px var(--body); color: var(--sub); text-shadow: none; }
.rs-body { padding: 16px; display: grid; gap: 4px; }
.rs-desc { margin: 0 0 6px; font-weight: 700; color: #E7F5FF; }
.rs-row { position: relative; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; padding-top: 18px; }
.rs-row:first-of-type { padding-top: 0; }
.rs-link { position: absolute; top: 2px; left: 50%; width: 4px; height: 14px; margin-left: -2px; border-radius: 2px; background: var(--line); box-shadow: 0 0 8px var(--line); }
.rs-node { display: grid; gap: 5px; align-content: start; padding: 12px; border-radius: 10px; background: var(--card); border: 2px solid var(--ink); box-shadow: inset 0 0 0 1px var(--card-line), 0 4px 0 rgba(4,16,46,.6); }
.rs-node.ready { box-shadow: inset 0 0 0 2px var(--green), 0 4px 0 rgba(4,16,46,.6); }
.rs-node.locked { opacity: .72; }
.rs-node.maxed { background: linear-gradient(180deg, #13397F, #0B2459); box-shadow: inset 0 0 0 2px var(--gold), 0 4px 0 rgba(4,16,46,.6); }
.rs-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.rs-top b { font: 21px var(--display); letter-spacing: .02em; text-transform: uppercase; text-shadow: var(--outline-sm); }
.rs-pips { display: inline-flex; gap: 3px; }
.rs-pips i { width: 12px; height: 12px; border-radius: 3px; background: #061634; border: 1px solid var(--card-line); transform: rotate(45deg); }
.rs-pips i.on { background: linear-gradient(180deg, #A5FFB0, #2DB848); border-color: var(--ink); }
.rs-node p { margin: 0; font-size: 14px; font-weight: 700; }
.rs-now { color: #fff; } .rs-next { color: var(--sub); } .rs-why { color: #FFC37A; font-size: 13px !important; }
.rs-buy { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 4px; }
.rs-time { margin-left: auto; font-weight: 800; color: #BFD3FF; font-size: 12px; white-space: nowrap; }
.rs-node.working { box-shadow: inset 0 0 0 2px var(--gold), 0 4px 0 rgba(4,16,46,.6); background-image: repeating-linear-gradient(135deg, rgba(255,210,63,.08) 0 10px, transparent 10px 20px); }
.rs-pips i.next { background: linear-gradient(180deg, #FFE98A, #E8A317); border-color: var(--ink); animation: rs-pulse 1.2s ease-in-out infinite; }
@keyframes rs-pulse { 50% { opacity: .45; } }
.rs-clock { background: #3A2A00; color: var(--gold); font-weight: 800; }
.rs-job { display: flex; align-items: center; gap: 10px; margin-top: 8px; padding: 8px 12px; border-radius: 10px; background: rgba(255,210,63,.12); border: 2px solid rgba(255,210,63,.5); }
.rs-job img { width: 26px; height: 26px; }
.rs-job .tmr { margin-left: auto; font: 20px var(--display); color: var(--gold); text-shadow: var(--outline-sm); }
@media (prefers-reduced-motion: reduce) { .rs-pips i.next { animation: none; } }
.rs-active { margin-top: 14px; padding: 12px 16px; }
.rs-active ul { margin: 0; padding-left: 18px; display: grid; gap: 4px; font-weight: 600; }

.fest-hero { position: relative; overflow: hidden; display: flex; align-items: flex-end; min-height: 300px; padding: 22px; border-radius: 14px; border: 3px solid var(--ink);
  background: #1D2F6E var(--fest-bg, none) 70% 40% / cover no-repeat; box-shadow: inset 0 0 0 2px var(--line), 0 6px 0 rgba(4,16,46,.7); margin-bottom: 14px; }
.fest-hero::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(4,16,46,.88) 0%, rgba(4,16,46,.55) 45%, transparent 75%); pointer-events: none; }
.fest-giga { position: absolute; right: 3%; bottom: 0; height: 88%; z-index: 0; display: flex; align-items: flex-end; pointer-events: none; }
.fest-giga img { height: 100%; width: auto; object-fit: contain; filter: drop-shadow(0 8px 0 rgba(4,16,46,.55)); }
.q-fold { display: block; margin: 6px auto 0; }
.fest-copy { position: relative; z-index: 1; display: grid; gap: 8px; justify-items: start; max-width: 520px; }
.fest-copy .title { margin: 0; font-size: 48px; }
.fest-copy p { margin: 0; font-weight: 700; color: #E7F5FF; text-shadow: 0 1px 0 var(--ink); }
.fest-tokens { display: inline-flex; align-items: center; gap: 8px; padding: 4px 16px 4px 6px; border-radius: 99px; background: rgba(4,16,46,.8); border: 2px solid var(--gold); }
.fest-tokens .ic { width: 34px; height: 34px; } .fest-tokens b { font: 26px var(--display); } .fest-tokens small { color: var(--gold); font-weight: 800; }
.fest-grid { display: grid; grid-template-columns: 1.25fr 1fr; grid-template-areas: "splice track" "splice shop"; gap: 14px; align-items: start; }
.fest-splice { grid-area: splice; padding: 14px; } .fest-track { grid-area: track; padding: 14px; } .fest-shop { grid-area: shop; padding: 14px; }
.fest-splice .subhead:first-child, .fest-track .subhead:first-child, .fest-shop .subhead:first-child { margin-top: 0; }
.fest-machine { display: grid; grid-template-columns: 150px 1fr; gap: 14px; align-items: center; }
.fest-machine-art { width: 150px; height: auto; filter: drop-shadow(0 6px 0 rgba(4,16,46,.6)); }
.fest-machine p { margin: 0 0 8px; font-weight: 700; }
.fest-odds { width: 100%; border-collapse: collapse; font-weight: 700; }
.fest-odds td { padding: 3px 6px; border-bottom: 1px solid rgba(99,198,255,.18); }
.fest-odds td:first-child { width: 44px; } .fest-odds img { width: 38px; height: 38px; object-fit: contain; }
.fest-odds td.num { text-align: right; font: 18px var(--display); letter-spacing: .02em; }
.fest-odds tr.r-epic td { background: rgba(255,138,28,.16); }
.fest-track ol { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.fest-track li { display: grid; grid-template-columns: 54px 1fr auto; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 10px; background: var(--card); border: 2px solid var(--ink); box-shadow: inset 0 0 0 1px var(--card-line); }
.fest-track li.ready { box-shadow: inset 0 0 0 2px var(--green); }
.fest-track li.claimed { opacity: .7; }
.fest-at { font: 22px var(--display); color: var(--gold); text-shadow: var(--outline-sm); text-align: center; }
.fest-item { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; padding: 8px 10px; margin-bottom: 8px; border-radius: 10px; background: var(--card); border: 2px solid var(--ink); box-shadow: inset 0 0 0 1px var(--card-line); }
.fest-item.out { opacity: .6; }
.fest-item small { color: var(--sub); font-weight: 800; }
.fest-item .btn .chip { background: transparent; border: 0; padding: 0; font-size: 15px; }
.fest-earn { margin: 0; padding-left: 18px; display: grid; gap: 3px; font-weight: 600; }
.fest-none { padding: 18px; display: grid; gap: 6px; } .fest-none p { margin: 0; font-weight: 700; }
@media (max-width: 1023px) {
  .research, .festival { padding: 10px 10px 30px; }
  .rs-intro { grid-template-columns: 1fr; }
  .fest-grid { grid-template-columns: 1fr; grid-template-areas: "splice" "track" "shop"; }
  .fest-machine { grid-template-columns: 96px 1fr; } .fest-machine-art { width: 96px; }
  .fest-copy .title { font-size: 34px; }
  .fest-hero { min-height: 230px; padding: 16px; }
  .fest-giga { height: 62%; right: -6%; opacity: .85; }
  .rs-tabs { margin-left: 4px; } .rs-tabs button { padding: 9px 10px 7px; font-size: 15px; gap: 5px; } .rs-tabs button small { display: none; } .rs-tabs button .ic { width: 22px; height: 22px; }
}

/* moderation review */
.mod-btn { width: auto !important; padding: 0 12px; font: 17px var(--display); letter-spacing: .05em; color: var(--modc); text-shadow: var(--outline-sm); }
.hudbtns .mod-btn .badge { top: -5px; right: -5px; }
.mod-btn svg { display: none; }
.modq { max-width: 980px; margin: 0 auto; padding: 14px 18px 40px; }
.modq-list { display: grid; gap: 12px; }
.modq-card { padding: 12px 14px; display: grid; gap: 8px; }
.modq-card.hidden-msg { background: linear-gradient(180deg, #3A1F5E, #2A1648); }
.modq-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.modq-top small { color: var(--sub); font-weight: 700; }
.modq-ctx { padding: 6px 10px; border-left: 3px solid var(--card-line); background: rgba(4,16,46,.35); border-radius: 6px; }
.modq-ctx p { margin: 2px 0; font-size: 13px; color: #BFDCF5; }
.modq-body { margin: 0; padding: 10px 12px; background: var(--card); border: 2px solid var(--ink); border-radius: 8px; font-weight: 700; white-space: pre-wrap; word-break: break-word; }
.modq > .tabs { flex-wrap: wrap; row-gap: 4px; margin-right: 12px; }
.modq > .tabs button { font-size: 17px; padding: 9px 22px 7px; white-space: nowrap; }
.modq-notes { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.modq-notes .modq-body { margin-top: 4px; font-weight: 600; }
.report-player { display: grid; gap: 10px; max-width: 460px; }
.report-player label { gap: 4px; }
.report-player textarea { resize: vertical; min-height: 84px; }
.modq-acts { gap: 8px; }
.modq-mute { gap: 6px; } .modq-mute small { font-weight: 800; color: var(--sub); }
.modq-muted { padding: 12px 14px; display: grid; gap: 10px; }
.modq-muted .in { min-width: 180px; }
.modq-muted ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.modq-muted li { display: flex; align-items: center; gap: 8px; padding: 6px 10px; background: var(--card); border: 2px solid var(--ink); border-radius: 8px; }
.modq-muted li .btn { margin-left: auto; }
.modq-log { padding: 10px; overflow-x: auto; }
.modq-log table { width: 100%; border-collapse: collapse; font-size: 13px; font-weight: 600; }
.modq-log td { padding: 5px 8px; border-bottom: 1px solid rgba(99,198,255,.18); vertical-align: top; }
@media (max-width: 1023px) { .modq { padding: 10px 10px 30px; } .hudbtns .mod-btn { width: 36px !important; padding: 0; color: var(--modc); } .mod-btn .mod-t { display: none; } .mod-btn svg { display: block; } }


/* Quality (fused duplicates) */
.qtag { display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 6px; background: linear-gradient(180deg, #FFE07A, #F09A0C); color: var(--ink); font: 13px/1.3 var(--display); letter-spacing: .02em; vertical-align: 2px; text-shadow: none; border: 1px solid var(--ink); }
.fuse { display: grid; gap: 8px; padding: 10px 12px; border-radius: 10px; background: var(--card); border: 2px solid var(--ink); box-shadow: inset 0 0 0 1px var(--card-line); }
.fuse .row { align-items: center; gap: 8px; }
.qstars { display: inline-flex; gap: 4px; }
.qstars i { width: 14px; height: 14px; transform: rotate(45deg); border-radius: 3px; background: #061634; border: 1px solid var(--card-line); }
.qstars i.on { background: linear-gradient(180deg, #FFE07A, #F09A0C); border-color: var(--ink); }
.fuse-list { display: grid; gap: 6px; max-height: 210px; overflow: auto; }
.fuse-row { display: grid; grid-template-columns: 44px 1fr auto; gap: 8px; align-items: center; font-weight: 700; }
.fuse-row img { width: 44px; height: 44px; object-fit: contain; }

/* ---------- Phase 3 wave 2: brand, shop, forum, commanders */
.logo-img { display: block; width: min(640px, 92vw); height: auto; margin: 4px auto 0; filter: drop-shadow(0 8px 0 rgba(4,16,46,.55)); animation: logo-in .5s cubic-bezier(.2,1.4,.3,1) backwards; }
@keyframes logo-in { from { transform: scale(.7) rotate(-4deg); opacity: 0; } }
.boot img { width: min(560px, 86vw); height: auto; margin: 0 auto 10px; filter: drop-shadow(0 8px 0 rgba(4,16,46,.55)); }
.nav-logo { margin-left: auto; display: flex; align-items: center; padding: 0 6px 4px 12px; }
.nav-logo img { height: 38px; width: auto; filter: drop-shadow(0 2px 0 var(--ink)); transform: rotate(-2deg); transition: transform .15s; }
.nav-logo:hover img { transform: rotate(-2deg) scale(1.06); }
.col { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.col.end { align-items: flex-end; }
.row.between { justify-content: space-between; }
.kicker { display: block; font: 14px var(--display); letter-spacing: .08em; text-transform: uppercase; color: var(--gold); text-shadow: var(--outline-sm); }
.notice { background: var(--card); border: 2px solid var(--ink); border-radius: 8px; box-shadow: inset 0 0 0 1px var(--card-line); padding: 10px 12px; margin: 8px 0; font-weight: 700; }
.notice.warn { box-shadow: inset 0 0 0 1px var(--gold); color: #FFE7A8; }
.chip.gold { background: var(--gold); color: var(--ink); border-color: var(--ink); }
.chip.bad { background: #5A1020; border-color: var(--red); color: #FFC0CA; }
.chip.new { background: var(--pink); border-color: var(--ink); }
.chipbtn.danger { color: #FFC0CA; box-shadow: inset 0 0 0 1px var(--red); }
button.pill.credits, button.pill.power { font: inherit; color: inherit; cursor: pointer; text-align: left; }
button.pill.credits:hover { filter: brightness(1.15); }
.iconbtn.shop-btn { background: radial-gradient(circle at 50% 30%, #FFF1A8, #FFC62E 55%, #EF8F0A); color: var(--ink); box-shadow: inset 0 -3px 0 rgba(160,80,0,.45), inset 0 2px 0 rgba(255,255,255,.6), 0 3px 0 var(--ink); }
.iconbtn.shop-btn:hover { filter: brightness(1.08); }
.iconbtn.shop-btn:active { transform: translateY(2px); box-shadow: inset 0 -2px 0 rgba(160,80,0,.45), 0 1px 0 var(--ink); }
.cart-art { overflow: visible; filter: drop-shadow(0 1.5px 0 rgba(4,16,46,.35)); }
.cart-ink { stroke: var(--ink); }
.cart-body { fill: #2C7BEA; stroke: var(--ink); }
.cart-shine { stroke: #9FD3FF; }
.cart-slat { stroke: #154C9E; }
.cart-wheel { fill: #2A2F45; stroke: var(--ink); }
.cart-coin { fill: #FFD84A; stroke: var(--ink); }
.cart-bolt { fill: #F08A00; stroke: #B25A00; }
@media (max-width: 640px) { .cart-art { width: 22px; height: 22px; } }

/* hub tiles */
.hub { grid-template-rows: 220px 196px 164px 150px 170px 160px; grid-template-areas: "wreck rivals rivals" "wreck city create" "gigas lab quests" "faction faction rankings" "event event research" "shop shop forum"; }
.tile.tl-shop { grid-area: shop; background: #2A1E5E var(--tile-bg, none) 60% 45% / cover no-repeat; }
.tile.tl-shop .t-mons { top: 22px; right: 10px; }
.tile.tl-forum { grid-area: forum; background: #10306E var(--tile-bg, none) 55% 40% / cover no-repeat; }
.tile .t-live.gold { background: linear-gradient(180deg, #FFE07A, #F09A0C); color: var(--ink); text-shadow: none; animation: none; }

/* shop */
.shop, .forum { padding: 16px; padding-bottom: 60px; max-width: 1180px; margin: 0 auto; }
.shop > .tabs { margin-bottom: -2px; flex-wrap: wrap; }
.shop-body { padding: 14px; display: grid; gap: 12px; }
.sec-blurb { margin: 0; }
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.shop-card { display: grid; grid-template-columns: 76px 1fr; grid-template-rows: 1fr auto; gap: 6px 10px; padding: 12px; background: var(--card); border: 2px solid var(--ink); border-radius: 10px; box-shadow: inset 0 0 0 1px var(--card-line); }
.shop-card .sc-art { grid-row: span 2; display: grid; place-items: center; background: radial-gradient(circle at 50% 40%, #2C6BD0, #0B2459 70%); border-radius: 10px; border: 2px solid var(--ink); }
.shop-card .sc-art img { width: 64px; height: 64px; object-fit: contain; filter: drop-shadow(0 3px 0 rgba(4,16,46,.6)); }
.shop-card b { font: 20px var(--display); letter-spacing: .03em; text-transform: uppercase; text-shadow: var(--outline-sm); }
.shop-card p { margin: 2px 0; font-size: 13px; }
.shop-card .btn { justify-self: start; }
.shop-card.out { opacity: .6; }
.shop-sec { display: grid; gap: 14px; }
.shop-feature { display: grid; grid-template-columns: minmax(150px, 240px) 1fr; gap: 16px; padding: 14px; background: var(--card); border: 2px solid var(--ink); border-radius: 12px; box-shadow: inset 0 0 0 1px var(--card-line); }
.shop-feature .sf-art { display: grid; place-items: center; border-radius: 12px; border: 2px solid var(--ink); background: radial-gradient(circle at 50% 45%, #3E8BF0, #0B2459 72%); min-height: 190px; }
.shop-feature.el-thermal .sf-art { background: radial-gradient(circle at 50% 45%, #FF9A4A, #5A1A08 72%); }
.shop-feature.el-cryo .sf-art { background: radial-gradient(circle at 50% 45%, #8BE8FF, #0B3A6A 72%); }
.shop-feature.el-toxic .sf-art { background: radial-gradient(circle at 50% 45%, #B8F06A, #1E4A12 72%); }
.shop-feature.capsule .sf-art { background: radial-gradient(circle at 50% 45%, #FFE07A, #6A3A06 72%); }
.shop-feature .sf-art img { max-width: 88%; max-height: 210px; object-fit: contain; filter: drop-shadow(0 6px 0 rgba(4,16,46,.6)); }
.shop-feature .sf-info { display: grid; gap: 6px; align-content: start; }
.shop-feature h3 { margin: 0; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.shop-feature p { margin: 0; }
.odds-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px; }
.odds-row { display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: 6px; padding: 4px 8px; border-radius: 8px; background: #061634; border: 1px solid var(--card-line); }
.odds-row img { width: 40px; height: 34px; object-fit: contain; }
.odds-row b { font: 15px var(--display); letter-spacing: .03em; text-transform: uppercase; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.odds-row small { font: 800 13px var(--body); color: var(--gold); }
.cmd-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.cmd-card { display: grid; gap: 8px; justify-items: center; padding: 10px 6px; background: var(--card); border: 2px solid var(--ink); border-radius: 10px; box-shadow: inset 0 0 0 1px var(--card-line); }
.cmd-card .ava-port { width: 92px; height: 92px; }
.cmd-card.locked .ava-port { filter: saturate(.35) brightness(.75); }
.cmd-card.sel { box-shadow: inset 0 0 0 2px #fff, 0 0 0 3px var(--gold); }
/* locked cards: dim portrait, lock badge, full-colour tag saying how to unlock */
.ava-card { align-content: start; }
.ava-card .ava-tag { align-self: start; white-space: nowrap; }
.ava-card.locked .ava-tag { font-size: 13px; padding: 2px 10px; }
.ava-card.locked.lk-shop .ava-tag { background: var(--gold); color: var(--ink); }
.ava-card.locked.lk-fest .ava-tag { background: var(--pink); color: #fff; }
.ava-card.locked.lk-lvl .ava-tag { background: #7B3FDB; color: #fff; }
.ava-lock { display: none; }
.ava-card.locked .ava-lock { display: grid; place-items: center; position: absolute; top: 74px; left: calc(50% + 24px); width: 30px; height: 30px; border-radius: 50%; background: var(--ink); border: 2px solid #3D8EEA; }
.ava-card.locked .ava-lock::before { content: ''; width: 12px; height: 9px; margin-top: 6px; border-radius: 2px; background: #FFCD3C; box-shadow: 0 -7px 0 -2px transparent; }
.ava-card.locked .ava-lock::after { content: ''; position: absolute; top: 5px; left: 50%; transform: translateX(-50%); width: 8px; height: 9px; border: 2px solid #FFCD3C; border-bottom: 0; border-radius: 6px 6px 0 0; }
button.ava-card.locked:hover .ava-port { filter: saturate(.7) brightness(.95); }
.ava-card.locked .ava-port { filter: saturate(.35) brightness(.75); }
button.ava-card.locked { cursor: pointer; }
.inv { gap: 8px; }
.inv-row { display: grid; grid-template-columns: 56px 1fr auto; gap: 10px; align-items: center; padding: 8px 10px; background: var(--card); border: 2px solid var(--ink); border-radius: 10px; box-shadow: inset 0 0 0 1px var(--card-line); }
.inv-row .inv-ic { width: 52px; height: 52px; object-fit: contain; }
.inv-row b { font: 18px var(--display); letter-spacing: .03em; text-transform: uppercase; }
.inv-row p { margin: 2px 0 0; }

/* tonic picker on the team screen */
.tonics { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tonic { display: flex; align-items: center; gap: 6px; padding: 4px 10px 4px 4px; border-radius: 99px; border: 2px solid var(--ink); background: #061634; color: #fff; font: 800 13px var(--body); box-shadow: inset 0 0 0 1px var(--card-line); }
.tonic img { width: 30px; height: 30px; object-fit: contain; }
.tonic.on { background: linear-gradient(180deg, #FFE07A, #F09A0C); color: var(--ink); box-shadow: 0 0 0 2px #fff; }
.tonic:disabled { opacity: .45; }

/* forum (XenForo style, 0.9.0) */
.forum-head .title { overflow-wrap: anywhere; }
.f-toolbar { display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; align-items: center; margin-bottom: 10px; padding: 8px 10px; border-radius: 10px; background: rgba(4,16,46,.55); box-shadow: inset 0 0 0 1px var(--card-line); }
.f-nav { display: flex; gap: 6px; flex-wrap: wrap; }
.f-search { display: flex; gap: 6px; flex: 1 1 260px; max-width: 420px; }
.f-search input, .f-title-in input, .f-ta, .f-prefix-sel, .f-tools select, .f-modsel, .fx-requests select, .rv-lookup input {
  font: 600 15px var(--body); padding: 8px 10px; border: 2px solid var(--ink); border-radius: 8px; background: #061634; color: #fff; box-shadow: inset 0 0 0 1px var(--card-line); min-width: 0; }
.f-search input { flex: 1; }
.f-crumbs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 13px; font-weight: 800; color: var(--sub); margin: 0 0 6px; }
.f-crumbs .linkbtn { font-weight: 800; }
.f-home { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 14px; align-items: start; }
.f-cats { display: grid; gap: 14px; }
.f-cat { padding: 0; overflow: hidden; }
.f-cat-title { margin: 0; padding: 10px 14px; font: 22px var(--display); letter-spacing: .04em; text-transform: uppercase; text-shadow: var(--outline-sm); background: linear-gradient(180deg, #2C8BEE, #1150A8); border-bottom: 2px solid var(--ink); }
.f-node { display: grid; grid-template-columns: 30px minmax(0, 1fr) 150px 240px; gap: 12px; align-items: center; padding: 12px 14px; border-top: 1px solid rgba(61,142,234,.35); }
.f-node:first-of-type { border-top: 0; }
.f-node-ic { width: 26px; height: 26px; border-radius: 8px; border: 2px solid var(--ink); background: #0B2459; box-shadow: inset 0 0 0 1px var(--card-line); }
.f-node.unread .f-node-ic { background: linear-gradient(180deg, #FFE07A, #F09A0C); box-shadow: 0 0 0 2px rgba(255,205,60,.35); }
.f-node-title { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; background: none; border: 0; padding: 0; color: #fff; cursor: pointer; text-align: left; font: 22px var(--display); letter-spacing: .03em; text-transform: uppercase; text-shadow: var(--outline-sm); }
.f-node-title:hover { color: var(--gold); }
.f-node-main p { margin: 2px 0 0; }
.f-new { font: 12px var(--display); letter-spacing: .05em; padding: 1px 8px; border-radius: 99px; background: var(--gold); color: var(--ink); text-shadow: none; }
.f-node-stats, .f-trow-stats, .f-stats, .f-pb-stats, .modq-stats { display: flex; gap: 14px; margin: 0; }
.f-node-stats div, .f-trow-stats div { display: grid; justify-items: center; }
.f-node-stats dt, .f-trow-stats dt, .f-stats dt, .f-pb-stats dt, .modq-stats dt { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--sub); }
.f-node-stats dd, .f-trow-stats dd { margin: 0; font: 20px var(--display); }
.f-node-last { display: flex; gap: 8px; align-items: center; min-width: 0; }
.f-node-last > div { display: grid; min-width: 0; }
.f-last-title { display: flex; gap: 6px; align-items: center; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; text-align: left; font-weight: 700; color: #fff; }
.f-last-title.bold, .f-trow.unread .f-trow-title { font-weight: 800; color: #fff; }
.f-side { display: grid; gap: 14px; position: sticky; top: 10px; }
.f-widget { padding: 12px 14px; }
.f-widget h3 { margin: 0 0 8px; font: 18px var(--display); letter-spacing: .04em; text-transform: uppercase; color: var(--gold); text-shadow: var(--outline-sm); }
.f-wlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.f-wlist li { display: grid; gap: 1px; }
.f-wlist li .linkbtn { text-align: left; font-weight: 700; color: #DDF0FF; display: flex; gap: 6px; align-items: center; }
.f-wlist li.unread .linkbtn { color: #fff; font-weight: 800; }
.f-wlist li.unread .linkbtn::before { content: ''; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); }
.f-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.f-stats dd { margin: 0; font: 18px var(--display); }
.f-prefix { display: inline-block; flex: none; font: 12px/1.4 var(--display); letter-spacing: .05em; text-transform: uppercase; padding: 1px 8px; border-radius: 6px; border: 2px solid var(--ink); text-shadow: none; color: #fff; vertical-align: 2px; margin-right: 4px; }
.pf-gold { background: var(--gold); color: var(--ink); } .pf-pink { background: var(--pink); } .pf-blue { background: #2C8BEE; } .pf-purple { background: #8C4DE8; }
.pf-green { background: #2DB84B; } .pf-orange { background: #F07A1C; } .pf-red { background: #E03149; }
.f-filter { margin: 0 0 8px; gap: 6px; }
.f-tlist { padding: 0; overflow: hidden; }
.f-trow { display: grid; grid-template-columns: 40px minmax(0, 1fr) 150px 170px; gap: 12px; align-items: center; padding: 10px 14px; border-top: 1px solid rgba(61,142,234,.35); }
.f-trow:first-child { border-top: 0; }
.f-trow.pinned { background: rgba(255,205,60,.07); }
.f-trow.unread { box-shadow: inset 4px 0 0 var(--gold); }
.f-trow.hidden-post { opacity: .6; }
.f-trow-main { display: grid; gap: 2px; min-width: 0; }
.f-trow-title { display: block; background: none; border: 0; padding: 0; color: #DDF0FF; text-align: left; cursor: pointer; font: 700 16px var(--body); overflow-wrap: anywhere; }
.f-trow-title:hover { color: var(--gold); }
.f-flag { margin-right: 4px; }
.f-trow-last { display: flex; gap: 8px; align-items: center; justify-content: flex-end; text-align: right; }
.f-trow-last > div { display: grid; }
.linkname { background: none; border: 0; padding: 0; font: 800 13px var(--body); color: #fff; cursor: pointer; }
.linkname:hover { text-decoration: underline; }
.f-ava { width: 40px; height: 40px; border-radius: 50%; overflow: hidden; border: 2px solid var(--ink); background: radial-gradient(circle at 50% 35%, #7FD6FF, #1F6FD0); box-shadow: 0 0 0 2px var(--line); flex: none; display: block; }
.f-ava.sm { width: 32px; height: 32px; }
.f-ava.lg { width: 96px; height: 96px; box-shadow: 0 0 0 3px var(--line); }
.f-ava img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.f-ava.role-dev { box-shadow: 0 0 0 2px var(--dev); } .f-ava.role-tester { box-shadow: 0 0 0 2px var(--tester); } .f-ava.role-mod, .f-ava.role-admin { box-shadow: 0 0 0 2px var(--modc); }
.f-thread-title { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.f-thread-title .f-prefix { font-size: 16px; }
.f-posts { display: grid; gap: 12px; margin: 10px 0; }
.f-post { display: grid; grid-template-columns: 170px minmax(0, 1fr); padding: 0; overflow: hidden; }
.f-post.op { box-shadow: inset 0 0 0 2px var(--gold), 0 6px 0 rgba(4,16,46,.6); }
.f-post.focus { box-shadow: inset 0 0 0 3px #7FD6FF, 0 6px 0 rgba(4,16,46,.6); }
.f-post.deleted, .f-post.blocked, .f-post.hidden { opacity: .75; }
.f-postbit { display: grid; justify-items: center; align-content: start; gap: 6px; padding: 14px 10px; background: rgba(4,16,46,.45); border-right: 2px solid rgba(61,142,234,.35); text-align: center; }
.f-pb-ava { background: none; border: 0; padding: 0; cursor: pointer; }
.f-pb-name { display: grid; justify-items: center; gap: 4px; }
.f-pb-name .linkname { font: 18px var(--display); letter-spacing: .03em; text-transform: uppercase; text-shadow: var(--outline-sm); overflow-wrap: anywhere; }
.f-pb-stats { display: grid; grid-template-columns: auto auto; gap: 2px 10px; width: 100%; font-size: 12px; text-align: left; }
.f-pb-stats div { display: contents; }
.f-pb-stats dd { margin: 0; font-weight: 800; text-align: right; }
.f-post-main { display: grid; align-content: start; gap: 8px; padding: 12px 16px; min-width: 0; }
.f-post header { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; border-bottom: 1px solid rgba(61,142,234,.3); padding-bottom: 6px; }
.f-post-n { margin-left: auto; }
.f-post footer { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.folded { font-style: italic; }
.f-sig { border-top: 1px dashed rgba(61,142,234,.45); padding-top: 6px; max-height: 3.4em; overflow: hidden; font-size: 13px; color: #CFE6FF; }
.f-react-slot:empty { display: none; }
.f-reacts { display: flex; gap: 8px; align-items: center; padding: 4px 10px; border-radius: 99px; background: rgba(4,16,46,.5); width: max-content; max-width: 100%; }
.f-react-emojis { font-size: 18px; letter-spacing: 1px; }
.f-reacts { flex-wrap: wrap; border-radius: 14px; }
.f-rpill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px 2px 6px; border-radius: 99px; border: 2px solid rgba(160,200,255,.35); background: rgba(255,255,255,.06); color: #fff; font: inherit; cursor: default; }
button.f-rpill { cursor: pointer; transition: transform .12s, background .12s; }
button.f-rpill:hover, button.f-rpill:focus-visible { transform: translateY(-2px); background: rgba(255,255,255,.14); }
.f-rpill.mine { border-color: var(--gold); background: rgba(255,205,60,.22); }
.f-rpill .f-remoji { font-size: 17px; line-height: 1; }
.f-rpill b { font-size: 13px; }
.f-rpill.pop { animation: rpop .45s cubic-bezier(.3,1.6,.5,1); }
.f-rpill.pop .f-remoji { animation: rjump .6s ease-out; display: inline-block; }
@keyframes rpop { 0% { transform: scale(.6); } 60% { transform: scale(1.18); } 100% { transform: scale(1); } }
@keyframes rjump { 0% { transform: translateY(0) rotate(0); } 35% { transform: translateY(-9px) rotate(-14deg) scale(1.3); } 70% { transform: translateY(0) rotate(8deg); } 100% { transform: none; } }
.f-react-pick:not(.hidden) { animation: rpop .22s ease-out; transform-origin: bottom left; }
@media (prefers-reduced-motion: reduce) { .f-rpill.pop, .f-rpill.pop .f-remoji, .f-react-pick:not(.hidden) { animation: none; } }
.f-reacts small { font-weight: 700; color: #DDF0FF; }
.f-react-wrap { position: relative; }
.f-react-btn.on { background: linear-gradient(180deg, #FFE07A, #F09A0C); color: var(--ink); text-shadow: none; }
.f-react-pick { position: absolute; bottom: calc(100% + 6px); left: 0; z-index: 20; display: flex; gap: 2px; padding: 6px; border-radius: 99px; background: #0B2459; border: 2px solid var(--ink); box-shadow: 0 0 0 1px var(--card-line), 0 6px 16px rgba(0,0,0,.5); }
.f-react-opt { width: 40px; height: 40px; font-size: 22px; border: 0; border-radius: 50%; background: none; cursor: pointer; transition: transform .1s; }
.f-react-opt:hover, .f-react-opt:focus-visible { transform: scale(1.25); background: rgba(255,255,255,.1); }
.f-react-opt.on { background: rgba(255,205,60,.3); }
.f-reply { padding: 12px; display: grid; gap: 8px; }
.f-reply-who { display: flex; gap: 8px; align-items: center; font: 18px var(--display); text-transform: uppercase; letter-spacing: .04em; }
.f-compose { display: grid; gap: 10px; }
.f-title-row { display: flex; gap: 8px; flex-wrap: wrap; }
.f-title-in { position: relative; flex: 1 1 280px; display: grid; }
.f-title-in input { width: 100%; padding-right: 70px; font-weight: 700; }
.f-title-in .f-count { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); }
.f-editor { display: grid; gap: 0; border-radius: 10px; border: 2px solid var(--ink); background: #061634; box-shadow: inset 0 0 0 1px var(--card-line); overflow: visible; }
.f-ed-top { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: space-between; padding: 6px; border-bottom: 1px solid var(--card-line); background: #0B2459; border-radius: 8px 8px 0 0; }
.f-tools { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.f-tb { min-width: 34px; height: 32px; padding: 0 8px; border-radius: 6px; border: 2px solid var(--ink); background: #164591; color: #fff; font: 800 14px var(--body); cursor: pointer; box-shadow: inset 0 0 0 1px var(--card-line); }
.f-tb:hover, .f-tb:focus-visible { background: #2C8BEE; }
.f-tb.help { background: #2B4A78; }
.f-tools select { height: 32px; padding: 0 6px; font-size: 13px; }
.f-ta { width: 100%; border: 0; border-radius: 0; box-shadow: none; resize: vertical; min-height: 110px; line-height: 1.45; }
.f-preview { padding: 10px 12px; min-height: 110px; }
.f-ed-foot { display: flex; gap: 10px; justify-content: space-between; align-items: center; padding: 6px 10px; border-top: 1px solid var(--card-line); }
.f-count { font: 800 12px var(--body); color: var(--sub); white-space: nowrap; font-variant-numeric: tabular-nums; }
.f-count.near { color: var(--gold); } .f-count.over { color: #FF8A9A; }
.f-mod { margin: 6px 0; padding: 8px 10px; border-radius: 8px; background: rgba(166,255,52,.08); box-shadow: inset 0 0 0 1px var(--modc); gap: 6px; }
.f-modsel { height: 32px; padding: 0 6px; font-size: 13px; }
.forum-empty { padding: 18px; display: grid; gap: 10px; justify-items: start; }
.f-results { padding: 0; overflow: hidden; }
.f-result { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 12px; padding: 12px 14px; border-top: 1px solid rgba(61,142,234,.35); }
.f-result:first-child { border-top: 0; }
.f-snippet { margin: 4px 0; color: #DDF0FF; font-size: 14px; }
.f-help-wrap { overflow-x: auto; }
.f-help { width: 100%; border-collapse: collapse; font-size: 14px; }
.f-help td { padding: 6px 8px; border-top: 1px solid var(--card-line); vertical-align: top; }
.f-help code { color: var(--gold); white-space: pre-wrap; }
/* BB code output */
.bb { font-size: 15px; line-height: 1.5; overflow-wrap: anywhere; white-space: pre-wrap; }
.bb strong { font-weight: 800; } .bb-u { text-decoration: underline; }
.bb-c-red { color: #FF6B7D; } .bb-c-orange { color: #FF9A4A; } .bb-c-gold { color: var(--gold); } .bb-c-yellow { color: #FFF06B; } .bb-c-green { color: #6BE57E; }
.bb-c-teal { color: #4FE3D0; } .bb-c-blue { color: #7FC4FF; } .bb-c-purple { color: #C19BFF; } .bb-c-pink { color: #FF8FCB; } .bb-c-gray { color: #A9B8CF; }
.bb-s1 { font-size: 12px; } .bb-s2 { font-size: 15px; } .bb-s3 { font-size: 20px; } .bb-s4 { font-size: 28px; font-family: var(--display); letter-spacing: .02em; }
.bb-h { margin: 4px 0; font: 24px var(--display); letter-spacing: .03em; text-transform: uppercase; text-shadow: var(--outline-sm); white-space: normal; }
h3.bb-h { font-size: 30px; }
.bb-center { text-align: center; }
.bb-quote { margin: 6px 0; padding: 8px 12px; border-left: 4px solid var(--gold); border-radius: 0 8px 8px 0; background: rgba(4,16,46,.55); white-space: pre-wrap; }
.bb-quote-by { font-weight: 800; color: var(--gold); margin-bottom: 4px; white-space: normal; }
.bb-quote-by .linkbtn { font-weight: 800; color: var(--gold); }
.bb-spoiler { margin: 6px 0; border-radius: 8px; background: rgba(4,16,46,.55); box-shadow: inset 0 0 0 1px var(--card-line); }
.bb-spoiler summary { cursor: pointer; padding: 6px 10px; font: 15px var(--display); letter-spacing: .05em; text-transform: uppercase; color: var(--gold); white-space: normal; }
.bb-spoiler > div { padding: 0 12px 8px; }
.bb-code { margin: 6px 0; padding: 10px 12px; border-radius: 8px; background: #030B20; box-shadow: inset 0 0 0 1px var(--card-line); overflow-x: auto; white-space: pre; font: 13px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: #CFE6FF; }
.bb-icode { padding: 1px 5px; border-radius: 4px; background: #030B20; font: 13px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: #CFE6FF; }
.bb-list { margin: 4px 0; padding-left: 24px; white-space: normal; }
.bb-list li { white-space: pre-wrap; }
.bb-mention { background: rgba(127,196,255,.16); border: 0; border-radius: 4px; padding: 0 3px; color: #9FD3FF; font: inherit; font-weight: 800; cursor: pointer; }
.f-devopts { display: grid; gap: 8px; padding: 10px 12px; margin: 10px 0 0; border-radius: 8px; background: rgba(255,70,70,.10); box-shadow: inset 0 0 0 1px rgba(255,70,70,.55); }
.f-devopts b { color: #FF8A8A; }
.f-devopts input[type=datetime-local] { width: auto; padding: 6px 8px; }
.f-opt { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; margin-right: 12px; cursor: pointer; }
.f-sched { display: grid; gap: 12px; }
.f-sched-card { padding: 12px 14px; display: grid; gap: 8px; }
.f-sched-title { font-size: 18px; }
.f-sched-card details summary { cursor: pointer; font-weight: 800; color: var(--sub); }
.f-ava.team { background: radial-gradient(circle at 50% 40%, #FFE07A, #E58A0A); box-shadow: 0 0 0 2px var(--gold); }
.f-ava.team img { object-fit: contain; padding: 8%; }
.f-ava.team.portrait { background: radial-gradient(circle at 50% 35%, #7FD6FF, #1F6FD0); }
.f-ava.team.portrait { display: flex; align-items: flex-end; justify-content: center; }
.f-ava.team.portrait img { width: 88%; height: 88%; object-fit: contain; object-position: center bottom; padding: 0; }
.team-name { color: var(--gold); font-weight: 800; }
.team-chip { background: linear-gradient(180deg, #FFE07A, #F09A0C); color: var(--ink); border-color: var(--ink); text-shadow: none; }
.f-pb-team { margin: 6px 0 0; text-align: center; }
.bb-link { color: #9FD3FF; font-weight: 800; text-decoration: underline; text-underline-offset: 2px; }
.bb-link:hover { color: #CFE9FF; }
.bb-img { display: inline-block; max-width: 100%; max-height: 520px; height: auto; vertical-align: middle; border-radius: 8px; }
.bb-img-off { display: inline-block; padding: 2px 8px; border-radius: 6px; background: rgba(4,16,46,.55); color: var(--muted, #A9B8CF); font-size: 13px; }
.f-sig .bb-img { display: none; }
.bb-giga { display: inline-flex; align-items: center; gap: 6px; vertical-align: middle; margin: 1px 2px; padding: 2px 10px 2px 3px; border-radius: 999px; border: 2px solid var(--ink); white-space: nowrap; line-height: 1; }
.bb-giga-art { width: 30px; height: 30px; border-radius: 50%; background: rgba(4,16,46,.25); display: grid; place-items: center; overflow: hidden; flex: none; }
.bb-giga-art img { max-width: 100%; max-height: 100%; object-fit: contain; filter: drop-shadow(0 3px 0 rgba(4,16,46,.5)); }
.bb-giga b { font: 15px var(--display); letter-spacing: .04em; text-transform: uppercase; text-shadow: var(--outline-sm); }
.el-thermal.bb-giga { background: radial-gradient(circle at 50% 40%, #FFB36B, #C64A0C); }
.el-cryo.bb-giga { background: radial-gradient(circle at 50% 40%, #A6EEFF, #1C86C9); }
.el-toxic.bb-giga { background: radial-gradient(circle at 50% 40%, #CFF79C, #4E9E1C); }
.pager { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: center; margin: 8px 0; }
.pager .chipbtn.on { background: linear-gradient(180deg, #FFE07A, #F09A0C); color: var(--ink); text-shadow: none; }

@media (max-width: 1023px) {
  .hub { grid-template-rows: 220px 160px 150px 140px 140px 160px 140px 150px 130px; grid-template-areas: "wreck wreck" "create rivals" "city gigas" "lab quests" "faction rankings" "event event" "research research" "shop shop" "forum forum"; }
  .hudbtns .forum-btn, .hudbtns .shop-btn, .nav-logo { display: none; }
  .shop, .forum { padding: 10px 10px 30px; }
  .shop-feature { grid-template-columns: 1fr; }
  .shop-feature .sf-art { min-height: 150px; }
  .f-home { grid-template-columns: 1fr; }
  .f-side { position: static; }
  .f-node { grid-template-columns: 26px minmax(0, 1fr); }
  .f-node-stats { display: none; }
  .f-node-last { grid-column: 2; }
  .f-trow { grid-template-columns: 36px minmax(0, 1fr) auto; gap: 10px; padding: 10px; }
  .f-trow-stats { gap: 8px; } .f-trow-stats div:last-child { display: none; }
  .f-trow-last { display: none; }
  .f-post { grid-template-columns: 1fr; }
  .f-postbit { grid-template-columns: auto minmax(0, 1fr); justify-items: start; text-align: left; border-right: 0; border-bottom: 2px solid rgba(61,142,234,.35); padding: 10px 12px; gap: 4px 10px; }
  .f-postbit .f-pb-ava { grid-row: span 2; }
  .f-ava.lg { width: 56px; height: 56px; }
  .f-pb-name { justify-items: start; grid-auto-flow: column; align-items: center; }
  .f-pb-stats { display: flex; flex-wrap: wrap; gap: 2px 10px; }
  .f-pb-stats div { display: flex; gap: 4px; }
  .f-post-main { padding: 10px 12px; }
  .f-toolbar { padding: 6px; }
  .f-search { max-width: none; }
}

.chip.res.cmdr { padding-left: 3px; }
.chip.res.cmdr .cmdr-port { width: 22px; height: 22px; border-radius: 50%; overflow: hidden; border: 1px solid var(--ink); display: inline-block; background: #1F6FD0; }
.chip.res.cmdr .cmdr-port img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.fest-odds-group summary { cursor: pointer; font-weight: 800; margin: 6px 0; }
.odds-detail summary { cursor: pointer; font-weight: 800; color: var(--sub); margin-top: 4px; }
.odds-detail p { margin: 4px 0; line-height: 1.4; }
.pedia-wrap { display: grid; gap: 10px; }
.pedia-filter { flex-wrap: wrap; }

/* ---------- guided sign-up (0.8.2) */
.auth-hero.small .logo-img { max-width: min(380px, 80vw); }
.auth-choices { display: grid; gap: 10px; padding: 18px; width: min(420px, 100%); justify-items: stretch; text-align: center; }
.auth-how { margin: 4px 0 0; color: var(--sub); font-weight: 800; font-size: 14px; }
.auth-steps { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 12px; margin: 0 0 6px; padding: 0; counter-reset: st; font: 15px var(--display); text-transform: uppercase; letter-spacing: .03em; color: #fff; }
.auth-steps li::before { counter-increment: st; content: counter(st); display: inline-grid; place-items: center; width: 22px; height: 22px; margin-right: 5px; border-radius: 50%; background: var(--gold); color: var(--ink); border: 2px solid var(--ink); font-size: 13px; }
.stepper { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 0; padding: 0; }
.stepper li { display: flex; align-items: center; gap: 6px; padding: 3px 12px 3px 3px; border-radius: 99px; background: #0B2459; border: 2px solid var(--ink); color: var(--sub); font: 15px var(--display); text-transform: uppercase; letter-spacing: .04em; }
.stepper .st-n { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; background: #164591; color: #fff; border: 2px solid var(--ink); font-size: 14px; }
.stepper li.on { background: linear-gradient(180deg, #49AEFF, #1765D3); color: #fff; text-shadow: var(--outline-sm); }
.stepper li.on .st-n { background: var(--gold); color: var(--ink); text-shadow: none; }
.stepper li.done { color: #E2F2FF; }
.stepper li.done .st-n { background: #7BD31A; color: var(--ink); }
.wiz-actions { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 10px; }
.cmd-pick { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 18px; width: min(1100px, 100%); align-items: start; }
.cmd-preview { position: sticky; top: 12px; display: grid; justify-items: center; gap: 8px; padding: 16px 12px; }
.ava-port.big { width: 170px; height: 170px; box-shadow: 0 0 0 4px var(--gold); }
.cmd-cap { margin: 0; font-weight: 800; font-size: 14px; color: #E2F2FF; }
.name-step { display: grid; grid-template-columns: 250px minmax(0, 400px); gap: 22px; align-items: start; justify-content: center; width: min(720px, 100%); }
.wanted { display: grid; justify-items: center; gap: 6px; padding: 14px 12px 10px; background: #F4E3B5; color: var(--ink); border: 3px solid var(--ink); border-radius: 6px; box-shadow: 0 6px 0 rgba(4,16,46,.6); transform: rotate(-2deg); }
.wanted-top { font: 44px/1 var(--display); letter-spacing: .06em; text-transform: uppercase; color: #B3261E; }
.wanted .ava-port.big { width: 150px; height: 150px; border-radius: 8px; box-shadow: none; }
.wanted-name { font: 28px/1.05 var(--display); text-transform: uppercase; letter-spacing: .02em; word-break: break-all; min-height: 1em; }
.wanted-sub { font: 800 12px var(--body); text-transform: uppercase; letter-spacing: .08em; color: #6B4A1C; }
.wanted .linkbtn { color: #1765D3; font-weight: 800; }
.name-step .auth-form { width: 100%; text-align: left; }
.field { display: grid; gap: 4px; }
.field > span { font: 15px var(--display); text-transform: uppercase; letter-spacing: .04em; color: var(--sub); }
.field-note { margin: -4px 0 0; font-size: 12px; color: var(--sub); }
.pw-wrap { position: relative; display: block; }
.pw-wrap input { padding-right: 70px; }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); padding: 4px 10px; border-radius: 6px; border: 2px solid var(--ink); background: #164591; color: #fff; font: 14px var(--display); text-transform: uppercase; letter-spacing: .04em; }
.rules { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; font-size: 13px; font-weight: 800; color: var(--sub); }
.rules li::before { content: '○'; display: inline-block; width: 18px; }
.rules li.ok { color: #9CF06A; } .rules li.ok::before { content: '✓'; }
.rules li.bad { color: #FFC0CA; } .rules li.bad::before { content: '✕'; }
.el-wheel { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px; font-weight: 800; color: var(--sub); }
.briefing { display: grid; justify-items: center; gap: 12px; width: min(640px, 100%); }
.pip-says { display: flex; align-items: center; gap: 10px; text-align: left; }
.pip-says img { width: 64px; height: 64px; object-fit: contain; animation: bob 2.6s ease-in-out infinite; }
.pip-says p { margin: 0; font-weight: 700; }
.pip-says b { font: 18px var(--display); color: var(--gold); letter-spacing: .04em; text-shadow: var(--outline-sm); }
.brief-card { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 16px; align-items: center; padding: 18px; text-align: left; width: 100%; min-height: 170px; animation: fade .25s; }
.brief-card > img { width: 96px; height: 96px; object-fit: contain; filter: drop-shadow(0 4px 0 rgba(4,16,46,.5)); }
.brief-card h3 { margin: 0 0 6px; font: 30px var(--display); text-transform: uppercase; text-shadow: var(--outline); }
.brief-card p { margin: 0 0 8px; }
.brief-card .el-wheel { justify-content: flex-start; }
.brief-dots { display: flex; gap: 6px; }
.brief-dots span { width: 12px; height: 12px; border-radius: 50%; background: #164591; border: 2px solid var(--ink); }
.brief-dots span.seen { background: #49AEFF; } .brief-dots span.on { background: var(--gold); }
.pip-step { display: inline-block; font: 13px var(--display); letter-spacing: .05em; padding: 1px 8px; border-radius: 99px; background: var(--ink); color: var(--gold); white-space: nowrap; vertical-align: 1px; }
.help > .btn.sm { justify-self: start; margin-bottom: 6px; }
@media (max-width: 720px) {
  .cmd-pick, .name-step { grid-template-columns: 1fr; }
  .cmd-preview { position: static; grid-template-columns: auto 1fr; justify-items: start; align-items: center; }
  .ava-port.big { width: 96px; height: 96px; }
  .wanted { justify-self: center; width: min(260px, 100%); }
  .wanted .ava-port.big { width: 110px; height: 110px; }
  .wanted-top { font-size: 34px; }
  .brief-card { grid-template-columns: 64px minmax(0, 1fr); padding: 14px; }
  .brief-card > img { width: 64px; height: 64px; }
  .brief-card h3 { font-size: 24px; }
  .stepper .st-t { display: none; } .stepper li.on .st-t { display: inline; }
}
/* sign-up: keep the step buttons in reach, compact landing, Lab labels above the team */
.onboard .wiz-actions.sticky, .onboard > .btn.big { position: sticky; bottom: 0; z-index: 5; }
.onboard .wiz-actions.sticky { width: 100%; padding: 12px 0 14px; background: linear-gradient(180deg, transparent, rgba(5,22,64,.92) 35%); pointer-events: none; }
.onboard .wiz-actions.sticky > * { pointer-events: auto; }
.onboard > .btn.big { bottom: 14px; box-shadow: 0 6px 0 var(--ink), 0 8px 24px rgba(4,16,46,.7); }
.auth .hero-mons { height: clamp(100px, 20vh, 210px); }
.auth .logo-img { width: min(460px, 82vw); height: auto; }
.floor { height: 25%; }
.hs-label { bottom: 14%; }
@media (max-width: 720px) {
  .onboard { padding: 16px 12px 0; }
  .onboard .ava-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .onboard .ava-card { padding: 6px 4px; }
  .onboard .ava-port { width: 76px; height: 76px; }
  .onboard .ava-port.big { width: 96px; height: 96px; }
}

/* ---------- 0.9.0 */
.btn.team-add { --b1: #74EE85; --b2: #22A13B; }
.btn.team-on { --b1: #133A2A; --b2: #0B2419; color: #9CF06A; box-shadow: inset 0 0 0 2px #4BDD62, 0 4px 0 var(--ink); }
.btn.team-on:hover { color: #FFC0CA; box-shadow: inset 0 0 0 2px #FF6B7D, 0 4px 0 var(--ink); }
.bar.max > div { background: linear-gradient(90deg, #FFE07A, #F09A0C); }
.reveal-screen { min-height: 100dvh; isolation: isolate; background: radial-gradient(ellipse at 50% 40%, #1F5FC4 0, #0A2A66 55%, #051640 100%); }
/* sign-up: centred, and roomier on big screens */
.onboard { align-content: center; min-height: 100dvh; padding: clamp(16px, 3vh, 40px) clamp(12px, 3vw, 40px); }
.onboard > .title { font-size: clamp(32px, 4.2vw, 64px); margin: 0; }
.onboard > .sub { font-size: clamp(14px, 1.1vw, 18px); max-width: 760px; }
.cmd-pick { width: min(1240px, 100%); grid-template-columns: clamp(200px, 20vw, 300px) minmax(0, 1fr); }
.onboard .ava-grid { grid-template-columns: repeat(auto-fill, minmax(clamp(110px, 9vw, 150px), 1fr)); width: 100%; }
.onboard .ava-port { width: clamp(84px, 7.4vw, 124px); height: clamp(84px, 7.4vw, 124px); }
.cmd-preview .ava-port.big { width: clamp(150px, 15vw, 230px); height: clamp(150px, 15vw, 230px); }
.onboard .wiz-actions.sticky { background: none; pointer-events: auto; padding: 8px 0 0; position: static; }
.starter-row { width: min(1240px, 100%); }
.stepper li { font-size: clamp(13px, 1vw, 16px); }
@media (max-width: 720px) {
  .onboard { align-content: start; padding: 14px 12px 0; }
  .onboard .ava-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .onboard .ava-port { width: 76px; height: 76px; }
  .cmd-pick { grid-template-columns: 1fr; }
  .onboard .wiz-actions.sticky { position: sticky; bottom: 0; padding: 12px 0 14px; background: linear-gradient(180deg, rgba(5,22,64,0), rgba(5,22,64,.95) 40%); pointer-events: none; }
  .onboard .wiz-actions.sticky > * { pointer-events: auto; }
}
.auth-ban { max-width: 460px; text-align: center; }
/* notifications */
.notices { display: grid; gap: 10px; }
.notice-waiting { display: grid; gap: 6px; }
.notice-waiting .btn { justify-content: space-between; text-align: left; text-transform: none; font: 800 15px var(--body); text-shadow: none; }
.notice-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; max-height: 50vh; overflow: auto; }
.notice-list li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 10px; border-radius: 8px; background: var(--card); box-shadow: inset 0 0 0 1px var(--card-line); font-weight: 700; }
.notice-list li.nl-good { box-shadow: inset 3px 0 0 #4BDD62, inset 0 0 0 1px var(--card-line); }
.notice-list li.nl-bad { box-shadow: inset 3px 0 0 #FF3D5A, inset 0 0 0 1px var(--card-line); }
.notice-list li small { flex: none; }
.toast { cursor: pointer; }
/* factions */
.fx-mode { font-size: 11px; } .fx-mode.open { background: #2DB84B; color: #fff; } .fx-mode.invite { background: #8C4DE8; color: #fff; } .fx-mode.request { background: #2C8BEE; color: #fff; }
.fx-rank.leader { background: var(--gold); color: var(--ink); } .fx-rank.officer { background: #2C8BEE; color: #fff; }
.fx-requests, .fx-invites { padding: 14px; display: grid; gap: 10px; margin-bottom: 14px; }
.fx-requests .row .in { flex: 1 1 200px; }
.fx-inv-list .chip .linkbtn { color: #FF8A9A; font-weight: 800; }
/* rivals lookup */
.rv-lookup { margin: 0 0 10px; gap: 8px; } .rv-lookup .in { flex: 1 1 220px; max-width: 360px; }
.rv-grid.one { grid-template-columns: minmax(0, 360px); margin-bottom: 12px; }
/* moderation: players */
.modq-players { display: grid; gap: 12px; }
.modq-players > .panel { padding: 12px; }
.modq-player { display: grid; gap: 12px; }
.modq-player .panel { padding: 14px; display: grid; gap: 10px; }
.modq-stats { flex-wrap: wrap; gap: 14px 22px; }
.modq-stats dd { margin: 0; font-weight: 800; }
.modq-alts { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.modq-acts-panel .row .in { flex: 1 1 240px; }
.linkish.big { font: 26px var(--display); letter-spacing: .03em; text-transform: uppercase; }

@media (max-width: 400px) {
  .pills { gap: 10px; }
  .pill { padding: 0 6px 0 20px; }
  .pill b { font-size: 15px; }
  .pill .pic { width: 30px; height: 30px; left: -11px; }
  .iconbtn { width: 33px; height: 33px; }
  .ava { width: 40px; height: 40px; }
}
/* very large monitors only: the first-Giga reveal scales up a little (sign-in and sign-up stay compact, 0.19.2) */
@media (min-width: 2200px) and (min-height: 1200px) { .reveal-screen > :not(.burst) { zoom: 1.25; } }
.set-push { display: grid; gap: 6px; padding: 8px 0; border-top: 2px solid var(--line); }
.set-row.muted { opacity: .55; }
.chat-mod { margin-left: auto; padding: 4px 12px; font-size: 15px; color: var(--modc); text-shadow: var(--outline-sm); }
.chat-mod + .chat-close { margin-left: 6px; }
.msg-act.mod { color: #FF8E8E; }
.modal.cmt-modal { width: min(520px, 100%); }
.chat-modtools { display: grid; gap: 12px; min-width: 0; }
.cmt-head { display: grid; gap: 4px; padding-right: 44px; }
.cmt-head small { font: 800 12px var(--body); letter-spacing: .1em; text-transform: uppercase; color: var(--modc); }
.cmt-head .title { margin: 0; }
.cmt-status { display: flex; gap: 6px; flex-wrap: wrap; }
.cmt-pill { font: 800 12px var(--body); padding: 3px 10px; border-radius: 999px; border: 2px solid var(--ink); background: #0D2A60; color: #CFE2FF; }
.cmt-pill.ok { background: #1E6B32; color: #C9FFC2; }
.cmt-pill.warn { background: #7A4A06; color: #FFE08A; }
.cmt-sec { display: grid; gap: 8px; padding: 12px; border-radius: 12px; background: rgba(4,16,46,.35); box-shadow: inset 0 0 0 1px var(--card-line); }
.cmt-sec-head { display: grid; gap: 2px; }
.cmt-sec-head b { font: 18px var(--display); text-transform: uppercase; letter-spacing: .04em; text-shadow: var(--outline-sm); }
.cmt-sec-head small { font: 600 12.5px var(--body); color: var(--sub); }
.cmt-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cmt-seg { display: grid; grid-template-columns: repeat(6, 1fr); border: 2px solid var(--ink); border-radius: 10px; overflow: hidden; box-shadow: 0 3px 0 var(--ink); }
.cmt-seg button { min-width: 0; font: 15px var(--display); letter-spacing: .03em; color: #fff; text-shadow: var(--outline-sm); background: linear-gradient(180deg, #1B4A92, #0D2A60); border: 0; border-left: 1px solid rgba(4,16,46,.8); padding: 8px 0; cursor: pointer; }
.cmt-seg button:first-child { border-left: 0; }
.cmt-seg button.on { background: linear-gradient(180deg, #49AEFF, #1765D3); }
.cmt-seg button:hover:not(.on) { background: linear-gradient(180deg, #245BAE, #133673); }
.cmt-purge { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; align-items: center; }
.cmt-purge .in { min-width: 0; }
.cmt-foot { margin: 0; }
@media (max-width: 420px) { .cmt-purge { grid-template-columns: 1fr 1fr; } .cmt-purge .in { grid-column: 1 / -1; } }
/* dropdowns that sit with text fields: same dark field, our own chevron */
select.sel { appearance: none; -webkit-appearance: none; width: 100%; min-height: 46px; padding: 10px 44px 10px 14px; font: 700 16px var(--body); cursor: pointer;
  background: #061634 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23FFD23F' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 14px center; }
select.sel:hover { box-shadow: inset 0 0 0 1px #49AEFF; }
select.sel:focus-visible { outline: 3px solid #FFD23F; outline-offset: 1px; }
select.sel option { background: #0D2A60; color: #fff; }
/* faction roster: rank actions sit under the member, never over the name */
.fx-member.fx-mcard { flex-direction: column; align-items: stretch; }
.fx-member-top { display: flex; gap: 10px; align-items: center; min-width: 0; }
.fx-macts { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 8px; border-top: 1px solid var(--card-line); }
.fx-macts .btn { flex: 1 1 auto; }
/* ban screen */
.ban-screen .ban-card { position: relative; display: grid; gap: 12px; width: min(520px, 100%); margin: 0 auto; padding: 22px; text-align: left;
  background: linear-gradient(180deg, #3A1430, #22091C); box-shadow: inset 0 0 0 2px var(--red), 0 6px 0 var(--ink); }
.ban-screen .ban-card .title { margin: 0; padding-right: 110px; overflow-wrap: anywhere; }
.ban-stamp { position: absolute; top: 16px; right: 16px; transform: rotate(8deg); font: 26px var(--display); letter-spacing: .06em; text-transform: uppercase;
  color: #FF5A6E; border: 3px solid #FF5A6E; border-radius: 8px; padding: 2px 10px; text-shadow: none; box-shadow: inset 0 0 0 2px rgba(255,90,110,.25); }
.ban-box { background: rgba(4,16,46,.55); border: 2px solid var(--ink); border-radius: 10px; padding: 10px 12px; box-shadow: inset 0 0 0 1px rgba(255,90,110,.35); }
.ban-box small { display: block; font: 800 11px var(--body); letter-spacing: .1em; text-transform: uppercase; color: #FF9AA8; margin-bottom: 4px; }
.ban-box p { margin: 0; font: 600 16px/1.4 var(--body); color: #fff; overflow-wrap: anywhere; }
.ban-left { display: inline-block; margin-top: 6px; font: 22px var(--display); letter-spacing: .03em; color: #FFD23F; text-shadow: var(--outline-sm); }
.ban-acts { justify-content: flex-end; gap: 8px; }
/* beta tools */
.modq-subtabs { gap: 6px; margin: 10px 0 12px; align-items: center; }
.modq-subtabs .kicker { font: 800 12px var(--body); letter-spacing: .1em; text-transform: uppercase; color: var(--gold); margin-right: 4px; }
.modq-stack { max-height: 160px; overflow: auto; font: 12px/1.35 ui-monospace, Menlo, monospace; background: rgba(4,16,46,.6); border-radius: 8px; padding: 8px; white-space: pre-wrap; word-break: break-word; }
.modq-log tr.bal-hard td { color: #FF9AA8; } .modq-log tr.bal-easy td { color: #B6F5A8; }
.modq-log th { text-align: left; font: 800 12px var(--body); text-transform: uppercase; color: var(--sub); padding: 4px 8px; }
.inv-code { font: 800 16px ui-monospace, Menlo, monospace; letter-spacing: .12em; color: var(--gold); }
.sv-answers { margin: 6px 0 0; padding-left: 18px; display: grid; gap: 4px; }
.chip.beta-chip { background: linear-gradient(180deg, #B98CFF, #7A3FE0); color: #fff; border-color: var(--ink); }
.help-beta { display: grid; gap: 8px; padding: 12px; margin-bottom: 10px; border-radius: 12px; background: linear-gradient(180deg, rgba(122,63,224,.35), rgba(4,16,46,.35)); box-shadow: inset 0 0 0 1px var(--card-line); }
.beta-form { display: grid; gap: 10px; }
.beta-form .kicker, .whatsnew .kicker { font: 800 12px var(--body); letter-spacing: .1em; text-transform: uppercase; color: var(--gold); }
.beta-form .title, .whatsnew .title { margin: 0; }
.beta-form textarea { width: 100%; font: 600 15px var(--body); padding: 10px 12px; border: 2px solid var(--ink); border-radius: 8px; background: #061634; color: #fff; box-shadow: inset 0 0 0 1px var(--card-line); resize: vertical; }
.sv-scale { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: center; }
.sv-scale small { font: 700 12px var(--body); color: var(--sub); }
.sv-seg { grid-template-columns: repeat(5, 1fr); }
@media (max-width: 480px) { .sv-scale { grid-template-columns: 1fr 1fr; } .sv-scale .sv-seg { grid-column: 1 / -1; grid-row: 1; } }
.whatsnew { display: grid; gap: 10px; }
.wn-sec { border-top: 1px solid rgba(99,198,255,.16); padding: 6px 0 2px; }
.wn-sec > summary { cursor: pointer; font: 800 15px/1.3 var(--body); color: var(--gold); }
.wn-list { margin: 4px 0 0; padding-left: 18px; display: grid; gap: 6px; font: 600 15px/1.35 var(--body); }
.set-account { display: grid; gap: 6px; }
.danger-zone .title { color: #FF9AA8; }
.auth-foot { display: grid; gap: 2px; justify-items: center; }
.linkbtn.inline { padding: 0; display: inline; font: inherit; color: #CFE2FF; }
.field-note .linkbtn.inline { color: #FFD23F; }
.help a { color: var(--gold); font-weight: 800; }
.pack-card { display: grid; grid-template-columns: 56px 1fr; gap: 10px 12px; align-items: center; padding: 14px; background: var(--card); border: 2px solid var(--ink); border-radius: 12px; box-shadow: inset 0 0 0 1px var(--card-line); }
.pack-ico { width: 56px; height: 56px; object-fit: contain; filter: drop-shadow(0 3px 0 rgba(4,16,46,.6)); }
.pack-main { display: grid; gap: 6px; min-width: 0; }
.pack-main b { font: 20px/1.1 var(--display); text-transform: uppercase; letter-spacing: .03em; text-shadow: var(--outline-sm); }
.pack-card .btn { grid-column: 1 / -1; width: 100%; }
.pay-history { margin: 6px 0 0; padding-left: 18px; display: grid; gap: 4px; font: 600 14px var(--body); }

/* Developer tools in the MOD player card */
.dev-tools { border-color: var(--dev); }
.dev-tools .subhead { color: var(--dev); }
.dev-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px 14px; margin: 10px 0; }
.dev-cur { display: grid; grid-template-columns: 1fr 96px auto; align-items: center; gap: 6px; }
.dev-cur span { font-weight: 800; font-size: 14px; }
.dev-cur .in { width: 96px; }
.dev-tools .row { margin: 6px 0; gap: 8px; }
.dev-tools .in.grow { flex: 1; min-width: 200px; }
.dev-tools .in[type=number] { width: 110px; }
.dev-recent { margin-top: 10px; font-size: 14px; }
.dev-recent summary { cursor: pointer; font-weight: 800; }
.dev-recent ul { margin: 6px 0 0; padding-left: 18px; }
.dev-tools select.sel { width: auto; flex: 1 1 220px; min-height: 40px; padding: 8px 40px 8px 12px; font-size: 15px; color: #fff; }
.dev-tools .row > small { min-width: 78px; font-weight: 800; }
.dev-reset { margin-top: 14px; padding-top: 12px; border-top: 2px dashed rgba(255,70,70,.45); }
.dev-reset summary { cursor: pointer; font: 18px var(--display); text-transform: uppercase; letter-spacing: .04em; color: #FFB3B3; }
.dev-keep { display: inline-flex; align-items: center; gap: 4px; font-weight: 800; font-size: 14px; padding: 6px 10px; border: 2px solid var(--ink); border-radius: 8px; background: #0D2A60; cursor: pointer; }

/* moderation rule picker and requests (0.18.0) */
.mod-rules .mr-rules { gap: 6px; }
.mod-rules .chipbtn { font-size: 14px; padding: 4px 12px; }
.mod-rules .chipbtn.mr-other:not(.on) { border-style: dashed; }
.mod-rules textarea { width: 100%; resize: vertical; }
.mr-info[hidden] { display: none; }
.modq-req p { margin: 4px 0; }
.modq-req .modq-acts .in { flex: 1 1 220px; min-width: 0; }

/* ---------- wide PC screens (0.19.1): pages, grids, Home and chat grow with the window instead of
   leaving empty bands; laptops (1024-1679px) keep the layout above. */
@media (min-width: 1680px) {
  .shell { grid-template-columns: 1fr 390px; }
  .hub { max-width: 1600px; grid-template-rows: 270px 240px 200px 184px 208px; }
  .gigas, .quests, .rivals, .shop, .forum { max-width: 1600px; }
  .faction-scr, .research, .festival { max-width: 1480px; }
  .social { max-width: 1400px; }
  .modq { max-width: 1240px; }
  .qsec { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .qsec > .subhead, .qsec > .q-fold { grid-column: 1 / -1; }
  .quest { height: 100%; }
  .tile .t-title { font-size: 50px; } .tile .t-sub { font-size: 14px; }
  .tile.tl-wreck .t-title { font-size: 78px; } .tile.tl-faction .t-title, .tile.tl-event .t-title { font-size: 46px; }
}
@media (min-width: 2200px) {
  .shell { grid-template-columns: 1fr 440px; }
  .hub { max-width: 1960px; grid-template-rows: 330px 294px 246px 226px 256px; }
  .gigas, .quests, .rivals, .shop, .forum { max-width: 1960px; }
  .faction-scr, .research, .festival { max-width: 1760px; }
  .social { max-width: 1600px; }
  .modq { max-width: 1440px; }
  .qsec { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tile .t-title { font-size: 60px; } .tile .t-sub { font-size: 15px; }
  .tile.tl-wreck .t-title { font-size: 94px; } .tile.tl-faction .t-title, .tile.tl-event .t-title { font-size: 56px; }
}

/* PC chat dock: fold it away (settings.chatDock) and it waits as a bar at the bottom right */
.chat-hide { display: none; }
@media (min-width: 1024px) {
  .chat-head .chat-hide { display: grid; margin-left: auto; width: 34px; height: 34px; }
  .chat-hide svg { width: 18px; height: 18px; }
  .chat-mod:not(.hidden) ~ .chat-hide { margin-left: 6px; }
  .shell.chat-hidden { grid-template-columns: 1fr 0; }
  .shell.chat-hidden .chat { display: none; }
  .shell.chat-hidden .peek { display: flex; position: fixed; right: 16px; bottom: 16px; z-index: 40; width: min(380px, 36vw); height: 46px; align-items: center; gap: 8px; padding: 0 8px 0 14px;
    border: 3px solid var(--ink); border-radius: 23px; background: #0A2357; box-shadow: inset 0 0 0 1px var(--card-line), 0 6px 18px rgba(0,0,0,.45); color: #fff; text-align: left;
    font: 15px var(--display); letter-spacing: .03em; text-transform: uppercase; cursor: pointer; }
  .shell.chat-hidden .peek:hover { background: #0F2F70; }
  .shell.chat-hidden .peek-text { flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .shell.chat-hidden .peek-text b { color: var(--line); font-weight: 400; }
  .shell.chat-hidden .peek .badge { position: static; font-size: 14px; }
}
/* small laptops: a narrower dock leaves the game more room */
@media (min-width: 1024px) and (max-width: 1279px) { .shell:not(.chat-hidden) { grid-template-columns: 1fr 300px; } }

/* forum member profile (#forum:member:<name>) */
.f-member { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 18px; align-items: start; padding: 16px; margin-bottom: 14px; }
.f-ava.xl { width: 120px; height: 120px; }
.f-member-main { display: grid; gap: 12px; min-width: 0; justify-items: start; }
.f-member .f-pb-name { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; justify-items: start; }
.f-member-main .title { margin: 0; overflow-wrap: anywhere; }
.f-member-stats { display: flex; flex-wrap: wrap; gap: 8px; width: 100%; }
.f-member-stats div { display: grid; gap: 2px; min-width: 96px; padding: 8px 12px; border-radius: 10px; background: rgba(4,16,46,.4); box-shadow: inset 0 0 0 1px rgba(61,142,234,.35); }
.f-member-stats dd { margin: 0; font: 22px var(--display); letter-spacing: .03em; }
.f-member .f-sig { width: 100%; }
.f-member-posts .f-result { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 560px) { .f-member { grid-template-columns: 1fr; justify-items: center; } .f-member-main { justify-items: center; } }

/* ---------- sign-in and sign-up, compact (0.19.2): everything fits one screen on a laptop and stays
   a comfortable size on big monitors; phones keep the rules in their own media queries above. */
@media (min-width: 721px) {
  .auth { gap: 10px; padding: clamp(12px, 3vh, 28px) 20px; }
  .auth .hero-mons { height: clamp(64px, 12vh, 132px); }
  .auth .logo-img { width: clamp(220px, 27vh, 330px); margin-top: 0; }
  .auth .auth-hero.small .logo-img { width: clamp(190px, 22vh, 270px); }
  .auth .tagline { font-size: 17px; margin-top: 4px; }
  .auth-choices, .auth-form { width: min(360px, 100%); padding: 16px; gap: 8px; }
  .auth .btn.big { font-size: 22px; min-height: 46px; padding: 8px 22px; }
  .auth .btn.alt { font-size: 17px; }
  .auth .title.sm { font-size: 26px; margin: 0 0 2px; }
  .auth-form input { padding: 10px 12px; font-size: 15px; }
  .auth .auth-steps { font-size: 13px; }
  .auth-foot .fine { font-size: 12px; margin: 0; }
  .onboard { gap: 10px; padding: clamp(12px, 2.5vh, 28px) clamp(12px, 3vw, 32px); }
  .onboard > .title { font-size: clamp(28px, 2.6vw, 40px); }
  .onboard > .sub { font-size: 14px; max-width: 640px; }
  .stepper li { font-size: 13px; padding: 2px 10px 2px 2px; }
  .stepper .st-n { width: 22px; height: 22px; font-size: 12px; }
  .onboard .btn.big { font-size: 22px; min-height: 46px; padding: 8px 24px; }
  .cmd-pick { width: min(980px, 100%); grid-template-columns: 210px minmax(0, 1fr); gap: 14px; }
  .cmd-preview { padding: 12px 10px; }
  .cmd-preview .ava-port.big { width: 150px; height: 150px; }
  .onboard .ava-grid { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
  .onboard .ava-card { padding: 6px 4px; }
  .onboard .ava-port { width: clamp(64px, 9vh, 84px); height: clamp(64px, 9vh, 84px); }
  .name-step { grid-template-columns: 210px minmax(0, 360px); gap: 18px; width: min(620px, 100%); }
  .wanted { padding: 10px 10px 8px; gap: 4px; }
  .wanted-top { font-size: 34px; }
  .wanted .ava-port.big { width: 118px; height: 118px; }
  .wanted-name { font-size: 22px; }
  .name-step .auth-form { gap: 6px; padding: 14px; }
  .starter-row { width: min(900px, 100%); gap: 12px; }
  .starter { padding: 10px; gap: 6px; }
  .starter-art { height: clamp(120px, 20vh, 170px); padding: 6px; overflow: hidden; box-sizing: border-box; grid-template-rows: minmax(0, 1fr); }
  .starter-art > img { display: block; height: 100%; max-height: 100%; width: 100%; object-fit: contain; }
  .starter h3 { font-size: 26px; }
  .briefing { width: min(580px, 100%); gap: 10px; }
  .brief-card { min-height: 140px; padding: 14px; }
  .brief-card h3 { font-size: 24px; }
}

/* reward boxes (0.20.0) */
.boxes { display: grid; gap: 16px; }
.box-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; align-items: stretch; }
.box-card { display: flex; flex-direction: column; gap: 12px; padding: 14px 16px 16px; min-width: 0; }
.box-top { display: flex; gap: 14px; align-items: center; }
.box-top h3 { margin: 0; font: 26px var(--display); letter-spacing: .03em; text-transform: uppercase; text-shadow: var(--outline-sm); }
.box-top p { margin: 2px 0 0; }
.box-ic { width: 72px; height: 72px; object-fit: contain; flex: none; filter: drop-shadow(0 3px 0 rgba(4,16,46,.55)); }
.box-card.k-scrap .box-ic.fallback { filter: grayscale(.85) brightness(1.15) drop-shadow(0 3px 0 rgba(4,16,46,.55)); }
.box-card.k-lab .box-ic.fallback { filter: hue-rotate(95deg) saturate(1.2) drop-shadow(0 3px 0 rgba(4,16,46,.55)); }
.box-card.k-vault .box-ic.fallback { filter: sepia(.6) saturate(2.2) hue-rotate(-10deg) brightness(1.1) drop-shadow(0 3px 0 rgba(4,16,46,.55)); }
.box-base { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px 10px; border-radius: 8px; background: rgba(4,16,46,.35); box-shadow: inset 0 0 0 1px var(--card-line); }
.box-base > small { font-weight: 800; margin-right: 2px; }
.odds { width: 100%; border-collapse: collapse; font-size: 14px; }
.odds caption { text-align: left; padding: 0 0 6px; font-weight: 800; color: var(--sub); }
.odds td { padding: 5px 6px; border-top: 1px solid rgba(255,255,255,.12); vertical-align: middle; }
.odds-p { width: 4.2em; font-weight: 800; text-align: right; white-space: nowrap; color: var(--gold); }
.box-pity { display: grid; gap: 6px; padding: 10px 12px; border-radius: 8px; background: rgba(4,16,46,.35); box-shadow: inset 0 0 0 1px var(--card-line); }
.box-pity small { line-height: 1.35; }
.box-acts { margin-top: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding-top: 4px; }
.box-acts .fine { flex: 1 1 140px; }
.box-earn { padding: 14px 16px; margin-top: 14px; }
.box-result { padding: 10px 14px; margin-bottom: 14px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.box-result-acts { margin-left: auto; display: inline-flex; gap: 12px; }
.chip.box { background: rgba(255, 210, 63, .18); }
/* City Power gets its own pill on wide screens; it drops its label, then hides, as the bar narrows */
@media (max-width: 1365px) { .pill.power small { display: none; } }
@media (max-width: 1199px) { .pill.power { display: none; } }
/* Biofuel: the + sits inside the pill (it used to hang off the edge into the Credits coin) */
.pills { gap: 28px; }
.pill.biofuel { padding-right: 42px; }
.pill.biofuel .fillbar { right: 42px; }
.pill .plus { right: 7px; top: 50%; width: 26px; height: 26px; font: 900 22px/1 var(--body); padding-bottom: 2px; box-shadow: inset 0 2px 0 rgba(255,255,255,.45), 0 2px 0 var(--ink); }
.pill .plus:hover { filter: brightness(1.12); }
@media (max-width: 1023px) { .pills { gap: 14px; } }
.land-adds { display: grid; gap: 6px; margin: 4px 0 8px; }
/* moving a building: a fixed-size bar at the bottom of the city (where a thumb is), so it does not
   jump about while the preview changes */
.move-bar { position: absolute; left: 50%; bottom: calc(14px + var(--safe-b)); transform: translateX(-50%); z-index: 4; width: min(580px, calc(100% - 24px));
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px 14px;
  padding: 10px 12px; border-radius: 12px; border: 2px solid var(--ink); background: linear-gradient(180deg, #164591, #0B2459); box-shadow: inset 0 0 0 2px #3FD6FF, 0 4px 0 var(--ink); }
.move-text { display: grid; gap: 2px; min-width: 0; }
.move-bar b { color: #9FE9FF; font: 18px var(--display); letter-spacing: .03em; text-transform: uppercase; }
.move-hint { color: #DDEBFF; font-weight: 700; font-size: 14px; }
.move-hint.free { color: #8EF59E; }
.move-hint.swap { color: #9FE9FF; }
.move-acts { display: flex; gap: 8px; }
@media (max-width: 520px) { .move-bar { grid-template-columns: 1fr; } .move-acts .btn { flex: 1; } }
.city-canvas.moving { touch-action: none; cursor: grab; }
.city-canvas.moving:active { cursor: grabbing; }
.move-row { gap: 10px; align-items: center; margin-top: 8px; }

/* ---------------------------------------------------------------- Sleeper Agents (0.20.6) */
.ag-intro { display: grid; grid-template-columns: 1fr 240px; gap: 16px; align-items: start; margin-bottom: 14px; }
.ag-intro p { margin: 4px 0 0; color: #CFE0FF; }
.ag-me { display: grid; gap: 4px; justify-items: start; padding: 12px; border-radius: 12px; border: 2px solid var(--ink); background: linear-gradient(180deg, #2B2160, #171040); box-shadow: inset 0 0 0 2px rgba(170,140,255,.35); }
.ag-me b { font: 22px var(--display); text-transform: uppercase; color: #D9C8FF; }
.ag-me small { color: #B9C8EE; }
.ag-hire { display: flex; align-items: center; gap: 14px; padding: 12px 16px; margin-bottom: 14px; border-radius: 14px; border: 3px solid var(--ink);
  background: linear-gradient(120deg, #3A2A86, #1D1652 60%); box-shadow: inset 0 0 0 2px rgba(170,140,255,.5), 0 4px 0 var(--ink); }
.ag-hire > div:nth-child(2) { display: grid; gap: 2px; flex: 1; }
.ag-hire b { font: 26px var(--display); text-transform: uppercase; }
.ag-hire small { color: #C9B8FF; font-weight: 800; }
.ag-left { display: grid; justify-items: end; }
.ag-left .tmr { font: 26px var(--display); color: var(--gold); text-shadow: var(--outline-sm); }
.chip.ag-boost { background: #2DB848; color: #fff; font-weight: 800; }
.chip.ag-boost.xp { background: #8A5CFF; }
.ag-work { display: grid; gap: 6px; margin-bottom: 14px; }
.ag-row { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 10px; background: rgba(4,16,46,.35); }
.ag-row .ava, .ag-card .ava, .ag-hire .ava { width: 44px; height: 44px; }
.ag-row .tmr { font-weight: 800; color: var(--gold); }
.ag-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.ag-card { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 10px; border-radius: 12px; border: 2px solid var(--ink);
  background: linear-gradient(180deg, #1D3F7E, #102758); box-shadow: inset 0 0 0 1px var(--card-line), 0 3px 0 var(--ink); }
.ag-card.full { opacity: .6; }
.ag-info { display: grid; gap: 2px; min-width: 0; }
.ag-info small { color: #B9C8EE; }
.ag-offer { display: grid; gap: 14px; }
.ag-offer .row { gap: 12px; }
.ag-bonus { display: grid; gap: 6px; font-weight: 800; }
.ag-bonus .in { font: 24px var(--display); }
.ag-quote { min-height: 74px; }
.ag-q-boost { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ag-q-boost span { display: grid; justify-items: center; padding: 10px; border-radius: 12px; border: 2px solid var(--ink); background: linear-gradient(180deg, #2DB848, #157A2B); }
.ag-q-boost span:last-child { background: linear-gradient(180deg, #8A5CFF, #5631C4); }
.ag-q-boost b { font: 34px var(--display); text-shadow: var(--outline-sm); }
.ag-q-boost small { font-weight: 800; }
@media (max-width: 720px) { .ag-intro { grid-template-columns: 1fr; } .ag-hire { flex-wrap: wrap; } }
.tmr { white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- Faction Epic Battles (0.20.8) */
.fx-epic { display: grid; grid-template-columns: 150px minmax(0, 1fr) 280px; gap: 18px; align-items: start; padding: 18px 20px; margin-bottom: 14px; border: 3px solid var(--ink);
  background: linear-gradient(120deg, #4A1A6E, #1B1050 55%, #0D2A60); box-shadow: inset 0 0 0 2px rgba(255,120,220,.35), 0 4px 0 var(--ink); }
.fx-epic-art { display: grid; place-items: center; align-self: start; }
.fx-epic-art img { width: 150px; height: 150px; object-fit: contain; filter: drop-shadow(0 6px 0 rgba(4,16,46,.6)); }
.fx-epic-main { display: grid; gap: 10px; min-width: 0; }
.fx-epic-main h2 { margin: 0; }
.fx-epic-main p { margin: 0; }
.fx-epic-kick { font: 14px var(--display); text-transform: uppercase; letter-spacing: .05em; color: #FF9DE6; }
.fx-epic-tiers { padding: 10px 12px; border-radius: 12px; background: rgba(4,16,46,.35); }
.fx-epic-tiers summary { cursor: pointer; font-weight: 800; }
.fx-epic-tiers .row { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 8px; align-items: center; margin: 8px 0 0; }
.fx-epic-tiers .row > b { font-size: 14px; }
.fx-epic-tiers .row > .tier-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.fx-epic-tiers p { margin: 10px 0 0; }
.fx-epic-board { align-self: start; padding: 12px; border-radius: 12px; background: rgba(4,16,46,.55); box-shadow: inset 0 0 0 1px rgba(255,157,230,.25); }
.fx-epic-board > small { display: block; font: 16px var(--display); text-transform: uppercase; letter-spacing: .04em; color: #FF9DE6; margin-bottom: 4px; }
.fx-epic-board ol { list-style: none; margin: 6px 0 0; padding: 0; counter-reset: ep; display: grid; gap: 4px; }
.fx-epic-board li { counter-increment: ep; display: grid; grid-template-columns: 22px 26px auto 1fr auto; gap: 6px; align-items: center; padding: 4px 6px; border-radius: 8px; }
.fx-epic-board li::before { content: counter(ep); font: 16px var(--display); color: var(--gold); }
.fx-epic-board li.me { background: rgba(255,210,63,.18); }
.fx-epic-board .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fx-epic-board .emb.sm { width: 26px; height: 26px; }
@media (max-width: 1100px) { .fx-epic { grid-template-columns: 120px minmax(0, 1fr); } .fx-epic-board { grid-column: 1 / -1; } .fx-epic-art img { width: 120px; height: 120px; } }
@media (max-width: 640px) { .fx-epic { grid-template-columns: 1fr; } .fx-epic-tiers .row { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------- daily login rewards (0.20.8) */
.daily { display: grid; gap: 12px; text-align: center; }
.daily-modal { width: min(940px, 96vw); }
.daily-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.daily-day .row { gap: 4px; min-width: 0; }
.daily-day .chip { max-width: 100%; white-space: normal; }
.daily-day { position: relative; display: grid; gap: 6px; align-content: start; padding: 8px 6px; border-radius: 12px; border: 2px solid var(--ink);
  background: linear-gradient(180deg, #1D3F7E, #102758); box-shadow: inset 0 0 0 1px var(--card-line); min-height: 78px; }
.daily-day small { font: 15px var(--display); text-transform: uppercase; color: #BFD3FF; }
.daily-day .chip { font-size: 11px; padding: 1px 5px; }
.daily-day .chip img { width: 14px; height: 14px; }
.daily-day.big { background: linear-gradient(180deg, #6A3FC4, #3A1F86); }
.daily-day.jackpot { background: linear-gradient(180deg, #F5B400, #B86A00); box-shadow: inset 0 0 0 2px #FFE89A; }
.daily-day.jackpot small { color: #1A1033; }
.daily-head { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; }
.daily-head .title { margin: 0; }
.daily-streak { background: #3A1F86; color: #FFD9A8; font-weight: 800; }
.daily-day.done { opacity: .55; }
.daily-day.now { box-shadow: inset 0 0 0 2px #fff, 0 0 0 3px var(--gold), 0 0 18px rgba(255,210,63,.6); animation: daily-glow 1.4s ease-in-out infinite; }
.daily-day.pop { animation: rpop .45s cubic-bezier(.3,1.6,.5,1); }
.daily-check { position: absolute; right: 6px; top: 4px; font-style: normal; font: 20px var(--display); color: #8CFFB0; text-shadow: var(--outline-sm); }
@keyframes daily-glow { 50% { box-shadow: inset 0 0 0 2px #fff, 0 0 0 3px var(--gold), 0 0 28px rgba(255,210,63,.95); } }
@media (prefers-reduced-motion: reduce) { .daily-day.now, .daily-day.pop { animation: none; } }
@media (max-width: 720px) { .daily-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 400px) { .daily-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* ---------------------------------------------------------------- walls and faction adverts (0.20.10) */
.wall { display: grid; gap: 10px; }
.wall-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.wall-head .subhead { margin: 0; }
.wall-mode { display: flex; align-items: center; gap: 8px; }
.wall-compose { display: grid; gap: 6px; }
.wall-ta { width: 100%; resize: vertical; min-height: 58px; }
.wall-send { gap: 10px; align-items: center; }
.wall-send .btn { margin-left: auto; }
.wall-list { display: grid; gap: 8px; }
.wall-post { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; padding: 10px 12px; border-radius: 12px; border: 2px solid var(--ink);
  background: linear-gradient(180deg, #1D3F7E, #122E66); box-shadow: inset 0 0 0 1px var(--card-line); animation: fadeUp .24s cubic-bezier(.2,.8,.2,1) both; }
.wall-post.mine { box-shadow: inset 0 0 0 2px rgba(255,210,63,.45); }
.wall-ava { background: none; border: 0; padding: 0; cursor: pointer; align-self: start; }
.wall-ava .pava { width: 44px; height: 44px; }
.wall-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.wall-body { margin: 4px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.wall-acts { display: flex; gap: 12px; margin-top: 4px; }
.wall-acts .linkbtn { font-size: 12px; }
.wall-empty { text-align: center; padding: 10px; }
.wall-more { justify-self: center; }
.fx-wall { margin-top: 14px; padding: 14px 18px; }
.fx-ad { margin-bottom: 14px; display: grid; gap: 10px; padding: 14px 18px; }
.fx-ad-head { justify-content: space-between; align-items: center; }
.fx-ad-head .subhead { margin: 0; }
.fx-tagline { margin: 4px 0 0; font-weight: 800; font-style: italic; color: #FFE9A6; }
.fx-tagline.big { font: 24px/1.1 var(--display); font-style: normal; letter-spacing: .02em; color: var(--gold); text-shadow: var(--outline-sm); margin: 0; }
.fx-adchips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.fx-adchips .chip.ok { background: #2DB848; color: #fff; }
.chip.fx-focus { background: #3A2A86; color: #E6DBFF; }
.fx-recruit { padding: 10px 12px; border-radius: 12px; background: rgba(4,16,46,.4); }
.fx-recruit small { display: block; font: 14px var(--display); text-transform: uppercase; color: #BFD3FF; }
.fx-recruit p { margin: 4px 0 0; white-space: pre-wrap; }
.fx-focus-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.fx-adform { display: grid; gap: 12px; }
.fx-adform-2 { gap: 12px; } .fx-adform-2 .field { flex: 1; min-width: 180px; }
.fx-adform-check { gap: 8px; align-items: center; font-weight: 800; }

@media (max-width: 440px) { .soc-row { flex-wrap: wrap; } .soc-row > .soc-acts { width: 100%; justify-content: flex-end; } }

/* ---------------------------------------------------------------- Settings (0.20.13) */
.modal.settings-modal { width: min(620px, 100%); padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.settings2 { display: flex; flex-direction: column; min-height: 0; max-height: calc(100dvh - 24px); padding: 0; }
.set-head { display: flex; align-items: center; gap: 12px; padding: 18px 64px 12px 20px; }
.set-head .ava { width: 52px; height: 52px; flex: none; }
.set-who { display: grid; gap: 2px; min-width: 0; }
.set-who .title { margin: 0; }
.set-who small { color: var(--sub); font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.set-tabs { display: flex; gap: 4px; margin: 0 16px; padding: 4px; background: rgba(4,16,46,.45); border: 2px solid var(--ink); border-radius: 12px; overflow-x: auto; scrollbar-width: none; }
.set-tabs::-webkit-scrollbar { display: none; }
/* 0.26.6: the head and tab strip never shrink in the flex column (short screens squashed the tabs) */
.set-head, .set-tabs { flex: none; }
@media (max-height: 640px) { .set-pane { min-height: 0; } }
.set-tabs button { flex: 1 0 auto; padding: 8px 12px; border-radius: 8px; border: 0; background: transparent; box-shadow: none; text-shadow: none; font: 15px/1 var(--display); letter-spacing: .03em; text-transform: uppercase; color: var(--sub); white-space: nowrap; transition: background .15s, color .15s; }
.set-tabs button:hover { color: #fff; background: rgba(255,255,255,.06); }
.set-tabs button.on { color: var(--ink); background: linear-gradient(180deg, #FFE27A, var(--gold)); box-shadow: inset 0 -2px 0 var(--gold-lo); text-shadow: none; }
.set-tabs button:focus-visible { outline: 3px solid #fff; outline-offset: 1px; }
.set-pane { display: grid; gap: 12px; padding: 14px 16px 18px; overflow-y: auto; flex: 1 1 auto; min-height: min(430px, 60dvh); align-content: start; scrollbar-color: var(--line) transparent; }
.set-pane > * { animation: fadeUp .2s cubic-bezier(.2,.8,.2,1) both; }
.set-card { display: grid; gap: 2px; padding: 6px 4px 4px; background: var(--card); border: 2px solid var(--ink); border-radius: 14px; box-shadow: inset 0 0 0 1px var(--card-line); }
.set-card-h { margin: 6px 12px 4px; font: 15px var(--display); letter-spacing: .05em; text-transform: uppercase; color: var(--sub); }
.set-card .set-push > .subhead:first-child { display: none; }
.set-card .set-push { padding: 6px 10px; }
.set-item { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 12px; border-radius: 10px; cursor: default; }
label.set-item { cursor: pointer; }
.set-item + .set-item { border-top: 1px solid rgba(99,198,255,.14); }
label.set-item:hover { background: rgba(255,255,255,.04); }
.set-text { display: grid; gap: 2px; min-width: 0; }
.set-text b { font-weight: 800; }
.set-text small { color: #9CC3F0; font-weight: 600; font-size: 13px; line-height: 1.3; }
.set-item > .btn, .set-item > a.btn { flex: none; }
.set-slider { display: flex; align-items: center; gap: 10px; flex: none; }
.set-slider input[type=range] { -webkit-appearance: none; appearance: none; width: clamp(110px, 26vw, 180px); height: 8px; border-radius: 99px; border: 2px solid var(--ink);
  background: linear-gradient(90deg, var(--line) var(--fill, 50%), rgba(4,16,46,.7) var(--fill, 50%)); cursor: pointer; }
.set-slider input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; border-radius: 50%; background: #fff; border: 3px solid var(--ink); box-shadow: 0 2px 0 var(--ink); }
.set-slider input[type=range]::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 3px solid var(--ink); }
.set-slider input[type=range]:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.set-val { min-width: 38px; text-align: right; font: 15px var(--display); color: #fff; }
.set-np { display: flex; align-items: center; gap: 10px; margin: 2px 8px 4px; padding: 8px 10px; border-radius: 10px; background: rgba(4,16,46,.5); border: 1px solid rgba(99,198,255,.2); }
.set-np-icon { width: 34px; height: 34px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--panel); border: 2px solid var(--ink); font-size: 18px; }
.set-np-text { display: grid; min-width: 0; flex: 1; }
.set-np-text small { color: #9CC3F0; font-size: 12px; font-weight: 700; }
.set-np-text b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.set-pane .music-credit { margin: 0 4px; font-size: 12px; color: #8FB4E0; }
/* switches: every checkbox in Settings, including the notification preferences */
.settings2 input[type=checkbox] { -webkit-appearance: none; appearance: none; flex: none; position: relative; width: 48px; height: 28px; margin: 0; border-radius: 99px;
  background: rgba(4,16,46,.8); border: 2px solid var(--ink); box-shadow: inset 0 0 0 1px rgba(99,198,255,.25); cursor: pointer; transition: background .18s; }
.settings2 input[type=checkbox]::after { content: ''; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: #B7CBEA; border: 2px solid var(--ink); transition: transform .18s cubic-bezier(.2,.8,.2,1), background .18s; }
.settings2 input[type=checkbox]:checked { background: var(--green-lo); box-shadow: inset 0 0 0 1px var(--green); }
.settings2 input[type=checkbox]:checked::after { transform: translateX(20px); background: #fff; }
.settings2 input[type=checkbox]:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.settings2 .set-row { background: none; border: 0; box-shadow: none; padding: 8px 2px; }
.set-account { display: grid; gap: 12px; }
.set-links { display: flex; flex-wrap: wrap; gap: 8px; padding: 6px 12px 10px; }
.set-danger { box-shadow: inset 0 0 0 1px rgba(255,61,90,.55); background: linear-gradient(180deg, rgba(255,61,90,.1), transparent 60%), var(--card); }
.set-danger .set-card-h { color: #FF8A9C; }
.set-foot { display: flex; justify-content: flex-end; }
@media (max-width: 560px) {
  .modal.settings-modal { width: 100%; }
  .set-head { padding: 14px 58px 10px 14px; }
  .set-head .ava { width: 44px; height: 44px; }
  .set-tabs { margin: 0 10px; }
  .set-tabs button { flex: 1 0 auto; padding: 8px 7px; font-size: 12.5px; letter-spacing: .01em; }
  .set-pane { padding: 12px 10px 16px; }
  .set-item { padding: 10px 8px; }
  .set-item:has(.set-slider) { flex-wrap: wrap; }
  .set-item:has(.set-slider) .set-slider { width: 100%; }
  .set-item:has(.set-slider) .set-slider input { flex: 1; width: auto; }
}
@media (prefers-reduced-motion: reduce) { .set-pane > *, .settings2 input[type=checkbox]::after { animation: none; transition: none; } }

/* ---------------------------------------------------------------- Commander picker (0.21.0) */
.modal.cp-modal { width: min(980px, 100%); }
.cp-picker { display: grid; gap: 12px; }
.cp-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding-right: 48px; }
.cp-head .title { margin: 0; }
.cp-head small { color: var(--sub); font-weight: 700; }
.cp-body { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 16px; align-items: start; }
.cp-preview { position: sticky; top: 0; display: grid; gap: 10px; justify-items: center; text-align: center; padding: 14px; background: var(--card); border: 2px solid var(--ink); border-radius: 16px; box-shadow: inset 0 0 0 1px var(--card-line); }
.cp-big { position: relative; width: 220px; aspect-ratio: 1; border-radius: 18px; overflow: hidden; border: 3px solid var(--ink); background: radial-gradient(circle at 50% 35%, #2C6FD6, #0B2459 70%); box-shadow: 0 4px 0 var(--ink); }
.cp-big img { width: 100%; height: 100%; object-fit: cover; }
.cp-big.locked img { filter: grayscale(.7) brightness(.75); }
.cp-preview .fine { margin: 0; min-height: 3.6em; }
.cp-preview .btn { width: 100%; }
.cp-st.on { background: var(--green); color: var(--ink); }
.cp-st.ok { background: var(--line); color: var(--ink); }
.cp-st.level { background: #FFE27A; color: var(--ink); }
.cp-st.shop { background: linear-gradient(180deg, #FFCD3C, #E58A0A); color: var(--ink); }
.cp-st.fest { background: linear-gradient(90deg, #7FF5E8, #FFD23F); color: var(--ink); }
.cp-st.staff { background: #FF5A6E; color: #fff; }
.cp-lvl { width: 100%; height: 10px; border-radius: 99px; background: rgba(4,16,46,.7); border: 2px solid var(--ink); overflow: hidden; }
.cp-lvl i { display: block; height: 100%; background: linear-gradient(90deg, var(--green-lo), var(--green)); }
.cp-side { display: grid; gap: 10px; min-width: 0; }
.cp-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.cp-tabs .chipbtn { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; padding: 5px 12px; }
.cp-tabs .chipbtn small { font: 700 11px var(--body); background: rgba(4,16,46,.55); color: #fff; padding: 1px 6px; border-radius: 99px; text-shadow: none; }
.cp-scroll { max-height: min(60dvh, 560px); overflow-y: auto; padding: 9px; scrollbar-color: var(--line) transparent; }
.cp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); grid-auto-rows: max-content; align-content: start; gap: 8px; }
.cp-card { position: relative; padding: 0; aspect-ratio: 1; border-radius: 12px; overflow: hidden; border: 2px solid var(--ink); background: radial-gradient(circle at 50% 35%, #2C6FD6, #0B2459 75%); box-shadow: inset 0 0 0 1px var(--card-line); cursor: pointer; transition: transform .12s, box-shadow .12s; }
.cp-card .ava-port, .cp-card .ava-port img { display: block; width: 100%; height: 100%; object-fit: cover; }
.cp-card:hover { transform: translateY(-2px); }
.cp-card.sel { box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--gold); transform: translateY(-2px); }
.cp-card.locked .ava-port img { filter: grayscale(.75) brightness(.7); }
.cp-card:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.cp-tag { position: absolute; left: 0; right: 0; bottom: 0; padding: 2px 4px; font: 800 10px var(--body); color: #fff; background: rgba(4,16,46,.82); text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cp-card.shop .cp-tag { color: #FFE27A; }
.cp-card.fest .cp-tag { color: #7FF5E8; }
.cp-eq { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; background: var(--green); color: var(--ink); font-weight: 900; border: 2px solid var(--ink); }
.cp-new { position: absolute; top: 4px; left: 4px; padding: 0 6px; border-radius: 6px; font: 800 10px var(--body); background: #FF5A6E; color: #fff; border: 2px solid var(--ink); text-transform: uppercase; }
.cp-big .cp-new { top: 8px; left: 8px; font-size: 13px; }
@media (max-width: 720px) {
  .cp-body { grid-template-columns: 1fr; }
  .cp-preview { position: static; grid-template-columns: 112px 1fr; text-align: left; justify-items: stretch; align-items: center; gap: 8px 12px; }
  .cp-big { width: 112px; grid-row: span 3; }
  .cp-preview .fine { min-height: 0; }
  .cp-preview .cp-lvl, .cp-preview .btn { grid-column: 1 / -1; }
  .cp-grid { grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 6px; }
  .cp-scroll { max-height: 46dvh; }
  .cp-head { padding-right: 44px; }
}

/* ---------------------------------------------------------------- 0.21.0: roster search, Gigapedia grid */
.rstars.legendary i { background: #7FF5E8; }
.rstars.ultra i { background: linear-gradient(135deg, #FF5FA2, #FFD23F 40%, #5FE3A1 65%, #5FC8FF); }
.g-searchrow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 10px; }
.g-search { flex: 1 1 220px; max-width: 380px; }
.g-count { margin-left: auto; color: var(--sub); font-weight: 800; }
.seg { display: inline-flex; gap: 4px; }
.seg .chipbtn { padding: 5px 12px; font-size: 14px; }
.chipbtn.rar-epic:not(.on) { box-shadow: inset 0 0 0 1px #FF8A3C, 0 3px 0 var(--ink); }
.chipbtn.rar-legendary:not(.on) { box-shadow: inset 0 0 0 1px #7FF5E8, 0 3px 0 var(--ink); }
.chipbtn.rar-ultra:not(.on) { box-shadow: inset 0 0 0 1px #FFD23F, 0 3px 0 var(--ink); }
.pedia-prog { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 6px 14px; padding: 10px 14px; background: rgba(4,16,46,.35); border-radius: 10px; box-shadow: inset 0 0 0 1px var(--card-line); }
.pp-num { white-space: nowrap; }
.pp-num b { font: 34px/1 var(--display); text-shadow: var(--outline); }
.pp-num span { font: 16px var(--display); color: var(--sub); text-transform: uppercase; letter-spacing: .04em; }
.pp-bar { height: 16px; background: #061634; border: 2px solid var(--ink); border-radius: 99px; overflow: hidden; box-shadow: inset 0 0 0 1px var(--card-line); }
.pp-bar i { display: block; height: 100%; background: linear-gradient(180deg, #8EF59A, #2DB848); }
.pp-rars { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px 16px; }
.pp-r { display: inline-flex; align-items: center; gap: 6px; }
.pp-r small { font: 800 12px var(--body); color: #D7ECFF; }
.pedia-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.pcard { position: relative; display: grid; grid-template-rows: 120px auto auto; padding: 6px 8px 9px; color: #fff; text-align: center; overflow: hidden;
  background: linear-gradient(180deg, #13397F, #0B2459 72%); border: 2px solid var(--ink); border-radius: 8px; box-shadow: inset 0 0 0 1px var(--card-line), 0 3px 0 rgba(4,16,46,.6); }
.pcard:hover { box-shadow: inset 0 0 0 2px #fff, 0 3px 0 rgba(4,16,46,.6); }
.pcard.r-epic { box-shadow: inset 0 0 0 2px #FF8A3C, 0 3px 0 rgba(4,16,46,.6); }
.pcard.r-legendary { box-shadow: inset 0 0 0 2px #7FF5E8, 0 3px 0 rgba(4,16,46,.6); }
.pcard.r-ultra::after { content: ''; position: absolute; inset: 0; border-radius: 6px; padding: 2px; pointer-events: none; background: linear-gradient(90deg, #FF5FA2, #FFD23F, #5FE3A1, #5FC8FF, #B57BFF);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0); }
.pcard.r-epic:hover, .pcard.r-legendary:hover { box-shadow: inset 0 0 0 2px #fff, 0 3px 0 rgba(4,16,46,.6); }
.pc-no { position: absolute; top: 5px; left: 7px; z-index: 2; font: 13px var(--display); letter-spacing: .05em; color: var(--sub); text-shadow: var(--outline-sm); }
.pc-own { position: absolute; top: 5px; right: 6px; z-index: 2; font: 800 11px var(--body); background: var(--green); color: var(--ink); border: 2px solid var(--ink); border-radius: 99px; padding: 0 6px; }
.pc-art { position: relative; display: grid; place-items: center; min-height: 0; }
.pc-art::before { content: ''; position: absolute; width: 78%; aspect-ratio: 1; border-radius: 50%; opacity: .5; }
.pcard.el-thermal .pc-art::before { background: radial-gradient(circle, var(--thermal), transparent 68%); }
.pcard.el-cryo .pc-art::before { background: radial-gradient(circle, var(--cryo), transparent 68%); }
.pcard.el-toxic .pc-art::before { background: radial-gradient(circle, var(--toxic), transparent 68%); }
.pc-art img, .pc-art .art-missing { position: relative; max-width: 100%; max-height: 112px; object-fit: contain; filter: drop-shadow(0 3px 0 rgba(4,16,46,.6)); }
.pc-art img.sil { filter: brightness(0) opacity(.55); }
.pcard.unknown .pc-art::before { opacity: .22; }
.pc-name { margin-top: 4px; font: 18px/1.05 var(--display); text-transform: uppercase; letter-spacing: .02em; text-shadow: var(--outline-sm); overflow-wrap: anywhere; }
.pcard.unknown .pc-name { color: var(--sub); }
.pc-meta { display: flex; justify-content: center; align-items: center; gap: 6px; margin-top: 5px; }
.pc-meta .hexb { width: 24px; height: 27px; font-size: 13px; }
.sp-head .pc-no { position: static; display: block; }
.sp-head .title { margin-bottom: 6px; }
.sp-forms { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0; }
.sp-form { margin: 0; display: grid; justify-items: center; align-content: end; gap: 4px; padding: 8px 6px; background: rgba(4,16,46,.35); border-radius: 10px; box-shadow: inset 0 0 0 1px var(--card-line); }
.sp-form img, .sp-form .art-missing { width: 100%; height: 130px; object-fit: contain; }
.sp-form figcaption { display: grid; text-align: center; font: 16px/1.1 var(--display); text-transform: uppercase; letter-spacing: .02em; text-shadow: var(--outline-sm); }
.sp-form figcaption small { font: 12px var(--display); color: var(--sub); letter-spacing: .05em; }
.sp-form.unknown figcaption { color: var(--sub); }
.sp-src { margin: 8px 0 14px; }
.sp-src b { font: 18px var(--display); text-transform: uppercase; letter-spacing: .03em; text-shadow: var(--outline-sm); }
.sp-src p { margin: 2px 0 0; color: #D7ECFF; font-size: 13px; }
.pedia-info .btn { margin-top: 6px; }
@media (max-width: 720px) {
  .gigas .roster-tools .sortbar.wrap { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -4px 6px; padding: 0 4px 5px; }
  .gigas .roster-tools .sortbar.wrap::-webkit-scrollbar { display: none; }
  .gigas .roster-tools .sortbar .chipbtn { flex: none; font-size: 14px; padding: 4px 10px; }
  .gigas .roster-tools .sb-label { flex: none; min-width: 0; font-size: 13px; }
  .pedia-grid { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 7px; }
  .pcard { grid-template-rows: 80px auto auto; padding: 5px 5px 7px; }
  .pc-art img, .pc-art .art-missing { max-height: 76px; }
  .pc-name { font-size: 14px; }
  .pc-meta .rstars i { width: 10px; height: 10px; }
  .pc-meta .hexb { width: 20px; height: 23px; font-size: 11px; }
  .pp-num b { font-size: 28px; }
  .g-search { max-width: none; }
  .g-count { margin-left: 0; }
  .sp-form img, .sp-form .art-missing { height: 88px; }
  .sp-form figcaption { font-size: 13px; }
}
@media (max-width: 520px) {
  .res-row:has(> div:nth-child(4)) b { font-size: 22px; }
  .res-row:has(> div:nth-child(4)) small { font-size: 10px; }
}
.prep-intel .prep-note { margin: 0 0 8px; }
.opt-main .odds-line { display: block; }
.odds-detail .odds-names { display: block; font-size: 11px; color: var(--sub); line-height: 1.35; }
@media (max-width: 520px) {
  .opt { flex-direction: column; align-items: stretch; }
  .opt > .btn { align-self: flex-end; }
}
/* Phone and tablet top bar (0.21.4). These come last so they win over the Biofuel "+" rules above,
   which gave the Biofuel pill 42px of empty room on phones (the "+" is hidden there) and squeezed the
   other pills until big numbers were cut off. The level badge sits centred under the commander and
   above the pills, so a three-digit level is never hidden behind the Biofuel can. */
@media (max-width: 1023px) {
  .me-btn { z-index: 3; flex: none; }
  .lvl { left: 50%; transform: translateX(-50%); bottom: -7px; padding: 0 5px; z-index: 1; }
  .pills { gap: 14px; padding-left: 9px; flex: 1 1 auto; margin-left: 0; justify-content: flex-end; }
  .pill.biofuel { padding-right: 8px; }
  .pill { flex: 1 0 auto; max-width: 150px; } /* phones: the pills share the row; tablets: they stop at 150px */
  .pill b { white-space: nowrap; }
}
@media (max-width: 400px) {
  .pills { gap: 10px; padding-left: 7px; }
  .pill.biofuel { padding-right: 6px; }
  .lvl { font-size: 12px; }
}
@media (max-width: 374px) {
  .topbar { gap: 4px; padding: calc(6px + var(--safe-t)) 6px 6px; }
  .ava { width: 36px; height: 36px; }
  .pills { gap: 8px; padding-left: 6px; }
  .pill, .pill.biofuel { padding: 0 5px 0 18px; height: 30px; }
  .pill b { font-size: 14px; }
  .pill .pic { width: 28px; height: 28px; left: -10px; }
  .hudbtns { gap: 3px; }
  .iconbtn { width: 31px; height: 31px; }
  .iconbtn svg { width: 18px; height: 18px; }
}
/* Home tiles (0.21.4): the Rivals division badge, the faction emblem and the tile icons are their own
   layer over the tile art, so they are sized for the tile they sit on. A tile is a size container, and
   on a narrow one (the phone's two-column hub) they are a quarter smaller and tucked into the corner,
   which keeps the title and the line under it clear of the picture. */
.tile { container-type: inline-size; }
@container (max-width: 320px) {
  .tile .t-div { height: 58.5%; top: 8px; right: 8px; }
  .tile .t-emb { height: 55.5%; top: 8px; right: 8px; }
  .tile .t-icon { width: 63px; height: 63px; top: 8px; right: 8px; }
  .tile.tl-create .t-icon { width: 34.5%; height: auto; }
  .tile .t-mons { top: 27%; }
}

/* Phones (0.21.6). Nothing on a game screen is wider than the phone, so no page slides sideways. */
/* Fields under 16px make iPhones zoom in when you tap them, and the zoomed page then slides left and
   right; every text field and picker is 16px on phones and tablets. */
@media (max-width: 1023px), (pointer: coarse) {
  input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]), select, textarea { font-size: 16px !important; }
}
@media (max-width: 1023px) {
  /* a screen never scrolls sideways; panels that really are wider (the Lab and map scenes, sort bars)
     scroll inside themselves */
  .stage { overflow-x: hidden; }
}
/* Grid screens size their column to the screen, not to their widest child, and a text field never
   props a panel open (a percentage max-width lets a field shrink below its natural width). */
.rivals, .faction-scr, .modq-players, .modq-player, .modq-player .panel, .soc-body, .prof-body, .prof-pane { grid-template-columns: minmax(0, 1fr); }
.in, select.sel { max-width: 100%; }
/* A small picture inside a button (Use Catalyst, Research Bay). */
.btn > .ic { width: 22px; height: 22px; object-fit: contain; margin-right: 6px; vertical-align: -4px; flex: none; }

/* In-screen tabs: on a phone they share the row and wrap their words instead of running off the edge. */
@media (max-width: 640px) {
  .tabs { margin-left: 4px; max-width: calc(100% - 4px); }
  .tabs button { flex: 0 1 auto; padding: 8px 13px 6px; font-size: 15px; line-height: 1.05; white-space: normal;
    clip-path: polygon(10px 0, calc(100% - 10px) 0, 100% 100%, 0 100%); margin-right: -6px; }
}

/* Evolution Pod (0.21.6): its own class (it used to borrow .pod, the Rankings podium, which centred
   every row and let them run off a phone). On a phone each Giga stacks: pictures, name, facts, buttons. */
.evo-pod > p { margin: 0; }
.evo { grid-template-columns: auto minmax(0, 1fr); }
.evo-info { min-width: 0; }
.evo-facts { display: flex; flex-wrap: wrap; gap: 2px 12px; }
.evo-cost, .evo-acts { gap: 6px; }
@media (max-width: 640px) {
  .evo { grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 10px; }
  .evo-pair { justify-content: center; gap: 8px; }
  .evo-art { width: 92px; height: 92px; }
  .evo-art img { max-height: 86px; }
  .evo-info b, .evo-info > small, .evo-clock { text-align: center; }
  .evo-facts { justify-content: center; }
  .evo-cost { justify-content: center; }
  .evo-acts { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
  .evo-acts .btn { width: 100%; min-width: 0; }
}

/* Profile: a long faction name wraps inside its pill instead of running out of it. */
.prof-tags .ftag { white-space: normal; text-align: left; max-width: 100%; border-radius: 12px; line-height: 1.2; overflow-wrap: anywhere; }
.prof-tags .ftag .emb { flex: none; }
.prof-actions .btn { max-width: 100%; white-space: normal; }
.prof-raids li { grid-template-columns: 78px minmax(0, 1fr) auto auto; }
@media (max-width: 400px) {
  .prof-name.pname { font-size: clamp(24px, 8vw, 32px); }
  .prof-tabs button { padding: 7px 10px 5px; font-size: 13px; }
  .prof-raids li { grid-template-columns: 64px minmax(0, 1fr) auto; }
  .prof-raids li > :last-child { grid-column: 2 / -1; justify-self: end; }
}

/* Moderation on phones: one Section picker instead of fourteen buttons, log rows that stack, and the
   player card, dev tools and answer boxes fit the width. */
.modq-pick { display: none; }
select.sel { color: #fff; } /* the dark picker had black text where a page did not set a colour */
.dev-tools select.sel { min-width: 0; max-width: 100%; }
.dev-tools .in.grow { min-width: 0; flex: 1 1 200px; }
.modq-players > .panel .in { flex: 1 1 160px; }
@media (max-width: 640px) {
  .modq > .tabs, .modq > .modq-subtabs { display: none; }
  .modq-pick { display: grid; gap: 4px; margin: 4px 0 12px; }
  .modq-pick > span { font: 800 12px var(--body); letter-spacing: .08em; text-transform: uppercase; color: var(--sub); }
  .mlog, .mlog tbody { display: block; }
  .mlog tr { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; padding: 8px 2px; border-bottom: 1px solid rgba(99,198,255,.18); }
  .mlog tr:last-child { border-bottom: 0; }
  .mlog td { display: block; padding: 0; border: 0; min-width: 0; }
  .mlog .ml-t { order: 9; margin-left: auto; font-size: 12px; color: var(--sub); }
  .mlog .ml-detail { order: 10; flex: 1 1 100%; overflow-wrap: anywhere; }
  .mlog .ml-detail:empty { display: none; }
  .mlog.inv .ml-by { order: 11; flex: 1 1 auto; }
  .mlog.inv .ml-acts { order: 12; margin-left: auto; }
  .modq-acts .in, .modq-acts-panel .row .in { flex: 1 1 100%; }
  .modq-muted .in { flex: 1 1 100%; min-width: 0; }
  .dev-tools .row > small { min-width: 0; flex: 1 1 100%; }
  .dev-cur { grid-template-columns: minmax(0, 1fr) 84px auto; }
  .dev-cur .in { width: 84px; }
  .dev-grid { grid-template-columns: minmax(0, 1fr); }
  .linkish.big { font-size: 22px; overflow-wrap: anywhere; }
}
/* The smallest phones (320px wide). */
.munch-info { min-width: 0; }
.f-search { min-width: 0; }
.f-search input { min-width: 0; max-width: 100%; }
@media (max-width: 640px) { .fx-acts { display: flex; flex-wrap: wrap; align-items: center; } }
@media (max-width: 340px) {
  .modal { padding: 16px 12px; }
  .prof-tabs button { padding: 6px 8px 4px; font-size: 12px; }
  .munch { flex-wrap: wrap; }
  .munch-btns { flex: 1 1 100%; }
}

/* Opening a box (0.21.6): it drops in, rattles harder and harder, bursts in a flash with light rays
   behind it, and the card with what came out pops up over the rays. Gold rays for a roll of 5% or
   less, purple for 1% or less. Tap to skip; with effects off the card shows at once. */
.bx-back { position: fixed; inset: 0; z-index: 120; display: grid; place-items: center; padding: 16px; overflow: hidden; cursor: pointer;
  background: radial-gradient(circle at 50% 44%, rgba(40,110,220,.6), rgba(2,8,26,.94) 68%); animation: fade .15s; }
.bx-back.bx-open { cursor: default; }
.bx-back.bx-closing { animation: fadeOut .17s forwards; pointer-events: none; }
.bx-stage, .bx-loot { grid-area: 1 / 1; }
.bx-stage { position: relative; width: min(250px, 60vw); aspect-ratio: 1; display: grid; place-items: center; pointer-events: none; }
.bx-box { position: relative; z-index: 1; width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 12px 0 rgba(4,16,46,.55));
  animation: bx-drop .42s cubic-bezier(.2,1.5,.45,1) both, bx-rattle .73s .42s linear both; }
@keyframes bx-drop { from { transform: translateY(-75vh) rotate(-10deg) scale(.8); } }
@keyframes bx-rattle {
  0%, 100% { transform: none; } 8% { transform: rotate(-3deg); } 16% { transform: rotate(3deg); } 24% { transform: rotate(-4deg) translateY(-2px); }
  32% { transform: rotate(4deg); } 40% { transform: rotate(-6deg) translateY(-4px); } 48% { transform: rotate(6deg); } 56% { transform: rotate(-8deg) translateY(-6px) scale(1.03); }
  64% { transform: rotate(8deg) scale(1.03); } 72% { transform: rotate(-10deg) translateY(-8px) scale(1.06); } 80% { transform: rotate(10deg) scale(1.06); }
  88% { transform: rotate(-11deg) translateY(-10px) scale(1.09); } 96% { transform: rotate(6deg) scale(1.1); } }
.bx-back.bx-burst .bx-box { animation: bx-pop .34s ease-in forwards; }
@keyframes bx-pop { 40% { transform: scale(1.3); filter: brightness(2.2); } to { transform: scale(1.7); filter: brightness(3); opacity: 0; } }
.bx-back.bx-open .bx-box { opacity: 0; }
.bx-rays { position: absolute; inset: -70%; border-radius: 50%; opacity: 0; transform: scale(.3);
  background: repeating-conic-gradient(rgba(130,200,255,.5) 0 9deg, transparent 9deg 24deg);
  -webkit-mask-image: radial-gradient(circle, #000 18%, transparent 66%); mask-image: radial-gradient(circle, #000 18%, transparent 66%); }
.bx-back.t-rare .bx-rays { background: repeating-conic-gradient(rgba(255,214,90,.65) 0 9deg, transparent 9deg 24deg); }
.bx-back.t-jackpot .bx-rays { background: repeating-conic-gradient(rgba(205,140,255,.7) 0 9deg, rgba(255,214,90,.35) 9deg 12deg, transparent 12deg 24deg); }
.bx-back.bx-burst .bx-rays, .bx-back.bx-open .bx-rays { opacity: 1; transform: scale(1); transition: opacity .25s, transform .45s cubic-bezier(.2,1.3,.4,1); animation: spin 14s linear infinite; }
.bx-flash { position: absolute; inset: -45%; border-radius: 50%; background: radial-gradient(circle, #fff 0, rgba(255,255,255,.85) 22%, rgba(255,255,255,0) 62%); opacity: 0; z-index: 2; }
.bx-back.bx-burst .bx-flash { animation: bx-flash .5s ease-out; }
@keyframes bx-flash { 25% { opacity: 1; } }
.bx-loot { position: relative; z-index: 3; width: min(420px, 100%); max-height: calc(100dvh - 40px); overflow: auto; display: grid; gap: 12px; justify-items: center; text-align: center;
  padding: 18px 16px; border: 3px solid var(--ink); border-radius: 16px; background: linear-gradient(180deg, #2378DA, #0E3C8A); box-shadow: inset 0 2px 0 rgba(255,255,255,.3), 0 8px 0 rgba(4,16,46,.7);
  visibility: hidden; opacity: 0; transform: scale(.7); }
.bx-back.bx-open .bx-loot { visibility: visible; opacity: 1; transform: none; transition: opacity .18s, transform .32s cubic-bezier(.2,1.45,.4,1); }
.bx-loot .title { margin: 0; }
.bx-prize { width: 100%; display: grid; justify-items: center; gap: 4px; padding: 14px 12px 12px; border-radius: 14px; background: rgba(4,16,46,.45); box-shadow: inset 0 0 0 2px var(--card-line); }
.bx-prize-art { width: 104px; height: 104px; object-fit: contain; filter: drop-shadow(0 5px 0 rgba(4,16,46,.5)); }
.bx-back.bx-open .bx-prize-art { animation: rpop .5s .08s both; }
.bx-prize b { font: 26px/1.05 var(--display); text-transform: uppercase; letter-spacing: .03em; text-shadow: var(--outline-sm); overflow-wrap: anywhere; }
.bx-prize.t-rare { box-shadow: inset 0 0 0 2px var(--gold), 0 0 22px rgba(255,210,63,.55); }
.bx-prize.t-jackpot { box-shadow: inset 0 0 0 2px #C994FF, 0 0 26px rgba(190,120,255,.7); }
.bx-odds { font-weight: 800; color: var(--sub); }
.bx-many { list-style: none; margin: 0; padding: 0; width: 100%; display: grid; gap: 6px; text-align: left; }
.bx-many li { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 5px 10px; border-radius: 10px; font-weight: 800; font-size: 14px;
  background: rgba(4,16,46,.45); box-shadow: inset 0 0 0 1px var(--card-line); }
.bx-back.bx-open .bx-many li { animation: fadeUp .25s calc(var(--i) * 60ms) both; }
.bx-many li.t-rare { box-shadow: inset 0 0 0 2px var(--gold); } .bx-many li.t-jackpot { box-shadow: inset 0 0 0 2px #C994FF; }
.bx-mini { width: 40px; height: 40px; object-fit: contain; }
.bx-loot > .btn { position: sticky; bottom: 0; box-shadow: 0 4px 0 var(--ink), 0 -10px 18px rgba(14,60,138,.9); }
@media (max-height: 820px) {
  .bx-many { gap: 4px; }
  .bx-many li { grid-template-columns: 30px minmax(0, 1fr) auto; padding: 3px 8px; font-size: 13px; }
  .bx-mini { width: 30px; height: 30px; }
  .bx-loot { gap: 9px; padding: 14px 12px; }
  .bx-loot > .btn.big { font-size: 24px; min-height: 50px; padding: 8px 30px; }
}
.bx-base { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; align-items: center; }
.bx-base > small { flex: 1 1 100%; color: var(--sub); font-weight: 800; }
.bx-skip { position: fixed; left: 0; right: 0; bottom: calc(20px + env(safe-area-inset-bottom)); text-align: center; font-weight: 800; color: var(--sub); animation: rs-pulse 1.6s infinite; pointer-events: none; }
.bx-back.bx-open .bx-skip, .bx-back.bx-calm .bx-stage { display: none; }
.bx-back.bx-calm, .bx-back.bx-calm * { animation: none !important; transition: none !important; }

/* Lab on phones (0.21.7): one machine at a time. The scene snaps from station to station and the
   dots under it show where you are (tap one to glide there). The Evolution Pod lights up and the
   Lab button counts the Gigas that can evolve now. */
.snap-pt { position: absolute; top: 0; width: 1px; height: 1px; pointer-events: none; scroll-snap-align: center; }
.lab-dots { display: none; }
.hotspot.ready { border-color: rgba(116,238,133,.9); box-shadow: 0 0 22px rgba(116,238,133,.55), inset 0 0 18px rgba(116,238,133,.25); animation: glow 1.4s ease-in-out infinite; }
.hotspot.ready .hs-label { background: linear-gradient(180deg, #74EE85, #22A13B); }
@media (max-width: 1023px) {
  .lab .scene { scroll-snap-type: x mandatory; scrollbar-width: none; }
  .lab .scene::-webkit-scrollbar { display: none; }
  .lab-dots { display: flex; justify-content: center; gap: 4px; padding: 4px 0; background: #071F4E; border-top: 3px solid var(--ink); }
  .lab-dot { width: 40px; height: 28px; padding: 0; border: 0; background: none; display: grid; place-items: center; cursor: pointer; }
  .lab-dot::before { content: ''; width: 11px; height: 11px; border-radius: 50%; background: #2B5FA8; box-shadow: 0 0 0 2px var(--ink); transition: background .15s, transform .15s; }
  .lab-dot.on::before { background: var(--gold); transform: scale(1.3); }
  .lab-bar { border-top: 0; padding-top: 4px; }
  /* the map settles on a stage after a swipe, without forcing it */
  .map-scene { scroll-snap-type: x proximity; }
  .map-inner .node { scroll-snap-align: center; }
}
.hs-pod .hs-label { left: auto; right: 3%; transform: none; }
/* Moderation: the how-it-works note is folded away (0.21.7); it used to push the queue down a screen on phones. */
.modq-about { margin: 0 0 10px; }
.modq-about summary { cursor: pointer; font-weight: 800; font-size: 14px; color: var(--sub); }
.modq-about p { margin: 6px 0 0; }

/* Faction tile (0.22.0): the name keeps clear of the emblem in the top-right corner. */
.tile.tl-faction .t-title { max-width: 74%; text-wrap: balance; overflow-wrap: anywhere; }
@container (max-width: 320px) {
  .tile.tl-faction .t-title { max-width: 60%; font-size: max(14px, 9cqi); line-height: 1.02; }
}

/* MOD > Sign-ups (0.22.0): a funnel per ad source and sign-ups per day. */
.grow-step { display: grid; grid-template-columns: minmax(0, 11em) minmax(0, 1fr) auto; align-items: center; gap: 8px; font-size: 14px; }
.grow-step > b { font-weight: 800; white-space: nowrap; }
.grow-bar { display: block; height: 12px; border-radius: 6px; background: rgba(4,16,46,.6); box-shadow: inset 0 0 0 1px var(--card-line); overflow: hidden; }
.grow-bar > i { display: block; height: 100%; background: linear-gradient(90deg, #2C8BEE, #4BDD62); }
.grow-days { display: flex; align-items: flex-end; gap: 2px; height: 90px; padding: 6px 0; }
.grow-days > i { flex: 1 1 0; min-width: 2px; background: linear-gradient(180deg, #FFCD3C, #E58A0A); border-radius: 2px 2px 0 0; }
.grow-link { display: block; margin-top: 6px; overflow-wrap: anywhere; white-space: normal; }
@media (max-width: 640px) { .grow-step { grid-template-columns: minmax(0, 1fr) auto; } .grow-step > .grow-bar { grid-column: 1 / -1; grid-row: 2; } }

/* Infamy seasons (0.22.0): rules table, result screen, profile finishes */
.rv-season .linkish { font-weight: 800; }
.season-table { display: grid; gap: 6px; margin: 10px 0; }
.season-row { display: grid; grid-template-columns: minmax(150px, 220px) 1fr; gap: 10px; align-items: center; padding: 6px 8px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255, 255, 255, .03); }
.season-div { display: grid; grid-template-columns: auto 1fr; column-gap: 8px; align-items: center; }
.season-div .divb { grid-row: span 2; width: 34px; height: 34px; }
.season-div small { opacity: .75; }
.season-result { text-align: center; }
.season-result .divb.big { width: 110px; height: 110px; margin: 6px auto; display: block; }
.prof-seasons { margin: 10px 0 4px; }
.season-badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 4px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255, 255, 255, .04); }
.season-badge .divb { width: 26px; height: 26px; }
.season-badge small { opacity: .75; }
@media (max-width: 560px) {
  .season-row { grid-template-columns: 1fr; gap: 4px; }
}

/* Accessibility (0.22.0) */
.sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }
.elmark { display: none; position: absolute; z-index: 3; font: 11px/1 var(--display); letter-spacing: .06em; padding: 3px 5px 2px; border-radius: 5px; border: 2px solid var(--ink); background: #fff; color: var(--ink); pointer-events: none; }
.el-marks .elmark { display: inline-block; }
.elmark.thermal { background: #FFD0A0; } .elmark.cryo { background: #D6F7FF; } .elmark.toxic { background: #E3FBC6; }
.mcard .elmark { top: 6px; right: 6px; }
.slot .elmark { top: 4px; left: 5px; }
.bcard .elmark { bottom: -6px; left: 30px; }
/* keyboard focus stays visible on the glossy buttons and cards that draw their own borders */
.btn:focus-visible, .chipbtn:focus-visible, .mcard:focus-visible, .gcard:focus-visible, .pcard:focus-visible, .bcard:focus-visible, .slot:focus-visible, .tabs button:focus-visible, .hotspot:focus-visible, .linkish:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

/* Top-bar pills on phones and tablets (0.22.1): every icon the same size and the pill's own height,
   sitting on the pill's left edge; the number centred in the room left; no space kept for the
   desktop-only Biofuel bar (it pushed the number up). */
@media (max-width: 1023px) {
  /* 0.24.0: a pill never shrinks below its number (big numbers are shortened to 1.2M / 38.4K on these screens), so the icon never covers it */
  .pill, .pill.biofuel { height: 34px; padding: 0 8px 0 28px; justify-content: center; flex: 1 0 auto; min-width: 0; max-width: 150px; }
  .pill .pic { width: 34px; height: 34px; left: -9px; }
  .pill.credits .pic { transform: translateY(-50%) scale(.9); } /* the coin fills its square; the others have air */
  .pill b { line-height: 1; }
}
/* 0.24.0: on phones a moderator's shield takes the Settings gear's place (Settings stays on their own profile), so the pills keep their room */
@media (max-width: 600px) { .pills { padding-left: 16px; } }
@media (max-width: 400px) {
  .pill, .pill.biofuel { height: 32px; padding: 0 6px 0 25px; }
  .pill .pic { width: 32px; height: 32px; left: -9px; }
}
@media (max-width: 374px) {
  .pill, .pill.biofuel { height: 30px; padding: 0 4px 0 23px; }
  .pill .pic { width: 28px; height: 28px; left: -8px; }
}

/* Real-money packs (0.22.3): a label chip, and the once-per-account kit stands out */
.pack-tag { justify-self: start; background: var(--gold); color: var(--ink); border-color: var(--ink); font-weight: 800; }
.pack-card.pack-once { border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--card-line), 0 0 0 2px rgba(255, 210, 63, .35); }
.pack-card > .chip.ok { grid-column: 1 / -1; justify-self: center; }

/* Your purchases (0.22.4) */
.pay-hist { margin-top: 14px; padding: 12px 14px; background: var(--card); border: 2px solid var(--ink); border-radius: 12px; box-shadow: inset 0 0 0 1px var(--card-line); }
.pay-hist .subhead { margin: 0 0 8px; }
.pay-rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.pay-row { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 6px 8px; border-radius: 8px; background: rgba(255, 255, 255, .05); }
.pay-ico { width: 34px; height: 34px; object-fit: contain; }
.pay-what { display: grid; min-width: 0; }
.pay-what b { font: 700 15px var(--body); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pay-what small { color: var(--sub); font: 600 12px var(--body); }
.pay-amt { font: 18px var(--display); letter-spacing: .03em; }
@media (max-width: 480px) { .pay-row { grid-template-columns: 30px minmax(0, 1fr) auto; } .pay-row .chip { grid-column: 2 / -1; justify-self: start; } }

/* Faction treasury (0.23.0) */
.panel.fx-treasury { padding: 14px 16px; }
.fx-treasury .row { align-items: center; gap: 10px; }
.fx-donate .in { width: 140px; }
.fx-crate { margin: 8px 0; padding: 8px 10px; border-radius: 10px; background: rgba(255, 210, 63, .12); border: 2px solid rgba(255, 210, 63, .45); }
.fx-ups { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 8px; margin: 10px 0; }
.fx-up { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 10px; background: var(--card); border: 2px solid var(--ink); box-shadow: inset 0 0 0 1px var(--card-line); }
.fx-up.maxed { opacity: .8; }
.fx-up-ico { width: 40px; height: 40px; object-fit: contain; }
.fx-up-main { display: grid; min-width: 0; }
.fx-up-main b { font: 17px var(--display); letter-spacing: .03em; text-transform: uppercase; }
.fx-up-main small { color: var(--sub); }
.fx-sw { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--ink); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .35); }
.fx-sw.on { outline: 3px solid #fff; outline-offset: 2px; }
/* Duels tab (0.23.0) */
.duel-opps .rv-entry { grid-template-columns: auto minmax(0, 1fr) auto; }

/* New-player pass (0.23.1): empty team slots are buttons */
button.slot.empty { cursor: pointer; align-content: center; gap: 4px; color: #fff; }
button.slot.empty:hover { filter: brightness(1.15); }
.slot-plus { font: 34px/1 var(--display); color: var(--gold); text-shadow: var(--outline-sm); }
.team-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; max-height: 60vh; overflow: auto; }

/* Faction page layout (0.23.2): header with stats chips and one row of actions; main column
   (Epic Battle, Siege, Treasury, wars, wall) and a side column (advert, roster, requests) */
.fx-banner { grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "emb id" "emb acts"; row-gap: 10px; }
.fx-banner > .emb { grid-area: emb; }
.fx-banner > .fx-id { grid-area: id; }
.fx-banner > .fx-acts { grid-area: acts; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: flex-start; justify-items: initial; }
.fx-banner > .fx-acts .btn { margin: 0; }
.fx-stats { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.fx-stats .chip { font-size: 13px; }
.chip.ftag.coloured { color: #fff; border-color: #0A1630; box-shadow: 0 0 0 2px var(--fx-col, transparent), inset 0 -3px 0 rgba(0, 0, 0, .25); text-shadow: var(--outline-sm); }
.fx-cols { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.fx-main, .fx-side { display: grid; gap: 14px; align-content: start; min-width: 0; }
/* one column (most screens): the panels interleave in a useful order */
.faction-scr { container-type: inline-size; }
.fx-cols { display: flex; flex-direction: column; }
.fx-main, .fx-side { display: contents; }
.fx-cols .fx-ad { order: 1; } .fx-cols .fx-epic { order: 2; } .fx-cols .fx-siege { order: 3; } .fx-cols .fx-treasury { order: 4; }
.fx-cols .fx-roster { order: 5; } .fx-cols .fx-requests { order: 6; } .fx-cols .fx-war { order: 7; } .fx-cols .fx-wall { order: 8; }
/* two columns when the faction page itself is wide */
@container (min-width: 1150px) {
  .fx-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(330px, 410px); align-items: start; }
  .fx-main, .fx-side { display: grid; }
  .fx-side .fx-members { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .fx-banner { grid-template-areas: "emb id" "acts acts"; }
}

/* Wall replies (0.23.3) */
.wall-replies { display: grid; gap: 6px; margin-top: 8px; padding-left: 10px; border-left: 3px solid var(--card-line); }
.wall-post.reply { padding: 6px 8px; background: rgba(255, 255, 255, .04); }
.wall-post.reply .wall-ava .pava { width: 30px; height: 30px; }
.wall-reply-box { display: grid; gap: 6px; margin-top: 8px; }
.wall-reply-box .wall-send { justify-content: flex-end; gap: 8px; }

/* Site banner (0.23.4), set at /admin */
.site-banner { position: fixed; z-index: 900; left: 50%; top: 10px; transform: translateX(-50%); width: min(720px, calc(100vw - 20px)); display: flex; align-items: center; gap: 10px; padding: 10px 12px 10px 16px; border-radius: 12px; border: 2px solid #0A1630; background: #FFD23F; color: #0A1630; font: 800 15px/1.3 "Fira", system-ui, sans-serif; box-shadow: 0 6px 0 rgba(4, 16, 46, .45); }
.site-banner.tone-warn { background: #FF8A5B; }
.site-banner.tone-party { background: linear-gradient(90deg, #FFD23F, #7BE88B, #3FA9FF); }
.site-banner-text { flex: 1; color: inherit; text-decoration: none; }
a.site-banner-text { text-decoration: underline; text-underline-offset: 3px; }
.site-banner-x { flex: none; width: 30px; height: 30px; border-radius: 50%; border: 2px solid #0A1630; background: rgba(255, 255, 255, .6); color: #0A1630; font: 900 18px/1 system-ui; cursor: pointer; }

/* 0.23.4: boosts and gifts from the team, above the home tiles */
.live-strip { display: flex; flex-wrap: wrap; gap: 10px; max-width: 1240px; margin: 0 auto 14px; }
.live-boost, .live-gift { display: flex; align-items: center; gap: 10px; padding: 9px 14px; border: 2px solid var(--ink); border-radius: 12px; box-shadow: 0 4px 0 var(--ink); }
.live-boost { background: linear-gradient(90deg, #FFE07A, #7BE88B); color: var(--ink); flex: 0 1 auto; }
.live-boost b { font: 22px/1 var(--display); text-transform: uppercase; letter-spacing: .02em; }
.live-boost span { font-weight: 800; font-size: 13px; }
.live-gift { background: linear-gradient(180deg, #FF6FB8, var(--pink-lo)); flex: 1 1 320px; justify-content: space-between; }
.live-gift b { display: block; font: 20px/1.1 var(--display); text-transform: uppercase; letter-spacing: .02em; text-shadow: var(--outline-sm); }
.live-gift span { display: block; font-size: 13px; font-weight: 700; }
@media (max-width: 720px) { .live-strip { margin-bottom: 10px; gap: 8px; } .live-boost { flex: 1 1 100%; } .live-boost b { font-size: 18px; } }

/* 0.23.5: City, Quests and Create Gigas use the city, map and skyline art behind their tiles */
.tile.tl-city { background-position: 70% 30%; }
.tile.tl-quests { background-position: 30% 40%; }

/* 0.23.6: name colours bought in the Shop (never the staff colours; staff names keep theirs) */
/* name colours (0.25.4): one flat colour each, same outline as every other name */
:is(.msg-meta .msg-user, .pname, .peek-text b, .me-name b, .prof-name, .nc-demo).nc-ember { color: #E5602A; }
:is(.msg-meta .msg-user, .pname, .peek-text b, .me-name b, .prof-name, .nc-demo).nc-sunflower { color: #FFE066; }
:is(.msg-meta .msg-user, .pname, .peek-text b, .me-name b, .prof-name, .nc-demo).nc-peach { color: #FFC2AE; }
:is(.msg-meta .msg-user, .pname, .peek-text b, .me-name b, .prof-name, .nc-demo).nc-bubblegum { color: #FF85C8; }
:is(.msg-meta .msg-user, .pname, .peek-text b, .me-name b, .prof-name, .nc-demo).nc-lilac { color: #C39BFF; }
:is(.msg-meta .msg-user, .pname, .peek-text b, .me-name b, .prof-name, .nc-demo).nc-cornflower { color: #8FB1FF; }
:is(.msg-meta .msg-user, .pname, .peek-text b, .me-name b, .prof-name, .nc-demo).nc-silver { color: #D9E2EE; }
:is(.msg-meta .msg-user, .pname, .peek-text b, .me-name b, .prof-name, .nc-demo).nc-gold { color: #F5C518; }
:is(.msg-meta .msg-user, .pname, .peek-text b, .me-name b, .prof-name, .nc-demo).nc-prism { color: #F6EEFF; }
:is(.msg-meta .msg-user, .pname, .peek-text b, .me-name b, .prof-name, .nc-demo).nc-glitter { color: #FFB3E6; }
:is(.msg-meta .msg-user, .pname, .peek-text b, .me-name b, .prof-name, .nc-demo).nc-rimelight { color: #9FE8FF; }
:is(.msg-meta .msg-user, .pname, .peek-text b, .me-name b, .prof-name, .nc-demo).nc-carnival { color: #D47CFF; }
:is(.msg-meta .msg-user, .pname, .peek-text b, .me-name b, .prof-name, .nc-demo).nc-molten { color: #C9A227; }
.live-surge { background: linear-gradient(90deg, #FFB0D9, #C39BFF); cursor: pointer; font: inherit; color: var(--ink); text-align: left; }
.nc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin-bottom: 10px; }
.nc-card { display: grid; justify-items: center; gap: 6px; padding: 12px 10px; background: var(--card); border: 2px solid var(--ink); border-radius: 10px; box-shadow: inset 0 0 0 1px var(--card-line); text-align: center; }
.nc-card.sel { box-shadow: inset 0 0 0 2px var(--gold); }
.nc-swatch { width: 100%; height: 8px; border-radius: 4px; }
.nc-demo { font: 22px/1.1 var(--display); letter-spacing: .02em; text-shadow: var(--outline-sm); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nc-card small { color: var(--sub); font-weight: 800; }
.shop-sec > .btn.alt.sm { justify-self: start; width: auto; }

/* chat: one-tap moderation sheet (0.23.8) */
.modsheet { display: grid; gap: 10px; min-width: 0; }
.modsheet > *, .modsheet-mutes > *, .modsheet-two > * { min-width: 0; }
.modsheet-quote { margin: 4px 0 0; font: 600 14px var(--body); color: #CFE2FF; overflow-wrap: anywhere; }
.modsheet .btn { width: 100%; box-sizing: border-box; min-height: 48px; padding-left: 8px; padding-right: 8px; white-space: normal; }
.modsheet-row { display: grid; gap: 6px; }
.modsheet-row > b { font: 16px var(--display); text-transform: uppercase; letter-spacing: .04em; text-shadow: var(--outline-sm); }
.modsheet-mutes, .modsheet-two { display: grid; grid-template-columns: repeat(auto-fit, minmax(80px, 1fr)); gap: 8px; }
@media (max-width: 1023px) {
  /* bigger tap targets on chat lines for everyone, and for the Mod button above all */
  .msg-act { padding: 6px 6px; font-size: 13px; }
  .msg-act.mod { border: 2px solid #FF8E8E; border-radius: 8px; padding: 3px 9px; }
}

/* timed name colours (0.23.8): one full-width row per term, "7 days" on the left, the price on the right */
.nc-terms { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; width: 100%; margin-top: 2px; }
.nc-term { width: 100%; min-width: 0; min-height: 40px; padding: 6px 8px 7px 12px; justify-content: space-between; gap: 8px; }
.nc-term .nc-days { font-size: 17px; white-space: nowrap; }
.nc-term .res { flex: none; }
.nc-left { font: 800 13px var(--body); color: var(--gold); }
.nc-card { align-content: start; }
@media (max-width: 520px) {
  .nc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .nc-card { padding: 10px 7px; }
  .nc-demo { font-size: 19px; }
  .nc-term { padding: 5px 6px 6px 8px; gap: 4px; }
  .nc-term .nc-days { font-size: 14px; }
  .nc-term .res { font-size: 12px; padding-left: 2px; padding-right: 6px; }
}
@media (max-width: 380px) { .nc-term { flex-direction: column; justify-content: center; gap: 3px; padding: 5px 4px 7px; } }
.nc-card .chip.ok, .nc-card > .btn.alt { justify-self: center; }

/* ---------- live arena duels (0.24.0) */
.arena { position: fixed; inset: 0; z-index: 60; background: var(--bg0); display: grid; grid-template-rows: auto 1fr auto; overflow: hidden; }
.arena-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.ar-top, .ar-bot { position: relative; z-index: 1; display: flex; align-items: center; gap: 10px; padding: 10px 12px; }
.ar-top { padding-top: calc(10px + var(--safe-t)); justify-content: space-between; background: linear-gradient(180deg, rgba(4,16,46,.85), transparent); }
.ar-bot { grid-row: 3; justify-content: space-between; flex-wrap: wrap; padding-bottom: calc(10px + var(--safe-b)); background: linear-gradient(0deg, rgba(4,16,46,.9), transparent); }
.ar-side { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1; }
.ar-side.ar-b { flex-direction: row-reverse; text-align: right; }
.ar-side b { display: block; font: 18px var(--display); letter-spacing: .02em; text-shadow: var(--outline-sm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 30vw; }
.ar-side.mine b { color: var(--gold); }
.ar-team { width: min(180px, 28vw); height: 10px; border: 2px solid var(--ink); border-radius: 6px; background: rgba(4,16,46,.7); overflow: hidden; }
.ar-team-fill { display: block; height: 100%; width: 100%; background: linear-gradient(180deg, #7CF08C, var(--green-lo)); transition: width .25s; }
.ar-b .ar-team-fill { margin-left: auto; background: linear-gradient(180deg, #FF7B8E, #B81A35); }
.ar-auto-chip { font: 700 11px var(--body); padding: 2px 7px; border-radius: 8px; background: rgba(255,205,60,.18); color: var(--gold); border: 1px solid var(--gold-lo); }
.ar-mid { text-align: center; flex: 0 0 auto; }
.ar-time { display: block; font: 30px var(--display); text-shadow: var(--outline); letter-spacing: .04em; }
.ar-time.surge { color: var(--orange); animation: pulse 1s infinite; }
.ar-mid small { font-weight: 800; font-size: 11px; color: var(--sub); letter-spacing: .06em; }
.is-live .ar-mid small { color: var(--red); }
.ar-count { position: absolute; inset: 0; z-index: 2; display: grid; place-content: center; pointer-events: none; font: 120px var(--display); text-shadow: var(--outline); opacity: 0; transition: opacity .2s; }
.ar-count.on, .ar-count.go { opacity: 1; }
.ar-count.go { color: var(--gold); animation: rise .3s; }
.ar-cards { display: flex; gap: 8px; }
.ar-card { position: relative; width: 92px; padding: 6px 6px 8px; border: 2px solid var(--ink); border-radius: 10px; background: linear-gradient(180deg, var(--card-hi), var(--card)); box-shadow: inset 0 0 0 2px var(--card-line), 0 4px 0 var(--ink); display: grid; justify-items: center; gap: 3px; transition: transform .1s, box-shadow .15s; }
.ar-card img { width: 56px; height: 56px; object-fit: contain; }
.ar-card:disabled { filter: saturate(.55); opacity: .8; }
.ar-card.ready { box-shadow: inset 0 0 0 2px var(--gold), 0 4px 0 var(--ink), 0 0 14px rgba(255,205,60,.55); }
.ar-card.ready:active, .ar-card.fired { transform: translateY(3px) scale(.97); }
.ar-card.ko { filter: grayscale(1); opacity: .45; }
.ar-skill { font-size: 11px; font-weight: 800; line-height: 1.1; text-align: center; }
.ar-bar { width: 100%; height: 6px; border-radius: 4px; background: rgba(4,16,46,.75); overflow: hidden; }
.ar-charge { display: block; height: 100%; width: 0; background: var(--gold); }
.ar-ctl { display: flex; gap: 8px; margin-left: auto; }
.ar-results .ar-res-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0; }
.ar-res-side { padding: 8px; border-radius: 10px; background: rgba(4,16,46,.45); }
.ar-res-side.mine { box-shadow: inset 0 0 0 2px var(--gold); }
.ar-res-mon { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.ar-res-mon img { width: 34px; height: 34px; object-fit: contain; }
.ar-res-mon.ko { opacity: .5; }
.ar-results.win .title { color: var(--gold); }
@media (max-width: 560px) {
  .ar-card { width: 74px; } .ar-card img { width: 42px; height: 42px; }
  .ar-time { font-size: 24px; } .ar-count { font-size: 84px; }
  .ar-ctl { width: 100%; justify-content: flex-end; }
}
@media (prefers-reduced-motion: reduce) { .ar-time.surge, .ar-count.go { animation: none; } }

/* ---------- live prompts, alerts, war ticker (0.24.0) */
.duel-invite { text-align: center; }
.duel-invite-team { display: flex; justify-content: center; gap: 8px; margin: 10px 0 14px; flex-wrap: wrap; }
.duel-invite-team > div { display: grid; justify-items: center; width: 80px; padding: 6px; border-radius: 10px; background: rgba(4,16,46,.45); }
.duel-invite-team img { width: 52px; height: 52px; object-fit: contain; }
.duel-invite-team small { font-size: 11px; color: var(--sub); }
.duel-on { color: var(--green); }
.toast-alert { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.toast-go { margin-left: 6px; padding: 2px 10px; border: 2px solid var(--ink); border-radius: 8px; background: var(--gold); color: var(--ink); font-weight: 800; }
.war-ticker { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 3px; font-size: 13px; }
.war-ticker li { padding: 4px 8px; border-radius: 8px; background: rgba(4,16,46,.4); border-left: 3px solid var(--green); animation: rise .25s; }
.war-ticker li.them { border-left-color: var(--red); }
@keyframes pulse { 50% { opacity: .55; } }

/* ---------- Support Agents (0.24.2): amber names and chip, the SUPPORT desk button */
:is(.msg-meta .msg-user, .pname, .peek-text b, .me-name b, .prof-name).role-support { color: var(--supp); }
.chip.role.role-support { background: #F08A1C; color: var(--ink); }
.prof-banner.role-support { background: radial-gradient(circle at 10% 20%, rgba(255,210,150,.5), transparent 45%), linear-gradient(180deg, #C9670E, #4A2408); box-shadow: inset 0 -2px 0 var(--supp); }
.prof-ava.role-support .pa-img { box-shadow: 0 0 0 4px var(--supp), 0 6px 0 rgba(4,16,46,.55); }
.f-ava.role-support { box-shadow: 0 0 0 2px var(--supp); }
.mod-btn.desk { color: var(--supp); font-size: 15px; }
/* the support desk has three tabs: they stay as tabs on phones (no section picker) */
.modq > .tabs.desk-tabs { display: flex; }
@media (max-width: 560px) { .modq > .tabs.desk-tabs button { font-size: 14px; padding: 8px 12px 6px; } }

/* ---------- family bonds and signature skills (0.25.0) */
.bonds { margin: 6px 0 10px; gap: 6px; }
.chip.bond { background: linear-gradient(180deg, #5A1E9E, #34106A); color: #fff; box-shadow: inset 0 0 0 1px #A77BFF; white-space: normal; text-align: left; }
.chip.bond b { color: var(--gold); }
.chip.bond.menagerie { background: linear-gradient(180deg, #0E6E5C, #08403A); box-shadow: inset 0 0 0 1px #4BDDB0; }
.chip.sig { background: linear-gradient(180deg, #FFE07A, #E58A0A); color: var(--ink); font-weight: 900; letter-spacing: .05em; }
.abil.bond b { color: #C9A8FF; }

/* ---------- phones play like a game app (0.25.2): bell + Menu in the top bar, a tile menu sheet */
.menu-btn { display: none !important; }
.gm-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.gm-tile { position: relative; display: grid; justify-items: center; align-content: center; gap: 6px; min-height: 92px; padding: 10px 6px; border: 3px solid var(--ink); border-radius: 16px; background: linear-gradient(180deg, var(--card-hi), var(--card)); box-shadow: inset 0 0 0 2px var(--card-line), 0 4px 0 var(--ink); color: var(--text); text-decoration: none; font: 15px var(--display); letter-spacing: .03em; text-transform: uppercase; touch-action: manipulation; }
.gm-tile:active { transform: translateY(3px); box-shadow: inset 0 0 0 2px var(--card-line), 0 1px 0 var(--ink); }
.gm-tile .gm-ic { width: 40px; height: 40px; display: grid; place-items: center; }
.gm-tile .gm-ic svg { width: 32px; height: 32px; }
.gm-tile .gm-ic img { width: 40px; height: 40px; object-fit: contain; }
.gm-tile.me-tile .gm-ic img { border-radius: 50%; box-shadow: 0 0 0 2px var(--gold); }
.gm-tile.big { background: linear-gradient(180deg, #FFD23F, #F09A0E); color: var(--ink); box-shadow: inset 0 0 0 2px #FFE89A, 0 4px 0 var(--ink); }
.gm-tile.mod .gm-ic { color: var(--modc); } .gm-tile.desk .gm-ic { color: var(--supp); }
.gm-q { font: 30px var(--display); line-height: 1; }
.gm-tile .badge { top: 6px; right: 6px; }
.gm-l { line-height: 1.1; text-align: center; }
@media (max-width: 760px) {
  .menu-btn { display: grid !important; }
  .hudbtns > .iconbtn:not(.bell-btn):not(.menu-btn) { display: none !important; }
  .hudbtns { gap: 6px; }
  /* a game-like sheet that rises from the bottom */
  .modal-back:has(.gm-sheet) { place-items: end center; padding: 0; }
  .modal.gm-sheet { width: 100%; border-radius: 22px 22px 0 0; padding: 16px 14px calc(18px + env(safe-area-inset-bottom)); max-height: 88dvh; }
  /* app feel: no stray text selection or double-tap zoom on controls */
  .nav, .topbar, .hudbtns, .gm-tile, .btn, .tabs button { -webkit-user-select: none; user-select: none; touch-action: manipulation; }
}

/* festival twists (0.25.2) */
.fest-twist { display: grid; gap: 2px; margin: 8px 0 10px; padding: 8px 12px; border-radius: 12px; background: rgba(255,210,63,.14); box-shadow: inset 0 0 0 2px rgba(255,210,63,.55); max-width: 560px; }
.fest-twist b { font: 18px var(--display); letter-spacing: .03em; color: var(--gold); text-transform: uppercase; }
.fest-twist span { font-size: 14px; }
.chip.res.ncol .nc-demo { font-size: 14px; display: inline; }


/* ---------- bounty board, city visits and the showcase (0.25.4) */
.bounty-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.bounty-list { display: grid; gap: 8px; }
.bounty-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 12px; background: rgba(4,16,46,.45); box-shadow: inset 0 0 0 2px rgba(255,61,90,.35); }
.bounty-row.you { box-shadow: inset 0 0 0 2px var(--gold); }
.bounty-who small { color: var(--sub); }
.bounty-pot { display: flex; align-items: center; gap: 4px; font: 22px var(--display); color: var(--gold); }
.bounty-pot img { width: 26px; height: 26px; }
.bounty-post { display: grid; gap: 6px; }
.bounty-mine { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 13px; }
.bounty-mine li { padding: 4px 8px; border-radius: 8px; background: rgba(4,16,46,.35); }
.bounty-mine li.st-claimed { box-shadow: inset 3px 0 0 var(--green); } .bounty-mine li.st-expired { opacity: .7; }
.bounty-me { font-size: 15px; }
.res-bounty { font: 20px var(--display); letter-spacing: .03em; color: var(--gold); }
@media (max-width: 760px) { .bounty-grid { grid-template-columns: 1fr; } .bounty-row { grid-template-columns: auto minmax(0, 1fr) auto; } .bounty-row > .btn, .bounty-row > .chip { grid-column: 1 / -1; justify-self: end; } }
.visit-modal { width: min(860px, 96vw); }
.visit { display: grid; gap: 10px; }
.visit-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; }
.visit-head .title { margin: 0; }
.visit-likes { display: grid; justify-items: center; line-height: 1; }
.visit-likes .heart { color: #FF5D8F; font-size: 28px; }
.visit-likes-n { font: 26px var(--display); }
.visit-stage { position: relative; height: min(56vh, 480px); border-radius: 14px; overflow: hidden; border: 3px solid var(--ink); }
.visit-canvas { width: 100%; height: 100%; display: block; }
.visit-foot { align-items: center; gap: 12px; }
.visit-foot .fine { flex: 1; margin: 0; }
.visit-like.done { background: linear-gradient(180deg, #FF8DB0, #E04878); color: #fff; }
.visit-like.pop { animation: rpop .45s cubic-bezier(.3,1.6,.5,1); }
.sc-card .rv-card-top { align-items: center; }
.sc-rank { font: 24px var(--display); color: var(--gold); }
.sc-likes { margin-left: auto; color: #FF8DB0; font: 20px var(--display); }
.bounty-grid > .panel { padding: 12px 14px; }
.bounty-grid .subhead { margin: 0 0 8px; }
@media (max-width: 520px) { .daily-head { flex-direction: column; gap: 4px; padding: 0 44px; } }

/* ---------- notifications (0.26.0): alert cards, the inbox, phone sheet */
.toast { pointer-events: auto; }
.toast.alert-toast { padding: 10px 12px; }
.toast-alert { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 10px; text-align: left; }
.toast-alert .nt-ic { width: 34px; height: 34px; object-fit: contain; }
.ta-text { display: grid; gap: 2px; min-width: 0; }
.ta-text b { font: 17px/1.1 var(--display); letter-spacing: .03em; color: var(--gold); }
.ta-text span { font: 600 13px/1.3 var(--body); color: #E2F2FF; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.toast.alert-toast:has(.nt-raid), .toast.alert-toast:has(.nt-bounty) { box-shadow: inset 0 0 0 2px var(--red), 0 4px 0 var(--ink); }
.toast.alert-toast:has(.nt-faction) { box-shadow: inset 0 0 0 2px #B98CFF, 0 4px 0 var(--ink); }
.toast.alert-toast:has(.nt-social), .toast.alert-toast:has(.nt-agents) { box-shadow: inset 0 0 0 2px var(--green), 0 4px 0 var(--ink); }
.inbox { gap: 10px; }
.inbox-head { align-items: center; gap: 8px; flex-wrap: wrap; }
.inbox-head .title { margin: 0; }
.inbox-chips { display: flex; gap: 6px; overflow-x: auto; padding: 2px 2px 5px; scrollbar-width: none; }
.inbox-chips .chipbtn { flex: none; font-size: 14px; line-height: 1; padding: 7px 13px; }
.inbox > *:not(.inbox-list) { flex: none; }
.inbox-head > .row { gap: 6px; flex-wrap: nowrap; flex: none; }
.inbox-head .chipbtn { font-size: 14px; line-height: 1; padding: 7px 12px; }
.inbox-chips .chipbtn.on { background: var(--gold); color: var(--ink); }
.inbox-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; max-height: min(56vh, 560px); overflow: auto; overscroll-behavior: contain; }
.inbox-item { border-radius: 10px; background: var(--card); box-shadow: inset 0 0 0 1px var(--card-line); }
.inbox-item.unread { box-shadow: inset 4px 0 0 var(--gold), inset 0 0 0 1px var(--card-line); background: linear-gradient(90deg, rgba(255,214,79,.12), var(--card) 40%); }
.inbox-item.nt-raid.unread, .inbox-item.nt-bounty.unread { box-shadow: inset 4px 0 0 var(--red), inset 0 0 0 1px var(--card-line); }
.inbox-btn { all: unset; box-sizing: border-box; cursor: pointer; width: 100%; display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 9px 10px; }
.inbox-btn:focus-visible { outline: 3px solid var(--gold); outline-offset: -3px; border-radius: 10px; }
.inbox-btn .nt-ic { width: 34px; height: 34px; object-fit: contain; }
.ib-text { display: grid; gap: 3px; min-width: 0; }
.ib-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.ib-top b { font: 16px/1.15 var(--display); letter-spacing: .03em; }
.ib-top small { flex: none; }
.ib-body { font: 600 13px/1.35 var(--body); color: #D6E8FF; }
.ib-go { font: 26px var(--display); color: var(--gold); }
.inbox-empty { padding: 14px; text-align: center; }
.inbox-popups summary { cursor: pointer; font-weight: 800; color: var(--sub); }
.inbox-popups .notice-list { margin-top: 6px; }
.push-kind span { display: grid; gap: 2px; }
.push-kind small { color: var(--sub); font-weight: 600; }
@media (max-width: 760px) {
  #toasts { top: calc(62px + env(safe-area-inset-top)); width: 94vw; }
  .modal-back:has(.inbox-sheet) { place-items: end center; padding: 0; }
  .modal.inbox-sheet { width: 100%; border-radius: 22px 22px 0 0; padding: 16px 12px calc(16px + env(safe-area-inset-bottom)); max-height: 92dvh; display: flex; flex-direction: column; }
  .modal.inbox-sheet .inbox { min-height: 0; display: flex; flex-direction: column; }
  .modal.inbox-sheet .inbox-list { max-height: none; flex: 1; min-height: 0; }
  .inbox-btn { grid-template-columns: 30px minmax(0, 1fr) auto; padding: 10px 8px; }
  .ib-top { gap: 6px; }
  .ib-top b { font-size: 15px; }
  .ib-body { font-size: 12.5px; }
  .inbox-head { flex-wrap: nowrap; padding-right: 50px; }
  .inbox-head .title { font-size: 26px; min-width: 0; }
  .inbox-head .chipbtn { font-size: 13px; padding: 7px 10px; }
  .modal.inbox-sheet .inbox-list { padding-bottom: 4px; }
}

/* ---------- allies market (0.26.1) */
.al-summary { display: flex; flex-wrap: wrap; gap: 10px 22px; align-items: center; padding: 10px 14px; border-radius: 12px; background: rgba(4,16,46,.4); box-shadow: inset 0 0 0 2px var(--card-line); }
.al-summary > div { display: grid; }
.al-summary b { font: 22px var(--display); color: var(--gold); letter-spacing: .03em; }
.al-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: 8px; }
.al-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 12px; background: var(--card); box-shadow: inset 0 0 0 1px var(--card-line); }
.al-card.mine { box-shadow: inset 0 0 0 2px var(--gold); }
.al-info { display: grid; gap: 3px; min-width: 0; }
.al-info small { color: var(--sub); }
.al-boost { gap: 4px; flex-wrap: wrap; }
.al-buy { display: grid; justify-items: end; gap: 4px; }
.al-price { display: flex; align-items: center; gap: 4px; font: 20px var(--display); color: var(--gold); }
.al-price img { width: 22px; height: 22px; }
.al-market-head { align-items: center; gap: 10px; flex-wrap: wrap; }
.al-market-head .in { max-width: 260px; }
@media (max-width: 520px) { .al-card { grid-template-columns: auto minmax(0, 1fr); } .al-buy { grid-column: 1 / -1; grid-auto-flow: column; justify-content: space-between; align-items: center; } }

/* ---------- phone navigation (0.26.1): tab strips swipe sideways, a Back row on every screen */
@media (max-width: 760px) {
  .tabs { overflow-x: auto; overflow-y: hidden; flex-wrap: nowrap; scrollbar-width: none; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; touch-action: pan-x pan-y; scroll-snap-type: x proximity; max-width: 100%; margin-right: 0; padding-right: 18px;
    -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs button { flex: 0 0 auto; white-space: nowrap; scroll-snap-align: start; touch-action: pan-x pan-y; }
  .tabs.at-end { -webkit-mask-image: none; mask-image: none; }
  .m-back { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; }
  .m-back button { display: inline-flex; align-items: center; gap: 4px; padding: 6px 14px 6px 10px; border: 2px solid var(--ink); border-radius: 999px; background: linear-gradient(180deg, #1D4C95, #0E2D63); box-shadow: inset 0 0 0 2px var(--line); color: #fff; font: 16px var(--display); letter-spacing: .04em; text-transform: uppercase; touch-action: manipulation; }
  .m-back button svg { width: 18px; height: 18px; }
  .m-back b { font: 18px var(--display); letter-spacing: .04em; text-transform: uppercase; color: var(--sub); }
  .nav, .topbar, .hudbtns, .gm-tile, .btn, .navbtn { touch-action: manipulation; }
  .stage { -webkit-overflow-scrolling: touch; overscroll-behavior-y: contain; touch-action: pan-x pan-y; }
}
@media (min-width: 761px) { .m-back { display: none; } }
@media (max-width: 760px) {
  .stage { position: relative; }
  .m-back.float { position: absolute; top: 8px; left: 8px; z-index: 6; margin: 0; }
}
/* arena on phones (0.26.1): a compact HUD that never runs off the edge, cards and controls on their own rows */
@media (max-width: 600px) {
  .ar-top { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 6px; padding: calc(6px + var(--safe-t)) 8px 6px; }
  .ar-side { gap: 6px; position: relative; }
  .ar-side .pava { width: 34px; height: 34px; flex: none; }
  .ar-side b { font-size: 14px; max-width: 100%; }
  .ar-side > div { min-width: 0; flex: 1; }
  .ar-team { width: 100%; height: 8px; }
  .ar-auto-chip { position: absolute; top: 100%; margin-top: 2px; font-size: 10px; padding: 1px 5px; }
  .ar-a .ar-auto-chip { left: 40px; } .ar-b .ar-auto-chip { right: 40px; }
  .ar-time { font-size: 24px; }
  .ar-mid small { font-size: 9px; }
  .ar-bot { display: grid; grid-template-columns: 1fr; gap: 8px; padding: 8px 8px calc(8px + var(--safe-b)); }
  .ar-cards { justify-content: center; }
  .ar-card { width: min(31vw, 110px); }
  .ar-ctl { margin: 0; justify-content: space-between; }
  .ar-ctl .btn { flex: 1; }
  .ar-count { font-size: 84px; }
  .ar-results .ar-res-grid { grid-template-columns: 1fr; }
  .arena + #toasts, .arena ~ #toasts { top: calc(70px + var(--safe-t)); }
}

/* ---------- phone pass (0.26.1): more room for the game, tighter headers, quests and boxes that fit */
.q-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.q-foot .q-rew { flex-wrap: wrap; gap: 4px; }
.q-foot .q-act:empty { display: none; }
.quest .q-main { flex: 1; min-width: 0; }
.quest.ready { box-shadow: inset 0 0 0 2px var(--green), 0 0 12px rgba(75,221,98,.3); }
.claim-all { justify-self: start; margin: 0 0 10px; }
.ach-excl > summary { cursor: pointer; list-style: none; }
.ach-excl > summary::-webkit-details-marker { display: none; }
.ach-excl > summary::before { content: '\25B8  '; color: var(--sub); }
.ach-excl[open] > summary::before { content: '\25BE  '; }
.ach-excl .ach-grid { margin-top: 8px; }
@media (max-width: 760px) {
  /* the PIP-3 tip and the chat ticker take less of the screen */
  .pip-guide { padding: 4px 8px 4px 6px; gap: 8px; }
  .pip-face { width: 34px; height: 34px; margin: 0; }
  .pip-guide p { font-size: 12.5px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .pip-guide p b { font-size: 14px; }
  .pip-guide .pip-step { font-size: 11px; padding: 0 6px; }
  .pip-guide .btn { padding: 4px 10px; font-size: 14px; min-height: 0; }
  .shell { grid-template-rows: calc(62px + var(--safe-t)) auto 1fr 34px calc(66px + var(--safe-b)); }
  .peek { font-size: 13px; padding: 0 10px; }
  .stage { padding-bottom: 10px; }
  /* headers */
  .m-back { margin: 0 0 6px; }
  .m-back button { padding: 3px 12px 3px 8px; font-size: 14px; }
  .m-back b { font-size: 15px; }
  .screen-head { gap: 6px; margin-bottom: 8px; }
  .screen-head .title { font-size: 30px; }
  .screen-head > p.fine { flex-basis: 100%; margin: 0; font-size: 12.5px; }
  .rv-head { gap: 8px; padding: 8px 10px; }
  .rv-head .divb.big { width: 58px; height: 58px; }
  .rv-head .title { font-size: 28px; }
  .rv-head p, .rv-head small { font-size: 12px; }
  .shop > .tabs, .modq > .tabs { flex-wrap: nowrap; }
  /* quests */
  .quest { padding: 9px 11px; }
  .quest .q-main > b { font-size: 18px; }
  .quest .q-main > p { font-size: 12.5px; margin: 1px 0 3px; }
  .quest .q-act .btn { padding: 6px 16px; font-size: 16px; }
  .claim-all { width: 100%; }
  /* achievements */
  .ach-body { padding: 10px; gap: 8px; }
  .ach-head > div:first-child { min-width: 0; }
  .ach-count { font-size: 28px; }
  .ach-card { padding: 8px 10px; gap: 8px; grid-template-columns: auto 1fr auto; }
  .ach-card .medal.lg, .ach-card .medal-lg { width: 46px; height: 46px; }
  .ach-card .q-act { grid-column: auto; justify-self: end; }
  .ach-card.done .q-act { display: none; }
  .ach-main b { font-size: 16px; }
  .ach-main p { font-size: 12px; }
  /* boxes */
  .box-grid { grid-template-columns: 1fr; gap: 10px; }
  .box-card { padding: 10px 12px 12px; gap: 8px; }
  .box-top { gap: 10px; }
  .box-top .box-ic { width: 58px; height: 58px; }
  .box-top h3 { font-size: 22px; }
  .box-base { padding: 6px 8px; }
  .odds { font-size: 13px; }
  .odds td { padding: 3px 4px; }
  .odds .chip { font-size: 12px; padding: 1px 7px; }
  .odds .chip img { width: 16px; height: 16px; }
  .box-acts .btn { flex: 1; }
  .box-earn { padding: 10px 12px; }
  .box-earn li { font-size: 13px; }
}
/* nothing in a grid may push the page wider than the phone (0.26.1) */
.fest-grid > *, .festival > *, .research > *, .rv-body > *, .shop > *, .quests > *, .gigas > *, .faction > *, .social > *, .forum > * { min-width: 0; }
@media (max-width: 760px) {
  .fest-machine { grid-template-columns: 72px minmax(0, 1fr); } .fest-machine-art { width: 72px; }
  .fest-odds td.num { font-size: 15px; }
  .fest-copy { max-width: 100%; }
  .fest-copy .title { font-size: 28px; }
  .fest-track li { grid-template-columns: 44px minmax(0, 1fr) auto; }
  .fest-item { grid-template-columns: minmax(0, 1fr) auto; }
  .fest-item > :last-child { grid-column: 1 / -1; justify-self: end; }
}
/* Daily Challenge (0.26.2) */
.dc-card { padding: 12px 14px; margin-bottom: 12px; display: grid; gap: 10px; background: linear-gradient(180deg, #5B2FB0, #2C1468); box-shadow: inset 0 0 0 2px #B98CFF, 0 4px 0 var(--ink); }
.dc-card.done { filter: saturate(.7); }
.dc-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.dc-head small { font-weight: 800; color: #E0CCFF; text-transform: uppercase; letter-spacing: .05em; font-size: 12px; }
.dc-head h2 { margin: 0; font: 28px var(--display); letter-spacing: .03em; text-transform: uppercase; text-shadow: var(--outline-sm); color: var(--gold); }
.dc-head p { margin: 2px 0 0; font-weight: 700; font-size: 14px; }
.dc-streak { display: grid; justify-items: center; padding: 6px 12px; border-radius: 12px; background: rgba(4,16,46,.45); flex: none; }
.dc-streak b { font: 28px/1 var(--display); color: #FFB45C; }
.dc-streak small { font-size: 11px; }
.dc-rewards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.dc-tier { padding: 6px 8px; border-radius: 10px; background: rgba(4,16,46,.45); display: grid; gap: 4px; }
.dc-tier b { color: var(--gold); letter-spacing: 2px; }
.dc-tier.got { box-shadow: inset 0 0 0 2px var(--green); }
.dc-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.dc-prep h2 { margin: 0; }
@media (max-width: 560px) { .dc-rewards { grid-template-columns: 1fr; } .dc-tier { grid-template-columns: auto 1fr; align-items: center; } .dc-head h2 { font-size: 22px; } .dc-foot .btn { flex: none; } }
/* Season Pass (0.26.2) */
.pass { display: grid; gap: 12px; }
.pass-head { padding: 12px 14px; display: grid; gap: 8px; background: linear-gradient(180deg, #1F5BB5, #0E2D63); }
.pass-top { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.pass-top small { color: var(--sub); font-weight: 800; }
.pass-top h2 { margin: 0; font: 30px var(--display); letter-spacing: .03em; text-transform: uppercase; text-shadow: var(--outline-sm); }
.pass-pts { display: grid; justify-items: end; } .pass-pts b { font: 30px/1 var(--display); color: var(--gold); }
.pass-bar { display: grid; gap: 4px; } .pass-bar .bar { height: 14px; }
.pass-acts { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; }
.pass-elite-on { background: linear-gradient(180deg, #FFE68A, var(--gold)); color: var(--ink); font-weight: 800; }
.pass-list { display: grid; gap: 4px; }
.pass-row { display: grid; grid-template-columns: 44px minmax(0, 1fr) minmax(0, 1fr); gap: 6px; align-items: stretch; }
.pass-labels span { font: 14px var(--display); letter-spacing: .05em; text-transform: uppercase; color: var(--sub); padding: 0 6px; }
.pass-n { display: grid; place-items: center; border-radius: 10px; background: rgba(4,16,46,.55); font: 20px var(--display); color: var(--sub); }
.pass-row.reached .pass-n { background: linear-gradient(180deg, #FFE68A, var(--gold)); color: var(--ink); }
.pass-row.big .pass-cell { box-shadow: inset 0 0 0 2px #B98CFF; }
.pass-cell { padding: 6px 8px; border-radius: 10px; background: var(--card); box-shadow: inset 0 0 0 1px var(--card-line); display: grid; align-items: center; }
.pass-cell.elite { background: linear-gradient(180deg, #4A2A8C, #2A1660); }
.pass-cell.elite.locked { opacity: .55; }
.pass-cell.claimed { opacity: .45; }
.pass-cell .row { gap: 4px; }
.pass-earn { padding: 12px 14px; } .pass-earn li { font-size: 14px; } .pass-earn b { color: var(--gold); }
@media (max-width: 560px) { .pass-row { grid-template-columns: 34px minmax(0, 1fr) minmax(0, 1fr); } .pass-cell { padding: 4px 5px; } .pass-cell .chip { font-size: 11px; padding: 1px 5px; } .pass-cell .chip img { width: 14px; height: 14px; } .pass-top h2 { font-size: 24px; } }
/* War League (0.26.2) */
.fx-league { padding: 12px 14px; display: grid; gap: 8px; }
.lg-table { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.lg-row { display: grid; grid-template-columns: 40px 28px minmax(0, 1fr) auto auto; gap: 8px; align-items: center; padding: 5px 8px; border-radius: 8px; background: var(--card); box-shadow: inset 0 0 0 1px var(--card-line); }
.lg-row.us { box-shadow: inset 0 0 0 2px var(--gold); }
.lg-row img { width: 28px; height: 28px; object-fit: contain; }
.lg-place { font: 18px var(--display); color: var(--gold); }
.lg-name { font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lg-pts { font: 17px var(--display); }
.lg-last { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; border-radius: 10px; background: rgba(255,214,79,.12); box-shadow: inset 0 0 0 2px var(--gold); }
.lg-us { margin: 0; font-weight: 800; }
.lg-tiers { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 6px; }
.lg-tiers > div { padding: 6px 8px; border-radius: 8px; background: rgba(4,16,46,.35); }
@media (max-width: 560px) { .lg-row { grid-template-columns: 34px 24px minmax(0, 1fr) auto; } .lg-row small { display: none; } }
.dc-stars i { font-style: normal; opacity: .25; }
/* festivals look and feel their own (0.26.3): an accent colour and a weather layer each */

.fest-twist + .fest-perk { margin-top: -4px; }
.fest-perk { background: color-mix(in srgb, var(--fest-accent) 16%, transparent); box-shadow: inset 0 0 0 2px var(--fest-accent); }
.fest-perk b { color: var(--fest-accent); }
.festival .fest-tokens { border-color: var(--fest-accent, var(--gold)); }
.fest-fx { position: absolute; inset: 0; z-index: 1; pointer-events: none; opacity: .85; background-repeat: repeat; }
.fx-glitter .fest-fx { background-image: radial-gradient(2px 2px at 20px 30px, #FFF 50%, transparent 51%), radial-gradient(3px 3px at 90px 80px, #FFB3E6 50%, transparent 51%), radial-gradient(2px 2px at 150px 20px, #FFE68A 50%, transparent 51%), radial-gradient(2px 2px at 60px 140px, #C9F 50%, transparent 51%); background-size: 180px 180px; animation: fx-fall 9s linear infinite, fx-twinkle 1.6s ease-in-out infinite alternate; }
.fx-snow .fest-fx { background-image: radial-gradient(3px 3px at 30px 20px, #FFF 50%, transparent 51%), radial-gradient(2px 2px at 110px 90px, #E6F8FF 50%, transparent 51%), radial-gradient(4px 4px at 160px 150px, #FFF 50%, transparent 51%), radial-gradient(2px 2px at 70px 160px, #CDEFFF 50%, transparent 51%); background-size: 200px 200px; animation: fx-fall 12s linear infinite; }
.fx-bubbles .fest-fx { background-image: radial-gradient(circle at 40px 160px, transparent 7px, rgba(212,124,255,.8) 8px, transparent 10px), radial-gradient(circle at 140px 60px, transparent 5px, rgba(142,224,74,.75) 6px, transparent 8px), radial-gradient(circle at 90px 120px, transparent 4px, rgba(255,255,255,.6) 5px, transparent 7px); background-size: 190px 190px; animation: fx-rise 10s linear infinite; }
.fx-sparks .fest-fx { background-image: radial-gradient(2px 2px at 30px 40px, #FFD23F 50%, transparent 51%), radial-gradient(2px 3px at 120px 110px, #FF8A1C 50%, transparent 51%), radial-gradient(2px 2px at 80px 170px, #FFF1B0 50%, transparent 51%); background-size: 170px 170px; animation: fx-rise 5s linear infinite, fx-twinkle .7s ease-in-out infinite alternate; }
@keyframes fx-fall { from { background-position: 0 0, 0 0, 0 0, 0 0; } to { background-position: 40px 180px, -30px 200px, 20px 190px, -10px 200px; } }
@keyframes fx-rise { from { background-position: 0 0, 0 0, 0 0; } to { background-position: 20px -190px, -20px -190px, 10px -170px; } }
@keyframes fx-twinkle { from { opacity: .55; } to { opacity: 1; } }
html.no-motion .fest-fx { animation: none; }
@media (prefers-reduced-motion: reduce) { .fest-fx { animation: none; } }
.fest-copy { z-index: 2; }
.fest-hero { box-shadow: inset 0 0 0 3px var(--fest-accent, var(--gold)); }
@media (max-width: 760px) { .fest-hero::after { background: linear-gradient(180deg, rgba(4,16,46,.82), rgba(4,16,46,.6) 60%, rgba(4,16,46,.35)); } }
/* economy governor (0.26.4) */
.econ-chip { cursor: pointer; border: 0; font: inherit; }
.econ-info { display: grid; gap: 8px; }
.econ-info p { margin: 0; }
.econ-bar { display: grid; gap: 4px; }
.econ-table th { text-align: left; color: var(--sub); font-size: 12px; padding: 2px 6px; }
/* Discord sign-in (0.26.5) */
.btn.discord-btn, .btn.discord { background: linear-gradient(180deg, #7983F5, #4752C4); color: #fff; }
.discord-mark { margin-right: 8px; }
.discord-signup .ob-avatars { max-height: 40vh; overflow: auto; }

/* ---------- moderator content clean-up (0.26.6) */
.modq-content { display: grid; gap: 8px; }
.modc-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 8px 0; border-top: 1px solid rgba(99,198,255,.14); }
.modc-row:first-of-type { border-top: 0; }
.modc-text { display: grid; gap: 4px; min-width: 0; flex: 1; }
.modc-text small { color: var(--sub); font-weight: 700; }
.modc-text .modq-body { margin: 0; overflow-wrap: anywhere; }
.modc-row > .btn, .modc-row > .row { flex: none; }
.modc-posts { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.modc-posts li { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 10px; background: rgba(4,16,46,.4); }
.modc-posts li span { overflow-wrap: anywhere; }
@media (max-width: 560px) { .modc-row { flex-direction: column; } .modc-row > .row { justify-content: flex-start; } }

/* ---------- 0.27.0: strikes, staff notes, wall reports, ban appeals */
.modq-strikes { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; margin: 8px 0 4px; padding: 8px 12px; border-radius: 10px; background: rgba(4,16,46,.45); box-shadow: inset 0 0 0 1px var(--card-line); }
.modq-strikes.hot { box-shadow: inset 0 0 0 2px var(--red); }
.modq-strikes > b { font: 18px/1 var(--display); letter-spacing: .03em; }
.modq-next { margin-left: auto; color: var(--gold); font-weight: 700; }
.modq-notes-panel { display: grid; gap: 8px; }
.modq-note-add { display: flex; gap: 8px; align-items: flex-end; }
.modq-note-add textarea { flex: 1; min-height: 52px; resize: vertical; }
.modq-notes-panel .modq-notes li { padding: 8px 10px; border-radius: 10px; background: rgba(4,16,46,.4); }
.modq-notes-panel .modq-notes li.mn-warn { box-shadow: inset 3px 0 0 var(--gold); }
.modq-notes-panel .modq-notes p { margin: 3px 0 0; overflow-wrap: anywhere; }
.wall-report { display: grid; gap: 10px; }
.wall-report .chipbtn { font-size: 14px; line-height: 1; padding: 8px 12px; }
.ban-appeal { display: grid; gap: 8px; }
.ban-appeal textarea { width: 100%; box-sizing: border-box; min-height: 90px; resize: vertical; }
@media (max-width: 560px) { .modq-note-add { flex-direction: column; align-items: stretch; } .modq-next { margin-left: 0; width: 100%; } }

/* ---------- 0.28.0: invite friends, duel watching */
.soc-invite { display: grid; gap: 10px; margin-bottom: 12px; padding: 14px 16px; }
.soc-invite-head { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; }
.soc-invite-head .subhead { margin: 0 0 4px; }
.soc-invite-url { width: 100%; box-sizing: border-box; font: 600 14px var(--body); }
.soc-invite-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.auth-invite { margin: 0 0 8px; }
@media (max-width: 560px) { .soc-invite-head { flex-direction: column; } }
/* 0.28.1: support escalation */
.modq-esc { margin: 6px 0; }
.chipbtn.hot { box-shadow: inset 0 0 0 2px var(--red), 0 3px 0 rgba(0,0,0,.35); }

/* ---------------------------------------------------------------- profile page (0.29.0, player.js) */
.pp { max-width: 1120px; margin: 0 auto; padding: 14px 16px 60px; display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
.pp-missing { padding: 20px; }
.pp-hero { position: relative; min-height: 310px; display: grid; align-items: end; overflow: hidden; border: 3px solid var(--ink); border-radius: 14px;
  background: #0E3A85; box-shadow: 0 6px 0 rgba(4,16,46,.55), inset 0 0 0 1px var(--line); }
.pp-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 62%; }
.pp-hero::before { content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(180deg, rgba(4,16,46,.05) 0%, rgba(4,16,46,.25) 38%, rgba(4,16,46,.88) 100%); }
.pp-hero.role-dev { border-color: #4A0B1E; box-shadow: 0 6px 0 rgba(4,16,46,.55), inset 0 -4px 0 var(--dev); }
.pp-hero.role-mod { box-shadow: 0 6px 0 rgba(4,16,46,.55), inset 0 -4px 0 var(--modc); }
.pp-hero.role-tester { box-shadow: 0 6px 0 rgba(4,16,46,.55), inset 0 -4px 0 var(--tester); }
.pp-hero-in { position: relative; z-index: 2; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 20px; align-items: end; padding: 90px 24px 22px; }
.prof-ava.pp-ava { width: 150px; height: 150px; }
.pp-id { min-width: 0; }
.pp-id .prof-name { font-size: 52px; }
.pp-since { margin: 2px 0 0; font-weight: 700; color: #D6E6FF; text-shadow: 0 1px 0 var(--ink); }
.pp-medals { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.pp-medal { display: inline-flex; align-items: center; gap: 7px; padding: 3px 12px 3px 3px; background: rgba(4,16,46,.7); border: 2px solid var(--ink); border-radius: 999px; box-shadow: inset 0 0 0 1px rgba(255,205,60,.45); }
.pp-medal small { font: 14px var(--display); letter-spacing: .03em; text-transform: uppercase; color: #FFE7A3; }
.pp-medal .medal.sm { width: 34px; height: 34px; }
.pp-div { align-self: center; }
.pp-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pp-bio { padding: 12px 16px; font-size: 16px; line-height: 1.45; background: var(--card); border: 2px solid var(--ink); border-left: 6px solid var(--gold); border-radius: 10px; box-shadow: inset 0 0 0 1px var(--card-line); overflow-wrap: anywhere; }
.pp-bio textarea { width: 100%; }
.pp-card { display: grid; gap: 10px; align-content: start; padding: 14px 16px; background: var(--card); border: 2px solid var(--ink); border-radius: 12px; box-shadow: inset 0 0 0 1px var(--card-line), 0 4px 0 rgba(4,16,46,.4); min-width: 0; }
.pp-card .subhead { margin: 0; }
.pp-card-head, .pp-card-foot { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pp-card-head { justify-content: space-between; }
.pp-hint { margin: 8px 0 0; }
.pp-gigas { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.pp-giga { position: relative; display: grid; justify-items: center; gap: 2px; padding: 10px 6px 10px; color: #fff; font: inherit; text-align: center;
  border: 2px solid var(--ink); border-radius: 10px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.25), 0 4px 0 rgba(4,16,46,.45); background: radial-gradient(circle at 50% 38%, #7FD6FF, #1F6FD0); }
.pp-giga.el-thermal { background: radial-gradient(circle at 50% 36%, #FFB36B, #9E3A08 78%); }
.pp-giga.el-cryo { background: radial-gradient(circle at 50% 36%, #A6EEFF, #155F98 78%); }
.pp-giga.el-toxic { background: radial-gradient(circle at 50% 36%, #CFF79C, #3A7A14 78%); }
button.pp-giga { cursor: pointer; transition: transform .12s; }
button.pp-giga:hover { transform: translateY(-3px); }
.pp-g-art { height: 128px; width: 100%; display: grid; place-items: end center; }
.pp-g-art img { max-height: 128px; max-width: 100%; object-fit: contain; filter: drop-shadow(0 5px 0 rgba(4,16,46,.45)); }
.pp-giga b { font: 17px/1.1 var(--display); letter-spacing: .03em; text-transform: uppercase; text-shadow: var(--outline-sm); }
.pp-giga small { font-weight: 800; font-size: 12px; color: #F2F7FF; text-shadow: 0 1px 0 var(--ink); }
.pp-giga .pt-tag { z-index: 1; }
.pp-giga .elmark { position: absolute; top: 6px; right: 6px; }
.pp-q { position: absolute; bottom: 52px; right: 8px; padding: 0 6px; font: 13px var(--display); color: var(--ink); background: var(--gold); border: 2px solid var(--ink); border-radius: 6px; }
.pp-cols { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.pp-stack { display: grid; gap: 14px; min-width: 0; }
.pp-stack .prof-stats.pp-stats { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
.pp-city-stage { position: relative; aspect-ratio: 16 / 10; border: 2px solid var(--ink); border-radius: 8px; overflow: hidden; background: #0E3A85; }
.pp-city-canvas { display: block; width: 100%; height: 100%; }
.pp-likes { display: inline-flex; align-items: baseline; gap: 5px; }
.pp-likes .heart { color: var(--pink); font-size: 20px; }
.pp-likes b { font: 22px var(--display); letter-spacing: .03em; }
.pp-likes small { font-weight: 700; color: var(--sub); }
.pp-rec-nums { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.pp-rec-nums > div { display: grid; padding: 8px 10px; background: rgba(4,16,46,.35); border: 2px solid var(--ink); border-radius: 8px; }
.pp-rec-nums small { font: 800 11px var(--body); color: var(--sub); text-transform: uppercase; letter-spacing: .05em; }
.pp-rec-nums b { font: 28px/1.1 var(--display); color: var(--gold); letter-spacing: .03em; }
.pp-rec-nums i { font-style: normal; font-size: 12px; font-weight: 700; color: #C8DAF7; }
.prof-stats.pp-stats { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.pp-folds { display: grid; gap: 10px; }
.pp-fold { background: var(--card); border: 2px solid var(--ink); border-radius: 12px; box-shadow: inset 0 0 0 1px var(--card-line); min-width: 0; }
.pp-fold > summary { display: flex; align-items: baseline; gap: 12px; padding: 12px 16px; cursor: pointer; list-style: none; }
.pp-fold > summary::-webkit-details-marker { display: none; }
.pp-fold > summary b { font: 20px var(--display); letter-spacing: .03em; text-transform: uppercase; text-shadow: var(--outline-sm); }
.pp-fold > summary small { font-weight: 700; color: var(--sub); }
.pp-fold > summary::after { content: '+'; margin-left: auto; font: 24px/1 var(--display); color: var(--gold); }
.pp-fold[open] > summary::after { content: '\2212'; }
.pp-fold > summary:focus-visible { outline: 3px solid var(--gold); outline-offset: -3px; border-radius: 10px; }
.pp-fold-body { display: grid; gap: 12px; padding: 0 14px 14px; min-width: 0; }
.pp-wall .wall { margin: 0; }
/* showcase editor */
.modal.pp-ed-modal { width: min(880px, 100%); }
.pp-ed { display: grid; gap: 12px; }
.pp-ed-body { display: grid; gap: 10px; min-height: 260px; align-content: start; }
.pp-ed-pinned { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; min-height: 84px; padding: 8px; background: rgba(4,16,46,.35); border: 2px dashed var(--card-line); border-radius: 10px; }
.pp-ed-pin { position: relative; width: 72px; height: 72px; padding: 4px; border: 2px solid var(--ink); border-radius: 8px; cursor: pointer; }
.pp-ed-pin img { width: 100%; height: 100%; object-fit: contain; }
.pp-ed-pin > i { position: absolute; top: -7px; right: -7px; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; background: var(--red); color: #fff; font: 800 15px/1 var(--body); font-style: normal; border: 2px solid var(--ink); }
.pp-ed-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); gap: 8px; max-height: 44vh; overflow: auto; padding: 2px; }
.pp-ed-g { position: relative; display: grid; justify-items: center; gap: 2px; padding: 6px 4px 8px; color: #fff; font: inherit; border: 2px solid var(--ink); border-radius: 8px; cursor: pointer; }
.pp-ed-g.el-thermal, .pp-ed-pin.el-thermal { background: radial-gradient(circle at 50% 40%, #FFB36B, #9E3A08 80%); }
.pp-ed-g.el-cryo, .pp-ed-pin.el-cryo { background: radial-gradient(circle at 50% 40%, #A6EEFF, #155F98 80%); }
.pp-ed-g.el-toxic, .pp-ed-pin.el-toxic { background: radial-gradient(circle at 50% 40%, #CFF79C, #3A7A14 80%); }
.pp-ed-g img { height: 66px; max-width: 100%; object-fit: contain; }
.pp-ed-g small { font: 12px/1.1 var(--display); letter-spacing: .03em; text-transform: uppercase; text-shadow: var(--outline-sm); text-align: center; }
.pp-ed-g i { font-style: normal; font-size: 11px; font-weight: 800; text-shadow: 0 1px 0 var(--ink); }
.pp-ed-g.sel, .pp-ed-m.sel, .pp-ed-bd.sel { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold); }
.pp-ed-n { position: absolute; top: 4px; left: 4px; z-index: 1; min-width: 22px; height: 22px; padding: 0 4px; display: grid; place-items: center; border-radius: 11px; background: var(--gold); color: var(--ink); font: 14px var(--display); border: 2px solid var(--ink); }
.pp-ed-medals { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; max-height: 44vh; overflow: auto; padding: 2px; }
.pp-ed-m { position: relative; display: flex; gap: 10px; align-items: center; padding: 6px 40px 6px 10px; color: #fff; font: inherit; text-align: left; background: rgba(4,16,46,.45); border: 2px solid var(--ink); border-radius: 8px; cursor: pointer; }
.pp-ed-m > span:nth-child(2) { display: grid; min-width: 0; }
.pp-ed-m b { font: 15px var(--display); letter-spacing: .03em; text-transform: uppercase; }
.pp-ed-m small { font-weight: 700; color: var(--sub); font-size: 12px; }
.pp-ed-m .pp-ed-n { top: 50%; left: auto; right: 8px; transform: translateY(-50%); }
.pp-ed-bds { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; max-height: 44vh; overflow: auto; padding: 2px; }
.pp-ed-bd { display: grid; gap: 5px; padding: 4px 4px 6px; color: #fff; font: inherit; background: rgba(4,16,46,.45); border: 2px solid var(--ink); border-radius: 8px; cursor: pointer; }
.pp-ed-bd img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 5px; }
.pp-ed-bd small { font: 13px var(--display); letter-spacing: .03em; text-transform: uppercase; }
.pp-ed-bd.locked { opacity: .5; cursor: not-allowed; }
.pp-ed-bd.locked img { filter: grayscale(1) brightness(.7); }
.pp-ed-foot { gap: 8px; }
@media (max-width: 1023px) {
  .pp-hero-in { grid-template-columns: auto minmax(0, 1fr); }
  .pp-div { grid-column: 1 / -1; }
  .pp-cols { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 600px) {
  .pp { padding: 8px 8px 30px; gap: 10px; }
  .pp-hero { min-height: 0; border-radius: 10px; }
  .pp-hero-in { grid-template-columns: minmax(0, 1fr); justify-items: start; gap: 10px; padding: 46px 12px 12px; }
  .pp-div { grid-column: auto; }
  .prof-ava.pp-ava { width: 92px; height: 92px; }
  .pp-id .prof-name { font-size: 32px; }
  .pp-medal { padding-right: 9px; } .pp-medal small { font-size: 12px; } .pp-medal .medal.sm { width: 28px; height: 28px; }
  .pp-gigas { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .pp-g-art, .pp-g-art img { height: 100px; max-height: 100px; }
  .pp-card { padding: 12px; }
  .pp-rec-nums b { font-size: 22px; }
  .pp-ed-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* 0.29.1: Shark Reef, the ASS Dev backdrop: sharks circle the whirlpool in the middle of the sea.
   The ring is squashed for the high camera; each shark rides a spinning arm and faces along it. */
.pp-bg.bd-devsea { object-position: 46% 45%; }
.pp-sharks { position: absolute; left: 46%; top: 45%; width: 0; height: 0; pointer-events: none; }
.pp-ring { position: absolute; left: 0; top: 0; transform: scaleY(.45); }
.pp-shark { position: absolute; left: 0; top: 0; width: 0; height: 0;
  --r: clamp(120px, 21vw, 230px); --t: 34s;
  transform: rotate(calc(360deg / var(--n) * var(--i)));
  animation: pp-orbit var(--t) linear infinite; animation-delay: calc(var(--t) / var(--n) * var(--i) * -1); }
.pp-shark-b { position: absolute; left: var(--r); top: 0; width: clamp(72px, 10vw, 120px); transform: translate(-50%, -50%) rotate(90deg);
  animation: pp-sway 2.4s ease-in-out infinite alternate; animation-delay: calc(var(--i) * -.53s); opacity: .9; filter: drop-shadow(0 6px 0 rgba(4,16,46,.35)); }
.pp-shark-b img { display: block; width: 100%; height: auto; }
@keyframes pp-orbit { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes pp-sway { from { transform: translate(-50%, -50%) rotate(84deg); } to { transform: translate(-50%, -50%) rotate(96deg); } }
.no-motion .pp-shark, .no-motion .pp-shark-b { animation: none; }
@media (prefers-reduced-motion: reduce) { .pp-shark, .pp-shark-b { animation: none; } }
.pp-ed-bd { position: relative; }
.pp-ed-excl { position: absolute; top: 8px; left: 8px; font-size: 11px; font-style: normal; }
@media (max-width: 600px) { .pp-shark { --r: 34vw; } .pp-shark-b { width: 15vw; } }
.pp-actions .pp-friend span { color: #5BE37A; }
