/* ===========================================================================
   ZELDA OCARINA OF TIME 3D · 海拉鲁时之神殿婚礼视觉系统
   科奇里深森绿 / 海拉鲁皇家蓝 / 三角神力金 / 王室羊皮卷 / 精灵石三色光韵
   中文大字遵循三层 text-shadow 硬边阴影规范（禁用描边属性）
   =========================================================================== */

:root {
  --forest-d:  #07110d;       /* 科奇里极夜森林底 */
  --forest:    #0b1a14;
  --navy-d:    #0a1524;       /* 时之神殿深海蓝 */
  --navy:      #10243d;
  --royal:     #1f4f99;       /* 皇家蓝 */
  --ocarina:   #2d74da;       /* 时之笛湛蓝（A键） */
  --ocarina-d: #143f82;
  --gold:      #f2c94c;       /* 三角神力金 */
  --gold-b:    #ffe68a;
  --gold-d:    #8c6010;
  --gold-dd:   #3b2504;
  --c-yellow:  #ffd426;       /* C键亮金黄 */
  --c-yellow-d:#9a6b00;
  --parchment: #f6ead0;       /* 王室羊皮卷 */
  --parch-2:   #ebd9b0;
  --ink:       #26180a;
  --cream:     #fbf4e4;
  --muted:     #8fa8a0;
  --emerald:   #2ecc71;       /* 科奇里翡翠 / 魔力槽 */
  --emerald-d: #158042;
  --ruby:      #e84a3c;       /* 鼓隆红宝石 / 生命心 */
  --ruby-d:    #992319;
  --sapphire:  #38b6ff;       /* 卓拉蓝宝石 */
  --navi:      #7ef9ff;       /* 妖精娜薇青 */
  --shadow:    0 0 28px #00000077;
}

