:root {
  --host-safe-top: 0px;
  --host-safe-right: 0px;
  --host-safe-bottom: 0px;
  --host-safe-left: 0px;
}
html,
body {
  width: 100%;
  height: 100%;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
body {
  height: 100dvh;
  display: flex;
  justify-content: center;
  background: #050710;
  padding: max(env(safe-area-inset-top), var(--host-safe-top))
    max(env(safe-area-inset-right), var(--host-safe-right))
    max(env(safe-area-inset-bottom), var(--host-safe-bottom))
    max(env(safe-area-inset-left), var(--host-safe-left));
}
#play-area {
  position: relative;
  width: 100%;
  height: 100%;
  max-width: 480px;
  overflow: hidden;
  isolation: isolate;
  background: #090a17;
}
#game,
#hud,
#overlay,
#touch-controls,
#toast {
  position: absolute;
}
#game,
#game canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
#overlay {
  padding: 16px;
}
.panel {
  width: 100%;
  max-height: calc(100% - 16px);
  padding: 26px 22px;
  border-radius: 24px;
  overscroll-behavior: contain;
  touch-action: pan-y;
}
h1 {
  font-size: clamp(31px, 9vw, 46px);
  letter-spacing: 0;
}
h2 {
  font-size: 30px;
  margin-bottom: 18px;
}
.subtitle {
  font:
    600 9px ui-monospace,
    monospace;
  letter-spacing: 3px;
  margin: 12px 0 27px;
}
.menu .menu-stats {
  margin-top: 22px;
  padding-top: 18px;
}
.mode-options {
  display: grid;
  gap: 12px;
  margin-bottom: 12px;
}
.mode-card {
  display: grid;
  grid-template-columns: 38px 1fr 14px;
  gap: 12px;
  align-items: center;
  text-align: left;
  border: 1px solid #00dfff60;
  background: linear-gradient(120deg, #00dfff16, #12334b30);
  border-radius: 18px;
  min-height: 88px;
  padding: 17px;
  color: #effdff;
}
.mode-card.level-mode {
  border-color: #b58cff60;
  background: linear-gradient(120deg, #a46cff22, #20234230);
}
.mode-icon {
  font-size: 32px;
  color: #00e5ff;
  text-align: center;
}
.level-mode .mode-icon {
  color: #c8a4ff;
}
.mode-card strong {
  display: block;
  font-size: 16px;
  letter-spacing: 1.5px;
}
.mode-card small {
  display: block;
  color: #b2b2cc;
  font-size: 11px;
  margin-top: 6px;
  line-height: 1.4;
}
.menu-links {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}
.menu-links .button {
  min-height: 46px;
  font-size: 10px;
  padding: 10px;
  letter-spacing: 1px;
}
.menu-help {
  border: 0;
  background: none;
  color: #919cb9;
  font-size: 11px;
  margin: 17px 0 0;
  padding: 10px;
}
.host-exit {
  display: block;
  border: 0;
  background: none;
  color: #a9b9cf;
  font-size: 12px;
  padding: 13px;
  width: 100%;
  margin-top: 9px;
}
.button {
  min-height: 48px;
  font-size: 12px;
  letter-spacing: 1px;
}
.compact,
.shop-panel,
.help,
.levels-panel {
  width: 100%;
  padding: 24px 20px;
}
.help p,
.help li {
  font-size: 12px;
  line-height: 1.7;
}
.level-grid {
  gap: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.level-card {
  min-height: 106px;
  padding: 12px;
}
.level-title {
  font-size: 10px;
}
.level-goal {
  font-size: 9px;
}
.level-number {
  font-size: 22px;
}
.levels-panel h2 {
  font-size: 30px;
}
.level-intro {
  font-size: 12px;
  margin-bottom: 18px;
}
.level-intro.footnote {
  display: none;
}
.back {
  margin-top: 20px;
}
.tabs {
  gap: 6px;
}
.tab {
  padding: 10px 11px;
  font-size: 9px;
}
.shop-item {
  grid-template-columns: 42px 1fr auto;
  padding: 12px 10px;
  gap: 8px;
}
.item-icon {
  width: 42px;
  height: 42px;
  font-size: 24px;
}
.item-info h3 {
  font-size: 12px;
}
.buy {
  min-height: 40px;
}
#hud {
  padding: 0;
}
.hud-left {
  left: 12px;
  top: 12px;
  gap: 6px;
}
.hud-card {
  border-radius: 12px;
  min-width: 45px;
  min-height: 58px;
  padding: 10px 8px;
}
.hud-card span {
  font-size: 7px;
  letter-spacing: 1px;
}
.hud-card strong {
  font-size: 18px;
}
.hud-card.lives-card strong {
  font-size: 15px;
  letter-spacing: -1px;
}
.best-card {
  display: none;
}
.hud-right {
  top: 12px;
  right: 12px;
  display: grid;
  grid-template-columns: auto 48px;
  grid-template-rows: 48px 19px;
  gap: 4px;
}
.hud-right .level-badge {
  font-size: 8px;
  letter-spacing: 0.4px;
  padding: 6px 8px;
}
.hud-right .theme-badge {
  font-size: 7px;
  letter-spacing: 1px;
  padding: 4px 8px;
}
.hud-right .icon-button {
  width: 48px;
  height: 48px;
  border-radius: 13px;
}
#level-objective {
  left: 12px;
  top: 88px;
  transform: none;
  padding: 10px 12px;
  width: calc(100% - 24px);
}
#objective-label {
  font-size: 9px;
}
#objective-time {
  font-size: 17px;
}
#laser-warning,
#hud:not(:has(#level-objective:not([hidden]))):not(:has(#boss:not([hidden])))
  #laser-warning {
  top: 89px;
  height: 29px;
  font-size: 9px;
  padding: 7px 12px;
}
#hud:has(#level-objective:not([hidden])) #laser-warning {
  top: 150px;
}
#boss {
  top: 90px;
  width: calc(100% - 36px);
  font-size: 10px;
}
#hud:has(#level-objective:not([hidden])) #boss {
  top: 153px;
}
#effects {
  bottom: 60px;
  max-width: calc(100% - 20px);
  gap: 5px;
  flex-wrap: wrap;
  justify-content: center;
}
.effect {
  padding: 5px 8px;
  font-size: 9px;
}
#control-label {
  bottom: 18px;
  font-size: 9px;
  letter-spacing: 0.5px;
  max-width: 95%;
  text-align: center;
  white-space: normal;
}
#touch-controls {
  bottom: 28px;
  z-index: 2;
}
#joystick {
  left: 20px;
  width: 100px;
  height: 100px;
  background: #07111e9c;
}
#tap-zones {
  padding: 0 20px;
}
#tap-zones button {
  min-height: 66px;
  background: #081525a8;
}
#hud[data-controls="joystick"] #effects,
#hud[data-controls="tap"] #effects {
  bottom: 105px;
}
#hud[data-controls="joystick"] #control-label,
#hud[data-controls="tap"] #control-label {
  display: none;
}
.result {
  padding: 25px 20px;
}
.result h2,
.level-result h2 {
  font-size: 30px;
  margin-bottom: 10px;
}
.result .eyebrow {
  font-size: 9px;
  letter-spacing: 2px;
}
.result-score {
  font-size: 64px;
  margin: 10px 0 4px;
}
.result .menu-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 20px 0;
  padding-top: 16px;
}
.result .stat span {
  font-size: 8px;
  letter-spacing: 0.6px;
}
.result .stat strong {
  font-size: 21px;
}
.result-detail {
  color: #aab6cb;
  font-size: 12px;
  line-height: 1.6;
  margin: 15px 0;
}
.victory-stars {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 15px 0 12px;
  color: #ffde59;
  font-size: 38px;
}
.victory-stars span {
  animation: star-pop 0.4s both;
}
.victory-stars span:nth-child(2) {
  animation-delay: 0.12s;
}
.victory-stars span:nth-child(3) {
  animation-delay: 0.24s;
}
.next-level {
  display: flex;
  justify-content: space-between;
  padding: 12px 14px;
  border: 1px solid #ffffff14;
  border-radius: 13px;
  color: #c9c1e7;
  font-size: 11px;
  margin-bottom: 14px;
}
.finish-meter {
  height: 4px;
  background: #ffffff12;
  border-radius: 4px;
  overflow: hidden;
  margin: 18px 0 8px;
}
.finish-meter i {
  display: block;
  height: 100%;
  background: #30dff0;
}
.count-in {
  display: grid;
  place-items: center;
  text-align: center;
  pointer-events: none;
}
.count-in strong {
  font-size: 64px;
  color: #daffff;
  text-shadow: 0 0 30px #00cfff90;
  animation: count-pop 0.65s both;
}
.count-in p {
  color: #c5c2e3;
  font-size: 12px;
  letter-spacing: 2px;
  margin-top: 18px;
}
#overlay.countdown {
  background: #080b1b55;
}
html #orientation-hint {
  background: #090c1b;
}
html #orientation-hint b {
  color: #20dcef;
}
html #orientation-hint span {
  color: #9faec5;
}
@keyframes star-pop {
  from {
    opacity: 0;
    transform: scale(0.45) rotate(-15deg);
  }
  to {
    opacity: 1;
    transform: scale(1) rotate(0);
  }
}
@keyframes count-pop {
  from {
    opacity: 0;
    transform: scale(1.25);
  }
  30% {
    opacity: 1;
  }
  to {
    opacity: 0;
    transform: scale(0.9);
  }
}
@media (min-aspect-ratio: 1/1) {
  #play-area {
    max-width: calc(100dvh * 0.62);
  }
}
@media (max-width: 360px) {
  .panel {
    padding: 22px 17px;
  }
  .hud-left {
    left: 9px;
    gap: 4px;
  }
  .hud-card {
    min-width: 41px;
    padding: 10px 6px;
  }
  .hud-card strong {
    font-size: 15px;
  }
  .hud-card.lives-card strong {
    font-size: 13px;
  }
  .hud-right {
    right: 9px;
    grid-template-columns: auto 48px;
  }
  .hud-right .level-badge {
    font-size: 7px;
    padding: 6px;
  }
  .mode-card {
    min-height: 79px;
    padding: 13px;
  }
  .mode-card strong {
    font-size: 14px;
  }
  .subtitle {
    letter-spacing: 2px;
    margin-bottom: 22px;
  }
}
@media (max-height: 650px) {
  .panel {
    padding-top: 20px;
    padding-bottom: 20px;
  }
  .menu h1 {
    font-size: 32px;
  }
  .mode-card {
    min-height: 75px;
  }
  .menu .subtitle {
    margin-bottom: 20px;
  }
  .menu-links .button {
    min-height: 42px;
  }
  .menu .menu-stats {
    margin-top: 17px;
    padding-top: 14px;
  }
  .result-score {
    font-size: 52px;
  }
  .victory-stars {
    font-size: 32px;
    margin: 10px 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .victory-stars span,
  .count-in strong {
    animation: none;
  }
}
