:root {
  --ink: #141410;
  --ink-soft: #22221d;
  --paper: #f1ede2;
  --paper-deep: #d9d3c4;
  --blue: #2b60ff;
  --red: #ff503c;
  --acid: #dcff45;
  --cyan: #6cecff;
  --muted: #8b8a81;
  --safe-top: max(18px, env(safe-area-inset-top));
  --safe-bottom: max(18px, env(safe-area-inset-bottom));
  color-scheme: dark;
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  overflow: hidden;
  background: #0b0b09;
}

body {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  color: var(--paper);
  overscroll-behavior: none;
}

button {
  margin: 0;
  padding: 0;
  border: 0;
  color: inherit;
  font: inherit;
  background: none;
  cursor: pointer;
}

button:focus-visible {
  outline: 2px solid var(--acid);
  outline-offset: 4px;
}

.app {
  position: relative;
  isolation: isolate;
  width: 100vw;
  width: 100%;
  height: 100dvh;
  height: 100%;
  overflow: hidden;
  color: var(--paper);
  background: var(--ink);
  touch-action: auto;
}

.app::before {
  content: "";
  position: absolute;
  z-index: 110;
  inset: 0;
  border: 1px solid rgba(255,255,255,.08);
  pointer-events: none;
}

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

.screen-grid {
  position: absolute;
  z-index: 2;
  inset: 0;
  opacity: .22;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.034) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.034) 1px, transparent 1px);
  background-size: 24px 24px;
  mask-image: linear-gradient(to bottom, #000, transparent 80%);
  transition: opacity .4s ease;
}

