/* OWProject — 东方Project 风格 UI */
:root {
  --bg: #0b0a12;
  --panel: #12101c;
  --panel2: #1a1628;
  --border: #5c4a2e;
  --border-lite: #8a7348;
  --gold: #d4b56a;           /* rgb(212, 181, 106) — 唯一主金色 */
  --gold2: #f0d78c;
  --text: #f2e6c8;
  --muted: #9a8b6e;
  --accent: #e8c878;
  --accent2: #c45c8a;
  --hi: #ff6b8a;
  --sc: #ffe08a;
  --warn: #fbbf24;
  --danger: #f87171;
  --font: "Segoe UI", "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", system-ui, sans-serif;
  --title-font: "Yu Mincho", "Hiragino Mincho ProN", "Noto Serif JP", "MS Mincho", "MingLiU", "PMingLiU", serif;
  --display-font: "Aptos Display", "Trebuchet MS", "Yu Gothic", "Microsoft JhengHei", sans-serif;
  --serif: "Songti SC", "SimSun", "Noto Serif SC", "Times New Roman", serif;
  --mono: "Cascadia Code", "Consolas", "Courier New", monospace;

  /* 键盘/菜单焦点描边（禁止再写 #d4af37 / 212,175,55 等漂移金） */
  --focus-border: var(--gold);
  --focus-bg: rgba(40, 32, 16, 0.75);
  --focus-bg-soft: rgba(40, 32, 16, 0.55);
  --focus-ring: rgba(212, 181, 106, 0.25);
  --focus-ring-soft: rgba(212, 181, 106, 0.18);
  --focus-outline: rgba(212, 181, 106, 0.45);
  --focus-glow: rgba(212, 181, 106, 0.15);
  --focus-glow-mid: rgba(212, 181, 106, 0.22);
  --focus-glow-strong: rgba(232, 200, 120, 0.35);
  --focus-border-soft: rgba(212, 181, 106, 0.22);
  --focus-border-mid: rgba(212, 181, 106, 0.28);
}
.selection-focus-band {
  background: linear-gradient(90deg, transparent, rgba(13, 9, 24, .55) 25%, rgba(13, 9, 24, .55) 75%, transparent);
  pointer-events: none;
}
.selection-band-hidden { visibility: hidden !important; }
.selection-transition-band {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 1;
  width: var(--selection-transition-width, min(78vw, 780px));
  height: var(--selection-transition-height, 210px);
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.selection-transition-band > div {
  width: 100%; height: 100%; transform-origin: center;
  background: linear-gradient(90deg, transparent, rgba(13,9,24,.55) 25%, rgba(13,9,24,.55) 75%, transparent);
}
.selection-transition-backdrop {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: linear-gradient(rgba(13,9,24,.24),rgba(13,9,24,.24)), #302432 url('../assets/bg/difficulty-cathedral.avif') center / cover no-repeat;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  width: 100%; height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  overflow: hidden;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
/* 表单控件允许选择/输入（覆盖 body user-select） */
input, select, textarea {
  user-select: text;
  -webkit-user-select: text;
}

#app { width: 100%; height: 100%; height: 100dvh; position: relative; }

/* ===== 加载界面 ===== */
#load-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: #242322;
  background: #e9e0ce;
  transition: opacity 0.55s cubic-bezier(0.23, 1, 0.32, 1), visibility 0s linear 0.55s;
}
#load-screen.done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
#load-screen[aria-busy="false"] .load-now,
#load-screen[aria-busy="false"] .load-pray { display: none; }
.load-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-color: #e9e0ce;
  background-image:
    radial-gradient(ellipse at 12% 16%, rgba(164, 61, 67, 0.2) 0 9%, transparent 30%),
    radial-gradient(ellipse at 84% 15%, rgba(62, 126, 145, 0.18) 0 10%, transparent 28%),
    linear-gradient(124deg, transparent 0 30%, rgba(196, 152, 64, 0.16) 30.2% 30.7%, transparent 31%),
    repeating-linear-gradient(0deg, rgba(36, 35, 34, 0.035) 0 1px, transparent 1px 5px),
    repeating-linear-gradient(91deg, transparent 0 47px, rgba(36, 35, 34, 0.045) 48px, transparent 49px 96px);
}
.load-bg::before,
.load-bg::after {
  content: "";
  position: absolute;
  pointer-events: none;
}
.load-bg::before {
  inset: -18% -8%;
  opacity: 0.5;
  background: repeating-linear-gradient(151deg, transparent 0 58px, rgba(164, 61, 67, 0.11) 59px 62px, transparent 63px 116px);
  transform: rotate(-5deg);
}
.load-bg::after {
  right: -8vw;
  bottom: -14vh;
  width: 62vw;
  height: 42vh;
  background: rgba(62, 126, 145, 0.12);
  clip-path: polygon(9% 22%, 72% 0, 100% 31%, 88% 78%, 46% 100%, 0 71%);
  transform: rotate(-9deg);
}
.load-sheet {
  position: relative;
  z-index: 1;
  width: min(980px, calc(100vw - 72px));
  min-height: min(520px, calc(100dvh - 96px));
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(240px, 0.8fr);
  gap: 24px;
  align-items: stretch;
  padding: 24px;
  overflow: hidden;
  border: 1px solid rgba(36, 35, 34, 0.42);
  background: rgba(239, 232, 215, 0.84);
  box-shadow: 12px 16px 0 rgba(36, 35, 34, 0.08), 0 24px 54px rgba(36, 35, 34, 0.18);
}
.load-sheet::before,
.load-sheet::after {
  content: "";
  position: absolute;
  pointer-events: none;
}
.load-sheet::before {
  top: 12px;
  right: 15%;
  width: 32%;
  height: 7px;
  background: #a43d43;
  clip-path: polygon(0 40%, 17% 9%, 48% 36%, 74% 0, 100% 44%, 87% 77%, 43% 63%, 12% 100%);
  opacity: 0.72;
  transform: rotate(-3deg);
}
.load-sheet::after {
  left: 10%;
  bottom: 15px;
  width: 42%;
  height: 9px;
  background: #3e7e91;
  clip-path: polygon(0 47%, 21% 12%, 45% 44%, 68% 0, 100% 51%, 78% 85%, 49% 55%, 19% 100%);
  opacity: 0.52;
  transform: rotate(2deg);
}
.load-band {
  position: relative;
  align-self: center;
  padding: 28px 28px 30px;
  border: 1px solid rgba(36, 35, 34, 0.34);
  background: rgba(245, 239, 224, 0.72);
  box-shadow: inset 0 0 0 6px rgba(164, 61, 67, 0.06), inset 0 0 0 7px rgba(62, 126, 145, 0.1);
}
.load-band::before {
  content: "";
  position: absolute;
  left: -10%;
  right: 18%;
  bottom: -8px;
  height: 10px;
  background: rgba(196, 152, 64, 0.72);
  clip-path: polygon(0 40%, 12% 13%, 42% 34%, 70% 0, 100% 44%, 86% 80%, 44% 58%, 17% 100%);
  transform: rotate(-2deg);
}
.load-presented {
  color: #6e6658;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.load-title {
  display: flex;
  align-items: flex-start;
  color: #242322;
  font-family: var(--title-font);
  font-size: 56px;
  font-weight: 700;
  line-height: 0.94;
  letter-spacing: 0;
  white-space: nowrap;
  text-shadow: 2px 3px 0 rgba(164, 61, 67, 0.18), -2px -1px 0 rgba(62, 126, 145, 0.14);
}
.load-title .title-glyph {
  display: inline-block;
  font-style: normal;
  letter-spacing: 0;
  paint-order: stroke fill;
}
.load-title .title-glyph:nth-child(1) { transform: translateY(0.1em) rotate(-1deg); }
.load-title .title-glyph:nth-child(2) { transform: translateY(-0.07em) rotate(1deg); }
.load-title .title-glyph:nth-child(3) { transform: translateY(-0.12em) scale(0.84); }
.load-title .title-glyph:nth-child(4) { transform: translateY(0.02em) scale(0.94); }
.load-title .title-glyph:nth-child(5) { transform: translateY(0.1em) scale(0.87); }
.load-title .title-glyph-1,
.load-title .title-glyph-2 {
  color: #a43d43;
  -webkit-text-stroke: 1px #c49840;
}
.load-title .title-glyph-3,
.load-title .title-glyph-4,
.load-title .title-glyph-5 {
  color: #243247;
  -webkit-text-stroke: 1px #f4eddb;
}
.load-sub {
  margin-top: 12px;
  color: #a43d43;
  font-family: var(--display-font);
  font-size: 17px;
  letter-spacing: 0.18em;
}
.load-notice {
  max-width: 34em;
  margin: 42px 0 30px;
  color: #4d4941;
  font-size: 14px;
  line-height: 1.7;
}
.load-maker {
  margin-top: 7px;
  color: #242322;
  font-family: var(--title-font);
  font-size: 20px;
  letter-spacing: 0.12em;
}
.load-progress-panel {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-width: 0;
  padding: 26px 0 16px 24px;
  border-left: 1px solid rgba(36, 35, 34, 0.3);
}
.load-pray {
  margin-bottom: 10px;
  color: #3e7e91;
  font-family: var(--title-font);
  font-size: 34px;
  font-weight: 700;
  letter-spacing: 0.1em;
  writing-mode: vertical-rl;
  text-orientation: mixed;
}
.load-now {
  color: #242322;
  font-family: var(--display-font);
  font-size: 19px;
  letter-spacing: 0.12em;
}
.load-text {
  color: #a43d43;
  font-family: var(--mono);
  font-size: 15px;
  letter-spacing: 0.03em;
}
#load-progress {
  width: 100%;
  height: 7px;
  margin-top: 11px;
  overflow: hidden;
  border: 1px solid rgba(36, 35, 34, 0.45);
  background: rgba(36, 35, 34, 0.1);
}
.load-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #a43d43 0 42%, #3e7e91 72%, #c49840 100%);
  transition: width 0.15s linear;
}
.load-status {
  min-height: 1.6em;
  margin-top: 12px;
  color: #5e594f;
  font-size: 14px;
  line-height: 1.5;
}
.load-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}
.load-action {
  appearance: none;
  min-height: 34px;
  padding: 6px 14px;
  color: #242322;
  border: 1px solid rgba(164, 61, 67, 0.62);
  background: rgba(164, 61, 67, 0.1);
  font: 600 13px var(--font);
  cursor: pointer;
  touch-action: manipulation;
}
.load-action-secondary {
  border-color: rgba(62, 126, 145, 0.62);
  background: rgba(62, 126, 145, 0.1);
}
@media (hover: hover) and (pointer: fine) {
  .load-action:hover {
    background: rgba(164, 61, 67, 0.2);
  }
  .load-action-secondary:hover {
    background: rgba(62, 126, 145, 0.2);
  }
}
@media (max-width: 680px) {
  #load-screen { overflow-y: auto; align-items: start; padding: 14px 0; touch-action: pan-y; }
  .load-sheet {
    width: calc(100vw - 28px);
    min-height: 0;
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    gap: 16px;
    padding: 16px;
  }
  .load-band {
    align-self: start;
    padding: 22px 18px 24px;
  }
  .load-title {
    font-size: 40px;
  }
  .load-sub {
    font-size: 15px;
  }
  .load-notice {
    margin: 24px 0 20px;
    font-size: 13px;
  }
  .load-maker {
    font-size: 17px;
  }
  .load-progress-panel {
    justify-content: flex-end;
    padding: 18px 4px 4px;
    border-top: 1px solid rgba(36, 35, 34, 0.3);
    border-left: 0;
  }
  .load-pray {
    font-size: 27px;
    writing-mode: horizontal-tb;
  }
}

