:root {
  --glass: rgba(10, 15, 26, 0.56);
  --glass-strong: rgba(9, 14, 24, 0.84);
  --line: rgba(255, 255, 255, 0.15);
  --gold: #ffd166;
  --cyan: #7ce7ff;
  --red: #ff5468;
  --text: #f8fafc;
  --muted: rgba(241, 245, 249, 0.74);
  --ui-font: "Noto Sans SC", "MiSans", "HarmonyOS Sans SC", "Source Han Sans SC", "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
  --serif-font: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "SimSun", serif;
  --num-font: "Anton", "Impact", sans-serif;
}

* {
  box-sizing: border-box;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}
html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  background: #0b1424;
  color: var(--text);
  font-family: var(--ui-font);
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
#scene { position: fixed; top: 0; right: 0; bottom: 0; left: 0; width: 100%; height: 100%; display: block; touch-action: none; ime-mode: disabled; }
[hidden] { display: none !important; }

kbd {
  display: inline-block;
  font-family: var(--ui-font);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.3;
  padding: 1px 6px;
  margin-right: 4px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #fff;
}

.holo {
  position: absolute;
  background: var(--glass);
  backdrop-filter: blur(14px) saturate(145%);
  -webkit-backdrop-filter: blur(14px) saturate(145%);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: 0 10px 30px rgba(4, 8, 16, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  padding: 11px 16px;
}

/* ==================== IN-GAME HUD ==================== */
#hud { position: fixed; top: 0; right: 0; bottom: 0; left: 0; pointer-events: none; z-index: 3; }
#hud.hudEnter { animation: hudIn 0.42s cubic-bezier(0.22, 1, 0.36, 1); }
@keyframes hudIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

#sysCard {
  left: 24px;
  top: 22px;
  min-width: 242px;
  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;
}
.sysHost {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 2px 7px 2px 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 209, 102, 0.28);
}
.sysHost[hidden] { display: none; }
.sysHostName {
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  max-width: 112px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sysAvatar, .hostAvatar, .rankAvatar, .hostAvatarSm {
  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;
}
.sysAvatar { width: 20px; height: 20px; font-size: 10px; border: 1px solid rgba(255, 209, 102, 0.72); }
.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(103, 232, 249, 0.22);
}
.hostAvatarSm { width: 28px; height: 28px; font-size: 12px; border: 1.5px solid var(--gold); }
.rankAvatar { width: 30px; height: 30px; font-size: 12px; border: 1px solid rgba(255, 255, 255, 0.26); }
.sysAvatar em, .hostAvatar em, .rankAvatar em, .hostAvatarSm em { font-style: normal; line-height: 1; }
.sysAvatar img, .hostAvatar img, .rankAvatar img, .hostAvatarSm 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(103, 232, 249, 0.14); color: var(--cyan); border-color: rgba(103, 232, 249, 0.45); }
.hostTier.tier-epic { background: rgba(192, 132, 252, 0.18); color: #e9d5ff; border-color: rgba(192, 132, 252, 0.5); }
.hostTier.tier-mythic { background: rgba(251, 146, 60, 0.2); color: #fed7aa; border-color: rgba(251, 146, 60, 0.55); }
.hostTier.tier-legend {
  background: linear-gradient(135deg, rgba(255, 209, 102, 0.26), rgba(255, 122, 61, 0.26));
  color: var(--gold);
  border-color: rgba(255, 209, 102, 0.7);
  box-shadow: 0 0 12px rgba(255, 209, 102, 0.22);
}
.sysStat {
  font-family: var(--num-font);
  font-size: 32px;
  line-height: 1.08;
  color: var(--gold);
  margin-top: 3px;
  letter-spacing: 0.04em;
  white-space: nowrap;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.38);
  transform-origin: left center;
}
.sysStat small {
  font-family: var(--ui-font);
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.08em;
  margin-right: 7px;
}
.sysSub {
  font-size: 12px;
  color: rgba(248, 250, 252, 0.86);
  margin-top: 3px;
  min-height: 16px;
}

#taskCard {
  right: 24px;
  top: 22px;
  width: 288px;
  border-right: 3px solid var(--cyan);
}
.taskHead {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.22em;
  color: var(--cyan);
}
.taskTitle {
  font-size: 16px;
  font-weight: 800;
  margin-top: 4px;
  color: #fff;
  letter-spacing: 0.03em;
}
.taskDesc {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
  line-height: 1.48;
}
.taskBar {
  height: 3px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.14);
  margin-top: 9px;
  overflow: hidden;
}
.taskBar i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--cyan), var(--gold));
  transition: width 0.22s ease;
}
.taskMeta {
  font-family: var(--num-font);
  font-size: 13px;
  letter-spacing: 0.06em;
  margin-top: 5px;
  color: var(--gold);
}
.taskMeta:empty { display: none; }

#reticle {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 42px;
  height: 42px;
  transform: translate(-50%, -50%) scale(0.72);
  opacity: 0.62;
  transition: transform 0.14s ease-out, opacity 0.14s ease-out;
}
#reticle.charging {
  transform: translate(-50%, -50%) scale(1.28);
  opacity: 1;
}
#reticle svg { width: 100%; height: 100%; transform: rotate(-90deg); }
#reticle .ring {
  fill: none;
  stroke: rgba(255, 255, 255, 0.22);
  stroke-width: 2.5;
}
#reticle .charge {
  fill: none;
  stroke: var(--gold);
  stroke-width: 5.5;
  stroke-dasharray: 251.3;
  stroke-dashoffset: 251.3;
  filter: drop-shadow(0 0 6px rgba(255, 209, 102, 0.85));
}
#reticle.full .charge {
  stroke: #ffffff;
  filter: drop-shadow(0 0 8px rgba(255, 209, 102, 0.95));
}
#reticle .dot {
  fill: #fff;
  filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.85));
}

#output {
  position: absolute;
  left: 50%;
  top: calc(50% + 36px);
  transform: translateX(-50%);
  padding: 3px 12px;
  border-radius: 999px;
  background: rgba(10, 15, 26, 0.62);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 209, 102, 0.34);
  font-size: 12px;
  color: var(--text);
  white-space: nowrap;
}
#output:empty { display: none; }
#output b {
  font-family: var(--num-font);
  color: var(--gold);
  font-size: 15px;
  font-weight: 400;
  letter-spacing: 0.5px;
}

#hp {
  position: absolute;
  left: 24px;
  bottom: 24px;
  width: 224px;
  padding: 7px 11px;
  border-radius: 6px;
  background: rgba(10, 15, 26, 0.46);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.13);
  transition: opacity 0.25s;
}
.hpMeta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: rgba(248, 250, 252, 0.72);
  margin-bottom: 5px;
}
.hpMeta em {
  font-style: normal;
  font-family: var(--num-font);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: #fff;
}
.hpTrack {
  height: 5px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.14);
  overflow: hidden;
}
#hpFill {
  display: block;
  height: 100%;
  width: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, #34d399, #7ce7ff);
  transition: width 0.18s ease;
}

#keys {
  position: absolute;
  right: 24px;
  bottom: 24px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  border-radius: 6px;
  background: rgba(10, 15, 26, 0.42);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.10);
  font-size: 11px;
  color: rgba(248, 250, 252, 0.78);
  white-space: nowrap;
}

#marker { position: absolute; width: 0; height: 0; }
.markerPin {
  position: absolute;
  left: 0;
  top: 0;
  width: 10px;
  height: 10px;
  transform: translate(-50%, -14px) rotate(45deg);
  background: var(--gold);
  border: 1.5px solid #090e18;
  box-shadow: 0 0 12px rgba(255, 209, 102, 0.9);
}
#marker b {
  position: absolute;
  left: 50%;
  top: -38px;
  transform: translateX(-50%);
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(9, 14, 24, 0.72);
  border: 1px solid rgba(255, 209, 102, 0.4);
  font-family: var(--num-font);
  font-weight: 400;
  font-size: 12px;
  color: var(--gold);
  letter-spacing: 0.5px;
  white-space: nowrap;
}

