:root {
  --app-height: 100svh;
  --night: #050d20;
  --night-2: #081936;
  --panel: rgba(7, 23, 52, 0.82);
  --panel-strong: rgba(5, 16, 39, 0.94);
  --line: rgba(162, 231, 255, 0.2);
  --line-strong: rgba(153, 237, 255, 0.46);
  --cyan: #6fe9ff;
  --cyan-2: #39bde9;
  --pink: #ff9fc8;
  --pink-hot: #ff5f9f;
  --lavender: #ad9bff;
  --gold: #ffe19a;
  --ice: #edfaff;
  --muted: rgba(218, 243, 255, 0.58);
  --danger: #ff6f9f;
  --shadow: 0 28px 86px rgba(0, 5, 24, 0.54);
  color-scheme: dark;
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  min-height: 100%;
  margin: 0;
}

body {
  overflow: hidden;
  color: var(--ice);
  background:
    radial-gradient(circle at 8% 0%, rgba(255, 117, 176, 0.18), transparent 30%),
    radial-gradient(circle at 96% 100%, rgba(66, 212, 255, 0.18), transparent 34%),
    linear-gradient(145deg, #030817, #07152e 52%, #0a1937);
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

button,
input {
  color: inherit;
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  touch-action: manipulation;
}

input,
textarea,
select,
[contenteditable="true"] {
  user-select: text;
  -webkit-user-select: text;
  -webkit-touch-callout: default;
}

button:focus-visible,
a:focus-visible,
input:focus-visible + i {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

a {
  color: inherit;
}

.is-hidden {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

.boot-screen {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  background:
    radial-gradient(circle, rgba(57, 196, 239, 0.12), transparent 30%),
    #040c1d;
  transition: opacity 420ms ease, visibility 420ms ease;
}

.boot-screen.is-complete {
  opacity: 0;
  visibility: hidden;
}

.boot-mark {
  position: relative;
  width: 64px;
  height: 64px;
  margin-bottom: 24px;
  transform: rotate(45deg);
  border: 1px solid rgba(144, 235, 255, 0.64);
  background: linear-gradient(135deg, rgba(100, 231, 255, 0.12), rgba(255, 121, 179, 0.22));
  box-shadow: 0 0 44px rgba(82, 220, 255, 0.2), inset 0 0 24px rgba(100, 229, 255, 0.1);
  animation: boot-spin 3.4s linear infinite;
}

.boot-mark::before,
.boot-mark::after {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(255, 255, 255, 0.76);
}

.boot-mark::after {
  inset: 25px;
  background: #fff;
  box-shadow: 0 0 16px var(--cyan);
}

.boot-mark i {
  position: absolute;
  inset: -8px;
  border: 1px dashed rgba(255, 162, 202, 0.44);
}

.boot-screen p {
  margin: 0 0 18px;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.18em;
}

.boot-track {
  width: 240px;
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(144, 230, 255, 0.12);
}

.boot-track span {
  display: block;
  width: 18%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--cyan), var(--pink));
  box-shadow: 0 0 15px var(--cyan);
  transition: width 260ms ease;
}

.boot-screen small {
  margin-top: 12px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.1em;
}

.app-shell {
  width: 100vw;
  height: var(--app-height, 100svh);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
  padding:
    max(12px, env(safe-area-inset-top))
    max(14px, env(safe-area-inset-right))
    max(12px, env(safe-area-inset-bottom))
    max(14px, env(safe-area-inset-left));
  transition: opacity 320ms ease;
}

.app-shell.is-loading {
  opacity: 0;
}

.app-header {
  position: relative;
  z-index: 20;
  width: min(1540px, 100%);
  min-height: 50px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 0;
  background: transparent;
  text-align: left;
}

.brand-gem {
  position: relative;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  transform: rotate(45deg);
  border: 1px solid rgba(139, 231, 255, 0.72);
  background: linear-gradient(135deg, rgba(110, 235, 255, 0.14), rgba(255, 135, 188, 0.24));
  box-shadow: inset 0 0 14px rgba(91, 226, 255, 0.18), 0 0 22px rgba(86, 220, 255, 0.13);
}

.brand-gem::before,
.brand-gem::after {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(255, 255, 255, 0.78);
}

.brand-gem::after {
  inset: 14px;
  background: #fff;
  box-shadow: 0 0 10px var(--cyan);
}

.brand small {
  display: block;
  margin-bottom: 2px;
  color: rgba(205, 239, 255, 0.46);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.2em;
}

.brand strong {
  display: block;
  font-size: 15px;
  letter-spacing: 0.08em;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.account-pill {
  min-width: 132px;
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 13px;
  border: 1px solid rgba(153, 237, 255, 0.24);
  border-radius: 999px;
  background: rgba(6, 21, 48, 0.78);
  text-align: left;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.06);
}

.account-pill:hover,
.account-pill.is-authenticated {
  border-color: rgba(111, 233, 255, 0.55);
  background: rgba(11, 42, 75, 0.9);
}

.account-status-dot {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #7d8da8;
  box-shadow: 0 0 8px rgba(125, 141, 168, 0.6);
}

.account-pill.is-authenticated .account-status-dot {
  background: #7cf7d1;
  box-shadow: 0 0 12px rgba(124, 247, 209, 0.8);
}

.account-pill.is-unavailable .account-status-dot {
  background: #ffd49a;
  box-shadow: 0 0 10px rgba(255, 212, 154, 0.5);
}

.account-pill small,
.account-pill strong {
  display: block;
  line-height: 1.15;
}

.account-pill small {
  color: var(--muted);
  font-size: 8px;
  letter-spacing: 0.08em;
}

.account-pill strong {
  max-width: 112px;
  overflow: hidden;
  margin-top: 3px;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.currency-pill {
  min-width: 112px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(6, 21, 48, 0.7);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(14px);
}

.currency-icon {
  color: var(--gold);
  text-shadow: 0 0 12px rgba(255, 224, 145, 0.62);
}

.currency-pill strong {
  min-width: 42px;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.round-button,
.hud-button {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(6, 21, 48, 0.7);
  backdrop-filter: blur(14px);
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.round-button:hover,
.hud-button:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
  background: rgba(24, 58, 94, 0.8);
}

.round-button svg,
.hud-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.screen {
  width: 100%;
  height: 100%;
  min-height: 0;
  display: none;
  place-items: center;
}

.orientation-guard {
  position: fixed;
  z-index: 120;
  inset: 0;
  display: none;
  place-content: center;
  justify-items: center;
  gap: 10px;
  padding: max(24px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left));
  background:
    radial-gradient(circle at 50% 40%, rgba(84, 218, 255, 0.16), transparent 32%),
    rgba(3, 10, 27, 0.97);
  text-align: center;
}

.orientation-guard strong {
  font-size: 18px;
  letter-spacing: 0.06em;
}

.orientation-guard small {
  color: var(--muted);
  font-size: 11px;
}

.orientation-device {
  position: relative;
  width: 62px;
  height: 92px;
  margin-bottom: 10px;
  border: 2px solid rgba(150, 237, 255, 0.76);
  border-radius: 13px;
  box-shadow: 0 0 28px rgba(74, 218, 255, 0.18), inset 0 0 22px rgba(75, 208, 255, 0.07);
  animation: orientation-turn 1.8s ease-in-out infinite;
}

.orientation-device::before {
  content: "";
  position: absolute;
  top: 6px;
  left: 50%;
  width: 17px;
  height: 2px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: rgba(219, 247, 255, 0.66);
}

.orientation-device i {
  position: absolute;
  inset: 15px 7px 8px;
  border-radius: 7px;
  background: linear-gradient(145deg, rgba(67, 202, 241, 0.18), rgba(170, 130, 255, 0.2));
}

@keyframes orientation-turn {
  0%, 24% { transform: rotate(0deg); }
  58%, 100% { transform: rotate(90deg); }
}

.screen.is-active {
  display: grid;
}

.lobby-surface {
  position: relative;
  width: min(1540px, 100%);
  max-height: 100%;
  aspect-ratio: 16 / 8.8;
  display: grid;
  grid-template-columns: 142px minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) auto;
  overflow: hidden;
  border: 1px solid rgba(141, 226, 255, 0.3);
  border-radius: clamp(20px, 2.2vw, 32px);
  background:
    linear-gradient(90deg, rgba(5, 18, 43, 0.97), rgba(6, 21, 52, 0.82) 42%, rgba(5, 18, 43, 0.52)),
    url("../assets/backgrounds/stage-3-star-harbor.png") center / cover;
  box-shadow: var(--shadow), inset 0 1px rgba(255, 255, 255, 0.07);
}

.lobby-surface::before {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(transparent 96%, rgba(131, 227, 255, 0.06) 96%),
    linear-gradient(90deg, transparent 96%, rgba(131, 227, 255, 0.05) 96%);
  background-size: 48px 48px;
  mask-image: linear-gradient(90deg, #000, transparent 82%);
}

.lobby-nav {
  position: relative;
  z-index: 2;
  min-height: 0;
  display: grid;
  align-content: center;
  gap: 7px;
  padding: 24px 14px;
  border-right: 1px solid var(--line);
  background: rgba(3, 13, 33, 0.58);
  backdrop-filter: blur(16px);
}

.nav-tab {
  position: relative;
  display: grid;
  grid-template-columns: 24px 1fr;
  align-items: center;
  gap: 7px;
  padding: 13px 10px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: rgba(217, 244, 255, 0.48);
  font-size: 12px;
  font-weight: 800;
  text-align: left;
  transition: color 160ms ease, background 160ms ease, border-color 160ms ease;
}

.nav-tab span {
  color: rgba(111, 233, 255, 0.4);
  font-size: 8px;
  letter-spacing: 0.08em;
}

.nav-tab::after {
  content: "";
  position: absolute;
  right: -15px;
  width: 2px;
  height: 0;
  background: var(--cyan);
  box-shadow: 0 0 12px var(--cyan);
  transition: height 180ms ease;
}

.nav-tab:hover,
.nav-tab.is-active {
  border-color: rgba(137, 230, 255, 0.16);
  background: rgba(92, 213, 248, 0.08);
  color: #fff;
}

.nav-tab.is-active::after {
  height: 24px;
}

.lobby-content {
  position: relative;
  z-index: 1;
  min-width: 0;
  min-height: 0;
}

.lobby-panel {
  position: absolute;
  inset: 0;
  display: none;
  min-width: 0;
  min-height: 0;
  padding: clamp(28px, 4vw, 64px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(106, 227, 255, 0.3) transparent;
}

.lobby-panel.is-active {
  display: block;
  animation: panel-in 260ms ease both;
}

.home-panel.is-active {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(360px, 0.84fr);
  align-items: center;
  gap: clamp(26px, 5vw, 82px);
  overflow: hidden;
}

.home-copy {
  position: relative;
  z-index: 2;
  max-width: 690px;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  color: var(--cyan);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.22em;
}

.eyebrow span {
  width: 34px;
  height: 1px;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
}

.home-copy h1 {
  margin: 0;
  font-size: clamp(38px, 4.6vw, 72px);
  font-weight: 900;
  letter-spacing: -0.065em;
  line-height: 1.04;
  text-shadow: 0 8px 32px rgba(0, 7, 28, 0.48);
}

.home-copy h1 em {
  color: transparent;
  font-style: normal;
  -webkit-text-stroke: 1px rgba(161, 238, 255, 0.78);
  text-shadow: 0 0 25px rgba(70, 218, 255, 0.12);
}

.lead {
  max-width: 620px;
  margin: 20px 0 0;
  color: rgba(222, 245, 255, 0.63);
  font-size: clamp(11px, 1.1vw, 14px);
  line-height: 1.8;
}

.mode-switch {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 24px;
}

.mode-option {
  position: relative;
  min-width: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(4, 19, 47, 0.58);
  text-align: left;
  backdrop-filter: blur(10px);
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.mode-option:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
}

.mode-option.is-active {
  border-color: rgba(112, 236, 255, 0.66);
  background: linear-gradient(135deg, rgba(38, 138, 189, 0.26), rgba(255, 108, 171, 0.1));
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.08), 0 0 22px rgba(70, 209, 248, 0.08);
}

.mode-number {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(154, 236, 255, 0.25);
  border-radius: 10px;
  color: var(--cyan);
  font-size: 11px;
  font-weight: 900;
}

.mode-option strong,
.mode-option small {
  display: block;
}

.mode-option strong {
  margin-bottom: 3px;
  font-size: 12px;
}

.mode-option small {
  overflow: hidden;
  color: rgba(212, 241, 255, 0.48);
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mode-option i {
  position: absolute;
  right: 8px;
  top: 7px;
  padding: 3px 6px;
  border-radius: 999px;
  background: rgba(255, 223, 151, 0.15);
  color: var(--gold);
  font-size: 7px;
  font-style: normal;
  font-weight: 900;
}

.character-selector {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 6px;
  min-width: 0;
}

.character-option {
  position: relative;
  min-width: 0;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  padding: 4px 7px 4px 3px;
  overflow: hidden;
  border: 1px solid rgba(160, 226, 255, 0.16);
  border-radius: 9px;
  background: rgba(8, 29, 61, 0.62);
  text-align: left;
  backdrop-filter: blur(8px);
  transition: transform 150ms ease, border-color 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

.character-option:hover,
.character-option.is-active {
  transform: translateY(-2px);
  border-color: rgba(255, 221, 148, 0.7);
  background: linear-gradient(135deg, rgba(36, 166, 205, 0.2), rgba(255, 167, 110, 0.15));
  box-shadow: inset 0 0 20px rgba(255, 228, 168, 0.05), 0 0 18px rgba(76, 220, 255, 0.08);
}

.character-option:focus-visible,
.hero-cycle-button:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.character-portrait {
  width: 38px;
  height: 38px;
  display: block;
  background-position: 0 0;
  background-repeat: no-repeat;
  background-size: 200% 200%;
  filter: drop-shadow(0 0 8px rgba(111, 229, 255, 0.2));
}

.portrait-aemeath {
  background-image: url("../assets/generated/chibi-aemeath-sheet-v4.png");
}

.portrait-thunder-snowfluff {
  background-image: url("../assets/generated/chibi-thunder-snowfluff-sheet-v1.png");
}

.portrait-phoebe-jiubi {
  background-image: url("../assets/generated/chibi-phoebe-jiubi-sheet-v2.png");
}

.portrait-phronono {
  background-image: url("../assets/generated/chibi-phronono-sheet-v1.png");
}

.portrait-yuno {
  background-image: url("../assets/generated/chibi-yuno-sheet-v1.png");
}

.portrait-sigrika {
  background-image: url("../assets/generated/chibi-sigrika-orange-sheet-v2.png");
}

.character-option strong,
.character-option small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.character-option strong {
  font-size: 9px;
}

.character-option small {
  margin-top: 2px;
  color: rgba(217, 241, 255, 0.48);
  font-size: 6px;
  letter-spacing: 0.05em;
}

.character-option i {
  position: absolute;
  right: 6px;
  top: 5px;
  padding: 2px 5px;
  border-radius: 999px;
  background: rgba(255, 223, 151, 0.16);
  color: var(--gold);
  font-size: 6px;
  font-style: normal;
  font-weight: 900;
}

.boss-selector {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin-top: 10px;
  padding: 8px;
  border: 1px solid rgba(139, 218, 255, 0.22);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(4, 21, 50, 0.76), rgba(28, 22, 68, 0.58));
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.05);
}

.boss-selector.is-hidden {
  display: none;
}

.boss-option {
  position: relative;
  min-width: 0;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 7px 9px 7px 6px;
  overflow: hidden;
  border: 1px solid rgba(137, 224, 255, 0.13);
  border-radius: 11px;
  background: rgba(31, 62, 105, 0.2);
  text-align: left;
  transition: border-color 150ms ease, background 150ms ease, transform 150ms ease;
}

.boss-option:hover,
.boss-option.is-active {
  transform: translateY(-1px);
  border-color: rgba(137, 227, 255, 0.68);
  background: linear-gradient(135deg, rgba(41, 176, 220, 0.24), rgba(160, 91, 232, 0.18));
  box-shadow: inset 0 0 22px rgba(92, 221, 255, 0.08);
}

.boss-option:disabled {
  cursor: default;
  opacity: 0.88;
}

.boss-option img {
  width: 48px;
  height: 42px;
  display: block;
  border-radius: 8px;
  object-fit: contain;
  filter: drop-shadow(0 0 8px rgba(99, 229, 255, 0.24));
}

.boss-option[data-boss="aleph-one"] img {
  object-fit: contain;
  object-position: center;
  transform: scale(1.08);
  filter: saturate(1.08) contrast(1.08) drop-shadow(0 0 9px rgba(91, 229, 255, 0.42));
}

.boss-option[data-boss="crownless"] img {
  object-fit: contain;
  object-position: center 42%;
  transform: scale(0.94);
  filter: saturate(1.14) contrast(1.06) drop-shadow(0 0 9px rgba(183, 95, 255, 0.34));
}

.boss-option strong,
.boss-option small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.boss-option strong {
  font-size: 10px;
}

.boss-option small {
  margin-top: 3px;
  color: rgba(211, 241, 255, 0.48);
  font-size: 7px;
}

.boss-option i {
  position: absolute;
  right: 6px;
  top: 5px;
  padding: 2px 5px;
  border-radius: 999px;
  background: rgba(184, 126, 255, 0.2);
  color: #d8b7ff;
  font-size: 6px;
  font-style: normal;
  font-weight: 900;
}

.boss-selector > p {
  grid-column: 1 / -1;
  margin: -1px 0 0;
  color: rgba(211, 241, 255, 0.54);
  font-size: 7px;
  text-align: center;
  letter-spacing: 0.04em;
}

.challenge-selector {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin-top: 10px;
  padding: 9px;
  border: 1px solid rgba(121, 231, 255, 0.22);
  border-radius: 14px;
  background: rgba(3, 15, 39, 0.68);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.05);
}

.challenge-selector.is-hidden {
  display: none;
}

.challenge-option {
  min-width: 0;
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  padding: 8px;
  border: 1px solid rgba(133, 226, 255, 0.13);
  border-radius: 10px;
  background: rgba(29, 67, 104, 0.2);
  text-align: left;
  transition: border-color 150ms ease, background 150ms ease, transform 150ms ease;
}

.challenge-option:hover,
.challenge-option.is-active {
  transform: translateY(-1px);
  border-color: rgba(119, 237, 255, 0.62);
  background: linear-gradient(135deg, rgba(50, 173, 219, 0.24), rgba(255, 112, 174, 0.09));
}

.challenge-option b {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(102, 229, 255, 0.1);
  color: var(--cyan);
  font-size: 12px;
}

.challenge-option strong,
.challenge-option small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.challenge-option strong {
  font-size: 9px;
}

.challenge-option small {
  margin-top: 2px;
  color: rgba(211, 241, 255, 0.48);
  font-size: 7px;
}

.challenge-selector > p {
  grid-column: 1 / -1;
  margin: 0;
  color: rgba(211, 241, 255, 0.54);
  font-size: 8px;
  text-align: center;
  letter-spacing: 0.04em;
}

.home-panel.is-challenge .route-strip {
  display: none;
}

.difficulty-debug {
  display: grid;
  grid-template-columns: minmax(118px, 1fr) repeat(2, minmax(104px, 0.72fr));
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 215, 137, 0.22);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(23, 31, 67, 0.74), rgba(56, 28, 70, 0.56));
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.05);
}

