/* Steel Hawks — EGA-flavoured retro UI, phone first. */
:root {
  --bg: #000022; --panel: #0000aa; --panel2: #000066; --cyan: #55ffff; --yellow: #ffff55; --white: #ffffff;
  --grey: #aaaaaa; --red: #ff5555; --green: #55ff55; --line: #5555ff;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--white); overflow: hidden;
  font-family: "Lucida Console", "Courier New", ui-monospace, monospace; font-size: 14px; }
#app { height: 100%; max-width: 520px; margin: 0 auto; position: relative; }
button { font: inherit; }
small { color: var(--grey); font-weight: normal; font-size: 0.8em; }

.btn { background: var(--cyan); color: #000; border: 0; padding: 10px 14px; font-weight: bold; letter-spacing: 1px; cursor: pointer;
  box-shadow: 3px 3px 0 #000, inset -2px -2px 0 #1a8a9a; border-radius: 0; touch-action: manipulation; }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 #000; }
.btn:disabled { background: #333; color: #777; box-shadow: 3px 3px 0 #000; }
.btn.ghost { background: transparent; color: var(--cyan); box-shadow: inset 0 0 0 2px var(--cyan); }
.btn.sm { padding: 7px 9px; font-size: 12px; }
.btn.big { padding: 14px 20px; font-size: 18px; width: 100%; }

/* title */
.title { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 20px; text-align: center;
  background: repeating-linear-gradient(0deg, #000022 0 3px, #00002e 3px 4px); }
#titleArt { width: min(80vw, 380px); image-rendering: pixelated; border: 3px solid var(--white); box-shadow: 6px 6px 0 #000; }
.logo { margin: 18px 0 0; font-size: clamp(34px, 11vw, 52px); letter-spacing: 3px; line-height: 1;
  background: repeating-linear-gradient(180deg, #fff 0 3px, #55aaff 3px 5px); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(3px 3px 0 #0000aa); font-weight: 900; }
.sub { color: var(--yellow); letter-spacing: 4px; font-weight: bold; margin-top: 6px; }
.tag { color: var(--grey); line-height: 1.5; }
.col { width: min(80vw, 320px); display: flex; flex-direction: column; gap: 14px; margin-top: 8px; }
.foot { margin-top: 22px; color: #5555aa; font-size: 11px; }

/* hub */
.hub { height: 100%; display: flex; flex-direction: column; }
.bar { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; padding-top: max(12px, env(safe-area-inset-top));
  background: var(--panel); border-bottom: 3px solid var(--cyan); font-weight: bold; }
.brand { color: var(--yellow); letter-spacing: 2px; cursor: pointer; }
.money { color: var(--green); }
.scroll { flex: 1; overflow-y: auto; padding: 10px 12px 24px; -webkit-overflow-scrolling: touch; }
.tabs { display: flex; gap: 6px; padding: 8px; padding-bottom: max(8px, env(safe-area-inset-bottom)); background: var(--panel2); border-top: 3px solid var(--line); }
.tab { flex: 1; background: transparent; color: var(--cyan); border: 2px solid var(--cyan); padding: 11px 0; font-weight: bold; letter-spacing: 1px; }
.tab.on { background: var(--cyan); color: #000; }
h2 { color: var(--yellow); font-size: 14px; letter-spacing: 2px; margin: 18px 0 8px; border-bottom: 2px dashed #333399; padding-bottom: 4px; display: flex; justify-content: space-between; }
.panel { background: var(--panel2); border: 2px solid var(--line); padding: 10px; }
.panel.win { color: var(--yellow); border-color: var(--yellow); }
.stats { display: flex; justify-content: space-around; text-align: center; }
.stats b { display: block; color: var(--cyan); font-size: 18px; }
.stats span { color: var(--grey); font-size: 11px; }
.empty { color: var(--grey); padding: 24px 6px; text-align: center; }

.row { display: flex; align-items: center; gap: 10px; background: var(--panel2); border: 2px solid #22228a; padding: 8px; margin-bottom: 6px; }
.row.done { opacity: 0.6; }
.row .info { flex: 1; min-width: 0; }
.row .acts { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.row.pick { cursor: pointer; }
.row.pick.on { border-color: var(--cyan); background: #001a66; }
.chk { color: var(--cyan); font-size: 18px; }
.nm { font-weight: bold; }
.meta { color: var(--grey); font-size: 12px; margin-top: 2px; }
.rank { color: var(--yellow); }
.wreck { color: var(--red); font-size: 12px; font-weight: bold; margin-top: 4px; }
.ok { color: var(--green); font-weight: bold; font-size: 12px; }
.badge { background: var(--yellow); color: #000; padding: 0 5px; font-size: 11px; }
.hp { height: 6px; background: #300; margin-top: 5px; border: 1px solid #000; }
.hp i { display: block; height: 100%; }
.pic { flex: none; background: #2a2a10; border: 2px solid #555; display: grid; place-items: center; }
.portrait { image-rendering: pixelated; display: block; }

.card { background: var(--panel2); border: 2px solid #22228a; padding: 10px; margin-bottom: 10px; }
.card .top { display: flex; gap: 10px; }
.cls { color: var(--cyan); font-size: 12px; margin: 2px 0 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chips span { background: #000; color: var(--yellow); font-size: 11px; padding: 2px 5px; }
.wpn { color: var(--red); font-size: 12px; margin: 8px 0 4px; }
.blurb { color: var(--grey); font-size: 12px; line-height: 1.4; }
.btn.buy { width: 100%; margin-top: 10px; }

.mission { background: var(--panel2); border: 2px solid #22228a; padding: 10px; margin-bottom: 8px; }
.mission.next, .mission.contract { border-color: var(--cyan); cursor: pointer; }
.mission.done { opacity: 0.55; }
.mission.locked { opacity: 0.4; }
.mission .btn { width: 100%; margin-top: 8px; }
.brief { color: var(--grey); font-size: 13px; line-height: 1.4; margin: 6px 0; }
.foes { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0; }
.foes span { background: #400; color: #ffaaaa; font-size: 11px; padding: 2px 6px; }
.pay { color: var(--green); font-size: 12px; }

.tons { color: var(--green); }
.tons.over { color: var(--red); }
.meter { height: 10px; background: #000; border: 2px solid var(--line); margin-bottom: 10px; }
.meter i { display: block; height: 100%; background: repeating-linear-gradient(90deg, var(--cyan) 0 6px, #1a8a9a 6px 8px); }
.launch { margin: 0; }

/* battle */
.battle { height: 100%; display: flex; flex-direction: column; background: #000; }
.hud { display: flex; align-items: center; justify-content: space-between; gap: 5px; padding: 6px 8px; background: var(--panel2); }
.hud.top { padding-top: max(6px, env(safe-area-inset-top)); font-weight: bold; border-bottom: 2px solid var(--line); }
.hud.bottom { padding-bottom: max(8px, env(safe-area-inset-bottom)); border-top: 2px solid var(--line); }
.hud.bottom .btn { flex: 1; padding: 10px 2px; }
.hud .us { color: var(--cyan); } .hud .them { color: var(--red); }
.btn.armed { background: var(--red); color: #fff; }
.stage { flex: 1; min-height: 0; display: grid; place-items: center; position: relative; }
#field { image-rendering: pixelated; touch-action: none; display: block; }
.hint { position: absolute; bottom: 8px; left: 0; right: 0; text-align: center; font-size: 12px; color: var(--yellow);
  text-shadow: 1px 1px 0 #000; pointer-events: none; transition: opacity 0.6s; }

.debrief { position: absolute; inset: 0; background: rgba(0, 0, 30, 0.82); display: grid; place-items: center; padding: 16px; z-index: 5; }
.debrief .box { width: 100%; max-height: 100%; overflow-y: auto; background: var(--panel); border: 3px solid var(--white); box-shadow: 6px 6px 0 #000; padding: 16px; }
.debrief h1 { margin: 0 0 8px; text-align: center; letter-spacing: 4px; font-size: 32px; }
.debrief h1.won { color: var(--yellow); } .debrief h1.lost { color: var(--red); }
.debrief .pay { font-size: 14px; text-align: center; margin-bottom: 10px; }
.sal { background: #003300; border: 2px solid var(--green); padding: 8px; margin-bottom: 8px; color: var(--green); }
.promo { color: var(--yellow); margin-bottom: 4px; }
.loss { color: var(--red); margin-bottom: 8px; }
.dlist { margin: 10px 0 14px; }
.dl { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; padding: 4px 0; border-bottom: 1px dotted #5555ff; }
.dl span:last-child { color: var(--yellow); white-space: nowrap; }

.toast { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); background: var(--yellow); color: #000; padding: 10px 14px;
  font-weight: bold; box-shadow: 4px 4px 0 #000; z-index: 10; max-width: 90vw; text-align: center; }
