:root {
  font-family: ui-rounded, 'Trebuchet MS', system-ui, sans-serif;
  color: #fff7ff;
  background: #19264e;
  font-synthesis: none;
  color-scheme: dark;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-height: 100dvh;
  background: radial-gradient(ellipse at 50% 0, #50558c 0, transparent 65%), #19264e;
}
button,
a,
input {
  -webkit-tap-highlight-color: transparent;
}
button {
  font: inherit;
  font-weight: 700;
  color: inherit;
  background: #344476;
  border: 1px solid #ffffff29;
  border-radius: 12px;
  padding: 10px 18px;
  min-height: 44px;
  cursor: pointer;
  touch-action: manipulation;
}
button:hover {
  filter: brightness(1.13);
}
button:disabled {
  opacity: 0.55;
  cursor: wait;
}
button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 3px solid #ffe18c;
  outline-offset: 4px;
}
a {
  color: inherit;
  text-decoration: none;
}
#app {
  max-width: 1280px;
  margin: auto;
  padding: 0 36px;
}
.topbar {
  height: 84px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  font-size: 14px;
  letter-spacing: 2px;
}
.back {
  font-weight: bold;
  letter-spacing: 0;
  font-size: 18px;
}
.version {
  color: #d0d5f0;
  letter-spacing: 0;
}
.game-shell {
  overflow: hidden;
  border: 1px solid #ffffff26;
  border-radius: 20px;
  background: #1b294e;
  box-shadow: 0 20px 90px #090f3050;
}
.toolbar {
  height: 64px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}
