:root {
  color-scheme: light;
  --paper: #fff8e1;
  --white: #fffefd;
  --ink: #2e3117;
  --muted: #51543b;
  --leaf: #386500;
  --line: #c5dba5;
  --pandan: #e2f5ad;
  --sky: #d8f1ff;
  --mango: #ffca55;
  --heading: ui-rounded, "Arial Rounded MT Bold", "Trebuchet MS", system-ui, sans-serif;
  --body: system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 1rem/1.6 var(--body); }
img { display: block; max-width: 100%; }
a { color: inherit; }
:focus-visible { outline: 3px solid #235592; outline-offset: 5px; }
h1, h2, h3, p, figure, dl, dd { margin: 0; }
h1, h2, h3 { font-family: var(--heading); font-weight: 900; line-height: 1.03; letter-spacing: -.045em; }
h2 { font-size: clamp(2.4rem, 5vw, 4.55rem); }
h3 { font-size: clamp(1.65rem, 2.7vw, 2.25rem); }

.shell { width: min(100% - 6rem, 74rem); margin-inline: auto; }
.skip-link { position: fixed; inset: .75rem auto auto .75rem; z-index: 2; padding: .65rem 1rem; background: var(--mango); color: var(--ink); transform: translateY(-180%); }
.skip-link:focus { transform: none; }

.site-header { background: var(--paper); border-bottom: 1px solid #e5d6a8; }
.header-inner, .footer-inner { min-height: 4.1rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem 2rem; }
.wordmark { display: flex; flex: none; justify-self: start; max-width: 100%; }
.wordmark img { width: 9rem; height: auto; }
.site-header nav { display: flex; align-items: center; justify-content: center; gap: clamp(.25rem, .55vw, .6rem); }
.nav-toggle { display: none; }
.site-header nav a, .game-menu summary {
  display: block;
  padding: .55rem .5rem;
  border-radius: .5rem;
  color: var(--ink);
  text-decoration: none;
  font-size: .9rem;
  font-weight: 750;
  white-space: nowrap;
}
.site-header nav a:hover, .game-menu summary:hover, .game-menu[open] summary { background: var(--pandan); }
.text-link:hover { color: #235592; }
.game-menu { position: relative; }
.game-menu summary { display: list-item; cursor: pointer; }
.game-menu summary::marker { color: var(--leaf); }
.game-menu-links {
  position: absolute;
  z-index: 3;
  inset: calc(100% + .25rem) auto auto 0;
  min-width: 10rem;
  padding: .3rem;
  border: 1px solid #e5d6a8;
  border-radius: .75rem;
  background: var(--white);
  box-shadow: 0 5px 15px #2e311729;
}

.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 3.4rem;
  padding: .78rem 1.4rem;
  color: var(--ink);
  background: var(--mango);
  border: 2px solid var(--ink);
  border-radius: .85rem;
  box-shadow: 0 4px var(--ink);
  text-decoration: none;
  font-weight: 850;
  line-height: 1.3;
  text-align: center;
  transition: background-color .16s, box-shadow .16s, transform .16s;
}
.button:hover { background: #ffdf93; transform: translateY(-2px); box-shadow: 0 6px var(--ink); }
.button:active { transform: translateY(2px); box-shadow: 0 2px var(--ink); }
.button-small { min-height: 2.5rem; padding: .42rem .95rem; background: var(--pandan); box-shadow: 0 3px var(--ink); font-size: .9rem; }
.button-small:hover { background: #c7ed73; }
.free-to-play { letter-spacing: .045em; white-space: nowrap; }

@media (prefers-reduced-motion: no-preference) {
  .hero-actions .button[href="/#coming-soon"] { animation: coming-soon-wiggle .52s ease-in-out .8s; }
  .button[href="/#coming-soon"]:focus-visible { animation: coming-soon-shake .38s ease-in-out; }
}

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .button[href="/#coming-soon"]:hover { animation: coming-soon-shake .38s ease-in-out; }
}

@keyframes coming-soon-wiggle {
  25% { rotate: -3deg; }
  50% { rotate: 3deg; }
  75% { rotate: -1.5deg; }
}

@keyframes coming-soon-shake {
  20%, 60% { translate: -.18rem; }
  40%, 80% { translate: .18rem; }
}

.text-link { width: fit-content; color: var(--leaf); font-weight: 800; text-underline-offset: .26em; text-decoration-color: #729448; }

.hero-artwork {
  padding: .9rem 1.25rem 0;
  background: linear-gradient(#8bd5ff, #d8f1ff 62%, var(--paper));
}
.hero-cover {
  position: relative;
  width: min(100%, 72rem, max(25rem, 139vh));
  margin-inline: auto;
  overflow: hidden;
  border-radius: 1.3rem;
  background: var(--sky);
  box-shadow: 0 6px 22px #315a6230;
}
.hero-cover img { width: 100%; height: auto; aspect-ratio: 2; object-fit: cover; object-position: center; }
.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 1.3rem 2.5rem;
  padding-block: clamp(1.8rem, 3.2vw, 3rem) clamp(2.2rem, 4vw, 3.65rem);
}
.eyebrow { color: var(--leaf); font-size: .83rem; font-weight: 850; letter-spacing: .095em; line-height: 1.4; text-transform: uppercase; }
.hero h1 { margin-block: .45rem .65rem; font-size: clamp(2.55rem, 4.5vw, 4.3rem); }
.hero h1 em { color: var(--leaf); font-style: normal; box-shadow: inset 0 -.23em #ffdc73; }
.hero-copy > p:not(.eyebrow), .preview-copy > p:not(.eyebrow) { max-width: 36rem; color: var(--muted); font-size: 1.08rem; }
.hero-actions { display: grid; justify-items: start; gap: .75rem; }
.hero-note { max-width: 22rem; color: var(--muted); font-size: .92rem; }

.playtest-preview {
  overflow: hidden;
  background: linear-gradient(145deg, #effad1, var(--pandan) 53%, #e4f6f0);
  border-block: 1px solid var(--line);
}
.preview-inner {
  display: grid;
  grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr);
  align-items: center;
  gap: clamp(2.5rem, 6vw, 5.5rem);
  padding-block: clamp(2.9rem, 5.7vw, 5rem) clamp(3.35rem, 5.7vw, 5rem);
}
.preview-copy h2 { margin-block: .65rem .75rem; }
.preview-copy .text-link { display: inline-block; margin-top: 1.1rem; }
.playtest-scene { position: relative; isolation: isolate; margin-inline: 0 .65rem; }
.playtest-scene::before, .playtest-scene::after {
  content: "";
  position: absolute;
  z-index: 1;
  width: clamp(1.5rem, 4vw, 3.5rem);
  aspect-ratio: 1;
  pointer-events: none;
  clip-path: polygon(50% 0, 64% 36%, 100% 50%, 64% 64%, 50% 100%, 36% 64%, 0 50%, 36% 36%);
}
.playtest-scene::before { inset: -1.5rem -1.35rem auto auto; background: #588a0d; transform: rotate(12deg); }
.playtest-scene::after { inset: auto auto 1.6rem -.95rem; width: 1.65rem; background: var(--mango); transform: rotate(15deg); }
.map-card {
  padding: .55rem;
  background: var(--white);
  border: 2px solid var(--ink);
  border-radius: 1.5rem;
  box-shadow: .55rem .65rem #a7d9bd;
  transform: rotate(2deg);
}
.map-image { position: relative; overflow: hidden; border-radius: .95rem; }
.map-art { width: 100%; height: auto; }
.gameplay-card { transform: none; }
.gameplay-card video { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; background: #2e3117; }
.video-error { padding: .2rem .45rem .45rem; color: var(--muted); font-size: .85rem; }
.scene-map { margin-top: 1.35rem; }
.scene-map summary { width: fit-content; cursor: pointer; }
.scene-map[open] .playtest-scene { margin-top: 1.35rem; margin-bottom: 1rem; }
.map-runner {
  position: absolute;
  width: clamp(2.85rem, 11%, 4.75rem);
  height: auto;
  transform: translate(-50%, -82.14%);
  pointer-events: none;
}
.scene-motion {
  position: absolute;
  inset: .65rem auto auto .65rem;
  min-height: 2rem;
  padding: .25rem .58rem;
  border: 1px solid var(--ink);
  border-radius: .5rem;
  background: var(--white);
  color: var(--ink);
  font: 750 .82rem/1.3 var(--body);
  cursor: pointer;
}
.scene-motion:hover { background: var(--pandan); }
.scene-motion:focus-visible { box-shadow: 0 0 0 4px var(--white); }
.map-card figcaption { display: flex; flex-wrap: wrap; gap: 0 .55rem; align-items: baseline; padding: .55rem .45rem .15rem; margin: 0; color: var(--ink); font: 900 1rem/1.4 var(--heading); }
.map-card figcaption span { color: var(--muted); font: 650 .84rem/1.4 var(--body); }
.crab-sticker {
  position: absolute;
  z-index: 2;
  inset: auto -.7rem -1.6rem auto;
  width: 6.4rem;
  display: grid;
  justify-items: center;
  padding: .1rem .35rem .3rem;
  background: #ffe3ec;
  border: 2px solid var(--ink);
  border-radius: 1.1rem;
  box-shadow: 3px 4px #c88c77;
  transform: rotate(-8deg);
}
.crab-sticker canvas { display: block; width: 5.25rem; height: auto; image-rendering: pixelated; }
.crab-sticker figcaption { margin: -.18rem 0 0; white-space: nowrap; color: var(--ink); font: 900 .81rem/1.4 var(--heading); }

.section { padding-block: clamp(3.5rem, 7vw, 6rem); }
.section-heading { display: grid; grid-template-columns: 1.3fr 1fr; align-items: end; gap: 1rem 2rem; margin-bottom: 1.8rem; }
.section-heading .eyebrow, .field-copy .eyebrow { margin-bottom: .65rem; }
.section-heading > p { max-width: 34rem; color: var(--muted); }
.districts, .class-grid { display: grid; gap: 1rem; }
.districts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.district, .class-card {
  overflow: hidden;
  border: 1px solid var(--card-border);
  border-radius: 1.2rem;
  background: var(--card-fill);
  box-shadow: 0 5px var(--card-border);
}
.district { --card-border: #addfc1; --card-fill: #e3f7e9; }
.district:nth-child(2) { --card-border: #eacb85; --card-fill: #fff1cd; }
.district:nth-child(3) { --card-border: #b5d6ed; --card-fill: #e4f4ff; }
.district img { width: 100%; height: auto; aspect-ratio: 1.65; object-fit: cover; }
.district-copy, .class-copy { padding: 1.05rem 1.2rem 1.25rem; }
.district h3, .class-card h3 { margin-block: .38rem .5rem; }
.district-copy p:last-child, .class-copy p:not(.eyebrow) { color: var(--muted); }

.field-section { padding-block: clamp(2.7rem, 5.5vw, 5rem); background: var(--sky); border-block: 1px solid #b4dcef; }
.field-layout { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); align-items: center; gap: clamp(1.8rem, 5vw, 4.6rem); }
.field-layout img { width: 100%; height: auto; border: .35rem solid var(--white); border-radius: 1.15rem; box-shadow: 0 4px #8fd0ee; }
figcaption, .art-note { margin-top: .7rem; color: var(--muted); font-size: .88rem; }
.field-copy p:not(.eyebrow) { margin-block: .9rem 1rem; color: var(--muted); }

.minigame-section { padding-bottom: clamp(2rem, 4vw, 3.5rem); }
.venue-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.venue-card { overflow: hidden; border: 1px solid #d8c58b; border-radius: 1.1rem; background: #fff2c5; }
.venue-card:target { outline: 2px solid var(--leaf); outline-offset: 3px; scroll-margin-top: 1rem; }
.venue-card img { width: 100%; height: auto; }
.venue-copy { padding: .85rem 1rem 1rem; }
.venue-copy h3 { margin-bottom: .25rem; font-size: 1.35rem; }
.venue-copy p { color: var(--muted); }
.venue-copy span { display: inline-block; margin-top: .4rem; color: var(--leaf); font-size: .87rem; font-weight: 750; }

.class-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.fighter { --card-border: #f0b9c2; --card-fill: #ffe8ec; --class-ink: #8a3550; }
.security { --card-border: #e9ce8a; --card-fill: #fff0cb; --class-ink: #725012; }
.rider { --card-border: #b5dba6; --card-fill: #e7f7d9; --class-ink: #346239; }
.responder { --card-border: #b8d4ef; --card-fill: #e4f1ff; --class-ink: #365b86; }
.class-art { display: block; width: 100%; height: auto; background: radial-gradient(ellipse, #fffdf4, var(--card-fill) 75%); border-bottom: 3px solid var(--card-border); }
.class-copy .eyebrow { color: var(--class-ink); }
.class-stage {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: inherit;
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.class-stage:disabled { cursor: default; }
.class-stage:focus-visible { outline-offset: -4px; }
.class-move {
  display: inline-grid;
  place-items: center;
  margin: .6rem 1.2rem 0;
  inline-size: 8.75rem;
  max-inline-size: calc(100% - 2.4rem);
  min-height: 2.5rem;
  padding: .3rem .75rem;
  border: 1px solid currentColor;
  border-radius: .6rem;
  background: var(--white);
  color: var(--class-ink);
  font: 800 .85rem/1.3 var(--body);
}
.class-stage:not(:disabled):is(:hover, :focus-visible) .class-move { background: var(--class-ink); color: var(--white); }
.class-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 1.4rem; }
.class-actions .art-note { margin: 0; }

.playtest-info { padding-block: 2.5rem; background: #f2f7da; border-top: 1px solid var(--line); }
.info-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.info-card {
  padding: clamp(1.15rem, 3vw, 1.8rem);
  scroll-margin-top: 1rem;
  border: 1px solid var(--line);
  border-radius: 1.2rem;
  background: var(--white);
}
.info-card:target { outline: 2px solid var(--leaf); outline-offset: 2px; }
.info-card h2 { margin-bottom: .65rem; font-size: clamp(1.65rem, 3.2vw, 2.35rem); color: var(--leaf); }
.info-card h3 { margin-bottom: .4rem; font-size: 1.18rem; letter-spacing: -.015em; }
.info-card p { color: var(--muted); }
.info-card .text-link { display: inline-block; margin-top: .75rem; }
.info-card > p + h3 { margin-top: 1.15rem; }

.beta-feature {
  padding: clamp(1rem, 2.2vw, 1.45rem);
  border: 1px solid #e6c97c;
  border-radius: .9rem;
  background: #fff1c5;
}
.beta-feature .eyebrow { margin-bottom: .6rem; color: #6b480b; }
.beta-feature h3 { font-size: clamp(1.45rem, 2.8vw, 2rem); line-height: 1.1; }

.leaderboard-categories { display: flex; flex-wrap: wrap; gap: .45rem; margin-bottom: .65rem; }
.leaderboard-categories button {
  min-height: 2.75rem;
  padding: .35rem .9rem;
  border: 1px solid var(--leaf);
  border-radius: .6rem;
  background: var(--white);
  color: var(--leaf);
  font: 750 .9rem/1.3 var(--body);
  cursor: pointer;
}
.leaderboard-categories button[aria-pressed="true"] { background: var(--leaf); color: var(--white); }
.leaderboard-categories button[aria-pressed="false"]:hover { background: var(--pandan); }
.leaderboard { width: 100%; margin-top: .9rem; border-collapse: collapse; font-size: .91rem; }
.leaderboard th, .leaderboard td { padding: .42rem .35rem; text-align: left; border-bottom: 1px solid var(--line); }
.leaderboard thead { background: #f2f7da; color: var(--leaf); }
.leaderboard tbody th { overflow-wrap: anywhere; font-weight: 750; }
.leaderboard th:nth-child(n+3), .leaderboard td:nth-child(n+3) { text-align: right; }
.leaderboard td { font-variant-numeric: tabular-nums; }
.leaderboard-status { margin-top: .7rem; }
.leaderboard-refresh {
  min-height: 2.5rem;
  margin-top: .85rem;
  padding: .35rem .75rem;
  border: 1px solid var(--leaf);
  border-radius: .6rem;
  background: var(--white);
  color: var(--leaf);
  font: 750 .85rem/1.3 var(--body);
  cursor: pointer;
}
.leaderboard-refresh:not(:disabled):hover { background: var(--pandan); }
.leaderboard-refresh:disabled { opacity: .65; cursor: wait; }

.join { background: #fff0bf; border-block: 1px solid #ead18c; }
.join-inner { display: flex; justify-content: space-between; align-items: center; gap: 1.25rem 2.5rem; padding-block: clamp(2.6rem, 5.5vw, 5rem); }
.join h2 { color: var(--leaf); }
.join p { margin-top: .65rem; color: var(--muted); }
.join-action { flex-shrink: 0; }
.join-action p { margin-top: .85rem; font-size: .88rem; }
.site-footer { background: var(--paper); }
.footer-inner { min-height: 5rem; }
.field-links, .footer-links { display: flex; flex-wrap: wrap; column-gap: 1.25rem; row-gap: .3rem; }

@media (max-width: 72rem) {
  .site-header .header-inner {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: .65rem;
    padding-block: .65rem;
  }
  .site-header .header-inner > .button { grid-area: 1 / 3; min-height: 2.75rem; }
  .nav-toggle:not([hidden]) {
    display: inline-flex;
    grid-area: 1 / 2;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    min-height: 2.75rem;
    padding: .4rem .75rem;
    border: 1px solid #d6c38a;
    border-radius: .7rem;
    background: var(--white);
    color: var(--ink);
    font: 750 .9rem/1.3 var(--body);
    cursor: pointer;
  }
  .nav-toggle::after { content: ""; width: .42rem; height: .42rem; border: solid var(--leaf); border-width: 0 2px 2px 0; transform: translateY(-.12rem) rotate(45deg); }
  .nav-toggle:is(:hover, [aria-expanded="true"]) { background: var(--pandan); }
  .nav-toggle[aria-expanded="true"]::after { transform: translateY(.09rem) rotate(225deg); }
  .site-header nav { display: grid; grid-column: 1 / -1; justify-content: stretch; align-items: stretch; gap: .15rem; }
  .nav-toggle:not([hidden]) + nav {
    position: absolute;
    z-index: 4;
    inset: calc(100% + .35rem) 0 auto auto;
    width: min(100%, 20rem);
    max-height: calc(100dvh - 5.5rem);
    overflow: auto;
    padding: .65rem;
    border: 1px solid #e5d6a8;
    border-radius: .9rem;
    background: var(--white);
    box-shadow: 0 6px 18px #2e311729;
  }
  .nav-toggle:not([hidden])[aria-expanded="false"] + nav { display: none; }
  .site-header nav a, .site-header .game-menu summary { min-height: 2.75rem; padding: .65rem .75rem; }
  .site-header .game-menu-links { position: static; min-width: 0; margin-left: .75rem; padding: .2rem 0 .2rem .45rem; border: 0; border-left: 2px solid var(--line); border-radius: 0; box-shadow: none; }
}

@media (max-width: 1000px) {
  .shell { width: calc(100% - 3rem); }
  .preview-inner { gap: 2.75rem; }
  .district-copy, .class-copy { padding-inline: .9rem; }
  .class-move { margin-inline: .9rem; }
  .class-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .shell { width: calc(100% - 2.5rem); }
  .hero-inner, .preview-inner { grid-template-columns: 1fr; }
  .preview-inner { gap: 2.1rem; }
  .playtest-scene { width: min(100% - .6rem, 33rem); margin-inline: auto; }
  .playtest-scene::before { inset: -1rem -.75rem auto auto; }
  .playtest-scene::after { inset: auto auto 1.3rem -.5rem; width: 1.25rem; }
  .map-card { border-radius: 1.2rem; box-shadow: .3rem .45rem #a7d9bd; }
  .map-image { border-radius: .72rem; }
  .crab-sticker { inset: auto -.25rem -1.2rem auto; width: 5.45rem; }
  .crab-sticker canvas { width: 4.45rem; }
  .section-heading, .field-layout { grid-template-columns: 1fr; }
  .venue-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .field-copy { grid-row: 1; }
}

@media (max-width: 600px) {
  .shell { width: calc(100% - 2rem); }
  .header-inner { min-height: 3.8rem; }
  .wordmark img { width: 7.5rem; }
  .hero-artwork { padding: 0; }
  .hero-cover { border-radius: 0; box-shadow: none; }
  .districts, .venue-grid { grid-template-columns: 1fr; }
  .info-grid { grid-template-columns: 1fr; }
  .join-inner { flex-direction: column; align-items: flex-start; gap: 1.25rem; }
}

@media (max-width: 360px) {
  .map-card figcaption { padding-inline: .15rem; font-size: .91rem; }
  .map-card figcaption span { font-size: .72rem; }
  .class-grid { grid-template-columns: 1fr; }
  .footer-inner { gap: .8rem; flex-wrap: wrap; padding-block: 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .button { transition: none; }
}
