/*!
 * Peep Arcade — shared game-card / fullscreen-shell / HUD styles.
 * Matches the site's own design tokens (--dp-*) from dp-site.css/dpsite.css.
 */

.pa-root { margin: 46px auto 8px; max-width: 960px; }

.pa-shell {
  position: relative;
  width: 100%;
  aspect-ratio: 960 / 440;
  border-radius: var(--dp-radius, 18px);
  overflow: hidden;
  /* the game's own dawn backdrop (scene0.svg) as the card art, so the card
     reads as a preview of the game — plus a top-to-floor dark scrim (same
     idea as the in-canvas gradient the game itself paints over each scene)
     so the title/copy/button stay legible over busy sky art. */
  background:
    linear-gradient(180deg, rgba(8, 10, 26, .18) 0%, rgba(8, 10, 26, .38) 55%, rgba(8, 10, 26, .68) 100%),
    url("scenes/scene0.7ded78bd5f32.svg") center / cover no-repeat;
  border: 1px solid var(--dp-line, #d9efe8);
  box-shadow: 0 30px 70px -40px rgba(16, 40, 60, .45);
  outline: none;
}
.pa-shell.pa-is-fullscreen,
.pa-shell:fullscreen,
.pa-shell:-webkit-full-screen {
  width: 100vw;
  height: 100vh;
  aspect-ratio: auto;
  border-radius: 0;
  max-width: none;
}

/* ---- attract state (idle card, no game loop running) ----
   `:not([hidden])` matters here: a bare `.pa-attract{display:flex}` rule
   ties with the UA `[hidden]{display:none}` rule on specificity and (being
   an author rule) wins by source order regardless of the `hidden` attribute
   — silently defeating .hidden=true/false toggling in JS. Scope it out. */
.pa-attract:not([hidden]) {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 8px;
  padding: 24px;
}
.pa-attract-peep { width: 118px; height: 124px; margin-bottom: 4px; filter: drop-shadow(0 10px 22px rgba(0, 0, 0, .4)); }
.pa-attract-peep svg { display: block; width: 100%; height: 100%; }
.pa-attract-peep.pa-bob { animation: pa-float 3.2s ease-in-out infinite; }
.pa-attract h3 {
  font-family: "Montserrat", sans-serif;
  font-weight: 900;
  font-size: 26px;
  margin: 0;
  color: #fff;
  text-shadow: 0 2px 16px rgba(6, 4, 16, .5);
}
.pa-attract p { margin: 0; color: #eafcff; opacity: .92; font-size: 15.5px; text-shadow: 0 1px 10px rgba(6, 4, 16, .4); }
.pa-play {
  display: inline-block;
  border: 0;
  cursor: pointer;
  background: var(--dp-grad, linear-gradient(120deg, #3ee3b0 0%, #1cc6ec 40%, #4d8bd4 72%, #1ec990 100%));
  color: #06202b;
  font-weight: 800;
  font-family: "Montserrat", sans-serif;
  padding: 14px 30px;
  border-radius: 999px;
  font-size: 16px;
  box-shadow: 0 16px 34px -14px rgba(18, 176, 216, .7);
  margin-top: 4px;
}
.pa-play:hover { filter: brightness(1.06); }
.pa-instructions { font-size: 13.5px; color: #eafcff; opacity: .8; }

/* score chip — best-score readout on the attract card; always renders text
   (a friendly "Not played yet" when there's no score in localStorage), so
   the pill never sits there empty/collapsed. */
.pa-best {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
  font-size: 12.5px;
  font-weight: 800;
  font-family: "Montserrat", sans-serif;
  letter-spacing: .01em;
  color: #eafcff;
  background: rgba(62, 227, 176, .16);
  border: 1px solid rgba(126, 232, 255, .38);
  padding: 5px 14px;
  border-radius: 999px;
  min-height: 1em;
  backdrop-filter: blur(4px);
}

/* ---- play state (canvas + DOM peep + HUD) ---- */
.pa-stage { position: absolute; inset: 0; background: #0b1520; }
.pa-canvas { display: block; }
.pa-peep-layer { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.pa-peep { position: absolute; transform-origin: center bottom; will-change: transform; }

.pa-hud {
  position: absolute; top: 12px; left: 12px; right: 12px;
  display: flex; align-items: flex-start; justify-content: space-between; gap: 10px;
  pointer-events: none;
}
.pa-score {
  pointer-events: auto;
  background: rgba(8, 20, 30, .55);
  color: #eafcff;
  font-weight: 800;
  font-family: "Montserrat", sans-serif;
  font-size: 14px;
  padding: 8px 14px;
  border-radius: 999px;
  backdrop-filter: blur(6px);
}
.pa-hud-btns { display: flex; gap: 8px; pointer-events: auto; }
.pa-mute, .pa-close {
  border: 1px solid rgba(255, 255, 255, .35);
  background: rgba(8, 20, 30, .55);
  color: #eafcff;
  font-weight: 700;
  font-size: 13px;
  padding: 7px 12px;
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
}
.pa-mute:hover, .pa-close:hover { background: rgba(8, 20, 30, .8); }

.pa-hud-instructions {
  position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%);
  color: rgba(234, 252, 255, .75);
  font-size: 12.5px;
  font-weight: 600;
  background: rgba(8, 20, 30, .4);
  padding: 5px 12px;
  border-radius: 999px;
  pointer-events: none;
  white-space: nowrap;
}

.pa-gameover:not([hidden]) {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  background: rgba(8, 20, 30, .72);
  color: #fff;
  text-align: center;
  padding: 24px;
}
.pa-gameover h3 { font-family: "Montserrat", sans-serif; font-size: 24px; margin: 0; }
.pa-gameover p { margin: 0; font-weight: 700; color: #eafcff; }
.pa-gameover .pa-play { margin-top: 2px; }

@keyframes pa-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

/* ---- the "Peep Arcade" console — a framed cabinet shell around the 3-game
   row on the home page (see .pa-arcade-row in peep-invaders.css). A mint
   -gradient border + a dark console body, with the store-local nerve motifs
   (circuit/nodegraph/bloom, generated once via /art/render, see static/game/
   art/PROVENANCE.txt) drifting behind the cards as low-opacity ambience —
   the games stay the hero, the art is atmosphere. ---- */
.pa-console {
  position: relative;
  margin: 34px auto 0;
  border-radius: 30px;
  padding: 2px; /* the gradient "frame" thickness */
  background: var(--dp-grad, linear-gradient(120deg, #3ee3b0 0%, #1cc6ec 40%, #4d8bd4 72%, #1ec990 100%));
  box-shadow: 0 40px 90px -50px rgba(6, 120, 140, .55);
}
.pa-console-inner {
  position: relative;
  border-radius: 28px;
  overflow: hidden;
  background: linear-gradient(180deg, #0c1120 0%, #0a0f1c 60%, #0b1020 100%);
  padding: 22px clamp(16px, 3vw, 30px) 30px;
}
.pa-console-bar {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  margin-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, .09);
}
.pa-console-eyebrow {
  font-family: "Montserrat", sans-serif;
  font-weight: 900;
  font-size: 13px;
  letter-spacing: .22em;
  text-transform: uppercase;
  background: var(--dp-grad, linear-gradient(120deg, #3ee3b0 0%, #1cc6ec 40%, #4d8bd4 72%, #1ec990 100%));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.pa-console-dots { display: flex; gap: 6px; }
.pa-console-dots i { display: block; width: 7px; height: 7px; border-radius: 50%; background: rgba(255, 255, 255, .22); }

/* ambient nerve-motif layer — store-local SVGs, decorative only (aria-hidden),
   dialled right down so the cabinets read clearly on top. */
.pa-console-bg { position: absolute; inset: 0; overflow: hidden; z-index: 0; }
.pa-console-motif { position: absolute; display: block; opacity: .13; filter: saturate(1.05); }
.pa-console-motif--circuit { top: -70px; left: -60px; width: 360px; height: 360px; animation: pa-console-drift-a 48s ease-in-out infinite; }
.pa-console-motif--nodegraph { bottom: -90px; right: -70px; width: 400px; height: 400px; opacity: .11; animation: pa-console-drift-b 56s ease-in-out infinite; }
.pa-console-motif--bloom { top: 18%; right: 6%; width: 220px; height: 220px; opacity: .1; animation: pa-console-pulse 9s ease-in-out infinite; }
.pa-console .pa-arcade-row { position: relative; z-index: 1; }

/* ---- shared scoreboard — sits BELOW the 3-up cards, inside the console.
   One column per game, each showing that game's high score(s): the local
   top-5 the card's game.js already writes on game-over/win (see
   peep-runner.js/peep-invaders.js/pacpeep.js), read + rendered by
   static/game/peep-arcade-board.js. Dark, on-brand, framed like a real
   cabinet marquee — the "beat your best" close of the CTA, not an
   afterthought. ---- */
.pa-scoreboard {
  position: relative;
  z-index: 1;
  margin-top: 26px;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, .09);
}
.pa-scoreboard-head { text-align: center; margin-bottom: 18px; }
.pa-scoreboard-eyebrow {
  display: inline-block;
  font-family: "Montserrat", sans-serif;
  font-weight: 900;
  font-size: 11.5px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: #06202b;
  background: var(--dp-grad, linear-gradient(120deg, #3ee3b0 0%, #1cc6ec 40%, #4d8bd4 72%, #1ec990 100%));
  padding: 5px 14px;
  border-radius: 999px;
}
.pa-scoreboard-head h3 {
  font-family: "Montserrat", sans-serif;
  font-weight: 900;
  font-size: 21px;
  margin: 10px 0 4px;
  color: #fff;
}
.pa-scoreboard-head p { margin: 0; color: #b8d4e0; font-size: 14px; }
.pa-scoreboard-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.pa-scoreboard-col {
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 16px;
  padding: 16px 16px 14px;
}
.pa-scoreboard-col h4 {
  font-family: "Montserrat", sans-serif;
  font-weight: 800;
  font-size: 14.5px;
  margin: 0 0 6px;
  color: #eafcff;
}
.pa-scoreboard-best {
  margin: 0 0 10px;
  font-family: "Montserrat", sans-serif;
  font-weight: 800;
  font-size: 13px;
  color: #7ee8ff;
}
.pa-scoreboard-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.pa-scoreboard-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #eafcff;
  background: rgba(8, 20, 30, .4);
  border-radius: 9px;
  padding: 6px 10px;
}
.pa-scoreboard-list li:first-child { background: linear-gradient(100deg, rgba(62, 227, 176, .22), rgba(6, 182, 212, .14)); }
.pa-scoreboard-list .rk { font-weight: 900; color: #7ee8ff; width: 14px; text-align: center; }
.pa-scoreboard-list li:first-child .rk { color: #ffd166; }
.pa-scoreboard-list .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; opacity: .9; }
.pa-scoreboard-list .sc { font-weight: 800; font-variant-numeric: tabular-nums; }
.pa-scoreboard-empty { justify-content: center; color: #8fa3ae; font-style: italic; background: transparent; padding: 10px; }

@media (max-width: 720px) {
  .pa-scoreboard-grid { grid-template-columns: 1fr; }
}

@keyframes pa-console-drift-a {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  50% { transform: translate(16px, -12px) rotate(3deg); }
}
@keyframes pa-console-drift-b {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  50% { transform: translate(-14px, 10px) rotate(-2deg); }
}
@keyframes pa-console-pulse {
  0%, 100% { opacity: .07; }
  50% { opacity: .15; }
}

@media (prefers-reduced-motion: reduce) {
  .pa-attract-peep.pa-bob { animation: none; }
  .pa-console-motif { animation: none; }
}

@media (max-width: 640px) {
  .pa-attract h3 { font-size: 21px; }
  .pa-attract-peep { width: 92px; height: 96px; }
  .pa-hud-instructions { font-size: 11px; }
  .pa-console { border-radius: 24px; }
  .pa-console-inner { border-radius: 22px; padding: 18px 14px 24px; }
  .pa-console-eyebrow { font-size: 11px; letter-spacing: .16em; }
}
