:root {
  --ink: #f8fafc;
  --muted: rgba(241, 245, 249, 0.74);
  --accent: #ffd166;
  --accent-soft: #ffe39b;
  --accent-deep: #b88212;
  --cyan: #7ce7ff;
  --gold: #ffd166;
  --danger: #ff5468;
  --glass: rgba(10, 15, 26, 0.56);
  --glass-strong: rgba(9, 14, 24, 0.84);
  --line: rgba(255, 255, 255, 0.15);
  --glow: rgba(255, 209, 102, 0.34);
  --font-display: "Anton", "Impact", sans-serif;
  --font-serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "SimSun", serif;
  --font-ui: "Noto Sans SC", "MiSans", "HarmonyOS Sans SC", "Source Han Sans SC", "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

[hidden] {
  display: none !important;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  background: #0b1424;
  color: var(--ink);
  font-family: var(--font-ui);
}

#scene {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  ime-mode: disabled;
}

/* Translucent green jelly membrane vignette in 1P view — subtly tightens on inhale & ripples on gulp! */
#fpJellyEdge {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  pointer-events: none;
  opacity: 0;
  --fp-inhale: 0;
  --fp-gulp: 0;
  transition: opacity 0.28s ease;
  background: radial-gradient(
    circle at 50% 50%,
    rgba(46, 238, 128, 0) calc(62% - var(--fp-inhale) * 6% - var(--fp-gulp) * 8%),
    rgba(24, 212, 108, calc(0.18 + var(--fp-inhale) * 0.10 + var(--fp-gulp) * 0.16)) 88%,
    rgba(8, 122, 58, calc(0.42 + var(--fp-inhale) * 0.12 + var(--fp-gulp) * 0.18)) 100%
  );
  box-shadow: inset 0 0 calc(56px + var(--fp-gulp) * 54px) rgba(140, 255, 190, calc(0.18 + var(--fp-gulp) * 0.28));
}
body.slime-fp #fpJellyEdge {
  opacity: 1;
}

/* Black Hole Tidal Mass-Drain Crimson Danger Overlay & Alert Banner */
#bhWarning {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  pointer-events: none;
  z-index: 26;
  --bh-danger: 0;
  background: radial-gradient(
    circle at 50% 50%,
    rgba(255, 24, 48, 0) 46%,
    rgba(220, 20, 44, calc(0.16 + var(--bh-danger) * 0.28)) 82%,
    rgba(155, 8, 26, calc(0.38 + var(--bh-danger) * 0.40)) 100%
  );
  box-shadow: inset 0 0 calc(65px + var(--bh-danger) * 95px) rgba(255, 32, 56, calc(0.32 + var(--bh-danger) * 0.45));
  animation: bhDangerPulse 0.72s ease-in-out infinite alternate;
}
.bhWarnBox {
  position: fixed;
  top: 72px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 26px;
  border-radius: 6px;
  border: 2px solid rgba(255, 64, 86, 0.92);
  background: rgba(46, 6, 14, 0.86);
  box-shadow: 0 0 32px rgba(255, 32, 56, 0.55), inset 0 0 18px rgba(255, 64, 86, 0.24);
  text-align: center;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.bhWarnTitle {
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0.08em;
  color: #ff4d63;
  text-shadow: 0 0 14px rgba(255, 48, 72, 0.75);
}
.bhWarnSub {
  margin-top: 4px;
  font-size: 13px;
  font-weight: 700;
  color: #ffe4e8;
}
@keyframes bhDangerPulse {
  from { opacity: 0.78; }
  to { opacity: 1.0; }
}

/* 3D-projected floating combat / growth popups */
#floaters {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  pointer-events: none;
  z-index: 18;
  overflow: hidden;
}
.floater {
  position: fixed;
  font-weight: 900;
  letter-spacing: 0.04em;
  white-space: nowrap;
  color: #ffffff;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.85), 0 0 18px rgba(50, 238, 128, 0.55);
  will-change: transform, opacity;
}

.holo {
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: 6px;
  backdrop-filter: blur(14px) saturate(145%);
  -webkit-backdrop-filter: blur(14px) saturate(145%);
  box-shadow: 0 10px 30px rgba(4, 8, 16, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  transition: background 0.45s ease, border-color 0.45s ease;
}

#hud {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10;
}

#sysCard {
  position: absolute;
  top: 22px;
  top: max(22px, env(safe-area-inset-top));
  left: 24px;
  left: max(24px, env(safe-area-inset-left));
  min-width: 242px;
  max-width: 286px;
  max-width: min(286px, calc(100vw - 48px));
  padding: 11px 16px 12px;
  border-left: 3px solid var(--gold);
}

.sysHeadRow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.sysName {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.24em;
  color: rgba(248, 250, 252, 0.68);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sysStat {
  margin-top: 3px;
  font-family: var(--font-display);
  font-size: 32px;
  line-height: 1.08;
  letter-spacing: 0.04em;
  color: var(--gold);
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.38);
  transform-origin: left center;
}
.sysStat.is-pop {
  animation: statPop 0.24s cubic-bezier(0.2, 1.35, 0.35, 1);
}
@keyframes statPop {
  0% { transform: scale(1); }
  45% { transform: scale(1.07); color: #fff5d4; }
  100% { transform: scale(1); }
}

.sysSub {
  margin-top: 3px;
  font-size: 12px;
  color: rgba(248, 250, 252, 0.84);
}

.benchProgress {
  margin-top: 9px;
}

.benchProgressMeta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 5px;
}

.benchProgressMeta em {
  font-style: normal;
  color: var(--gold);
  font-weight: 700;
}

.benchProgressTrack {
  height: 3.5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  overflow: hidden;
}

.benchProgressTrack i {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--gold), var(--cyan));
  transition: width 0.16s ease-out;
}

body.realm-space {
  --glass: rgba(10, 15, 26, 0.64);
  --line: rgba(255, 255, 255, 0.16);
  --glow: rgba(116, 255, 176, 0.36);
}

#rightStack {
  position: absolute;
  top: 22px;
  top: max(22px, env(safe-area-inset-top));
  right: 24px;
  right: max(24px, env(safe-area-inset-right));
  width: 312px;
  width: min(312px, calc(100vw - 48px));
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#taskCard {
  position: relative;
  width: 312px;
  max-width: calc(100vw - 48px);
  padding: 13px 16px 13px 18px;
  border: 1px solid rgba(255, 209, 102, 0.44);
  border-left: 4px solid var(--gold);
  background: linear-gradient(135deg, rgba(24, 20, 10, 0.78), rgba(10, 15, 28, 0.78));
  box-shadow: 0 12px 32px rgba(4, 8, 16, 0.42), 0 0 20px rgba(255, 209, 102, 0.14), inset 0 1px 0 rgba(255, 232, 160, 0.18);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
#taskCard.is-advance {
  border-color: rgba(255, 232, 148, 0.95);
  box-shadow: 0 12px 36px rgba(4, 8, 16, 0.48), 0 0 34px rgba(255, 209, 102, 0.58), inset 0 0 18px rgba(255, 209, 102, 0.22);
  transform: scale(1.03);
}
.taskHead {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: var(--gold);
  text-shadow: 0 0 10px rgba(255, 209, 102, 0.45);
}
.taskMeta {
  margin-top: 6px;
  font-family: var(--font-display);
  font-size: 14px;
  color: var(--gold);
  letter-spacing: 0.06em;
}
.taskMeta:empty {
  display: none;
}
.taskTitle {
  margin-top: 5px;
  font-size: 17px;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: 0.03em;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.55);
}
.taskDesc {
  margin-top: 4px;
  font-size: 12.5px;
  line-height: 1.48;
  color: rgba(241, 245, 249, 0.88);
}
.taskGuide {
  margin-top: 7px;
  padding: 5px 9px;
  border-radius: 5px;
  background: rgba(255, 209, 102, 0.13);
  border: 1px solid rgba(255, 209, 102, 0.34);
  font-size: 12px;
  font-weight: 700;
  color: #ffe8a3;
  line-height: 1.38;
}
.taskTrack {
  margin-top: 10px;
  height: 5px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.16);
  overflow: hidden;
}
.taskTrack i {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--gold), #ffeb99, var(--cyan));
  box-shadow: 0 0 10px rgba(255, 209, 102, 0.55);
  transition: width 0.22s ease;
}

/* Always-Visible Golden Main Quest 3D Waypoint Pin */
#spaceMarker {
  position: fixed;
  left: 0;
  top: 0;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  gap: 7px;
  pointer-events: none;
  z-index: 15;
  will-change: transform;
}
.smDiamond {
  width: 14px;
  height: 14px;
  background: var(--gold);
  border: 2px solid #181204;
  transform: rotate(45deg);
  box-shadow: 0 0 16px rgba(255, 209, 102, 0.95), 0 0 28px rgba(255, 209, 102, 0.55);
  animation: questPinPulse 1.5s ease-in-out infinite;
}
@keyframes questPinPulse {
  0%, 100% { transform: rotate(45deg) scale(1); }
  50% { transform: rotate(45deg) scale(1.18); }
}
#spaceMarker.is-edge .smDiamond {
  width: 12px;
  height: 12px;
  background: #ffe07a;
  box-shadow: 0 0 18px rgba(255, 209, 102, 0.95);
}
.smInfo {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 310px;
  padding: 4px 11px 4px 7px;
  border-radius: 999px;
  background: rgba(18, 14, 6, 0.84);
  border: 1.5px solid rgba(255, 209, 102, 0.78);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.55), 0 0 14px rgba(255, 209, 102, 0.28);
  backdrop-filter: blur(6px);
  white-space: nowrap;
  overflow: hidden;
}
.smBadge {
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--gold);
  color: #1a1204;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}