/* ==================== TOASTS, BANNERS & FLOATERS ==================== */
#toasts {
  position: fixed;
  left: 50%;
  top: 22px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  z-index: 9;
  transition: top 0.2s ease;
}
body.has-top-bar #toasts {
  top: 118px;
}
.toast {
  position: relative;
  background: var(--glass-strong);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-left: 3px solid var(--cyan);
  border-radius: 6px;
  padding: 8px 18px 8px 14px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 10px 28px rgba(4, 8, 16, 0.35);
  animation: toastIn 0.28s cubic-bezier(0.2, 1.4, 0.4, 1);
  white-space: nowrap;
}
.toast .ding {
  color: var(--cyan);
  font-family: var(--num-font);
  margin-right: 8px;
  font-size: 16px;
}
.toast em {
  font-style: normal;
  color: var(--gold);
  font-family: var(--num-font);
  letter-spacing: 1px;
}
.toast.gold { border-left-color: var(--gold); }
.toast.gold .ding { color: var(--gold); }
.toast.out { animation: toastOut 0.32s forwards; }
.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: 12;
  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;
  background: rgba(255, 209, 102, 0.18);
  border-color: rgba(255, 209, 102, 0.65);
  color: var(--gold);
}
@keyframes toastIn {
  from { transform: translateY(-14px) scale(0.94); opacity: 0; }
  to { transform: none; opacity: 1; }
}
@keyframes toastOut {
  to { transform: translateY(-8px); opacity: 0; }
}

#banner {
  position: fixed;
  left: 0;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  text-align: center;
  pointer-events: none;
  opacity: 0;
  z-index: 4;
}
#banner .bTop {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.38em;
  color: var(--gold);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.75);
}
#banner .bMain {
  font-family: var(--num-font);
  font-size: 92px;
  line-height: 1.05;
  color: #fff;
  margin-top: 4px;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.92), 0 0 12px rgba(0, 0, 0, 0.85), 0 0 32px rgba(255, 209, 102, 0.72);
  letter-spacing: 2px;
}
#banner .bMain.cn {
  font-family: var(--ui-font);
  font-weight: 900;
  font-size: 72px;
  letter-spacing: 0.14em;
}
#banner .bSub {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.14em;
  margin-top: 8px;
  color: rgba(248, 250, 252, 0.98);
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.95), 0 0 6px rgba(0, 0, 0, 0.9);
}

#floaters { position: fixed; top: 0; right: 0; bottom: 0; left: 0; pointer-events: none; z-index: 3; }
.floater {
  position: absolute;
  font-family: var(--num-font);
  color: var(--gold);
  white-space: nowrap;
  text-shadow: 0 3px 10px rgba(0, 0, 0, 0.65), 0 0 14px rgba(255, 190, 70, 0.75);
  transform: translate(-50%, -50%);
}

#hurt {
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  pointer-events: none;
  box-shadow: inset 0 0 160px rgba(255, 36, 66, 0.85);
  opacity: 0;
  transition: opacity 0.4s;
  z-index: 2;
}

/* ==================== SYSTEM CONSOLE & FINALE MODALS ==================== */
#panel {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: calc(100% - 32px);
  max-width: 700px;
  max-height: calc(100% - 24px);
  max-height: min(675px, calc(100% - 24px));
  padding: 18px 24px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 6;
  animation: panelIn 0.28s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: auto;
  background: var(--glass-strong);
  backdrop-filter: blur(20px) saturate(150%);
  border-radius: 8px;
}
@keyframes panelIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.pHead {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  padding-bottom: 10px;
}
.pHeadTitle { display: flex; flex-direction: column; }
.pEyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.24em;
  color: var(--gold);
  margin-bottom: 2px;
}
.pTitle {
  font-size: 26px;
  font-weight: 900;
  color: #fff;
  letter-spacing: 0.16em;
}
.pHint { font-size: 12px; color: var(--muted); }
.pBody {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  padding-top: 10px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.22) transparent;
}
.pBody::-webkit-scrollbar, .rankList::-webkit-scrollbar { width: 6px; height: 6px; }
.pBody::-webkit-scrollbar-thumb, .rankList::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.22);
  border-radius: 999px;
}
.pBody::-webkit-scrollbar-track, .rankList::-webkit-scrollbar-track { background: transparent; }

.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.1);
}
.pTab {
  appearance: none;
  border: 0;
  border-radius: 4px;
  padding: 5px 12px;
  background: transparent;
  color: var(--muted);
  font-family: var(--ui-font);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease;
}
.pTab:hover { color: #fff; }
.pTab.is-active {
  background: linear-gradient(135deg, rgba(255, 209, 102, 0.22), rgba(103, 232, 249, 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;
  margin-bottom: 10px;
  border-radius: 8px;
  background: linear-gradient(95deg, rgba(255, 209, 102, 0.12), rgba(103, 232, 249, 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: #fff;
  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); }
.hostTag.is-lock { color: var(--gold); }

.pCard.unlockCard {
  background: linear-gradient(145deg, rgba(255, 209, 102, 0.12), rgba(12, 20, 36, 0.45));
  border-color: rgba(255, 209, 102, 0.48);
}
.pCard.unlockCard .endlessFollow {
  background: var(--gold);
  color: #090e18;
}
.perfSwitch {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
  width: 100%;
}
.perfSwitch .perfBtn {
  align-self: stretch;
  padding: 7px 6px;
  font-size: 12px;
  text-align: center;
  background: rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
  border: 1px solid rgba(255, 255, 255, 0.14);
}
.perfSwitch .perfBtn:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}
.perfSwitch .perfBtn.is-active {
  background: var(--gold);
  color: #090e18;
  border-color: var(--gold);
}

.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(--ui-font);
  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: #fff;
  border-color: rgba(255, 255, 255, 0.3);
}
.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(103, 232, 249, 0.16);
  border-color: rgba(103, 232, 249, 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(103, 232, 249, 0.08));
  border: 1px solid rgba(255, 209, 102, 0.45);
}
.rankMyBar[hidden] { display: none; }
.rankMyPos {
  font-family: var(--num-font);
  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: #fff; }
.rankMyInfo span { font-size: 11px; color: var(--muted); }
.rankList {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 360px;
  overflow: auto;
  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(--num-font);
  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(--num-font);
  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);
}

.fHost {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px 5px 6px;
  margin: 2px 0 10px;
  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: 14px; font-weight: 800; color: #fff; }

.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 span {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 2px;
}
.pMetric b {
  font-family: var(--num-font);
  font-weight: 400;
  font-size: 20px;
  color: #fff;
  letter-spacing: 0.5px;
}
.pMetric.accent b { color: var(--gold); }
.pMetric.rivalActive {
  border-color: rgba(255, 58, 48, 0.42);
  background: rgba(255, 34, 24, 0.08);
}
.pMetric.rivalActive b {
  font-family: var(--ui-font);
  font-size: 16px;
  font-weight: 800;
  color: #ff6b6b;
  letter-spacing: 0.03em;
}
.pMetric.rivalCleared {
  border-color: rgba(103, 232, 249, 0.44);
  background: linear-gradient(135deg, rgba(103, 232, 249, 0.11), rgba(255, 209, 102, 0.08));
}
.pMetric.rivalCleared b {
  font-family: var(--ui-font);
  font-size: 16px;
  font-weight: 800;
  color: var(--cyan);
  letter-spacing: 0.03em;
}
.pCard.rivalCardActive {
  border-color: rgba(255, 58, 48, 0.42);
  background: linear-gradient(145deg, rgba(255, 34, 24, 0.12), rgba(12, 20, 36, 0.45));
}
.pCard.rivalCardCleared {
  border-color: rgba(103, 232, 249, 0.44);
  background: linear-gradient(145deg, rgba(103, 232, 249, 0.12), rgba(255, 209, 102, 0.07));
}
.rivalBadge {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
}
.rivalBadge.is-danger {
  color: #ff8080;
  background: rgba(255, 34, 24, 0.16);
  border-color: rgba(255, 58, 48, 0.45);
}
.rivalBadge.is-cleared {
  color: #090e18;
  background: linear-gradient(90deg, var(--cyan), var(--gold));
  border-color: transparent;
}

.pGrid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}
.pCard {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.04);
}
.pCard h3 {
  margin: 0 0 4px;
  font-weight: 800;
  font-size: 15px;
  color: #fff;
}
.pCard p {
  margin: 0 0 9px;
  font-size: 11.5px;
  line-height: 1.42;
  color: var(--muted);
}
.pCard button, .pCard .endlessFollow {
  align-self: flex-start;
  font-family: var(--ui-font);
  font-size: 13px;
  font-weight: 700;
  color: #090e18;
  background: #f8fafc;
  border: 0;
  border-radius: 4px;
  padding: 7px 14px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.16s ease, transform 0.16s ease;
}
.pCard button:hover, .pCard .endlessFollow:hover {
  background: var(--gold);
  transform: translateY(-1px);
}
.pRow {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  padding: 7px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.pRow:last-child { border-bottom: 0; }
.pRow span { color: var(--muted); }
.pRow b {
  color: var(--gold);
  font-weight: 400;
  font-family: var(--num-font);
  font-size: 17px;
  letter-spacing: 1px;
}

.danger {
  background: rgba(255, 84, 104, 0.12) !important;
  color: #ff99a6 !important;
  border: 1px solid rgba(255, 84, 104, 0.45) !important;
}
.danger:hover {
  background: rgba(255, 84, 104, 0.24) !important;
}
.danger.armed {
  background: var(--red) !important;
  color: #fff !important;
  border-color: var(--red) !important;
}

/* ==================== INDIE TITLE SCREEN ==================== */
#title {
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: clamp(48px, 6.5vw, 104px);
  background: linear-gradient(90deg, rgba(5, 12, 26, 0) 0%, rgba(5, 12, 26, 0) 51.5%, rgba(5, 12, 26, 0.28) 64%, rgba(4, 10, 22, 0.48) 100%);
  transition: opacity 0.45s cubic-bezier(0.22, 1, 0.36, 1), transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
#title.leaving {
  opacity: 0;
  transform: scale(1.015);
  pointer-events: none;
}
.tStage {
  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(--serif-font);
  font-weight: 900;
  font-size: clamp(54px, 5vw, 72px);
  line-height: 1.04;
  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;
}
.tSubLine .tLine {
  width: 28px;
  height: 1px;
  background: rgba(255, 209, 102, 0.52);
}
.tSubText {
  font-family: var(--ui-font);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.46em;
  padding-left: 0.46em;
  color: rgba(248, 250, 252, 0.72);
}
.tMenu {
  margin-top: 52px;
  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(--serif-font);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.28em;
  color: rgba(241, 245, 249, 0.62);
  text-shadow: 0 2px 12px rgba(3, 8, 20, 0.55);
  transition: color 0.18s ease, opacity 0.2s ease;
}
.mItem::before,
.mItem::after {
  content: "";
  display: block;
  width: 0;
  height: 1px;
  background: var(--gold);
  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: 22px;
  opacity: 1;
}
.mItem:disabled {
  opacity: 0.35;
  cursor: default;
}
.mBadge {
  font-family: var(--num-font);
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0.06em;
  padding: 0;
  background: transparent;
  color: var(--gold);
}
.mItemReset.armed {
  color: #ff7585 !important;
}
.mItemReset.armed::before,
.mItemReset.armed::after {
  width: 22px !important;
  opacity: 1 !important;
  background: #ff7585 !important;
}
.tLoad {
  margin-top: 18px;
  font-size: 12px;
  letter-spacing: 0.24em;
  color: rgba(248, 250, 252, 0.55);
  transition: opacity 0.3s ease;
}
.tLoad.ready {
  opacity: 0;
  pointer-events: none;
  height: 0;
  margin: 0;
  overflow: hidden;
}
.tLoad.error {
  opacity: 1;
  height: auto;
  margin-top: 16px;
  color: #ff8593;
  letter-spacing: 0.06em;
}
#startupProgress:not([hidden]) { display: block; width: 100%; max-width: 220px; height: 4px; margin: 0 auto 8px; accent-color: var(--gold); }

