/* ============ 日语渡劫录 · 女神异闻录风 UI ============
   红黑白撕纸拼贴 / 斜切倾斜 / 网点纹理 / 星芒迸射
   （类名与动画钩子与旧版一一对应，仅换皮） */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
button { touch-action: manipulation; font-family: inherit; cursor: pointer; }
html, body { height: 100%; overflow: hidden; }
body {
  background: #0a0a0a;
  font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans", "Yu Gothic", "Noto Sans JP", sans-serif;
  color: #fff;
  user-select: none;
  -webkit-user-select: none;
}

/* ---------- 竖屏游戏容器 ---------- */
#game {
  position: relative;
  margin: 0 auto;
  height: 100dvh;
  max-height: 100dvh;
  aspect-ratio: 9 / 16;
  max-width: 100vw;
  background:
    radial-gradient(ellipse at 50% -14%, #9c0d15 0%, transparent 40%),
    radial-gradient(ellipse at 108% 108%, #8f0710 0%, transparent 44%),
    linear-gradient(168deg, #200a0e 0%, #12060a 44%, #0a0a0a 100%);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
#stars { position: absolute; inset: 0; pointer-events: none; opacity: .9;
  background-image:
    radial-gradient(1px 1px at 12% 18%, #fff9 50%, transparent 51%),
    radial-gradient(1px 1px at 78% 9%, #fff7 50%, transparent 51%),
    radial-gradient(2px 2px at 55% 26%, #ffe60046 50%, transparent 51%),
    radial-gradient(1px 1px at 32% 42%, #fff6 50%, transparent 51%),
    radial-gradient(1px 1px at 88% 55%, #fff5 50%, transparent 51%),
    radial-gradient(2px 2px at 8% 70%, #ff2a2a33 50%, transparent 51%),
    radial-gradient(1px 1px at 64% 82%, #fff4 50%, transparent 51%),
    radial-gradient(1px 1px at 40% 6%, #fff6 50%, transparent 51%);
}
/* 全局网点（漫画网点纹理） */
#game::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 1;
  background-image: radial-gradient(circle, #ffffff09 28%, transparent 30%);
  background-size: 7px 7px;
}

/* ---------- 顶栏 ---------- */
#topbar {
  flex: 0 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(env(safe-area-inset-top, 0px) + 7px) 8px 7px;
  background: linear-gradient(180deg, #0a0a0af2 0%, #0a0a0ad0 65%, transparent 100%);
  border-bottom: 2px solid #fff;
  z-index: 30;
}
.tb-left { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.realm-name {
  display: inline-block; align-self: flex-start;
  background: #c50f18; color: #fff;
  font-weight: 900; font-size: 13px; letter-spacing: 2px;
  padding: 2px 10px; white-space: nowrap;
  transform: skewX(-10deg);
  box-shadow: 3px 3px 0 #0a0a0a;
}
.realm-name > span { display: inline-block; transform: skewX(10deg); }
.realm-sub {
  font-size: 9px; color: #ffffffb0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  letter-spacing: 1px; padding-left: 2px;
}
.tb-right { display: flex; align-items: center; gap: 5px; }
.tb-stat {
  display: flex; align-items: center; gap: 3px;
  background: #f2ecdc; color: #0a0a0a; border: 2px solid #0a0a0a;
  padding: 2px 7px; font-size: 11px; font-weight: 900;
  transform: skewX(-10deg);
  box-shadow: 2px 2px 0 #0a0a0a;
}
.tb-stat > * { transform: skewX(10deg); }
.tb-stat b { color: #c00d14; }
.tb-btn {
  background: #0a0a0a; border: 2px solid #fff; color: #fff;
  font-size: 13px; font-weight: 900; padding: 2px 9px;
  transform: skewX(-10deg);
}
.tb-btn:active { background: #c50f18; }
/* 登录账号条：👤 变为用户名徽标 */
.tb-btn.on { background: #12331e; border-color: #8fd8a8; color: #8fd8a8; max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; letter-spacing: 1px; }

/* ---------- 屏幕区 ---------- */
#screen { flex: 1 1 auto; position: relative; overflow: hidden; display: flex; flex-direction: column; z-index: 10; }
.page { position: absolute; inset: 0; display: flex; flex-direction: column; padding: 10px 12px calc(env(safe-area-inset-bottom, 0px) + 10px); overflow-y: auto; animation: pageIn .22s ease-out; }
@keyframes pageIn { from { opacity: 0; transform: translate(18px, 6px) skewX(-2deg); } to { opacity: 1; transform: none; } }
.page::-webkit-scrollbar { width: 0; }

/* ---------- 通用组件 ---------- */
.btn {
  position: relative;
  display: block; width: 100%;
  background: #f2ecdc; color: #0a0a0a;
  border: 3px solid #0a0a0a;
  padding: 12px 16px; margin: 9px 0;
  font-size: 15px; font-weight: 900; letter-spacing: 3px;
  text-align: left;
  transform: skewX(-8deg);
  box-shadow: 4px 4px 0 #0a0a0a;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 8px), calc(100% - 12px) 100%, 0 100%);
  transition: transform .06s;
}
.btn > * { transform: skewX(8deg); }
.btn:active { transform: skewX(-8deg) translateY(3px); box-shadow: 2px 2px 0 #0a0a0a; background: #ffe600; }
.btn.gold { background: #ffe600; }
.btn.gold:active { background: #fff; }
.btn.red { background: #c50f18; color: #fff; box-shadow: 4px 4px 0 #0a0a0a; animation: pulseRed 1s infinite; }
.btn.red:active { background: #f2ecdc; color: #c50f18; }
@keyframes pulseRed { 0%,100% { box-shadow: 4px 4px 0 #0a0a0a; } 50% { box-shadow: 4px 4px 0 #ffe600; } }
.btn.jade { background: #f2ecdc; }
.btn.ghost { background: #f2ecdc; color: #0a0a0a; border-color: #0a0a0a; box-shadow: 3px 3px 0 #0a0a0a; font-size: 13px; }
.btn.ghost:active { background: #ffe600; }
.btn:disabled { filter: grayscale(1) brightness(.7); box-shadow: none; transform: skewX(-8deg); cursor: default; }
.btn .tag { float: right; font-size: 10px; color: #c00d14; font-weight: 900; letter-spacing: 1px; transform: skewX(8deg); }
.btn.red .tag, .btn.ghost .tag { color: #ffe600; }
.btn .tag.bad { color: #fff; background: #0a0a0a; padding: 0 4px; }

.panel {
  position: relative;
  background: #101010; border: 2px solid #fff;
  padding: 10px 14px; margin: 9px 0;
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 12px, 100% 100%, 0 100%);
}
.panel::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px;
  background: repeating-linear-gradient(-45deg, #c50f18 0 7px, #2b2b2b 7px 14px);
}
.panel-title {
  position: relative; display: inline-block;
  font-size: 12px; color: #0a0a0a; font-weight: 900; letter-spacing: 2px;
  background: #f2ecdc; padding: 2px 10px; margin: 2px 0 8px;
  transform: skewX(-10deg);
}
.panel-title::after { content: ""; position: absolute; right: -6px; top: 0; border: 4px solid transparent; border-left-color: #c50f18; }

.hbar { height: 16px; background: #0a0a0a; border: 2px solid #fff; overflow: hidden; position: relative; transform: skewX(-8deg); }
.hbar > i { display: block; height: 100%; transition: width .3s; }
.hbar > i.hp { background: repeating-linear-gradient(-45deg, #c50f18 0 9px, #e05555 9px 12px); }
.hbar > i.mp { background: repeating-linear-gradient(-45deg, #ffe600 0 9px, #f2ecdc 9px 12px); }
.hbar > span { position: absolute; inset: 0; font-size: 9px; font-weight: 900; display: flex; align-items: center; justify-content: center; color: #fff; text-shadow: 1px 1px 0 #0a0a0a; transform: skewX(8deg); }

/* ---------- 假名/单词卡 ---------- */
.kana-card {
  position: relative;
  background: #f6f1e4; color: #141414; border: 3px solid #0a0a0a;
  padding: 20px 16px 18px; margin: 14px auto 10px; max-width: 340px;
  clip-path: polygon(0 9px, 15px 0, 100% 0, 100% calc(100% - 20px), calc(100% - 26px) 100%, 0 100%);
  box-shadow: 5px 5px 0 #0a0a0a;
  transform: rotate(-1.2deg);
}
.kana-card::before {
  content: ""; position: absolute; left: 0; top: 0; right: 0; height: 7px;
  background: repeating-linear-gradient(-60deg, #0a0a0a 0 16px, #c50f18 16px 32px);
}
.kana-card::after {
  content: "印"; position: absolute; right: 12px; top: 16px;
  width: 30px; height: 30px; background: #c50f18; color: #fff;
  font-size: 14px; font-weight: 900; display: flex; align-items: center; justify-content: center;
  transform: rotate(-10deg);
  clip-path: polygon(50% 0, 63% 18%, 100% 25%, 78% 50%, 100% 75%, 63% 82%, 50% 100%, 37% 82%, 0 75%, 22% 50%, 0 25%, 37% 18%);
}
.kc-char { font-size: 84px; font-weight: 900; text-align: center; line-height: 1.12; font-family: "Hiragino Sans", "Yu Gothic", "Noto Sans JP", sans-serif; cursor: pointer; }
.kc-romaji { text-align: center; font-size: 22px; font-weight: 900; color: #c00d14; letter-spacing: 3px; }
.kc-mne { margin-top: 12px; font-size: 13px; line-height: 1.65; background: #141414; color: #f6f1e4; border-radius: 0; padding: 9px 10px; clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 0 100%); }
.kc-mne b { color: #ffe600; }
.kc-word { margin-top: 9px; text-align: center; font-size: 13px; color: #444; }
.kc-word .w { font-size: 20px; font-weight: 900; color: #141414; }
.kc-kata { text-align: center; margin-top: 7px; font-size: 12px; color: #8a2020; font-weight: 700; }
.kc-tap { text-align: center; font-size: 10px; color: #999; margin-top: 7px; }

/* ---------- 答题 ---------- */
.quiz-q { text-align: center; margin: 14px 0 6px; }
.quiz-q .q-type {
  display: inline-block;
  font-size: 11px; color: #fff; font-weight: 900; letter-spacing: 3px;
  background: #0a0a0a; border: 2px solid #fff; padding: 2px 12px;
  transform: skewX(-10deg);
}
.quiz-q .q-type > span { display: inline-block; transform: skewX(10deg); }
.quiz-q .q-big {
  font-size: 64px; font-weight: 900; line-height: 1.18; margin-top: 10px;
  font-family: "Hiragino Sans", "Yu Gothic", "Noto Sans JP", sans-serif; cursor: pointer;
  color: #fff;
  text-shadow: 2px 2px 0 #c50f18, 4px 4px 0 #0a0a0a;
}
.quiz-q .q-romaji { font-size: 38px; font-weight: 900; color: #ffe600; letter-spacing: 4px; margin-top: 10px; text-shadow: 3px 3px 0 #0a0a0a; }
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.choice {
  position: relative;
  background: #0a0a0a; border: 3px solid #fff;
  color: #fff; padding: 14px 10px; font-size: 19px; font-weight: 900;
  transform: skewX(-6deg);
  font-family: "Hiragino Sans", "Yu Gothic", "Noto Sans JP", sans-serif;
  box-shadow: 3px 3px 0 #0a0a0a;
  transition: transform .06s;
}
.choice > * { transform: skewX(6deg); }
.choice:active { transform: skewX(-6deg) scale(.96); }
.choice.ok { background: #ffe600; border-color: #0a0a0a; color: #0a0a0a; box-shadow: 3px 3px 0 #fff; animation: popIn .18s; }
.choice.ng { background: #c50f18; border-color: #f2ecdc; color: #fff; animation: shakeX .3s; }
.choice.dim { opacity: .3; pointer-events: none; }
.choice .romaji { display: block; font-size: 11px; font-weight: 800; color: #ffffffa8; margin-top: 3px; letter-spacing: 1px; transform: skewX(6deg); }
.choice.ok .romaji { color: #0a0a0ac0; }

.combo-bar { display: flex; align-items: center; gap: 8px; margin: 4px 0; }
.combo-bar .cb-label { font-size: 11px; font-weight: 900; color: #fff; white-space: nowrap; text-shadow: 2px 2px 0 #0a0a0a; }
.combo-fire { color: #ffe600; animation: flick .5s infinite alternate; }
@keyframes flick { from { text-shadow: 0 0 3px #ffe60088, 2px 2px 0 #0a0a0a; } to { text-shadow: 0 0 9px #ff8c00aa, 2px 2px 0 #0a0a0a; } }

/* ---------- 战斗 ---------- */
.battle-stage { display: flex; flex-direction: column; align-items: center; padding-top: 10px; position: relative; }
.boss-name {
  display: inline-block;
  font-size: 14px; font-weight: 900; color: #fff; letter-spacing: 3px;
  background: #c50f18; padding: 3px 16px;
  transform: skewX(-10deg);
  box-shadow: 3px 3px 0 #0a0a0a;
}
.boss-name > span { display: inline-block; transform: skewX(10deg); }
.boss-taunt { font-size: 11px; color: #ffffffc8; min-height: 18px; margin: 6px 0 8px; letter-spacing: 1px; }
.boss-sprite { margin: 4px 0 10px; position: relative; z-index: 2; filter: drop-shadow(0 8px 10px #000c); }
.boss-sprite::before {
  content: ""; position: absolute; left: 50%; top: 50%; width: 150px; height: 150px;
  transform: translate(-50%, -50%); z-index: -1;
  background: conic-gradient(#ffffff22 0deg 12deg, transparent 12deg 30deg);
  background-repeat: repeat; background-size: 30deg 100%;
  clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
  animation: burstSpin 14s linear infinite;
}
@keyframes burstSpin { to { transform: translate(-50%, -50%) rotate(360deg); } }
.boss-sprite.hurt { animation: hurtFlash .3s; }
@keyframes hurtFlash { 0%,100% { filter: none; } 50% { filter: brightness(3) saturate(2) drop-shadow(0 0 8px #fff); } }
.boss-sprite.idle { animation: bob 2s ease-in-out infinite; }
@keyframes bob { 0%,100% { transform: translateY(0) rotate(-1deg); } 50% { transform: translateY(-6px) rotate(1.5deg); } }
.hero-row { display: flex; align-items: flex-end; gap: 12px; justify-content: center; margin-top: 8px; }
.hero-sprite { animation: bob 2.6s ease-in-out infinite; }
.hero-row > div > div:first-child { color: #ffe600; }
.timer-bar { height: 12px; background: #0a0a0a; border: 2px solid #fff; overflow: hidden; margin: 8px 0; transform: skewX(-8deg); }
.timer-bar > i { display: block; height: 100%; background: repeating-linear-gradient(-45deg, #ffe600 0 8px, #0a0a0a 8px 16px); }
.timer-bar.urgent > i { background: repeating-linear-gradient(-45deg, #c50f18 0 8px, #f2ecdc 8px 16px); }

/* ---------- 主界面（P5 场景） ---------- */
.home-scene { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; position: relative; }
.p5-streaks {
  position: absolute; top: 0; bottom: 30%; left: -10%; right: -10%;
  background: repeating-linear-gradient(-64deg, transparent 0 46px, #ffffff09 46px 50px, transparent 50px 110px, #e600120c 110px 118px);
  transform: rotate(0.001deg); pointer-events: none;
}
.p5-mountain { position: absolute; bottom: 0; pointer-events: none; }
.p5-mountain.m1 {
  left: -6%; right: -6%; height: 34%;
  background: linear-gradient(180deg, #1c0508 0%, #0d0304 100%);
  clip-path: polygon(0 78%, 7% 55%, 13% 68%, 22% 30%, 30% 52%, 39% 12%, 47% 44%, 56% 22%, 64% 50%, 73% 26%, 81% 58%, 89% 40%, 100% 70%, 100% 100%, 0 100%);
}
.p5-mountain.m2 {
  left: -6%; right: -6%; height: 26%;
  background: #0a0a0a;
  clip-path: polygon(0 62%, 10% 80%, 18% 44%, 27% 70%, 36% 30%, 45% 62%, 55% 18%, 64% 55%, 74% 38%, 84% 72%, 93% 50%, 100% 76%, 100% 100%, 0 100%);
}
.p5-burst {
  position: absolute; bottom: 16%; left: 50%; width: 190px; height: 190px;
  transform: translateX(-50%); pointer-events: none;
  background: conic-gradient(#e6001217 0deg 10deg, transparent 10deg 24deg);
  background-repeat: repeat; background-size: 24deg 100%;
  clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
  animation: burstSpin 22s linear infinite;
}
/* 撕纸楔形撞色面：大面积亮红/微白斜切撕裂，制造明暗对撞 */
.p5-wedge { position: absolute; pointer-events: none; }
.p5-wedge.w1 {
  top: 0; right: 0; width: 86%; height: 56%;
  background: #e60012; opacity: .09;
  clip-path: polygon(100% 0, 100% 100%, 8% 30%);
}
.p5-wedge.w2 {
  top: 24%; left: -4%; width: 52%; height: 30%;
  background: #fff; opacity: .05;
  clip-path: polygon(0 0, 100% 44%, 0 100%);
}
.npc-row { display: flex; align-items: flex-end; gap: 18px; margin-bottom: 8px; z-index: 2; }
.npc { display: flex; flex-direction: column; align-items: center; gap: 6px; }
/* 贴纸化：白色描边 + 黑色硬阴影，让角色像贴在拼贴上 */
.npc canvas.px, .hero-row canvas.px, .battle-stage .boss-sprite {
  filter: drop-shadow(2px 0 0 #fff) drop-shadow(-2px 0 0 #fff) drop-shadow(0 2px 0 #fff) drop-shadow(0 -2px 0 #fff)
          drop-shadow(5px 5px 0 #0a0a0a);
}
.npc .npc-name {
  font-size: 10px; color: #fff; font-weight: 900; letter-spacing: 1px;
  background: #0a0a0a; border: 2px solid #fff; padding: 1px 8px;
  transform: skewX(-10deg);
}
.npc .npc-name > span { display: inline-block; transform: skewX(10deg); }
.npc-hero { margin-bottom: 4px; }

.bubble {
  position: relative;
  background: #f2ecdc; color: #141414; border: 3px solid #0a0a0a;
  padding: 11px 13px; font-size: 12px; line-height: 1.7; font-weight: 600; margin: 8px 14px 10px;
  min-height: 60px;
  clip-path: polygon(0 10px, 8px 0, calc(100% - 14px) 0, 100% 10px, 100% calc(100% - 8px), calc(100% - 10px) 100%, 12px 100%, 0 calc(100% - 12px));
  box-shadow: 4px 4px 0 #0a0a0a;
  z-index: 2;
}
.bubble::after { content: ""; position: absolute; bottom: -12px; left: 38px;
  background: #f2ecdc; width: 14px; height: 14px; border: 3px solid #0a0a0a; border-top: none; border-left: none;
  transform: skewX(14deg) rotate(45deg); }
.bubble .who { color: #c00d14; font-weight: 900; }
/* 「再来一条」局部换话时的弹出动效 */
.bubble.bubble-pop { animation: bubbleIn .3s cubic-bezier(.2,.9,.3,1.25); }
@keyframes bubbleIn { from { opacity: 0; transform: translateY(14px) skewX(-6deg) scale(.94); } }
.bubble .jp { color: #8a0f8a; font-weight: 800; }
.bubble-tap { position: absolute; right: 9px; bottom: 5px; font-size: 9px; color: #999; font-weight: 700; }

.home-actions { padding-bottom: 4px; }
.demon-meter { display: flex; align-items: center; gap: 7px; margin: 5px 0 3px; }
.demon-meter .dm-label {
  font-size: 10px; color: #0a0a0a; font-weight: 900; white-space: nowrap;
  background: #ffe600; padding: 1px 7px; transform: skewX(-8deg);
}
.dm-label > span { display: inline-block; transform: skewX(8deg); }
.dm-bar { flex: 1; height: 10px; background: #0a0a0a; border: 2px solid #fff; overflow: hidden; transform: skewX(-8deg); }
.dm-bar > i { display: block; height: 100%; background: linear-gradient(90deg, #5d3580 0%, #7d4da3 70%, #9a63bd 100%); transition: width .4s; }

/* ---------- 图鉴 ---------- */
.dex-top { display: flex; align-items: center; gap: 10px; margin-bottom: 9px; }
.dex-top .btn { width: auto; margin: 0; padding: 7px 13px; font-size: 12px; letter-spacing: 1px; }
.dex-title { flex: 1; font-size: 17px; font-weight: 900; color: #fff; letter-spacing: 5px; transform: skewX(-8deg); text-shadow: 2px 2px 0 #0a0a0a; }
.dex-tabs { display: flex; gap: 8px; margin-bottom: 10px; }
.dex-tab {
  flex: 1; background: #0a0a0a; border: 2px solid #fff; color: #ffffff90;
  padding: 9px 0; font-size: 13px; font-weight: 900; letter-spacing: 2px;
  transform: skewX(-8deg); box-shadow: 3px 3px 0 #ffffff2e;
}
.dex-tab > span { display: inline-block; transform: skewX(8deg); }
.dex-tab.on { background: #f2ecdc; color: #0a0a0a; box-shadow: 3px 3px 0 #0a0a0a; }
.kana-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px; }
.kana-cell {
  aspect-ratio: 1; background: #0f0f0f; border: 2px solid #ffffff45;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-size: 19px; font-weight: 900; cursor: pointer; position: relative;
  font-family: "Hiragino Sans", "Yu Gothic", "Noto Sans JP", sans-serif;
  transform: skewX(-4deg);
}
.kana-cell > * { transform: skewX(4deg); }
.kana-cell .r { font-size: 10.5px; color: #ffffff96; font-family: inherit; margin-top: 3px; transform: skewX(4deg); }
.kana-cell.got { background: #f2ecdc; border-color: #0a0a0a; color: #0a0a0a; box-shadow: 2px 2px 0 #0a0a0a; }
.kana-cell.got .r { color: #c00d14; }
.kana-cell.demo { border-color: #a24bd8; box-shadow: 2px 2px 0 #a24bd8; }
.kana-cell.demo::after {
  content: "怒"; position: absolute; top: -6px; right: -5px; font-size: 9px; background: #a24bd8; color: #fff;
  width: 15px; height: 15px; display: flex; align-items: center; justify-content: center;
  transform: rotate(8deg);
}
.kana-cell.locked { color: #ffffff30; }
.dex-count { text-align: center; font-size: 11px; color: #ffffff90; margin: 10px 0; letter-spacing: 2px; font-weight: 700; }
.dex-count b { color: #ffe600; }
.section-gap { height: 16px; }

.talis-list { display: flex; flex-direction: column; gap: 10px; }
.talis {
  position: relative;
  background: #f2ecdc; color: #141414; border: 2px solid #0a0a0a;
  padding: 11px 14px; min-height: 50px;
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 9px, 100% 100%, 0 100%);
  box-shadow: 4px 4px 0 #0a0a0a;
  border-left: 7px solid #c50f18;
}
.talis.locked { background: #161616; color: #ffffff45; border-color: #ffffff30; border-left-color: #ffffff30; box-shadow: 4px 4px 0 #ffffff18; }
.talis .t-name { font-size: 15px; font-weight: 900; font-family: "Hiragino Sans", "Yu Gothic", "Noto Sans JP", sans-serif; }
.talis .t-sub { font-size: 10px; color: #6a2020; margin-top: 3px; font-weight: 600; }
.talis.locked .t-sub { color: #ffffff40; }
.talis .t-skill { position: absolute; right: 10px; top: 10px; font-size: 9px; color: #fff; background: #0a0a0a; padding: 1px 6px; font-weight: 900; transform: skewX(-8deg); }

/* ---------- 弹窗 ---------- */
#overlay { position: absolute; inset: 0; z-index: 60; background: #0a0a0ad9; display: flex; align-items: center; justify-content: center; padding: 20px; animation: fadeIn .18s; }
#overlay.hidden { display: none; }
.modal {
  position: relative;
  width: 100%; max-width: 330px; max-height: 86%; overflow-y: auto;
  background: #f6f1e4; color: #141414; border: 3px solid #0a0a0a;
  padding: 26px 16px 16px;
  clip-path: polygon(0 18px, 14px 0, 100% 0, 100% calc(100% - 16px), calc(100% - 20px) 100%, 0 100%);
  box-shadow: 5px 5px 0 #0a0a0a;
  animation: popIn .22s;
}
.modal::-webkit-scrollbar { width: 0; }
.modal h3 {
  position: absolute; top: -12px; left: -8px;
  font-size: 16px; color: #fff; letter-spacing: 3px;
  background: #c50f18; border: 2px solid #0a0a0a; padding: 3px 14px;
  transform: skewX(-10deg) rotate(-2deg);
  box-shadow: 3px 3px 0 #0a0a0a;
}
.modal h3 > * { transform: skewX(10deg); }
.modal .m-body { font-size: 13px; line-height: 1.85; color: #222; font-weight: 600; }
.modal .m-body .jp { color: #8a0f8a; font-weight: 800; }
.modal .m-body .hl { color: #c00d14; font-weight: 900; }
.modal .m-big { text-align: center; font-size: 56px; font-weight: 900; margin: 8px 0; font-family: "Hiragino Sans", "Yu Gothic", "Noto Sans JP", sans-serif; }
@keyframes popIn { from { transform: scale(.86) skewX(-3deg); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ---------- 特效 ---------- */
#fx { position: absolute; inset: 0; z-index: 70; pointer-events: none; overflow: hidden; }
.float-text {
  position: absolute; font-weight: 900; font-size: 18px; color: #0a0a0a;
  background: #ffe600; border: 2px solid #0a0a0a; padding: 1px 8px; white-space: nowrap;
  transform: translateX(-50%) skewX(-8deg);
  box-shadow: 2px 2px 0 #0a0a0a;
  animation: floatUp 1.1s ease-out forwards;
}
.float-text.bad { background: #c50f18; color: #fff; box-shadow: 2px 2px 0 #0a0a0a; }
.float-text.huge { font-size: 24px; animation-duration: 1.4s; }
@keyframes floatUp { from { transform: translateX(-50%) skewX(-8deg) rotate(0) translateY(0) scale(1); opacity: 1; } 18% { transform: translateX(-50%) skewX(-8deg) rotate(-4deg) translateY(-18px) scale(1.18); } 80% { opacity: 1; } to { transform: translateX(-50%) skewX(-8deg) rotate(-4deg) translateY(-90px) scale(1); opacity: 0; } }

#game.shake { animation: shakeAll .35s; }
@keyframes shakeAll { 0%,100% { transform: translate(0,0) rotate(0); } 20% { transform: translate(-8px,4px) rotate(-.5deg); } 40% { transform: translate(7px,-5px) rotate(.5deg); } 60% { transform: translate(-5px,-3px) rotate(-.3deg); } 80% { transform: translate(5px,4px) rotate(.4deg); } }
.shakeX { animation: shakeX .3s; }
@keyframes shakeX { 0%,100% { transform: skewX(-6deg) translateX(0); } 25% { transform: skewX(-6deg) translateX(-6px); } 75% { transform: skewX(-6deg) translateX(6px); } }

#game.glitch::before {
  content: ""; position: absolute; inset: 0; z-index: 90; pointer-events: none;
  background: repeating-linear-gradient(0deg, #ff00c855 0 2px, transparent 2px 7px, #00fff055 7px 9px, transparent 9px 15px);
  animation: glitchMove .12s infinite, hueRot 1s infinite;
  mix-blend-mode: screen;
}
#game.glitch { animation: shakeAll .12s infinite; }
@keyframes glitchMove { from { transform: translateX(-4px); } to { transform: translateX(4px); } }
@keyframes hueRot { from { filter: hue-rotate(0); } to { filter: hue-rotate(360deg); } }

.confetti { position: absolute; width: 9px; height: 9px; animation: confFall 1.6s ease-in forwards; }
@keyframes confFall { from { transform: translateY(-10px) rotate(0); opacity: 1; } to { transform: translateY(105vh) rotate(720deg); opacity: 0; } }

/* ---------- 结果页 ---------- */
.result-hero {
  display: inline-block; align-self: center;
  font-size: 20px; font-weight: 900; color: #fff; letter-spacing: 4px; margin: 16px 0 6px;
  background: #0a0a0a; border: 2px solid #fff; padding: 3px 16px;
  transform: skewX(-10deg); box-shadow: 4px 4px 0 #0a0a0a;
}
.result-hero > span { display: inline-block; transform: skewX(10deg); }
.result-rows { margin: 10px 0; background: #101010; border: 2px solid #fff; padding: 4px 12px; clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 12px, 100% 100%, 0 100%); }
.result-row { display: flex; justify-content: space-between; font-size: 13px; padding: 8px 2px; border-bottom: 1px dashed #ffffff30; font-weight: 600; }
.result-row b { color: #ffe600; }
.result-row .ng b { color: #ff7d7d; }

/* ---------- 设置 ---------- */
.set-row { display: flex; align-items: center; justify-content: space-between; padding: 11px 2px; border-bottom: 1px dashed #ffffff50; font-size: 14px; font-weight: 600; }
.toggle { width: 48px; height: 24px; background: #0a0a0a; border: 2px solid #fff; position: relative; cursor: pointer; transform: skewX(-8deg); }
.toggle::after { content: ""; position: absolute; top: 2px; left: 3px; width: 16px; height: 16px; background: #fff; transition: left .2s, background .2s; }
.toggle.on { background: #c50f18; }
.toggle.on::after { left: 25px; background: #ffe600; }

/* ---------- 符箓小剧场 ---------- */
.scene-box { background: #101010; border: 2px solid #fff; padding: 13px; margin: 8px 0; clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 10px, 100% 100%, 0 100%); }
.scene-where { display: inline-block; font-size: 10px; color: #0a0a0a; letter-spacing: 2px; font-weight: 900; background: #ffe600; padding: 2px 8px; transform: skewX(-8deg); }
.scene-text { font-size: 13px; line-height: 1.8; margin-top: 8px; color: #f2f2f2; font-weight: 600; }
.scene-text .jp { color: #c9a0ff; font-weight: 800; }

/* ---------- 其他 ---------- */
.small-note { font-size: 10px; color: #ffffff96; text-align: center; margin-top: 10px; line-height: 1.8; letter-spacing: 1px; font-weight: 600; }
.back-row { display: flex; gap: 8px; }
.back-row .btn { margin: 0; flex: 1; }
/* 底排按钮错落，像随手钉上的拼贴纸片 */
.back-row .btn:nth-child(1) { transform: skewX(-8deg) rotate(-1.2deg); }
.back-row .btn:nth-child(2) { transform: skewX(-8deg) translateY(4px); }
.back-row .btn:nth-child(3) { transform: skewX(-8deg) rotate(1.2deg); }
.back-row .btn:active { transform: skewX(-8deg) translateY(4px) translate(2px, 2px); }
canvas.px { image-rendering: pixelated; image-rendering: crisp-edges; display: block; }
.pxmix { font-family: "Hiragino Sans", "Yu Gothic", "Noto Sans JP", sans-serif; }
.gold-text { color: #ffe600; }

/* ========== v1.4.2 动效增强 ========== */

/* P5 斜切转场幕：黑幕+红细线扫屏 */
.p5-wipe {
  position: absolute; inset: -10% -35%; z-index: 85; pointer-events: none; visibility: hidden;
  background: linear-gradient(104deg, transparent 0 34%, #0a0a0a 34% 60%, #c50f18 60% 64%, #0a0a0a 64% 100%);
}
.p5-wipe.run { visibility: visible; animation: wipeSweep .36s cubic-bezier(.3,.6,.4,1) forwards; }
@keyframes wipeSweep { from { transform: translateX(-85%); } to { transform: translateX(85%); } }

/* 页面子元素依次砸入 */
.page > * { animation: pageIn .34s cubic-bezier(.18,.9,.32,1.18) both; }
.page > *:nth-child(2) { animation-delay: .05s; }
.page > *:nth-child(3) { animation-delay: .1s; }
.page > *:nth-child(4) { animation-delay: .16s; }
.page > *:nth-child(5) { animation-delay: .22s; }
.page > *:nth-child(6) { animation-delay: .28s; }
@keyframes pageIn { from { opacity: 0; transform: translateY(22px) skewX(-4deg); } }

/* 答题选项逐个弹出 */
.choice { animation: choiceIn .24s cubic-bezier(.2,.9,.3,1.3) both; }
.choice:nth-child(2) { animation-delay: .05s; }
.choice:nth-child(3) { animation-delay: .1s; }
.choice:nth-child(4) { animation-delay: .15s; }
@keyframes choiceIn { from { opacity: 0; transform: skewX(-6deg) scale(.7); } }

/* 答对/答错全屏斜闪（打击感） */
.slash-flash { position: absolute; inset: -25%; pointer-events: none; z-index: 75;
  background: linear-gradient(104deg, transparent 40%, #ffe600d9 46%, #ffffff 50%, #ffe600d9 54%, transparent 60%);
  animation: slashSweep .5s ease-out forwards; }
.slash-flash.red { background: linear-gradient(104deg, transparent 40%, #c50f18e0 46%, #ffffff 50%, #c50f18e0 54%, transparent 60%); }
@keyframes slashSweep { from { transform: translateX(-55%); } to { transform: translateX(55%); opacity: 0; } }

/* 顶栏数值变化弹跳 */
.tb-stat b.bump { display: inline-block; animation: bump .32s; }
@keyframes bump { 35% { transform: skewX(10deg) scale(1.4); color: #ffe600; } }

/* 弹窗标题牌旋入砸落 */
.modal h3 { animation: tabSlam .32s cubic-bezier(.2,.9,.3,1.25) .06s both; }
@keyframes tabSlam { from { opacity: 0; transform: skewX(-10deg) rotate(-14deg) translate(-30px, -18px); } }

/* Boss 名砸入 + 嘲讽语浮现 */
.boss-name { animation: bossSlam .35s cubic-bezier(.2,.9,.3,1.25) both; }
@keyframes bossSlam { from { opacity: 0; transform: skewX(-10deg) scale(1.7); } }
.boss-taunt { animation: fadeIn .3s .18s both; }

/* 场景氛围：斜纹缓慢流动、NPC 常驻浮动 */
.p5-streaks { animation: streakDrift 14s linear infinite; }
@keyframes streakDrift { to { background-position: 236px 0; } }
.npc canvas.px { animation: bob 2.6s ease-in-out infinite; }
.npc:nth-child(2) canvas.px { animation-delay: .8s; }
.npc-hero canvas.px { animation-delay: .4s; }

/* 桌面悬停微抬 */
@media (hover: hover) {
  .btn:hover { transform: skewX(-8deg) translateY(-2px); }
  .back-row .btn:hover { filter: brightness(1.06); }
}

/* ========== 奥义系统 ========== */

/* 奥义待机按钮：连击蓄满后浮现 */
.ult-btn {
  display: block; width: 100%; margin: 6px 0;
  background: #c50f18; color: #ffe600; border: 3px solid #0a0a0a;
  font-size: 15px; font-weight: 900; letter-spacing: 4px; padding: 10px;
  transform: skewX(-8deg); box-shadow: 3px 3px 0 #0a0a0a;
  animation: ultPulse .9s infinite;
}
.ult-btn:active { transform: skewX(-8deg) translateY(3px); }
@keyframes ultPulse { 0%,100% { filter: brightness(1); } 50% { filter: brightness(1.4); } }

/* 奥义解放演出：全屏黑幕 + 星芒 + 逐字砸入 */
.ult-show {
  position: absolute; inset: 0; z-index: 88; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 16px;
  background: #0a0a0af2; animation: fadeIn .12s;
}
.ult-show.out { animation: ultOut .22s forwards; }
@keyframes ultOut { to { opacity: 0; } }
.ult-rays {
  position: absolute; width: 320px; height: 320px;
  background: conic-gradient(#ffe60030 0deg 6deg, transparent 6deg 22deg);
  background-repeat: repeat; background-size: 22deg 100%;
  clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
  animation: burstSpin 2.6s linear infinite;
}
.ult-tag { font-size: 12px; color: #f2ecdc; font-weight: 900; letter-spacing: 6px; transform: skewX(-10deg); }
.ult-name { font-size: 32px; font-weight: 900; color: #ffe600; transform: skewX(-8deg); text-shadow: 3px 3px 0 #c50f18, 5px 5px 0 #0a0a0a; }
.ult-name i { display: inline-block; font-style: normal; animation: ultChar .3s cubic-bezier(.2,.9,.3,1.4) both; }
@keyframes ultChar { from { opacity: 0; transform: translateY(-28px) scale(2.2); } }

/* ========== 宗门 ========== */
.sect-rep { display: flex; align-items: center; gap: 7px; margin: 6px 0; }
.sect-rep .sr-label { font-size: 10px; color: #ffe600; font-weight: 900; white-space: nowrap; background: #0a0a0a; border: 2px solid #ffe600; padding: 1px 7px; transform: skewX(-8deg); }
.sect-rep .sr-buff { font-size: 10px; color: #8fd8a8; font-weight: 800; white-space: nowrap; }
.sect-disc, .sect-cand { display: flex; flex-direction: column; gap: 8px; }
.sd-card, .sc-card {
  display: flex; align-items: center; gap: 10px;
  background: #f2ecdc; border: 2px solid #0a0a0a; padding: 8px 10px;
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 8px, 100% 100%, 0 100%);
  box-shadow: 3px 3px 0 #0a0a0a;
}
.sd-card.done { background: #ffe600; }
.sd-card.busy { opacity: .92; }
.sd-face {
  width: 38px; height: 38px; font-size: 22px; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: #0a0a0a; border: 2px solid var(--qc, #fff); transform: rotate(-4deg);
}
.sd-mid { flex: 1; min-width: 0; }
.sd-name { font-size: 14px; font-weight: 900; color: #0a0a0a; }
.sd-trait { font-size: 10px; color: #6a6478; margin-top: 1px; }
.sd-where { font-size: 10px; color: #c00d14; font-weight: 800; margin-top: 2px; }
.sd-where.free { color: #4a9b62; }
.sd-take {
  flex: none; background: #c50f18; color: #fff; border: 2px solid #0a0a0a;
  font-size: 12px; font-weight: 900; padding: 6px 10px;
  transform: skewX(-8deg); box-shadow: 2px 2px 0 #0a0a0a; animation: ultPulse 1.2s infinite;
}
.sd-take:disabled { background: #b8bcc8; animation: none; }
.sect-places { display: flex; flex-direction: column; gap: 7px; }
.sp-card {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  background: #0a0a0a; border: 2px solid #f2ecdc; color: #fff;
  padding: 9px 11px; font-size: 13px; font-weight: 900;
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 8px, 100% 100%, 0 100%);
  box-shadow: 3px 3px 0 #ffffff22;
}
.sp-card:active { background: #c50f18; }
.sp-ico { font-size: 18px; flex: none; }
.sp-mid { flex: 1; min-width: 0; }
.sp-mid i { display: block; font-style: normal; font-size: 10px; color: #ffffff90; font-weight: 600; margin-top: 2px; }
.sp-lock { font-size: 10px; color: #ffe600; font-weight: 900; white-space: nowrap; }
.sp-card.locked { opacity: .45; }
.sc-refresh { background: none; border: 2px dashed #ffffff60; color: #ffffff90; font-size: 11px; font-weight: 800; padding: 7px; }
.sect-log { display: flex; flex-direction: column; gap: 6px; }
.sl-item {
  font-size: 11px; line-height: 1.7; color: #f2ecdcd8; font-weight: 600;
  background: #101010; border-left: 4px solid #c50f18; padding: 7px 10px;
}

/* 弟子来信信纸 */
.letter {
  position: relative; background: #f6f1e4; border: 2px solid #0a0a0a;
  padding: 14px 14px 12px; margin: 8px 0 10px;
  clip-path: polygon(0 8px, 8px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 12px) 100%, 0 100%);
  box-shadow: 4px 4px 0 #0a0a0a;
}
.letter::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 5px;
  background: repeating-linear-gradient(-60deg, #0a0a0a 0 12px, #c50f18 12px 24px);
}
.lt-stamp {
  position: absolute; right: 10px; top: 14px; width: 34px; height: 38px;
  background: #c50f18; color: #fff; border: 2px dashed #f6f1e4;
  display: flex; align-items: center; justify-content: center; font-size: 17px;
  transform: rotate(6deg);
}
.lt-head { font-size: 12px; font-weight: 900; color: #c00d14; margin: 4px 44px 8px 0; letter-spacing: 1px; }
.lt-body { font-size: 13px; line-height: 1.95; color: #222; font-weight: 600; }
.lt-divider { font-size: 10px; text-align: center; color: #8a8578; margin: 12px 0 6px; letter-spacing: 3px; font-weight: 800; }
.lt-line { font-size: 13px; line-height: 1.9; color: #3a2a6a; font-weight: 800; margin-top: 5px; }
.lt-line::before { content: "⚡ "; color: #c50f18; }

/* ========== 账号/卡密表单 ========== */
.form-row { display: flex; align-items: center; gap: 8px; margin: 8px 0; }
.form-row label { flex: none; width: 44px; font-size: 12px; font-weight: 900; color: #0a0a0a; }
.form-row input {
  flex: 1; min-width: 0; font-size: 13px; font-weight: 700; color: #141414;
  background: #fff; border: 2px solid #0a0a0a; padding: 9px 10px;
  transform: skewX(-6deg); box-shadow: 2px 2px 0 #0a0a0a; outline: none;
}
.form-row input:focus { background: #ffe600; }
.form-row input::placeholder { color: #999; font-weight: 600; }