.difficulty-debug-copy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.difficulty-debug-copy span,
.difficulty-debug label span {
  display: block;
}

.difficulty-debug-copy small {
  display: block;
  color: rgba(255, 217, 145, 0.62);
  font-size: 6px;
  font-weight: 900;
  letter-spacing: 0.15em;
}

.difficulty-debug-copy strong {
  display: block;
  margin-top: 2px;
  font-size: 10px;
}

.difficulty-debug-copy em {
  color: rgba(218, 240, 255, 0.42);
  font-size: 6px;
  font-style: normal;
  white-space: nowrap;
}

.difficulty-debug label {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 7px;
  color: rgba(222, 244, 255, 0.62);
  font-size: 7px;
  font-weight: 800;
}

.difficulty-debug select {
  min-width: 64px;
  padding: 5px 22px 5px 8px;
  border: 1px solid rgba(129, 229, 255, 0.25);
  border-radius: 8px;
  background: #091a3a;
  color: #e8f9ff;
  font: 900 8px system-ui, sans-serif;
}

.difficulty-debug > p {
  grid-column: 1 / -1;
  margin: -2px 0 0;
  color: rgba(255, 224, 164, 0.7);
  font-size: 7px;
  text-align: center;
  letter-spacing: 0.04em;
}

.launch-row {
  display: flex;
  align-items: stretch;
  gap: 12px;
  margin-top: 16px;
}

.launch-button,
.primary-button {
  position: relative;
  min-width: 216px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 15px 14px 20px;
  overflow: hidden;
  border: 1px solid rgba(170, 243, 255, 0.94);
  border-radius: 12px;
  background: linear-gradient(135deg, #30bce4, #378ed4 62%, #8276dd);
  box-shadow: 0 15px 38px rgba(42, 174, 221, 0.25), inset 0 1px rgba(255, 255, 255, 0.42);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.05em;
  transition: transform 160ms ease, filter 160ms ease;
}

.launch-button::before,
.primary-button::before {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-125%) skewX(-18deg);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.36), transparent);
  transition: transform 520ms ease;
}

.launch-button:hover,
.primary-button:hover {
  transform: translateY(-2px);
  filter: brightness(1.08);
}

.launch-button:hover::before,
.primary-button:hover::before {
  transform: translateX(125%) skewX(-18deg);
}

.launch-button i {
  color: rgba(237, 252, 255, 0.62);
  font-size: 8px;
  font-style: normal;
  letter-spacing: 0.12em;
}

.launch-button b,
.primary-button span {
  position: relative;
  z-index: 1;
}

.launch-button b {
  width: 29px;
  height: 29px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(3, 25, 55, 0.28);
}

.best-chip {
  min-width: 122px;
  display: grid;
  align-content: center;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(4, 18, 45, 0.58);
  backdrop-filter: blur(10px);
}

.best-chip span {
  color: rgba(207, 238, 255, 0.44);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.best-chip strong {
  margin-top: 3px;
  color: var(--gold);
  font-size: 17px;
  font-variant-numeric: tabular-nums;
}

.route-strip {
  display: grid;
  grid-template-columns: auto 1fr auto 1fr auto 1fr auto;
  align-items: center;
  gap: 7px;
  margin-top: 18px;
}

.route-strip > i {
  height: 1px;
  background: linear-gradient(90deg, rgba(102, 232, 255, 0.62), rgba(102, 232, 255, 0.08));
}

.route-stop {
  display: grid;
  justify-items: center;
  gap: 4px;
}

.route-stop b {
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(146, 233, 255, 0.24);
  border-radius: 50%;
  background: rgba(6, 25, 57, 0.72);
  color: rgba(219, 246, 255, 0.58);
  font-size: 8px;
}

.route-stop span {
  color: rgba(212, 241, 255, 0.38);
  font-size: 8px;
  white-space: nowrap;
}

.route-stop.is-ready b {
  border-color: var(--cyan);
  color: #fff;
  box-shadow: 0 0 15px rgba(91, 226, 255, 0.26);
}

.boss-stop b {
  color: var(--pink);
}

.home-hero {
  position: relative;
  align-self: stretch;
  min-height: 440px;
}

.hero-orbit {
  position: absolute;
  left: 50%;
  top: 48%;
  border: 1px solid rgba(118, 230, 255, 0.24);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: inset 0 0 60px rgba(92, 226, 255, 0.04);
}

.orbit-a {
  width: min(38vw, 480px);
  aspect-ratio: 1;
  background: repeating-conic-gradient(from 0deg, rgba(124, 232, 255, 0.18) 0 1deg, transparent 1deg 14deg);
  animation: orbit 28s linear infinite;
}

.orbit-b {
  width: min(30vw, 360px);
  aspect-ratio: 1;
  border-style: dashed;
  animation: orbit-reverse 19s linear infinite;
}

.chibi-hero {
  position: absolute;
  z-index: 2;
  width: min(38vw, 520px);
  aspect-ratio: 1;
  left: 50%;
  top: 46%;
  transform: translate(-50%, -50%);
  background-image: url("../assets/generated/chibi-aemeath-sheet-v4.png");
  background-size: 200% 200%;
  background-position: 0 0;
  background-repeat: no-repeat;
  filter: drop-shadow(0 26px 34px rgba(0, 9, 35, 0.62)) drop-shadow(0 0 18px rgba(79, 222, 255, 0.18));
  animation: hero-float 3.2s ease-in-out infinite;
}

.chibi-hero[data-character="phoebe-jiubi"] {
  width: min(35vw, 480px);
  top: 48%;
  background-image: url("../assets/generated/chibi-phoebe-jiubi-sheet-v2.png");
  filter: drop-shadow(0 26px 34px rgba(0, 9, 35, 0.62)) drop-shadow(0 0 22px rgba(255, 223, 151, 0.22));
}

.chibi-hero[data-character="aemeath-thunder-snowfluff"] {
  width: min(36vw, 492px);
  top: 47%;
  background-image: url("../assets/generated/chibi-thunder-snowfluff-sheet-v1.png");
  filter: drop-shadow(0 26px 34px rgba(0, 9, 35, 0.62)) drop-shadow(0 0 25px rgba(103, 226, 255, 0.28));
}

.chibi-hero[data-character="phronono"] {
  width: min(36vw, 492px);
  top: 47%;
  background-image: url("../assets/generated/chibi-phronono-sheet-v1.png");
  filter: drop-shadow(0 26px 34px rgba(0, 9, 35, 0.62)) drop-shadow(0 0 24px rgba(255, 83, 113, 0.2));
}

.chibi-hero[data-character="yuno"] {
  width: min(36vw, 492px);
  top: 47%;
  background-image: url("../assets/generated/chibi-yuno-sheet-v1.png");
  filter: drop-shadow(0 26px 34px rgba(0, 9, 35, 0.62)) drop-shadow(0 0 24px rgba(111, 204, 255, 0.24));
}

.chibi-hero[data-character="sigrika"] {
  width: min(35vw, 476px);
  top: 49%;
  background-image: url("../assets/generated/chibi-sigrika-orange-sheet-v2.png");
  filter: drop-shadow(0 26px 34px rgba(0, 9, 35, 0.62)) drop-shadow(0 0 25px rgba(255, 159, 64, 0.25));
}

.chibi-hero.is-switching {
  animation: hero-switch 240ms ease-out both;
}

.hero-cycle-button {
  position: absolute;
  z-index: 6;
  top: 39%;
  width: 42px;
  height: 76px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  place-items: center;
  padding: 6px 4px;
  border: 1px solid rgba(137, 230, 255, 0.2);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(8, 34, 70, 0.76), rgba(8, 20, 48, 0.42));
  color: rgba(229, 248, 255, 0.8);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.05), 0 8px 24px rgba(0, 9, 33, 0.28);
  backdrop-filter: blur(10px);
  transition: transform 160ms ease, border-color 160ms ease, color 160ms ease, background 160ms ease;
}

.hero-cycle-button:hover {
  border-color: rgba(255, 221, 148, 0.7);
  background: linear-gradient(180deg, rgba(24, 89, 126, 0.78), rgba(33, 27, 68, 0.62));
  color: #fff;
  transform: translateY(-2px);
}

.hero-cycle-previous {
  left: -2%;
}

.hero-cycle-next {
  right: -2%;
}

.hero-cycle-button kbd {
  min-width: 19px;
  padding: 2px 4px;
  border: 1px solid rgba(137, 230, 255, 0.2);
  border-radius: 5px;
  background: rgba(2, 14, 36, 0.6);
  color: var(--cyan);
  font-family: inherit;
  font-size: 7px;
  font-weight: 800;
  line-height: 1.25;
}

.hero-cycle-button span {
  font-size: 28px;
  font-weight: 300;
  line-height: 1;
}

.hero-cycle-button small {
  color: rgba(210, 239, 255, 0.45);
  font-size: 6px;
  white-space: nowrap;
}

.hero-character-console {
  position: absolute;
  z-index: 5;
  right: 0;
  bottom: 1%;
  left: 0;
  display: grid;
  grid-template-columns: minmax(180px, 0.95fr) minmax(170px, 1.05fr);
  align-items: end;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid rgba(139, 224, 255, 0.2);
  border-radius: 14px 4px 14px 4px;
  background: linear-gradient(115deg, rgba(4, 20, 50, 0.84), rgba(13, 36, 76, 0.72) 58%, rgba(70, 44, 86, 0.56));
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.06), 0 14px 34px rgba(0, 8, 31, 0.34);
  backdrop-filter: blur(13px);
}

.hero-character-console::before {
  content: "RESONATOR SELECT";
  position: absolute;
  top: -15px;
  left: 10px;
  color: rgba(133, 232, 255, 0.55);
  font-size: 6px;
  font-weight: 900;
  letter-spacing: 0.16em;
}

.hero-signal {
  min-width: 0;
  padding: 5px 11px 4px;
  border-left: 2px solid var(--cyan);
  background: linear-gradient(90deg, rgba(5, 20, 48, 0.72), transparent);
  text-align: right;
}

.hero-signal small,
.hero-signal strong,
.hero-signal span {
  display: block;
}

.hero-signal small {
  color: rgba(194, 239, 255, 0.44);
  font-size: 6px;
  font-weight: 900;
  letter-spacing: 0.18em;
}

.hero-signal small b {
  color: var(--gold);
  font: inherit;
  letter-spacing: 0.06em;
}

.hero-signal strong {
  margin: 2px 0;
  overflow: hidden;
  font-size: 13px;
  letter-spacing: 0.14em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hero-signal span {
  color: var(--cyan);
  font-size: 7px;
}

.hero-signal p {
  margin: 4px 0 0;
  overflow: hidden;
  color: rgba(226, 242, 255, 0.5);
  font-size: 6px;
  letter-spacing: 0.03em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lobby-footer {
  position: relative;
  z-index: 3;
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 9px 22px;
  border-top: 1px solid var(--line);
  background: rgba(3, 12, 29, 0.72);
  color: rgba(204, 238, 255, 0.34);
  font-size: 8px;
  letter-spacing: 0.08em;
}

.icp-filing-link {
  color: rgba(204, 238, 255, 0.58);
  text-decoration: none;
  white-space: nowrap;
}

.icp-filing-link:hover,
.icp-filing-link:focus-visible {
  color: var(--cyan);
  text-decoration: underline;
}

.panel-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 34px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.panel-heading h2 {
  margin: 0;
  font-size: clamp(28px, 3vw, 46px);
  letter-spacing: -0.04em;
}

.panel-heading > p {
  max-width: 460px;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
  text-align: right;
}

.upgrade-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 24px;
}

.upgrade-card {
  position: relative;
  min-height: 290px;
  display: grid;
  grid-template-rows: auto auto 1fr auto auto;
  gap: 10px;
  padding: 24px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(9, 34, 72, 0.82), rgba(5, 18, 43, 0.88));
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.05);
}

.upgrade-card::after {
  content: attr(data-icon);
  position: absolute;
  right: -10px;
  top: -28px;
  color: rgba(113, 234, 255, 0.06);
  font-size: 150px;
  font-weight: 900;
}

.upgrade-icon {
  position: relative;
  z-index: 1;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(137, 232, 255, 0.35);
  border-radius: 15px;
  background: rgba(77, 211, 248, 0.1);
  color: var(--cyan);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.06), 0 0 20px rgba(77, 217, 255, 0.08);
  font-size: 24px;
}

.upgrade-card h3 {
  position: relative;
  z-index: 1;
  margin: 5px 0 0;
  font-size: 18px;
}

.upgrade-card p {
  position: relative;
  z-index: 1;
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.7;
}

.level-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 5px;
}

.level-row i {
  height: 5px;
  border-radius: 999px;
  background: rgba(146, 229, 255, 0.1);
}

.level-row i.is-on {
  background: linear-gradient(90deg, var(--cyan), var(--pink));
  box-shadow: 0 0 10px rgba(89, 231, 255, 0.3);
}

.upgrade-buy {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 13px;
  border: 1px solid rgba(140, 235, 255, 0.32);
  border-radius: 10px;
  background: rgba(36, 139, 189, 0.18);
  font-size: 10px;
  font-weight: 900;
}

.upgrade-buy:hover:not(:disabled) {
  border-color: rgba(143, 238, 255, 0.72);
  background: rgba(42, 167, 216, 0.28);
}

.upgrade-buy:disabled {
  cursor: default;
  opacity: 0.54;
}

.upgrade-buy span {
  color: var(--gold);
}

.lab-note {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 218, 139, 0.15);
  border-radius: 12px;
  background: rgba(255, 221, 143, 0.05);
  color: rgba(236, 247, 255, 0.58);
  font-size: 10px;
}

.lab-note span {
  color: var(--gold);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.14em;
}

.mission-list {
  display: grid;
  gap: 9px;
  margin-top: 22px;
}

.mission-item {
  display: grid;
  grid-template-columns: 44px minmax(170px, 0.7fr) minmax(180px, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(5, 20, 47, 0.7);
}

.mission-index {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(140, 232, 255, 0.25);
  border-radius: 11px;
  color: var(--cyan);
  font-size: 9px;
  font-weight: 900;
}

.mission-copy strong,
.mission-copy small {
  display: block;
}

.mission-copy strong {
  margin-bottom: 3px;
  font-size: 12px;
}

.mission-copy small {
  color: var(--muted);
  font-size: 9px;
}

.mission-progress {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
}

.mission-track {
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(150, 232, 255, 0.1);
}

.mission-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--cyan-2), var(--pink));
}

.mission-progress b {
  min-width: 64px;
  color: rgba(224, 247, 255, 0.58);
  font-size: 8px;
  text-align: right;
}

.claim-button {
  min-width: 100px;
  padding: 9px 12px;
  border: 1px solid rgba(255, 221, 143, 0.26);
  border-radius: 10px;
  background: rgba(255, 221, 143, 0.08);
  color: var(--gold);
  font-size: 9px;
  font-weight: 900;
}

.claim-button.is-ready {
  border-color: rgba(255, 224, 151, 0.7);
  background: rgba(255, 218, 130, 0.17);
  box-shadow: 0 0 18px rgba(255, 221, 142, 0.08);
}

.claim-button:disabled {
  cursor: default;
  opacity: 0.45;
}

.subheading {
  margin: 22px 0 12px;
  color: rgba(225, 247, 255, 0.76);
  font-size: 11px;
  letter-spacing: 0.1em;
}

.achievement-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.achievement {
  min-height: 88px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(5, 19, 45, 0.65);
  opacity: 0.45;
}