/* ==================== LIGHT-SPEED FINALE MODAL ==================== */
#finale {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100vh - 24px);
  overflow: auto;
  padding: 26px 30px;
  text-align: center;
  z-index: 8;
  pointer-events: auto;
  background: var(--glass-strong);
  backdrop-filter: blur(20px) saturate(150%);
  border-radius: 8px;
  animation: panelIn 0.42s cubic-bezier(0.22, 1, 0.36, 1);
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.22) transparent;
}
#finale[hidden] { display: none; }
.fTag {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.32em;
  color: var(--cyan);
}
.fTitle {
  font-family: var(--ui-font);
  font-weight: 900;
  font-size: 52px;
  margin: 8px 0 6px;
  color: #fff;
  letter-spacing: 0.14em;
  text-shadow: 0 4px 24px rgba(103, 232, 249, 0.55), 0 0 18px rgba(255, 209, 102, 0.35);
}
.fHost {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px 5px 6px;
  margin: 2px 0 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(103, 232, 249, 0.38);
}
.fHost[hidden] { display: none; }
.fHostName { font-size: 14px; font-weight: 800; color: #fff; }
.fSub {
  margin: 0 0 16px;
  font-size: 14px;
  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: 8px 4px;
  margin-bottom: 16px;
  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(--num-font);
  font-size: 16px;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: #fff;
}
#finaleEndless {
  flex-direction: row;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  text-align: left;
  border-color: rgba(103, 232, 249, 0.45);
  background: linear-gradient(120deg, rgba(103, 232, 249, 0.12), rgba(255, 209, 102, 0.07));
}
#finaleEndless[hidden] { display: none; }
#finaleEndless p { margin-bottom: 0; }
.endlessActions { display: flex; flex-wrap: wrap; gap: 6px; }
#finaleEndless .endlessActions { flex-shrink: 0; }
#finaleEndless button, #finaleEndless .endlessFollow { align-self: center; }
.pCard button.endlessPreview {
  background: rgba(103, 232, 249, 0.14);
  color: var(--cyan);
  border: 1px solid rgba(103, 232, 249, 0.45);
}
.pCard button.endlessPreview:hover {
  background: rgba(103, 232, 249, 0.28);
  color: #fff;
}
#unlockModal {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(480px, calc(100vw - 32px));
  max-height: calc(100vh - 24px);
  overflow: auto;
  padding: 24px 26px;
  text-align: center;
  z-index: 9;
  pointer-events: auto;
  background: var(--glass-strong);
  backdrop-filter: blur(20px) saturate(150%);
  border-radius: 8px;
  animation: panelIn 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}
#unlockModal[hidden] { display: none; }
.uTag {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.28em;
  color: var(--cyan);
}
.uTitle {
  font-family: var(--ui-font);
  font-weight: 900;
  font-size: 32px;
  margin: 8px 0 6px;
  color: #fff;
  letter-spacing: 0.1em;
}
.uSub {
  margin: 0 0 16px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--gold);
}
#unlockModalCard {
  text-align: left;
  margin-bottom: 16px;
}
#unlockModalCard .endlessActions {
  margin-top: 4px;
}
#btnUnlockClose {
  background: rgba(255, 255, 255, 0.1);
  color: #e2e8f0;
  border: 1px solid rgba(255, 255, 255, 0.22);
}
#btnUnlockClose:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}
.fActions {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}
.fActions button {
  font-family: var(--ui-font);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 10px 22px;
  border: 0;
  border-radius: 4px;
  cursor: pointer;
  background: #f8fafc;
  color: #090e18;
  transition: background 0.16s ease, transform 0.16s ease;
}
.fActions button:hover {
  background: var(--gold);
  transform: translateY(-1px);
}
.fActions button.danger {
  background: rgba(255, 84, 104, 0.14) !important;
  color: #ffb4bd !important;
  border: 1px solid rgba(255, 84, 104, 0.55) !important;
}
.fActions button.danger:hover {
  background: rgba(255, 84, 104, 0.28) !important;
}
@media (max-height: 520px), (max-width: 560px) {
  #finale { padding: 16px 18px; }
  .fTitle { font-size: 36px; margin: 4px 0; }
  .fSub { font-size: 12px; margin-bottom: 10px; }
  .fStats { padding: 4px 2px; margin-bottom: 10px; }
  .fStats .pRow { padding: 4px 2px; font-size: 12px; }
  .fStats .pRow b { font-size: 14px; }
  #finaleEndless { flex-direction: column; align-items: stretch; }
}