.smLabel {
  font-size: 12px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 0.02em;
  overflow: hidden;
  text-overflow: ellipsis;
}
.smSub {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 12.5px;
  color: var(--gold);
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

/* Secondary Cyan Crosshair Aim-Lock Pin (when looking at another planet/star) */
#aimMarker {
  position: fixed;
  left: 0;
  top: 0;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  gap: 5px;
  pointer-events: none;
  z-index: 14;
  will-change: transform;
}
.amDiamond {
  width: 9px;
  height: 9px;
  background: var(--cyan);
  border: 1.5px solid #09131f;
  transform: rotate(45deg);
  box-shadow: 0 0 12px rgba(124, 231, 255, 0.85);
}
.amInfo {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 260px;
  padding: 2.5px 10px;
  border-radius: 999px;
  background: rgba(8, 16, 28, 0.78);
  border: 1px solid rgba(124, 231, 255, 0.48);
  backdrop-filter: blur(6px);
  white-space: nowrap;
  overflow: hidden;
}
.amLabel {
  font-size: 11px;
  font-weight: 700;
  color: #e2f6ff;
  overflow: hidden;
  text-overflow: ellipsis;
}
.amSub {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 11.5px;
  color: var(--cyan);
  letter-spacing: 0.04em;
  flex-shrink: 0;
}
#aimMarker.is-hardlock .amDiamond {
  width: 14px;
  height: 14px;
  background: #38f8ff;
  border: 2px solid #041924;
  box-shadow: 0 0 18px rgba(56, 248, 255, 0.95), 0 0 32px rgba(56, 248, 255, 0.55);
  animation: questPinPulse 1.1s ease-in-out infinite;
}
#aimMarker.is-hardlock .amInfo {
  max-width: 340px;
  padding: 4px 12px;
  background: rgba(6, 22, 36, 0.88);
  border: 1.5px solid rgba(56, 248, 255, 0.88);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.55), 0 0 18px rgba(56, 248, 255, 0.35);
}
#spaceMarker.is-hardlock .smDiamond {
  background: #42ff9e;
  box-shadow: 0 0 18px rgba(66, 255, 158, 0.95), 0 0 34px rgba(255, 209, 102, 0.65);
}
#spaceMarker.is-hardlock .smInfo {
  max-width: 360px;
  border-color: rgba(66, 255, 158, 0.92);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6), 0 0 18px rgba(66, 255, 158, 0.38);
}

/* Minimal Alien Planet Stability Bar (only shown on planet surface, unified with Fist/Speed .holo!) */
#planetCard {
  position: absolute;
  top: 22px;
  top: max(22px, env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  width: 320px;
  width: min(320px, calc(100vw - 620px));
  min-width: 230px;
  padding: 9px 14px 10px;
  border-color: var(--line);
  border-top: 2px solid var(--gold);
  background: var(--glass);
  box-shadow: 0 10px 30px rgba(4, 8, 16, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}
#planetCard.is-crit {
  border-color: rgba(255, 84, 104, 0.72);
  background: rgba(28, 10, 16, 0.80);
  animation: critPulse 1.1s ease-in-out infinite;
}
@keyframes critPulse {
  0%, 100% { box-shadow: 0 0 14px rgba(255, 84, 104, 0.30); }
  50% { box-shadow: 0 0 24px rgba(255, 84, 104, 0.62); }
}
.pcHead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.pcName {
  font-size: 12.5px;
  font-weight: 800;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pcGrav {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 999px;
  color: var(--cyan);
  background: rgba(124, 231, 255, 0.14);
  border: 1px solid rgba(124, 231, 255, 0.32);
  white-space: nowrap;
}
.pcMeta {
  margin-top: 4px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 11px;
  color: var(--muted);
}
.pcMeta em {
  font-style: normal;
  font-family: var(--font-display);
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--gold);
}
.pcTrack {
  margin-top: 5px;
  height: 3.5px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.14);
  overflow: hidden;
}
.pcTrack i {
  display: block;
  height: 100%;
  width: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--danger), var(--gold), var(--cyan));
  transition: width 0.2s ease-out;
}

/* Galactic Star Map Overlay */
#galaxyOverlay {
  position: fixed;
  top: 22px;
  right: 26px;
  bottom: 22px;
  left: 26px;
  top: max(22px, 3.5vh);
  bottom: max(22px, 3.5vh);
  left: max(26px, 4vw);
  right: max(26px, 4vw);
  z-index: 42;
  display: flex;
  flex-direction: column;
  padding: 18px 22px;
  border-radius: 8px;
  background: var(--glass-strong);
  border: 1px solid var(--line);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  box-shadow: 0 24px 70px rgba(4, 8, 16, 0.72), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  pointer-events: auto;
}
.galTop {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}
.galTitle {
  font-size: 20px;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: 0.08em;
}
.galSub {
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted);
}
.galTopActions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.galMain {
  flex: 1;
  min-height: 0;
  margin-top: 14px;
  display: grid;
  grid-template-columns: 1fr 310px;
  gap: 16px;
}
.galStage {
  display: flex;
  flex-direction: column;
  min-height: 0;
  gap: 10px;
}
#galaxyCanvas {
  flex: 1;
  width: 100%;
  min-height: 240px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  cursor: grab;
}
#galaxyCanvas:active { cursor: grabbing; }
.galRoster {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.galChip {
  flex: 1;
  min-width: 112px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 7px 10px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.045);
  color: var(--ink);
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.galChip em {
  font-style: normal;
  font-size: 11px;
  color: var(--accent);
}
.galChip.is-active {
  border-color: rgba(116, 255, 176, 0.65);
  background: rgba(116, 255, 176, 0.14);
}
.galChip.is-dead {
  opacity: 0.58;
  border-color: rgba(255, 84, 104, 0.35);
}
.galChip.is-dead em { color: var(--danger); }
.galScanner {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}
.gsHead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.08em;
}
.gsSeed {
  font-family: monospace;
  color: var(--muted);
}
.gsName {
  font-size: 20px;
  font-weight: 900;
  color: #ffffff;
}
.gsDesc {
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
}
.gsStats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.gsStats div {
  padding: 7px 9px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.10);
}
.gsStats span {
  display: block;
  font-size: 10.5px;
  color: var(--muted);
}
.gsStats b {
  display: block;
  margin-top: 2px;
  font-size: 12.5px;
  color: #ffffff;
}
.gsStabMeta {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  color: rgba(212, 238, 252, 0.85);
}
.gsStabMeta em { font-style: normal; font-weight: 800; color: #74ffb0; }
.gsStabMeta em.is-crit { color: #ff6b5b; }
.gsStabTrack {
  margin-top: 5px;
  height: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}
.gsStabTrack i {
  display: block;
  height: 100%;
  border-radius: 999px;
}
.gsActions {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.gsActions .pBtn { width: 100%; text-align: center; padding: 9px 12px; }
.gsDeadNote {
  padding: 9px 10px;
  border-radius: 8px;
  background: rgba(255, 98, 92, 0.12);
  border: 1px solid rgba(255, 98, 92, 0.35);
  color: #ffd0cc;
  font-size: 12px;
  line-height: 1.45;
}
.gsHint {
  font-size: 11px;
  color: rgba(253, 230, 138, 0.85);
  line-height: 1.4;
}

#reticle {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 34px;
  height: 34px;
  transform: translate(-50%, -50%);
  opacity: 0.78;
  transition: transform 0.14s ease, opacity 0.14s ease;
}
#reticle.is-hidden-space {
  pointer-events: none;
}
#reticle.is-hidden-space svg {
  opacity: 0;
}
#reticle.is-edible {
  opacity: 0.96;
  transform: translate(-50%, -50%) scale(1.08);
}
#reticle.is-edible .ring {
  stroke: var(--accent);
}
#reticle.is-warn .ring {
  stroke: rgba(255, 212, 112, 0.85);
}
#reticle.is-charging {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1.22);
}

#reticleHint {
  position: absolute;
  top: 40px;
  left: 50%;
  transform: translateX(-50%);
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
  color: #f6fff9;
  background: rgba(6, 18, 16, 0.78);
  border: 1px solid rgba(114, 255, 176, 0.34);
  backdrop-filter: blur(6px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}
#reticleHint.hint-charge,
#reticleHint.hint-explosive,
#reticleHint.hint-boss {
  color: #fff6c2;
  border-color: rgba(255, 212, 112, 0.72);
  background: rgba(28, 22, 6, 0.84);
}
#reticleHint.hint-armored {
  color: #bae6fd;
  border-color: rgba(56, 189, 248, 0.65);
  background: rgba(6, 22, 34, 0.84);
}
#reticleHint.hint-big {
  color: #ffd0cc;
  border-color: rgba(255, 110, 100, 0.55);
  background: rgba(28, 10, 12, 0.82);
}

#reticle svg {
  width: 100%;
  height: 100%;
}

#reticle .ring {
  fill: none;
  stroke: rgba(255, 255, 255, 0.24);
  stroke-width: 2.5;
}

#reticle .charge {
  fill: none;
  stroke: var(--gold);
  stroke-width: 4.5;
  stroke-linecap: round;
  stroke-dasharray: 251.2;
  stroke-dashoffset: 251.2;
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
}

#reticle .dot {
  fill: #ffffff;
}

#keys {
  position: absolute;
  right: 24px;
  right: max(24px, env(safe-area-inset-right));
  bottom: 24px;
  bottom: max(24px, env(safe-area-inset-bottom));
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  border-radius: 6px;
  background: rgba(10, 15, 26, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.10);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-size: 11px;
  color: rgba(248, 250, 252, 0.78);
  white-space: nowrap;
  max-width: calc(100vw - 48px);
  overflow: hidden;
}

#keys kbd {
  display: inline-block;
  margin-right: 4px;
  padding: 1px 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.22);
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.3;
  color: #ffffff;
}
#keys.is-faded {
  opacity: .28;
  transition: opacity .6s;
}
#keys.is-faded:hover {
  opacity: 1;
}