/* ===== 通用屏幕骨架 ===== */
.screen {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse at 50% 0%, #2a1840 0%, transparent 55%),
    radial-gradient(ellipse at 80% 100%, #1a1028 0%, var(--bg) 60%);
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
.menu-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(transparent 50%, rgba(0, 0, 0, 0.28) 50%),
    repeating-linear-gradient(90deg, transparent 0, transparent 48px, rgba(212, 181, 106, 0.03) 48px, rgba(212, 181, 106, 0.03) 49px),
    radial-gradient(circle at 20% 80%, rgba(196, 92, 138, 0.12), transparent 40%),
    radial-gradient(circle at 80% 20%, rgba(232, 200, 120, 0.1), transparent 40%);
  background-size: 100% 3px, auto, auto, auto;
}
.screen.active { display: flex; }

/* ===== 主菜单：纸墨标题画面 ===== */
#screen-menu.title-scene {
  --title-font: "Yu Mincho", "Hiragino Mincho ProN", "Noto Serif JP", "MS Mincho", "MingLiU", "PMingLiU", serif;
  --display-font: "Aptos Display", "Trebuchet MS", "Yu Gothic", "Microsoft JhengHei", sans-serif;
  --paper: #e9e0ce;
  --paper-light: #f4eddb;
  --ink: #242322;
  --ink-soft: #4e4a43;
  --vermillion: #a43d43;
  --cobalt: #3e7e91;
  --gold-ink: #c49840;
  --moss: #627b68;
  --violet-ink: #69566f;
  display: none;
  align-items: stretch;
  justify-content: stretch;
  overflow-x: hidden;
  overflow-y: auto;
  isolation: isolate;
  color: var(--ink);
  background: var(--paper);
  touch-action: pan-y;
}
#screen-menu.title-scene.active { display: block; }
#screen-menu.title-scene::before,
#screen-menu.title-scene::after {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 0;
  pointer-events: none;
}
#screen-menu.title-scene::before {
  opacity: 0.38;
  background:
    linear-gradient(90deg, rgba(244, 237, 219, 0.32), transparent 46%),
    linear-gradient(0deg, rgba(17, 20, 29, 0.34), transparent 34%),
    repeating-linear-gradient(0deg, rgba(36, 35, 34, 0.035) 0 1px, transparent 1px 6px);
  mix-blend-mode: multiply;
}
#screen-menu.title-scene::after {
  opacity: 0.34;
  background: linear-gradient(90deg, rgba(17, 20, 29, 0.22), transparent 28%, transparent 72%, rgba(17, 20, 29, 0.16));
}
.menu-layer {
  position: absolute;
  pointer-events: none;
}
.menu-far {
  z-index: 0;
  inset: 0;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 84% 18%, rgba(70, 145, 146, 0.34), transparent 52%),
    radial-gradient(ellipse at 74% 82%, rgba(126, 59, 110, 0.4), transparent 53%),
    linear-gradient(174deg, #f4eddb 0%, #e9e0ce 27%, #747789 51%, #263345 100%);
}
.menu-far::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(244, 237, 219, 0.54) 0%, rgba(244, 237, 219, 0.18) 28%, transparent 59%),
    linear-gradient(0deg, rgba(17, 20, 29, 0.32), transparent 28%),
    radial-gradient(ellipse at 83% 14%, rgba(222, 190, 96, 0.16), transparent 31%);
}
.menu-ornament {
  z-index: 1;
  inset: 0;
  overflow: hidden;
}
.ink-stroke {
  position: absolute;
  height: 13px;
  opacity: 0.68;
  clip-path: polygon(0 43%, 7% 17%, 29% 34%, 52% 0, 76% 35%, 100% 19%, 96% 78%, 72% 57%, 48% 100%, 27% 62%, 4% 90%);
}
.ink-stroke-one {
  top: 19%;
  left: 36%;
  width: 46%;
  background: var(--vermillion);
  transform: rotate(-8deg);
}
.ink-stroke-two {
  right: 8%;
  bottom: 21%;
  width: 39%;
  height: 9px;
  background: var(--cobalt);
  transform: rotate(11deg);
  opacity: 0.58;
}
.paper-shard {
  width: 106px;
  height: 72px;
  background: rgba(244, 237, 219, 0.8);
  border: 1px solid rgba(36, 35, 34, 0.22);
  position: absolute;
  box-shadow: 6px 8px 0 rgba(36, 35, 34, 0.08);
}
.paper-shard-one {
  top: 11%;
  right: 34%;
  transform: rotate(19deg);
}
.paper-shard-two {
  right: 5%;
  bottom: 12%;
  width: 82px;
  height: 118px;
  background: rgba(244, 237, 219, 0.58);
  transform: rotate(-17deg);
}
.seal {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  position: absolute;
  color: rgba(244, 237, 219, 0.88);
  border: 2px solid rgba(164, 61, 67, 0.72);
  background: rgba(164, 61, 67, 0.7);
  font-family: var(--title-font);
  font-size: 23px;
  line-height: 1;
  transform: rotate(8deg);
}
.seal-one {
  top: 12%;
  left: 7%;
}
.seal-two {
  right: 8%;
  bottom: 8%;
  color: rgba(244, 237, 219, 0.92);
  border-color: rgba(62, 126, 145, 0.68);
  background: rgba(62, 126, 145, 0.62);
  transform: rotate(-13deg);
}
.menu-title {
  z-index: 4;
  top: 40px;
  left: 7.2vw;
  width: min(720px, 54vw);
}
.title-glyph {
  display: inline-block;
  font-style: normal;
  letter-spacing: 0;
  paint-order: stroke fill;
}
#screen-menu .game-title {
  display: flex;
  align-items: flex-start;
  width: max-content;
  max-width: 100%;
  margin: 0;
  color: var(--ink);
  font-family: var(--title-font);
  font-size: 96px;
  font-weight: 700;
  line-height: 0.88;
  letter-spacing: 0;
  white-space: nowrap;
}
#screen-menu .game-title .title-glyph {
  position: relative;
  text-shadow: 3px 4px 0 rgba(17, 20, 29, 0.28), 5px 7px 0 rgba(196, 152, 64, 0.2);
}
#screen-menu .game-title .title-glyph-1,
#screen-menu .game-title .title-glyph-2 {
  color: var(--vermillion);
  -webkit-text-stroke: 2px var(--gold-ink);
}
#screen-menu .game-title .title-glyph-3,
#screen-menu .game-title .title-glyph-4,
#screen-menu .game-title .title-glyph-5 {
  color: #243247;
  -webkit-text-stroke: 2px #f4eddb;
}
#screen-menu .game-title .title-glyph-1 { font-size: 0.92em; transform: translateY(0.14em) rotate(-2deg); }
#screen-menu .game-title .title-glyph-2 { font-size: 1.14em; transform: translateY(-0.14em) rotate(1deg); }
#screen-menu .game-title .title-glyph-3 { font-size: 0.78em; transform: translateY(-0.2em) rotate(-3deg); }
#screen-menu .game-title .title-glyph-4 { font-size: 1em; transform: translateY(0.02em) rotate(2deg); }
#screen-menu .game-title .title-glyph-5 { font-size: 0.88em; transform: translateY(0.1em) rotate(4deg); }
#screen-menu .game-subtitle {
  margin: 15px 0 0 10px;
  color: var(--vermillion);
  font-family: var(--display-font);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-shadow: 1px 1px 0 rgba(244, 237, 219, 0.8);
}
#screen-menu .title-brush {
  display: block;
  width: 76%;
  height: 7px;
  margin: 18px 0 0 7px;
  background: var(--gold-ink);
  border-radius: 48% 52% 42% 58% / 58% 42% 58% 42%;
  opacity: 0.78;
  transform: rotate(-2deg);
}
.menu-portrait {
  z-index: 3;
  top: 17vh;
  right: 8vw;
  width: min(35vw, 470px);
  height: min(69vh, 620px);
  min-height: 420px;
}
.portrait-placeholder {
  position: absolute;
  inset: 0;
  overflow: hidden;
  opacity: 0.7;
  filter: drop-shadow(8px 12px 0 rgba(17, 20, 29, 0.12));
}
.placeholder-sheet,
.placeholder-figure,
.placeholder-brush {
  position: absolute;
  display: block;
}
.placeholder-sheet {
  border: 1px dashed rgba(36, 35, 34, 0.28);
  background: rgba(244, 237, 219, 0.38);
}
.placeholder-sheet-back {
  inset: 6% 7% 5% 14%;
  background: rgba(62, 126, 145, 0.1);
  border-radius: 17% 83% 22% 78% / 12% 19% 81% 88%;
  transform: rotate(11deg);
}
.placeholder-sheet-front {
  inset: 13% 13% 12% 3%;
  background: rgba(244, 237, 219, 0.48);
  border-radius: 7% 93% 11% 89% / 89% 12% 88% 11%;
  transform: rotate(-7deg);
}
.placeholder-figure {
  left: 23%;
  right: 15%;
  top: 17%;
  bottom: 12%;
  background: rgba(36, 35, 34, 0.36);
  clip-path: polygon(48% 0, 60% 8%, 64% 22%, 79% 36%, 91% 60%, 100% 81%, 81% 100%, 56% 87%, 41% 100%, 14% 86%, 0 64%, 11% 38%, 30% 25%, 35% 9%);
  opacity: 0.6;
}
.placeholder-figure::before {
  content: "";
  position: absolute;
  left: 38%;
  top: 4%;
  width: 24%;
  height: 15%;
  border-radius: 50%;
  background: rgba(36, 35, 34, 0.42);
}
.placeholder-figure::after {
  content: "";
  position: absolute;
  left: 19%;
  right: 16%;
  bottom: 13%;
  height: 1px;
  background: rgba(244, 237, 219, 0.58);
  box-shadow: 0 -18px 0 rgba(244, 237, 219, 0.3), 0 -36px 0 rgba(244, 237, 219, 0.2);
}
.placeholder-brush {
  top: 5%;
  right: 6%;
  width: 11px;
  height: 91%;
  background: rgba(196, 152, 64, 0.38);
  clip-path: polygon(18% 0, 83% 0, 100% 85%, 54% 100%, 0 85%);
  transform: rotate(17deg);
  opacity: 0.52;
}
.portrait-caption {
  position: absolute;
  right: 4%;
  bottom: -2px;
  margin: 0;
  color: var(--ink-soft);
  font-family: var(--display-font);
  font-size: 13px;
  letter-spacing: 0.12em;
  white-space: nowrap;
  text-shadow: 1px 1px 0 rgba(244, 237, 219, 0.7);
}
.portrait-caption strong {
  color: var(--vermillion);
  font-family: var(--title-font);
  font-size: 19px;
  font-weight: 700;
}
.portrait-caption span { margin-left: 0.45em; }
#screen-menu .menu-nav {
  z-index: 5;
  left: 7.2vw;
  top: max(242px, calc(100% - 554px));
  width: 430px;
  max-width: calc(100vw - 80px);
  color: #f4eddb;
  touch-action: pan-y;
  pointer-events: auto;
  padding-bottom: 28px;
}
#screen-menu .menu-group + .menu-group { margin-top: 12px; }
#screen-menu .menu-group:nth-child(2) { margin-left: 14px; }
#screen-menu .menu-group:nth-child(3) { margin-left: 7px; }
#screen-menu .menu-group:nth-child(4) { margin-left: 24px; }
#screen-menu .menu-btn {
  appearance: none;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  width: 100%;
  min-height: 44px;
  padding: 5px 8px 6px 4px;
  color: #f4eddb;
  border: 1px solid transparent;
  border-radius: 0;
  background: transparent;
  font: inherit;
  cursor: pointer;
  position: relative;
  isolation: isolate;
  text-align: left;
  transition: color 0.14s, background-color 0.14s, border-color 0.14s, transform 0.14s;
}
#screen-menu .menu-btn:focus { outline: none; }
#screen-menu .menu-btn:focus-visible .menu-label {
  text-decoration: underline dotted #f6d9a1 2px;
  text-underline-offset: 6px;
}
#screen-menu .menu-entry {
  display: inline-flex;
  align-items: baseline;
  min-width: 0;
  gap: 13px;
}
#screen-menu .menu-label {
  color: #f4eddb;
  font-family: var(--title-font);
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.015em;
  white-space: nowrap;
  -webkit-text-stroke: 2px #253042;
  paint-order: stroke fill;
  text-shadow: 2px 3px 0 rgba(17, 20, 29, 0.78);
}
#screen-menu .menu-caption {
  color: #fff7e3;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.1;
  letter-spacing: 0.04em;
  white-space: nowrap;
  text-shadow: 1px 1px 2px #172130, -1px -1px 2px #172130;
}
#screen-menu .menu-btn::before {
  content: "";
  position: absolute;
  z-index: -1;
  left: -5px;
  right: 24%;
  bottom: 5px;
  height: 24px;
  opacity: 0;
  background: linear-gradient(90deg, rgba(196, 152, 64, 0.5), rgba(196, 152, 64, 0.12) 72%, transparent);
  transform: rotate(-1deg);
  transition: opacity 0.14s, transform 0.14s;
}
#screen-menu .menu-btn::after {
  content: "";
  position: absolute;
  left: -15px;
  top: 50%;
  width: 8px;
  height: 8px;
  border: 1px solid rgba(244, 237, 219, 0.86);
  opacity: 0;
  transform: translateY(-50%) rotate(45deg) scale(0.75);
  transition: opacity 0.14s, transform 0.14s;
}
#screen-menu .menu-btn.selected {
  color: #f4eddb;
  border-color: transparent;
  background: transparent;
  transform: translateX(7px);
}
#screen-menu .menu-btn.selected::before { opacity: 1; transform: rotate(-1deg) scaleX(1.02); background: linear-gradient(90deg, rgba(164, 61, 67, 0.72), rgba(196, 152, 64, 0.3) 72%, transparent); }
#screen-menu .menu-btn.selected::after { opacity: 1; border-color: var(--gold-ink); transform: translateY(-50%) rotate(45deg) scale(1); }
#screen-menu .menu-btn.selected .menu-label { color: #f06a62; text-shadow: 2px 2px 0 rgba(17, 20, 29, 0.94); }
#screen-menu .menu-btn.selected .menu-caption { color: #f8d98c; }
@media (hover: hover) and (pointer: fine) {
  #screen-menu .menu-btn:hover {
    color: #f4eddb;
    background: rgba(17, 20, 29, 0.12);
    transform: translateX(4px);
  }
  #screen-menu .menu-btn:hover::before { opacity: 0.82; }
  #screen-menu .menu-btn:hover .menu-label { color: #f06a62; }
}
#screen-menu .menu-hint {
  margin: 13px 0 0 4px;
  color: rgba(244, 237, 219, 0.8);
  font-family: var(--font);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-shadow: 1px 1px 0 rgba(17, 20, 29, 0.8);
}
.menu-btn {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  padding: 0.7rem 1rem;
  border-radius: 0;
  font-size: 1.05rem;
  font-family: var(--serif);
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: color .12s, background .12s, border-color .12s;
  text-align: left;
  position: relative;
}
.menu-btn:focus { outline: none; }
.menu-btn:hover, .menu-btn:focus-visible, .menu-btn.selected {
  border-color: var(--focus-outline);
  background: linear-gradient(90deg, rgba(212,181,106,.12), transparent 70%);
  color: #fff8e8;
}
.menu-btn.ghost {
  background: transparent;
  color: var(--muted);
  margin-top: 0.75rem;
  text-align: center;
  border: 1px solid rgba(154,139,110,.3);
}
.menu-btn.ghost:hover,
.menu-btn.ghost:focus-visible,
.menu-btn.ghost.selected {
  color: var(--gold);
  border-color: rgba(212, 181, 106, 0.55);
  background: linear-gradient(90deg, rgba(212, 181, 106, 0.14), transparent 70%);
}
.row-btns .menu-btn.ghost { margin-top: 0; }

/* 主菜单退出反馈 */
#screen-exit.exit-screen {
  --title-font: "Yu Mincho", "Hiragino Mincho ProN", "Noto Serif JP", "MS Mincho", "MingLiU", "PMingLiU", serif;
  --display-font: "Aptos Display", "Trebuchet MS", "Yu Gothic", "Microsoft JhengHei", sans-serif;
  overflow: auto;
  color: #242322;
  background:
    repeating-linear-gradient(0deg, rgba(36, 35, 34, 0.04) 0 1px, transparent 1px 5px),
    linear-gradient(132deg, #f4eddb, #d9d0bb);
}
.exit-sheet {
  width: min(420px, calc(100vw - 40px));
  padding: 34px 36px 32px;
  text-align: center;
  border: 1px solid rgba(36, 35, 34, 0.4);
  background: rgba(244, 237, 219, 0.82);
  box-shadow: 10px 12px 0 rgba(36, 35, 34, 0.1);
}
.exit-kicker {
  color: #3e7e91;
  font: 700 11px var(--display-font);
  letter-spacing: 0.16em;
}
.exit-sheet h2 {
  margin-top: 18px;
  color: #a43d43;
  font: 700 38px/1.1 var(--title-font);
  letter-spacing: 0.16em;
}
.exit-message {
  margin: 10px 0 24px;
  color: #4e4a43;
  font-size: 15px;
}
.exit-sheet .menu-btn {
  justify-content: center;
  color: #242322;
  border-color: rgba(164, 61, 67, 0.5);
  background: rgba(164, 61, 67, 0.08);
}

