:root {
  --bg: #03060e;
  --ink: #eaf6ff;
  --dim: #8095b8;
  --cyan: #3cf0ff;
  --pink: #ff3cf0;
  --gold: #ffd166;
  --red: #ff3d5a;
  --green: #5dff9b;
  --panel: rgba(10, 16, 36, 0.82);
  --panel2: rgba(18, 26, 52, 0.9);
  --line: rgba(120, 200, 255, 0.18);
  --st: env(safe-area-inset-top, 0px);
  --sb: env(safe-area-inset-bottom, 0px);
  --head: 'Orbitron', 'Avenir Next', system-ui, sans-serif;
  --body: 'Rajdhani', 'Avenir Next Condensed', system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body {
  margin: 0; height: 100%; background: var(--bg); color: var(--ink); overflow: hidden;
  font-family: var(--body); touch-action: none; overscroll-behavior: none;
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent;
}
button { font-family: inherit; color: inherit; border: none; background: none; cursor: pointer; padding: 0; touch-action: manipulation; }
.hidden { display: none !important; }
#cv { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }

/* ---------- HUD ---------- */
#hud {
  position: fixed; top: 0; left: 0; right: 0; z-index: 5;
  padding: calc(var(--st) + 6px) 10px 6px;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  background: linear-gradient(to bottom, rgba(3,6,14,0.9), rgba(3,6,14,0));
}
.hud-l, .hud-r { display: flex; gap: 6px; flex: 1; }
.hud-r { justify-content: flex-end; }
.pill {
  display: flex; align-items: center; gap: 5px; height: 34px; padding: 0 11px 0 9px;
  border-radius: 17px; background: var(--panel); border: 1px solid var(--line);
  font: 700 15px var(--head); letter-spacing: 0.5px;
}
.pill .ic { font-size: 14px; }
.lives .ic { color: var(--cyan); text-shadow: 0 0 8px var(--cyan); }
.credits .ic { color: var(--gold); text-shadow: 0 0 8px var(--gold); }
.pill.flash { animation: pillflash 0.4s; }
@keyframes pillflash { 0% { background: rgba(255,61,90,0.6); } 100% { background: var(--panel); } }
.hud-c { text-align: center; line-height: 1; }
.hud-c .lbl { font: 600 10px var(--head); letter-spacing: 3px; color: var(--dim); }
#hWave { font: 900 19px var(--head); margin-top: 2px; text-shadow: 0 0 12px rgba(60,240,255,0.5); }
.hbtn {
  width: 38px; height: 34px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line);
  font: 700 14px var(--head);
}
#bSpeed { width: auto; min-width: 38px; padding: 0 6px; }
.hbtn.on { color: var(--gold); border-color: rgba(255,209,102,0.5); box-shadow: 0 0 10px rgba(255,209,102,0.3); }

/* ---------- Boss bar ---------- */
#bossbar {
  position: fixed; left: 50%; transform: translateX(-50%); top: calc(var(--st) + 50px); z-index: 4;
  width: min(80vw, 340px); text-align: center; pointer-events: none;
}
#bossName { font: 900 11px var(--head); letter-spacing: 4px; color: #ff6b81; text-shadow: 0 0 10px #ff3d5a; margin-bottom: 3px; }
#bossbar .track { position: relative; height: 7px; border-radius: 4px; background: rgba(255,255,255,0.1); overflow: hidden; border: 1px solid rgba(255,61,90,0.4); }
#bossFill { position: absolute; inset: 0; background: linear-gradient(90deg, #ff3d5a, #ff8a5c); box-shadow: 0 0 10px #ff3d5a; transform-origin: left; }
#bossShield { position: absolute; left: 0; right: 0; top: 0; height: 2px; background: #5ab8ff; transform-origin: left; z-index: 2; }