#toasts {
  position: fixed;
  top: auto;
  bottom: 92px;
  bottom: max(92px, calc(env(safe-area-inset-bottom) + 84px));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  gap: 8px;
  z-index: 25;
  pointer-events: none;
}
body.realm-space #toasts {
  top: auto;
  bottom: 150px;
  bottom: max(150px, calc(env(safe-area-inset-bottom) + 140px));
}

.toast {
  padding: 8px 18px 8px 14px;
  border-radius: 6px;
  background: var(--glass-strong);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-left: 3px solid var(--accent);
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: 0 10px 28px rgba(4, 8, 16, 0.35);
  animation: toastIn 0.24s cubic-bezier(0.2, 1.4, 0.4, 1);
  white-space: normal;
  max-width: 580px;
  max-width: min(620px, 78vw);
  text-align: center;
}

.toast.gold {
  border-left-color: var(--gold);
}

.toast em {
  font-style: normal;
  font-family: var(--font-display);
  letter-spacing: 0.04em;
  color: var(--accent);
}

.toast.gold em {
  color: var(--gold);
}

.imeWarnCard {
  position: fixed;
  left: 50%;
  top: 20%;
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 560px;
  padding: 16px 24px;
  border-radius: 10px;
  background: rgba(9, 14, 24, 0.94);
  border: 2px solid var(--gold);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.68), 0 0 30px rgba(255, 209, 102, 0.32);
  text-align: center;
  pointer-events: none;
  z-index: 48;
  animation: toastIn 0.24s cubic-bezier(0.2, 1.3, 0.4, 1);
}
.imeWarnTitle {
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0.06em;
  color: var(--gold);
  margin-bottom: 8px;
}
.imeWarnBody {
  font-size: 14px;
  line-height: 1.75;
  font-weight: 600;
  color: #f8fafc;
}
.imeWarnBody kbd {
  font-size: 13px;
  padding: 2px 7px;
  margin: 0 2px;
  border-radius: 3px;
  background: rgba(255, 209, 102, 0.18);
  border: 1px solid rgba(255, 209, 102, 0.65);
  color: var(--gold);
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(8px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

#banner {
  position: fixed;
  top: 34%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.94);
  text-align: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.35s cubic-bezier(0.2, 0.9, 0.25, 1);
  z-index: 26;
}

#banner.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.bTop {
  font-size: 12px;
  letter-spacing: 0.34em;
  color: #88ffba;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
}

.bMain {
  margin-top: 4px;
  font-size: 38px;
  font-size: clamp(28px, 4.4vw, 48px);
  font-weight: 900;
  color: #ffffff;
  text-shadow: 0 4px 24px rgba(24, 214, 104, 0.55), 0 2px 8px rgba(0, 0, 0, 0.7);
}

.bSub {
  margin-top: 6px;
  font-size: 13.5px;
  color: rgba(226, 255, 238, 0.9);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.75);
}

/* Title overlay synchronized 1:1 with 《指数世界》 & 《指数之拳》 minimalist indie aesthetic */
#title {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 68px;
  padding-right: clamp(48px, 6.5vw, 104px);
  background: linear-gradient(
    90deg,
    rgba(5, 12, 26, 0) 0%,
    rgba(5, 12, 26, 0.06) 44%,
    rgba(5, 12, 26, 0.56) 62%,
    rgba(4, 10, 22, 0.84) 100%
  );
  transition: opacity 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

#title.leaving {
  opacity: 0;
  pointer-events: none;
}

.tStage {
  width: 380px;
  width: clamp(320px, 35vw, 460px);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.tTitle {
  margin: 0;
  display: inline-flex;
  align-items: baseline;
  font-family: var(--font-serif);
  font-weight: 900;
  font-size: 62px;
  font-size: clamp(54px, 5vw, 72px);
  line-height: 1.04;
  gap: 22px;
  gap: clamp(18px, 1.9vw, 28px);
  color: #ffffff;
  text-shadow: 0 8px 30px rgba(3, 8, 20, 0.55);
}

.tSubLine {
  margin-top: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.tLine {
  width: 28px;
  height: 1px;
  background: var(--accent);
  opacity: 0.65;
}

.tSubText {
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.46em;
  padding-left: 0.46em;
  color: rgba(248, 250, 252, 0.72);
}

.tMenu {
  margin-top: 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.mItem {
  position: relative;
  appearance: none;
  border: 0;
  outline: none;
  margin: 0;
  padding: 9px 12px;
  background: transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.28em;
  color: rgba(241, 245, 249, 0.64);
  text-shadow: 0 2px 12px rgba(3, 8, 20, 0.58);
  transition: color 0.18s ease, opacity 0.2s ease;
}

.mItem::before,
.mItem::after {
  content: "";
  display: block;
  width: 0;
  height: 1px;
  background: var(--accent);
  opacity: 0;
  transition: width 0.24s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.2s ease;
}

.mItem .tLabel { padding-left: 0.28em; }

.mItem.is-active,
.mItem:not(:disabled):hover,
.mItem:focus-visible {
  color: #ffffff;
}

.mItem.is-active::before,
.mItem.is-active::after,
.mItem:not(:disabled):hover::before,
.mItem:not(:disabled):hover::after {
  width: 24px;
  opacity: 1;
}

.mItem:disabled {
  opacity: 0.35;
  cursor: default;
}

.mBadge {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0.06em;
  color: var(--accent);
}

.tLoad {
  margin-top: 14px;
  font-size: 11px;
  letter-spacing: 0.22em;
  color: rgba(248, 250, 252, 0.62);
}
.tLoad.ready { opacity: 0; pointer-events: none; }
#startupProgress:not([hidden]) { display: block; width: 100%; max-width: 220px; height: 4px; margin: 0 auto 8px; accent-color: var(--accent); }

/* System Console Panel — 1:1 synchronized with 《指数之拳》 & 《指数之速》 */
#panel {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: calc(100% - 32px);
  max-width: 720px;
  max-height: calc(100% - 24px);
  max-height: min(675px, calc(100% - 24px));
  display: flex;
  flex-direction: column;
  z-index: 85;
  overflow: hidden;
  border-radius: 8px;
  background: var(--glass-strong);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
}

#panel[hidden] {
  display: none;
}

.pHead {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 12px;
  padding: 16px 22px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}
#touchResume {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 800;
  color: #090e18;
  background: var(--gold);
  border-color: var(--gold);
  cursor: pointer;
}
html[data-toy-landscape] .pHead { padding-right: 92px; }

.pEyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.24em;
  color: var(--accent);
}

.pTitle {
  font-size: 24px;
  font-weight: 900;
  letter-spacing: 0.16em;
  color: #ffffff;
}

.pHint {
  font-size: 12px;
  color: var(--muted);
}

.pHint kbd {
  padding: 1px 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
}

.pBody {
  flex: 1 1 auto;
  min-height: 0;
  padding: 14px 22px 20px;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
@media (max-height: 540px) {
  #panel {
    top: 8px;
    bottom: 8px;
    transform: translateX(-50%);
    width: calc(100% - 20px);
    max-width: 680px;
    max-height: calc(100% - 16px);
    height: auto;
  }
  .pHead { padding: 10px 14px 8px; gap: 6px 10px; }
  .pEyebrow { display: none; }
  .pTitle { font-size: 17px; letter-spacing: 0.08em; }
  .pHint { display: none; }
  .pBody { padding: 10px 14px 14px; }
}

.pMetrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.pMetric {
  padding: 8px 11px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.11);
}

.pMetric.accent {
  background: rgba(116, 255, 176, 0.09);
  border-color: rgba(116, 255, 176, 0.36);
}

.pMetric span {
  display: block;
  font-size: 11px;
  color: var(--muted);
}

.pMetric b {
  display: block;
  margin-top: 2px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 19px;
  letter-spacing: 0.03em;
  color: #ffffff;
}
.pMetric.accent b {
  color: var(--accent);
}

.benchHead {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 8px;
}

.benchHead em {
  font-style: normal;
  font-family: var(--font-display);
  color: var(--accent);
  letter-spacing: 0.06em;
}

.benchGrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 6px;
}

.benchChip {
  padding: 7px 10px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.10);
  font-size: 12px;
}

.benchChip b {
  display: block;
  color: rgba(255, 255, 255, 0.72);
}

.benchChip span {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  color: var(--muted);
}

.benchChip.is-passed {
  background: rgba(116, 255, 176, 0.10);
  border-color: rgba(116, 255, 176, 0.36);
}

.benchChip.is-passed b {
  color: var(--accent);
}

.benchChip.is-next {
  border-color: rgba(255, 209, 102, 0.50);
  background: rgba(255, 209, 102, 0.08);
}

.pCard {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 14px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.pCard h3 {
  font-size: 14px;
  font-weight: 800;
  color: #ffffff;
}

.pCard p {
  margin-top: 2px;
  font-size: 11.5px;
  color: var(--muted);
}

.pActions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.pBtn {
  appearance: none;
  padding: 6px 12px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.07);
  color: #f1f5f9;
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.pBtn:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
}

.pBtn.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #061812;
}

.pBtn.danger {
  border-color: rgba(255, 84, 104, 0.45);
  background: rgba(255, 84, 104, 0.12);
  color: #ff99a6;
}
.pBtn.danger:hover {
  background: rgba(255, 84, 104, 0.24);
}

/* Touch controls */
#touchControls {
  display: none;
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 20;
}

body.touch-mode #touchControls {
  display: block;
}

body.touch-mode #keys,
body.panel-open #keys {
  display: none;
}

#touchMove {
  position: fixed;
  width: 112px;
  height: 112px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.28);
  background: radial-gradient(circle, rgba(16, 28, 46, 0.28), rgba(8, 14, 26, 0.52));
  box-shadow: inset 0 0 18px rgba(116, 255, 176, 0.10);
}

#touchMove i {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 44px;
  height: 44px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 1.5px solid rgba(220, 255, 236, 0.72);
  background: radial-gradient(circle at 35% 30%, rgba(164, 255, 206, 0.92), rgba(46, 214, 126, 0.72));
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.35);
}

