/* FreePlayZone — shared game shell styles. Every game links this file. */
:root {
  --bg: #0b0e17;
  --panel: #171c2f;
  --panel-edge: #242c4c;
  --text: #eef1f9;
  --muted: #8b93ad;
  --accent: #3ee07f; /* games override per-game */
  --danger: #ff5d5d;
  --radius: 14px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: radial-gradient(1100px 700px at 50% -10%, #141b31, var(--bg));
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.fpz-hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: var(--stage-w, min(94vw, 540px));
  padding: 8px 2px;
  font-weight: 600;
  font-size: 15px;
}
.fpz-hud .fpz-score { color: var(--accent); font-variant-numeric: tabular-nums; }
.fpz-hud .fpz-best { color: var(--muted); font-variant-numeric: tabular-nums; }
.fpz-hud .fpz-spacer { flex: 1; }

canvas.fpz-canvas {
  display: block;
  background: #0d1120;
  border: 1px solid var(--panel-edge);
  border-radius: var(--radius);
  touch-action: none;
}

.fpz-btn {
  background: linear-gradient(180deg, var(--accent), color-mix(in srgb, var(--accent) 72%, #000));
  color: #071508;
  border: 0;
  border-radius: 12px;
  padding: 12px 26px;
  font: 700 16px/1 system-ui, sans-serif;
  cursor: pointer;
  box-shadow: 0 6px 22px color-mix(in srgb, var(--accent) 35%, transparent);
}
.fpz-btn:hover { filter: brightness(1.1); }
.fpz-btn:active { transform: translateY(1px); }

.fpz-btn--ghost {
  background: #212945;
  color: var(--text);
  box-shadow: none;
  border: 1px solid var(--panel-edge);
}
.fpz-btn--small { padding: 7px 14px; font-size: 13px; border-radius: 9px; }

.fpz-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(7, 10, 18, 0.72);
  backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}
.fpz-overlay.show { opacity: 1; pointer-events: auto; }

.fpz-panel {
  background: var(--panel);
  border: 1px solid var(--panel-edge);
  border-radius: 18px;
  padding: 30px 36px;
  text-align: center;
  max-width: min(92vw, 430px);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
}
.fpz-panel h1 { margin: 0 0 8px; font-size: 26px; letter-spacing: 0.3px; }
.fpz-panel p {
  margin: 0 0 20px;
  color: var(--muted);
  white-space: pre-line;
  line-height: 1.55;
  font-size: 15px;
}
.fpz-panel .fpz-newbest {
  display: inline-block;
  margin-bottom: 14px;
  padding: 5px 12px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  color: var(--accent);
  font-weight: 700;
  font-size: 13px;
}

/* On-screen touch buttons (games opt in) */
.fpz-touch {
  position: fixed;
  bottom: 14px;
  display: flex;
  gap: 12px;
  z-index: 20;
}
.fpz-touch--left { left: 14px; }
.fpz-touch--right { right: 14px; }
.fpz-touch button {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 1px solid var(--panel-edge);
  background: rgba(33, 41, 69, 0.75);
  color: var(--text);
  font-size: 22px;
  cursor: pointer;
  touch-action: none;
}
.fpz-touch button:active { background: color-mix(in srgb, var(--accent) 40%, #212945); }
@media (hover: hover) and (pointer: fine) {
  .fpz-touch { display: none; } /* hidden on mouse-only devices */
}
