:root {
  font-family: system-ui, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  color: #252035;
  background: #f8f6ff;
  --muted: #605770;
  --line: #e9e1f1;
  --paper: #fffefd;
  --from: #f1e1ff;
  --to: #ffdcd0;
  --accent: #6936ab;
  --ink: #2b1e43;
  --shadow: 0 18px 48px #33215212;
  --emoji: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100svh; display: flex; flex-direction: column; }
body.landing { background: radial-gradient(ellipse at 90% 5%, #efe2ff, transparent 43%), #f8f6ff; }
body.player {
  color: var(--ink);
  background: radial-gradient(ellipse at 10% 0, color-mix(in srgb, var(--from) 85%, white), transparent 55%),
    radial-gradient(ellipse at 90% 50%, color-mix(in srgb, var(--to) 55%, white), transparent 60%), #faf7ff;
}
h1, h2, h3, p { margin: 0; }
h1, h2, h3, p, a, button { overflow-wrap: anywhere; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .55; }
:focus-visible { outline: 3px solid #7040bd; outline-offset: 4px; }
.site-header { width: min(100% - 36px, 1100px); margin: 0 auto; min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 860; letter-spacing: -.035em; font-size: 1.12rem; }
.brand-icon { display: grid; place-items: center; background: #2c2140; color: #f7dcff; border-radius: 12px; width: 38px; height: 38px; font-size: 23px; }
.lang { display: flex; gap: 2px; padding: 3px; background: #fffdfd; border: 1px solid #e9e1f1; border-radius: 99px; }
.lang button { border: 0; background: transparent; border-radius: 99px; min-height: 44px; min-width: 52px; font-size: .79rem; font-weight: 790; }
.lang button[aria-pressed="true"] { color: white; background: #35264d; }
.site-footer { width: min(100% - 36px, 1100px); margin: auto auto 0; text-align: center; color: var(--muted); border-top: 1px solid #80638e24; padding: 21px 0 24px; font-size: .78rem; }
.landing-main { width: min(100% - 36px, 1100px); margin: 6px auto 35px; }
.hero { isolation: isolate; position: relative; overflow: hidden; border-radius: 30px; padding: 26px 22px 12px; background: radial-gradient(ellipse at 100% 90%, #ffd5c3 1%, transparent 58%), linear-gradient(132deg,#ffeff5,#e8dbff 72%); box-shadow: var(--shadow); border: 1px solid #fff; }
.hero-copy { position: relative; z-index: 1; }
.eyebrow { color: #653996; font-size: .75rem; font-weight: 850; letter-spacing: .1em; text-transform: uppercase; }
.hero h1 { font-size: clamp(2.25rem, 6.7vw, 5.1rem); line-height: 1.04; letter-spacing: -.067em; margin: 12px 0; max-width: 760px; }
.hero h1 strong { display: block; color: #792fa4; background: linear-gradient(100deg,#6d35b3,#a63572); background-clip: text; -webkit-text-fill-color: transparent; }
#hero-desc { color: #514363; line-height: 1.53; max-width: 430px; font-size: .96rem; }
.primary, .secondary { display: inline-grid; place-items: center; min-height: 48px; padding: 10px 17px; border-radius: 14px; font-weight: 790; text-align: center; transition: transform .16s, box-shadow .16s, background .16s; }
.primary { color: white; border: 1px solid transparent; background: color-mix(in srgb, var(--accent) 55%, var(--ink)); box-shadow: 0 6px 14px #37225428; }
.secondary { background: #fff; border: 1px solid var(--line); }
.primary:hover, .secondary:hover { transform: translateY(-2px); box-shadow: 0 8px 18px #37225424; }
.primary:active, .secondary:active { transform: scale(.97); }
#random { margin-top: 16px; }
.hero-art { height: 118px; position: relative; display: grid; place-items: center; font-family: var(--emoji); }
.hero-art span { position: absolute; }
.art-center { font-size: 87px; filter: drop-shadow(0 14px 15px #6d397f29); animation: float 5s ease-in-out infinite; }
.art-star { left: 15%; top: 13%; font-size: 24px; animation: float 5s ease-in-out -1s infinite; }
.art-moon { right: 12%; top: 1%; font-size: 25px; animation: float 5s ease-in-out -2s infinite; }
.art-shell { right: 18%; bottom: 5%; font-size: 24px; animation: float 5s ease-in-out -3s infinite; }
.orbit { width: 74%; height: 68%; border: 1px solid #fff9; border-radius: 50%; transform: rotate(-15deg); }
.orbit-two { transform: rotate(17deg); }
.discovery { margin-top: 24px; }
.search { display: flex; align-items: center; gap: 10px; padding: 0 12px; background: var(--paper); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 8px 24px #34254f09; max-width: 670px; }
.search > span { font-size: 1.7rem; line-height: 1; }
.search:focus-within { outline: 2px solid #8658c8; }
.search input { border: 0; background: transparent; flex: 1; min-width: 0; min-height: 51px; outline: 0; }
.search input::-webkit-search-cancel-button { display: none; }
.search button { border: 0; background: transparent; font-size: 1.5rem; min-width: 44px; min-height: 44px; }
.chips { display: flex; flex-wrap: wrap; gap: 7px; margin: 13px 0 23px; }
.chip { background: #fff; border: 1px solid var(--line); border-radius: 99px; padding: 7px 10px; min-height: 44px; font-size: .81rem; font-weight: 730; }
.chip[aria-pressed="true"] { color: white; background: #392a53; border-color: #392a53; }
.chip-count { margin-left: 6px; opacity: .75; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.discovery h2 { font-size: 1.42rem; letter-spacing: -.035em; margin: 0 0 12px; }
#count, #empty { color: var(--muted); font-size: .86rem; }
#featured { margin-bottom: 24px; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 265px), 1fr)); gap: 13px; }
.quiz-card { min-width: 0; content-visibility: auto; contain-intrinsic-size: auto 248px; overflow: hidden; border: 1px solid var(--line); border-radius: 21px; background: var(--paper); box-shadow: 0 8px 24px #34254f0b; transition: transform .18s, box-shadow .18s; }
.quiz-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.card-art { position: relative; isolation: isolate; display: grid; place-items: center; min-height: 105px; overflow: hidden; color: var(--ink); background: linear-gradient(130deg,var(--from),var(--to)); }
.card-art::before, .player-art::before { content: ""; position: absolute; z-index: -1; width: 175px; aspect-ratio: 1; border: 1px solid #fff8; box-shadow: 0 0 0 20px #fff3, 0 0 0 40px #fff2; border-radius: 50%; }
.card-emoji { font: 53px var(--emoji); filter: drop-shadow(0 4px 9px #321b4133); }
.badge, .card-arrow { background: #fffdf6dd; position: absolute; top: 10px; border-radius: 99px; }
.badge { left: 10px; padding: 5px 9px; font-size: .69rem; font-weight: 820; }
.card-arrow { right: 10px; padding: 2px 7px; }
.card-body { padding: 13px 15px 15px; }
.card-body h3 { font-size: 1.14rem; line-height: 1.2; letter-spacing: -.025em; }
.subtitle { margin: 5px 0 10px; font-size: .84rem; line-height: 1.45; color: var(--muted); }
.facts, .tags { display: flex; flex-wrap: wrap; gap: 6px 11px; font-size: .75rem; }
.facts { color: var(--muted); font-weight: 680; }
.played { color: #31684f; }
.tags { gap: 5px; margin-top: 9px; }
.tags span { background: #f4effa; color: #544264; border-radius: 99px; padding: 4px 8px; }
.player-main { width: min(100% - 32px, 560px); margin: 8px auto 36px; }
.panel { background: var(--paper); border: 1px solid #fff; box-shadow: var(--shadow); border-radius: 28px; padding: 21px; animation: enter .24s ease both; }
.panel h1 { margin: 12px 0; font-size: clamp(1.6rem, 5vw, 2.4rem); line-height: 1.15; letter-spacing: -.04em; }
.panel h1:focus { outline: none; }
.panel h2 { margin-top: 23px; font-size: 1.1rem; }
.intro, .calculating, .result { text-align: center; }
.player-art { position: relative; isolation: isolate; display: grid; place-items: center; overflow: hidden; min-height: 155px; border-radius: 20px; margin: 0 0 18px; background: linear-gradient(130deg,var(--from),var(--to)); }
.player-art span { font: 82px var(--emoji); filter: drop-shadow(0 6px 12px #321b4133); }
.tagline { line-height: 1.45; font-weight: 680; }
.body-copy { margin: 13px 0; line-height: 1.65; color: var(--muted); }
.player-facts, .rarity { font-size: .83rem; font-weight: 750; color: var(--muted); margin: 14px 0; }
.start { margin-top: 3px; width: 100%; }
.progress-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: -6px 0 8px; }
.text-button { border: 0; padding: 0; min-height: 44px; background: none; font-weight: 735; font-size: .84rem; }
.progress-count { font-size: .82rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.progress { height: 8px; border-radius: 9px; background: #eee8f3; margin: 0 8px 19px 0; }
.progress-fill { height: 100%; background: linear-gradient(90deg,var(--to),var(--accent)); border-radius: inherit; position: relative; transition: width .28s ease; }
.progress-emoji { position: absolute; right: 0; top: 50%; transform: translate(45%,-50%); font: 20px var(--emoji); }
.scene { display: flex; gap: 13px; align-items: center; border-radius: 16px; padding: 12px; line-height: 1.45; background: linear-gradient(130deg, color-mix(in srgb, var(--from) 59%, white), color-mix(in srgb, var(--to) 45%, white)); }
.scene .eyebrow { margin-bottom: 4px; }
.scene-emoji { font: 35px var(--emoji); }
.options { display: grid; gap: 8px; margin-top: 15px; }
.options.emoji, .options.yesno { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.option { display: flex; gap: 10px; align-items: center; min-width: 0; text-align: left; min-height: 54px; padding: 9px 12px; border-radius: 14px; border: 1px solid var(--line); background: #fff; font-weight: 660; line-height: 1.32; transition: transform .12s, background .15s, border-color .15s; }
.option:hover, .option.selected { border-color: var(--accent); background: color-mix(in srgb, var(--from) 55%, white); }
.option:active { transform: scale(.97); }
.option-label { min-width: 0; }
.option-number { flex: 0 0 27px; display: grid; place-items: center; width: 27px; height: 27px; border-radius: 9px; background: #f1eaf8; color: #674b82; font-size: .75rem; font-weight: 850; }
.option-icon { font: 25px var(--emoji); }
.emoji .option, .yesno .option { flex-direction: column; justify-content: center; text-align: center; min-height: 89px; }
.emoji .option-icon { font-size: 39px; }
.yesno .affirmative .option-icon { color: #2c6d56; }
.yesno .negative .option-icon { color: #9d325c; }
.panel.leaving { animation: leave .15s ease both; }
.panel:has(.yesno).leaving { animation: swipe .105s ease both; }
.calculating .player-art span, .waiting-dots { animation: float .75s ease-in-out infinite alternate; }
.waiting-dots { color: var(--accent); letter-spacing: .38em; margin-top: 15px; }
.result-disclaimer { font-size: .77rem; font-weight: 710; color: var(--muted); margin: 11px 0; }
.result-tags { justify-content: center; }
.runner { margin-top: 14px; font-weight: 680; color: var(--muted); }
.stats { display: grid; gap: 13px; padding: 15px; margin-top: 18px; border-radius: 17px; background: #f8f4fa; text-align: left; }
.stat-label, .stat-poles { display: flex; justify-content: space-between; gap: 8px; }
.stat-label { font-size: .88rem; font-weight: 750; }
.stat-value { font-variant-numeric: tabular-nums; }
.stat-track { margin-top: 6px; height: 8px; border-radius: 8px; background: #e9dfef; position: relative; }
.stat-fill { position: absolute; inset: 0 auto 0 0; width: var(--value, 0%); border-radius: inherit; background: var(--accent); transition: width .56s ease, left .56s ease; }
.axis-track { background: linear-gradient(90deg,var(--from),var(--to)); }
.axis-track .stat-fill { left: clamp(0px, calc(var(--value, 50%) - 5px), 100% - 10px); top: -2px; bottom: -2px; width: 10px; }
.stat-poles { color: var(--muted); font-size: .73rem; margin-top: 5px; }
.tips { padding-left: 23px; margin: 8px 0 17px; line-height: 1.5; text-align: left; }
.tips li + li { margin-top: 6px; }
.matches, .actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 9px; }
.matches div { background: #f7f0fb; border-radius: 14px; padding: 10px 6px; }
.matches span { display: block; color: var(--muted); font-size: .72rem; margin-bottom: 4px; }
.share-status:empty { display: none; }
.share-status { margin-top: 8px; font-size: .84rem; }
.share-preview { display: block; width: min(100%, 310px); height: auto; border-radius: 15px; margin: 18px auto 0; box-shadow: var(--shadow); }
.confetti { position: fixed; overflow: hidden; pointer-events: none; inset: 0; z-index: 5; }
.confetti i { position: absolute; left: var(--x); top: -12px; width: 8px; height: 12px; border-radius: 3px; animation: fall 1.2s var(--delay) ease-in both; }
@keyframes float { 50% { transform: translateY(-7px) rotate(-3deg); } }
@keyframes enter { from { opacity: 0; transform: translateY(9px); } to { opacity: 1; transform: translateY(0); } }
@keyframes leave { to { opacity: .35; transform: translateX(-7px); } }
@keyframes swipe { to { opacity: .35; transform: translateX(-15px) rotate(-.6deg); } }
@keyframes fall { to { transform: translate(var(--drift), 85vh) rotate(590deg); opacity: 0; } }
@media (min-width: 680px) {
  .site-header { min-height: 82px; }
  .hero { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); align-items: center; min-height: 340px; padding: 44px; }
  .hero-art { height: 100%; min-height: 220px; }
  .art-center { font-size: clamp(112px, 15vw, 190px); }
  .art-star, .art-moon, .art-shell { font-size: 39px; }
  .art-star { left: 4%; }
  .art-moon { right: 4%; }
  .panel { padding: 27px; }
  .player-main { margin-top: 15px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