.touchTopBar {
  position: fixed;
  top: 12px;
  top: max(12px, env(safe-area-inset-top));
  right: 12px;
  right: max(12px, env(safe-area-inset-right));
  display: flex;
  gap: 8px;
  pointer-events: auto;
}

/* Honor of Kings / Naruto Mobile style right-thumb radial skill fan! */
.touchActions {
  position: fixed;
  right: 16px;
  right: max(16px, env(safe-area-inset-right));
  bottom: 14px;
  bottom: max(14px, env(safe-area-inset-bottom));
  width: 224px;
  height: 166px;
  pointer-events: none;
}
.touchActions .touchButton {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  width: 58px;
  height: 58px;
  padding: 0;
  border-radius: 50%;
  border: 2px solid rgba(226, 240, 255, 0.38);
  background: radial-gradient(circle at 35% 28%, rgba(30, 48, 76, 0.72), rgba(8, 14, 26, 0.78));
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.08), 0 5px 14px rgba(0, 0, 0, 0.42);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  color: rgba(248, 250, 252, 0.96);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.03em;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.65);
  pointer-events: auto;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.08s ease, background 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease;
}
.touchActions .touchButton::before {
  content: '';
  display: block;
  width: 18px;
  height: 18px;
  background: currentColor;
  opacity: 0.95;
  flex-shrink: 0;
}
.touchActions .touchButton.holding,
.touchActions .touchButton:active {
  transform: scale(0.90);
}
/* Primary Big Button (84px) — 吞噬 (bottom-right thumb home) */
.touchActions .touchButton[data-touch="suck"] {
  right: 0;
  bottom: 0;
  width: 84px;
  height: 84px;
  gap: 4px;
  border-width: 2.5px;
  border-color: rgba(116, 255, 176, 0.80);
  background: radial-gradient(circle at 35% 28%, rgba(22, 134, 78, 0.80), rgba(6, 36, 24, 0.86));
  box-shadow: inset 0 0 0 3px rgba(116, 255, 176, 0.18), 0 6px 20px rgba(10, 120, 66, 0.42);
  color: #b8ffd6;
  font-size: 13.5px;
}
.touchActions .touchButton[data-touch="suck"]::before {
  width: 25px;
  height: 25px;
  clip-path: polygon(50% 4%, 64% 28%, 92% 18%, 74% 44%, 98% 60%, 70% 66%, 78% 94%, 50% 76%, 22% 94%, 30% 66%, 2% 60%, 26% 44%, 8% 18%, 36% 28%);
}
.touchActions .touchButton[data-touch="suck"].holding,
.touchActions .touchButton[data-touch="suck"]:active {
  border-color: #d8ffea;
  background: radial-gradient(circle at 35% 28%, rgba(116, 255, 176, 0.95), rgba(34, 197, 94, 0.92));
  color: #062214;
  text-shadow: none;
  box-shadow: 0 0 24px rgba(116, 255, 176, 0.75);
}
/* Skill 1 (正左 ~180°) — 质能爆炸 */
.touchActions [data-touch="blast"] {
  right: 96px;
  bottom: 4px;
  border-color: rgba(255, 196, 86, 0.72);
  background: radial-gradient(circle at 35% 28%, rgba(154, 74, 18, 0.76), rgba(34, 16, 8, 0.82));
  box-shadow: inset 0 0 0 2px rgba(255, 209, 102, 0.16), 0 5px 14px rgba(0, 0, 0, 0.40);
  color: #ffe08a;
}
.touchActions [data-touch="blast"]::before {
  clip-path: polygon(50% 0, 62% 32%, 96% 18%, 74% 48%, 100% 70%, 66% 68%, 58% 100%, 42% 72%, 8% 82%, 28% 52%, 4% 24%, 38% 34%);
}
.touchActions [data-touch="blast"].holding,
.touchActions [data-touch="blast"]:active {
  border-color: #fff3c4;
  background: rgba(255, 188, 66, 0.94);
  color: #241204;
  text-shadow: none;
  box-shadow: 0 0 22px rgba(255, 188, 66, 0.72);
}
/* Skill 2 (左上 ~135°) — 喷射 / 折跃 */
.touchActions [data-touch="jet"] {
  right: 76px;
  bottom: 74px;
  border-color: rgba(103, 232, 249, 0.70);
  background: radial-gradient(circle at 35% 28%, rgba(18, 92, 128, 0.76), rgba(8, 22, 38, 0.82));
  box-shadow: inset 0 0 0 2px rgba(103, 232, 249, 0.16), 0 5px 14px rgba(0, 0, 0, 0.40);
  color: #a5f3fc;
}
.touchActions [data-touch="jet"]::before {
  clip-path: polygon(0 12%, 24% 12%, 58% 50%, 24% 88%, 0 88%, 34% 50%, 0 12%, 44% 12%, 68% 12%, 100% 50%, 68% 88%, 44% 88%, 78% 50%, 44% 12%);
}
.touchActions [data-touch="jet"].holding,
.touchActions [data-touch="jet"]:active {
  border-color: #e0f9ff;
  background: rgba(103, 232, 249, 0.94);
  color: #06202e;
  text-shadow: none;
  box-shadow: 0 0 20px rgba(103, 232, 249, 0.72);
}
/* Skill 3 (正上 ~90°) — 跳跃 */
.touchActions [data-touch="jump"] {
  right: 6px;
  bottom: 98px;
  border-color: rgba(214, 236, 255, 0.62);
  background: radial-gradient(circle at 35% 28%, rgba(44, 72, 108, 0.74), rgba(10, 18, 32, 0.80));
  color: #f0f9ff;
}
.touchActions [data-touch="jump"]::before {
  clip-path: polygon(50% 6%, 94% 52%, 80% 66%, 60% 42%, 60% 94%, 40% 94%, 40% 42%, 20% 66%, 6% 52%);
}
.touchActions [data-touch="jump"].holding,
.touchActions [data-touch="jump"]:active {
  border-color: #ffffff;
  background: rgba(224, 242, 254, 0.92);
  color: #0a1829;
  text-shadow: none;
}
/* Outer Space Skill 1 — 锁定 */
.touchActions [data-touch="lock"] {
  right: 164px;
  bottom: 6px;
  width: 50px;
  height: 50px;
  font-size: 10.5px;
  border-color: rgba(251, 191, 36, 0.64);
  background: radial-gradient(circle at 35% 28%, rgba(112, 76, 18, 0.74), rgba(18, 16, 26, 0.80));
  color: #fde68a;
}
.touchActions [data-touch="lock"]::before {
  width: 15px;
  height: 15px;
  border: 2px solid currentColor;
  border-radius: 50%;
  background: transparent;
}
/* Outer Space Skill 2 — 下降 */
.touchActions [data-touch="descend"] {
  right: 146px;
  bottom: 68px;
  width: 50px;
  height: 50px;
  font-size: 10.5px;
  border-color: rgba(165, 180, 252, 0.64);
  background: radial-gradient(circle at 35% 28%, rgba(56, 62, 126, 0.74), rgba(14, 16, 34, 0.80));
  color: #c7d2fe;
}
.touchActions [data-touch="descend"]::before {
  width: 15px;
  height: 15px;
  clip-path: polygon(50% 6%, 94% 52%, 80% 66%, 60% 42%, 60% 94%, 40% 94%, 40% 42%, 20% 66%, 6% 52%);
  transform: rotate(180deg);
}
.touchActions .touchButton.touchSpaceOnly {
  display: none;
}
body.realm-space .touchActions .touchButton.touchSpaceOnly,
body.realm-cosmic-play .touchActions .touchButton.touchCosmicDescend {
  display: flex;
}

