/* AiRCADE — Erasmus Edition
   Colors sampled directly from the client's "AI Games Cafe {HHH}" Figma brand board: navy /
   cyan / mint / blush pink, flat color blocks, hard black borders and hard offset shadows
   (no blur/glow). Typography kept as the original arcade's VT323 + Press Start 2P pairing. */

:root {
  --navy: #003cd3;
  --navy-deep: #001c8c;
  --navy-screen: #000f5c;
  --cyan: #00d7ff;
  --mint: #00ff9f;
  --pink: #fccde2;
  --pink-pale: #fff3f3;
  --ink: #000000;
  --paper: #ffffff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 21px;
  min-height: 100vh;
  background-color: #111111;
  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: var(--navy);
  border: 6px solid var(--ink);
  border-radius: 32px;
}

.inner-ring {
  position: absolute;
  top: 27px;
  left: 27px;
  right: 27px;
  bottom: 27px;
  border-radius: 24px;
  border: 5px solid var(--mint);
  pointer-events: none;
  z-index: 3;
}

.content {
  position: relative;
  width: 100%;
  height: calc(100vh - 84px);
  overflow: hidden;
  border-radius: 1rem;
  background: var(--navy-screen);
}

/* Pixel-mosaic corner accent, echoing the standee's navy/mint mosaic pattern */
.pixel-mosaic {
  position: absolute;
  right: 0;
  bottom: 0;
  width: min(38%, 420px);
  height: min(38%, 420px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.5;
  background-image:
    repeating-conic-gradient(var(--mint) 0% 25%, transparent 0% 50%);
  background-size: 28px 28px;
  -webkit-mask-image: radial-gradient(120% 120% at 100% 100%, #000 30%, transparent 75%);
  mask-image: radial-gradient(120% 120% at 100% 100%, #000 30%, transparent 75%);
}

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: 4.5rem;
  line-height: 1;
  color: var(--mint);
  text-shadow: 3px 3px 0 var(--ink), -3px 3px 0 var(--ink), -3px -3px 0 var(--ink), 3px -3px 0 var(--ink);
}

#tagline {
  margin: 0.35rem 0 0 2.1rem;
  font-family: "VT323", monospace;
  font-size: 1.1rem;
  color: var(--pink);
}

#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;
}

/* ----- Flat "sticker" arcade button ----- */
a.game {
  position: relative;
  display: block;
  text-align: center;
  text-decoration: none;
  border: 4px solid var(--ink);
  border-radius: 1rem;
  background: var(--pink-pale);
  box-shadow: 6px 6px 0 var(--ink);
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}

a.game h2 {
  margin: 0;
  padding: 1.3rem 1.5rem;
  font-family: "Press Start 2P", "VT323", monospace;
  font-size: 0.95rem;
  line-height: 1.35;
  color: var(--navy);
}

a.game:hover {
  background: var(--cyan);
}

a.game:active {
  transform: translate(3px, 3px);
  box-shadow: 3px 3px 0 var(--ink);
}

a.game.active {
  background: var(--mint);
  transform: translate(3px, 3px);
  box-shadow: 3px 3px 0 var(--ink);
}

/* Small cursor-badge, echoing the brand's pointer/cursor doodle iconography */
a.game.active::after {
  content: "";
  position: absolute;
  top: -11px;
  right: -11px;
  width: 22px;
  height: 22px;
  background: var(--ink);
  clip-path: polygon(0 0, 100% 38%, 54% 54%, 38% 100%);
}

/* ----- 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.05rem;
  color: var(--pink);
  text-decoration: underline;
}

.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: 1.5rem;
  color: var(--navy);
  background: var(--pink);
  border: 2px solid var(--ink);
  border-radius: 0.5rem;
  box-shadow: 2px 2px 0 var(--ink);
  user-select: none;
}

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

/* ----- 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(--ink);
  box-shadow: 8px 8px 0 var(--ink);
}

/* Real screenshot fills the box; falls back to a flat accent-colour card with the title
   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: var(--navy);
  font-family: "Press Start 2P", monospace;
  font-size: 1.15rem;
  line-height: 1.6;
  background: var(--accent, var(--cyan));
}

.preview-box {
  padding: 1rem 1.15rem;
  border: 3px solid var(--ink);
  border-radius: 1rem;
  font-family: "VT323", monospace;
  font-size: 1.1rem;
  line-height: 1.4;
  color: var(--navy);
  background: var(--paper);
  box-shadow: 4px 4px 0 var(--accent, var(--mint));
}

#credits a {
  color: var(--navy);
  text-decoration: underline;
}

.preview-box.warning {
  color: var(--navy);
  background: var(--pink);
  border-color: var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
  font-size: 0.95rem;
}

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

.overlay.hidden {
  display: none;
}

.overlay-content {
  position: relative;
  width: 95%;
  height: 95%;
  background: #fff;
  border-radius: 1rem;
  overflow: hidden;
  border: 5px solid var(--ink);
}

.overlay.disclaimer-mode .overlay-content,
.overlay.more-mode .overlay-content {
  background: var(--pink);
}

#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: var(--ink);
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 0.4rem;
  box-shadow: 3px 3px 0 var(--ink);
  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(--navy);
  text-align: center;
}

#disclaimer-text h2,
#more-games-overlay-text h2 {
  margin: 0;
  font-family: "VT323", monospace;
  font-size: 2.75rem;
  color: var(--navy);
}

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

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

#disclaimer-text .credit-line {
  margin-top: 0.5rem;
  font-size: 0.95rem;
  color: var(--navy);
  opacity: 0.8;
}

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

.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.25rem;
}

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

.more-games-list a {
  font-family: "VT323", monospace;
  font-size: 1.3rem;
  color: var(--navy);
  text-decoration: none;
  cursor: url("../img/cursor.png") 0 0, auto;
}

.more-games-list a:hover {
  color: var(--paper);
  text-decoration: underline;
}

.more-games-desc {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.4;
  color: var(--navy);
  opacity: 0.85;
}

.more-games-tag {
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--navy-deep);
  opacity: 0.75;
}

.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.25rem;
  }
}