.identity {
  display: flex;
  align-items: center;
  gap: 15px;
}
.identity strong {
  color: #ffacd3;
  letter-spacing: 2px;
  font-size: 22px;
}
.identity span {
  font-size: 14px;
  color: #d2d9f3;
}
.toolbar p {
  font-size: 14px;
  color: #d2d9f3;
}
.toolbar-actions {
  display: flex;
  gap: 8px;
}
.toolbar-actions button {
  padding: 8px 15px;
  font-size: 14px;
}
.stage-wrap {
  position: relative;
  margin: auto;
  aspect-ratio: 16/9;
  width: 100%;
  overflow: hidden;
  background: #8fd5f2;
}
canvas {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  touch-action: none;
}
.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #16245330;
  padding: 16px;
}
.menu-card {
  text-align: center;
  color: #323565;
  background: #fff9f3f5;
  border: 3px solid #fff;
  border-radius: 28px;
  padding: 30px 48px;
  box-shadow: 0 12px 0 #6a4b7720;
  max-width: 94%;
  max-height: 100%;
  overflow: auto;
}
.eyebrow {
  font-size: 12px;
  letter-spacing: 2px;
  font-weight: 800;
  color: #717197;
}
h1 {
  font-size: 90px;
  letter-spacing: -5px;
  color: #f36f9f;
  line-height: 1;
  margin: 12px 0 20px;
  text-shadow: 0 4px 0 #ffd7e8;
  -webkit-text-stroke: 2px #d45188;
}
h1 span {
  display: block;
  letter-spacing: 3px;
  font-size: 16px;
  margin-top: 12px;
  color: #5d5b8c;
  text-shadow: none;
  -webkit-text-stroke: 0;
}
.menu-card p {
  font-size: 16px;
  line-height: 1.6;
}
.primary {
  display: block;
  margin: 18px auto 0;
  border: 0;
  border-bottom: 4px solid #ba3871;
  background: #ed669e;
  color: white;
  font-size: 18px;
  min-width: 215px;
  padding: 13px 24px;
}
.menu-note {
  display: block;
  margin-top: 16px;
  font-size: 13px;
  color: #74718f;
}
.controls {
  min-height: 76px;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.movement,
.actions {
  display: flex;
  gap: 8px;
}
.controls button {
  padding: 10px 14px;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
.controls button.held {
  background: #ac5187;
  transform: translateY(2px);
}
.jump {
  background: #d85994;
  border-color: #fa90bb;
}
.keyboard-help {
  font-size: 13px;
  line-height: 2.3;
  color: #c6cde5;
  margin: 0;
  text-align: center;
}
.keyboard-help span {
  margin: 0 4px;
}
kbd {
  font-family: inherit;
  border: 1px solid #ffffff30;
  border-radius: 4px;
  padding: 2px 5px;
  background: #ffffff0a;
}
footer {
  text-align: center;
  color: #b7bfdc;
  font-size: 14px;
  line-height: 1.5;
  padding: 22px;
}
.pause-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #fff9f5;
  color: #343458;
  text-align: center;
  padding: 28px 40px;
  border-radius: 24px;
  max-height: 100%;
  overflow: auto;
}
.pause-card h2 {
  font-size: 32px;
  margin: 8px 0 0;
}
.pause-card p {
  margin: 4px;
}
.pause-card .primary {
  margin: 12px 0 4px;
}
.pause-card button:not(.primary) {
  background: #eeebf6;
  color: #454569;
  border-color: #d9d4e9;
}
.import-label {
  display: block;
  margin-top: 14px;
  background: #eeebf6;
  border-radius: 10px;
  padding: 10px;
  cursor: pointer;
  font-size: 14px;
}
.import-label input {
  display: block;
  max-width: 270px;
  margin: 8px auto 0;
  color: #383760;
  font-size: 14px;
}
#asset-message {
  font-size: 14px;
  max-width: 390px;
  margin: 12px auto 0;
  line-height: 1.4;
  color: #7c4962;
}
#asset-message:empty {
  display: none;
}
[hidden] {
  display: none !important;
}
.play-mode {
  overflow: hidden;
}
.play-mode #app {
  max-width: none;
  width: 100%;
  height: 100dvh;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom)
    env(safe-area-inset-left);
}
.play-mode .topbar,
.play-mode footer {
  display: none;
}
.play-mode .game-shell {
  height: 100%;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.play-mode .toolbar,
.play-mode .controls {
  width: 100%;
  flex-shrink: 0;
}
.play-mode .stage-wrap {
  width: min(
    100%,
    calc((100dvh - 140px - env(safe-area-inset-top) - env(safe-area-inset-bottom)) * 16 / 9)
  );
  flex-shrink: 0;
  margin: auto;
}
.play-mode .controls {
  height: 76px;
}
.play-mode .toolbar {
  height: 64px;
}
#orientation {
  position: fixed;
  inset: 0;
  z-index: 10;
  background: #24345e;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 32px;
}
#orientation h2 {
  font-size: 27px;
}
#orientation p {
  max-width: 320px;
  line-height: 1.6;
  color: #cbd4f2;
}
#orientation a {
  margin-top: 24px;
  border-bottom: 1px solid #ff9bc8;
  padding: 10px;
}
.rotate-icon {
  font-size: 90px;
  color: #ff9bc8;
  transform: rotate(90deg);
}
@media (max-width: 1150px) {
  .keyboard-help {
    display: none;
  }
}
@media (max-height: 600px) and (orientation: landscape) {
  #app {
    padding: 0 16px;
  }
  .topbar {
    height: 46px;
  }
  .topbar > span {
    display: none;
  }
  footer {
    display: none;
  }
  .toolbar {
    height: 48px;
    padding: 0 14px;
  }
  .controls {
    min-height: 58px;
    padding: 6px 12px;
  }
  .controls button {
    font-size: 14px;
    padding: 7px 12px;
  }
  .game-shell {
    border-radius: 12px;
  }
  .stage-wrap {
    width: min(100%, calc((100dvh - 160px) * 16 / 9));
  }
  .menu-card {
    padding: 14px 26px;
  }
  .eyebrow {
    font-size: 11px;
  }
  h1 {
    font-size: 52px;
    margin: 8px 0 12px;
  }
  h1 span {
    font-size: 14px;
    margin-top: 7px;
  }
  .menu-card p {
    font-size: 14px;
    margin: 8px 0;
  }
  .menu-note {
    margin-top: 8px;
  }
  .primary {
    margin-top: 8px;
    padding: 8px 20px;
    min-height: 44px;
    font-size: 16px;
  }
  .play-mode .toolbar {
    height: 48px;
  }
  .play-mode .controls {
    height: 58px;
  }
  .play-mode .stage-wrap {
    width: min(
      100%,
      calc((100dvh - 106px - env(safe-area-inset-top) - env(safe-area-inset-bottom)) * 16 / 9)
    );
  }
  .pause-card {
    padding: 12px 30px;
    gap: 4px;
  }
  .pause-card .eyebrow,
  .pause-card p {
    display: none;
  }
  .pause-card h2 {
    font-size: 23px;
    margin: 0;
  }
  .toolbar p {
    display: none;
  }
  .pause-card button {
    min-height: 40px;
    padding: 7px 14px;
  }
}
@media (max-width: 600px) {
  .controls {
    gap: 6px;
  }
  .movement,
  .actions {
    gap: 4px;
  }
  .controls button {
    padding: 7px 9px;
  }
  .identity {
    gap: 8px;
  }
}

@media (max-height: 600px) and (orientation: landscape) {
  .menu-card .eyebrow,
  .menu-card > p,
  .menu-card .menu-note,
  .menu-card h1 span {
    display: none;
  }
  .menu-card h1 {
    font-size: 38px;
    margin: 0 0 8px;
  }
  .menu-card {
    padding: 10px 18px;
  }
  .menu-card:has(#import-label:not([hidden])) #start {
    display: none;
  }
  #asset-message {
    margin-top: 6px;
    font-size: 13px;
  }
  .import-label {
    margin-top: 7px;
    padding: 6px;
    font-size: 13px;
  }
  .import-label input {
    margin-top: 4px;
  }
}
