:root{
  --bg:#0a0a12;
  --panel:#14141f;
  --brick:#c1451c;
  --steel:#8a8a8a;
  --yellow:#f4c430;
  --green:#3fa34d;
  --accent:#f4c430;
  --text:#e8e8ef;
  --muted:#9a9ab0;
}
*{box-sizing:border-box;margin:0;padding:0}
html{scroll-behavior:smooth}
body{
  font-family:'Segoe UI',system-ui,sans-serif;
  background:var(--bg);
  color:var(--text);
  line-height:1.5;
}
.wrap{max-width:1200px;margin:0 auto;padding:0 20px}
a{color:var(--accent);text-decoration:none}

/* Topbar */
.topbar{
  background:#000;
  border-bottom:3px solid var(--brick);
  position:sticky;top:0;z-index:50;
}
.topbar .wrap{display:flex;align-items:center;justify-content:space-between;height:64px}
.logo{font-weight:900;font-size:22px;letter-spacing:2px;color:#fff;font-family:'Courier New',monospace}
.logo span{color:var(--yellow)}
.topbar nav{display:flex;gap:22px}
.topbar nav a{color:var(--text);font-weight:600;transition:.2s}
.topbar nav a:hover{color:var(--yellow)}

/* Hero */
.hero{
  padding:60px 0 40px;
  text-align:center;
  background:
    repeating-linear-gradient(0deg,transparent,transparent 30px,rgba(193,69,28,.04) 30px,rgba(193,69,28,.04) 32px),
    radial-gradient(ellipse at top,#1a1226,#0a0a12);
}
.hero h1{
  font-size:clamp(28px,5vw,52px);
  font-family:'Courier New',monospace;
  font-weight:900;
  color:var(--yellow);
  text-shadow:4px 4px 0 var(--brick),8px 8px 0 rgba(0,0,0,.4);
  letter-spacing:1px;
  margin-bottom:18px;
  line-height:1.1;
}
.lead{max-width:680px;margin:0 auto 28px;color:var(--muted);font-size:18px}
.btn-play{
  display:inline-block;
  background:var(--yellow);
  color:#111;
  font-weight:900;
  font-size:18px;
  padding:14px 38px;
  border:none;
  border-radius:8px;
  cursor:pointer;
  box-shadow:0 5px 0 #b8901c;
  transition:.1s;
  font-family:'Courier New',monospace;
  letter-spacing:1px;
}
.btn-play:hover{transform:translateY(2px);box-shadow:0 3px 0 #b8901c}

/* Game */
.game-section{padding:40px 0}
.game-layout{display:flex;gap:24px;justify-content:center;align-items:flex-start;flex-wrap:wrap}
.canvas-holder{position:relative;flex:0 1 832px;max-width:100%}
#game{
  display:block;
  width:100%;
  max-width:832px;
  aspect-ratio:1/1;
  background:#000;
  border:6px solid #333;
  border-radius:6px;
  image-rendering:pixelated;
  image-rendering:crisp-edges;
}
.overlay{
  position:absolute;inset:0;
  background:rgba(0,0,0,.82);
  display:flex;align-items:center;justify-content:center;
  border-radius:6px;
}
.overlay.hidden{display:none}
.overlay-box{text-align:center;padding:30px}
.ov-title{
  font-family:'Courier New',monospace;
  font-size:44px;font-weight:900;color:var(--yellow);
  text-shadow:3px 3px 0 var(--brick);letter-spacing:3px;
}
.ov-sub{color:#fff;font-size:20px;margin:12px 0 22px}
#playerName{
  display:block;margin:0 auto 18px;padding:12px 16px;width:240px;
  background:#1c1c2a;border:2px solid #444;border-radius:6px;color:#fff;
  font-size:16px;text-align:center;
}
#playerName:focus{outline:none;border-color:var(--yellow)}
.ov-hint{color:var(--muted);font-size:13px;margin-top:16px}

/* Side panel */
.side-panel{
  flex:0 0 180px;
  background:var(--panel);
  border:2px solid #2a2a3a;
  border-radius:8px;
  padding:18px;
  display:flex;flex-direction:column;gap:10px;
}
.hud-item{
  display:flex;justify-content:space-between;align-items:center;
  background:#1c1c2a;padding:8px 12px;border-radius:6px;
}
.hud-item span{color:var(--muted);font-size:13px}
.hud-item b{color:var(--yellow);font-size:20px;font-family:'Courier New',monospace}
.tanks-left{display:flex;flex-wrap:wrap;gap:3px;min-height:20px;margin:4px 0}
.tanks-left i{width:12px;height:12px;background:var(--brick);display:block;border-radius:2px}
.btn-ghost{
  background:#1c1c2a;color:var(--text);border:2px solid #333;
  padding:10px;border-radius:6px;cursor:pointer;font-weight:700;transition:.2s;
}
.btn-ghost:hover{border-color:var(--yellow);color:var(--yellow)}

/* Mobile controls */
.mobile-controls{display:none;justify-content:space-between;align-items:center;margin-top:20px;padding:0 10px}
.dpad{display:flex;flex-direction:column;align-items:center;gap:4px}
.dpad-mid{display:flex;gap:4px}
.dpad button,.fire-btn{
  background:#1c1c2a;border:2px solid #444;color:#fff;border-radius:8px;
  font-size:22px;width:58px;height:58px;cursor:pointer;user-select:none;
  touch-action:manipulation;
}
.fire-btn{width:90px;height:90px;background:var(--brick);border-color:#e05a2c;font-weight:900;font-size:16px}
.dpad button:active,.fire-btn:active{filter:brightness(1.3)}

/* Info sections */
.info-section,.scores-section{padding:56px 0;border-top:1px solid #1e1e2c}
.info-section h2,.scores-section h2{
  text-align:center;font-size:32px;margin-bottom:34px;
  font-family:'Courier New',monospace;color:var(--yellow);
}
.cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(230px,1fr));gap:20px;margin-bottom:40px}
.card{
  background:var(--panel);border:2px solid #2a2a3a;border-radius:10px;
  padding:24px;text-align:center;transition:.2s;
}
.card:hover{border-color:var(--brick);transform:translateY(-4px)}
.card .ic{font-size:34px;margin-bottom:12px}
.card h3{color:#fff;margin-bottom:8px;font-size:18px}
.card p{color:var(--muted);font-size:15px}
.card b{color:var(--yellow)}
.rules{background:var(--panel);border:2px solid #2a2a3a;border-radius:10px;padding:28px;max-width:760px;margin:0 auto}
.rules h3{color:var(--yellow);margin-bottom:16px;font-size:20px}
.rules ul{list-style:none}
.rules li{padding:8px 0;border-bottom:1px solid #232336;color:var(--muted)}
.rules li:last-child{border:none}

/* Scores */
.scores{width:100%;max-width:720px;margin:0 auto;border-collapse:collapse;background:var(--panel);border-radius:10px;overflow:hidden}
.scores th,.scores td{padding:14px 18px;text-align:left}
.scores th{background:#000;color:var(--yellow);font-family:'Courier New',monospace;text-transform:uppercase;font-size:13px}
.scores tbody tr:nth-child(odd){background:#181824}
.scores td:last-child,.scores th:last-child{text-align:right;font-family:'Courier New',monospace;color:var(--yellow)}
.scores tbody tr:first-child td{font-weight:900;color:#fff}

/* Footer */
.footer{background:#000;border-top:3px solid var(--brick);padding:34px 0;text-align:center;margin-top:20px}
.footer p{color:var(--muted)}
.footer .small{font-size:12px;margin-top:8px;opacity:.6}

@media(max-width:900px){
  .side-panel{flex-direction:row;flex-wrap:wrap;flex:1 1 100%;justify-content:center}
  .hud-item{flex:1 1 120px}
  .tanks-left{flex:1 1 100%}
  .btn-ghost{flex:1 1 120px}
}
@media(max-width:768px){
  .topbar nav{gap:14px;font-size:14px}
  .mobile-controls{display:flex}
  .ov-title{font-size:32px}
}