:root {
  --petrol-950: #082a2f;
  --petrol-900: #092f33;
  --petrol-800: #123d43;
  --cream: #f2e6cf;
  --cream-light: #fbf4e7;
  --copper: #b7653d;
  --brass: #c79a4b;
  --ether: #55d9d0;
  --ink: #263437;
  --muted: #6e6254;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--petrol-900);
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(rgba(8, 42, 47, 0.48), rgba(8, 42, 47, 0.48)),
    url("../assets/interface/motif-page.png") center / 600px 600px repeat,
    var(--petrol-900);
  font-family: Arial, Helvetica, sans-serif;
}

img {
  display: block;
  max-width: 100%;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.page-shell {
  min-height: 100vh;
  padding: clamp(24px, 4vw, 56px) 20px;
}

.experience-card {
  width: min(100%, 970px);
  margin: 0 auto;
  padding: clamp(24px, 3.5vw, 42px);
  border: 1px solid rgba(80, 62, 36, 0.28);
  border-radius: 30px;
  background:
    radial-gradient(circle at 50% 0, rgba(255, 255, 255, 0.6), transparent 34%),
    var(--cream);
  box-shadow:
    0 26px 70px rgba(1, 19, 22, 0.36),
    inset 0 0 0 7px rgba(255, 250, 238, 0.42);
}

.intro {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(270px, 0.8fr);
  align-items: center;
  gap: clamp(28px, 5vw, 62px);
}

.brand {
  min-width: 0;
}

.game-logo {
  width: min(100%, 590px);
  height: auto;
}

.intro-copy {
  padding-left: clamp(0px, 2vw, 20px);
  border-left: 1px solid rgba(66, 74, 66, 0.2);
}

.intro-copy > p {
  margin: 0;
  color: #433b32;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.65;
}

.game-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.game-tags span {
  padding: 8px 11px;
  border: 1px solid rgba(32, 68, 69, 0.22);
  border-radius: 999px;
  background: rgba(255, 251, 242, 0.62);
  color: var(--petrol-800);
  font-size: 11px;
  font-weight: 700;
}

.instructions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 28px;
  overflow: hidden;
  border: 1px solid rgba(75, 65, 48, 0.22);
  border-radius: 16px;
  background: rgba(255, 251, 243, 0.72);
}

.instruction {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-height: 72px;
  padding: 14px 16px;
}

.instruction + .instruction {
  border-left: 1px solid rgba(75, 65, 48, 0.18);
}

.instruction-icon {
  display: grid;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  color: var(--cream-light);
  background: var(--petrol-800);
  box-shadow: 0 3px 0 rgba(6, 32, 36, 0.16);
}

.instruction-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.instruction p {
  margin: 0;
  color: #544b41;
  font-size: 11px;
  line-height: 1.5;
}

.instruction strong {
  display: block;
  margin-bottom: 1px;
  color: var(--petrol-800);
  font-size: 12px;
}

.game-shell {
  margin-top: 22px;
}

.game-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 0 6px 10px;
}

.game-heading h2 {
  margin: 0;
  color: var(--petrol-800);
  font-size: 14px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.game-heading p {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ether);
  box-shadow: 0 0 0 3px rgba(85, 217, 208, 0.18);
}

.game-frame {
  position: relative;
  overflow: hidden;
  border: 4px solid var(--petrol-800);
  border-radius: 18px 18px 0 0;
  background: var(--petrol-950);
  box-shadow:
    0 14px 30px rgba(28, 36, 32, 0.18),
    0 0 0 3px rgba(183, 101, 61, 0.34);
}

.game-canvas-wrap {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--petrol-950);
}

#game-canvas {
  width: 100%;
  height: 100%;
  touch-action: none;
}

#game-canvas canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

.game-loading {
  position: absolute;
  inset: 0;
  display: grid;
  margin: 0;
  padding: 30px;
  place-items: center;
  color: var(--cream-light);
  background: var(--petrol-950);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-align: center;
}

.game-loading[hidden] {
  display: none;
}

.game-error {
  color: #fff1dc;
}

.mission {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 106px;
  padding: 18px 24px;
  border: 3px solid var(--petrol-800);
  border-top: 0;
  border-radius: 0 0 16px 16px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.32), transparent),
    var(--cream-light);
}

.mission-symbol {
  display: grid;
  flex: 0 0 auto;
  width: 58px;
  height: 58px;
  place-items: center;
  border: 2px solid rgba(183, 101, 61, 0.42);
  border-radius: 50%;
  background:
    repeating-conic-gradient(
      from 0deg,
      rgba(183, 101, 61, 0.22) 0 7deg,
      transparent 7deg 22deg
    ),
    rgba(183, 101, 61, 0.07);
}

.mission-symbol-core {
  width: 24px;
  height: 24px;
  border: 4px solid var(--petrol-800);
  border-radius: 50%;
  background: var(--ether);
  box-shadow:
    0 0 0 4px rgba(199, 154, 75, 0.62),
    0 0 15px rgba(85, 217, 208, 0.58);
}

.mission h3 {
  margin: 0 0 6px;
  color: var(--petrol-800);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 20px;
}

.mission p {
  margin: 0;
  color: #62574b;
  font-size: 13px;
  line-height: 1.5;
}

.footer-links {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 20px;
  width: 100%;
  margin-bottom: 20px;
}

.footer-links a {
  color: white;
  text-decoration: none;
  text-decoration: underline;
  font-size: 11px;
  opacity: 0.6;
}

@media (max-width: 780px) {
  .page-shell {
    padding: 18px 12px;
  }

  .experience-card {
    padding: 24px 18px;
    border-radius: 22px;
  }

  .intro {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .game-logo {
    width: min(100%, 600px);
    margin: 0 auto;
  }

  .intro-copy {
    padding: 18px 0 0;
    border-top: 1px solid rgba(66, 74, 66, 0.2);
    border-left: 0;
    text-align: center;
  }

  .game-tags {
    justify-content: center;
  }

  .instructions {
    grid-template-columns: 1fr;
  }

  .instruction + .instruction {
    border-top: 1px solid rgba(75, 65, 48, 0.18);
    border-left: 0;
  }
}

@media (max-width: 520px) {
  .page-shell {
    padding-inline: 8px;
  }

  .experience-card {
    padding: 20px 12px;
    border-radius: 18px;
  }

  .intro-copy > p {
    font-size: 14px;
  }

  .game-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .game-frame {
    border-width: 3px;
    border-radius: 12px 12px 0 0;
  }

  .mission {
    align-items: flex-start;
    gap: 12px;
    min-height: 0;
    padding: 16px;
    border-width: 2px;
  }

  .mission-symbol {
    width: 50px;
    height: 50px;
  }

  .mission h3 {
    font-size: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
  }
}
