:root {
  --bg: #0B0B1E; --panel: #17173A; --panel2: #0F0F27; --line: #2E2D5E; --line2: #3A3970;
  --text: #EDEBFF; --muted: #A9A6D6; --soft: #C9C6F0;
  --gold: #FFC857; --cyan: #5EE6FF; --green: #9BE36A; --red: #FF9B85; --pink: #C996CC;
  --safe-top: env(safe-area-inset-top, 0px); --safe-bottom: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html, body, #root { margin: 0; height: 100%; background: var(--bg); color: var(--text); font-family: 'Space Grotesk', system-ui, sans-serif; -webkit-tap-highlight-color: transparent; }
body { overscroll-behavior: none; }
button, input { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; }
h2 { font-family: 'Pixelify Sans', monospace; font-size: 20px; }
h3 { font-size: 15px; margin-top: 4px; }
.pixel { image-rendering: pixelated; }
.muted { color: var(--muted); } .small { font-size: 13px; } .tiny { font-size: 11px; }
.gold { color: var(--gold); } .green { color: var(--green); } .red { color: var(--red); } .cyan { color: var(--cyan); } .warn { color: var(--gold); margin: 0; }
.row { display: flex; align-items: center; gap: 10px; } .between { justify-content: space-between; } .grow { flex: 1; min-width: 0; } .left { text-align: left; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.error { color: var(--red); margin: 0; }

.screen { min-height: 100%; padding: calc(24px + var(--safe-top)) 20px calc(24px + var(--safe-bottom)); }
.center { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; }
.login { width: 100%; max-width: 360px; display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.login form, .login.stack { width: 100%; text-align: left; }
.login.stack { align-items: stretch; }
.login.stack > img, .login.stack > h1, .login.stack > p { align-self: center; text-align: center; }
.brand { font-family: 'Pixelify Sans', monospace; font-size: 34px; color: var(--gold); }
.title-screen { position: relative; overflow: hidden; }
.title-sky { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; }
.title-screen .login { position: relative; z-index: 1; }
.brand-logo { margin: 8px 0 0; width: 100%; line-height: 0; animation: logo-in 1.1s cubic-bezier(.2,.9,.3,1.25) both; }
.logo-float { position: relative; display: block; width: 100%; max-width: 360px; margin: 0 auto; animation: logo-float 5s ease-in-out 1.1s infinite; filter: drop-shadow(0 0 18px rgba(95, 216, 240, 0.25)); }
.brand-logo img { width: 100%; height: auto; display: block; }
.logo-shine { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(105deg, transparent 42%, rgba(255,255,255,0.55) 50%, transparent 58%) no-repeat; background-size: 300% 100%; background-position: 150% 0; -webkit-mask: url('assets/logo.png') center / 100% 100% no-repeat; mask: url('assets/logo.png') center / 100% 100% no-repeat; animation: logo-shine 5s ease-in-out 1.6s infinite; }
.logo-twinkle { position: absolute; left: 23.9%; top: 21%; width: 18%; aspect-ratio: 1; transform: translate(-50%, -50%); pointer-events: none; background: radial-gradient(circle, rgba(255,214,110,0.75) 0%, rgba(255,200,90,0.25) 35%, transparent 65%); animation: logo-twinkle 2.4s ease-in-out infinite; }
@keyframes logo-in { from { opacity: 0; transform: translateY(-36px) scale(0.92); } to { opacity: 1; transform: none; } }
@keyframes logo-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
@keyframes logo-shine { 0% { background-position: 150% 0; } 35%, 100% { background-position: -50% 0; } }
@keyframes logo-twinkle { 0%, 100% { opacity: 0.25; transform: translate(-50%, -50%) scale(0.7); } 50% { opacity: 1; transform: translate(-50%, -50%) scale(1.1); } }
.tagline { margin: 0 0 12px; font-family: 'Pixelify Sans', monospace; font-weight: 500; font-size: 15px; letter-spacing: 2px; text-transform: uppercase; color: #8FE4F5; animation: tagline-in 0.8s ease-out 0.7s both; }
@keyframes tagline-in { from { opacity: 0; letter-spacing: 8px; } to { opacity: 1; letter-spacing: 2px; } }
@media (prefers-reduced-motion: reduce) { .brand-logo, .logo-float, .logo-shine, .logo-twinkle, .tagline { animation: none; } }
.small-brand { font-size: 22px; color: var(--text); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
label { font-size: 13px; color: var(--soft); }
input { width: 100%; height: 46px; padding: 0 14px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line2); outline: none; }
input:focus { border-color: var(--gold); }

.btn { min-height: 44px; padding: 0 16px; border-radius: 12px; background: transparent; border: 1px solid var(--line2); cursor: pointer; font-weight: 600; font-size: 14px; }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn.primary { background: var(--gold); color: #1A1030; border: 0; }
.btn.green { background: var(--green); color: #0F3320; border: 0; }
.btn.outline { border-color: var(--gold); color: var(--gold); }
.btn.ghost { border: 0; color: var(--muted); padding: 0 10px; }
.btn.tiny { min-height: 32px; padding: 0 10px; font-size: 12px; }

/* ---------- game ---------- */
.game { position: fixed; inset: 0; overflow: hidden; }
.map { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: grab; display: block; }
.hud { position: absolute; top: calc(10px + var(--safe-top)); left: 10px; right: 10px; display: flex; gap: 6px; align-items: center; pointer-events: none; }
.hud > * { pointer-events: auto; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 9px; background: rgba(23,23,58,0.92); border: 1px solid var(--line); font-family: 'Pixelify Sans', monospace; font-size: 14px; white-space: nowrap; }
.chip.gold { color: var(--gold); background: #3A2A10; border-color: #3A2A10; font-family: inherit; font-size: 12px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; } .chips .chip { font-family: inherit; font-size: 12px; }
.brandchip { color: var(--gold); font-weight: 700; cursor: pointer; min-height: 36px; }
.chip.alert { background: var(--gold); color: #1A1030; border: 0; cursor: pointer; font-family: inherit; font-weight: 600; font-size: 12px; min-height: 36px; }
.dot { width: 9px; height: 9px; display: inline-block; }
.fuel { display: inline-flex; gap: 2px; } .fuel i { width: 4px; height: 12px; background: var(--line); } .fuel i.on { background: var(--gold); }
.tools { position: absolute; right: 10px; top: calc(64px + var(--safe-top)); display: flex; flex-direction: column; gap: 8px; }
.tool { width: 44px; height: 44px; border-radius: 12px; background: rgba(23,23,58,0.92); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.tool svg { width: 20px; height: 20px; fill: none; stroke: var(--cyan); stroke-width: 2; }
.tool.corner { position: fixed; top: calc(10px + var(--safe-top)); right: 10px; z-index: 2; }
.toast { position: absolute; left: 50%; top: calc(64px + var(--safe-top)); transform: translateX(-50%); max-width: calc(100% - 120px); padding: 10px 14px; border-radius: 12px; background: #1E3A24; color: var(--green); font-size: 13px; font-weight: 600; text-align: center; }
.toast.bad { background: #3A1E1E; color: var(--red); }

.sheet { position: absolute; left: 0; right: 0; bottom: 0; max-height: 60%; overflow-y: auto; padding: 14px 16px calc(16px + var(--safe-bottom)); border-radius: 20px 20px 0 0; background: var(--panel); border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
@media (min-width: 720px) { .sheet { left: auto; right: 16px; bottom: 16px; width: 380px; border-radius: 20px; border: 1px solid var(--line); } }
.title { font-family: 'Pixelify Sans', monospace; font-size: 18px; }
.fleet { display: flex; flex-direction: column; gap: 6px; }
.trip { padding: 8px 10px; border-radius: 10px; background: var(--panel2); display: flex; flex-direction: column; gap: 5px; }
.bar { height: 6px; border-radius: 3px; background: #26254F; overflow: hidden; } .bar i { display: block; height: 100%; }
.report { text-align: left; padding: 10px 12px; border-radius: 12px; background: var(--panel2); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 3px; cursor: pointer; }
.report b { color: var(--gold); } .report span { font-size: 13px; color: var(--soft); }
.tier { padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; background: #26254F; color: var(--soft); }
.tier.uncommon { background: #0F3320; color: var(--green); } .tier.rare { background: #2A1F52; color: var(--pink); } .tier.legendary { background: #3A2A10; color: var(--gold); }
.factors { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.factors div { padding: 6px 8px; border-radius: 8px; background: var(--panel2); display: flex; flex-direction: column; gap: 1px; }
.traits { display: flex; flex-direction: column; gap: 6px; }
.trait { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 10px; background: var(--panel2); border: 1px solid var(--line); }
.trait .row { gap: 8px; } .trait b { font-size: 13px; }
.trait.rare { border-color: #4A3F8F; } .trait.legendary { border-color: var(--gold); box-shadow: 0 0 0 1px #3A2A10 inset; }
.traits.compact .trait { padding: 6px 8px; } .traits.compact img { width: 28px; height: 28px; }
.factors span { font-size: 10px; color: var(--muted); } .factors b { font-size: 12px; }
.pstats { display: flex; flex-direction: column; gap: 6px; }
.pstat-pop { padding: 8px 10px; border-radius: 8px; background: var(--panel2); display: flex; flex-direction: column; gap: 4px; }
.deposits { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.deposits div { padding: 6px 4px; border-radius: 8px; background: var(--panel2); display: flex; flex-direction: column; align-items: center; gap: 3px; text-align: center; }
.deposits div.dim { opacity: 0.45; }
.deposits span { font-size: 10px; color: var(--muted); } .deposits b { font-size: 11px; }
.pips { display: flex; gap: 2px; } .pips i { width: 6px; height: 6px; background: var(--line); }
.note { min-height: 44px; display: flex; align-items: center; justify-content: center; text-align: center; padding: 8px 12px; border-radius: 12px; border: 1px dashed var(--line2); color: var(--muted); font-size: 13px; }
.note.green { border-color: var(--green); color: var(--green); }

.overlay { position: fixed; inset: 0; background: rgba(5,5,15,0.7); display: flex; align-items: flex-end; justify-content: center; z-index: 10; }
@media (min-width: 720px) { .overlay { align-items: center; } }
.dialog, .panel { width: 100%; max-width: 520px; max-height: 92%; overflow-y: auto; padding: 16px 16px calc(20px + var(--safe-bottom)); border-radius: 20px 20px 0 0; background: var(--panel); border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 12px; }
.panel { height: 100%; max-height: 100%; border-radius: 0; background: var(--bg); padding-top: calc(12px + var(--safe-top)); }
@media (min-width: 720px) { .dialog { border-radius: 20px; border: 1px solid var(--line); } .panel { height: 92%; border-radius: 20px; border: 1px solid var(--line); } }
.card { padding: 12px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.card.row { flex-direction: row; }
.card p { margin: 0; }
.resbar { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
.res { padding: 6px 4px; border-radius: 8px; background: var(--panel2); display: flex; flex-direction: column; align-items: center; gap: 2px; }
.res b { display: flex; align-items: center; gap: 4px; font-family: 'Pixelify Sans', monospace; font-size: 14px; } .res span { font-size: 9px; color: var(--muted); text-align: center; }
.list { display: flex; flex-direction: column; gap: 8px; }
.listrow { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; background: var(--panel2); border: 1px solid var(--line); cursor: pointer; text-align: left; }
.listrow.dim { opacity: 0.55; }
.tabs { display: flex; gap: 6px; } .tab { flex: 1; min-height: 40px; border-radius: 10px; background: transparent; border: 1px solid var(--line2); font-weight: 600; cursor: pointer; } .tab.on { background: var(--gold); color: #1A1030; border-color: var(--gold); }
.slots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.slot { min-height: 148px; padding: 8px 6px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; gap: 4px; cursor: pointer; text-align: center; }
.slot > .tiny:first-child { align-self: flex-start; }
.slot b { font-size: 12px; line-height: 1.2; } .slot .small { font-size: 11px; }
.slot.empty { border: 1px dashed var(--gold); }
.slot.locked { background: var(--panel2); cursor: default; }
.plus { width: 40px; height: 40px; margin: 8px 0; border-radius: 10px; border: 2px dashed var(--gold); color: var(--gold); display: flex; align-items: center; justify-content: center; font-size: 22px; }
.lock { width: 28px; height: 28px; fill: none; stroke: var(--muted); stroke-width: 2; margin: 6px 0; }
.art { height: 60px; display: flex; align-items: flex-end; justify-content: center; } .small-art { height: 48px; width: 52px; flex-shrink: 0; }

.btn.wide { width: 100%; }
.or { width: 100%; display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ships */
.shipbox { width: 60px; height: 60px; flex: none; border-radius: 14px; background: var(--panel2); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; }
.shipbox.small { width: 44px; height: 44px; border-radius: 10px; }
.pill { align-self: flex-start; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: rgba(94,230,255,0.14); color: var(--cyan); }
.pill.green { background: rgba(155,227,106,0.14); color: var(--green); } .pill.gold { background: rgba(255,200,87,0.14); color: var(--gold); } .pill.red { background: rgba(255,138,92,0.14); color: #FF8A5C; }
.box { padding: 12px 14px; border-radius: 14px; background: var(--panel2); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; }
.label { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.big { font-family: 'Pixelify Sans', monospace; font-size: 20px; }
.duo { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.trio { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.trio .box, .duo .box { padding: 10px; } .trio b { font-size: 15px; }
.tank { display: grid; gap: 3px; }
.tank i { height: 12px; background: var(--line); }
.tank i.on { background: var(--gold); } .tank i.short { background: transparent; border: 1.5px dashed #FF8A5C; }
.danger { padding: 12px 14px; border-radius: 14px; background: rgba(226,85,45,0.1); border: 1px solid #7A2E2E; display: flex; flex-direction: column; gap: 4px; font-size: 13px; line-height: 1.45; color: #F2C3B0; }
.danger b { color: #FF8A5C; font-size: 14px; } .danger.soft { background: rgba(226,85,45,0.06); border-color: #5A2A2A; }
.btn.cyanline { color: var(--cyan); } .btn.redline { border-color: #7A2E2E; color: #FF8A5C; }
.shippick { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; }
.pickship { flex: none; display: flex; gap: 8px; align-items: center; min-height: 48px; padding: 6px 12px 6px 8px; border-radius: 12px; background: transparent; border: 1px solid var(--line2); cursor: pointer; text-align: left; font-size: 13px; }
.pickship.on { border: 2px solid var(--green); background: rgba(155,227,106,0.08); }
.listrow.broken { border-color: #7A2E2E; background: rgba(226,85,45,0.08); }
.minibar { display: block; height: 4px; border-radius: 2px; background: var(--line); overflow: hidden; } .minibar i { display: block; height: 4px; background: var(--gold); }
.soft { color: var(--soft); }
.chip.shipschip { cursor: pointer; font-family: inherit; font-size: 12px; font-weight: 600; color: var(--cyan); min-height: 36px; }

/* settings */
.setlist { flex: none; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.setrow { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 8px 14px; background: var(--panel2); border: 0; border-bottom: 1px solid var(--line); cursor: pointer; text-align: left; }
.setrow:last-child { border-bottom: 0; } .setrow.off { opacity: 0.45; cursor: default; }
.switch { width: 46px; height: 28px; flex: none; border-radius: 14px; background: var(--line2); position: relative; transition: background .15s; }
.switch i { position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--soft); transition: left .15s; }
.switch.on { background: var(--cyan); } .switch.on i { left: 21px; background: #0B0B1E; }
.setrow:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; }
.tagpreview { flex: none; height: 92px; border-radius: 14px; background: #05050F; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; }
.tagpill { display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 12px 0 4px; border: 2px solid var(--cyan); border-radius: 15px; background: var(--bg); font-size: 12px; font-weight: 600; }
.tagicon { width: 22px; height: 22px; border-radius: 50%; background: var(--panel); }
.tagship { width: 14px; height: 14px; background: #8A88A8; clip-path: polygon(50% 0, 100% 100%, 0 100%); }

.coords { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.coords label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; }
.coords input { height: 44px; text-align: center; font-variant-numeric: tabular-nums; }

/* ---------- rare find card ---------- */
.rarefind-bg { background: rgba(5, 4, 20, 0.78); }
.rarefind { position: relative; width: min(340px, calc(100% - 32px)); margin: auto; padding: 22px 18px 16px; border-radius: 20px; background: var(--panel); border: 2px solid var(--tier); box-shadow: 0 0 40px -8px var(--tier); display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; animation: rf-pop 0.45s cubic-bezier(.2, 1.4, .4, 1) both; }
.rarefind.legendary { background: linear-gradient(180deg, #2A1F0A, var(--panel) 55%); }
.rf-burst { position: relative; width: 150px; height: 120px; display: grid; place-items: center; }
.rf-rays { position: absolute; inset: -20px; border-radius: 50%; background: repeating-conic-gradient(from 0deg, color-mix(in srgb, var(--tier) 35%, transparent) 0 10deg, transparent 10deg 30deg); mask: radial-gradient(circle, #000 25%, transparent 68%); -webkit-mask: radial-gradient(circle, #000 25%, transparent 68%); animation: rf-spin 9s linear infinite; }
.rf-icon { position: relative; width: 96px; height: 96px; animation: rf-bob 2.4s ease-in-out infinite; filter: drop-shadow(0 0 10px var(--tier)); }
.rf-kicker { font-family: 'Pixelify Sans', monospace; font-weight: 700; font-size: 15px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--tier); }
.rf-name { margin: 0; font-family: 'Pixelify Sans', monospace; font-size: 28px; line-height: 1.1; }
.rf-look { margin: 0; color: var(--muted); font-size: 13px; }
.rf-effect { margin: 4px 0; padding: 8px 12px; border-radius: 10px; background: var(--panel2); border: 1px solid var(--line); font-size: 13px; font-weight: 600; }
.rf-where { display: flex; align-items: center; gap: 10px; text-align: left; margin: 2px 0; }
.rf-buttons { width: 100%; gap: 8px; margin-top: 6px; } .rf-buttons .btn { flex: 1; }
@keyframes rf-pop { from { transform: scale(0.6) translateY(20px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes rf-spin { to { transform: rotate(360deg); } }
@keyframes rf-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@media (prefers-reduced-motion: reduce) { .rarefind, .rf-rays, .rf-icon { animation: none; } }

/* ---------- codex ---------- */
.codex { display: flex; flex-direction: column; gap: 10px; overflow-y: auto; padding-bottom: calc(24px + var(--safe-bottom)); }
.codexbar { height: 8px; } .codexbar i { background: linear-gradient(90deg, var(--cyan), var(--gold)); }
.codexgrid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.codexcell { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); cursor: pointer; text-align: center; }
.codexcell b { font-size: 12px; }
.codexcell.locked, .codexrow.locked { cursor: default; opacity: 0.75; }
.codexcell.locked .codexpic canvas { filter: brightness(0) drop-shadow(0 0 0 #2A2950); opacity: 0.55; }
.codexcell.locked b, .codexrow.locked b { color: var(--muted); letter-spacing: 0.15em; }
.codexrow { width: 100%; text-align: left; cursor: pointer; }
.codexrow.locked { border-style: dashed; }
@keyframes pr-fadein { from { opacity: 0; } to { opacity: 1; } }
/* contacts and preset chat */
.tool { position: relative; }
.toolbadge { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: var(--gold); color: #1A1030; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.contactrow { display: flex; flex-direction: row; align-items: center; gap: 10px; }
.contactmain { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; text-align: left; background: none; border: 0; color: inherit; font: inherit; cursor: pointer; padding: 0; min-height: 44px; }
.contactmain > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chatpanel { gap: 10px; }
.chatlog { display: flex; flex-direction: column; gap: 8px; min-height: 180px; max-height: 42vh; overflow-y: auto; padding: 10px; border-radius: 12px; background: var(--panel2); border: 1px solid var(--line); }
.bubble { align-self: flex-start; max-width: 78%; padding: 8px 12px; border-radius: 14px 14px 14px 4px; background: var(--panel); border: 1px solid var(--line2); display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.bubble.mine { align-self: flex-end; background: #3A2A10; border-color: #5A4418; border-radius: 14px 14px 4px 14px; color: #FFE3A3; }
.chips .chip.on { background: var(--gold); color: #1A1030; border-color: var(--gold); font-weight: 600; }
.chips button.chip { cursor: pointer; min-height: 36px; }
.phrasegrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.btn.phrase { min-height: 44px; font-size: 13px; line-height: 1.25; text-align: left; white-space: normal; }

/* ---------- landing events ---------- */
.eventcard { width: min(360px, calc(100% - 32px)); margin: auto; padding: 22px 18px 14px; border-radius: 20px; background: var(--panel); border: 2px solid var(--cyan); display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; animation: rf-pop 0.4s cubic-bezier(.2, 1.4, .4, 1) both; }
.eventcard.good { border-color: var(--green); } .eventcard.bad { border-color: var(--red); } .eventcard.safe { border-color: var(--line2); }
.ev-icon { width: 80px; height: 80px; }
.ev-kicker { font-size: 12px; color: var(--muted); }
.ev-title { margin: 0; font-family: 'Pixelify Sans', monospace; font-size: 26px; }
.ev-text { margin: 0; font-size: 14px; line-height: 1.5; color: var(--soft, #C9C6F0); }
.ev-choices { width: 100%; display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.ev-choice { min-height: 56px; padding: 10px 14px; border-radius: 12px; background: var(--panel2); border: 1px solid var(--line2); display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; cursor: pointer; }
.ev-choice b { font-size: 14px; } .ev-choice .small { color: var(--muted); }
.ev-choice.risky { border-color: #7A3A3A; } .ev-choice.risky .small { color: #FF9A8A; }
.ev-choice:disabled { opacity: 0.6; cursor: default; }
.ev-result { font-family: 'Pixelify Sans', monospace; font-size: 18px; font-weight: 700; color: var(--muted); }
.ev-result.good { color: var(--green); } .ev-result.bad { color: var(--red); }
.ev-gain { padding: 8px 14px; border-radius: 10px; background: var(--panel2); border: 1px solid var(--line); font-weight: 600; font-size: 14px; margin-bottom: 4px; }

/* side menu: one button shows or hides the tools */
.toolmenu { display: flex; flex-direction: column; gap: 8px; }
.toolmenu[hidden] { display: none; }
.tools.open .toolmenu { animation: toolsIn 0.18s ease-out; }
.tool.toggle { background: rgba(23,23,58,0.96); }
.tools.open .tool.toggle { border-color: var(--cyan); }
@keyframes toolsIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .tools.open .toolmenu { animation: none; } }

/* the bottom sheet hides itself when it has nothing to show */
.sheet:empty { display: none; }

/* space notes */
.snote { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 16px 16px 16px 4px; background: #10233A; border: 2px solid var(--cyan); color: #E8E6FF; font-size: 16px; }
.snote.mine { background: #142A1C; border-color: var(--green); }
.snote-beacon { width: 14px; height: 14px; flex: none; background: var(--cyan); transform: rotate(45deg); box-shadow: 0 0 0 2px #1A1030, 0 0 12px var(--cyan); }
.snote.mine .snote-beacon { background: var(--green); box-shadow: 0 0 0 2px #1A1030, 0 0 12px var(--green); }
.snote-list { display: flex; flex-direction: column; gap: 6px; max-height: 38vh; overflow-y: auto; }
.snote-opt { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-height: 48px; padding: 8px 12px; border-radius: 12px; background: var(--panel2); border: 1px solid var(--line); text-align: left; cursor: pointer; color: inherit; }
.snote-opt.on { border-color: var(--cyan); background: #10233A; }
.chip.pick { cursor: pointer; min-height: 36px; color: inherit; }
.btn.grow, .grow.btn { flex: 1; }

/* ---------- pilots ---------- */
.pilotface { border-radius: 50%; flex: none; }
.pilotcard { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 12px; background: var(--panel2); border: 1px solid var(--line); border-left: 3px solid var(--spec); }
.pilotcard .bar { height: 6px; }
.pilotlv { font-family: 'Pixelify Sans', monospace; font-weight: 700; color: var(--spec); }

/* ---------- characters ---------- */
.pilotsprite { flex: none; image-rendering: pixelated; }
.pilotcard .spritebox { width: 60px; height: 72px; display: flex; align-items: flex-end; justify-content: center; border-radius: 10px; background: var(--panel); flex: none; overflow: hidden; }
.charsheet { gap: 12px; }
.charsheet h3 { margin: 6px 0 0; font-family: 'Pixelify Sans', monospace; font-size: 18px; }
.charstage { position: relative; display: flex; justify-content: center; align-items: flex-end; height: 240px; border-radius: 14px; background: #120f24; overflow: hidden; }
.charstage::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 34px; background: #2a2440; border-top: 3px solid #3a3260; z-index: 0; }
.charstage .pilotsprite { position: relative; z-index: 1; margin-bottom: 8px; }
.charmsg { padding: 10px 12px; border-radius: 10px; background: var(--panel2); border: 1px solid var(--gold); font-size: 13px; line-height: 1.4; }
.charmsg.bad { border-color: var(--red); }
.racegrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.racechip { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 4px; min-height: 92px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel2); color: inherit; font: inherit; font-size: 13px; cursor: pointer; }
.racechip.on { border-color: var(--gold); background: #2a2346; }
.racechip.locked .pilotsprite { opacity: 0.35; filter: grayscale(0.6); }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch { width: 44px; height: 44px; border-radius: 8px; border: 0; cursor: pointer; }
.swatch.small { width: 36px; height: 36px; }
.swatch.on { box-shadow: 0 0 0 2px var(--bg, #0e0c1b), 0 0 0 4px var(--gold); }
.gearrow { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border-radius: 10px; background: var(--panel2); border: 1px solid var(--line); }
.gearrow > .btn { min-height: 44px; }
.btn.gearpick { justify-content: flex-start; text-align: left; white-space: normal; line-height: 1.3; min-height: 44px; }
.racemet { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; max-width: 340px; margin: auto; padding: 24px 20px; border-radius: 18px; background: var(--panel); border: 2px solid var(--gold); }
.racemet h2 { font-family: 'Pixelify Sans', monospace; font-size: 26px; margin: 0; }
.shiprow .pilotsprite { margin-left: -2px; }
.charsheet > * { flex-shrink: 0; }

/* a note with a button: text wraps beside it, and the box never gets squeezed shorter than its text */
.note { flex-shrink: 0; }
.note.withbtn { justify-content: space-between; gap: 10px; text-align: left; }
.note.withbtn > span { min-width: 0; }
.note.withbtn > .btn { flex-shrink: 0; }
/* building icons: little looping effects (ItemIcon) */
.itemicon { position: relative; display: inline-block; flex: none; }
.itemicon .fx { position: absolute; pointer-events: none; transform: translate(-50%, -50%); border-radius: 50%; background: var(--c); }
.fx-blink { animation: fx-blink 1.8s ease-in-out infinite; box-shadow: 0 0 4px var(--c); }
.fx-flame { border-radius: 50% 50% 45% 45%; animation: fx-flame 0.35s ease-in-out infinite alternate; box-shadow: 0 0 6px var(--c); }
.fx-rise { animation: fx-rise 2.2s ease-out infinite; opacity: 0; }
.fx-drip { animation: fx-drip 1.6s ease-in infinite; opacity: 0; }
.fx-slide { border-radius: 2px; animation: fx-slide 2s linear infinite; opacity: 0; }
.fx-beam { animation: fx-beam 1.6s ease-in infinite; opacity: 0; box-shadow: 0 0 5px #5EE6FF; }
.fx-spark { animation: fx-spark 0.9s steps(3) infinite; box-shadow: 0 0 5px var(--c); }
.fx-ping { background: none; border: 1px solid var(--c); animation: fx-ping 2.4s ease-out infinite; opacity: 0; }
.fx-glow { background: radial-gradient(circle, var(--c) 0%, transparent 70%); animation: fx-glow 2.6s ease-in-out infinite; }
.fx-shine { position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(115deg, transparent 35%, rgba(255, 246, 210, 0.55) 50%, transparent 65%) no-repeat;
  background-size: 250% 100%; animation: fx-shine 3.6s ease-in-out infinite; }
@keyframes fx-blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.15; } }
@keyframes fx-flame { from { transform: translate(-50%, -50%) scale(0.8, 0.9); opacity: 0.85; } to { transform: translate(-50%, -60%) scale(1.1, 1.3); opacity: 1; } }
@keyframes fx-rise { 0% { opacity: 0; transform: translate(-50%, -50%); } 20% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -350%) scale(0.6); } }
@keyframes fx-drip { 0% { opacity: 0; transform: translate(-50%, -50%); } 15% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, 260%); } }
@keyframes fx-slide { 0% { opacity: 0; transform: translate(-50%, -50%); } 10%, 85% { opacity: 1; } 100% { opacity: 0; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))); } }
@keyframes fx-beam { 0% { opacity: 0; transform: translate(-50%, -50%); } 15% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, calc(-50% + var(--dy))); } }
@keyframes fx-spark { 0% { opacity: 1; transform: translate(-50%, -50%) scale(1); } 50% { opacity: 0.2; transform: translate(-30%, -70%) scale(0.6); } 100% { opacity: 0.9; transform: translate(-70%, -40%) scale(1.1); } }
@keyframes fx-ping { 0% { opacity: 0.9; transform: translate(-50%, -50%) scale(0.2); } 100% { opacity: 0; transform: translate(-50%, -50%) scale(1); } }
@keyframes fx-glow { 0%, 100% { opacity: 0.45; transform: translate(-50%, -50%) scale(0.85); } 50% { opacity: 1; transform: translate(-50%, -50%) scale(1.1); } }
@keyframes fx-shine { 0% { background-position: 150% 0; } 60%, 100% { background-position: -60% 0; } }
@media (prefers-reduced-motion: reduce) { .itemicon .fx, .itemicon .fx-shine { animation: none; display: none; } }

/* ---------- stats, leaders, founders ---------- */
.statbars { display: flex; flex-direction: column; gap: 3px; width: 100%; }
.statrow { display: grid; grid-template-columns: 64px minmax(0, 1fr) 18px auto; align-items: center; gap: 6px; font-size: 12px; }
.statrow.dim { opacity: 0.45; }
.statname { color: var(--muted); }
.statbar { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 2px; height: 8px; }
.statbar i { border-radius: 2px; background: var(--line); }
.statval { text-align: right; font-size: 12px; }
.btn.statadd { min-height: 28px; min-width: 32px; padding: 0 8px; font-weight: 700; color: var(--gold); border-color: var(--gold); }
.candcard { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border-radius: 12px; background: var(--panel2); border: 1px solid var(--line); }
.candcard .btn { align-self: flex-start; margin-top: 4px; min-height: 40px; }
.spritebox { width: 60px; height: 72px; display: flex; align-items: flex-end; justify-content: center; border-radius: 10px; background: var(--panel); flex: none; overflow: hidden; }
.spritebox.small { width: 44px; height: 52px; }
.pickdialog > * { flex-shrink: 0; }
.pickh3 { margin: 6px 0 0; font-family: 'Pixelify Sans', monospace; font-size: 16px; }
.rulercard { display: flex; flex-direction: column; gap: 8px; }
.plaque { font-size: 12px; line-height: 1.4; padding: 6px 10px; border-radius: 8px; background: #2a2346; border: 1px solid #5a4418; color: #FFE3A3; }
.nopilot, .crewcard, .foundcard { display: flex; flex-direction: column; gap: 8px; }
.nopilot { border-color: var(--gold); }
.foundcard { border-color: var(--green); }

/* planet calendar */
.calcard { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border-radius: 14px; background: var(--panel2, rgba(255,255,255,0.04)); border: 1px solid var(--line); color: inherit; font: inherit; cursor: pointer; text-align: left; min-height: 44px; }
.caldial { position: relative; width: 36px; height: 36px; flex-shrink: 0; border-radius: 50%; background: conic-gradient(from 180deg, #1B1A40 0 25%, #FFC857 35% 65%, #1B1A40 75% 100%); border: 2px solid var(--line); }
.caldial i { position: absolute; left: 50%; top: 50%; width: 2px; height: 15px; background: #E8E6FF; transform-origin: 50% 0; transform: rotate(calc(var(--f) * 360deg + 180deg)); border-radius: 1px; }
.calgrid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.calday { aspect-ratio: 1; min-height: 36px; border-radius: 8px; border: 1px solid var(--line); background: transparent; color: var(--muted); font: 600 12px/1 inherit; cursor: default; padding: 0; }
.calday.lived { background: rgba(155,227,106,0.12); color: var(--text); cursor: pointer; }
.calday.bad { background: rgba(255,90,60,0.25); border-color: #FF5A3C; color: #FFD0C4; cursor: pointer; }
.calday.today { outline: 2px solid var(--gold); outline-offset: -2px; color: var(--gold); }
.calday.future { opacity: 0.35; }
.calday.on { box-shadow: 0 0 0 2px var(--cyan); }
.calkey { display: flex; gap: 12px; flex-wrap: wrap; }
.calkey i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 4px; vertical-align: -1px; border: 1px solid var(--line); }
.calkey i.lived { background: rgba(155,227,106,0.4); } .calkey i.bad { background: #FF5A3C; } .calkey i.today { border: 2px solid var(--gold); }

/* climate */
.climate { display: flex; flex-direction: column; gap: 6px; padding: 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel2, rgba(255,255,255,0.03)); }
.climate.compact { gap: 2px; padding: 8px 10px; }
.zgauge { position: relative; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; height: 10px; margin-top: 2px; }
.zgauge i { border-radius: 3px; opacity: 0.75; }
.zgauge b { position: absolute; top: -4px; width: 4px; height: 18px; margin-left: -2px; border-radius: 2px; background: #FFFFFF; box-shadow: 0 0 0 2px #0B0B1E; }
.zlabels { display: flex; justify-content: space-between; }

/* routes: waypoints on the send screen */
.waypoints { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.waypoints li { display: flex; align-items: center; gap: 8px; padding: 4px 4px 4px 8px; border-radius: 10px; background: var(--panel2); border: 1px solid var(--line); }
.wpnum { width: 22px; height: 22px; flex: none; display: grid; place-items: center; border-radius: 50%; border: 2px solid var(--cyan); color: var(--cyan); font-weight: 700; font-size: 12px; }

/* ranking medal on a planet card (gold / silver / bronze, grey below 3rd) */
.medal { width: 14px; height: 14px; flex: none; border-radius: 50%; box-shadow: inset 0 0 0 2px rgba(0,0,0,.35); }

/* claim races */
.box.race { border-color: #7A3E2E; background: #22131A; }
.race-title { color: #FF8A5C; font-family: 'Pixelify Sans', monospace; font-size: 18px; }
.racers { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.racers li { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.racers li.mine { color: var(--green); }
.racepos { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; background: #3A1F22; color: #FF8A5C; font-weight: 700; font-size: 12px; }
.racers li.mine .racepos { background: #14301E; color: var(--green); }
/* town names on the surface globe, and road planning */
.townlabel { position: absolute; transform: translate(-50%, -150%); pointer-events: none; padding: 1px 6px; border-radius: 6px; background: rgba(11,11,30,0.78); border: 1px solid rgba(255,255,255,0.18); color: #F3EEF8; font-family: 'Pixelify Sans', monospace; font-size: 11px; white-space: nowrap; }
.townlabel.picked { color: #1A1030; background: var(--cyan); border-color: var(--cyan); }
/* a planet dungeon on the globe (claude/planet-dungeons.md): a point on its tile with a label above, and a scanner ping until scanned */
.dglabel { position: absolute; width: 0; height: 0; pointer-events: none; }
.dgtag { pointer-events: auto; cursor: pointer; line-height: 1.3; position: absolute; left: 0; bottom: 6px; transform: translateX(-50%); padding: 1px 6px; border-radius: 6px; background: rgba(11,11,30,0.78); border: 1px solid rgba(255,200,87,0.6); color: var(--gold); font-family: 'Pixelify Sans', monospace; font-size: 11px; white-space: nowrap; }
.dglabel.unk .dgtag { color: var(--cyan); border-color: rgba(94,230,255,0.55); }
.dgping, .dgping::after { position: absolute; left: -10px; top: -6px; width: 20px; height: 12px; border: 1px solid var(--cyan); border-radius: 50%; animation: dgping 1.6s ease-out infinite; }
.dgping::after { content: ''; left: -1px; top: -1px; animation-delay: 0.8s; }
@keyframes dgping { from { transform: scale(0.3); opacity: 0.9; } to { transform: scale(1.6); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .dgping, .dgping::after { animation: none; opacity: 0.6; } }
.linkish { background: none; border: 0; padding: 0; color: inherit; font: inherit; cursor: pointer; text-align: left; min-height: 32px; }
.linkish:disabled { cursor: default; }
button.chip { cursor: pointer; color: inherit; min-height: 32px; }
.road-card { border-color: var(--gold); }
.roadsign { position: absolute; pointer-events: none; padding: 2px 7px; border-radius: 5px; background: #2E6B3F; border: 1px solid #CFE8D2; color: #F4FFF4; font-family: 'Pixelify Sans', monospace; font-size: 11px; white-space: nowrap; box-shadow: 0 1px 0 rgba(0,0,0,0.4); }
.gearrow.dim { opacity: 0.55; }
.supplyicon { flex: none; align-self: center; image-rendering: pixelated; }

/* ---------- battle (combat step 2) ---------- */
.battle-bg { background: rgba(5, 4, 16, 0.92); }
.battle { display: flex; flex-direction: column; gap: 8px; overflow-y: auto; padding-bottom: calc(20px + var(--safe-bottom, 0px)); }
.battle-turn { display: flex; justify-content: space-between; align-items: center; padding: 6px 10px; border-radius: 10px; font-size: 14px; }
.battle-turn.you { background: rgba(94, 230, 255, 0.12); border: 1px solid rgba(94, 230, 255, 0.5); }
.battle-turn.them { background: rgba(224, 72, 72, 0.12); border: 1px solid rgba(224, 72, 72, 0.4); }
.battle-board { display: grid; grid-template-columns: repeat(9, 1fr); gap: 2px; width: 100%; max-width: 380px; align-self: center;
  aspect-ratio: 1; background: #0B0B1E; padding: 3px; border-radius: 12px; border: 1px solid var(--line); }
.bcell { position: relative; padding: 0; border: 0; border-radius: 4px; background: #14122A; overflow: visible; cursor: pointer; aspect-ratio: 1; }
.bcell.sun { background: radial-gradient(circle, #FFF1A8 0, #FFB347 35%, #C4512F 70%, #14122A 100%); }
.bcell.reach { background: rgba(94, 230, 255, 0.22); box-shadow: inset 0 0 0 1px rgba(94, 230, 255, 0.6); }
.bcell.target { box-shadow: inset 0 0 0 2px #FF5A5A; background: rgba(224, 72, 72, 0.18); }
.bcell.heal { box-shadow: inset 0 0 0 2px #7FD35A; background: rgba(127, 211, 90, 0.18); }
.bplanet { position: absolute; inset: 18%; border-radius: 50%; opacity: 0.85; box-shadow: 0 0 0 1px #1A1030; }
.bplanet.camp { inset: 6%; opacity: 1; box-shadow: 0 0 0 2px #E04848, 0 0 10px rgba(224, 72, 72, 0.5); }
.bship { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.bship img { width: 88%; height: 88%; image-rendering: pixelated; }
.bship.pirates img { filter: drop-shadow(0 0 1px #FF5A5A) drop-shadow(0 0 1px #FF5A5A) saturate(0.8); }
.bship.you img { filter: drop-shadow(0 0 1px #5EE6FF); }
.bship.down img { filter: grayscale(1) brightness(0.45); }
.bship.cloaked img { opacity: 0.45; }
.bship.actor { outline: 2px solid #FFC857; outline-offset: -1px; border-radius: 4px; animation: pr-pulse 1.2s ease-in-out infinite; }
.bbars { position: absolute; left: 6%; right: 6%; bottom: 2px; display: flex; flex-direction: column; gap: 1px; }
.bbars i { display: block; height: 3px; border-radius: 2px; }
.bbars .hullbar { background: #7FD35A; }
.bbars .shieldbar { background: #5EA8FF; }
.bdef { position: absolute; top: 0; right: 2px; font-size: 10px; color: #9BF6FF; }
.bfx { position: absolute; left: 50%; top: 10%; transform: translateX(-50%); font: 700 13px/1 system-ui, sans-serif; pointer-events: none;
  text-shadow: 0 1px 0 #000, 0 0 4px #000; animation: bfx-rise 1.3s ease-out forwards; white-space: nowrap; z-index: 2; }
.bfx.hit { color: #FF8A5C; } .bfx.crit { color: #FFD25E; font-size: 16px; } .bfx.down { color: #FF5A5A; font-size: 15px; }
.bfx.miss { color: #C9C6F0; font-size: 11px; } .bfx.heal { color: #7FD35A; }
@keyframes bfx-rise { 0% { opacity: 0; transform: translate(-50%, 6px) scale(0.8); } 15% { opacity: 1; transform: translate(-50%, 0) scale(1.1); } 100% { opacity: 0; transform: translate(-50%, -22px) scale(1); } }
@keyframes pr-pulse { 50% { outline-color: rgba(255, 200, 87, 0.35); } }
.battle-order { display: flex; gap: 3px; flex-wrap: wrap; }
.battle-order .border { width: 26px; height: 26px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; background: #14122A; border: 1px solid var(--line); }
.battle-order .border img { width: 22px; height: 22px; image-rendering: pixelated; }
.battle-order .border.pirates { border-color: rgba(224, 72, 72, 0.6); }
.battle-order .border.you { border-color: rgba(94, 230, 255, 0.6); }
.battle-order .border.now { box-shadow: 0 0 0 2px #FFC857; }
.battle-order .border.done { opacity: 0.35; }
.battle-log { display: flex; flex-direction: column; gap: 2px; padding: 6px 8px; background: #0F0D22; border-radius: 8px; min-height: 60px; }
.battle-end.won { border-color: #FFC857; } .battle-end.lost { border-color: #E04848; }
.pirate-card { border-color: rgba(224, 72, 72, 0.5); }
.listrow.picked { box-shadow: inset 0 0 0 2px #FFC857; }
@media (prefers-reduced-motion: reduce) { .bfx { animation-duration: 0.01s; } .bship.actor { animation: none; } }
.powerbar { height: 8px; border-radius: 4px; background: rgba(255,255,255,0.08); overflow: hidden; margin: 6px 0 4px; }
.powerbar i { display: block; height: 100%; border-radius: 4px; }
.rolepick { max-width: 44%; font-size: 12px; padding: 4px 6px; border-radius: 8px; background: rgba(23,23,58,0.92); color: inherit; border: 1px solid var(--line); min-height: 32px; }

/* ---------- battle on the galaxy map: control panel ---------- */
.sheet.battle-hidden { display: none; }
.battle-hud { position: fixed; left: 8px; right: 8px; bottom: calc(8px + var(--safe-bottom, 0px)); z-index: 30; max-width: 520px; margin: 0 auto;
  display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border-radius: 16px; background: rgba(16, 14, 38, 0.94);
  border: 1px solid var(--line); box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5); max-height: 46vh; overflow-y: auto; }
.battle-hud.fleetbar { bottom: auto; top: calc(64px + var(--safe-top, 0px)); right: 68px; margin: 0; padding: 6px 10px; gap: 2px; border-color: rgba(94, 230, 255, 0.5); }
.battle-hud.fight { border-color: rgba(224, 72, 72, 0.5); }
.battle-hud.end.won { border-color: #FFC857; } .battle-hud.end.lost { border-color: #E04848; }
.battle-hud .battle-log { min-height: 0; }
.townrow { display: flex; flex-direction: column; gap: 2px; padding: 6px 2px; border-bottom: 1px solid var(--line); }
.townrow .rolepick { max-width: none; flex: 1; }
/* real-time fleets: the warning (Battle or Detour) and the battle panel */
.encounter-bg { background: rgba(40, 6, 10, 0.35); align-items: center; }
.dialog.encounter { border: 2px solid #FFC857; box-shadow: 0 0 0 4px rgba(255, 200, 87, 0.15), 0 12px 40px rgba(0, 0, 0, 0.6); animation: enc-pulse 1.2s ease-in-out infinite alternate; gap: 10px; }
@keyframes enc-pulse { from { box-shadow: 0 0 0 2px rgba(255, 200, 87, 0.1), 0 12px 40px rgba(0, 0, 0, 0.6); } to { box-shadow: 0 0 0 7px rgba(255, 90, 90, 0.22), 0 12px 40px rgba(0, 0, 0, 0.6); } }
@media (prefers-reduced-motion: reduce) { .dialog.encounter { animation: none; } }
.enc-timer, .enc-power, .clash-bar { height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.1); overflow: hidden; }
.enc-timer > div { height: 100%; background: #FFC857; transition: width 0.25s linear; }
.enc-power { height: 8px; background: rgba(255, 90, 90, 0.75); }
.enc-power > div { height: 100%; background: #5EE6FF; }
.enc-sides { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.enc-sides .vs { font-size: 20px; color: #FFC857; }
.battle-hud.clash { gap: 6px; }
.clash-row { display: grid; grid-template-columns: 70px 1fr 34px; align-items: center; gap: 8px; }
.clash-bar { height: 8px; }
.clash-bar > div { height: 100%; transition: width 0.2s; } .clash-bar > .mine { background: #7FD35A; } .clash-bar > .theirs { background: #FF6A5A; }
.clash-list { margin: 0; padding-left: 4px; list-style: none; display: flex; flex-direction: column; gap: 2px; }
/* battle terrain */
.terrain-chip { padding: 6px 10px; border-radius: 10px; font-size: 13px; border: 1px solid var(--line); background: rgba(255,255,255,0.04); }
.terrain-chip.sun { border-color: rgba(255,150,60,0.6); color: #FFC27A; background: rgba(255,120,40,0.1); }
.terrain-chip.nebula { border-color: rgba(150,120,255,0.6); color: #C8B8FF; background: rgba(120,100,240,0.1); }
.terrain-chip.asteroids { border-color: rgba(200,180,150,0.6); color: #E2D2B6; background: rgba(170,150,120,0.1); }
.terrain-chip .tiny { color: inherit; opacity: 0.85; }
.weapon-card { display: flex; flex-direction: column; gap: 8px; }
.weapon-row { gap: 8px; padding-top: 6px; border-top: 1px solid var(--line); }

/* Inside a scrolling sheet, dialog or panel, cards keep their full height and the sheet scrolls,
   instead of cards being squashed until their text spills out (calendar card, settings lists). */
.sheet > *, .dialog > *, .panel > * { flex-shrink: 0; }

/* ---------- pirate ships: encounter front views, WANTED banner, Wanted List posters (claude/pirates.md) ---------- */
.pirate-front { position: relative; display: inline-block; animation: pirate-in 420ms cubic-bezier(.2,.9,.3,1.2) both, pirate-bob 2.4s ease-in-out 420ms infinite; }
.pirate-front::after { content: ''; position: absolute; left: 15%; right: 15%; bottom: 2px; height: 6px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255,60,60,.75), rgba(255,60,60,0)); animation: pirate-glow 1.6s ease-in-out infinite; }
.pirate-front.boss img { filter: drop-shadow(0 0 6px rgba(255,80,80,.55)); }
@keyframes pirate-in { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes pirate-bob { 0%, 100% { translate: 0 0; } 50% { translate: 0 -3px; } }
@keyframes pirate-glow { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
.wanted-banner { display: flex; gap: 12px; align-items: center; padding: 8px 12px; border-radius: 10px; color: #2A1A10;
  background: linear-gradient(#EAD9AE, #D8C190); border: 2px solid #7A5A2E; box-shadow: inset 0 0 0 2px #F4E7C4; animation: pirate-in 420ms both; }
.wanted-banner .tiny { color: #4A3420; } .wanted-banner .gold { color: #8A3A10; font-weight: 700; }
.wanted-word { font-family: 'Pixelify Sans', monospace; font-size: 22px; letter-spacing: 3px; color: #8A1A1A; line-height: 1; }
.wanted-portrait { display: grid; place-items: center; width: 70px; height: 70px; background: #2A1E22; border: 2px solid #5A3A20; border-radius: 4px; }
.wanted-portrait img { animation: pirate-bob 2.4s ease-in-out infinite; }
.posters { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.poster { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; padding: 10px 10px 12px;
  color: #2A1A10; background: linear-gradient(#EFE0B8, #D9C291); border: 2px solid #7A5A2E; border-radius: 6px; box-shadow: inset 0 0 0 3px #F6EACB, 0 4px 0 #0006; }
.poster .tiny, .poster .muted { color: #5A4028; } .poster .gold { color: #8A3A10; font-weight: 700; } .poster .cyan { color: #0E6A7A; }
.poster .btn { color: #2A1A10; border-color: #7A5A2E; background: #F6EACB; } .poster .btn.ghost { background: transparent; }
.poster-head { font-family: 'Pixelify Sans', monospace; font-size: 20px; letter-spacing: 3px; color: #8A1A1A; }
.poster-name { font-size: 15px; }
.poster .btn.tiny { white-space: normal; height: auto; padding: 4px 8px; }
.poster-art { position: relative; width: 96px; height: 90px; display: grid; place-items: center; background: #2A1E22; border: 2px solid #5A3A20; border-radius: 4px; overflow: hidden; }
.poster-art::after { content: ''; position: absolute; left: 20%; right: 20%; bottom: 8px; height: 8px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255,60,60,.8), rgba(255,60,60,0)); animation: pirate-glow 1.6s ease-in-out infinite; }
.poster-art img { animation: pirate-bob 2.6s ease-in-out infinite; z-index: 1; }
.poster-art img.silhouette { filter: brightness(0) drop-shadow(0 0 4px #8A4FE0); }
.poster.hidden { opacity: .85; }
.stamp { position: absolute; z-index: 2; font-family: 'Pixelify Sans', monospace; font-size: 15px; letter-spacing: 2px; color: #C8202A; padding: 2px 6px;
  border: 3px solid #C8202A; border-radius: 4px; transform: rotate(-14deg); background: rgba(239,224,184,.35); animation: stamp-slam 380ms cubic-bezier(.3,1.6,.5,1) both; }
@keyframes stamp-slam { from { transform: rotate(-14deg) scale(2.4); opacity: 0; } to { transform: rotate(-14deg) scale(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .pirate-front, .pirate-front::after, .wanted-portrait img, .poster-art img, .poster-art::after, .stamp, .wanted-banner { animation: none; } }

/* ---------- Ship view: close-up of a flying ship ---------- */
.shipview { position: fixed; inset: 0; z-index: 30; background: #060515; display: flex; flex-direction: column; }
.shipview canvas { position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; touch-action: none; }
.sv-top { position: relative; display: flex; align-items: flex-start; gap: 8px; padding: calc(10px + var(--safe-top, 0px)) 14px 10px; background: linear-gradient(rgba(6,5,21,0.85), rgba(6,5,21,0)); }
.sv-name { font-family: Silkscreen, monospace; font-weight: 400; color: var(--gold); letter-spacing: 0.04em; }
.sv-bottom { position: relative; margin-top: auto; display: flex; flex-direction: column; gap: 8px; padding: 14px 14px calc(16px + var(--safe-bottom, 0px)); background: linear-gradient(rgba(6,5,21,0), rgba(6,5,21,0.9) 30%); max-width: 560px; width: 100%; align-self: center; }
.sv-route { position: relative; height: 6px; border-radius: 3px; background: #2C2A66; }
.sv-route i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 3px; background: var(--gold); }
.sv-route em { position: absolute; top: -2px; width: 2px; height: 10px; background: #9BF6FF; }
.sv-route b { position: absolute; top: 50%; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: #FFF2B0; box-shadow: 0 0 8px var(--gold); }
.sv-tip { position: absolute; transform: translateX(-50%); z-index: 5; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 12px; border-radius: 12px; background: rgba(6,5,21,0.88); border: 1px solid var(--line); font-size: 13px; white-space: nowrap; pointer-events: none; }
.sv-tip span { color: #A9A6D6; font-size: 12px; }
.sv-top { align-items: center; }
.sv-btn { flex: none; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 14px; background: rgba(20,18,50,0.8); border: 1px solid var(--line); color: var(--text, #E8E6FF); cursor: pointer; }
.sv-btn:active { transform: scale(0.95); }
.sv-warn { padding: 8px 10px; border-radius: 10px; background: rgba(255,90,60,0.14); border: 1px solid rgba(255,138,92,0.55); }
.sv-warn b { color: #FF8A5C; }

/* ---------- unique planets: quirks, anomalies, goods, creatures, digs ---------- */
.trait.quirk { border-color: #2C6A7A; }
.trait.anomaly { background: linear-gradient(135deg, #2A2140, #17173A); animation: anomaly-glow 3s ease-in-out infinite; }
@keyframes anomaly-glow { 0%, 100% { box-shadow: 0 0 0 1px #3A2A10 inset, 0 0 0 rgba(255,200,87,0); } 50% { box-shadow: 0 0 0 1px #3A2A10 inset, 0 0 14px rgba(255,200,87,.35); } }
.digbar { display: flex; gap: 4px; margin: 2px 0 4px; }
.digbar i { flex: 1; height: 6px; border-radius: 3px; background: var(--line); }
.digbar i.on { background: var(--gold); }
.digfind { display: flex; flex-direction: column; gap: 1px; padding: 6px 8px; border-left: 2px solid #8A6A3A; background: var(--panel2); border-radius: 0 8px 8px 0; }
.goods-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.good { display: flex; gap: 8px; align-items: center; padding: 8px; border-radius: 10px; background: var(--panel2); border: 1px solid var(--line); }
.good.show { border-color: #8A6A3A; box-shadow: 0 0 0 1px #3A2A10 inset; }
@media (prefers-reduced-motion: reduce) { .trait.anomaly { animation: none; } }

/* ================= Soft Glass theme (UI redesign option B, Nov 2) =================
   Calm dark space, see-through rounded panels, one modern font, violet for actions.
   Later rules here override the older look above. */
:root {
  --bg: #0E0D1C; --panel: rgba(20,19,38,0.88); --panel2: rgba(255,255,255,0.05); --line: rgba(255,255,255,0.09); --line2: rgba(255,255,255,0.16);
  --text: #EEF0FF; --muted: #A9AECF; --soft: #CDD1EC;
  --accent: #8B7CFF; --accent-ink: #120F24; --gold: #FFC66D; --cyan: #5EC8FF; --green: #6BE08A; --red: #FF8E80; --pink: #D9A8FF;
  --glass: rgba(18,18,34,0.78); --radius: 18px;
}
html, body, #root { font-family: 'Plus Jakarta Sans', system-ui, sans-serif; }
h2 { font-family: 'Plus Jakarta Sans', system-ui, sans-serif; font-size: 20px; font-weight: 800; }
h3 { font-size: 15px; font-weight: 700; }
.title { font-family: 'Plus Jakarta Sans', system-ui, sans-serif; font-weight: 800; font-size: 17px; }
.small-brand { font-family: 'Plus Jakarta Sans', system-ui, sans-serif; font-weight: 800; }
input { border-radius: 12px; background: rgba(255,255,255,0.06); }
input:focus { border-color: var(--accent); }
.btn { border-radius: 14px; font-weight: 700; }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.outline { border-color: rgba(139,124,255,0.6); color: #CFC8FF; }
.btn.green { background: var(--green); color: #0E2A18; }
.overlay { background: rgba(6,6,16,0.55); backdrop-filter: blur(2px); }
.dialog, .sheet { background: var(--glass); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); border: 1px solid var(--line2); }
.dialog { border-radius: 26px 26px 0 0; }
.panel { background: var(--bg); }
.card, .box { border-radius: var(--radius); background: var(--panel2); border: 1px solid var(--line); }
.listrow, .report, .trait, .trip { border-radius: 16px; background: var(--panel2); border-color: var(--line); }
.note { border-radius: 16px; border-color: var(--line2); }
.chip { font-family: 'Plus Jakarta Sans', system-ui, sans-serif; font-weight: 700; font-size: 13px; border-radius: 12px; background: var(--glass); border-color: var(--line); backdrop-filter: blur(14px); }
.chip.alert { background: var(--gold); color: #2A1A04; border-radius: 12px; }
.chip.gold { background: rgba(255,198,109,0.14); color: var(--gold); }
.toast { top: calc(118px + var(--safe-top)); z-index: 8; box-shadow: 0 6px 20px rgba(0,0,0,0.4); border-radius: 14px; background: rgba(20,60,36,0.92); backdrop-filter: blur(10px); }
.toast.bad { background: rgba(70,24,24,0.92); }

/* ---------- map HUD: profile, resources, alerts on top; a labelled dock at the bottom ---------- */
.tools { top: calc(118px + var(--safe-top)); }
.tool { background: var(--glass); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-radius: 14px; }
.tool svg { stroke: #8FD8FF; }
.hud.glass { flex-direction: column; align-items: stretch; gap: 8px; }
.hud-top { display: flex; align-items: center; gap: 10px; }
.hud-me { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 12px 0 0; background: none; border: 0; cursor: pointer; text-align: left; }
.hud-avatar { width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--accent); background: var(--glass); backdrop-filter: blur(14px); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 16px; flex: none; }
.hud-who { display: flex; flex-direction: column; text-shadow: 0 1px 3px rgba(0,0,0,0.8); }
.hud-who b { font-size: 15px; } .hud-who span { font-size: 12px; color: var(--soft); }
.hud-bell { position: relative; width: 44px; height: 44px; border-radius: 14px; border: 1px solid var(--line2); background: var(--glass); backdrop-filter: blur(14px); display: flex; align-items: center; justify-content: center; cursor: pointer; flex: none; }
.hud-bell svg, .dock svg, .more-item svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.hud-bell .badge, .dock .badge { position: absolute; top: 5px; right: 5px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: #FF7A6B; color: #1A1028; font-size: 10px; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.hud-res { display: flex; gap: 6px; }
.hud-res > div, .hud-res > button { color: inherit; font-family: inherit; cursor: pointer; flex: 1; min-width: 0; height: 34px; display: flex; align-items: center; justify-content: center; gap: 5px; border-radius: 12px; background: var(--glass); backdrop-filter: blur(14px); border: 1px solid var(--line); font-size: 13px; font-weight: 700; }
.hud-res i { width: 8px; height: 8px; border-radius: 4px; flex: none; }
.hud-alerts { display: flex; gap: 6px; flex-wrap: wrap; }
.sheet { left: 12px; right: 12px; bottom: calc(12px + var(--safe-bottom)); max-height: calc(100% - 180px); border-radius: 24px; padding: 14px 14px 16px; }
@media (min-width: 720px) { .sheet { left: auto; right: 16px; width: 380px; } }
.sheet:empty { display: none; }
.battle-hud.fleetbar { top: calc(118px + var(--safe-top, 0px)); right: 68px; }
.more-menu { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.more-item { min-height: 84px; border-radius: 18px; background: var(--panel2); border: 1px solid var(--line); color: var(--text); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; cursor: pointer; font-size: 13px; font-weight: 700; position: relative; }
.more-item svg { width: 24px; height: 24px; color: #CFC8FF; }
.more-item .badge { position: absolute; top: 8px; right: 10px; min-width: 18px; height: 18px; border-radius: 9px; background: #FF7A6B; color: #1A1028; font-size: 10px; font-weight: 800; display: flex; align-items: center; justify-content: center; }

/* ---------- reports: the newest one as a notification, the rest one tap away ---------- */
.notif { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 16px; background: var(--panel2); border: 1px solid var(--line); text-align: left; cursor: pointer; width: 100%; }
.notif .ic { width: 34px; height: 34px; border-radius: 11px; background: rgba(79,209,197,0.16); color: #4FD1C5; display: flex; align-items: center; justify-content: center; flex: none; }
.notif .ic svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.notif .ic.alert { background: rgba(255,142,128,0.16); color: var(--red); } .notif .ic.gold { background: rgba(255,198,109,0.16); color: var(--gold); }
.notif b { font-size: 14px; display: block; } .notif span.body { font-size: 12px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.notif.full span.body { -webkit-line-clamp: unset; display: block; }

/* ---------- planet page: tabs ---------- */
.ptabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; padding: 4px; border-radius: 14px; background: rgba(255,255,255,0.06); position: sticky; top: -12px; z-index: 2; backdrop-filter: blur(14px); }
.ptabs button { height: 38px; border-radius: 10px; border: 0; background: none; color: var(--muted); font-weight: 700; font-size: 13px; cursor: pointer; }
.ptabs button[aria-selected="true"] { background: var(--text); color: var(--accent-ink); }
.ptiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.ptile { padding: 12px; border-radius: 18px; background: var(--panel2); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.ptile span { font-size: 12px; color: var(--muted); } .ptile b { font-size: 21px; font-weight: 800; line-height: 1.05; }
.ptile .bar { height: 6px; background: rgba(255,255,255,0.08); }
.bigbtn { min-height: 52px; border-radius: 16px; font-size: 15px; }

/* Soft Glass: ship sheet */
.dialog { position: relative; }
.sg-close { position: absolute; top: 10px; right: 10px; }
.sg-head { display: flex; align-items: center; gap: 14px; padding-right: 30px; }
.shipbox.big { width: 84px; height: 84px; border-radius: 22px; background: rgba(139,124,255,0.14); border: 0; }
.sg-name { font-size: 22px; font-weight: 800; margin: 0; }
.fuelring { position: relative; width: 64px; height: 64px; flex: none; }
.fuelring > div { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; }
.fuelring b { font-size: 16px; font-weight: 800; }
.fuelring span { font-size: 9px; color: var(--muted); margin-top: 2px; }
.sg-fuel { padding: 10px 12px; }
.trio.facts .box { display: flex; flex-direction: column; gap: 2px; border-radius: 16px; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.08); }
.trio.facts b { font-size: 16px; font-weight: 800; }
.rowlist { display: flex; flex-direction: column; border-radius: 18px; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.08); padding: 0 14px; }
.rowlist button { height: 48px; display: flex; align-items: center; gap: 10px; background: none; border: 0; border-bottom: 1px solid rgba(255,255,255,0.08); padding: 0; color: var(--text); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.rowlist button:last-child { border-bottom: 0; }
.rowlist button span { flex: 1; text-align: left; }
.rowlist button svg { color: var(--muted); }
.pilotcard { border-radius: 20px; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.08); }

/* play / pause the planet's slow turn: bottom-right corner of the globe */
.globebtn { position: absolute; right: 8px; bottom: 8px; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(11,11,30,0.72); border: 1px solid rgba(255,255,255,0.18); color: #F3EEF8; cursor: pointer; padding: 0; }
.globebtn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.globebtn:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
/* contacts: Ally / Neutral / Hostile */
.contactrow { flex-wrap: wrap; }
.contactrow > .stack { flex-basis: 100%; }
.chips.stance { display: flex; gap: 6px; }
.chips.stance .chip { cursor: pointer; font-family: inherit; font-size: 12px; min-height: 32px; color: var(--muted, #9aa); }
.chips.stance .chip.on.ally { color: #7CE38B; border-color: #2E6B3A; background: #13301C; }
.chips.stance .chip.on.neutral { color: var(--cyan); border-color: #24506B; background: #102638; }
.chips.stance .chip.on.hostile { color: #FF7A7A; border-color: #6B2A2A; background: #351414; }
/* wildlife: the wild zone screen (src/ui/Wild.tsx) */
.wild { position: fixed; inset: 0; z-index: 60; background: #05050F; touch-action: none; user-select: none; -webkit-user-select: none; }
.wild-cv { position: absolute; inset: 0; width: 100%; height: 100%; display: block; image-rendering: pixelated; }
.wild-load { position: absolute; inset: 0; display: flex; flex-direction: column; gap: 8px; align-items: center; justify-content: center; text-align: center; padding: 24px; }
.wild-top { position: absolute; left: 0; right: 0; top: 0; padding: calc(10px + env(safe-area-inset-top)) 16px 10px; background: linear-gradient(rgba(8,7,22,0.88), rgba(8,7,22,0.55) 80%, rgba(8,7,22,0)); display: flex; flex-direction: column; gap: 4px; pointer-events: none; }
.wild-top > * { pointer-events: auto; }
.wild-title { font-size: 20px; }
.wild-pill { border: 1px solid rgba(160,150,230,0.3); background: rgba(14,12,34,0.85); color: var(--gold); border-radius: 99px; padding: 6px 12px; font-weight: 700; min-height: 36px; }
.wild-bar { height: 6px; border-radius: 3px; background: rgba(255,255,255,0.12); overflow: hidden; }
.wild-bar i { display: block; height: 100%; border-radius: 3px; }
.wild-scan { margin-top: 8px; align-self: flex-start; display: flex; flex-direction: column; gap: 1px; padding: 8px 14px; border-radius: 99px; background: rgba(8,7,22,0.85); border: 1px solid rgba(155,246,255,0.45); }
.wild-banner { margin-top: 8px; align-self: flex-start; max-width: 100%; display: flex; flex-direction: column; gap: 1px; text-align: left; padding: 8px 14px; border-radius: 14px; background: rgba(8,7,22,0.88); border: 1px solid rgba(160,150,230,0.3); color: inherit; }
.wild-banner.gold { border-color: rgba(255,200,87,0.7); } .wild-banner.gold b { color: var(--gold); }
.wild-banner.cyan { border-color: rgba(155,246,255,0.6); } .wild-banner.cyan b { color: #9BF6FF; }
.wild-banner.red { border-color: rgba(255,90,70,0.6); } .wild-banner.red b { color: #FF8A7A; }
.wild-bottom { position: absolute; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding: 12px 12px calc(12px + env(safe-area-inset-bottom)); background: linear-gradient(rgba(8,7,22,0), rgba(8,7,22,0.85) 35%); }
.wild-btn { display: flex; flex-direction: column; align-items: center; gap: 1px; min-height: 52px; border-radius: 16px; border: 1px solid rgba(160,150,230,0.35); background: rgba(30,26,64,0.95); color: #fff; padding: 6px 4px; }
.wild-btn b { font-size: 14px; } .wild-btn span { font-size: 10px; color: var(--muted, #A9A6D0); }
.wild-btn.on { border-color: #9BF6FF; background: rgba(40,80,110,0.95); }
.wild-btn:disabled { opacity: 0.45; }
.wild-hint { position: absolute; left: 16px; right: 16px; bottom: calc(256px + env(safe-area-inset-bottom)); text-align: center; padding: 8px 12px; border-radius: 12px; background: rgba(8,7,22,0.8); pointer-events: none; }
.wild-modal { position: absolute; inset: 0; background: rgba(5,5,15,0.6); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 5; }
.wild-modal .dialog { max-width: 360px; }
.award-medal { font-size: 48px; }
.guide-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.guide-card { display: flex; flex-direction: column; gap: 3px; padding: 8px; border-radius: 12px; background: var(--panel2); border: 1px solid var(--line); }
.guide-card.legendary { border-color: rgba(255,200,87,0.6); }
.guide-pic { height: 84px; border-radius: 8px; background: #24224A; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 6px; overflow: hidden; }
.guide-pic img { max-height: 80px; max-width: 100%; }
.guide-pic img.unknown { filter: brightness(0); opacity: 0.55; }
.pips { display: inline-flex; gap: 3px; } .pips i { width: 7px; height: 7px; background: rgba(255,255,255,0.15); border-radius: 1px; } .pips i.on { background: #9BF6FF; }
.beasts { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 6px; }
.beast { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 4px; border-radius: 10px; background: var(--panel2); border: 1px solid var(--line); text-align: center; }
.beast img { height: 40px; width: auto; max-width: 100%; object-fit: contain; }
.beast img.unknown { filter: brightness(0); opacity: 0.5; }
.medal { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 10px; border-radius: 14px; border: 1px solid rgba(255,200,87,0.6); background: radial-gradient(circle at 50% 30%, #3A2A10, #1A1838); color: inherit; min-width: 88px; }
.medal img { height: 44px; width: auto; }
img.silhouette { filter: brightness(0); opacity: 0.6; }
/* wildlife joystick: bottom-left, above the action buttons */
.wild-stick { position: absolute; left: 18px; bottom: calc(86px + env(safe-area-inset-bottom)); width: 120px; height: 120px; border-radius: 50%; touch-action: none;
  background: radial-gradient(circle, rgba(155,246,255,0.10) 0 55%, rgba(155,246,255,0.04) 56% 100%); border: 2px solid rgba(155,246,255,0.30); z-index: 2; }
.wild-stick::before { content: ''; position: absolute; inset: 34px; border-radius: 50%; border: 1px dashed rgba(155,246,255,0.18); }
.wild-stick i { position: absolute; left: 50%; top: 50%; width: 52px; height: 52px; margin: -26px 0 0 -26px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle at 40% 35%, #DDFBFF, #6FD3E8 55%, #2C7F96); box-shadow: 0 2px 8px rgba(0,0,0,0.5); transition: transform 0.12s ease-out; }
.wild-stick.on { border-color: rgba(155,246,255,0.6); }
.wild-stick.on i { transition: none; }
@media (min-width: 900px) { .wild-stick { width: 104px; height: 104px; } }
/* Codex: animals tab */
.wmedal { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 76px; padding: 6px; border-radius: 12px; background: var(--panel); border: 1px solid #FFB84D; color: inherit; cursor: pointer; }
.wmedal img { height: 34px; width: auto; }
.animalrow { align-items: flex-start; }
.animalpic { width: 56px; height: 48px; flex: none; display: flex; align-items: flex-end; justify-content: center; border-radius: 10px; background: rgba(90,140,90,0.22); overflow: hidden; }
.animalpic img { max-width: 52px; max-height: 44px; }
.animalrow.dim .animalpic { background: rgba(255,255,255,0.05); }
.animalpic img.unknown, .listrow img.unknown { filter: brightness(0); opacity: 0.5; }
.wild-stick.right { left: auto; right: 18px; }
.wild-swap { position: absolute; bottom: calc(212px + env(safe-area-inset-bottom)); left: 26px; width: 34px; height: 34px; border-radius: 50%; z-index: 2;
  border: 1px solid rgba(155,246,255,0.35); background: rgba(20,24,50,0.85); color: #9BF6FF; font-size: 16px; line-height: 1; }
.wild-swap.right { left: auto; right: 26px; }
@media (min-width: 900px) { .wild-swap { bottom: calc(196px + env(safe-area-inset-bottom)); } }
.wild-elder { margin-top: 8px; padding: 8px 10px; border-radius: 12px; background: rgba(60,14,20,0.88); border: 1px solid rgba(255,110,90,0.5); display: flex; flex-direction: column; gap: 4px; }
.wild-elder.open { background: rgba(70,52,10,0.9); border-color: #FFD86B; }
/* Codex: Elders */
.elders { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; }
.eldercard { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 4px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); color: inherit; cursor: pointer; text-align: center; }
.eldercard.on { border-color: #FF8A5C; }
.elderpic { height: 52px; display: flex; align-items: flex-end; justify-content: center; }
.elderpic img { max-height: 50px; max-width: 86px; }
.elderpic img.unknown { filter: brightness(0); opacity: 0.55; }
.eldercard.asleep { opacity: 0.55; cursor: default; }

/* guest accounts: the reminder in the account dialog and the warning's sign-out button */
.guestnote { border-style: solid; border-color: #FFC857; color: var(--text, #E8E6FF); background: rgba(255, 200, 87, 0.08); }
.btn.btn-warn { color: #FF9B73; border-color: #7A2E2E; background: rgba(226, 85, 45, 0.1); }

/* Ring View: the galaxy from above, planets circling their suns */
.ringview { position: absolute; inset: 0; }
.ringview .map { background: #04040C; }
.ring-bar { position: absolute; left: 10px; top: calc(166px + var(--safe-top)); display: flex; align-items: center; gap: 8px; padding: 6px 8px 6px 12px; border-radius: 14px; background: var(--glass, rgba(23,23,58,0.92)); border: 1px solid var(--line); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); white-space: nowrap; max-width: calc(100% - 76px); }
/* map view switcher: 3D map / Ring / Stars (owner, Nov 4) */
.viewswitch { position: absolute; left: 10px; top: calc(118px + var(--safe-top)); display: flex; gap: 2px; padding: 3px; border-radius: 14px; background: var(--glass, rgba(23,23,58,0.92)); border: 1px solid var(--line); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); z-index: 5; }
.viewswitch button { display: flex; align-items: center; gap: 5px; min-height: 36px; padding: 0 10px; border: 1px solid transparent; border-radius: 11px; background: transparent; color: var(--muted, #A3A3CC); font: 600 13px var(--body, system-ui); cursor: pointer; }
.viewswitch button svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.viewswitch button.on { background: rgba(255,200,87,0.14); border-color: var(--gold, #FFC857); color: var(--gold, #FFC857); }
.viewswitch button:focus-visible { outline: 2px solid var(--gold, #FFC857); outline-offset: 1px; }
.starview .map { background: #03030A; cursor: grab; }
.star-err { position: absolute; left: 12px; right: 12px; bottom: calc(24px + var(--safe-bottom, 0px)); margin: 0; padding: 10px 12px; border-radius: 12px; background: rgba(60,16,24,0.92); color: #FFD1D1; font-size: 13px; }
.ring-title { font-family: 'Pixelify Sans', monospace; font-size: 13px; color: #FFE9A0; overflow: hidden; text-overflow: ellipsis; }
.tool.on { border-color: var(--gold); }
.tool.on svg { stroke: var(--gold); }

/* comet impacts */
.impactbar { position: relative; height: 10px; border-radius: 6px; background: #241F3A; overflow: hidden; }
.impactbar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 6px; transition: width 0.4s; }
.impactbar .tick { position: absolute; top: 0; bottom: 0; width: 1px; background: rgba(255,255,255,0.25); z-index: 1; }
.note.impactwarn { display: block; border-color: #FF5C5C; background: rgba(255, 70, 70, 0.10); color: inherit; text-align: left; width: 100%; cursor: pointer; }
/* resource icons */
.resicon { flex: none; image-rendering: pixelated; vertical-align: -3px; margin-right: 3px; }
.hud-res .resicon { margin-right: 0; }
.resdot { width: 8px; height: 8px; border-radius: 4px; display: inline-block; flex: none; }
.cost { display: inline; white-space: normal; }
.costpart { white-space: nowrap; }
.cost .resicon { vertical-align: -2px; margin-right: 2px; }

/* ---------- tutorial quests (src/ui/Tutorial.tsx): one quest under the view switcher ---------- */
.questbar { position: absolute; left: 10px; right: 66px; max-width: 340px; top: calc(166px + var(--safe-top)); z-index: 5; border-radius: 16px; border: 1px solid var(--line); background: var(--glass, rgba(23,23,58,0.92)); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); overflow: hidden; }
.questbar.ready { border-color: rgba(255,198,109,0.7); box-shadow: 0 0 0 1px rgba(255,198,109,0.25), 0 0 18px rgba(255,198,109,0.25); }
.questbar .qhead { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; background: none; border: 0; color: inherit; text-align: left; cursor: pointer; min-height: 48px; }
.questbar .qhead b { display: block; font-size: 14px; line-height: 1.2; }
.questbar .qkicker { display: block; font-size: 11px; color: var(--muted, #A3A3CC); letter-spacing: 0.02em; }
.questbar.ready .qkicker { color: var(--gold, #FFC66D); }
.qnum { flex: none; width: 28px; height: 28px; border-radius: 9px; display: flex; align-items: center; justify-content: center; font: 700 13px var(--body, system-ui); background: rgba(155,135,255,0.18); color: #C9BCFF; }
.questbar.ready .qhead .qnum { background: rgba(255,198,109,0.2); color: var(--gold, #FFC66D); }
.questbar .qprog { font: 600 12px var(--body, system-ui); color: var(--muted, #A3A3CC); }
.questbar .qchev { width: 18px; height: 18px; flex: none; fill: none; stroke: var(--muted, #A3A3CC); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.questbar .qbody { padding: 0 12px 10px; display: flex; flex-direction: column; gap: 8px; }
.questbar .qbody p { margin: 0; color: #DCDAF5; }
.questbar .qbar { height: 6px; border-radius: 3px; background: rgba(255,255,255,0.08); overflow: hidden; }
.questbar .qbar i { display: block; height: 100%; background: linear-gradient(90deg, #9B87FF, #4FD1C5); border-radius: 3px; }
.questbar .qreward { gap: 8px; align-items: center; flex-wrap: wrap; }
.questbar .qreward .btn { min-height: 36px; padding: 0 14px; }
.questbar .qfoot { border-top: 1px solid var(--line); padding-top: 6px; }
.linkbtn { background: none; border: 0; padding: 6px 2px; color: #C9BCFF; font: 600 12px var(--body, system-ui); cursor: pointer; }
.linkbtn.muted { color: var(--muted, #A3A3CC); }
.questlist { list-style: none; margin: 4px 0 12px; padding: 0; display: flex; flex-direction: column; gap: 6px; max-height: 55vh; overflow: auto; }
.questlist li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; background: var(--panel2); border: 1px solid var(--line); }
.questlist li b { display: block; font-size: 13px; }
.questlist li.done { opacity: 0.6; }
.questlist li.done .qnum { background: rgba(79,209,197,0.18); color: #4FD1C5; }
.questlist li.now { border-color: rgba(155,135,255,0.6); }
.questlist li.later .qnum { background: rgba(255,255,255,0.06); color: var(--muted, #A3A3CC); }
.lostcard { display: flex; flex-direction: column; gap: 6px; margin: 4px 0 12px; }

/* space dungeons: the dive runs full screen in a frame (public/dungeon/index.html) */
.dungeon-screen { position: fixed; inset: 0; z-index: 70; background: #07060c; }
.dungeon-screen iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; }
.dungeon-screen .screen { height: 100%; color: #e8e4f4; padding: 24px; }
/* Codex → Wrecks: the relic collection */
.relics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.reliccard { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 4px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); text-align: center; }
.reliccard b { line-height: 1.2; }
.reliccard.missing { opacity: 0.6; }
/* planet card tabs (owner, Nov 7: design A) */
.ptabs { display: flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--panel2); flex-shrink: 0; }
.ptabs button { flex: 1; min-height: 40px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font: inherit; font-weight: 600; font-size: 14px; cursor: pointer; }
.ptabs button.on { background: #2A2A5C; color: var(--text); }
.ptiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; flex-shrink: 0; }
.ptiles > div, .ptiles > button { padding: 10px 12px; border-radius: 12px; background: var(--panel2); border: 0; color: var(--text); font: inherit; text-align: left; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ptiles > button { cursor: pointer; }
.ptiles span, .ptiles i { font-size: 12px; color: var(--muted); font-style: normal; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ptiles b { font-size: 18px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pfacts { display: flex; flex-direction: column; border-radius: 12px; background: var(--panel2); flex-shrink: 0; }
.pfacts > div { display: flex; justify-content: space-between; gap: 12px; padding: 11px 14px; font-size: 14px; }
.pfacts > div + div { border-top: 1px solid var(--line); }
.pfacts span { color: var(--muted); flex-shrink: 0; } .pfacts b { text-align: right; }
.pbtns { gap: 8px; } .pbtns .btn { min-height: 48px; }
/* quest bar while a card is open: a small pill that doesn't cover the card */
.questpill { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line2); background: rgba(23, 23, 58, 0.92); color: var(--gold); font: inherit; font-weight: 600; font-size: 13px; cursor: pointer; }
.questbar.compact { right: auto; border: 0; background: none; backdrop-filter: none; -webkit-backdrop-filter: none; overflow: visible; }

/* ---------- Peixei, the guide pet (src/ui/Peixei.tsx) ---------- */
.questbar.haspet .qhead { padding-right: 52px; }
.questbar.haspet .qchev { display: none; }
.petdock { position: absolute; right: 6px; top: 2px; width: 44px; height: 44px; padding: 0; border: 0; background: none; cursor: pointer; z-index: 1; }
.petdock canvas { width: 44px; height: 44px; image-rendering: pixelated; display: block; }
.petdock .bub { position: absolute; right: -2px; top: 0; min-width: 16px; height: 16px; border-radius: 8px; background: var(--gold, #FFC66D); color: #1A1438; font: 700 10px/16px var(--body, system-ui); text-align: center; padding: 0 4px; box-shadow: 0 0 10px rgba(255,198,109,0.6); }
.petdock .zz { position: absolute; right: 2px; top: 1px; font: 700 12px var(--body, system-ui); color: #C9BCFF; animation: petzz 2.4s ease-in-out infinite; pointer-events: none; }
@keyframes petzz { 0%, 100% { transform: translateY(0); opacity: .5; } 50% { transform: translateY(-4px); opacity: 1; } }
.petdock:focus-visible { outline: 2px solid var(--gold, #FFC66D); outline-offset: 2px; border-radius: 10px; }
.pettalk { position: absolute; left: 12px; right: 12px; bottom: calc(14px + var(--safe-bottom)); max-width: 460px; margin: 0 auto; z-index: 9; animation: petin .35s cubic-bezier(.2,.9,.3,1.2); }
@keyframes petin { from { transform: translateY(30px); opacity: 0; } }
.petportrait { position: absolute; left: 4px; top: -76px; width: 92px; height: 92px; image-rendering: pixelated; filter: drop-shadow(0 6px 10px rgba(0,0,0,0.5)); pointer-events: none; }
.petbox { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 18px 16px 14px; border-radius: 22px; background: rgba(23,23,58,0.97); border: 1.5px solid rgba(155,135,255,0.45); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: 0 12px 40px rgba(0,0,0,0.45); }
.petname { position: absolute; left: 104px; top: -12px; font: 700 13px var(--body, system-ui); letter-spacing: 0.06em; color: #1A1438; background: #4FD1C5; padding: 2px 12px; border-radius: 8px; }
.petline { margin: 2px 0 0; font-size: 15px; line-height: 1.45; min-height: 66px; cursor: pointer; }
.petline .caret { display: inline-block; width: 7px; height: 13px; margin-left: 2px; background: #9B87FF; vertical-align: -1px; animation: petcaret .8s steps(2) infinite; }
@keyframes petcaret { 50% { opacity: 0; } }
.petloss { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border-radius: 14px; background: var(--panel2); border: 1px solid var(--line); }
.petbtns { display: flex; flex-direction: column; gap: 8px; }
.petbtns.two { flex-direction: row; }
.petbtns.two .btn { flex: 1; }
.petbtns .btn.gold { background: var(--gold, #FFC66D); color: #1A1438; border-color: transparent; }
.petstep { align-self: flex-end; margin-top: -4px; font: 600 11px var(--body, system-ui); letter-spacing: 0.06em; color: var(--muted, #A3A3CC); }
@media (prefers-reduced-motion: reduce) { .pettalk, .petdock .zz, .petline .caret { animation: none; } }
/* Peixei's home name and flag colour (src/ui/Peixei.tsx NameForm) */
.petform { display: flex; flex-direction: column; gap: 8px; }
.petform input { min-height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel2); color: inherit; font: 600 15px var(--body, system-ui); padding: 0 12px; }
.petform input:focus-visible { outline: 2px solid #9B87FF; outline-offset: 1px; }
.petflags { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 6px; }
.petflag { aspect-ratio: 1; min-height: 34px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--panel2); display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.petflag svg { width: 70%; height: 70%; fill: none; stroke: #C9C6F0; stroke-width: 1.6; stroke-linecap: round; }
.petflag svg .cloth { fill: var(--flag); stroke: var(--flag); stroke-linejoin: round; }
.petflag.on { border-color: var(--flag); box-shadow: 0 0 0 2px var(--flag) inset, 0 0 12px color-mix(in srgb, var(--flag) 45%, transparent); }
.petflag:focus-visible { outline: 2px solid var(--gold, #FFC66D); outline-offset: 2px; }
/* Peixei's pointer ring */
.petpoint { position: fixed; z-index: 12; pointer-events: none; border-radius: 16px; border: 2.5px solid var(--gold, #FFC66D); box-shadow: 0 0 18px rgba(255,198,109,0.55); animation: petpulse 1.4s ease-in-out infinite; transition: left .25s, top .25s, width .25s, height .25s; }
.petpoint-tag { position: absolute; left: 50%; top: -24px; transform: translateX(-50%); white-space: nowrap; font: 700 11px var(--body, system-ui); color: #1A1438; background: var(--gold, #FFC66D); padding: 2px 8px; border-radius: 8px; }
@keyframes petpulse { 0%, 100% { outline: 0 solid rgba(255,198,109,0.5); outline-offset: 0; } 50% { outline: 8px solid rgba(255,198,109,0); outline-offset: 4px; } }
@media (prefers-reduced-motion: reduce) { .petpoint { animation: none; transition: none; } }
/* the first week's daily quest (src/ui/Daily.tsx) */
.dailyrow { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-top: 1px solid var(--line); }
.dailycard .dailyrow { border-top: 0; }
.dailyrow .dsun { flex: none; width: 28px; height: 28px; border-radius: 9px; display: flex; align-items: center; justify-content: center; background: rgba(255,198,109,0.14); color: var(--gold, #FFC66D); font-size: 15px; }
.dailyrow .dkicker { display: block; font-size: 11px; color: var(--muted, #A3A3CC); }
.dailyrow b { font-size: 13px; }
.dailyrow.ready { background: rgba(255,198,109,0.08); }
.dailyrow.ready .dkicker { color: var(--gold, #FFC66D); }
.dailyrow.claimed { opacity: 0.6; }
.dailyrow .btn.tiny { min-height: 32px; padding: 0 12px; }
/* a gold warning note (fuel: no way back, a parked ship that can't get home; Nov 8) */
.note.gold { border-color: var(--gold, #FFC66D); color: #F5DDA8; background: rgba(255,198,109,0.07); }
.note.gold b { color: var(--gold, #FFC66D); }
.note.gold.stack { flex-direction: column; align-items: stretch; }
/* quest button next to the bell and its panel (owner, Nov 8: design A) */
.hud-quest { color: var(--gold, #FFC66D); border-color: rgba(255,198,109,0.55); margin-right: 8px; }
.hud-quest.on { background: rgba(255,198,109,0.16); }
.hud-quest .qbadge { top: -6px; right: -6px; background: var(--gold, #FFC66D); color: #1A1438; }
.hud-quest .qdot { position: absolute; bottom: -3px; right: -3px; width: 13px; height: 13px; border-radius: 50%; background: #8FE36A; border: 2px solid #0B0B22; }
.hud-quest.ready { box-shadow: 0 0 0 1px rgba(143,227,106,0.5), 0 0 14px rgba(143,227,106,0.35); }
.questpanel { position: fixed; right: 10px; width: min(330px, calc(100vw - 20px)); z-index: 40; box-sizing: border-box; padding: 12px; border-radius: 16px; border: 1px solid var(--line2); background: var(--glass, rgba(23,23,58,0.96)); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: 0 14px 34px rgba(0,0,0,0.55); display: flex; flex-direction: column; gap: 10px; max-height: calc(100vh - 140px); overflow-y: auto; }
.questpanel .qbar { height: 6px; border-radius: 3px; background: rgba(255,255,255,0.08); overflow: hidden; }
.questpanel .qbar i { display: block; height: 100%; background: var(--gold, #FFC66D); border-radius: 3px; }
.questpanel .qcard { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; padding-right: 56px; border-radius: 12px; background: rgba(255,255,255,0.04); }
.questpanel .qcard.ready { background: rgba(255,198,109,0.08); }
.questpanel .qkicker { font-size: 12px; font-weight: 600; color: var(--gold, #FFC66D); }
.questpanel .qcard p { margin: 0; }
.questpanel .qreward { gap: 8px; align-items: center; flex-wrap: wrap; }
.questpanel .qreward .btn { min-height: 36px; padding: 0 14px; }
.questpanel .dailyrow { border-top: 0; border-radius: 12px; background: rgba(255,255,255,0.04); }
.questpanel .qfoot { padding-top: 2px; }
.questpanel .petdock { top: 4px; right: 4px; }

/* Settings button beside the bell (Nov 8 2026) */
.hud-set { margin-left: 0; }
.hud-who { min-width: 0; } .hud-who b, .hud-who span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hud-me { min-width: 0; flex: 0 1 auto; }
/* the map's side menu: icon + short label (design D, Nov 8); .tool.corner (music) keeps the plain square */
.tools .tool { width: 56px; height: 52px; flex-direction: column; gap: 3px; }
.tools .tool svg { stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.tools .toolmenu { gap: 6px; }
.toollabel { font-size: 10px; font-weight: 600; line-height: 1; color: var(--soft); }

/* one-time iPhone tip: add to home screen for full screen (Nov 8 2026) */
.hometip { position: fixed; left: 12px; right: 12px; bottom: calc(env(safe-area-inset-bottom) + 84px); z-index: 40; max-width: 420px; margin: 0 auto; padding: 12px 14px; border-radius: 14px; background: #17173A; border: 1px solid #FFC857; box-shadow: 0 10px 28px rgba(0,0,0,.55); display: flex; flex-direction: column; gap: 6px; }
.hometip p { margin: 0; color: #C9C6F0; line-height: 1.4; }
.hometip .btn { align-self: flex-end; }

/* character skin preview: the three looks side by side */
.looks3 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.look3 { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 4px; border-radius: 14px; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.08); }
.look3pic { height: 104px; display: flex; align-items: flex-end; justify-content: center; }
.look3pic img { max-width: 100%; height: auto; }

/* Z in Ring View (Nov 9): step through the bands of 4 layers */
.ring-z { display: flex; align-items: center; gap: 6px; }
.ring-zbtn { width: 34px; height: 34px; border-radius: 10px; border: 1px solid #3A3970; background: #12122E; color: #FFE9A0; font-size: 13px; display: flex; align-items: center; justify-content: center; padding: 0; }
.ring-zbtn:disabled { opacity: .35; }

/* Ring View Z slide bar (Nov 9): the Map's depth gauge, but you can drag it (wide hit area, thin look) */
.ringz { position: absolute; left: 0; top: 30%; height: 36%; width: 64px; touch-action: none; cursor: ns-resize; z-index: 5; }
.ringz-track { position: absolute; left: 18px; top: 0; bottom: 0; width: 2px; background: rgba(201,198,240,0.25); }
.ringz-known { position: absolute; left: 17px; width: 4px; background: rgba(94,230,255,0.75); margin-top: -2px; padding-bottom: 4px; }
.ringz-tick { position: absolute; left: 15px; width: 5px; height: 1px; background: rgba(201,198,240,0.35); }
.ringz-tick.zero { width: 8px; background: rgba(201,198,240,0.7); }
.ringz-home { position: absolute; left: 21px; width: 5px; height: 3px; margin-top: -1px; background: #9BE36A; }
.ringz-band { position: absolute; left: 14px; width: 10px; min-height: 4px; background: #FFC857; border-radius: 1px; }
.ringz-label { position: absolute; left: 27px; transform: translateY(-50%); padding: 1px 4px; background: rgba(11,11,30,0.75); color: #FFC857; font: 600 11px "Space Grotesk", system-ui, sans-serif; white-space: nowrap; pointer-events: none; }
.ringz:focus-visible { outline: 2px solid #5EE6FF; outline-offset: 2px; border-radius: 8px; }

/* ship sheet: Show on map at the top (Nov 9) */
.sg-locate { display: flex; align-items: center; justify-content: center; gap: 8px; border-color: #5EE6FF; color: #A8F2FF; }
/* a planet's own stock (…0114) */
.stockcard { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; background: rgba(255,255,255,0.02); }
.stockrow { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.stockitem { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; }

/* trade routes (…0115) */
.routestops { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.routestops li.here b { color: var(--gold, #ffd76a); }
.routeedit { border: 1px solid rgba(255,255,255,.08); border-radius: 8px; padding: 8px; }
.routegrid { display: grid; grid-template-columns: minmax(64px, 1fr) minmax(0, 88px) minmax(0, 88px); gap: 4px 6px; align-items: center; }
.routegrid input { width: 100%; min-width: 0; padding: 6px 8px; min-height: 0; height: 34px; font-size: 15px; }
.routeedit input[type=number] { padding: 6px 8px; height: 34px; font-size: 15px; }
.routeedit select, .routeadd select { background: rgba(255,255,255,.06); color: inherit; border: 1px solid rgba(255,255,255,.14); border-radius: 8px; padding: 6px 8px; height: 34px; font: inherit; }
.routeedit select option, .routeadd select option, .routeadd select optgroup { background: #1b1d2b; color: #e8e8f0; }
.raterow { display: flex; flex-wrap: wrap; gap: 4px 10px; }
.raterow > span:first-child, .raterow > span:last-child { flex-basis: 100%; }

/* daily quests, login rewards, new Bag items (…0118) */
.itemchip { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--soft); background: rgba(255,255,255,0.06); border-radius: 8px; padding: 2px 7px 2px 3px; }
.itemchip.big { font-size: 14px; padding: 4px 10px 4px 4px; }
.itemchip img { image-rendering: pixelated; }
.dailies .drow2 { display: block; margin-top: 3px; }
.dailies .dailyrow { align-items: flex-start; }
.dailies .dailyrow > .btn { align-self: center; }
.dtier { flex: none; min-width: 52px; text-align: center; font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; border-radius: 7px; padding: 4px 6px; margin-top: 1px; }
.dtier.t1 { background: rgba(107,224,138,0.15); color: var(--green); }
.dtier.t2 { background: rgba(94,200,255,0.15); color: var(--cyan); }
.dtier.t3 { background: rgba(217,168,255,0.16); color: var(--pink); }
.dtier.t0 { background: rgba(255,198,109,0.16); color: var(--gold); }
.loginrow { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 8px 12px; border: 0; border-radius: 12px; background: rgba(255,255,255,0.04); color: inherit; font: inherit; cursor: pointer; }
.loginrow .dsun { flex: none; width: 28px; height: 28px; border-radius: 9px; display: flex; align-items: center; justify-content: center; background: rgba(255,198,109,0.14); font-size: 15px; }
.loginrow .dkicker { display: block; font-size: 11px; color: var(--muted); }
.loginrow b { font-size: 13px; }
.loginrow.ready { background: rgba(255,198,109,0.1); box-shadow: inset 0 0 0 1px rgba(255,198,109,0.35); }
.loginrow.ready .dkicker { color: var(--gold); }
.loginbox { max-width: 440px; }
.logingrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.loginday { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 4px; border-radius: 12px; background: rgba(255,255,255,0.05); border: 1px solid var(--line); text-align: center; min-width: 0; }
.loginday.final { grid-column: 1 / -1; flex-direction: row; justify-content: center; gap: 12px; background: linear-gradient(135deg, rgba(255,198,109,0.12), rgba(139,124,255,0.12)); }
.loginday.today { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold), 0 0 18px rgba(255,198,109,0.25); }
.loginday.taken { opacity: .5; }
.loginday.taken > span:first-child { color: var(--green); }
.loginitems { display: flex; gap: 4px; justify-content: center; min-height: 30px; align-items: center; }
.loginitem { position: relative; display: inline-flex; }
.loginitem img { image-rendering: pixelated; }
.loginitem i { position: absolute; right: -6px; bottom: -4px; font-style: normal; font-size: 10px; font-weight: 700; background: var(--accent, #8B7CFF); color: #fff; border-radius: 6px; padding: 0 3px; }
.loginname { line-height: 1.25; overflow-wrap: anywhere; }
.loginday.final .loginname { max-width: 150px; text-align: left; }
.fxchip { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; color: var(--soft); background: rgba(255,255,255,0.06); border-radius: 8px; padding: 3px 8px 3px 4px; }
.fxchip img { image-rendering: pixelated; }
.cometlist { padding: 10px 12px; border-radius: 12px; background: rgba(94,200,255,0.07); border: 1px solid rgba(94,200,255,0.25); }

/* Crew menu (owner, Nov 10) */
.crewscreen { max-width: 480px; }
.crewlist { display: flex; flex-direction: column; gap: 6px; }
.crewrow { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,0.03); color: inherit; font: inherit; cursor: pointer; }
.crewrow:hover { background: rgba(255,255,255,0.06); }
.crewrow .spritebox { flex: none; }
.crewname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crewrole { flex: none; font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; border: 1px solid; border-radius: 6px; padding: 1px 5px; }
.crewpts { flex: none; font-size: 11px; font-weight: 700; color: #1b1d2b; background: var(--gold); border-radius: 6px; padding: 0 5px; }
.crewhead { display: flex; gap: 12px; align-items: center; }
.crewhead .charstage.small { flex: none; height: 170px; width: 128px; padding: 0 6px; }
.crewcard { padding: 10px 12px; border-radius: 12px; background: rgba(255,255,255,0.04); border: 1px solid var(--line); }
.violet { color: var(--pink); } .orange { color: #ff9a5a; }
.skingrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 6px; }
.skinpick { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 4px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255,255,255,0.03); color: inherit; font: inherit; font-size: 11px; cursor: pointer; min-width: 0; }
.skinthumb { display: flex; align-items: flex-end; justify-content: center; width: 100%; }
.skinthumb canvas { image-rendering: pixelated; }
.skinpick span { text-align: center; line-height: 1.2; overflow-wrap: anywhere; }
.skinpick.on { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold); }

/* Realm card: a person's walk-sheet standing row, breathing in place (src/ui/Realm.tsx RealmUnlocks) */
@keyframes npcIdle { from { background-position-x: 0 } to { background-position-x: -256px } }
.npcIdle { animation: npcIdle .8s steps(4) infinite }
@media (prefers-reduced-motion: reduce) { .npcIdle { animation: none } }

/* resource bar: totals over all planets, tap for each planet's share (owner, Nov 11) */
.resbarwrap { position: relative; }
button.res { border: 0; color: inherit; font: inherit; cursor: pointer; }
button.res.on { box-shadow: inset 0 0 0 1px var(--gold); }
.respop { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 40; display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border-radius: 12px; background: #141627; border: 1px solid var(--line); box-shadow: 0 10px 30px rgba(0,0,0,.55); }
.respop b { display: inline-flex; align-items: center; gap: 6px; }
.resline { display: flex; align-items: baseline; gap: 10px; font-size: 14px; }
.resline b { font-variant-numeric: tabular-nums; }
.resline > span:last-child { min-width: 64px; text-align: right; }
.hud-res > button.on { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold); }

/* the open side menu is never covered by the bottom panel (owner, Nov 12: "the ship progress bars block the menu"):
   while it's open the panel stops short of the menu's column, the menu sits on top, and a short screen scrolls it */
.game.tools-open .sheet { right: 80px; }
.tools { z-index: 6; }
.tools .toolmenu { max-height: calc(100dvh - 190px - var(--safe-top) - var(--safe-bottom)); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; }
.tools .toolmenu::-webkit-scrollbar { display: none; }

/* main character (…0128) */
.avatarlay { z-index: 90; }
.avatarmaker { gap: 10px; }
.avatarstage { height: 220px; background: radial-gradient(ellipse at 50% 85%, #2b2552 0%, #120f24 70%); }
.avatarname { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); padding: 3px 10px; border-radius: 8px; background: rgba(0,0,0,.45); color: var(--gold); font-weight: 700; z-index: 2; white-space: nowrap; }
.avatarfoot { display: flex; flex-direction: column; gap: 4px; position: sticky; bottom: -1px; z-index: 3; margin: 0 -4px; padding: 18px 4px 6px; background: linear-gradient(to bottom, transparent, var(--bg) 22px); }
.avatarfoot .btn.primary { height: 50px; font-size: 16px; }
.avatarcard { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 10px 12px; border: 1px solid var(--gold); border-radius: 14px; background: rgba(255,200,87,.07); color: inherit; font: inherit; cursor: pointer; }
.avatarcard.empty { border-style: dashed; }
.jobpick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.jobchip { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 4px 8px; border: 2px solid rgba(255,255,255,.12); border-radius: 12px; background: rgba(0,0,0,.25); color: inherit; font: inherit; cursor: pointer; min-width: 0; overflow: hidden; }
.jobchip > span:first-child { margin: -10px 0 -6px; transform: scale(.9); }
.jobchip b { font-size: 13px; }
.jobchip .tiny { text-align: center; line-height: 1.2; }
.jobchip.on { border-color: var(--jc); background: color-mix(in srgb, var(--jc) 14%, transparent); }
.jobcard { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border: 1px solid var(--jc, var(--gold)); border-radius: 14px; background: color-mix(in srgb, var(--jc, #ffc857) 8%, transparent); }
.jobcard .upper { text-transform: uppercase; letter-spacing: 1px; color: var(--jc); }
.jobxp { height: 6px; border-radius: 3px; background: rgba(255,255,255,.1); overflow: hidden; }
.jobxp i { display: block; height: 100%; background: var(--jc); }
.jobgear { display: flex; gap: 6px; flex-wrap: wrap; }
.jobgear .jg { position: relative; width: 44px; height: 44px; border: 2px solid rgba(255,255,255,.15); border-radius: 10px; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,.25); }
.jobgear .jg.empty { border-style: dashed; }
.jobgear .jg.empty .tiny { font-size: 8px; text-align: center; line-height: 1.1; }
.jobgear .jg em { position: absolute; right: 2px; bottom: 0; font: 800 9px system-ui; font-style: normal; color: #ffd36b; text-shadow: 0 1px 2px #000; }
.avatarcard .upper { text-transform: uppercase; letter-spacing: 1px; color: var(--gold); }
.tiny.bad { color: #ff7a7a; }