/* 主菜单分层绘画入场：最长 1.1s；行为层负责移除 menu-entering。 */
#screen-menu.menu-entering > [data-menu-layer="far"] { animation: menuFarIn 860ms cubic-bezier(0.23, 1, 0.32, 1) both; }
#screen-menu.menu-entering > [data-menu-layer="ornament"] { animation: menuOrnamentIn 920ms cubic-bezier(0.23, 1, 0.32, 1) 70ms both; }
#screen-menu.menu-entering > [data-menu-layer="portrait"] { animation: menuPortraitIn 980ms cubic-bezier(0.23, 1, 0.32, 1) 110ms both; }
#screen-menu.menu-entering > [data-menu-layer="title"] { animation: menuTitleIn 760ms cubic-bezier(0.23, 1, 0.32, 1) 180ms both; }
#screen-menu.menu-entering > [data-menu-layer="nav"] { animation: menuNavIn 850ms cubic-bezier(0.23, 1, 0.32, 1) 250ms both; }
@keyframes menuFarIn {
  from { opacity: 0; transform: scale(1.035) translate3d(0, 10px, 0); }
  to { opacity: 1; transform: none; }
}
@keyframes menuOrnamentIn {
  from { opacity: 0; transform: translate3d(12px, -10px, 0) rotate(1deg); }
  to { opacity: 1; transform: none; }
}
@keyframes menuPortraitIn {
  from { opacity: 0; transform: translate3d(42px, 14px, 0) rotate(2deg); }
  to { opacity: 1; transform: none; }
}
@keyframes menuTitleIn {
  from { opacity: 0; transform: translate3d(-20px, 15px, 0); }
  to { opacity: 1; transform: none; }
}
@keyframes menuNavIn {
  from { opacity: 0; transform: translate3d(-18px, 22px, 0); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  #screen-menu *, #screen-menu *::before, #screen-menu *::after,
  #load-screen *, #load-screen *::before, #load-screen *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* ===== 下游屏幕共用的东方面板 ===== */
.menu-panel, .th-panel {
  position: relative;
  z-index: 1;
  width: min(440px, 92vw);
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
  text-align: center;
}
.menu-panel.wide, .th-panel.wide { width: min(680px, 94vw); }
.th-panel-frame {
  padding: 1.75rem 1.6rem 1.4rem;
  background: linear-gradient(180deg, rgba(30, 24, 44, 0.96) 0%, rgba(16, 12, 24, 0.97) 100%);
  border: 2px solid var(--border);
  box-shadow:
    0 0 0 1px rgba(240, 215, 140, 0.15),
    0 18px 50px rgba(0, 0, 0, 0.55),
    inset 0 0 40px rgba(212, 181, 106, 0.04);
  position: relative;
}
.th-panel-frame::before,
.th-panel-frame::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  border: 2px solid var(--gold);
  opacity: 0.7;
}
.th-panel-frame::before { top: 6px; left: 6px; border-right: none; border-bottom: none; }
.th-panel-frame::after { right: 6px; bottom: 6px; border-top: none; border-left: none; }
.panel-title {
  margin-bottom: 1.1rem;
  color: var(--gold2);
  font-family: var(--serif);
  font-size: 1.35rem;
  letter-spacing: 0.18em;
  text-shadow: 0 0 12px rgba(232, 200, 120, 0.3);
}

/* 主菜单响应式：竖屏重新编排，不把桌面舞台缩成小字。 */
@media (max-width: 820px) and (orientation: portrait) {
  #screen-menu.title-scene {
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  #screen-menu .menu-title { top: 24px; left: 28px; width: calc(100% - 56px); }
  #screen-menu .game-title { font-size: 58px; }
  #screen-menu .game-subtitle { margin-top: 10px; font-size: 15px; }
  #screen-menu .title-brush { width: 62%; margin-top: 13px; }
  #screen-menu .menu-portrait { top: 138px; right: 28px; width: min(42vw, 190px); height: 156px; min-height: 0; }
  #screen-menu .portrait-caption { right: 0; bottom: -1px; font-size: 11px; }
  #screen-menu .portrait-caption strong { font-size: 15px; }
  #screen-menu .menu-nav { top: 280px; right: 28px; bottom: auto; left: 28px; width: auto; max-width: none; }
  #screen-menu .menu-group + .menu-group { margin-top: 9px; padding-top: 7px; }
  #screen-menu .menu-group:nth-child(n) { margin-left: 0; }
  #screen-menu .menu-btn { min-height: 44px; padding: 5px 7px 6px 3px; touch-action: manipulation; }
  #screen-menu .menu-label { font-size: 24px; }
  #screen-menu .menu-caption { font-size: 14px; }
  #screen-menu .menu-hint { margin-top: 10px; font-size: 10px; }
  #screen-menu .version-badge { right: 12px; bottom: 10px; }
}

@media (max-width: 520px) {
  #screen-menu.title-scene {
    min-height: 568px;
  }
  #screen-menu .menu-title { top: 18px; left: 18px; width: calc(100% - 36px); }
  #screen-menu .game-title { font-size: 42px; line-height: 0.9; }
  #screen-menu .game-subtitle { margin: 8px 0 0 3px; font-size: 13px; letter-spacing: 0.13em; }
  #screen-menu .title-brush { width: 56%; height: 6px; margin: 9px 0 0 2px; }
  #screen-menu .menu-portrait { top: 112px; right: 18px; width: 132px; height: 105px; }
  #screen-menu .portrait-caption { right: -1px; font-size: 9px; letter-spacing: 0.05em; }
  #screen-menu .portrait-caption strong { font-size: 12px; }
  #screen-menu .menu-nav { top: 218px; right: 16px; left: 16px; }
  #screen-menu .menu-group + .menu-group { margin-top: 7px; padding-top: 5px; }
  #screen-menu .menu-group:nth-child(n) { margin-left: 0; }
  #screen-menu .menu-btn { min-height: 44px; padding: 6px 4px 6px 2px; }
  #screen-menu .menu-entry { gap: 8px; }
  #screen-menu .menu-label { font-size: 23px; }
  #screen-menu .menu-caption { font-size: 14px; letter-spacing: 0; }
  #screen-menu .menu-hint { margin-top: 7px; font-size: 9px; letter-spacing: 0.06em; }
  #screen-menu .version-badge { display: none; }
  #screen-menu .seal-one { top: 8%; left: 4%; transform: scale(0.72) rotate(8deg); }
  #screen-menu .seal-two { right: 4%; bottom: 4%; transform: scale(0.72) rotate(-13deg); }
}

@media (max-width: 340px) {
  #screen-menu .menu-title { top: 14px; left: 14px; width: calc(100% - 28px); }
  #screen-menu .game-title { font-size: 36px; }
  #screen-menu .game-subtitle { font-size: 12px; }
  #screen-menu .menu-portrait { top: 96px; right: 15px; width: 110px; height: 94px; }
  #screen-menu .menu-nav { top: 194px; right: 13px; left: 13px; }
  #screen-menu .menu-btn { min-height: 44px; }
  #screen-menu .menu-label { font-size: 21px; }
  #screen-menu .menu-caption { font-size: 14px; }
  #screen-menu .menu-group + .menu-group { margin-top: 6px; padding-top: 4px; }
  #screen-menu .menu-hint { margin-top: 6px; font-size: 8px; }
}

@media (max-width: 680px) {
  .load-title { font-size: 32px; }
  .load-title .title-glyph-1,
  .load-title .title-glyph-2 { -webkit-text-stroke-width: 1px; }
  .load-title .title-glyph-3,
  .load-title .title-glyph-4,
  .load-title .title-glyph-5 { -webkit-text-stroke-width: 1px; }
}

@media (max-height: 620px) and (min-width: 521px) {
  #screen-menu.title-scene { overflow-y: auto; }
  #screen-menu .menu-title { top: 18px; }
  #screen-menu .game-title { font-size: 58px; }
  #screen-menu .menu-portrait { top: 100px; height: 330px; min-height: 0; }
  #screen-menu .menu-nav { top: 150px; bottom: auto; padding-bottom: 28px; }
  #screen-menu .menu-group + .menu-group { margin-top: 6px; }
  #screen-menu .menu-btn { min-height: 40px; }
}


/* Stage grid */
.stage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.5rem;
  margin-bottom: 1rem;
  text-align: left;
}
.stage-btn {
  border: 1px solid rgba(92,74,46,.7);
  background: rgba(16,12,24,.9);
  color: var(--text);
  padding: 0.75rem;
  cursor: pointer;
  text-align: left;
  font-family: var(--serif);
}
.stage-btn:hover,
.stage-btn.selected {
  border-color: var(--focus-border);
  box-shadow: 0 0 12px var(--focus-ring-soft);
}
.stage-btn.selected {
  outline: 1px solid var(--focus-outline);
}
.stage-btn small { display: block; color: var(--muted); margin-top: 0.25rem; font-size: 0.7rem; font-family: var(--font); }
.stage-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* Practice — 行样式与 Settings 共用 .settings-row */
.practice-form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  text-align: left;
  margin-bottom: 1rem;
}
.practice-form .settings-row {
  margin: 0;
}
.practice-form input[type="number"] {
  flex: 1;
  min-width: 0;
  width: 100%;
  background: #0c0a12;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.5rem;
  font-size: 1rem;
  font-family: var(--mono);
  pointer-events: auto;
  user-select: text;
  -webkit-user-select: text;
  cursor: text;
}
.practice-form .settings-row.selected input[type="number"] {
  border-color: rgba(212, 181, 106, 0.55);
}
.practice-form .settings-control input[type="checkbox"] {
  width: 1.15rem;
  height: 1.15rem;
  accent-color: var(--gold2);
  cursor: pointer;
  pointer-events: auto;
}

/* Practice — 章节列表（只显示当前关卡的章节，短列表；点选/←→ 循环） */
.practice-chapter-control {
  align-items: stretch;
}
.practice-chapter-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  max-height: min(34vh, 260px);
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: rgba(10, 8, 14, 0.6);
  padding: 0.3rem;
  text-align: left;
}
.pc-item {
  appearance: none;
  text-align: left;
  font: inherit;
  font-size: 0.85rem;
  color: #e8dcc4;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 3px;
  padding: 0.38rem 0.55rem;
  cursor: pointer;
  pointer-events: auto;
  -webkit-user-select: none;
  user-select: none;
}
.pc-item:hover { background: var(--focus-bg-soft); }
.pc-item.selected {
  background: var(--focus-bg);
  border-color: var(--focus-border);
  box-shadow: 0 0 0 1px var(--focus-ring);
  color: #f3e7cd;
}
/* Practice — 章节最佳记录（练习各章最佳，随难度切换刷新） */
.pc-best {
  display: block;
  font-size: 11px;
  color: #64748b;
  margin-top: 0.15rem;
}
/* Practice — 难度 / 关卡标签（难度带 --dc 主题色；点选/←→ 循环） */
.practice-diffs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  width: 100%;
}
.ptab {
  flex: 1 1 auto;
  min-width: 3.2rem;
  padding: 0.45rem 0.5rem;
  background: rgba(12, 14, 20, 0.55);
  border: 1px solid var(--focus-border-soft);
  color: #d8cbb0;
  border-radius: 4px;
  cursor: pointer;
  font: inherit;
  font-size: 0.85rem;
  letter-spacing: 0.03em;
  pointer-events: auto;
  -webkit-user-select: none;
  user-select: none;
}
.ptab:hover { background: var(--focus-bg-soft); }
.ptab.selected,
.ptab:focus-visible {
  border-color: var(--dc, var(--focus-border));
  background: var(--focus-bg);
  box-shadow: 0 0 0 1px var(--focus-ring);
  color: #f3e7cd;
}
.practice-hint {
  margin: 0;
  font-size: 0.75rem;
  line-height: 1.45;
  color: var(--muted);
  padding: 0 0.15rem;
}
.row-btns {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* Keys */
.keys-hint { color: var(--muted); font-size: 0.85rem; margin-bottom: 1rem; }
.key-list { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 1rem; }
.key-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background: rgba(16,12,24,.9);
  border: 1px solid rgba(92,74,46,.7);
  color: var(--text);
  cursor: pointer;
  font-size: 1rem;
  font-family: var(--serif);
}
.key-row:hover,
.key-row.selected {
  border-color: var(--focus-border);
  background: var(--focus-bg);
  box-shadow: 0 0 0 1px var(--focus-ring);
}
.key-row.listening {
  border-color: var(--warn);
  box-shadow: 0 0 0 1px rgba(251,191,36,.4);
}
.key-row kbd {
  background: #0c0a12;
  border: 1px solid var(--border);
  padding: 0.25rem 0.6rem;
  font-family: var(--mono);
  min-width: 2.5rem;
  color: var(--gold2);
}

