:root {
  --safe-top: env(safe-area-inset-top);
  --safe-right: env(safe-area-inset-right);
  --safe-bottom: env(safe-area-inset-bottom);
  --safe-left: env(safe-area-inset-left);
  --page-bg: #edf5ff;
  --panel-bg: #ffffff;
  --panel-soft: #f6f9ff;
  --ink: #17233c;
  --muted: #536276;
  --line: rgba(46, 80, 125, 0.16);
  --blue: #3269d8;
  --blue-dark: #214ba0;
  --yellow: #ffd25d;
  --shadow: 0 22px 60px rgba(39, 74, 129, 0.24);
  --game-ratio: 750 / 1334;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--page-bg);
  scroll-behavior: smooth;
  -ms-touch-action: manipulation;
  touch-action: manipulation;
}

body {
  min-width: 320px;
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 17% 8%, rgba(255, 255, 255, 0.82) 0 12%, transparent 23%),
    radial-gradient(circle at 84% 1%, rgba(255, 255, 255, 0.7) 0 7%, transparent 15%),
    linear-gradient(180deg, #c6ddfb 0%, #eef6ff 54%, #ffffff 100%);
  cursor: default;
  text-align: left;
}

body,
canvas,
div {
  display: block;
  outline: none;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}

body,
button,
input,
textarea,
select {
  font: inherit;
}

canvas {
  background-color: rgba(0, 0, 0, 0);
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

p,
h1,
h2,
h3 {
  margin-top: 0;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 50;
  transform: translateY(-140%);
  padding: 10px 14px;
  border-radius: 6px;
  background: #ffffff;
  color: var(--blue-dark);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 64px;
  padding: calc(12px + var(--safe-top)) max(20px, var(--safe-right)) 12px max(20px, var(--safe-left));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: rgba(238, 246, 255, 0.78);
  border-bottom: 1px solid rgba(255, 255, 255, 0.72);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  font-weight: 800;
  font-size: 20px;
  letter-spacing: 0;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: block;
  flex: 0 0 auto;
  border-radius: 10px;
  box-shadow: 0 6px 14px rgba(28, 67, 117, 0.18);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #40536d;
  font-size: 14px;
  font-weight: 700;
}

.site-nav a {
  padding: 9px 11px;
  border-radius: 6px;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  background: rgba(50, 105, 216, 0.11);
  color: var(--blue-dark);
}

.play-hero {
  min-height: calc(100dvh - 64px);
  display: grid;
  grid-template-columns: minmax(300px, min(46vw, 540px)) minmax(320px, 560px);
  justify-content: center;
  align-items: center;
  gap: clamp(28px, 6vw, 76px);
  padding: clamp(18px, 3vw, 38px) max(22px, var(--safe-right)) clamp(34px, 5vw, 70px) max(22px, var(--safe-left));
}

.game-column {
  display: grid;
  place-items: center;
  width: 100%;
}

.game-shell {
  width: min(100%, calc((100dvh - 126px) * 750 / 1334));
  max-width: 540px;
  min-width: 300px;
  aspect-ratio: var(--game-ratio);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.84);
  border-radius: 18px;
  background: #bed8fa;
  box-shadow: var(--shadow);
  contain: layout size paint;
}

.game-frame {
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
  background: #bed8fa;
}

.play-copy {
  max-width: 560px;
}

.eyebrow {
  margin-bottom: 12px;
  color: var(--blue-dark);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin-bottom: 18px;
  font-size: clamp(42px, 6vw, 76px);
  line-height: 0.98;
  letter-spacing: 0;
}

.lead {
  max-width: 50ch;
  margin-bottom: 24px;
  color: #33435a;
  font-size: clamp(17px, 2vw, 21px);
  line-height: 1.58;
}

.quick-facts {
  display: grid;
  gap: 10px;
  max-width: 520px;
}

.quick-facts div {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.64);
}

.quick-facts strong {
  color: var(--ink);
  font-size: 15px;
}

