:root {
  color-scheme: light;
  font-family: "Trebuchet MS", "Avenir Next", "Gill Sans", sans-serif;
  --text: #fff6e1;
  --ink: #351b34;
  --ink-soft: rgba(53, 27, 52, 0.74);
}

* {
  box-sizing: border-box;
}

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

body {
  color: var(--text);
  background:
    radial-gradient(circle at 18% 18%, rgba(255, 241, 180, 0.22), transparent 18%),
    radial-gradient(circle at 82% 12%, rgba(147, 246, 213, 0.14), transparent 18%),
    linear-gradient(180deg, #1f0a2e 0%, #542044 45%, #d46e59 100%);
}

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

.topbar {
  width: min(1180px, 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, 247, 236, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.76);
  backdrop-filter: blur(12px);
  box-shadow: 0 12px 30px rgba(42, 12, 33, 0.16);
}

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

.topbar-note {
  margin: 0;
  color: var(--ink-soft);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.72rem;
}

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

.game-shell {
  position: relative;
  width: min(calc(100vw - 40px), calc((100vh - 140px) * 1.6), 1120px);
  aspect-ratio: 16 / 10;
  max-height: calc(100vh - 140px);
  display: grid;
  place-items: center;
  border-radius: 34px;
  overflow: hidden;
  background:
    radial-gradient(circle at top, rgba(255, 226, 120, 0.18), transparent 30%),
    linear-gradient(180deg, #17071f, #5d203f 55%, #cf624e 100%);
  box-shadow:
    0 30px 80px rgba(37, 0, 26, 0.42),
    0 0 0 1px rgba(255, 255, 255, 0.14);
}

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

#game {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
}

.start-btn {
  position: absolute;
  z-index: 2;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  border: 0;
  border-radius: 999px;
  padding: 16px 28px;
  font: inherit;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: #3a1634;
  background:
    linear-gradient(135deg, #fff8d2 0%, #ffb4d8 45%, #9ef7ff 100%);
  box-shadow:
    0 12px 30px rgba(34, 0, 28, 0.38),
    0 0 24px rgba(255, 242, 126, 0.52);
  cursor: pointer;
  transition:
    transform 120ms ease,
    box-shadow 120ms ease,
    opacity 160ms ease;
}

.start-btn:hover,
.start-btn:focus-visible {
  transform: translateX(-50%) translateY(-2px) scale(1.02);
  box-shadow:
    0 16px 34px rgba(34, 0, 28, 0.46),
    0 0 30px rgba(255, 242, 126, 0.65);
  outline: none;
}

.start-btn.hidden {
  opacity: 0;
  pointer-events: none;
}

.game-shell:fullscreen #game {
  width: auto;
  height: 96vh;
  max-width: 96vw;
}

@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 - 176px) * 1.6));
    max-height: calc(100vh - 176px);
    border-radius: 28px;
  }

  .start-btn {
    bottom: 20px;
    padding: 14px 22px;
    font-size: 0.98rem;
  }
}