/* Settings */
.settings-section-title {
  font-family: var(--serif);
  font-size: 1rem;
  color: var(--gold2);
  text-align: left;
  margin: 0.35rem 0 0.55rem;
  letter-spacing: 0.04em;
}
.settings-form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  text-align: left;
  margin-bottom: 0.75rem;
}
#screen-settings .key-list {
  margin-bottom: 1rem;
}
.settings-row {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 0.75rem 1rem;
  background: rgba(16,12,24,.9);
  border: 1px solid rgba(92,74,46,.7);
  color: var(--text);
  font-family: var(--serif);
  cursor: default;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.settings-row.check {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  cursor: pointer;
}
.settings-row.selected {
  border-color: var(--focus-border);
  background: var(--focus-bg);
  box-shadow: 0 0 0 1px var(--focus-ring);
}
.settings-label {
  font-size: 0.95rem;
  color: var(--text);
}
.settings-control {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.settings-control input[type="range"] {
  flex: 1;
  min-width: 0;
  accent-color: var(--gold2);
  cursor: pointer;
}
.settings-control input[type="checkbox"] {
  width: 1.15rem;
  height: 1.15rem;
  accent-color: var(--gold2);
  cursor: pointer;
}
.settings-value {
  font-family: var(--mono);
  font-size: 0.9rem;
  color: var(--gold2);
  min-width: 3.2rem;
  text-align: right;
}


/* History builds */
.history-panel { max-height: 90vh; overflow: hidden; }
.history-panel .th-panel-frame {
  display: flex;
  flex-direction: column;
  max-height: 90vh;
}
.history-status {
  margin: 0 0 0.5rem;
  font-size: 0.82rem;
  color: #a89878;
  text-align: left;
}
.history-status.error {
  color: #e08080;
}
.history-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  overflow-y: auto;
  max-height: 52vh;
  text-align: left;
  padding: 0.15rem 0.2rem 0.5rem;
  margin-bottom: 0.65rem;
}
.history-item {
  display: block;
  width: 100%;
  text-align: left;
  background: rgba(12, 14, 20, 0.55);
  border: 1px solid var(--focus-border-soft);
  color: #d8cbb0;
  padding: 0.55rem 0.7rem;
  border-radius: 4px;
  cursor: pointer;
  font: inherit;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.history-item:hover,
.history-item.selected {
  border-color: var(--focus-border);
  background: var(--focus-bg);
  box-shadow: 0 0 0 1px var(--focus-ring);
}
.history-item.is-current {
  border-color: rgba(120, 180, 220, 0.45);
}
.history-item-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.35rem 0.75rem;
  margin-bottom: 0.25rem;
  font-size: 0.78rem;
}
.history-time {
  color: var(--gold2);
  font-family: var(--mono, monospace);
}
.history-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}
.history-env,
.history-branch,
.history-current-tag {
  font-size: 0.72rem;
  padding: 0.05rem 0.35rem;
  border-radius: 3px;
  border: 1px solid var(--focus-border-mid);
  color: #c9b896;
}
.history-current-tag {
  color: #9ec9e8;
  border-color: rgba(120, 180, 220, 0.45);
}
.history-commit {
  font-family: var(--mono, monospace);
  font-size: 0.75rem;
  color: #b8a888;
}
.history-msg {
  font-size: 0.88rem;
  line-height: 1.4;
  color: #e8dcc4;
  word-break: break-word;
}

/* Manual */
.manual-panel { max-height: 90vh; overflow: hidden; }
.manual-panel .th-panel-frame {
  display: flex;
  flex-direction: column;
  max-height: 90vh;
}
.manual-body {
  text-align: left;
  overflow-y: auto;
  max-height: 60vh;
  padding: 0.35rem 0.4rem 1rem;
  font-size: 0.88rem;
  line-height: 1.65;
  color: #d8cbb0;
  border: 1px solid transparent;
  border-radius: 4px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.manual-body.kb-focus {
  border-color: var(--focus-outline);
  box-shadow: 0 0 0 1px var(--focus-ring-soft);
}
.manual-chapter {
  margin-bottom: 1.1rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--focus-ring-soft);
}
.manual-chapter:last-child {
  border-bottom: none;
  margin-bottom: 0.25rem;
}
.manual-body h3 {
  color: var(--gold);
  margin: 0 0 0.45rem;
  font-size: 0.98rem;
  letter-spacing: 0.04em;
}
.manual-body p {
  margin: 0;
  white-space: normal;
}

/* ===== 游戏舞台：共享纸墨背景 + 固定 450:600 版面 ===== */
#screen-game {
  --stage-paper: #d8c7ae;
  --stage-wash: #68566c;
  --stage-ink: #201c32;
  --stage-red: #e59aae;
  --stage-gold: #e5c991;
  --stage-blue: #93d4df;
  --hud-panel: rgba(28, 25, 43, 0.96);
  --hud-panel-soft: rgba(39, 33, 52, 0.86);
  --hud-line: rgba(231, 209, 161, 0.45);
  --hud-line-soft: rgba(231, 209, 161, 0.2);
  --hud-text: #faf0df;
  --hud-muted: #d3c6d3;
  --life-color: #f295cf;
  --bomb-color: #9bdca2;
  --edit-color: #83dce8;
  position: absolute;
  inset: 0;
  overflow: hidden;
  isolation: isolate;
  background: #17313b;
  color: var(--hud-text);
  align-items: stretch;
  justify-content: stretch;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

.game-backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background:
    linear-gradient(155deg, rgba(148, 92, 101, .55), transparent 48%),
    linear-gradient(25deg, rgba(55, 122, 129, .6), transparent 52%),
    linear-gradient(125deg, #333149 0%, #62516c 54%, #303a53 100%);
}
.game-backdrop::before,
.game-backdrop::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.game-backdrop::before {
  background:
    repeating-linear-gradient(128deg, transparent 0 88px, rgba(141, 209, 208, .16) 89px 92px, transparent 93px 164px),
    repeating-linear-gradient(38deg, transparent 0 137px, rgba(230, 187, 137, .13) 138px 140px, transparent 141px 216px),
    linear-gradient(32deg, transparent 65%, rgba(217, 122, 158, .18) 65% 75%, transparent 75%);
  opacity: 0.8;
}
.game-backdrop::after {
  background:
    linear-gradient(90deg, rgba(8, 26, 35, 0.2), transparent 22%, transparent 78%, rgba(8, 26, 35, 0.28)),
    linear-gradient(180deg, rgba(255, 248, 226, 0.1), transparent 34%, rgba(10, 22, 28, 0.22));
}
#bg3d {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  opacity: 0.1;
}
#bg3d-fallback {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 50;
  width: min(300px, calc(100% - 24px));
  max-height: 45%;
  overflow: auto;
  touch-action: pan-y;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.55rem;
  padding: 1rem;
  color: #294d53;
  background: #e2e8d9;
  font-size: 12px;
  text-align: left;
  pointer-events: auto;
}
#bg3d-fallback p { margin: 0; max-width: 32em; }
#bg3d-fallback-err { color: #4e6462; overflow-wrap: anywhere; }
#bg3d-fallback button {
  min-height: 44px;
  padding: 0.55rem 1rem;
  color: #f6eed6;
  background: rgba(43, 86, 99, 0.86);
  border: 1px solid rgba(238, 211, 145, 0.66);
  border-radius: 2px;
  cursor: pointer;
  touch-action: manipulation;
}
#bg3d-fallback button:hover,
#bg3d-fallback button:focus-visible { background: rgba(62, 111, 120, 0.94); }
.overlay-fx {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    repeating-linear-gradient(0deg, transparent 0 3px, rgba(240, 231, 202, 0.06) 3px 4px),
    linear-gradient(180deg, rgba(240, 235, 212, 0.12), transparent 44%, rgba(5, 19, 26, 0.22));
  mix-blend-mode: screen;
  opacity: 0.65;
}

.game-layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(96px, .35fr) minmax(0, 1.65fr) minmax(280px, .8fr);
  gap: 20px;
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 12px clamp(14px, 2vw, 28px) 28px;
}
.panel-left,
.panel-right,
.panel-center {
  position: relative;
  min-width: 0;
  min-height: 0;
}
.panel-left {
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 0;
  pointer-events: none;
}
.title-rail {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 0;
  padding: 12px 6px;
  color: var(--stage-ink);
  writing-mode: horizontal-tb;
  text-orientation: mixed;
}
.title-rail::before,
.title-rail::after {
  content: "";
  position: absolute;
  pointer-events: none;
}
.title-rail::before {
  inset: 0 8px 0 auto;
  width: 1px;
  background: linear-gradient(180deg, transparent, rgba(164, 62, 73, 0.72) 22%, rgba(214, 178, 102, 0.72) 76%, transparent);
  transform: rotate(3deg);
}
.title-rail::after {
  left: 0;
  bottom: 6px;
  width: 76px;
  height: 12px;
  background: rgba(169, 70, 80, 0.3);
  clip-path: polygon(0 28%, 100% 0, 90% 76%, 16% 100%);
  transform: rotate(-5deg);
}
#screen-game .game-title {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.12em;
  margin: 0;
  font-family: var(--title-font);
  font-size: 3rem;
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: 0.1em;
  writing-mode: horizontal-tb;
  text-orientation: mixed;
  white-space: nowrap;
  text-shadow: 2px 2px 0 rgba(236, 224, 188, 0.9), 4px 5px 0 rgba(24, 43, 53, 0.22);
}
#screen-game .game-title-glyph {
  display: block;
  paint-order: stroke fill;
  -webkit-text-stroke: 1px rgba(247, 237, 207, 0.72);
}
#screen-game .game-title-glyph-1,
#screen-game .game-title-glyph-2 {
  color: var(--stage-red);
  text-shadow: 2px 2px 0 rgba(244, 207, 142, 0.88), 4px 5px 0 rgba(80, 33, 40, 0.28);
}
#screen-game .game-title-glyph-2 { transform: translateX(0.06em) scale(1.04); }
#screen-game .game-title-glyph-3,
#screen-game .game-title-glyph-4,
#screen-game .game-title-glyph-5 {
  color: #9bcbdc;
  text-shadow: 2px 2px 0 #222439, 3px 4px 0 rgba(13, 17, 29, .6);
}
#screen-game .game-title-glyph-3 { transform: translateX(-0.08em) scale(0.9); }
#screen-game .game-title-glyph-4 { transform: translateX(0.05em); }
#screen-game .game-title-glyph-5 { transform: translateX(-0.03em) scale(0.94); }
#screen-game .game-subtitle {
  display: block;
  color: #d9cdbb;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.76rem;
  letter-spacing: 0.16em;
  writing-mode: vertical-rl;
  text-transform: uppercase;
}
.title-rule {
  display: block;
  width: 1px;
  height: 90px;
  margin-top: 8px;
  background: linear-gradient(180deg, transparent, rgba(47, 95, 114, 0.72), transparent);
}

.panel-center {
  --letter-height: 68px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 0;
  container-type: size;
  padding-bottom: 18px;
}
.letter-track {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100cqw;
  height: var(--letter-height);
  flex: 0 0 var(--letter-height);
  overflow: visible;
  z-index: 3;
}
.letter-track::before {
  content: "";
  position: absolute;
  left: 2%;
  right: 2%;
  bottom: 6px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(231, 208, 152, 0.62) 18%, rgba(231, 208, 152, 0.22) 82%, transparent);
  transform: rotate(-0.8deg);
}
.playfield-wrap {
  position: relative;
  display: grid;
  place-items: stretch;
  width: min(100cqw, calc((100cqh - var(--letter-height) - 18px) * 0.75));
  height: min(calc(100cqw * 4 / 3), calc(100cqh - var(--letter-height) - 18px));
  flex: 0 0 auto;
  aspect-ratio: 3 / 4;
  min-width: 0;
  min-height: 0;
  overflow: visible;
  isolation: isolate;
  background: #1a2830;
  outline: 2px solid rgba(231, 214, 170, 0.84);
  outline-offset: 6px;
  box-shadow:
    0 0 0 1px rgba(27, 46, 53, 0.7),
    0 0 0 10px rgba(207, 194, 160, 0.2),
    10px 14px 22px rgba(10, 27, 34, 0.28);
}
.playfield-wrap::before,
.playfield-wrap::after {
  content: "";
  position: absolute;
  pointer-events: none;
  z-index: 1;
}
.playfield-wrap::before {
  inset: -4px;
  border: 1px solid rgba(106, 183, 198, 0.48);
  clip-path: polygon(0 0, 24% 0, 24% 1px, 76% 1px, 76% 0, 100% 0, 100% 100%, 0 100%);
}
.playfield-wrap::after {
  left: -15px;
  bottom: -14px;
  width: 86px;
  height: 10px;
  background: rgba(169, 70, 80, 0.62);
  clip-path: polygon(0 28%, 100% 0, 84% 78%, 8% 100%);
  transform: rotate(-3deg);
}
#playfield {
  display: block;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  margin: 0;
  border: 0;
  outline: 0;
  background: #132029;
  image-rendering: auto;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

/* Boss marker follows the playfield and remains outside the collision space. */
.boss-enemy-marker {
  position: absolute;
  top: 100%;
  left: 50%;
  z-index: 6;
  margin-top: 12px;
  transform: translateX(-50%);
  pointer-events: none;
  line-height: 1;
  white-space: nowrap;
  user-select: none;
}
.boss-enemy-marker > span {
  display: inline-block;
  padding: 0 0.16em;
  color: #fdf3da;
  font-family: Georgia, "Palatino Linotype", "Book Antiqua", "Times New Roman", serif;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  line-height: 1.05;
  -webkit-text-stroke: 3px #8d2941;
  paint-order: stroke fill;
  filter: drop-shadow(0 1px 1px rgba(14, 24, 29, 0.68));
}
.boss-enemy-marker.hidden { display: none; }

/* 结局故事：保持全屏对话，不显示战斗舞台外围。 */
#screen-game.ending-cinematic {
  background: #071014;
}
#screen-game.ending-cinematic .game-backdrop { display: none; }
#screen-game.ending-cinematic .panel-left,
#screen-game.ending-cinematic .panel-right { display: none !important; }
#screen-game.ending-cinematic .game-layout {
  grid-template-columns: 1fr;
  gap: 0;
  padding: 0;
  background: #071014;
}
#screen-game.ending-cinematic .panel-center {
  width: 100%;
  max-width: min(100vw, 560px);
  margin: 0 auto;
  background: #071014;
}
#screen-game.ending-cinematic .letter-track,
#screen-game.ending-cinematic .touch-keys,
#screen-game.ending-cinematic .stage-label,
#screen-game.ending-cinematic .boss-enemy-marker { display: none !important; }
#screen-game.ending-cinematic .playfield-wrap {
  background: #071014;
  outline: none;
  box-shadow: none;
}
#screen-game.ending-cinematic #playfield { background: #071014; }

/* Dialogue — 东方对话框 + 立绘 */
.dialogue-box {
  position: absolute;
  left: 3%;
  right: 3%;
  bottom: 5%;
  background: rgba(12, 10, 18, 0.92);
  border: 2px solid rgba(212,181,106,.5);
  padding: 0.55rem 0.65rem 0.45rem;
  z-index: 10;
  box-shadow: 0 0 24px rgba(0,0,0,.55);
}
.dialogue-box.hidden { display: none; }
.dialogue-layout {
  display: flex;
  gap: 0.65rem;
  align-items: stretch;
  min-height: 88px;
}
.dialogue-portrait-wrap {
  flex: 0 0 72px;
  display: flex;
  align-items: flex-end;
}
.dialogue-portrait {
  width: 72px;
  height: 96px;
  object-fit: cover;
  object-position: center top;
  border: 1px solid rgba(212,181,106,.55);
  box-shadow: 0 0 12px rgba(212,181,106,.2);
  background: #1a1424;
}
.dialogue-portrait.hidden { display: none; }
.dialogue-content { flex: 1; min-width: 0; }
.dialogue-name {
  font-family: var(--serif);
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 0.3rem;
  letter-spacing: 0.08em;
}
.dialogue-text {
  font-size: 0.88rem;
  line-height: 1.5;
  color: #f2e6c8;
  min-height: 2.6em;
  white-space: pre-line;
}
.dialogue-hint {
  text-align: right;
  font-size: 0.68rem;
  color: var(--muted);
  margin-top: 0.3rem;
  letter-spacing: 0.08em;
}