/* Touch controls: airy translucent glass pills & circular thumb-arc for maximum 3D visibility. */
#touchControls { display: none; }
#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;
}
.touch-input {
  --touch-left: 14px;
  --touch-right: 14px;
  --touch-top: 10px;
  --touch-top-left: 10px;
  --touch-bottom: 14px;
  --stick-size: 112px;
  --touch-btn-h: 32px;
  --touch-action: 58px;
  --touch-mid: 58px;
  --touch-sub: 50px;
  --touch-punch: 84px;
  --touch-gap: 10px;
  overscroll-behavior: none;
}
@supports (width: clamp(1px, 2px, 3px)) {
.touch-input {
  --touch-left: max(10px, calc(env(safe-area-inset-left) + 8px));
  --touch-right: max(12px, calc(env(safe-area-inset-right) + 10px));
  --touch-top: max(8px, calc(env(safe-area-inset-top) + 6px));
  --touch-top-left: max(8px, calc(env(safe-area-inset-top) + 6px));
  --touch-bottom: max(12px, calc(env(safe-area-inset-bottom) + 8px));
  --stick-size: clamp(102px, 26vmin, 130px);
  --touch-btn-h: clamp(30px, 7.6vmin, 34px);
  --touch-action: clamp(54px, 15.2vmin, 64px);
  --touch-mid: clamp(54px, 15.2vmin, 64px);
  --touch-sub: clamp(46px, 12.8vmin, 54px);
  --touch-punch: clamp(78px, 21.8vmin, 92px);
  --touch-gap: clamp(8px, 2.2vmin, 12px);
  overscroll-behavior: none;
}
}
.touch-input #scene, .touch-input #touchControls { touch-action: none; }
.touch-input #touchControls { position: absolute; top: 0; right: 0; bottom: 0; left: 0; width: 100%; height: 100%; display: block; pointer-events: none; }
.touch-input #keys, .touch-input .pHint { display: none; }
.touchButton {
  appearance: none;
  pointer-events: auto;
  touch-action: none;
  min-width: 32px;
  min-height: var(--touch-btn-h);
  padding: 0 9px;
  border: 1px solid rgba(226, 240, 255, 0.20);
  border-radius: 999px;
  background: rgba(8, 14, 26, 0.42);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.08);
  color: rgba(248, 250, 252, 0.90);
  font: 700 10.5px/1 var(--ui-font);
  -webkit-tap-highlight-color: transparent;
  transition: background 0.14s ease, border-color 0.14s ease, transform 0.1s ease;
}
.touchButton.holding, .touchButton[aria-pressed="true"], .touchButton:active {
  background: rgba(20, 56, 74, 0.72);
  border-color: var(--cyan);
  color: var(--cyan);
  transform: scale(0.95);
}
.touchButton:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }

.touchTopBar {
  position: absolute;
  top: var(--touch-top-left);
  left: var(--touch-left);
  display: flex;
  align-items: center;
  gap: 5px;
  pointer-events: none;
}
#touchPause {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: var(--touch-btn-h);
  padding: 0 9px;
  white-space: nowrap;
}
#touchPause::before {
  content: '';
  width: 9px;
  height: 9px;
  background: currentColor;
  opacity: 0.82;
  clip-path: polygon(14% 12%, 40% 12%, 40% 88%, 14% 88%, 14% 12%, 60% 12%, 86% 12%, 86% 88%, 60% 88%, 60% 12%);
}
#touchView {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: var(--touch-btn-h);
  padding: 0 9px;
  white-space: nowrap;
}
#touchView.is-locked {
  border-color: rgba(255, 209, 102, 0.52);
  color: var(--gold);
  background: rgba(52, 38, 16, 0.56);
}
.touchPower {
  display: inline-flex;
  align-items: center;
  height: var(--touch-btn-h);
  border: 1px solid rgba(226, 240, 255, 0.20);
  border-radius: 999px;
  background: rgba(8, 14, 26, 0.42);
  overflow: hidden;
  pointer-events: auto;
}
.touchPower .touchButton {
  min-width: clamp(28px, 7.2vmin, 32px);
  min-height: 0;
  height: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--gold);
  font: 700 15px/1 var(--ui-font);
}
.touchPower .touchButton:active {
  background: rgba(103, 232, 249, 0.18);
  color: var(--cyan);
  transform: none;
}
.touchPowerTag { display: none; }

#touchMove {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 96px;
  height: 96px;
  width: var(--stick-size, 96px);
  height: var(--stick-size, 96px);
  border: 1px solid rgba(184, 228, 255, 0.36);
  border-radius: 50%;
  background: rgba(12, 22, 37, 0.20);
}
#touchMove::before {
  content: '';
  position: absolute;
  top: 14%; right: 14%; bottom: 14%; left: 14%;
  border: 1px dashed rgba(184, 228, 255, 0.24);
  border-radius: 50%;
}
#touchMove i {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 34%;
  height: 34%;
  margin-left: -17%;
  margin-top: -17%;
  border: 1px solid rgba(184, 228, 255, 0.72);
  border-radius: 50%;
  background: rgba(83, 157, 183, 0.52);
}

/* Honor of Kings / Naruto Mobile style right-thumb radial skill fan! */
.touchActions {
  position: absolute;
  right: var(--touch-right);
  bottom: var(--touch-bottom);
  width: calc(var(--touch-punch) + var(--touch-action) + var(--touch-sub) + 32px);
  height: calc(var(--touch-punch) + var(--touch-action) + 20px);
  pointer-events: none;
}
.touchActions .touchButton {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  width: var(--touch-action);
  height: var(--touch-action);
  padding: 0;
  border-radius: 50%;
  border: 2px solid rgba(226, 240, 255, 0.36);
  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);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.65);
  transition: transform 0.08s ease, background 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease;
}
.touchActions .touchButton[hidden] { display: none; }
.touchActions .touchButton.holding,
.touchActions .touchButton:active {
  transform: scale(0.90);
}
.touchActions [data-touch="leap"] { right: calc(var(--touch-punch) - 8px); bottom: calc(var(--touch-punch) - 10px); }
.touchActions [data-touch="dive"] { right: 6px; bottom: calc(var(--touch-punch) + 12px); }
.touchActions #touchSprint { right: calc(var(--touch-punch) + var(--touch-action) + 22px); bottom: 6px; width: var(--touch-sub); height: var(--touch-sub); }
.touchActions [data-touch="jump"] { right: calc(var(--touch-punch) - 8px); bottom: calc(var(--touch-punch) - 10px); }
.touchActions [data-touch="punch"] { right: 0; bottom: 0; }

.touchActions .touchButton::before {
  content: '';
  display: block;
  width: 18px;
  height: 17px;
  background: currentColor;
  opacity: 0.95;
  flex-shrink: 0;
}
.touchActions #touchSprint::before {
  clip-path: polygon(0 12%, 22% 12%, 58% 50%, 22% 88%, 0 88%, 36% 50%, 0 12%, 44% 12%, 66% 12%, 100% 50%, 66% 88%, 44% 88%, 80% 50%, 44% 12%);
}
.touchActions [data-touch="jump"]::before {
  clip-path: polygon(50% 5%, 95% 52%, 82% 65%, 59% 40%, 59% 95%, 41% 95%, 41% 40%, 18% 65%, 5% 52%);
}
.touchActions [data-touch="leap"]::before, .touchActions [data-touch="dive"]::before {
  clip-path: polygon(50% 3%, 90% 42%, 79% 54%, 50% 25%, 21% 54%, 10% 42%, 50% 3%, 50% 48%, 90% 87%, 79% 99%, 50% 70%, 21% 99%, 10% 87%, 50% 48%);
}
.touchActions [data-touch="dive"]::before { transform: rotate(180deg); }
.touchActions [data-touch="punch"] {
  width: var(--touch-punch);
  height: var(--touch-punch);
  gap: 4px;
  border-width: 2.5px;
  border-color: rgba(255, 209, 102, 0.78);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 28%, rgba(154, 100, 24, 0.80), rgba(26, 16, 8, 0.84));
  box-shadow: inset 0 0 0 3px rgba(255, 209, 102, 0.16), 0 6px 18px rgba(4, 8, 16, 0.36);
  color: var(--gold);
  font-size: 13px;
}
.touchActions [data-touch="punch"]::before {
  width: 24px;
  height: 24px;
  clip-path: polygon(51% 0, 59% 35%, 91% 15%, 75% 43%, 100% 51%, 68% 59%, 85% 88%, 57% 72%, 51% 100%, 41% 72%, 15% 90%, 30% 59%, 0 52%, 31% 42%, 12% 14%, 43% 35%);
}
.touchActions [data-touch="punch"].holding, .touchActions [data-touch="punch"]:active {
  border-color: var(--gold);
  background: rgba(255, 209, 102, 0.94);
  color: #1f1708;
  text-shadow: none;
}

.touch-input #sysCard, .touch-input #taskCard {
  top: var(--touch-top);
  min-width: 0;
  padding: 4px 10px;
  border-radius: 10px;
  border: 1px solid rgba(226, 240, 255, 0.16);
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  background: rgba(8, 14, 26, 0.44);
}
.touch-input #sysCard .sysHeadRow,
.touch-input #sysCard .sysName,
.touch-input #sysCard .sysSub,
.touch-input #taskCard .taskHead { display: none; }
.touch-input #sysCard {
  height: var(--touch-btn-h);
  display: flex;
  align-items: center;
  padding: 0 11px;
  border-radius: 999px;
}
.touch-input #sysCard .sysStat {
  margin: 0;
  font-size: clamp(15px, 4.1vmin, 19px);
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.touch-input #sysCard .sysStat small { font-size: 9px; margin-right: 4px; }
/* Compact single-row tappable mission pill on mobile (tap to expand description). */
.touch-input #taskCard {
  right: var(--touch-right);
  width: clamp(134px, 24vw, 186px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 6px;
  row-gap: 3px;
  pointer-events: auto;
  cursor: pointer;
}
.touch-input #taskCard .taskTitle {
  margin: 0;
  font-size: 11px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.touch-input #taskCard .taskDesc { display: none; grid-column: 1 / -1; min-height: 0; margin-top: 2px; font-size: 10px; line-height: 1.3; }