.achievement.is-unlocked {
  border-color: rgba(255, 223, 151, 0.32);
  background: linear-gradient(145deg, rgba(255, 217, 137, 0.08), rgba(5, 19, 45, 0.72));
  opacity: 1;
}

.achievement strong,
.achievement span {
  display: block;
}

.achievement strong {
  margin-bottom: 5px;
  font-size: 10px;
}

.achievement span {
  color: var(--muted);
  font-size: 8px;
  line-height: 1.5;
}

.memory-layout {
  display: grid;
  grid-template-columns: minmax(260px, 1.35fr) minmax(210px, 0.8fr) minmax(220px, 0.8fr);
  gap: 14px;
  margin-top: 22px;
}

.memory-card {
  position: relative;
  min-height: 320px;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: #0a1a38;
  text-align: left;
}

.memory-card img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform 420ms ease, filter 420ms ease;
}

.memory-card:hover img {
  transform: scale(1.035);
  filter: brightness(1.06);
}

.memory-card > span {
  position: absolute;
  inset: auto 0 0;
  padding: 48px 18px 16px;
  background: linear-gradient(transparent, rgba(4, 13, 31, 0.9));
}

.memory-card small,
.memory-card strong {
  display: block;
}

.memory-card small {
  margin-bottom: 4px;
  color: var(--cyan);
  font-size: 7px;
  font-weight: 900;
  letter-spacing: 0.14em;
}

.memory-card strong {
  font-size: 13px;
}

.memory-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: linear-gradient(145deg, rgba(9, 35, 72, 0.78), rgba(5, 18, 43, 0.86));
}

.memory-index {
  color: var(--pink);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.16em;
}

.memory-copy blockquote {
  margin: 15px 0;
  font-size: clamp(16px, 1.8vw, 24px);
  font-weight: 900;
  line-height: 1.45;
}

.memory-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.7;
}

.memory-copy a {
  margin-top: 18px;
  color: var(--cyan);
  font-size: 9px;
  font-weight: 900;
  text-decoration: none;
}

.memory-cinema {
  display: grid;
  grid-template-columns: minmax(0, 2.15fr) minmax(230px, 0.85fr);
  gap: 16px;
  margin-top: 22px;
  align-items: stretch;
}

.memory-video-shell {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(128, 229, 255, 0.34);
  border-radius: 17px;
  background:
    radial-gradient(circle at 50% 45%, rgba(67, 144, 199, 0.16), transparent 52%),
    #020713;
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.32), inset 0 0 42px rgba(94, 220, 255, 0.05);
}

.memory-video-shell::before {
  content: "OFFICIAL ONLINE PLAYER";
  position: absolute;
  z-index: 0;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  color: rgba(171, 235, 255, 0.36);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.22em;
  white-space: nowrap;
}

.memory-video-shell iframe {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  background: transparent;
}

.memory-film-copy {
  min-height: 0;
}

.memory-film-copy small {
  display: block;
  margin-top: 13px;
  color: rgba(181, 207, 226, 0.68);
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

@media (max-width: 980px) {
  .memory-cinema {
    grid-template-columns: 1fr;
  }

  .memory-film-copy {
    min-height: 150px;
  }
}

.game-screen {
  align-items: center;
}

.game-frame {
  position: relative;
  width: min(1540px, 100%, calc((100svh - 86px) * 16 / 9));
  max-height: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  isolation: isolate;
  border: 1px solid rgba(143, 229, 255, 0.36);
  border-radius: clamp(18px, 2vw, 30px);
  background: #071935;
  box-shadow: var(--shadow), inset 0 1px rgba(255, 255, 255, 0.07);
}

.game-frame::before {
  content: "";
  position: absolute;
  z-index: 4;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  box-shadow: inset 0 0 90px rgba(0, 8, 30, 0.35);
}

.game-frame::after {
  content: "";
  position: absolute;
  z-index: 5;
  inset: 0;
  pointer-events: none;
  opacity: 0.08;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 140 140' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.42'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
}

.game-fullscreen-button {
  position: absolute;
  z-index: 11;
  top: 70px;
  right: 14px;
  width: 36px;
  height: 36px;
  display: none;
  place-items: center;
  border: 1px solid rgba(143, 229, 255, 0.32);
  border-radius: 10px;
  background: rgba(5, 23, 52, 0.8);
  box-shadow: 0 8px 22px rgba(0, 7, 28, 0.28);
  backdrop-filter: blur(10px);
}

.game-fullscreen-button svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.game-fullscreen-button.is-active {
  border-color: rgba(255, 225, 154, 0.68);
  color: var(--gold);
}

canvas {
  position: absolute;
  z-index: 1;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

.webgl-vfx-layer {
  z-index: 2;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  opacity: 0;
  transition: opacity 90ms linear;
}

.webgl-vfx-layer.is-active {
  opacity: 1;
}

.game-hud {
  position: absolute;
  z-index: 8;
  inset: 0 0 auto;
  display: grid;
  grid-template-columns: 1fr minmax(320px, 0.9fr) 1fr;
  align-items: start;
  gap: 14px;
  padding: clamp(14px, 1.8vw, 22px);
  pointer-events: none;
}

.hud-left,
.hud-right {
  display: flex;
  align-items: stretch;
  gap: 7px;
}

.hud-right {
  justify-content: flex-end;
}

.score-block,
.distance-block,
.combo-block,
.life-block,
.shield-block,
.stage-progress,
.hud-button {
  border: 1px solid var(--line);
  background: linear-gradient(145deg, rgba(4, 17, 43, 0.76), rgba(11, 40, 77, 0.58));
  backdrop-filter: blur(13px);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.05);
}

.score-block,
.distance-block,
.combo-block {
  min-width: 104px;
  padding: 9px 12px;
  border-radius: 12px;
}

.score-block small,
.distance-block small,
.combo-block small {
  display: block;
  margin-bottom: 3px;
  color: rgba(204, 238, 255, 0.48);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.15em;
}

.score-block strong,
.distance-block strong,
.combo-block strong {
  display: block;
  font-size: clamp(15px, 1.6vw, 21px);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.combo-block strong {
  color: var(--gold);
}

.combo-block {
  min-width: 136px;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 120ms ease;
}

.combo-block small {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.combo-block small em {
  color: rgba(137, 238, 255, 0.68);
  font-size: 7px;
  font-style: normal;
  letter-spacing: 0.08em;
}

#hudFlowChain {
  color: var(--cyan);
}

.flow-track {
  display: block;
  height: 2px;
  margin-top: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(94, 173, 218, 0.16);
}

.flow-track em {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--cyan), var(--pink), var(--gold));
  box-shadow: 0 0 8px rgba(126, 238, 255, 0.58);
  transition: width 80ms linear;
}

.combo-block[data-flow-tier="1"] {
  border-color: rgba(108, 232, 255, 0.48);
}

.combo-block[data-flow-tier="2"] {
  border-color: rgba(255, 139, 207, 0.58);
  box-shadow: 0 0 18px rgba(255, 104, 183, 0.14), inset 0 1px rgba(255, 255, 255, 0.07);
}

.combo-block[data-flow-tier="3"] {
  border-color: rgba(255, 223, 136, 0.72);
  box-shadow: 0 0 24px rgba(255, 205, 91, 0.2), inset 0 1px rgba(255, 255, 255, 0.08);
}

.combo-block.is-flow-pulse {
  transform: translateY(1px) scale(1.025);
}

.combo-block.is-flow-broken {
  border-color: rgba(255, 92, 143, 0.48);
  filter: saturate(0.7);
}

.stage-progress {
  padding: 9px 13px 11px;
  border-radius: 13px;
}

.stage-progress.is-urgent {
  border-color: rgba(255, 118, 166, 0.72);
  box-shadow: 0 0 22px rgba(255, 87, 148, 0.2), inset 0 1px rgba(255, 255, 255, 0.06);
  animation: trial-urgent 620ms ease-in-out infinite alternate;
}

.stage-meta {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  margin-bottom: 7px;
}

.stage-meta span {
  color: var(--cyan);
  font-size: 8px;
  font-weight: 900;
}

.stage-meta strong {
  font-size: 10px;
}

.stage-meta em {
  color: rgba(214, 242, 255, 0.48);
  font-size: 8px;
  font-style: normal;
}

.progress-track,
.boss-track {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(2, 12, 31, 0.78);
}

.progress-track span,
.boss-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--cyan-2), var(--cyan), var(--pink));
  box-shadow: 0 0 14px rgba(102, 233, 255, 0.58);
  transition: width 100ms linear;
}

.boss-track {
  margin-top: -6px;
}

