@import url("/css/games-themes.css");
@import url("/css/games-phone.css");
/* Game sky. Same night as the house, closer stars, a brighter blue nebula.
   Glass cards, round edges. The felt and the play stay in front. */
html { background: #000103; }
body.ps-page, body {
  background:
    radial-gradient(ellipse 26% 18% at 14% 16%, rgba(180, 220, 255, 0.45), transparent 46%),
    radial-gradient(ellipse 34% 24% at 20% 22%, rgba(0, 160, 255, 0.48), transparent 62%),
    radial-gradient(ellipse 22% 16% at 78% 12%, rgba(0, 255, 240, 0.32), transparent 58%),
    radial-gradient(ellipse 40% 28% at 68% 78%, rgba(20, 80, 180, 0.4), transparent 70%),
    #000103;
  color: #eef6ff;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background-image:
    radial-gradient(1.5px 1.5px at 8% 12%, #fff, transparent),
    radial-gradient(1px 1px at 12% 18%, rgba(0, 255, 240, 0.9), transparent),
    radial-gradient(2px 2px at 18% 10%, #eef6ff, transparent),
    radial-gradient(1px 1px at 24% 16%, rgba(160, 210, 255, 0.9), transparent),
    radial-gradient(1.4px 1.4px at 70% 14%, #fff, transparent),
    radial-gradient(1px 1px at 76% 8%, rgba(0, 255, 240, 0.85), transparent),
    radial-gradient(1.6px 1.6px at 84% 18%, #fff, transparent),
    radial-gradient(1px 1px at 40% 70%, rgba(238, 246, 255, 0.75), transparent),
    radial-gradient(1.2px 1.2px at 58% 84%, rgba(0, 255, 240, 0.7), transparent);
  background-size: 100% 100%, 160px 160px, 160px 160px, 220px 220px, 100% 100%, 180px 180px, 100% 100%, 100% 100%, 200px 200px;
  opacity: 0.85;
  animation: psg-drift 80s linear infinite;
}
@keyframes psg-drift {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(-1.5%, -1%, 0); }
}
.game-card, .psg-card, .cosmic-card, .panel, .felt {
  border-radius: 28px;
  background: rgba(6, 16, 32, 0.62);
  border: 1px solid rgba(0, 255, 240, 0.24);
  box-shadow:
    0 16px 40px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(238, 246, 255, 0.08);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.game-mark, .game-thumb {
  border-radius: 18px;
}
.game-mark {
  width: 42px;
  height: 42px;
  background: #000103 url("/assets/icons/icon-72x72.png") center/cover;
  box-shadow: 0 0 18px rgba(0, 255, 240, 0.35);
}
.btn, button, .option-btn, .opt-cell, .tile, .pad, .card {
  border-radius: 18px;
}
.sd-stage, .stage, canvas {
  border-radius: 28px;
}
@media (prefers-reduced-motion: reduce) {
  body::before { animation: none; }
  .game-card, .btn, .tile, .pad, .card { transition: none; }
}

body::before {
  content: "";
  position: fixed;
  inset: -3%;
  z-index: -3;
  pointer-events: none;
  opacity: 1;
  animation: none;
  background: linear-gradient(180deg, rgba(0,1,3,.12), rgba(0,1,3,.28)), url("/assets/theme/sky.jpg") center/cover no-repeat;
}
.ps-theme-pic { width: min(100%, 720px); border-radius: 22px; display: block; margin: 12px auto; border: 1px solid rgba(0,255,240,.28); }

.ps-theme-pic { width: min(100%, 640px); max-height: 280px; object-fit: cover; object-position: center; border-radius: 22px; display: block; margin: 16px auto; border: 1px solid rgba(0,255,240,.28); box-shadow: 0 0 32px rgba(0,180,255,.25); }
.game-card, .hub-top, .daily, .shelf { border-radius: 22px; background: rgba(6,14,28,.62); border: 1px solid rgba(0,255,240,.22); backdrop-filter: blur(10px); }
img.ps-theme-pic.ps-game-icon { width: min(78vw, 280px); max-width: 280px; max-height: 280px; height: auto; aspect-ratio: 1; object-fit: cover; }
/* The star photograph sits behind the page. Cards stay solid so the words can be read. */
body.ps-page, body {
  background-color: transparent;
  background-image: none;
}
html, body {
  overflow-x: hidden;
  overflow-y: auto;
  height: auto;
  min-height: 100%;
}

/* Glow pass. Cyan and magenta, slow. No game removed. */
.game-card, .hub-top, .daily, .shelf, .psg-card, .cosmic-card, .panel, .felt {
  box-shadow:
    0 0 0 1px rgba(0, 255, 240, 0.28),
    0 0 22px rgba(0, 255, 240, 0.14),
    0 14px 32px rgba(255, 0, 255, 0.08);
  transition: transform 0.35s ease, box-shadow 0.35s ease;
}
.game-card:hover, .hub-top:hover, .shelf a:hover {
  transform: translateY(-2px);
  box-shadow:
    0 0 0 1px rgba(255, 0, 255, 0.45),
    0 0 28px rgba(0, 255, 240, 0.22),
    0 16px 36px rgba(255, 0, 255, 0.12);
}
.btn, button, .option-btn, .opt-cell, .tile, .pad {
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.btn:hover, button:hover, .option-btn:hover, .tile:hover, .pad:hover {
  box-shadow: 0 0 16px rgba(0, 255, 240, 0.28), 0 0 22px rgba(255, 0, 255, 0.12);
}
@media (prefers-reduced-motion: reduce) {
  .game-card, .hub-top, .daily, .shelf, .psg-card, .btn, button, .tile, .pad { transition: none; }
  .game-card:hover, .hub-top:hover, .shelf a:hover { transform: none; }
}

/* Phone play. Boards stay inside the night. No game removed. */
@media (max-width: 720px) {
  .grid, .cc-grid, .sd-stage, .stage, canvas, .board, .keys, .controls, .sd-controls, .opt-row {
    max-width: 100%;
  }
  canvas, .sd-stage, .grid, .cc-sky, .cc-grid {
    box-shadow:
      0 0 0 1px rgba(0, 255, 240, 0.38),
      0 0 26px rgba(0, 255, 240, 0.16),
      0 14px 30px rgba(255, 0, 255, 0.1);
  }
  .cosmic-card, .game-card {
    border-radius: 22px;
  }
  .btn, .option-btn, .opt-cell, .tile, .pad, .key {
    min-height: 48px;
  }
  .game-thumb { height: 148px; }
}
/* Progress on the cards you already have. Nothing removed. */
.game-card.ps-rank-2 { box-shadow: 0 0 0 1px rgba(0, 255, 240, 0.55), 0 0 28px rgba(0, 255, 240, 0.22); }
.game-card.ps-rank-5 { box-shadow: 0 0 0 1px rgba(255, 0, 255, 0.55), 0 0 28px rgba(0, 255, 240, 0.2), 0 0 36px rgba(255, 0, 255, 0.16); }
.game-card.ps-rank-10 { box-shadow: 0 0 0 1px #ffd700, 0 0 26px rgba(255, 215, 0, 0.28), 0 0 36px rgba(0, 255, 240, 0.16); }
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background-image:
    radial-gradient(1.5px 1.5px at 12% 18%, #fff, transparent),
    radial-gradient(1.2px 1.2px at 72% 22%, rgba(0, 255, 240, 0.9), transparent),
    radial-gradient(1.4px 1.4px at 40% 70%, rgba(255, 0, 255, 0.55), transparent),
    radial-gradient(1px 1px at 84% 78%, #eef6ff, transparent);
  background-size: 180px 180px, 220px 220px, 260px 260px, 200px 200px;
  opacity: 0.55;
  animation: psg-drift 90s linear infinite;
}
@media (prefers-reduced-motion: reduce) {
  body::after { animation: none; }
}

/* Some pages still paint the body when the phone is set to light mode. The house starts dark
   whatever the phone says, so keep the photograph showing. The Light button still wins. */
@media (prefers-color-scheme: light) {
  html:not([data-theme="light"]) body {
    background-color: transparent !important;
    background-image: none !important;
  }
}