.quick-facts span {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.content-band {
  padding: clamp(44px, 7vw, 92px) max(22px, var(--safe-right)) clamp(46px, 7vw, 96px) max(22px, var(--safe-left));
  background: #ffffff;
}

.content-band-soft {
  background: var(--panel-soft);
}

.content-wrap {
  width: min(1100px, 100%);
  margin: 0 auto;
}

.section-heading {
  max-width: 610px;
  margin-bottom: 24px;
}

.section-heading h2 {
  margin-bottom: 0;
  color: var(--ink);
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1.08;
  letter-spacing: 0;
}

.rule-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.rule-grid article {
  min-height: 220px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.step {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  margin-bottom: 20px;
  border-radius: 8px;
  background: #ffe28c;
  color: #4f3710;
  font-weight: 900;
}

.rule-grid h3 {
  margin-bottom: 10px;
  font-size: 20px;
  line-height: 1.25;
}

.rule-grid p,
.body-copy p,
.faq-list p {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
}

.two-column {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(320px, 1fr);
  gap: clamp(28px, 5vw, 68px);
  align-items: start;
}

.body-copy p {
  margin-bottom: 16px;
}

.faq-list {
  display: grid;
  gap: 10px;
}

.faq-list details {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.faq-list summary {
  cursor: pointer;
  padding: 18px 20px;
  color: var(--ink);
  font-weight: 800;
}

.faq-list p {
  margin: 0;
  padding: 0 20px 20px;
}

.site-footer {
  min-height: 76px;
  padding: 24px max(22px, var(--safe-right)) calc(24px + var(--safe-bottom)) max(22px, var(--safe-left));
  display: flex;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
  color: #536276;
  background: #f7fbff;
  border-top: 1px solid var(--line);
  font-size: 14px;
}

.noscript-message {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 60;
  max-width: 320px;
  padding: 14px 16px;
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  box-shadow: 0 14px 42px rgba(0, 0, 0, 0.2);
}

input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

@media (max-width: 980px) {
  .play-hero {
    grid-template-columns: minmax(290px, 470px) minmax(280px, 1fr);
    gap: 30px;
  }

  h1 {
    font-size: clamp(38px, 6vw, 58px);
  }
}

@media (max-width: 820px) {
  body {
    background: linear-gradient(180deg, #bed8fa 0%, #e7f2ff 64%, #ffffff 100%);
  }

  .site-header {
    display: none;
  }

  .play-hero {
    display: block;
    min-height: auto;
    padding: 0;
  }

  .game-column {
    min-height: 100dvh;
    padding: 0;
  }

  .game-shell {
    width: 100vw;
    height: 100dvh;
    max-width: none;
    min-width: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .play-copy {
    max-width: none;
    padding: 36px max(20px, var(--safe-right)) 44px max(20px, var(--safe-left));
    background: #ffffff;
  }

  h1 {
    max-width: 12ch;
    font-size: 42px;
  }

  .lead {
    font-size: 17px;
  }

  .quick-facts div {
    background: #f7fbff;
  }

  .rule-grid,
  .two-column {
    grid-template-columns: 1fr;
  }

  .rule-grid article {
    min-height: 0;
  }

  .site-footer {
    justify-content: flex-start;
  }
}

@media (max-width: 420px) {
  .play-copy,
  .content-band {
    padding-left: max(16px, var(--safe-left));
    padding-right: max(16px, var(--safe-right));
  }

  h1 {
    font-size: 38px;
  }

  .section-heading h2 {
    font-size: 30px;
  }
}

@media (min-width: 821px) and (max-height: 740px) {
  .site-header {
    min-height: 54px;
    padding-top: 8px;
    padding-bottom: 8px;
  }

  .play-hero {
    min-height: calc(100dvh - 54px);
    padding-top: 14px;
    padding-bottom: 22px;
  }

  .game-shell {
    width: min(100%, calc((100dvh - 88px) * 750 / 1334));
  }

  .quick-facts {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .quick-facts div {
    padding: 12px;
  }
}
