html, body {
  margin:0;
  padding:0;
  overflow:hidden;
  background:#14110d;
  font-family:Arial, sans-serif;
  color:#fff;
  touch-action:none;
  overscroll-behavior:none;
  -webkit-user-select:none;
  user-select:none;
}
canvas { display:block; }
#hud {
  position:fixed;
  left:0;
  right:0;
  top:0;
  z-index:5;
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:10px;
  padding:calc(8px + env(safe-area-inset-top)) 12px 10px;
  background:linear-gradient(180deg, rgba(0,0,0,.76), rgba(0,0,0,.06));
  pointer-events:none;
}
.brand { font-weight:900; letter-spacing:.3px; font-size:16px; line-height:1.1; }
.brand span { display:block; font-size:10px; opacity:.78; font-weight:600; margin-top:3px; }
.stats { display:flex; gap:9px; flex-wrap:wrap; justify-content:flex-end; font-size:14px; line-height:1.25; }
.modal {
  position:fixed;
  inset:0;
  z-index:10;
  display:flex;
  align-items:center;
  justify-content:center;
  background:rgba(0,0,0,.69);
  padding:18px;
}
.hidden { display:none !important; }
.card {
  width:min(430px, 95vw);
  background:#21180f;
  border:1px solid rgba(255,255,255,.16);
  border-radius:22px;
  padding:22px;
  box-shadow:0 22px 70px rgba(0,0,0,.55);
}
h1,h2 { margin:0 0 12px; }
p { line-height:1.45; color:#eadfce; }
label { display:block; margin-top:14px; margin-bottom:6px; color:#d6c4a8; }
input {
  width:100%;
  box-sizing:border-box;
  border:0;
  border-radius:12px;
  padding:14px;
  font-size:17px;
  background:#fff9ef;
}
button {
  width:100%;
  margin-top:14px;
  border:0;
  border-radius:14px;
  padding:14px;
  font-size:18px;
  font-weight:900;
  background:#d9973b;
  color:#1d1208;
  cursor:pointer;
}
button:active { transform:scale(.98); }
button:hover { filter:brightness(1.08); }
small { display:block; margin-top:12px; color:#bda88c; }
.link { display:block; margin-top:14px; color:#ffcf7d; text-align:center; }
.mobile-controls {
  position:fixed;
  left:0;
  right:0;
  bottom:calc(14px + env(safe-area-inset-bottom));
  z-index:6;
  display:grid;
  grid-template-columns:1fr 1fr 1.25fr 1fr 1fr;
  gap:10px;
  padding:0 14px;
  pointer-events:none;
}
.control-btn {
  pointer-events:auto;
  min-height:62px;
  margin:0;
  border-radius:22px;
  background:rgba(217,151,59,.88);
  box-shadow:0 10px 28px rgba(0,0,0,.35);
  font-size:24px;
  border:1px solid rgba(255,255,255,.28);
}
.control-btn.jump { font-size:17px; background:rgba(255,205,99,.92); }
.control-btn.boost { font-size:17px; background:rgba(120,205,255,.9); }
.control-btn.attack { font-size:15px; background:rgba(255,120,90,.9); }
.hint {
  position:fixed;
  left:50%;
  top:72px;
  transform:translateX(-50%);
  z-index:7;
  white-space:nowrap;
  padding:9px 13px;
  border-radius:999px;
  background:rgba(0,0,0,.68);
  border:1px solid rgba(255,255,255,.18);
  color:#ffe1a3;
  font-weight:800;
  font-size:14px;
  pointer-events:none;
}
@media (max-width:700px){
  .mobile-controls{gap:7px; padding:0 8px;}
  .control-btn{min-height:56px; border-radius:18px; font-size:20px;}
  .control-btn.jump,.control-btn.boost{font-size:14px;}
  .control-btn.attack{font-size:13px;}
  #hud{ padding-left:8px; padding-right:8px; }
  .brand{font-size:13px; max-width:42vw;}
  .brand span{font-size:9px;}
  .stats{font-size:12px; gap:5px; max-width:56vw;}
  .card{padding:18px; border-radius:20px;}
  h1{font-size:25px;}
  p{font-size:14px;}
}
@media (min-width:900px){
  .mobile-controls{max-width:520px; margin:auto; left:50%; transform:translateX(-50%);}
}
.debug-line{ color:#ffcf7d; min-height:16px; }

.debug-box{
  display:block;
  max-height:170px;
  overflow:auto;
  white-space:pre-wrap;
  margin-top:10px;
  padding:10px;
  border-radius:12px;
  background:rgba(0,0,0,.38);
  color:#ffd08a;
  border:1px solid rgba(255,255,255,.13);
  font-size:11px;
  line-height:1.35;
}
body.debug-running .debug-box{
  position:fixed;
  left:8px;
  top:70px;
  width:min(440px, calc(100vw - 16px));
  z-index:99;
  pointer-events:auto;
}
