/* Chancery: a heraldic dark interface. Sable ground, five tinctures that carry meaning (bricks tenne, rations vert, gold and actions or, power gules,
   information azure), square corners, double-hairline panels, pennant-shaped main buttons, thin gold progress lines. See docs/art-direction.html. */
/* Fonts ship with the app (web/fonts, latin subset, from Google Fonts, SIL Open Font License 1.1). */
@font-face { font-family: 'Cormorant SC'; font-style: normal; font-weight: 700; font-display: swap; src: url(fonts/CormorantSC-700.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Public Sans'; font-style: normal; font-weight: 400 600; font-display: swap; src: url(fonts/PublicSans-var.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
:root {
  --bg: #12151D;          /* sable */
  --panel: #1B2030;       /* field */
  --panel2: #232A3D;      /* raised field: inputs, secondary buttons */
  --line: #343C52;        /* rule */
  --text: #E9E4D6;        /* ivory */
  --muted: #9DA6BB;
  --accent: #D9A441;      /* or */
  --on-accent: #1A1405;
  --ok: #5C9A68;          /* vert */
  --bad: #C9514B;         /* gules */
  --info: #4A78C2;        /* azure */
  --epic: #8A64B8;        /* purpure */
  --bricks: #C07A33;        /* tenne */
  --font-display: 'Cormorant SC', 'Iowan Old Style', 'Palatino Linotype', Georgia, serif;
  --font-ui: 'Public Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 15px/1.35 var(--font-ui); display: flex; flex-direction: column; max-width: 560px; margin: 0 auto; }
svg.ico { width: 1.15em; height: 1.15em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: butt; stroke-linejoin: miter; vertical-align: -0.2em; }
.c-marble { color: #C9D6E8; } .c-bricks { color: var(--bricks); } .c-rations { color: var(--ok); } .c-coin { color: var(--accent); } .c-exp { color: var(--accent); } .c-pow { color: var(--bad); } .c-ok { color: var(--ok); } .c-bad { color: var(--bad); }


.job { position: relative; display: flex; justify-content: space-between; gap: 8px; margin-top: 4px; background: var(--panel); border: 1px solid var(--line); padding: 5px 10px 9px; font-size: 13px; }
.job .jl { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.job .jt { color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.job .bar { position: absolute; left: 6px; right: 6px; bottom: 3px; height: 3px; background: var(--line); overflow: hidden; }
.job .bar i { display: block; height: 100%; background: var(--accent); }
.job.res { flex-direction: row; align-items: flex-start; border-color: #6B5A2E; }

.group-title { display: flex; align-items: center; gap: 10px; margin: 16px 0 8px; font-family: var(--font-display); font-size: 16px; font-weight: 700; letter-spacing: .06em; color: var(--muted); }
.group-title::before { content: ""; width: 7px; height: 7px; background: var(--accent); transform: rotate(45deg); flex: none; }
.group-title::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: 2px; padding: 13px 14px; margin-bottom: 8px; box-shadow: inset 0 0 0 3px var(--panel), inset 0 0 0 4px var(--line); }
.card-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.card-top .grow { flex: 1; min-width: 0; } .sold-pic { flex: none; width: 56px; height: 56px; object-fit: contain; filter: drop-shadow(0 2px 2px rgba(0,0,0,.35)); }
.card.locked .sold-pic { filter: grayscale(1) brightness(.7); }
.card h3 { margin: 0; font-family: var(--font-display); font-size: 19px; font-weight: 700; letter-spacing: .01em; line-height: 1.15; }
.lv { color: var(--accent); font-family: var(--font-ui); font-size: 13px; font-weight: 600; letter-spacing: 0; }
.sub { color: var(--muted); font-size: 12px; margin-top: 2px; }
.costs { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 6px; font-size: 13px; font-variant-numeric: tabular-nums; }
.costs span { display: inline-flex; align-items: center; gap: 4px; }
.costs .short { color: var(--bad); }
.req { font-size: 12px; color: var(--muted); margin-top: 4px; }
.req .unmet { color: var(--bad); }

button { font: inherit; font-size: 14px; color: var(--text); background: var(--panel2); border: 1px solid var(--line); border-radius: 2px; padding: 8px 14px; min-height: 40px; cursor: pointer; }
button:hover:not(:disabled) { border-color: var(--muted); }
button.primary { background: var(--accent); color: var(--on-accent); border: 0; font-weight: 600; padding-right: 24px; clip-path: polygon(0 0, 100% 0, calc(100% - 9px) 50%, 100% 100%, 0 100%); }
button.primary:hover:not(:disabled) { filter: brightness(1.08); }
button.primary:focus-visible { filter: brightness(1.2); outline: none; }
button:disabled { opacity: .4; cursor: not-allowed; }
button.danger { color: var(--bad); }
button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button.on { background: var(--accent); color: var(--on-accent); border-color: transparent; font-weight: 600; clip-path: none; padding-right: 14px; }


.row { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.battle-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; font-size: 13px; color: var(--muted); }
#battle { width: 100%; max-width: 360px; display: block; margin: 0 auto; background: #0c0e14; border: 1px solid var(--line); touch-action: none; }
#toast { position: fixed; z-index: 90; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--panel2); border: 1px solid var(--accent); padding: 8px 14px; opacity: 0; transition: opacity .2s; pointer-events: none; max-width: 90%; text-align: center; font-size: 13px; }
#toast.show { opacity: 1; }

.hero-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 6px 0; font-size: 13px; }
.hero-head b { font-variant-numeric: tabular-nums; }
.rar { font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 2px; color: #1A1405; margin-right: 6px; letter-spacing: .02em; font-family: var(--font-ui); vertical-align: 2px; }
.rar.UR { background: #D9A441; } .rar.SSR { background: var(--epic); color: #150F20; } .rar.SR { background: var(--info); color: #08121F; }
.stats { display: flex; gap: 14px; font-size: 13px; margin-top: 6px; font-variant-numeric: tabular-nums; }
.stats span { display: inline-flex; align-items: center; gap: 4px; }
.actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; align-items: center; }
select { font: inherit; font-size: 14px; color: var(--text); background: var(--panel2); border: 1px solid var(--line); border-radius: 2px; padding: 8px; min-height: 40px; max-width: 100%; }
input[type=text], input[type=number], input:not([type]), textarea { font: inherit; font-size: 16px; color: var(--text); background: var(--panel2); border: 1px solid var(--line); border-radius: 2px; padding: 8px 10px; min-height: 40px; }   /* 16px: iPhone Safari zooms into smaller fields */
input:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
details { margin-top: 6px; font-size: 12px; color: var(--muted); } details p { margin: 4px 0; }
.locked { opacity: .5; }

.chips { display: flex; gap: 6px; overflow-x: auto; padding: 4px 0 8px; }
.chips button { white-space: nowrap; min-height: 36px; padding: 6px 12px; }
#squads .chips, #ally .chips { flex-wrap: wrap; overflow: visible; }
#squads .chips button svg.ico, #workers .chips button svg.ico { width: 14px; height: 14px; }
#b-team { margin-bottom: 8px; }
#squads select { min-height: 36px; }

.qty { display: flex; gap: 6px; align-items: center; margin-top: 8px; flex-wrap: wrap; }
.qty input { font: inherit; font-size: 16px; width: 84px; color: var(--text); background: var(--panel2); border: 1px solid var(--line); border-radius: 2px; padding: 8px; min-height: 40px; }
.hosp { border-color: var(--bad); }
.march { border-color: var(--accent); }
.tag { font-size: 11px; color: var(--muted); }

.q { font-size: 11px; font-weight: 700; padding: 0 6px; border-radius: 2px; border: 1px solid currentColor; letter-spacing: .02em; }
.q1 { color: #C9CED9; } .q2 { color: var(--ok); } .q3 { color: var(--info); } .q4 { color: #A98AD6; } .q5 { color: var(--accent); }
#workers .chips { margin: 6px 0; }
#workers select { min-height: 36px; width: 100%; }
.recruit { display: flex; gap: 6px; align-items: center; }
.recruit select { min-height: 36px; }

/* home base scene */
.scene-box { position: relative; flex: 1; min-height: 0; border: 1px solid var(--line); background: var(--land, #2E5C2B); }
.scene-wrap { position: absolute; inset: 0; overflow: auto; touch-action: pan-x pan-y; -webkit-overflow-scrolling: touch; cursor: grab; }
#scene svg { display: block; max-width: none; }
.scn .o { stroke: #0B0D12; stroke-opacity: .62; stroke-width: 1.2; stroke-linejoin: round; }
.scn text { font: 600 10px var(--font-ui); fill: var(--text); text-anchor: middle; pointer-events: none; }
.scn text.plot { font: 700 11px var(--font-display); letter-spacing: .04em; }
.scn .bld, .scn .bdg { cursor: pointer; }
/* day and night: a multiply tint over the buildings, then halos (windows, torches, furnaces, lamps), stars and the moon above it */
.scn .tint { fill: var(--tint, #fff); mix-blend-mode: multiply; display: none; }
@supports (mix-blend-mode: multiply) { .scn .tint { display: block; } }
.scn .lights { opacity: var(--night, 0); }
.scn.day .lights, .scn.day .tint { display: none; }
.scn .lf { animation: lflick 1.7s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.scn .tw { animation: twinkle 3.6s ease-in-out infinite; }
@keyframes lflick { 0%, 100% { opacity: 1; transform: scale(1); } 40% { opacity: .78; transform: scale(.94); } 70% { opacity: .95; transform: scale(1.05); } }
@keyframes twinkle { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
/* floating bubbles over the producing buildings */
#fx { position: absolute; left: 0; top: 0; width: 0; height: 0; pointer-events: none; z-index: 1; }
.bub { position: absolute; display: flex; align-items: center; gap: 4px; padding: 2px 9px 2px 6px; white-space: nowrap; border-radius: 999px; background: rgba(18, 21, 29, .92); border: 1px solid var(--accent); color: var(--text); font: 700 12px var(--font-ui); transform: translate(-50%, 0); opacity: 0; animation: bubup 3.2s ease-out forwards; }
.bub svg.ico { width: 14px; height: 14px; }
.bub.up { border-color: var(--ok); color: var(--ok); }
@keyframes bubup { 0% { opacity: 0; transform: translate(-50%, 6px) scale(.6); } 14% { opacity: 1; transform: translate(-50%, -4px) scale(1); } 75% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -44px) scale(1); } }
/* edge buttons: left column = things to act on, bottom row = timers */
@media (prefers-reduced-motion: reduce) { .scn .lf, .scn .tw, .chip, .bub { animation: none; } }
/* building animations: pennants wave, chimneys smoke, furnaces and torches flicker, gears turn (all off for reduced motion) */
.scn .flag { transform-box: fill-box; transform-origin: 0 50%; animation: wave 2.4s ease-in-out infinite; }
.scn .smoke circle { fill: #E9E4D6; opacity: 0; transform-box: fill-box; transform-origin: center; animation: rise 3.3s ease-out infinite; }
.scn .glow { opacity: .35; animation: pulse 1.8s ease-in-out infinite; }
.scn .fire { transform-box: fill-box; transform-origin: 50% 100%; animation: flick .5s ease-in-out infinite alternate; }
.scn .spin { transform-box: fill-box; transform-origin: center; animation: spin 6s linear infinite; }
.scn .lit { animation: pulse 3.2s ease-in-out infinite; }
.scn .ripple { transform-box: fill-box; transform-origin: center; animation: ripple 3s ease-out infinite; }
@keyframes wave { 0%, 100% { transform: scaleX(1) skewY(0deg); } 50% { transform: scaleX(.82) skewY(7deg); } }
@keyframes rise { 0% { opacity: 0; transform: translate(0, 0) scale(.5); } 15% { opacity: .5; } 100% { opacity: 0; transform: translate(7px, -30px) scale(2); } }
@keyframes pulse { 0%, 100% { opacity: .35; } 50% { opacity: .85; } }
@keyframes flick { from { transform: scale(1, 1); opacity: .9; } to { transform: scale(.78, 1.18); opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes ripple { 0% { opacity: .7; transform: scale(.3); } 100% { opacity: 0; transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .scn .flag, .scn .smoke circle, .scn .glow, .scn .fire, .scn .spin, .scn .lit, .scn .ripple { animation: none; } .scn .smoke circle { opacity: .25; } }

/* boot screen: the shield sits exactly where the native launch screen draws it (screen centre, 90 x 120), the wordmark fades in below it */
#boot { position: fixed; inset: 0; z-index: 100; background: var(--bg); transition: opacity .5s ease; }
#boot.out { opacity: 0; pointer-events: none; }
#boot .boot-mark { position: absolute; left: 50%; top: 50%; width: 90px; height: 120px; margin: -60px 0 0 -45px; }
#boot .boot-word { position: absolute; left: 0; right: 0; top: calc(50% + 84px); text-align: center; white-space: nowrap; font: 700 clamp(24px, 8.2vw, 34px)/1 var(--font-display); letter-spacing: .2em; padding-left: .2em; text-transform: uppercase; color: var(--text); text-shadow: 0 0 28px rgba(217, 164, 65, .28); animation: bootin .9s ease-out both; }
#boot .boot-rule { position: absolute; left: 50%; top: calc(50% + 142px); width: 230px; margin-left: -115px; display: flex; align-items: center; gap: 10px; animation: bootin 1.1s ease-out both; }
#boot .boot-rule i { flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--accent)); }
#boot .boot-rule i:last-child { background: linear-gradient(270deg, transparent, var(--accent)); }
#boot .boot-rule b { width: 7px; height: 7px; background: var(--accent); transform: rotate(45deg); }
#boot .boot-sub { position: absolute; left: 0; right: 0; top: calc(50% + 162px); text-align: center; font: 600 10px var(--font-ui); letter-spacing: .42em; padding-left: .42em; text-transform: uppercase; color: var(--muted); animation: bootin 1.3s ease-out both; }
#boot .boot-bar { position: absolute; left: 50%; width: 120px; margin-left: -60px; bottom: calc(9vh + env(safe-area-inset-bottom)); height: 2px; background: var(--line); overflow: hidden; }
#boot .boot-bar i { display: block; width: 40%; height: 100%; background: var(--accent); animation: bootbar 1.3s ease-in-out infinite; }
@keyframes bootin { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes bootbar { from { transform: translateX(-100%); } to { transform: translateX(260%); } }
@media (prefers-reduced-motion: reduce) { #boot { transition: none; } #boot .boot-word, #boot .boot-rule, #boot .boot-sub, #boot .boot-bar i { animation: none; } }

/* terrain and ambient life: waves and foam, villagers, birds, boats, building-site ghosts */
.scn .wv { animation: wavepulse 5s ease-in-out infinite; }
.scn .foam { animation: foamrun 3.2s linear infinite; }
.scn .foam2 { animation: foamrun 5s linear infinite reverse; }
.scn .wk { animation: wkbob .42s ease-in-out infinite alternate; }
.scn .bird { animation: flap .5s ease-in-out infinite alternate; transform-box: fill-box; transform-origin: 50% 100%; }
.scn .boat { animation: bob 3.4s ease-in-out infinite alternate; }
.scn .birds { opacity: calc(1 - var(--night, 0)); }
.scn .ghost { opacity: .3; pointer-events: none; }
.scn .ghost.lk { opacity: .2; }
.scn text.plot { paint-order: stroke; stroke: #0B0D12; stroke-width: 3px; stroke-linejoin: round; fill: #F2D58A; }
.scn text.plot.lk { fill: #B9B4A4; opacity: .85; }
@keyframes wavepulse { 0%, 100% { opacity: .15; } 50% { opacity: 1; } }
@keyframes foamrun { to { stroke-dashoffset: -46; } }
@keyframes wkbob { to { transform: translateY(-1.2px); } }
@keyframes flap { to { transform: scaleY(.35); } }
@keyframes bob { to { transform: translateY(-2px) rotate(2deg); } }
@media (prefers-reduced-motion: reduce) { .scn .wv, .scn .foam, .scn .foam2, .scn .wk, .scn .bird, .scn .boat { animation: none; } }

/* ---------- layout: header, home with its HUD, panels over the home ---------- */
[hidden] { display: none !important; }
#top { position: relative; z-index: 30; display: grid; grid-template-columns: auto repeat(3, minmax(0, 1fr)); gap: 8px; align-items: center; padding: calc(6px + env(safe-area-inset-top)) 12px 6px; background: var(--panel); border-bottom: 1px solid var(--line); }
.lord { display: flex; align-items: center; gap: 8px; }
.lshield { position: relative; width: 36px; height: 42px; display: grid; place-items: center; }
.lshield svg { position: absolute; inset: 0; width: 100%; height: 100%; fill: var(--panel2); stroke: var(--accent); stroke-width: 1.4; }
.lshield b { position: relative; font: 700 17px/1 var(--font-display); color: var(--accent); margin-top: -2px; }
.lpow { display: flex; align-items: center; gap: 3px; font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.lpow svg.ico { width: 16px; height: 16px; }
.res { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; }
.res svg.ico { width: 17px; height: 17px; margin-bottom: 1px; }
.res b { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.res small { color: var(--muted); font-size: 11px; min-height: 13px; font-variant-numeric: tabular-nums; }

main { position: relative; flex: 1; min-height: 0; overflow: hidden; }
.tab { display: none; }
#tab-city { display: block; position: absolute; inset: 0; }
.tab.panel { position: absolute; inset: 0; overflow-y: auto; padding: 60px 16px 92px; background: var(--bg); z-index: 20; -webkit-overflow-scrolling: touch; }
.tab.panel.active { display: block; }
#panel-bar { display: none; position: absolute; top: 0; left: 0; right: 0; height: 48px; z-index: 25; align-items: center; justify-content: center; background: var(--panel); border-bottom: 1px solid var(--line); font: 700 21px/1 var(--font-display); letter-spacing: .1em; text-transform: uppercase; }
#panel-x { position: absolute; right: 6px; top: 4px; width: 40px; padding: 0; background: none; border: 0; }
#panel-back { display: none; position: absolute; left: 12px; bottom: calc(14px + env(safe-area-inset-bottom)); z-index: 26; min-height: 46px; padding-left: 14px; padding-right: 26px; align-items: center; gap: 6px; font-size: 15px; }
body[data-panel] #panel-bar, body[data-panel] #panel-back { display: flex; }
body[data-panel] #tab-city { visibility: hidden; }      /* the city scene costs a lot to paint; skip it while a full-screen panel covers it */

.scene-box { position: absolute; inset: 0; background: var(--land, #3A7536); overflow: hidden; }
.hud-col { position: absolute; z-index: 3; display: flex; flex-direction: column; gap: 9px; pointer-events: none; }
#hud-l { left: 8px; top: 10px; } #hud-r { right: 8px; top: 10px; }
.chip, .hbtn { pointer-events: auto; position: relative; width: 52px; min-height: 52px; padding: 5px 2px 6px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; background: rgba(27, 32, 48, .93); border: 1px solid var(--line); border-radius: 2px; color: var(--text); font: 600 10px/1.1 var(--font-ui); box-shadow: inset 0 0 0 2px rgba(27, 32, 48, .93), inset 0 0 0 3px var(--line), 0 2px 6px rgba(0, 0, 0, .35); }
.chip svg.ico, .hbtn svg.ico { width: 21px; height: 21px; }
.chip b { font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--muted); }
.chip.busy { border-color: #8A7336; } .chip.busy b { color: var(--accent); }
.chip.ready { border-color: var(--accent); color: var(--accent); } .chip.ready b { color: var(--accent); font-size: 13px; }
.chip.collect { border-color: var(--accent); color: var(--accent); } .chip.collect b { color: var(--accent); font-size: 13px; }
.cbar { display: none; position: absolute; left: 6px; right: 6px; bottom: 4px; height: 2px; background: var(--line); }
.chip.busy .cbar { display: block; } .cbar u { display: block; height: 100%; width: 0; background: var(--accent); }
.hbtn span { color: var(--muted); font-size: 10px; }
.bd { position: absolute; top: -8px; right: -8px; min-width: 19px; height: 21px; padding: 2px 4px 0; text-align: center; background: var(--accent); color: #1A1405; font: 700 11px/16px var(--font-ui); font-style: normal; clip-path: polygon(0 0, 100% 0, 100% 72%, 50% 100%, 0 72%); }
.scene-ui { position: absolute; z-index: 3; right: 8px; bottom: calc(100px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 6px; }
.scene-ui button { width: 40px; min-height: 40px; padding: 0; font-size: 20px; background: rgba(27, 32, 48, .93); }
.scene-ui svg.ico { width: 20px; height: 20px; vertical-align: -4px; }
#hud-b { position: absolute; z-index: 3; left: 8px; right: 8px; bottom: calc(10px + env(safe-area-inset-bottom)); display: flex; align-items: flex-end; gap: 8px; pointer-events: none; }
.big { pointer-events: auto; position: relative; flex: none; width: 78px; min-height: 70px; padding: 6px 4px 7px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; background: linear-gradient(180deg, #2A3248, #1B2030); border: 1px solid var(--accent); border-radius: 2px; color: var(--text); box-shadow: inset 0 0 0 2px #1B2030, inset 0 0 0 3px #6B5A2E, 0 3px 10px rgba(0, 0, 0, .45); }
.big svg.ico { width: 28px; height: 28px; color: var(--accent); }
.big span { font: 700 14px/1 var(--font-display); letter-spacing: .08em; text-transform: uppercase; }
#qline { pointer-events: auto; flex: 1; min-width: 0; min-height: 46px; padding: 6px 10px; text-align: left; display: flex; flex-direction: column; gap: 1px; justify-content: center; background: rgba(27, 32, 48, .93); border: 1px solid var(--line); box-shadow: 0 2px 6px rgba(0, 0, 0, .35); }
#qline .qt { font-size: 12px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#qline .qp { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
#qline.done { border-color: var(--accent); } #qline.done .qp { color: var(--accent); font-weight: 600; }

/* radial menu on a tapped building */
#radial { position: absolute; left: 0; top: 0; width: 0; height: 0; z-index: 4; }
.rlabel { position: absolute; transform: translate(-50%, -100%); padding: 2px 10px; background: rgba(18, 21, 29, .94); border: 1px solid var(--accent); font: 700 14px/1.3 var(--font-display); letter-spacing: .04em; white-space: nowrap; pointer-events: none; }
.rd { position: absolute; width: 48px; height: 48px; min-height: 0; padding: 0; border-radius: 50%; display: grid; place-items: center; background: var(--panel); border: 2px solid var(--accent); color: var(--text); box-shadow: 0 3px 10px rgba(0, 0, 0, .55); transform: translate(-50%, -50%); animation: rdin .18s ease-out both; }
.rd svg.ico { width: 22px; height: 22px; }
.rd.go { background: var(--accent); color: var(--on-accent); }
.rd small { position: absolute; top: 100%; left: 50%; transform: translateX(-50%); margin-top: 3px; font: 600 10px/1 var(--font-ui); color: #fff; text-shadow: 0 1px 3px #000, 0 0 4px #000; white-space: nowrap; pointer-events: none; }
@keyframes rdin { from { opacity: 0; transform: translate(-50%, -50%) scale(.4); } to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }

/* modal: the upgrade panel and the menu */
#modal { position: fixed; z-index: 60; inset: 0; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(8, 10, 16, .74); }
.mdl { position: relative; width: min(100%, 420px); max-height: 88vh; overflow-y: auto; padding: 18px 16px 14px; background: var(--panel); border: 1px solid var(--accent); box-shadow: inset 0 0 0 3px var(--panel), inset 0 0 0 4px var(--line), 0 12px 40px rgba(0, 0, 0, .6); }
.mdl h3 { margin: 0; font: 700 23px/1.1 var(--font-display); letter-spacing: .02em; }
.mdl-x { position: absolute; top: 8px; right: 8px; width: 38px; min-height: 38px; padding: 0; background: none; border: 0; }
.mdl-head { display: flex; gap: 12px; align-items: center; margin: 0 28px 8px 0; }
.mdl-head .prev { flex: none; width: 104px; height: 96px; background: var(--land, #3A7536); border: 1px solid var(--line); overflow: hidden; }
.mdl-head .prev svg { width: 100%; height: 100%; display: block; }
.mdl .lvrow { margin-top: 4px; color: var(--accent); font-weight: 600; font-size: 14px; }
.mdl .lvrow .arr { color: var(--muted); }
.stat { width: 100%; border-collapse: collapse; margin: 6px 0; font-size: 13px; }
.stat td { padding: 6px 4px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.stat td:first-child { color: var(--muted); } .stat td:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.stat .arr { color: var(--muted); } .stat .to { color: var(--ok); font-weight: 600; }
.stat svg.ico { width: 15px; height: 15px; margin-right: 6px; }
.mdl .sec { margin: 12px 0 2px; font: 700 15px/1 var(--font-display); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.rq { display: flex; align-items: center; gap: 8px; padding: 6px 4px; border-bottom: 1px solid var(--line); font-size: 13px; }
.rq .grow { flex: 1; min-width: 0; } .rq .ok { color: var(--ok); } .rq .no { color: var(--bad); }
.rq svg.ico { width: 16px; height: 16px; } .rq button { min-height: 32px; padding: 4px 12px; font-size: 13px; }
.rq .num { font-variant-numeric: tabular-nums; color: var(--muted); } .rq .num.no { color: var(--bad); }
.mdl-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; }
.mdl-foot .t { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 5px; }
.mdl-foot .btns { display: flex; gap: 8px; }
.mdl-foot .inst { display: flex; flex-direction: column; align-items: center; line-height: 1.1; padding: 4px 14px; }
.mdl-foot .inst small { display: flex; align-items: center; gap: 3px; font-size: 12px; font-weight: 600; color: var(--accent); }
.mdl-foot .inst small svg.ico { width: 13px; height: 13px; }
.mdl .hxp { display: flex; align-items: center; gap: 5px; margin-top: 4px; font-size: 13px; color: var(--muted); }
.mdl .hxp b { color: var(--ok); } .mdl .hxp svg.ico { width: 15px; height: 15px; }
.mdl.menu { width: min(100%, 320px); }
.mdl.menu .menu { display: grid; gap: 8px; margin-top: 12px; }
.mdl.menu button.mi { display: flex; align-items: center; gap: 12px; justify-content: flex-start; min-height: 48px; font-size: 15px; }
.mdl.menu button.mi svg.ico { width: 22px; height: 22px; color: var(--accent); }

/* collectable production bubbles and the burst that flies to the bar */
#bubbles { position: absolute; left: 0; top: 0; width: 0; height: 0; z-index: 3; }
/* townsfolk talk (townsay.js): a small white bubble over a walker's head; position comes from transform, the pop from scale */
.tsay { position: absolute; left: 0; top: 0; z-index: 3; max-width: 150px; padding: 5px 9px; border-radius: 10px; background: #FBF7EC; color: #2B2418; border: 1.5px solid #1E2340; font: 600 11.5px/1.25 var(--font-ui); text-align: center; pointer-events: none; box-shadow: 0 2px 6px rgba(0, 0, 0, .3); opacity: 0; scale: .4; transform-origin: 50% 100%; transition: opacity .25s, scale .25s cubic-bezier(.3, 1.6, .5, 1); }
.tsay::after { content: ''; position: absolute; left: 50%; bottom: -6px; width: 9px; height: 9px; margin-left: -5px; background: #FBF7EC; border: solid #1E2340; border-width: 0 1.5px 1.5px 0; rotate: 45deg; }
.tsay.on { opacity: 1; scale: 1; }
.cb { position: absolute; transform: translate(-50%, -100%); display: flex; align-items: center; gap: 4px; min-height: 0; padding: 4px 10px 4px 8px; border-radius: 999px; background: rgba(27, 32, 48, .96); border: 2px solid var(--accent); color: var(--text); font: 700 13px/1 var(--font-ui); font-variant-numeric: tabular-nums; box-shadow: 0 3px 10px rgba(0, 0, 0, .5); animation: cbob 1.6s ease-in-out infinite alternate; cursor: pointer; }
.cb::after { content: ""; position: absolute; left: 50%; bottom: -7px; margin-left: -5px; border: 5px solid transparent; border-top-color: var(--accent); border-bottom: 0; }
.cb svg.ico { width: 18px; height: 18px; }
.cb.full { border-color: var(--bad); animation: cbob .5s ease-in-out infinite alternate; } .cb.full::after { border-top-color: var(--bad); }
@keyframes cbob { from { transform: translate(-50%, -100%); } to { transform: translate(-50%, calc(-100% - 5px)); } }
.fly { position: fixed; z-index: 80; width: 22px; height: 22px; pointer-events: none; }
.fly svg.ico { width: 22px; height: 22px; filter: drop-shadow(0 1px 3px rgba(0, 0, 0, .7)); }
.gain { position: fixed; z-index: 80; transform: translate(-50%, -100%); pointer-events: none; font: 700 18px/1 var(--font-ui); color: var(--accent); text-shadow: 0 1px 4px #000, 0 0 8px #000; animation: gainup 1.1s ease-out forwards; }
@keyframes gainup { from { opacity: 1; transform: translate(-50%, -100%); } to { opacity: 0; transform: translate(-50%, calc(-100% - 38px)); } }
.res.bump, #b-heroes.bump { animation: bump .32s ease-out; }
@keyframes bump { 40% { transform: scale(1.14); } }
@media (prefers-reduced-motion: reduce) { .cb, .cb.full, .res.bump, #b-heroes.bump { animation: none; } .gain { animation-duration: 1.6s; } }

/* speed-up dialog, queue rows with a Speed up button, inventory */
.job .su { flex: none; min-height: 28px; padding: 3px 10px; font-size: 12px; display: inline-flex; align-items: center; gap: 4px; margin-left: 8px; }
.job .su svg.ico { width: 13px; height: 13px; }
.job .jl { flex: 1; min-width: 0; }
.su-prog { margin: 10px 0 6px; } .su-prog .su-left { font: 700 22px/1 var(--font-display); letter-spacing: .04em; font-variant-numeric: tabular-nums; }
.su-prog .bar { position: relative; height: 4px; margin-top: 8px; background: var(--line); } .su-prog .bar i { display: block; height: 100%; background: var(--accent); }
.su-help { margin: 8px 0; } .su-help button { display: inline-flex; align-items: center; gap: 6px; }
.qs { display: inline-flex; align-items: center; gap: 6px; } .qs b { min-width: 18px; text-align: center; font-variant-numeric: tabular-nums; }
.qs button { min-height: 30px; width: 30px; padding: 0; font-size: 16px; }
.rq .sub { margin-top: 1px; }
.inv { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.inv-i { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 12px 6px; background: var(--panel); border: 1px solid var(--line); box-shadow: inset 0 0 0 2px var(--panel), inset 0 0 0 3px var(--line); text-align: center; }
.inv-i .inv-ic svg.ico { width: 26px; height: 26px; color: var(--accent); }
.inv-i b { font-size: 18px; font-variant-numeric: tabular-nums; } .inv-i span:last-child { font-size: 11px; color: var(--muted); }

/* hero grid, hero detail */
.hgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; margin-top: 8px; }
.hc-sep { grid-column: 1 / -1; margin-top: 8px; font: 700 14px var(--font-display); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.hc { position: relative; display: flex; flex-direction: column; gap: 0; min-height: 0; padding: 0; background: var(--panel); border: 2px solid var(--line); border-radius: 2px; overflow: hidden; text-align: center; color: var(--text); }
.hc.UR { border-color: #D9A441; } .hc.SSR { border-color: #8A64B8; } .hc.SR { border-color: #4A78C2; }
.hc-art { display: block; aspect-ratio: 4 / 5; } .hc.off .hc-art { filter: grayscale(.9) brightness(.6); }
.pt { display: block; width: 100%; height: 100%; }
.hc-lv { position: absolute; left: 0; top: 0; padding: 1px 6px; background: rgba(18, 21, 29, .85); font: 700 11px/1.4 var(--font-ui); }
.hc-stars { position: absolute; right: 3px; top: 1px; font-size: 10px; color: var(--accent); text-shadow: 0 1px 2px #000; }
.hc-sq { position: absolute; right: 0; bottom: 20px; padding: 0 5px; background: var(--info); color: #08121F; font: 700 9px/1.5 var(--font-ui); font-style: normal; text-transform: uppercase; }
.hc-name { padding: 3px 3px 4px; font: 600 11px/1.15 var(--font-ui); min-height: 28px; display: flex; align-items: center; justify-content: center; background: var(--panel); }
.hd-art { position: relative; margin: 0 auto; width: min(100%, 260px); border: 3px solid var(--line); box-shadow: 0 0 24px rgba(0, 0, 0, .5); }
.hd-art.UR { border-color: #D9A441; box-shadow: 0 0 28px rgba(217, 164, 65, .35); } .hd-art.SSR { border-color: #8A64B8; box-shadow: 0 0 28px rgba(138, 100, 184, .35); } .hd-art.SR { border-color: #4A78C2; }
.hd-pt { aspect-ratio: 4 / 5; }
.hd-nav { position: absolute; top: 50%; width: 36px; min-height: 44px; padding: 0; margin-top: -22px; background: rgba(18, 21, 29, .7); border: 0; }
.hd-nav.l { left: 0; } .hd-nav.r { right: 0; } .hd-nav.r svg { transform: rotate(180deg); }
.hd-rar { position: absolute; left: 8px; top: 8px; font: 700 26px/1 var(--font-display); letter-spacing: .06em; text-shadow: 0 2px 6px #000; }
.hd-rar.UR { color: #F0C75E; } .hd-rar.SSR { color: #B392DA; } .hd-rar.SR { color: #86A9E0; }
.hd-meta { position: absolute; left: 8px; bottom: 8px; display: flex; gap: 6px; } .hd-meta i { padding: 1px 8px; background: rgba(18, 21, 29, .85); font: 600 11px/1.6 var(--font-ui); font-style: normal; display: inline-flex; align-items: center; gap: 4px; }
.hd-meta svg.ico { width: 13px; height: 13px; }
.hd-name { margin: 12px 0 0; text-align: center; font: 700 26px/1.1 var(--font-display); letter-spacing: .03em; }
.hd-nick, .hd-lv { text-align: center; } .hd-lv { margin-top: 4px; color: var(--accent); font-weight: 600; }
.hd-tabs { display: flex; margin: 12px 0 10px; border-bottom: 1px solid var(--line); }
.hd-tabs button { flex: 1; background: none; border: 0; border-bottom: 3px solid transparent; border-radius: 0; min-height: 42px; color: var(--muted); font-weight: 600; clip-path: none; padding: 6px; }
.hd-tabs button.on { color: var(--accent); border-bottom-color: var(--accent); background: none; }
.hd-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 8px; }
.hd-st { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 4px; background: var(--panel); border: 1px solid var(--line); }
.hd-st svg.ico { width: 20px; height: 20px; color: var(--accent); } .hd-st b { font-size: 19px; font-variant-numeric: tabular-nums; } .hd-st small { color: var(--muted); font-size: 11px; } .hd-st small i { color: var(--ok); font-style: normal; }
.hd-act { display: flex; gap: 8px; margin: 12px 0 6px; flex-wrap: wrap; }
.hd-sk { padding: 10px 12px; margin-bottom: 8px; background: var(--panel); border: 1px solid var(--line); } .hd-sk p { margin: 4px 0 0; font-size: 13px; } .hd-sk.locked { opacity: .5; }
.hd-sk-lv { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--accent); font-weight: 600; } .hd-sk.locked .hd-sk-lv { color: var(--muted); } .hd-sk-lv svg.ico { width: 14px; height: 14px; }
.hd-starrow { display: flex; justify-content: center; gap: 8px; font-size: 26px; color: var(--line); } .hd-starrow .on { color: var(--accent); text-shadow: 0 0 10px rgba(217, 164, 65, .5); } .hd-tier { text-align: center; margin-bottom: 8px; }

/* recruit screen */
#tab-recruit.panel { padding-bottom: 96px; }
.rc-tabs { display: flex; gap: 6px; margin-bottom: 10px; } .rc-tabs button { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; font-weight: 600; clip-path: none; }
.rc-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; } .rc-tk { display: inline-flex; align-items: center; gap: 6px; font-size: 15px; } .rc-tk svg.ico { width: 20px; height: 20px; color: var(--accent); }
.rc-pity { margin: 6px 0 10px; font-size: 13px; color: var(--muted); } .rc-pity b { color: var(--accent); }
.rc-art { position: relative; display: flex; justify-content: center; align-items: flex-end; height: 250px; padding: 14px 8px 0; overflow: hidden; border: 1px solid var(--line); background: radial-gradient(ellipse at 50% 38%, #5B3E1C 0%, #2A1E14 45%, #12151D 85%); }
.rc-art.work { background: radial-gradient(ellipse at 50% 38%, #2E4A5C 0%, #1B2A38 50%, #12151D 90%); }
.rc-p { width: 31%; aspect-ratio: 4 / 5; margin: 0 -1.5%; border: 3px solid #D9A441; box-shadow: 0 6px 20px rgba(0, 0, 0, .6); overflow: hidden; }
.rc-p.p1 { width: 38%; z-index: 2; margin-bottom: 0; } .rc-p.p0 { transform: rotate(-4deg) translateY(10px); } .rc-p.p2 { transform: rotate(4deg) translateY(10px); }
.rc-btns button.free { background: linear-gradient(180deg, #7FD86A, #3E9A3A 60%, #2D7A2C); border-color: #2D7A2C; color: #fff; }
.rc-free { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 8px; font-size: 13px; color: var(--muted); } .rc-free b { color: var(--text); font-variant-numeric: tabular-nums; }
.rc-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; } .rc-btns button { min-height: 52px; font-size: 16px; padding-right: 20px; }
.rc-more { display: flex; align-items: center; gap: 8px; margin-top: 10px; } .rc-more .sub { flex: 1; }
#reveal { position: fixed; inset: 0; z-index: 70; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: calc(16px + env(safe-area-inset-top)) 12px calc(16px + env(safe-area-inset-bottom)); background: radial-gradient(ellipse at 50% 40%, #1C2640, #0B0D12 80%); }
#reveal[hidden] { display: none; }
.rv-title { font: 700 22px/1 var(--font-display); letter-spacing: .12em; text-transform: uppercase; }
.rv-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(66px, 1fr)); gap: 8px; width: min(100%, 420px); }
.rcard { perspective: 700px; aspect-ratio: 4 / 5.6; cursor: pointer; }
.rin { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .55s cubic-bezier(.3, .1, .2, 1); }
.rcard.flip .rin { transform: rotateY(180deg); }
.rback, .rfront { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border: 2px solid #D9A441; overflow: hidden; background: var(--panel); }
.rfront { transform: rotateY(180deg); display: flex; flex-direction: column; }
.rfront.UR { border-color: #F0C75E; box-shadow: 0 0 18px rgba(240, 199, 94, .65); } .rfront.SSR { border-color: #B392DA; box-shadow: 0 0 14px rgba(179, 146, 218, .5); } .rfront.SR { border-color: #86A9E0; } .rfront.q5 { border-color: #F0C75E; box-shadow: 0 0 16px rgba(240, 199, 94, .6); } .rfront.q4 { border-color: #B392DA; box-shadow: 0 0 12px rgba(179, 146, 218, .45); } .rfront.q3 { border-color: #86A9E0; }
.rpt { flex: 1; min-height: 0; } .rpt.dim { filter: brightness(.55) saturate(.7); } .rpt.ico { display: grid; place-items: center; background: linear-gradient(180deg, #2A3248, #1B2030); } .rpt.ico svg.ico { width: 38px; height: 38px; color: var(--accent); }
.rname { padding: 2px 2px 3px; font: 600 9px/1.15 var(--font-ui); text-align: center; background: rgba(18, 21, 29, .92); min-height: 24px; display: flex; align-items: center; justify-content: center; }
.rtag { position: absolute; top: 0; left: 0; right: 0; padding: 1px 0; background: var(--accent); color: var(--on-accent); text-align: center; font: 700 9px/1.5 var(--font-ui); font-style: normal; letter-spacing: .05em; }
.rv-sum { max-width: 420px; text-align: center; font-size: 12px; color: var(--muted); min-height: 16px; }
.rv-act { display: flex; gap: 10px; min-height: 48px; } .rv-act button { min-height: 46px; }
@media (prefers-reduced-motion: reduce) { .rin { transition: none; } }
.hc.off { border-color: var(--line); }

/* research: category cards and the hexagon tree */
.rbar { position: sticky; top: -1px; z-index: 5; display: flex; align-items: center; gap: 10px; margin: 0 0 10px; padding: 8px 10px; background: var(--panel); border: 1px solid #6B5A2E; box-shadow: 0 4px 10px rgba(0, 0, 0, .4); font-size: 13px; }
.rbar.idle { border-color: var(--line); color: var(--muted); }
.rbar-n { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .rbar-n svg.ico { width: 15px; height: 15px; vertical-align: -3px; margin-right: 4px; color: var(--accent); }
.rbar-t { color: var(--accent); font-variant-numeric: tabular-nums; font-weight: 600; } .rbar button { min-height: 30px; padding: 3px 10px; font-size: 12px; display: inline-flex; align-items: center; gap: 4px; } .rbar button svg.ico { width: 13px; height: 13px; }
.rbar::after { content: ""; position: absolute; left: 0; bottom: 0; height: 2px; width: var(--p, 0%); background: var(--accent); } .rbar.idle::after { display: none; }
.cats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.cat { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; min-height: 0; padding: 14px 8px 12px; background: var(--panel); border: 1px solid var(--line); box-shadow: inset 0 0 0 2px var(--panel), inset 0 0 0 3px var(--line); color: var(--text); }
.cat b { font: 700 18px/1.1 var(--font-display); letter-spacing: .04em; } .cat-p { font-size: 22px; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; } .cat small { color: var(--muted); font-size: 11px; text-align: center; }
.cat-bar { align-self: stretch; height: 3px; background: var(--line); margin: 2px 6px; } .cat-bar i { display: block; height: 100%; background: var(--accent); }
.cat.lock { opacity: .6; } .cat.lock .cat-p { color: var(--muted); font-size: 16px; }
.catx { width: 66px; height: 66px; color: var(--accent); }
.hx { fill: #232A3D; stroke: #4A5675; stroke-width: 2; } .hx2 { fill: #1B2030; stroke: none; }
.treesvg { display: block; width: 100%; height: auto; }
.tl { fill: none; stroke: #3A4561; stroke-width: 3; } .tl.on { stroke: var(--accent); }
.tn { cursor: pointer; } .tn .tni { color: #8C93A6; } .tnl { font: 700 11px var(--font-ui); fill: var(--muted); text-anchor: middle; } .tnt { font: 700 11px var(--font-ui); fill: var(--accent); text-anchor: middle; }
.tn.lock { opacity: .5; }
.tn.avail .hx { stroke: var(--accent); animation: tnglow 1.6s ease-in-out infinite; } .tn.avail .tni { color: var(--accent); } .tn.avail .tnl { fill: var(--text); }
.tn.part .hx { stroke: #B8963E; } .tn.part .tni { color: #D9A441; }
.tn.prog .hx { stroke: var(--info); stroke-width: 3; animation: tnglow 1.1s ease-in-out infinite; } .tn.prog .tni { color: #86A9E0; }
.tn.max .hx { stroke: var(--accent); fill: #3A2F18; } .tn.max .tni { color: var(--accent); } .tn.max .tnl { fill: var(--accent); }
@keyframes tnglow { 0%, 100% { stroke-width: 2; filter: drop-shadow(0 0 0 rgba(217, 164, 65, 0)); } 50% { stroke-width: 3.4; filter: drop-shadow(0 0 5px rgba(217, 164, 65, .8)); } }
.tnbig { flex: none; width: 84px; height: 84px; color: var(--accent); }
.foot-btns { display: inline-flex; gap: 8px; align-items: center; } .foot-btns button { display: inline-flex; align-items: center; gap: 5px; }
@media (prefers-reduced-motion: reduce) { .tn.avail .hx, .tn.prog .hx { animation: none; } }

/* worker list */
.hc.q5 { border-color: #D9A441; } .hc.q4 { border-color: #8A64B8; } .hc.q3 { border-color: #4A78C2; } .hc.q2 { border-color: #5C9A68; } .hc.q1 { border-color: #5C6479; }
.slots { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.sl { width: 64px; min-height: 0; padding: 0; border: 2px solid var(--line); border-radius: 2px; overflow: hidden; background: var(--panel); }
.sl .hc-art { display: block; aspect-ratio: 4 / 5; } .sl.q5 { border-color: #D9A441; } .sl.q4 { border-color: #8A64B8; } .sl.q3 { border-color: #4A78C2; } .sl.q2 { border-color: #5C9A68; }
.sl.empty { aspect-ratio: 4 / 5; height: auto; display: grid; place-items: center; border-style: dashed; color: var(--accent); font-size: 26px; background: none; }
.wd-pt { flex: none; width: 96px; aspect-ratio: 4 / 5; border: 3px solid var(--line); overflow: hidden; } .wd-pt.q5 { border-color: #D9A441; } .wd-pt.q4 { border-color: #8A64B8; } .wd-pt.q3 { border-color: #4A78C2; } .wd-pt.q2 { border-color: #5C9A68; }
.wmini { flex: none; width: 40px; aspect-ratio: 4 / 5; border: 2px solid var(--line); overflow: hidden; } .wmini.q5 { border-color: #D9A441; } .wmini.q4 { border-color: #8A64B8; } .wmini.q3 { border-color: #4A78C2; }
.wrow .sub { font-size: 11px; } .wsp { flex-wrap: wrap; overflow: visible; }
/* "POWER +N" banner */
#pwr { position: fixed; z-index: 85; left: 50%; top: calc(86px + env(safe-area-inset-top)); transform: translateX(-50%); display: flex; align-items: center; gap: 8px; padding: 6px 22px; background: linear-gradient(90deg, transparent, rgba(27, 32, 48, .96) 18%, rgba(27, 32, 48, .96) 82%, transparent); border-top: 1px solid var(--accent); border-bottom: 1px solid var(--accent); font: 700 20px/1 var(--font-display); letter-spacing: .1em; color: var(--accent); pointer-events: none; white-space: nowrap; }
#pwr[hidden] { display: none; } #pwr b { color: var(--text); font-family: var(--font-ui); letter-spacing: 0; } #pwr svg.ico { width: 22px; height: 22px; color: var(--bad); }
#pwr.go { animation: pwrin 2s ease-out forwards; }
@keyframes pwrin { 0% { opacity: 0; transform: translateX(-50%) scale(.6); } 12% { opacity: 1; transform: translateX(-50%) scale(1.08); } 20% { transform: translateX(-50%) scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: translateX(-50%) translateY(-14px); } }
@media (prefers-reduced-motion: reduce) { #pwr.go { animation-duration: 2s; animation-name: none; } }

/* construction: scaffold, builders, dust; completion: pop, burst, banner */
.scn .ghost.up { opacity: .97; }
.scn .dust { fill: #D8CBB0; opacity: 0; transform-box: fill-box; transform-origin: center; animation: dust 2.2s ease-out infinite; }
@keyframes dust { 0% { opacity: 0; transform: translate(0, 0) scale(.4); } 15% { opacity: .5; } 100% { opacity: 0; transform: translate(6px, -16px) scale(2.4); } }
.scn .hm { transform-box: fill-box; transform-origin: 0 100%; animation: hammer .8s ease-in infinite; }
@keyframes hammer { 0% { transform: rotate(-50deg); } 42% { transform: rotate(26deg); } 52% { transform: rotate(20deg); } 100% { transform: rotate(-50deg); } }
.scn .spark { opacity: 0; transform-box: fill-box; transform-origin: center; animation: spark .8s linear infinite; }
@keyframes spark { 0%, 38% { opacity: 0; transform: scale(.3); } 45% { opacity: 1; transform: scale(1.2); } 62%, 100% { opacity: 0; transform: scale(.6); } }
.scn .bld.pop { transform-box: fill-box; transform-origin: 50% 100%; animation: bpop .9s ease-out both; }
@keyframes bpop { 0% { transform: scale(.93, .86); } 30% { transform: scale(1.05, 1.1); } 60% { transform: scale(.99, .98); } 100% { transform: none; } }
.bst { position: absolute; width: 0; height: 0; pointer-events: none; }
.bst i { position: absolute; left: 0; top: 0; display: block; }
.bst-glow { width: 200px; height: 200px; margin: -100px 0 0 -100px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 232, 170, .9), rgba(217, 164, 65, .38) 40%, transparent 70%); animation: bglow .9s ease-out forwards; }
@keyframes bglow { 0% { opacity: 0; transform: scale(.2); } 25% { opacity: 1; } 100% { opacity: 0; transform: scale(1.6); } }
.bst-ring { width: 90px; height: 90px; margin: -45px 0 0 -45px; border-radius: 50%; border: 3px solid #FFE3A0; animation: bring .8s ease-out forwards; }
@keyframes bring { 0% { opacity: .9; transform: scale(.2); } 100% { opacity: 0; transform: scale(2.6); } }
.bst-ray { width: 3px; height: 74px; margin: -74px 0 0 -1.5px; transform-origin: 50% 100%; background: linear-gradient(to top, rgba(255, 227, 160, .95), transparent); opacity: 0; animation: bray .85s ease-out forwards; }
@keyframes bray { 0% { opacity: 0; transform: rotate(var(--r)) scaleY(0); } 25% { opacity: 1; transform: rotate(var(--r)) scaleY(1); } 100% { opacity: 0; transform: rotate(var(--r)) scaleY(1.5) translateY(-10px); } }
.bst-sp { width: 5px; height: 5px; margin: -2.5px 0 0 -2.5px; background: #FFE3A0; opacity: 0; animation: bsp 1.1s ease-out forwards; animation-delay: var(--d); }
@keyframes bsp { 0% { opacity: 0; transform: translate(0, 0) rotate(45deg) scale(.6); } 15% { opacity: 1; } 100% { opacity: 0; transform: translate(var(--dx), var(--dy)) rotate(225deg) scale(.4); } }
.bnr { position: absolute; transform: translate(-50%, 0); text-align: center; pointer-events: none; white-space: nowrap; animation: bnr 2.2s ease-out forwards; }
.bnr b { display: block; font: 700 22px/1 var(--font-display); letter-spacing: .14em; color: var(--accent); text-shadow: 0 2px 0 #1A1405, 0 0 14px rgba(217, 164, 65, .75); }
.bnr span { display: block; margin-top: 3px; font: 600 11px var(--font-ui); letter-spacing: .12em; text-transform: uppercase; color: var(--text); text-shadow: 0 1px 2px #000; }
@keyframes bnr { 0% { opacity: 0; transform: translate(-50%, 10px) scale(.7); } 12% { opacity: 1; transform: translate(-50%, -6px) scale(1.12); } 22% { transform: translate(-50%, -10px) scale(1); } 78% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -54px) scale(1); } }
@media (prefers-reduced-motion: reduce) { .scn .dust, .scn .hm, .scn .spark, .scn .bld.pop { animation: none; } }

/* guided start: a dimmed screen with a ring round the thing to touch (every layer ignores taps except the card) */
#guide { position: fixed; inset: 0; z-index: 88; pointer-events: none; }
#guide[hidden], #guide.hid > * { display: none !important; }   /* beats the card's own display rule: a hidden guide must not catch taps */
#guide .g-dim { position: absolute; left: 0; top: 0; width: 100%; height: 100%; display: none; }
#guide .g-ring { position: absolute; left: 0; top: 0; display: none; border: 2.5px solid var(--accent); box-shadow: 0 0 14px 1px rgba(217, 164, 65, .6); }
#guide .g-ring::after { content: ''; position: absolute; inset: -3px; border: 2px solid var(--accent); border-radius: inherit; animation: gping 1.4s ease-out infinite; }
#guide .g-arrow { position: absolute; left: 0; top: 0; display: none; width: 28px; height: 34px; }
#guide .g-arrow svg { display: block; width: 100%; height: 100%; animation: gbob .8s ease-in-out infinite; } #guide .g-arrow.dn svg { transform: rotate(180deg); animation-name: gbobd; }
#guide.lit .g-dim, #guide.lit .g-ring, #guide.lit .g-arrow { display: block; }
#guide .g-edge { position: absolute; left: 0; top: 0; display: none; width: 44px; height: 44px; padding: 0; border-radius: 50%; border: 2px solid var(--accent); background: rgba(18, 21, 29, .9); pointer-events: auto; animation: gping 1.4s ease-out infinite; }
#guide .g-edge svg { display: block; width: 100%; height: 100%; }
#guide.away .g-edge { display: block; }
#guide .g-card { position: absolute; left: 10px; right: 10px; bottom: calc(118px + env(safe-area-inset-bottom)); max-width: 460px; margin: 0 auto; display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; pointer-events: auto;
  background: rgba(27, 32, 48, .97); border: 1px solid var(--accent); box-shadow: 0 0 0 3px rgba(18, 21, 29, .9), 0 8px 24px rgba(0, 0, 0, .6); }
#guide .g-card.top { bottom: auto; top: calc(74px + env(safe-area-inset-top)); }
#guide .g-card.pop { animation: gcard .3s ease-out; }
#guide .g-av { flex: none; width: 44px; height: 44px; display: grid; place-items: center; background: var(--bg); border: 2px solid var(--accent); color: var(--accent); }
#guide .g-av svg.ico { width: 26px; height: 26px; }
#guide .g-tx { flex: 1; min-width: 0; }
#guide .g-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
#guide .g-head b { font: 700 14px/1 var(--font-display); letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
#guide .g-n { font: 600 10px var(--font-ui); letter-spacing: .06em; color: var(--muted); }
#guide .g-tx p { margin: 4px 0 0; font: 500 14px/1.35 var(--font-ui); color: var(--text); }
#guide .g-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 6px; min-height: 20px; }
#guide .g-go { min-height: 36px; padding: 6px 18px; }
#guide .g-skip { margin-left: auto; padding: 12px 10px; min-height: 40px; background: none; border: 0; color: var(--muted); font: 600 11px var(--font-ui); letter-spacing: .04em; text-decoration: underline; text-underline-offset: 2px; }
@keyframes gping { 0% { opacity: .8; transform: scale(1); } 100% { opacity: 0; transform: scale(1.28); } }
@keyframes gbob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(6px); } }
@keyframes gbobd { 0%, 100% { transform: rotate(180deg) translateY(0); } 50% { transform: rotate(180deg) translateY(6px); } }
@keyframes gcard { 0% { opacity: 0; transform: translateY(8px); } 100% { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { #guide .g-ring::after, #guide .g-arrow svg, #guide .g-edge, #guide .g-card.pop { animation: none; } }

/* the island grows: the next stage is a pale shoal with a sign; newly opened land rises in */
.scn .land { cursor: pointer; } .scn .land text { fill: var(--text); }
.scn .newland { animation: landin 1.3s ease-out both; }
@keyframes landin { 0% { opacity: 0; transform: translateY(18px); } 100% { opacity: 1; transform: none; } }
.lbn { position: fixed; z-index: 86; left: 50%; top: calc(150px + env(safe-area-inset-top)); transform: translateX(-50%); text-align: center; pointer-events: none; white-space: nowrap; animation: lbn 3.4s ease-out forwards; }
.lbn small { display: block; font: 600 11px var(--font-ui); letter-spacing: .24em; color: var(--text); text-shadow: 0 1px 3px #000; }
.lbn b { display: block; margin-top: 4px; font: 700 30px/1 var(--font-display); letter-spacing: .1em; color: var(--accent); text-shadow: 0 2px 0 #1A1405, 0 0 18px rgba(217, 164, 65, .75); }
@keyframes lbn { 0% { opacity: 0; transform: translate(-50%, 12px) scale(.8); } 10% { opacity: 1; transform: translate(-50%, 0) scale(1.06); } 18% { transform: translate(-50%, 0) scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -16px); } }
@media (prefers-reduced-motion: reduce) { .scn .newland { animation: none; } }

/* plot names (collision-checked pills in one layer), buildable plots, sounds toggles */
.scn .plb rect { fill: rgba(14, 17, 26, .6); } .scn .plb.lk rect { fill: rgba(14, 17, 26, .42); }
.scn .ghost.ok { opacity: .46; }
.scn .lotglow { fill: rgba(217, 164, 65, .12); stroke: #D9A441; stroke-width: 1.4; stroke-linejoin: round; pointer-events: none; animation: lotp 2.2s ease-in-out infinite; }
@keyframes lotp { 0%, 100% { stroke-opacity: .3; fill-opacity: .4; } 50% { stroke-opacity: 1; fill-opacity: 1; } }
.scn .plus.ok { transform-box: fill-box; transform-origin: center; animation: plusp 1.8s ease-in-out infinite; }
@keyframes plusp { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.14); } }
@media (prefers-reduced-motion: reduce) { .scn .lotglow, .scn .plus.ok { animation: none; } }
/* the realm in the wilderness: a survey line round the next stage, trees that fall away when land opens, the sign to the World */
.scn .survey { fill: rgba(232, 214, 160, .1); stroke: #E8D6A0; stroke-opacity: .8; stroke-width: 2; stroke-dasharray: 8 6; stroke-linejoin: round; pointer-events: none; }
.scn .wildout { transform-box: fill-box; transform-origin: 50% 100%; animation: wildout 1.1s ease-in both; }
@keyframes wildout { 0% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateY(12px) scale(.55); } }
.scn .world { cursor: pointer; } .scn .world text { fill: var(--text); }
@media (prefers-reduced-motion: reduce) { .scn .wildout { animation-duration: .01s; } }

/* world: search, found target, rallies */
.lvrow { display: flex; align-items: center; gap: 8px; margin: 8px 0; } .lvrow input[type=range] { flex: 1; min-width: 0; accent-color: var(--accent); }
.lvrow button { min-width: 40px; min-height: 40px; padding: 0; font-size: 20px; } .lvnum { min-width: 52px; text-align: right; color: var(--accent); }
.card.found { border-color: var(--accent); }
.dots { display: flex; gap: 4px; align-items: center; } .dots i { width: 10px; height: 10px; border: 1.5px solid var(--accent); transform: rotate(45deg); } .dots i.on { background: var(--accent); }

/* world map */
#tab-world.panel { padding: 0; overflow: hidden; background: #0C0E14; z-index: 18; }
body[data-panel="world"] #panel-bar, body[data-panel="world"] #panel-back { display: none; }
#wm-cv { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; -webkit-user-select: none; user-select: none; }
#wm-pos { position: absolute; z-index: 4; top: 10px; left: 50%; transform: translateX(-50%); display: flex; gap: 12px; min-height: 34px; padding: 4px 14px; align-items: center; background: rgba(27, 32, 48, .93); border: 1px solid var(--accent); font: 600 13px/1 var(--font-ui); color: var(--muted); }
#wm-pos b { color: var(--text); font-variant-numeric: tabular-nums; }
#wm-l { left: 8px; top: 10px; z-index: 4; }
#wm-mch { display: flex; flex-direction: column; gap: 6px; pointer-events: none; }
.mch { pointer-events: auto; position: relative; width: 136px; min-height: 0; padding: 5px 8px 9px; display: block; text-align: left; background: rgba(27, 32, 48, .93); border: 1px solid #8A7336; border-radius: 2px; box-shadow: 0 2px 6px rgba(0, 0, 0, .35); }
.mch .mt { display: flex; gap: 6px; align-items: baseline; font: 600 11px/1.2 var(--font-ui); color: var(--text); white-space: nowrap; } .mch .mt u { text-decoration: none; color: var(--accent); font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.mch .mc { display: block; font: 600 12px/1.3 var(--font-ui); font-variant-numeric: tabular-nums; color: var(--muted); }
.mch .mb { position: absolute; left: 6px; right: 6px; bottom: 3px; height: 2px; background: var(--line); } .mch .mb u { display: block; height: 100%; width: 0; background: var(--accent); }
#wm-r { top: 58px; bottom: auto; right: 8px; z-index: 4; }
#wm-mini { position: absolute; z-index: 4; right: 8px; top: 252px; width: 120px; height: 120px; border: 1px solid var(--accent); box-shadow: 0 2px 8px rgba(0, 0, 0, .5); touch-action: none; background: #0C0E14; }
#wm-mini[hidden] { display: none; }
#wm-card { position: absolute; z-index: 5; left: 8px; right: 8px; bottom: calc(92px + env(safe-area-inset-bottom)); max-height: 60%; overflow-y: auto; }
.wmc { position: relative; padding: 10px 12px 12px; background: rgba(27, 32, 48, .97); border: 1px solid var(--accent); box-shadow: inset 0 0 0 2px rgba(27, 32, 48, .97), inset 0 0 0 3px #6B5A2E, 0 4px 14px rgba(0, 0, 0, .5); }
.wmc-x { position: absolute; top: 2px; right: 2px; width: 34px; min-height: 34px; padding: 0; background: none; border: 0; z-index: 1; }
.wmc-h { display: flex; gap: 10px; align-items: center; padding-right: 30px; }
.wmc-h img { width: 56px; height: 56px; flex: none; border: 1px solid var(--line); background: #35602F; }
.wmc-h h3 { margin: 0; font: 700 19px/1.1 var(--font-display); letter-spacing: .04em; } .wmc-h .sub { margin-top: 2px; }
.wmc-star { flex: none; width: 38px; min-height: 38px; padding: 0; font-size: 24px; line-height: 1; background: none; border: 0; color: var(--muted); } .wmc-star.fav { color: var(--accent); }
.wmc-r { margin-top: 7px; font-size: 13px; } .wmc-r .k { color: var(--muted); margin-right: 4px; } .wmc-r b.ok { color: var(--ok); } .wmc-r b.bad { color: var(--bad); }
.wmc-r .tag { display: inline-block; padding: 0 5px; border: 1px solid var(--line); font-size: 12px; font-weight: 600; }
.wmc-m { margin-top: 7px; display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; font-size: 12px; color: var(--muted); } .wmc-m svg.ico { width: 14px; height: 14px; vertical-align: -2px; }
.wmc-b { margin-top: 10px; display: flex; justify-content: center; }
.wmc-dots { margin-top: 8px; }
.wm-flag { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 30px; background: linear-gradient(180deg, #E3B655, #C48F2E); color: var(--on-accent); border: 1px solid #F2D26B; font: 700 17px/1 var(--font-display); letter-spacing: .08em; text-transform: uppercase; }
.wm-flag svg.ico { width: 22px; height: 22px; } .wm-flag:disabled { opacity: .5; }
.wm-disp { margin-top: 10px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.wm-sqs { display: flex; align-items: center; gap: 6px; } .wm-sqs .sub { margin-right: 4px; }
.wm-sqs button { width: 40px; min-height: 40px; padding: 0; } .wm-sqs button.on { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.wm-heroes { display: flex; gap: 6px; align-items: center; min-width: 0; }
.wm-hp { width: 44px; height: 56px; flex: none; padding: 0; overflow: hidden; border: 1px solid var(--accent); background: var(--panel2); }
.wm-hp.empty { display: grid; place-items: center; border: 1px dashed var(--line); font-size: 22px; color: var(--muted); }
.wm-tr { margin-left: auto; } .wm-q { display: flex; gap: 4px; align-items: center; margin-top: 3px; } .wm-q input { width: 58px; min-height: 38px; padding: 0 4px; text-align: center; } .wm-q button { min-width: 34px; min-height: 38px; padding: 0 6px; }
.wm-go { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.wm-st { display: flex; align-items: center; gap: 5px; font-size: 16px; } .wm-st svg.ico { width: 20px; height: 20px; } .wm-st i { font-style: normal; color: var(--bad); font-weight: 700; } .wm-st.low b { color: var(--bad); }
.wm-march { min-height: 46px; padding: 0 24px; font-size: 16px; flex: 1; max-width: 220px; } .wm-why { color: var(--bad); }
.wm-bar { position: absolute; z-index: 4; left: 8px; right: 8px; bottom: calc(10px + env(safe-area-inset-bottom)); display: flex; justify-content: space-between; pointer-events: none; } .wm-bar .big { pointer-events: auto; }
#wm-sheet { position: absolute; z-index: 7; left: 0; right: 0; bottom: 0; max-height: 78%; overflow-y: auto; padding: 8px 14px calc(18px + env(safe-area-inset-bottom)); background: var(--bg); border-top: 1px solid var(--accent); box-shadow: 0 -6px 20px rgba(0, 0, 0, .5); -webkit-overflow-scrolling: touch; }
#wm-sheet[hidden] { display: none; }
.wm-sh-bar { position: sticky; top: -8px; z-index: 1; display: flex; align-items: center; justify-content: space-between; margin: -8px -14px 6px; padding: 8px 8px 8px 14px; background: var(--panel); border-bottom: 1px solid var(--line); font: 700 19px/1 var(--font-display); letter-spacing: .1em; text-transform: uppercase; }
.wm-sh-bar button { width: 38px; min-height: 38px; padding: 0; background: none; border: 0; }
.wm-xy { display: flex; gap: 10px; align-items: flex-end; } .wm-xy label { flex: 1; display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); } .wm-xy input { width: 100%; }
#wm-find { margin-top: 10px; }

/* social screens: alliance hub, shop, chat */
.crest { width: 64px; height: 68px; flex: none; } .crest.sm { width: 28px; height: 30px; }
.avt { width: 38px; height: 38px; flex: none; } .chest { width: 40px; height: 36px; flex: none; }
.mrow { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; margin: 0 0 6px; background: var(--panel); border: 1px solid var(--line); text-align: left; color: var(--text); }
.mrow.me { border-color: var(--accent); background: var(--panel2); } .mrow .grow { min-width: 0; flex: 1; } .mrow b { font-weight: 600; } .mrow button { flex: none; min-height: 40px; min-width: 40px; }
.mrow button svg.ico { width: 18px; height: 18px; vertical-align: -3px; }
.rk { display: inline-block; padding: 0 5px; border: 1px solid var(--line); color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .04em; vertical-align: 1px; }
.no { width: 26px; flex: none; text-align: center; color: var(--accent); font-family: var(--font-display); font-size: 19px; }
.tbd { font-style: normal; background: var(--accent); color: var(--on-accent); padding: 0 6px; font-size: 11px; font-weight: 700; margin-left: 4px; border-radius: 9px; }
.rec { padding: 9px 4px; border-bottom: 1px solid var(--line); font-size: 14px; } .rec .sub { display: block; font-size: 12px; }
.ah-head { display: flex; gap: 14px; align-items: center; padding: 12px; background: var(--panel); border: 1px solid var(--accent); box-shadow: inset 0 0 0 2px var(--panel), inset 0 0 0 3px #6B5A2E; }
.ah-crest .crest { width: 72px; height: 76px; } .ah-info { min-width: 0; }
.ah-info h2 { margin: 0; font: 700 22px/1.1 var(--font-display); letter-spacing: .04em; } .tag { color: var(--accent); }
.ah-stars { color: var(--accent); font-size: 15px; letter-spacing: 2px; margin: 3px 0; } .ah-stars i { font-style: normal; color: var(--line); }
.ah-kv { display: flex; flex-wrap: wrap; gap: 2px 12px; font-size: 12px; color: var(--muted); } .ah-kv b { color: var(--text); font-weight: 600; }
.ah-desc { margin: 10px 0; padding: 10px 12px; font-size: 13px; font-style: italic; color: var(--muted); background: rgba(35, 42, 61, .6); border-left: 3px solid var(--accent); }
.ah-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.ah-b { position: relative; display: flex; align-items: center; gap: 10px; min-height: 54px; padding: 8px 12px; text-align: left; font: 600 14px/1.15 var(--font-ui); }
.ah-b svg.ico { width: 26px; height: 26px; color: var(--accent); flex: none; }
.ah-foot { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.ah-foot button { position: relative; display: flex; gap: 6px; align-items: center; justify-content: center; font-size: 13px; padding: 0 6px; } .ah-foot svg.ico { width: 18px; height: 18px; }
.gl .bar { margin-top: 8px; } textarea { width: 100%; line-height: 1.4; resize: vertical; }
#bnr { position: fixed; z-index: 70; left: 0; right: 0; top: 22%; display: flex; justify-content: center; pointer-events: none; }
#bnr[hidden] { display: none; }
#bnr .bn-in { min-width: 62%; max-width: 94%; padding: 12px 30px 14px; text-align: center; background: linear-gradient(180deg, #E3B655, #B98626); color: var(--on-accent); clip-path: polygon(0 0, 100% 0, 96% 50%, 100% 100%, 0 100%, 4% 50%); filter: drop-shadow(0 6px 14px rgba(0, 0, 0, .5)); }
#bnr b { display: block; font: 700 26px/1.1 var(--font-display); letter-spacing: .1em; text-transform: uppercase; }
#bnr .bn-in div { font-size: 13px; font-weight: 600; margin-top: 5px; } #bnr svg.ico { width: 15px; height: 15px; vertical-align: -3px; color: var(--on-accent); }
#bnr.go .bn-in { animation: bnin 2.8s ease both; }
@keyframes bnin { 0% { opacity: 0; transform: scale(.6); } 10% { opacity: 1; transform: scale(1.06); } 18% { transform: scale(1); } 86% { opacity: 1; } 100% { opacity: 0; transform: translateY(-14px); } }
.sh-top { display: flex; gap: 10px; margin-bottom: 10px; } .sh-cur { display: flex; align-items: center; gap: 6px; padding: 6px 10px; background: var(--panel); border: 1px solid var(--line); font-size: 15px; } .sh-cur small { color: var(--muted); font-size: 11px; }
.sh-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 10px 0; }
.sh-item { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 4px; min-height: 0; text-align: center; }
.sh-ic { position: relative; display: grid; place-items: center; width: 56px; height: 56px; background: var(--panel2); border: 1px solid var(--line); } .sh-ic svg.ico { width: 30px; height: 30px; color: var(--accent); }
.sh-q { position: absolute; right: 3px; bottom: 2px; font: 700 11px/1 var(--font-ui); font-style: normal; color: var(--text); text-shadow: 0 1px 2px #000; }
.sh-n { font: 600 12px/1.15 var(--font-ui); min-height: 28px; display: flex; align-items: center; }
.sh-pr { display: flex; gap: 4px; align-items: center; font-size: 13px; font-weight: 600; } .sh-pr.short { color: var(--bad); } .sh-pr svg.ico { width: 14px; height: 14px; }
.sh-st { font-size: 11px; color: var(--muted); } .sh-item.out { opacity: .5; }
.sh-foot { text-align: center; color: var(--muted); font-size: 13px; padding: 8px 0 4px; }
.sh-big { display: grid; place-items: center; position: relative; width: 84px; height: 84px; margin: 6px auto 8px; background: var(--panel2); border: 1px solid var(--accent); } .sh-big svg.ico { width: 44px; height: 44px; color: var(--accent); }
.sh-qty { justify-content: center; margin: 10px 0; }
#tab-chat.panel { padding: 56px 0 0; overflow: hidden; }
#tab-chat.panel.active { display: flex; flex-direction: column; }
body[data-panel="chat"] #panel-back { display: none; }
#ch-tabs, #ch-sub { margin: 0 12px 6px; flex: none; } #ch-sub[hidden] { display: none; }
#ch-list { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 12px 10px; -webkit-overflow-scrolling: touch; }
#ch-form { flex: none; display: flex; gap: 8px; padding: 8px 12px calc(10px + env(safe-area-inset-bottom)); background: var(--panel); border-top: 1px solid var(--line); } #ch-form[hidden] { display: none; } #ch-form input { flex: 1; min-width: 0; }
.cm { display: flex; gap: 8px; align-items: flex-end; margin: 7px 0; } .cm.me { justify-content: flex-end; }
.cbub { max-width: 78%; padding: 7px 10px 8px; background: var(--panel); border: 1px solid var(--line); font-size: 14px; overflow-wrap: anywhere; } .cm.me .cbub { background: #3A3118; border-color: #8A7336; }
.cn { font-size: 11px; color: var(--muted); font-weight: 600; margin-bottom: 1px; } .cn em { font-style: normal; color: var(--accent); } .cn small { font-weight: 400; margin-left: 6px; }
.cm.sys { justify-content: center; } .cm.sys span { font-size: 12px; color: var(--muted); background: rgba(35, 42, 61, .7); padding: 3px 12px; border-radius: 10px; text-align: center; }
.pml { cursor: pointer; } .pmh { display: flex; gap: 8px; align-items: center; margin: 2px 0 6px; padding: 6px 10px; } .pmh svg.ico { width: 18px; height: 18px; }
.ch-notice { white-space: pre-wrap; margin: 6px 0 4px; }
#h-chat { position: absolute; z-index: 3; left: 8px; right: 62px; bottom: calc(88px + env(safe-area-inset-bottom)); display: flex; align-items: center; gap: 8px; min-height: 34px; padding: 4px 10px; text-align: left; background: rgba(27, 32, 48, .93); border: 1px solid var(--line); font-size: 12px; color: var(--text); box-shadow: 0 2px 6px rgba(0, 0, 0, .35); }
#h-chat svg.ico { width: 16px; height: 16px; flex: none; color: var(--accent); } #h-chat span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* home buttons, header cart */
#top { grid-template-columns: auto repeat(3, minmax(0, 1fr)) auto; }
.cart { display: flex; align-items: center; gap: 4px; min-height: 38px; padding: 4px 8px; background: linear-gradient(180deg, #2A3248, #1B2030); border: 1px solid var(--accent); } .cart svg.ico { width: 20px; height: 20px; color: var(--accent); } .cart b { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
#hud-r { gap: 7px; } .hbtn.sm { width: 46px; min-height: 46px; padding: 3px 1px 4px; gap: 1px; } .hbtn.sm svg.ico { width: 19px; height: 19px; } .hbtn.sm > span { font-size: 9px; line-height: 1.1; }
.hbtn .ic2 { display: grid; place-items: center; } .hbtn .ic2 .ico2 { width: 27px; height: 27px; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .5)); }
@media (max-height: 740px) { #z-in, #z-out { display: none; } }
.ico2 { display: inline-block; vertical-align: middle; flex: none; width: 24px; height: 24px; } button > .ico2, .gd-act .ico2 { width: 20px; height: 20px; }
/* rewards */
.rw-grid { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 2px; } .rw-grid.lg .rw { width: 72px; }
.rw { display: flex; flex-direction: column; align-items: center; width: 62px; padding: 6px 2px 4px; background: rgba(27, 32, 48, .92); border: 1px solid var(--line); color: var(--text); } .rw .ico2 { width: 34px; height: 34px; } .rw b { font-size: 13px; } .rw small { font-size: 9px; color: var(--muted); text-align: center; line-height: 1.1; }
.rwi { display: inline-flex; align-items: center; gap: 3px; margin-right: 8px; } .rwi .ico2 { width: 16px; height: 16px; }
/* mail */
.ml-row { position: relative; display: flex; align-items: center; gap: 10px; padding: 8px 6px 8px 14px; margin-bottom: 6px; background: var(--panel); border: 1px solid var(--line); cursor: pointer; }
.ml-row.unread { border-color: #8A7336; background: linear-gradient(90deg, #2E2916, var(--panel) 45%); }
.ml-row > .ico2 { width: 42px; height: 42px; } .ml-tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; } .ml-tx b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .ml-row:not(.unread) .ml-tx b { font-weight: 500; color: var(--muted); }
.ml-att { display: flex; flex-wrap: wrap; margin-top: 2px; font-size: 12px; }
.ml-star { flex: none; min-height: 36px; min-width: 36px; padding: 0; background: none; border: 0; font-size: 20px; color: var(--muted); } .ml-star.fav { color: var(--accent); }
.ml-dot { position: absolute; top: 9px; left: 5px; width: 8px; height: 8px; border-radius: 50%; background: var(--bad); }
.ml-foot { position: sticky; bottom: -80px; display: flex; gap: 8px; padding: 8px 0; background: var(--bg); } .ml-foot button { flex: 1; padding: 8px 4px; font-size: 13px; }
.ml-empty { text-align: center; padding: 30px 10px; } .ml-empty .ico2 { width: 64px; height: 64px; opacity: .6; }
.ml-paper { position: relative; padding: 18px 16px 16px; background: linear-gradient(180deg, #F1E4C4, #DCC9A0); color: #2B2110; border: 1px solid #8A7336; box-shadow: 0 6px 18px rgba(0, 0, 0, .5), inset 0 0 40px rgba(120, 90, 30, .2); }
.ml-paper h2 { font: 700 24px/1.15 var(--font-display); letter-spacing: .03em; margin: 0 46px 4px 0; } .ml-paper .sub { color: #6B5A30; } .ml-paper p { margin: 10px 0; font-size: 15px; line-height: 1.45; }
.ml-seal { position: absolute; top: 10px; right: 10px; } .ml-seal .ico2 { width: 38px; height: 38px; }
.ml-rule { height: 2px; margin: 10px 0; background: linear-gradient(90deg, transparent, #8A7336, transparent); }
.ml-act { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; } .ml-act button { flex: 1; }
/* events */
.ev-card { position: relative; display: block; width: 100%; padding: 0; margin-bottom: 10px; text-align: left; border: 1px solid #8A7336; background: var(--panel); overflow: hidden; box-shadow: 0 3px 10px rgba(0, 0, 0, .4); }
.ev-art { display: block; } .banner-art { display: block; width: 100%; height: auto; aspect-ratio: 300 / 110; }
.ev-tx { position: absolute; left: 0; right: 0; bottom: 0; padding: 26px 12px 8px; background: linear-gradient(0deg, rgba(18, 21, 29, .95), rgba(18, 21, 29, 0)); display: flex; flex-direction: column; } .ev-tx b { font: 700 20px/1.1 var(--font-display); letter-spacing: .05em; } .ev-tx small { color: var(--muted); font-size: 12px; }
.ev-t { display: inline-flex; gap: 4px; align-items: center; padding: 2px 8px; background: rgba(18, 21, 29, .85); border: 1px solid var(--line); font-size: 12px; font-weight: 600; } .ev-t svg.ico { width: 13px; height: 13px; }
.ev-card > .ev-t { position: absolute; top: 8px; left: 8px; }
.ev-head { position: relative; margin-bottom: 10px; border: 1px solid #8A7336; overflow: hidden; } .ev-ttl { position: absolute; left: 0; right: 0; bottom: 0; padding: 26px 12px 8px; background: linear-gradient(0deg, rgba(18, 21, 29, .95), rgba(18, 21, 29, 0)); } .ev-ttl h2 { margin: 0 0 4px; font: 700 24px/1.1 var(--font-display); letter-spacing: .05em; }
.dbar { padding: 10px 12px 28px; background: var(--panel); border: 1px solid var(--line); } .dpts { font-size: 13px; color: var(--muted); } .dpts b { font: 700 26px var(--font-display); color: var(--accent); }
.dtrack { position: relative; height: 10px; margin: 36px 6px 0 4px; background: var(--line); border-radius: 5px; } .dtrack > i { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(90deg, #C98E3A, #F2D26B); border-radius: 5px; }
.dc { position: absolute; top: -40px; width: 44px; min-height: 0; padding: 0; transform: translateX(-100%); background: none; border: 0; display: flex; flex-direction: column; align-items: center; }
.dc .ico2 { width: 38px; height: 38px; filter: grayscale(.7) brightness(.75); } .dc.ready .ico2 { filter: none; animation: dcb .8s ease-in-out infinite alternate; } .dc.done .ico2 { filter: grayscale(.3) brightness(.6); }
.dc small { position: absolute; top: 52px; font-size: 11px; color: var(--muted); } .dc .ck { position: absolute; top: 14px; font-style: normal; color: var(--ok); font-weight: 700; font-size: 20px; text-shadow: 0 1px 3px #000; } .dc .lk { position: absolute; top: 16px; font-style: normal; font-size: 9px; background: var(--bad); color: #fff; padding: 0 3px; }
@keyframes dcb { to { transform: translateX(-100%) translateY(-4px); } }
.dnote { margin: 8px 0; } .dt { display: flex; align-items: center; gap: 10px; padding: 8px 10px; margin-bottom: 6px; background: var(--panel); border: 1px solid var(--line); } .dt.ok { border-color: var(--ok); } .dt .grow { flex: 1; min-width: 0; } .dt .bar { margin-top: 5px; } .ok-ck svg { width: 26px; height: 26px; color: var(--ok); }
.lgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 10px; } .lc { position: relative; padding: 6px 2px; background: var(--panel); border: 1px solid var(--line); text-align: center; } .lc > b { font-size: 12px; color: var(--muted); }
.lc .rw-grid { justify-content: center; gap: 2px; margin: 4px 0 0; } .lc .rw { width: 42px; padding: 2px; } .lc .rw small { display: none; } .lc .rw .ico2 { width: 24px; height: 24px; } .lc .rw b { font-size: 11px; }
.lc.today { border-color: var(--accent); box-shadow: 0 0 14px rgba(217, 164, 65, .5); } .lc.done { opacity: .55; } .lc .ck { position: absolute; right: 4px; top: 2px; color: var(--ok); font-style: normal; font-weight: 700; } .lc.wide { grid-column: span 2; }
/* hot deals */
.dl { margin-bottom: 10px; background: linear-gradient(180deg, #3A2A12, #2A1E0C); border: 2px solid #E8A33A; box-shadow: 0 4px 16px rgba(0, 0, 0, .5); }
.dl-top { position: relative; display: flex; min-height: 156px; background: linear-gradient(135deg, #FFB347, #E8691E 55%, #B83A12); overflow: hidden; }
.dl-ttl { position: relative; z-index: 1; width: 54%; padding: 12px 10px; } .dl-ttl h2 { margin: 0; font: 700 22px/1.05 var(--font-display); letter-spacing: .03em; color: #fff; text-shadow: 0 2px 0 rgba(0, 0, 0, .4); } .dl-ttl .sub { display: block; color: #FFE7C2; margin-top: 4px; font-size: 12px; }
.dl-t { display: inline-flex; gap: 4px; align-items: center; margin-top: 8px; padding: 2px 8px; background: rgba(18, 21, 29, .8); color: #fff; font-size: 12px; font-weight: 600; } .dl-t svg.ico { width: 13px; height: 13px; }
.dl-hero { position: absolute; right: 0; top: 0; bottom: 0; width: 48%; } .dl-hero .pt { height: 100%; } .dl-scene { position: absolute; right: 0; top: 0; bottom: 0; width: 56%; } .dl-scene .banner-art { height: 100%; width: 100%; aspect-ratio: auto; }
.dl-rib { position: absolute; right: 0; bottom: 8px; z-index: 2; padding: 3px 14px 3px 22px; background: linear-gradient(180deg, #E0584F, #A41E18); color: #fff; font: 700 20px/1.2 var(--font-display); clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 10px 50%); }
.dl-rows { margin: 10px; padding: 4px; background: rgba(18, 21, 29, .55); border: 1px solid #8A5A12; } .dl-row { display: flex; align-items: center; gap: 10px; padding: 5px 8px; border-bottom: 1px solid rgba(255, 255, 255, .08); } .dl-row:last-child { border: 0; } .dl-row .ico2 { width: 30px; height: 30px; } .dl-row b { flex: 1; font-size: 14px; } .dl-row span { font-weight: 700; color: #FFE58A; }
.dl-avail { text-align: center; font-size: 13px; color: #FFE7C2; margin-top: 4px; }
.dl-buy { display: flex; align-items: center; justify-content: center; gap: 8px; width: calc(100% - 20px); margin: 6px 10px 12px; min-height: 48px; background: linear-gradient(180deg, #FFE58A, #E8A21E); border: 1px solid #FFF3B0; color: #2B1A05; font: 700 20px/1 var(--font-display); letter-spacing: .06em; box-shadow: 0 3px 0 #8A5A12, 0 6px 14px rgba(0, 0, 0, .4); } .dl-buy .ico2 { width: 26px; height: 26px; } .dl-buy.off { opacity: .5; }
.dl-tabs { display: flex; gap: 8px; } .dl-t3 { position: relative; flex: 1; padding: 3px; min-height: 0; display: flex; flex-direction: column; gap: 3px; background: #3A2A12; border: 2px solid #8A5A12; color: var(--text); } .dl-t3.on { border-color: #FFE58A; background: #5A3A12; color: var(--text); font-weight: 400; }
.dl-mini { display: block; height: 52px; overflow: hidden; } .dl-mini .pt, .dl-mini .banner-art { height: 100%; width: 100%; aspect-ratio: auto; } .dl-t3 small { font-size: 10px; line-height: 1.1; padding-bottom: 2px; }
.hd-tabs button { padding-left: 2px; padding-right: 2px; white-space: nowrap; } .hd-tabs .tbd { margin-left: 3px; padding: 0 5px; }

/* hero detail */
.hd2 { --rc: #A97BE0; --rc2: #6A3FB0; --rc3: #26124A; margin: -4px -2px 0; }
.hd2.UR { --rc: #E8A33A; --rc2: #7A3A5A; --rc3: #2A1030; } .hd2.SR { --rc: #5C8FE0; --rc2: #2F5AA8; --rc3: #101E40; }
.hd2-stage { position: relative; height: min(104vw, 430px); overflow: hidden; border: 2px solid var(--rc); background: radial-gradient(120% 90% at 50% 30%, var(--rc2), var(--rc3) 72%); box-shadow: inset 0 0 50px rgba(0, 0, 0, .55); }
.hd2-rays { position: absolute; inset: -40%; background: repeating-conic-gradient(from 0deg at 50% 40%, rgba(255, 255, 255, .08) 0 6deg, transparent 6deg 16deg); animation: hd2spin 60s linear infinite; }
@keyframes hd2spin { to { transform: rotate(360deg); } } @media (prefers-reduced-motion: reduce) { .hd2-rays { animation: none; } }
.hd2-art { position: absolute; inset: 0; } .hd2-art .pt { width: 100%; height: 100%; }
.hd2-top { position: absolute; left: 10px; top: 6px; right: 10px; z-index: 3; pointer-events: none; display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; }
.rar-glyph { height: 38px; width: auto; flex: none; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .55)); }
.hd2-name { display: flex; flex-direction: column; min-width: 0; } .hd2-name b { font: 700 22px/1.05 var(--font-display); letter-spacing: .04em; text-shadow: 0 2px 4px rgba(0, 0, 0, .8); } .hd2-name span { font-size: 12px; color: #E9E4D6; text-shadow: 0 1px 3px #000; }
.hd2-badges { flex-basis: 100%; display: flex; gap: 6px; } .hd2-badges i { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: rgba(18, 21, 29, .7); border: 1px solid var(--rc); } .hd2-badges svg.ico { width: 14px; height: 14px; color: #fff; }
.eq { position: absolute; z-index: 3; width: 58px; height: 58px; min-height: 0; padding: 0; background: none; border: 0; filter: drop-shadow(0 3px 5px rgba(0, 0, 0, .55)); }
.eq .ico2 { width: 100%; height: 100%; display: block; } .eq.s0 { left: 10px; top: 112px; } .eq.s1 { right: 10px; top: 112px; } .eq.s2 { left: 10px; top: 186px; } .eq.s3 { right: 10px; top: 186px; }
.eq.empty { background: rgba(18, 21, 29, .55); border: 1px solid rgba(255, 255, 255, .22); border-radius: 8px; } .eq .ghost { display: block; width: 100%; height: 100%; opacity: .22; filter: grayscale(1); } .eq .ghost .ico2 { padding: 6px; }
.eq .lvb { position: absolute; right: 2px; bottom: 1px; font: 700 11px/1 var(--font-ui); font-style: normal; color: #fff; text-shadow: 0 1px 2px #000, 0 0 3px #000; }
.eq .rd, .hd2-tabs .rd { position: absolute; top: -3px; right: -3px; width: 12px; height: 12px; border-radius: 50%; background: #E0443B; border: 2px solid #fff; }
.eq.sk.sel .ico2 { outline: 3px solid #FFE58A; outline-offset: 1px; border-radius: 10px; box-shadow: 0 0 16px rgba(255, 229, 138, .8); } .eq.sk.lock .ico2 { filter: grayscale(.8) brightness(.6); } .eq .lk { position: absolute; inset: 0; display: grid; place-items: center; font-style: normal; } .eq .lk svg.ico { width: 22px; height: 22px; color: #fff; }
.hd2-eqall { position: absolute; z-index: 3; left: 50%; bottom: 64px; transform: translateX(-50%); min-height: 32px; padding: 3px 16px; background: linear-gradient(180deg, #7FE0E0, #2F9AA8); border: 1px solid #CFFFFF; color: #052A2E; font: 700 14px/1 var(--font-ui); border-radius: 14px; clip-path: none; box-shadow: 0 2px 0 #145A66; }
.hd2-power { position: absolute; z-index: 3; left: 0; right: 0; bottom: 8px; display: flex; justify-content: center; align-items: center; gap: 8px; font: 700 34px/1 var(--font-display); color: #FFE9A8; text-shadow: 0 2px 0 #3A1A00, 0 0 14px rgba(255, 200, 80, .65); letter-spacing: .02em; }
.hd2-power .pwr { width: 30px; height: 30px; } .hd2-i { width: 20px; min-height: 0; height: 20px; padding: 0; border-radius: 50%; font: 700 12px/1 var(--font-ui); background: rgba(255, 255, 255, .85); color: #26124A; border: 0; }
.hd2-power.gain::after { content: attr(data-gain); position: absolute; right: 18%; top: -20px; font-size: 22px; color: #9CFF8A; animation: hd2g 1.6s ease-out both; } @keyframes hd2g { 0% { opacity: 0; transform: translateY(10px); } 15% { opacity: 1; } 100% { opacity: 0; transform: translateY(-26px); } }
.hd2-lv { display: flex; align-items: center; justify-content: center; gap: 26px; padding: 8px 0 6px; } .hd2-lv b { min-width: 110px; text-align: center; font: 700 28px/1 var(--font-display); } .hd2-lv button { width: 40px; min-height: 40px; padding: 0; border-radius: 50%; } .hd2-lv button.r svg, .hd2-arr.r svg { transform: scaleX(-1); }
.hd2-stats { display: grid; grid-template-columns: repeat(4, 1fr); background: var(--panel); border: 1px solid var(--line); } .hd2-stats div { text-align: center; padding: 6px 2px 7px; border-right: 1px solid var(--line); } .hd2-stats div:last-child { border: 0; } .hd2-stats small { display: block; font-size: 10px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); } .hd2-stats b { font-size: 16px; font-variant-numeric: tabular-nums; }
.hd2-exp, .hd2-need { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 10px 0 6px; font-size: 15px; } .hd2-exp .ico2, .hd2-need .ico2 { width: 22px; height: 22px; } .hd2-exp b.short, .hd2-need b.short { color: var(--bad); }
.hd2-upr { display: flex; justify-content: center; align-items: center; gap: 10px; margin-bottom: 8px; }
.hd2-up { min-width: 58%; min-height: 54px; background: linear-gradient(180deg, #8DE97A, #2F9A3A); border: 1px solid #D6FFC8; color: #0B2A0F; font: 700 24px/1 var(--font-display); letter-spacing: .06em; box-shadow: 0 3px 0 #1B5A22, 0 6px 14px rgba(0, 0, 0, .4); clip-path: none; } .hd2-up.star { background: linear-gradient(180deg, #FFE58A, #E8A21E); border-color: #FFF3B0; color: #2B1A05; box-shadow: 0 3px 0 #8A5A12, 0 6px 14px rgba(0, 0, 0, .4); }
.hd2-up10 { min-height: 40px; padding: 0 14px; } .hd2-nx { text-align: center; margin: 4px 0 8px; }
.hd2-tabs { display: flex; margin-top: 6px; border-top: 1px solid var(--line); } .hd2-tabs button { position: relative; flex: 1; min-height: 46px; background: none; border: 0; border-bottom: 3px solid transparent; border-radius: 0; color: var(--muted); font: 700 16px/1 var(--font-display); letter-spacing: .06em; clip-path: none; padding: 6px 2px; } .hd2-tabs button.on { color: var(--accent); border-bottom-color: var(--accent); background: none; } .hd2-tabs .rd { top: 6px; right: 14%; }
.hd2-stars { position: absolute; z-index: 3; left: 0; right: 0; bottom: 52px; display: flex; justify-content: center; gap: 4px; } .hd2-stars .st { width: 34px; height: 34px; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .6)); }
.hd2-skh { display: flex; align-items: center; gap: 8px; margin: 4px 0 6px; } .hd2-skt { flex: 1; text-align: center; } .hd2-skt b { display: block; font: 700 20px/1.1 var(--font-display); letter-spacing: .03em; } .hd2-skt em { font-style: normal; color: var(--accent); font-size: 14px; } .hd2-skt span { font-size: 12px; color: var(--muted); }
.hd2-arr { width: 38px; min-height: 38px; padding: 0; border-radius: 50%; }
.hd2-tags { display: flex; gap: 8px; justify-content: center; margin-bottom: 8px; } .tg { padding: 1px 10px; font-size: 12px; font-weight: 600; border: 1px solid var(--line); background: var(--panel2); } .tg.martial { color: #FF9A7A; border-color: #8E3426; } .tg.tactical { color: #8EC2FF; border-color: #2A4A80; }
.hd2-det { padding: 10px 12px; background: var(--panel); border: 1px solid var(--line); } .hd2-dt { font: 700 15px var(--font-display); letter-spacing: .08em; color: var(--accent); margin-bottom: 4px; } .hd2-det p { margin: 0 0 6px; font-size: 14px; } .hd2-det ul { margin: 0; padding-left: 18px; font-size: 13px; color: var(--muted); } .hd2-det li.on { color: #9CE08A; } .hd2-det li small { color: #E8B04A; }
.hd2-sp { padding: 10px 12px; background: var(--panel); border: 1px solid var(--line); } .hd2-spt { font: 700 20px var(--font-display); text-align: center; margin-bottom: 6px; } .hd2-r { display: flex; align-items: center; gap: 10px; padding: 3px 4px; font-size: 15px; } .hd2-r span { flex: 1; color: var(--muted); } .hd2-r .arr { color: #6FE08A; font-style: normal; font-size: 11px; } .hd2-r .to { color: #9CFF8A; }
.hd2-strip { display: flex; justify-content: center; gap: 10px; margin: 10px 0 2px; } .hd2-strip .ico2 { width: 52px; height: 52px; } .hd2-strip .ico2.dim { filter: grayscale(.8) brightness(.6); }
.gd-cur { display: flex; gap: 12px; align-items: center; margin: 8px 0; } .gd-cur .ico2 { width: 64px; height: 64px; } .gd-act { display: flex; gap: 8px; margin-bottom: 4px; } .gd-act .primary { flex: 1; }
.gd-row .ico2 { width: 44px; height: 44px; } .gq { font-size: 12px; font-weight: 700; }
.gear-inv .inv-ic .ico2 { width: 36px; height: 36px; }
.sh-ic .ico2 { width: 38px; height: 38px; } .sh-big .ico2 { width: 56px; height: 56px; }

.scn { position: relative; } .scn > .scn-anim { position: absolute; left: 0; top: 0; pointer-events: none; will-change: transform; }   /* the moving bits of the city (scene.js splitAnimLayer) */

/* fog over unexplored land (land.js) */
.fog .fogp { animation: fogd 9s ease-in-out infinite alternate; } @keyframes fogd { from { transform: translate(-7px, 2px); } to { transform: translate(8px, -3px); } }
.scn .fogout { animation: fogoff 1.5s ease-in forwards; pointer-events: none; } @keyframes fogoff { to { opacity: 0; transform: translateY(-18px); } }
.scn .bdg.land.ready { animation: landpulse 1.4s ease-in-out infinite alternate; transform-box: fill-box; } @keyframes landpulse { to { opacity: .72; } }
@media (prefers-reduced-motion: reduce) { .fog .fogp, .scn .bdg.land.ready { animation: none; } }

/* the gift box on newly explored land (land.js) */
.scn .giftbob { animation: giftbob 1.1s ease-in-out infinite alternate; } @keyframes giftbob { to { transform: translateY(-5px); } }
.scn .glint { animation: glint 1.35s ease-in-out infinite; transform-box: fill-box; transform-origin: center; } @keyframes glint { 0%, 100% { opacity: 0; transform: scale(.3); } 50% { opacity: 1; transform: scale(1); } }
.giftfx { position: fixed; z-index: 85; width: 150px; height: 150px; margin: -75px 0 0 -75px; border-radius: 50%; pointer-events: none; background: radial-gradient(circle, rgba(255, 243, 196, .95) 0, rgba(255, 201, 94, .55) 35%, rgba(255, 176, 64, 0) 70%); animation: giftfx .7s ease-out forwards; }
@keyframes giftfx { from { opacity: 1; transform: scale(.2); } to { opacity: 0; transform: scale(1.6); } }
@media (prefers-reduced-motion: reduce) { .scn .giftbob, .scn .glint { animation: none; } .scn .glint { opacity: .8; } }

/* the Lord's card and page (lordhero.js) */
.hc.lordc { box-shadow: 0 0 0 2px #E8B23E, 0 0 12px rgba(232, 178, 62, .45); }
.hc-sq.lordtag { background: #E8B23E; color: #3A230E; }
.hc.lordc > .rd { position: absolute; z-index: 3; top: 4px; right: 4px; width: 12px; height: 12px; border-radius: 50%; background: #E0443B; border: 2px solid #fff; }
.hd2-stars.six { gap: 2px; } .hd2-stars.six .st { width: 30px; height: 30px; }

/* Mason's Wall (masonswall.js) */
#mason-box { padding: 10px 12px 24px; }
.mw-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.mw-tm { display: flex; flex-direction: column; gap: 3px; min-width: 110px; }
.mw-tm b { font: 700 18px/1 Georgia, serif; } .mw-tm.low b, .mw-top .low b { color: var(--bad); }
.mw-bar { display: block; height: 5px; background: #1B2030; border-radius: 3px; overflow: hidden; } .mw-bar u { display: block; height: 100%; background: var(--accent); }
.mw-board { display: grid; grid-template-columns: repeat(8, 1fr); grid-template-rows: repeat(9, 1fr); gap: 1px; background: #0E111A; border: 2px solid #343C52; border-radius: 6px; aspect-ratio: 8 / 9; max-width: 340px; margin: 0 auto; touch-action: none; user-select: none; }
.mw-b { background: #171B27; display: block; } .mw-b.p, .mw-c.p { background: #B9AE98; box-shadow: inset 0 0 0 2px #948770; }
.mw-b.s, .mw-c.s { background: #C9893A; box-shadow: inset 0 0 0 2px #8A5521; background-image: linear-gradient(135deg, transparent 45%, #8A5521 46%, #8A5521 54%, transparent 55%); }
.mw-b.g, .mw-c.g { background: #E5BD4D; box-shadow: inset 0 0 0 2px #B9741A; } .mw-b.k, .mw-c.k { background: #E7E1FF; box-shadow: inset 0 0 0 2px #7C6AD8; }
.mw-b.h { background: #0A0C12; } .mw-b.x { background: #3A1E1E; box-shadow: inset 0 0 0 2px #7A2D2D; background-image: linear-gradient(45deg, transparent 47%, #E0614F 48%, #E0614F 52%, transparent 53%); }
.mw-b.ok { outline: 2px solid var(--ok); outline-offset: -2px; opacity: .85; } .mw-b.bad { outline: 2px solid var(--bad); outline-offset: -2px; opacity: .85; }
.mw-cart { display: flex; justify-content: space-around; align-items: flex-end; gap: 8px; margin-top: 10px; touch-action: none; }
.mw-stone { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px; min-width: 96px; min-height: 76px; justify-content: flex-end; border: 2px solid #343C52; border-radius: 8px; background: #12151D; cursor: grab; }
.mw-stone.sel { border-color: var(--accent); } .mw-stone.gone { opacity: .25; cursor: default; } .mw-stone small { color: #9DA6BB; }
.mw-sh { position: relative; pointer-events: none; } .mw-c { position: absolute; display: block; }
.mw-hint { text-align: center; margin-top: 8px; }
.mw-ch { display: flex; align-items: center; gap: 6px; margin: 8px 0; } .mw-ch i { width: 14px; height: 14px; border-radius: 3px; background: #1B2030; border: 1px solid #343C52; } .mw-ch i.on { background: var(--accent); }
.card-top { overflow: visible; } .sold-pic.f-ashriders { transform: scale(1.3); transform-origin: 50% 88%; margin-right: 6px; }      /* a rider is drawn whole with the horse: scale it up so the man is as big as the foot soldiers */

/* B4.6: raid warning banner and the reports chip */
#inc-banner { position: fixed; z-index: 60; top: calc(8px + env(safe-area-inset-top)); left: 8px; right: 8px; display: flex; flex-direction: column; gap: 4px; pointer-events: none; }
#inc-banner .inc { background: rgba(140, 28, 24, .95); border: 1px solid #E8453C; color: #fff; padding: 6px 10px; border-radius: 2px; font: 600 12px/1.3 var(--font-ui); box-shadow: 0 2px 8px rgba(0, 0, 0, .5); }
.qbtns { display: flex; gap: 6px; flex: none; } .qbtns .go { background: var(--accent); color: var(--on-accent); }
