:root {
  font-family: "Avenir Next", Avenir, "Segoe UI", sans-serif;
  color: #233f48;
  font-synthesis: none;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: #e9eee9;
  overflow: hidden;
}
button {
  font: inherit;
  color: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
button:focus-visible {
  outline: 3px solid #deae57;
  outline-offset: 5px;
}
button {
  transition:
    transform 0.18s,
    background 0.18s,
    box-shadow 0.18s;
}
button:hover {
  transform: translateY(-2px);
}
button:active {
  transform: translateY(1px);
}
#game-shell {
  position: relative;
  width: 100vw;
  height: 100dvh;
  overflow: hidden;
  background: #e9eee9;
}
canvas {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.screen {
  position: absolute;
  inset: 0;
  max-width: 1600px;
  margin: auto;
}
.hidden {
  display: none !important;
}
.masthead {
  position: absolute;
  top: 5.1%;
  left: 5.1%;
  right: 5.1%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  font-family: Georgia, serif;
  font-weight: bold;
  font-size: 15px;
  letter-spacing: 2.8px;
}
.brand-mark {
  font-size: 42px;
  line-height: 1;
  color: #ad8746;
}
.brand-sub {
  display: block;
  font-size: 9px;
  letter-spacing: 4px;
  margin-top: 5px;
  text-align: center;
}
.header-actions {
  display: flex;
  gap: 12px;
}
.icon-button {
  border: 1px solid #28454b22;
  border-radius: 50%;
  background: #fffaf06b;
  width: 42px;
  height: 42px;
  font-size: 22px;
}
.hero {
  position: absolute;
  left: 7%;
  top: 23%;
  width: 51%;
}
.eyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2.8px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.eyebrow > span {
  width: 25px;
  height: 1px;
  background: #b39355;
}
h1 {
  position: relative;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(42px, 6.1vw, 92px);
  font-weight: 400;
  line-height: 1.02;
  letter-spacing: -3px;
  margin: 23px 0 20px;
  max-width: 610px;
}
h1 em {
  font-weight: 400;
  color: #638d80;
}
.title-star {
  display: inline-block;
  font-size: 27px;
  vertical-align: top;
  margin: 9px 0 0 16px;
  color: #c09c57;
}
.hero p {
  font-size: 15px;
  line-height: 1.8;
  color: #647671;
  letter-spacing: 0.1px;
}
.hero-actions {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-top: 25px;
}
.primary {
  border: 0;
  background: #294e50;
  color: #fffaf0;
  padding: 17px 24px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 6px 18px #294e5020;
}
.primary:hover {
  background: #36645e;
  box-shadow: 0 8px 22px #294e5035;
}
.primary span {
  margin-left: 28px;
  font-size: 18px;
}
.text-button {
  font-size: 12px;
  border: 0;
  border-bottom: 1px solid #9baca580;
  padding: 10px 0;
  background: transparent;
}
.text-button span {
  margin-left: 9px;
}
.hero-note {
  margin-top: 25px;
  color: #71847b;
  font-size: 10px;
  letter-spacing: 0.5px;
}
.hero-note > span {
  color: #b4914f;
  font-size: 17px;
  margin-right: 6px;
}
.scene-caption {
  position: absolute;
  right: 7%;
  bottom: 27.5%;
  font-size: 8px;
  letter-spacing: 2px;
  text-align: center;
  color: #697f73;
  line-height: 2;
}
.scene-caption > span {
  display: block;
  font-size: 25px;
  color: #ba9957;
  line-height: 1.2;
}
.scene-caption small {
  font-family: Georgia, serif;
  font-size: 13px;
  font-style: italic;
  letter-spacing: 0.5px;
}
.journey {
  position: absolute;
  left: 5.2%;
  right: 5.2%;
  bottom: 8%;
  height: 112px;
  display: grid;
  grid-template-columns: 0.76fr 1fr 1fr 1fr;
  align-items: center;
  border-top: 1px solid #72897e30;
  border-bottom: 1px solid #72897e30;
  background: #f9f7ed70;
  backdrop-filter: blur(10px);
}
.journey-label {
  font-size: 10px;
  letter-spacing: 2px;
  padding-left: 16px;
}
.journey-label span {
  display: block;
  font-family: Georgia, serif;
  font-style: italic;
  font-size: 12px;
  letter-spacing: 0;
  color: #819183;
  margin-top: 8px;
}
.chapter {
  display: flex;
  align-items: center;
  gap: 13px;
  text-align: left;
  background: none;
  border: 0;
  border-left: 1px solid #72897e25;
  padding: 6px 20px;
  min-width: 0;
}
.chapter-art {
  display: flex;
  flex: 0 0 49px;
  height: 60px;
  align-items: center;
  justify-content: center;
  font-family: Georgia, serif;
  font-size: 35px;
  border-radius: 25px 25px 6px 6px;
  border: 1px solid #fff8;
  box-shadow: 0 2px 6px #25474109;
}
.gardens {
  background: linear-gradient(#c8dfd3, #f3e8c9);
  color: #bd9862;
}
.thunder {
  background: linear-gradient(#bbc6d3, #e0d8d7);
  color: #637994;
}
.moon {
  background: linear-gradient(#9cabc8, #d8cfdf);
  color: #ffefb5;
}
.chapter small {
  display: block;
  font-size: 8px;
  letter-spacing: 1.6px;
  color: #87978d;
}
.chapter strong {
  display: block;
  font-family: Georgia, serif;
  font-weight: 400;
  font-size: 16px;
  white-space: nowrap;
  margin-top: 6px;
}
.chapter i {
  display: block;
  font-size: 9px;
  font-style: normal;
  color: #839187;
  margin-top: 6px;
  white-space: nowrap;
}
.chapter b {
  font-size: 15px;
  margin-left: auto;
  font-weight: 400;
  color: #82968a;
}
.title-bottom {
  position: absolute;
  bottom: 3.3%;
  left: 6.3%;
  right: 6.3%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 7px;
  letter-spacing: 1.5px;
  color: #849388;
}
.title-bottom button {
  border: 0;
  background: none;
  font-size: 10px;
  letter-spacing: 0;
}
.title-bottom button span {
  border: 1px solid #899a89;
  border-radius: 50%;
  margin-left: 5px;
  padding: 1px 5px;
}
#hud {
  position: absolute;
  left: 4%;
  right: 4%;
  top: 4%;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
}
.hud-left,
.hud-right {
  display: flex;
  align-items: center;
  gap: 20px;
}
.hud-left {
  background: #fff9ebdb;
  border: 1px solid #fff9;
  border-radius: 14px;
  padding: 9px 18px 9px 9px;
  box-shadow: 0 4px 20px #294e5012;
}
.hud-left small {
  display: block;
  font-size: 8px;
  letter-spacing: 2px;
  color: #849589;
  margin-bottom: 5px;
}
.hud-left strong {
  font:
    18px Georgia,
    serif;
}
.hud-pause {
  pointer-events: auto;
  border: 1px solid #54746128;
  background: #fff9eddb;
  width: 41px;
  height: 41px;
  border-radius: 10px;
  font-size: 20px;
}
.stat {
  background: #fff9ebdf;
  border: 1px solid #fff9;
  border-radius: 30px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 17px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 4px 20px #294e5012;
}
.stat b {
  font-size: 21px;
  line-height: 1;
}
.gold {
  color: #d4a44b;
}
.mint {
  color: #699f9e;
}
#boss-hud {
  position: absolute;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  font-size: 9px;
  letter-spacing: 2px;
  color: #fff8e5;
  text-shadow: 0 2px 8px #44375f;
}
#boss-hearts {
  font-size: 25px;
  letter-spacing: 10px;
  color: #ffd889;
  margin-top: 10px;
}
#toast {
  position: absolute;
  left: 50%;
  top: 15%;
  transform: translate(-50%, -12px);
  opacity: 0;
  transition: 0.3s;
  background: #fff9e9ee;
  border: 1px solid #fff;
  padding: 12px 23px;
  border-radius: 30px;
  font-size: 12px;
  box-shadow: 0 6px 20px #20354412;
  pointer-events: none;
  text-align: center;
  max-width: 90%;
  width: max-content;
}
#toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
#hint {
  position: absolute;
  bottom: 5%;
  left: 50%;
  transform: translateX(-50%);
  border-radius: 30px;
  background: #fffaf0e8;
  border: 1px solid #fff8;
  padding: 12px 23px;
  font-size: 12px;
  color: #42645d;
  box-shadow: 0 5px 30px #25464810;
  white-space: nowrap;
}
kbd {
  font:
    10px "Avenir Next",
    sans-serif;
  display: inline-block;
  border: 1px solid #849a8c50;
  border-bottom-width: 2px;
  padding: 2px 5px;
  border-radius: 4px;
  background: #fff9;
  margin: 0 2px;
  min-width: 21px;
  text-align: center;
}
.hidden {
  display: none !important;
}
#modal {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #1b394556;
  backdrop-filter: blur(9px);
  z-index: 5;
}
.modal-card {
  position: relative;
  background: #faf8ee;
  border: 1px solid #fff;
  border-radius: 20px;
  width: min(580px, 92vw);
  max-height: 90dvh;
  overflow: auto;
  padding: 42px;
  box-shadow: 0 25px 90px #172e4533;
  text-align: center;
}
.close-button {
  position: absolute;
  top: 12px;
  right: 17px;
  background: transparent;
  border: 0;
  font-size: 26px;
  color: #82968b;
}
.modal-kicker {
  font-size: 9px;
  letter-spacing: 3px;
  color: #8d9b85;
  margin: 5px 0 18px;
}
.modal-card h2 {
  font:
    36px Georgia,
    serif;
  font-weight: 400;
  margin: 12px 0 18px;
  color: #315450;
}
.modal-card p {
  font-size: 13px;
  color: #7b897d;
  line-height: 1.8;
}
.modal-symbol {
  font-size: 42px;
  color: #b69b58;
}
.modal-buttons {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 24px;
}
.secondary {
  border: 1px solid #55776440;
  background: #f1f2e8;
  padding: 14px 22px;
  border-radius: 8px;
  font-size: 12px;
}
.controls-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 13px;
  text-align: left;
  margin: 25px 0;
  font-size: 12px;
  color: #647f71;
}
.controls-list span {
  background: #eaf0e5;
  padding: 12px;
  border-radius: 7px;
}
.setting {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 0;
  border-bottom: 1px solid #365d4715;
  text-align: left;
  font-size: 13px;
}
.setting small {
  display: block;
  font-size: 11px;
  color: #8a9787;
  margin-top: 7px;
}
.toggle {
  border: 0;
  background: #365f58;
  color: #fff7df;
  min-width: 65px;
  border-radius: 20px;
  padding: 9px 15px;
  font-size: 11px;
}
.toggle.off {
  background: #dce2d6;
  color: #75816f;
}
.level-choice {
  display: flex;
  align-items: center;
  gap: 17px;
  width: 100%;
  text-align: left;
  border: 1px solid #708d7530;
  border-radius: 12px;
  padding: 15px;
  margin: 10px 0;
  background: #f1f3e8;
}
.level-choice:disabled {
  opacity: 0.55;
  cursor: default;
}
.level-choice strong {
  font:
    19px Georgia,
    serif;
  display: block;
}
.level-choice small {
  font-size: 11px;
  display: block;
  margin-top: 5px;
  color: #88947e;
}
.level-choice b {
  margin-left: auto;
  font-size: 20px;
  color: #b8974e;
}
.result-stats {
  display: flex;
  gap: 30px;
  justify-content: center;
  margin: 24px 0;
  color: #708775;
}
.result-stats strong {
  display: block;
  font:
    30px Georgia,
    serif;
  color: #b39753;
  margin-bottom: 6px;
}
.result-stats span {
  font-size: 10px;
  letter-spacing: 1px;
}
#touch-controls {
  position: absolute;
  bottom: 20px;
  left: 20px;
  right: 20px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  pointer-events: none;
  z-index: 2;
  user-select: none;
}
.touch-direction,
.touch-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.touch-direction > div {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
#touch-controls button {
  pointer-events: auto;
  touch-action: none;
  background: #fff8e9b0;
  border: 1px solid #fff8;
  border-radius: 15px;
  width: 50px;
  height: 48px;
  font-size: 13px;
  box-shadow: 0 3px 10px #1a344320;
}
.touch-direction > div button {
  height: 30px;
}
#touch-controls .touch-jump {
  width: 76px;
  height: 76px;
  font-size: 12px;
  border-radius: 50%;
  background: #e7f2d3d9;
}
#touch-controls small {
  font-size: 6px;
}
#rotate-note {
  display: none;
}
@media (max-width: 1000px) {
  .hero {
    top: 22%;
  }
  .hero p {
    font-size: 13px;
  }
  .hero-actions {
    gap: 16px;
  }
  .primary {
    padding: 14px 20px;
  }
  .hero-note {
    margin-top: 18px;
    font-size: 9px;
  }
  .journey {
    height: 95px;
  }
  .journey-label {
    display: none;
  }
  .journey {
    grid-template-columns: 1fr 1fr 1fr;
  }
  .chapter {
    padding: 6px 15px;
  }
  .title-bottom > span {
    font-size: 6px;
  }
  .eyebrow {
    font-size: 8px;
    letter-spacing: 2px;
  }
  .hero h1 {
    margin: 20px 0 14px;
  }
}
@media (max-height: 650px) and (min-aspect-ratio: 1.4) {
  .masthead {
    top: 4%;
  }
  .brand {
    font-size: 11px;
  }
  .brand-mark {
    font-size: 32px;
  }
  .brand-sub {
    font-size: 7px;
  }
  .hero {
    top: 21%;
  }
  .hero h1 {
    font-size: clamp(30px, 6vw, 65px);
    margin: 12px 0;
  }
  .hero p {
    font-size: 11px;
    line-height: 1.6;
    margin: 8px 0;
  }
  .hero-actions {
    margin-top: 14px;
  }
  .primary {
    padding: 11px 16px;
    font-size: 11px;
  }
  .text-button {
    font-size: 10px;
  }
  .hero-note {
    margin-top: 12px;
    font-size: 8px;
  }
  .journey {
    height: 78px;
    bottom: 7%;
  }
  .chapter-art {
    height: 45px;
    flex-basis: 36px;
    font-size: 27px;
  }
  .chapter strong {
    font-size: 14px;
  }
  .chapter i {
    display: none;
  }
  .chapter small {
    font-size: 7px;
  }
  .title-bottom {
    bottom: 2%;
  }
  .scene-caption {
    bottom: 28%;
    font-size: 7px;
  }
  .hero .eyebrow {
    font-size: 7px;
  }
  .modal-card {
    padding: 25px;
  }
  #hint {
    bottom: 7%;
    font-size: 10px;
  }
  #touch-controls:not(.hidden) ~ #rotate-note {
    display: none;
  }
}
@media (max-aspect-ratio: 1/1) {
  .hero {
    top: 18%;
    width: 90%;
    left: 8%;
  }
  .hero h1 {
    font-size: 57px;
  }
  .hero p {
    font-size: 13px;
  }
  .scene-caption {
    display: none;
  }
  .journey {
    bottom: 10%;
    height: auto;
    padding: 10px 0;
    grid-template-columns: 1fr;
    gap: 10px;
    background: #f8f7eceb;
  }
  .chapter {
    border: 0;
    padding: 3px 15px;
  }
  .chapter-art {
    height: 40px;
    flex-basis: 40px;
    font-size: 25px;
  }
  .chapter strong {
    font-size: 15px;
    margin: 3px 0;
  }
  .chapter small {
    font-size: 7px;
  }
  .chapter i {
    display: none;
  }
  .title-bottom > span {
    display: none;
  }
  .title-bottom {
    justify-content: center;
    bottom: 5%;
  }
  .hero-note {
    font-size: 8px;
  }
  .eyebrow {
    font-size: 7px;
  }
  .masthead {
    top: 4%;
  }
  .brand {
    font-size: 12px;
  }
  #hud {
    left: 3%;
    right: 3%;
    top: 3%;
  }
  .hud-left,
  .hud-right {
    gap: 6px;
  }
  .hud-left {
    padding: 7px;
  }
  .hud-left strong {
    font-size: 11px;
  }
  .hud-left small {
    font-size: 6px;
  }
  .hud-pause {
    width: 31px;
    height: 34px;
  }
  .stat {
    padding: 8px;
    font-size: 10px;
    gap: 5px;
  }
  #hint {
    bottom: 29%;
    font-size: 9px;
    white-space: normal;
    width: 90%;
    text-align: center;
  }
  #rotate-note {
    display: block;
    position: absolute;
    bottom: 18%;
    width: 100%;
    text-align: center;
    color: #6a8075;
    font-size: 10px;
    pointer-events: none;
  }
  #title-screen:not(.hidden) ~ #rotate-note {
    display: none;
  }
  .modal-card h2 {
    font-size: 30px;
  }
  .controls-list {
    gap: 8px;
    font-size: 10px;
  }
  .modal-card {
    padding: 30px 20px;
  }
}
#toast.boss-toast {
  top: 25%;
}
@media (pointer: coarse) {
  #hint {
    bottom: 135px;
  }
  #toast {
    font-size: 10px;
  }
  .hud-right .stat {
    padding: 9px 12px;
  }
}
@media (max-height: 500px) and (min-aspect-ratio: 1.4) {
  .hero p,
  .hero-note,
  .scene-caption {
    display: none;
  }
  .hero h1 {
    font-size: clamp(32px, 5.6vw, 52px);
  }
  .hero-actions {
    margin-top: 18px;
  }
  .journey {
    height: 69px;
  }
  .masthead .icon-button {
    width: 34px;
    height: 34px;
    font-size: 18px;
  }
  .brand-sub {
    letter-spacing: 3px;
  }
  #boss-hud {
    top: 60px;
  }
  #toast.boss-toast {
    top: 42%;
  }
  .hud-left strong {
    font-size: 14px;
  }
  .hud-left {
    padding: 6px 13px 6px 6px;
  }
  .hud-left,
  .hud-right {
    gap: 10px;
  }
  .hud-pause {
    width: 34px;
    height: 34px;
  }
  .stat {
    font-size: 11px;
  }
  .modal-card h2 {
    font-size: 28px;
  }
  .modal-symbol {
    font-size: 26px;
  }
  .modal-kicker {
    margin: 3px 0 12px;
  }
  .result-stats {
    margin: 15px 0;
  }
  .modal-card p {
    font-size: 11px;
  }
  .modal-buttons {
    margin-top: 16px;
  }
}
#game-shell:has(#title-screen:not(.hidden)) > canvas {
  object-fit: cover;
}
@media (pointer: coarse) and (min-aspect-ratio: 1.4) {
  #hint {
    top: 110px;
    bottom: auto;
    font-size: 9px;
    padding: 9px 15px;
    max-width: 85%;
    white-space: normal;
    text-align: center;
  }
  #toast.show ~ #hint {
    opacity: 0;
  }
}
