/* =============================================
   PAC-MAN  —  style.css
============================================= */

@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

/* ── Reset ── */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  background: #000;
  overflow: hidden;
  font-family: 'Press Start 2P', monospace;
  touch-action: none;
}

/* ── Utility ── */
.HIDE { display: none !important; }

/* ── Canvas ── */
canvas {
  display: block;
  position: fixed;
  top: 0;
  left: 0;
  cursor: none;
}

/* ══════════════════════════════
   SCREENS
══════════════════════════════ */
.screen {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.93);
  gap: 18px;
  padding: 20px;
}

/* ══════════════════════════════
   TYPOGRAPHY
══════════════════════════════ */
.title {
  font-size: clamp(22px, 7vw, 52px);
  color: #FFD700;
  text-shadow: 3px 3px 0 #8b6914;
  text-align: center;
}

.title.green { color: #00ff88; text-shadow: 3px 3px 0 #007744; }
.title.red   { color: #ff3333; animation: blink .9s step-end infinite; }
.title.blue  { color: #00ccff; }

.stat {
  font-size: 10px;
  color: #aaa;
  letter-spacing: 2px;
  text-align: center;
}
.stat span { color: #FFD700; }

.stars {
  font-size: clamp(20px, 5vw, 36px);
  color: #FFD700;
  letter-spacing: 10px;
  animation: starPulse 1s ease-in-out infinite alternate;
}

@keyframes blink    { 50% { opacity: 0; } }
@keyframes starPulse { from { opacity: .7; } to { opacity: 1; } }

/* ══════════════════════════════
   BUTTONS
══════════════════════════════ */
.btn {
  font-family: 'Press Start 2P', monospace;
  font-size: 11px;
  padding: 13px 0;
  width: 260px;
  cursor: pointer;
  letter-spacing: 2px;
  border: 3px solid #8b6914;
  background: #FFD700;
  color: #000;
  transition: background .1s, transform .1s;
}
.btn:hover, .btn:active {
  background: #fff;
  transform: scale(1.03);
}

.btn.outline {
  background: transparent;
  border: 2px solid #555;
  color: #aaa;
}
.btn.outline:hover, .btn.outline:active {
  background: rgba(255, 255, 255, .06);
  border-color: #aaa;
  color: #fff;
}

.btn.ctrl-btn {
  background: transparent;
  border-color: #555;
  color: #aaa;
}
.btn.ctrl-btn:hover {
  background: rgba(255, 215, 0, .07);
  border-color: #aaa;
  color: #fff;
}

/* ══════════════════════════════
   CONTROLS POPUP
══════════════════════════════ */
.ctrl-wrap {
  position: relative;
  width: 260px;
}

.ctrl-panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: #0a0a1a;
  border: 2px solid #555;
  padding: 14px 18px;
  font-size: 8px;
  color: #aaa;
  line-height: 2.4;
  z-index: 60;
  animation: fadeDown .15s ease;
}
.ctrl-panel span  { color: #FFD700; }
.ctrl-panel .note { color: #444; font-size: 7px; margin-top: 6px; }

@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ══════════════════════════════
   HUD
══════════════════════════════ */
#hud {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 44px;
  z-index: 30;
  background: #000;
  border-bottom: 2px solid #FFD700;
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0 8px;
}

.hseg {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.hlbl { font-size: 7px;  color: #FFD700; letter-spacing: 2px; }
.hval { font-size: 14px; color: #fff; }

#livesRow { display: flex; gap: 5px; align-items: center; }

.lifeIcon {
  width: 13px;
  height: 13px;
  background: #FFD700;
  border-radius: 50%;
  clip-path: polygon(50% 50%, 100% 15%, 100% 0%, 0% 0%, 0% 100%, 100% 100%, 100% 85%);
}

/* ══════════════════════════════
   IN-GAME PAUSE BUTTON
══════════════════════════════ */
#pauseBtn {
  position: fixed;
  top: 52px;
  right: 10px;
  z-index: 35;
  width: 44px;
  height: 34px;
  background: rgba(0, 0, 0, .8);
  border: 2px solid #FFD700;
  border-radius: 6px;
  color: #FFD700;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: monospace;
  letter-spacing: 1px;
}
#pauseBtn:active { background: rgba(255, 215, 0, .2); }

/* ══════════════════════════════
   MOBILE D-PAD
══════════════════════════════ */
#dpad {
  position: fixed;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 40;
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.drow { display: flex; gap: 4px; align-items: center; }

.dbtn {
  width: 54px;
  height: 54px;
  background: rgba(255, 215, 0, .1);
  border: 2px solid rgba(255, 215, 0, .45);
  border-radius: 8px;
  color: #FFD700;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.dbtn:active { background: rgba(255, 215, 0, .35); }

.dmid { width: 54px; height: 54px; }

/* ══════════════════════════════
   MENU PREVIEW
══════════════════════════════ */
.previewRow {
  display: flex;
  gap: 14px;
  align-items: center;
  margin: 4px 0;
}

.pmPrev {
  width: 32px;
  height: 32px;
  background: #FFD700;
  border-radius: 50%;
  clip-path: polygon(50% 50%, 100% 18%, 100% 0%, 0% 0%, 0% 100%, 100% 100%, 100% 82%);
  animation: munch .35s steps(1) infinite;
}

@keyframes munch {
  50% {
    clip-path: polygon(50% 50%, 100% 50%, 100% 0%, 0% 0%, 0% 100%, 100% 100%, 100% 50%);
  }
}

.ghPrev {
  width: 28px;
  height: 32px;
  border-radius: 14px 14px 0 0;
}

.hiBox {
  border: 2px solid #FFD700;
  padding: 8px 24px;
  text-align: center;
  background: rgba(255, 215, 0, .05);
}
