/* 首页「飞花令」行书字：简体「志莽行书」的 飞/花/令 + 繁体「芫荽 Iansui」的 飛（均 SIL OFL 1.1 开源可商用）。
   几何统一：墨迹高 860/1000em、墨迹中线 440、每字左右边距各 100（相邻字净间距恒为 200/1000em）；
   仅对偏细的「飛」做 16/1000em 加粗补偿；内嵌 WOFF2 约 2KB，不依赖系统字体 */
@font-face {
  font-family: "FeihuaKai";
  src: url(data:font/woff2;base64,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) format("woff2");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}





/* ===========================================================
   飞花令 · 水墨诗词闯关  样式表
   移动端优先，适配不同规格手机屏幕
   =========================================================== */
*,
*::before,
*::after { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

:root {
  --paper: #f7f4ed;
  --paper-2: #fffdf8;
  --ink: #1f1d1a;
  --ink-soft: #5a564e;
  --ink-faint: #948d80;
  --cinnabar: #a8342a;
  --cinnabar-soft: rgba(168, 52, 42, .12);
  --line: rgba(31, 29, 26, .18);
  --shadow: 0 2px 10px rgba(40, 32, 20, .07);
  --radius: 10px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

html, body {
  height: 100%;
  background: var(--paper);
  color: var(--ink);
  font-family: "Songti SC", "STSong", "SimSun", "Noto Serif SC", serif;
  overflow: hidden;
  -webkit-user-select: none; user-select: none;
}

#inkBg {
  position: fixed; inset: 0; z-index: 0;
  width: 100%; height: 100%;
  pointer-events: none; opacity: .95;
}
.ink-scene { animation: inkFade 1.5s ease both; }
@keyframes inkFade { from { opacity: 0; } to { opacity: 1; } }

/* ---------------- 通用按钮 ---------------- */
.primary-btn {
  appearance: none; border: none; cursor: pointer;
  background: var(--ink); color: var(--paper-2);
  font-family: inherit; font-size: 17px; letter-spacing: 3px;
  padding: 13px 34px; border-radius: 8px; transition: transform .12s, opacity .2s;
}
.primary-btn:active { transform: scale(.97); opacity: .85; }
.primary-btn:disabled { background: #cbc3b4; cursor: default; }

.ghost-btn {
  appearance: none; cursor: pointer; background: transparent;
  border: 1px solid var(--cinnabar); color: var(--cinnabar);
  font-family: inherit; font-size: 15px; letter-spacing: 3px;
  padding: 10px 30px; border-radius: 8px; transition: background .15s, color .15s;
}
.ghost-btn:active { background: var(--cinnabar); color: #fff; }

.home-btn {
  position: fixed; top: calc(12px + var(--safe-top)); left: 12px; z-index: 60;
  width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid var(--line); background: rgba(255, 253, 248, .82);
  color: var(--ink); font-size: 26px; line-height: 1; cursor: pointer;
  display: none; align-items: center; justify-content: center;
  font-family: inherit; box-shadow: var(--shadow); backdrop-filter: blur(4px);
}
.home-btn.show { display: flex; }
.home-btn .home-bullet { display: block; line-height: 1; transform: translateY(-2px); }

/* 背景音乐开关：常驻左侧（首页：音乐 / 简繁 竖排；答题页：返回 / 音乐 / 简繁 竖排） */
.sound-btn {
  position: fixed; top: calc(12px + var(--safe-top)); left: 12px; z-index: 60;
  width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid var(--line); background: rgba(255, 253, 248, .82);
  color: var(--ink); font-size: 18px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-family: inherit; box-shadow: var(--shadow); backdrop-filter: blur(4px);
  transition: opacity .2s, color .2s;
}
.sound-btn:active { background: var(--ink); color: #fff; }
/* 简繁切换按钮：常驻左侧，排在音乐按钮下面 */
.lang-btn {
  position: fixed; top: calc(58px + var(--safe-top)); left: 12px; z-index: 60;
  width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid var(--line); background: rgba(255, 253, 248, .82);
  color: var(--ink); font-size: 15px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-family: inherit; box-shadow: var(--shadow); backdrop-filter: blur(4px);
}
.lang-btn:active { background: var(--ink); color: #fff; }
/* 答题页：返回按钮在最上，往下依次是背景音乐、简繁切换，形成左侧竖排 */
.sound-btn.game-layout { top: calc(58px + var(--safe-top)); }
.lang-btn.game-layout { top: calc(104px + var(--safe-top)); }

.sound-btn.off { color: var(--ink-faint); opacity: .55; text-decoration: line-through; }
/* 自动播放被浏览器拦截时：朱红脉冲，提示「点一下就有音乐」 */
.sound-btn.pending {
  color: var(--cinnabar); border-color: var(--cinnabar);
  animation: soundPulse 1.6s ease-in-out infinite;
}
@keyframes soundPulse {
  0%, 100% { transform: scale(1); box-shadow: var(--shadow); }
  50% { transform: scale(1.12); box-shadow: 0 0 0 7px rgba(168, 52, 42, .13); }
}
.home-btn:active { background: var(--ink); color: #fff; }

/* ---------------- 游戏主界面 ---------------- */
.app[hidden] { display: none !important; }

/* 答题页：中段完全不压色，让水墨全强度透出；只在顶部 HUD 与底部进度条两条窄带局部压纸色 */
.app::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(180deg,
    rgba(247, 244, 237, .88) 0%,
    rgba(247, 244, 237, .40) 6%,
    rgba(247, 244, 237, 0) 15%,
    rgba(247, 244, 237, 0) 85%,
    rgba(247, 244, 237, .38) 94%,
    rgba(247, 244, 237, .62) 100%);
}   /* 修复：display:flex 覆盖 hidden，导致切回首页透出答题页 */

.app {
  position: relative; z-index: 10;
  height: 100%; max-width: 560px; margin: 0 auto;
  display: flex; flex-direction: column;
  padding: calc(12px + var(--safe-top)) 16px calc(12px + var(--safe-bottom));
}

.hud {
  display: flex; flex-direction: column; gap: 0;
  font-size: 13px; color: var(--ink-soft);
  padding-bottom: 8px;
  padding-left: 0;
}
.hud-top {
  min-height: 42px; margin-left: 46px; margin-right: 46px;
  display: flex; align-items: center; justify-content: center;
  border-bottom: 1px solid var(--cinnabar-soft);
}
.hud .level { color: var(--ink-faint); font-size: 12px; letter-spacing: 2px; }
.hud .combo { color: var(--cinnabar); font-size: 12px; height: 15px; text-align: center; }
.hud .score { font-weight: 400; color: var(--ink-faint); font-size: 12px; min-width: auto; text-align: center; font-variant-numeric: tabular-nums; }
.hud-energy { min-height: 38px; margin-top: 6px; margin-left: 46px; display: flex; align-items: center; justify-content: flex-start; }
.hud-energy .hud-meta { margin-left: 12px; display: flex; align-items: center; gap: 10px; }
.energy-wrap { display: flex; align-items: center; gap: 4px; color: var(--cinnabar); }
.energy-label { color: var(--ink-faint); font-size: 11px; letter-spacing: 0; }
.hud .hp { letter-spacing: 1px; color: var(--cinnabar); font-size: 13px; min-width: auto; line-height: 1; }
.hud .hp .heart { transition: opacity .3s, transform .3s; display: inline-block; }
.hud .hp .heart.half {
  background: linear-gradient(90deg, var(--cinnabar) 50%, rgba(168, 52, 42, .18) 50%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hud .hp .heart.lost { opacity: .18; transform: scale(.8); }

.ling-area { text-align: center; padding: 26px 0 6px; position: relative; }
.ling-label { font-size: 12px; color: var(--ink-faint); letter-spacing: 5px; }
.ling-char {
  font-size: 56px; font-weight: 700; color: var(--ink); line-height: 1.1;
  margin-top: 2px; position: relative; display: inline-block;
}
.timer { font-size: 13px; color: var(--ink-faint); margin-top: 8px; letter-spacing: 1px; font-variant-numeric: tabular-nums; }
.timer.warn { color: var(--cinnabar); font-weight: 700; }

/* 拼句区 */
.board {
  margin-top: 12px; padding: 10px;
  min-height: 76px; max-height: 30vh; overflow-y: auto;
  border: 1px dashed rgba(168, 52, 42, .3); border-radius: var(--radius);
  background: rgba(255, 253, 248, .6);
  display: flex; flex-direction: column; gap: 8px;
}
.board-row {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
  min-height: 34px; padding: 4px 8px; border-radius: 6px;
  border-left: 2px dashed #d9d0bf; transition: border-color .2s, background .2s;
}
.board-row.active { border-left-color: var(--cinnabar); background: rgba(168, 52, 42, .05); }
.board-row.done { border-left-style: solid; border-left-color: var(--cinnabar); background: rgba(255, 255, 255, .55); }

.slot {
  min-width: 34px; height: 30px; padding: 0 4px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 5px; font-size: 16px;
}
.slot.empty {
  min-width: 42px; border: 1px dashed #d3cabb;
  background: rgba(255, 255, 255, .35);
  gap: 3px;
}
.slot.empty i {
  display: inline-block; width: 5px; height: 5px; border-radius: 50%;
  background: #c9c0af;
}
.slot.filled {
  border: 1px solid var(--ink); background: rgba(255, 255, 255, .9); cursor: pointer;
}
.slot.filled:active { background: var(--ink); color: #fff; }

.hint-bar {
  margin-top: 0; padding: 0 12px; max-height: 0; overflow: hidden; opacity: 0;
  border-left: 3px solid var(--cinnabar); border-radius: 0 6px 6px 0;
  background: var(--cinnabar-soft); color: var(--cinnabar);
  font-size: 14px; line-height: 1.55;
  transition: opacity .4s, max-height .4s, padding .4s, margin .4s;
}
.hint-bar.show { opacity: 1; max-height: 140px; padding: 9px 12px; margin-top: 8px; }

.actions { display: flex; gap: 10px; margin-top: 10px; }
.confirm-btn {
  flex: 1; padding: 13px;
  border: none; border-radius: 8px; cursor: pointer;
  background: var(--ink); color: #fff;
  font-family: inherit; font-size: 16px; letter-spacing: 4px;
  transition: opacity .2s, transform .12s;
}
.confirm-btn:active { transform: scale(.985); }
.confirm-btn:disabled { background: #cbc3b4; letter-spacing: 6px; }

.clear-btn {
  padding: 13px 18px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--line); background: transparent; color: var(--ink-soft);
  font-family: inherit; font-size: 14px; letter-spacing: 2px;
  transition: background .15s, color .15s, transform .12s;
}
.clear-btn:active { transform: scale(.96); background: var(--ink-soft); color: #fff; }

/* 碎片区 */
.pool {
  flex: 1; margin-top: 12px; padding-top: 4px;
  display: flex; flex-wrap: wrap; gap: 8px; align-content: flex-start;
  overflow-y: auto; justify-content: center; align-content: center;
}
.frag {
  padding: 9px 14px; font-size: 16px; cursor: pointer;
  border: 1px solid var(--ink); border-radius: 6px;
  background: rgba(255, 255, 255, .88); color: var(--ink);
  transition: transform .12s, background .15s, opacity .2s;
  box-shadow: 0 1px 3px rgba(40, 32, 20, .05);
}
.frag:active { transform: scale(.94); }
.frag.used { opacity: .25; pointer-events: none; }
.frag.wrong { animation: shake .4s; border-color: var(--cinnabar); }
@keyframes shake {
  0%,100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

/* 玩法说明：小字淡色，两行，不抢选项风头 */
.howto-title {
  text-align: center; font-size: 11px; line-height: 1.4;
  color: var(--ink-faint); opacity: .62; letter-spacing: 2px;
  padding-top: 8px; margin-top: 2px;
}
.howto {
  text-align: center; font-size: 11.5px; line-height: 1.7;
  color: var(--ink-faint); opacity: .75; letter-spacing: .5px;
  padding: 2px 6px 2px; margin-top: 0;
}
.howto span { display: block; }

.progress { text-align: center; font-size: 12px; color: var(--ink-faint); letter-spacing: 2px; padding-top: 8px; }

/* ---------------- 全屏层 ---------------- */
.screen {
  position: fixed; inset: 0; z-index: 40;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: calc(24px + var(--safe-top)) 24px calc(24px + var(--safe-bottom));
  background: transparent;   /* 水墨背景自带上纸色，首页不再叠加一层纸，避免把画压淡 */
  text-align: center;
}
.screen[hidden] { display: none; }

.brand-title {
  margin: 0 0 26px; line-height: 1.06;
  /* 简体用内嵌「志莽行书」子集，缺失时回退系统行楷/楷体 */
  font-family: "FeihuaKai", "STXingkai", "华文行楷", "Xingkai SC", "行楷",
               "Kaiti SC", "STKaiti", "KaiTi", "楷体", "Songti SC", serif;
  font-size: clamp(44px, 13.4vw, 66px);
  font-weight: 400;
  letter-spacing: 0;          /* 字间距已写入字库步进，保证三字净间距一致 */
  color: var(--ink);
  -webkit-text-stroke: .85px var(--ink);          /* 加粗笔锋：贴合参考图的厚度 */
  text-shadow: 0 0 .4px currentColor, 0 1px 10px rgba(247, 244, 237, .95), 0 0 22px rgba(247, 244, 237, .8);
}
.screen.start .brand { transform: translateY(-44px); }   /* 标题整体上移 20px，拉开与下方文字的距离 */
/* 页脚两行：以「·」为居中锚点（grid 1fr auto 1fr），左右间距由 column-gap 统一 */
.foot-line {
  position: absolute; left: 0; right: 0;
  display: grid; grid-template-columns: 1fr auto 1fr;
  column-gap: .5em; align-items: baseline; justify-items: stretch;
  font-size: 12px; color: var(--ink-faint); letter-spacing: 3px;
}
.foot-line .fl { justify-self: end; }
.foot-line .fr { justify-self: start; }
.foot-line .dot { color: var(--cinnabar); opacity: .8; letter-spacing: 0; }
.ai-note { bottom: calc(42px + var(--safe-bottom)); }
.start-foot { bottom: calc(20px + var(--safe-bottom)); }
.brand .sub { font-size: 14px; letter-spacing: 6px; color: var(--ink-soft); margin-bottom: 6px; }
.brand .tagline { font-size: 13px; color: var(--ink-faint); letter-spacing: 2px; margin-bottom: 10px; }
/* 「传播中国传统文化」：点睛一句，做成朱红小字 */
.brand .mission {
  font-size: 15px; color: var(--cinnabar); letter-spacing: 6px;
  margin-bottom: 30px; padding-bottom: 10px;
  border-bottom: 1px solid rgba(168, 52, 42, .25);
}
.brand { display: flex; flex-direction: column; align-items: center; }
/* 文字外发光：压住背后的墨色提高对比，又不会形成可见的圆形色块 */
.brand h1, .brand .sub, .brand .tagline, .start-foot, .hud, .progress {
  text-shadow: 0 1px 10px rgba(247, 244, 237, .95), 0 0 22px rgba(247, 244, 237, .8);
}
.brand .primary-btn { margin-bottom: 14px; }
/* 浏览器拦截自动播放时的提示：告诉用户点一下就有音乐 */
.audio-hint {
  /* 位置由下方统一抬高，给「全AI实现」说明行让位 */
  position: absolute; bottom: calc(66px + var(--safe-bottom));
  font-size: 13px; color: var(--cinnabar); letter-spacing: 1px;
  padding: 7px 16px; border-radius: 999px;
  border: 1px solid rgba(168, 52, 42, .3); background: rgba(255, 253, 248, .8);
  animation: soundPulse 2s ease-in-out infinite;
}
.audio-hint[hidden] { display: none; }

.levelselect h2 { font-size: 24px; letter-spacing: 6px; font-weight: 400; margin-bottom: 22px; }
.level-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
  width: 100%; max-width: 420px; margin-bottom: 26px;
}
.level-cell {
  aspect-ratio: 1 / 1; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--line); background: rgba(255, 253, 248, .8);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  font-family: inherit; color: var(--ink); transition: transform .12s, border-color .2s;
}
.level-cell:active { transform: scale(.95); border-color: var(--cinnabar); }
.level-cell .num { font-size: 20px; }
.level-cell .ling { font-size: 12px; color: var(--ink-faint); letter-spacing: 1px; }
.level-cell.locked { opacity: .4; pointer-events: none; }

/* 典故小卡 / 结算 */
.overlay {
  position: fixed; inset: 0; z-index: 70;
  display: flex; align-items: center; justify-content: center;
  padding: calc(24px + var(--safe-top)) 22px calc(24px + var(--safe-bottom));
  background: rgba(31, 29, 26, .22); backdrop-filter: blur(2px);
  animation: fadeIn .25s;
}
.overlay[hidden] { display: none; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.card {
  width: 100%; max-width: 400px; max-height: 86vh; overflow-y: auto;
  background: var(--paper-2); border-radius: 14px; box-shadow: 0 12px 40px rgba(30, 24, 16, .22);
  padding: 30px 26px; text-align: center;
  animation: popIn .28s cubic-bezier(.2, .9, .3, 1.3);
}
@keyframes popIn { from { transform: scale(.92); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.card-source { font-size: 12px; color: var(--ink-faint); letter-spacing: 1px; margin-bottom: 14px; }
.card-poem { font-size: 21px; line-height: 1.9; color: var(--ink); margin-bottom: 16px; }
.card-pinyin {
  font-family: "Times New Roman", Georgia, serif;
  font-size: 13px; line-height: 1.7; letter-spacing: .5px;
  color: var(--ink-faint); padding: 0 6px; margin: -8px 0 12px;
}
.card-notes { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.py-chip {
  font-size: 12.5px; line-height: 1.5; text-align: left;
  padding: 7px 10px; border-radius: 8px;
  border: 1px solid rgba(168, 52, 42, .22); background: rgba(255, 255, 255, .6);
  color: var(--ink-soft);
}
.py-chip b { color: var(--cinnabar); font-size: 14px; margin-right: 2px; }
.py-chip em { display: block; font-style: normal; color: var(--ink-faint); margin-top: 2px; }

.card-poem .ling-mark { font-style: normal; color: var(--cinnabar); font-weight: 700; }

.card-explain {
  font-size: 14px; line-height: 1.75; color: var(--ink-soft);
  padding: 10px 14px; border-radius: 8px; background: rgba(43, 43, 40, .05);
  margin-bottom: 12px; text-align: left;
}
.card-note {
  font-size: 14px; line-height: 1.7; color: var(--cinnabar);
  padding: 10px 14px; border-radius: 8px; background: var(--cinnabar-soft);
  margin-bottom: 14px;
}
.card-story { font-size: 13.5px; line-height: 1.75; color: var(--ink-soft); margin-bottom: 24px; }

.result-card h2 { font-size: 24px; letter-spacing: 4px; font-weight: 400; margin-bottom: 14px; }
.stars { font-size: 34px; letter-spacing: 8px; color: #cfc6b5; margin-bottom: 18px; }
.stars .on { color: var(--cinnabar); }
.result-stat .heal-note { color: var(--cinnabar); font-size: 13px; }
.result-stat { font-size: 14px; line-height: 1.9; color: var(--ink-soft); margin-bottom: 24px; font-variant-numeric: tabular-nums; }
.result-btns { display: flex; flex-direction: column; gap: 10px; align-items: center; }

/* Toast */
.toast {
  /* 位置由居中改为靠上，落在 HUD 与「令」字之间的空隙里：
     既不压典故小卡的「释义」，也不挡正在看的令字 */
  position: fixed; left: 50%; top: calc(8% + var(--safe-top)); z-index: 90;
  transform: translate(-50%, -50%) scale(.94);
  padding: 11px 26px; border-radius: 10px; max-width: 78%;
  background: rgba(31, 29, 26, .58); color: rgba(255, 255, 255, .88);
  font-size: 16px; text-align: center; letter-spacing: 1px;
  backdrop-filter: blur(3px);
  opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s;
}
.toast.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
/* 判对：淡朱红 + 半透明，文字也相应减淡，不抢释义的注意力 */
.toast.correct { background: rgba(168, 52, 42, .42); color: rgba(255, 252, 248, .92); }
.toast.wrong { background: rgba(58, 54, 48, .48); color: rgba(255, 255, 255, .86); }

/* 飞花特效 */
.petal-layer { position: fixed; inset: 0; z-index: 65; pointer-events: none; overflow: hidden; }
.petal {
  position: absolute; top: -24px; width: 11px; height: 11px;
  background: var(--cinnabar); opacity: .72;
  border-radius: 50% 0 50% 50%; transform: rotate(45deg);
  animation: petalFall linear forwards;
}
/* 连击奖励：金红双色花瓣 + 放大，形成明显庆祝感 */
.petal.gold { background: #c9971f; opacity: .85; width: 14px; height: 14px; }
@keyframes petalFall {
  0% { transform: translateY(0) rotate(0) scale(1); opacity: .85; }
  100% { transform: translateY(112vh) rotate(420deg) scale(.6); opacity: 0; }
}

/* 首页飞花：柔粉/淡金花瓣，飘落时左右摇曳、自身旋转，营造「飞花令」的意境 */
.petal-layer.home-layer { z-index: 30; }   /* 首页花瓣压在标题按钮之下、水墨之上 */
.petal.home {
  width: 15px; height: 15px; opacity: .92;
  background: radial-gradient(circle at 30% 28%, #fff7f3 0%, #f2c7c2 44%, #dfa09a 100%);
  border-radius: 62% 38% 60% 40% / 56% 62% 38% 44%;
  box-shadow: 0 0 6px rgba(206, 132, 126, .32);
  animation-name: petalDrift;
  will-change: transform, opacity;
}
.petal.home.pale { background: radial-gradient(circle at 32% 28%, #fffaf6 0%, #f7ded2 46%, #e7b8a4 100%); }
.petal.home.gold { background: radial-gradient(circle at 32% 26%, #fffbf0 0%, #f1ddaa 45%, #d9b967 100%); box-shadow: 0 0 7px rgba(196, 158, 76, .38); }
@keyframes petalDrift {
  0%   { transform: translate3d(0, -4vh, 0) rotate(0deg) scale(.92); opacity: 0; }
  10%  { opacity: .92; }
  45%  { transform: translate3d(22px, 52vh, 0) rotate(200deg) scale(1.04); }
  100% { transform: translate3d(-18px, 116vh, 0) rotate(430deg) scale(.84); opacity: 0; }
}

/* 五连击奖励：金笺印纹 + 飞花字样 + 补血提示 */
.combo-burst {
  position: fixed; inset: 0; z-index: 88; pointer-events: none;
  display: grid; place-items: center;
  background: radial-gradient(circle at 50% 47%, rgba(201, 151, 31, .14), rgba(201, 151, 31, 0) 43%);
}
.combo-burst[hidden] { display: none; }
.combo-burst-card {
  width: min(78vw, 340px); padding: 24px 22px 21px;
  border: 1px solid rgba(169, 120, 36, .52); border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(255, 253, 247, .96), rgba(247, 238, 217, .93)),
    repeating-linear-gradient(45deg, rgba(176, 132, 48, .08) 0 2px, transparent 2px 8px);
  box-shadow: 0 18px 58px rgba(66, 48, 19, .20), inset 0 0 0 5px rgba(201, 151, 31, .07);
  text-align: center; color: var(--ink);
  opacity: 0; transform: scale(.76) rotate(-2deg);
}
.combo-burst.show .combo-burst-card { animation: comboBurstIn 2.55s cubic-bezier(.19, 1, .22, 1) both; }
.combo-burst-seal {
  display: inline-block; padding: 3px 12px 4px; margin-bottom: 6px;
  border: 1px solid rgba(168, 52, 42, .72); border-radius: 999px;
  color: var(--cinnabar); font-size: 12px; letter-spacing: 4px;
}
.combo-burst-main { line-height: 1; white-space: nowrap; }
.combo-burst-main b { color: #9a6c1f; font-size: clamp(48px, 15vw, 64px); font-weight: 700; letter-spacing: 2px; }
.combo-burst-main span { margin-left: 7px; color: var(--ink); font-size: 21px; letter-spacing: 5px; }
.combo-burst-rule { width: 62px; height: 1px; margin: 12px auto 9px; background: linear-gradient(90deg, transparent, #b8892f, transparent); }
.combo-burst-reward { color: var(--cinnabar); font-size: 15px; letter-spacing: 2px; }
@keyframes comboBurstIn {
  0% { opacity: 0; transform: scale(.76) rotate(-2deg); }
  12% { opacity: 1; transform: scale(1.06) rotate(.7deg); }
  22% { transform: scale(1) rotate(0); }
  76% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: translateY(-18px) scale(.98); }
}

@media (prefers-reduced-motion: reduce) {
  .combo-burst.show .combo-burst-card { animation-duration: 1.2s; }
  .petal { animation-duration: 1.2s !important; }
}

@media (max-height: 680px) {
  .ling-char { font-size: 46px; }
  .ling-area { padding: 16px 0 4px; }
  .brand-title { font-size: 48px; letter-spacing: 10px; -webkit-text-stroke: .7px var(--ink); }
}
@media (min-width: 620px) {
  .app { padding-left: 24px; padding-right: 24px; }
}