.flash-msg {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: transparent;
  z-index: 20;
  pointer-events: none;
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--danger);
  text-shadow: 0 0 20px rgba(248,113,113,.85);
  letter-spacing: 0.2em;
  animation: flashPulse 0.15s ease infinite alternate;
}
.flash-msg.hidden, .letter-banner.hidden, .game-overlay.hidden { display: none; }

/* 暂停 / 结束 共用叠加层 */
.game-overlay {
  position: absolute;
  inset: 0;
  z-index: 25;
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  pointer-events: auto;
}
.game-overlay-blur {
  position: absolute;
  inset: 0;
  backdrop-filter: blur(3px) saturate(0.65);
  -webkit-backdrop-filter: blur(3px) saturate(0.65);
  background: rgba(19, 13, 24, 0.46);
  animation: overlay-blur-enter 240ms cubic-bezier(.22,.8,.25,1);
}
.game-overlay-panel {
  position: relative;
  z-index: 1;
  width: min(96%, 380px);
  max-height: 96%;
  overflow-y: auto;
  text-align: left;
  padding: 1rem 0.6rem 2.5rem 2.7rem;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  animation: overlay-menu-enter 280ms cubic-bezier(.16,1,.3,1);
}
.game-overlay-panel::before {
  content: '';
  position: absolute;
  left: 1px;
  top: 14%;
  bottom: 24px;
  width: 50px;
  background: url('../assets/ui/pause-vine.avif') center / contain no-repeat;
  pointer-events: none;
  transform-origin: bottom center;
  animation: overlay-vine-sway 4s ease-in-out infinite alternate;
}
.game-overlay-actions .overlay-btn:nth-child(2n) { margin-left: 9px; width: calc(100% - 9px); }
.game-overlay-actions .overlay-btn:nth-child(3n) { margin-left: 3px; width: calc(100% - 3px); }
.game-overlay.mode-confirm .overlay-btn { font-size: clamp(1.2rem, 2.4vw, 1.65rem); }
.overlay-confirm-subtitle {
  display: block;
  margin-top: 2px;
  font-size: .62em;
  line-height: 1.2;
  font-weight: 500;
  -webkit-text-stroke: 1px #211525;
  text-shadow: 1px 1px 0 #211525;
}
@keyframes overlay-vine-sway { from { transform: rotate(-3deg); } to { transform: rotate(3deg); } }
@keyframes overlay-blur-enter {
  from { backdrop-filter: blur(0) saturate(1); -webkit-backdrop-filter: blur(0) saturate(1); background: rgba(19, 13, 24, 0); }
  to { backdrop-filter: blur(3px) saturate(.65); -webkit-backdrop-filter: blur(3px) saturate(.65); background: rgba(19, 13, 24, .46); }
}
@keyframes overlay-menu-enter {
  from { opacity: 0; transform: translate(-10px, 12px); }
  to { opacity: 1; transform: translate(0, 0); }
}
@keyframes overlay-select-shake {
  0%, 100% { transform: translate(0, 0) rotate(0); }
  20% { transform: translate(-2.2px, 1.2px) rotate(-.55deg); }
  40% { transform: translate(1.5px, -1.4px) rotate(.45deg); }
  60% { transform: translate(-1.2px, -.7px) rotate(-.3deg); }
  80% { transform: translate(.8px, .9px) rotate(.2deg); }
}
.game-overlay-actions .overlay-btn.selection-change { animation: overlay-select-shake 140ms linear; }
@media (prefers-reduced-motion: reduce) {
  .game-overlay-blur,
  .game-overlay-panel,
  .game-overlay-panel::before,
  .game-overlay-actions .overlay-btn.selection-change { animation: none; }
}
.game-overlay-title {
  font-family: var(--serif);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  letter-spacing: 0.06em;
  color: #f5eadb;
  paint-order: stroke fill;
  -webkit-text-stroke: 3px #211525;
  text-shadow: 3px 3px 0 #211525;
  margin: 0 0 1rem;
}
.game-overlay.mode-result .game-overlay-title {
  letter-spacing: 0.08em;
  font-size: clamp(1.8rem, 3.5vw, 2.5rem);
}
.overlay-result-summary { margin-bottom: .65rem; }
.result-context { margin: 0 0 .4rem; color: #cdbdcc; font-size: .75rem; line-height: 1.5; }
.result-score { margin: 0; display: flex; flex-direction: column; color: #f7e6ba; }
.result-score > span { font: italic .8rem var(--title-font); }
.result-score strong { font: 800 clamp(1.7rem, 4vw, 2.5rem)/1.2 var(--mono); overflow-wrap: anywhere; paint-order: stroke fill; -webkit-text-stroke: 2px #211525; }
.overlay-result-details { margin-bottom: .65rem; color: #ddd0df; }
.overlay-result-details .game-overlay-body { max-height: 20vh; font-size: .75rem; }
.game-overlay.mode-result .game-overlay-panel { display: flex; flex-direction: column; }
.game-overlay.mode-result .game-overlay-panel > * { flex-shrink: 0; }
.game-overlay.mode-result .overlay-result-details { flex-shrink: 0; min-height: 44px; }
.result-achievement { color: #a7dfbd; font: 700 .85rem var(--title-font); margin: .3rem 0 0; }
@media (max-width: 520px), (max-height: 700px) {
  .game-overlay.mode-result:not(.mode-confirm) .game-overlay-panel { padding-top: .4rem; padding-bottom: 1.8rem; }
  .game-overlay.mode-result .game-overlay-title { margin-bottom: .35rem; }
  .overlay-result-summary { margin-bottom: .2rem; }
  .overlay-result-details { margin-bottom: .2rem; }
  .overlay-result-details .game-overlay-body { height: 68px; max-height: 68px; margin-bottom: .2rem; }
  .game-overlay.mode-result .game-overlay-actions { gap: 0; }
}
.game-overlay-body {
  margin: 0 0 0.85rem;
  font-family: inherit;
  font-size: 0.78rem;
  line-height: 1.55;
  color: #d8cbb0;
  white-space: pre-wrap;
  text-align: left;
  max-height: 28vh;
  overflow-y: auto;
}
.game-overlay-body:empty { display: none; }
.game-overlay-actions {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.game-overlay-actions .overlay-btn {
  width: 100%;
  margin: 0;
  min-height: 44px;
  font-family: var(--title-font);
  font-size: clamp(1.15rem, 2.4vw, 1.65rem);
  font-weight: 800;
  text-align: left;
  padding: 0.35rem 0.7rem;
  color: #c9becb;
  background: transparent;
  border: 0;
  border-radius: 0;
  paint-order: stroke fill;
  -webkit-text-stroke: 3px #211525;
  text-shadow: 2px 2px 0 #211525;
}
.game-overlay-actions .overlay-btn.hidden { display: none !important; }
.game-overlay-actions .overlay-btn.selected,
.game-overlay-actions .overlay-btn:focus-visible {
  outline: none;
  color: #ffc1d2;
  background: transparent;
  box-shadow: none;
}
.game-overlay-hint {
  margin: 0.65rem 0 0;
  font-size: 0.68rem;
  color: #e1d4df;
  letter-spacing: 0.04em;
}

/* 版本号（主菜单 / 暂停右下角）
 * 注意：#screen-menu 继承 .screen 的 position:absolute + inset:0，
 * 已能作为绝对定位子元素的包含块，勿再写成 relative，否则会顶掉铺满视口布局。
 */
.version-badge {
  position: absolute;
  right: 14px;
  bottom: 12px;
  z-index: 5;
  margin: 0;
  padding: 2px 4px;
  font-family: var(--mono, ui-monospace, monospace);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: rgba(201, 184, 150, 0.72);
  /* 需可悬停，否则 title（build 号 / hash）不会弹出 */
  pointer-events: auto;
  cursor: default;
  user-select: none;
}
.version-badge-overlay {
  right: 12px;
  bottom: 10px;
  color: rgba(201, 184, 150, 0.78);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.65);
}
@keyframes flashPulse {
  from { opacity: 0.7; }
  to { opacity: 1; }
}

/* Letter reserved rail: outside the playfield, never an avoidance overlay. */
.letter-banner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "name timer" "progress bonus" "rate rate";
  gap: 2px 8px;
  width: 100%;
  padding: 4px 2px 8px;
  color: #f6eddd;
  font-family: var(--font);
  font-size: 12px;
  line-height: 1.25;
  pointer-events: none;
}
.letter-name { grid-area: name; font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.letter-remain { grid-area: progress; color: #9bd8e9; }
.letter-rate { grid-area: rate; font-size: 11px; color: #ded0da; }
.letter-bonus { grid-area: bonus; color: #f0b6d6; text-align: right; }
.letter-timer { grid-area: timer; font-size: 16px; font-weight: 700; text-align: right; color: #f0b6d6; }
.letter-remain, .letter-bonus, .letter-timer { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.letter-banner.hidden { display: none; }

/* ===== 右侧战斗 HUD ===== */
.panel-right {
  align-self: stretch;
  min-height: 0;
  color: var(--hud-text);
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: #7b8c80 transparent;
}
.score-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  padding: 16px 14px;
  background: transparent;
  border: 0;
  box-shadow: none;
}
.hud-heading { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px; align-items: center; }
.th-score-title { color: var(--hud-muted); font: 600 14px/1.2 var(--title-font); letter-spacing: .08em; }
.difficulty-sign { display: grid; gap: 4px; padding: 6px 10px; max-width: 170px; color: #eefbff; background: rgba(32, 61, 86, .76); clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%); }
.difficulty-sign > span { font: 10px var(--mono); letter-spacing: .06em; }
.difficulty-sign strong { font: 800 18px/1.35 var(--font); overflow-wrap: anywhere; text-shadow: 1px 1px 0 #141727, -1px -1px 0 #141727; }
#ui-difficulty { text-decoration: underline; text-decoration-color: var(--difficulty-color, #315f72); text-decoration-thickness: 3px; text-underline-offset: 4px; }
.stage-label { grid-column: 1 / -1; text-align: right; font: 12px var(--mono); color: var(--hud-muted); }
.mode-markers { display: flex; flex-wrap: wrap; gap: 5px; }
.hud-mode { color: #f5f0df; background: #406457; padding: 4px 9px; font: 12px/1.2 var(--mono); }
#ui-mode-replay { background: #355e78; }
#ui-mode-nomiss { background: #8c3d59; }
#ui-mode-stage { background: #785b32; }
.hidden { display: none !important; }
.stat-block { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.stat-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-width: 0; padding: 5px 0; color: var(--hud-text); font: 600 15px/1.4 var(--title-font); text-shadow: 1px 1px 0 #171626; }
.stat-row strong { min-width: 0; color: #fff7ec; font: 800 18px/1.4 var(--mono); font-variant-numeric: tabular-nums; text-align: right; overflow-wrap: anywhere; paint-order: stroke fill; -webkit-text-stroke: 2px #191728; text-shadow: 2px 2px 0 #191728; }
.stat-label { font-size: 18px; font-weight: 700; }
.stat-label small { display: block; font: 400 11px/1.4 var(--font); color: var(--hud-muted); }
.score-row { padding: 6px 0; background: transparent; border-bottom: 1px solid var(--hud-line-soft); }
.score-row strong { font-size: 26px; }
.score-compact { display: none; }
.resource-row { padding-block: 12px; border-bottom: 1px solid var(--hud-line-soft); }
.resource-control { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 8px; min-width: 0; }
.resource-cells { display: flex; gap: 4px; }
.resource-cell { width: 15px; height: 16px; flex: 0 0 15px; background: rgba(219, 206, 229, .22); clip-path: polygon(50% 22%, 64% 4%, 85% 4%, 100% 24%, 100% 44%, 50% 100%, 0 44%, 0 24%, 15% 4%, 36% 4%); }
.resource-cell.filled { background: var(--life-color); }
.bombs .resource-cell { clip-path: polygon(50% 0, 62% 34%, 100% 38%, 71% 61%, 80% 100%, 50% 77%, 20% 100%, 29% 61%, 0 38%, 38% 34%); }
.bombs .resource-cell.filled { background: var(--bomb-color); }
.resource-row .resource-count { font-size: 26px; line-height: 1; }
.lives .resource-count, .lives .stat-label { color: var(--life-color); }
.bombs .resource-count, .bombs .stat-label { color: var(--bomb-color); }
.resource-overflow { font: 12px var(--mono); color: #e9d8b5; white-space: nowrap; }
.edit-row { display: grid; grid-template-columns: auto auto minmax(0, 1fr); gap: 9px; padding-block: 8px; }
.edit-row .edit-value { color: var(--edit-color); font-size: 16px; }
.edit-meter { height: 12px; min-width: 0; overflow: hidden; border: 1px solid #9dcad3; background: rgba(39, 118, 139, .24); }
.edit-fill { height: 100%; width: 0; background: #72c4d8; transition: none; }
.edit-fill.full { background: #a1edf3; box-shadow: inset 0 0 0 2px #59c6d5; }
.combo-row { display: none; color: #edcb87; }
.combo-row.active { display: flex; }
.combo-row strong { color: #edcb87; }
.status-row { align-items: baseline; }
.status-row strong { font: 600 14px/1.5 var(--font); }
.tendency-values { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; }
#ui-chapter-tendency { color: #b9deed; font: 12px/1.2 var(--mono); white-space: nowrap; }
.hud-details { position: relative; border-top: 1px solid var(--hud-line-soft); }
.hud-details summary { display: none; min-height: 44px; cursor: pointer; list-style: none; color: #f4e6cc; font: 600 13px var(--font); }
.hud-details summary::-webkit-details-marker { display: none; }
.details-body { display: grid; gap: 2px; padding-top: 7px; }
.details-body .stat-row { font-size: 12px; }
.details-body .stat-row strong { font-size: 13px; }
.score-detail { display: none; }
.touch-keys { display: none; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.touch-btn { appearance: none; min-width: 0; min-height: 44px; padding: 8px 5px; color: #f6f0de; background: #315d64; border: 1px solid #24494e; border-radius: 0; cursor: pointer; font: 600 14px var(--font); touch-action: manipulation; user-select: none; }
.touch-btn.bomb { background: #3c7050; border-color: #295137; }
.touch-btn.pause { background: #79546a; border-color: #55384a; }
.touch-btn:active, .touch-btn.active { filter: brightness(1.2); transform: scale(.97); }
.touch-btn:focus-visible, .hud-details summary:focus-visible { outline: 2px solid #f3c486; outline-offset: 2px; }
@media (hover: hover) and (pointer: fine) { .touch-btn:hover { filter: brightness(1.1); } }
@media (pointer: coarse) { .touch-keys { display: grid; } }
@media (max-width: 1100px) and (orientation: landscape) {
  .game-layout { grid-template-columns: minmax(0, 1fr) minmax(220px, 34vw); gap: 16px; padding: 10px 16px 18px; }
  .panel-left { display: none; }
  .score-panel { padding: 10px; gap: 6px; }
  .th-score-title { font-size: 14px; }
  .difficulty-sign { padding: 4px 8px; }
  .difficulty-sign strong { font-size: 14px; }
  .stat-block { gap: 3px; }
  .resource-row { padding-block: 5px; }
  .touch-keys { display: grid; }
}
@media (orientation: portrait), (max-width: 520px) {
  #screen-game { overflow-y: auto; overflow-x: hidden; touch-action: pan-y; }
  .game-layout {
    grid-template-columns: 1fr;
    --playfield-width: calc(100vw - 24px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px));
    grid-template-rows: auto auto;
    align-content: start;
    height: auto;
    min-height: 100%;
    flex-shrink: 0;
    overflow: visible;
    touch-action: pan-y;
    padding: 10px 12px calc(18px + env(safe-area-inset-bottom, 0));
  }
  .panel-left { display: none; }
  .panel-center {
    --letter-height: 62px;
    container-type: normal;
    display: flex;
    flex: 0 0 auto;
    align-self: start;
    justify-content: flex-start;
    width: 100%;
    height: auto;
    min-height: calc(var(--letter-height) + var(--playfield-width) * 4 / 3 + 20px);
    padding: 0 0 20px;
  }
  .letter-track { width: 100%; height: 62px; flex: 0 0 62px; }
  .letter-banner { padding: 2px 0 6px; gap: 1px 6px; }
  .letter-name { font-size: 13px; }
  .letter-remain, .letter-bonus { font-size: 11px; }
  .letter-rate { font-size: 10px; }
  .playfield-wrap {
    width: var(--playfield-width);
    height: calc(var(--playfield-width) * 4 / 3);
    flex: 0 0 auto;
    aspect-ratio: 3 / 4;
  }
  .panel-right { align-self: start; width: 100%; overflow: visible; }
  #playfield, .touch-keys, .touch-btn { touch-action: none; }
  #ui-chapter-tendency { font-size: 10px; }
  .score-panel { position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 3px 4px; padding: 5px 6px; box-shadow: none; border-block-width: 1px; }
  .hud-heading { grid-column: 1 / 4; display: flex; gap: 4px; min-width: 0; }
  .th-score-title, .stage-label, .difficulty-sign > span { display: none; }
  .difficulty-sign { display: block; max-width: none; min-width: 0; padding: 2px 6px; background: rgba(74, 125, 131, .14); }
  .difficulty-sign strong { display: block; font: 600 12px/1.3 var(--font); white-space: normal; }
  .mode-markers { grid-column: 4; justify-content: end; align-items: center; }
  .hud-mode { font-size: 10px; padding: 2px 3px; }
  .stat-block { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 2px 8px; }
  .stat-row { padding: 1px 0; gap: 4px; font-size: 12px; line-height: 1.35; }
  .stat-row strong { font-size: 13px; }
  .score-row { grid-column: 1 / -1; padding: 2px 4px; }
  .score-row #ui-score { display: none; }
  .score-compact { display: block; }
  .resource-row { display: block; padding: 3px 0; border-bottom: 0; }
  .stat-label { display: block; font-size: 12px; }
  .stat-label small { display: none; }
  .resource-control { grid-template-columns: minmax(0, 1fr) auto auto; gap: 3px; }
  .resource-cells { gap: 2px; }
  .resource-cell { width: 9px; height: 8px; flex-basis: 9px; }
  .resource-row .resource-count { font-size: 16px; }
  .resource-overflow { font-size: 10px; }
  .edit-row { grid-column: 1 / -1; grid-template-columns: auto auto minmax(0, 1fr); padding: 2px 0; }
  .edit-row .edit-value { font-size: 13px; }
  .edit-meter { height: 8px; }
  .combo-row { grid-column: 1; }
  .status-row:last-child { grid-column: 2; grid-row: 4; }
  .status-row:not(:last-child) { grid-column: 1 / -1; }
  .score-detail { display: flex; }
  .status-row strong { font-size: 12px; line-height: 1.35; }
  .hud-details { grid-column: 1; grid-row: auto; border: 0; align-self: stretch; }
  .hud-details summary { display: flex; align-items: center; justify-content: center; padding: 4px; text-align: center; border: 1px solid #667f73; font-size: 12px; }
  .hud-details[open] .details-body { position: absolute; bottom: 48px; left: 0; width: min(290px, calc(100vw - 36px)); max-height: 45dvh; overflow-y: auto; padding: 10px; background: var(--hud-panel); border: 1px solid #b9a581; box-shadow: 0 4px 18px #14172788; z-index: 40; touch-action: pan-y; }
  .touch-keys { grid-column: 2 / -1; display: grid; gap: 4px; }
  .touch-btn { font-size: 13px; padding: 5px 2px; }
}
@media (max-width: 340px) {
  .game-layout { --playfield-width: calc(100vw - 16px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)); padding-inline: 8px; }
  .score-panel { padding-inline: 4px; }
  .stat-block { column-gap: 6px; }
  .resource-cell { width: 8px; flex-basis: 8px; }
}

/* ===== Debug（Tweakpane 面板 + 角标 HUD；控制台 owDebug()） ===== */
/* 面板本体由 Tweakpane 生成（#debug-panel）；仅保留版面角标 */
.debug-hud {
  position: fixed;
  left: 8px;
  bottom: 8px;
  z-index: 10040;
  max-width: min(92vw, 520px);
  padding: 0.28rem 0.5rem;
  background: rgba(0, 0, 0, 0.72);
  border: 1px solid rgba(251, 191, 36, 0.35);
  color: #fde68a;
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.35;
  pointer-events: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.debug-hud.hidden { display: none; }

/* Ranking */
.ranking-panel { max-height: 90vh; overflow: hidden; }
.ranking-panel .th-panel-frame {
  display: flex;
  flex-direction: column;
  max-height: 90vh;
}
.ranking-diffs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.6rem;
}
.ranking-diff-btn {
  flex: 1 1 auto;
  min-width: 3.2rem;
  padding: 0.4rem 0.5rem;
  background: rgba(12, 14, 20, 0.55);
  border: 1px solid var(--focus-border-soft);
  color: #d8cbb0;
  border-radius: 4px;
  cursor: pointer;
  font: inherit;
  font-size: 0.8rem;
  letter-spacing: 0.03em;
}
.ranking-diff-btn.selected,
.ranking-diff-btn:hover {
  border-color: var(--focus-border);
  background: var(--focus-bg);
  box-shadow: 0 0 0 1px var(--focus-ring);
}
.ranking-list {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  overflow-y: auto;
  max-height: 52vh;
  text-align: left;
  padding: 0.15rem 0.2rem 0.5rem;
  margin-bottom: 0.65rem;
}
.ranking-row {
  display: grid;
  grid-template-columns: 2rem 1fr auto auto auto auto;
  gap: 0.5rem;
  align-items: center;
  padding: 0.45rem 0.6rem;
  background: rgba(12, 14, 20, 0.55);
  border: 1px solid var(--focus-border-soft);
  border-radius: 4px;
  font-size: 0.85rem;
  color: #e8dcc4;
}
.ranking-row.selected {
  border-color: var(--focus-border);
  background: var(--focus-bg);
  box-shadow: 0 0 0 1px var(--focus-ring);
}
.ranking-rank { color: var(--gold2); font-family: var(--mono, monospace); }
.ranking-name { color: #f3e7cd; font-weight: 600; }
.ranking-player { color: #b8a888; font-size: 0.78rem; }
.ranking-route { color: #9ec9e8; font-size: 0.78rem; }
/* 排行榜「续」徽标：续关对局 */
.rk-badge {
  display: inline-block;
  margin-left: 0.3rem;
  padding: 0 0.3rem;
  border-radius: 3px;
  font-size: 0.68rem;
  line-height: 1.3;
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, 0.55);
  background: rgba(251, 191, 36, 0.12);
  vertical-align: middle;
}
.ranking-score { color: #f3e7cd; font-family: var(--mono, monospace); text-align: right; }
.ranking-date { color: #8a7c62; font-size: 0.75rem; }
.ranking-empty { color: #8a7c62; text-align: center; padding: 1rem 0; }

/* Replay */
.replay-panel { max-height: 90vh; overflow: hidden; }
.replay-panel .th-panel-frame {
  display: flex;
  flex-direction: column;
  max-height: 90vh;
}
.replay-status {
  margin: 0 0 0.5rem;
  font-size: 0.82rem;
  color: #a89878;
  text-align: left;
}
.replay-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  overflow-y: auto;
  max-height: 52vh;
  text-align: left;
  padding: 0.15rem 0.2rem 0.5rem;
  margin-bottom: 0.65rem;
}
.replay-row {
  display: flex;
  align-items: stretch;
  gap: 0.4rem;
}
.replay-item {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  gap: 0.6rem;
  align-items: center;
  flex: 1 1 auto;
  min-width: 0;
  text-align: left;
  background: rgba(12, 14, 20, 0.55);
  border: 1px solid var(--focus-border-soft);
  color: #e8dcc4;
  padding: 0.5rem 0.7rem;
  border-radius: 4px;
  cursor: pointer;
  font: inherit;
}
.replay-row.selected .replay-item {
  border-color: var(--focus-border);
  background: var(--focus-bg);
  box-shadow: 0 0 0 1px var(--focus-ring);
}
.replay-del {
  flex: 0 0 auto;
  min-width: 3.4rem;
  padding: 0 0.6rem;
  background: rgba(12, 14, 20, 0.55);
  border: 1px solid var(--focus-border-soft);
  color: #d8cbb0;
  border-radius: 4px;
  cursor: pointer;
  font: inherit;
  font-size: 0.82rem;
  white-space: nowrap;
}
.replay-del:hover {
  border-color: var(--focus-border);
  background: var(--focus-bg);
}
.replay-del.confirming {
  color: #fca5a5;
  border-color: #f87171;
  background: rgba(80, 22, 22, 0.55);
  box-shadow: 0 0 0 1px rgba(248, 113, 113, 0.4);
}
.replay-export { color: #9ec9e8; }
.replay-meta { font-size: 0.82rem; color: #d8cbb0; }
.replay-score { font-family: var(--mono, monospace); color: #f3e7cd; text-align: right; }
.replay-date { font-size: 0.75rem; color: #8a7c62; }
.replay-tag {
  font-size: 0.72rem;
  padding: 0.05rem 0.35rem;
  border-radius: 3px;
  border: 1px solid rgba(120, 180, 220, 0.45);
  color: #9ec9e8;
}
.replay-empty { color: #8a7c62; text-align: center; padding: 1rem 0; }

/* Overlay 排行榜昵称输入 */
.overlay-rank {
  margin: 0.4rem 0 0.75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
}
.overlay-rank-title {
  margin: 0;
  color: var(--gold2);
  font-size: 0.9rem;
  letter-spacing: 0.05em;
}
.overlay-rank input {
  width: 7rem;
  padding: 0.35rem 0.5rem;
  text-align: center;
  font: inherit;
  font-size: 1rem;
  letter-spacing: 0.35em;
  color: #f3e7cd;
  background: rgba(12, 14, 20, 0.7);
  border: 1px solid var(--focus-border-mid);
  border-radius: 4px;
}
.overlay-rank input:focus {
  outline: none;
  border-color: var(--focus-border);
  box-shadow: 0 0 0 1px var(--focus-ring);
}

/* Score ranking 结算弹层 */
.score-ranking {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.score-ranking.hidden { display: none; }
.score-ranking-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 8, 12, 0.74);
  backdrop-filter: blur(3px);
}
.score-ranking-panel {
  position: relative;
  width: min(92vw, 520px);
  max-height: 90vh;
  overflow: hidden;
}
.score-ranking-panel .th-panel-frame {
  display: flex;
  flex-direction: column;
  max-height: 90vh;
}
.sr-diff {
  margin: 0 0 0.5rem;
  font-size: 0.85rem;
  color: var(--gold2);
  text-align: center;
  letter-spacing: 0.05em;
}
.sr-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  overflow-y: auto;
  max-height: 40vh;
  text-align: left;
  padding: 0.15rem 0.2rem 0.5rem;
  margin-bottom: 0.6rem;
}
.sr-row {
  display: grid;
  grid-template-columns: 2rem 1fr auto auto auto;
  gap: 0.5rem;
  align-items: center;
  padding: 0.4rem 0.6rem;
  background: rgba(12, 14, 20, 0.55);
  border: 1px solid var(--focus-border-soft);
  border-radius: 4px;
  font-size: 0.85rem;
  color: #e8dcc4;
}
.sr-row.is-current {
  border-color: var(--gold2);
  background: rgba(46, 38, 18, 0.62);
  box-shadow: 0 0 0 1px var(--focus-ring);
}
.sr-rank { color: var(--gold2); font-family: var(--mono, monospace); }
.sr-name { color: #f3e7cd; font-weight: 600; }
.sr-name-input {
  width: 100%;
  min-width: 0;
  padding: 0.2rem 0.4rem;
  text-align: center;
  font: inherit;
  font-size: 0.85rem;
  letter-spacing: 0.3em;
  color: #f3e7cd;
  background: rgba(12, 14, 20, 0.7);
  border: 1px solid var(--focus-border-mid);
  border-radius: 3px;
}
.sr-name-input:focus {
  outline: none;
  border-color: var(--focus-border);
  box-shadow: 0 0 0 1px var(--focus-ring);
}
.sr-player { color: #b8a888; font-size: 0.78rem; }
.sr-route { color: #9ec9e8; font-size: 0.78rem; }
.sr-score { color: #f3e7cd; font-family: var(--mono, monospace); text-align: right; }
/* ===== Battle-only visual layer: dark Japanese gothic print frame + transparent HUD ===== */
#screen-game {
  --stage-paper: #2f2731;
  --stage-wash: #201922;
  --stage-ink: #0b090e;
  --stage-red: #923747;
  --stage-gold: #c5baaa;
  --stage-blue: #6f9a9e;
  --hud-panel: transparent;
  --hud-panel-soft: transparent;
  --hud-text: #f0e8d8;
  --hud-muted: #c0b6a8;
  --hud-line: rgba(221, 209, 190, 0.3);
  --hud-line-soft: rgba(221, 209, 190, 0.15);
  --life-color: #df91ad;
  --bomb-color: #a8c792;
  --edit-color: #79cfd0;
  background-color: #141117;
}


/* One quiet print field: the decoration is kept at the peripheral edges so the playfield and HUD stay legible. */
#screen-game .game-backdrop {
  background-color: #271e28;
  background-image: url('../assets/bg/battle-print.avif');
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
  opacity: 1;
}
#screen-game .game-backdrop::before,
#screen-game .game-backdrop::after {
  content: none;
}
#screen-game #bg3d {
  opacity: 0.025;
  mix-blend-mode: normal;
  filter: grayscale(0.55) sepia(0.35) contrast(1.05);
}
#screen-game .overlay-fx {
  background: none;
  opacity: 0;
  mix-blend-mode: normal;
}

#screen-game .title-rail {
  color: #d9d0c2;
  text-shadow: 1px 1px 0 #0b090e;
}
#screen-game .title-rail::before {
  background: #71303b;
  box-shadow: 1px 0 0 rgba(182, 171, 161, 0.28);
}
#screen-game .title-rail::after {
  background-color: transparent;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 76 12'%3E%3Cpath d='M1 9c9-5 16-5 24-1s14 2 20-2 15-4 30 0' fill='none' stroke='%238f3544' stroke-width='1.3'/%3E%3Cpath d='M16 7l-4-5m4 5 5-5M40 7l-4-5m4 5 5-5M63 8l-4-5m4 5 5-5' fill='none' stroke='%23a79b95' stroke-width='.8'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: 100% 100%;
  opacity: 0.72;
  box-shadow: none;
}
#screen-game .game-title {
  text-shadow: none;
}
#screen-game .game-title-glyph {
  -webkit-text-stroke: 1.5px #e6daca;
  paint-order: stroke fill;
  text-shadow: -2px -2px 0 #100b12, 2px -2px 0 #100b12, -2px 2px 0 #100b12, 4px 4px 0 #100b12;
}
#screen-game .game-title-glyph-1,
#screen-game .game-title-glyph-2 {
  color: #ad495d;
  text-shadow: 2px 2px 0 #100b12, -2px -1px 0 #100b12, 3px 3px 0 #100b12;
}
#screen-game .game-title-glyph-3,
#screen-game .game-title-glyph-4,
#screen-game .game-title-glyph-5 {
  color: #e5dfd3;
  text-shadow: 2px 2px 0 #100b12, -2px -1px 0 #100b12, 3px 3px 0 #100b12;
}
#screen-game .game-title-glyph-1 { transform: translateX(-0.08em) rotate(-4deg) scale(1.12); }
#screen-game .game-title-glyph-2 { transform: translateX(0.10em) rotate(3deg) scale(1.18); }
#screen-game .game-title-glyph-3 { transform: translateX(-0.10em) rotate(-2deg) scale(0.98); }
#screen-game .game-title-glyph-4 { transform: translateX(0.08em) rotate(3deg) scale(1.10); }
#screen-game .game-title-glyph-5 { transform: translateX(-0.04em) rotate(-3deg) scale(1.08); }
#screen-game .game-subtitle {
  color: #a79d96;
  text-shadow: 1px 1px 0 #0c0a0f;
}
#screen-game .title-rule {
  background: #6c323d;
  box-shadow: 1px 0 0 rgba(166, 153, 143, 0.26);
}

#screen-game .playfield-wrap {
  outline: 1px solid rgba(153, 143, 137, 0.72);
  box-shadow: 3px 5px 0 rgba(7, 6, 10, 0.56);
}
#screen-game .playfield-wrap::before {
  border-color: rgba(156, 146, 140, 0.46);
  box-shadow: inset 0 0 0 1px rgba(42, 31, 39, 0.8);
}
#screen-game .playfield-wrap::after {
  background: #6e2c39;
  box-shadow: 38px -7px 0 rgba(137, 125, 119, 0.28);
}

#screen-game .score-panel {
  position: relative;
  background: transparent;
  box-shadow: none;
}
#screen-game .score-panel::before,
#screen-game .score-panel::after {
  content: "";
  position: absolute;
  pointer-events: none;
}
#screen-game .score-panel::before {
  inset: 0 0 auto;
  height: 1px;
  background: rgba(166, 153, 143, 0.26);
  opacity: 0.82;
}
#screen-game .score-panel::after {
  right: 0;
  bottom: 0;
  width: 28%;
  height: 1px;
  background: rgba(111, 45, 57, 0.5);
  opacity: 0.72;
}
#screen-game .hud-heading,
#screen-game .stat-block,
#screen-game .score-row,
#screen-game .resource-row,
#screen-game .edit-row {
  background: transparent;
  box-shadow: none;
}
#screen-game .th-score-title {
  color: #d4c7b8;
  text-shadow: 1px 1px 0 #0c0a0f;
}
#screen-game .difficulty-sign {
  color: #c7d9de;
  background: transparent;
  box-shadow: none;
}
#screen-game .difficulty-sign strong {
  paint-order: stroke fill;
  -webkit-text-stroke: 2px #0c0a0f;
  text-shadow: 1px 1px 0 #0c0a0f;
}
#screen-game .stage-label {
  color: #aaa19a;
  text-shadow: 1px 1px 0 #0c0a0f;
}
#screen-game .hud-mode {
  color: #d9d0c2;
  background: rgba(37, 29, 37, 0.76);
  box-shadow: inset 0 -1px 0 rgba(160, 148, 139, 0.24), 1px 1px 0 rgba(8, 7, 11, 0.48);
}
#screen-game #ui-mode-replay { background: rgba(44, 63, 52, 0.72); }
#screen-game #ui-mode-nomiss { background: rgba(103, 39, 50, 0.76); }
#screen-game #ui-mode-stage { background: rgba(65, 46, 48, 0.78); }
#screen-game .stat-row {
  color: var(--hud-text);
  text-shadow: -1px -1px 0 #0c0a0f, 1px -1px 0 #0c0a0f, -1px 1px 0 #0c0a0f, 1px 1px 0 #0c0a0f;
}
#screen-game .stat-row strong {
  color: #fff8e8;
  -webkit-text-stroke: 2.5px #0c0a0f;
  paint-order: stroke fill;
  text-shadow: 2px 2px 0 #0c0a0f;
}
#screen-game .stat-label,
#screen-game .stat-label small {
  color: #ddd2c1;
  text-shadow: -1px -1px 0 #0c0a0f, 1px -1px 0 #0c0a0f, -1px 1px 0 #0c0a0f, 1px 1px 0 #0c0a0f;
}
#screen-game .stat-label { font-weight: 800; }
#screen-game .stat-label small { color: #a79d96; }
#screen-game .resource-row {
  border-bottom-color: rgba(164, 151, 143, 0.2);
}
#screen-game .resource-row.lives {
  border-bottom-color: rgba(193, 123, 146, 0.3);
}
#screen-game .resource-row.bombs {
  border-bottom-color: rgba(142, 174, 137, 0.3);
}
#screen-game .resource-row.lives .stat-label,
#screen-game .resource-row.lives .stat-label small,
#screen-game .resource-row.lives .resource-count,
#screen-game .resource-row.lives .resource-overflow {
  color: var(--life-color);
}
#screen-game .resource-row.bombs .stat-label,
#screen-game .resource-row.bombs .stat-label small,
#screen-game .resource-row.bombs .resource-count,
#screen-game .resource-row.bombs .resource-overflow {
  color: var(--bomb-color);
}
#screen-game .resource-cell {
  background: rgba(190, 172, 186, 0.38);
  box-shadow: inset 0 0 0 1px rgba(12, 10, 15, 0.82);
}
#screen-game .resource-cell.filled {
  background: var(--life-color);
  box-shadow: inset 0 0 0 1px rgba(230, 210, 192, 0.6), inset 0 -1px 0 rgba(67, 28, 39, 0.44);
}
#screen-game .bombs .resource-cell.filled {
  background: var(--bomb-color);
  box-shadow: inset 0 0 0 1px rgba(219, 216, 188, 0.58), inset 0 -1px 0 rgba(38, 57, 39, 0.42);
}
#screen-game .edit-row {
  border-bottom-color: rgba(126, 184, 186, 0.5);
}
#screen-game .edit-row .stat-label,
#screen-game .edit-row .stat-label small,
#screen-game .edit-row .edit-value {
  color: var(--edit-color);
}
#screen-game .edit-row .edit-value {
  -webkit-text-stroke: 2px #0c0a0f;
  paint-order: stroke fill;
  text-shadow: 1px 1px 0 #0c0a0f;
}
#screen-game .edit-meter {
  border-color: rgba(126, 184, 186, 0.62);
  background: rgba(30, 48, 48, 0.46);
  box-shadow: inset 0 0 0 1px rgba(12, 10, 15, 0.82);
}
#screen-game .edit-fill {
  background: var(--edit-color);
  box-shadow: inset 0 0 0 1px rgba(212, 223, 205, 0.38);
}
#screen-game .edit-fill.full {
  background: #83b8b3;
  box-shadow: inset 0 0 0 1px #cad4c2;
}
#screen-game .resource-overflow {
  text-shadow: 1px 1px 0 #0c0a0f;
}
#screen-game .score-row {
  border-bottom-color: rgba(164, 151, 143, 0.2);
}
#screen-game .combo-row { color: #b89a68; text-shadow: 1px 1px 0 #0c0a0f; }
#screen-game .combo-row strong { color: #d0b982; text-shadow: 1px 1px 0 #0c0a0f; }
#screen-game .hud-details {
  border-top-color: rgba(164, 151, 143, 0.18);
  box-shadow: none;
}
#screen-game .hud-details summary {
  color: #d4c7b8;
  text-shadow: 1px 1px 0 #0c0a0f;
}
#screen-game #ui-chapter-tendency {
  color: #9fb5ac;
  text-shadow: 1px 1px 0 #0c0a0f;
}
#screen-game .touch-btn {
  color: #ddd2c1;
  background: rgba(35, 27, 35, 0.94);
  border-color: #766c69;
  box-shadow: 2px 3px 0 rgba(8, 7, 11, 0.64);
  text-shadow: 1px 1px 0 #0c0a0f;
}
#screen-game .touch-btn.bomb {
  background: rgba(46, 65, 50, 0.94);
  border-color: #66816a;
}
#screen-game .touch-btn.pause {
  background: rgba(74, 33, 43, 0.94);
  border-color: #86515b;
}
#screen-game .touch-btn:focus-visible { outline-color: #b9aea4; }
#screen-game .letter-banner { filter: none; text-shadow: 1px 1px 0 #0c0a0f; }
#screen-game .letter-name { color: #bca56f; }
#screen-game .letter-remain { color: #91ad8d; }
#screen-game .letter-rate { color: #b1a49b; }
#screen-game .letter-bonus,
#screen-game .letter-timer { color: #c17b92; }

