:root {
  --bg: #0d0d1a;
  --pink: #ff66cc;
  --pink-border: #ff33aa;
  --green: #68ff9e;
  --cream: #f0c8c8;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 21px;
  min-height: 100vh;
  background-color: var(--bg);
  font-family: "VT323", monospace;
  cursor: url("../img/cursor.png") 0 0, auto;
}

/* ----- Arcade cabinet frame ----- */
.glow-box {
  position: relative;
  width: 100%;
  min-height: calc(100vh - 42px);
  padding: 21px;
  background: linear-gradient(45deg, #ed1b51, #bf6bab);
  border-radius: 32px;
}

/* Rainbow inner bezel */
.inner-ring {
  position: absolute;
  top: 29px;
  left: 29px;
  right: 29px;
  bottom: 29px;
  border-radius: 24px;
  padding: 3px;
  background: linear-gradient(-121deg, #f7ec2f, #4c9dd6, #ea892e, #48af48);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  z-index: 3;
}

.content {
  position: relative;
  width: 100%;
  height: calc(100vh - 84px);
  overflow: hidden;
  border-radius: 1rem;
  background: radial-gradient(120% 90% at 50% 0%, #3a0d5c 0%, #1a0330 55%, #0d0d1a 100%);
}

/* Synthwave perspective grid on the floor */
.grid-floor {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 60%;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(rgba(255, 51, 170, 0.5) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 51, 170, 0.5) 1px, transparent 1px);
  background-size: 48px 48px;
  transform: perspective(340px) rotateX(62deg);
  transform-origin: bottom center;
  -webkit-mask-image: linear-gradient(to top, #000 0%, transparent 85%);
  mask-image: linear-gradient(to top, #000 0%, transparent 85%);
  opacity: 0.55;
}

main {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  height: 100%;
}

/* ----- Left column ----- */
#left {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

#logo {
  margin: 0;
  padding: 2rem 0 0 2rem;
  font-family: "VT323", monospace;
  font-size: 5rem;
  line-height: 1;
  color: var(--green);
  text-shadow: 3px 3px 0 #000, -3px 3px 0 #000, -3px -3px 0 #000, 3px -3px 0 #000;
}

#games {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  flex: 1;
  min-height: 0;
  padding: 2.2rem 2rem;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 12%, #000 88%, transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0%, #000 12%, #000 88%, transparent 100%);
}

#games::-webkit-scrollbar {
  display: none;
}

/* ----- Neon arcade button ----- */
a.game {
  display: block;
  text-align: center;
  text-decoration: none;
  border: 4px solid var(--pink-border);
  border-radius: 1rem;
  background: linear-gradient(to bottom, #6e1d93, #290142);
  box-shadow: inset 0 0 0 4px #000, 0 8px 0 #c02774, 0 12px 0 #000;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  cursor: url("../img/cursor.png") 0 0, auto;
}

a.game h2 {
  margin: 0;
  padding: 1.4rem 1.5rem;
  font-family: "Press Start 2P", "VT323", monospace;
  font-size: 0.95rem;
  line-height: 1.4;
  color: var(--pink);
  text-shadow: 2px 2px 0 #000;
}

a.game:hover {
  background: linear-gradient(to bottom, #7a24b2, #350152);
  box-shadow: inset 0 0 0 4px #000, 0 10px 0 #d6368c, 0 14px 0 #000;
}

a.game:active {
  transform: translateY(6px);
  box-shadow: inset 0 0 0 4px #000, 0 2px 0 #c02774, 0 4px 0 #000;
}

@keyframes pulse {
  0%, 100% {
    box-shadow: inset 0 0 0 4px #000, 0 8px 0 #c02774, 0 12px 0 #000, 0 0 14px 2px var(--green);
  }
  50% {
    box-shadow: inset 0 0 0 4px #000, 0 8px 0 #c02774, 0 12px 0 #000, 0 0 22px 5px var(--cream);
  }
}

a.game.active {
  border-color: var(--pink);
  background: linear-gradient(to bottom, #8a2ec4, #3d0160);
  animation: pulse 1.4s infinite;
}

a.game.active h2 {
  color: #ffd6f2;
}

/* ----- Keyboard legend ----- */
.key-block-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.disclaimer-link {
  all: unset;
  position: absolute;
  left: 2rem;
  cursor: url("../img/cursor.png") 0 0, auto;
  font-family: "VT323", monospace;
  font-size: 1.3rem;
  color: var(--cream);
  text-decoration: underline;
  text-shadow: 1px 1px #000;
}

.key-block {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.key {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 1rem;
  height: 1.5rem;
  padding: 0.5rem;
  font-family: "VT323", monospace;
  font-size: 2rem;
  color: var(--bg);
  background: var(--cream);
  border: 2px solid #000;
  border-radius: 0.5rem;
  text-shadow: 1px 1px #000;
  user-select: none;
}

.key-block p {
  margin: 0;
  font-family: "VT323", monospace;
  font-size: 1.1rem;
  color: var(--cream);
}

/* ----- Right column: preview ----- */
#right {
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  padding: 2rem 2rem 2rem 0;
}

#preview {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

#preview-media {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 1rem;
  overflow: hidden;
  border: 4px solid var(--accent, var(--green));
  box-shadow: 0 0 22px -4px var(--accent, var(--green));
}

/* Real screenshot fills the box; falls back to the generated neon art card when a game
   has no usable capture (see the `image` field in games.js/more_games.js). */
#preview-art {
  position: absolute;
  inset: 0;
}

#preview-art img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#preview-art.preview-art-flat {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  text-align: center;
  color: #fff;
  font-family: "Press Start 2P", monospace;
  font-size: 1.3rem;
  line-height: 1.6;
  text-shadow: 0 2px 0 #000, 0 0 18px var(--accent, #fff);
  background:
    radial-gradient(80% 120% at 50% 0%, color-mix(in srgb, var(--accent, #68ff9e) 55%, transparent), transparent 70%),
    repeating-linear-gradient(45deg, rgba(0, 0, 0, 0.25) 0 14px, rgba(0, 0, 0, 0.12) 14px 28px),
    linear-gradient(160deg, #1a0330, #05050c);
  transition: --accent 0.4s ease;
}

#preview-art.preview-art-flat::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(0deg, transparent 0 3px, rgba(0, 0, 0, 0.28) 3px 4px);
  pointer-events: none;
}

.preview-box {
  padding: 1rem 1.15rem;
  border: 4px solid transparent;
  border-radius: 1rem;
  font-family: "VT323", monospace;
  font-size: 1.5rem;
  line-height: 1.25;
  color: #fff;
  background:
    linear-gradient(rgba(13, 13, 26, 0.92), rgba(13, 13, 26, 0.92)) padding-box,
    linear-gradient(180deg, var(--accent, #68ff9e), color-mix(in srgb, var(--accent, #68ff9e) 30%, #000)) border-box;
}

#credits a {
  color: #51a6dc;
  text-decoration: underline;
}

.preview-box.warning {
  color: #ffd7d7;
  background: rgba(120, 20, 20, 0.5);
  border-color: #ff6b6b;
  font-size: 1.15rem;
}

/* ----- Fullscreen overlay ----- */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 98;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 8, 18, 0.95);
}

.overlay.hidden {
  display: none;
}

.overlay-content {
  position: relative;
  width: 95%;
  height: 95%;
  background: #fff;
  border-radius: 1rem;
  overflow: hidden;
}

.overlay.disclaimer-mode .overlay-content,
.overlay.more-mode .overlay-content {
  background: repeating-linear-gradient(45deg, #290142, #290142 10px, #1a002f 10px, #1a002f 20px);
  box-shadow: inset 0 0 0 2px #000, inset 0 0 0 4px var(--pink), inset 0 0 0 6px #000;
}

#game-iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.overlay.disclaimer-mode #game-iframe,
.overlay.more-mode #game-iframe {
  display: none;
}

#close-overlay {
  position: absolute;
  top: 12px;
  right: 14px;
  z-index: 1000;
  width: 2.4rem;
  height: 2.4rem;
  font-size: 1.4rem;
  line-height: 1;
  color: #000;
  background: #fff;
  border: none;
  border-radius: 0.4rem;
  cursor: url("../img/cursor.png") 0 0, auto;
}

#disclaimer-text,
#more-games-overlay-text {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  padding: 3rem;
  overflow-y: auto;
  font-family: "VT323", monospace;
  color: var(--cream);
  text-align: center;
  text-shadow: 1px 1px 0 #000;
}

#disclaimer-text h2,
#more-games-overlay-text h2 {
  margin: 0;
  font-size: 3rem;
  color: var(--pink);
  text-shadow: 1px 1px 0 #000, 0 0 6px var(--pink);
}

