@import url("https://fonts.googleapis.com/css2?family=Noto+Sans+TC:wght@500;700;900&display=swap");
:root {
  font-family: "Noto Sans TC", sans-serif;
  color: #143a32;
  background: #103c36;
  font-synthesis: none;
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}
button,
input,
select {
  font: inherit;
}
button {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
button:focus-visible,
canvas:focus-visible {
  outline: 3px solid #ffe787;
  outline-offset: -4px;
}
button {
  border: 0;
}
button:active {
  transform: scale(0.97);
}
[hidden] {
  display: none !important;
}
#game {
  position: relative;
  width: 100%;
  height: 100dvh;
  overflow: hidden;
  isolation: isolate;
}
canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  outline: none;
}
#hud {
  position: absolute;
  inset: 0;
  pointer-events: none;
  padding: max(12px, env(safe-area-inset-top)) 16px
    max(16px, env(safe-area-inset-bottom));
}
header {
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: 520px;
  margin: 0 auto;
}
.brand {
  width: 124px;
  height: 48px;
  flex-shrink: 0;
  overflow: hidden;
}
.brand img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.stat {
  display: flex;
  flex-direction: column;
  padding: 3px 5px;
  color: #fff;
  text-shadow: 0 2px 8px #063d3a80;
}
.stat span {
  font-size: 12px;
  letter-spacing: 1px;
}
.stat strong {
  font-size: 27px;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}
