/* PAPER RUSH: Neighborhood Hero — page, HUD, menus and touch controls. */
.pr-page { --pr-ink: #fff9e8; --pr-gold: #ffd23f; --pr-red: #ff5a4a; --pr-green: #6dec8c; --pr-panel: #1d1b4af2; --pr-edge: #ffd23f;
  --pr-font: "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
  background: radial-gradient(1000px 520px at 70% -10%, #5a3fa8, transparent), #141236; color: var(--pr-ink); min-height: 100vh; }
.pr-page::before { display: none; }
.pr-nav { display: flex; justify-content: space-between; align-items: center; padding: 12px 24px; }
.pr-nav a { color: #ffe9a6; text-decoration: none; font-weight: 700; }
.pr-brand { font-weight: 900; letter-spacing: 1px; color: #fff !important; }
.pr-brand span { color: var(--pr-gold); }
.pr-brand small { margin-left: 8px; font-size: 10px; color: #c9b8ff; letter-spacing: 2px; }
.pr-nav a:focus-visible, .pr-page a:focus-visible { outline: 3px solid var(--pr-gold); outline-offset: 3px; border-radius: 4px; }
.pr-main { max-width: 1240px; margin: 0 auto; padding: 0 16px 28px; }
.pr-heading { display: flex; align-items: baseline; gap: 6px 18px; flex-wrap: wrap; margin: 2px 0 12px; }
.pr-heading h1 { margin: 0; font: 900 clamp(22px, 3.2vw, 36px) var(--pr-font); letter-spacing: 2px; text-transform: uppercase; }
.pr-heading h1 span { color: var(--pr-gold); }
.pr-heading p { margin: 0; color: #d9ceff; }

.pr-stage { position: relative; width: 100%; aspect-ratio: 16 / 9; max-height: calc(100vh - 150px); margin: 0 auto; border-radius: 14px; overflow: hidden; background: #8fd0ff;
  box-shadow: 0 18px 60px #000a, inset 0 0 0 2px #ffd23f55; user-select: none; -webkit-user-select: none; font-family: var(--pr-font); container-type: inline-size; }
.pr-stage:fullscreen { max-height: none; border-radius: 0; }
#game-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; outline: none; cursor: crosshair; image-rendering: auto; }
#game-canvas:focus-visible { outline: 3px solid var(--pr-gold); outline-offset: -3px; }

.pr-hud { position: absolute; top: 0; left: 0; right: 0; pointer-events: none; padding: 8px 10px; text-shadow: 0 2px 3px #000b; }
.pr-hud[hidden] { display: none; }
.pr-hud-row { display: flex; gap: 8px; align-items: stretch; flex-wrap: wrap; max-width: calc(100% - 270px); }
.pr-stat { background: #1d1b4acc; border: 2px solid #ffffff33; border-radius: 10px; padding: 4px 10px; min-width: 64px; text-align: center; line-height: 1.1; }
.pr-stat small { display: block; font-size: clamp(9px, 1.3cqw, 12px); letter-spacing: 1px; text-transform: uppercase; color: #ffe9a6; }
.pr-stat strong { font-size: clamp(14px, 2.4cqw, 24px); font-variant-numeric: tabular-nums; }
.pr-stat-wide { min-width: 150px; flex: 1 1 150px; max-width: 240px; text-align: left; }
.pr-mini { font-size: clamp(9px, 1.3cqw, 12px); color: #fff; }
.pr-progress { height: 8px; border-radius: 6px; background: #0007; overflow: hidden; margin: 3px 0; border: 1px solid #fff5; }
.pr-progress i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #ffd23f, #6dec8c); }
#hud-lives { color: #ff7a8a; letter-spacing: 2px; }
.pr-stat.is-hot strong { color: var(--pr-gold); }

.pr-toolbar { position: absolute; top: 8px; right: 10px; display: flex; gap: 6px; z-index: 5; }
.pr-icon-btn { min-height: 44px; min-width: 44px; padding: 6px 12px; border-radius: 10px; border: 2px solid #ffffff66; background: #1d1b4aee; color: #fff; font-weight: 800; font-size: 13px; }
.pr-icon-btn[hidden] { display: none; }
.pr-icon-btn:hover { background: #3a2f8a; }
.pr-icon-btn:focus-visible, .pr-btn:focus-visible, .pr-touch-btn:focus-visible { outline: 3px solid var(--pr-gold); outline-offset: 2px; }
.pr-live { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

.pr-screen { position: absolute; inset: 0; display: grid; place-items: center; padding: 12px; background: #120d3199; z-index: 4; overflow: auto; }
.pr-screen[hidden] { display: none; }
#screen-menu { background: linear-gradient(#1204407a, #12044099); }
.pr-panel { width: min(520px, 100%); max-height: 100%; overflow: auto; text-align: center; background: var(--pr-panel); border: 3px solid var(--pr-edge); border-radius: 16px; padding: clamp(12px, 3cqw, 24px);
  box-shadow: 0 10px 40px #000c, inset 0 0 0 2px #0006; }
.pr-panel h2 { margin: 0 0 8px; font: 900 clamp(22px, 4cqw, 34px) var(--pr-font); text-transform: uppercase; letter-spacing: 2px; }
.pr-kicker { margin: 0; color: #c9b8ff; font-size: 12px; letter-spacing: 3px; text-transform: uppercase; }
.pr-logo { line-height: 0.95; font-size: clamp(34px, 8cqw, 72px) !important; margin: 4px 0 !important; color: #fff; text-shadow: 0 4px 0 #b3261e, 0 8px 0 #0006; }
.pr-logo b { color: var(--pr-gold); }
.pr-logo small { display: block; margin-top: 6px; font-size: 0.26em; letter-spacing: 4px; color: #ffe9a6; text-shadow: none; }
.pr-best, .pr-total { margin: 6px 0; color: #ffe9a6; }
.pr-best strong, .pr-total strong { color: #fff; font-size: 1.3em; font-variant-numeric: tabular-nums; }
.pr-hint { margin: 10px 0 0; font-size: 13px; color: #d9ceff; }
.pr-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.pr-btn { min-height: 48px; padding: 10px 18px; border-radius: 12px; border: 3px solid #fff7; background: #3a2f8a; color: #fff; font-weight: 900; font-size: 17px; letter-spacing: 1px; text-transform: uppercase; }
.pr-btn:hover { background: #4d3fb5; }
.pr-btn-primary { background: linear-gradient(#ffd23f, #ff9a1f); color: #2b1600; border-color: #fff3c4; }
.pr-btn-primary:hover { background: linear-gradient(#ffe27a, #ffb04a); }
.pr-howto { text-align: left; }
.pr-howto ul { margin: 0; padding-left: 20px; display: grid; gap: 6px; font-size: clamp(13px, 1.9cqw, 16px); line-height: 1.35; }
kbd { display: inline-block; min-width: 1.6em; padding: 1px 6px; margin: 0 2px; border-radius: 6px; border: 2px solid #fff8; background: #0005; font: 800 0.85em var(--pr-font); text-align: center; }
.pr-badge { margin: 6px 0; padding: 6px 12px; border-radius: 999px; display: inline-block; background: var(--pr-gold); color: #2b1600; font-weight: 900; animation: pr-pop 0.6s ease-out; }
.pr-rating { width: 84px; height: 84px; margin: 6px auto; display: grid; place-items: center; border-radius: 50%; font: 900 52px var(--pr-font); color: #2b1600; background: radial-gradient(circle at 35% 30%, #fff3b0, #ffb020); border: 4px solid #fff; animation: pr-pop 0.7s ease-out; }
.pr-table { margin: 8px 0; display: grid; grid-template-columns: 1fr auto; gap: 4px 14px; text-align: left; font-size: clamp(13px, 1.9cqw, 16px); }
.pr-table dt { color: #d9ceff; }
.pr-table dd { margin: 0; font-weight: 800; text-align: right; font-variant-numeric: tabular-nums; }
.pr-table dt, .pr-table dd { animation: pr-rise 0.4s ease-out both; animation-delay: calc(var(--i, 0) * 70ms); }
.pr-table .pr-plus { color: var(--pr-green); }
.pr-table .pr-minus { color: #ff9c8f; }
@keyframes pr-pop { from { transform: scale(0.3); opacity: 0; } 70% { transform: scale(1.12); } to { transform: scale(1); opacity: 1; } }
@keyframes pr-rise { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

.pr-touch { display: none; }
.pr-info { margin-top: 14px; color: #d9ceff; }
.pr-info h2 { font: 800 16px var(--pr-font); margin: 0 0 4px; color: #ffe9a6; }
.pr-info p { margin: 0; line-height: 1.6; }

@container (max-width: 640px) {
  .pr-hud-row { max-width: 100%; margin-top: 52px; }
  .pr-stat { min-width: 52px; padding: 2px 6px; }
  .pr-stat-wide { display: none; }
  .pr-toolbar { left: 10px; right: 10px; justify-content: flex-end; }
  .pr-icon-btn span { display: none; }
  .pr-panel { padding: 10px; }
  .pr-actions { margin-top: 8px; gap: 6px; }
  .pr-btn { min-height: 44px; font-size: 15px; padding: 6px 12px; }
  .pr-howto ul { font-size: 12px; }
  .pr-rating { width: 56px; height: 56px; font-size: 34px; }
}

/* Touch controls sit below the street on phones and tablets so they never cover the road. */
@media (pointer: coarse), (max-width: 820px) {
  .pr-touch { display: grid; grid-template-columns: auto auto 1fr; gap: 10px; margin: 10px auto 0; max-width: 960px; touch-action: none; -webkit-user-select: none; user-select: none; }
  .pr-pad { display: flex; gap: 8px; }
  .pr-pad-throw { justify-content: flex-end; }
  .pr-touch-btn { min-width: 64px; min-height: 64px; flex: 1; border-radius: 16px; border: 3px solid #fff8; background: #3a2f8a; color: #fff; font: 900 22px var(--pr-font); touch-action: none; -webkit-tap-highlight-color: transparent; }
  .pr-touch-btn.is-down { background: #ffd23f; color: #2b1600; transform: scale(0.96); }
  .pr-throw { min-width: 96px; min-height: 72px; font-size: 17px; background: linear-gradient(#ff7a3c, #e0452e); border-color: #fff3c4; }
  .pr-throw.is-down { background: #ffd23f; }
  .pr-stage { max-height: none; }
  .pr-info { display: none; }
}
@media (max-width: 520px) {
  .pr-touch { grid-template-columns: 1fr 1fr; }
  .pr-pad-throw { grid-column: 1 / -1; }
  .pr-throw { min-height: 64px; }
  .pr-nav { padding: 8px 12px; }
  .pr-heading p { display: none; }
}
/* Short landscape phones: overlay the pad on the stage corners and drop the page chrome. */
@media (orientation: landscape) and (max-height: 520px) and (pointer: coarse) {
  .pr-nav, .pr-heading, .pr-info { display: none; }
  .pr-main { padding: 0; max-width: none; }
  .pr-stage { max-height: 100vh; border-radius: 0; width: min(100vw, calc(100vh * 16 / 9)); }
  .pr-touch { position: fixed; left: 8px; right: 8px; bottom: 8px; margin: 0; pointer-events: none; z-index: 20; grid-template-columns: auto auto 1fr; }
  .pr-touch .pr-touch-btn { pointer-events: auto; opacity: 0.72; min-height: 56px; min-width: 56px; }
}
@media (prefers-reduced-motion: reduce) {
  .pr-badge, .pr-rating, .pr-table dt, .pr-table dd { animation: none; }
}