/* ===== 全局 ===== */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--forest-d); }
body {
  margin: 0;
  background: linear-gradient(180deg, var(--navy-d) 0%, var(--forest) 35%, var(--navy-d) 72%, var(--forest-d) 100%);
  color: var(--cream);
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  overflow-x: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ===== 手机外壳 ===== */
.phone-shell {
  width: min(100%, 480px);
  margin: auto;
  overflow: hidden;
  background: var(--forest);
  box-shadow: var(--shadow);
  position: relative;
}

/* ===== ① 首页 · 海拉鲁晨曦 ===== */
.hero {
  position: relative;
  min-height: 100svh;
  overflow: hidden;
  background: var(--forest-d);
}
.hero-art {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center 42%;
}
.hero-shade {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 50% 24%, transparent 0%, #07110d55 62%, #040b08dd 100%),
    linear-gradient(180deg, #06100d88 0%, transparent 22%, #07110da8 52%, #06100dee 100%);
}
.fairy-dust {
  position: absolute; inset: 0; pointer-events: none; opacity: .65;
  background-image:
    radial-gradient(circle, #ffe68a 0 1.4px, transparent 2.5px),
    radial-gradient(circle, #7ef9ff 0 1.2px, transparent 2.4px),
    radial-gradient(circle, #2ecc71 0 1px, transparent 2px);
  background-position: 14% 20%, 82% 28%, 48% 12%;
  background-size: 135px 125px, 175px 145px, 210px 190px;
  animation: dustFloat 4.2s ease-in-out infinite;
}
@keyframes dustFloat { 0%,100% { opacity: .45; transform: translateY(0); } 50% { opacity: .9; transform: translateY(-6px); } }

.hero-hud {
  position: absolute; z-index: 3;
  top: max(13px, env(safe-area-inset-top)); left: 14px; right: 14px;
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 11px; gap: 6px;
  border: 1.5px solid #f2c94c88; border-radius: 6px;
  color: var(--gold);
  background: #07110dcc; backdrop-filter: blur(6px);
  font: 800 9px/1 "Courier New", monospace;
  letter-spacing: .12em;
}
.hero-hud b { color: var(--navi); font-size: 10px; }

.hero-brand {
  position: absolute; z-index: 3; top: 8.8%;
  left: 50%; width: min(88%, 410px);
  transform: translateX(-50%);
  pointer-events: none;
  filter: drop-shadow(0 4px 0 #1f1404) drop-shadow(0 12px 22px #000000aa);
}
.hero-brand img { width: 100%; height: auto; }

.hero-copy {
  position: absolute; z-index: 3; top: 43%; left: 18px; right: 18px;
  text-align: center;
}
.mission-code {
  display: inline-block; padding: 6px 14px; margin: 0;
  border: 2px solid var(--gold); border-radius: 4px;
  color: var(--gold-dd); background: linear-gradient(180deg, var(--gold-b), var(--gold));
  box-shadow: 0 4px 0 var(--gold-d), 0 8px 16px #00000066;
  font: 900 clamp(10px, 2.7vw, 12px)/1 "Courier New", monospace;
  letter-spacing: .14em;
}
.hero-kicker {
  margin: 14px 0 4px; color: var(--navi);
  font-size: 11px; font-weight: 800; letter-spacing: .32em;
  text-shadow: 0 2px 6px #000000cc;
}
.hero h1 {
  margin: 6px 0 0;
  color: var(--gold-b);
  font: 900 clamp(34px, 10.5vw, 48px)/1.08
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  letter-spacing: .08em;
  text-shadow:
    0 3px 0 #7a520b,
    0 6px 0 #2d1b02,
    0 12px 20px #000000dd;
  -webkit-font-smoothing: antialiased;
}
.hero-en {
  margin: 10px 0 0; color: var(--cream);
  font: 800 10px/1.2 "Courier New", monospace; letter-spacing: .16em; opacity: .88;
}
.mission-ticket {
  display: grid; grid-template-columns: 48px 1fr; gap: 5px 8px;
  width: min(92%, 350px); margin: 16px auto 0;
  padding: 11px 14px;
  border: 1.5px solid #f2c94caa;
  box-shadow: inset 0 0 0 2px #07110d, 0 8px 20px #00000088;
  background: #091612d9; backdrop-filter: blur(6px);
  color: var(--cream); text-align: left; border-radius: 6px;
}
.mission-ticket span { color: var(--gold); font: 900 9px/1.5 "Courier New", monospace; letter-spacing: .08em; }
.mission-ticket b { font-size: 12px; line-height: 1.35; }
.hero-venue { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.enter-button {
  position: absolute; z-index: 3;
  left: 50%; bottom: calc(58px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: flex; align-items: center; justify-content: center; gap: 10px;
  min-width: min(86%, 376px);
  padding: 15px 24px;
  border: 2.5px solid var(--gold-b);
  border-radius: 999px;
  background: linear-gradient(180deg, var(--ocarina) 0%, var(--royal) 55%, var(--ocarina-d) 100%);
  color: var(--cream); font: 900 14px/1 sans-serif; letter-spacing: .1em;
  box-shadow: 0 5px 0 #0a214a, 0 10px 22px #00000099;
  cursor: pointer; user-select: none; -webkit-user-select: none;
  touch-action: manipulation;
  animation: heroBtnBob 1.9s ease-in-out infinite;
}
.enter-button:active { transform: translateX(-50%) translateY(2px); box-shadow: 0 3px 0 #0a214a; }
.enter-button b { font-size: 15px; color: var(--gold); }
@keyframes heroBtnBob { 0%,100% { transform: translateX(-50%) translateY(0); } 50% { transform: translateX(-50%) translateY(-5px); } }

.start-note {
  position: absolute; z-index: 3; left: 0; right: 0;
  bottom: calc(18px + env(safe-area-inset-bottom));
  margin: 0; text-align: center; color: var(--muted);
  font-size: 10px; letter-spacing: .14em;
}

/* ===== 滚动吸顶 HUD ===== */
.game-hud {
  position: sticky; z-index: 6; top: 0;
  display: flex; justify-content: space-between; align-items: center;
  margin: 0 12px; padding: 9px 12px; gap: 8px;
  background: #08131aee; backdrop-filter: blur(8px);
  border: 1.5px solid var(--gold); border-top: 0; border-radius: 0 0 10px 10px;
  box-shadow: 0 8px 20px #00000066;
  transform: translateY(-110%); transition: transform .35s ease;
}
.game-hud.visible { transform: translateY(0); }
.hud-hearts { display: flex; gap: 3px; align-items: center; }
.hud-hearts .heart {
  font-style: normal; font-size: 14px; line-height: 1;
  color: #41555c; transition: color .25s ease, transform .25s ease;
}
.hud-hearts .heart.full {
  color: var(--ruby);
  text-shadow: 0 0 8px #e84a3c88;
}
.hud-stones { display: flex; align-items: center; gap: 6px; }
.hud-stones small { color: var(--muted); font: 800 8px/1 "Courier New", monospace; letter-spacing: .12em; }
.hud-stones span { display: inline-flex; gap: 4px; align-items: center; }
.hud-stones i {
  display: block; width: 10px; height: 10px; border-radius: 50%;
  background: #1b2f38; border: 1px solid #63828a; transition: all .3s ease;
}
.hud-stones i[data-tone="emerald"].lit { background: var(--emerald); border-color: #afffd0; box-shadow: 0 0 8px var(--emerald); }
.hud-stones i[data-tone="ruby"].lit    { background: var(--ruby);    border-color: #ffb6af; box-shadow: 0 0 8px var(--ruby); }
.hud-stones i[data-tone="sapphire"].lit{ background: var(--sapphire);border-color: #bceaff; box-shadow: 0 0 8px var(--sapphire); }
.hud-stones b { color: var(--gold); font: 900 10px/1 "Courier New", monospace; }
.hud-score { display: flex; align-items: center; gap: 4px; }
.rupee-gem { color: var(--emerald); font-size: 13px; text-shadow: 0 0 8px #2ecc7188; }
.hud-score b { color: var(--gold); font: 900 14px/1 "Courier New", monospace; }
.hud-score small { color: var(--muted); font: 800 8px/1 "Courier New", monospace; letter-spacing: .08em; }

/* ===== 通用 section ===== */
.story-section {
  position: relative; padding: 36px 18px 28px;
  border-top: 2px dashed #f2c94c44;
}
.section-title { display: flex; align-items: center; gap: 14px; margin: 0 0 18px; color: var(--cream); }
.section-title span {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; flex-shrink: 0;
  background: linear-gradient(180deg, var(--gold), var(--gold-d));
  color: var(--gold-dd);
  border: 2px solid var(--gold-b); border-radius: 50%;
  font: 900 15px/1 sans-serif;
  box-shadow: 0 3px 0 #3b2504;
}
.section-title div p { margin: 0 0 3px; color: var(--navi); font: 800 9px/1 "Courier New", monospace; letter-spacing: .2em; }
.section-title h2 { margin: 0; font: 900 19px/1.15 sans-serif; letter-spacing: .05em; color: var(--gold-b); }
.section-title.light span { background: linear-gradient(180deg, var(--ocarina), var(--royal)); color: var(--cream); border-color: var(--navi); }

.reveal { opacity: 1; transform: translateY(0); transition: opacity .6s ease, transform .6s ease; }
.reveal.reveal-pending { opacity: 0; transform: translateY(14px); }
.reveal.show { opacity: 1; transform: translateY(0); }

/* ===== ② 王室书信 ===== */
.briefing {
  background: radial-gradient(circle at 50% 0%, #143628 0%, #091410 72%);
}
.forest-glow {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(circle at 50% 18%, #2ecc7122 0%, transparent 55%);
}
.fairy-field {
  position: absolute; inset: 0; pointer-events: none; opacity: .38;
  background-image: radial-gradient(circle, #ffe68a99 0 2px, transparent 4px);
  background-size: 72px 72px;
  animation: steam 12s linear infinite;
}
@keyframes steam { from { background-position: 0 100%; } to { background-position: 0 -100%; } }

.order-card {
  position: relative;
  padding: 18px 16px 16px; margin-bottom: 20px;
  border: 2.5px solid var(--gold); border-radius: 8px;
  background: linear-gradient(180deg, var(--parchment) 0%, var(--parch-2) 100%);
  color: var(--ink);
  box-shadow: inset 0 0 0 2px #c8a25888, 0 8px 0 var(--gold-dd), 0 14px 24px #00000066;
}
.card-top {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 8px; padding-bottom: 7px;
  border-bottom: 2px dashed var(--gold-d);
  font: 900 10px/1 "Courier New", monospace; letter-spacing: .14em;
}
.card-top span { color: var(--gold-d); }
.card-top b { color: var(--cream); background: var(--royal); padding: 4px 8px; border-radius: 3px; font-size: 9px; }

.order-card h3 { margin: 6px 0 8px; font: 900 20px/1.25 sans-serif; color: var(--royal); letter-spacing: .04em; }
.order-card p { margin: 0 0 12px; font-size: 13px; line-height: 1.7; color: #362511; }
.order-card dl { margin: 0 0 16px; padding: 0; }
.order-card dl > div {
  display: grid; grid-template-columns: 62px 1fr; gap: 8px;
  padding: 6px 0; border-bottom: 1px dotted #9c6b1266;
  font: 800 11px/1.3 "Courier New", monospace;
}
.order-card dl > div:last-child { border-bottom: 0; }
.order-card dt { color: var(--gold-d); letter-spacing: .1em; }
.order-card dd { margin: 0; color: var(--ink); font-family: inherit; }

.accept-button {
  display: block; width: 100%; padding: 14px;
  border: 2.5px solid var(--gold-b); border-radius: 6px;
  background: linear-gradient(180deg, var(--ocarina) 0%, var(--royal) 100%);
  color: var(--cream); font: 900 15px/1 sans-serif; letter-spacing: .12em;
  box-shadow: 0 4px 0 var(--ocarina-d);
  cursor: pointer; user-select: none; -webkit-user-select: none;
  touch-action: none;
}
.accept-button:disabled { opacity: .88; cursor: default; }

/* 时之笛经典白边翠绿魔力槽 */
.hold-progress {
  height: 10px; margin-top: 10px; padding: 1.5px;
  border: 2px solid #ffffff; border-radius: 4px;
  background: #14221a; box-shadow: inset 0 0 0 1px #00000055;
  overflow: hidden;
}
.hold-progress i {
  display: block; height: 100%; width: 0; border-radius: 2px;
  background: linear-gradient(90deg, #1fb865, #57ff9a);
  transition: width .08s linear;
}

.mission-complete {
  display: none; margin: 0 0 16px; padding: 12px;
  border: 2px solid var(--emerald); border-radius: 8px;
  background: #0d2b20; text-align: center; color: var(--cream);
  box-shadow: 0 0 18px #2ecc7166;
}
.mission-complete.show { display: block; animation: questGlow 1.5s ease infinite; }
.mission-complete b { display: block; color: var(--emerald); font: 900 13px/1 "Courier New", monospace; letter-spacing: .16em; margin-bottom: 4px; }
.mission-complete span { font-size: 12px; }
@keyframes questGlow { 0%,100% { box-shadow: 0 0 16px #2ecc7155; } 50% { box-shadow: 0 0 26px #2ecc7199; } }

/* 妖精娜薇指引卡 */
.navi-stage {
  position: relative; margin: 0 auto 24px; max-width: 390px;
  padding: 14px 14px 14px 102px; min-height: 104px;
  border: 2px solid var(--navi); border-radius: 10px;
  background: linear-gradient(135deg, #0d233a, #091722);
  box-shadow: 0 0 18px #7ef9ff33, 0 5px 0 #07131e;
}
.navi-stage img {
  position: absolute; left: 8px; top: 50%; transform: translateY(-50%);
  width: 84px; height: auto;
  filter: drop-shadow(0 0 10px #7ef9ffaa);
  animation: naviHover 2.8s ease-in-out infinite;
}
@keyframes naviHover { 0%,100% { transform: translateY(-54%); } 50% { transform: translateY(-44%); } }
.navi-bubble b { display: block; color: var(--navi); font: 900 10px/1 "Courier New", monospace; letter-spacing: .16em; margin-bottom: 6px; }
.navi-bubble span { font-size: 12.5px; line-height: 1.55; color: var(--cream); }

/* ===== ③ 主题原生：五音时之笛吹奏小游戏 ===== */
.ocarina-game {
  position: relative;
  margin: 4px -2px 0; padding: 14px 13px 15px;
  border: 2.5px solid var(--gold); border-radius: 10px;
  background: linear-gradient(180deg, #10243d 0%, #091422 100%);
  color: var(--cream);
  box-shadow: inset 0 0 0 2px #07111a, 0 8px 24px #00000088;
}
.game-console-top {
  display: flex; justify-content: space-between; align-items: flex-end;
  margin-bottom: 10px; padding-bottom: 9px;
  border-bottom: 1.5px solid #f2c94c55;
}
.game-console-top small { display: block; color: var(--navi); font: 800 8.5px/1.2 "Courier New", monospace; letter-spacing: .14em; margin-bottom: 3px; }
.game-console-top b { color: var(--gold-b); font: 900 14.5px/1.2 sans-serif; letter-spacing: .04em; }
.game-console-top span { color: var(--gold); font: 900 10px/1 "Courier New", monospace; }
.game-console-top strong { color: var(--cream); font-size: 13px; }

/* 三颗精灵石祭坛 */
.stone-altar {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
  margin-bottom: 10px;
}
.stone-slot {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 7px 4px; border-radius: 8px;
  border: 1.5px solid #2b4560; background: #07111c;
  text-align: center; transition: all .3s ease;
}
.stone-slot img {
  width: 44px; height: 44px; object-fit: contain;
  filter: grayscale(.9) brightness(.45); opacity: .55;
  transition: all .35s ease;
}
.stone-slot span { font-size: 10px; font-weight: 800; color: var(--muted); line-height: 1.2; }
.stone-slot.active { border-color: var(--gold); background: #142a46; box-shadow: 0 0 12px #f2c94c33; }
.stone-slot.active img { filter: grayscale(.2) brightness(.85); opacity: .9; }
.stone-slot.active span { color: var(--gold-b); }

.stone-slot.lit-emerald { border-color: var(--emerald); background: #0d2b1d; box-shadow: 0 0 16px #2ecc7155; }
.stone-slot.lit-ruby    { border-color: var(--ruby);    background: #2f1214; box-shadow: 0 0 16px #e84a3c55; }
.stone-slot.lit-sapphire{ border-color: var(--sapphire);background: #0d2538; box-shadow: 0 0 16px #38b6ff55; }
.stone-slot[class*="lit-"] img { filter: drop-shadow(0 0 8px #ffffffaa); opacity: 1; transform: scale(1.06); }
.stone-slot[class*="lit-"] span { color: var(--cream); }

.game-stats {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px 10px;
  margin-bottom: 10px; padding: 8px 10px;
  background: #060e18; border: 1px solid #f2c94c55; border-radius: 6px;
  font: 900 10px/1.3 "Courier New", monospace;
}
.game-stats span { display: flex; justify-content: space-between; color: var(--cream); }
.game-stats b { color: var(--gold); }

/* 曲名横幅 + 示范播放键 */
.song-banner {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  margin-bottom: 8px; padding: 8px 10px;
  border-radius: 6px; border: 1.5px solid #f2c94c66;
  background: linear-gradient(90deg, #1b365a, #10243d);
}
.song-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.song-info small { color: var(--navi); font: 800 8.5px/1 "Courier New", monospace; letter-spacing: .12em; }
.song-info b { color: var(--gold-b); font: 900 13px/1.2 sans-serif; }
.song-info span { color: var(--muted); font: 800 9px/1 "Courier New", monospace; letter-spacing: .1em; }
#song-preview-btn {
  flex-shrink: 0; padding: 7px 11px;
  border: 1.5px solid var(--gold); border-radius: 999px;
  background: #091727; color: var(--gold);
  font: 900 11px/1 sans-serif; cursor: pointer;
}
#song-preview-btn:active, #song-preview-btn.playing { background: var(--gold); color: var(--gold-dd); }

/* 四红线时之笛五线谱视窗 */
.ocarina-staff {
  position: relative; height: 96px; margin-bottom: 10px;
  padding: 6px 10px 6px 52px;
  border: 2px solid var(--gold); border-radius: 8px;
  background: linear-gradient(180deg, #19120b 0%, #2a1d11 100%);
  box-shadow: inset 0 0 18px #000000aa;
  overflow: hidden;
}
.staff-clef {
  position: absolute; left: 6px; top: 50%; transform: translateY(-50%);
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  opacity: .92; pointer-events: none;
}
.staff-clef img { width: 100%; height: auto; filter: drop-shadow(0 0 6px #38b6ff66); }
.staff-lines {
  position: absolute; left: 48px; right: 10px; top: 0; bottom: 0;
  pointer-events: none;
}
.staff-lines i {
  position: absolute; left: 0; right: 0; height: 1.5px;
  background: #d95d4caa; display: block;
}
.staff-lines i:nth-child(1) { top: 21%; }
.staff-lines i:nth-child(2) { top: 38%; }
.staff-lines i:nth-child(3) { top: 55%; }
.staff-lines i:nth-child(4) { top: 72%; }

.staff-notes {
  position: relative; width: 100%; height: 100%;
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  align-items: center;
}
.staff-note {
  position: relative; height: 100%;
}
.note-bead {
  position: absolute; left: 50%; transform: translate(-50%, -50%);
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font: 900 12px/1 sans-serif;
  transition: transform .18s ease, box-shadow .18s ease, opacity .18s ease;
}
/* 真实五音高度对应四红线位置 */
.staff-note[data-pitch="U"] .note-bead { top: 20%; }
.staff-note[data-pitch="L"] .note-bead { top: 33%; }
.staff-note[data-pitch="R"] .note-bead { top: 50%; }
.staff-note[data-pitch="D"] .note-bead { top: 66%; }
.staff-note[data-pitch="A"] .note-bead { top: 82%; }

.staff-note.note-c .note-bead {
  background: linear-gradient(180deg, #ffe76e, var(--c-yellow));
  color: #3b2600; border: 2px solid #fff3b0;
}
.staff-note.note-a .note-bead {
  background: linear-gradient(180deg, #5ba4ff, var(--ocarina));
  color: #ffffff; border: 2px solid #cce3ff;
}
.staff-note.pending .note-bead { opacity: .45; filter: saturate(.75); }
.staff-note.current .note-bead {
  opacity: 1; transform: translate(-50%, -50%) scale(1.16);
  box-shadow: 0 0 0 3px var(--navi), 0 0 14px var(--navi);
  animation: notePulse 1s ease-in-out infinite;
}
.staff-note.done .note-bead {
  opacity: 1; transform: translate(-50%, -50%) scale(1.04);
  box-shadow: 0 0 12px var(--gold);
}
.staff-note.previewing .note-bead {
  opacity: 1; transform: translate(-50%, -50%) scale(1.24);
  box-shadow: 0 0 0 3px var(--gold-b), 0 0 18px var(--gold);
}
@keyframes notePulse { 0%,100% { box-shadow: 0 0 0 2px var(--navi), 0 0 10px var(--navi); } 50% { box-shadow: 0 0 0 4px var(--navi), 0 0 18px var(--navi); } }

.ocarina-staff.shake { animation: staffShake .28s ease; }
@keyframes staffShake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }

.blessing-toast {
  position: absolute; left: 50%; top: 6px; transform: translateX(-50%) translateY(-6px);
  padding: 3px 10px; border-radius: 999px;
  background: #0d2b20ee; border: 1px solid var(--emerald);
  color: var(--gold-b); font: 800 10px/1.3 sans-serif;
  white-space: nowrap; opacity: 0; pointer-events: none;
  transition: opacity .25s ease, transform .25s ease; z-index: 4;
}
.blessing-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.freeplay-bar {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  margin-bottom: 8px; padding: 6px 10px; border-radius: 6px;
  background: #0b241d; border: 1px solid var(--emerald);
  font-size: 10.5px; color: var(--cream);
}
.freeplay-bar b { color: var(--c-yellow); }
.freeplay-bar button {
  flex-shrink: 0; padding: 5px 10px; border-radius: 999px;
  border: 1px solid var(--gold); background: transparent; color: var(--gold);
  font: 900 10px/1 sans-serif; cursor: pointer;
}

/* 五键时之笛控制器 */
.game-stage {
  position: relative;
  padding: 14px 10px;
  background: radial-gradient(ellipse at 50% 0%, #244f8844 0%, #07111c 78%);
  border: 1.5px solid #f2c94c88; border-radius: 8px;
  min-height: 224px;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.ocarina-controls {
  display: flex; align-items: center; justify-content: space-around;
  width: 100%; gap: 10px;
}
.a-btn-wrap {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.oc-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  border-radius: 50%; cursor: pointer;
  user-select: none; -webkit-user-select: none;
  touch-action: manipulation;
  transition: transform .08s ease, box-shadow .08s ease;
}
.oc-a {
  width: 72px; height: 72px;
  border: 3px solid #cce3ff;
  background: radial-gradient(circle at 35% 30%, #63adff, var(--ocarina) 60%, var(--ocarina-d));
  color: #ffffff;
  box-shadow: 0 5px 0 #0b2859, 0 10px 20px #00000088;
}
.oc-a b { font: 900 26px/1 sans-serif; text-shadow: 0 2px 4px #092149; }
.oc-a small { font: 800 9px/1 "Courier New", monospace; opacity: .88; margin-top: 2px; }
.oc-a:active, .oc-a.pressed { transform: translateY(3px) scale(.96); box-shadow: 0 2px 0 #0b2859, 0 0 18px #7ef9ffaa; }
.pad-hint { font: 700 9.5px/1 sans-serif; color: var(--muted); }

.c-pad {
  display: grid;
  grid-template-columns: repeat(3, 50px);
  grid-template-rows: repeat(3, 50px);
  gap: 4px;
  align-items: center; justify-items: center;
}
.c-up    { grid-column: 2; grid-row: 1; }
.c-left  { grid-column: 1; grid-row: 2; }
.c-center{
  grid-column: 2; grid-row: 2;
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: #0d1f35; border: 1px solid #f2c94c44;
  color: var(--gold); font: 900 12px/1 "Courier New", monospace;
}
.c-right { grid-column: 3; grid-row: 2; }
.c-down  { grid-column: 2; grid-row: 3; }

.oc-c {
  width: 50px; height: 50px;
  border: 2.5px solid #fff5b8;
  background: radial-gradient(circle at 35% 30%, #fff08a, var(--c-yellow) 62%, var(--c-yellow-d));
  color: #3a2300;
  box-shadow: 0 4px 0 #6b4700, 0 8px 14px #00000077;
}
.oc-c b { font: 900 18px/1 sans-serif; }
.oc-c:active, .oc-c.pressed { transform: translateY(2px) scale(.95); box-shadow: 0 2px 0 #6b4700, 0 0 16px #ffd426bb; }

/* 开始 / 结算遮罩 */
.game-intro, .game-result {
  position: absolute; inset: 0; z-index: 3;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 7px;
  background: #07111ae6; backdrop-filter: blur(5px);
  text-align: center; padding: 14px 16px;
}
.intro-ocarina {
  width: 72px; height: auto;
  filter: drop-shadow(0 0 12px #38b6ff88);
  animation: floatSlow 3s ease-in-out infinite;
}
.result-sword {
  width: 46px; height: auto;
  filter: drop-shadow(0 0 12px #7ef9ffaa);
}
@keyframes floatSlow { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
.game-intro h3, .game-result h3 { margin: 0; color: var(--gold-b); font: 900 17px/1.2 sans-serif; letter-spacing: .04em; }
.game-intro p, .game-result span { margin: 0; color: var(--cream); font-size: 11.5px; line-height: 1.55; }
.game-result p { margin: 0; color: var(--navi); font: 800 9px/1 "Courier New", monospace; letter-spacing: .16em; }
.game-result strong { display: block; color: var(--gold); font: 900 22px/1.1 "Courier New", monospace; }
.game-result > b { display: block; padding: 5px 10px; background: #103b2c; border: 1px solid var(--emerald); color: var(--emerald); border-radius: 4px; font-size: 11px; }

.intro-actions, .result-actions {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 4px;
}
.intro-actions button, .result-actions button, .submit-button {
  padding: 10px 18px;
  border: 2px solid var(--gold-b); border-radius: 999px;
  background: linear-gradient(180deg, var(--ocarina), var(--royal));
  color: var(--cream); font: 900 12.5px/1 sans-serif; letter-spacing: .1em;
  box-shadow: 0 3px 0 #0b234d; cursor: pointer;
}
.intro-actions .btn-secondary, .result-actions .btn-secondary {
  border-color: var(--gold); background: #0b1c2e; color: var(--gold);
  box-shadow: 0 3px 0 #07111a;
}
.game-tip { margin: 9px 0 0; text-align: center; color: var(--gold); font-size: 11px; letter-spacing: .04em; opacity: .9; }

/* ===== ④ 希卡传音 · 贤者祝福 ===== */
.crew-section {
  background: radial-gradient(circle at 50% 0%, #16304b 0%, var(--forest) 72%);
}
.crew-phone {
  position: relative; padding: 13px 13px 16px;
  border: 2.5px solid var(--navi); border-radius: 16px;
  background: linear-gradient(180deg, #0e2238 0%, #07121e 100%);
  box-shadow: 0 0 22px #7ef9ff33, inset 0 0 18px #7ef9ff22;
}
.phone-top {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 10px; padding-bottom: 8px;
  border-bottom: 1px dashed #7ef9ff66; color: var(--navi);
  font: 900 10px/1 "Courier New", monospace; letter-spacing: .16em;
}
.phone-top b { color: var(--gold); }
.crew-slides { position: relative; min-height: 290px; }
.crew-slide {
  display: none; flex-direction: column; align-items: center; text-align: center;
  padding: 4px 4px 0; gap: 10px;
}
.crew-slide.active { display: flex; animation: fadeIn .32s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* 拱门祭坛相框，完美承载竖版官方高清全身原画 */
.crew-photo {
  width: 148px; height: 174px;
  display: flex; align-items: flex-end; justify-content: center; padding: 8px 8px 4px;
  background: radial-gradient(circle at 50% 35%, #234972 0%, #0c1d30 100%);
  border: 2.5px solid var(--gold); border-radius: 74px 74px 14px 14px;
  box-shadow: 0 5px 0 var(--gold-dd), inset 0 0 16px #7ef9ff33;
  overflow: hidden;
}
.crew-photo img { width: 100%; height: 100%; object-fit: contain; object-position: bottom center; }
.crew-name { margin: 0; color: var(--gold); font: 900 13.5px/1 sans-serif; letter-spacing: .1em; }
.crew-msg {
  margin: 0; padding: 10px 12px;
  background: var(--parchment); color: var(--ink);
  border: 1.5px solid var(--gold); border-radius: 8px;
  font-size: 13px; line-height: 1.6; max-width: 94%;
}
.crew-controls {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 10px; padding: 6px 4px;
}
.crew-controls button {
  width: 38px; height: 38px;
  border: 2px solid var(--navi); border-radius: 50%;
  background: transparent; color: var(--navi);
  font: 900 14px/1 sans-serif; cursor: pointer;
}
.crew-controls button:active { background: var(--navi); color: var(--forest-d); }
.crew-controls output { color: var(--gold); font: 900 11px/1 "Courier New", monospace; letter-spacing: .12em; }

/* ===== ⑤ 时之神殿 · 圣约章程 ===== */
.schedule-section {
  background: linear-gradient(180deg, #0b1a14 0%, #102a23 50%, #081412 100%);
  border-top: 0;
}
.restaurant-screen {
  position: relative; margin: 0 0 18px;
  border: 2.5px solid var(--gold); border-radius: 10px;
  overflow: hidden; box-shadow: 0 8px 20px #00000066;
}
.restaurant-screen img { width: 100%; height: auto; }
.restaurant-status {
  position: absolute; top: 10px; right: 10px;
  display: flex; align-items: center; gap: 6px;
  padding: 6px 10px; background: #07110ddd; color: var(--gold);
  border: 1.5px solid var(--gold); border-radius: 999px;
  font: 900 9px/1 "Courier New", monospace; letter-spacing: .12em;
}
.restaurant-status i { width: 7px; height: 7px; background: var(--emerald); border-radius: 50%; animation: blink 1.4s ease infinite; }
@keyframes blink { 0%,100% { opacity: 1; } 50% { opacity: .35; } }

.menu-board {
  padding: 14px 12px 12px;
  border: 2px solid var(--gold); border-radius: 10px;
  background: linear-gradient(180deg, #0c1f19 0%, #07120e 100%);
  color: var(--cream);
  box-shadow: inset 0 0 0 1px #f2c94c33, 0 8px 18px #00000066;
}
.board-title { margin: 0 0 10px; text-align: center; color: var(--gold); font: 900 10.5px/1 "Courier New", monospace; letter-spacing: .2em; }
.menu-item {
  display: grid; grid-template-columns: 56px 1fr auto; gap: 10px;
  padding: 10px 6px; border-bottom: 1px dashed #f2c94c44;
  font-size: 12px;
}
.menu-item:last-child { border-bottom: 0; }
.menu-item .time { color: var(--navi); font: 900 14px/1.2 "Courier New", monospace; }
.menu-item h4 { margin: 0 0 3px; color: var(--gold-b); font: 900 13.5px/1.25 sans-serif; }
.menu-item p { margin: 0; color: #c7d8cf; font-size: 11.5px; line-height: 1.5; }
.menu-item .stars { color: var(--gold); font: 900 12px/1 sans-serif; align-self: center; }
.menu-total {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 8px; padding-top: 8px;
  border-top: 1.5px solid var(--gold);
  font: 900 10.5px/1 "Courier New", monospace; letter-spacing: .16em;
}
.menu-total span { color: var(--gold); }
.menu-total b { color: var(--emerald); font-size: 15px; }

.countdown-card {
  display: flex; align-items: baseline; justify-content: center; gap: 8px;
  margin: 20px auto 0; padding: 14px 18px;
  border: 2px solid var(--navi); border-radius: 10px;
  background: #071422; color: var(--navi);
  box-shadow: 0 0 18px #7ef9ff33; width: fit-content;
}
.countdown-card span { font: 900 9.5px/1 "Courier New", monospace; letter-spacing: .16em; color: var(--cream); }
.countdown-card b { font: 900 34px/1 "Courier New", monospace; color: var(--gold); }
.countdown-card small { font: 900 9.5px/1 "Courier New", monospace; letter-spacing: .14em; color: var(--cream); }

.gift-note {
  margin: 18px 0 0; padding: 11px 14px;
  border-left: 4px solid var(--gold); background: #0c211b;
  border-radius: 0 8px 8px 0;
}
.gift-note b { display: block; color: var(--gold); font: 900 10px/1 "Courier New", monospace; letter-spacing: .18em; margin-bottom: 4px; }
.gift-note span { color: var(--cream); font-size: 12.5px; line-height: 1.6; }

/* ===== ⑥ 海拉鲁地图 · 前往圣殿 ===== */
.arrival {
  background: radial-gradient(circle at 50% 100%, #152b44 0%, var(--forest) 72%);
}
.map-console {
  position: relative; padding: 24px 18px 20px; overflow: hidden;
  border: 2px solid var(--gold); border-radius: 10px;
  background: #0a141c;
  box-shadow: 0 0 22px #38b6ff33;
  text-align: center;
}
.map-bg {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; opacity: .22; pointer-events: none;
  filter: sepia(.25) contrast(1.05);
}
.map-grid {
  position: absolute; inset: 8px; pointer-events: none;
  background-image:
    linear-gradient(var(--navi) 1px, transparent 1px),
    linear-gradient(90deg, var(--navi) 1px, transparent 1px);
  background-size: 32px 32px; opacity: .12; border-radius: 6px;
}
.map-pulse { position: relative; z-index: 1; margin: 0 auto 14px; width: 62px; height: 62px; }
.map-pulse i, .map-pulse b { position: absolute; inset: 0; margin: auto; border-radius: 50%; }
.map-pulse i { width: 100%; height: 100%; background: var(--gold); opacity: .28; animation: pulseRing 1.7s ease infinite; }
.map-pulse b {
  width: 36px; height: 36px;
  background: linear-gradient(180deg, var(--ocarina), var(--royal));
  color: var(--gold); border: 2.5px solid var(--gold-b);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; box-shadow: 0 0 18px #38b6ff88;
}
@keyframes pulseRing { 0% { transform: scale(.65); opacity: .55; } 100% { transform: scale(1.35); opacity: 0; } }
.coordinate { position: relative; z-index: 1; margin: 0 0 4px; color: var(--navi); font: 900 10px/1 "Courier New", monospace; letter-spacing: .2em; }
.map-console h3 { position: relative; z-index: 1; margin: 0 0 8px; color: var(--gold-b); font: 900 16px/1.35 sans-serif; }
.map-console p { position: relative; z-index: 1; margin: 0 0 14px; color: var(--cream); font-size: 12.5px; line-height: 1.6; }
.map-console a {
  position: relative; z-index: 1;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 11px 20px; border: 2px solid var(--gold); border-radius: 999px;
  background: #091522cc; color: var(--gold-b);
  font: 900 12px/1 sans-serif; letter-spacing: .1em; text-decoration: none;
}
.map-console a:active { background: var(--gold); color: var(--gold-dd); }

/* ===== ⑦ 勇者报到 ===== */
.rsvp-section {
  background: linear-gradient(180deg, var(--forest) 0%, var(--navy-d) 100%);
}
.rsvp-phone {
  padding: 14px 14px 16px;
  border: 2.5px solid var(--emerald); border-radius: 14px;
  background: linear-gradient(180deg, #0d2324 0%, #071418 100%);
  box-shadow: 0 0 20px #2ecc7133;
}
.app-bar {
  display: flex; align-items: center; gap: 8px; padding-bottom: 8px;
  border-bottom: 1px dashed #2ecc7177;
  color: var(--emerald); font: 900 10px/1 "Courier New", monospace; letter-spacing: .15em;
}
.app-bar span { color: var(--gold); font-size: 13px; }
.app-bar small { margin-left: auto; color: var(--gold); font-size: 9px; }
.rsvp-phone form { padding-top: 12px; }
.demo-notice {
  margin: 0 0 14px; padding: 8px 10px;
  background: #ffffff10; border-left: 2.5px solid var(--gold);
  color: var(--gold-b); font-size: 11px; line-height: 1.5;
}
.demo-notice b { color: var(--ruby); }
.rsvp-phone label { display: block; margin: 0 0 12px; }
.rsvp-phone label > span { display: block; margin-bottom: 5px; color: var(--cream); font: 800 11px/1 "Courier New", monospace; letter-spacing: .08em; }
.rsvp-phone label > span b { color: var(--ruby); }
.rsvp-phone input, .rsvp-phone select, .rsvp-phone textarea {
  width: 100%; padding: 10px 11px;
  border: 1.5px solid #2ecc7188; border-radius: 6px;
  background: #060f12; color: var(--cream);
  font: 600 13px/1.4 sans-serif; outline: none;
}
.rsvp-phone input:focus, .rsvp-phone select:focus, .rsvp-phone textarea:focus {
  border-color: var(--gold); box-shadow: 0 0 0 3px #f2c94c33;
}
.rsvp-phone fieldset { border: 0; padding: 0; margin: 0 0 12px; }
.rsvp-phone legend { padding: 0 0 6px; color: var(--cream); font: 800 11px/1 "Courier New", monospace; letter-spacing: .08em; }
.choice-row { display: flex; gap: 8px; }
.choice-row label {
  flex: 1; margin: 0; padding: 10px;
  border: 1.5px solid #2ecc7188; border-radius: 6px;
  text-align: center; cursor: pointer;
}
.choice-row input { display: none; }
.choice-row span { display: block; color: var(--cream); font: 800 12px/1 sans-serif; letter-spacing: .08em; }
.choice-row label:has(input:checked) { background: var(--emerald); border-color: var(--gold-b); }
.choice-row label:has(input:checked) span { color: var(--forest-d); }
.rsvp-phone textarea { resize: vertical; min-height: 74px; }
.website-field { position: absolute !important; left: -10000px !important; width: 1px !important; height: 1px !important; overflow: hidden !important; }
#attendance-details { transition: opacity .2s ease; }
#attendance-details.is-disabled { opacity: .35; pointer-events: none; }
.rsvp-phone label small { display: flex; justify-content: flex-end; margin-top: 3px; color: var(--muted); font: 800 10px/1 "Courier New", monospace; }
.rsvp-phone label small output { color: var(--gold); }
.form-error { margin: 0 0 10px; padding: 8px 10px; background: var(--ruby-d); color: var(--cream); border-radius: 6px; font-size: 12px; }
.submit-button {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 14px; margin-top: 4px;
  border-radius: 8px; font-size: 14px;
}
.submit-button b { color: var(--gold); }
.rsvp-success, .rsvp-external { margin-top: 14px; padding: 16px; text-align: center; }
.success-radar { position: relative; width: 64px; height: 64px; margin: 0 auto 12px; }
.success-radar i, .success-radar b { position: absolute; inset: 0; margin: auto; display: flex; align-items: center; justify-content: center; }
.success-radar i { border-radius: 50%; background: var(--gold); opacity: .28; animation: pulseRing 1.6s ease infinite; }
.success-radar b { width: 38px; height: 38px; border-radius: 50%; background: var(--gold); color: var(--gold-dd); font: 900 17px/1 sans-serif; }
.rsvp-success h3, .rsvp-external h3 { margin: 0 0 8px; color: var(--gold-b); font: 900 16px/1.2 sans-serif; }
.rsvp-success p, .rsvp-external p { margin: 0 0 14px; color: var(--cream); font-size: 12.5px; line-height: 1.6; }
.rsvp-success button {
  padding: 10px 18px; border: 2px solid var(--navi); border-radius: 999px;
  background: transparent; color: var(--navi); font: 900 11px/1 sans-serif; letter-spacing: .1em; cursor: pointer;
}
.rsvp-external a {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 11px 20px; border: 2px solid var(--emerald); border-radius: 999px;
  color: var(--emerald); text-decoration: none; font: 900 12px/1 sans-serif;
}

/* ===== ⑧ 结尾重逢 ===== */
.ending { position: relative; min-height: 340px; overflow: hidden; }
.ending img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 28%; }
.ending-copy {
  position: absolute; left: 16px; right: 16px; bottom: 48px; z-index: 2;
  padding: 14px 16px; border: 2px solid var(--gold); border-radius: 10px;
  background: #07120fd9; backdrop-filter: blur(8px);
  text-align: center; color: var(--cream);
  box-shadow: 0 8px 22px #00000099;
}
.ending-copy p { margin: 0 0 4px; color: var(--gold); font: 900 9.5px/1 "Courier New", monospace; letter-spacing: .2em; }
.ending-copy h2 {
  margin: 6px 0 8px; color: var(--gold-b);
  font: 900 clamp(17px, 5vw, 22px)/1.25 sans-serif;
  text-shadow: 0 2px 0 #7a520b, 0 4px 0 #2d1b02;
  -webkit-font-smoothing: antialiased;
}
.ending-copy b { display: block; margin: 4px 0; color: var(--cream); font: 900 14px/1.3 sans-serif; }
.ending-copy span { color: var(--navi); font: 800 10.5px/1 "Courier New", monospace; letter-spacing: .12em; }

footer { padding: 20px 14px 76px; text-align: center; background: var(--forest-d); }
.footer-logo {
  display: inline-block; padding: 6px 14px;
  border: 1.5px solid var(--gold); border-radius: 4px;
  color: var(--gold); font: 900 12px/1 "Courier New", monospace; letter-spacing: .16em;
}
.footer-logo b { color: var(--navi); }
footer p { margin: 8px 0 0; color: var(--muted); font: 800 9px/1.5 "Courier New", monospace; letter-spacing: .12em; }

/* ===== 底部快捷导航 & 音乐坞 ===== */
.quick-nav {
  position: fixed; z-index: 10;
  left: 50%; bottom: calc(12px + env(safe-area-inset-bottom));
  transform: translateX(-50%) translateY(10px);
  display: flex; gap: 4px; padding: 5px;
  border: 2px solid var(--gold); border-radius: 999px;
  background: #07131bee; backdrop-filter: blur(8px);
  box-shadow: 0 6px 18px #00000088;
  opacity: 0; pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
}
.quick-nav.visible { opacity: 1; pointer-events: auto; transform: translateX(-50%) translateY(0); }
.quick-nav a {
  padding: 8px 13px; border-radius: 999px;
  color: var(--cream); font: 900 11px/1 sans-serif; letter-spacing: .12em; text-decoration: none;
}
.quick-nav a.active, .quick-nav a:active, .quick-nav a:hover { background: var(--royal); color: var(--gold-b); }

.music-dock {
  position: fixed; z-index: 11;
  right: calc(12px + env(safe-area-inset-right));
  top: calc(58px + env(safe-area-inset-top));
  display: flex; align-items: center; gap: 6px;
  padding: 5px 5px 5px 10px;
  background: #07131bd9; backdrop-filter: blur(6px);
  border: 1.5px solid var(--gold); border-radius: 999px;
}
.music-dock p { margin: 0; color: var(--cream); font: 800 9px/1.2 sans-serif; white-space: nowrap; }
.music-dock button {
  width: 30px; height: 30px; border: 0; border-radius: 50%;
  background: var(--royal); color: var(--gold-b);
  font-size: 14px; cursor: pointer; box-shadow: 0 2px 0 #0a1f45;
}
.music-dock button[aria-pressed="true"] { background: var(--emerald); color: var(--forest-d); }

@media (max-width: 680px) {
  .music-dock { padding: 4px; }
  .music-dock p { display: none; }
}
@media (max-width: 420px) {
  .hero-brand { width: min(92%, 410px); }
}
@media (max-width: 374px) {
  .oc-a { width: 62px; height: 62px; }
  .c-pad { grid-template-columns: repeat(3, 44px); grid-template-rows: repeat(3, 44px); }
  .oc-c { width: 44px; height: 44px; }
}
@media (max-height: 720px) {
  .hero-brand { top: 7.5%; width: min(84%, 370px); }
  .hero-copy { top: 38.5%; }
  .mission-ticket { margin-top: 12px; }
  .enter-button { bottom: calc(48px + env(safe-area-inset-bottom)); }
  .start-note { display: none; }
}