/* Desktop hierarchy; compact layouts retain their responsive rules. */
@media (min-width: 1101px) and (orientation: landscape) {
  #screen-game .game-title { transform: translateX(18px) scale(1.65, 1.5); transform-origin: center; }
  #screen-game .game-subtitle { transform: translateX(55px); color: #f0d9dd; }
  #screen-game .score-panel { gap: 18px; }
  #screen-game .th-score-title { color: #efe1e5; }
  #screen-game .difficulty-sign { background: transparent; }
  #screen-game .difficulty-sign strong { font-size: 26px; line-height: 1.15; }
  #screen-game .score-row,
  #screen-game .resource-row,
  #screen-game .edit-row { background: transparent; }
  #screen-game .score-row { border-bottom: 2px solid #dccfd9; }
  #screen-game .score-row > span { font-size: 26px; line-height: 1.2; font-weight: 900; }
  #screen-game .score-row strong { font-size: 34px; line-height: 1.15; }
  #screen-game .resource-row { padding-block: 16px; }
  #screen-game .resource-row .stat-label { font-size: 27px; line-height: 1.2; -webkit-text-stroke: 3px #170d1b; paint-order: stroke fill; }
  #screen-game .resource-row .stat-label small { font-size: 12px; }
  #screen-game .resource-row.lives { border-bottom: 2px solid #e79ac8; }
  #screen-game .resource-row.bombs { border-bottom: 2px solid #a7d9a1; }
  #screen-game .resource-control { gap: 5px; }
  #screen-game .resource-cells { gap: 3px; }
  #screen-game .resource-cell { width: 18px; height: 22px; flex-basis: 18px; background: #534752; }
  #screen-game .resource-cell.filled { background: #ffedf9; }
  #screen-game .bombs .resource-cell.filled { background: #c5ffc9; }
  #screen-game .resource-count { font-size: 28px; }
  #screen-game .edit-row { border-bottom: 2px solid #99d2da; padding-block: 12px; }
  #screen-game .edit-row .stat-label { font-size: 23px; }
  #screen-game .edit-value { font-size: 22px; }
  #screen-game .status-row { font-size: 17px; }
  #screen-game .hud-details { opacity: 1; border-top: 1px solid rgba(235,210,225,.5); }
  #screen-game .hud-details .stat-row { padding-block: 3px; color: #e3d6df; }
  #screen-game .hud-details .stat-row strong { font-size: 14px; color: #e3d6df; }
}
@media (min-width: 1101px) and (max-height: 700px) and (orientation: landscape) {
  #screen-game .score-panel { gap: 8px; padding-block: 8px; }
  #screen-game .stat-block { gap: 3px; }
  #screen-game .resource-row { padding-block: 7px; }
  #screen-game .edit-row { padding-block: 6px; }
  #screen-game .hud-heading { gap: 4px; }
  #screen-game .difficulty-sign { padding-block: 3px; }
  #screen-game .difficulty-sign strong { font-size: 22px; }
  #screen-game .hud-details .stat-row { padding-block: 1px; }
}

