/* ===========================================================================
   HYRULE WEDDING · 塞尔达传说·旷野之息 视觉系统
   希卡青蓝 / 三角力量金 / 羊皮纸米白 + 深岩蓝夜色底
   希卡几何纹、发光石板、神祠橙辉、三角力量与符文点缀

   配色来源（从素材实测采样，非凭空指定）：
     封面落日主视觉：天空暖金 #f1d2a0 / #fdedc2，山峦冷蓝 #283c56 / #4d637e
     希卡石板地图  ：#1f4094 希卡蓝、#0d0f36 深岩蓝（13.8% 占比）、#94885f 地图褐
     海拉鲁平原    ：#5fa84a 草地绿、#b8ead8 天光青
     古代神祠升起  ：#f0a83c 神祠橙辉、#b99455 岩金

   中文大字遵循三层 text-shadow 铁律（禁用 -webkit-text-stroke）
   =========================================================================== */

:root {
  /* ── 主色：希卡青蓝（行动色：按钮、强调边框、发光）── */
  --sheikah:   #3d8ede;
  --sheikah-d: #1f5fa8;
  --sheikah-x: #10386a;
  --sheikah-l: #86c6ff;

  /* ── 辅色：三角力量金（权威色：标题、星级、描边）── */
  --tri:       #e9c14a;
  --tri-l:     #ffe4a0;
  --tri-d:     #a97f16;
  --tri-x:     #6d4f08;

  /* ── 羊皮纸：古文书的米白 ── */
  --cream:     #f6efda;
  --parch:     #e6dcbd;
  --parch-d:   #cabf96;

  /* ── 夜色底：封面山峦的冷蓝 + 岩层黑 ── */
  --night:     #101a2c;
  --night-d:   #070d18;
  --night-2:   #16233a;
  --night-3:   #1f3350;
  --slate:     #4d637e;
  --slate-d:   #2b3a52;

  /* ── 功能点缀 ── */
  --glow:      #f0a83c;   /* 神祠橙辉（小游戏、发光点缀） */
  --glow-l:    #ffcc7a;
  --leaf:      #5fa84a;   /* 海拉鲁草绿（正确 / 完成态） */
  --leaf-d:    #31631f;
  --cyan:      #46d6e8;   /* 希卡符文青光（信息 / 链接 / 地图） */
  --cyan-d:    #1b8e9e;

  --ink:       #16233a;   /* 羊皮纸上的墨色 */
  --muted:     #8b9ab5;
  --shadow:    0 0 24px #00000066;
}

