/* light-theme: manual
   NexGames "arcade" style (nexgames.html only, after its inline <style>).
   Neon marquee title, cabinet cards with a per-game neon rim, CRT scanlines on
   the thumbnails, a synthwave floor grid behind the header and arcade type.
   Remove the <link> in nexgames.html to revert. Selectors start with :root to
   outrank the generated light-theme rules; light variant at the end. */

:root .nexgames-hub {
  --ar-pixel: "Press Start 2P", monospace;
  --ar-marquee: "Bungee", "Inter", sans-serif;
  --ar-pink: #ff3ea5;
  --ar-cyan: #22d3ee;
  --ar-yellow: #facc15;
  --ar-panel: #0b0b1a;
}

/* per-game neon colour, picked from the thumbnail class */
:root .nexgames-card { --neon: #a78bfa; }
:root .nexgames-card:has(.nh-thumb) { --neon: #a855f7; }
:root .nexgames-card:has(.bc-thumb) { --neon: #22c55e; }
:root .nexgames-card:has(.sj-thumb) { --neon: #818cf8; }
:root .nexgames-card:has(.tr-thumb) { --neon: #38bdf8; }
:root .nexgames-card:has(.cs-thumb) { --neon: #ef4444; }
:root .nexgames-card:has(.ngc-thumb) { --neon: #f59e0b; }

/* --- header: neon marquee over a synthwave floor --- */
:root .nexgames-hub .nexgames-header {
  position: relative;
  padding-bottom: 2.5rem;
}

:root .nexgames-hub .nexgames-header::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -1rem;
  width: min(1100px, 100%);
  height: 180px;
  translate: -50% 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(255, 62, 165, 0.35) 1px, transparent 1px) 50% 0 / 48px 100%,
    linear-gradient(0deg, rgba(34, 211, 238, 0.35) 1px, transparent 1px) 0 0 / 100% 24px;
  transform: perspective(240px) rotateX(58deg);
  transform-origin: 50% 100%;
  -webkit-mask-image: linear-gradient(0deg, #000 10%, transparent 90%);
  mask-image: linear-gradient(0deg, #000 10%, transparent 90%);
  animation: ar-floor 2.4s linear infinite;
}

@keyframes ar-floor {
  from { background-position: 50% 0, 0 0; }
  to   { background-position: 50% 0, 0 24px; }
}

:root .nexgames-hub .nexgames-header h2 {
  font-family: var(--ar-marquee);
  font-weight: 400;
  letter-spacing: 0.04em;
}

:root .nexgames-hub .nexgames-header h2 span {
  background: none;
  -webkit-text-fill-color: #fff0fa;
  color: #fff0fa;
  text-shadow:
    0 0 4px #fff,
    0 0 12px var(--ar-pink),
    0 0 28px var(--ar-pink),
    0 0 56px rgba(255, 62, 165, 0.6);
  animation: ar-flicker 6s infinite;
}

/* neon tube flicker: mostly steady, two quick drop-outs per cycle */
@keyframes ar-flicker {
  0%, 18%, 22%, 62%, 64%, 66%, 100% { opacity: 1; }
  20%, 63%, 65% { opacity: 0.45; }
}

:root .nexgames-hub .nexgames-icon {
  color: var(--ar-cyan);
  filter: drop-shadow(0 0 10px var(--ar-cyan));
}

:root .nexgames-hub .nexgames-header p { color: #c4c4e8; }

:root .nexgames-hub .nexgames-leaderboard-link {
  font-family: var(--ar-pixel);
  font-size: 0.6rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 2px solid var(--ar-yellow);
  border-radius: 4px;
  background: rgba(250, 204, 21, 0.08);
  color: var(--ar-yellow);
  padding: 0.75rem 1rem;
  box-shadow: 0 0 14px rgba(250, 204, 21, 0.25);
}

:root .nexgames-hub .nexgames-leaderboard-link:hover {
  background: var(--ar-yellow);
  color: #1a1400;
  box-shadow: 0 0 24px rgba(250, 204, 21, 0.6);
}

/* --- cabinet cards --- */
:root .nexgames-hub .nexgames-card {
  background: var(--ar-panel);
  border: 2px solid color-mix(in srgb, var(--neon) 55%, transparent);
  border-radius: 10px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.6), 0 0 18px color-mix(in srgb, var(--neon) 18%, transparent);
}

:root .nexgames-hub .nexgames-card:hover {
  border-color: var(--neon);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.6), 0 0 34px color-mix(in srgb, var(--neon) 45%, transparent);
}

/* CRT screen: scanlines + vignette over the thumbnail */
:root .nexgames-hub .nexgames-card-thumb {
  position: relative;
  border-bottom: 2px solid color-mix(in srgb, var(--neon) 55%, transparent);
}

:root .nexgames-hub .nexgames-card-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.28) 0 1px, transparent 1px 3px),
    radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, 0.55) 100%);
}

:root .nexgames-hub .nexgames-card-thumb i {
  color: #fff;
  filter: drop-shadow(0 0 6px var(--neon)) drop-shadow(0 0 16px var(--neon));
}

:root .nexgames-hub .nexgames-card:hover .nexgames-card-thumb i {
  animation: ar-crt 0.35s steps(2) 2;
}

@keyframes ar-crt {
  50% { transform: translateX(2px) scale(1.12); opacity: 0.75; }
}

/* --- card type --- */
:root .nexgames-hub .nexgames-card-tag,
:root .nexgames-hub .nexgames-card-version,
:root .nexgames-hub .nexgames-card-cta {
  font-family: var(--ar-pixel);
  text-transform: uppercase;
}

:root .nexgames-hub .nexgames-card-tag {
  font-size: 0.5rem;
  line-height: 1.7;
  letter-spacing: 0.04em;
  color: var(--neon);
}

:root .nexgames-hub .nexgames-card-body h3 {
  font-family: var(--ar-marquee);
  font-weight: 400;
  font-size: 1.05rem;
  letter-spacing: 0.01em;
  overflow-wrap: anywhere;
}

:root .nexgames-hub .nexgames-card-version {
  font-size: 0.45rem;
  border-radius: 2px;
  border-color: color-mix(in srgb, var(--neon) 50%, transparent);
  background: color-mix(in srgb, var(--neon) 14%, transparent);
  color: #fff;
  vertical-align: middle;
}

:root .nexgames-hub .nexgames-card-body p {
  color: #b8b8d8;
  overflow-wrap: anywhere;
  hyphens: auto;
}

/* arcade start button */
:root .nexgames-hub .nexgames-card-cta {
  font-size: 0.55rem;
  letter-spacing: 0.06em;
  border-radius: 4px;
  border: 2px solid var(--neon);
  background: transparent;
  color: var(--neon);
  padding: 0.7rem 0.9rem;
}

:root .nexgames-hub .nexgames-card-cta:hover {
  background: var(--neon);
  color: #050510;
  box-shadow: 0 0 18px color-mix(in srgb, var(--neon) 70%, transparent);
}

:root .nexgames-hub .nexgames-card-cta:hover i { animation: ar-blink 0.6s steps(1) infinite; }

@keyframes ar-blink { 50% { opacity: 0; } }

/* side banners (NexCraft / NexSpace ads) */
:root .nexgames-hub .nexgames-banner {
  border-radius: 10px;
  border: 2px dashed rgba(34, 211, 238, 0.35);
  background: rgba(11, 11, 26, 0.85);
}

:root .nexgames-hub .nexgames-banner:hover {
  border-color: var(--ar-cyan);
  box-shadow: 0 0 22px rgba(34, 211, 238, 0.3);
}

:root .nexgames-hub .nexgames-banner .banner-name { font-family: var(--ar-marquee); font-weight: 400; }
:root .nexgames-hub .nexgames-banner .banner-cta { font-family: var(--ar-pixel); font-size: 0.5rem; color: var(--ar-cyan); }

@media (prefers-reduced-motion: reduce) {
  :root .nexgames-hub .nexgames-header::before,
  :root .nexgames-hub .nexgames-header h2 span,
  :root .nexgames-hub .nexgames-card:hover .nexgames-card-thumb i,
  :root .nexgames-hub .nexgames-card-cta:hover i { animation: none; }
}

/* --- light theme: daylight arcade - white cabinets, coloured rims, no glow --- */
html[data-theme="light"] .nexgames-hub {
  --ar-panel: #ffffff;
  --ar-yellow: #b45309;
}

html[data-theme="light"] .nexgames-hub .nexgames-header::before {
  background:
    linear-gradient(90deg, rgba(219, 39, 119, 0.25) 1px, transparent 1px) 50% 0 / 48px 100%,
    linear-gradient(0deg, rgba(8, 145, 178, 0.25) 1px, transparent 1px) 0 0 / 100% 24px;
}

html[data-theme="light"] .nexgames-hub .nexgames-header h2 span {
  -webkit-text-fill-color: #db2777;
  color: #db2777;
  text-shadow: 3px 3px 0 rgba(8, 145, 178, 0.35);
}

html[data-theme="light"] .nexgames-hub .nexgames-header p,
html[data-theme="light"] .nexgames-hub .nexgames-card-body p { color: #475569; }

html[data-theme="light"] .nexgames-hub .nexgames-card {
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

html[data-theme="light"] .nexgames-hub .nexgames-card:hover {
  box-shadow: 0 14px 36px color-mix(in srgb, var(--neon) 25%, transparent);
}

html[data-theme="light"] .nexgames-hub .nexgames-card-body h3 { color: #0f172a; }

/* thumbnails: bright screens in the game's colour instead of washed-out dark gradients */
html[data-theme="light"] .nexgames-hub .nexgames-card-thumb {
  background: linear-gradient(135deg, color-mix(in srgb, var(--neon) 30%, #fff), var(--neon));
}

html[data-theme="light"] .nexgames-hub .nexgames-card-thumb::after {
  background: repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.18) 0 1px, transparent 1px 3px);
}

html[data-theme="light"] .nexgames-hub .nexgames-card-tag { color: color-mix(in srgb, var(--neon) 75%, #000); }

html[data-theme="light"] .nexgames-hub .nexgames-card-version { color: #0f172a; }

html[data-theme="light"] .nexgames-hub .nexgames-card-cta { color: color-mix(in srgb, var(--neon) 75%, #000); }

html[data-theme="light"] .nexgames-hub .nexgames-card-cta:hover { color: #fff; }

html[data-theme="light"] .nexgames-hub .nexgames-leaderboard-link { background: #fffbeb; }
html[data-theme="light"] .nexgames-hub .nexgames-leaderboard-link:hover { background: #f59e0b; color: #1a1400; }

html[data-theme="light"] .nexgames-hub .nexgames-banner { background: #ffffff; border-color: rgba(8, 145, 178, 0.4); }
html[data-theme="light"] .nexgames-hub .nexgames-banner .banner-cta { color: #0e7490; }

/* ============================================================ Arcade-Halle
   cabinets built by assets/js/arcade-hall.js: marquee, CRT mini scene, panel */
:root .nexgames-hub .arc-cabinet { overflow: hidden; }

.arc-marquee {
  position: relative;
  padding: 0.55rem 0.8rem 0.5rem;
  background: linear-gradient(180deg, color-mix(in srgb, var(--neon) 35%, #0b0b1a), #0b0b1a);
  border-bottom: 2px solid color-mix(in srgb, var(--neon) 60%, transparent);
  color: #fff;
  font: 400 0.82rem/1.1 var(--ar-marquee, "Bungee", sans-serif);
  letter-spacing: 0.02em;
  text-align: center;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 0 8px var(--neon), 0 0 18px var(--neon);
  animation: arcMarquee 3.2s ease-in-out infinite;
}
@keyframes arcMarquee { 50% { text-shadow: 0 0 4px var(--neon), 0 0 10px var(--neon); } }

/* mini scenes on the screen */
.arc-scene { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.arc-scene i, .arc-scene b { position: absolute; display: block; }

/* Star Jump: platforms + the rocket icon hops */
.arc-plat { width: 26%; height: 5px; border-radius: 3px; background: color-mix(in srgb, var(--neon) 70%, #fff); box-shadow: 0 0 8px var(--neon); }
:root .nexgames-hub .arc-game-starjump i.fas { animation: arcHop 1.4s cubic-bezier(0.3, 0, 0.4, 1) infinite; }
@keyframes arcHop { 0%, 100% { transform: translateY(14px); } 50% { transform: translateY(-16px); } }

/* Block Clicker: block gets clicked, +1 floats up */
:root .nexgames-hub .arc-game-blockclicker i.fas { animation: arcClick 1.4s steps(1) infinite; }
@keyframes arcClick { 0%, 100% { transform: scale(1); } 8% { transform: scale(0.86); } 16% { transform: scale(1); } }
.arc-plus { left: 30%; top: 55%; color: #ffff55; font: 400 0.75rem var(--ar-pixel, monospace); text-shadow: 2px 2px 0 #3f3f15; opacity: 0; animation: arcPlus 1.4s ease-out var(--d, 0s) infinite; }
@keyframes arcPlus { 10% { opacity: 1; } 100% { opacity: 0; transform: translateY(-38px); } }

/* Type Racer: letters fall */
.arc-letter { top: -18%; color: #e0f2fe; font: 400 0.8rem var(--ar-pixel, monospace); text-shadow: 0 0 6px var(--neon); animation: arcFall 2.6s linear var(--d, 0s) infinite; }
@keyframes arcFall { to { transform: translateY(170px); } }

/* NexHero: hit sparks */
.arc-spark { left: 32%; top: 58%; width: 14px; height: 14px; background: radial-gradient(circle, #fff, #fde047 40%, transparent 70%); opacity: 0; animation: arcSpark 0.9s ease-out var(--d, 0s) infinite; }
@keyframes arcSpark { 0% { opacity: 0; transform: scale(0.3); } 20% { opacity: 1; transform: scale(1.4); } 60%, 100% { opacity: 0; transform: scale(0.6); } }

/* NexStrike: crosshair sweeps */
.arc-cross { left: 20%; top: 30%; width: 22px; height: 22px; border: 2px solid #fca5a5; border-radius: 50%; animation: arcAim 3s ease-in-out infinite; }
.arc-cross::before, .arc-cross::after { content: ""; position: absolute; background: #fca5a5; }
.arc-cross::before { left: 50%; top: -6px; bottom: -6px; width: 2px; margin-left: -1px; }
.arc-cross::after { top: 50%; left: -6px; right: -6px; height: 2px; margin-top: -1px; }
@keyframes arcAim { 0%, 100% { transform: translate(0, 0); } 33% { transform: translate(120px, 20px); } 66% { transform: translate(60px, -10px); } }

/* Nexaman: creature bobs on pixel grass */
.arc-grass { left: 0; right: 0; bottom: 0; height: 14px; background: repeating-linear-gradient(90deg, #4ade80 0 6px, #22c55e 6px 12px); opacity: 0.6; }
:root .nexgames-hub .arc-game-nexaman i.fas { animation: arcBob 1.1s steps(2) infinite; }
@keyframes arcBob { 50% { transform: translateY(-6px); } }

/* NexHero shield pulse */
:root .nexgames-hub .arc-game-nexhero i.fas { animation: arcPulse 0.9s ease-out infinite; }
@keyframes arcPulse { 20% { transform: scale(1.12); } }

/* control panel */
.arc-panel {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.55rem 0.9rem;
  background: linear-gradient(180deg, #16162b, #0b0b1a);
  border-bottom: 2px solid color-mix(in srgb, var(--neon) 40%, transparent);
}
.arc-stick { position: relative; width: 18px; height: 18px; }
.arc-stick::before { content: ""; position: absolute; left: 7px; bottom: 6px; width: 4px; height: 14px; border-radius: 2px; background: #94a3b8; transform-origin: bottom center; animation: arcStick 2.4s ease-in-out infinite; }
.arc-stick::after { content: ""; position: absolute; left: 3px; bottom: 16px; width: 12px; height: 12px; border-radius: 50%; background: #ef4444; box-shadow: 0 0 6px #ef4444; animation: arcStickTop 2.4s ease-in-out infinite; }
@keyframes arcStick { 30% { transform: rotate(-22deg); } 60% { transform: rotate(18deg); } }
@keyframes arcStickTop { 30% { transform: translateX(-5px); } 60% { transform: translateX(4px); } }
.arc-btn { width: 14px; height: 14px; border-radius: 50%; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.35); }
.arc-btn-a { background: var(--neon); }
.arc-btn-b { background: #facc15; }
.arc-coin { margin-left: auto; color: #94a3b8; font: 400 0.42rem var(--ar-pixel, monospace); letter-spacing: 0.04em; white-space: nowrap; animation: arcBlink 1.2s steps(1) infinite; }
@keyframes arcBlink { 50% { opacity: 0.2; } }

@media (prefers-reduced-motion: reduce) {
  .arc-marquee, .arc-scene *, .arc-stick::before, .arc-stick::after, .arc-coin,
  :root .nexgames-hub .arc-screen i.fas { animation: none !important; }
}

html[data-theme="light"] .arc-marquee { background: linear-gradient(180deg, color-mix(in srgb, var(--neon) 30%, #fff), #fff); color: #111827; text-shadow: none; }
html[data-theme="light"] .arc-panel { background: linear-gradient(180deg, #f1f5f9, #e2e8f0); }
html[data-theme="light"] .arc-coin { color: #475569; }

/* real in-game screenshots on the cabinet screens (images/screens/NexGames/);
   the CRT scanlines (::after) stay on top, icon and mini scene are not needed */
:root .nexgames-hub .nexgames-card-thumb.has-shot {
  background-color: #020617;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}
:root .nexgames-hub .nexgames-card-thumb.has-shot > i,
:root .nexgames-hub .nexgames-card-thumb.has-shot .arc-scene { display: none; }
:root .nexgames-hub .nexgames-card-thumb.has-shot { transition: filter 0.3s ease; filter: saturate(0.9) brightness(0.92); }
:root .nexgames-hub .nexgames-card:hover .nexgames-card-thumb.has-shot { filter: none; }