/* Selection screens share one stationary cathedral backdrop and overlay. */
#screen-difficulty,
#screen-player-select {
  padding: 0;
  overflow: hidden;
  background: #302432 url('../assets/bg/difficulty-cathedral.avif') center / cover no-repeat;
}
#screen-difficulty.active,
#screen-player-select.active { display: block; }
#screen-difficulty .menu-bg,
#screen-player-select .menu-bg {
  background: rgba(13, 9, 24, .24);
}
#screen-difficulty .th-panel,
#screen-player-select .th-panel,
#screen-difficulty .th-panel-frame,
#screen-player-select .th-panel-frame {
  width: 100%;
  height: 100%;
}
#screen-difficulty .th-panel-frame,
#screen-player-select .th-panel-frame {
  position: relative;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}
#screen-difficulty .th-panel-frame::before,
#screen-difficulty .th-panel-frame::after,
#screen-player-select .th-panel-frame::before,
#screen-player-select .th-panel-frame::after { display: none; }
#screen-difficulty .panel-title,
#screen-player-select .panel-title {
  position: absolute;
  top: 3vh;
  left: 0;
  z-index: 3;
  width: 100%;
  color: #fff1dd;
  font-size: clamp(1.8rem, 4.5vw, 3.8rem);
  text-align: center;
  pointer-events: none;
}

