@charset "UTF-8";
:root {
  color-scheme: light;
  color: #294b50;
  background: #efe3c9;
  font-family: Georgia, "Times New Roman", serif;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  background: radial-gradient(ellipse at 50% 30%, #fff8e7, #e2d4b8);
}
button,
input {
  font: inherit;
}
button {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
button:focus-visible,
input:focus-visible {
  outline: 3px solid #ca7956;
  outline-offset: 3px;
}
button:disabled {
  opacity: 0.45;
  cursor: default;
}
[hidden] {
  display: none !important;
}
#game {
  width: min(100vw, calc(100dvh * 4 / 3), 1120px);
  aspect-ratio: 4/3;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  container-type: inline-size;
  box-shadow: 0 22px 100px #6756382b;
  background: #d4e6dc;
}
canvas {
  width: 100%;
  height: 100%;
  display: block;
  outline: none;
}
#screen {
  position: absolute;
  inset: 0;
  z-index: 5;
  padding: 6%;
  display: flex;
  align-items: center;
  background: linear-gradient(90deg, #f8efdcee, #f8efdcda 32%, #f8efdc08 80%);
}
#screen:empty {
  display: none;
}
.panel {
  width: 100%;
  max-height: 100%;
  overflow: auto;
  scrollbar-width: thin;
}
.eyebrow {
  font: 700 clamp(9px, 1.2cqw, 13px)/1.6 system-ui;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #9e5b40;
  margin: 0 0 15px;
}
.title {
  font-size: clamp(40px, 9.5cqw, 106px);
  line-height: 0.91;
  font-weight: 400;
  letter-spacing: -0.065em;
  margin: 0 0 19px;
  max-width: 5em;
}
.title em {
  font-style: italic;
  color: #ac603f;
}
.subtitle {
  font: clamp(12px, 1.7cqw, 19px)/1.6 Georgia;
  max-width: 290px;
  color: #586c68;
  margin: 0 0 22px;
}
.rule {
  height: 1px;
  background: #c8986a;
  width: 50px;
  margin: 23px 0;
}
.actions {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
  max-width: 570px;
}
.actions button,
.back,
.route-button {
  min-height: 44px;
  border: 1px solid #557c7866;
  background: #fff7e4b8;
  color: #315b5b;
  padding: 12px 19px;
  border-radius: 5px;
  font: 650 clamp(12px, 1.5cqw, 16px) system-ui;
  transition:
    transform 0.15s,
    background 0.15s;
}
.actions .primary {
  background: #347c7a;
  border-color: #347c7a;
  color: #fff4d8;
  box-shadow: 0 5px 18px #347c7a26;
}
.actions button:hover,
.back:hover,
.route-button:not(:disabled):hover {
  transform: translateY(-1px);
  background: #f7d5a1;
}
.actions .primary:hover {
  background: #286b69;
}
.links {
  display: flex;
  gap: 25px;
  margin-top: 19px;
}
.links button {
  background: none;
  border: 0;
  padding: 7px 0;
  color: #496863;
  font: 13px system-ui;
}
.links button:hover {
  color: #a25c3e;
}
.meta {
  font: 10px system-ui;
  color: #778577;
  margin-top: 21px;
  letter-spacing: 0.04em;
}
h2 {
  font-size: clamp(26px, 4.4cqw, 50px);
  font-weight: 400;
  letter-spacing: -0.035em;
  margin: 0 0 15px;
}
.body-copy {
  font: clamp(12px, 1.6cqw, 17px)/1.65 system-ui;
  color: #516a65;
  max-width: 580px;
}
.body-copy p {
  margin: 0 0 14px;
}
.back {
  margin-top: 17px;
  padding: 9px 17px;
}
.routes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  max-width: 600px;
}
.route-button {
  text-align: left;
  padding: 11px 13px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.route-button b {
  font-size: 24px;
  font-weight: 400;
  color: #b06a45;
}
.route-button span {
  display: block;
  font-size: 12px;
}
.route-button small {
  display: block;
  font-size: 9px;
  color: #778b76;
  margin-top: 4px;
}
.setting {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  max-width: 390px;
  margin: 22px 0;
  font: 15px system-ui;
}
.setting input[type="range"] {
  width: 180px;
  accent-color: #397c79;
}
.setting input[type="checkbox"] {
  width: 22px;
  height: 22px;
  accent-color: #397c79;
}
.result {
  display: flex;
  gap: 27px;
  margin: 22px 0 28px;
}
.result strong {
  font-size: 31px;
  font-weight: 400;
  display: block;
  color: #a3633e;
}
.result span {
  font: 10px system-ui;
  letter-spacing: 0.1em;
  color: #708374;
}
.stars {
  font-size: 32px;
  letter-spacing: 8px;
  color: #b87943;
  margin-bottom: 10px;
}
#hud {
  position: absolute;
  inset: 0 0 auto;
  z-index: 3;
  padding: 3% 4%;
  background: linear-gradient(#f4ebdbe8, #f4ebdb00);
  pointer-events: none;
}
#hud > div:first-child span {
  display: block;
  font: 9px system-ui;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #9a6946;
}
#hud strong {
  display: block;
  font-size: clamp(14px, 2.3cqw, 24px);
  font-weight: 400;
  margin-top: 4px;
}
.meters {
  position: absolute;
  right: 4%;
  top: 22%;
  display: flex;
  align-items: center;
  gap: 18px;
  font: clamp(11px, 1.6cqw, 17px) system-ui;
}
.meters button {
  pointer-events: auto;
  width: 40px;
  height: 40px;
  border: 1px solid #54797377;
  background: #faf3deaa;
  border-radius: 50%;
  color: #315e5a;
  font: 20px system-ui;
}
.progress {
  height: 3px;
  background: #5b80732c;
  margin-top: 15px;
  max-width: 240px;
  border-radius: 2px;
}
.progress i {
  display: block;
  height: 100%;
  width: 0;
  background: #418884;
  border-radius: 2px;
}
#tip {
  position: absolute;
  z-index: 2;
  bottom: 20%;
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: 85%;
  padding: 9px 15px;
  border: 1px solid #51797244;
  background: #fff6dfdd;
  border-radius: 5px;
  font: clamp(10px, 1.4cqw, 15px)/1.5 system-ui;
  text-align: center;
  color: #385d58;
}
#toast {
  position: absolute;
  z-index: 7;
  top: 20%;
  left: 50%;
  transform: translateX(-50%);
  font: 12px system-ui;
  background: #f8ecd8d9;
  border-radius: 5px;
  padding: 7px 13px;
  white-space: nowrap;
  color: #9a583a;
  pointer-events: none;
}
#toast:empty {
  display: none;
}
#brand {
  position: absolute;
  z-index: 6;
  bottom: 3%;
  left: 4%;
  right: 4%;
  font: 7px system-ui;
  letter-spacing: 0.2em;
  color: #55746d;
  pointer-events: none;
}
#brand span {
  float: right;
}
#game.playing #brand {
  display: none;
}
#touch {
  position: absolute;
  bottom: 4%;
  left: 3%;
  right: 3%;
  z-index: 3;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
  touch-action: none;
  user-select: none;
}
#touch > div {
  display: flex;
  gap: 8px;
}
#touch button {
  pointer-events: auto;
  min-height: 44px;
  min-width: 44px;
  width: 58px;
  height: 58px;
  border-radius: 15px;
  border: 1px solid #456b6088;
  background: #fff3d87d;
  color: #2c5f58;
  font: 26px system-ui;
  touch-action: none;
  user-select: none;
}
#touch button small {
  display: block;
  font: 7px system-ui;
}
#touch button.down {
  background: #3a8079c4;
  color: #fff3db;
  border-color: #3a8079;
}
#touch button[data-action="gas"] {
  width: 78px;
  background: #3b807997;
  color: #fff9e8;
}
@media (max-width: 550px) {
  #game {
    width: 100vw;
    min-height: 0;
  }
  #screen {
    padding: 5%;
  }
  .eyebrow {
    margin-bottom: 8px;
  }
  .title {
    margin-bottom: 12px;
  }
  .subtitle {
    margin-bottom: 14px;
    max-width: 230px;
  }
  .rule {
    margin: 12px 0;
  }
  .actions button {
    padding: 10px 13px;
  }
  .links {
    margin-top: 10px;
    gap: 20px;
  }
  .links button {
    font-size: 11px;
  }
  .meta {
    font-size: 8px;
    margin-top: 12px;
  }
  .routes {
    gap: 5px;
  }
  .route-button {
    padding: 6px;
    gap: 7px;
  }
  .route-button b {
    font-size: 18px;
  }
  .route-button span {
    font-size: 10px;
  }
  .route-button small {
    font-size: 8px;
  }
  .setting {
    font-size: 12px;
    margin: 14px 0;
  }
  .setting input[type="range"] {
    width: 130px;
  }
  .meters {
    gap: 9px;
  }
  .meters button {
    width: 34px;
    height: 34px;
  }
  #touch {
    left: 2%;
    right: 2%;
    bottom: 3%;
  }
  #touch button {
    width: 45px;
    height: 45px;
    font-size: 22px;
    border-radius: 12px;
  }
  #touch button[data-action="gas"] {
    width: 56px;
  }
  #touch > div {
    gap: 5px;
  }
  #tip {
    bottom: 24%;
  }
  .result {
    gap: 20px;
    margin: 14px 0 18px;
  }
  .result strong {
    font-size: 24px;
  }
  #brand span {
    display: none;
  }
  .stars {
    font-size: 23px;
    margin-bottom: 6px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
@media (max-width: 550px) {
  #screen {
    padding: 4%;
  }
  .title {
    font-size: 36px;
    line-height: 0.9;
    margin-bottom: 8px;
  }
  .eyebrow {
    font-size: 8px;
    margin-bottom: 6px;
  }
  .rule {
    display: none;
  }
  .subtitle {
    font-size: 11px;
    line-height: 1.35;
    margin-bottom: 8px;
  }
  .meta {
    display: none;
  }
  .links {
    margin-top: 4px;
    gap: 22px;
  }
  .links button {
    min-height: 44px;
    padding: 8px 0;
  }
  .actions {
    gap: 7px;
  }
  .actions button {
    font-size: 11px;
    min-height: 44px;
    padding: 9px 12px;
  }
}
@media (max-width: 550px) {
  .result {
    margin: 9px 0 12px;
    gap: 20px;
  }
  .result strong {
    font-size: 22px;
  }
  .result span {
    font-size: 8px;
  }
  .stars {
    font-size: 20px;
    margin-bottom: 5px;
  }
  .panel h2 {
    font-size: 23px;
    margin-bottom: 10px;
  }
}
#tip { top: 24%; bottom: auto; }
@media (max-width: 350px) {
  #screen { padding: 3%; }
  .title { font-size: 30px; }
  .eyebrow { font-size: 7px; }
  .subtitle { font-size: 10px; line-height: 1.3; }
  .links { margin-top: 0; gap: 18px; }
  .links button { font-size: 10px; }
  .actions button { font-size: 10px; padding: 8px 10px; }
  .panel h2 { font-size: 20px; }
  .result { gap: 15px; }
  .result strong { font-size: 20px; }
}

.quote {
  font: italic clamp(12px, 1.7cqw, 18px)/1.6 Georgia;
  color: #586c68;
  max-width: 330px;
}