.touch-input #taskCard.is-expanded .taskDesc { display: block; }
.touch-input #taskCard.is-expanded .taskTitle { white-space: normal; }
.touch-input #taskCard .taskBar { grid-column: 1 / -1; margin-top: 1px; height: 2.5px; }
.touch-input #taskCard .taskMeta { grid-column: 2; grid-row: 1; margin: 0; font-size: 10px; line-height: 1.1; white-space: nowrap; }

.touch-input #hp {
  left: 50%;
  bottom: var(--touch-bottom);
  width: clamp(92px, 16vw, 136px);
  padding: 3px 7px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(8, 14, 26, 0.36);
  transform: translateX(-50%);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.touch-input .hpMeta { font-size: 7.5px; margin-bottom: 2px; letter-spacing: 0.06em; }
.touch-input .hpMeta em { font-size: 9.5px; }
.touch-input .hpTrack { height: 3px; }
.touch-input #toasts { top: calc(var(--touch-top-left) + var(--touch-btn-h) + 10px); width: min(82vw, 380px); }
.touch-input .toast { white-space: normal; font-size: 11.5px; padding: 5px 10px; background: rgba(8, 14, 26, 0.62); backdrop-filter: none; }
.touch-input #banner .bMain { font-size: clamp(30px, 8vmin, 68px); }
.touch-input #banner .bSub { padding-inline: 12px; font-size: 11px; }
.touch-input #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);
}
.touch-input #panel, .touch-input #finale, .touch-input #unlockModal {
  width: calc(100% - 20px);
  max-width: 680px;
  max-height: calc(100% - 16px);
  padding: 10px 14px;
}
.touch-input #finale, .touch-input #unlockModal {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}
.touch-input .pBody {
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}
.touch-input .benchGrid, .touch-input .rankList {
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
}
html[data-toy-landscape] .pHead { padding-right: 92px; }
@media (max-height: 540px) {
  #panel, .touch-input #panel {
    top: 8px;
    bottom: 8px;
    transform: translateX(-50%);
    width: calc(100% - 20px);
    max-width: 680px;
    max-height: calc(100% - 16px);
    height: auto;
    padding: 10px 14px;
  }
  .pHead { gap: 6px 10px; padding-bottom: 6px; }
  .pEyebrow { display: none; }
  .pTitle { font-size: 17px; letter-spacing: 0.08em; }
  .pHint { display: none; }
  .pTab { padding: 4px 9px; font-size: 12px; }
}
.touch-input .pCard button, .touch-input .pCard .endlessFollow { min-height: 38px; }
.touch-input .endlessFollow { display: inline-flex; align-items: center; }
.touch-input .pMetric { min-width: 0; overflow-wrap: anywhere; }
.touch-input .pMetric b { font-size: clamp(15px, 4.4vmin, 20px); }

/* Landscape mobile/tablet: single ultra-clean top strip, centered Speed pill, compact right Mission pill. */
@media (orientation: landscape) {
  .touch-input #sysCard {
    top: var(--touch-top-left);
    left: 50%;
    transform: translateX(-50%);
    max-width: min(196px, 28vw);
  }
}

/* Compact / split-screen landscape: trim spacing so top-left bar never meets centered pill. */
@media (orientation: landscape) and (max-width: 720px) {
  .touch-input .touchTopBar { gap: 4px; }
  .touch-input #touchPause, .touch-input #touchView { padding: 0 7px; font-size: 10px; }
  .touch-input #sysCard { max-width: 26vw; padding: 0 8px; }
}

/* Portrait mobile: Row 1 utility pills, Row 2 Speed + compact Mission pill, hairline HP tucked under Speed (leaving bottom-left thumb zone 100% open!). */
@media (orientation: portrait) {
  .touch-input {
    --touch-action: 60px;
    --touch-mid: 60px;
    --touch-sub: 52px;
    --touch-punch: 88px;
    --touch-gap: 10px;
  }
  @supports (width: clamp(1px, 2px, 3px)) {
    .touch-input {
      --touch-action: clamp(56px, 15.2vw, 66px);
      --touch-mid: clamp(56px, 15.2vw, 66px);
      --touch-sub: clamp(48px, 12.8vw, 56px);
      --touch-punch: clamp(82px, 22vw, 94px);
      --touch-gap: clamp(8px, 2.2vw, 12px);
    }
  }
  .touch-input #title {
    justify-content: center;
    padding: var(--touch-top) var(--touch-right) var(--touch-bottom) var(--touch-left);
    background: linear-gradient(180deg, rgba(4, 10, 22, 0.22), rgba(4, 10, 22, 0.66));
  }
  .touch-input .tStage { width: 100%; }
  .touch-input .tTitle { font-size: clamp(40px, 11vw, 65px); gap: clamp(10px, 4vw, 20px); }
  .touch-input .touchTopBar {
    top: var(--touch-top);
    left: var(--touch-left);
    right: var(--touch-right);
  }
  .touch-input .touchPower { margin-left: auto; }
  .touch-input #sysCard {
    top: calc(var(--touch-top) + var(--touch-btn-h) + 6px);
    left: var(--touch-left);
    max-width: calc(46vw - var(--touch-left));
  }
  .touch-input #taskCard {
    top: calc(var(--touch-top) + var(--touch-btn-h) + 6px);
    right: var(--touch-right);
    width: min(192px, calc(50vw - var(--touch-right)));
  }
  .touch-input #hp {
    left: var(--touch-left);
    top: calc(var(--touch-top) + var(--touch-btn-h) * 2 + 12px);
    bottom: auto;
    width: clamp(92px, 28vw, 126px);
    transform: none;
  }
  .touch-input #toasts { top: calc(var(--touch-top) + var(--touch-btn-h) * 2 + 44px); }
  .touch-input .pGrid { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .touch-input .pHead { gap: 8px; padding-bottom: 8px; }
  .touch-input .pEyebrow { display: none; }
  .touch-input .pTitle { font-size: 18px; letter-spacing: 0.08em; }
  .touch-input .pTabs { margin-right: 0; }
  .touch-input .pTab { padding: 4px 9px; font-size: 12px; }
  .touch-input .pMetrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (orientation: landscape) and (max-height: 480px) {
  .touch-input #title { padding-right: var(--touch-right); }
  .touch-input .tTitle { font-size: clamp(34px, 12vh, 56px); }
  .touch-input .tSubLine { margin-top: 9px; }
  .touch-input .tMenu { margin-top: 14px; gap: 2px; }
  .touch-input .mItem { min-height: 42px; }
}


/* ==================== EXPONENTIAL SPEED HUD EXTENSIONS ==================== */
.speedCard {
  min-width: 304px;
  max-width: 342px;
}
.benchProgress {
  margin-top: 6px;
  padding-top: 5px;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
}
.benchProgressMeta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  font-size: 11px;
  color: rgba(226, 232, 240, 0.86);
  margin-bottom: 4px;
}
.benchProgressMeta span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.benchProgressMeta em {
  font-style: normal;
  font-family: var(--num-font);
  font-size: 11px;
  color: var(--cyan);
  white-space: nowrap;
}
.benchProgressTrack {
  height: 3px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.14);
  overflow: hidden;
}
#benchFill {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: 99px;
  background: linear-gradient(90deg, #ffd166, #67e8f9);
  transition: width 0.1s linear;
}
.touch-input .benchProgress { display: none; }