.grain {
  position: absolute;
  z-index: 100;
  inset: -30%;
  opacity: .05;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 20% 30%, #fff 0 .45px, transparent .7px),
    radial-gradient(circle at 70% 60%, #fff 0 .35px, transparent .65px),
    radial-gradient(circle at 42% 84%, #fff 0 .4px, transparent .7px);
  background-size: 5px 7px, 7px 5px, 9px 11px;
  mix-blend-mode: soft-light;
  animation: grainShift .22s steps(2) infinite;
}

.edge-vignette {
  position: absolute;
  z-index: 3;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 42%, rgba(0,0,0,.36) 100%);
}

@keyframes grainShift {
  0% { transform: translate3d(-1%, 1%, 0); }
  50% { transform: translate3d(1%, -1%, 0); }
  100% { transform: translate3d(0, 1%, 0); }
}

.topbar {
  position: absolute;
  z-index: 75;
  top: var(--safe-top);
  left: 18px;
  right: 17px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: opacity .35s ease, color .35s ease;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  text-align: left;
}

.lab-mark {
  position: relative;
  display: block;
  width: 31px;
  height: 31px;
  border: 1px solid rgba(241,237,226,.72);
}

.lab-mark::before,
.lab-mark::after {
  content: "";
  position: absolute;
  left: 4px;
  right: 4px;
  height: 1px;
  background: rgba(241,237,226,.36);
}

.lab-mark::before { top: 8px; }
.lab-mark::after { bottom: 8px; }
.lab-mark i { position: absolute; left: 4px; right: 4px; top: 14px; height: 1px; background: var(--blue); transform: rotate(14deg); }
.lab-mark b { position: absolute; right: -2px; top: 11px; width: 5px; height: 8px; background: var(--acid); }

.brand > span:last-child {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.brand > span:last-child > b {
  font-size: 11px;
  font-weight: 650;
  letter-spacing: .14em;
}

.brand small {
  color: #77776f;
  font: 6px/1 Arial, sans-serif;
  letter-spacing: .14em;
}

.top-actions { display: flex; gap: 7px; }

.icon-button {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(20,20,16,.48);
  backdrop-filter: blur(8px);
}

.sound-button > span {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 13px;
}

.sound-button i {
  display: block;
  width: 1px;
  height: 4px;
  background: var(--paper);
  animation: soundBar .7s ease-in-out infinite alternate;
}

.sound-button i:nth-child(2) { height: 11px; animation-delay: -.25s; }
.sound-button i:nth-child(3) { height: 7px; animation-delay: -.5s; }
.sound-button i:nth-child(4) { height: 3px; animation-delay: -.12s; }
.sound-button[aria-pressed="false"] i { height: 1px !important; animation: none; opacity: .4; }
@keyframes soundBar { to { transform: scaleY(.35); } }

.pause-button { display: none; }
.pause-button span { display: flex; gap: 4px; }
.pause-button i { width: 2px; height: 11px; background: var(--paper); }
.app[data-phase="playing"] .pause-button { display: grid; }
.app[data-phase="playing"] .brand { pointer-events: none; }

.scene {
  position: absolute;
  z-index: 20;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .42s ease, visibility .42s;
}

.scene.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  color: #929188;
  font-size: 7px;
  letter-spacing: .14em;
}

.eyebrow b { color: var(--paper); font: 700 7px/1 Arial, sans-serif; letter-spacing: .14em; }
.eyebrow span { width: 29px; height: 1px; background: var(--red); }
.eyebrow i { font-style: normal; }

/* Menu */
.menu {
  background: linear-gradient(180deg, rgba(20,20,16,.25), rgba(20,20,16,.8) 70%, var(--ink));
}

.menu-heading {
  position: absolute;
  z-index: 5;
  top: 96px;
  left: 25px;
  right: 25px;
}

.menu-heading .eyebrow { margin-bottom: 14px; }

.menu-heading h1 {
  position: relative;
  width: max-content;
  margin: 0;
  color: var(--paper);
  font-family: "Songti SC", "STSong", serif;
  font-size: clamp(58px, 17vw, 74px);
  font-weight: 800;
  line-height: .98;
  letter-spacing: -.1em;
}

.menu-heading h1::after {
  content: "";
  position: absolute;
  z-index: -1;
  left: 5px;
  right: -8px;
  bottom: 1px;
  height: 13px;
  background: var(--blue);
  transform: skewX(-13deg);
}

.menu-heading h1 span { color: var(--acid); }

.tagline {
  margin: 17px 0 0;
  color: #aaa99f;
  font-size: 11px;
  line-height: 1.75;
  letter-spacing: .08em;
}

.risk-ticket {
  position: absolute;
  z-index: 4;
  top: 301px;
  right: 22px;
  width: 170px;
  height: 105px;
  padding: 13px 13px 10px;
  color: var(--ink);
  background:
    linear-gradient(rgba(20,20,16,.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(20,20,16,.06) 1px, transparent 1px),
    var(--paper);
  background-size: 10px 10px;
  box-shadow: 7px 8px 0 rgba(241,237,226,.12);
  transform: rotate(1.8deg);
}

.risk-ticket::before {
  content: "WARNING";
  position: absolute;
  top: 0;
  right: 0;
  padding: 4px 6px;
  color: #fff;
  background: var(--red);
  font: 6px/1 Arial, sans-serif;
  letter-spacing: .1em;
}

.risk-ticket > div { display: flex; align-items: baseline; }
.risk-ticket > div small { margin-right: auto; font: 6px/1 Arial, sans-serif; letter-spacing: .12em; }
.risk-ticket > div b { color: var(--blue); font: 900 30px/.8 Arial, sans-serif; letter-spacing: -.06em; }
.risk-ticket > div i { font: 10px/1 Arial, sans-serif; font-style: normal; }
.risk-ticket > span { display: grid; grid-template-columns: repeat(10,1fr); gap: 2px; margin: 13px 0 9px; }
.risk-ticket > span i { display: block; height: 15px; background: var(--blue); }
.risk-ticket > span i:nth-last-child(-n+3) { background: var(--red); }
.risk-ticket > p { margin: 0; font: 700 7px/1 Arial, sans-serif; letter-spacing: .18em; }

.how-to {
  position: absolute;
  z-index: 6;
  top: 442px;
  left: 22px;
  right: 22px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-block: 1px solid rgba(255,255,255,.13);
}

.how-to article {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  height: 66px;
  padding: 0 7px;
  border-right: 1px solid rgba(255,255,255,.1);
}

.how-to article:last-child { border-right: 0; }
.how-to p { display: flex; flex-direction: column; gap: 4px; margin: 0; min-width: 0; }
.how-to p b { overflow: hidden; font-size: 8px; font-weight: 550; white-space: nowrap; }
.how-to p small { color: #66665f; font: 6px/1 Arial, sans-serif; letter-spacing: .12em; }

.gesture {
  position: relative;
  flex: 0 0 auto;
  display: block;
  width: 27px;
  height: 27px;
  border: 1px solid rgba(255,255,255,.24);
  border-radius: 50%;
}

.gesture::before {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px solid var(--blue);
  border-radius: 50%;
}

.gesture i {
  position: absolute;
  left: 11px;
  top: 6px;
  width: 5px;
  height: 12px;
  border: 1px solid var(--paper);
  border-radius: 3px;
}

.hold-gesture::before { animation: gesturePulse 1.4s ease-out infinite; }
.pull-gesture i { animation: pullDown 1.5s ease-in-out infinite; }
.release-gesture::after { content: "↑"; position: absolute; top: -8px; right: -2px; color: var(--acid); font: 13px/1 Arial, sans-serif; animation: releaseUp 1.3s ease-in-out infinite; }
@keyframes gesturePulse { 70%,100% { opacity: 0; transform: scale(1.6); } }
@keyframes pullDown { 50% { transform: translateY(5px); } }
@keyframes releaseUp { 50% { transform: translateY(-4px); } }

.menu-bottom {
  position: absolute;
  z-index: 8;
  left: 22px;
  right: 22px;
  bottom: var(--safe-bottom);
}

.best-strip {
  display: grid;
  grid-template-columns: 1fr 1px 1fr 1px 1fr;
  align-items: center;
  height: 47px;
  margin-bottom: 9px;
  border-top: 1px solid rgba(255,255,255,.13);
}

.best-strip > i { width: 1px; height: 22px; background: rgba(255,255,255,.12); }
.best-strip span { display: flex; align-items: baseline; justify-content: center; gap: 7px; }
.best-strip small { color: #6e6d66; font-size: 7px; }
.best-strip b { font: 700 14px/1 Arial, sans-serif; }

.primary-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 51px;
  padding: 0 17px;
  color: white;
  background: var(--blue);
  box-shadow: 0 13px 30px rgba(43,96,255,.24);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: .08em;
  transition: transform .2s ease, filter .2s ease;
}

.primary-button:hover { filter: brightness(1.08); }
.primary-button:active { transform: scale(.985); }
.primary-button > i { font: 20px/1 Arial, sans-serif; font-style: normal; }
.primary-button.dark { color: var(--paper); background: var(--ink); box-shadow: none; }

.daily-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 42px;
  padding: 0 15px;
  border: 1px solid rgba(255,255,255,.15);
  margin-top: 7px;
  text-align: left;
}

.daily-button > span { display: flex; align-items: baseline; gap: 9px; }
.daily-button b { font-size: 9px; font-weight: 550; letter-spacing: .08em; }
.daily-button small { color: #66665f; font: 6px/1 Arial, sans-serif; letter-spacing: .12em; }
.daily-button > i { color: var(--acid); font: 16px/1 Arial, sans-serif; font-style: normal; }

/* HUD */
.hud { pointer-events: none !important; }

.score-block {
  position: absolute;
  top: 76px;
  left: 20px;
  display: flex;
  flex-direction: column;
}

.score-block small { color: #77766e; font: 6px/1 Arial, sans-serif; letter-spacing: .13em; }
.score-block strong { margin-top: 4px; font: 800 31px/.95 Arial, sans-serif; letter-spacing: -.06em; }
.score-block > span { position: absolute; left: 100%; top: 15px; width: max-content; margin-left: 8px; color: var(--acid); font: 700 9px/1 Arial, sans-serif; opacity: 0; transform: translateY(4px); }
.score-block > span.pop { animation: scorePop .55s ease-out; }
@keyframes scorePop { 0% { opacity: 0; transform: translateY(6px); } 30% { opacity: 1; transform: translateY(0); } 100% { opacity: 0; transform: translateY(-9px); } }

.timer-block {
  position: absolute;
  top: 69px;
  left: 50%;
  width: 54px;
  height: 54px;
  transform: translateX(-50%);
}

.timer-block svg { position: absolute; inset: 0; width: 100%; transform: rotate(-90deg); }
.timer-block circle { fill: none; stroke: rgba(255,255,255,.12); stroke-width: 1.5; }
.timer-block .timer-value { stroke: var(--paper); stroke-width: 2; stroke-linecap: square; stroke-dasharray: 144.5; stroke-dashoffset: 0; transition: stroke .25s ease; }
.timer-block > span { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.timer-block b { font: 700 15px/1 Arial, sans-serif; }
.timer-block small { margin-top: 2px; color: #6c6b64; font: 5px/1 Arial, sans-serif; letter-spacing: .1em; }
.timer-block.urgent .timer-value { stroke: var(--red); }
.timer-block.urgent b { color: var(--red); }

.combo-block {
  position: absolute;
  top: 78px;
  right: 20px;
  width: 67px;
  text-align: right;
}

.combo-block small { display: block; color: #6f6e67; font: 6px/1 Arial, sans-serif; letter-spacing: .14em; }
.combo-block b { display: block; margin: 3px 0 6px; color: var(--acid); font: 800 22px/1 Arial, sans-serif; }
.combo-block > i { display: block; width: 100%; height: 2px; background: linear-gradient(90deg,var(--acid) var(--combo,0%),rgba(255,255,255,.12) 0); }
.combo-block.bump b { animation: comboBump .28s ease-out; }
@keyframes comboBump { 50% { transform: scale(1.3); } }

.target-label {
  display: none !important;
  position: absolute;
  top: 139px;
  left: 50%;
  display: grid;
  grid-template-columns: 12px 1fr auto;
  align-items: center;
  gap: 8px;
  min-width: 182px;
  height: 37px;
  padding: 0 10px;
  border: 1px solid rgba(255,255,255,.13);
  background: rgba(20,20,16,.62);
  backdrop-filter: blur(8px);
  transform: translateX(-50%);
}

.target-dot { width: 8px; height: 8px; border: 2px solid var(--target-color,var(--blue)); border-radius: 50%; box-shadow: 0 0 9px var(--target-color,var(--blue)); }
.target-label p { display: flex; flex-direction: column; gap: 2px; margin: 0; }
.target-label p small { color: #6d6c65; font-size: 5px; letter-spacing: .08em; }
.target-label p b { font-size: 8px; font-weight: 550; letter-spacing: .08em; }
.target-label > i { color: #77766f; font: 7px/1 Arial, sans-serif; font-style: normal; }
.target-label > i b { color: var(--paper); font-size: 11px; }
.target-label.armored { border-color: rgba(241,237,226,.62); box-shadow: inset 0 0 0 1px rgba(241,237,226,.1); }
.target-label.armored .target-dot { border-radius: 2px; border-color: var(--paper); box-shadow: 0 0 9px rgba(241,237,226,.7); transform: rotate(45deg); }
.target-label.armored p small::after { content: " / BREAK FIRST"; color: var(--red); }

.load-panel {
  position: absolute;
  z-index: 25;
  left: 20px;
  right: 20px;
  bottom: var(--safe-bottom);
  padding: 10px 12px 9px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(20,20,16,.74);
  backdrop-filter: blur(9px);
  transition: border-color .2s ease, transform .2s ease;
}

.load-copy { display: flex; align-items: flex-end; justify-content: space-between; }
.load-copy > span { display: flex; align-items: baseline; gap: 8px; }
.load-copy small { color: #77766f; font-size: 7px; letter-spacing: .08em; }
.load-copy small i { color: var(--paper); font-style: normal; }
.load-copy b { font: 800 20px/1 Arial, sans-serif; }
.load-copy em { color: var(--acid); font: 800 18px/1 Arial, sans-serif; font-style: normal; }
.load-track { position: relative; height: 7px; margin: 9px 0 6px; overflow: hidden; background: rgba(255,255,255,.1); }
.load-track > i { display: block; width: var(--load,0%); height: 100%; background: linear-gradient(90deg,var(--blue) 0 67%,var(--acid) 67% 84%,var(--red) 84%); box-shadow: 0 0 14px currentColor; transition: width .08s linear; }
.load-track span { position: absolute; top: 0; bottom: 0; width: 1px; background: rgba(20,20,16,.65); }
.load-track span:nth-of-type(1) { left: 50%; }
.load-track span:nth-of-type(2) { left: 75%; }
.load-track span:nth-of-type(3) { left: 90%; }
.load-panel p { margin: 0; color: #77766f; font-size: 7px; letter-spacing: .08em; }
.load-panel.danger { border-color: var(--red); animation: dangerPulse .55s ease-in-out infinite alternate; }
.load-panel.danger .load-copy b,
.load-panel.danger p { color: var(--red); }
@keyframes dangerPulse { to { transform: translateY(-2px); box-shadow: 0 0 26px rgba(255,80,60,.14); } }.tutorial-callout {
  position: absolute;
  left: 50%;
  bottom: calc(var(--safe-bottom) + 110px);
  z-index: 80;
  display: flex;
  align-items: center;
  gap: 14px;
  width: max-content;
  max-width: calc(100% - 32px);
  padding: 10px 20px;
  color: #ffffff;
  border: 2px solid #ffb81c;
  border-radius: 999px;
  background: rgba(16, 12, 38, 0.96) !important;
  box-shadow:
    0 14px 40px rgba(0, 0, 0, 0.75),
    0 0 24px rgba(255, 184, 28, 0.4);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transform: translateX(-50%);
  transition: opacity .3s ease, transform .3s ease;
  animation: tutCalloutBounce 2.4s ease-in-out infinite;
}

@keyframes tutCalloutBounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(-5px); }
}

.tutorial-callout.hidden {
  opacity: 0 !important;
  transform: translate(-50%, 16px) !important;
  pointer-events: none !important;
}

.tutorial-callout .step-badge {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: #241442;
  background: linear-gradient(135deg, #ffc736 0%, #ff9d1c 100%);
  font: 900 13px/1 Arial, sans-serif;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  flex-shrink: 0;
}

.tutorial-callout .tut-content {
  display: flex;
  flex-direction: column;
  gap: 3px;
  text-align: left;
}

.tutorial-callout b {
  color: #ffea78 !important;
  font-size: 14px !important;
  font-weight: 900 !important;
  letter-spacing: .05em;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.9);
}

.tutorial-callout small {
  color: #ffffff !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  letter-spacing: .03em;
  opacity: 0.95;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
}

.tut-gesture-icon {
  display: none !important;
}

/* ------------------------------------------
 * 三主题背景自适应指引气泡 (Theme Adaptive)
 * ------------------------------------------ */
/* 1. 星球大战 (space) 背景自适应 */
.app[data-theme="space"] .tutorial-callout {
  border: 2px solid #63ddff !important;
  background: rgba(10, 14, 38, 0.94) !important;
  box-shadow:
    0 14px 40px rgba(0, 0, 0, 0.85),
    0 0 24px rgba(99, 221, 255, 0.45) !important;
}

.app[data-theme="space"] .tutorial-callout .step-badge {
  color: #0b112c !important;
  background: linear-gradient(135deg, #63ddff 0%, #38b2ff 100%) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5) !important;
}

.app[data-theme="space"] .tutorial-callout b {
  color: #63ddff !important;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.9), 0 0 10px rgba(99, 221, 255, 0.5) !important;
}

.app[data-theme="space"] .tutorial-callout small {
  color: rgba(255, 255, 255, 0.92) !important;
}

/* 2. 像素表情包 (pixel) 背景自适应 */
.app[data-theme="pixel"] .tutorial-callout {
  border: 3px solid #ff3fb4 !important;
  border-radius: 16px !important;
  background: rgba(20, 12, 36, 0.96) !important;
  box-shadow:
    0 12px 36px rgba(0, 0, 0, 0.8),
    0 0 20px rgba(255, 63, 180, 0.4) !important;
}

.app[data-theme="pixel"] .tutorial-callout .step-badge {
  border-radius: 4px !important;
  color: #ffffff !important;
  background: #ff3fb4 !important;
}

.app[data-theme="pixel"] .tutorial-callout b {
  color: #ffe66d !important;
}

/* 3. 萌宠世界 (pet) 背景自适应 */
.app[data-theme="pet"] .tutorial-callout {
  border: 2.5px solid #ffb81c !important;
  border-radius: 999px !important;
  background: rgba(36, 20, 48, 0.94) !important;
  box-shadow:
    0 12px 36px rgba(0, 0, 0, 0.65),
    0 0 22px rgba(255, 184, 28, 0.4) !important;
}

.app[data-theme="pet"] .tutorial-callout .step-badge {
  color: #241442 !important;
  background: linear-gradient(135deg, #ffc736 0%, #ff9d1c 100%) !important;
}

.app[data-theme="pet"] .tutorial-callout b {
  color: #ffea78 !important;
}

/* 局内最后5秒全息无敌提醒Banner */
.invincible-banner {
  position: absolute;
  top: 46%;
  left: 50%;
  z-index: 15;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: max-content;
  max-width: 90%;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.9);
  transition: opacity 0.4s ease, transform 0.4s ease;
  user-select: none;
}

.invincible-banner.show {
  opacity: 0.78;
  transform: translate(-50%, -50%) scale(1);
  animation: crazyFloat 2.6s ease-in-out infinite, crazyFlash 0.85s ease-in-out infinite alternate;
}

@keyframes crazyFloat {
  0%, 100% { transform: translate(-50%, -50%) translateY(0); }
  50% { transform: translate(-50%, -50%) translateY(-10px); }
}

@keyframes crazyFlash {
  0% { opacity: 0.55; filter: drop-shadow(0 0 8px rgba(255, 184, 28, 0.4)); }
  100% { opacity: 0.92; filter: drop-shadow(0 0 22px rgba(255, 63, 180, 0.85)); }
}

.invincible-banner b {
  color: #ffea78;
  font-family: 'ZCOOL KuaiLe', 'Fredoka', ui-rounded, sans-serif;
  font-size: 24px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-shadow:
    0 2px 10px rgba(0, 0, 0, 0.8),
    0 0 16px rgba(255, 184, 28, 0.6);
  white-space: nowrap;
}

.invincible-banner small {
  color: rgba(255, 255, 255, 0.85);
  font-family: 'Fredoka', sans-serif;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.25em;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.8);
}

.final-countdown {
  position: absolute;
  z-index: 50;
  inset: 0;
  display: none;
  place-items: center;
  pointer-events: none;
  background: rgba(255,80,60,.04);
}

.final-countdown.show { display: grid; }
.final-countdown small { position: absolute; top: 39%; color: var(--red); font: 700 10px/1 Arial, sans-serif; letter-spacing: .25em; }
.final-countdown b { color: transparent; -webkit-text-stroke: 1px rgba(255,255,255,.16); font: 900 174px/1 Arial, sans-serif; letter-spacing: -.08em; }

/* Upgrade / Pause */
.modal-scene { z-index: 85; }
.modal-scrim { position: absolute; inset: 0; background: rgba(7,7,6,.83); backdrop-filter: blur(9px); }

.upgrade-panel {
  position: absolute;
  top: 92px;
  left: 21px;
  right: 21px;
}

.upgrade-panel .eyebrow { margin-bottom: 15px; }
.upgrade-panel h2,
.pause-card h2 {
  margin: 0;
  font: 400 35px/1.2 "Songti SC", "STSong", serif;
  letter-spacing: -.05em;
}
.upgrade-panel h2 em { color: var(--acid); font-style: normal; }
.upgrade-panel > p:last-of-type { margin: 12px 0 20px; color: #8b8a82; font-size: 9px; letter-spacing: .07em; }

.upgrade-options { display: grid; gap: 8px; }
.upgrade-card {
  position: relative;
  display: grid;
  grid-template-columns: 49px 1fr 27px;
  align-items: center;
  min-height: 92px;
  padding: 10px 12px;
  overflow: hidden;
  color: var(--ink);
  text-align: left;
  background: var(--paper);
  border: 2px solid transparent;
  transition: transform .2s ease, border-color .2s ease;
}
.upgrade-card:hover { transform: translateX(4px); border-color: var(--blue); }
.upgrade-card::after { content: attr(data-index); position: absolute; right: 4px; bottom: -16px; color: rgba(20,20,16,.05); font: 900 65px/1 Arial, sans-serif; }
.upgrade-card > i:first-child { display: grid; place-items: center; width: 37px; height: 37px; color: white; background: var(--blue); font: 800 15px/1 Arial, sans-serif; font-style: normal; }
.upgrade-card > span { display: flex; flex-direction: column; gap: 5px; }
.upgrade-card > span b { font: 700 13px/1 "Songti SC", serif; letter-spacing: .04em; }
.upgrade-card > span small { color: #696961; font-size: 8px; line-height: 1.5; }
.upgrade-card > i:last-child { color: var(--blue); font: 20px/1 Arial, sans-serif; font-style: normal; }

.pause-card {
  position: absolute;
  top: 50%;
  left: 25px;
  right: 25px;
  padding: 26px 22px 20px;
  color: var(--ink);
  background: var(--paper);
  transform: translateY(-50%) rotate(-1deg);
  box-shadow: 10px 10px 0 rgba(241,237,226,.13);
}
.pause-card > p { margin: 0 0 13px; color: var(--blue); font: 700 7px/1 Arial, sans-serif; letter-spacing: .18em; }
.pause-card .primary-button { margin-top: 27px; }
.text-button { display: block; margin: 15px auto 0; color: currentColor; font-size: 8px; letter-spacing: .1em; text-decoration: underline; text-underline-offset: 4px; opacity: .55; }

/* Result */
.result { background: rgba(9,9,7,.76); backdrop-filter: blur(8px); }
.result-paper {
  position: absolute;
  top: 75px;
  left: 22px;
  right: 22px;
  padding: 17px 19px 16px;
  overflow: hidden;
  color: var(--ink);
  background:
    linear-gradient(rgba(20,20,16,.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(20,20,16,.055) 1px, transparent 1px),
    var(--paper);
  background-size: 14px 14px;
  box-shadow: 10px 10px 0 rgba(241,237,226,.14);
  transform: rotate(-.5deg);
}
.result-paper::before { content: ""; position: absolute; top: 0; left: 0; width: 7px; height: 100%; background: var(--blue); }
.result-topline { display: flex; justify-content: space-between; color: #727169; font: 6px/1 Arial, sans-serif; letter-spacing: .13em; }
.grade-stamp { position: absolute; top: 42px; right: 18px; display: grid; place-items: center; width: 62px; height: 62px; color: var(--red); border: 2px solid var(--red); border-radius: 50%; font: 900 38px/1 Arial, sans-serif; transform: rotate(9deg); }
.grade-stamp::after { content: "APPROVED"; position: absolute; bottom: 5px; font: 700 5px/1 Arial, sans-serif; letter-spacing: .08em; }
.result-kicker { margin: 33px 0 7px; color: #77766e; font-size: 8px; letter-spacing: .13em; }
.result-paper h2 { margin: 0; font: 400 34px/1.16 "Songti SC", serif; letter-spacing: -.05em; }
.result-paper h2 em { color: var(--blue); font: 900 44px/1 Arial, sans-serif; font-style: normal; letter-spacing: -.06em; }
.record-line { width: calc(100% - 20px); margin: 14px 0 19px; padding-bottom: 10px; color: #65645e; border-bottom: 1px solid rgba(20,20,16,.24); font-size: 8px; letter-spacing: .05em; }

.result-stats { display: grid; grid-template-columns: repeat(3,1fr); border-block: 1px solid rgba(20,20,16,.25); }
.result-stats span { display: flex; flex-direction: column; gap: 8px; padding: 12px 8px; border-right: 1px solid rgba(20,20,16,.2); }
.result-stats span:last-child { border-right: 0; }
.result-stats small { color: #77766e; font-size: 7px; }
.result-stats b { font: 800 19px/1 Arial, sans-serif; }

.challenge-line { display: grid; grid-template-columns: 32px 1fr; gap: 10px; align-items: center; min-height: 69px; }
.challenge-line i { position: relative; width: 29px; height: 29px; border: 1px solid var(--red); border-radius: 50%; }
.challenge-line i::before { content: "!"; position: absolute; inset: 0; display: grid; place-items: center; color: var(--red); font: 800 12px/1 Arial, sans-serif; }
.challenge-line p { margin: 0; color: #55554f; font-size: 8px; line-height: 1.65; }

.result-secondary { display: grid; grid-template-columns: 1fr 1fr; margin-top: 7px; border: 1px solid rgba(20,20,16,.25); }
.result-secondary button { height: 39px; color: var(--ink); font-size: 8px; letter-spacing: .08em; }
.result-secondary button:first-child { border-right: 1px solid rgba(20,20,16,.25); }

.feedback-layer {
  position: absolute;
  z-index: 68;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.feedback-pop { position: absolute; left: 50%; top: 47%; color: var(--paper); font: 900 26px/.9 Arial, sans-serif; text-align: center; letter-spacing: -.04em; text-shadow: 0 3px 20px rgba(0,0,0,.45); transform: translate(-50%,-50%); animation: feedbackPop .7s ease-out forwards; }
.feedback-pop small { display: block; margin-top: 7px; color: var(--acid); font: 700 7px/1 Arial, sans-serif; letter-spacing: .16em; }
.feedback-pop.bad { color: var(--red); }
@keyframes feedbackPop { 0% { opacity: 0; transform: translate(-50%,-35%) scale(.6); } 25% { opacity: 1; transform: translate(-50%,-50%) scale(1.12); } 100% { opacity: 0; transform: translate(-50%,-75%) scale(.95); } }

.toast {
  position: absolute;
  z-index: 140;
  left: 50%;
  bottom: calc(var(--safe-bottom) + 15px);
  width: max-content;
  max-width: calc(100% - 38px);
  padding: 10px 14px;
  color: var(--paper);
  background: var(--ink);
  border: 1px solid rgba(255,255,255,.2);
  font-size: 8px;
  letter-spacing: .07em;
  opacity: 0;
  transform: translate(-50%,8px);
  pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
}
.toast.show { opacity: 1; transform: translate(-50%,0); }

.rotate-notice { display: none; }
.desktop-copy { display: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@media (min-width: 900px) {
  body { grid-template-columns: 1fr 430px 1fr; gap: 72px; padding: 24px; }
  .app { grid-column: 2; }
  .desktop-copy { grid-column: 1; grid-row: 1; justify-self: end; display: block; width: 280px; }
  .desktop-copy p { display: flex; align-items: center; gap: 10px; margin: 0 0 27px; color: #6e6d65; font: 6px/1 Arial, sans-serif; letter-spacing: .15em; }
  .desktop-copy p i { width: 28px; height: 1px; background: var(--red); }
  .desktop-copy h2 { margin: 0 0 21px; font: 400 37px/1.24 "Songti SC", serif; letter-spacing: -.04em; }
  .desktop-copy small { color: #6f6e67; font-size: 8px; letter-spacing: .12em; }
}

@media (max-height: 740px) {
  .menu-heading { top: 78px; }
  .menu-heading h1 { font-size: 57px; }
  .tagline { margin-top: 10px; }
  .risk-ticket { top: 257px; transform: rotate(1.8deg) scale(.88); transform-origin: right top; }
  .how-to { top: 370px; }
  .how-to article { height: 57px; }
  .best-strip { height: 39px; }
  .primary-button { height: 45px; }
  .daily-button { height: 37px; }
  .result-paper { top: 55px; transform: rotate(-.5deg) scale(.92); transform-origin: center top; }
  .upgrade-panel { top: 70px; }
  .upgrade-card { min-height: 78px; }
}

@media (max-height: 610px) {
  .menu-heading { top: 70px; }
  .menu-heading .eyebrow { margin-bottom: 9px; }
  .menu-heading h1 { font-size: 49px; }
  .tagline { font-size: 9px; line-height: 1.55; }
  .risk-ticket { top: 220px; transform: rotate(1.8deg) scale(.76); }
  .how-to { top: 306px; }
  .how-to article { height: 50px; padding-inline: 4px; }
  .gesture { transform: scale(.8); }
  .menu-bottom { bottom: max(8px, env(safe-area-inset-bottom)); }
  .best-strip { height: 33px; margin-bottom: 5px; }
  .daily-button { margin-top: 5px; }
  .result-paper { top: 38px; transform: rotate(-.5deg) scale(.79); }
  .upgrade-panel { top: 57px; }
  .upgrade-panel h2 { font-size: 29px; }
  .upgrade-options { gap: 5px; }
  .upgrade-card { min-height: 69px; }
}

@media (orientation: landscape) and (max-height: 600px) {
  .app > :not(#gameCanvas):not(.screen-grid):not(.grain):not(.edge-vignette):not(.rotate-notice) { display: none !important; }
  .rotate-notice { position: absolute; z-index: 160; inset: 0; display: flex; align-items: center; justify-content: center; gap: 18px; color: var(--paper); background: rgba(20,20,16,.94); }
  .rotate-notice > b { color: var(--acid); font: 300 39px/1 Arial, sans-serif; }
  .rotate-notice > span { font: 400 17px/1.5 "Songti SC", serif; }
  .rotate-notice small { color: #77766f; font: 6px/1 Arial, sans-serif; letter-spacing: .14em; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
}

/* --------------------------------------------------------------------------
   THREE WORLDS UI · 2026 portrait interface
   The launch and style scenes are self-contained; the game HUD inherits the
   selected theme through #app[data-theme].
   -------------------------------------------------------------------------- */

:root {
  --safe-left: max(18px, env(safe-area-inset-left));
  --safe-right: max(18px, env(safe-area-inset-right));
}

body {
  background:
    radial-gradient(circle at 50% 16%, rgba(101, 89, 255, .15), transparent 34%),
    radial-gradient(circle at 50% 100%, rgba(255, 118, 169, .08), transparent 32%),
    #07070c;
}

.app {
  width: 100vw;
  width: 100%;
  height: 100dvh;
  height: 100%;
}

.app {
  --theme-primary: #7188ff;
  --theme-secondary: #64f5ff;
  --theme-hot: #ff4f7e;
  --theme-panel: rgba(12, 18, 48, .72);
  --theme-panel-solid: #111936;
  --theme-line: rgba(132, 221, 255, .25);
  --theme-text: #f4f8ff;
  --theme-muted: #8794b8;
  --theme-focus: #71f6ff;
  --theme-radius: 8px;
}

.app[data-theme="space"] {
  --ink: #070b1d;
  --paper: #f4f8ff;
  --paper-deep: #b6c5e5;
  --blue: #7188ff;
  --acid: #64f5ff;
  --red: #ff4f7e;
  --cyan: #64f5ff;
  --theme-primary: #7188ff;
  --theme-secondary: #64f5ff;
  --theme-hot: #ff4f7e;
  --theme-panel: rgba(9, 17, 47, .72);
  --theme-panel-solid: #101936;
  --theme-line: rgba(122, 224, 255, .28);
  --theme-text: #f4f8ff;
  --theme-muted: #8492b8;
  --theme-focus: #64f5ff;
  --theme-radius: 7px;
}

.app[data-theme="pixel"] {
  --ink: #160f2c;
  --paper: #fffbe4;
  --paper-deep: #d8d0ff;
  --blue: #ff3fb4;
  --acid: #ffe34a;
  --red: #ff4b55;
  --cyan: #38f0dd;
  --theme-primary: #ff3fb4;
  --theme-secondary: #38f0dd;
  --theme-hot: #ff4b55;
  --theme-panel: rgba(22, 15, 44, .88);
  --theme-panel-solid: #201446;
  --theme-line: rgba(255, 227, 74, .48);
  --theme-text: #fffbe4;
  --theme-muted: #b8a9d7;
  --theme-focus: #ffe34a;
  --theme-radius: 0px;
}

.app[data-theme="pet"] {
  --ink: #3c2940;
  --paper: #fffaf0;
  --paper-deep: #f1d8c7;
  --blue: #ff79a8;
  --acid: #6fd9b2;
  --red: #ff6e6b;
  --cyan: #79d8ee;
  --theme-primary: #ff79a8;
  --theme-secondary: #6fd9b2;
  --theme-hot: #ff7a65;
  --theme-panel: rgba(255, 250, 240, .84);
  --theme-panel-solid: #fff7e9;
  --theme-line: rgba(103, 73, 105, .15);
  --theme-text: #49324d;
  --theme-muted: #9d8199;
  --theme-focus: #ff6f9f;
  --theme-radius: 18px;
}

.app[data-phase="menu"] .topbar,
.app[data-phase="style"] .topbar {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.app[data-phase="playing"] .brand {
  pointer-events: auto;
}

.app[data-phase="menu"] .screen-grid,
.app[data-phase="style"] .screen-grid,
.app[data-phase="menu"] .edge-vignette,
.app[data-phase="style"] .edge-vignette {
  opacity: 0;
}

.app[data-phase="menu"] .grain,
.app[data-phase="style"] .grain {
  z-index: 69;
  opacity: .055;
}

button:focus-visible {
  outline-color: var(--theme-focus, var(--acid));
}

/* Launch scene ------------------------------------------------------------ */

.launch-scene {
  z-index: 60;
  overflow: hidden;
  color: #fff;
  background: url("./static/begin/begin.webp") center center / cover no-repeat;
}

.launch-panels {
  display: none;
}

.launch-scene::after {
  display: none;
}

.launch-panels,
.launch-slice {
  position: absolute;
  inset-inline: 0;
}

.launch-panels { inset-block: 0; }

.launch-slice {
  overflow: hidden;
  transform: translateZ(0);
}

.launch-space {
  top: -2%;
  height: 39%;
  clip-path: polygon(0 0, 100% 0, 100% 82%, 0 100%);
  background:
    radial-gradient(circle at 76% 22%, rgba(139, 108, 255, .6), transparent 19%),
    radial-gradient(ellipse at 28% 50%, rgba(53, 125, 255, .42), transparent 34%),
    radial-gradient(circle at 10% 25%, #fff 0 1px, transparent 1.5px),
    radial-gradient(circle at 65% 48%, #aef7ff 0 1px, transparent 1.6px),
    radial-gradient(circle at 90% 68%, #fff 0 .8px, transparent 1.3px),
    linear-gradient(145deg, #070918 5%, #11164a 52%, #36166a 100%);
  background-size: auto, auto, 58px 61px, 82px 77px, 69px 73px, auto;
  box-shadow: 0 18px 42px rgba(2, 4, 18, .5);
}

.launch-space::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .5;
  background: conic-gradient(from 200deg at 35% 115%, transparent, rgba(98, 221, 255, .2), transparent 18%);
}

.space-planet {
  position: absolute;
  right: -12%;
  top: 8%;
  width: 51%;
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle at 29% 27%, rgba(255,255,255,.92) 0 1.2%, transparent 2%),
    radial-gradient(circle at 33% 32%, #8ddcff 0, #5574ef 19%, #3d247b 48%, #130b39 72%);
  box-shadow:
    -22px 7px 45px rgba(78, 111, 255, .55),
    inset 13px -12px 22px rgba(5, 4, 24, .72),
    inset -3px 3px 6px rgba(255,255,255,.3);
}

.space-planet::after {
  content: "";
  position: absolute;
  inset: 11% -23%;
  border: 4px solid rgba(133, 221, 255, .48);
  border-inline-color: rgba(193, 137, 255, .75);
  border-radius: 50%;
  transform: rotate(-17deg) scaleY(.27);
  box-shadow: 0 0 15px rgba(100, 224, 255, .42);
}

.space-moon {
  position: absolute;
  top: 54%;
  left: 8%;
  width: 28px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 29%, #fff, #9ab7ff 37%, #4d4b91 74%);
  box-shadow: 0 0 20px rgba(135, 202, 255, .45);
}

.space-orbit {
  position: absolute;
  border: 1px solid rgba(112, 222, 255, .25);
  border-radius: 50%;
  transform: rotate(-18deg);
}

.orbit-one { left: -35%; top: 17%; width: 106%; height: 105%; }
.orbit-two { left: -19%; top: 31%; width: 73%; height: 69%; border-style: dashed; }

.space-ship {
  position: absolute;
  left: 12%;
  bottom: 18%;
  width: 106px;
  height: 38px;
  filter: drop-shadow(0 5px 10px rgba(0,0,0,.48));
  transform: rotate(-8deg);
}

.space-ship::before {
  content: "";
  position: absolute;
  inset: 5px 5px 4px 12px;
  clip-path: polygon(0 48%, 33% 18%, 68% 0, 100% 47%, 66% 62%, 24% 100%);
  background: linear-gradient(165deg, #e4faff, #6979ca 49%, #252559 50% 100%);
  border: 1px solid rgba(255,255,255,.58);
}

.space-ship::after {
  content: "";
  position: absolute;
  left: -20px;
  top: 15px;
  width: 40px;
  height: 7px;
  background: linear-gradient(90deg, transparent, #64f5ff);
  filter: blur(1px);
}

.space-ship i {
  position: absolute;
  z-index: 2;
  left: 54px;
  top: 11px;
  width: 19px;
  height: 8px;
  border-radius: 50% 50% 20% 20%;
  background: #70f3ff;
  box-shadow: 0 0 12px #70f3ff;
}

.space-ship b {
  position: absolute;
  z-index: 2;
  right: 14px;
  top: 16px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ff547f;
  box-shadow: 0 0 9px #ff547f;
}

.space-laser {
  position: absolute;
  height: 2px;
  transform-origin: right center;
  background: linear-gradient(90deg, transparent, #fff 78%, #64f5ff);
  box-shadow: 0 0 8px #64f5ff;
}

.laser-one { right: 18%; bottom: 17%; width: 40%; transform: rotate(-17deg); }
.laser-two { right: 2%; bottom: 28%; width: 24%; transform: rotate(10deg); opacity: .7; }

.launch-pixel {
  z-index: 2;
  top: 29%;
  height: 40%;
  clip-path: polygon(0 18%, 100% 0, 100% 80%, 0 100%);
  background:
    linear-gradient(45deg, rgba(255,255,255,.09) 25%, transparent 25% 75%, rgba(255,255,255,.09) 75%) 0 0 / 18px 18px,
    linear-gradient(135deg, #fd3ca7, #7646df 47%, #2f7bd8 100%);
  box-shadow: 0 18px 44px rgba(69, 19, 101, .44);
}

.launch-pixel::before,
.launch-pixel::after {
  content: "";
  position: absolute;
  background: rgba(255, 230, 75, .96);
  box-shadow: 0 0 0 6px rgba(255,255,255,.08), 0 0 28px rgba(255, 224, 62, .5);
  transform: rotate(45deg);
}

.launch-pixel::before { left: -21px; top: 28%; width: 51px; height: 51px; }
.launch-pixel::after { right: 14%; bottom: 13%; width: 16px; height: 16px; background: #41f5dc; }

.pixel-burst {
  position: absolute;
  left: 50%;
  top: 53%;
  width: 225px;
  height: 124px;
  transform: translate(-50%, -50%) rotate(-7deg);
  background: repeating-conic-gradient(from 0deg, rgba(255,238,68,.86) 0 9deg, transparent 9deg 18deg);
  clip-path: polygon(50% 0, 56% 35%, 71% 10%, 67% 40%, 96% 25%, 74% 48%, 100% 57%, 71% 59%, 90% 88%, 61% 68%, 57% 100%, 48% 70%, 27% 96%, 37% 65%, 2% 75%, 31% 54%, 0 43%, 34% 43%, 17% 14%, 43% 35%);
  opacity: .55;
}

.pixel-avatar {
  position: absolute;
  z-index: 2;
  display: block;
  width: 70px;
  height: 70px;
  border: 4px solid #26153f;
  background: #ffe34a;
  box-shadow: 7px 7px 0 rgba(34, 19, 58, .62), inset -7px -7px 0 rgba(255, 121, 40, .38);
}

.pixel-avatar::before,
.pixel-avatar::after {
  content: "";
  position: absolute;
  top: 21px;
  width: 9px;
  height: 13px;
  background: #24143a;
  box-shadow: 0 4px 0 #fff;
}

.pixel-avatar::before { left: 14px; }
.pixel-avatar::after { right: 14px; }
.pixel-avatar i { position: absolute; left: 19px; right: 19px; bottom: 14px; height: 7px; border: 4px solid #27143c; border-top: 0; }
.pixel-avatar b { position: absolute; right: -11px; top: -13px; width: 16px; height: 16px; background: #38f0dd; border: 3px solid #25143c; }
.pixel-avatar-a { left: 13%; top: 36%; transform: rotate(-9deg); }
.pixel-avatar-b { right: 9%; top: 20%; width: 57px; height: 57px; background: #38f0dd; transform: rotate(9deg); }
.pixel-avatar-c { left: 47%; bottom: 8%; width: 43px; height: 43px; background: #ff795b; transform: rotate(13deg); }
.pixel-avatar-b::before, .pixel-avatar-b::after { top: 16px; width: 7px; height: 10px; }
.pixel-avatar-c::before, .pixel-avatar-c::after { top: 11px; width: 6px; height: 8px; }
.pixel-avatar-c i { left: 10px; right: 10px; bottom: 8px; }

.pixel-coin {
  position: absolute;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  color: #291642;
  border: 3px solid #291642;
  background: #ffe34a;
  font: 900 15px/1 "Courier New", monospace;
  box-shadow: 4px 4px 0 rgba(38,20,62,.45);
}

.coin-one { left: 6%; bottom: 11%; transform: rotate(8deg); }
.coin-two { right: 30%; top: 20%; transform: rotate(-13deg); }

.launch-pets {
  z-index: 3;
  top: 59%;
  bottom: -1%;
  clip-path: polygon(0 17%, 100% 0, 100% 100%, 0 100%);
  background:
    radial-gradient(circle at 85% 18%, rgba(255,255,255,.78) 0 2%, transparent 2.3%),
    linear-gradient(155deg, #ffd6dd 0 34%, #f7b9ca 34% 56%, #90d8ba 56% 72%, #5eb68d 72%);
}

.launch-pets::before {
  content: "";
  position: absolute;
  left: -10%;
  right: -10%;
  bottom: -15%;
  height: 50%;
  border-radius: 50% 50% 0 0;
  background:
    radial-gradient(circle at 20% 20%, #ffe765 0 3px, transparent 4px),
    radial-gradient(circle at 62% 17%, #fff 0 3px, transparent 4px),
    radial-gradient(circle at 82% 32%, #ff88aa 0 3px, transparent 4px),
    #74c597;
  background-size: 74px 61px, 91px 70px, 83px 65px, auto;
  box-shadow: inset 0 14px 26px rgba(255,255,255,.13);
}

.launch-cloud {
  position: absolute;
  display: block;
  width: 70px;
  height: 23px;
  border-radius: 999px;
  background: rgba(255,255,255,.75);
  box-shadow: 20px -9px 0 rgba(255,255,255,.75), 40px 0 0 rgba(255,255,255,.75);
}

.cloud-one { left: -20px; top: 25%; transform: scale(.72); }
.cloud-two { right: 7%; top: 20%; transform: scale(.48); opacity: .75; }

.pet-face {
  position: absolute;
  z-index: 3;
  display: block;
  width: 82px;
  height: 76px;
  border: 3px solid rgba(74, 49, 66, .78);
  border-radius: 48% 48% 44% 44%;
  background: #fff3db;
  box-shadow: 0 10px 0 rgba(80, 46, 70, .12), inset 0 -9px 0 rgba(224, 172, 130, .2);
}

.pet-face::before,
.pet-face::after {
  content: "";
  position: absolute;
  z-index: -1;
  top: -18px;
  width: 32px;
  height: 38px;
  border: 3px solid rgba(74, 49, 66, .78);
  background: inherit;
}

.pet-face::before { left: 5px; transform: rotate(-24deg); border-radius: 9px 80% 14px 70%; }
.pet-face::after { right: 5px; transform: rotate(24deg); border-radius: 80% 9px 70% 14px; }
.pet-face i { position: absolute; top: 29px; width: 8px; height: 10px; border-radius: 50%; background: #4a3142; }
.pet-face i:first-child { left: 20px; }
.pet-face i:nth-child(2) { right: 20px; }
.pet-face b { position: absolute; left: 50%; bottom: 16px; width: 22px; height: 11px; border: 3px solid #4a3142; border-top: 0; border-radius: 0 0 18px 18px; transform: translateX(-50%); }
.pet-cat { left: 7%; bottom: 9%; transform: rotate(-5deg); }
.pet-dog { right: 8%; bottom: 7%; width: 88px; height: 81px; background: #edb676; transform: rotate(5deg); }
.pet-dog::before, .pet-dog::after { top: -7px; width: 31px; height: 49px; background: #a86d4f; }
.pet-dog::before { left: -10px; transform: rotate(19deg); border-radius: 70% 20% 60% 40%; }
.pet-dog::after { right: -10px; transform: rotate(-19deg); border-radius: 20% 70% 40% 60%; }
.pet-bunny { left: 41%; bottom: 1%; width: 65px; height: 62px; background: #fff8f4; transform: scale(.82); }
.pet-bunny::before, .pet-bunny::after { top: -45px; width: 20px; height: 54px; border-radius: 70% 70% 35% 35%; }
.pet-bunny::before { left: 7px; transform: rotate(-7deg); }
.pet-bunny::after { right: 7px; transform: rotate(7deg); }

.launch-flower {
  position: absolute;
  z-index: 2;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ff7da0;
  box-shadow: 7px 0 #fff, -7px 0 #fff, 0 7px #fff, 0 -7px #fff;
}

.flower-one { left: 26%; bottom: 7%; }
.flower-two { right: 29%; bottom: 17%; transform: scale(.7); }

.launch-logo {
  display: none !important;
}

.launch-logo p {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin: 0 0 7px;
  color: #bfeeff;
  font: 700 6px/1 Arial, sans-serif;
  letter-spacing: .24em;
  text-shadow: 0 0 12px rgba(100,245,255,.72);
}

.launch-logo p span { width: 24px; height: 1px; background: linear-gradient(90deg, transparent, #64f5ff); }
.launch-logo p span:last-child { transform: scaleX(-1); }

.launch-logo h1 {
  margin: 0;
  color: #ffe76c;
  font-family: "Arial Black", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: clamp(43px, 13.7vw, 59px);
  font-weight: 950;
  line-height: 1;
  letter-spacing: -.085em;
  -webkit-text-stroke: 1px rgba(94, 33, 84, .9);
  text-shadow:
    0 2px 0 #ffac4e,
    0 4px 0 #dd5f7a,
    0 7px 0 #662b72,
    0 0 8px rgba(255,255,255,.8),
    0 0 25px rgba(255,126,111,.78),
    0 12px 22px rgba(11,5,29,.8);
  transform: skew(-3deg) rotate(-1deg);
}

.launch-logo h1 small {
  display: inline-block;
  margin-inline: .08em;
  color: #fff3d1;
  font-size: .47em;
  font-weight: 900;
  letter-spacing: 0;
  vertical-align: .23em;
  -webkit-text-stroke-width: 0;
  text-shadow: 0 2px 0 #f26984, 0 0 14px #ffc65d;
}

.launch-logo > b {
  display: inline-block;
  margin-top: 10px;
  padding: 4px 13px 5px;
  color: #fff;
  border: 1px solid rgba(255,255,255,.35);
  border-radius: 999px;
  background: rgba(9, 12, 38, .36);
  backdrop-filter: blur(5px);
  font-size: 8px;
  font-weight: 650;
  letter-spacing: .16em;
  text-shadow: 0 2px 8px rgba(0,0,0,.6);
}

.launch-action {
  position: absolute;
  z-index: 12;
  top: calc(67% + 17px);
  left: 50%;
  width: min(80%, 320px);
  transform: translate(-50%, -50%);
}

.liquid-start {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 44px;
  align-items: center;
  width: 100%;
  min-height: 68px;
  padding: 6px 12px 6px 28px;
  overflow: hidden;
  color: #fff;
  border: 1.5px solid rgba(255, 255, 255, 0.65);
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.28) 0%, rgba(20, 16, 45, 0.55) 50%, rgba(255, 120, 180, 0.22) 100%);
  box-shadow:
    inset 0 1.5px 3px rgba(255, 255, 255, 0.75),
    inset 0 -1.5px 4px rgba(0, 0, 0, 0.3),
    0 12px 36px rgba(16, 12, 38, 0.45),
    0 0 24px rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  text-align: left;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  animation: liquidFloat 3.6s ease-in-out infinite;
}

.liquid-start::before {
  content: "";
  position: absolute;
  inset: 3px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: inherit;
  pointer-events: none;
}

.liquid-start::after {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.22), transparent 60%);
  pointer-events: none;
  opacity: 0.8;
  transition: opacity 0.3s ease;
}

.liquid-start:hover {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.38) 0%, rgba(32, 24, 68, 0.7) 50%, rgba(255, 140, 200, 0.35) 100%);
  border-color: rgba(255, 255, 255, 0.95);
  box-shadow:
    inset 0 2px 4px rgba(255, 255, 255, 0.9),
    0 16px 42px rgba(16, 12, 38, 0.55),
    0 0 32px rgba(255, 255, 255, 0.35);
  transform: translateY(-3px) scale(1.02);
}

.liquid-start:active {
  transform: scale(0.97);
}

.liquid-start > span:not(.liquid-shine) {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.liquid-start b {
  color: #ffffff;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-shadow: 0 2px 10px rgba(12, 10, 28, 0.7);
}

.liquid-start small {
  color: rgba(255, 255, 255, 0.88);
  font: 700 8.5px/1 Arial, sans-serif;
  letter-spacing: 0.24em;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

.liquid-start > i {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  color: #100c28;
  background: linear-gradient(135deg, #ffffff 0%, #ffd6ea 100%);
  box-shadow: inset 0 0 0 1px #fff, 0 4px 14px rgba(0, 0, 0, 0.3);
  font: 700 22px/1 Arial, sans-serif;
  font-style: normal;
  transition: transform 0.3s ease, background 0.3s ease;
}

.liquid-start:hover > i {
  transform: translateX(4px) scale(1.05);
  background: linear-gradient(135deg, #ffffff 0%, #d4f7ff 100%);
}

.cartoon-start {
  border: 3.5px solid #241442;
  background: #ffb81c;
  box-shadow:
    inset 0 3px 0 rgba(255, 255, 255, 0.65),
    inset 0 -4px 0 rgba(0, 0, 0, 0.18),
    0 6px 0 #241442,
    0 12px 28px rgba(0, 0, 0, 0.38);
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

.cartoon-start:hover {
  background: #ffc736;
  border-color: #1b0e33;
  box-shadow:
    inset 0 3px 0 rgba(255, 255, 255, 0.75),
    inset 0 -4px 0 rgba(0, 0, 0, 0.22),
    0 8px 0 #1b0e33,
    0 16px 36px rgba(0, 0, 0, 0.45);
  transform: translateY(-3px) scale(1.03);
}

.cartoon-start b {
  color: #241442;
  font-family: 'ZCOOL KuaiLe', 'Fredoka', ui-rounded, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  font-size: 23px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-shadow: 0 1.5px 0 rgba(255, 255, 255, 0.4);
}

.cartoon-start small {
  color: #5c358e;
  font-family: 'Fredoka', 'ZCOOL KuaiLe', ui-rounded, sans-serif;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-shadow: none;
}

.cartoon-start > i {
  color: #ffffff;
  background: #241442;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.25);
}

.cartoon-emojis {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
}

.c-emoji {
  position: absolute;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.4));
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.emoji-cat {
  top: -16px;
  left: 10px;
  width: 36px;
  height: 36px;
  transform: rotate(-12deg);
  animation: cartoonBob 3s ease-in-out infinite alternate;
}

.emoji-rocket {
  bottom: -14px;
  right: 52px;
  width: 32px;
  height: 32px;
  transform: rotate(15deg);
  animation: cartoonFloat 2.6s ease-in-out infinite alternate;
}

.emoji-sparkle {
  top: -10px;
  right: 18px;
  font-size: 16px;
  animation: cartoonTwinkle 1.8s ease-in-out infinite alternate;
}

.cartoon-start:hover .emoji-cat {
  transform: rotate(-20deg) scale(1.18) translateY(-4px);
}

.cartoon-start:hover .emoji-rocket {
  transform: rotate(25deg) scale(1.18) translateY(-4px);
}

@keyframes cartoonBob {
  0% { transform: rotate(-12deg) translateY(0); }
  100% { transform: rotate(-6deg) translateY(-5px); }
}

@keyframes cartoonFloat {
  0% { transform: rotate(15deg) translateY(0); }
  100% { transform: rotate(20deg) translateY(-4px); }
}

@keyframes cartoonTwinkle {
  0% { opacity: 0.4; transform: scale(0.8); }
  100% { opacity: 1; transform: scale(1.25); }
}

.liquid-shine {
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  transform: skewX(-20deg);
  animation: shineMove 4s ease-in-out infinite;
}

@keyframes shineMove {
  0%, 70% { left: -100%; }
  100% { left: 200%; }
}

.launch-action > p {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin: 13px 0 0;
  color: rgba(255, 255, 255, 0.88);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: .2em;
  text-shadow: 0 2px 8px rgba(20, 10, 35, 0.8);
}

.launch-action > p i { width: 18px; height: 1.5px; background: rgba(255, 255, 255, 0.6); }

.launch-footnote {
  position: absolute;
  z-index: 8;
  left: 24px;
  right: 24px;
  bottom: calc(var(--safe-bottom) + 1px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0;
  color: rgba(67,42,65,.55);
  font: 700 6px/1 Arial, sans-serif;
  letter-spacing: .18em;
}

.launch-footnote span { display: grid; place-items: center; width: 23px; height: 23px; color: rgba(255,255,255,.76); border: 1px solid rgba(255,255,255,.55); border-radius: 50%; }

@keyframes liquidFloat { 50% { transform: translateY(-5px); } }
@keyframes liquidSweep { 0%, 42% { left: -42%; opacity: 0; } 52% { opacity: .8; } 72%, 100% { left: 122%; opacity: 0; } }

/* Style selection --------------------------------------------------------- */

.style-select {
  z-index: 58;
  overflow: hidden;
  color: #f8f6ff;
  background:
    radial-gradient(circle at 9% 22%, rgba(86, 220, 255, .14), transparent 25%),
    radial-gradient(circle at 91% 48%, rgba(255, 71, 169, .14), transparent 28%),
    radial-gradient(circle at 40% 92%, rgba(117, 234, 179, .1), transparent 31%),
    linear-gradient(145deg, #090b1c, #15102c 58%, #171124);
}

.style-select::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .32;
  background:
    linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(to bottom, #000, transparent 80%);
}

.style-ambient { position: absolute; inset: 0; pointer-events: none; }
.style-ambient i { position: absolute; display: block; border: 1px solid rgba(255,255,255,.09); border-radius: 50%; }
.style-ambient i:first-child { top: -120px; right: -110px; width: 300px; height: 300px; box-shadow: inset 0 0 50px rgba(95,102,255,.1); }
.style-ambient i:nth-child(2) { left: -160px; bottom: 8%; width: 280px; height: 280px; border-style: dashed; }
.style-ambient i:nth-child(3) { top: 20%; left: 8%; width: 5px; height: 5px; border: 0; background: #fff; box-shadow: 52px -31px 0 #71e6ff, 269px 60px 0 #ff7aac, 230px 315px 0 #fff, 30px 400px 0 #77e1b8; opacity: .58; }

.style-heading {
  position: absolute;
  z-index: 3;
  top: var(--safe-top);
  left: var(--safe-left);
  right: var(--safe-right);
  display: grid;
  grid-template-columns: 54px 1fr 40px;
  align-items: center;
  min-height: 72px;
}

.back-button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  width: 45px;
  height: 45px;
  color: rgba(255,255,255,.82);
  border: 1px solid rgba(255,255,255,.17);
  border-radius: 15px;
  background: rgba(255,255,255,.055);
  backdrop-filter: blur(10px);
  transition: transform .2s ease, background .2s ease;
}

.back-button:hover { background: rgba(255,255,255,.12); transform: translateX(-2px); }
.back-button:active { transform: scale(.94); }
.back-button i { height: 22px; font: 300 25px/18px Arial, sans-serif; font-style: normal; }
.back-button span { color: rgba(255,255,255,.5); font-size: 6px; letter-spacing: .12em; }

.style-heading > div { min-width: 0; text-align: center; }
.style-heading p { margin: 0 0 6px; color: #8e91ae; font: 700 6px/1 Arial, sans-serif; letter-spacing: .25em; }
.style-heading h2 { margin: 0; font-size: clamp(17px, 5.2vw, 22px); font-weight: 760; line-height: 1.15; letter-spacing: .02em; text-shadow: 0 4px 18px rgba(0,0,0,.42); }
.style-step { justify-self: end; color: rgba(255,255,255,.36); font: 700 6px/1 Arial, sans-serif; letter-spacing: .08em; transform: rotate(90deg); }

.style-cards {
  position: absolute;
  z-index: 3;
  top: calc(var(--safe-top) + 80px);
  right: var(--safe-right);
  bottom: calc(var(--safe-bottom) + 95px);
  left: var(--safe-left);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

@keyframes cardGentleFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}

.style-card {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  overflow: hidden;
  border: 1.5px solid rgba(255, 255, 255, .28);
  border-radius: 20px;
  text-align: left;
  box-shadow: 0 14px 35px rgba(0, 0, 0, .35), inset 0 1px 1px rgba(255, 255, 255, .3);
  transform: translateZ(0);
  transition: transform .3s cubic-bezier(.2,.9,.2,1), border-color .3s ease, filter .3s ease, box-shadow .3s ease;
  background: #090c15;
}

.style-card:nth-child(1) { animation: cardGentleFloat 4.2s ease-in-out infinite; }
.style-card:nth-child(2) { animation: cardGentleFloat 4.8s ease-in-out 0.8s infinite; }
.style-card:nth-child(3) { animation: cardGentleFloat 4.4s ease-in-out 1.6s infinite; }

.style-card::before {
  content: "";
  position: absolute;
  z-index: 3;
  top: 8px;
  right: 8px;
  bottom: 8px;
  left: calc(46% + 4px);
  pointer-events: none;
  border: 1px solid rgba(255, 255, 255, .15);
  border-radius: 0 14px 14px 0;
}

.style-card:hover {
  animation-play-state: paused;
  transform: translateY(-5px) scale(1.015);
  filter: saturate(1.15) brightness(1.08);
  border-color: rgba(255, 255, 255, .5);
  box-shadow: 0 20px 42px rgba(0, 0, 0, .45), inset 0 1px 2px rgba(255, 255, 255, .4);
}
.style-card:active { transform: scale(.982); }
.style-card:focus-visible { outline-width: 3px; outline-offset: 3px; }
.style-card.selected .card-enter { opacity: 1; color: #fff; border-color: transparent; background: rgba(255,255,255,.2); box-shadow: 0 0 16px rgba(255,255,255,.22); }
.pixel-card.selected .card-enter { color: #24143d; border-color: #24143d; background: #38f0dd; box-shadow: 3px 3px 0 #24143d; }
.pet-card.selected .card-enter { color: #fff; background: #e86797; box-shadow: 0 5px 13px rgba(214,79,132,.24); }
.style-card > * { min-width: 0; }

/* 背景图片展示 */
.card-bg-wrap {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  overflow: hidden;
}

.card-bg-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: left center;
  transition: transform .5s ease;
}

.style-card:hover .card-bg-img {
  transform: scale(1.08);
}

/* 右侧完全透明毛玻璃面板 */
.card-glass-panel {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 55%;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px 10px 16px;
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.02) 100%);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border-left: 1.5px solid rgba(255, 255, 255, 0.3);
  box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.18), -10px 0 25px rgba(0, 0, 0, 0.2);
  transition: backdrop-filter .3s ease, background .3s ease, border-color .3s ease;
}

.space-card .card-glass-panel {
  border-left-color: rgba(120, 220, 255, 0.45);
}

.pixel-card .card-glass-panel {
  border-left-color: rgba(60, 230, 110, 0.55);
}

.pet-card .card-glass-panel {
  background: linear-gradient(120deg, rgba(255, 248, 250, 0.38) 0%, rgba(255, 235, 242, 0.18) 100%);
  border-left-color: rgba(255, 255, 255, 0.85);
  box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.4), -10px 0 25px rgba(0, 0, 0, 0.08);
}

/* 文字浮动与视觉表现 */
@keyframes textGentleFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

@keyframes iconFloatPulse {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-2px) scale(1.06); }
}

.card-copy {
  position: relative;
  z-index: 4;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  min-width: 0;
}

.space-card { color: #eff8ff; border-color: rgba(102, 211, 255, .4); }
.pixel-card { color: #ffffff; border-color: rgba(255, 130, 175, .45); }
.pet-card { color: #ffffff; border-color: rgba(255, 210, 220, .6); }

.space-card .card-copy small { color: #6cecff; text-shadow: 0 1px 6px rgba(0,0,0,0.8); }
.pixel-card .card-copy small { color: #ffd666; text-shadow: 0 1px 6px rgba(0,0,0,0.8); }
.pet-card .card-copy small { color: #ff9ebb; text-shadow: 0 1px 6px rgba(0,0,0,0.8); }

.card-copy small {
  font: 700 8.5px/1 Arial, sans-serif;
  letter-spacing: .15em;
  animation: textGentleFloat 3.8s ease-in-out infinite;
}

.card-copy strong {
  overflow: hidden;
  font-size: clamp(16px, 4.8vw, 21px);
  font-weight: 850;
  line-height: 1.1;
  letter-spacing: -.02em;
  white-space: nowrap;
  text-shadow: 0 2px 10px rgba(0,0,0,0.85);
  transition: transform .3s ease, text-shadow .3s ease;
}

.style-card:hover .card-copy strong {
  transform: translateX(4px);
  text-shadow: 0 2px 14px rgba(255,255,255,0.4);
}

.card-copy em {
  overflow: hidden;
  font-size: 8.5px;
  font-style: normal;
  letter-spacing: .04em;
  opacity: .9;
  white-space: nowrap;
  text-shadow: 0 1px 6px rgba(0,0,0,0.85);
}

.card-enter {
  position: relative;
  z-index: 4;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  font: 700 12px/1 Arial, sans-serif;
  opacity: .85;
  animation: iconFloatPulse 3.4s ease-in-out infinite;
  transition: transform .25s ease, opacity .25s ease, background .25s ease;
}

.style-card:hover .card-enter {
  animation: none;
  opacity: 1;
  transform: rotate(45deg) scale(1.15);
  background: rgba(255, 255, 255, 0.2);
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.3);
}

.space-card {
  color: #eff8ff;
  border-color: rgba(102, 211, 255, .35);
  background:
    radial-gradient(circle at 20% 20%, rgba(84, 202, 255, .3), transparent 29%),
    linear-gradient(120deg, #07122f, #17265e 56%, #30205d);
}

.space-card:hover { border-color: rgba(117, 237, 255, .78); box-shadow: 0 15px 38px rgba(20, 88, 191, .28), inset 0 1px rgba(255,255,255,.22); }
.space-card .card-copy small { color: #6cecff; }
.space-card .card-enter { color: #6cecff; }

.space-preview {
  background:
    radial-gradient(circle at 78% 18%, #fff 0 1px, transparent 1.5px),
    radial-gradient(circle at 15% 29%, #94efff 0 1px, transparent 1.6px),
    linear-gradient(145deg, #06102c, #172a67);
  background-size: 54px 51px, 69px 63px, auto;
}

.preview-planet {
  position: absolute;
  left: -23%;
  top: -29%;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 58% 58%, #8b93ff, #393289 43%, #111241 72%);
  box-shadow: 12px 16px 28px rgba(75,100,255,.45), inset -13px -10px 17px rgba(3,7,26,.65);
}

.preview-orbit {
  position: absolute;
  left: -26%;
  top: 17%;
  width: 118%;
  height: 47%;
  border: 2px solid rgba(106,237,255,.55);
  border-radius: 50%;
  transform: rotate(-17deg);
  box-shadow: 0 0 12px rgba(91,232,255,.24);
}

.preview-grid {
  position: absolute;
  right: -20%;
  bottom: -34%;
  width: 90%;
  height: 75%;
  background:
    linear-gradient(rgba(91,224,255,.24) 1px, transparent 1px),
    linear-gradient(90deg, rgba(91,224,255,.24) 1px, transparent 1px);
  background-size: 13px 13px;
  transform: perspective(90px) rotateX(48deg) rotate(-7deg);
}

.preview-ship {
  position: absolute;
  z-index: 3;
  right: 12%;
  bottom: 24%;
  width: 76px;
  height: 28px;
  clip-path: polygon(0 50%, 32% 8%, 67% 0, 100% 50%, 61% 64%, 20% 100%);
  background: linear-gradient(165deg, #ebfbff, #8396e9 48%, #262b6a 49%);
  filter: drop-shadow(0 4px 7px rgba(0,0,0,.5));
  transform: rotate(-9deg);
}

.preview-ship i { position: absolute; left: 42%; top: 24%; width: 22%; height: 28%; border-radius: 50%; background: #63f4ff; box-shadow: 0 0 9px #63f4ff; }
.preview-beam { position: absolute; right: 7%; bottom: 17%; width: 65%; height: 2px; background: linear-gradient(90deg, transparent, #fff, #6cecff); box-shadow: 0 0 8px #6cecff; transform: rotate(-14deg); }

.pixel-card {
  color: #ffffff;
  border: 2.5px solid #3ce66e;
  border-radius: 18px;
  background:
    linear-gradient(90deg, rgba(255,255,255,.12) 50%, transparent 50%) 0 0 / 12px 12px,
    linear-gradient(135deg, #ff4fab, #ff8d45 52%, #ffe44b);
  box-shadow:
    0 0 0 3px #0f2414,
    4px 4px 0 #0f2414,
    0 14px 35px rgba(0, 0, 0, .4);
}

.pixel-card::before {
  inset: 7px;
  left: calc(46% + 4px);
  border: 1.5px dashed rgba(255, 255, 255, .4);
  border-left: 0;
  border-radius: 0 12px 12px 0;
}

.pixel-card .card-bg-wrap {
  background-color: #36cd61;
}

.pixel-card .card-bg-img {
  transform: translateX(-20px);
}

.pixel-card:hover .card-bg-img {
  transform: translateX(-20px) scale(1.08);
}

.pixel-card:hover {
  border-color: #5dff8b;
  box-shadow:
    0 0 0 3px #0f2414,
    6px 6px 0 #3ce66e,
    0 18px 40px rgba(0, 0, 0, .5);
}

.pixel-card .card-copy {
  font-family: "Courier New", "Microsoft YaHei", monospace;
}

.pixel-card .card-copy small {
  font-weight: 900;
  color: #ffd666;
  text-shadow: 0 1px 6px rgba(0,0,0,0.85);
}

.pixel-card .card-copy strong {
  text-shadow: 0 2px 10px rgba(0,0,0,0.9);
}

.pixel-card .card-enter {
  border-width: 2px;
  border-radius: 50%;
}

.pixel-preview {
  border-right: 3px solid #24143d;
  background:
    linear-gradient(90deg, rgba(255,255,255,.13) 50%, transparent 50%) 0 0 / 12px 12px,
    linear-gradient(145deg, #ff49ad, #884bd8);
}

.pixel-sun {
  position: absolute;
  top: -23%;
  right: -11%;
  width: 79px;
  height: 79px;
  background: #ffe44b;
  border: 4px solid #28163f;
  box-shadow: 5px 5px 0 rgba(40,22,63,.4);
  transform: rotate(45deg);
}

.preview-pixel-face {
  position: absolute;
  z-index: 2;
  left: 22%;
  top: 23%;
  width: 66px;
  height: 66px;
  border: 4px solid #26143d;
  background: #ffe44b;
  box-shadow: 7px 7px 0 #291641, inset -7px -7px 0 #ff913f;
  transform: rotate(-6deg);
}

.preview-pixel-face::before,
.preview-pixel-face::after {
  content: "";
  position: absolute;
  top: 18px;
  width: 9px;
  height: 12px;
  background: #26143d;
}

.preview-pixel-face::before { left: 13px; }
.preview-pixel-face::after { right: 13px; }
.preview-pixel-face i { position: absolute; left: 16px; right: 16px; bottom: 13px; height: 9px; border: 4px solid #26143d; border-top: 0; }
.preview-pixel-face b { position: absolute; top: -13px; right: -13px; width: 18px; height: 18px; border: 3px solid #26143d; background: #3ce3cc; }

.preview-mini-face {
  position: absolute;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  color: #26143d;
  border: 3px solid #26143d;
  background: #42ead5;
  font: 900 13px/1 "Courier New", monospace;
  box-shadow: 3px 3px 0 rgba(38,20,61,.55);
}

.mini-one { left: 7%; bottom: 9%; transform: rotate(-8deg); }
.mini-two { right: 4%; bottom: 20%; background: #ff678a; transform: rotate(8deg); }

.preview-spring {
  position: absolute;
  right: -2%;
  bottom: 3%;
  width: 85%;
  height: 22px;
  border-bottom: 5px solid #26143d;
  background: repeating-linear-gradient(135deg, transparent 0 8px, #fff 8px 12px, transparent 12px 20px);
  transform: rotate(-7deg);
}

.pet-card {
  color: #3d1f35;
  border-color: rgba(255, 255, 255, .85);
  border-radius: 20px;
  box-shadow: 0 14px 35px rgba(104, 51, 89, .2), inset 0 1px #fff;
}

.pet-card::before {
  border-color: rgba(83, 55, 80, .15);
  border-radius: 0 14px 14px 0;
}

.pet-card:hover {
  border-color: #fff;
  box-shadow: 0 18px 37px rgba(127, 63, 102, .3), inset 0 1px #fff;
}

.pet-card .card-copy small {
  color: #d63b72;
  font-weight: 900;
  letter-spacing: .16em;
  text-shadow: 0 1px 3px rgba(255, 255, 255, 0.95);
}

.pet-card .card-copy strong {
  color: #3d1f35;
  font-weight: 900;
  text-shadow: 0 1px 3px rgba(255, 255, 255, 0.95), 0 0 12px rgba(255, 255, 255, 0.85);
}

.pet-card .card-copy em {
  color: #5c3855;
  font-weight: 700;
  text-shadow: 0 1px 3px rgba(255, 255, 255, 0.95);
}

.pet-card .card-enter {
  color: #d63b72;
  border-color: #d63b72;
  background: rgba(255, 255, 255, 0.7);
  box-shadow: 0 2px 8px rgba(214, 59, 114, 0.25);
}

.pet-preview {
  border-right-color: rgba(82,54,79,.13);
  background: linear-gradient(#aee4ee 0 51%, #9edaa9 51% 63%, #63b785 63%);
}

.preview-cloud {
  position: absolute;
  display: block;
  width: 43px;
  height: 15px;
  border-radius: 999px;
  background: rgba(255,255,255,.82);
  box-shadow: 12px -7px 0 rgba(255,255,255,.82), 25px 0 0 rgba(255,255,255,.82);
}

.cloud-left { left: -10px; top: 19%; }
.cloud-right { right: 3%; top: 11%; transform: scale(.65); }

.preview-grass {
  position: absolute;
  left: -5%;
  right: -5%;
  bottom: -22%;
  height: 56%;
  border-radius: 50% 50% 0 0;
  background: #72c491;
  box-shadow: inset 0 8px 15px rgba(255,255,255,.18);
}

.preview-pet {
  position: absolute;
  z-index: 3;
  display: block;
  width: 57px;
  height: 53px;
  border: 3px solid #52394f;
  border-radius: 46% 46% 43% 43%;
  background: #fff2d5;
  box-shadow: 0 6px 0 rgba(80,47,72,.11), inset 0 -6px rgba(218,163,125,.17);
}

.preview-pet::before,
.preview-pet::after {
  content: "";
  position: absolute;
  z-index: -1;
  top: -14px;
  width: 21px;
  height: 28px;
  border: 3px solid #52394f;
  background: inherit;
}

.preview-pet::before { left: 2px; border-radius: 5px 80% 8px 70%; transform: rotate(-25deg); }
.preview-pet::after { right: 2px; border-radius: 80% 5px 70% 8px; transform: rotate(25deg); }
.preview-pet i { position: absolute; top: 20px; width: 6px; height: 7px; border-radius: 50%; background: #50364d; }
.preview-pet i:first-child { left: 14px; }
.preview-pet i:nth-child(2) { right: 14px; }
.preview-pet b { position: absolute; left: 50%; bottom: 10px; width: 15px; height: 8px; border: 2px solid #50364d; border-top: 0; border-radius: 0 0 10px 10px; transform: translateX(-50%); }
.preview-cat { left: 13%; bottom: 15%; transform: rotate(-6deg); }
.preview-pup { right: 6%; bottom: 10%; width: 62px; height: 57px; background: #dca66d; transform: rotate(6deg); }
.preview-pup::before, .preview-pup::after { top: -4px; height: 36px; background: #a66f51; }
.preview-pup::before { left: -8px; transform: rotate(17deg); }
.preview-pup::after { right: -8px; transform: rotate(-17deg); }
.preview-heart { position: absolute; z-index: 4; top: 11%; left: 48%; color: #ff6f9c; font-size: 17px; text-shadow: 0 2px 0 #fff, 0 4px 9px rgba(204,70,119,.28); animation: heartFloat 2s ease-in-out infinite; }

.style-footer {
  position: absolute;
  z-index: 4;
  right: var(--safe-right);
  bottom: var(--safe-bottom);
  left: var(--safe-left);
}

.style-footer .best-strip {
  height: 32px;
  margin: 0 0 5px;
  border-top: 0;
  border-bottom: 1px solid rgba(255,255,255,.11);
}

.style-footer .best-strip span { gap: 5px; }
.style-footer .best-strip small { color: rgba(255,255,255,.39); font-size: 6px; }
.style-footer .best-strip b { color: rgba(255,255,255,.85); font-size: 11px; }
.style-footer .best-strip > i { height: 15px; background: rgba(255,255,255,.1); }

.style-footer .daily-button {
  height: 42px;
  margin: 0;
  padding: 0 14px;
  color: rgba(255,255,255,.84);
  border-color: rgba(255,255,255,.15);
  border-radius: 14px;
  background: rgba(255,255,255,.055);
  backdrop-filter: blur(12px);
  transition: border-color .2s ease, background .2s ease, transform .2s ease;
}

.style-footer .daily-button:hover { border-color: rgba(255,255,255,.34); background: rgba(255,255,255,.1); }
.style-footer .daily-button:active { transform: scale(.985); }
.style-footer .daily-button b { font-size: 8px; }
.style-footer .daily-button small { color: rgba(255,255,255,.38); }
.style-footer .daily-button > i { color: #78efff; }

@keyframes heartFloat { 50% { transform: translateY(-4px) scale(1.08); } }

/* Theme-aware in-game interface ------------------------------------------ */

.topbar {
  left: var(--safe-left);
  right: var(--safe-right);
}

.brand,
.icon-button,
.target-label,
.load-panel,
.tutorial-callout,
.upgrade-card,
.pause-card,
.result-paper,
.primary-button {
  transition:
    color .3s ease,
    background-color .3s ease,
    border-color .3s ease,
    box-shadow .3s ease,
    border-radius .3s ease,
    transform .2s ease;
}

.brand { color: var(--theme-text); }
.brand > span:last-child > b { color: var(--theme-text); }
.brand small { color: var(--theme-muted); }
.lab-mark { border-color: var(--theme-line); background: var(--theme-panel); backdrop-filter: blur(8px); }
.lab-mark::before, .lab-mark::after { background: var(--theme-line); }
.lab-mark i { background: var(--theme-primary); box-shadow: 0 0 8px var(--theme-primary); }
.lab-mark b { background: var(--theme-secondary); box-shadow: 0 0 8px var(--theme-secondary); }

.icon-button {
  color: var(--theme-text);
  border-color: var(--theme-line);
  border-radius: var(--theme-radius);
  background: var(--theme-panel);
  box-shadow: inset 0 1px rgba(255,255,255,.07), 0 6px 16px rgba(0,0,0,.12);
  backdrop-filter: blur(11px) saturate(130%);
}

.sound-button i,
.pause-button i { background: currentColor; }

.score-block small,
.combo-block small,
.timer-block small { color: var(--theme-muted); }
.score-block strong { color: var(--theme-text); text-shadow: 0 4px 16px rgba(0,0,0,.25); }
.score-block > span,
.combo-block b { color: var(--theme-secondary); }
.combo-block > i { background: linear-gradient(90deg, var(--theme-secondary) var(--combo,0%), var(--theme-line) 0); }

.timer-block circle { stroke: var(--theme-line); }
.timer-block .timer-value { stroke: var(--theme-text); filter: drop-shadow(0 0 3px rgba(255,255,255,.25)); }
.timer-block b { color: var(--theme-text); }
.timer-block.urgent .timer-value { stroke: var(--theme-hot); }
.timer-block.urgent b { color: var(--theme-hot); }

.target-label {
  color: var(--theme-text);
  border-color: var(--theme-line);
  border-radius: var(--theme-radius);
  background: var(--theme-panel);
  box-shadow: inset 0 1px rgba(255,255,255,.06), 0 8px 20px rgba(0,0,0,.15);
  backdrop-filter: blur(12px) saturate(135%);
}

.target-label p small,
.target-label > i { color: var(--theme-muted); }
.target-label > i b { color: var(--theme-text); }

.load-panel {
  left: var(--safe-left);
  right: var(--safe-right);
  color: var(--theme-text);
  border-color: var(--theme-line);
  border-radius: var(--theme-radius);
  background: var(--theme-panel);
  box-shadow: inset 0 1px rgba(255,255,255,.07), 0 10px 28px rgba(0,0,0,.2);
  backdrop-filter: blur(13px) saturate(135%);
}

.load-copy small,
.load-panel p { color: var(--theme-muted); }
.load-copy em { color: var(--theme-secondary); }
.load-track { border-radius: calc(var(--theme-radius) * .35); background: var(--theme-line); }
.load-track > i { background: linear-gradient(90deg, var(--theme-primary) 0 67%, var(--theme-secondary) 67% 84%, var(--theme-hot) 84%); }
.load-panel.danger { border-color: var(--theme-hot); }
.load-panel.danger .load-copy b,
.load-panel.danger p { color: var(--theme-hot); }

.tutorial-callout {
  color: var(--ink);
  border-radius: var(--theme-radius);
  background: var(--paper);
  box-shadow: 0 10px 26px rgba(0,0,0,.2);
}
.tutorial-callout > span { border-radius: calc(var(--theme-radius) * .55); background: var(--theme-primary); }

.modal-scrim {
  background: color-mix(in srgb, var(--ink) 80%, transparent);
  backdrop-filter: blur(12px) saturate(90%);
}

.upgrade-panel .eyebrow b { color: var(--theme-text); }
.upgrade-panel .eyebrow span { background: var(--theme-hot); }
.upgrade-panel .eyebrow,
.upgrade-panel > p:last-of-type { color: var(--theme-muted); }
.upgrade-panel h2 { color: var(--theme-text); }
.upgrade-panel h2 em { color: var(--theme-secondary); }

.upgrade-card {
  color: var(--ink);
  border-radius: var(--theme-radius);
  background: var(--paper);
  box-shadow: 0 10px 22px rgba(0,0,0,.15), inset 0 1px rgba(255,255,255,.5);
}
.upgrade-card:hover { border-color: var(--theme-primary); }
.upgrade-card > i:first-child { border-radius: calc(var(--theme-radius) * .65); background: var(--theme-primary); }
.upgrade-card > i:last-child { color: var(--theme-primary); }

.pause-card {
  color: var(--ink);
  border-radius: var(--theme-radius);
  background: var(--paper);
  box-shadow: 0 20px 50px rgba(0,0,0,.32);
  transform: translateY(-50%);
}
.pause-card > p { color: var(--theme-primary); }

.primary-button {
  border-radius: var(--theme-radius);
  background: linear-gradient(135deg, var(--theme-primary), color-mix(in srgb, var(--theme-primary) 68%, #15152d));
  box-shadow: 0 13px 30px color-mix(in srgb, var(--theme-primary) 26%, transparent);
}
.primary-button.dark { color: #fff; background: var(--ink); }

.result { background: color-mix(in srgb, var(--ink) 74%, transparent); }
.result-paper {
  color: var(--ink);
  border-radius: var(--theme-radius);
  background:
    linear-gradient(color-mix(in srgb, var(--ink) 5%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--ink) 5%, transparent) 1px, transparent 1px),
    var(--paper);
  background-size: 14px 14px;
  box-shadow: 0 24px 54px rgba(0,0,0,.35);
  transform: none;
}
.result-paper::before { background: var(--theme-primary); }
.result-paper h2 em { color: var(--theme-primary); }
.grade-stamp { color: var(--theme-hot); border-color: var(--theme-hot); }
.challenge-line i { border-color: var(--theme-hot); }
.challenge-line i::before { color: var(--theme-hot); }

/* Space HUD: glass cockpit */

.app[data-theme="space"] .topbar::after {
  content: "";
  position: absolute;
  z-index: -1;
  left: -7px;
  right: -7px;
  top: -8px;
  height: 49px;
  border: 1px solid rgba(100,229,255,.1);
  clip-path: polygon(0 0, 96% 0, 100% 27%, 100% 100%, 4% 100%, 0 73%);
  background: linear-gradient(90deg, rgba(9,17,47,.5), rgba(30,27,73,.32));
  backdrop-filter: blur(8px);
}

.app[data-theme="space"] .lab-mark {
  clip-path: polygon(22% 0, 78% 0, 100% 22%, 100% 78%, 78% 100%, 22% 100%, 0 78%, 0 22%);
}

.app[data-theme="space"] .target-label,
.app[data-theme="space"] .load-panel {
  background:
    linear-gradient(135deg, rgba(105,143,255,.08), transparent 45%),
    rgba(7,16,45,.7);
}

.app[data-theme="space"] .target-label {
  clip-path: polygon(8px 0, calc(100% - 8px) 0, 100% 8px, 100% calc(100% - 8px), calc(100% - 8px) 100%, 8px 100%, 0 calc(100% - 8px), 0 8px);
}

.app[data-theme="space"] .load-panel::before,
.app[data-theme="space"] .load-panel::after {
  content: "";
  position: absolute;
  top: -1px;
  width: 34px;
  height: 3px;
  background: var(--theme-secondary);
  box-shadow: 0 0 10px var(--theme-secondary);
}
.app[data-theme="space"] .load-panel::before { left: 14px; }
.app[data-theme="space"] .load-panel::after { right: 14px; }

.app[data-theme="space"] .upgrade-card {
  color: var(--theme-text);
  border-color: rgba(101,229,255,.2);
  background:
    linear-gradient(120deg, rgba(113,136,255,.16), transparent 38%),
    rgba(10,20,52,.92);
  box-shadow: inset 0 1px rgba(255,255,255,.08), 0 10px 24px rgba(0,0,0,.22);
  clip-path: polygon(0 0, calc(100% - 13px) 0, 100% 13px, 100% 100%, 13px 100%, 0 calc(100% - 13px));
}
.app[data-theme="space"] .upgrade-card > span small { color: var(--theme-muted); }
.app[data-theme="space"] .upgrade-card::after { color: rgba(255,255,255,.035); }
.app[data-theme="space"] .pause-card,
.app[data-theme="space"] .result-paper {
  color: var(--theme-text);
  border: 1px solid rgba(103,226,255,.25);
  background:
    linear-gradient(rgba(100,220,255,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(100,220,255,.035) 1px, transparent 1px),
    linear-gradient(135deg, rgba(113,136,255,.14), transparent 43%),
    rgba(8,17,45,.96);
  background-size: 18px 18px, 18px 18px, auto, auto;
  clip-path: polygon(0 0, calc(100% - 17px) 0, 100% 17px, 100% 100%, 17px 100%, 0 calc(100% - 17px));
}
.app[data-theme="space"] .pause-card h2,
.app[data-theme="space"] .result-paper h2 { color: var(--theme-text); }
.app[data-theme="space"] .result-topline,
.app[data-theme="space"] .result-kicker,
.app[data-theme="space"] .record-line,
.app[data-theme="space"] .result-stats small,
.app[data-theme="space"] .challenge-line p { color: var(--theme-muted); }
.app[data-theme="space"] .record-line,
.app[data-theme="space"] .result-stats,
.app[data-theme="space"] .result-stats span,
.app[data-theme="space"] .result-secondary,
.app[data-theme="space"] .result-secondary button:first-child { border-color: rgba(117,217,255,.18); }
.app[data-theme="space"] .result-secondary button { color: var(--theme-text); }
.app[data-theme="space"] .primary-button.dark { color: #07102b; background: linear-gradient(135deg, #67f4ff, #7188ff); }

/* Pixel HUD: hard-edged arcade cabinet */

.app[data-theme="pixel"] :is(.topbar, .hud, .upgrade-panel, .pause-card, .result-paper) {
  font-family: "Courier New", "Microsoft YaHei", monospace;
}
.app[data-theme="pixel"] .topbar { top: calc(var(--safe-top) + 2px); }
.app[data-theme="pixel"] .lab-mark,
.app[data-theme="pixel"] .icon-button,
.app[data-theme="pixel"] .target-label,
.app[data-theme="pixel"] .load-panel {
  border-width: 2px;
  border-color: #ffe34a;
  border-radius: 0;
  background: rgba(25,14,53,.88);
  box-shadow: 3px 3px 0 rgba(255,63,180,.72);
  backdrop-filter: none;
}
.app[data-theme="pixel"] .lab-mark i { height: 3px; transform: none; }
.app[data-theme="pixel"] .lab-mark b { width: 7px; height: 7px; }
.app[data-theme="pixel"] .brand > span:last-child > b { font-weight: 900; }
.app[data-theme="pixel"] .score-block strong,
.app[data-theme="pixel"] .combo-block b { text-shadow: 3px 3px 0 rgba(255,63,180,.45); }
.app[data-theme="pixel"] .timer-block svg { shape-rendering: crispEdges; }
.app[data-theme="pixel"] .timer-block .timer-value { stroke: var(--acid); stroke-width: 3; stroke-linecap: butt; }
.app[data-theme="pixel"] .target-dot { border-radius: 0; }
.app[data-theme="pixel"] .load-track { height: 9px; border: 2px solid #fffbe4; border-radius: 0; background: #2c1b51; }
.app[data-theme="pixel"] .load-track > i { image-rendering: pixelated; box-shadow: none; }
.app[data-theme="pixel"] .tutorial-callout {
  border: 3px solid #24133f;
  border-radius: 0;
  box-shadow: 6px 6px 0 #ff3fb4;
}
.app[data-theme="pixel"] .tutorial-callout > span { border-radius: 0; background: #ff3fb4; }
.app[data-theme="pixel"] .upgrade-panel h2,
.app[data-theme="pixel"] .pause-card h2,
.app[data-theme="pixel"] .result-paper h2 { font-family: "Courier New", "Microsoft YaHei", monospace; font-weight: 900; }
.app[data-theme="pixel"] .upgrade-card {
  color: #24133f;
  border: 3px solid #24133f;
  border-radius: 0;
  background: #fff26a;
  box-shadow: 6px 6px 0 #ff3fb4;
}
.app[data-theme="pixel"] .upgrade-card:nth-child(2) { background: #50e9d5; box-shadow: 6px 6px 0 #ffe34a; }
.app[data-theme="pixel"] .upgrade-card:nth-child(3) { background: #ff8ccc; box-shadow: 6px 6px 0 #3ce5cf; }
.app[data-theme="pixel"] .upgrade-card:hover { transform: translate(-2px,-2px); box-shadow: 9px 9px 0 #38f0dd; }
.app[data-theme="pixel"] .upgrade-card > i:first-child,
.app[data-theme="pixel"] .primary-button { border-radius: 0; background: #ff3fb4; box-shadow: 4px 4px 0 #ffe34a; }
.app[data-theme="pixel"] .pause-card,
.app[data-theme="pixel"] .result-paper {
  color: #24133f;
  border: 4px solid #24133f;
  border-radius: 0;
  background:
    linear-gradient(rgba(36,19,63,.07) 2px, transparent 2px),
    linear-gradient(90deg, rgba(36,19,63,.07) 2px, transparent 2px),
    #fff9d3;
  background-size: 16px 16px;
  box-shadow: 9px 9px 0 #ff3fb4;
}
.app[data-theme="pixel"] .result-paper::before { width: 8px; background: #38e2ce; }
.app[data-theme="pixel"] .result-paper h2 em { color: #ff3fb4; text-shadow: 3px 3px 0 #ffe34a; }
.app[data-theme="pixel"] .primary-button.dark { color: #24133f; background: #ffe34a; box-shadow: 4px 4px 0 #38e2ce; }
.app[data-theme="pixel"] .result-secondary button { color: #24133f; font-family: inherit; font-weight: 900; }

/* Pet HUD: soft toy-like controls */

.app[data-theme="pet"] { color: var(--theme-text); }
.app[data-theme="pet"] .screen-grid { opacity: .08; }
.app[data-theme="pet"] .edge-vignette { background: radial-gradient(ellipse at center, transparent 55%, rgba(78,49,75,.14)); }
.app[data-theme="pet"] .topbar { color: var(--theme-text); }
.app[data-theme="pet"] .lab-mark,
.app[data-theme="pet"] .icon-button {
  color: var(--theme-text);
  border-color: rgba(92,61,91,.13);
  border-radius: 15px;
  background: rgba(255,250,240,.82);
  box-shadow: 0 6px 16px rgba(97,59,88,.12), inset 0 1px #fff;
}
.app[data-theme="pet"] .lab-mark { border-radius: 50% 50% 44% 44%; }
.app[data-theme="pet"] .brand > span:last-child > b { color: #fffaf0; text-shadow: 0 2px 9px rgba(67,40,63,.45); }
.app[data-theme="pet"] .brand small { color: rgba(255,250,240,.72); text-shadow: 0 1px 5px rgba(67,40,63,.4); }
.app[data-theme="pet"] .score-block small,
.app[data-theme="pet"] .combo-block small,
.app[data-theme="pet"] .timer-block small { color: rgba(255,250,240,.76); text-shadow: 0 2px 7px rgba(67,40,63,.38); }
.app[data-theme="pet"] .score-block strong { color: #fff; text-shadow: 0 3px 9px rgba(67,40,63,.4); }
.app[data-theme="pet"] .timer-block circle { stroke: rgba(255,255,255,.32); }
.app[data-theme="pet"] .timer-block .timer-value { stroke: #fffaf0; }
.app[data-theme="pet"] .timer-block b { color: #fff; text-shadow: 0 2px 7px rgba(67,40,63,.4); }
.app[data-theme="pet"] .target-label,
.app[data-theme="pet"] .load-panel {
  color: var(--theme-text);
  border-color: rgba(91,57,87,.13);
  background: rgba(255,250,240,.86);
  box-shadow: 0 9px 23px rgba(100,60,89,.14), inset 0 1px #fff;
}
.app[data-theme="pet"] .target-label { border-radius: 999px; padding-inline: 13px; }
.app[data-theme="pet"] .target-label p small,
.app[data-theme="pet"] .target-label > i,
.app[data-theme="pet"] .load-copy small,
.app[data-theme="pet"] .load-panel p { color: var(--theme-muted); }
.app[data-theme="pet"] .target-label > i b { color: var(--theme-text); }
.app[data-theme="pet"] .load-panel { border-radius: 21px; }
.app[data-theme="pet"] .load-track { height: 9px; border-radius: 999px; background: rgba(83,55,80,.1); }
.app[data-theme="pet"] .load-track > i { border-radius: inherit; box-shadow: 0 0 12px rgba(255,121,168,.3); }
.app[data-theme="pet"] .tutorial-callout { border-radius: 19px; box-shadow: 0 10px 26px rgba(103,57,88,.18); }
.app[data-theme="pet"] .tutorial-callout > span { border-radius: 50%; }
.app[data-theme="pet"] .modal-scrim { background: rgba(67,42,66,.63); backdrop-filter: blur(12px) saturate(90%); }
.app[data-theme="pet"] .upgrade-panel h2,
.app[data-theme="pet"] .pause-card h2,
.app[data-theme="pet"] .result-paper h2 { font-family: "PingFang SC", "Microsoft YaHei", sans-serif; font-weight: 780; }
.app[data-theme="pet"] .upgrade-card {
  color: var(--theme-text);
  border: 1px solid rgba(94,61,91,.11);
  border-radius: 22px;
  background: #fff8eb;
  box-shadow: 0 10px 23px rgba(92,53,82,.15), inset 0 1px #fff;
}
.app[data-theme="pet"] .upgrade-card:nth-child(2) { background: #effbf3; }
.app[data-theme="pet"] .upgrade-card:nth-child(3) { background: #fff0f4; }
.app[data-theme="pet"] .upgrade-card > i:first-child { border-radius: 50%; background: #ff79a8; }
.app[data-theme="pet"] .pause-card,
.app[data-theme="pet"] .result-paper {
  color: var(--theme-text);
  border: 1px solid rgba(95,62,93,.12);
  border-radius: 28px;
  background:
    radial-gradient(circle at 91% 12%, rgba(255,121,168,.12), transparent 20%),
    radial-gradient(circle at 8% 90%, rgba(111,217,178,.14), transparent 23%),
    #fff9ed;
  box-shadow: 0 22px 52px rgba(87,48,78,.27), inset 0 1px #fff;
}
.app[data-theme="pet"] .result-paper::before { width: 9px; background: linear-gradient(#ff79a8, #6fd9b2); }
.app[data-theme="pet"] .result-paper h2 em { color: #e86695; }
.app[data-theme="pet"] .primary-button { border-radius: 999px; background: linear-gradient(135deg, #ff8eb5, #ef6f9e); box-shadow: 0 10px 24px rgba(219,89,140,.25), inset 0 1px rgba(255,255,255,.5); }
.app[data-theme="pet"] .primary-button.dark { color: #fff; background: linear-gradient(135deg, #6fd9b2, #4db896); }
.app[data-theme="pet"] .result-secondary { border-radius: 14px; overflow: hidden; }
.app[data-theme="pet"] .result-secondary button { color: var(--theme-text); }

/* Viewport, safe-area and accessibility ---------------------------------- */

@supports not ((backdrop-filter: blur(2px)) or (-webkit-backdrop-filter: blur(2px))) {
  .liquid-start { background: rgba(100, 70, 147, .9); }
  .back-button,
  .style-footer .daily-button { background: rgba(27, 22, 52, .96); }
  .icon-button,
  .target-label,
  .load-panel { background: var(--theme-panel-solid); }
}

@media (min-width: 900px) {
  body {
    grid-template-columns: minmax(250px, 1fr) auto minmax(250px, 1fr);
    gap: clamp(46px, 6vw, 92px);
    padding: 24px;
  }

  .app {
    width: min(430px, calc(56.25dvh - 27px));
    height: min(calc(100dvh - 48px), 764px);
    border: 1px solid rgba(255,255,255,.11);
    border-radius: 27px;
    box-shadow: 0 34px 100px rgba(0,0,0,.66), 0 0 0 7px rgba(255,255,255,.018);
  }

  .app::before { border-radius: inherit; }
  .desktop-copy { width: 310px; }
  .desktop-copy p { color: #77758a; }
  .desktop-copy p i { background: #785fff; }
  .desktop-copy h2 { color: #eceaf7; font-family: "PingFang SC", "Microsoft YaHei", sans-serif; font-weight: 720; }
  .desktop-copy small { color: #716f80; }
}

@media (max-width: 360px) {
  :root {
    --safe-left: max(13px, env(safe-area-inset-left));
    --safe-right: max(13px, env(safe-area-inset-right));
  }

  .launch-logo h1 { font-size: 43px; }
  .launch-action { width: 82%; }
  .liquid-start { min-height: 66px; }
  .style-card { border-radius: 18px; }
  .card-copy strong { font-size: 16px; }
  .card-copy em { font-size: 7.5px; }
  .style-footer .best-strip span { flex-direction: column; gap: 2px; }
  .style-footer .best-strip small { font-size: 5px; }
}

@media (max-height: 740px) {
  .launch-logo { top: calc(var(--safe-top) + 5px); }
  .launch-logo h1 { font-size: clamp(40px, 12.8vw, 52px); }
  .launch-logo > b { margin-top: 7px; }
  .launch-action { top: 61%; }
  .liquid-start { min-height: 64px; }
  .pet-face { transform: scale(.86); transform-origin: center bottom; }
  .pet-cat { transform: rotate(-5deg) scale(.86); }
  .pet-dog { transform: rotate(5deg) scale(.86); }
  .pet-bunny { transform: scale(.7); }

  .style-heading { min-height: 59px; }
  .back-button { width: 40px; height: 40px; border-radius: 13px; }
  .style-heading h2 { font-size: 17px; }
  .style-cards {
    top: calc(var(--safe-top) + 67px);
    bottom: calc(var(--safe-bottom) + 84px);
    gap: 8px;
  }
  .style-card { border-radius: 18px; }
  .card-glass-panel { width: 56%; padding: 8px 12px 8px 14px; }
  .card-copy { gap: 3px; }
  .card-copy strong { font-size: 16px; }
  .style-footer .best-strip { height: 26px; }
  .style-footer .daily-button { height: 36px; border-radius: 12px; }

  .result-paper { top: 45px; padding-block: 14px; }
  .upgrade-panel { top: 64px; }
  .upgrade-card { min-height: 76px; }
}

@media (max-height: 620px) {
  .launch-logo { top: calc(max(8px, env(safe-area-inset-top)) + 1px); }
  .launch-logo p { margin-bottom: 4px; }
  .launch-logo h1 { font-size: clamp(37px, 11.8vw, 46px); }
  .launch-logo > b { display: none; }
  .launch-action { top: 60.5%; width: 73%; }
  .liquid-start { min-height: 55px; padding-left: 20px; grid-template-columns: 1fr 36px; }
  .liquid-start b { font-size: 14px; }
  .liquid-start > i { width: 36px; height: 36px; font-size: 24px; }
  .launch-action > p { margin-top: 8px; }
  .launch-footnote { bottom: max(5px, env(safe-area-inset-bottom)); }
  .space-ship { transform: rotate(-8deg) scale(.78); transform-origin: left bottom; }
  .pixel-avatar { transform-origin: center; scale: .82; }

  .style-heading { top: max(8px, env(safe-area-inset-top)); min-height: 48px; }
  .style-heading p { display: none; }
  .style-heading h2 { font-size: 15px; }
  .back-button { width: 36px; height: 36px; }
  .style-cards {
    top: calc(max(8px, env(safe-area-inset-top)) + 55px);
    bottom: calc(max(8px, env(safe-area-inset-bottom)) + 68px);
    gap: 6px;
  }
  .style-card { border-radius: 15px; }
  .card-glass-panel { width: 58%; padding: 6px 10px 6px 12px; }
  .card-copy small { font-size: 7.5px; }
  .card-copy strong { font-size: 14px; }
  .card-copy em { display: none; }
  .card-enter { width: 22px; height: 22px; font-size: 10px; }
  .style-footer .best-strip { display: none; }
  .style-footer .daily-button { height: 38px; }
  .preview-pixel-face { scale: .76; transform-origin: left top; }
  .preview-pet { scale: .78; transform-origin: center bottom; }
  .style-footer .best-strip { display: none; }
  .style-footer .daily-button { height: 38px; }

  .score-block { top: 66px; }
  .timer-block { top: 61px; transform: translateX(-50%) scale(.88); }
  .combo-block { top: 68px; }
  .target-label { top: 121px; }
  .load-panel { padding-block: 8px; }
  .tutorial-callout { bottom: calc(var(--safe-bottom) + 83px); }
  .upgrade-panel { top: 52px; }
  .upgrade-panel h2 { font-size: 27px; }
  .upgrade-panel > p:last-of-type { margin-block: 8px 12px; }
  .upgrade-card { min-height: 64px; }
  .result-paper { top: 28px; left: 18px; right: 18px; transform: scale(.86); transform-origin: center top; }
}

@media (hover: hover) and (pointer: fine) {
  .icon-button:hover { border-color: var(--theme-focus); filter: brightness(1.1); }
  .primary-button:hover { transform: translateY(-1px); }
}

@media (prefers-contrast: more) {
  .style-card,
  .back-button,
  .style-footer .daily-button,
  .icon-button,
  .target-label,
  .load-panel { border-width: 2px; }
  .card-copy em,
  .style-footer .best-strip small,
  .style-footer .daily-button small { opacity: 1; color: currentColor; }
}

@media (prefers-reduced-motion: reduce) {
  .liquid-start,
  .liquid-start::after,
  .preview-heart,
  .grain,
  .sound-button i,
  .load-panel.danger { animation: none !important; }

  .style-card,
  .back-button,
  .primary-button,
  .card-enter { transition-duration: .01ms !important; }
}

/* 玩法图例指南入口按钮 */
.launch-sub-action {
  display: flex;
  justify-content: center;
  margin-top: 10px;
}

.guide-trigger-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  color: #ffb81c;
  font-size: 12px;
  font-weight: 800;
  background: rgba(36, 20, 66, 0.75);
  border: 1.5px solid #ffb81c;
  border-radius: 999px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  transition: all 0.25s ease;
}

.guide-trigger-btn:hover {
  background: #ffb81c;
  color: #241442;
  transform: translateY(-2px);
}

/* 新手引导与图例 Modal 样式 */
.tut-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.tut-modal.show {
  opacity: 1;
  pointer-events: auto;
}

.tut-three-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

.tut-modal-backdrop {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: radial-gradient(circle at center, rgba(16, 13, 34, 0.78) 0%, rgba(8, 6, 18, 0.95) 100%);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.tut-modal-card {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  width: min(94%, 440px);
  max-height: calc(100vh - 40px);
  overflow: hidden;
  color: #ffffff;
  background: rgba(22, 18, 48, 0.92);
  border: 2px solid rgba(255, 184, 28, 0.6);
  border-radius: 24px;
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.7),
    0 0 35px rgba(255, 184, 28, 0.25);
  transform: scale(0.92);
  transition: transform 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.tut-modal.show .tut-modal-card {
  transform: scale(1);
}

.tut-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(12, 9, 28, 0.4);
}

.tut-title-group h2 {
  margin: 0;
  color: #ffc736;
  font-family: 'ZCOOL KuaiLe', 'Fredoka', sans-serif;
  font-size: 20px;
  letter-spacing: 0.05em;
}

.tut-title-group p {
  margin: 2px 0 0;
  color: rgba(255, 255, 255, 0.65);
  font-size: 11px;
}

.tut-close-x {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 22px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tut-close-x:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.25);
}

.tut-scroll-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.tut-section .sec-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.tut-section .sec-label span {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  color: #241442;
  background: #ffb81c;
  font-size: 10px;
  font-weight: 900;
}

.tut-section .sec-label b {
  font-size: 13px;
  color: #fff;
  letter-spacing: 0.04em;
}

/* 愤怒的小鸟弹射演示区 */
.angry-demo-wrapper {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px;
  background: rgba(12, 9, 28, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 16px;
}

#angryBirdsDemoCanvas {
  width: 100%;
  max-width: 340px;
  height: 160px;
  border-radius: 12px;
  background: #0d0a21;
}

.demo-tip-pill {
  margin-top: 6px;
  padding: 4px 12px;
  color: #ffd875;
  font-size: 10px;
  font-weight: 700;
  background: rgba(255, 184, 28, 0.15);
  border-radius: 999px;
}

/* 口诀 Banner */
.formula-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: linear-gradient(135deg, rgba(255, 184, 28, 0.22) 0%, rgba(255, 63, 180, 0.18) 100%);
  border: 1.5px dashed #ffb81c;
  border-radius: 14px;
}

.formula-icon {
  font-size: 22px;
}

.formula-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.formula-text b {
  color: #ffea78;
  font-size: 13px;
  letter-spacing: 0.05em;
}

.formula-text small {
  color: rgba(255, 255, 255, 0.75);
  font-size: 9.5px;
}

/* 图例库 (全官方 .webp 高清图片) */
.legend-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.legend-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  background: rgba(30, 24, 62, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.legend-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 184, 28, 0.6);
  background: rgba(42, 34, 85, 0.85);
}

.legend-icon-box {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  padding: 4px;
  background: rgba(12, 9, 28, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  overflow: hidden;
}

.legend-icon-box img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

.legend-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
}

.legend-info b {
  color: #ffffff;
  font-size: 11.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.legend-tag {
  display: inline-block;
  padding: 1px 6px;
  color: #ffc736;
  font-size: 8.5px;
  font-weight: 700;
  background: rgba(255, 199, 54, 0.18);
  border-radius: 4px;
  width: max-content;
}

.legend-tag.hazard {
  color: #ff5252;
  background: rgba(255, 82, 82, 0.18);
}

.legend-info small {
  color: rgba(255, 255, 255, 0.72);
  font-size: 9px;
  line-height: 1.25;
}

.tut-footer {
  padding: 12px 20px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(12, 9, 28, 0.6);
}

.tut-action-btn {
  width: 100%;
  padding: 12px;
  color: #241442;
  font-family: 'ZCOOL KuaiLe', 'Fredoka', sans-serif;
  font-size: 16px;
  font-weight: 900;
  background: linear-gradient(135deg, #ffc736 0%, #ff9d1c 100%);
  border: 2px solid #241442;
  border-radius: 999px;
  box-shadow: 0 4px 0 #241442, 0 8px 20px rgba(0, 0, 0, 0.4);
  cursor: pointer;
  transition: all 0.2s ease;
}

.tut-action-btn:hover {
  background: linear-gradient(135deg, #ffd756 0%, #ffad2c 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 0 #241442, 0 10px 24px rgba(0, 0, 0, 0.5);
}

.tut-action-btn:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #241442;
}