/* Bilibili Toy top-right native capsule clearance + compact landscape mobile rules (740x360) */
html[data-toy-landscape] .touchTopBar {
  right: 104px;
}
body.touch-mode #rightStack,
html[data-toy-landscape] #rightStack {
  top: 56px;
}
html[data-toy-landscape] .galTop {
  padding-right: 96px;
}
@media (max-width: 780px), (max-height: 540px) {
  #planetCard {
    min-width: 160px;
    padding: 5px 10px 6px;
  }
  .pcName { font-size: 11px; }
  .pcGrav { font-size: 9.5px; padding: 1px 5px; }
  .pcMeta { margin-top: 2px; font-size: 10px; }
  .pcMeta em { font-size: 11.5px; }
  .pcTrack { margin-top: 3px; }
  .smInfo {
    max-width: 215px;
    padding: 3px 8px 3px 5px;
    gap: 4px;
  }
  #spaceMarker.is-hardlock .smInfo {
    max-width: 232px;
  }
  .smBadge {
    padding: 1px 5px;
    font-size: 9px;
  }
  .smLabel,
  .smSub {
    font-size: 10.5px;
  }
  .amInfo {
    max-width: 196px;
    padding: 2px 8px;
    gap: 4px;
  }
  #aimMarker.is-hardlock .amInfo {
    max-width: 220px;
    padding: 3px 9px;
  }
  .amLabel,
  .amSub {
    font-size: 10px;
  }
  .bhWarnBox {
    top: 44px;
    max-width: 256px;
    max-width: min(256px, calc(100vw - 24px));
    padding: 5px 12px;
    border-width: 1.5px;
  }
  .bhWarnTitle {
    font-size: 12px;
    letter-spacing: 0.04em;
    white-space: nowrap;
  }
  .bhWarnSub {
    margin-top: 2px;
    font-size: 10px;
  }
}
@media (max-height: 540px) {
  #title {
    padding-right: 28px;
  }
  .tStage {
    width: 300px;
  }
  .tTitle {
    font-size: 38px;
    gap: 12px;
  }
  .tSubLine {
    margin-top: 8px;
  }
  .tMenu {
    margin-top: 14px;
    gap: 4px;
  }
  .mItem {
    padding: 6px 14px;
    font-size: 14px;
  }
  #sysCard {
    top: 8px;
    left: 10px;
    min-width: 150px;
    max-width: 162px;
    padding: 5px 8px 6px;
  }
  .sysName {
    font-size: 9.5px;
    letter-spacing: 0.14em;
  }
  .sysStat {
    margin-top: 1px;
    font-size: 19px;
  }
  .sysSub {
    margin-top: 1px;
    font-size: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .benchProgress {
    margin-top: 4px;
  }
  .benchProgressMeta {
    font-size: 9.5px;
    margin-bottom: 2px;
  }
  #planetCard {
    top: 8px;
    width: 192px;
    min-width: 160px;
    max-width: calc(100vw - 380px);
  }
  html[data-toy-landscape] #planetCard {
    left: 43%;
  }
  .touchTopBar {
    top: 8px;
    right: 10px;
    gap: 5px;
  }
  .touchTopBar .touchButton {
    padding: 5px 9px;
    font-size: 11px;
  }
  .touchActions {
    right: 14px;
    bottom: 10px;
    width: 214px;
    height: 158px;
  }
  .touchActions .touchButton {
    width: 56px;
    height: 56px;
    font-size: 11px;
  }
  .touchActions .touchButton[data-touch="suck"] {
    width: 80px;
    height: 80px;
    font-size: 13px;
  }
  .touchActions [data-touch="blast"] {
    right: 92px;
    bottom: 4px;
  }
  .touchActions [data-touch="jet"] {
    right: 72px;
    bottom: 70px;
  }
  .touchActions [data-touch="jump"] {
    right: 6px;
    bottom: 92px;
  }
  .touchActions [data-touch="lock"] {
    right: 158px;
    bottom: 6px;
    width: 48px;
    height: 48px;
  }
  .touchActions [data-touch="descend"] {
    right: 140px;
    bottom: 66px;
    width: 48px;
    height: 48px;
  }
  #rightStack {
    top: 10px;
    right: 10px;
    width: 192px;
  }
  body.touch-mode #rightStack,
  html[data-toy-landscape] #rightStack {
    top: 40px;
    right: 10px;
    width: 192px;
  }
  #taskCard {
    width: 192px;
    padding: 5px 8px 6px;
  }
  .taskHead {
    font-size: 9px;
  }
  .taskTitle {
    font-size: 11.5px;
    margin-top: 2px;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .taskDesc {
    font-size: 10px;
    margin-top: 2px;
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .taskGuide {
    display: none;
  }
  .taskTrack {
    margin-top: 4px;
    height: 4px;
  }
  .taskMeta {
    margin-top: 3px;
    font-size: 10.5px;
  }
  #toasts,
  body.realm-space #toasts {
    top: auto;
    bottom: 12px;
    left: 12px;
    transform: none;
    align-items: flex-start;
  }
  .toast {
    padding: 5px 11px 5px 10px;
    font-size: 11.5px;
    max-width: 280px;
    max-width: min(280px, calc(100vw - 246px));
    text-align: left;
  }
  #cosmicPrompt,
  body.cosmic-lattice #cosmicPrompt {
    top: auto;
    left: 12px;
    bottom: 12px;
    transform: none;
    width: 244px;
    max-width: calc(100vw - 244px);
    padding: 7px 12px 8px;
    text-align: left;
  }
  .cpTier {
    font-size: 11.5px;
    margin-bottom: 5px;
  }
  .cpBar {
    height: 4px;
    margin-bottom: 5px;
  }
  .cpHint {
    font-size: 10.5px;
  }
  #selfDevourHint {
    left: 12px;
    bottom: 14px;
    transform: none;
    padding: 7px 14px;
    gap: 5px;
    max-width: calc(100vw - 244px);
  }
  #selfDevourHint.is-holding {
    transform: scale(1.03);
  }
  .sdTitle {
    font-size: 11.5px;
    letter-spacing: 0.08em;
  }
  .sdTrack {
    width: 170px;
  }
  #galaxyOverlay {
    top: 8px;
    right: 10px;
    bottom: 8px;
    left: 10px;
    padding: 10px 14px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
  }
  .galMain {
    grid-template-columns: 1fr 220px;
    gap: 10px;
    margin-top: 8px;
  }
  #galaxyCanvas {
    min-height: 120px;
  }
  .galRoster {
    max-height: 76px;
    overflow-y: auto;
    overflow-x: auto;
    flex-wrap: nowrap;
  }
  .galTitle {
    font-size: 16px;
  }
}

.touchSpaceOnly {
  display: none;
}
body.realm-space .touchSpaceOnly,
body.realm-cosmic-play .touchCosmicDescend {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.touchButton {
  appearance: none;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(10, 15, 26, 0.56);
  backdrop-filter: blur(10px);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.touchTopBar .touchButton.primary {
  background: rgba(116, 255, 176, 0.24);
  border-color: rgba(116, 255, 176, 0.55);
}

#hyperwarpOverlay {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 86;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.22s ease;
  background: #02040a;
}
#hyperwarpOverlay.active {
  opacity: 1;
  pointer-events: auto;
}
#hyperwarpCanvas {
  width: 100%;
  height: 100%;
  display: block;
}
#hyperwarpLabel {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  padding: 18px 34px;
  border-radius: 8px;
  background: var(--glass-strong);
  border: 1px solid var(--line);
  backdrop-filter: blur(12px);
  box-shadow: 0 12px 48px rgba(4, 8, 16, 0.55);
}
.hwTop {
  font-size: 11px;
  letter-spacing: 0.28em;
  color: var(--accent);
  font-weight: 800;
}
.hwName {
  margin-top: 6px;
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 900;
  color: #ffffff;
}
.hwSub {
  margin-top: 4px;
  font-size: 13px;
  color: var(--muted);
}

.gsPlanetListTitle {
  font-size: 11.5px;
  font-weight: 700;
  color: #7dd3fc;
  letter-spacing: 0.06em;
  margin: 10px 0 6px;
}
.gsPlanetList {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
  max-height: 225px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}
.gsPlanetRow {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 10px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(125, 211, 252, 0.16);
}
.gsPlanetRow.is-dead {
  opacity: 0.52;
}
.gsPRIcon {
  font-size: 18px;
  flex: none;
}
.gsPRInfo {
  flex: 1;
  min-width: 0;
}
.gsPRInfo b {
  display: block;
  font-size: 12.5px;
  color: #f4fbff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gsPRInfo small {
  display: block;
  font-size: 10.5px;
  color: rgba(190, 224, 245, 0.72);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gsPRTag {
  font-style: normal;
  font-size: 10.5px;
  font-weight: 700;
  color: #74ffb0;
  flex: none;
}
.gsPlanetRow.is-dead .gsPRTag {
  color: #fb7185;
}

.setGrid {
  display: grid;
  gap: 8px;
  flex: 1;
  min-width: 240px;
}
.setRow {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
}
.setRow span {
  min-width: 92px;
  color: rgba(235, 244, 255, 0.88);
}
.setRow input[type='range'] {
  flex: 1;
  accent-color: var(--accent);
}
.setRow em {
  font-style: normal;
  min-width: 48px;
  text-align: right;
  font-family: var(--font-display);
  color: var(--accent);
}

@media (max-width: 960px) and (min-height: 541px) {
  #sysCard {
    left: 12px;
    left: max(12px, env(safe-area-inset-left));
    min-width: 176px;
    max-width: 210px;
    max-width: min(210px, calc(100vw - 24px));
    padding: 5px 10px 6px;
  }
  body.touch-mode #sysCard {
    top: 50px;
    top: calc(max(10px, env(safe-area-inset-top)) + 40px);
  }
  #sysCard .sysName {
    font-size: 9.5px;
    letter-spacing: 0.16em;
  }
  #sysCard .sysStat {
    font-size: 21px;
    margin-top: 1px;
  }
  #sysCard .sysSub {
    margin-top: 1px;
    font-size: 10.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  #sysCard .benchProgress {
    margin-top: 4px;
  }
  #sysCard .benchProgressMeta {
    font-size: 10px;
    margin-bottom: 2px;
  }
  #rightStack,
  body.touch-mode #rightStack,
  html[data-toy-landscape] #rightStack {
    left: 12px;
    left: max(12px, env(safe-area-inset-left));
    right: auto;
    top: 148px;
    top: calc(max(10px, env(safe-area-inset-top)) + 138px);
    width: 228px;
    width: min(228px, calc(100vw - 24px));
  }
  #taskCard {
    width: 228px;
    width: min(228px, calc(100vw - 24px));
    padding: 6px 10px 7px 11px;
  }
  #taskCard .taskHead {
    font-size: 9.5px;
  }
  #taskCard .taskTitle {
    font-size: 12.5px;
    margin-top: 2px;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  #taskCard .taskDesc {
    font-size: 10.5px;
    margin-top: 2px;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  #taskCard .taskGuide {
    display: none;
  }
  #taskCard .taskTrack {
    margin-top: 5px;
    height: 4px;
  }
  #taskCard .taskMeta {
    margin-top: 3px;
    font-size: 11px;
  }
  #planetCard {
    left: 12px;
    left: max(12px, env(safe-area-inset-left));
    right: auto;
    transform: none;
    top: 256px;
    top: calc(max(10px, env(safe-area-inset-top)) + 246px);
    width: 228px;
    width: min(228px, calc(100vw - 24px));
    min-width: 0;
    padding: 6px 10px 7px;
  }
  .bhWarnBox {
    top: 56px;
    left: auto;
    right: 12px;
    transform: none;
    max-width: calc(100vw - 24px);
  }
}

@media (max-width: 780px) and (min-height: 541px) {
  #galaxyOverlay {
    top: 10px;
    right: 10px;
    bottom: 10px;
    left: 10px;
    padding: 12px 14px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
  }
  .galMain {
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: 10px;
  }
  #galaxyCanvas {
    min-height: 200px;
  }
}