/* ===== 全局 ===== */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--night-d); }
body {
  margin: 0;
  /* 底色：斜向希卡网格 + 冷蓝渐变，模拟石板纹路 */
  background:
    repeating-linear-gradient(0deg, #00000000 0 23px, #ffffff04 23px 24px),
    linear-gradient(180deg, var(--night-2) 0%, var(--night) 28%, var(--night-2) 58%, var(--night-d) 100%);
  color: var(--cream);
  font-family: "Arial Narrow", "Microsoft YaHei", sans-serif;
  /* 反常规做法：默认开启抗锯齿保证中文清晰，仅对英文像素 UI 单独关掉 */
  -webkit-font-smoothing: antialiased;
  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; }

/* 英文像素 UI：关掉抗锯齿换取锯齿感（只作用于纯英文小字） */
.hero-hud, .mission-code, .hero-en, .game-console-top, .game-stats,
.card-top, .game-legend, .coordinate, .board-title, .phone-top,
.app-bar, .footer-logo, .menu-total, .countdown-card, .section-title div p,
.ticket-tag, .hud-order small, .hud-score small, .hud-score b,
.crew-controls output, .menu-item .time, .demo-notice, .game-tip {
  -webkit-font-smoothing: none;
}

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

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

/* ===== ① 首页 · 海拉鲁日落 ===== */
.hero { position: relative; min-height: 100svh; overflow: hidden; background: #050c18; }
.hero-art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 45%; }
.hero-shade {
  position: absolute; inset: 0;
  /* 径向压暗中心外圈 + 上下深蓝压边，保证大字与票根可读 */
  background:
    radial-gradient(ellipse at 50% 30%, transparent 0%, #0a163055 60%, #060e1c 100%),
    linear-gradient(180deg, #050c18aa 0%, transparent 24% 32%, #0a162c9c 66%, #050c18 100%);
}
.hero-sparkle {
  position: absolute; inset: 0; pointer-events: none; opacity: .55;
  /* 金色与青色的光点，模拟希卡科技的浮游粒子 */
  background-image:
    radial-gradient(circle, var(--tri-l) 0 1.3px, transparent 2.1px),
    radial-gradient(circle, var(--cyan) 0 1.1px, transparent 1.8px),
    radial-gradient(circle, #ffffff 0 1px, transparent 1.6px);
  background-position: 12% 14%, 76% 22%, 46% 7%;
  background-size: 128px 118px, 172px 142px, 224px 198px;
  animation: spark 3.4s steps(3) infinite;
}
@keyframes spark { 0%,100% { opacity: .38 } 50% { opacity: .86 } }

.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: 2px solid var(--sheikah);
  border-radius: 2px;
  color: var(--sheikah-l);
  background: #08152bcc;
  font: 900 8px/1 "Courier New", monospace;
  letter-spacing: .1em;
  box-shadow: 0 0 14px #3d8ede55, inset 0 0 10px #3d8ede22;
}
.hero-hud b { color: var(--tri); font-size: 10px; }

.hero-brand {
  position: absolute; z-index: 3; top: 11%;
  left: 50%; width: min(calc(100% - 40px), 290px);
  transform: translateX(-50%);
  filter: drop-shadow(0 3px 0 #4a3008) drop-shadow(0 10px 18px #000000bb);
}
.hero-brand img { width: 100%; height: auto; }

.hero-copy {
  position: absolute; z-index: 3; top: 40%; left: 18px; right: 18px;
  text-align: center;
}
/* 委托编号：希卡蓝底 + 金边，四角带切角，像石板上的印记 */
.mission-code {
  display: inline-block; padding: 7px 14px; margin: 0;
  border: 2px solid var(--tri);
  border-radius: 2px;
  color: var(--tri-l); background: #10386acc;
  box-shadow: 0 0 16px #3d8ede66, inset 0 0 12px #3d8ede33;
  font: 900 clamp(9px, 2.6vw, 12px)/1 "Courier New", monospace;
  letter-spacing: .14em;
}
.hero-kicker { margin: 14px 0 4px; color: var(--cream); font-size: 11px; font-weight: 900; letter-spacing: .3em; }
.hero h1 {
  margin: 6px 0 0; color: var(--tri-l);
  font: 900 clamp(32px, 10.5vw, 50px)/1.06
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
    "Noto Sans SC", "Noto Sans CJK SC", sans-serif;
  letter-spacing: .09em;
  text-wrap: balance;   /* 占位符姓名较长时避免断成「新娘」+「名字」这类残行 */
  /* 三层硬阴影模拟描边：深金描边 + 焦金内影 + 夜空蓝投影（禁用 text-stroke） */
  text-shadow:
    0 3px 0 var(--tri-d),
    0 6px 0 var(--tri-x),
    0 11px 16px #030a17dd;
  -webkit-font-smoothing: antialiased;
}
.hero-en { margin: 12px 0 0; color: var(--cyan); font: 900 12px/1 "Courier New", monospace; letter-spacing: .18em; opacity: .92; }
/* 石板票根：深蓝底 + 青色虚线 + 角标 */
.mission-ticket {
  display: grid; grid-template-columns: 44px 1fr; gap: 4px 8px;
  width: min(92%, 350px); margin: 18px auto 0;
  padding: 11px 13px;
  border: 2px dashed var(--cyan);
  border-radius: 2px;
  background: #08152bdd; color: var(--cream);
  text-align: left;
  box-shadow: 0 0 18px #46d6e833, 0 4px 16px #00000088;
}
.mission-ticket span { color: var(--cyan); font: 900 8px/1.6 "Courier New", monospace; }
.mission-ticket b { font-size: 12px; line-height: 1.3; }
.hero-venue { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.enter-button {
  position: absolute; z-index: 3;
  left: 50%; bottom: calc(96px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: flex; align-items: center; gap: 10px;
  padding: 15px 24px;
  border: 3px solid var(--sheikah-l);
  border-radius: 3px;
  background: linear-gradient(180deg, var(--sheikah) 0%, var(--sheikah-d) 100%);
  color: var(--cream); font: 900 14px/1 sans-serif;
  letter-spacing: .1em;
  white-space: nowrap;   /* 同 quick-nav：只给 left:50% 时可用宽度只剩半屏，不加会折行 */
  box-shadow: 0 0 22px #3d8ede88, 0 5px 0 var(--sheikah-x), 0 10px 20px #000000aa;
  cursor: pointer;
  animation: bounce 1.7s steps(2) infinite;
}
.enter-button:active { transform: translateX(-50%) translateY(3px); box-shadow: 0 2px 0 var(--sheikah-x), 0 5px 10px #00000077; }
.enter-button b { font-size: 15px; color: var(--tri-l); }
@keyframes bounce { 0%,100% { transform: translateX(-50%) translateY(0) } 50% { transform: translateX(-50%) translateY(-5px) } }

/* 底部依次让位给快捷导航（约 57px 高） */
.start-note {
  position: absolute; z-index: 3; left: 0; right: 0;
  bottom: calc(66px + env(safe-area-inset-bottom));
  margin: 0; text-align: center; color: var(--muted);
  font-size: 10px; letter-spacing: .14em;
}

/* ===== 滚动 HUD ===== */
/* 隐藏态必须用 visibility，不能只靠 translateY：
   sticky 元素的常规流位置在首屏之下，translateY(-100%) 只抬自身高度，首屏底部仍会露出。 */
.game-hud {
  position: sticky; z-index: 5; top: 0;
  display: flex; justify-content: space-between; align-items: center;
  margin: 0 14px; padding: 9px 12px; gap: 8px;
  background: #08152bee; backdrop-filter: blur(8px);
  border: 2px solid var(--sheikah); border-bottom-width: 3px;
  border-radius: 0 0 3px 3px;
  box-shadow: 0 0 16px #3d8ede44;
  transform: translateY(-100%);
  visibility: hidden;
  transition: transform .35s ease, visibility .35s;
}
.game-hud.visible { transform: translateY(0); visibility: visible; }
.hud-order { display: flex; flex-direction: column; gap: 2px; }
.hud-order small { color: var(--muted); font: 900 8px/1 "Courier New", monospace; letter-spacing: .14em; }
.hud-order b { color: var(--cream); font: 900 11px/1 sans-serif; }
.hud-score { display: flex; align-items: center; gap: 5px; }
.hud-score span { color: var(--tri); font-size: 13px; }
.hud-score b { color: var(--tri-l); font: 900 14px/1 "Courier New", monospace; }
.hud-score small { color: var(--muted); font: 900 8px/1 "Courier New", monospace; letter-spacing: .1em; }

/* ===== 通用 section ===== */
.story-section {
  position: relative; padding: 36px 20px 28px;
}
/* 希卡电路分隔带：深蓝底 + 青色主干线 + 金节点（用伪元素，避免被各 section 的 background 盖掉） */
.story-section::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 8px; z-index: 2;
  background:
    repeating-linear-gradient(90deg,
      transparent 0 3px,
      var(--tri) 3px 5px,
      transparent 5px 26px),
    linear-gradient(180deg, var(--sheikah) 0 2px, var(--night-d) 2px 6px, var(--sheikah-d) 6px 7px, var(--night-d) 7px);
}
.section-title { display: flex; align-items: center; gap: 13px; margin: 0 0 18px; color: var(--cream); }
/* 序号徽记：菱形切角 + 青色发光，呼应希卡几何纹 */
.section-title span {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; flex-shrink: 0;
  background: linear-gradient(180deg, var(--sheikah) 0%, var(--sheikah-d) 100%);
  color: var(--tri-l);
  border: 2px solid var(--tri);
  border-radius: 3px;
  font: 900 15px/1 sans-serif;
  box-shadow: 0 0 16px #3d8ede77, inset 0 0 10px #0a1a33;
  -webkit-font-smoothing: none;
}
.section-title div p { margin: 0 0 3px; color: var(--cyan); font: 900 9px/1 "Courier New", monospace; letter-spacing: .18em; }
.section-title h2 {
  margin: 0;
  font: 900 19px/1.15 "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  letter-spacing: .08em; color: var(--cream);
  -webkit-font-smoothing: antialiased;
}
.section-title.light span { background: linear-gradient(180deg, var(--tri) 0%, var(--tri-d) 100%); color: var(--night-d); box-shadow: 0 0 18px #e9c14a66; }

/* 渐入动画 */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s ease; }
.reveal.show { opacity: 1; transform: translateY(0); }

/* ===== ② 接单 · 希卡石板委托 ===== */
.briefing { background: radial-gradient(circle at 50% 0%, #1c3054 0%, var(--night) 68%); }
.slate-glow {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(circle at 50% 24%, #3d8ede26 0%, transparent 54%);
}
.rune-field {
  position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image:
    radial-gradient(circle, #46d6e899 0 2px, transparent 3px),
    radial-gradient(circle, #e9c14a88 0 1.5px, transparent 2.5px);
  background-position: 18% 60%, 74% 34%;
  background-size: 74px 88px, 108px 116px;
  animation: runeRise 9s linear infinite;
}
@keyframes runeRise {
  from { background-position: 18% 100%, 74% 80%; }
  to   { background-position: 18% -20%, 74% -40%; }
}

/* 羊皮纸委托卡：古文书的米白 + 金角标 + 希卡蓝描边 */
.order-card {
  position: relative;
  padding: 17px 15px 15px; margin-bottom: 20px;
  border: 3px solid var(--sheikah-d);
  border-radius: 3px;
  background:
    repeating-linear-gradient(0deg, #00000000 0 25px, #b99a5f2e 25px 26px),
    linear-gradient(180deg, var(--cream) 0%, var(--parch) 100%);
  color: var(--ink);
  box-shadow: inset 0 0 0 2px var(--tri) , inset 0 0 22px #a97f1622, 0 7px 0 #00000055;
}
/* 四角金三角装饰（纯 CSS，用 conic-gradient 画角标） */
.order-card::after {
  content: ""; position: absolute; inset: 5px; pointer-events: none;
  background:
    linear-gradient(var(--tri-d), var(--tri-d)) left  top    / 16px 2px no-repeat,
    linear-gradient(var(--tri-d), var(--tri-d)) left  top    / 2px 16px no-repeat,
    linear-gradient(var(--tri-d), var(--tri-d)) right top    / 16px 2px no-repeat,
    linear-gradient(var(--tri-d), var(--tri-d)) right top    / 2px 16px no-repeat,
    linear-gradient(var(--tri-d), var(--tri-d)) left  bottom / 16px 2px no-repeat,
    linear-gradient(var(--tri-d), var(--tri-d)) left  bottom / 2px 16px no-repeat,
    linear-gradient(var(--tri-d), var(--tri-d)) right bottom / 16px 2px no-repeat,
    linear-gradient(var(--tri-d), var(--tri-d)) right bottom / 2px 16px no-repeat;
}
.card-top {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 8px; padding-bottom: 7px;
  border-bottom: 2px dashed var(--sheikah-d);
  font: 900 10px/1 "Courier New", monospace; letter-spacing: .12em;
}
.card-top span { color: var(--sheikah-d); }
.card-top b { color: var(--night-d); background: var(--tri); padding: 3px 7px; border-radius: 2px; font-size: 9px; border: 2px solid var(--tri-d); }

.order-card h3 {
  margin: 6px 0 8px;
  font: 900 20px/1.25 "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--sheikah-x); letter-spacing: .06em;
  -webkit-font-smoothing: antialiased;
}
.order-card p { margin: 0 0 12px; font-size: 13px; line-height: 1.7; color: #22304a; }
.order-card dl { margin: 0 0 15px; padding: 0; }
.order-card dl > div {
  display: grid; grid-template-columns: 62px 1fr; gap: 8px;
  padding: 6px 0; border-bottom: 1px dotted #a8895c;
  font: 900 11px/1.3 "Courier New", monospace;
}
.order-card dl > div:last-child { border-bottom: 0; }
.order-card dt { color: var(--sheikah-d); letter-spacing: .12em; }
.order-card dd { margin: 0; color: var(--ink); }

.accept-button {
  display: block; width: 100%;
  padding: 14px;
  border: 3px solid var(--sheikah-x);
  border-radius: 2px;
  background: linear-gradient(180deg, var(--sheikah) 0%, var(--sheikah-d) 100%);
  color: var(--cream); font: 900 15px/1 sans-serif; letter-spacing: .12em;
  box-shadow: 0 4px 0 var(--sheikah-x), inset 0 0 16px #0a1a3366;
  cursor: pointer;
  user-select: none; -webkit-user-select: none;
  touch-action: none;
}
.hold-progress { height: 6px; margin-top: 8px; border: 1px solid var(--sheikah-d); border-radius: 2px; background: #cabf9688; overflow: hidden; }
.hold-progress i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--cyan), var(--tri)); transition: width .1s linear; }

.mission-complete {
  display: none; margin: 0 0 16px; padding: 12px;
  border: 3px solid var(--cyan-d);
  border-radius: 3px;
  background: #07242b; text-align: center; color: var(--cream);
  box-shadow: 0 0 20px #46d6e866;
}
.mission-complete.show { display: block; animation: glowPulse 1.3s steps(2) infinite; }
.mission-complete b { display: block; color: var(--cyan); font: 900 13px/1 "Courier New", monospace; letter-spacing: .16em; margin-bottom: 4px; }
.mission-complete span { font-size: 12px; }
@keyframes glowPulse { 0%,100% { box-shadow: 0 0 14px #46d6e855 } 50% { box-shadow: 0 0 28px #46d6e899 } }

/* 证婚人石板（英帕） */
.sage-stage {
  position: relative; margin: 0 auto 26px; max-width: 360px;
  padding: 14px 14px 14px 106px; min-height: 128px;
  border: 3px solid var(--sheikah-x);
  border-radius: 3px;
  background:
    repeating-linear-gradient(0deg, #00000000 0 21px, #00000030 21px 22px),
    linear-gradient(135deg, var(--slate-d) 0%, #131f33 100%);
  box-shadow: inset 0 0 0 2px var(--sheikah), inset 0 0 26px #3d8ede33, 0 7px 0 #00000055, 0 10px 26px #00000088;
}
.sage-stage img {
  position: absolute; left: -4px; bottom: -8px;
  width: 106px; height: auto;
  filter: drop-shadow(0 4px 0 #0a1424) drop-shadow(0 0 12px #3d8ede66);
  animation: sway 3.6s steps(2) infinite;
}
@keyframes sway { 0%,100% { transform: rotate(-2deg) } 50% { transform: rotate(2deg) } }
.sage-bubble b { display: block; color: var(--tri-l); font: 900 11px/1 "Courier New", monospace; letter-spacing: .16em; margin-bottom: 6px; -webkit-font-smoothing: none; }
.sage-bubble span { font-size: 13px; line-height: 1.6; color: var(--cream); }

/* ===== ③ 限时神庙试炼小游戏 ===== */
.trial-game {
  position: relative;
  margin: 6px -4px 0; padding: 14px 14px 16px;
  border: 3px solid var(--sheikah-x);
  border-radius: 3px;
  /* 底纹：希卡机关石壁 + 神祠橙辉从顶部落下 */
  background:
    repeating-linear-gradient(45deg, #16324f 0 8px, #0e2138 8px 16px),
    linear-gradient(180deg, #0e2138 0%, #060f1c 100%);
  color: var(--cream);
  box-shadow: inset 0 0 0 2px var(--sheikah), inset 0 0 40px #3d8ede22, 0 6px 18px #00000088;
}
.game-console-top {
  display: flex; justify-content: space-between; align-items: flex-end;
  margin-bottom: 10px; padding-bottom: 10px;
  border-bottom: 2px solid var(--sheikah);
}
.game-console-top small { display: block; color: var(--cyan); font: 900 9px/1.2 "Courier New", monospace; letter-spacing: .16em; margin-bottom: 3px; }
.game-console-top b { color: var(--cream); font: 900 14px/1.25 sans-serif; letter-spacing: .05em; }
.game-console-top span { color: var(--tri); font: 900 10px/1 "Courier New", monospace; }
.game-console-top strong { color: var(--cream); font-size: 13px; }

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

.order-ticket {
  display: flex; align-items: center; gap: 8px; margin-bottom: 10px;
  padding: 8px 10px;
  background: var(--cream); color: var(--ink);
  border: 2px solid var(--sheikah-d); border-radius: 2px;
  box-shadow: 3px 4px 0 var(--sheikah-x);
}
.order-ticket.show { display: flex; }
.ticket-tag {
  background: var(--sheikah-d); color: var(--cream);
  padding: 3px 7px; border-radius: 2px;
  font: 900 9px/1.2 "Courier New", monospace; letter-spacing: .12em;
}
.order-ticket b { font: 900 13px/1 sans-serif; letter-spacing: .05em; }
.order-parts { display: flex; gap: 4px; flex-wrap: wrap; }
.order-parts .part-chip {
  width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center;
  background: #f6efdacc; border: 1.5px solid var(--sheikah-d); border-radius: 2px;
  font-size: 14px;
}
.order-parts .part-chip.done { background: var(--leaf); border-color: var(--leaf-d); }
.order-parts .part-chip.current { outline: 2px solid var(--glow); outline-offset: 1px; animation: blink .9s steps(2) infinite; }
@keyframes blink { 0%,100% { opacity: 1 } 50% { opacity: .45 } }

.game-stage {
  position: relative;
  padding: 12px;
  background:
    radial-gradient(ellipse at 50% 0%, #f0a83c2e 0%, transparent 70%),
    linear-gradient(180deg, #04101d 0%, #020812 100%);
  border: 2px solid var(--sheikah-d); border-radius: 2px;
  min-height: 240px;
  overflow: hidden;
}
.game-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
/* 符文块：深色石板上嵌发光符文，契合希卡机关语言 */
.game-tile {
  aspect-ratio: 1 / 1;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px;
  background:
    radial-gradient(circle at 50% 34%, #2a4a72 0%, #12233c 62%, #0a1424 100%);
  border: 2.5px solid var(--sheikah);
  border-radius: 3px;
  box-shadow: 0 4px 0 var(--sheikah-x), inset 0 0 14px #46d6e833;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease;
  user-select: none; -webkit-user-select: none;
  touch-action: manipulation;
}
.game-tile:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--sheikah-x), inset 0 0 18px #46d6e866; }
.game-tile.flash-correct { animation: flashGood .38s ease; }
.game-tile.flash-wrong { animation: flashBad .38s ease; }
@keyframes flashGood {
  0%   { background: radial-gradient(circle, var(--tri-l) 0%, var(--glow) 70%); box-shadow: 0 0 22px var(--glow); }
  100% { background: radial-gradient(circle at 50% 34%, #2a4a72 0%, #12233c 62%, #0a1424 100%); }
}
@keyframes flashBad {
  0%   { background: radial-gradient(circle, #ff8a5c 0%, #a8341a 70%); box-shadow: 0 0 22px #ff6b3d; border-color: #ff8a5c; }
  100% { background: radial-gradient(circle at 50% 34%, #2a4a72 0%, #12233c 62%, #0a1424 100%); }
}

.game-intro, .game-result {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 8px;
  background: #030a14dd; backdrop-filter: blur(4px);
  text-align: center; padding: 20px;
}
.rune-core { width: 46px; height: 46px; object-fit: contain; filter: drop-shadow(0 0 12px var(--glow)); animation: sway 3.6s steps(2) infinite; }
.game-intro h3, .game-result h3 {
  margin: 0; color: var(--tri-l); font: 900 18px/1.25 "PingFang SC", "Microsoft YaHei", sans-serif;
  letter-spacing: .06em; -webkit-font-smoothing: antialiased;
}
.game-intro p, .game-result span { margin: 0; color: var(--cream); font-size: 12px; line-height: 1.7; }
.game-intro button, .game-result button, .submit-button {
  margin-top: 6px; padding: 11px 20px;
  border: 3px solid var(--sheikah-x); border-radius: 2px;
  background: linear-gradient(180deg, var(--sheikah), var(--sheikah-d));
  color: var(--cream); font: 900 13px/1 sans-serif; letter-spacing: .12em;
  box-shadow: 0 4px 0 var(--sheikah-x);
  cursor: pointer;
}
.game-result strong { display: block; margin: 2px 0; color: var(--tri); font: 900 28px/1 "Courier New", monospace; letter-spacing: .04em; -webkit-font-smoothing: none; }
.game-result > span { color: var(--tri-l); font: 900 18px/1 sans-serif; letter-spacing: .1em; margin-bottom: 4px; }
.game-result > b { display: block; padding: 6px 10px; background: var(--glow); color: #2a1400; border-radius: 2px; font-size: 12px; }

.game-legend {
  display: flex; justify-content: space-around;
  margin-top: 10px; padding: 7px 8px;
  background: #03091388; border-radius: 2px;
  font: 900 10px/1 "Courier New", monospace;
}
.game-legend span { color: var(--cream); }
.game-tip { margin: 10px 0 0; text-align: center; color: var(--cyan); font-size: 11px; letter-spacing: .04em; }

/* ===== ④ 英杰来电 ===== */
.crew-section { background: radial-gradient(circle at 50% 0%, #1b2f4e 0%, var(--night) 68%); }
.crew-phone {
  position: relative; padding: 12px 12px 16px;
  border: 3px solid var(--sheikah-x); border-radius: 3px;
  background:
    repeating-linear-gradient(0deg, #00000000 0 21px, #00000022 21px 22px),
    linear-gradient(180deg, var(--slate-d) 0%, #0e1a2c 100%);
  box-shadow: inset 0 0 0 2px var(--sheikah), inset 0 0 30px #3d8ede22, 0 6px 0 #00000055, 0 8px 22px #00000088;
}
.phone-top {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 10px; padding-bottom: 8px;
  border-bottom: 1px dashed var(--cyan); color: var(--sheikah-l);
  font: 900 10px/1 "Courier New", monospace; letter-spacing: .16em;
}
.phone-top b { color: var(--cyan); animation: blink 1.4s steps(2) infinite; }
.crew-slides { position: relative; min-height: 258px; }
.crew-slide {
  display: none; flex-direction: column; align-items: center; text-align: center;
  padding: 8px 4px 0; gap: 10px;
}
.crew-slide.active { display: flex; animation: fadeIn .35s ease; }
@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }
/* 头像框：希卡圆形符文环（金属环 + 发光） */
.crew-photo {
  width: 128px; height: 128px;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle, #2a4a72 0%, #0a1424 100%);
  border: 3px solid var(--tri);
  border-radius: 50%;
  box-shadow: 0 0 20px #3d8ede77, inset 0 0 18px #00000099, 0 4px 0 #00000055;
  overflow: hidden;
}
.crew-photo img { width: 100%; height: 100%; object-fit: cover; }
.crew-name { margin: 0; color: var(--tri-l); font: 900 14px/1 sans-serif; letter-spacing: .1em; }
/* 对话气泡：羊皮纸 + 金色描边 */
.crew-msg {
  margin: 0; padding: 10px 13px;
  background: linear-gradient(180deg, var(--cream) 0%, var(--parch) 100%);
  color: var(--ink); border: 2px solid var(--tri-d); border-radius: 3px;
  font-size: 13px; line-height: 1.7; max-width: 92%;
  box-shadow: 0 3px 0 #00000055;
}

.crew-controls {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 12px; padding: 6px 4px;
}
.crew-controls button {
  width: 42px; height: 42px;
  border: 2px solid var(--sheikah); border-radius: 3px;
  background: #0a1730; color: var(--sheikah-l);
  font: 900 14px/1 sans-serif; cursor: pointer;
  box-shadow: 0 3px 0 var(--sheikah-x);
}
.crew-controls button:active { background: var(--sheikah); color: var(--night-d); }
.crew-controls output { color: var(--cyan); font: 900 11px/1 "Courier New", monospace; letter-spacing: .12em; }

/* ===== ⑤ 婚礼当天日程 ===== */
.schedule-section {
  background: linear-gradient(180deg, #060f1c 0%, #16324f 50%, #060f1c 100%);
  border-top: 0;
}
.scene-screen {
  position: relative; margin: 0 0 18px;
  border: 3px solid var(--sheikah-x); border-radius: 3px;
  overflow: hidden;
  box-shadow: inset 0 0 0 2px var(--sheikah), 0 6px 0 #00000055;
}
.scene-screen img { width: 100%; height: auto; }
/* 状态胶囊靠左放：右上角是固定的音乐坞（约 46px 宽），
   放右侧会被常驻的坞按钮压住一截。 */
.scene-status {
  position: absolute; top: 12px; left: 12px;
  display: flex; align-items: center; gap: 6px;
  padding: 6px 10px; background: var(--sheikah-d); color: var(--cream);
  border: 2px solid var(--tri); border-radius: 2px;
  font: 900 9px/1 "Courier New", monospace; letter-spacing: .1em;
  -webkit-font-smoothing: none;
}
.scene-status i { width: 8px; height: 8px; background: var(--glow); border-radius: 50%; animation: blink 1.2s steps(2) infinite; }

.menu-board {
  padding: 14px 12px 12px;
  border: 3px solid var(--sheikah-x); border-radius: 3px;
  background:
    repeating-linear-gradient(0deg, #00000000 0 25px, #ffffff0d 25px 26px),
    linear-gradient(180deg, #0d1a2c 0%, #060d18 100%);
  color: var(--cream);
  box-shadow: inset 0 0 0 2px var(--sheikah), inset 0 0 30px #3d8ede1f, 0 6px 14px #00000088;
}
.board-title { margin: 0 0 10px; text-align: center; color: var(--cyan); font: 900 11px/1 "Courier New", monospace; letter-spacing: .2em; }
.menu-item {
  display: grid; grid-template-columns: 58px 1fr auto; gap: 10px;
  padding: 9px 8px; border-bottom: 1px dashed #46d6e844;
  font-size: 12px;
}
.menu-item:last-child { border-bottom: 0; }
.menu-item .time { color: var(--tri); font: 900 14px/1 "Courier New", monospace; }
.menu-item h4 {
  margin: 0 0 3px; color: var(--cream);
  font: 900 13px/1.3 "PingFang SC", "Microsoft YaHei", sans-serif;
  letter-spacing: .06em; -webkit-font-smoothing: antialiased;
}
.menu-item p { margin: 0; color: #9db0cc; font-size: 11px; line-height: 1.6; }
.menu-item .stars { color: var(--tri); font: 900 13px/1 sans-serif; letter-spacing: .04em; }
.menu-total {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 8px; padding-top: 8px;
  border-top: 2px solid var(--sheikah);
  font: 900 11px/1 "Courier New", monospace; letter-spacing: .16em;
}
.menu-total span { color: var(--cyan); }
.menu-total b { color: var(--leaf); font-size: 16px; }

.countdown-card {
  display: flex; align-items: baseline; justify-content: center; gap: 8px;
  margin: 20px auto 0; padding: 14px 18px;
  border: 3px solid var(--cyan-d); border-radius: 3px;
  background: #04101d; color: var(--cyan);
  box-shadow: 0 0 20px #46d6e855, inset 0 0 16px #46d6e822;
  width: fit-content;
}
.countdown-card span { font: 900 10px/1 "Courier New", monospace; letter-spacing: .18em; color: var(--cream); }
.countdown-card b { font: 900 36px/1 "Courier New", monospace; color: var(--tri); letter-spacing: .04em; }
.countdown-card small { font: 900 10px/1 "Courier New", monospace; letter-spacing: .18em; color: var(--cream); }

.gift-note {
  margin: 18px 0 0; padding: 10px 14px;
  border-left: 5px solid var(--tri);
  background: var(--night-2);
  border-radius: 0 3px 3px 0;
}
.gift-note b { display: block; color: var(--tri); font: 900 10px/1 "Courier New", monospace; letter-spacing: .18em; margin-bottom: 4px; }
.gift-note span { color: var(--cream); font-size: 12px; line-height: 1.7; }

/* ===== ⑥ 前往城堡镇 ===== */
.arrival { background: radial-gradient(circle at 50% 100%, #173253 0%, var(--night) 70%); }
.map-console {
  position: relative; padding: 22px 18px 18px;
  border: 3px solid var(--cyan-d); border-radius: 3px;
  background: #04101d;
  box-shadow: 0 0 24px #46d6e855, inset 0 0 20px #46d6e822;
  text-align: center;
  overflow: hidden;
}
/* 希卡石板地图作底：低透明度铺底，既点题又不抢正文 */
.map-art {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; opacity: .22; filter: saturate(.75) brightness(.72);
  z-index: 0;
}
/* 内容层统一抬到地图之上；.map-art / .map-grid 单独保持绝对定位 */
.map-console > * { position: relative; z-index: 1; }
.map-grid {
  position: absolute; inset: 8px; pointer-events: none;
  background-image:
    linear-gradient(var(--cyan) 1px, transparent 1px),
    linear-gradient(90deg, var(--cyan) 1px, transparent 1px);
  background-size: 30px 30px;
  opacity: .12; border-radius: 2px; z-index: 0;
}
.map-pulse { position: relative; margin: 0 auto 14px; width: 64px; height: 64px; z-index: 1; }
.map-pulse i, .map-pulse b { position: absolute; inset: 0; margin: auto; border-radius: 50%; }
.map-pulse i { width: 100%; height: 100%; background: var(--glow); opacity: .25; animation: pulseRing 1.6s ease infinite; }
.map-pulse b {
  width: 36px; height: 36px;
  background: linear-gradient(180deg, var(--tri), var(--tri-d)); color: var(--night-d);
  border: 3px solid var(--tri-l);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  box-shadow: 0 0 20px var(--glow);
}
@keyframes pulseRing { 0% { transform: scale(.6); opacity: .5 } 100% { transform: scale(1.3); opacity: 0 } }
.coordinate { margin: 0 0 4px; color: var(--cyan); font: 900 10px/1 "Courier New", monospace; letter-spacing: .2em; }
.map-console h3 {
  margin: 0 0 8px; color: var(--tri-l);
  font: 900 16px/1.35 "PingFang SC", "Microsoft YaHei", sans-serif;
  letter-spacing: .05em; -webkit-font-smoothing: antialiased;
}
.map-console p { margin: 0 0 14px; color: var(--cream); font-size: 12px; line-height: 1.7; }
.map-console a {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 11px 18px; border: 2px solid var(--cyan); border-radius: 2px;
  background: #04101dcc; color: var(--cyan);
  font: 900 12px/1 sans-serif; letter-spacing: .12em;
  text-decoration: none;
}
.map-console a:active { background: var(--cyan); color: #04101d; }

/* ===== ⑦ 旅人报到 ===== */
.rsvp-section { background: linear-gradient(180deg, var(--night) 0%, var(--night-2) 100%); }
.rsvp-phone {
  padding: 14px 14px 16px;
  border: 3px solid var(--sheikah-x); border-radius: 3px;
  background:
    repeating-linear-gradient(0deg, #00000000 0 21px, #00000022 21px 22px),
    linear-gradient(180deg, var(--slate-d) 0%, #0e1a2c 100%);
  box-shadow: inset 0 0 0 2px var(--sheikah), inset 0 0 30px #3d8ede1f, 0 6px 18px #00000066;
}
.app-bar {
  display: flex; align-items: center; gap: 8px; padding-bottom: 8px;
  border-bottom: 1px dashed var(--cyan);
  color: var(--sheikah-l); font: 900 10px/1 "Courier New", monospace; letter-spacing: .16em;
}
.app-bar span { color: var(--glow); font-size: 12px; }
.app-bar small { margin-left: auto; color: var(--leaf); font-size: 9px; letter-spacing: .12em; }
.rsvp-phone form { padding-top: 12px; }
.demo-notice {
  margin: 0 0 14px; padding: 8px 10px;
  background: #00000044; border-left: 3px solid var(--cyan);
  color: var(--sheikah-l); font-size: 11px; line-height: 1.6;
}
.rsvp-phone label { display: block; margin: 0 0 12px; }
.rsvp-phone label > span { display: block; margin-bottom: 5px; color: var(--cream); font-size: 12px; font-weight: 900; letter-spacing: .06em; }
.rsvp-phone label > span b { color: var(--tri); }
.rsvp-phone input, .rsvp-phone select, .rsvp-phone textarea {
  width: 100%; padding: 10px 11px;
  border: 2px solid var(--sheikah-d); border-radius: 2px;
  background: var(--cream); color: var(--ink);
  font-size: 13px; line-height: 1.45; letter-spacing: .02em;
  outline: none;
}
.rsvp-phone input::placeholder, .rsvp-phone textarea::placeholder { color: #8a8154; }
.rsvp-phone input:focus, .rsvp-phone select:focus, .rsvp-phone textarea:focus {
  border-color: var(--sheikah);
  box-shadow: 0 0 0 3px #3d8ede55;
}
.rsvp-phone fieldset { border: 0; padding: 0; margin: 0 0 12px; }
.rsvp-phone legend { padding: 0 0 6px; color: var(--cream); font-size: 12px; font-weight: 900; letter-spacing: .06em; }
.rsvp-phone legend b { color: var(--tri); }
.choice-row { display: flex; gap: 8px; }
.choice-row label {
  flex: 1; margin: 0; padding: 10px;
  border: 2px solid var(--sheikah-d); border-radius: 2px;
  background: var(--cream);
  text-align: center; cursor: pointer;
}
.choice-row input { display: none; }
/* 特异性必须 ≥ `.rsvp-phone label > span`（0,2,1），否则会被它的 color:cream 覆盖，
   未选中的那个选项就变成「米白字 + 米白底」而完全看不见。 */
.rsvp-phone .choice-row label span { display: block; color: var(--ink); font: 900 12px/1 sans-serif; letter-spacing: .06em; }
.rsvp-phone .choice-row label:has(input:checked) { background: var(--leaf); border-color: var(--leaf-d); box-shadow: inset 0 0 0 2px var(--tri-l); }
.rsvp-phone .choice-row label:has(input:checked) span { color: #0b2107; }
.rsvp-phone textarea { resize: vertical; min-height: 70px; font-size: 13px; }
.rsvp-phone label small { display: flex; justify-content: flex-end; margin-top: 3px; color: var(--parch-d); font: 900 10px/1 "Courier New", monospace; }
.rsvp-phone label small output { color: var(--tri-l); }
.form-error {
  margin: 0 0 10px; padding: 8px 10px;
  background: var(--sheikah-x); color: var(--cream); border-radius: 2px;
  font-size: 12px;
}
.submit-button {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 14px;
  border: 3px solid var(--sheikah-x); border-radius: 2px;
  background: linear-gradient(180deg, var(--sheikah), var(--sheikah-d));
  color: var(--cream); font: 900 14px/1 sans-serif; letter-spacing: .12em;
  box-shadow: 0 4px 0 var(--sheikah-x); cursor: pointer;
}
.submit-button:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--sheikah-x); }
.submit-button b { color: var(--tri-l); font-size: 14px; }
.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(--leaf); opacity: .28; animation: pulseRing 1.6s ease infinite; }
.success-radar b {
  width: 38px; height: 38px; border-radius: 3px;
  background: linear-gradient(180deg, var(--tri), var(--tri-d)); color: var(--night-d);
  font: 900 18px/1 sans-serif;
}
.rsvp-success h3, .rsvp-external h3 {
  margin: 0 0 8px; color: var(--tri-l);
  font: 900 16px/1.3 "PingFang SC", "Microsoft YaHei", sans-serif;
  letter-spacing: .06em; -webkit-font-smoothing: antialiased;
}
.rsvp-success p, .rsvp-external p { margin: 0 0 14px; color: var(--cream); font-size: 12px; line-height: 1.7; }
.rsvp-success button {
  padding: 10px 18px; border: 2px solid var(--cyan); border-radius: 2px;
  background: transparent; color: var(--cyan); font: 900 11px/1 sans-serif;
  letter-spacing: .12em; cursor: pointer;
}
.rsvp-external a {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 11px 18px; border: 2px solid var(--leaf); border-radius: 2px;
  color: var(--leaf); text-decoration: none;
  font: 900 12px/1 sans-serif; letter-spacing: .12em;
}

/* ===== ⑧ 结尾 · 海拉鲁见 ===== */
.ending { position: relative; min-height: 340px; overflow: hidden; }
.ending img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 62%; }
.ending-copy {
  position: absolute; left: 18px; right: 18px; bottom: 48px; z-index: 2;
  padding: 15px;
  border: 3px solid var(--sheikah-x); border-radius: 3px;
  background: #050c18e0; backdrop-filter: blur(8px);
  box-shadow: inset 0 0 0 2px var(--sheikah), inset 0 0 24px #3d8ede33, 0 6px 18px #000000aa;
  text-align: center; color: var(--cream);
}
.ending-copy p { margin: 0 0 4px; color: var(--cyan); font: 900 10px/1 "Courier New", monospace; letter-spacing: .2em; }
.ending-copy h2 {
  margin: 6px 0 8px; color: var(--tri-l);
  font: 900 clamp(19px, 5.6vw, 25px)/1.25 "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  letter-spacing: .08em;
  text-shadow: 0 2px 0 var(--tri-d), 0 4px 0 var(--tri-x);
  -webkit-font-smoothing: antialiased;
}
.ending-copy b { display: block; margin: 4px 0; color: var(--cream); font: 900 14px/1.4 "PingFang SC", "Microsoft YaHei", sans-serif; letter-spacing: .06em; -webkit-font-smoothing: antialiased; }
.ending-copy span { color: var(--cyan); font: 900 11px/1 "Courier New", monospace; letter-spacing: .12em; }

footer { padding: 20px 14px 14px; text-align: center; background: var(--night-d); }
.footer-logo {
  display: inline-block; padding: 6px 14px;
  border: 2px solid var(--sheikah); border-radius: 2px;
  color: var(--sheikah-l); background: transparent;
  font: 900 13px/1 "Courier New", monospace; letter-spacing: .16em;
  box-shadow: 0 0 14px #3d8ede44;
}
.footer-logo b { color: var(--tri); }
footer p { margin: 8px 0 0; color: var(--muted); font: 900 9px/1.6 "Courier New", monospace; letter-spacing: .12em; }

/* ===== 底部快捷导航 ===== */
/* 注意：position:fixed 只给 left:50% 时，可用宽度会被砍成半个视口，
   flex 子项被压到 min-content 导致双字标签折行。改用 left/right + margin:auto 居中。 */
.quick-nav {
  position: fixed; z-index: 10;
  left: 0; right: 0; bottom: calc(12px + env(safe-area-inset-bottom));
  width: fit-content;
  max-width: calc(100% - 20px);
  margin-inline: auto;
  display: flex; gap: 4px; padding: 5px;
  border: 2px solid var(--sheikah); border-radius: 3px;
  background: #08152bee; backdrop-filter: blur(8px);
  box-shadow: 0 0 18px #3d8ede55, 0 4px 0 #00000066, 0 6px 16px #00000099;
}
.quick-nav a {
  padding: 8px 12px; border-radius: 2px;
  color: var(--cream); font: 900 11px/1 sans-serif; letter-spacing: .1em;
  text-decoration: none;
  white-space: nowrap;      /* 标签永不折行 */
  flex: none;
}
.quick-nav a:active, .quick-nav a:hover,
.quick-nav a.active { background: var(--sheikah); color: var(--cream); }

/* ===== 音乐坞 ===== */
/* 默认收起为纯图标：常驻展开会遮住右上角的正文内容（390px 屏上占近四成宽度） */
.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;
  background: #08152bdd; backdrop-filter: blur(6px);
  border: 2px solid var(--sheikah); border-radius: 3px;
  box-shadow: 0 0 14px #3d8ede44, 0 3px 0 #00000066;
}
.music-dock p {
  display: none; margin: 0 2px 0 4px;
  color: var(--cream); font: 900 9px/1.3 "Courier New", monospace;
  letter-spacing: .1em; max-width: 96px; -webkit-font-smoothing: none;
}
.music-dock:hover p,
.music-dock:focus-within p,
.music-dock.expanded p { display: block; }
.music-dock button {
  width: 32px; height: 32px;
  border: 2px solid var(--sheikah-x); border-radius: 3px;
  background: linear-gradient(180deg, var(--sheikah), var(--sheikah-d));
  color: var(--tri-l);
  font-size: 14px; cursor: pointer;
  box-shadow: 0 2px 0 var(--sheikah-x);
  flex: none;
}
.music-dock button[aria-pressed="true"] { background: linear-gradient(180deg, var(--tri), var(--tri-d)); color: var(--night-d); box-shadow: 0 2px 0 var(--tri-x); }
.music-dock button:active { transform: translateY(1px); }

/* ===== 极窄屏兜底（375px 及以下）===== */
@media (max-width: 375px) {
  .hero h1 { letter-spacing: .06em; }
  .game-tile { font-size: 25px; }
  .menu-item { grid-template-columns: 52px 1fr auto; gap: 8px; }
  .sage-stage { padding-left: 96px; }
  .sage-stage img { width: 96px; }
}
