:root {
  color-scheme: light;
  font-family: "Trebuchet MS", "Avenir Next", sans-serif;
  --text: #1e1d43;
  --text-soft: rgba(30, 29, 67, 0.72);
  --panel: rgba(255, 253, 248, 0.92);
  --panel-line: rgba(255, 255, 255, 0.72);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background:
    radial-gradient(circle at 18% 12%, rgba(255, 188, 122, 0.5), transparent 22%),
    radial-gradient(circle at 82% 20%, rgba(134, 230, 255, 0.34), transparent 22%),
    radial-gradient(circle at 50% 84%, rgba(255, 111, 175, 0.22), transparent 26%),
    linear-gradient(180deg, #fff7ef 0%, #fff4dd 34%, #e7f6ff 100%);
  color: var(--text);
}

.game-page {
  min-height: 100vh;
  padding: 18px 18px 24px;
}

.topbar {
  width: min(1320px, calc(100vw - 36px));
  margin: 0 auto 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.back-link,
.topbar-note {
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.76);
  backdrop-filter: blur(12px);
  box-shadow: 0 12px 30px rgba(42, 52, 102, 0.14);
}

.back-link {
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
}

.topbar-note {
  margin: 0;
  color: rgba(30, 29, 67, 0.64);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.72rem;
}

.page-shell {
  min-height: calc(100vh - 86px);
  display: grid;
  place-items: center;
  padding: 8px 0;
}

.game-shell {
  position: relative;
  width: min(calc(100vw - 40px), calc((100vh - 140px) * 1.5609), 1280px);
  aspect-ratio: 1280 / 820;
  max-height: calc(100vh - 140px);
  border-radius: 34px;
  overflow: hidden;
  background: #fffdfa;
  box-shadow:
    0 34px 96px rgba(57, 57, 89, 0.2),
    inset 0 0 0 2px rgba(255, 255, 255, 0.75);
}

.game-shell:fullscreen {
  width: 100vw;
  height: 100vh;
  max-width: none;
  max-height: none;
  border-radius: 0;
}

#game {
  display: block;
  width: 100%;
  height: 100%;
}

.overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(24, 30, 54, 0.2);
  backdrop-filter: blur(8px);
}

.hidden {
  display: none;
}

.panel {
  width: min(840px, 100%);
  padding: 30px;
  border-radius: 28px;
  border: 2px solid var(--panel-line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 247, 234, 0.92)),
    var(--panel);
  box-shadow:
    0 24px 64px rgba(30, 29, 67, 0.18),
    inset 0 0 48px rgba(255, 212, 151, 0.16);
}

.intro-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(280px, 0.95fr);
  gap: 26px;
  align-items: center;
}

.small-panel {
  width: min(460px, 100%);
  text-align: center;
}

.eyebrow {
  margin: 0 0 8px;
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #a65a80;
}

h1,
h2 {
  margin: 0;
  font-family: "Palatino Linotype", "Book Antiqua", serif;
  line-height: 1.02;
}

h1 {
  font-size: clamp(2.8rem, 5vw, 4.6rem);
}

h2 {
  font-size: clamp(1.8rem, 4vw, 2.7rem);
}

.lede {
  margin: 14px 0 0;
  font-size: 1.03rem;
  line-height: 1.68;
  color: var(--text-soft);
}

.controls-grid {
  display: grid;
  grid-template-columns: auto auto;
  gap: 8px 16px;
  margin: 22px 0 26px;
  align-items: baseline;
}

.controls-grid span {
  color: var(--text-soft);
}

.controls-grid strong {
  color: var(--text);
}

.sketch-card {
  margin: 0;
  padding: 14px;
  border-radius: 24px;
  background:
    radial-gradient(circle at 10% 8%, rgba(255, 255, 255, 0.88), transparent 26%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(248, 245, 239, 0.94));
  box-shadow:
    0 24px 48px rgba(44, 42, 73, 0.14),
    inset 0 0 0 1px rgba(30, 29, 67, 0.08);
}

.sketch-card img {
  display: block;
  width: 100%;
  border-radius: 18px;
  object-fit: contain;
  background: white;
  box-shadow: 0 18px 30px rgba(44, 42, 73, 0.12);
}

.sketch-card figcaption {
  margin-top: 12px;
  text-align: center;
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(30, 29, 67, 0.56);
}

button {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 14px 26px;
  font: inherit;
  font-weight: 700;
  color: white;
  background: linear-gradient(135deg, #ff7b87, #ffb14a 56%, #3cc7ff);
  box-shadow:
    0 14px 28px rgba(255, 145, 88, 0.26),
    inset 0 0 16px rgba(255, 255, 255, 0.3);
  cursor: pointer;
}

button:hover {
  filter: brightness(1.04);
}

button:active {
  transform: translateY(1px);
}

@media (max-width: 960px) {
  .intro-panel {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .game-page {
    padding: 12px 12px 16px;
  }

  .topbar {
    margin-bottom: 10px;
    flex-direction: column;
    align-items: stretch;
  }

  .page-shell {
    min-height: auto;
  }

  .game-shell {
    width: min(calc(100vw - 24px), calc((100vh - 188px) * 1.5609));
    max-height: calc(100vh - 188px);
  }

  .overlay {
    padding: 14px;
  }

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

  .controls-grid {
    gap: 7px 12px;
  }
}
