/* Placeholder menu styling. Function first; the real art pass comes later. */
:root {
  --bg: #10141c;
  --panel: #1a2130;
  --panel2: #222b3d;
  --line: #36425a;
  --text: #e6ecf5;
  --dim: #8d9ab3;
  --accent: #f2a33a;
  --accent2: #4fc3f7;
  --danger: #e5534b;
  --good: #57c27a;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 15px/1.45 system-ui, sans-serif; }
#app { position: fixed; inset: 0; overflow: auto; }

.screen { min-height: 100%; display: flex; flex-direction: column; gap: 16px; padding: 20px 28px; }
.header { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; border-bottom: 2px solid var(--line); padding-bottom: 10px; }
.header h1 { margin: 0; font-size: 26px; }
.body { flex: 1; display: flex; flex-direction: column; gap: 16px; }
.footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; border-top: 2px solid var(--line); padding-top: 12px; }
.footer .row { display: flex; gap: 10px; }

.logo { font: 900 64px/1 monospace; letter-spacing: 6px; color: var(--accent); text-shadow: 4px 4px 0 #6a3a0a; }
.logo.small { font-size: 44px; text-align: center; margin: 10px 0 20px; }
.logo.tiny { font-size: 16px; letter-spacing: 2px; text-shadow: 2px 2px 0 #6a3a0a; }
.dim { color: var(--dim); }
.small { font-size: 13px; }
.grow { flex: 1; min-width: 0; }

h2 { margin: 0 0 6px; font-size: 18px; }
h3 { margin: 0 0 6px; font-size: 15px; color: var(--accent2); }

button {
  font: inherit; color: var(--text); background: var(--panel2); border: 2px solid var(--line);
  border-radius: 6px; padding: 8px 14px; cursor: pointer;
}
button:hover:not([disabled]), button:focus-visible { border-color: var(--accent); background: #2a3550; outline: none; }
button:active:not([disabled]) { transform: translateY(1px); }
button[disabled] { opacity: 0.45; cursor: not-allowed; }
button.primary { background: #6a3a0a; border-color: var(--accent); font-weight: 700; }
button.primary:hover { background: #8a4c10; }
button.danger:hover { border-color: var(--danger); }
button.icon { padding: 2px 8px; }
button.huge { font-size: 20px; padding: 12px 28px; }

input[type=text], select {
  font: inherit; color: var(--text); background: #0d1119; border: 2px solid var(--line); border-radius: 6px; padding: 6px 8px;
}
input[type=text]:focus, select:focus { border-color: var(--accent2); outline: none; }
input[type=color] { width: 40px; height: 32px; border: 2px solid var(--line); border-radius: 6px; background: none; padding: 0; }
input[type=range] { width: 200px; }

.panel { background: var(--panel); border: 2px solid var(--line); border-radius: 8px; padding: 14px; }
.col { display: flex; flex-direction: column; gap: 10px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.tag { font-size: 12px; color: var(--dim); border: 1px solid var(--line); border-radius: 4px; padding: 0 5px; white-space: nowrap; }
.tag.super { color: var(--accent); border-color: var(--accent); }
.note { background: #2a2414; border: 2px dashed #6a5a2a; border-radius: 8px; padding: 10px 14px; color: #e8d6a0; }

/* Title screen */
.title-screen { align-items: center; justify-content: center; text-align: center; cursor: pointer; }
.title-screen .logo { font-size: 96px; }
.tagline { font-size: 20px; color: var(--dim); margin-top: 8px; }
.blink { margin-top: 60px; font-size: 18px; animation: blink 1.2s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.corner { position: absolute; right: 16px; bottom: 12px; font-size: 13px; }

/* Big menu buttons */
.bigbtns { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 18px; max-width: 1100px; width: 100%; margin: 0 auto; }
.big { display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-end; gap: 4px; min-height: 150px; padding: 18px; text-align: left; }
.big-label { font-size: 24px; font-weight: 800; }
.big-sub { font-size: 14px; color: var(--dim); }
.big.danger .big-label { color: #ff9a92; }
.main-screen .body { justify-content: center; }

/* Lists (barracks, roster) */
.list { display: flex; flex-direction: column; gap: 6px; overflow: auto; }
.item { display: flex; align-items: center; gap: 10px; background: var(--panel2); border: 2px solid var(--line); border-radius: 6px; padding: 6px 10px; }
.item.click { cursor: pointer; }
.item.click:hover { border-color: var(--accent); }
.item.used { opacity: 0.4; }
.item.roster { border-left-width: 8px; flex-wrap: wrap; }
.empty { color: var(--dim); padding: 20px; text-align: center; border: 2px dashed var(--line); border-radius: 6px; }
.swatch { width: 26px; height: 26px; padding: 0; border-radius: 50%; border: 2px solid #000; }
.mini { font-size: 13px; color: var(--dim); display: flex; gap: 4px; align-items: center; }
.mini select { padding: 2px 4px; }

canvas.flag { image-rendering: pixelated; border-radius: 2px; flex: none; }
canvas.preview { width: 100%; image-rendering: pixelated; border: 2px solid var(--line); border-radius: 6px; background: #000; }

/* Create game layout */
.create-grid { display: grid; grid-template-columns: minmax(240px, 1fr) minmax(320px, 1.4fr) minmax(300px, 1.2fr); gap: 16px; flex: 1; }
@media (max-width: 1000px) { .create-grid { grid-template-columns: 1fr; } }

/* Forms */
.field { display: grid; grid-template-columns: 170px 1fr; gap: 10px; align-items: center; }
.field > label { color: var(--dim); }
.membernames { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 14px; }
.membernames label { display: flex; gap: 8px; align-items: center; color: var(--dim); }
.membernames input { flex: 1; min-width: 0; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 16px; }

/* Scheme editor */
.tabs { display: flex; gap: 6px; }
.tabs button.active { border-color: var(--accent); background: #3a2a10; }
.opt-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); gap: 14px; }
.opt { display: flex; align-items: center; gap: 10px; padding: 3px 0; }
.opt select { min-width: 150px; }
table.weapons { width: 100%; border-collapse: collapse; }
table.weapons th { text-align: left; color: var(--dim); font-weight: 600; font-size: 13px; padding: 4px 6px; }
table.weapons td { padding: 3px 6px; border-top: 1px solid var(--line); }
table.weapons tr.cat td { color: var(--accent2); font-weight: 700; padding-top: 12px; border-top: none; }
table.weapons select { padding: 2px 4px; }

table.controls td { padding: 4px 14px 4px 0; }
table.controls td:last-child { color: var(--accent); font-family: monospace; font-size: 15px; }

/* Dialog */
.overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.6); display: flex; align-items: center; justify-content: center; z-index: 10; }
.dialog { min-width: 340px; max-width: 520px; }
.dialog p { margin-top: 0; font-size: 16px; }
.dialog input { width: 100%; margin-bottom: 12px; }

/* Battle screen */
.battle { position: fixed; inset: 0; overflow: hidden; background: #000; cursor: none; }
.battle canvas { position: absolute; left: 0; top: 0; image-rendering: pixelated; }
.battle-debug { position: absolute; left: 10px; top: 8px; font: 13px/1.5 monospace; color: #fff; text-shadow: 1px 1px 0 #000; white-space: pre; pointer-events: none; }
.battle-hint { position: absolute; left: 0; right: 0; top: 8px; text-align: center; font: 13px monospace; color: #fff; text-shadow: 1px 1px 0 #000, -1px -1px 0 #000; pointer-events: none; opacity: 0.85; }
.battle-loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font: 22px monospace; color: var(--accent); }
.pause { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, 0.55); cursor: default; }
.pause[hidden] { display: none; }
.battle-toast { position: absolute; left: 50%; top: 18%; transform: translateX(-50%); font: bold 15px monospace; color: #fff; background: rgba(0, 0, 0, 0.6);
  padding: 6px 14px; border-radius: 6px; pointer-events: none; animation: toast 1.8s ease-out forwards; }
@keyframes toast { 0%, 70% { opacity: 1; } 100% { opacity: 0; } }
.battle-labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.name-label { position: absolute; transform: translate(-50%, -100%); text-align: center; font: bold 12px/1.2 monospace; white-space: nowrap;
  text-shadow: 1px 1px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000; }
.name-label span { display: block; }
.name-label b { display: inline-block; background: rgba(0, 0, 0, 0.55); padding: 0 4px; border-radius: 3px; }
.popup { position: absolute; transform: translate(-50%, -100%); font: bold 16px monospace; text-shadow: 1px 1px 0 #000, -1px -1px 0 #000;
  animation: popup 1.4s ease-out forwards; }
@keyframes popup { from { opacity: 1; margin-top: 0; } to { opacity: 0; margin-top: -40px; } }

/* Battle HUD */
.hud-bottom { position: absolute; left: 12px; right: 12px; bottom: 12px; display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; pointer-events: none; }
.hud-left { display: flex; align-items: flex-end; gap: 8px; }
.hud-weapon, .hud-wind, .hud-teams:not(:empty) { font: 13px/1.5 monospace; color: #fff; background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.15); border-radius: 6px; padding: 6px 10px; }
.hud-weapon b { font-size: 15px; color: var(--accent); }
.hud-wind { text-align: center; min-width: 170px; }
.windbar { position: relative; height: 10px; background: rgba(255, 255, 255, 0.12); border-radius: 3px; margin-top: 3px; }
.windfill { position: absolute; top: 0; bottom: 0; background: var(--accent2); border-radius: 3px; }
.windmid { position: absolute; left: 50%; top: -2px; bottom: -2px; width: 2px; margin-left: -1px; background: #fff; }
.turn-time { font: bold 30px/1 monospace; color: #fff; background: rgba(0, 0, 0, 0.6); border: 3px solid #fff; border-radius: 8px; padding: 8px 12px; min-width: 64px; text-align: center; }
.turn-time.retreat { color: #ffd24a; }
.turn-time.waiting { color: #8d9ab3; }
.round-time { font: bold 13px/1 monospace; color: #c8ccd4; background: rgba(0, 0, 0, 0.6); border-radius: 6px; padding: 4px 6px; margin-top: 4px; text-align: center; }
.round-time.sudden { color: #ff5a4a; }
.team-row .wins { color: #ffd24a; margin-left: 4px; }
.results-sub { white-space: pre-line; }
.results-awards { white-space: pre-line; text-align: left; font-size: 14px; line-height: 1.6; margin-top: 8px; color: #e8e8e8; }
.speech { position: absolute; transform: translate(-50%, -100%); background: #fff; color: #1a1d24; font: bold 12px/1.2 sans-serif; padding: 3px 7px; border-radius: 8px; border: 2px solid #888; white-space: nowrap; pointer-events: none; }
.speech::after { content: ''; position: absolute; left: 50%; bottom: -6px; margin-left: -4px; border: 4px solid transparent; border-top-color: #fff; }
.hud-teams { display: flex; flex-direction: column; gap: 2px; min-width: 260px; }
.team-row { display: grid; grid-template-columns: 120px 1fr; gap: 8px; align-items: center; font-weight: bold; opacity: 0.75; }
.team-row.active { opacity: 1; }
.team-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-shadow: 1px 1px 0 #000; }
.team-bar { height: 9px; background: rgba(255, 255, 255, 0.1); border-radius: 2px; overflow: hidden; }
.team-bar div { height: 100%; transition: width 0.15s; }
.results { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, 0.45); cursor: default; }
.results[hidden] { display: none; }
.results h1 { font-size: 34px; text-shadow: 2px 2px 0 #000; }
.fuse-label { position: absolute; transform: translate(-50%, -100%); font: bold 13px monospace; color: #fff; text-shadow: 1px 1px 0 #000, -1px -1px 0 #000; pointer-events: none; }
canvas.look-preview { width: 54px; height: 54px; image-rendering: pixelated; cursor: pointer; background: rgba(255,255,255,0.05); border-radius: 6px; flex: none; }
canvas.look-preview:hover { background: rgba(255,255,255,0.14); }
/* Weapon panel (quick right-click in battle) */
.weapon-panel { position: absolute; right: 12px; bottom: 74px; background: rgba(12, 15, 22, 0.92); border: 2px solid var(--line); border-radius: 8px;
  padding: 8px 10px; font: 12px/1.4 monospace; color: #fff; cursor: default; width: 260px; }
.weapon-panel[hidden] { display: none; }
.wp-title { font-weight: bold; color: var(--accent); margin-bottom: 4px; }
.wp-row { display: flex; align-items: center; gap: 3px; margin: 2px 0; }
.wp-cat { width: 30px; color: var(--dim); font-size: 11px; }
.wp-tile { position: relative; width: 38px; height: 34px; padding: 0; display: flex; align-items: center; justify-content: center; border-width: 1px; border-radius: 4px; }
.wp-tile canvas { width: 32px; height: 32px; image-rendering: pixelated; }
.wp-tile.off { opacity: 0.32; }
.wp-tile.sel { border-color: var(--accent); background: #3a2a10; }
.wp-badge { position: absolute; right: 1px; bottom: 0; font-size: 10px; font-weight: bold; color: #fff; text-shadow: 1px 1px 0 #000, -1px -1px 0 #000; }
.wp-info { margin-top: 6px; height: 72px; overflow: hidden; border-top: 1px solid var(--line); padding-top: 4px; } /* fixed height: a long description must never move the weapon grid */