/* ---------- New-threat chip (bottom bar) & enemy info ---------- */
#threat {
  flex: 1 1 auto; min-width: 0; max-width: 190px; height: 40px; margin: 0 auto; padding: 0 12px 0 2px; border-radius: 20px;
  display: flex; align-items: center; gap: 4px; background: var(--panel); border: 1.5px solid rgba(255,61,110,0.7);
  box-shadow: 0 0 14px rgba(255,61,110,0.35); text-align: left; animation: threatIn 0.35s cubic-bezier(.2,1.4,.4,1), threatGlow 1.2s 0.35s infinite alternate;
}
#threat canvas { width: 32px; height: 32px; flex: none; }
#threat span { min-width: 0; font: 900 11px var(--head); letter-spacing: 1px; color: #ff9db0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.15; }
#threat small { display: block; font: 700 9px var(--head); letter-spacing: 1.5px; color: #ff3d6e; }
@keyframes threatIn { from { transform: scale(0.6); opacity: 0; } }
@keyframes threatGlow { to { box-shadow: 0 0 22px rgba(255,61,110,0.6); border-color: #ff3d6e; } }
#bossbar { pointer-events: auto; cursor: pointer; }
.esheet { max-height: 86vh; overflow-y: auto; }
.einfo { display: flex; gap: 10px; text-align: left; padding: 10px 0; border-top: 1px solid var(--line); }
.sheet .einfo canvas { width: 56px; height: 56px; flex: none; margin: 0; aspect-ratio: auto; border-radius: 0; }
.einfo .et { min-width: 0; flex: 1; }
.einfo .en { font: 900 15px var(--head); letter-spacing: 1.5px; color: #ff9db0; }
.einfo .en em { font: 700 9px var(--head); font-style: normal; letter-spacing: 1px; color: var(--gold); border: 1px solid rgba(255,209,102,0.5); border-radius: 5px; padding: 1px 4px; vertical-align: middle; }
.einfo .ed { font: 600 14px var(--body); color: var(--ink); line-height: 1.2; margin: 2px 0; }
.estats { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.estats div { background: rgba(255,255,255,0.05); border-radius: 7px; padding: 3px 7px; text-align: center; }
.estats b { display: block; font: 700 12px var(--head); }
.estats span { font: 600 9px var(--body); color: var(--dim); letter-spacing: 1px; }
.tgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 8px 0 12px; }
.tgrid button { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 4px 2px; display: flex; flex-direction: column; align-items: center; }
.sheet .tgrid canvas { width: 40px; height: 40px; margin: 0; aspect-ratio: auto; border-radius: 0; }
.tgrid small { font: 600 10px var(--body); color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }

/* ---------- Dock ---------- */
#dock { position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; padding: 0 8px calc(var(--sb) + 8px); }
#actionRow { height: 50px; position: relative; z-index: 4; transition: transform 0.18s ease-out; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
#abilities { display: flex; gap: 6px; min-width: 60px; }
.abtn {
  position: relative; width: 42px; height: 42px; border-radius: 50%; background: var(--panel);
  border: 1.5px solid var(--c); font-size: 18px; color: var(--c); text-shadow: 0 0 8px var(--c);
  box-shadow: 0 0 14px color-mix(in srgb, var(--c) 35%, transparent); overflow: hidden;
}
.abtn .cdm { position: absolute; inset: 0; background: conic-gradient(rgba(3,6,14,0.82) var(--p), transparent 0); border-radius: 50%; }
.abtn.cool { opacity: 0.7; box-shadow: none; }
.abtn.arm { animation: pulse 0.7s infinite alternate; background: color-mix(in srgb, var(--c) 30%, var(--panel)); }
@keyframes pulse { to { transform: scale(1.1); } }
#hint { flex: 1; text-align: center; font: 600 13px var(--body); color: var(--dim); letter-spacing: 0.5px; line-height: 1.1; }
#bNext {
  height: 40px; min-width: 96px; padding: 0 14px; border-radius: 20px; position: relative; overflow: hidden;
  background: linear-gradient(135deg, rgba(60,240,255,0.25), rgba(255,60,240,0.25)); border: 1.5px solid var(--cyan);
  font: 900 12px var(--head); letter-spacing: 1px; box-shadow: 0 0 18px rgba(60,240,255,0.35);
}
#bNext .bon { display: block; font: 700 10px var(--body); color: var(--gold); letter-spacing: 0.5px; margin-top: 1px; }
#bNext .fill { position: absolute; left: 0; top: 0; bottom: 0; background: rgba(60,240,255,0.18); z-index: -1; }
#bNext.go { animation: pulse 0.8s infinite alternate; }
#bNext.off { opacity: 0; pointer-events: none; }

#towerBar { display: flex; gap: 5px; overflow-x: auto; scrollbar-width: none; }
#towerBar::-webkit-scrollbar { display: none; }
.tbtn {
  flex: 1 0 0; min-width: 40px; height: 74px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; position: relative;
  transition: transform 0.12s, border-color 0.12s;
}
.tbtn canvas { width: 36px; height: 36px; pointer-events: none; }
.tbtn .cost { font: 700 11px var(--head); color: var(--gold); }
.tbtn.sel { border-color: var(--c); box-shadow: 0 0 16px color-mix(in srgb, var(--c) 50%, transparent), inset 0 0 12px color-mix(in srgb, var(--c) 25%, transparent); transform: translateY(-4px); }
.tbtn.poor { opacity: 0.5; }
.tbtn.poor .cost { color: var(--red); }
.tbtn.locked { opacity: 0.35; }
.tbtn.locked .cost { color: var(--dim); font-size: 9px; }
.tbtn:active { transform: scale(0.94); }

/* ---------- Tower panel ---------- */
#towerPanel {
  position: absolute; left: 8px; right: 8px; bottom: calc(var(--sb) + 8px);
  background: #0b1230; border: 1px solid var(--c, var(--line)); border-radius: 16px; padding: 10px 12px; z-index: 3;
  box-shadow: 0 0 24px color-mix(in srgb, var(--c, #3cf0ff) 25%, transparent);
  animation: panelIn 0.18s ease-out;
}
@keyframes panelIn { from { transform: translateY(20px); opacity: 0; } }
.tp-head { display: flex; align-items: center; gap: 10px; }
.tp-head canvas { width: 38px; height: 38px; }
.tp-name { font: 900 15px var(--head); letter-spacing: 1px; color: var(--c); }
.tp-sub { font: 600 12px var(--body); color: var(--dim); }
.tp-x { margin-left: auto; width: 34px; height: 34px; border-radius: 10px; background: rgba(255,255,255,0.06); font-size: 16px; }
.tp-stats { display: flex; gap: 6px; margin: 8px 0; }
.tp-stat { flex: 1; background: rgba(255,255,255,0.04); border-radius: 8px; padding: 4px 6px; text-align: center; }
.tp-stat b { display: block; font: 700 13px var(--head); }
.tp-stat b i { font-style: normal; color: var(--green); font-size: 10px; }
.tp-stat span { font: 600 10px var(--body); color: var(--dim); letter-spacing: 1px; }
.tp-btns { display: flex; gap: 6px; }
.tp-btn {
  flex: 1; min-height: 46px; border-radius: 11px; background: rgba(255,255,255,0.06); border: 1px solid var(--line);
  font: 700 11px var(--head); letter-spacing: 0.5px; padding: 4px; line-height: 1.2;
}
.tp-btn small { display: block; font: 600 11px var(--body); color: var(--dim); letter-spacing: 0; }
.tp-btn.up { background: color-mix(in srgb, var(--c) 18%, transparent); border-color: var(--c); }
.tp-btn.up small { color: var(--gold); }
.tp-btn.spec { flex: 1.4; text-align: left; padding: 6px 8px; }
.tp-btn.spec small { color: var(--ink); opacity: 0.75; font-size: 11px; }
.tp-btn.spec em { font-style: normal; color: var(--gold); float: right; }
.tp-btn.dis { opacity: 0.4; }
.tp-btn.sell small { color: var(--gold); }

/* ---------- Toasts ---------- */
#toast { position: fixed; left: 12px; right: 12px; top: 30%; z-index: 7; pointer-events: none; text-align: center; }
.tst { font: 900 clamp(22px, 8.5vw, 34px) var(--head); letter-spacing: clamp(2px, 1.2vw, 6px); color: #fff; text-shadow: 0 0 18px var(--cyan), 0 0 40px var(--cyan); animation: tstIn 1.6s forwards; }
.tst.boss { color: #ffd0d8; font-size: clamp(20px, 7.5vw, 30px); letter-spacing: 3px; text-shadow: 0 0 18px var(--red), 0 0 40px var(--red); animation: tstBoss 2.6s forwards; }
.tst.boss small { display: block; font: 600 15px var(--body); letter-spacing: 1px; color: #ffb3c0; margin-top: 6px; text-shadow: none; }
.tst.small { font-size: 15px; letter-spacing: 2px; color: var(--gold); text-shadow: 0 0 12px rgba(255,209,102,0.7); margin-top: 60px; animation: tstSmall 1.5s forwards; }
@keyframes tstIn { 0% { transform: scale(2.2); opacity: 0; filter: blur(8px); } 15% { transform: scale(1); opacity: 1; filter: none; } 75% { opacity: 1; } 100% { transform: scale(0.9); opacity: 0; } }
@keyframes tstBoss { 0% { transform: scale(3); opacity: 0; } 10% { transform: scale(1); opacity: 1; } 20%,40%,60% { opacity: 0.4; } 30%,50%,70% { opacity: 1; } 85% { opacity: 1; } 100% { opacity: 0; } }
@keyframes tstSmall { 0% { transform: translateY(10px); opacity: 0; } 15% { transform: none; opacity: 1; } 80% { opacity: 1; } 100% { transform: translateY(-14px); opacity: 0; } }

/* ---------- Screens ---------- */
.screen {
  position: fixed; inset: 0; z-index: 10; display: flex; flex-direction: column; align-items: center;
  padding: calc(var(--st) + 16px) 16px calc(var(--sb) + 16px); overflow-y: auto; touch-action: pan-y;
  animation: fadeIn 0.25s;
}
.screen.dim { background: rgba(3, 6, 14, 0.72); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); justify-content: center; }
@keyframes fadeIn { from { opacity: 0; } }
.title { text-align: center; }
.title h1 {
  margin: 0; font: 900 clamp(44px, min(15.5vw, 11vh), 84px) var(--head); letter-spacing: 0.04em; padding-left: 0.04em; line-height: 0.95;
  background: linear-gradient(100deg, #3cf0ff, #b47cff 45%, #ff3cf0); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 18px rgba(120,160,255,0.55));
  animation: shimmer 4s ease-in-out infinite;
}
@keyframes shimmer { 50% { filter: drop-shadow(0 0 30px rgba(255,60,240,0.7)); } }
.title h2 { margin: 6px 0 0; font: 700 clamp(15px, 4.6vw, 22px) var(--head); letter-spacing: 14px; color: var(--ink); padding-left: 14px; opacity: 0.9; }
/* home: the title and buttons sit together as one group, a little above center, whatever the screen height */
.screen.home { justify-content: center; padding-bottom: calc(var(--sb) + 16px + 7vh); }
.title::after { content: ''; display: block; width: 72%; height: 2px; margin: clamp(12px, 2.2vh, 20px) auto 0; border-radius: 1px;
  background: linear-gradient(90deg, transparent, #3cf0ff 25%, #b47cff 50%, #ff3cf0 75%, transparent); opacity: 0.75; box-shadow: 0 0 12px rgba(180,124,255,0.6); }
.menu-btns { display: flex; flex-direction: column; gap: 14px; width: min(82vw, 320px); margin-top: clamp(36px, 8vh, 84px); }
.btn {
  height: 58px; border-radius: 16px; font: 900 17px var(--head); letter-spacing: 3px;
  background: var(--panel); border: 1.5px solid var(--line); position: relative;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  transition: transform 0.1s;
}
.btn:active { transform: scale(0.96); }
.btn.primary { border-color: var(--cyan); background: linear-gradient(135deg, rgba(60,240,255,0.22), rgba(180,124,255,0.22)); box-shadow: 0 0 26px rgba(60,240,255,0.35), inset 0 0 20px rgba(60,240,255,0.12); }
.btn.gold { border-color: rgba(255,209,102,0.6); box-shadow: 0 0 18px rgba(255,209,102,0.2); }
.btn .badge { font: 700 13px var(--head); color: var(--gold); letter-spacing: 1px; }
.btn.small { height: 46px; font-size: 13px; letter-spacing: 2px; border-color: rgba(120,200,255,0.28); }
.ver { position: absolute; bottom: calc(var(--sb) + 8px); font: 600 11px var(--body); color: var(--dim); opacity: 0.6; letter-spacing: 1px; }

.topbar { width: 100%; max-width: 560px; display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.topbar h3 { margin: 0; flex: 1; font: 900 20px var(--head); letter-spacing: 4px; }
.back { width: 42px; height: 42px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); font-size: 18px; }
.shardpill { display: flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border-radius: 18px; background: var(--panel); border: 1px solid rgba(180,124,255,0.45); font: 700 15px var(--head); }
.shardpill .ic { color: #c69bff; text-shadow: 0 0 10px #b47cff; }

.lvgrid { width: 100%; max-width: 560px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding-bottom: 20px; }
.lvcard {
  border-radius: 16px; background: var(--panel); border: 1px solid var(--line); padding: 8px; text-align: left; position: relative; overflow: hidden;
  transition: transform 0.1s;
}
.lvcard:active { transform: scale(0.97); }
.lvcard canvas { width: 100%; aspect-ratio: 9 / 14; border-radius: 10px; display: block; }
.lvcard .n { font: 900 13px var(--head); letter-spacing: 1px; margin-top: 7px; }
.lvcard .n span { color: var(--dim); font-size: 10px; margin-right: 4px; }
.lvcard .m { display: flex; justify-content: space-between; align-items: center; margin-top: 2px; font: 600 12px var(--body); color: var(--dim); }
.stars { color: #39405a; font-size: 15px; letter-spacing: 1px; }
.stars b { color: var(--gold); text-shadow: 0 0 8px var(--gold); font-weight: normal; }
.lvcard.locked { opacity: 0.4; }
.lvcard.locked::after { content: '🔒'; position: absolute; top: 40%; left: 50%; transform: translate(-50%, -50%); font-size: 30px; filter: grayscale(1); }
.lvcard.next { border-color: var(--cyan); box-shadow: 0 0 18px rgba(60,240,255,0.3); }

.sheet { width: min(92vw, 380px); background: var(--panel2); border: 1px solid var(--line); border-radius: 20px; padding: 18px; text-align: center; animation: panelIn 0.2s; }
.sheet h3 { margin: 0 0 4px; font: 900 22px var(--head); letter-spacing: 3px; }
.sheet p { margin: 4px 0 14px; color: var(--dim); font: 600 15px var(--body); }
.sheet .btns { display: flex; flex-direction: column; gap: 10px; }
.sheet canvas { width: 46%; aspect-ratio: 9 / 14; border-radius: 12px; margin: 6px auto 10px; display: block; }

.lablist { width: 100%; max-width: 560px; display: flex; flex-direction: column; gap: 9px; padding-bottom: 20px; }
.labsec { font: 700 11px var(--head); letter-spacing: 3px; color: var(--dim); margin: 8px 2px 0; }
.labrow { display: flex; align-items: center; gap: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 10px 10px 10px 12px; }
.labrow .ic { width: 42px; height: 42px; flex: none; border-radius: 12px; display: grid; place-items: center; font-size: 21px; color: #c69bff; background: rgba(180,124,255,0.12); text-shadow: 0 0 10px #b47cff; }
.labrow .info { flex: 1; min-width: 0; }
.labrow .nm { font: 700 13px var(--head); letter-spacing: 1px; }
.labrow .ds { font: 600 13px var(--body); color: var(--dim); line-height: 1.15; }
.labrow .pips { display: flex; gap: 3px; margin-top: 4px; }
.labrow .pips i { width: 10px; height: 4px; border-radius: 2px; background: rgba(255,255,255,0.12); }
.labrow .pips i.on { background: #c69bff; box-shadow: 0 0 6px #b47cff; }
.labrow .pips i.lock { background: rgba(255,255,255,0.04); outline: 1px dashed rgba(255,255,255,0.12); outline-offset: -1px; }
.labrow .pips.fine { gap: 2px; }
.labrow .pips.fine i { width: 6px; }
.labrow .pips .lvn { margin-left: 5px; font: 700 10px var(--head); color: var(--dim); line-height: 4px; }
.labrow.locked { opacity: 0.45; }
.buy.gate { border-color: var(--line); background: none; color: var(--dim); font-size: 11px; }
.buy { min-width: 70px; height: 42px; border-radius: 12px; border: 1.5px solid rgba(180,124,255,0.6); background: rgba(180,124,255,0.15); font: 700 13px var(--head); }
.buy.no { opacity: 0.4; }
.buy.max { border-color: var(--line); background: none; color: var(--dim); font-size: 11px; }
.labrow.flash { animation: labflash 0.5s; }
@keyframes labflash { 0% { background: rgba(180,124,255,0.5); } }

.endt { font: 900 clamp(38px, 11vw, 60px) var(--head); letter-spacing: 6px; margin: 0; }
.endt.win { color: #fff; text-shadow: 0 0 20px var(--cyan), 0 0 50px var(--cyan); }
.endt.lose { color: #ffd0d8; text-shadow: 0 0 20px var(--red), 0 0 50px var(--red); }
.bigstars { font-size: 52px; letter-spacing: 8px; margin: 10px 0; color: #2b3048; }
.bigstars b { color: var(--gold); text-shadow: 0 0 18px var(--gold); font-weight: normal; display: inline-block; animation: starIn 0.5s cubic-bezier(.2,1.6,.4,1) both; }
@keyframes starIn { from { transform: scale(3) rotate(-90deg); opacity: 0; } }
.endstats { display: flex; gap: 10px; justify-content: center; margin: 6px 0 12px; }
.endstats div { background: rgba(255,255,255,0.05); border-radius: 10px; padding: 6px 12px; }
.endstats b { display: block; font: 700 18px var(--head); }
.endstats span { font: 600 11px var(--body); color: var(--dim); letter-spacing: 1px; }
.reward { font: 700 22px var(--head); color: #d9b8ff; text-shadow: 0 0 14px #b47cff; margin: 4px 0 8px; }
.unlock { font: 700 13px var(--head); letter-spacing: 1px; color: var(--gold); margin: 4px 0; padding: 8px; border: 1px dashed rgba(255,209,102,0.5); border-radius: 10px; }

.toggle { display: flex; align-items: center; justify-content: space-between; background: rgba(255,255,255,0.04); border-radius: 12px; padding: 12px 14px; font: 700 14px var(--head); letter-spacing: 1px; }
.toggle .sw { width: 50px; height: 28px; border-radius: 14px; background: rgba(255,255,255,0.12); position: relative; transition: background 0.2s; }
.toggle .sw::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform 0.2s; }
.toggle.on .sw { background: var(--cyan); box-shadow: 0 0 12px var(--cyan); }
.toggle.on .sw::after { transform: translateX(22px); }
.toggle .tl { min-width: 98px; flex: none; white-space: nowrap; text-align: left; }
.toggle .vol { flex: 1; min-width: 0; margin: 0 12px 0 4px; accent-color: var(--cyan); height: 28px; }
.toggle:not(.on) .vol { opacity: 0.35; }
.howto { text-align: left; font: 600 15px var(--body); color: var(--ink); line-height: 1.35; }
.howto b { color: var(--cyan); }
.btn .sub { display: block; font: 600 11px var(--body); letter-spacing: 1px; opacity: 0.75; margin-top: 2px; text-transform: none; }
.btn:has(.sub) { flex-direction: column; gap: 0; height: 64px; }

/* v0.2: damage types, sector rules, research */
.dchip { display: inline-flex; align-items: center; gap: 3px; padding: 1px 6px; margin: 0 3px 2px 0; border-radius: 6px; font: 700 10px var(--body); letter-spacing: 0.5px; color: var(--d); background: color-mix(in srgb, var(--d) 14%, transparent); border: 1px solid color-mix(in srgb, var(--d) 45%, transparent); vertical-align: middle; }
.resline { margin-top: 4px; display: flex; flex-wrap: wrap; align-items: center; gap: 2px; }
.resline b { font: 900 9px var(--head); letter-spacing: 1px; margin-right: 3px; }
.resline b.w { color: var(--green); }
.resline b.r { color: #ff6b7a; margin-left: 6px; }
.actsec { grid-column: 1 / -1; font: 900 12px var(--head); letter-spacing: 3px; color: var(--dim); padding: 8px 2px 0; border-bottom: 1px solid var(--line); }
.mods { display: flex; flex-direction: column; gap: 3px; margin: -6px 0 10px; font: 700 13px var(--body); color: #ffb84d; }
.threats { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; margin: -4px 0 14px; }
.threats canvas { width: 28px; height: 28px; }
.labnote { font: 600 12px var(--body); color: var(--dim); margin: -2px 2px 8px; }
.labrow .ic canvas { width: 34px; height: 34px; }
.labrow .ds .vs { color: #ff8a96; font-size: 11px; }
.sheet p.fine { font-size: 12px; margin: 0 0 6px; }
.labrow .pips i.ms { box-shadow: 0 0 0 1.5px var(--gold); }
.labrow .ds .cap { color: var(--gold); font-size: 12px; }