.icon {
  margin-left: auto;
  pointer-events: auto;
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: #103e39d9;
  color: #fff;
  font-weight: 900;
  font-size: 22px;
  box-shadow: 0 4px 16px #063d3a20;
}
.route {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px auto 0;
  max-width: 520px;
  color: #fff;
  font-size: 12px;
  text-shadow: 0 1px 6px #00362e;
  font-weight: 700;
}
.track {
  height: 4px;
  border-radius: 9px;
  background: #123c3650;
  flex: 1;
  overflow: hidden;
}
.track i {
  display: block;
  height: 100%;
  width: 0;
  background: #f9e89a;
  transition: width 0.2s linear;
}
.bottom {
  position: absolute;
  bottom: max(18px, env(safe-area-inset-bottom));
  left: 20px;
  right: 20px;
  display: flex;
  justify-content: space-between;
  color: #fff;
  font-size: 12px;
  text-shadow: 0 1px 6px #153f31;
}
.bottom span {
  background: #0d3e37c4;
  padding: 8px 12px;
  border-radius: 20px;
}
#toast {
  position: absolute;
  top: 19%;
  left: 10px;
  right: 10px;
  text-align: center;
  color: white;
  font-weight: 900;
  font-size: 16px;
  text-shadow:
    0 2px 3px #174638,
    0 0 12px #174638;
  opacity: 0;
  transition: opacity 0.14s;
  pointer-events: none;
}
#toast.show {
  opacity: 1;
}
.boss-visible #toast {
  top: calc(max(12px, env(safe-area-inset-top)) + 190px);
  font-size: 14px;
}
#gesture {
  position: absolute;
  bottom: 85px;
  left: 0;
  right: 0;
  text-align: center;
  color: #fff;
  font-size: 14px;
  text-shadow: 0 2px 8px #073c30;
  transition: opacity 0.5s;
}
#boss-hud {
  max-width: 400px;
  margin: 20px auto 0;
  padding: 10px 15px;
  background: #193540dd;
  border-radius: 16px;
  color: white;
  font-size: 13px;
}
#boss-hud > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.hp {
  height: 9px;
  margin-top: 9px;
  border-radius: 6px;
  background: #081c2f;
  overflow: hidden;
}
.vitals {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 520px;
  margin: 10px auto 0;
  color: #fff;
  font-size: 13px;
  text-shadow: 0 1px 5px #07382d;
}
.vitals b {
  font: 22px/1 monospace;
  letter-spacing: 2px;
  color: #b8f0ff;
  vertical-align: middle;
}
.vitals b.critical {
  color: #ffb699;
}
.damage {
  box-shadow: inset 0 0 65px #dd5b4266;
}
#streak {
  background: #143f39a8;
  border-radius: 12px;
  padding: 4px 8px;
}
.hp i {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #ff975d, #ffdd86);
  transition: width 0.1s linear;
}
.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding: max(24px, env(safe-area-inset-top)) 24px
    max(28px, env(safe-area-inset-bottom));
  pointer-events: none;
}
.overlay button,
.overlay input,
.overlay select {
  pointer-events: auto;
}
.menu-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #fff;
  font-size: 14px;
  letter-spacing: 3px;
}
.menu-top img {
  width: 194px;
  height: 78px;
  object-fit: cover;
}
.menu-copy {
  margin-top: 4vh;
  color: #fff;
  text-shadow: 0 3px 30px #123f3240;
}
.eyebrow {
  font-family: system-ui, sans-serif;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 3px;
}
h1 {
  margin: 12px 0;
  font-size: clamp(48px, 11vw, 84px);
  line-height: 1.04;
  letter-spacing: -3px;
  font-weight: 900;
}
h1 span {
  color: #e5f38e;
  margin-left: 8px;
}
.menu-copy p {
  font-size: 16px;
  letter-spacing: 3px;
}
.service-note {
  display: flex;
  align-items: center;
  gap: 12px;
  width: min(100%, 390px);
  margin: 20px auto 0;
  padding: 9px 13px;
  border: 1px solid #d9e99a55;
  border-radius: 16px;
  background: #0e463d9c;
  color: #fff;
  box-shadow: 0 8px 24px #062f2a25;
}
.service-note img {
  width: 48px;
  height: 48px;
  border-radius: 11px;
  object-fit: cover;
}
.service-note div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.service-note strong {
  font-size: 13px;
}
.service-note span {
  font-size: 11px;
  opacity: 0.76;
  letter-spacing: 1px;
}
.menu-actions {
  margin-top: auto;
  width: 100%;
  max-width: 390px;
  align-self: center;
}
.primary,
.secondary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  min-height: 56px;
  border-radius: 18px;
  padding: 15px 23px;
  font-size: 17px;
  font-weight: 900;
}
.primary {
  background: #e8f48c;
  color: #173e31;
  box-shadow:
    0 6px 0 #77a955,
    0 12px 28px #092f3e30;
}
.secondary {
  background: #e8efe4;
  color: #204339;
  margin-top: 15px;
  justify-content: center;
}
.menu-actions p {
  font-size: 12px;
  color: #fff;
  text-align: center;
  text-shadow: 0 1px 6px #123e32;
}
.subtle {
  display: block;
  margin: 14px auto 0;
  min-height: 44px;
  background: transparent;
  color: inherit;
  font-size: 14px;
  text-decoration: underline;
  text-underline-offset: 4px;
}
.menu-actions .subtle {
  color: #fff;
}
.shade {
  pointer-events: auto;
  justify-content: center;
  align-items: center;
  background: #062e38a6;
  backdrop-filter: blur(9px);
}
.panel {
  width: 100%;
  max-width: 390px;
  max-height: 100%;
  overflow: auto;
  background: #fffcf0;
  border: 1px solid #fff;
  padding: 30px 25px;
  border-radius: 28px;
  box-shadow: 0 20px 80px #00292c45;
}
h2 {
  font-size: 26px;
  margin: 13px 0;
}
.panel p {
  font-size: 14px;
  line-height: 1.8;
  color: #607467;
  margin-bottom: 25px;
}
.panel label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 58px;
  border-bottom: 1px solid #dce5d9;
  font-size: 15px;
}
.panel input {
  width: 24px;
  height: 24px;
  accent-color: #2a7054;
}
.panel select {
  max-width: 145px;
  border: 1px solid #c7d2c3;
  border-radius: 10px;
  padding: 8px;
  background: white;
  color: #204339;
}
#loading {
  position: absolute;
  inset: 0;
  background: #103c36;
  display: grid;
  place-items: center;
  color: #eef5cf;
  font-size: 16px;
}
#diagnostics {
  position: absolute;
  bottom: 60px;
  left: 8px;
  background: #001c25d9;
  color: #bdf4c3;
  font: 11px/1.5 monospace;
  padding: 8px;
  pointer-events: none;
  white-space: pre-wrap;
  max-width: 95%;
}
@media (min-width: 700px) {
  .menu-top,
  .menu-copy {
    margin-left: max(0px, calc((100vw - 1100px) / 2));
    margin-right: max(0px, calc((100vw - 1100px) / 2));
  }
  .menu-copy {
    margin-top: 8vh;
  }
  #hud {
    padding-top: 20px;
  }
  h1 {
    font-size: 90px;
  }
  .menu-actions {
    align-self: flex-start;
    margin-left: max(0px, calc((100vw - 1100px) / 2));
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
#hud.overdrive { box-shadow: inset 0 0 70px #00dfff55; }
#hud.overdrive #streak { color: #70faff; text-shadow: 0 0 12px #00aaff; }
#streak { font-size: 14px; }
.official-link { display: flex; align-items: center; justify-content: center; min-height: 44px; margin-top: 8px; padding: 8px 12px; border-radius: 12px; background: #e5efdc; color: #164d40; font-size: 14px; font-weight: 600; text-decoration: none; }
.official-link:hover { background: #d4e6c5; }
.official-link:focus-visible { outline: 3px solid #257d68; outline-offset: 3px; }
