@font-face {
  font-family: "Press Start 2P";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/press-start-2p.woff2") format("woff2");
}

:root {
  --bg: #0b0b14;
  --panel: #14142a;
  --gold: #f5a623;
  --red: #ff4b32;
  --blue: #4aa3ff;
  --text: #fff;
  --muted: #b8b8c8;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Press Start 2P", monospace;
  -webkit-font-smoothing: none;
}

/* ---------- Landing ---------- */

.landing {
  text-align: center;
  background: radial-gradient(circle at 50% 20%, #51317e 0%, #241b49 45%, #0b0b14 100%);
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 28px;
  min-height: 100dvh;
  padding: 32px 16px;
  display: flex;
}

.landing__logo {
  filter: drop-shadow(6px 6px #00000073);
  width: min(560px, 90vw);
  height: auto;
}

.landing__title {
  color: #fff2c2;
  text-shadow: 5px 5px #1a0f1a;
  margin: 0;
  font-size: clamp(28px, 7vw, 64px);
  line-height: 1.15;
}

.landing__tagline {
  text-shadow: 3px 3px #1a0f1a;
  max-width: 640px;
  font-size: clamp(10px, 2.4vw, 16px);
  line-height: 1.8;
  margin: 0;
}

.adventures {
  grid-template-columns: repeat(2, minmax(260px, 390px));
  gap: 22px;
  width: min(820px, 94vw);
  display: grid;
}

.adventure {
  border: 5px solid #1a0f1a;
  border-radius: 12px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 14px;
  min-height: 220px;
  padding: 22px;
  text-decoration: none;
  display: flex;
  box-shadow: 7px 7px #1a0f1a;
}

.adventure--available {
  background: #f5a623f5;
}

.adventure--available:hover,
.adventure--available:focus-visible {
  transform: translate(2px, 2px);
}

.adventure--available img {
  width: min(300px, 80%);
  height: auto;
}

.adventure--locked {
  color: #d8d8dc;
  cursor: not-allowed;
  background: #6b6b72;
}

.adventure--cholo {
  color: #fff;
  /* The disabled "Cholo Factos" card is a placeholder. Its background is a
     pure CSS gradient so the page never references a missing image file. */
  background: linear-gradient(#0c07107a, #0c0710e6),
    linear-gradient(165deg, #24305e 0%, #4a2b5e 42%, #8a3f2b 78%, #d5803a 100%);
}

.adventure--cholo:hover,
.adventure--cholo:focus-visible {
  transform: translate(2px, 2px);
}

.adventure--disabled {
  cursor: not-allowed;
  filter: grayscale(0.7);
  opacity: 0.6;
}

.adventure--disabled:hover,
.adventure--disabled:focus-visible {
  transform: none;
}

.adventure--cholo .adventure__action {
  color: #ffd23f;
}

.adventure__placeholder {
  color: #bcbcc4;
  text-shadow: 4px 4px #3d3d45;
  font-size: clamp(26px, 5vw, 44px);
  line-height: 1;
}

.adventure__name {
  text-align: center;
  font-size: clamp(11px, 1.8vw, 16px);
}

.adventure__action {
  color: #1a0f1a;
  font-size: 12px;
}

.adventure--locked .adventure__action {
  color: #dedee4;
}

.landing__cta {
  color: #1a0f1a;
  background: var(--gold);
  border: 4px solid #1a0f1a;
  border-radius: 8px;
  padding: 20px 36px;
  font-size: clamp(14px, 3vw, 22px);
  text-decoration: none;
  transition: transform 80ms, box-shadow 80ms;
  display: inline-block;
  box-shadow: 6px 6px #1a0f1a;
}

.landing__cta:hover,
.landing__cta:focus-visible {
  outline: none;
  transform: translate(2px, 2px);
  box-shadow: 4px 4px #1a0f1a;
}

.landing__cast {
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-end;
  gap: 24px;
  display: flex;
}

.landing__credits {
  border: 3px solid var(--gold);
  background: #0b0b14bf;
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 11px;
  line-height: 1.8;
}

.landing__credits a {
  color: var(--gold);
}

.landing__author {
  color: #1a0f1a;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  display: flex;
}

.landing__author img {
  filter: drop-shadow(3px 3px #00000059);
  width: 113px;
  height: auto;
}

.landing__footer {
  color: #b8b8c8;
  opacity: 0.8;
  font-size: 10px;
  line-height: 2;
  margin: 0;
}

@media (max-width: 650px) {
  .adventures {
    grid-template-columns: 1fr;
  }
}

/* ---------- Play ---------- */

.play {
  background: var(--bg);
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
  position: fixed;
  inset: 0;
  overflow: hidden;
}

.game-canvas {
  inset: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom)
    env(safe-area-inset-left);
  position: absolute;
}

.game-canvas canvas {
  image-rendering: pixelated;
  display: block;
}

.rotate-hint {
  display: none;
}

@media (orientation: portrait) and (max-width: 820px) {
  .rotate-hint {
    left: 16px;
    right: 16px;
    bottom: calc(24px + env(safe-area-inset-bottom));
    background: var(--panel);
    border: 3px solid var(--gold);
    z-index: 10;
    border-radius: 8px;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    font-size: 10px;
    line-height: 1.7;
    display: flex;
    position: absolute;
  }

  .rotate-hint button {
    font: inherit;
    color: #1a0f1a;
    background: var(--gold);
    border: 0;
    border-radius: 4px;
    padding: 8px 10px;
  }

  .rotate-hint.is-dismissed {
    display: none;
  }
}