@media (max-width: 760px) and (min-height: 541px) {
  body.realm-space #toasts {
    bottom: 200px;
    bottom: max(200px, calc(env(safe-area-inset-bottom) + 188px));
  }
  #cosmicPrompt,
  #selfDevourHint {
    bottom: 196px;
    bottom: max(196px, calc(env(safe-area-inset-bottom) + 184px));
  }
}

#cineHud {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  pointer-events: none;
  z-index: 16;
}
#cineHud[hidden] {
  display: none;
}
.cineBar {
  position: absolute;
  left: 0;
  right: 0;
  height: 52px;
  background: linear-gradient(180deg, rgba(4, 7, 14, 0.96), rgba(4, 7, 14, 0.80));
}
.cineBarTop {
  top: 0;
  border-bottom: 1px solid rgba(255, 209, 102, 0.22);
}
.cineBarBot {
  bottom: 0;
  background: linear-gradient(0deg, rgba(4, 7, 14, 0.96), rgba(4, 7, 14, 0.80));
  border-top: 1px solid rgba(255, 209, 102, 0.22);
}

#cosmicPrompt {
  position: fixed;
  left: 50%;
  bottom: 42px;
  bottom: max(42px, calc(env(safe-area-inset-bottom) + 34px));
  transform: translateX(-50%);
  width: 340px;
  width: min(340px, calc(100vw - 48px));
  padding: 12px 18px 13px;
  border-radius: 10px;
  background: rgba(7, 12, 24, 0.72);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 209, 102, 0.34);
  box-shadow: 0 12px 32px rgba(2, 6, 16, 0.50);
  text-align: center;
  pointer-events: none;
  z-index: 22;
  transition: border-color 0.22s ease, box-shadow 0.22s ease, opacity 0.22s ease;
}
#cosmicPrompt[hidden] {
  display: none;
}
#cosmicPrompt.is-holding {
  border-color: rgba(116, 255, 176, 0.65);
  box-shadow: 0 12px 38px rgba(16, 185, 129, 0.28), 0 0 22px rgba(255, 209, 102, 0.22);
}
body.cosmic-lattice #cosmicPrompt {
  top: 18px;
  top: max(18px, env(safe-area-inset-top));
  bottom: auto;
  width: 400px;
  width: min(400px, calc(100vw - 260px));
  padding: 10px 18px 11px;
  background: rgba(6, 10, 18, 0.80);
  border-color: rgba(255, 209, 102, 0.42);
}
@media (max-width: 760px) and (min-height: 541px) {
  body.cosmic-lattice #cosmicPrompt {
    top: 56px;
    top: calc(max(12px, env(safe-area-inset-top)) + 44px);
    width: 300px;
    width: min(300px, calc(100vw - 32px));
  }
}
.cpTier {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: #ffe8a3;
  margin-bottom: 8px;
}
.cpBar {
  width: 100%;
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  overflow: hidden;
  margin-bottom: 8px;
}
.cpFill {
  width: 0%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #34d399, #ffd166);
  transition: width 0.08s linear;
}
.cpHint {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: rgba(241, 245, 249, 0.86);
}

#cosmicDone {
  position: fixed;
  left: 50%;
  bottom: 46px;
  bottom: max(46px, calc(env(safe-area-inset-bottom) + 38px));
  transform: translateX(-50%);
  display: flex;
  gap: 12px;
  z-index: 24;
}
#cosmicDone[hidden] {
  display: none;
}

body.cosmic-outer-void #banner,
body.cosmic-void-white #banner {
  top: 17%;
}
body.cosmic-void-white #banner .bTop {
  color: #059669;
  text-shadow: none;
}
body.cosmic-void-white #banner .bMain {
  color: #0f172a;
  text-shadow: 0 2px 14px rgba(15, 23, 42, 0.14);
}
body.cosmic-void-white #banner .bSub {
  color: #334155;
  text-shadow: none;
}
body.cosmic-void-white #cosmicDone .pBtn {
  background: rgba(15, 23, 42, 0.88);
  border-color: rgba(15, 23, 42, 0.92);
  color: #f8fafc;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.20);
}
body.cosmic-void-white #cosmicDone .pBtn.is-active {
  background: #059669;
  border-color: #047857;
  color: #ffffff;
}
#cosmicFlash {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 26;
  opacity: 0;
  background: #ffffff;
}
#cosmicFlash.is-invert {
  background: #050811;
}
#uiDevourLayer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
  z-index: 44;
}
#uiDevourLayer[hidden] {
  display: none;
}

.uidPiece {
  position: fixed;
  top: 0;
  left: 0;
  will-change: transform, opacity;
  transform-origin: center center;
  box-sizing: border-box;
  user-select: none;
  pointer-events: none;
}
.uidPiece.is-pulled {
  filter: drop-shadow(0 0 12px rgba(116, 255, 176, 0.55));
}

.uidKeyPill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  border-radius: 7px;
  background: rgba(12, 16, 28, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #e2e8f0;
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.42);
}
.uidKeyPill kbd {
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
}

/* Act 1 Fourth-Wall-Breaking Tutorial Subtitle (the very first edible UI piece!) */
.uidTutCard {
  padding: 13px 22px 14px;
  border-radius: 12px;
  background: rgba(8, 13, 24, 0.90);
  border: 1px solid rgba(148, 163, 184, 0.34);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.62);
  text-align: center;
  font-family: var(--font-ui);
  line-height: 1.5;
}
.uidTutTag {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.22em;
  color: #74ffb0;
  margin-bottom: 5px;
}
.uidTutLine {
  font-size: 14px;
  font-weight: 700;
  color: #f1f5f9;
  letter-spacing: 0.03em;
}
.uidTutSub {
  margin-top: 4px;
  font-size: 13px;
  font-weight: 600;
  color: #cbd5e1;
}
.uidTutSub kbd {
  display: inline-block;
  padding: 1px 7px;
  margin: 0 2px;
  border-radius: 4px;
  background: rgba(116, 255, 176, 0.16);
  border: 1px solid rgba(116, 255, 176, 0.45);
  color: #a7f3d0;
  font-size: 12px;
  font-weight: 800;
  font-family: var(--font-ui);
}
.uidTutCard.is-panic {
  background: rgba(38, 12, 16, 0.94);
  border-color: rgba(251, 146, 60, 0.72);
  box-shadow: 0 0 24px rgba(249, 115, 22, 0.45);
}
.uidTutCard.is-panic .uidTutTag {
  color: #fb923c;
}
.uidTutCard.is-panic .uidTutLine {
  color: #fef08a;
  font-weight: 900;
}
.uidTutCard.is-panic .uidTutSub {
  color: #fdba74;
}
@media (max-width: 820px), (max-height: 460px) {
  .uidTutCard {
    padding: 9px 14px 10px;
  }
  .uidTutLine {
    font-size: 12.5px;
  }
  .uidTutSub {
    font-size: 11.5px;
  }
}

/* Rolling End Credits (桃天帝不差 Solo Staff Roll) */
.uidCreditLine {
  text-align: center;
  font-family: var(--font-ui);
  color: #f8fafc;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.72);
  white-space: nowrap;
}
.uidCreditLine .ucRole {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.24em;
  color: #ffd166;
  margin-bottom: 4px;
}
.uidCreditLine .ucName {
  display: block;
  font-size: 27px;
  font-weight: 900;
  letter-spacing: 0.14em;
  color: #ffffff;
}
.uidCreditLine.is-title .ucName {
  font-size: 38px;
  color: #74ffb0;
  letter-spacing: 0.20em;
}
.uidCreditChar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-ui);
  font-size: 28px;
  font-weight: 900;
  color: #ffffff;
  text-shadow: 0 0 12px rgba(116, 255, 176, 0.55);
}

/* =====================================================================
   ACT 3: 1:1 AUTHENTIC LIGHT-MODE CHROME + REAL BILIBILI TOY WEB PLAYER
   ===================================================================== */
.uidBrowserTop {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  height: 36px;
  padding: 0 0 0 8px;
  background: linear-gradient(90deg, #f8e2d6, #f4dbd0);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
  color: #1f2937;
}
.uidTabStrip {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 32px;
  overflow: hidden;
}
.uidTab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 30px;
  padding: 0 11px;
  border-radius: 9px 9px 0 0;
  font-size: 11.5px;
  font-weight: 500;
  white-space: nowrap;
  max-width: 175px;
  overflow: hidden;
}
.uidTab.is-active {
  background: #ffffff;
  color: #111827;
  font-weight: 600;
  box-shadow: 0 -1px 4px rgba(0, 0, 0, 0.06);
}
.uidTab.is-inactive {
  background: transparent;
  color: #4b5563;
  border-right: 1px solid rgba(0, 0, 0, 0.10);
  border-radius: 0;
  height: 22px;
  margin-bottom: 4px;
}
.uidTabX {
  margin-left: 6px;
  opacity: 0.55;
  font-size: 13px;
}
.uidTabPlus {
  padding: 0 10px 5px;
  color: #4b5563;
  font-size: 16px;
}
.uidTabGlyph {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  color: #ffffff;
  font-size: 9px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.uidTabDot {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #a7f3d0, #10b981 65%, #065f46);
  display: inline-block;
  flex-shrink: 0;
}
.uidWinBtns {
  display: flex;
  align-items: stretch;
  height: 36px;
}
.uidWinBtn {
  width: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: #1f2937;
}
.uidWinBtn.is-close {
  font-size: 15px;
}
.uidBrowserNav {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 12px;
  background: #ffffff;
  font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
  color: #4b5563;
}
.uidNavGlyph {
  font-size: 14px;
  width: 24px;
  text-align: center;
  color: #374151;
}
.uidNavGlyph.is-dim {
  opacity: 0.35;
}
.uidOmnibox {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  background: #f1f3f4;
  color: #1f2937;
  font-size: 12.5px;
  font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
}
.uidUrlText {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.uidTuneIcon {
  color: #5f6368;
  font-size: 12px;
}
.uidStarIcon {
  color: #5f6368;
  font-size: 14px;
}
.uidBookmarksBar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 28px;
  padding: 0 14px;
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
  font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
  color: #374151;
  font-size: 11.5px;
}
.uidBmList {
  display: flex;
  align-items: center;
  gap: 14px;
  overflow: hidden;
  white-space: nowrap;
}
.uidBmItem {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.uidBmAll {
  color: #4b5563;
  white-space: nowrap;
}

/* Exact Real Bilibili Toy Right Vertical Dark Action Rail */
.uidToyRailBg {
  background: #090a0d;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
}
.uidToyRailCluster {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  font-family: "Microsoft YaHei", var(--font-ui);
  color: #cbd5e1;
}
.uidToyGlobe {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.uidToyAuthor {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #fbbf24, #ea580c);
  border: 2px solid rgba(255, 255, 255, 0.72);
  color: #ffffff;
  font-weight: 900;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.uidToyBtn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 16px;
  color: #e2e8f0;
}
.uidToyBtn em {
  font-style: normal;
  font-size: 10.5px;
  color: #9ca3af;
}
.uidToyBtn.is-nav em {
  font-size: 9.5px;
  white-space: nowrap;
}

/* =====================================================================
   ACT 4: 1:1 AUTHENTIC LIGHT-MODE WINDOWS 11 DESKTOP & FROSTED TASKBAR
   ===================================================================== */
.uidWin11Icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
  width: 78px;
  padding: 5px 4px;
  border-radius: 4px;
  font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
  color: #ffffff;
  font-size: 11px;
  font-weight: 500;
  text-align: center;
  line-height: 1.25;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.88), 0 0 2px rgba(0, 0, 0, 0.92);
}
.uidWin11Icon svg {
  width: 38px;
  height: 38px;
  display: block;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.34));
}

