:root {
  --bg: #170d33;
  --ink: #fff;
  --muted: rgba(255, 255, 255, 0.72);
  --glass: rgba(28, 16, 60, 0.55);
  --glass-line: rgba(255, 255, 255, 0.16);
  --pink: #ff6fb5;
  --violet: #8b6bff;
  --gold: #ffd166;
  --radius: 22px;
  --font: "PingFang SC", "HarmonyOS Sans SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--ink); font-family: var(--font); -webkit-font-smoothing: antialiased; user-select: none; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
.hidden { display: none !important; }

#video { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

#stage { position: fixed; inset: 0; background: radial-gradient(120% 90% at 50% 40%, #2a1a5c, #0f0824); }
#stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* ---------- guide ---------- */
#guide { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.guide-oval { width: min(34vh, 40vw); aspect-ratio: 3 / 4; border-radius: 50%; border: 4px dashed rgba(255, 255, 255, 0.7); box-shadow: 0 0 0 9999px rgba(10, 4, 30, 0.35); animation: breathe 2.2s ease-in-out infinite; }
#guide p { position: absolute; top: calc(50% + min(24vh, 28vw)); margin: 0; font-size: 26px; font-weight: 800; text-shadow: 0 2px 12px rgba(0, 0, 0, 0.5); }
@keyframes breathe { 50% { transform: scale(1.04); border-color: rgba(255, 210, 120, 0.9); } }

/* ---------- top bar ---------- */
.topbar { position: fixed; top: 18px; left: 18px; right: 18px; display: flex; justify-content: space-between; align-items: center; pointer-events: none; z-index: 5; }
.topbar > * { pointer-events: auto; }
.brand { display: flex; align-items: center; gap: 12px; padding: 8px 18px 8px 8px; border-radius: 999px; background: var(--glass); border: 1px solid var(--glass-line); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
.brand-logo { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; font-size: 24px; background: conic-gradient(from 200deg, var(--pink), var(--violet), var(--gold), var(--pink)); box-shadow: 0 0 22px rgba(255, 111, 181, 0.55); }
.brand-name { font-weight: 900; font-size: 20px; letter-spacing: 1px; }
.brand-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.actions { display: flex; gap: 10px; }
.pill, .round { display: inline-flex; align-items: center; gap: 8px; height: 56px; padding: 0 22px; border-radius: 999px; background: var(--glass); border: 1px solid var(--glass-line); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); font-weight: 800; font-size: 18px; transition: transform 0.15s, background 0.2s, box-shadow 0.2s; text-decoration: none; }
.round { width: 56px; padding: 0; justify-content: center; }
.pill:hover, .round:hover { transform: translateY(-2px); background: rgba(60, 36, 120, 0.7); }
.pill:active, .round:active { transform: scale(0.96); }
.pill svg, .round svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pill.primary { background: linear-gradient(135deg, #ff8ac2, #ff5f9e 45%, #a46bff); border-color: transparent; box-shadow: 0 8px 26px rgba(255, 95, 158, 0.45); color: #fff; }
.pill.on { background: linear-gradient(135deg, #3ee7ff, #4f7bff); box-shadow: 0 0 26px rgba(62, 231, 255, 0.55); border-color: transparent; }
.round .off { display: none; }
.round.attn { animation: attn 1s ease-in-out infinite; background: linear-gradient(135deg, #ffd166, #ff7a59); }
@keyframes attn { 50% { transform: scale(1.12); box-shadow: 0 0 0 8px rgba(255, 209, 102, 0.3); } }
.round.muted .on { display: none; }
.round.muted .off { display: block; }

/* ---------- panels ---------- */
.panel { position: fixed; z-index: 4; padding: 16px; border-radius: var(--radius); background: var(--glass); border: 1px solid var(--glass-line); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }
.panel-title { font-weight: 900; font-size: 15px; letter-spacing: 2px; color: var(--gold); margin-bottom: 10px; }
#hints { left: 18px; top: 50%; transform: translateY(-50%); width: 236px; }
#hintList { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
#hintList li { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 16px; background: rgba(255, 255, 255, 0.06); font-weight: 700; font-size: 16px; transition: transform 0.18s cubic-bezier(.3, 1.6, .5, 1), background 0.18s, box-shadow 0.18s; }
#hintList li .ico { font-size: 26px; line-height: 1; }
#hintList li.active { transform: scale(1.07) translateX(6px); background: linear-gradient(135deg, rgba(255, 138, 194, 0.9), rgba(164, 107, 255, 0.9)); box-shadow: 0 6px 22px rgba(255, 95, 158, 0.5); }

#aiPanel { right: 18px; top: 50%; transform: translateY(-50%); width: 270px; border-color: rgba(62, 231, 255, 0.45); box-shadow: 0 0 40px rgba(62, 231, 255, 0.18) inset; }
#aiPanel .panel-title { color: #7ff0ff; }
.ai-lead { margin: 0 0 12px; font-size: 14px; line-height: 1.6; color: var(--muted); }
.ai-lead b { color: #7ff0ff; }
.bar { display: grid; grid-template-columns: 56px 1fr 38px; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; margin: 7px 0; }
.bar-track { height: 12px; border-radius: 6px; background: rgba(255, 255, 255, 0.1); overflow: hidden; }
.bar-fill { height: 100%; width: 100%; transform-origin: left; transform: scaleX(0); background: linear-gradient(90deg, #3ee7ff, #b98bff); border-radius: 6px; }
.bar-val { text-align: right; font-variant-numeric: tabular-nums; color: #7ff0ff; font-size: 13px; }
.ai-foot { margin-top: 12px; font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- dock ---------- */
#dock { position: fixed; z-index: 5; left: 50%; bottom: 18px; transform: translateX(-50%); display: flex; gap: 10px; padding: 10px; border-radius: 30px; background: var(--glass); border: 1px solid var(--glass-line); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); max-width: calc(100vw - 24px); overflow-x: auto; scrollbar-width: none; }
.card { flex: none; width: 104px; padding: 10px 6px 10px; border-radius: 22px; display: flex; flex-direction: column; align-items: center; gap: 6px; transition: transform 0.2s cubic-bezier(.3, 1.6, .5, 1), background 0.2s; }
.card:hover { transform: translateY(-4px); background: rgba(255, 255, 255, 0.06); }
.card .icon { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; font-size: 36px; background: linear-gradient(135deg, var(--c1), var(--c2)); box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25), inset 0 -4px 8px rgba(0, 0, 0, 0.15), inset 0 4px 8px rgba(255, 255, 255, 0.35); transition: box-shadow 0.2s; }
.card .label { font-size: 15px; font-weight: 800; white-space: nowrap; }
.card .key { font-size: 11px; color: var(--muted); }
.card.active { background: rgba(255, 255, 255, 0.12); transform: translateY(-8px); }
.card { position: relative; }
.card.active::after { content: ''; position: absolute; left: 16px; right: 16px; bottom: 3px; height: 4px; border-radius: 2px; background: linear-gradient(90deg, #fff calc(var(--p, 0) * 100%), rgba(255, 255, 255, 0.18) 0); }
.card.active .icon { box-shadow: 0 0 0 4px #fff, 0 0 28px var(--c2); }

/* ---------- toast ---------- */
#toast { position: fixed; z-index: 6; bottom: 168px; left: 50%; transform: translate(-50%, -20px) scale(0.9); padding: 12px 26px; border-radius: 999px; background: rgba(255, 255, 255, 0.95); color: #3a1d6e; font-weight: 900; font-size: 24px; opacity: 0; pointer-events: none; transition: opacity 0.25s, transform 0.35s cubic-bezier(.3, 1.6, .5, 1); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3); white-space: nowrap; }
#toast small { font-size: 15px; font-weight: 700; color: #7a5aa8; margin-left: 10px; }
#toast.show { opacity: 1; transform: translate(-50%, 0) scale(1); }

/* ---------- photo ---------- */
#countdown { position: fixed; z-index: 8; inset: 0; display: grid; place-items: center; pointer-events: none; font-size: 30vh; font-weight: 900; color: #fff; text-shadow: 0 8px 40px rgba(255, 95, 158, 0.8); }
#countdown.tick { animation: tick 0.9s ease-out; }
@keyframes tick { from { transform: scale(1.6); opacity: 0; } 20% { transform: scale(1); opacity: 1; } to { transform: scale(0.8); opacity: 0; } }
#flash { position: fixed; z-index: 9; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
#flash.go { animation: flash 0.6s ease-out; }
#flash.soft { animation: flashSoft 0.5s ease-out; }
@keyframes flashSoft { from { opacity: 0.45; } to { opacity: 0; } }
@keyframes flash { from { opacity: 0.95; } to { opacity: 0; } }
#photoModal { position: fixed; z-index: 10; inset: 0; display: grid; place-items: center; background: rgba(12, 6, 30, 0.72); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.photo-card { display: flex; flex-direction: column; align-items: center; gap: 22px; animation: drop 0.6s cubic-bezier(.3, 1.4, .5, 1); }
.photo-card img { max-width: min(78vw, 1000px); max-height: 72vh; border-radius: 10px; transform: rotate(-2deg); box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55); }
.photo-actions { display: flex; gap: 14px; }
.pill.ghost { background: rgba(255, 255, 255, 0.12); }
@keyframes drop { from { transform: translateY(-40px) rotate(4deg); opacity: 0; } }

/* ---------- intro ---------- */
#intro { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; overflow: hidden; background: radial-gradient(120% 120% at 20% 10%, #3b1f7a 0%, #1b0e3d 55%, #120828 100%); transition: opacity 0.6s, transform 0.6s; }
#intro.leaving { opacity: 0; transform: scale(1.04); pointer-events: none; }
.blob { position: absolute; border-radius: 50%; filter: blur(70px); opacity: 0.6; animation: float 14s ease-in-out infinite; }
.b1 { width: 46vw; height: 46vw; background: #ff5fa8; left: -12vw; top: -14vw; }
.b2 { width: 40vw; height: 40vw; background: #6b5bff; right: -10vw; bottom: -16vw; animation-delay: -5s; }
.b3 { width: 26vw; height: 26vw; background: #ffc35a; right: 22vw; top: -8vw; opacity: 0.35; animation-delay: -9s; }
@keyframes float { 50% { transform: translate(4vw, 3vw) scale(1.08); } }
.intro-inner { position: relative; display: flex; align-items: center; gap: 6vw; padding: 40px; max-width: 1200px; }
.intro-text { max-width: 560px; }
.eyebrow { display: inline-block; padding: 6px 14px; border-radius: 999px; background: rgba(255, 255, 255, 0.12); font-weight: 800; letter-spacing: 3px; font-size: 13px; text-transform: uppercase; color: var(--gold); }
h1 { margin: 16px 0 12px; font-size: clamp(48px, 7vw, 92px); line-height: 1.02; font-weight: 900; letter-spacing: 2px; }
h1 span { background: linear-gradient(90deg, #ffd166, #ff6fb5 45%, #a98bff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { font-size: 22px; line-height: 1.6; color: var(--muted); margin: 0 0 20px; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 30px; }
.chips span { padding: 8px 14px; border-radius: 999px; background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.14); font-size: 15px; font-weight: 700; }
.start { position: relative; padding: 22px 54px; border-radius: 999px; font-size: 26px; font-weight: 900; letter-spacing: 2px; color: #fff; background: linear-gradient(135deg, #ff8ac2, #ff5f9e 45%, #a46bff); box-shadow: 0 14px 40px rgba(255, 95, 158, 0.5); transition: transform 0.2s cubic-bezier(.3, 1.6, .5, 1), filter 0.2s; }
.start:not(:disabled) { animation: pulse 2s ease-in-out infinite; }
.start:not(:disabled):hover { transform: scale(1.05); }
.start:disabled { filter: grayscale(0.6) brightness(0.8); cursor: progress; }
@keyframes pulse { 50% { box-shadow: 0 14px 60px rgba(255, 95, 158, 0.85), 0 0 0 10px rgba(255, 138, 194, 0.15); } }
.status { min-height: 22px; margin: 16px 0 0; font-size: 15px; color: var(--muted); }
.status.error { color: #ffb3b3; font-weight: 700; }
.grown-ups { margin-top: 26px; font-size: 14px; color: var(--muted); max-width: 520px; }
.grown-ups summary { cursor: pointer; font-weight: 700; }
.grown-ups p { line-height: 1.7; }
.intro-mirror { --r: calc(min(36vw, 420px) / 2); position: relative; width: min(36vw, 420px); aspect-ratio: 1; flex: none; }
.mirror-ring { position: absolute; inset: 12%; border-radius: 50%; padding: 12px; background: conic-gradient(from 0deg, #ffd166, #ff6fb5, #a98bff, #6fd6ff, #ffd166); animation: spin 12s linear infinite; box-shadow: 0 0 80px rgba(255, 111, 181, 0.45); }
.mirror-face { width: 100%; height: 100%; border-radius: 50%; display: grid; place-items: center; font-size: min(14vw, 160px); background: radial-gradient(circle at 35% 30%, #4c3592, #1b0f3f); animation: spin 12s linear infinite reverse; }
.orbit { position: absolute; inset: 0; animation: spin 20s linear infinite; }
.orbit span { position: absolute; left: 50%; top: 50%; font-size: min(5vw, 54px); margin: -0.6em 0 0 -0.6em; width: 1.2em; height: 1.2em; display: grid; place-items: center; border-radius: 50%; background: rgba(255, 255, 255, 0.14); backdrop-filter: blur(6px); }
.orbit span:nth-child(1) { transform: rotate(0deg) translateY(calc(var(--r) * -0.92)) rotate(0deg); }
.orbit span:nth-child(2) { transform: rotate(60deg) translateY(calc(var(--r) * -0.92)) rotate(-60deg); }
.orbit span:nth-child(3) { transform: rotate(120deg) translateY(calc(var(--r) * -0.92)) rotate(-120deg); }
.orbit span:nth-child(4) { transform: rotate(180deg) translateY(calc(var(--r) * -0.92)) rotate(-180deg); }
.orbit span:nth-child(5) { transform: rotate(240deg) translateY(calc(var(--r) * -0.92)) rotate(-240deg); }
.orbit span:nth-child(6) { transform: rotate(300deg) translateY(calc(var(--r) * -0.92)) rotate(-300deg); }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 900px) {
  .intro-mirror { display: none; }
  #hints { top: auto; bottom: 150px; transform: none; width: auto; left: 12px; right: 12px; }
  #hintList { flex-direction: row; flex-wrap: wrap; }
  #hintList li { font-size: 14px; }
  #aiPanel { top: 90px; transform: none; }
  .brand-sub { display: none; }
  .pill span { display: none; }
  .pill { padding: 0 16px; }
}
