/* ── PAC-MAN LITE  style.css ── */
:root {
  --yellow : #FFD700;
  --cyan   : #00CFFF;
  --blue   : #1c1ccc;
  --bg     : #08080f;
  --panel  : #0d0d1a;
  --border : #22224a;
  --dim    : #555570;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: #fff;
  font-family: 'Press Start 2P', monospace;
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

#page {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 24px 16px 32px;
  width: 100%;
  max-width: 680px;
}

/* ── Header ── */
header { text-align: center; }

h1 {
  font-size: clamp(20px, 5vw, 36px);
  letter-spacing: 4px;
  margin-bottom: 10px;
  line-height: 1.2;
}
.h-pac  { color: var(--yellow); }
.h-lite { color: var(--cyan); }

.sub {
  font-size: 7px;
  color: var(--dim);
  letter-spacing: 1px;
  line-height: 2.2;
}

/* ── HUD ── */
#hud {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  max-width: 588px;
  background: var(--panel);
  border: 2px solid var(--border);
  border-bottom: none;
  padding: 10px 18px;
}
.hcell  { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.hlabel { font-size: 6px; color: var(--dim); letter-spacing: 1.5px; }
.hval   { font-size: 14px; color: #fff; min-width: 80px; text-align: center; }
.hval.gold { color: var(--yellow); }

/* ── Arena ── */
#arena {
  position: relative;
  line-height: 0;
  border: 3px solid var(--border);
}
#gameCanvas { display: block; image-rendering: pixelated; }

/* ── Overlay ── */
#overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.88);
  display: flex; align-items: center; justify-content: center;
  z-index: 10;
}
#overlay.hidden { display: none; }

.ov-box {
  display: flex; flex-direction: column; align-items: center; gap: 20px;
  padding: 36px 40px;
  border: 3px solid var(--yellow);
  background: #000;
  max-width: 340px;
  text-align: center;
}
#ovTitle {
  font-size: clamp(14px, 3.5vw, 22px);
  color: var(--yellow);
  letter-spacing: 2px;
  line-height: 1.5;
}
#ovMsg {
  font-size: 9px;
  color: var(--cyan);
  line-height: 2.4;
}
#ovBtn {
  font-family: 'Press Start 2P', monospace;
  font-size: 11px;
  color: #000;
  background: var(--yellow);
  border: none;
  padding: 13px 26px;
  cursor: pointer;
  letter-spacing: 2px;
  transition: opacity .15s;
}
#ovBtn:hover { opacity: .85; }
#ovBtn:active{ opacity: .7; }

/* ── D-pad ── */
#dpad { display: flex; flex-direction: column; align-items: center; gap: 4px; margin-top: 4px; }
.drow { display: flex; gap: 4px; }
.db {
  font-family: 'Press Start 2P', monospace;
  font-size: 14px;
  width: 56px; height: 56px;
  background: var(--panel);
  color: var(--yellow);
  border: 2px solid var(--border);
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  transition: background .1s;
}
.db:active, .db:hover { background: #1a1a30; border-color: var(--yellow); }

/* ── Footer ── */
footer { font-size: 8px; color: var(--dim); text-align: center; line-height: 2; }
footer a { color: var(--cyan); text-decoration: none; }
footer a:hover { text-decoration: underline; }

/* ── Responsive ── */
@media (max-width: 480px) {
  .sub  { display: none; }
  .hval { font-size: 11px; }
  .db   { width: 50px; height: 50px; }
}