@import url("https://fonts.googleapis.com/css2?family=Press+Start+2P&family=Space+Grotesk:wght@400;600&display=swap");
:root { color-scheme: dark; --bg: #120d26; --fg: #f4ead5; --muted: #a99cc4; --accent: #ff4b2b; --border: #33285a; --radius: 10px; --font: "Space Grotesk", sans-serif; }
* { box-sizing: border-box; }
.authbox { display: flex; flex-direction: column; gap: 8px; margin: 12px auto 0; max-width: 340px; text-align: left; align-items: stretch; }
.auth-in { padding: 8px 10px; border-radius: 8px; border: 1px solid var(--border); background: #1c1438; color: var(--fg); font: inherit; min-width: 0; flex: 1; }
.auth-row { display: flex; gap: 8px; flex-wrap: wrap; }
.auth-err { color: #ff8a7a; font-size: 14px; }
.auth-note { color: var(--muted); font-size: 14px; margin: 6px 0; }
.auth-link { color: var(--muted); font-size: 13px; }
.worlds { position: relative; display: inline-block; }
.worlds-panel { position: absolute; right: 0; top: 110%; z-index: 20; width: min(340px, 86vw); background: #1c1438; border: 1px solid var(--border);
  border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.world-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.world-list li { display: flex; gap: 6px; align-items: center; }
.world-list li span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body { margin: 0; background: radial-gradient(circle at 50% 0, #2b1850, var(--bg) 60%); color: var(--fg); font-family: var(--font); min-height: 100vh; }
.front { position: relative; min-height: 100vh; display: grid; place-items: center; padding: 20px; overflow: hidden; }
.front-blocks span { position: absolute; top: -60px; width: 44px; height: 44px; display: grid; place-items: center; font: 9px "Press Start 2P", monospace; color: #111;
  background: linear-gradient(#e0382f 0 35%, #f4ead5 35% 65%, #e0382f 65%); border: 2px solid #7a1410; animation: fall 6s linear infinite; opacity: .55; }
@keyframes fall { to { transform: translateY(115vh) rotate(360deg); } }
.front-card { position: relative; text-align: center; max-width: 34rem; background: rgba(18,13,38,.82); border: 2px solid var(--border); border-radius: 16px; padding: 32px 24px;
  box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.front-kicker { color: #ffd23f; font: 10px "Press Start 2P", monospace; letter-spacing: 2px; margin: 0 0 12px; }
.front-title { font: clamp(28px, 8vw, 52px) "Press Start 2P", monospace; margin: 0 0 16px; text-shadow: 4px 4px 0 #7a1410; }
.front-title span { color: var(--accent); }
.front-sub { color: var(--muted); margin: 0 0 24px; line-height: 1.5; }
.front-play { font: 14px "Press Start 2P", monospace; background: var(--accent); color: #fff; border: none; border-bottom: 5px solid #8e1e0c; border-radius: 10px; padding: 18px 26px;
  cursor: pointer; animation: pulse 1.4s ease-in-out infinite; }
.front-play:active { transform: translateY(3px); border-bottom-width: 2px; }
@keyframes pulse { 50% { transform: scale(1.05); } }
.front-tips { list-style: none; padding: 0; margin: 24px 0 0; color: var(--muted); font-size: 14px; display: grid; gap: 6px; }
.front-tips b { color: var(--fg); }
.app { max-width: 80rem; margin: 0 auto; padding: 16px; }
.top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
h1 { font-family: "Press Start 2P", monospace; font-size: 22px; margin: 0; color: var(--accent); text-shadow: 3px 3px 0 #000; }
h1 span { color: #ffd23f; }
.stats { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { background: #1e1640; border: 1px solid var(--border); padding: 6px 10px; border-radius: 999px; font-size: 13px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.tool { background: #1e1640; color: var(--fg); border: 2px solid var(--border); border-radius: var(--radius); padding: 8px 12px; font: 600 14px var(--font); cursor: pointer; }
.tool:hover { border-color: #6a55b0; }
.tool.on { background: var(--accent); border-color: #ffd23f; color: #fff; }
.tool.danger { border-color: #8a2a2a; }
.tool:focus-visible, .pad button:focus-visible { outline: 3px solid #ffd23f; outline-offset: 2px; }
kbd { font-family: "Press Start 2P", monospace; font-size: 9px; opacity: .7; }
.power { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.power input { accent-color: var(--accent); width: 110px; }
.stage { border: 3px solid #000; border-radius: var(--radius); overflow: hidden; box-shadow: 0 0 0 2px var(--border), 0 20px 50px rgba(0,0,0,.5); }
.stage { height: min(68vh, 640px); min-height: 320px; }
canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: crosshair; }
.pad { display: none; justify-content: space-between; align-items: center; gap: 14px; margin-top: 12px; }
.dpad { display: grid; grid-template-columns: repeat(3, 60px); gap: 6px; }
.pad .jump { width: 110px; height: 80px; font: 14px "Press Start 2P", monospace; background: var(--accent); }
.pad button { width: 60px; height: 54px; font-size: 22px; border-radius: 14px; background: #1e1640; color: var(--fg); border: 2px solid var(--border); touch-action: none; user-select: none; }
.help { color: var(--muted); font-size: 14px; line-height: 1.5; }
@media (hover: none), (max-width: 700px) { .pad { display: flex; } h1 { font-size: 16px; } }
