/* Arcade hub: a retro "game select screen" — dark cabinet background, pixel
   grid, marquee header. Tokens from styles.css, primitives from pixel-ui.css. */

.arcade-body {
  background: #0b1526;
}

.arcade-header {
  --adventure-bg-image: none;
  background:
    linear-gradient(180deg, rgba(11, 21, 42, 0.2), rgba(11, 21, 42, 0.94)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.035) 0 2px, transparent 2px 26px),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.035) 0 2px, transparent 2px 26px),
    linear-gradient(160deg, #0b1526, #16294a 60%, #0b1526);
}

.arcade-marquee {
  width: var(--content);
  margin: 0 auto;
  padding: clamp(28px, 6vw, 64px) 0 clamp(40px, 6vw, 76px);
  text-align: center;
}

.arcade-marquee .eyebrow {
  color: #ffd166;
}

.arcade-marquee h1 {
  color: #ffffff;
  font-size: clamp(1.6rem, 4.4vw, 3rem);
  text-shadow: 4px 4px 0 rgba(0, 0, 0, 0.45), 0 0 28px rgba(255, 209, 102, 0.35);
}

.arcade-marquee-subtitle {
  max-width: 640px;
  margin: 14px auto 0;
  color: rgba(255, 255, 255, 0.78) !important;
}

.arcade-shell {
  width: var(--content);
  margin: 0 auto;
  padding: clamp(24px, 4vw, 48px) 0 clamp(56px, 8vw, 96px);
}

.arcade-footer {
  border-top-color: rgba(255, 255, 255, 0.12);
  background: #0b1526;
  color: rgba(255, 255, 255, 0.65);
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: clamp(18px, 2vw, 28px);
}

.arcade-loading {
  grid-column: 1 / -1;
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
  color: #ffffff;
}

.game-card {
  --notch: 14px;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 240px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: linear-gradient(165deg, #16294a, #0f1e38 120%);
  color: #ffffff;
  padding: clamp(20px, 2.4vw, 28px);
  text-decoration: none;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.game-card p {
  color: rgba(255, 255, 255, 0.78);
  margin: 0;
}

.game-card-available:hover,
.game-card-available:focus-visible {
  border-color: #ffd166;
  box-shadow: 0 0 0 1px rgba(255, 209, 102, 0.5), 0 20px 40px rgba(0, 0, 0, 0.4);
  transform: translateY(-5px) scale(1.015);
}

.game-card-locked {
  border-style: dashed;
  background: linear-gradient(165deg, #1a2237, #12182a 120%);
  color: rgba(255, 255, 255, 0.55);
  filter: grayscale(0.35);
}

.game-card-locked p {
  color: rgba(255, 255, 255, 0.5);
}

.game-card-icon {
  display: inline-grid;
  align-self: center;
  width: 56px;
  height: 56px;
  place-items: center;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  color: #ffd166;
}

.game-card-locked .game-card-icon {
  color: rgba(255, 255, 255, 0.5);
}

.game-card h3 {
  color: #ffffff;
  font-size: 1.2rem;
  text-align: center;
}

.game-card-ribbon {
  position: absolute;
  top: 14px;
  right: -30px;
  transform: rotate(28deg);
  background: #4b5565;
  color: #ffffff;
  font-size: 0.58rem;
  letter-spacing: 0.02em;
  padding: 0.34rem 2.2rem;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35);
}

.game-card-ribbon-live {
  background: var(--green);
}

.game-card-tag {
  margin-top: auto;
  color: #ffd166 !important;
  font-size: 0.82rem;
  font-weight: 850;
}

.arcade-error {
  grid-column: 1 / -1;
  border-color: #f0b8b2;
  background: rgba(255, 241, 240, 0.94);
  color: var(--ink);
  padding: 24px;
}

@media (max-width: 720px) {
  .game-card-ribbon {
    right: -34px;
  }
}

/* ==========================================================================
   Shared across every arcade game (not just the hub): a small dark icon
   button, and the "How to Play" instructions modal (see instructions-modal.js).
   ========================================================================== */

.arcade-icon-button {
  width: 44px;
  height: 44px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.arcade-icon-button svg {
  width: 20px;
  height: 20px;
  display: block;
}

.instructions-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: grid;
  place-items: center;
  background: rgba(6, 12, 24, 0.74);
  backdrop-filter: blur(3px);
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom))
    max(16px, env(safe-area-inset-left));
}

.instructions-overlay[hidden] {
  display: none;
}

.instructions-panel {
  --notch: 14px;
  display: flex;
  flex-direction: column;
  width: min(560px, 100%);
  max-height: min(82svh, 640px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: #101c34;
  color: #ffffff;
}

.instructions-panel:focus {
  outline: none;
}

.instructions-header {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  padding: 16px 18px;
}

.instructions-header h2 {
  margin: 0;
  color: #ffffff;
  font-size: clamp(0.92rem, 3.2vw, 1.15rem);
}

.instructions-body {
  flex: 1 1 auto;
  display: grid;
  gap: 18px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 18px;
}

.instructions-body h3 {
  margin: 0 0 6px;
  color: #ffd166;
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.instructions-body p {
  margin: 0;
  color: rgba(255, 255, 255, 0.86);
  font-size: 0.96rem;
  line-height: 1.55;
}

.instructions-footer {
  flex: 0 0 auto;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  padding: 14px 18px max(14px, env(safe-area-inset-bottom));
}

.instructions-footer .primary-button {
  width: 100%;
}
