/* Packet Runner. The page chrome follows the light/dark theme.
   This play area stays the dark neon stage in both themes. */

.pr-shell {
  position: relative;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  background: #050805;
  border: 1px solid rgba(57, 255, 20, 0.35);
  border-radius: 12px;
  box-shadow: 0 0 24px rgba(57, 255, 20, 0.12);
  overflow: hidden;
  color: #d8ffe4;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

.pr-stage {
  position: relative;
  background: #050805;
}

.pr-shell canvas {
  display: block;
  width: 100%;
  height: 230px;
  touch-action: none;
  cursor: pointer;
}

.pr-shell .game-hud {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  gap: 0.4rem;
  padding: 0.45rem 0.7rem;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.74rem;
  letter-spacing: 0.03em;
  color: #7cff6b;
  pointer-events: none;
  text-shadow: 0 0 8px rgba(57, 255, 20, 0.35);
}

.pr-shell .game-hud strong {
  color: #39ff14;
  font-weight: 700;
}

.pr-shell .game-overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  padding: 1.1rem 0.9rem;
  text-align: center;
  background: rgba(0, 0, 0, 0.78);
  color: #d8ffe4;
}

.pr-shell .game-overlay[hidden] {
  display: none !important;
}

.pr-shell .game-overlay h2 {
  margin: 0;
  font-size: clamp(1.25rem, 4.4vw, 1.7rem);
  color: #39ff14;
  letter-spacing: 0.04em;
  text-shadow: 0 0 12px rgba(57, 255, 20, 0.45);
}

.pr-shell .game-overlay p {
  margin: 0;
  max-width: 28rem;
  color: #c8f5c4;
  font-size: 0.92rem;
  line-height: 1.35;
}

.pr-shell .game-overlay .muted {
  color: #6a9a6a;
  font-size: 0.78rem;
}

.pr-shell .score-line {
  color: #7cff6b;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 1rem;
}

.pr-shell .game-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 8.5rem;
  padding: 0.55rem 1.3rem;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.95rem;
  font-weight: 700;
  color: #041004;
  background: #39ff14;
  border: 2px solid #39ff14;
  border-radius: 999px;
  cursor: pointer;
}

.pr-shell .game-btn:disabled {
  opacity: 0.7;
  cursor: progress;
}

.pr-shell .game-btn:focus-visible {
  outline: 2px solid #e8ffe4;
  outline-offset: 2px;
}

.pr-pad {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.4rem;
  padding: 0.55rem;
  background: #050805;
}

.pr-pad__btn {
  min-height: 44px;
  padding: 0.35rem 0.2rem;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.78rem;
  font-weight: 700;
  color: #d8ffe4;
  background: #0d1f0e;
  border: 1px solid rgba(57, 255, 20, 0.45);
  border-radius: 10px;
  cursor: pointer;
}

.pr-pad__btn:focus-visible {
  outline: 2px solid #39ff14;
  outline-offset: 2px;
}

.pr-pad__btn--pause {
  grid-column: 1 / -1;
}

html[data-theme="light"] .pr-shell,
html[data-theme="light"] .pr-shell .pr-stage,
html[data-theme="light"] .pr-shell .pr-pad,
html[data-theme="light"] .pr-shell .game-overlay,
html[data-theme="light"] .pr-shell .game-hud,
html[data-theme="light"] .pr-shell .game-overlay h2,
html[data-theme="light"] .pr-shell .game-overlay p,
html[data-theme="light"] .pr-shell .pr-pad__btn {
  color: #d8ffe4;
}

html[data-theme="light"] .pr-shell .game-overlay h2,
html[data-theme="light"] .pr-shell .game-hud,
html[data-theme="light"] .pr-shell .game-hud strong,
html[data-theme="light"] .pr-shell .score-line {
  color: #39ff14;
}

html[data-theme="light"] .pr-shell .game-overlay p {
  color: #c8f5c4;
}

html[data-theme="light"] .pr-shell .game-btn {
  color: #041004;
  background: #39ff14;
  border-color: #39ff14;
}

html[data-theme="light"] .pr-shell,
html[data-theme="light"] .pr-stage,
html[data-theme="light"] .pr-pad {
  background: #050805;
  border-color: rgba(57, 255, 20, 0.55);
}

body[data-games-page="packet-runner"] .game-howto {
  margin: 1.1rem 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.95rem;
}

body[data-games-page="packet-runner"] .game-howto li {
  position: relative;
  margin: 0.4rem 0;
  padding-left: 1.1rem;
}

body[data-games-page="packet-runner"] .game-howto li::before {
  content: "▸";
  position: absolute;
  left: 0;
  color: #39ff14;
}

@media (max-width: 420px) {
  .pr-shell .game-hud {
    font-size: 0.68rem;
    gap: 0.25rem;
  }

  .pr-pad__btn {
    font-size: 0.72rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pr-shell {
    box-shadow: none;
  }
}