.benchSection {
  margin: 10px 0 12px;
  padding: 10px 12px;
  border-radius: 7px;
  background: rgba(8, 13, 24, 0.58);
  border: 1px solid rgba(103, 232, 249, 0.22);
}
.benchHead {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 8px;
}
.benchHead em {
  font-style: normal;
  font-family: var(--num-font);
  color: var(--cyan);
  font-size: 12px;
}
.benchGrid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  max-height: 136px;
  overflow-y: auto;
  padding-right: 4px;
}
.benchChip {
  padding: 5px 8px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  opacity: 0.48;
}
.benchChip.is-passed {
  opacity: 1;
  background: linear-gradient(135deg, rgba(16, 48, 74, 0.72), rgba(28, 34, 56, 0.68));
  border-color: rgba(103, 232, 249, 0.48);
}
.benchChip.is-next {
  opacity: 0.92;
  border-color: rgba(255, 209, 102, 0.65);
  background: rgba(68, 48, 16, 0.42);
}
.benchChip b {
  display: block;
  font-size: 11px;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.benchChip.is-passed b { color: #fef08a; }
.benchChip span {
  display: block;
  font-family: var(--num-font);
  font-size: 10px;
  color: var(--cyan);
  margin-top: 1px;
}
.speedBadge {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #090e18;
  background: var(--gold);
  white-space: nowrap;
}
.speedBadge.is-qs {
  background: var(--cyan);
  box-shadow: 0 0 12px rgba(103, 232, 249, 0.72);
}
.speedBadge.is-rewind {
  background: linear-gradient(90deg, #67e8f9, #ffd166);
  color: #090e18;
  box-shadow: 0 0 14px rgba(103, 232, 249, 0.78);
}
.sysMainRow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.hudChronoDial {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  filter: drop-shadow(0 0 8px rgba(255, 209, 102, 0.35));
}
.hudChronoDial[hidden] { display: none; }
#speedCurve {
  display: block;
  width: 100%;
  height: 32px;
  margin-top: 6px;
  border-radius: 4px;
  background: rgba(5, 10, 20, 0.48);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.touch-input #speedCurve { display: none; }

.qsBar {
  position: absolute;
  left: 50%;
  top: 22px;
  transform: translateX(-50%);
  padding: 9px 18px 8px;
  border-radius: 8px;
  border: 1px solid rgba(103, 232, 249, 0.58);
  background: linear-gradient(155deg, rgba(10, 24, 46, 0.88), rgba(14, 18, 36, 0.88));
  box-shadow: 0 0 28px rgba(103, 232, 249, 0.25), inset 0 1px rgba(255, 255, 255, 0.14);
  text-align: center;
  min-width: 290px;
  z-index: 4;
}
.qsBar[hidden] { display: none; }

.qsHead {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
  color: var(--cyan);
}
.qsDot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 10px var(--cyan);
  animation: qsPulse 0.8s ease-in-out infinite alternate;
}
@keyframes qsPulse {
  from { opacity: 0.45; transform: scale(0.85); }
  to { opacity: 1; transform: scale(1.25); }
}
.qsMetrics {
  display: flex;
  justify-content: center;
  gap: 18px;
  margin-top: 5px;
}
.qsMetrics span {
  display: block;
  font-size: 9px;
  color: var(--muted);
  letter-spacing: 0.08em;
}
.qsMetrics b {
  font-family: var(--num-font);
  font-size: 18px;
  font-weight: 400;
  color: #fff;
  letter-spacing: 0.04em;
}
.qsMetrics div:last-child b { color: var(--gold); }
.qsTip {
  margin-top: 4px;
  font-size: 10px;
  color: rgba(186, 230, 253, 0.78);
}
.touch-input .qsBar {
  top: calc(var(--touch-top-left) + var(--touch-btn-h) + 8px);
  padding: 6px 12px;
  min-width: 220px;
}
.touch-input .qsTip { display: none; }
.touch-input .qsMetrics b { font-size: 15px; }

.chronoBar {
  position: absolute;
  left: 50%;
  top: 22px;
  transform: translateX(-50%);
  padding: 9px 18px 8px;
  border-radius: 8px;
  border: 1px solid rgba(255, 209, 102, 0.62);
  background: linear-gradient(155deg, rgba(10, 26, 48, 0.88), rgba(24, 18, 38, 0.88));
  box-shadow: 0 0 32px rgba(103, 232, 249, 0.28), 0 0 16px rgba(255, 209, 102, 0.18), inset 0 1px rgba(255, 255, 255, 0.16);
  text-align: center;
  min-width: 340px;
  z-index: 4;
}
.chronoBar[hidden] { display: none; }
.chronoHead {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
  background: linear-gradient(90deg, #67e8f9, #ffd166);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.chronoDot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ffd166;
  box-shadow: 0 0 12px #ffd166;
  animation: qsPulse 0.65s ease-in-out infinite alternate;
}
.chronoMetrics {
  display: flex;
  justify-content: center;
  gap: 18px;
  margin-top: 5px;
}
.chronoMetrics span {
  display: block;
  font-size: 9px;
  color: var(--muted);
  letter-spacing: 0.08em;
}
.chronoMetrics b {
  font-family: var(--num-font);
  font-size: 18px;
  font-weight: 400;
  color: #fff;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
}
.chronoMetrics div:first-child b { color: var(--cyan); }
.chronoMetrics div:last-child b { color: var(--gold); }
.chronoTip {
  margin-top: 4px;
  font-size: 10px;
  color: rgba(254, 243, 199, 0.8);
}
.touch-input .chronoBar {
  top: calc(var(--touch-top-left) + var(--touch-btn-h) + 8px);
  padding: 6px 12px;
  min-width: 240px;
}
.touch-input .chronoTip { display: none; }
.touch-input .chronoMetrics b { font-size: 14px; }

/* Directed Time-Reversal Cinema Letterbox HUD (100% clean movie framing!) */
body.is-cine #hud,
body.is-cine #toasts,
body.is-cine #banner {
  opacity: 0 !important;
  pointer-events: none !important;
}
#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;
  background: linear-gradient(180deg, rgba(4, 7, 14, 0.94), rgba(4, 7, 14, 0.78));
  display: flex;
  align-items: center;
  padding: 0 32px;
}
.cineBarTop {
  top: 0;
  height: 52px;
  border-bottom: 1px solid rgba(103, 232, 249, 0.18);
}
.cineBarBot {
  bottom: 0;
  height: 52px;
  background: linear-gradient(0deg, rgba(4, 7, 14, 0.96), rgba(4, 7, 14, 0.78));
  border-top: 1px solid rgba(103, 232, 249, 0.18);
}
.cineTag {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.22em;
  color: rgba(186, 230, 253, 0.8);
}
.cineRateWrap {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
}
.cineRateWrap span {
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--muted);
}
.cineRateWrap b {
  font-family: var(--num-font);
  font-size: 24px;
  font-weight: 400;
  letter-spacing: 0.06em;
  color: var(--cyan);
  text-shadow: 0 0 14px rgba(103, 232, 249, 0.65);
  font-variant-numeric: tabular-nums;
}
.cineCaption {
  text-align: center;
}
.cineCaption span {
  display: block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.2em;
  color: var(--gold);
  margin-bottom: 3px;
}
.cineCaption p {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #f8fafc;
}

#skillPills {
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 78px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  pointer-events: none;
}
.ultPill {
  --ult-accent: #67e8f9;
  width: 206px;
  max-width: 100%;
  padding: 7px 11px 8px;
  border-radius: 6px;
  background: rgba(10, 15, 26, 0.56);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-left: 3px solid var(--ult-accent);
  transition: border-color 0.2s ease, box-shadow 0.25s ease, opacity 0.2s ease;
}
.rewindPill, .portalPill {
  width: 196px;
}
.portalPill {
  --ult-accent: #a5b4fc;
}
#rewindFill, #portalFill {
  display: block;
  height: 100%;
  width: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--ult-accent), #f8fafc);
  transition: width 0.1s linear;
}
#portalFill { width: 0; }
.ultPill.is-ready {
  box-shadow: 0 0 18px rgba(103, 232, 249, 0.24), inset 0 1px rgba(255, 255, 255, 0.12);
  box-shadow: 0 0 18px color-mix(in srgb, var(--ult-accent) 26%, transparent), inset 0 1px rgba(255, 255, 255, 0.12);
}
.ultPill.is-cd {
  opacity: 0.78;
}
.ultPill.is-locked {
  opacity: 0.74;
  border-color: rgba(148, 163, 184, 0.28);
}
.ultPill.is-locked .ultKey {
  background: rgba(100, 116, 139, 0.55);
  color: #e2e8f0;
  box-shadow: none;
}
.ultPill.is-locked .ultRow em {
  color: rgba(125, 211, 252, 0.78);
  font-size: 11px;
}
.rewindPill.is-locked #rewindFill {
  background: linear-gradient(90deg, rgba(56, 189, 248, 0.45), rgba(103, 232, 249, 0.82));
}
.ultRow {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 5px;
}
.ultKey {
  display: inline-grid;
  place-items: center;
  min-width: 19px;
  height: 19px;
  padding: 0 4px;
  border-radius: 4px;
  font-family: var(--num-font);
  font-size: 12px;
  font-weight: 700;
  color: #090e18;
  background: var(--ult-accent);
  box-shadow: 0 0 10px rgba(103, 232, 249, 0.50);
  box-shadow: 0 0 10px color-mix(in srgb, var(--ult-accent) 55%, transparent);
}
.ultRow b {
  font-size: 13px;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.06em;
  flex: 1;
}
.ultRow em {
  font-style: normal;
  font-family: var(--num-font);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--ult-accent);
}
.ultTrack {
  height: 4px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.14);
  overflow: hidden;
}
#ultFill {
  display: block;
  height: 100%;
  width: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--ult-accent), #fff7cc);
  transition: width 0.1s linear;
}
.touch-input #skillPills { display: none; }

