* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: #10151a; color: #e8e4d8; font-family: system-ui, -apple-system, 'Segoe UI', sans-serif; }
#app { max-width: 1180px; margin: 0 auto; padding: 0 10px 30px; }
#topbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 2px; border-bottom: 1px solid #2a343e; flex-wrap: wrap; }
.brand { font-weight: 800; letter-spacing: 0.12em; font-size: 17px; }
.brand .sub { color: #9fb4a4; font-size: 11px; letter-spacing: 0.18em; margin-left: 6px; }
#turninfo { color: #c9d4c5; font-size: 13.5px; }
button { font: inherit; cursor: pointer; border-radius: 8px; border: 1px solid #46545f; background: #1d262e; color: #e8e4d8; padding: 8px 13px; }
button:hover { background: #27333d; }
button:disabled { opacity: 0.45; cursor: default; }
button.primary { background: #37507e; border-color: #5b84c4; font-weight: 700; padding: 11px 20px; }
button.danger { background: #6e3535; border-color: #c45b5b; }
button.ghost { padding: 6px 10px; font-size: 13px; }
.screen { padding-top: 14px; }
.hidden { display: none !important; }
h1 { font-size: 24px; margin: 6px 0 8px; }
h2 { font-size: 17px; margin: 14px 0 6px; }
h3 { font-size: 13px; letter-spacing: 0.14em; color: #9fb4a4; margin: 16px 0 6px; text-transform: uppercase; }
.lede { color: #c9d4c5; line-height: 1.45; max-width: 72ch; }
.fine { color: #93a294; font-size: 12.5px; line-height: 1.45; }
.cards { display: flex; gap: 12px; flex-wrap: wrap; margin: 14px 0; }
.card { flex: 1 1 300px; text-align: left; padding: 16px; background: #17202a; border: 1px solid #33424e; }
.card:hover { border-color: #7ea4dd; }
.cname { font-weight: 800; font-size: 19px; letter-spacing: 0.06em; }
.cbuff { margin: 7px 0 5px; color: #e8e4d8; }
.cnote { color: #93a294; font-size: 13px; line-height: 1.4; }
.cpick { margin-top: 10px; font-weight: 700; color: #ffd75e; }
#setup-map, #map { width: 100%; height: auto; display: block; border: 1px solid #2a343e; border-radius: 10px; touch-action: manipulation; }
#audit-box { background: #0c1116; border: 1px solid #2a343e; border-radius: 8px; padding: 10px 12px; font-size: 12.5px; line-height: 1.5; white-space: pre-wrap; color: #b9d2ae; }
#campaign-grid { display: grid; grid-template-columns: minmax(0, 1fr) 318px; gap: 12px; align-items: start; }
@media (max-width: 860px) { #campaign-grid { grid-template-columns: 1fr; } }
#panel { background: #141c23; border: 1px solid #2a343e; border-radius: 10px; padding: 12px 14px; }
#phase-box { border-bottom: 1px solid #2a343e; padding-bottom: 10px; margin-bottom: 10px; }
#phase-box .ph { font-weight: 800; letter-spacing: 0.08em; }
#log { max-height: 300px; overflow-y: auto; font-size: 12.5px; line-height: 1.5; color: #b9c4b4; }
#log div { padding: 3px 0; border-bottom: 1px dashed #22303a; }
#bill-box { font-size: 13px; color: #d8c9a3; }
.kv { display: flex; justify-content: space-between; gap: 8px; padding: 2px 0; font-size: 13.5px; }
.kv b { color: #fff; }
input[type=range] { width: 100%; }
.act { display: flex; flex-direction: column; gap: 7px; margin-top: 10px; }
.act button { width: 100%; }
#battlewrap { position: relative; width: 100%; height: min(66vh, 560px); background: #0b0e11; border: 1px solid #2a343e; border-radius: 10px; overflow: hidden; touch-action: none; }
#battlewrap canvas { display: block; }
#battle-hud { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 9px 2px; flex-wrap: wrap; }
#bh-left, #bh-mid, #bh-right { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 13.5px; }
.fpbar { width: 128px; height: 9px; background: #2a2f26; border-radius: 5px; overflow: hidden; display: inline-block; vertical-align: middle; }
.fpbar i { display: block; height: 100%; }
#modal-wrap { position: fixed; inset: 0; background: rgba(6, 9, 12, 0.72); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 14px; }
#modal { background: #17202a; border: 1px solid #46545f; border-radius: 12px; max-width: 560px; width: 100%; max-height: 88vh; overflow-y: auto; padding: 18px 20px; }
#modal h2 { margin-top: 0; }
#toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); background: #22303a; border: 1px solid #5b84c4; color: #fff; padding: 9px 16px; border-radius: 9px; z-index: 60; font-size: 14px; }
.terms { background: #0c1116; border: 1px solid #2a343e; border-radius: 8px; padding: 10px 12px; font-size: 13.5px; line-height: 1.55; margin: 10px 0; }
.win { color: #ffd75e; font-weight: 800; }
