@font-face { font-family: Patrick; src: url('../fonts/patrick-hand.ttf') format('truetype'); font-display: swap; }
* { box-sizing: border-box; }
:root { color-scheme: light; }
body { margin:0; color:#172867; background:#f7f4e9; background-image:repeating-linear-gradient(transparent 0 31px,#2a42ad12 31px 32px); font:15px/1.45 'Trebuchet MS',sans-serif; }
[hidden] { display:none!important; }
button, select, input { font:inherit; }
button, select { color:#172867; background:#f7f4e9; border:1.5px solid #2a42ad; border-radius:5px; padding:9px 12px; cursor:pointer; }
button:hover { background:#e8eaf3; } button:active { transform:translateY(1px); }
a { color:inherit; } p { margin:10px 0 16px; } h2 { font:34px/1.1 Patrick,cursive; margin:8px 0 18px; }
header { height:70px; display:flex; align-items:center; justify-content:space-between; padding:0 24px; border-bottom:1px solid #2a42ad33; gap:12px; }
.wordmark { font:44px Patrick,cursive; text-decoration:none; line-height:1; } .wordmark span { color:#c94b59; }
.edition { font-size:11px; letter-spacing:2px; } nav { display:flex; gap:8px; } nav button { border:0; background:transparent; }
main { display:grid; grid-template-columns:minmax(0,1fr) 330px; height:calc(100dvh - 70px); }
.surface { position:relative; min-height:0; overflow:hidden; }
canvas { width:100%; height:100%; display:block; touch-action:none; }
aside { border-left:1px solid #c94b5977; padding:25px 22px; overflow-y:auto; background:#f7f4e9e8; overscroll-behavior:contain; }
h1 { font:68px/.9 Patrick,cursive; margin:24px 0; letter-spacing:-2px; } h1 span { color:#c94b59; }
.eyebrow { font-size:11px; letter-spacing:1.8px; } .hand-note { font:28px/1.15 Patrick,cursive; color:#c94b59; transform:rotate(-4deg); margin:26px 0; }
.primary { background:#2a42ad; color:white; font-weight:bold; width:100%; } .primary:hover { background:#172867; }
.secondary { margin-top:10px; width:100%; } .muted,.credit { font-size:12px; opacity:.8; } .credit { margin-top:26px; }
.defense-hud { position:absolute; top:12px; left:50%; transform:translateX(-50%); display:flex; gap:28px; padding:8px 20px; background:#f7f4e9ed; border:1px solid #2a42ad66; border-radius:7px; pointer-events:none; }
.defense-hud span { display:grid; text-align:center; } .defense-hud small { font-size:9px; letter-spacing:1px; } .defense-hud b { font:30px/1 Patrick,cursive; } .defense-hud span:nth-child(2) b { color:#c94b59; }
.control-actions { position:absolute; bottom:12px; left:12px; right:12px; display:flex; justify-content:center; gap:10px; flex-wrap:wrap; }
.board-note { position:absolute; top:16px; left:24px; font:26px Patrick,cursive; color:#c94b59; transform:rotate(-3deg); pointer-events:none; }
.status-line { display:flex; justify-content:space-between; align-items:center; gap:10px; font-size:11px; letter-spacing:1px; } .status-line button { padding:5px 10px; }
.notice { border-left:3px solid #c94b59; padding-left:10px; font-size:13px; min-height:38px; }
.forecast { padding:10px; background:#2a42ad0a; font-size:13px; border:1px dashed #2a42ad66; margin-bottom:12px; }
.risk { display:grid; grid-template-columns:24px 1fr; align-items:center; font-size:13px; margin:8px 0 18px; } .risk span { grid-column:2; font-size:10px; } .risk input { width:20px; height:20px; }
.selection { display:grid; grid-template-columns:1fr 1fr 48px 48px; align-items:center; gap:5px; margin:15px 0 10px; font-size:13px; } .selection select { min-width:0; width:100%; padding:4px; }
.shop { display:grid; grid-template-columns:1fr 1fr; gap:7px; } .shop button { text-align:left; min-height:64px; padding:7px 10px; } .shop strong { display:block; font:23px/1 Patrick,cursive; } .shop small { font-size:11px; }
.shop [aria-pressed=true] { outline:2px solid #c94b59; outline-offset:1px; background:#c94b590c; }
.tower-detail { font-size:12px; min-height:52px; margin:12px 0; } #tower-actions label { display:block; margin:12px 0 5px; font-size:12px; } #priority { width:100%; }
.upgrade-actions { display:flex; gap:8px; margin-top:8px; } .upgrade-actions .primary { flex:1; }
.burst-controls { border-top:1px solid #2a42ad44; margin-top:18px; padding-top:14px; display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.burst { background:#c94b59; color:white; font-weight:bold; touch-action:none; user-select:none; } .burst:hover { background:#a83e4b; }
.burst-controls meter { width:100%; grid-column:1 / -1; height:15px; accent-color:#c94b59; } .burst-controls p { grid-column:1 / -1; font-size:11px; margin:0; }
#burst-mode[aria-pressed=true] { background:#c94b591c; border-color:#c94b59; }
#perk-options { display:grid; gap:8px; margin-bottom:18px; } #perk-options button { text-align:left; font-size:12px; } #perk-options strong { display:block; font:24px Patrick,cursive; }
#result { margin-top:20px; padding:18px 0; } #result a { display:block; text-align:center; margin:20px 0; }
.feedback { position:absolute; top:92px; left:50%; transform:translateX(-50%); text-align:center; background:#f7f4e9e8; padding:8px 14px; border:1px solid #c94b59; font:24px Patrick,cursive; pointer-events:none; }
dialog { width:min(600px,calc(100% - 24px)); max-height:85dvh; overflow:auto; border:2px solid #2a42ad; border-radius:8px; background:#f7f4e9; color:#172867; padding:28px; }
dialog::backdrop { background:#17286766; } dialog li { margin-bottom:12px; } dialog p { font-size:14px; } .close { float:right; } #pause-dialog a { display:block; margin-top:20px; text-align:center; }
#error { position:fixed; inset:20%; z-index:20; padding:28px; background:#f7f4e9; border:3px solid #c94b59; }
.comfort-settings { margin-top:20px; border:1px solid #2a42ad44; } .comfort-settings label { display:block; margin:10px 0; } .comfort-settings input[type=range] { width:100%; }
@media (max-width:760px) {
  header { height:58px; padding:0 12px; } .edition { display:none; } nav { gap:0; } nav button { padding:6px 9px; font-size:12px; }
  main { height:calc(100dvh - 58px); grid-template-columns:1fr; grid-template-rows:minmax(235px,53%) minmax(0,1fr); }
  aside { border-left:0; border-top:2px solid #c94b5977; padding:14px 16px max(28px,env(safe-area-inset-bottom)); }
  #lobby { max-width:520px; margin:auto; } h1 { font-size:48px; margin:12px 0; } .hand-note { display:none; }
  .defense-hud { gap:20px; top:7px; padding:5px 15px; } .defense-hud b { font-size:24px; }
  .control-actions { bottom:5px; } .control-actions .camera-views { background:#f7f4e9ee; padding:0 8px; }
  .board-note { font-size:18px; top:6px; left:12px; } .feedback { top:70px; font-size:18px; max-width:90%; }
  #match { display:block; } .selection { margin-top:10px; } .shop { grid-template-columns:repeat(4,1fr); } .shop button { min-height:59px; padding:5px; } .shop strong { font-size:19px; }
  .tower-detail { min-height:0; } .burst-controls { position:sticky; bottom:-14px; background:#f7f4e9; padding-bottom:8px; z-index:2; }
  .burst-controls p { display:none; } .notice { margin-bottom:8px; min-height:0; } .forecast { margin-bottom:8px; padding:6px 9px; }
}
@media (max-height:520px) and (min-width:651px) {
  header { height:48px; } main { height:calc(100dvh - 48px); grid-template-columns:minmax(0,1fr) 280px; grid-template-rows:1fr; }
  aside { border-left:1px solid #c94b5977; border-top:0; padding:10px 14px; }
  .shop { grid-template-columns:1fr 1fr; } .defense-hud { gap:18px; }
}