@media (max-width: 760px) {
  #keys {
    left: 264px;
    flex-wrap: wrap;
    justify-content: end;
  }
  #skillPills { bottom: 116px; }
}
@media (max-width: 540px) {
  #keys {
    left: 24px;
    bottom: 66px;
    justify-content: start;
  }
  #skillPills { bottom: 144px; }
}

/* Speedster Mobile Radial Skill Fan (Honor of Kings / Naruto Mobile layout!) */
.speedActions [data-touch="jump"] {
  right: calc(var(--touch-punch) - 8px);
  bottom: calc(var(--touch-punch) - 10px);
  border-color: rgba(214, 236, 255, 0.60);
  color: #f0f9ff;
}
.speedActions #touchUlt {
  right: 6px;
  bottom: calc(var(--touch-punch) + 12px);
  width: var(--touch-action);
  height: var(--touch-action);
  border-color: rgba(255, 146, 66, 0.78);
  background: radial-gradient(circle at 35% 28%, rgba(168, 60, 18, 0.80), rgba(30, 14, 10, 0.84));
  box-shadow: inset 0 0 0 2px rgba(255, 186, 76, 0.18), 0 5px 14px rgba(0, 0, 0, 0.42);
  color: #ffd166;
  font-size: 11px;
}
.speedActions #touchRewind, .speedActions #touchPortal {
  width: var(--touch-sub);
  height: var(--touch-sub);
  font-size: 10.5px;
}
.speedActions #touchRewind {
  right: calc(var(--touch-punch) + var(--touch-action) + 22px);
  bottom: 6px;
  border-color: rgba(103, 232, 249, 0.72);
  background: radial-gradient(circle at 35% 28%, rgba(18, 92, 126, 0.78), rgba(10, 20, 36, 0.84));
  box-shadow: inset 0 0 0 2px rgba(103, 232, 249, 0.16), 0 5px 12px rgba(0, 0, 0, 0.40);
  color: #67e8f9;
}
.speedActions #touchRewind::before {
  width: 16px;
  height: 13px;
  clip-path: polygon(0 50%, 46% 8%, 46% 92%, 0 50%, 50% 50%, 96% 8%, 96% 92%, 50% 50%);
}
.speedActions #touchPortal {
  right: calc(var(--touch-punch) + var(--touch-action) + 4px);
  bottom: calc(var(--touch-action) + 12px);
  border-color: rgba(165, 180, 252, 0.72);
  background: radial-gradient(circle at 35% 28%, rgba(72, 66, 146, 0.78), rgba(14, 18, 36, 0.84));
  box-shadow: inset 0 0 0 2px rgba(165, 180, 252, 0.16), 0 5px 12px rgba(0, 0, 0, 0.40);
  color: #c7d2fe;
}
.speedActions #touchPortal::before {
  width: 11px;
  height: 15px;
  border: 2px solid currentColor;
  border-radius: 50%;
  background: transparent;
}
.speedActions #touchRewind:disabled, .speedActions #touchPortal:disabled {
  opacity: 0.42;
  box-shadow: none;
  border-color: rgba(255, 255, 255, 0.16);
}
.speedActions #touchUlt::before {
  width: 19px;
  height: 19px;
  clip-path: polygon(50% 0, 82% 48%, 62% 48%, 50% 100%, 38% 48%, 18% 48%);
}
.speedActions #touchUlt.is-cd {
  opacity: 0.42;
  box-shadow: none;
  border-color: rgba(255, 255, 255, 0.16);
}
.speedActions #touchPunch {
  right: calc(var(--touch-punch) + 12px);
  bottom: 4px;
  width: var(--touch-mid);
  height: var(--touch-mid);
  gap: 3px;
  border-width: 2px;
  border-color: rgba(255, 209, 102, 0.74);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 28%, rgba(146, 94, 24, 0.78), rgba(24, 16, 10, 0.84));
  box-shadow: inset 0 0 0 2px rgba(255, 209, 102, 0.16), 0 5px 14px rgba(0, 0, 0, 0.42);
  color: var(--gold);
  font-size: 11px;
}
.speedActions #touchPunch::before {
  width: 19px;
  height: 19px;
  clip-path: polygon(16% 32%, 84% 32%, 84% 68%, 60% 82%, 22% 82%, 16% 62%);
}
.speedActions #touchPunch.holding,
.speedActions #touchPunch:active {
  background: rgba(255, 209, 102, 0.94);
  color: #091220;
  text-shadow: none;
  box-shadow: 0 0 20px rgba(255, 209, 102, 0.75);
}
.speedActions #touchSpeedForce {
  right: 0;
  bottom: 0;
  width: var(--touch-punch);
  height: var(--touch-punch);
  gap: 4px;
  border-width: 2.5px;
  border-color: rgba(103, 232, 249, 0.84);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 28%, rgba(22, 114, 154, 0.82), rgba(8, 22, 42, 0.86));
  box-shadow: inset 0 0 0 3px rgba(103, 232, 249, 0.18), 0 6px 20px rgba(20, 148, 198, 0.42);
  color: var(--cyan);
  font-size: 13.5px;
}
.speedActions #touchSpeedForce::before {
  width: 26px;
  height: 26px;
  clip-path: polygon(56% 0, 18% 54%, 48% 54%, 38% 100%, 82% 44%, 52% 44%);
}
.speedActions #touchSpeedForce[aria-pressed="true"],
.speedActions #touchSpeedForce.holding,
.speedActions #touchSpeedForce:active {
  border-color: var(--gold);
  background: linear-gradient(155deg, rgba(103, 232, 249, 0.96), rgba(255, 209, 102, 0.96));
  color: #091220;
  text-shadow: none;
  box-shadow: 0 0 24px rgba(103, 232, 249, 0.78);
}
.speedActions [data-touch="brake"]::before {
  clip-path: polygon(16% 18%, 38% 18%, 38% 82%, 16% 82%, 16% 18%, 62% 18%, 84% 18%, 84% 82%, 62% 82%, 62% 18%);
}

/* ==================== FINAL BOSS HUD: 碎日巅峰残影 ==================== */
.bossHud {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: min(490px, 84vw);
  padding: 10px 16px 11px;
  border-top: 2px solid #ffb347;
  border-left: 1px solid rgba(255, 195, 102, 0.34);
  border-right: 1px solid rgba(255, 195, 102, 0.34);
  border-bottom: 1px solid rgba(255, 195, 102, 0.22);
  background: rgba(12, 11, 20, 0.72);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.42), 0 0 24px rgba(255, 179, 71, 0.14);
  transition: top 0.25s ease;
}
body.has-top-bar .bossHud {
  top: 104px;
}
body.has-boss-hud #toasts {
  top: 122px;
}
body.has-top-bar.has-boss-hud #toasts {
  top: 204px;
}
body.is-clash-cine #hud {
  opacity: 0 !important;
  pointer-events: none !important;
}
.bossHead {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
}
.bossTitleWrap {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  min-width: 0;
}
.bossEyebrow {
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.22em;
  color: rgba(255, 209, 102, 0.84);
  white-space: nowrap;
}
.bossName {
  font-family: var(--serif-font);
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0.14em;
  color: #fff8e6;
  text-shadow: 0 2px 12px rgba(255, 166, 48, 0.45);
  white-space: nowrap;
}
.bossStatus {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: rgba(255, 224, 150, 0.9);
  white-space: nowrap;
}
.bossStatus.is-alert {
  color: #ff9f43;
  text-shadow: 0 0 12px rgba(255, 145, 50, 0.72);
}
.bossTrack {
  margin-top: 7px;
  height: 6px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}