#disclaimer-text p,
#more-games-overlay-text p {
  max-width: 46ch;
  margin: 0;
  font-size: 1.6rem;
  line-height: 1.5;
}

#disclaimer-text a {
  color: var(--pink);
  text-decoration: underline;
}

#disclaimer-text .credit-line {
  margin-top: 0.5rem;
  font-size: 1.2rem;
  color: var(--green);
  opacity: 0.9;
}

#disclaimer-text .credit-line a {
  color: var(--green);
}

.more-games-list {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 0;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  max-width: 56ch;
}

.more-games-list li {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
}

.more-games-thumb {
  width: min(280px, 70vw);
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
  border: 3px solid var(--pink);
  border-radius: 0.75rem;
  box-shadow: 0 0 14px -2px var(--green);
}

.more-games-list a {
  font-size: 1.9rem;
  color: var(--green);
  text-decoration: none;
  text-shadow: 0 0 8px rgba(104, 255, 158, 0.6);
}

.more-games-list a:hover {
  color: #fff;
  text-decoration: underline;
}

.more-games-desc {
  margin: 0;
  font-size: 1.1rem;
  color: var(--cream);
  opacity: 0.85;
}

.more-games-desc a {
  font-size: 1.1rem;
  color: var(--cream);
  text-decoration: underline;
  text-shadow: none;
}

/* CRT scanline sheen over everything */
.pixel-overlay {
  position: fixed;
  inset: 0;
  z-index: 99;
  pointer-events: none;
  background:
    linear-gradient(rgba(0, 0, 0, 0.08) 50%, transparent 50%),
    repeating-linear-gradient(90deg, transparent 0 1px, rgba(255, 255, 255, 0.02) 1px 2px);
  background-size: 100% 3px, 3px 100%;
}

.hidden {
  display: none !important;
}

/* Kiosk mode: system cursor hides after a moment of stillness (see app.js). Never touches
   an embedded game's iframe — that's a separate document with its own cursor. */
body.hide-cursor,
body.hide-cursor * {
  cursor: none !important;
}

/* ----- Responsive ----- */
@media (max-width: 860px) {
  .content {
    height: auto;
    min-height: calc(100vh - 84px);
  }
  main {
    grid-template-columns: 1fr;
    height: auto;
  }
  #right {
    padding: 0 2rem 2rem;
  }
  #games {
    flex: none;
    max-height: 42vh;
  }
  #logo {
    font-size: 3.5rem;
  }
}