.uidWin11Window {
  border-radius: 8px;
  background: rgba(248, 250, 252, 0.94);
  border: 1px solid rgba(15, 23, 42, 0.14);
  box-shadow: 0 18px 46px rgba(15, 23, 42, 0.24);
  font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
  color: #0f172a;
  overflow: hidden;
}
.uidWin11Titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 32px;
  padding: 0 0 0 12px;
  background: rgba(241, 245, 249, 0.96);
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  font-size: 12px;
  font-weight: 600;
  color: #1e293b;
}
.uidWin11Body {
  padding: 10px 12px;
  font-size: 11.5px;
  font-family: Consolas, "Microsoft YaHei", monospace;
}
.uidTmRow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 6px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.07);
  color: #334155;
}
.uidTmRow.is-head {
  color: #64748b;
  font-size: 11px;
}
.uidTmRow.is-hot {
  background: rgba(239, 68, 68, 0.16);
  color: #b91c1c;
  font-weight: 800;
}

.uidWin11TaskbarBg {
  height: 44px;
  background: rgba(243, 246, 252, 0.90);
  border-top: 1px solid rgba(15, 23, 42, 0.09);
  backdrop-filter: blur(22px);
}
.uidTbWidget {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 8px;
  border-radius: 5px;
  font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
  color: #0f172a;
  font-size: 11.5px;
}
.uidTbStartCluster {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 36px;
}
.uidTbApp {
  width: 36px;
  height: 36px;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.uidTbApp.is-active {
  background: rgba(15, 23, 42, 0.07);
  border-bottom: 2px solid #0078d4;
}
.uidTbSearch {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 158px;
  height: 28px;
  padding: 0 11px;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.12);
  color: #475569;
  font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
  font-size: 11.5px;
}
.uidTbTray {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 36px;
  padding: 0 10px;
  font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
  color: #0f172a;
  font-size: 11px;
}
.uidTbClock {
  text-align: right;
  line-height: 1.22;
}

/* Hide desktop HUD chrome during Eat-the-UI while keeping #touchControls playable on mobile! */
body.ui-devour-active #sysCard,
body.ui-devour-active #planetCard,
body.ui-devour-active #rightStack,
body.ui-devour-active #spaceMarker,
body.ui-devour-active #reticle,
body.ui-devour-active #keys,
body.ui-devour-active #cosmicPrompt,
body.ui-devour-active #banner,
body.ui-devour-active #toasts,
body.ui-devour-active #cineHud {
  display: none !important;
  visibility: hidden !important;
}
body.ui-devour-active:not(.ui-devour-done) #cosmicDone {
  display: none !important;
  visibility: hidden !important;
}
body.ui-devour-done #touchControls {
  display: none !important;
}

/* Act 6A: Minimalist Dark-Ink Self-Devour Prompt in Spotless White Void */
#selfDevourHint {
  position: fixed;
  left: 50%;
  bottom: 52px;
  transform: translateX(-50%);
  z-index: 64;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(15, 23, 42, 0.14);
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.08);
  transition: transform 0.2s ease, border-color 0.2s ease;
}
#selfDevourHint[hidden] { display: none; }
#selfDevourHint.is-holding {
  transform: translateX(-50%) scale(1.04);
  border-color: rgba(16, 185, 129, 0.55);
}
.sdTitle {
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: #0f172a;
}
.sdTrack {
  width: 220px;
  height: 4px;
  border-radius: 99px;
  background: rgba(15, 23, 42, 0.12);
  overflow: hidden;
}
#sdFill {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, #10b981, #059669);
}

/* Act 6B: Ouroboros Epilogue Card over Sunlit Indestructible City Floor */
body.ui-devour-done #cosmicDone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  bottom: 36px;
  padding: 18px 26px;
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.84);
  border: 1px solid rgba(116, 255, 176, 0.35);
  box-shadow: 0 20px 54px rgba(15, 23, 42, 0.35);
  backdrop-filter: blur(14px);
  z-index: 70;
}
.cdEpitaph {
  text-align: center;
}
.cdEpitaph[hidden] { display: none; }
.cdEyebrow {
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.22em;
  color: #6ee7b7;
  margin-bottom: 4px;
}
.cdHeadline {
  font-family: var(--font-ui);
  font-size: 16px;
  font-weight: 800;
  color: #f8fafc;
  letter-spacing: 0.04em;
}
.cdBtns {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}
.cdRunTime {
  margin-top: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 5px 14px;
  border-radius: 999px;
  background: rgba(255, 209, 102, 0.12);
  border: 1px solid rgba(255, 209, 102, 0.38);
  font-family: var(--font-ui);
  font-size: 12px;
  color: #e2e8f0;
}
.cdRunTime[hidden] { display: none; }
.cdRunTime b {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 400;
  letter-spacing: 0.06em;
  color: var(--gold);
}
.cdRunTime .cdNewRec {
  font-style: normal;
  font-size: 10px;
  font-weight: 800;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--gold);
  color: #090e18;
}
.cdRunTime .cdBest {
  font-size: 11px;
  color: var(--muted);
}
.cdRunTime .cdMuted {
  font-size: 11.5px;
  color: var(--muted);
}