.bossTrack i {
  display: block;
  height: 100%;
  width: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, #ff7a2f, #ffd166, #fff6d6);
  box-shadow: 0 0 12px rgba(255, 196, 86, 0.75);
  transition: width 0.2s ease;
}
.bossSub {
  margin-top: 5px;
  font-size: 11px;
  letter-spacing: 0.06em;
  color: rgba(241, 245, 249, 0.76);
}
.touch-input .bossHud {
  top: 46px;
  top: calc(var(--touch-top-left) + var(--touch-btn-h) + 6px);
  width: 268px;
  max-width: 54%;
  padding: 5px 11px 6px;
  background: rgba(12, 11, 20, 0.58);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.34), 0 0 14px rgba(255, 179, 71, 0.14);
}
.touch-input body.has-top-bar .bossHud {
  top: 88px;
}
.touch-input .bossEyebrow {
  display: none;
}
.touch-input .bossName {
  font-size: 13px;
  letter-spacing: 0.08em;
}
.touch-input .bossStatus {
  font-size: 10px;
}
.touch-input .bossTrack {
  margin-top: 4px;
  height: 4px;
}
.touch-input .bossSub {
  margin-top: 3px;
  font-size: 9.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.touch-input body.has-boss-hud #toasts {
  top: 96px;
}
.touch-input body.has-top-bar.has-boss-hud #toasts {
  top: 136px;
}
@media (max-height: 540px) {
  .bossHud {
    top: 8px;
    width: 276px;
    max-width: 50%;
    padding: 5px 11px 6px;
  }
  body.has-top-bar .bossHud {
    top: 68px;
  }
  .touch-input .bossHud {
    top: 44px;
    top: calc(var(--touch-top-left) + var(--touch-btn-h) + 5px);
    width: 248px;
    max-width: 48%;
    padding: 4px 10px 5px;
  }
  .touch-input body.has-top-bar .bossHud {
    top: 84px;
  }
  .bossEyebrow {
    display: none;
  }
  .bossName {
    font-size: 13px;
    letter-spacing: 0.08em;
  }
  .bossStatus {
    font-size: 10px;
  }
  .bossTrack {
    margin-top: 4px;
    height: 4px;
  }
  .bossSub {
    display: none;
  }
  body.has-boss-hud #toasts {
    top: 56px;
  }
  .touch-input body.has-boss-hud #toasts {
    top: 86px;
  }
  body.has-top-bar.has-boss-hud #toasts {
    top: 116px;
  }
  .touch-input body.has-top-bar.has-boss-hud #toasts {
    top: 124px;
  }
  .touch-input body.has-boss-hud .qsBar,
  .touch-input body.has-boss-hud .chronoBar {
    padding: 3px 10px;
    min-width: 196px;
  }
  .touch-input body.has-boss-hud .qsHead,
  .touch-input body.has-boss-hud .chronoHead {
    font-size: 9.5px;
  }
  .touch-input body.has-boss-hud .qsMetrics,
  .touch-input body.has-boss-hud .chronoMetrics {
    margin-top: 2px;
    gap: 12px;
  }
  .touch-input body.has-boss-hud .qsMetrics b,
  .touch-input body.has-boss-hud .chronoMetrics b {
    font-size: 12px;
  }
}
@media (orientation: portrait) {
  .touch-input .bossHud {
    top: 84px;
    top: calc(var(--touch-top) + var(--touch-btn-h) * 2 + 14px);
    width: 320px;
    max-width: 90%;
    padding: 6px 11px;
  }
  .touch-input body.has-top-bar .bossHud {
    top: 136px;
  }
}

/* Mission Card Crisis Lock-On when the Sun explodes and locks onto 「指数之拳之影」 */
#taskCard.is-crisis {
  border-right: 3px solid #ff8c32;
  border-color: rgba(255, 166, 66, 0.52);
  background: rgba(24, 12, 16, 0.78);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.42), 0 0 24px rgba(255, 122, 43, 0.24);
}
#taskCard.is-crisis .taskHead {
  color: #ff9f43;
  text-shadow: 0 0 10px rgba(255, 140, 50, 0.65);
}
#taskCard.is-crisis .taskBar i {
  background: linear-gradient(90deg, #ff5e2b, #ffd166);
}
#marker.is-shadow-lock {
  border-color: rgba(255, 166, 66, 0.85);
  background: rgba(22, 12, 14, 0.84);
  box-shadow: 0 0 18px rgba(255, 140, 48, 0.55);
}
#marker.is-shadow-lock .markerPin {
  background: #ffb347;
  box-shadow: 0 0 10px #ff8c32;
}

/* ==================== TOY HOST PROFILE, RANKING & FOLLOW UNLOCK ==================== */
.sysHost {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 2px 7px 2px 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(103, 232, 249, 0.28);
}
.sysHost[hidden] { display: none; }
.sysHostName {
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  max-width: 112px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sysAvatar, .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(--cyan);
  font-style: normal;
  font-weight: 800;
}
.sysAvatar { width: 20px; height: 20px; font-size: 10px; border: 1px solid rgba(103, 232, 249, 0.72); }
.hostAvatar {
  width: 42px;
  height: 42px;
  font-size: 16px;
  border: 2px solid var(--cyan);
  box-shadow: 0 0 0 3px rgba(103, 232, 249, 0.16), 0 0 18px rgba(255, 209, 102, 0.22);
}
.rankAvatar { width: 30px; height: 30px; font-size: 12px; border: 1px solid rgba(255, 255, 255, 0.26); }
.sysAvatar em, .hostAvatar em, .rankAvatar em { font-style: normal; line-height: 1; }
.sysAvatar img, .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(103, 232, 249, 0.14); color: var(--cyan); border-color: rgba(103, 232, 249, 0.45); }
.hostTier.tier-epic { background: rgba(192, 132, 252, 0.18); color: #e9d5ff; border-color: rgba(192, 132, 252, 0.5); }
.hostTier.tier-mythic { background: rgba(251, 146, 60, 0.2); color: #fed7aa; border-color: rgba(251, 146, 60, 0.55); }
.hostTier.tier-legend {
  background: linear-gradient(135deg, rgba(255, 209, 102, 0.26), rgba(103, 232, 249, 0.26));
  color: var(--gold);
  border-color: rgba(255, 209, 102, 0.7);
  box-shadow: 0 0 12px rgba(255, 209, 102, 0.22);
}
.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.1);
}
.pTab {
  appearance: none;
  border: 0;
  border-radius: 4px;
  padding: 5px 12px;
  background: transparent;
  color: var(--muted);
  font-family: var(--ui-font);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease;
}
.pTab:hover { color: #fff; }
.pTab.is-active {
  background: linear-gradient(135deg, rgba(103, 232, 249, 0.22), rgba(255, 209, 102, 0.16));
  color: var(--cyan);
  box-shadow: inset 0 0 0 1px rgba(103, 232, 249, 0.48);
}
.hostBanner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  margin-bottom: 10px;
  border-radius: 8px;
  background: linear-gradient(95deg, rgba(103, 232, 249, 0.12), rgba(255, 209, 102, 0.07) 58%, rgba(255, 255, 255, 0.03));
  border: 1px solid rgba(103, 232, 249, 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: #fff;
  letter-spacing: 0.03em;
}
.hostRankPill {
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  color: #090e18;
  background: var(--cyan);
}
.hostSubRow { margin-top: 4px; }
.hostTag {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--muted);
}
.hostTag.is-ok { color: var(--cyan); }
.hostTag.is-lock { color: var(--gold); }
.pCard.unlockCard {
  background: linear-gradient(145deg, rgba(255, 209, 102, 0.12), rgba(12, 20, 36, 0.45));
  border-color: rgba(255, 209, 102, 0.48);
}
.endlessActions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.endlessFollow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 14px;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
  background: var(--gold);
  color: #090e18;
  cursor: pointer;
}
.endlessFollow[hidden] { display: none; }
.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(--ui-font);
  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: #fff;
  border-color: rgba(255, 255, 255, 0.3);
}
.rankChip.is-active {
  background: rgba(103, 232, 249, 0.18);
  border-color: rgba(103, 232, 249, 0.65);
  color: var(--cyan);
}
.rankPeriod.is-active {
  background: rgba(255, 209, 102, 0.16);
  border-color: rgba(255, 209, 102, 0.55);
  color: var(--gold);
}
.rankMyBar {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 13px;
  border-radius: 7px;
  background: linear-gradient(95deg, rgba(103, 232, 249, 0.16), rgba(255, 209, 102, 0.08));
  border: 1px solid rgba(103, 232, 249, 0.45);
}
.rankMyBar[hidden] { display: none; }
.rankMyPos {
  font-family: var(--num-font);
  font-size: 20px;
  color: var(--cyan);
  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: #fff; }
.rankMyInfo span { font-size: 11px; color: var(--muted); }
.rankList {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 360px;
  overflow: auto;
  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(103, 232, 249, 0.10);
  border-color: rgba(103, 232, 249, 0.45);
}
.rankNum {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  font-family: var(--num-font);
  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(--cyan);
  color: #090e18;
  font-weight: 800;
}
.rankUser small { font-size: 11px; color: var(--muted); }
.rankScore {
  font-family: var(--num-font);
  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;
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed rgba(255, 255, 255, 0.14);
}
