:root { --lcd: #9ead86; --ink: #1b1f16; --off: rgba(27,31,22,.1); --shell: #e8b400; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #2b2d30; color: #f2f2f2; font-family: system-ui, sans-serif; }
body { display: flex; align-items: center; justify-content: center; touch-action: none; user-select: none; }
.card { width: min(420px, 94vw); max-height: 96vh; overflow: auto; background: linear-gradient(160deg, #ffd23f, var(--shell)); color: #3a2a00; border-radius: 22px; padding: 16px 18px; box-shadow: 0 14px 30px #0008; }
h1 { margin: 0; font-size: 26px; letter-spacing: 4px; color: #7a1410; } h1 small { font-size: 11px; letter-spacing: 1px; }
.sub { margin: 4px 0 8px; font-size: 13px; } .sub a { color: #7a1410; font-weight: 700; }
fieldset { border: 2px solid #7a141055; border-radius: 12px; margin: 8px 0; display: flex; flex-direction: column; gap: 8px; }
legend { font-weight: 900; color: #7a1410; }
label { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; }
.chk { justify-content: flex-start; }
select, input { font-size: 16px; padding: 5px; border-radius: 6px; border: 1px solid #7a141088; }
#code { text-transform: uppercase; letter-spacing: 8px; font: 900 24px monospace; text-align: center; }
button { cursor: pointer; border: 0; border-radius: 10px; font-weight: 900; }
.big { background: #c8231c; color: #fff; padding: 11px; font-size: 16px; box-shadow: 0 4px 0 #5e0f0c; }
.small { background: #c8231c; color: #fff; padding: 5px 9px; font-size: 12px; }
.msg { min-height: 1.2em; font-weight: 700; color: #7a1410; }
#game { width: 100vw; height: 100vh; display: flex; flex-direction: column; align-items: center; padding: 6px; gap: 6px; }
#game[hidden], #lobby[hidden] { display: none; }
#top { display: flex; gap: 12px; align-items: center; font-size: 14px; } #top b { letter-spacing: 3px; color: #ffd23f; }
#lcd { position: relative; flex: 1; min-height: 0; display: flex; gap: 8px; padding: 8px; background: linear-gradient(170deg, #a7b590, var(--lcd) 40%, #8f9e78); border-radius: 6px; border: 6px solid #3a3d42; color: var(--ink); }
#board { display: block; border: 1px solid #1b1f1688; }
#panel { width: 86px; display: flex; flex-direction: column; font-weight: 900; }
.lbl { font-size: 10px; letter-spacing: 1px; margin-top: 8px; } .val { font: 900 14px monospace; }
.lives { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 3px; }
.lives i { width: 11px; height: 11px; border: 2px solid var(--ink); background: radial-gradient(var(--ink) 35%, transparent 36%); }
.lives i.off { opacity: .12; }
.status { margin-top: 10px; font-size: 11px; line-height: 14px; }
#meSide { font-size: 9px; }
.overlay { position: absolute; left: 10%; right: 10%; top: 40%; text-align: center; background: rgba(158,173,134,.95); border: 2px solid var(--ink); padding: 8px; font-weight: 900; display: none; }
.overlay.show { display: block; } .overlay b { font-size: 18px; display: block; }
#pad { display: flex; align-items: center; justify-content: space-between; width: min(420px, 96vw); padding: 0 8px 4px; }
#dpad { position: relative; width: 132px; height: 132px; touch-action: none; }
#dpad b { position: absolute; width: 46px; height: 46px; border-radius: 50%; background: radial-gradient(circle at 38% 30%, #ff7a6e, #c8231c 45%, #8e1612); display: flex; align-items: center; justify-content: center; color: #fffb; pointer-events: none; box-shadow: 0 4px 0 #5e0f0c; }
#dpad b[data-d=up] { left: 43px; top: 0 } #dpad b[data-d=down] { left: 43px; bottom: 0 } #dpad b[data-d=left] { left: 0; top: 43px } #dpad b[data-d=right] { right: 0; top: 43px }
#dpad b.on, #fire.on { filter: brightness(.8); transform: translateY(3px); }
#fire { width: 92px; height: 92px; border-radius: 50%; color: #fffc; background: radial-gradient(circle at 38% 30%, #ff7a6e, #c8231c 45%, #8e1612); box-shadow: 0 6px 0 #5e0f0c; touch-action: none; }
@media (pointer: fine) and (min-height: 700px) { #pad { opacity: .85; } }