/* ==================== SYSTEM PANEL TABS & BILIBILI TOY LEADERBOARD ==================== */
.pTabs {
  display: inline-flex;
  gap: 4px;
  padding: 3px;
  margin-right: auto;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.10);
}
.pTab {
  appearance: none;
  border: 0;
  border-radius: 4px;
  padding: 5px 12px;
  background: transparent;
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease;
}
.pTab:hover { color: #ffffff; }
.pTab.is-active {
  background: linear-gradient(135deg, rgba(255, 209, 102, 0.22), rgba(124, 231, 255, 0.16));
  color: var(--gold);
  box-shadow: inset 0 0 0 1px rgba(255, 209, 102, 0.45);
}

.hostBanner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-radius: 8px;
  background: linear-gradient(95deg, rgba(255, 209, 102, 0.12), rgba(124, 231, 255, 0.07) 58%, rgba(255, 255, 255, 0.03));
  border: 1px solid rgba(255, 209, 102, 0.28);
}
.hostMeta { min-width: 0; flex: 1; }
.hostNameRow {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.hostName {
  font-size: 16px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 0.03em;
}
.hostRankPill {
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  color: #090e18;
  background: var(--gold);
}
.hostSubRow { margin-top: 4px; }
.hostTag {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--muted);
}
.hostTag.is-ok { color: var(--cyan); }
.hostAvatar, .rankAvatar {
  position: relative;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: linear-gradient(135deg, #273859, #151e31);
  color: var(--gold);
  font-style: normal;
  font-weight: 800;
}
.hostAvatar {
  width: 42px;
  height: 42px;
  font-size: 16px;
  border: 2px solid var(--gold);
  box-shadow: 0 0 0 3px rgba(255, 209, 102, 0.16), 0 0 18px rgba(124, 231, 255, 0.22);
}
.rankAvatar {
  width: 30px;
  height: 30px;
  font-size: 12px;
  border: 1px solid rgba(255, 255, 255, 0.26);
}
.hostAvatar em, .rankAvatar em { font-style: normal; line-height: 1; }
.hostAvatar img, .rankAvatar img {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.hostTier {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  white-space: nowrap;
  background: rgba(148, 163, 184, 0.2);
  color: #e2e8f0;
  border: 1px solid rgba(148, 163, 184, 0.35);
}
.hostTier.tier-rare { background: rgba(124, 231, 255, 0.14); color: var(--cyan); border-color: rgba(124, 231, 255, 0.45); }
.hostTier.tier-epic { background: rgba(192, 132, 252, 0.18); color: #e9d5ff; border-color: rgba(192, 132, 252, 0.50); }
.hostTier.tier-mythic { background: rgba(251, 146, 60, 0.20); color: #fed7aa; border-color: rgba(251, 146, 60, 0.55); }
.hostTier.tier-legend {
  background: linear-gradient(135deg, rgba(255, 209, 102, 0.26), rgba(116, 255, 176, 0.24));
  color: var(--gold);
  border-color: rgba(255, 209, 102, 0.70);
  box-shadow: 0 0 12px rgba(255, 209, 102, 0.22);
}

.rankRoot {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.rankControls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}
.rankBoards, .rankPeriods {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.rankChip, .rankPeriod, .rankRefresh {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 4px;
  padding: 5px 11px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.rankChip:hover, .rankPeriod:hover, .rankRefresh:hover {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.30);
}
.rankChip.is-active {
  background: rgba(255, 209, 102, 0.18);
  border-color: rgba(255, 209, 102, 0.65);
  color: var(--gold);
}
.rankPeriod.is-active {
  background: rgba(124, 231, 255, 0.16);
  border-color: rgba(124, 231, 255, 0.55);
  color: var(--cyan);
}
.rankMyBar {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 13px;
  border-radius: 7px;
  background: linear-gradient(95deg, rgba(255, 209, 102, 0.16), rgba(124, 231, 255, 0.08));
  border: 1px solid rgba(255, 209, 102, 0.45);
}
.rankMyBar[hidden] { display: none; }
.rankMyPos {
  font-family: var(--font-display);
  font-size: 20px;
  color: var(--gold);
  min-width: 44px;
  text-align: center;
}
.rankMyInfo {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.rankMyInfo strong { font-size: 14px; color: #ffffff; }
.rankMyInfo span { font-size: 11px; color: var(--muted); }
.rankList {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 360px;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.22) transparent;
}
.rankRow {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 8px 12px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.rankRow.is-self {
  background: rgba(255, 209, 102, 0.10);
  border-color: rgba(255, 209, 102, 0.45);
}
.rankNum {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  font-family: var(--font-display);
  font-size: 15px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.06);
}
.rankRow.is-top-1 .rankNum { background: linear-gradient(135deg, #ffe27a, #f59e0b); color: #1f1402; }
.rankRow.is-top-2 .rankNum { background: linear-gradient(135deg, #f1f5f9, #94a3b8); color: #0f172a; }
.rankRow.is-top-3 .rankNum { background: linear-gradient(135deg, #fdba74, #c2410c); color: #1c0a00; }
.rankUser {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.rankName {
  font-size: 13px;
  font-weight: 700;
  color: #f8fafc;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rankName em {
  font-style: normal;
  font-size: 10px;
  margin-left: 6px;
  padding: 1px 5px;
  border-radius: 3px;
  background: var(--gold);
  color: #090e18;
  font-weight: 800;
}
.rankUser small { font-size: 11px; color: var(--muted); }
.rankScore {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--gold);
  white-space: nowrap;
}
.rankEmpty {
  padding: 36px 16px;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  border-radius: 6px;
  border: 1px dashed rgba(255, 255, 255, 0.14);
}
@media (max-height: 540px) {
  .pTab { padding: 4px 9px; font-size: 12px; }
  .rankList { max-height: 220px; }
}
@media (max-width: 560px) {
  .pTabs { margin-right: 0; }
  .pTab { padding: 4px 9px; font-size: 12px; }
}

/* ==================== FOLLOW-TO-UNLOCK & URBAN FINALE MODALS ==================== */
.pCard.unlockCard {
  background: linear-gradient(135deg, rgba(255, 209, 102, 0.12), rgba(116, 255, 176, 0.08));
  border-color: rgba(255, 209, 102, 0.45);
}
.endlessActions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.endlessFollow,
.endlessCheck,
.endlessPreview {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 6px 14px;
  border-radius: 5px;
  font-family: var(--font-ui);
  font-size: 12.5px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease, transform 0.14s ease;
}
.endlessFollow {
  background: var(--gold);
  color: #090e18;
  border: 1px solid var(--gold);
}
.endlessFollow:hover {
  background: #ffe39b;
  transform: translateY(-1px);
}
.endlessCheck {
  background: rgba(255, 255, 255, 0.10);
  color: #f8fafc;
  border: 1px solid rgba(255, 255, 255, 0.22);
}
.endlessCheck:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.18);
}
.endlessCheck:disabled {
  opacity: 0.6;
  cursor: default;
}
.endlessPreview {
  background: rgba(124, 231, 255, 0.14);
  color: var(--cyan);
  border: 1px solid rgba(124, 231, 255, 0.45);
}
.endlessPreview:hover {
  background: rgba(124, 231, 255, 0.26);
  color: #ffffff;
}

#urbanFinale,
#unlockModal {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: calc(100% - 28px);
  max-width: 560px;
  max-height: calc(100% - 20px);
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  padding: 22px 26px;
  text-align: center;
  z-index: 90;
  pointer-events: auto;
  background: var(--glass-strong);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  border-radius: 10px;
  border: 1px solid rgba(255, 209, 102, 0.34);
  box-shadow: 0 22px 64px rgba(4, 8, 18, 0.65);
}
#unlockModal {
  max-width: 480px;
}
#urbanFinale[hidden],
#unlockModal[hidden] {
  display: none;
}
.fTag,
.uTag {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.26em;
  color: var(--cyan);
}
.fTitle {
  font-family: var(--font-ui);
  font-weight: 900;
  font-size: 42px;
  margin: 6px 0 4px;
  color: #ffffff;
  letter-spacing: 0.16em;
  text-shadow: 0 4px 24px rgba(116, 255, 176, 0.45), 0 0 18px rgba(255, 209, 102, 0.35);
}
.uTitle {
  font-family: var(--font-ui);
  font-weight: 900;
  font-size: 28px;
  margin: 8px 0 6px;
  color: #ffffff;
  letter-spacing: 0.08em;
}
.fHost {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px 4px 6px;
  margin: 2px 0 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 209, 102, 0.35);
}
.fHost[hidden] { display: none; }
.fHostName {
  font-size: 13px;
  font-weight: 800;
  color: #ffffff;
}
.fSub,
.uSub {
  margin: 0 0 14px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--gold);
}
.fStats {
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  padding: 6px 4px;
  margin-bottom: 12px;
  text-align: left;
}
.fStats .pRow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 4px;
  font-size: 13px;
  color: var(--muted);
}
.fStats .pRow + .pRow {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.fStats .pRow b {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: #ffffff;
}
#finaleEndless,
#unlockModalCard {
  text-align: left;
  margin-bottom: 14px;
}
#finaleEndless[hidden] { display: none; }
.fActions {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}
.fPrimary,
.fSecondary {
  appearance: none;
  min-height: 38px;
  padding: 8px 18px;
  border-radius: 6px;
  font-family: var(--font-ui);
  font-size: 13.5px;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease, transform 0.14s ease;
}
.fPrimary {
  background: linear-gradient(135deg, #ffd166, #6ee7b7);
  color: #061812;
  border: 0;
  box-shadow: 0 6px 22px rgba(255, 209, 102, 0.28);
}
.fPrimary:hover {
  transform: translateY(-1px);
}
.fPrimary[hidden] { display: none; }
.fSecondary {
  background: rgba(255, 255, 255, 0.10);
  color: #e2e8f0;
  border: 1px solid rgba(255, 255, 255, 0.22);
}
.fSecondary:hover {
  background: rgba(255, 255, 255, 0.20);
  color: #ffffff;
}
.fSecondary.danger {
  border-color: rgba(255, 84, 104, 0.45);
  background: rgba(255, 84, 104, 0.14);
  color: #ff99a6;
}
.fSecondary.danger:hover {
  background: rgba(255, 84, 104, 0.28);
  color: #ffffff;
}
@media (max-height: 540px) {
  #urbanFinale,
  #unlockModal {
    top: 8px;
    bottom: 8px;
    transform: translateX(-50%);
    width: calc(100% - 20px);
    max-width: 560px;
    max-height: calc(100% - 16px);
    height: auto;
    padding: 12px 16px;
  }
  .fTitle { font-size: 26px; }
  .uTitle { font-size: 20px; }
  .fSub, .uSub { margin-bottom: 10px; font-size: 12px; }
  .fStats .pRow { padding: 4px 2px; font-size: 12px; }
}
/* Mobile landscape final-cascade overrides for late-defined Cosmic & Self-Devour prompts */
@media (max-height: 540px) {
  #cosmicPrompt,
  body.cosmic-lattice #cosmicPrompt {
    top: auto;
    left: 12px;
    bottom: 12px;
    transform: none;
    width: 244px;
    max-width: calc(100vw - 244px);
    padding: 7px 12px 8px;
    text-align: left;
  }
  .cpTier {
    font-size: 11.5px;
    margin-bottom: 5px;
  }
  .cpBar {
    height: 4px;
    margin-bottom: 5px;
  }
  .cpHint {
    font-size: 10.5px;
  }
  #selfDevourHint {
    left: 12px;
    bottom: 14px;
    transform: none;
    padding: 7px 14px;
    gap: 5px;
    max-width: calc(100vw - 244px);
  }
  #selfDevourHint.is-holding {
    transform: scale(1.03);
  }
  .sdTitle {
    font-size: 11.5px;
    letter-spacing: 0.08em;
  }
  .sdTrack {
    width: 170px;
  }
}
@media (max-width: 760px) and (min-height: 541px) {
  #cosmicPrompt,
  #selfDevourHint {
    bottom: 196px;
    bottom: max(196px, calc(env(safe-area-inset-bottom) + 184px));
  }
}
/* Mobile WebGL FPS protection: disable live backdrop-filter blur over 60fps 3D canvas (matches 《指数之速》). */
.touch-input .holo,
.touch-input .touchButton,
.touch-input .toast,
.touch-input #panel,
.touch-input #urbanFinale,
.touch-input #unlockModal,
.touch-input #galaxyOverlay,
body.touch-mode .holo,
body.touch-mode .touchButton,
body.touch-mode .toast {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.touch-input .holo,
body.touch-mode .holo {
  background: rgba(10, 15, 26, 0.72);
}
.touch-input .touchButton,
body.touch-mode .touchButton {
  background: rgba(10, 15, 26, 0.70);
}
.touch-input #panel,
.touch-input #urbanFinale,
.touch-input #unlockModal {
  background: rgba(9, 14, 24, 0.94);
}
