.pf-body {
  margin: 0; padding: 0;
  overflow: hidden;
  background: #0b1026;
  touch-action: none;
}
.pf-root {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: #0b1026;
}
#game {
  width: 100%; height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

/* ---- HUD ---- */
.pf-hud {
  position: fixed; top: 0; left: 0; right: 0;
  display: flex; align-items: center; gap: 1rem;
  padding: 6px 12px;
  z-index: 20;
  pointer-events: none;
}
.pf-hud--hidden { display: none; }
.pf-back {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 10px;
  background: rgba(0,0,0,0.4); color: #fff;
  text-decoration: none; font-size: 1.3rem; font-weight: 700;
  pointer-events: auto;
}
.pf-hud__lives { display: flex; gap: 2px; align-items: center; }
.pf-heart {
  display: inline-block; width: 18px; height: 18px;
  background: #ff4f6d; border-radius: 50% 50% 0 50%;
  transform: rotate(-45deg);
  box-shadow: 0 0 4px rgba(255,79,109,0.5);
}
.pf-hud__score {
  margin-left: auto;
  font-size: 1.1rem; font-weight: 800; color: #ffd600;
  text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}
.pf-hud__power {
  font-size: 1rem; font-weight: 700; color: #fff;
  background: rgba(0,0,0,0.4); border-radius: 8px; padding: 2px 8px;
}
.pf-hud__power--hidden { display: none; }

/* ---- On-screen controls ---- */
.pf-controls {
  position: fixed; bottom: 0; left: 0; right: 0;
  display: flex; justify-content: space-between;
  padding: 0 12px 16px;
  z-index: 20;
  pointer-events: none;
}
.pf-controls--hidden { display: none; }
.pf-pad { display: flex; gap: 8px; pointer-events: auto; }
.pf-pad--right { gap: 12px; }
.pf-btn {
  display: flex; align-items: center; justify-content: center;
  border: none; border-radius: 50%;
  font-size: 1.5rem; font-weight: 700; color: #fff;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
}
.pf-btn--move {
  width: 64px; height: 64px;
  background: rgba(255,255,255,0.18);
}
.pf-btn--jump {
  width: 72px; height: 72px;
  background: rgba(87,210,91,0.35);
  font-size: 1.8rem;
}
.pf-btn--action {
  width: 56px; height: 56px;
  background: rgba(255,160,0,0.3);
  font-size: 1.4rem;
}
.pf-btn:active { transform: scale(0.9); background: rgba(255,255,255,0.35); }

/* ---- Menu ---- */
.pf-menu {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(11,16,38,0.85);
  z-index: 30;
  overflow-y: auto;
}
.pf-menu--hidden { display: none; }
.pf-menu__card {
  background: #1a2248; border-radius: 18px;
  padding: 24px 28px; max-width: 500px; width: 90%;
  text-align: center; color: #fff;
  box-shadow: 0 8px 30px rgba(0,0,0,0.5);
}
.pf-menu__title {
  font-size: 1.8rem; margin: 0 0 4px; color: #ffd600;
  text-shadow: 0 2px 0 rgba(0,0,0,0.3);
}
.pf-menu__sub { margin: 0 0 16px; opacity: 0.7; font-size: 0.95rem; }
.pf-menu__label { font-weight: 700; margin: 12px 0 6px; font-size: 0.9rem; opacity: 0.8; }
.pf-menu__section { margin-bottom: 12px; }

.pf-menu__heroes {
  display: flex; gap: 12px; justify-content: center;
}
.pf-hero-btn {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 10px 16px; border-radius: 14px;
  background: rgba(255,255,255,0.08); border: 2px solid transparent;
  color: #fff; font-weight: 700; font-size: 1rem;
  cursor: pointer; transition: border-color 0.15s;
}
.pf-hero-btn--active { border-color: #ffd600; background: rgba(255,214,0,0.12); }
.pf-hero-preview { width: 48px; height: 72px; image-rendering: pixelated; }

.pf-menu__diffs {
  display: flex; gap: 8px; justify-content: center;
}
.pf-diff-btn {
  flex: 1; padding: 8px 6px; border-radius: 10px;
  background: rgba(255,255,255,0.08); border: 2px solid transparent;
  color: #fff; font-weight: 700; font-size: 0.85rem;
  cursor: pointer; transition: border-color 0.15s;
}
.pf-diff-btn small { font-weight: 400; opacity: 0.65; }
.pf-diff-btn--active { border-color: #4fe3ff; background: rgba(79,227,255,0.1); }

.pf-play-btn {
  display: inline-block; margin: 12px 6px 0;
  padding: 12px 36px; border-radius: 14px;
  background: #ffd600; color: #1a1a2e; border: none;
  font-size: 1.2rem; font-weight: 800;
  cursor: pointer; letter-spacing: 0.02em;
  box-shadow: 0 4px 0 #b89a00;
  transition: transform 0.08s;
}
.pf-play-btn:active { transform: translateY(2px); box-shadow: 0 2px 0 #b89a00; }
.pf-play-btn--alt {
  background: rgba(255,255,255,0.15); color: #fff;
  box-shadow: none; font-size: 1rem;
}

/* ---- Rotate overlay ---- */
.pf-rotate {
  display: none; position: fixed; inset: 0;
  flex-direction: column; align-items: center; justify-content: center; gap: 16px;
  background: #0b1026; color: #fff; z-index: 100;
  font-size: 1.1rem; text-align: center;
}
.pf-rotate--show { display: flex; }
.pf-rotate__icon { font-size: 3rem; animation: pf-spin 2s ease-in-out infinite; }
@keyframes pf-spin { 0%,100% { transform: rotate(0deg); } 50% { transform: rotate(90deg); } }