/* Difficulty ranks are positioned around the viewport midpoint for WAAPI exit/entry. */
#screen-difficulty .diff-list {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: block;
  margin: 0;
  padding: 0;
  clip-path: inset(max(100px, 14vh) 0 0);
}
#screen-difficulty .difficulty-focus-band {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 1;
  width: min(68vw, 680px);
  height: 196px;
  transform: translate(-50%, -50%) rotate(var(--band-angle, 0deg));
}
#screen-difficulty .diff-btn:nth-child(n) {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(54vw, 610px);
  margin: 0;
  padding: 12px 18px;
  border: 0;
  background: transparent;
  text-align: center;
  transform: translate(calc(-50% + var(--rank-x, 0px)), calc(-50% + var(--rank-y, 0px)));
  opacity: var(--rank-opacity, .1);
  transition: none;
  will-change: transform, opacity;
}
#screen-difficulty .diff-btn.selected { opacity: 1; background: transparent; }
#screen-difficulty .diff-btn::before { display: none; }
#screen-difficulty .diff-name {
  order: -1;
  color: #fff;
  font-family: var(--font);
  font-size: clamp(1.5rem, 3.5vw, 2.8rem);
  font-weight: 900;
  paint-order: stroke fill;
  -webkit-text-stroke: 2px #29202b;
}
#screen-difficulty .diff-rank {
  font-family: var(--title-font);
  font-size: clamp(1.7rem, 3.8vw, 3.1rem);
  line-height: 1.1;
  letter-spacing: .02em;
}
#screen-difficulty .diff-desc {
  color: #fff;
  font-size: clamp(.85rem, 1.6vw, 1.25rem);
  font-weight: 800;
  text-shadow: 1px 2px 0 #211626;
}
#screen-difficulty .diff-meta { font-size: .72rem; }
#screen-difficulty:has(.diff-btn[data-diff="extra"]) .difficulty-focus-band {
  height: var(--extra-band-height, 240px);
}
#screen-player-select .player-focus-band {
  position: absolute;
  left: 68%;
  top: 50%;
  z-index: 1;
  width: 46vw;
  height: 0;
  transform: translate(-50%, -50%) rotate(0deg);
}

/* Player stage: two colored silhouette masks remain visible; only their controls receive input. */
#screen-player-select .player-cards {
  position: absolute;
  inset: 0;
  display: block;
  pointer-events: none;
}
#screen-player-select .player-card,
#screen-player-select .player-card.selected {
  position: absolute;
  inset: 0;
  z-index: 3;
  width: 100%;
  min-height: 0;
  padding: 0;
  border: 0;
  outline: none;
  background: transparent;
  box-shadow: none;
  pointer-events: none;
  transition: none;
}
#screen-player-select .player-card.current-player { z-index: 2; }
#screen-player-select .player-card .player-portrait {
  display: block;
  position: absolute;
  left: 0;
  top: 20%;
  width: 32vw;
  height: 72%;
  max-height: none;
  margin: 0;
  border: 0;
  background: #a4d8d5;
  mask: url('../assets/ui/player-placeholder.svg') center / contain no-repeat;
  -webkit-mask: url('../assets/ui/player-placeholder.svg') center / contain no-repeat;
  transform: translateX(-50%) scale(.64);
  filter: blur(3px);
  opacity: .36;
  pointer-events: auto;
  cursor: pointer;
  transition: none;
  will-change: transform, filter, opacity;
}
#screen-player-select .player-card[data-player="shama"] .player-portrait { background: #d3b3e4; }
#screen-player-select .player-card.current-player .player-portrait {
  transform: translateX(24%) scale(1);
  filter: none;
  opacity: 1;
}
#screen-player-select .player-card h3,
#screen-player-select .player-card p {
  position: absolute;
  left: 45%;
  width: 46%;
  margin: 0;
  pointer-events: none;
  opacity: 0;
  transform: translateX(35px);
  transition: none;
  will-change: transform, opacity;
  cursor: pointer;
}
#screen-player-select .player-card h3 {
  top: 29%;
  color: #fff1dd;
  font-size: clamp(2rem, 4.5vw, 4rem);
  text-align: center;
  text-shadow: 3px 3px #211725;
}
#screen-player-select .player-card p {
  top: 43%;
  padding: 2rem 1rem;
  color: #f2e8e7;
  font-size: clamp(1rem, 2vw, 1.7rem);
  text-align: center;
}
#screen-player-select .player-card.current-player h3,
#screen-player-select .player-card.current-player p {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

@media (max-width: 560px) {
  #screen-player-select .player-focus-band { left: 72%; width: 50vw; }
  #screen-difficulty .difficulty-focus-band { width: 88vw; height: 132px; }
  #screen-difficulty .diff-btn:nth-child(n) { width: 88vw; padding: 8px; }
  #screen-difficulty .diff-desc { max-width: 29ch; }
  #screen-player-select .panel-title { font-size: 1.8rem; }
  #screen-player-select .player-card .player-portrait { width: 52vw; height: 52%; top: 18%; }
  #screen-player-select .player-card.current-player .player-portrait { transform: translateX(4%) scale(1); }
  #screen-player-select .player-card h3 { left: 47%; top: 25%; width: 50%; font-size: 1.6rem; }
  #screen-player-select .player-card p { left: 47%; top: 37%; width: 50%; padding: 1rem .4rem; font-size: .9rem; }
}

#screen-player-select.selection-arriving { background: transparent; }
#screen-player-select.selection-arriving .menu-bg { visibility: hidden; }
#screen-difficulty .diff-btn:nth-child(n) { transition: transform 300ms cubic-bezier(.22,1,.36,1), opacity 300ms cubic-bezier(.22,1,.36,1); }
#screen-difficulty .difficulty-focus-band { transition: transform 300ms cubic-bezier(.22,1,.36,1); }
#screen-player-select .player-card .player-portrait { transition: transform 450ms cubic-bezier(.22,1,.36,1), filter 450ms cubic-bezier(.22,1,.36,1), opacity 450ms cubic-bezier(.22,1,.36,1); }
#screen-player-select .player-card h3,
#screen-player-select .player-card p { transition: transform 450ms cubic-bezier(.22,1,.36,1), opacity 450ms cubic-bezier(.22,1,.36,1); }
@media (prefers-reduced-motion: reduce) {
  #screen-difficulty .diff-btn:nth-child(n),
  #screen-difficulty .difficulty-focus-band,
  #screen-player-select .player-card .player-portrait,
  #screen-player-select .player-card h3,
  #screen-player-select .player-card p { transition: none; }
}

/* Mode choice shares the stationary selection stage. */
#screen-mode-select { padding: 0; overflow: hidden; background: #302432 url('../assets/bg/difficulty-cathedral.avif') center / cover no-repeat; }
#screen-mode-select.active { display: block; }
#screen-mode-select .menu-bg { background: rgba(13,9,24,.24); }
#screen-mode-select .th-panel,
#screen-mode-select .th-panel-frame { width: 100%; height: 100%; }
#screen-mode-select .th-panel-frame { position: relative; padding: 0; border: 0; background: transparent; box-shadow: none; }
#screen-mode-select .th-panel-frame::before,
#screen-mode-select .th-panel-frame::after { display: none; }
#screen-mode-select .panel-title { position: absolute; top: 3vh; left: 0; z-index: 3; width: 100%; color: #fff1dd; font-size: clamp(1.8rem,4.5vw,3.8rem); text-align: center; pointer-events: none; }
#screen-mode-select .mode-focus-band { position: absolute; left: 50%; top: 50%; z-index: 1; width: min(78vw,780px); height: 210px; transform: translate(-50%,-50%) rotate(var(--mode-band-angle,0deg)); transition: transform 300ms cubic-bezier(.22,1,.36,1); }
#screen-mode-select .mode-btn { position: absolute; top: 50%; left: 50%; display: flex; flex-direction: column; align-items: center; gap: .25rem; width: min(70vw,700px); padding: 12px 18px; border: 0; background: transparent; color: #fff; text-align: center; transform: translate(-50%,calc(-50% + var(--mode-y,0px))); opacity: var(--mode-opacity,.3); transition: transform 300ms cubic-bezier(.22,1,.36,1),opacity 300ms cubic-bezier(.22,1,.36,1); }
#screen-mode-select .mode-name { font: 900 clamp(1.5rem,3.5vw,2.8rem) var(--font); -webkit-text-stroke: 2px #29202b; paint-order: stroke fill; }
#screen-mode-select .mode-rank { font: clamp(2rem,5vw,4rem) Georgia,serif; color: #a4d8d5; }
#screen-mode-select [data-mode="nomiss"] .mode-rank { color: #d3b3e4; }
#screen-difficulty.selection-arriving { background: transparent; }
#screen-mode-select.selection-arriving .menu-bg,
#screen-difficulty.selection-arriving .menu-bg { visibility: hidden; }
@media(max-width:560px) {
  #screen-mode-select .mode-btn { width: 90vw; padding: 8px; }
  #screen-mode-select .mode-focus-band { width: 94vw; height: 170px; }
  #screen-mode-select .mode-desc { max-width: 27ch; }
}
@media(prefers-reduced-motion:reduce) {
  #screen-mode-select .mode-btn,
  #screen-mode-select .mode-focus-band { transition: none; }
}
@media(max-width:560px) {
  #screen-mode-select .mode-list { clip-path: inset(65px 0 0); }
}

#screen-mode-select .mode-list { position: absolute; inset: 0; z-index: 2; }
#screen-player-select .player-cards { z-index: 2; }
:is(#screen-mode-select,#screen-difficulty,#screen-player-select).selection-in-motion { background: transparent; z-index: 2; }
:is(#screen-mode-select,#screen-difficulty,#screen-player-select).selection-in-motion .menu-bg { visibility: hidden; }
.selection-preparing .selection-focus-band { transition: none !important; }
/* ===== TH14/TH20-style scene interstitial ===== */
.scene-curtain {
  position: fixed;
  inset: 0;
  z-index: 1000;
  overflow: hidden;
  isolation: isolate;
  pointer-events: auto;
  background: transparent;
}

.scene-curtain-backdrop {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background-color: #201425;
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
  overflow: hidden;
}

.scene-curtain-backdrop > .menu-far,
.scene-curtain-backdrop > .menu-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.scene-curtain-mask-defs {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.scene-prayer {
  position: absolute;
  right: clamp(1.25rem, 6vw, 6.5rem);
  bottom: clamp(1.4rem, 7vh, 5.75rem);
  z-index: 3;
  display: grid;
  justify-items: end;
  gap: .2rem;
  min-width: min(13rem, 62vw);
  color: #fffdfb;
  text-align: right;
  pointer-events: none;
  filter: drop-shadow(2px 3px 0 rgba(20, 9, 23, .78));
}
.scene-prayer[hidden] { display: none; }

.scene-prayer::before,
.scene-prayer::after {
  content: '';
  position: absolute;
  width: clamp(.65rem, 1.3vw, 1.2rem);
  height: clamp(1.2rem, 2.8vw, 2.1rem);
  border-radius: 90% 10% 90% 10%;
  background: linear-gradient(145deg, #e16c63 0 45%, #9e354b 46% 100%);
  opacity: .9;
  pointer-events: none;
}

.scene-prayer::before {
  top: 8%;
  left: -1.5rem;
  transform: rotate(-38deg);
}

.scene-prayer::after {
  right: -.9rem;
  bottom: 2%;
  transform: rotate(38deg) scale(.78);
}

.scene-prayer strong {
  position: relative;
  color: #fff;
  font: italic 800 clamp(1.3rem, 3.6vw, 2.55rem)/1.05 var(--title-font);
  letter-spacing: .04em;
  white-space: nowrap;
  paint-order: stroke fill;
  -webkit-text-stroke: clamp(1px, .12vw, 2px) rgba(43, 24, 48, .95);
  text-shadow: 0 0 4px rgba(255, 255, 255, .35), 2px 3px 0 rgba(28, 13, 30, .7);
}

.scene-prayer span {
  color: #74ded4;
  font: italic 600 clamp(.58rem, 1.15vw, .9rem)/1.1 var(--mono);
  letter-spacing: .08em;
  text-shadow: 1px 1px 0 rgba(12, 35, 39, .9);
}

.scene-transitioning {
  cursor: progress;
}

.scene-transitioning .scene-curtain {
  cursor: progress;
}

@media (max-width: 560px) {
  .scene-prayer {
    right: clamp(.8rem, 4vw, 1.75rem);
    bottom: clamp(1rem, 5vh, 2.5rem);
    min-width: 0;
  }

  .scene-prayer::before { left: -1rem; }
  .scene-prayer::after { right: -.55rem; }
}

@media (prefers-reduced-motion: reduce) {
  .scene-curtain-panel { will-change: auto; }

  .scene-prayer {
    transition: none !important;
    animation: none !important;
  }
}
