* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
#overlay[data-screen="results"] .beast-emblem,
#overlay[data-screen="choices"] .beast-emblem,
#overlay[data-screen="records"] .beast-emblem,
#overlay[data-screen="results"] > .eyebrow,
#overlay[data-screen="records"] > .eyebrow,
#overlay[data-screen="results"] > #victory-beast {
  display: none;
}
#menu-return { margin-top: 10px; background: transparent; color: #c2d5b4; }
#overlay { overflow-y: auto; }
button:disabled { opacity: 0.45; cursor: default; }
.beast-emblem {
  position: relative;
  flex-shrink: 0;
  width: 94px;
  height: 82px;
  margin: 0 auto 18px;
  border: 3px solid #172b1c;
  border-radius: 43% 48% 38% 40%;
  background: radial-gradient(circle at 30% 20%, #f0ffad, #c8ef6b 45%, #7ca344);
  box-shadow:
    inset -5px -7px 0 #52762a55,
    0 10px 0 #081d1870,
    0 0 60px #d1fc6525;
  transform: rotate(-8deg);
}
.beast-emblem::before,
.beast-emblem::after {
  content: "";
  position: absolute;
  width: 22px;
  height: 22px;
  border: 7px solid #92ac9e;
  outline: 3px solid #1b3029;
  background: #2a463b;
  border-radius: 5px;
  left: -18px;
  top: 33px;
  transform: rotate(25deg);
}
.beast-emblem::after {
  left: auto;
  right: -15px;
  border-color: #7de2cf;
  border-top-color: transparent;
  border-radius: 0 0 12px 12px;
}
.beast-emblem i {
  position: absolute;
  top: 22px;
  left: 22px;
  width: 18px;
  height: 21px;
  border-radius: 50%;
  background: #f9ffe6;
  box-shadow: inset -5px -3px 0 #d4e5ab;
}
.beast-emblem i + i {
  left: 48px;
}
.beast-emblem i::after {
  content: "";
  position: absolute;
  width: 7px;
  height: 9px;
  background: #18342a;
  border-radius: 50%;
  top: 7px;
  left: 7px;
}
.beast-emblem span {
  position: absolute;
  width: 25px;
  height: 14px;
  top: 49px;
  left: 33px;
  border-radius: 3px 3px 14px 14px;
  background: #203525;
  border-top: 4px solid #f9ffe6;
}
@media (max-width: 700px) {
  .beast-emblem {
    width: 94px;
    height: 82px;
    zoom: 0.7;
    margin-bottom: 10px;
  }
}
#move-zone,
#joystick {
  display: none;
}
#move-zone {
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
#joystick {
  position: absolute;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: 2px solid #d1fc6570;
  background: #203c2c99;
  pointer-events: none;
  z-index: 4;
  box-shadow: inset 0 0 18px #0003;
}
#stick {
  position: absolute;
  left: 25px;
  top: 25px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 25%, #e3ffa0, #9fbf54);
  border: 2px solid #d8f2a3;
  box-shadow: 0 4px 12px #0006;
}
#joystick.engaged {
  border-color: #d1fc65;
  background: #344f2ebd;
}
#dash,
#smash {
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
#smash {
  position: absolute;
  bottom: 20px;
  right: 130px;
  z-index: 2;
  border-color: #d6ac72;
  background: #443c27;
  color: #ffce91;
  min-width: 96px;
  border-radius: 14px;
  padding: 12px;
}
body {
  background: radial-gradient(ellipse at 70% 10%, #273927 0, transparent 60%), #101916;
}
#overlay {
  z-index: 3;
  background: linear-gradient(160deg, #11251dec, #112018bc);
  backdrop-filter: blur(3px);
}
#overlay[hidden],
#upgrades[hidden],
button[hidden] {
  display: none !important;
}
#upgrades {
  display: flex;
  gap: 12px;
  padding: 15px 25px;
  width: 100%;
}
#upgrades button {
  flex: 1;
  text-align: left;
  padding: 20px 14px;
  border-color: #c9ef8166;
  background: #2d4334;
}
#upgrades button:hover {
  background: #425e3a;
  border-color: #d1fc65;
  transform: translateY(-3px);
}
#upgrades b {
  display: block;
  color: #d1fc65;
  font-size: 12px;
  margin-bottom: 12px;
}
#upgrades span {
  font-weight: 400;
  font-size: 12px;
  line-height: 1.6;
  color: #c9d6be;
}
.mode-menu,
#run-upgrade-options {
  display: flex;
  gap: 8px;
  padding: 12px 20px;
  width: 100%;
}
.mode-menu button,
#run-upgrade-options button {
  flex: 1;
  text-align: left;
  padding: 13px 10px;
  background: #243a2d;
}
.mode-menu b,
#run-upgrade-options b {
  display: block;
  color: #d1fc65;
  font-size: 10px;
  letter-spacing: 1px;
}
.mode-menu span,
#run-upgrade-options span {
  display: block;
  margin-top: 6px;
  color: #c4d4c0;
  font-size: 10px;
  line-height: 1.3;
}
.mode-menu button[disabled] {
  opacity: 0.42;
  cursor: not-allowed;
}
.meta-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
  width: 100%;
  padding: 0 20px 8px;
}
.skin-button {
  flex: 0 0 34%;
  text-align: left;
  padding: 10px;
  background: #172c21;
  border: 2px solid #c6ef68;
}
.skin-button b { display:block; color:#f2f9d8; font-size:10px; letter-spacing:1px; }
.skin-button span { display:block; margin-top:5px; color:#ffdc6a; font-size:9px; }
.missions { flex: 1; text-align: left; }
.missions-head { margin: 0 0 4px; color: #a9bb97; font-size: 9px; letter-spacing: .5px; }
.missions-head b { color: #ffdc6a; font-size: 11px; }
.mission { padding: 3px 0; color: #d8e6d1; font-size: 10px; border-bottom: 1px dashed #2f4a38; }
.mission.done { color: #ffdc6a; font-weight: 800; }
.mission.new::after { content: " NEW"; color: #7de2cf; font-size: 8px; font-weight: 800; }
#result-hook { min-height: 14px; margin: 0 0 8px; color: #ffdc6a; font-size: 12px; font-weight: 800; }
#result-missions { margin: 0 0 10px; padding: 8px 10px; border-radius: 7px; background: #0a1913; }
#skip-score small { display: inline; opacity: .6; font-size: 9px; margin-left: 4px; }
.records-launch {
  align-self: center;
  margin: 1px 0 15px;
  padding: 4px 5px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #a9bb97;
  font-size: 9px;
  letter-spacing: .8px;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.records-launch:hover { background: transparent; color: #d1fc65; }
.records-launch span { margin-left: 4px; }
#records-menu {
  width: min(470px, 94%);
  padding: 4px 0 16px;
}
.records-head { display:flex; align-items:center; justify-content:space-between; gap:8px; }
.records-head .eyebrow { margin:8px 0; }
.records-head button { padding:7px 8px; font-size:9px; }
.record-tabs { display:flex; gap:5px; padding:8px 0; }
.record-tabs button { flex:1; padding:10px 4px; color:#b9ceb0; background:#172c21; font-size:9px; }
.record-tabs button.active { color:#1d2e1e; background:#d1fc65; border-color:#d1fc65; }
#records-rule { min-height:16px; margin:0 0 7px; color:#a3b99b; font-size:10px; text-align:center; }
.records-sheet { overflow:hidden; border:2px solid #718a61; border-radius:5px; background:#0a1913; box-shadow:inset 0 0 0 1px #162b20; }
.records-row { display:grid; grid-template-columns:54px minmax(0,1fr) 108px; align-items:center; min-height:32px; border-bottom:1px solid #3d553f; text-align:left; }
.records-row:last-child { border-bottom:0; }
.records-row span { padding:0 8px; font-size:11px; }
.records-labels { min-height:25px; background:#31472e; color:#d9f2a7; font-size:9px; letter-spacing:1px; }
.records-labels span { font-size:9px; }
.records-row:nth-child(even) { background:#10251b; }
.records-row .rank { color:#d1fc65; font-weight:800; }
.records-row .name { overflow:hidden; color:#f2f9d8; font-weight:800; text-overflow:ellipsis; white-space:nowrap; }
.records-row .metric { color:#ffda98; text-align:right; }
.records-empty { padding:22px; color:#9ab091; font-size:11px; text-align:center; }
#run-upgrades {
  width: 100%;
  text-align: center;
}
#reroll {
  margin: 0 0 15px;
  border-color: #ffcb7a;
  color: #ffdc9a;
}
#arcade-result {
  width: min(440px, 94%);
  background: #11241dec;
  border: 1px solid #58704c;
  border-radius: 14px;
  padding: 18px;
  box-shadow: 0 14px 45px #0008;
}
#arcade-result h3 { margin: 7px 0; font-size: 28px; }
#arcade-result label { display:block; text-align:left; font-size:9px; color:#a9bb97; letter-spacing:1px; }
#arcade-name { width:100%; margin:7px 0 10px; padding:12px; border-radius:7px; border:1px solid #607757; background:#0a1913; color:#efffcf; font:700 15px Arial; }
.result-actions { display:flex; gap:8px; }
.result-actions button { flex:1; }
#save-score { background:#d1fc65; color:#172719; border:0; }
#save-status { min-height:14px; color:#b9d6a8; font-size:10px; }
#leaderboard { max-height:132px; overflow:auto; border-top:1px solid #466043; padding-top:8px; font-size:10px; color:#d8e6d1; text-align:left; }
#leaderboard p { margin:3px 0; display:flex; justify-content:space-between; }
.game {
  box-shadow:
    0 0 0 5px #17261d,
    0 0 0 6px #3c513c,
    0 30px 80px #0007;
}
#notice {
  top: 89px;
  background: #12251ed9;
  border-radius: 20px;
  width: fit-content;
  max-width: 94%;
  margin: auto;
  padding: 8px 14px;
  font-size: 11px;
}
#notice:empty {
  display: none;
}
#dash {
  z-index: 2;
  box-shadow: 0 4px 0 #0e1b13;
  border-radius: 14px;
}
#dash:active {
  transform: translateY(3px);
  box-shadow: none;
}
body {
  margin: 0;
  background: radial-gradient(ellipse at 75% 35%, #263d2a 0, #101916 65%);
  color: #edf0d9;
  font-family: Arial, Helvetica, sans-serif;
}
main {
  max-width: 1250px;
  margin: auto;
  padding: 26px 38px;
}
header {
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid #34433a;
  padding-bottom: 22px;
}
header a {
  color: #ecf4d3;
  text-decoration: none;
  font-size: 25px;
  font-weight: 950;
  letter-spacing: -1.5px;
}
header a span {
  color: #d1fc65;
}
header > div {
  font-size: 10px;
  letter-spacing: 2px;
  margin-left: auto;
  margin-right: 20px;
  color: #bfccb9;
}
small {
  display: block;
  font-size: 9px;
  margin-top: 6px;
  color: #849588;
}
button {
  font: 700 11px Arial;
  cursor: pointer;
  color: #edf0d9;
  background: #25362c;
  border: 1px solid #40513f;
  border-radius: 8px;
  padding: 12px 15px;
}
button:hover {
  background: #3a4e32;
}
button:focus-visible,
canvas:focus-visible {
  outline: 3px solid #d1fc65;
  outline-offset: 3px;
}
.layout {
  display: grid;
  grid-template-columns: 1fr 540px;
  gap: 65px;
  align-items: center;
  padding-top: 30px;
}
.eyebrow {
  font-size: 10px;
  letter-spacing: 2.5px;
  color: #c9ed86;
  font-weight: 700;
}
h1 {
  font-size: 86px;
  line-height: 0.91;
  letter-spacing: -6px;
  margin: 28px 0;
}
h1 em {
  color: #d1fc65;
  font-style: normal;
}
.intro {
  font-size: 15px;
  line-height: 1.7;
  color: #acbcae;
  max-width: 305px;
}
.parts {
  margin-top: 30px;
}
.parts > div {
  border-top: 1px solid #34433a;
  padding: 15px 12px;
  border-left: 2px solid #516344;
  background: linear-gradient(90deg, #b0d96908, transparent);
  opacity: 0.75;
  transition: opacity 0.15s;
}
.parts > div.active {
  opacity: 1;
  color: #d1fc65;
  border-left-color: #d1fc65;
  background: linear-gradient(90deg, #b0d96920, transparent);
}
.parts b {
  font-size: 11px;
  letter-spacing: 2px;
}
.parts span {
  display: block;
  font-size: 12px;
  margin-top: 6px;
  color: #b3c3b7;
}
.controls {
  font-size: 9px;
  line-height: 2.2;
  letter-spacing: 1px;
  color: #819985;
  margin-top: 22px;
}
.controls strong {
  color: #c5d2c1;
  margin-left: 12px;
  font-weight: 400;
}
.game {
  position: relative;
  border: 1px solid #49604a;
  border-radius: 18px;
  overflow: hidden;
  background: #213329;
  box-shadow: 0 25px 70px #0005;
}
canvas {
  display: block;
  width: 100%;
  height: auto;
  touch-action: none;
}
#overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 32%, #355036e8, #102017ed 75%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  backdrop-filter: blur(5px);
}
#overlay.hidden {
  display: none;
}
h2 {
  font-size: 58px;
  line-height: 1;
  letter-spacing: -3px;
  margin: 20px 0;
}
#description {
  color: #b7c9b4;
  line-height: 1.7;
  font-size: 14px;
}
#start {
  background: #d1fc65;
  color: #172719;
  border: 0;
  padding: 18px 30px;
  font-size: 13px;
  margin-top: 20px;
  min-width: 220px;
}
#start span {
  margin-left: 45px;
}
#dash {
  position: absolute;
  bottom: 20px;
  right: 20px;
  border: 1px solid #bbde7770;
  background: #152b22e8;
  min-width: 96px;
  padding: 12px;
  color: #d1fc65;
}
#dash small {
  color: #a1b293;
}
#notice {
  pointer-events: none;
  position: absolute;
  top: 92px;
  left: 15px;
  right: 15px;
  text-align: center;
  font-size: 13px;
  font-weight: 800;
  color: #efffcf;
  text-shadow: 0 2px 8px #000;
}
footer {
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  letter-spacing: 1.2px;
  color: #839881;
  padding-top: 25px;
}
footer span {
  letter-spacing: 0;
}
@media (max-width: 950px) {
  .layout {
    grid-template-columns: 1fr 1.4fr;
    gap: 25px;
  }
  h1 {
    font-size: 64px;
  }
  main {
    padding: 20px;
  }
  .intro {
    font-size: 13px;
  }
}
@media (max-width: 640px) {
  main {
    padding: 10px;
  }
  .layout {
    display: block;
    padding-top: 12px;
  }
  aside {
    display: none;
  }
  header {
    padding-bottom: 12px;
  }
  header > div {
    display: none;
  }
  header a {
    margin-right: auto;
    font-size: 22px;
  }
  header button {
    padding: 10px;
  }
  .game {
    max-width: 540px;
    margin: auto;
  }
  footer {
    font-size: 8px;
    line-height: 1.5;
  }
  footer span {
    display: none;
  }
  h2 {
    font-size: 50px;
  }
}
@media (pointer: coarse), (max-width: 640px) {
  html,
  body {
    height: 100%;
    overscroll-behavior: none;
    overflow: hidden;
    touch-action: none;
  }
  body {
    position: fixed;
    inset: 0;
    width: 100%;
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
  }
  main {
    height: 100%;
    overflow: hidden;
    touch-action: none;
  }
  .game,
  .game * {
    touch-action: none;
  }
  main {
    padding: 8px max(8px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom))
      max(8px, env(safe-area-inset-left));
  }
  header {
    height: 48px;
    padding-bottom: 8px;
  }
  header > div,
  aside,
  footer {
    display: none;
  }
  header a {
    margin-right: auto;
    font-size: 22px;
  }
  .layout {
    display: block;
    padding-top: 8px;
  }
  .game {
    width: min(100%, calc((100svh - 218px - env(safe-area-inset-bottom)) * 0.76923));
    min-width: 220px;
    max-width: 540px;
    padding-bottom: 140px;
    margin: auto;
    overflow: hidden;
  }
  #move-zone {
    display: block;
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50%;
    height: 140px;
    z-index: 2;
    background: linear-gradient(0deg, #15291f, #21372a);
    border-top: 1px solid #53694655;
  }
  #move-zone span {
    position: absolute;
    bottom: 8px;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 8px;
    letter-spacing: 1px;
    color: #a6be90;
    pointer-events: none;
  }
  #joystick {
    display: block;
    left: calc(25% - 50px);
    top: calc(100% - 123px);
  }
  #dash,
  #smash {
    bottom: 28px;
    right: 10px;
    width: 70px;
    min-width: 0;
    height: 70px;
    border-radius: 50%;
    font-size: 11px;
    padding: 8px 2px;
    z-index: 4;
  }
  #smash {
    right: 87px;
    bottom: 48px;
    border-color: #d6ac72;
  }
  #dash small,
  #smash small {
    font-size: 8px;
  }
  #overlay {
    bottom: 140px;
    padding: 12px;
  }
  #overlay h2 {
    font-size: clamp(28px, 8vw, 48px);
    margin: 12px 0;
  }
  #overlay .eyebrow {
    font-size: 8px;
    letter-spacing: 1px;
  }
  #description {
    font-size: 12px;
    line-height: 1.4;
  }
  #start {
    min-width: 0;
    margin-top: 10px;
    padding: 14px 20px;
  }
  #upgrades {
    padding: 6px;
    gap: 8px;
  }
  .mode-menu,
  #run-upgrade-options {
    padding: 5px 8px;
    gap: 5px;
  }
  .mode-menu button,
  #run-upgrade-options button {
    padding: 9px 6px;
  }
  .mode-menu b,
  #run-upgrade-options b { font-size: 8px; }
  .mode-menu span,
  #run-upgrade-options span { font-size: 8px; }
  #arcade-result { padding: 11px; }
  #arcade-result h3 { font-size: 21px; }
  #leaderboard { max-height: 82px; }
  .records-launch { margin-bottom: 7px; padding:4px 5px; }
  .meta-row { padding: 0 8px 5px; gap: 5px; }
  .skin-button { padding: 7px 6px; }
  .skin-button b { font-size: 8px; }
  .mission { font-size: 9px; padding: 2px 0; }
  #result-missions { padding: 5px 8px; margin-bottom: 7px; }
  #result-hook { font-size: 11px; margin-bottom: 5px; }
  #records-menu { padding-bottom: 4px; }
  .records-row { grid-template-columns:42px minmax(0, 1fr) 85px; min-height:28px; }
  .records-row span { padding:0 5px; font-size:9px; }
  .records-labels span { font-size:8px; }
  #upgrades button {
    padding: 12px 8px;
  }
  #upgrades b {
    font-size: 10px;
  }
  #upgrades span {
    font-size: 10px;
  }
  #notice {
    font-size: 9px;
    top: 11%;
    padding: 5px 8px;
  }
}

#victory-beast {
  width: 130px;
  height: 130px;
  border-radius: 50%;
  border: 2px solid #d1fc65;
  margin-bottom: 8px;
}
#victory-beast[hidden] {
  display: none;
}
#overlay:has(#victory-beast:not([hidden])) .beast-emblem {
  display: none;
}
#pause-menu { display: flex; flex-direction: column; gap: 10px; width: min(280px, 100%); margin: 14px auto 0; }
#pause-menu[hidden] { display: none; }
#pause-menu small { display: inline; opacity: .6; font-size: 9px; margin-left: 4px; }
#quit-run { background: transparent; color: #c2d5b4; }