.boss-track span {
  background: linear-gradient(90deg, var(--pink-hot), #ffb4d1);
  box-shadow: 0 0 14px rgba(255, 94, 160, 0.62);
}

.boss-track[data-state="guarded"] span {
  background: repeating-linear-gradient(115deg, #15334f 0 12px, #28769a 12px 24px, #82e8f3 24px 30px);
  box-shadow: 0 0 18px rgba(93, 222, 239, 0.72);
}

.boss-track[data-boss="crownless"] span {
  background: linear-gradient(90deg, #180828, #6f2bb7 58%, #c284ff);
  box-shadow: 0 0 18px rgba(116, 44, 192, 0.72);
}

.boss-track[data-boss="crownless"][data-state="guarded"] span {
  background: repeating-linear-gradient(115deg, #160827 0 12px, #542080 12px 24px, #a668d2 24px 30px);
  box-shadow: 0 0 18px rgba(139, 72, 194, 0.7);
}

.boss-track[data-boss="crownless"][data-state="guard-broken"] span {
  background: repeating-linear-gradient(115deg, #160727 0 12px, #9144db 12px 24px, #d1a0ff 24px 30px);
  box-shadow: 0 0 24px rgba(175, 91, 246, 0.88);
  animation: crownless-guard-bar 360ms linear infinite;
}

.boss-track[data-boss="crownless"][data-state="time-stop"] span {
  filter: saturate(0.52) brightness(0.72);
  box-shadow: 0 0 20px rgba(75, 34, 112, 0.7);
}

.boss-track[data-boss="crownless"][data-state="time-anchor"] span {
  background: linear-gradient(90deg, #24102e, #8651aa 58%, #ffe09a);
  box-shadow: 0 0 22px rgba(255, 219, 130, 0.54);
}

.boss-track[data-boss="crownless"][data-state="time-sync"] span {
  background: repeating-linear-gradient(115deg, #3c174f 0 12px, #a65fe2 12px 24px, #ffe195 24px 31px);
  box-shadow: 0 0 26px rgba(255, 221, 142, 0.82);
  animation: crownless-guard-bar 280ms linear infinite;
}

.boss-track[data-boss="crownless"][data-state="phantom"] span {
  background: linear-gradient(90deg, #11071d, #5b2486 42%, #bb70e8 72%, #f5d48f);
  box-shadow: 0 0 24px rgba(161, 76, 215, 0.68), 0 0 8px rgba(255, 218, 139, 0.42);
}

.stage-progress[data-boss="crownless"].is-counter-window {
  filter: drop-shadow(0 0 12px rgba(128, 49, 207, 0.82));
}

.life-block {
  min-width: 84px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 8px 10px;
  border-radius: 12px;
}

.life-gem {
  width: 15px;
  height: 15px;
  transform: rotate(45deg);
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 4px 7px 4px 7px;
  background: linear-gradient(135deg, #fff, var(--pink-hot));
  box-shadow: 0 0 9px rgba(255, 91, 159, 0.48);
}

.life-gem.is-off {
  opacity: 0.2;
  filter: grayscale(1);
  box-shadow: none;
}

.shield-block {
  min-width: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border-radius: 12px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 900;
}

.hud-button {
  border-radius: 12px;
  pointer-events: auto;
}

.skill-core {
  position: absolute;
  z-index: 9;
  right: clamp(16px, 2vw, 26px);
  bottom: clamp(16px, 2vw, 24px);
  width: 94px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(153, 237, 255, 0.46);
  border-radius: 50%;
  background: rgba(4, 18, 44, 0.78);
  box-shadow: 0 12px 30px rgba(0, 7, 28, 0.32), inset 0 1px rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
  transition: transform 160ms ease, border-color 160ms ease, filter 160ms ease;
}

.skill-core:hover:not(:disabled) {
  transform: translateY(-2px);
  border-color: rgba(176, 244, 255, 0.9);
}

.skill-core:disabled {
  cursor: default;
}

.skill-core.is-ready {
  border-color: var(--pink);
  box-shadow: 0 0 28px rgba(255, 93, 162, 0.28), inset 0 0 20px rgba(92, 231, 255, 0.12);
  animation: skill-ready 760ms ease-in-out infinite alternate;
}

.skill-core[data-boss="crownless"].is-ready {
  border-color: #b96cff;
  background: radial-gradient(circle at 50% 44%, rgba(105, 38, 174, 0.48), rgba(13, 5, 27, 0.94) 68%);
  box-shadow: 0 0 38px rgba(118, 43, 198, 0.62), 0 0 76px rgba(49, 13, 82, 0.38), inset 0 0 26px rgba(179, 96, 255, 0.24);
  animation: crownless-counter-ready 440ms ease-in-out infinite alternate;
}

.skill-core[data-boss="crownless"].is-ready circle {
  stroke: rgba(194, 123, 255, 0.88);
}

.skill-core[data-boss="crownless"][data-state="time-stop"] {
  border-color: rgba(113, 69, 151, 0.72);
  background: radial-gradient(circle at 50% 42%, rgba(58, 26, 92, 0.56), rgba(7, 3, 17, 0.96) 70%);
  box-shadow: inset 0 0 28px rgba(131, 65, 192, 0.2), 0 0 20px rgba(41, 12, 75, 0.4);
}

.skill-core[data-boss="crownless"][data-state="time-anchor"] {
  border-color: rgba(255, 220, 133, 0.76);
  background: radial-gradient(circle at 50% 42%, rgba(113, 65, 111, 0.62), rgba(12, 4, 25, 0.96) 70%);
  box-shadow: 0 0 24px rgba(255, 215, 117, 0.26), inset 0 0 26px rgba(151, 76, 208, 0.24);
}

.skill-core[data-boss="crownless"][data-state="time-sync"],
.skill-core[data-boss="crownless"].is-time-sync {
  border-color: #ffe49c;
  background: radial-gradient(circle at 50% 42%, rgba(255, 221, 126, 0.42), rgba(64, 24, 94, 0.9) 66%);
  box-shadow: 0 0 34px rgba(255, 221, 126, 0.68), 0 0 70px rgba(143, 72, 218, 0.48), inset 0 0 24px rgba(255, 240, 187, 0.28);
  animation: crownless-time-sync 280ms ease-in-out infinite alternate;
}

.skill-core[data-boss="crownless"][data-state="time-sync"] circle {
  stroke: rgba(255, 229, 153, 0.96);
}

.skill-core[data-boss="crownless"][data-state^="time-"] .skill-copy strong {
  max-width: 66px;
  color: #fff0bd;
  text-shadow: 0 0 12px rgba(255, 218, 114, 0.86);
}

.skill-core[data-boss="crownless"][data-state="guard-broken"] .skill-copy strong {
  max-width: 62px;
  font-size: 10px;
  color: #f0d9ff;
  text-shadow: 0 0 12px #a755ef;
}

.skill-core.is-active {
  filter: brightness(1.25);
}

.skill-core.is-reflow {
  border-color: rgba(255, 159, 210, 0.92);
  box-shadow: 0 0 34px rgba(226, 91, 255, 0.42), inset 0 0 24px rgba(255, 159, 210, 0.18);
  animation: resonance-reflow-core 360ms ease-out 2 alternate;
}

.skill-core svg {
  position: absolute;
  inset: 5px;
  width: calc(100% - 10px);
  height: calc(100% - 10px);
  transform: rotate(-90deg);
}

.skill-core circle {
  fill: none;
  stroke: rgba(177, 237, 255, 0.16);
  stroke-width: 4;
}

.skill-fill {
  position: absolute;
  inset: auto 0 0;
  height: 0;
  background: linear-gradient(180deg, rgba(106, 236, 255, 0.18), rgba(84, 206, 244, 0.64) 55%, rgba(255, 105, 171, 0.72));
  transition: height 100ms linear;
}

.skill-copy {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
}

.skill-copy small {
  width: 23px;
  height: 18px;
  display: grid;
  place-items: center;
  margin-bottom: 3px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 5px;
  background: rgba(2, 14, 35, 0.34);
  font-size: 8px;
  font-weight: 900;
}

.skill-copy strong {
  font-size: 11px;
}

.skill-core > i {
  position: absolute;
  bottom: 9px;
  z-index: 1;
  color: rgba(229, 249, 255, 0.62);
  font-size: 7px;
  font-style: normal;
  font-weight: 900;
}

.resonance-finisher-button {
  position: absolute;
  z-index: 9;
  right: clamp(122px, 8vw, 140px);
  bottom: clamp(24px, 2.4vw, 34px);
  width: 78px;
  aspect-ratio: 1;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 2px;
  overflow: hidden;
  border: 1px solid rgba(113, 237, 255, 0.42);
  border-radius: 24px;
  background: radial-gradient(circle at 50% 36%, rgba(75, 213, 255, 0.2), rgba(4, 16, 42, 0.9) 68%);
  box-shadow: 0 12px 28px rgba(0, 7, 28, 0.3), inset 0 1px rgba(255, 255, 255, 0.1);
  color: #eefcff;
  backdrop-filter: blur(12px);
  transition: transform 160ms ease, opacity 160ms ease, border-color 160ms ease, filter 160ms ease;
}

.resonance-finisher-button:hover:not(:disabled) { transform: translateY(-2px) scale(1.025); }
.resonance-finisher-button:disabled { cursor: default; }

.resonance-finisher-button > span {
  width: 22px;
  height: 18px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 5px;
  background: rgba(2, 12, 31, 0.46);
  font-size: 8px;
  font-weight: 900;
}

.resonance-finisher-button strong {
  max-width: 66px;
  overflow: hidden;
  font-size: 10px;
  line-height: 1.05;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.resonance-finisher-button small {
  color: rgba(219, 244, 255, 0.56);
  font-size: 6px;
  font-weight: 900;
  letter-spacing: 0.1em;
}

.resonance-finisher-button[data-path="escort"] {
  border-color: rgba(255, 225, 154, 0.52);
  background: radial-gradient(circle at 50% 36%, rgba(255, 225, 154, 0.22), rgba(35, 26, 45, 0.92) 68%);
}

.resonance-finisher-button[data-path="overdrive"] {
  border-color: rgba(255, 155, 198, 0.54);
  background: radial-gradient(circle at 50% 36%, rgba(255, 99, 184, 0.22), rgba(35, 10, 48, 0.92) 68%);
}

.resonance-finisher-button.is-ready {
  border-color: #fff1b1;
  box-shadow: 0 0 28px rgba(255, 225, 154, 0.42), inset 0 0 20px rgba(113, 237, 255, 0.13);
  animation: resonance-finisher-ready 620ms ease-in-out infinite alternate;
}

.resonance-finisher-button.is-casting {
  filter: brightness(1.34);
  box-shadow: 0 0 38px rgba(255, 239, 178, 0.52), inset 0 0 26px rgba(255, 255, 255, 0.18);
}

.resonance-finisher-button.is-spent { opacity: 0.48; filter: saturate(0.45); }

@keyframes resonance-finisher-ready {
  from { transform: translateY(0) scale(1); filter: brightness(1); }
  to { transform: translateY(-2px) scale(1.035); filter: brightness(1.2); }
}

.build-resonance-chip {
  position: absolute;
  z-index: 9;
  left: clamp(16px, 2vw, 26px);
  top: clamp(78px, 9vw, 96px);
  min-width: 236px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 12px 8px 8px;
  border: 1px solid rgba(113, 237, 255, 0.34);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(4, 23, 52, 0.9), rgba(24, 18, 55, 0.84));
  box-shadow: 0 0 24px rgba(79, 216, 255, 0.12), inset 0 1px rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
  pointer-events: none;
}

.game-frame.has-diagnostics .build-resonance-chip {
  opacity: 0;
  visibility: hidden;
}

.build-resonance-chip > i {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(113, 237, 255, 0.38);
  border-radius: 11px;
  color: #8ff5ff;
  font-size: 18px;
  font-style: normal;
}

.build-resonance-chip[data-path="escort"] {
  border-color: rgba(255, 225, 154, 0.4);
}

.build-resonance-chip[data-path="escort"] > i { color: #ffe19a; }
.build-resonance-chip[data-path="overdrive"] > i { color: #ff9bc6; }

.build-resonance-chip.is-triggered {
  border-color: rgba(255, 155, 211, 0.82);
  box-shadow: 0 0 34px rgba(224, 91, 255, 0.3), inset 0 0 18px rgba(255, 155, 211, 0.13);
  animation: resonance-chip-trigger 240ms ease-out 2 alternate;
}

.build-resonance-chip.is-critical {
  border-color: rgba(214, 250, 255, 0.88);
  box-shadow: 0 0 34px rgba(103, 231, 255, 0.3), inset 0 0 20px rgba(255, 234, 167, 0.13);
  animation: resonance-critical-ready 420ms ease-in-out 2 alternate;
}

.build-resonance-chip span,
.build-resonance-chip small,
.build-resonance-chip strong,
.build-resonance-chip em {
  display: block;
}

.build-resonance-chip small {
  color: rgba(199, 235, 255, 0.5);
  font-size: 6px;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.build-resonance-chip strong {
  margin-top: 2px;
  color: #effbff;
  font-size: 10px;
}

.build-resonance-chip em {
  margin-top: 2px;
  color: rgba(207, 238, 252, 0.58);
  font-size: 6px;
  font-style: normal;
}

.seal-ride-chip {
  position: absolute;
  z-index: 9;
  left: clamp(16px, 2vw, 26px);
  bottom: clamp(16px, 2vw, 24px);
  width: 246px;
  height: 68px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 13px 6px 4px;
  overflow: hidden;
  border: 1px solid rgba(124, 241, 255, 0.62);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(7, 40, 74, 0.88), rgba(41, 24, 77, 0.76));
  box-shadow: 0 0 28px rgba(79, 229, 255, 0.2), inset 0 1px rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(13px);
  pointer-events: none;
}

.seal-ride-chip img {
  width: 62px;
  height: 62px;
  flex: 0 0 auto;
  object-fit: contain;
  filter: drop-shadow(0 0 9px rgba(95, 239, 255, 0.62));
}

.seal-ride-chip > span {
  min-width: 0;
  flex: 1;
}

.seal-ride-chip small,
.seal-ride-chip strong {
  display: block;
}

.seal-ride-chip small {
  color: var(--cyan);
  font-size: 6px;
  font-weight: 900;
  letter-spacing: 0.16em;
}

.seal-ride-chip strong {
  margin-top: 3px;
  font-size: 10px;
}

.seal-ride-chip strong b {
  color: #ffb8dc;
  font-variant-numeric: tabular-nums;
}

.seal-ride-chip span > i {
  height: 4px;
  display: block;
  margin-top: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(150, 233, 255, 0.14);
}

.seal-ride-chip span > i em {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: inherit;
  background: linear-gradient(90deg, #64ebff, #ff8fc4);
  box-shadow: 0 0 10px rgba(94, 236, 255, 0.64);
  transition: width 60ms linear;
}

.seal-ride-chip[data-ride="staff"] {
  border-color: rgba(255, 224, 145, 0.72);
  background: linear-gradient(135deg, rgba(41, 28, 70, 0.9), rgba(89, 55, 42, 0.78));
  box-shadow: 0 0 30px rgba(255, 210, 107, 0.24), inset 0 1px rgba(255, 255, 255, 0.14);
}

.seal-ride-chip[data-ride="staff"] img {
  filter: drop-shadow(0 0 10px rgba(255, 216, 113, 0.7));
}

.seal-ride-chip[data-ride="staff"] small,
.seal-ride-chip[data-ride="staff"] strong b {
  color: #ffe19c;
}

.seal-ride-chip[data-ride="staff"] span > i em {
  background: linear-gradient(90deg, #ffe08c, #d9b4ff);
  box-shadow: 0 0 11px rgba(255, 217, 118, 0.7);
}

.seal-ride-chip[data-ride="frightened-seal"] {
  border-color: rgba(180, 231, 255, 0.82);
  background: linear-gradient(135deg, rgba(20, 45, 70, 0.94), rgba(73, 70, 112, 0.84));
  box-shadow: 0 0 32px rgba(137, 220, 255, 0.3), inset 0 1px rgba(255, 255, 255, 0.16);
}

.seal-ride-chip[data-ride="frightened-seal"] img {
  filter: drop-shadow(0 0 11px rgba(172, 231, 255, 0.82));
}

.seal-ride-chip[data-ride="frightened-seal"] small,
.seal-ride-chip[data-ride="frightened-seal"] strong b {
  color: #c7efff;
}

.seal-ride-chip[data-ride="frightened-seal"] span > i em {
  background: linear-gradient(90deg, #79dcff, #e9d7ff);
  box-shadow: 0 0 12px rgba(132, 218, 255, 0.78);
}

.seal-ride-chip[data-ride="fried-rice"] {
  border-color: rgba(255, 201, 91, 0.78);
  background: linear-gradient(135deg, rgba(65, 22, 29, 0.94), rgba(101, 54, 24, 0.84));
  box-shadow: 0 0 32px rgba(255, 176, 62, 0.28), inset 0 1px rgba(255, 255, 255, 0.15);
}

.seal-ride-chip[data-ride="fried-rice"] img {
  filter: drop-shadow(0 0 11px rgba(255, 205, 74, 0.78));
}

.seal-ride-chip[data-ride="fried-rice"] small,
.seal-ride-chip[data-ride="fried-rice"] strong b {
  color: #ffd36f;
}

.seal-ride-chip[data-ride="fried-rice"] span > i em {
  background: linear-gradient(90deg, #ff8e45, #fff09c);
  box-shadow: 0 0 12px rgba(255, 190, 69, 0.78);
}

.seal-ride-chip[data-ride="moon-wheel"] {
  border-color: rgba(140, 222, 255, 0.78);
  background: linear-gradient(135deg, rgba(14, 25, 74, 0.94), rgba(56, 53, 113, 0.84));
  box-shadow: 0 0 32px rgba(96, 201, 255, 0.28), inset 0 1px rgba(255, 255, 255, 0.15);
}

.seal-ride-chip[data-ride="moon-wheel"] img {
  filter: drop-shadow(0 0 11px rgba(126, 221, 255, 0.78));
}

.seal-ride-chip[data-ride="moon-wheel"] small,
.seal-ride-chip[data-ride="moon-wheel"] strong b {
  color: #aeeaff;
}

.seal-ride-chip[data-ride="moon-wheel"] span > i em {
  background: linear-gradient(90deg, #72dfff, #fff0a8);
  box-shadow: 0 0 12px rgba(111, 210, 255, 0.78);
}

.seal-ride-chip[data-ride="sun-spirit"] {
  border-color: rgba(177, 244, 192, 0.82);
  background: linear-gradient(135deg, rgba(18, 62, 59, 0.94), rgba(68, 84, 46, 0.84));
  box-shadow: 0 0 32px rgba(134, 230, 179, 0.3), inset 0 1px rgba(255, 255, 255, 0.16);
}

.seal-ride-chip[data-ride="sun-spirit"] img {
  filter: drop-shadow(0 0 11px rgba(184, 242, 194, 0.82));
}

.seal-ride-chip[data-ride="sun-spirit"] small,
.seal-ride-chip[data-ride="sun-spirit"] strong b {
  color: #d9ffc9;
}

.seal-ride-chip[data-ride="sun-spirit"] span > i em {
  background: linear-gradient(90deg, #79ddb6, #f3ffb5);
  box-shadow: 0 0 12px rgba(169, 241, 190, 0.82);
}

.diagnostics-panel {
  position: absolute;
  z-index: 11;
  top: clamp(82px, 7vw, 108px);
  left: clamp(14px, 1.8vw, 24px);
  width: clamp(224px, 17vw, 270px);
  padding: 12px;
  border: 1px solid rgba(106, 233, 255, 0.34);
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(4, 24, 51, 0.92), rgba(10, 22, 48, 0.82)),
    rgba(3, 13, 34, 0.88);
  box-shadow: 0 16px 42px rgba(0, 7, 28, 0.36), inset 0 1px rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(14px);
  transition: opacity 180ms ease, visibility 180ms ease, transform 180ms ease;
}

.diagnostics-panel.is-hidden {
  transform: translateX(-8px);
}

.diagnostics-panel header,
.diagnostics-panel header > span,
.diagnostics-panel header small,
.diagnostics-panel header strong {
  display: block;
}

.diagnostics-panel header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.diagnostics-panel header small {
  color: rgba(118, 230, 255, 0.56);
  font-size: 6px;
  font-weight: 900;
  letter-spacing: 0.14em;
}

.diagnostics-panel header strong {
  margin-top: 2px;
  color: #effcff;
  font-size: 11px;
}

.diagnostics-panel header > i {
  display: flex;
  align-items: center;
  gap: 5px;
  color: rgba(140, 235, 255, 0.7);
  font-size: 6px;
  font-style: normal;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.diagnostics-panel header > i b {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #69eaff;
  box-shadow: 0 0 9px #69eaff;
  animation: diagnostics-live 1.2s ease-in-out infinite;
}

.diagnostics-primary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  margin-top: 9px;
  overflow: hidden;
  border: 1px solid rgba(126, 229, 255, 0.13);
  border-radius: 9px;
  background: rgba(126, 229, 255, 0.12);
}

.diagnostics-primary > div {
  min-width: 0;
  padding: 7px 4px;
  background: rgba(5, 22, 47, 0.9);
  text-align: center;
}

.diagnostics-primary small,
.diagnostics-primary strong {
  display: block;
}

.diagnostics-primary small {
  overflow: hidden;
  color: rgba(178, 229, 246, 0.43);
  font-size: 5px;
  font-weight: 900;
  text-overflow: ellipsis;
}

.diagnostics-primary strong {
  margin-top: 3px;
  color: #7cedff;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.diagnostics-primary strong em {
  color: rgba(173, 226, 243, 0.42);
  font-size: 5px;
  font-style: normal;
}

.diagnostics-details {
  display: grid;
  gap: 4px;
  margin: 8px 1px 0;
}

.diagnostics-details > div {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(129, 224, 249, 0.08);
}

.diagnostics-details dt,
.diagnostics-details dd {
  margin: 0;
  font-size: 6px;
  font-variant-numeric: tabular-nums;
}

.diagnostics-details dt {
  color: rgba(178, 226, 243, 0.42);
  font-weight: 900;
}

.diagnostics-details dd {
  min-width: 0;
  overflow: hidden;
  color: rgba(225, 248, 255, 0.76);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.diagnostics-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 8px;
}

.diagnostics-actions button {
  min-width: 0;
  padding: 6px 4px;
  border: 1px solid rgba(117, 230, 255, 0.2);
  border-radius: 7px;
  background: rgba(53, 160, 199, 0.1);
  color: rgba(221, 248, 255, 0.75);
  font-size: 6px;
  font-weight: 900;
}

.diagnostics-actions button:hover {
  border-color: rgba(117, 230, 255, 0.48);
  background: rgba(65, 184, 222, 0.2);
}

.diagnostics-panel > p {
  min-height: 10px;
  margin: 7px 0 0;
  overflow: hidden;
  color: rgba(171, 221, 239, 0.4);
  font-size: 5px;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.diagnostics-panel > p.is-success { color: #8cf4ff; }
.diagnostics-panel > p.is-error { color: #ff9fc7; }

.chapter-banner,
.boss-banner {
  position: absolute;
  z-index: 9;
  top: 26%;
  left: 50%;
  min-width: 320px;
  display: grid;
  justify-items: center;
  padding: 15px 28px;
  transform: translate(-50%, -14px);
  border: 1px solid rgba(165, 239, 255, 0.32);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(4, 20, 48, 0.86), rgba(12, 44, 78, 0.72));
  box-shadow: 0 18px 44px rgba(0, 7, 28, 0.38);
  opacity: 0;
  pointer-events: none;
  backdrop-filter: blur(14px);
}

.chapter-banner.is-showing,
.boss-banner.is-showing {
  animation: banner-show 2.5s ease both;
}

.chapter-banner small,
.boss-banner small {
  color: var(--cyan);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.18em;
}

.chapter-banner strong,
.boss-banner strong {
  margin: 5px 0 3px;
  font-size: 21px;
}

.chapter-banner span,
.boss-banner span {
  color: var(--muted);
  font-size: 9px;
}

.boss-banner {
  border-color: rgba(255, 125, 183, 0.42);
  background: linear-gradient(135deg, rgba(50, 13, 50, 0.88), rgba(9, 35, 69, 0.8));
}

.boss-banner small {
  color: var(--pink);
}

.game-toast {
  position: absolute;
  z-index: 10;
  left: 50%;
  top: 18%;
  max-width: 64%;
  padding: 8px 14px;
  transform: translate(-50%, -10px);
  border: 1px solid rgba(166, 239, 255, 0.3);
  border-radius: 999px;
  background: rgba(4, 20, 48, 0.82);
  box-shadow: 0 12px 32px rgba(0, 7, 27, 0.3);
  opacity: 0;
  pointer-events: none;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-align: center;
  backdrop-filter: blur(12px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.game-toast.is-showing {
  opacity: 1;
  transform: translate(-50%, 0);
}

.game-toast[data-tone="danger"] {
  border-color: rgba(255, 102, 158, 0.46);
  color: #ffdce9;
}

.game-toast[data-tone="dash"],
.game-toast[data-tone="combo"],
.game-toast[data-tone="seal"],
.game-toast[data-tone="staff"] {
  border-color: rgba(255, 162, 202, 0.42);
  color: #fff2f8;
}

.game-toast[data-tone="staff"] {
  border-color: rgba(255, 218, 126, 0.64);
  color: #fff3c9;
}

.game-toast[data-tone="perfect"] {
  padding: 10px 18px;
  border-color: rgba(187, 105, 255, 0.76);
  background: linear-gradient(110deg, rgba(12, 4, 25, 0.94), rgba(63, 18, 104, 0.92), rgba(20, 7, 38, 0.94));
  color: #ead3ff;
  box-shadow: 0 0 28px rgba(114, 40, 191, 0.48), 0 12px 32px rgba(4, 1, 12, 0.54);
  text-shadow: 0 0 14px rgba(192, 116, 255, 0.82);
}

.game-toast[data-tone="counter"] {
  top: 19%;
  min-width: min(430px, 72%);
  padding: 12px 24px 13px;
  border: 2px solid rgba(197, 123, 255, 0.92);
  border-radius: 18px;
  background: linear-gradient(110deg, rgba(7, 2, 15, 0.97), rgba(72, 20, 119, 0.96), rgba(13, 4, 27, 0.97));
  color: #f1ddff;
  box-shadow: 0 0 34px rgba(126, 47, 207, 0.74), 0 16px 38px rgba(3, 1, 10, 0.64), inset 0 0 22px rgba(187, 105, 255, 0.16);
  font-size: 14px;
  line-height: 1.55;
  white-space: pre-line;
  text-shadow: 0 0 14px rgba(202, 139, 255, 0.92);
  animation: crownless-counter-alert 420ms ease-in-out infinite alternate;
}

.game-toast[data-tone="counter"]::before {
  content: "PERFECT DODGE · GUARD BREAK";
  display: block;
  margin-bottom: 2px;
  color: #b86cff;
  font-size: 8px;
  letter-spacing: 0.18em;
}

.game-toast[data-tone="temporal"] {
  top: 19%;
  min-width: min(430px, 72%);
  padding: 12px 24px 13px;
  border: 2px solid rgba(255, 224, 143, 0.96);
  border-radius: 18px;
  background: linear-gradient(110deg, rgba(14, 5, 19, 0.97), rgba(92, 50, 89, 0.96), rgba(33, 16, 49, 0.97));
  color: #fff1bd;
  box-shadow: 0 0 34px rgba(255, 218, 118, 0.64), 0 16px 38px rgba(3, 1, 10, 0.64), inset 0 0 22px rgba(255, 235, 174, 0.16);
  font-size: 14px;
  line-height: 1.55;
  white-space: pre-line;
  text-shadow: 0 0 14px rgba(255, 224, 143, 0.9);
  animation: crownless-counter-alert 320ms ease-in-out infinite alternate;
}

.game-toast[data-tone="temporal"]::before {
  content: "TEMPORAL REVERSAL · DIRECT COUNTER";
  display: block;
  margin-bottom: 2px;
  color: #ffdf89;
  font-size: 8px;
  letter-spacing: 0.18em;
}

.game-toast[data-tone="temporal-anchor"] {
  border-color: rgba(255, 224, 143, 0.78);
  background: linear-gradient(110deg, rgba(10, 3, 21, 0.95), rgba(78, 36, 100, 0.94), rgba(29, 12, 42, 0.95));
  color: #fff0b7;
  box-shadow: 0 0 28px rgba(255, 216, 114, 0.42), 0 12px 32px rgba(4, 1, 12, 0.54);
  text-shadow: 0 0 14px rgba(255, 221, 137, 0.82);
}

.game-toast[data-tone="temporal-anchor"]::before {
  content: "TEMPORAL ANCHOR · 1 / 2";
  display: block;
  margin-bottom: 2px;
  color: #ffdc83;
  font-size: 8px;
  letter-spacing: 0.18em;
}

.game-toast[data-tone="phantom"] {
  border-color: rgba(240, 202, 135, 0.82);
  background: linear-gradient(110deg, rgba(8, 2, 18, 0.96), rgba(72, 28, 97, 0.95), rgba(21, 8, 37, 0.96));
  color: #ffe9ad;
  box-shadow: 0 0 30px rgba(181, 91, 224, 0.44), 0 12px 32px rgba(4, 1, 12, 0.56);
  text-shadow: 0 0 14px rgba(255, 217, 132, 0.68);
}

.game-toast[data-tone="phantom"]::before {
  content: "PHANTOM BODY REVEALED";
  display: block;
  margin-bottom: 2px;
  color: #dba5ff;
  font-size: 8px;
  letter-spacing: 0.18em;
}

.game-toast[data-tone="finisher"] {
  top: 18%;
  min-width: min(460px, 76%);
  padding: 13px 26px 14px;
  border: 2px solid rgba(255, 230, 160, 0.94);
  border-radius: 18px;
  background:
    linear-gradient(112deg, rgba(5, 17, 37, 0.98), rgba(42, 72, 112, 0.97), rgba(42, 15, 57, 0.98));
  color: #fff3c9;
  box-shadow:
    0 0 38px rgba(109, 231, 255, 0.54),
    0 18px 42px rgba(3, 7, 19, 0.7),
    inset 0 0 26px rgba(255, 224, 148, 0.16);
  font-size: 15px;
  letter-spacing: 0.1em;
  text-shadow: 0 0 16px rgba(255, 227, 152, 0.78);
}

.game-toast[data-tone="finisher"]::before {
  content: "RESONANCE FINISHER · Q";
  display: block;
  margin-bottom: 3px;
  color: #83edff;
  font-size: 8px;
  letter-spacing: 0.22em;
}

.game-overlay,
.modal-backdrop,
.lightbox {
  position: absolute;
  z-index: 15;
  inset: 0;
  display: grid;
  place-items: center;
  padding: clamp(18px, 4vw, 52px);
  background:
    radial-gradient(circle at 50% 48%, rgba(77, 220, 255, 0.1), transparent 30%),
    rgba(2, 10, 28, 0.72);
  backdrop-filter: blur(7px);
  transition: opacity 220ms ease, visibility 220ms ease;
}

.tutorial-card,
.perk-dialog,
.route-transition-dialog,
.compact-dialog,
.result-dialog,
.settings-dialog {
  border: 1px solid rgba(157, 234, 255, 0.3);
  border-radius: 23px;
  background: linear-gradient(145deg, rgba(8, 31, 67, 0.96), rgba(4, 16, 39, 0.97));
  box-shadow: 0 30px 86px rgba(0, 5, 25, 0.6), inset 0 1px rgba(255, 255, 255, 0.08);
}

.tutorial-card {
  width: min(800px, 100%);
  padding: clamp(25px, 4vw, 46px);
  text-align: center;
}

.overlay-kicker {
  margin: 0 0 8px;
  color: var(--cyan);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.22em;
}

.tutorial-card h2,
.perk-dialog h2,
.route-transition-dialog h2,
.compact-dialog h2,
.result-dialog h2,
.settings-dialog h2 {
  margin: 0;
  font-size: clamp(28px, 3.3vw, 44px);
  letter-spacing: -0.04em;
}

.tutorial-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 24px 0;
}

.tutorial-grid > div {
  min-height: 150px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 8px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(5, 20, 47, 0.64);
}

.tutorial-grid kbd {
  padding: 7px 10px;
  border: 1px solid rgba(151, 235, 255, 0.32);
  border-radius: 7px;
  background: rgba(45, 155, 199, 0.15);
  box-shadow: inset 0 -2px rgba(0, 0, 0, 0.22);
  color: var(--cyan);
  font: 900 9px inherit;
}

.tutorial-grid strong {
  font-size: 12px;
}

.tutorial-grid span {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.6;
}

.tutorial-seal-tip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  max-width: 560px;
  margin: -12px auto 18px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.55;
}

.tutorial-seal-tip img {
  width: 50px;
  height: 50px;
  flex: 0 0 auto;
  object-fit: contain;
  filter: drop-shadow(0 0 8px rgba(96, 236, 255, 0.46));
}

.tutorial-seal-tip strong {
  display: block;
  color: #eafcff;
  font-size: 10px;
}

.primary-button {
  min-width: 190px;
  justify-content: center;
  margin: 0 auto;
}

.perk-dialog {
  width: min(1040px, 100%);
  max-height: calc(100% - 12px);
  padding: clamp(22px, 3.2vw, 38px);
  overflow-y: auto;
  text-align: center;
}

.perk-clear-heading {
  display: grid;
  grid-template-columns: 132px 1fr;
  align-items: center;
  gap: 22px;
  text-align: left;
}

.perk-clear-heading > div:last-child > p:not(.overlay-kicker) {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.6;
}

.perk-boss-portrait {
  width: 132px;
  height: 112px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(142, 232, 255, 0.24);
  border-radius: 18px;
  background:
    radial-gradient(circle, rgba(112, 230, 255, 0.14), transparent 62%),
    rgba(3, 14, 35, 0.82);
}

.perk-boss-portrait img {
  width: 118%;
  height: 118%;
  object-fit: contain;
  filter: drop-shadow(0 0 16px rgba(92, 224, 255, 0.22));
}

.perk-combat-report {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 1px;
  margin-top: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--line);
}

.perk-combat-report > div {
  min-width: 0;
  padding: 10px 8px;
  background: rgba(4, 18, 43, 0.94);
}

.perk-combat-report small,
.perk-combat-report strong {
  display: block;
}

.perk-combat-report small {
  color: rgba(205, 237, 255, 0.44);
  font-size: 6px;
  letter-spacing: 0.1em;
}

.perk-combat-report strong {
  margin-top: 4px;
  color: #e7faff;
  font-size: 11px;
}

.perk-combat-report .is-rating strong {
  color: var(--gold);
}

.perk-route-progress,
.route-transition-path {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
}

.perk-route-progress > i,
.route-transition-path > i {
  width: 34px;
  height: 1px;
  background: linear-gradient(90deg, rgba(102, 230, 255, 0.32), rgba(190, 145, 255, 0.32));
}

.route-progress-node {
  display: grid;
  grid-template-columns: 30px 1fr;
  align-items: center;
  column-gap: 9px;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid rgba(155, 230, 255, 0.14);
  border-radius: 10px;
  background: rgba(4, 17, 40, 0.72);
  text-align: left;
}

.route-progress-node > span {
  grid-row: 1 / 3;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(141, 231, 255, 0.25);
  border-radius: 50%;
  color: var(--cyan);
  font-size: 9px;
  font-weight: 900;
}

.route-progress-node small,
.route-progress-node strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.route-progress-node small {
  color: rgba(205, 235, 255, 0.38);
  font-size: 6px;
}

.route-progress-node strong {
  font-size: 9px;
}

.route-progress-node.is-cleared {
  border-color: rgba(101, 238, 220, 0.36);
}

.route-progress-node.is-cleared > span {
  border-color: rgba(101, 238, 220, 0.55);
  background: rgba(57, 199, 176, 0.12);
  color: #8fffe7;
}

.route-progress-node.is-next {
  border-color: rgba(244, 166, 218, 0.46);
  box-shadow: 0 0 20px rgba(213, 104, 184, 0.1);
}

.route-progress-node.is-next > span {
  color: #ffb6dd;
}

.route-progress-node.is-locked {
  opacity: 0.42;
}

.perk-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 16px;
}

.perk-card {
  position: relative;
  min-height: 220px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 10px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(5, 20, 48, 0.7);
  text-align: center;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.perk-card .perk-exclusive {
  position: absolute;
  left: 12px;
  top: 12px;
  padding: 4px 7px;
  border: 1px solid color-mix(in srgb, var(--perk-color, var(--cyan)) 35%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--perk-color, var(--cyan)) 9%, rgba(4, 16, 38, 0.92));
  color: color-mix(in srgb, var(--perk-color, var(--cyan)) 82%, white);
  font-size: 6px;
  font-style: normal;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.perk-card .perk-path {
  position: absolute;
  right: 12px;
  top: 12px;
  padding: 4px 7px;
  border: 1px solid color-mix(in srgb, var(--path-color, var(--cyan)) 35%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--path-color, var(--cyan)) 8%, rgba(4, 16, 38, 0.92));
  color: color-mix(in srgb, var(--path-color, var(--cyan)) 82%, white);
  font-size: 6px;
  font-style: normal;
  font-weight: 900;
}

.perk-card:hover {
  transform: translateY(-3px);
  border-color: var(--perk-color, var(--cyan));
  background: rgba(16, 50, 86, 0.78);
}

.perk-card .perk-icon {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--perk-color, var(--cyan)) 55%, transparent);
  border-radius: 18px;
  background: color-mix(in srgb, var(--perk-color, var(--cyan)) 10%, transparent);
  color: var(--perk-color, var(--cyan));
  box-shadow: 0 0 28px color-mix(in srgb, var(--perk-color, var(--cyan)) 14%, transparent);
  font-size: 28px;
}

.perk-card strong {
  font-size: 14px;
}

.perk-card span {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.65;
}

.perk-card em,
.perk-card b {
  font-style: normal;
}

.perk-card b.is-resonance {
  background: color-mix(in srgb, var(--perk-color, var(--cyan)) 18%, transparent);
  color: color-mix(in srgb, var(--perk-color, var(--cyan)) 78%, white);
  box-shadow: 0 0 16px color-mix(in srgb, var(--perk-color, var(--cyan)) 14%, transparent);
}

.perk-card b.is-reroute {
  background: rgba(255, 188, 112, 0.1);
  color: #ffd9a8;
}

.perk-card em {
  color: var(--perk-color, var(--cyan));
  font-size: 8px;
  line-height: 1.5;
}

.perk-card b {
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: rgba(227, 247, 255, 0.72);
  font-size: 7px;
}

.route-transition-dialog {
  width: min(940px, 100%);
  max-height: calc(100% - 12px);
  display: grid;
  grid-template-columns: 0.38fr 0.62fr;
  overflow: hidden;
}

.route-signal-art {
  position: relative;
  min-height: 470px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-right: 1px solid var(--line);
  background:
    radial-gradient(circle at 50% 44%, rgba(99, 225, 255, 0.2), transparent 38%),
    linear-gradient(155deg, rgba(47, 113, 163, 0.2), rgba(17, 5, 43, 0.5));
}

.route-signal-art::before,
.route-signal-art::after {
  content: "";
  position: absolute;
  width: 280px;
  height: 280px;
  border: 1px solid rgba(139, 229, 255, 0.14);
  border-radius: 50%;
}

.route-signal-art::after {
  width: 210px;
  height: 210px;
  border-color: rgba(225, 147, 255, 0.16);
}

.route-signal-art > span {
  position: absolute;
  top: 24px;
  color: rgba(193, 237, 255, 0.44);
  font-size: 7px;
  font-weight: 900;
  letter-spacing: 0.2em;
}

.route-signal-art img {
  position: relative;
  z-index: 1;
  width: 92%;
  height: 380px;
  object-fit: contain;
  filter: drop-shadow(0 0 25px rgba(94, 220, 255, 0.24));
}

.route-transition-copy {
  padding: clamp(30px, 4vw, 48px);
  overflow-y: auto;
}

.route-transition-copy > p:not(.overlay-kicker) {
  margin: 12px 0 20px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.65;
}

.route-perk-confirm {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(151, 232, 255, 0.2);
  border-radius: 12px;
  background: rgba(7, 28, 58, 0.72);
}

.route-perk-confirm > span {
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: color-mix(in srgb, var(--perk-color, var(--cyan)) 12%, transparent);
  color: var(--perk-color, var(--cyan));
  font-size: 22px;
}

.route-perk-confirm small,
.route-perk-confirm strong,
.route-perk-confirm em {
  display: block;
  font-style: normal;
}

.route-resonance-notice {
  display: block;
  margin-top: 5px;
  color: color-mix(in srgb, var(--path-color, var(--cyan)) 78%, white);
  font-size: 7px;
  font-weight: 900;
}

.route-perk-confirm small {
  color: rgba(204, 237, 255, 0.42);
  font-size: 6px;
  letter-spacing: 0.12em;
}

.route-perk-confirm strong {
  margin-top: 3px;
  font-size: 11px;
}

.route-perk-confirm em {
  margin-top: 3px;
  color: var(--cyan);
  font-size: 7px;
}

.route-transition-path {
  margin: 22px 0;
}

.route-transition-copy .primary-button {
  margin: 0;
}

.compact-dialog {
  width: min(470px, 100%);
  padding: 42px;
  text-align: center;
}

.compact-dialog > p:not(.overlay-kicker) {
  margin: 14px 0 24px;
  color: var(--muted);
  font-size: 11px;
}

.text-button {
  display: block;
  margin: 12px auto 0;
  padding: 7px 12px;
  background: transparent;
  color: rgba(214, 242, 255, 0.54);
  font-size: 9px;
  font-weight: 900;
}

.text-button.danger {
  color: rgba(255, 137, 177, 0.68);
}

.result-dialog {
  width: min(1000px, 100%);
  max-height: calc(100% - 12px);
  display: grid;
  grid-template-columns: 0.3fr 0.7fr;
  overflow: hidden;
}

.result-grade {
  display: grid;
  place-items: center;
  min-height: 440px;
  border-right: 1px solid var(--line);
  background:
    radial-gradient(circle, rgba(255, 153, 199, 0.2), transparent 48%),
    linear-gradient(145deg, rgba(39, 148, 190, 0.16), rgba(5, 17, 42, 0.3));
  color: transparent;
  font-size: clamp(110px, 14vw, 190px);
  font-weight: 900;
  font-style: italic;
  -webkit-text-stroke: 2px rgba(155, 241, 255, 0.86);
  text-shadow: 0 0 35px rgba(82, 226, 255, 0.18);
}

.result-copy {
  padding: clamp(28px, 4vw, 46px);
  overflow-y: auto;
}

.result-challenge-note {
  margin: 9px 0 -8px;
  color: rgba(146, 237, 255, 0.72);
  font-size: 9px;
  line-height: 1.6;
}

.result-score {
  display: flex;
  align-items: end;
  gap: 9px;
  margin: 20px 0;
}

.result-score strong {
  color: var(--gold);
  font-size: clamp(40px, 5.4vw, 70px);
  font-variant-numeric: tabular-nums;
  line-height: 0.9;
}

.result-score span {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 8px;
  letter-spacing: 0.12em;
}

.result-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--line);
}

.result-stats div {
  padding: 12px;
  background: rgba(5, 19, 45, 0.9);
}

.result-stats small,
.result-stats strong {
  display: block;
}

.result-stats small {
  margin-bottom: 4px;
  color: rgba(206, 238, 255, 0.42);
  font-size: 7px;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.result-stats strong {
  font-size: 13px;
}

.result-stats .gold {
  color: var(--gold);
}

.result-expedition {
  margin-top: 14px;
}

.result-expedition-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  overflow: hidden;
  border: 1px solid rgba(153, 231, 255, 0.14);
  border-radius: 10px 10px 0 0;
  background: rgba(153, 231, 255, 0.14);
}

.result-expedition-summary > div {
  padding: 8px;
  background: rgba(4, 17, 40, 0.92);
}

.result-expedition-summary small,
.result-expedition-summary strong {
  display: block;
}

.result-expedition-summary small {
  color: rgba(205, 237, 255, 0.4);
  font-size: 6px;
}

.result-expedition-summary strong {
  margin-top: 3px;
  font-size: 11px;
}

.result-expedition-summary > p {
  grid-column: 1 / -1;
  margin: 0;
  padding: 7px 9px;
  background: rgba(6, 23, 49, 0.94);
  color: rgba(203, 235, 250, 0.55);
  font-size: 7px;
}

.result-expedition-summary > p strong {
  display: inline;
  color: #edfaff;
  font-size: inherit;
}

.result-boss-reports {
  border: 1px solid rgba(153, 231, 255, 0.14);
  border-top: 0;
  border-radius: 0 0 10px 10px;
}

.result-perk-build {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 10px;
  padding: 8px 9px;
  border: 1px solid rgba(153, 231, 255, 0.14);
  border-top: 0;
  background: rgba(5, 20, 45, 0.9);
}

.result-perk-build > p {
  margin: 0;
  color: rgba(205, 237, 255, 0.48);
  font-size: 6px;
}

.result-perk-build > p span,
.result-perk-build > p strong {
  display: block;
}

.result-perk-build > p em {
  display: block;
  margin-top: 2px;
  color: #8feeff;
  font-size: 6px;
  font-style: normal;
}

.result-perk-build > p strong {
  margin-top: 3px;
  color: #effbff;
  font-size: 9px;
}

.result-perk-build > .result-finisher-summary {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  padding-top: 7px;
  border-top: 1px solid rgba(143, 238, 255, 0.12);
}

.result-perk-build > .result-finisher-summary strong,
.result-perk-build > .result-finisher-summary em { margin: 0; }

.result-perk-build > .result-build-history {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  padding-top: 7px;
  border-top: 1px solid rgba(143, 238, 255, 0.12);
}

.result-perk-build > .result-build-history strong,
.result-perk-build > .result-build-history em {
  margin: 0;
}

.result-perk-build > .result-build-history em {
  color: rgba(199, 235, 255, 0.58);
  text-align: right;
}

.result-perk-build > div {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

.result-perk-chip {
  display: grid;
  grid-template-columns: 20px auto;
  align-items: center;
  column-gap: 5px;
  min-width: 112px;
  padding: 5px 7px;
  border: 1px solid color-mix(in srgb, var(--perk-color, var(--cyan)) 26%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--perk-color, var(--cyan)) 7%, transparent);
}

.result-perk-chip i {
  grid-row: 1 / 3;
  color: var(--perk-color, var(--cyan));
  font-size: 14px;
  font-style: normal;
}

.result-perk-chip b,
.result-perk-chip small {
  display: block;
  white-space: nowrap;
}

.result-perk-chip b {
  color: #f1fbff;
  font-size: 7px;
}

.result-perk-chip small {
  color: color-mix(in srgb, var(--perk-color, var(--cyan)) 72%, white);
  font-size: 5px;
}

.result-boss-report {
  display: grid;
  grid-template-columns: 26px 1fr auto auto;
  align-items: center;
  gap: 9px;
  padding: 8px 9px;
  border-top: 1px solid rgba(153, 231, 255, 0.09);
  background: rgba(4, 16, 38, 0.82);
}

.result-boss-report:first-child {
  border-top: 0;
}

.result-boss-report > span {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(113, 241, 218, 0.34);
  border-radius: 50%;
  color: #8cffe7;
  font-size: 8px;
  font-weight: 900;
}

.result-boss-report.is-failed > span {
  border-color: rgba(255, 112, 158, 0.38);
  color: #ff9fbd;
}

.result-boss-report small,
.result-boss-report strong {
  display: block;
}

.result-boss-report small {
  color: rgba(201, 235, 255, 0.38);
  font-size: 5px;
}

.result-boss-report strong {
  margin-top: 2px;
  font-size: 9px;
}

.result-boss-report em,
.result-boss-report b {
  font-style: normal;
  white-space: nowrap;
}

.result-boss-report em {
  color: var(--gold);
  font-size: 7px;
}

.result-boss-report b {
  color: rgba(211, 240, 255, 0.54);
  font-size: 6px;
}

.result-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.result-actions .primary-button {
  min-width: 170px;
  margin: 0;
}

.secondary-button {
  min-width: 120px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(6, 22, 50, 0.72);
  font-size: 10px;
  font-weight: 900;
}

.touch-controls {
  position: absolute;
  z-index: 9;
  inset: auto 0 0;
  display: none;
  justify-content: space-between;
  padding: 0 18px 15px;
  pointer-events: none;
}

.touch-controls button {
  width: 86px;
  height: 52px;
  display: grid;
  place-items: center;
  gap: 2px;
  border: 1px solid rgba(163, 237, 255, 0.36);
  border-radius: 15px;
  background: rgba(4, 20, 49, 0.72);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.08);
  pointer-events: auto;
  font-size: 10px;
  font-weight: 900;
  backdrop-filter: blur(12px);
}

.touch-controls small {
  color: var(--muted);
  font-size: 6px;
  letter-spacing: 0.12em;
}

.modal-backdrop,
.lightbox {
  position: fixed;
  z-index: 80;
}

.settings-dialog {
  position: relative;
  width: min(690px, 100%);
  max-height: calc(100dvh - 34px);
  overflow-y: auto;
  padding: 36px;
  scrollbar-width: thin;
  scrollbar-color: rgba(111, 224, 255, 0.35) transparent;
}

.modal-close,
.lightbox-close {
  position: absolute;
  right: 15px;
  top: 13px;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.07);
  color: rgba(230, 249, 255, 0.62);
  font-size: 20px;
}

.toggle-row {
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(5, 20, 47, 0.6);
  cursor: pointer;
}

.toggle-row strong,
.toggle-row small {
  display: block;
}

.toggle-row strong {
  margin-bottom: 3px;
  font-size: 11px;
}

.toggle-row small {
  color: var(--muted);
  font-size: 8px;
}

.toggle-row input {
  position: absolute;
  opacity: 0;
}

.toggle-row i {
  position: relative;
  width: 42px;
  height: 23px;
  flex: 0 0 auto;
  border: 1px solid rgba(154, 230, 255, 0.24);
  border-radius: 999px;
  background: rgba(2, 12, 31, 0.72);
  transition: background 160ms ease;
}

.toggle-row i::after {
  content: "";
  position: absolute;
  width: 17px;
  height: 17px;
  left: 2px;
  top: 2px;
  border-radius: 50%;
  background: rgba(216, 244, 255, 0.55);
  transition: transform 160ms ease, background 160ms ease;
}

.toggle-row input:checked + i {
  background: rgba(49, 177, 220, 0.46);
}

.toggle-row input:checked + i::after {
  transform: translateX(19px);
  background: #fff;
  box-shadow: 0 0 10px var(--cyan);
}

.music-settings {
  margin-top: 15px;
  padding: 14px;
  border: 1px solid rgba(154, 230, 255, 0.18);
  border-radius: 15px;
  background:
    radial-gradient(circle at 88% 0, rgba(255, 126, 190, 0.11), transparent 34%),
    rgba(3, 16, 40, 0.64);
}

.settings-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.settings-section-title > span,
.settings-section-title small,
.settings-section-title strong {
  display: block;
}

.settings-section-title small {
  margin-bottom: 3px;
  color: var(--cyan);
  font-size: 7px;
  font-weight: 900;
  letter-spacing: 0.16em;
}

.settings-section-title strong {
  font-size: 14px;
}

.music-playback-button {
  min-width: 84px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 12px;
  border: 1px solid rgba(124, 230, 255, 0.3);
  border-radius: 999px;
  background: linear-gradient(120deg, rgba(46, 163, 206, 0.25), rgba(201, 94, 158, 0.18));
  color: #eafcff;
  font-size: 9px;
  font-weight: 900;
}

.music-playback-button b {
  color: var(--cyan);
  font-size: 9px;
}

.music-playback-button.is-playing {
  border-color: rgba(255, 147, 202, 0.42);
  box-shadow: 0 0 20px rgba(89, 221, 255, 0.12);
}

.music-controls {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 10px;
  margin-top: 12px;
}

.music-controls label {
  min-width: 0;
  display: grid;
  gap: 6px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(7, 25, 54, 0.58);
}

.music-controls label > span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 8px;
  font-weight: 900;
}

.music-controls label > span b {
  color: var(--cyan);
  font-variant-numeric: tabular-nums;
}

.music-controls select {
  width: 100%;
  min-width: 0;
  padding: 5px 26px 5px 7px;
  border: 1px solid rgba(143, 231, 255, 0.2);
  border-radius: 7px;
  outline: 0;
  background: #081c3d;
  color: #e9fbff;
  font: 800 9px inherit;
}

.music-controls select:focus-visible,
.music-controls input:focus-visible,
.music-playback-button:focus-visible,
.music-import-button:focus-visible,
.music-remove-button:focus-visible {
  outline: 2px solid rgba(111, 230, 255, 0.75);
  outline-offset: 2px;
}

.music-volume-row input {
  width: 100%;
  accent-color: #65e9ff;
}

.music-now-playing {
  min-height: 24px;
  display: flex;
  align-items: center;
  margin: 9px 0;
  padding: 6px 9px;
  border-left: 2px solid var(--cyan);
  background: linear-gradient(90deg, rgba(83, 217, 255, 0.08), transparent);
  color: rgba(220, 247, 255, 0.72);
  font-size: 8px;
}

.music-now-playing.is-error {
  border-left-color: var(--pink);
  color: #ffc7df;
}

.music-track-list {
  display: grid;
  gap: 6px;
}

.music-track-row {
  min-width: 0;
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto 27px;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 6px 7px;
  border: 1px solid rgba(151, 231, 255, 0.12);
  border-radius: 10px;
  background: rgba(6, 24, 52, 0.54);
}

.music-track-row.is-current {
  border-color: rgba(105, 229, 255, 0.35);
  background: linear-gradient(100deg, rgba(34, 133, 174, 0.16), rgba(113, 45, 103, 0.08));
}

.music-track-index {
  color: rgba(126, 226, 255, 0.52);
  font-size: 8px;
  font-weight: 900;
}

.music-track-copy,
.music-track-copy strong,
.music-track-copy small {
  min-width: 0;
  display: block;
}

.music-track-copy strong {
  overflow: hidden;
  color: #ecfbff;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.music-track-copy small {
  margin-top: 3px;
  overflow: hidden;
  color: rgba(196, 234, 248, 0.42);
  font-size: 7px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.music-track-row.is-imported .music-track-copy small {
  color: rgba(130, 232, 255, 0.66);
}

.music-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

.music-import-button,
.music-remove-button {
  border: 1px solid rgba(148, 232, 255, 0.2);
  border-radius: 7px;
  background: rgba(69, 173, 211, 0.1);
  color: rgba(224, 249, 255, 0.78);
  font-size: 8px;
  font-weight: 900;
}

.music-import-button {
  padding: 6px 10px;
}

.music-remove-button {
  width: 27px;
  height: 27px;
  color: rgba(255, 163, 198, 0.72);
}

.music-remove-button:disabled {
  opacity: 0.25;
  cursor: default;
}

.music-legal-note {
  margin: 9px 2px 0;
  color: rgba(203, 237, 250, 0.38);
  font-size: 7px;
  line-height: 1.55;
}

.save-settings {
  margin-top: 12px;
  padding: 14px;
  border: 1px solid rgba(255, 215, 139, 0.16);
  border-radius: 15px;
  background:
    radial-gradient(circle at 8% 0, rgba(255, 208, 113, 0.08), transparent 32%),
    rgba(3, 16, 40, 0.64);
}

.save-schema-badge {
  padding: 5px 8px;
  border: 1px solid rgba(255, 218, 143, 0.22);
  border-radius: 999px;
  color: rgba(255, 229, 174, 0.58);
  font-size: 7px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.save-schema-badge b {
  color: var(--gold);
}

.save-action-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  margin-top: 11px;
}

.save-action-grid > button {
  min-width: 0;
  min-height: 53px;
  display: grid;
  grid-template-columns: 25px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  padding: 8px;
  border: 1px solid rgba(150, 231, 255, 0.16);
  border-radius: 10px;
  background: rgba(8, 29, 60, 0.62);
  text-align: left;
}

.save-action-grid > button:hover:not(:disabled) {
  border-color: rgba(111, 229, 255, 0.42);
  background: rgba(20, 64, 96, 0.68);
}

.save-action-grid > button:disabled {
  opacity: 0.38;
  cursor: default;
}

.save-action-grid > button > b {
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(89, 211, 245, 0.1);
  color: var(--cyan);
  font-size: 13px;
}

.save-action-grid > button span,
.save-action-grid > button strong,
.save-action-grid > button small {
  min-width: 0;
  display: block;
}

.save-action-grid > button strong {
  color: #e9fbff;
  font-size: 8px;
}

.save-action-grid > button small {
  margin-top: 3px;
  overflow: hidden;
  color: rgba(198, 235, 249, 0.42);
  font-size: 6px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.save-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

.save-transfer-status {
  min-height: 24px;
  display: flex;
  align-items: center;
  margin: 8px 0 0;
  padding: 6px 9px;
  border-left: 2px solid rgba(255, 212, 125, 0.72);
  background: linear-gradient(90deg, rgba(255, 205, 108, 0.07), transparent);
  color: rgba(222, 244, 252, 0.62);
  font-size: 7px;
}

.save-transfer-status.is-error {
  border-left-color: var(--pink);
  color: #ffc4dd;
}

.save-transfer-status.is-success {
  border-left-color: var(--cyan);
  color: #c9f8ff;
}

.save-import-preview {
  margin-top: 8px;
  padding: 11px;
  border: 1px solid rgba(255, 215, 132, 0.25);
  border-radius: 11px;
  background: linear-gradient(135deg, rgba(36, 40, 63, 0.86), rgba(8, 30, 60, 0.9));
}

.save-preview-heading span,
.save-preview-heading strong {
  display: block;
}

.save-preview-heading span {
  color: var(--gold);
  font-size: 6px;
  font-weight: 900;
  letter-spacing: 0.14em;
}

.save-preview-heading strong {
  margin-top: 3px;
  font-size: 10px;
}

.save-import-preview dl {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  margin: 9px 0 0;
  overflow: hidden;
  border: 1px solid rgba(151, 229, 255, 0.12);
  border-radius: 8px;
  background: rgba(151, 229, 255, 0.12);
}

.save-import-preview dl div {
  min-width: 0;
  padding: 7px;
  background: rgba(5, 22, 49, 0.92);
}

.save-import-preview dt,
.save-import-preview dd {
  margin: 0;
}

.save-import-preview dt {
  color: rgba(197, 234, 248, 0.4);
  font-size: 6px;
}

.save-import-preview dd {
  margin-top: 3px;
  overflow: hidden;
  color: #f1fcff;
  font-size: 9px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.save-import-preview > p {
  margin: 8px 0;
  color: rgba(206, 239, 251, 0.52);
  font-size: 7px;
}

.save-preview-actions {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
}

.save-preview-actions button {
  padding: 7px 10px;
  border: 1px solid rgba(150, 231, 255, 0.18);
  border-radius: 8px;
  background: rgba(8, 32, 65, 0.72);
  color: rgba(221, 247, 255, 0.7);
  font-size: 7px;
  font-weight: 900;
}

#confirmImportSaveButton {
  border-color: rgba(255, 213, 129, 0.28);
  background: rgba(172, 112, 48, 0.18);
  color: #ffe7b7;
}

.save-legal-note {
  margin: 8px 2px 0;
  color: rgba(203, 237, 250, 0.36);
  font-size: 7px;
  line-height: 1.5;
}

.reset-button {
  width: 100%;
  margin-top: 18px;
  padding: 10px;
  border: 1px solid rgba(255, 115, 163, 0.22);
  border-radius: 10px;
  background: rgba(255, 96, 153, 0.07);
  color: rgba(255, 151, 187, 0.7);
  font-size: 9px;
  font-weight: 900;
}

.settings-note {
  margin: 12px 0 0;
  color: rgba(207, 239, 255, 0.36);
  font-size: 8px;
  text-align: center;
}

.lightbox {
  background: rgba(1, 7, 20, 0.9);
}

.lightbox img {
  max-width: min(1100px, 92vw);
  max-height: 88vh;
  border: 1px solid rgba(159, 233, 255, 0.3);
  border-radius: 18px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.64);
}

.lightbox-close {
  position: fixed;
  right: 24px;
  top: 22px;
  width: 40px;
  height: 40px;
}

@keyframes boot-spin {
  to { transform: rotate(405deg); }
}

@keyframes panel-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes orbit {
  from { transform: translate(-50%, -50%) rotate(0); }
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes orbit-reverse {
  from { transform: translate(-50%, -50%) rotate(360deg); }
  to { transform: translate(-50%, -50%) rotate(0); }
}

@keyframes hero-float {
  50% { transform: translate(-50%, calc(-50% - 10px)) rotate(-1deg); }
}

@keyframes hero-switch {
  from { opacity: 0; transform: translate(-50%, -46%) scale(0.94); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

@keyframes skill-ready {
  to { transform: translateY(-2px) scale(1.025); filter: brightness(1.14); }
}

@keyframes resonance-chip-trigger {
  to { transform: scale(1.045); filter: brightness(1.28); }
}

@keyframes resonance-critical-ready {
  from { transform: translateY(0) scale(1); filter: brightness(1); }
  to { transform: translateY(-2px) scale(1.025); filter: brightness(1.24); }
}

@keyframes resonance-reflow-core {
  from { transform: scale(1); filter: brightness(1); }
  to { transform: scale(1.07); filter: brightness(1.32); }
}

@keyframes crownless-counter-ready {
  from { transform: scale(1); filter: brightness(0.92); }
  to { transform: translateY(-3px) scale(1.055); filter: brightness(1.28); }
}

@keyframes crownless-time-sync {
  from { transform: scale(1); filter: brightness(1); }
  to { transform: translateY(-2px) scale(1.065); filter: brightness(1.34); }
}

@keyframes crownless-guard-bar {
  to { background-position: 30px 0; }
}

@keyframes crownless-counter-alert {
  from { transform: translate(-50%, 0) scale(1); filter: brightness(0.94); }
  to { transform: translate(-50%, 2px) scale(1.025); filter: brightness(1.2); }
}

@keyframes diagnostics-live {
  50% { opacity: 0.35; transform: scale(0.72); }
}

@keyframes banner-show {
  0% { opacity: 0; transform: translate(-50%, -14px); }
  15%, 78% { opacity: 1; transform: translate(-50%, 0); }
  100% { opacity: 0; transform: translate(-50%, 10px); }
}

@media (max-width: 1100px) {
  .lobby-surface {
    grid-template-columns: 108px minmax(0, 1fr);
  }

  .lobby-nav {
    padding-inline: 10px;
  }

  .nav-tab {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 3px;
    text-align: center;
  }

  .nav-tab::after {
    right: -11px;
  }

  .home-panel.is-active {
    grid-template-columns: minmax(0, 1.1fr) minmax(300px, 0.7fr);
    gap: 20px;
  }

  .home-copy h1 {
    font-size: clamp(36px, 5vw, 58px);
  }

  .route-strip {
    display: none;
  }

  .home-hero {
    min-height: 380px;
  }

  .hero-character-console {
    grid-template-columns: minmax(150px, 0.9fr) minmax(150px, 1.1fr);
  }

  .character-option {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .character-portrait {
    width: 34px;
    height: 34px;
  }

  .upgrade-card {
    min-height: 260px;
    padding: 18px;
  }

  .memory-layout {
    grid-template-columns: 1fr 0.8fr;
  }

  .memory-copy {
    grid-column: 1 / -1;
    min-height: 160px;
  }

  .mission-item {
    grid-template-columns: 38px minmax(140px, 0.65fr) minmax(140px, 1fr) auto;
    gap: 10px;
  }
}

@media (pointer: coarse), (max-width: 780px) {
  .app-shell {
    height: var(--app-height, 100dvh);
    gap: 4px;
    padding:
      max(4px, env(safe-area-inset-top))
      max(6px, env(safe-area-inset-right))
      max(4px, env(safe-area-inset-bottom))
      max(6px, env(safe-area-inset-left));
  }

  .app-header {
    min-height: 32px;
    height: 32px;
  }

  .brand-gem {
    width: 24px;
    height: 24px;
  }

  .brand-gem::after {
    inset: 10px;
  }

  .brand small {
    display: none;
  }

  .brand strong {
    font-size: 11px;
  }

  .header-actions {
    gap: 5px;
  }

  .account-pill {
    min-width: 86px;
    min-height: 30px;
    gap: 6px;
    padding: 5px 9px;
  }

  .account-pill small {
    display: none;
  }

  .account-pill strong {
    max-width: 70px;
    margin-top: 0;
    font-size: 9px;
  }

  .currency-pill {
    min-width: 66px;
    height: 30px;
    gap: 5px;
    padding-inline: 8px;
  }

  .currency-pill strong {
    min-width: 28px;
    font-size: 11px;
  }

  .round-button {
    width: 30px;
    height: 30px;
  }

  .lobby-surface {
    grid-template-columns: 76px minmax(0, 1fr);
    width: 100%;
    height: 100%;
    max-height: none;
    aspect-ratio: auto;
    border-radius: 15px;
  }

  .game-frame {
    --touch-edge: 18px;
    --touch-action-width: 86px;
    --touch-control-gap: 12px;
    --touch-bottom: 15px;
    --skill-size: 70px;
    width: min(100%, calc((var(--app-height, 100dvh) - 48px) * 16 / 9));
    max-height: 100%;
  }

  .lobby-nav {
    padding: 10px 6px;
  }

  .nav-tab {
    padding: 8px 4px;
    font-size: 8px;
  }

  .lobby-panel {
    padding: 20px;
  }

  .home-panel.is-active {
    grid-template-columns: 1fr 0.55fr;
    gap: 4px;
  }

  .eyebrow {
    margin-bottom: 7px;
    font-size: 6px;
  }

  .home-copy h1 {
    font-size: clamp(25px, 7vw, 44px);
  }

  .lead {
    max-width: 440px;
    margin-top: 9px;
    font-size: 8px;
    line-height: 1.55;
  }

  .mode-switch {
    gap: 6px;
    margin-top: 10px;
  }

  .mode-option {
    gap: 6px;
    padding: 8px;
  }

  .mode-number {
    width: 25px;
    height: 25px;
    font-size: 7px;
  }

  .mode-option strong {
    font-size: 8px;
  }

  .mode-option small,
  .mode-option i {
    display: none;
  }

  .launch-row {
    margin-top: 9px;
  }

  .difficulty-debug {
    grid-template-columns: 1fr repeat(2, minmax(92px, 0.72fr));
    margin-top: 7px;
    padding: 6px 8px;
  }

  .difficulty-debug-copy em,
  .difficulty-debug > p {
    display: none;
  }

  .launch-button {
    min-width: 138px;
    padding: 9px 10px 9px 12px;
    font-size: 9px;
  }

  .launch-button i,
  .best-chip {
    display: none;
  }

  .launch-button b {
    width: 22px;
    height: 22px;
  }

  .home-hero {
    min-height: 0;
  }

  .home-hero .chibi-hero,
  .home-hero .chibi-hero[data-character] {
    width: min(30vw, calc((var(--app-height, 100dvh) - 48px) * 0.78));
    left: 48%;
    top: 45%;
  }

  .orbit-a {
    width: 150%;
  }

  .orbit-b {
    display: none;
  }

  .hero-cycle-button {
    top: 36%;
    width: 28px;
    height: 48px;
    padding: 3px;
  }

  .hero-cycle-previous {
    left: -5%;
  }

  .hero-cycle-next {
    right: -5%;
  }

  .hero-cycle-button kbd,
  .hero-cycle-button small {
    display: none;
  }

  .hero-cycle-button span {
    font-size: 21px;
  }

  .hero-character-console {
    right: -4%;
    bottom: 0;
    left: -8%;
    grid-template-columns: 1fr;
    gap: 4px;
    padding: 5px;
    border-radius: 9px 2px 9px 2px;
  }

  .hero-character-console::before,
  .hero-signal small,
  .hero-signal span,
  .hero-signal p,
  .character-option > span,
  .character-option i {
    display: none;
  }

  .character-selector {
    grid-row: 2;
    gap: 4px;
  }

  .character-option {
    display: grid;
    grid-template-columns: 29px;
    justify-content: center;
    padding: 2px;
  }

  .character-portrait {
    width: 29px;
    height: 29px;
  }

  .hero-signal {
    grid-row: 1;
    padding: 2px 5px;
    border-left-width: 1px;
    text-align: center;
  }

  .hero-signal strong {
    margin: 0;
    font-size: 8px;
    letter-spacing: 0.04em;
  }

  .lobby-footer {
    position: absolute;
    right: max(6px, env(safe-area-inset-right));
    bottom: max(2px, env(safe-area-inset-bottom));
    display: flex;
    width: auto;
    padding: 2px 6px;
    border: 0;
    border-radius: 6px;
    background: rgba(3, 12, 29, 0.76);
    font-size: 6px;
  }

  .lobby-footer > span {
    display: none;
  }

  .panel-heading {
    align-items: start;
    gap: 12px;
    padding-bottom: 10px;
  }

  .panel-heading h2 {
    font-size: 20px;
  }

  .panel-heading > p {
    max-width: 260px;
    font-size: 7px;
  }

  .upgrade-grid {
    gap: 7px;
    margin-top: 10px;
  }

  .upgrade-card {
    min-height: 188px;
    gap: 5px;
    padding: 11px;
    border-radius: 12px;
  }

  .upgrade-icon {
    width: 34px;
    height: 34px;
    font-size: 17px;
  }

  .upgrade-card h3 {
    font-size: 11px;
  }

  .upgrade-card p {
    font-size: 7px;
  }

  .upgrade-buy {
    min-height: 30px;
    font-size: 7px;
  }

  .lab-note {
    display: none;
  }

  .mission-list {
    gap: 5px;
    margin-top: 10px;
  }

  .mission-item {
    grid-template-columns: 30px minmax(105px, 0.7fr) minmax(90px, 1fr) auto;
    gap: 7px;
    padding: 7px;
  }

  .mission-index {
    width: 28px;
    height: 28px;
  }

  .mission-copy strong {
    font-size: 8px;
  }

  .mission-copy small,
  .mission-progress b {
    font-size: 6px;
  }

  .claim-button {
    min-width: 70px;
    padding: 6px;
    font-size: 6px;
  }

  .subheading {
    margin: 10px 0 6px;
  }

  .achievement {
    min-height: 60px;
    padding: 8px;
  }

  .achievement strong {
    font-size: 7px;
  }

  .achievement span {
    font-size: 6px;
  }

  .memory-layout {
    grid-template-columns: 1fr 0.75fr 0.9fr;
    gap: 7px;
    margin-top: 10px;
  }

  .memory-card {
    min-height: 205px;
    border-radius: 10px;
  }

  .memory-copy {
    grid-column: auto;
    min-height: 0;
    padding: 12px;
  }

  .memory-copy blockquote {
    margin: 8px 0;
    font-size: 11px;
  }

  .memory-copy p,
  .memory-copy a {
    font-size: 6px;
  }

  .game-frame {
    width: min(100%, calc((100svh - 56px) * 16 / 9));
    border-radius: 15px;
  }

  .game-hud {
    grid-template-columns: 64px minmax(0, 1fr) 72px 70px 30px 30px;
    gap: 5px;
    padding: 9px;
  }

  .hud-left {
    min-width: 0;
  }

  .hud-right {
    display: contents;
  }

  .stage-progress {
    min-width: 0;
  }

  .diagnostics-panel {
    top: 50px;
    left: 9px;
    width: 196px;
    padding: 8px;
    border-radius: 10px;
  }

  .diagnostics-panel header strong { font-size: 8px; }
  .diagnostics-primary { margin-top: 6px; }
  .diagnostics-primary > div { padding: 4px 2px; }
  .diagnostics-primary strong { font-size: 9px; }
  .diagnostics-details { gap: 2px; margin-top: 5px; }
  .diagnostics-details > div { padding-bottom: 2px; }
  .diagnostics-actions { gap: 4px; margin-top: 5px; }
  .diagnostics-actions button { padding: 4px 2px; font-size: 5px; }
  .diagnostics-panel > p { margin-top: 4px; }

  .score-block,
  .distance-block,
  .combo-block {
    min-width: 64px;
    padding: 6px 7px;
    border-radius: 8px;
  }

  .score-block small,
  .distance-block small,
  .combo-block small {
    font-size: 5px;
  }

  .score-block strong,
  .distance-block strong,
  .combo-block strong {
    font-size: 11px;
  }

  .distance-block {
    display: none;
  }

  .combo-block {
    display: block;
    min-width: 72px;
  }

  .combo-block small em {
    display: none;
  }

  .stage-progress {
    padding: 6px 8px;
    border-radius: 8px;
  }

  .stage-meta {
    margin-bottom: 4px;
  }

  .stage-meta span,
  .stage-meta em {
    font-size: 5px;
  }

  .stage-meta strong {
    font-size: 7px;
  }

  .life-block {
    min-width: 0;
    gap: 3px;
    padding: 6px 4px;
    border-radius: 8px;
  }

  .life-gem {
    width: 9px;
    height: 9px;
  }

  .shield-block {
    min-width: 30px;
    border-radius: 8px;
    font-size: 8px;
  }

  .hud-button {
    width: 30px;
    height: 30px;
    border-radius: 8px;
  }

  .skill-core {
    width: var(--skill-size);
    right: calc(var(--touch-edge) + var(--touch-action-width) + var(--touch-control-gap));
    bottom: var(--touch-bottom);
  }

  .resonance-finisher-button {
    right: calc(var(--touch-edge) + var(--touch-action-width) + var(--touch-control-gap));
    bottom: calc(var(--touch-bottom) + var(--skill-size) + 8px);
    width: 58px;
    border-radius: 18px;
  }

  .resonance-finisher-button strong { max-width: 48px; font-size: 8px; }
  .resonance-finisher-button small { font-size: 5px; }

  .build-resonance-chip {
    left: 12px;
    top: 58px;
    min-width: 176px;
    padding: 6px 9px 6px 6px;
  }

  .build-resonance-chip > i {
    width: 30px;
    height: 30px;
    font-size: 14px;
  }

  .build-resonance-chip em {
    display: none;
  }

  .seal-ride-chip {
    left: 50%;
    bottom: 9px;
    width: 190px;
    height: 51px;
    padding-block: 3px;
    transform: translateX(-50%);
    border-radius: 13px;
  }

  .seal-ride-chip img {
    width: 45px;
    height: 45px;
  }

  .seal-ride-chip small {
    display: none;
  }

  .seal-ride-chip strong {
    margin-top: 0;
    font-size: 8px;
  }

  .seal-ride-chip span > i {
    margin-top: 5px;
  }

  .skill-copy strong {
    font-size: 8px;
  }

  .skill-core > i {
    bottom: 6px;
    font-size: 5px;
  }

  .touch-controls {
    display: flex;
    padding-right: var(--touch-edge);
    padding-bottom: var(--touch-bottom);
    padding-left: var(--touch-edge);
  }

  .touch-controls button {
    width: var(--touch-action-width);
  }

  .chapter-banner,
  .boss-banner {
    min-width: 230px;
    padding: 9px 16px;
  }

  .chapter-banner strong,
  .boss-banner strong {
    font-size: 13px;
  }

  .chapter-banner span,
  .boss-banner span,
  .chapter-banner small,
  .boss-banner small {
    font-size: 6px;
  }

  .tutorial-card,
  .perk-dialog,
  .route-transition-dialog,
  .compact-dialog {
    padding: 20px;
  }

  .tutorial-card h2,
  .perk-dialog h2,
  .route-transition-dialog h2,
  .compact-dialog h2 {
    font-size: 22px;
  }

  .perk-clear-heading {
    grid-template-columns: 88px 1fr;
    gap: 12px;
  }

  .perk-boss-portrait {
    width: 88px;
    height: 74px;
  }

  .perk-combat-report {
    grid-template-columns: repeat(3, 1fr);
    margin-top: 9px;
  }

  .perk-combat-report > div {
    padding: 6px;
  }

  .perk-route-progress {
    margin-top: 8px;
  }

  .route-progress-node {
    grid-template-columns: 22px 1fr;
    padding: 5px;
  }

  .route-progress-node > span {
    width: 22px;
    height: 22px;
  }

  .tutorial-grid {
    margin: 12px 0;
  }

  .tutorial-grid > div {
    min-height: 105px;
    padding: 10px;
  }

  .tutorial-grid span {
    font-size: 6px;
  }

  .perk-card {
    min-height: 150px;
    padding: 12px;
  }

  .perk-card .perk-icon {
    width: 42px;
    height: 42px;
    font-size: 19px;
  }

  .perk-card span {
    font-size: 6px;
  }

  .result-dialog {
    width: min(680px, 100%);
  }

  .route-transition-dialog {
    width: min(680px, 100%);
  }

  .route-signal-art {
    min-height: 310px;
  }

  .route-signal-art img {
    height: 250px;
  }

  .route-transition-copy {
    padding: 22px;
  }

  .result-grade {
    min-height: 310px;
  }

  .result-copy {
    padding: 24px;
  }
}

@media (pointer: coarse) and (orientation: portrait) and (max-width: 900px) {
  .orientation-guard {
    display: grid;
  }
}

@media (max-width: 620px) and (orientation: portrait) {
  .modal-backdrop {
    padding: 10px;
  }

  .settings-dialog {
    max-height: calc(100dvh - 20px);
    padding: 25px 18px 20px;
  }

  .music-controls {
    grid-template-columns: 1fr;
  }

  .save-action-grid {
    grid-template-columns: 1fr;
  }

  .save-import-preview dl {
    grid-template-columns: repeat(2, 1fr);
  }

  .music-track-row {
    grid-template-columns: 22px minmax(0, 1fr) auto 27px;
    gap: 6px;
  }

  .lobby-surface,
  .game-frame {
    width: 100%;
  }

  .app-header {
    align-self: start;
  }

  .lobby-surface {
    grid-template-columns: 58px minmax(0, 1fr);
  }

  .home-panel.is-active {
    grid-template-columns: 1fr;
  }

  .home-copy {
    max-width: 78%;
  }

  .home-hero {
    position: absolute;
    inset: 0 0 0 44%;
  }

  .home-hero .hero-orbit,
  .home-hero .chibi-hero {
    opacity: 0.52;
  }

  .mode-switch {
    grid-template-columns: 1fr;
  }

  .mode-option:nth-child(2) {
    display: none;
  }

  .challenge-selector,
  .boss-selector {
    grid-template-columns: 1fr;
  }

  .difficulty-debug {
    grid-template-columns: 1fr 1fr;
  }

  .difficulty-debug-copy {
    grid-column: 1 / -1;
  }
}

@media (max-height: 520px) and (orientation: landscape) {
  .app-shell {
    gap: 3px;
    padding:
      max(3px, env(safe-area-inset-top))
      max(5px, env(safe-area-inset-right))
      max(3px, env(safe-area-inset-bottom))
      max(5px, env(safe-area-inset-left));
  }

  .app-header {
    min-height: 28px;
    height: 28px;
  }

  .brand-gem {
    width: 21px;
    height: 21px;
  }

  .brand-gem::before { inset: 5px; }
  .brand-gem::after { inset: 9px; }

  .account-pill,
  .currency-pill,
  .round-button {
    min-height: 27px;
    height: 27px;
  }

  .round-button {
    width: 27px;
  }

  .lobby-surface {
    grid-template-columns: 64px minmax(0, 1fr);
  }

  .lobby-nav {
    gap: 3px;
    padding: 5px 4px;
  }

  .nav-tab {
    padding: 5px 3px;
    font-size: 7px;
  }

  .game-frame {
    --touch-edge: 10px;
    --touch-action-width: 76px;
    --touch-control-gap: 10px;
    --touch-bottom: 8px;
    --skill-size: 62px;
    width: min(100%, calc((var(--app-height, 100dvh) - 38px) * 16 / 9));
  }

  .game-hud {
    grid-template-columns: 64px minmax(0, 1fr) 72px 70px 30px 30px;
    gap: 5px;
    padding: 9px;
  }

  .hud-left {
    min-width: 0;
  }

  .hud-right {
    display: contents;
  }

  .distance-block {
    display: none;
  }

  .score-block,
  .combo-block {
    min-width: 0;
    padding: 6px 7px;
    border-radius: 8px;
  }

  .score-block small,
  .combo-block small {
    font-size: 5px;
  }

  .score-block strong,
  .combo-block strong {
    font-size: 11px;
  }

  .combo-block small em {
    display: none;
  }

  .stage-progress {
    min-width: 0;
    padding: 6px 8px;
    border-radius: 8px;
  }

  .life-block {
    min-width: 0;
    gap: 3px;
    padding: 6px 4px;
    border-radius: 8px;
  }

  .life-gem {
    width: 9px;
    height: 9px;
  }

  .shield-block {
    min-width: 0;
    border-radius: 8px;
    font-size: 8px;
  }

  .hud-button {
    width: 30px;
    height: 30px;
    border-radius: 8px;
  }

  .build-resonance-chip {
    left: 12px;
    top: 58px;
    min-width: 176px;
    padding: 6px 9px 6px 6px;
  }

  .build-resonance-chip > i {
    width: 30px;
    height: 30px;
    font-size: 14px;
  }

  .build-resonance-chip em {
    display: none;
  }

  .modal-backdrop {
    padding: 8px;
  }

  .settings-dialog {
    max-height: calc(100dvh - 16px);
    padding: 22px 28px;
  }

  .settings-dialog h2 {
    font-size: 25px;
  }

  .toggle-row {
    min-height: 48px;
    margin-top: 7px;
  }

  .lobby-panel {
    padding: 12px 38px;
  }

  .home-panel.is-active {
    align-items: center;
  }

  .home-copy h1 {
    font-size: clamp(24px, 5.2vw, 31px);
    line-height: 0.94;
  }

  .home-copy .lead {
    display: none;
  }

  .eyebrow {
    margin-bottom: 5px;
  }

  .mode-switch {
    margin-top: 9px;
  }

  .mode-option {
    padding-block: 6px;
  }

  .boss-selector {
    gap: 4px;
    margin-top: 6px;
    padding: 5px;
  }

  .boss-option {
    padding-block: 4px;
  }

  .boss-option img {
    height: 32px;
  }

  .boss-selector > p {
    display: none;
  }

  .difficulty-debug {
    grid-template-columns: auto 1fr 1fr;
    gap: 5px;
    margin-top: 5px;
    padding: 5px 7px;
  }

  .difficulty-debug-copy em,
  .difficulty-debug > p {
    display: none;
  }

  .launch-row {
    margin-top: 8px;
  }

  .launch-button {
    min-height: 34px;
    padding-block: 6px;
  }

  .route-strip {
    display: none;
  }

  .home-hero {
    min-height: 0;
    height: 100%;
  }

  .home-hero .chibi-hero,
  .home-hero .chibi-hero[data-character] {
    width: min(28vw, calc((var(--app-height, 100dvh) - 42px) * 0.72));
    left: 48%;
    top: 43%;
  }

  .hero-character-console {
    right: 0;
    bottom: 2px;
    left: -4%;
  }

  .touch-controls {
    padding: 0 var(--touch-edge) var(--touch-bottom);
  }

  .touch-controls button {
    width: var(--touch-action-width);
    height: 44px;
  }

  .skill-core {
    width: var(--skill-size);
    right: calc(var(--touch-edge) + var(--touch-action-width) + var(--touch-control-gap));
    bottom: var(--touch-bottom);
  }

  .resonance-finisher-button {
    right: calc(var(--touch-edge) + var(--touch-action-width) + var(--touch-control-gap));
    bottom: calc(var(--touch-bottom) + var(--skill-size) + 8px);
    width: 54px;
  }

  .route-transition-dialog {
    height: calc(100% - 4px);
  }

  .route-signal-art {
    min-height: 0;
  }

  .route-signal-art img {
    height: 250px;
  }

  .route-transition-copy {
    padding: 18px 22px;
  }

  .route-transition-copy > p:not(.overlay-kicker) {
    margin: 7px 0 10px;
  }

  .route-transition-path {
    margin: 12px 0;
  }

  .result-dialog {
    height: calc(100% - 4px);
  }

  .result-grade {
    min-height: 0;
  }
}

@keyframes trial-urgent {
  from { filter: brightness(1); }
  to { filter: brightness(1.18); }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* Account, cloud-save and leaderboard surfaces */
.leaderboard-panel {
  align-content: start;
  overflow: auto;
  padding-bottom: 18px;
}

.leaderboard-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 20px 0 14px;
}

.leaderboard-toolbar button,
.leaderboard-toolbar select {
  min-height: 38px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted);
  background: rgba(5, 21, 49, 0.72);
  font: 800 10px inherit;
}

.leaderboard-toolbar button.is-active {
  border-color: rgba(111, 233, 255, 0.58);
  color: var(--ice);
  background: rgba(31, 125, 166, 0.26);
  box-shadow: inset 0 -2px var(--cyan);
}

.leaderboard-toolbar .leaderboard-refresh {
  margin-left: auto;
}

.leaderboard-own {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
  padding: 12px 16px;
  border: 1px solid rgba(255, 225, 154, 0.35);
  border-radius: 12px;
  background: linear-gradient(90deg, rgba(255, 197, 104, 0.12), rgba(89, 217, 255, 0.08));
  font-size: 10px;
}

.leaderboard-own strong,
.leaderboard-own b {
  color: var(--gold);
}

.leaderboard-table {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(3, 15, 37, 0.68);
}

.leaderboard-head,
.leaderboard-row {
  display: grid;
  grid-template-columns: 70px minmax(130px, 1.2fr) minmax(90px, 0.8fr) minmax(95px, 0.8fr);
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 18px;
}

.leaderboard-head {
  color: var(--muted);
  background: rgba(93, 200, 240, 0.08);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.leaderboard-row {
  border-top: 1px solid rgba(162, 231, 255, 0.09);
  font-size: 10px;
}

.leaderboard-row > span:first-child {
  color: var(--cyan);
  font-weight: 900;
}

.leaderboard-row strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leaderboard-row b {
  color: var(--gold);
  font-size: 12px;
}

.leaderboard-row em {
  color: var(--muted);
  font-style: normal;
}

.leaderboard-row.is-top-1 { background: rgba(255, 211, 118, 0.09); }
.leaderboard-row.is-top-2 { background: rgba(181, 229, 255, 0.06); }
.leaderboard-row.is-top-3 { background: rgba(255, 164, 129, 0.05); }

.leaderboard-empty {
  margin: 0;
  padding: 42px 20px;
  color: var(--muted);
  text-align: center;
  font-size: 10px;
}

.leaderboard-note {
  margin: 12px 2px 0;
  color: var(--muted);
  font-size: 9px;
}

.account-dialog {
  position: relative;
  width: min(620px, 100%);
  max-height: min(820px, calc(100svh - 42px));
  overflow: auto;
  padding: clamp(24px, 4vw, 42px);
  border: 1px solid rgba(157, 234, 255, 0.3);
  border-radius: 23px;
  background: linear-gradient(145deg, rgba(8, 31, 67, 0.98), rgba(4, 16, 39, 0.98));
  box-shadow: 0 30px 86px rgba(0, 5, 25, 0.65), inset 0 1px rgba(255, 255, 255, 0.08);
}

.account-dialog h2 {
  margin: 0;
  font-size: clamp(28px, 3.3vw, 42px);
  letter-spacing: -0.04em;
}

.account-lead,
.account-privacy {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.75;
}

.account-lead { margin: 14px 0 20px; }
.account-privacy { margin: 16px 0 0; }

.account-form-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 18px;
  padding: 5px;
  border-radius: 12px;
  background: rgba(2, 13, 33, 0.68);
}

.account-form-tabs button {
  min-height: 38px;
  border-radius: 9px;
  color: var(--muted);
  background: transparent;
  font-weight: 900;
}

.account-form-tabs button.is-active {
  color: var(--ice);
  background: rgba(62, 185, 225, 0.2);
  box-shadow: inset 0 -2px var(--cyan);
}

.account-form {
  display: grid;
  gap: 13px;
}

.account-form > label:not(.account-confirm) {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
}

.account-form input[type="text"],
.account-form input[type="password"] {
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  outline: 0;
  background: rgba(2, 13, 33, 0.7);
}

.account-form input:focus {
  border-color: rgba(111, 233, 255, 0.7);
  box-shadow: 0 0 0 3px rgba(72, 203, 242, 0.1);
}

.account-confirm {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.5;
}

.account-confirm input { margin-top: 2px; }
.account-submit { width: 100%; margin-top: 3px; }
.account-guest-button { width: 100%; margin-top: 13px; }

.account-profile {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 20px 0;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(22, 76, 110, 0.16);
}

.account-avatar {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid rgba(111, 233, 255, 0.55);
  border-radius: 50%;
  color: var(--cyan);
  background: rgba(63, 201, 240, 0.12);
  box-shadow: 0 0 22px rgba(63, 201, 240, 0.16);
}

.account-profile small,
.account-profile strong,
.account-profile em {
  display: block;
}

.account-profile small { color: var(--cyan); font-size: 8px; }
.account-profile strong { margin: 3px 0; font-size: 16px; }
.account-profile em { color: var(--muted); font-size: 9px; font-style: normal; }

.cloud-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.cloud-actions button {
  min-height: 82px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(5, 22, 50, 0.72);
  text-align: left;
}

.cloud-actions b { color: var(--cyan); font-size: 22px; }
.cloud-actions strong,
.cloud-actions small { display: block; }
.cloud-actions strong { font-size: 10px; }
.cloud-actions small { margin-top: 4px; color: var(--muted); font-size: 8px; }

.cloud-conflict {
  margin-top: 14px;
  padding: 15px;
  border: 1px solid rgba(255, 205, 130, 0.35);
  border-radius: 13px;
  background: rgba(126, 79, 24, 0.14);
}

.cloud-conflict > strong { color: var(--gold); font-size: 11px; }
.cloud-conflict p { color: var(--muted); font-size: 9px; }
.cloud-conflict > div { display: flex; gap: 8px; }
.cloud-conflict button { flex: 1; min-height: 36px; border-radius: 9px; background: rgba(57, 159, 196, 0.22); }

.account-status {
  min-height: 18px;
  margin: 14px 0;
  color: var(--muted);
  font-size: 9px;
}

.account-status.is-error { color: #ffabc6; }
.account-status.is-success { color: #8ef4d1; }

.account-session-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
}

@media (max-width: 720px) {
  .account-pill { min-width: 42px; justify-content: center; padding: 7px; }
  .account-pill > span:last-child { display: none; }
  .leaderboard-head,
  .leaderboard-row { grid-template-columns: 48px minmax(100px, 1fr) minmax(80px, 0.7fr); padding-inline: 10px; }
  .leaderboard-head > :nth-child(3),
  .leaderboard-row > :nth-child(3) { display: none; }
  .cloud-actions { grid-template-columns: 1fr; }
}

/* Phone landscape must keep the primary action and first-run confirmation above browser chrome. */
@media (pointer: coarse) and (orientation: landscape) and (max-height: 600px) {
  body.is-playing .app-shell {
    grid-template-rows: minmax(0, 1fr);
    gap: 0;
    padding:
      max(2px, env(safe-area-inset-top))
      max(2px, env(safe-area-inset-right))
      max(2px, env(safe-area-inset-bottom))
      max(2px, env(safe-area-inset-left));
  }

  body.is-playing .app-header {
    display: none;
  }

  body.is-playing .game-frame {
    --touch-edge: 10px;
    --touch-action-width: 76px;
    --touch-control-gap: 10px;
    --touch-bottom: 8px;
    --skill-size: 62px;
    width: min(100%, calc((var(--app-height, 100dvh) - 4px) * 16 / 9));
    border-radius: 12px;
  }

  .game-fullscreen-button {
    display: grid;
    top: 46px;
    right: 8px;
    width: 30px;
    height: 30px;
    border-radius: 8px;
  }

  .lobby-panel {
    padding: 6px 16px;
  }

  .home-panel.is-active {
    grid-template-columns: minmax(0, 1fr) minmax(176px, 0.46fr);
    align-items: stretch;
    gap: 6px;
  }

  .home-copy {
    min-height: 0;
    max-height: 100%;
    display: grid;
    align-content: center;
  }

  .home-copy > .eyebrow,
  .home-copy > .lead {
    display: none;
  }

  .home-copy h1 {
    font-size: clamp(19px, 5.4vh, 27px);
    line-height: 1;
    white-space: nowrap;
  }

  .home-copy h1 br {
    display: none;
  }

  .mode-switch {
    gap: 4px;
    margin-top: 5px;
  }

  .mode-option {
    min-height: 31px;
    gap: 4px;
    padding: 3px 5px;
  }

  .mode-number {
    width: 22px;
    height: 22px;
  }

  .boss-selector,
  .challenge-selector {
    gap: 3px;
    margin-top: 4px;
    padding: 3px;
    border-radius: 9px;
  }

  .boss-option,
  .challenge-option {
    min-height: 31px;
    gap: 4px;
    padding: 2px 4px;
    border-radius: 7px;
  }

  .boss-option {
    grid-template-columns: 28px minmax(0, 1fr);
  }

  .boss-option img {
    width: 28px;
    height: 26px;
  }

  .boss-option small,
  .boss-selector > p,
  .challenge-option small,
  .challenge-selector > p {
    display: none;
  }

  .difficulty-debug {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
    margin-top: 4px;
    padding: 3px 5px;
    border-radius: 8px;
  }

  .difficulty-debug-copy,
  .difficulty-debug > p {
    display: none;
  }

  .difficulty-debug label {
    grid-template-columns: 1fr auto;
    gap: 4px;
    font-size: 6px;
  }

  .difficulty-debug select {
    min-width: 56px;
    padding: 3px 17px 3px 6px;
    font-size: 7px;
  }

  .launch-row {
    min-height: 36px;
    margin-top: 5px;
  }

  .launch-button {
    min-width: 158px;
    min-height: 36px;
    padding: 5px 8px 5px 11px;
  }

  .route-strip {
    display: none;
  }

  .tutorial-overlay {
    place-items: center;
    padding: 4px;
    overflow: hidden;
  }

  .tutorial-card {
    width: min(760px, 100%);
    max-height: 100%;
    display: grid;
    align-content: center;
    padding: 8px 12px;
    overflow-y: auto;
    border-radius: 13px;
  }

  .tutorial-card .overlay-kicker {
    margin-bottom: 2px;
    font-size: 6px;
  }

  .tutorial-card h2 {
    font-size: 18px;
  }

  .tutorial-grid {
    gap: 5px;
    margin: 6px 0;
  }

  .tutorial-grid > div {
    min-height: 66px;
    gap: 3px;
    padding: 5px;
    border-radius: 8px;
  }

  .tutorial-grid kbd {
    padding: 3px 6px;
    font-size: 7px;
  }

  .tutorial-grid strong {
    font-size: 8px;
  }

  .tutorial-grid span {
    font-size: 5px;
    line-height: 1.25;
  }

  .tutorial-seal-tip {
    gap: 5px;
    max-width: 520px;
    margin: 0 auto 5px;
    font-size: 6px;
    line-height: 1.25;
  }

  .tutorial-seal-tip img {
    width: 27px;
    height: 27px;
  }

  .tutorial-seal-tip strong {
    font-size: 7px;
  }

  #tutorialStartButton {
    min-width: 180px;
    min-height: 32px;
    padding: 6px 10px;
    font-size: 8px;
  }
}
