/* 视觉语言对齐参考站：高细节像素场景打底，深蓝灰圆角面板，红橙斜纹标题栏，胶囊按钮，粗圆体。 */
@font-face { font-family: "Nunito"; src: url("assets/fonts/Nunito.ttf") format("truetype"); font-weight: 200 1000; font-display: swap; }

:root {
  --ink: #2a2440;
  --panel: rgba(34, 40, 58, .95);
  --panel-solid: #22283a;
  --row: #1a1f2f;
  --row-2: #2b3350;
  --line: #3b4465;
  --text: #e7eaf6;
  --dim: #a4abc6;
  --gold: #ffd23a;
  --gold-2: #f2a516;
  --red: #ff5a5f;
  --red-2: #f0434d;
  --red-dark: #8e1d2a;
  --orange: #ff9a3a;
  --blue: #3a8cff;
  --blue-dark: #1f5bb5;
  --purple: #6a4cd8;
  --purple-2: #c08aff;
  --green: #36c96a;
  --green-dark: #157a3a;
  --chips: #3a8cff;
  --mult: #ff5a5f;
  --dou: #c08aff;
  --fire: #e8622c;
  --water: #2f86e6;
  --electric: #d9a400;
  --grass: #36a14a;
  --stripes: repeating-linear-gradient(-45deg, #ffffff24 0 10px, #fff0 10px 20px);
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --font: "Nunito", "M PLUS Rounded 1c", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: #0d0f1a; color: var(--text); overscroll-behavior: none; }
body { font: 700 14px/1.4 var(--font); -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; border: 0; background: none; padding: 0; cursor: pointer; touch-action: manipulation; }
img { image-rendering: pixelated; display: block; }
.ticon { display: inline-block; flex: none; object-fit: contain; }
input { font: inherit; }
b { font-weight: 900; }

#app { position: fixed; inset: 0; margin: 0 auto; max-width: 480px; background: #1a1630; overflow: hidden; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.boot { height: 100%; display: grid; place-items: center; color: var(--dim); font-weight: 900; }
.boot.err { padding: 24px; text-align: center; }
#rotate { display: none; }
@media (orientation: landscape) and (max-height: 480px) {
  #rotate { display: grid; place-items: center; position: fixed; inset: 0; z-index: 99; background: #1a1630; font-size: 18px; font-weight: 900; }
}

.screen { position: absolute; inset: 0; display: flex; flex-direction: column; padding-top: var(--safe-t); padding-bottom: var(--safe-b); }
.scroll { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 4px 12px 12px; position: relative; }

/* 背景：真实像素图放大，没有素材时退回渐变 */
.bg { position: absolute; inset: 0; z-index: 0; background-size: cover; background-position: center; image-rendering: pixelated; background-color: #1a1630; }
.bg-title { background-image: linear-gradient(#2a2a7a, #6a4cd8 45%, #1a1446); }
.bg-ch1 { background-image: linear-gradient(#7cc7ee 0 50%, #7cc65f 50%, #4c9c46); }
.bg-ch2 { background-image: linear-gradient(#6d5aa6, #eea27f 50%, #8c7a4c 50%, #5d5132); }
.bg-ch3 { background-image: linear-gradient(#151a44, #4a3f88 50%, #39476b 50%, #232c4c); }
.bg-route, .bg-grass { background-image: linear-gradient(#3b7d4f, #1d4a33); }
.bg-shop { background-image: linear-gradient(#7a4a2a, #3a2415); }
.bg-daycare { background-image: linear-gradient(#a8d8a0, #4c9c46); }
.screen > *:not(.bg):not(.sheet-wrap) { position: relative; z-index: 1; }
.battle > .bg { inset: -16px; }

/* 精灵 */
.spr { position: relative; flex: none; pointer-events: none; }
.spr-img { position: absolute; image-rendering: pixelated; background-repeat: no-repeat; }
.spr-img.smooth { image-rendering: auto; }
.silhouette .spr-img { filter: brightness(0) invert(.3); }
.white .spr-img { filter: brightness(0) invert(1); }

/* 胶囊按钮 */
.btn { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 8px 18px; border-radius: 999px; font-weight: 900; font-size: 16px; color: #fff; background: var(--stripes), var(--row-2); box-shadow: 0 4px 0 #11152a, 0 6px 14px #0007; transition: transform .06s, box-shadow .06s; text-shadow: 0 1px 0 #0005; }
.btn:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 #11152a; }
.btn:disabled { filter: saturate(.3) brightness(.65); cursor: default; }
.btn.go { background: var(--stripes), linear-gradient(180deg, #ff6f73, var(--red-2)); box-shadow: 0 5px 0 var(--red-dark), 0 8px 16px #0007; }
.btn.go:active:not(:disabled) { box-shadow: 0 2px 0 var(--red-dark); }
.btn.alt { background: var(--stripes), linear-gradient(100deg, #6c4cf0, var(--blue)); box-shadow: 0 5px 0 #2a2a7a, 0 8px 16px #0007; }
.btn.alt:active:not(:disabled) { box-shadow: 0 2px 0 #2a2a7a; }
.btn.gold { background: var(--stripes), linear-gradient(180deg, #ffe27a, var(--gold)); color: #4a3200; text-shadow: none; box-shadow: 0 5px 0 #8a5a00, 0 8px 16px #0007; }
.btn.ghost { background: #1a1f2fe6; box-shadow: inset 0 0 0 2px var(--line); color: var(--text); font-size: 15px; text-shadow: none; }
.btn.ghost:active:not(:disabled) { box-shadow: inset 0 0 0 2px var(--line); background: var(--row-2); }
.btn.big { min-height: 56px; font-size: 19px; }
.btn.mini { min-height: 44px; padding: 4px 12px; font-size: 13px; }
.btn small { font-weight: 800; font-size: 12px; opacity: .95; }
.row { display: flex; gap: 8px; }
.row.wrap { flex-wrap: wrap; margin-top: 8px; }
.grow { flex: 1; min-width: 0; }

/* 斜切标题牌：红橙斜纹，下沿一条深色台阶 */
.phead { flex: none; align-self: flex-start; margin: 8px 12px 8px 14px; padding: 7px 22px 8px; border-radius: 14px; transform: skewX(-7deg); background: var(--stripes), linear-gradient(100deg, var(--red), var(--orange)); box-shadow: 0 5px 0 var(--red-dark), 0 8px 16px #0007; max-width: calc(100% - 28px); }
.phead > * { transform: skewX(7deg); }
.phead-title { display: flex; align-items: center; gap: 8px; font-size: 22px; font-weight: 1000; line-height: 1.2; text-shadow: 0 2px 0 #0003; color: #fff; }
.phead-sub { margin-top: 1px; padding-bottom: 2px; font-size: 12.5px; font-weight: 900; line-height: 1.3; color: #fff; }
.titlebar { flex: none; display: flex; align-items: center; gap: 6px; padding-left: 10px; }
.titlebar .phead { margin-left: 4px; min-width: 0; }
.backpill { position: relative; isolation: isolate; flex: none; height: 44px; padding: 0 14px; font-weight: 900; color: var(--text); }
.backpill::before { content: ""; position: absolute; inset: 4px 0; z-index: -1; border-radius: 99px; background: var(--panel); box-shadow: 0 3px 10px #0006; }

/* 属性色：胶囊、放射纹立绘、头像环、斜纹小节 */
.ty-fire { --ty: #ff7a1a; --ty2: #ffb03a; --tyd: #a33a17; }
.ty-water { --ty: #3a8cff; --ty2: #6fc0ff; --tyd: #1f4f9c; }
.ty-electric { --ty: #e8b400; --ty2: #ffe05a; --tyd: #8a6300; }
.ty-grass { --ty: #36b857; --ty2: #8fe07a; --tyd: #157a3a; }
.ty-normal { --ty: #8a8fae; --ty2: #c8cbe0; --tyd: #565a78; }
.tpill { display: inline-block; font-size: 12px; font-weight: 1000; line-height: 18px; padding: 1px 12px; border-radius: 99px; background: var(--ty); color: #fff; text-shadow: 0 1px 0 #0003; white-space: nowrap; }
.burst { position: relative; flex: none; border-radius: 16px; overflow: hidden; background: repeating-conic-gradient(from 0deg at 50% 62%, #ffffff30 0 10deg, #fff0 10deg 20deg), radial-gradient(circle at 50% 62%, var(--ty2), var(--ty)); box-shadow: inset 0 0 0 3px #ffffffd9, 0 4px 10px #0006; display: flex; align-items: flex-end; justify-content: center; }
.burst .plate { position: absolute; left: 12%; right: 12%; bottom: 7%; height: 20%; border-radius: 50%; background: #ffffff40; box-shadow: inset 0 0 0 2px #ffffffb3; }
.burst .spr { margin-bottom: 7%; }
.face { position: relative; flex: none; border-radius: 50%; overflow: hidden; background: radial-gradient(circle at 50% 35%, var(--ty2), var(--ty)); box-shadow: 0 0 0 3px #ffffffe8, 0 3px 8px #0007; }
.face img { width: 100%; height: 100%; }
.face.unknown { background: #39405e; }
.face.unknown .spr { position: absolute; left: 0; top: 0; }
.chain { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 3px; margin: 4px 0; }
.chain .link { display: flex; flex-direction: column; align-items: center; color: var(--dim); font-weight: 1000; font-size: 16px; line-height: 1; min-width: 22px; }
.chain .link.multi { flex-direction: row; gap: 3px; padding: 0 3px; }
.chain .link small.or { color: var(--gold); line-height: 1.1; }
.face.current { box-shadow: 0 0 0 3px var(--gold), 0 3px 8px #0007; }
.chain .link small { font-size: 11px; font-weight: 800; white-space: nowrap; }
.chain-label { margin-top: 6px; font-size: 12px; color: var(--dim); font-weight: 800; }
.tsec { margin-top: 12px; border-radius: 14px; overflow: hidden; background: var(--row); }
.tsec-head { display: flex; align-items: center; gap: 8px; padding: 7px 12px; font-weight: 900; font-size: 15px; color: #fff; background: var(--stripes), linear-gradient(100deg, var(--tyd), var(--ty)); text-shadow: 0 1px 0 #0004; }
.tround { width: 26px; height: 26px; border-radius: 50%; background: #fff; display: grid; place-items: center; color: var(--ty); flex: none; }
.tsec-body { padding: 8px 12px 10px; }
.tsec-body p, .tsec-body.plain p { margin: 3px 0; font-size: 14px; line-height: 1.5; font-weight: 700; }
.tsec-body.plain { margin-top: 2px; }
.hero-card { padding: 12px; border-radius: 18px; background: var(--panel); box-shadow: 0 6px 18px #0007; }
.hero-top { display: flex; gap: 12px; align-items: flex-start; }
.dexno { font-size: 12px; color: var(--dim); font-weight: 800; }
.hero-name { font-size: 30px; font-weight: 1000; line-height: 1.2; margin-bottom: 4px; }
.hero-name.small { font-size: 24px; display: flex; align-items: center; gap: 8px; }
.startabs { flex: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; padding: 2px 12px 8px; }
.stab { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 4px 6px; border-radius: 16px; background: var(--panel); font-weight: 900; font-size: 13px; box-shadow: 0 4px 10px #0006; }
.stab { position: relative; min-height: 44px; min-width: 0; }
.stab img { width: 44px; height: 44px; border-radius: 12px; }
.stab .spr, .stab canvas { pointer-events: none; }
.stab > span:not(.lock):not(.newtag) { line-height: 1.15; white-space: nowrap; }
.stab.locked { background: #3d3f63; color: var(--dim); box-shadow: inset 0 0 0 2px #ffffff14, 0 3px 0 #0a0d18; padding-top: 4px; gap: 0; }
.stab.locked .lock { position: absolute; top: 5px; right: 5px; width: 14px; height: 14px; }
.stab.locked.on { background: #4a4c75; box-shadow: 0 0 0 3px var(--gold), 0 4px 12px #0008; }
.newtag { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 4px; border-radius: 99px; font-size: 12px; font-weight: 1000; line-height: 1; color: #4a3200; background: linear-gradient(180deg, #ffe27a, var(--gold)); box-shadow: 0 2px 0 #8a5a00; text-shadow: none; }
.stab .newtag { position: absolute; top: -5px; right: -3px; z-index: 2; animation: newPulse 1.2s ease-in-out infinite; }
@keyframes newPulse { 50% { transform: scale(1.14); } }

/* 没解锁的伙伴：大剪影、问号和条件 */
.hero-card.locked { background: #2f3150; }
.lockburst { position: relative; flex: none; display: grid; place-items: center; border-radius: 16px; background: #3d3f63; box-shadow: inset 0 0 0 2px #ffffff14; }
.lockburst .lock { position: absolute; top: 7px; right: 7px; width: 20px; height: 20px; }
.lock-label { margin-top: 2px; font-size: 12px; font-weight: 900; color: var(--gold); }
.lock-hint { margin-top: 2px; font-size: 15px; font-weight: 900; line-height: 1.35; }

/* 挑战选择：放在“我选你了”上面。挑战的数量和名字会变，所以横向滑动。 */
.foot.starter-foot { flex-direction: column; gap: 6px; padding-top: 7px; }
.starter-foot > .btn { flex: none; width: 100%; }
.chal { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.hscroll { overflow-x: auto; overflow-y: hidden; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.hscroll::-webkit-scrollbar { display: none; }
.chal-row { display: flex; gap: 6px; margin: 0 -12px; padding: 5px 12px 6px; touch-action: pan-x manipulation; }
.chalp { position: relative; flex: none; display: flex; align-items: center; gap: 5px; min-height: 44px; padding: 3px 14px; border-radius: 999px; font-size: 14px; font-weight: 1000; white-space: nowrap; color: #fff; text-shadow: 0 1px 0 #0005; background: var(--stripes), linear-gradient(100deg, #5a4cc0, #3f6cd0); box-shadow: 0 3px 0 #23245e; transition: transform .06s; }
.chalp:active { transform: translateY(2px); }
.chalp.on { background: var(--stripes), linear-gradient(100deg, var(--red-2), var(--orange, #ff9a3a)); box-shadow: 0 0 0 2.5px var(--gold), 0 3px 0 2.5px #8a3a10; }
.chalp.locked { background: var(--stripes), #3d3f63; color: var(--dim); text-shadow: none; box-shadow: inset 0 0 0 1.5px #ffffff18, 0 3px 0 #0a0d18; padding-left: 11px; }
.chalp.locked.peek { background: var(--stripes), #55587f; color: #fff; box-shadow: inset 0 0 0 1.5px #ffffff55, 0 3px 0 #0a0d18; }
.chalp-text { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.15; }
.chalp-text b { font-size: 13px; }
.chalp-text small { font-size: 11px; font-weight: 800; }
.chalp .newtag { position: absolute; top: -6px; right: -2px; }
.chal-cap { display: flex; align-items: center; gap: 5px; min-height: 16px; font-size: 12px; font-weight: 800; line-height: 1.3; color: var(--dim); }
.chal-cap.on { color: var(--gold); }
.chal-cap.locked { color: #fff; }
.chal-cap .lock { width: 12px; height: 12px; }
.chal-tease { display: flex; align-items: center; justify-content: center; gap: 5px; font-size: 12px; font-weight: 800; line-height: 1.3; color: var(--dim); }
.chal-tease .lock { width: 12px; height: 12px; }
.where-main { overflow: hidden; text-overflow: ellipsis; }
.chal-mark { width: fit-content; max-width: 100%; margin-top: 1px; padding: 0 7px; overflow: hidden; text-overflow: ellipsis; border-radius: 99px; font-size: 11px; font-weight: 1000; line-height: 15px; color: #fff; background: var(--stripes), linear-gradient(100deg, var(--red-2), #ff9a3a); text-shadow: 0 1px 0 #0006; }
.chal-rule { padding: 8px 10px; border-radius: 12px; background: var(--row); box-shadow: inset 0 0 0 1.5px var(--gold); }
.pill.chal { font-size: 12px; background: var(--stripes), linear-gradient(100deg, var(--red-2), #ff9a3a); color: #fff; }
.recap-chal { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 13px; font-weight: 900; color: var(--gold); text-shadow: 0 1px 2px #000; }
.hall-chal { margin-top: 3px; }

/* 结算页的解锁时刻 */
.unlockcard { position: relative; display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; padding: 10px 12px; overflow: hidden; border-radius: 18px; background: var(--stripes), linear-gradient(110deg, #3a2a7a, #6a3a9c 60%, #a0522d); box-shadow: 0 0 0 3px var(--gold), 0 0 22px #ffd23a88, 0 6px 0 3px #0a0d18; }
.unlockcard.fresh { animation: unlockIn .5s .32s cubic-bezier(.25, 1.5, .5, 1) both; }
.unlockcard.fresh::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(105deg, #fff0 40%, #fff8 50%, #fff0 60%); transform: translateX(-100%); animation: unlockShine .8s .75s ease-out both; }
@keyframes unlockIn { from { opacity: 0; transform: scale(.7) rotate(-3deg); } to { opacity: 1; transform: none; } }
@keyframes unlockShine { to { transform: translateX(100%); } }
.unlockrow { display: flex; align-items: center; gap: 12px; min-width: 0; }
.unlockart { position: relative; flex: none; display: grid; place-items: center; width: 64px; height: 64px; }
.unlockart .rays { position: absolute; inset: -9px; border-radius: 50%; background: repeating-conic-gradient(#ffd23a66 0 18deg, #ffd23a00 18deg 36deg); -webkit-mask: radial-gradient(circle, #000 42%, #0000 72%); mask: radial-gradient(circle, #000 42%, #0000 72%); animation: unlockSpin 9s linear infinite; }
@keyframes unlockSpin { to { transform: rotate(360deg); } }
.unlockart > img, .unlockglyph { position: relative; display: grid; place-items: center; width: 60px; height: 60px; border-radius: 50%; background: radial-gradient(circle at 50% 36%, var(--ty2, #6a5ad0), var(--ty, #3a2a7a)); box-shadow: 0 0 0 3px var(--gold), 0 3px 0 3px #8a5a00; }
.unlockname { font-size: 23px; font-weight: 1000; line-height: 1.2; color: var(--gold); text-shadow: 0 2px 0 #0009; overflow-wrap: anywhere; }
.unlockname small { font-size: 14px; color: #fff; }
.unlocksub { margin-top: 1px; font-size: 13px; font-weight: 800; line-height: 1.35; color: #f2eefc; text-shadow: 0 1px 1px #0008; }
.stab.on { background: linear-gradient(180deg, var(--ty), var(--tyd)); box-shadow: 0 0 0 3px var(--gold), 0 4px 12px #0008; }

/* 开场横幅：斜体、斜切、蓝紫斜纹 */
.startbanner { position: absolute !important; left: 0; right: 0; top: calc(var(--safe-t) + 122px); z-index: 26 !important; text-align: center; pointer-events: none; animation: bannerIn 1.25s ease-out forwards; }
.startbanner .small { font-size: 15px; font-weight: 900; color: #fff; text-shadow: 0 2px 4px #000; margin-bottom: 4px; }
.startbanner .big { display: inline-block; padding: 8px 34px; font-size: 32px; font-weight: 1000; font-style: italic; color: #fff; border-radius: 14px; transform: skewX(-8deg); background: var(--stripes), linear-gradient(100deg, var(--blue), #8a5cff); box-shadow: 0 6px 18px #0009; text-shadow: 0 2px 0 #0004; }
.startbanner .big.boss { background: var(--stripes), linear-gradient(100deg, var(--red), var(--orange)); }
@keyframes bannerIn { 0% { opacity: 0; transform: scale(1.7); } 12% { opacity: 1; transform: scale(.96); } 20% { transform: scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: translateX(50px); } }

/* 顶栏 */
.topbar { display: flex; align-items: center; gap: 0; height: 46px; flex: none; padding: 0 4px 0 8px; background: linear-gradient(180deg, #0d0f1acc, #0d0f1a00); }
.topbar .where { font-weight: 900; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; text-shadow: 0 2px 0 #000a; color: #fff; }
.topbar .where em { font-style: normal; color: var(--gold); margin-left: 6px; font-size: 13px; }
.chip { display: inline-flex; align-items: center; gap: 4px; height: 34px; padding: 0 10px 0 6px; border-radius: 999px; background: var(--panel); font-weight: 900; font-size: 16px; white-space: nowrap; }
.chip.gold { color: var(--gold); }
.chip img { width: 22px; height: 22px; }
/* 图标圆 36px，按钮本身 44px，点击区域够大，视觉不变 */
.icon-btn { width: 44px; height: 44px; isolation: isolate; display: grid; place-items: center; font-weight: 900; font-size: 16px; color: var(--text); position: relative; flex: none; }
.icon-btn::before { content: ""; position: absolute; inset: 4px; z-index: -1; border-radius: 50%; background: var(--panel); }
.icon-btn img { width: 24px; height: 24px; }
.icon-btn .badge { position: absolute; top: 1px; right: 1px; min-width: 17px; height: 17px; border-radius: 9px; background: var(--red); color: #fff; font-size: 11px; line-height: 17px; text-align: center; }

/* 对手区：敌人站在场景地面上，HUD 是大圆头像压在右端斜切的深色条上 */
.stage { flex: 1 1 0; min-height: 110px; position: relative; }
.stage.danger::after { content: ""; position: absolute; inset: -46px 0 0; box-shadow: inset 0 0 44px #ff2a1a88; pointer-events: none; }
.foe-plat { position: absolute; left: 0; right: 0; margin: 0 auto; bottom: 8px; width: 58%; height: 26px; border-radius: 50%; background: radial-gradient(closest-side, #000000a8 40%, #0000); }
.foe-spr { position: absolute; left: 0; right: 0; bottom: 20px; display: flex; justify-content: center; }
.foe-spr .spr { transform-origin: 50% 100%; animation: breathe 1.7s ease-in-out infinite; }
.foe-spr.fly .spr { animation: hover 2.1s ease-in-out infinite; }
.foe-plat.fly { animation: hoverShadow 2.1s ease-in-out infinite; }
@keyframes breathe { 0%, 100% { transform: none; } 50% { transform: scale(1.035, .955); } }
@keyframes hover { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
@keyframes hoverShadow { 0%, 100% { transform: none; opacity: 1; } 50% { transform: scale(.82); opacity: .75; } }
.foe-spr.drop { animation: foeDrop .36s cubic-bezier(.3, 1.5, .5, 1) both; }
@keyframes foeDrop { from { transform: translateY(-46px) scale(.82); opacity: 0; } }
.foe-spr.hurt { animation: hurtShake .3s; }
.foe-spr.hurt.heavy { animation: hurtHeavy .42s; }
.foe-spr.faint { animation: faint .6s forwards; }
.foe-plat { transition: opacity .4s; }
.foe-plat.gone { opacity: 0; animation: none; }
.foe-spr.blink .spr-img { filter: brightness(0) invert(1); }
@keyframes faint { 25% { transform: translateY(-14px) scale(1.06); opacity: 1; } to { transform: translateY(30px) scale(.8, .3); opacity: 0; } }
@keyframes hurtShake { 20% { transform: translateX(-9px); } 50% { transform: translateX(8px); } 75% { transform: translateX(-4px); } }
@keyframes hurtHeavy { 12% { transform: translate(-16px, 4px) rotate(-5deg); } 34% { transform: translate(15px, -3px) rotate(4deg); } 58% { transform: translate(-9px, 2px) rotate(-2deg); } 80% { transform: translate(5px, 0); } }

.foe-card { position: absolute; left: 8px; right: 22px; top: 0; z-index: 2; display: flex; align-items: flex-start; }
.foe-card .face { z-index: 2; margin-top: 1px; box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--tyd), 0 5px 10px #0009; }
.foe-card.boss .face { box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--gold-2), 0 5px 10px #0009; }
.foe-main { position: relative; isolation: isolate; flex: 1; min-width: 0; margin: 4px 0 0 -30px; padding: 6px 12px 9px 40px; }
.foe-main::before { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: 0 12px 12px 0; background: linear-gradient(180deg, #2c3350, #1a1f2f); transform: skewX(-15deg); transform-origin: 0 100%; box-shadow: 0 4px 0 #0a0d18, 0 8px 16px #0008; }
.foe-card.boss .foe-main::before { background: var(--stripes), linear-gradient(100deg, #6a1c2a, #2c1a2c 70%); }
.foe-name { min-width: 0; font-size: 15px; font-weight: 1000; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #fff; }
.foe-name .pill { margin-left: 4px; }
.foe-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.foe-head .hp { font-size: 21px; line-height: 1.1; white-space: nowrap; font-weight: 1000; color: #fff; font-variant-numeric: tabular-nums; text-shadow: 0 2px 0 #0007; }
.foe-head .hp small { color: var(--dim); font-size: 12px; font-weight: 800; text-shadow: none; }
.hpbar { position: relative; height: 15px; margin-top: 4px; border-radius: 4px; background: #0a0d18; box-shadow: 0 0 0 2px #0a0d18, inset 0 2px 0 #0007; overflow: hidden; transform: skewX(-15deg); }
.hpbar i { position: absolute; left: 0; top: 0; bottom: 0; z-index: 1; display: block; background: linear-gradient(#a3f7ad 0 22%, #4ede7c 22% 70%, var(--green)); transition: width .16s ease-out; }
.hpbar i.ghost { z-index: 0; background: #fff; transition: width .55s .24s ease-in; }
.hpbar.low i:not(.ghost) { background: linear-gradient(#fff0a8 0 22%, #ffd23a 22% 70%, var(--gold-2)); }
.hpbar.crit i:not(.ghost) { background: linear-gradient(#ffc0b0 0 22%, #ff6a5f 22% 70%, var(--red-2)); }
.rule-line { margin-top: 5px; font-size: 11.5px; color: var(--gold); font-weight: 900; line-height: 1.25; }
/* 胡地战：提示可以换位 */
.sleep-hint { position: absolute; left: 50%; bottom: 3px; z-index: 3; transform: translateX(-50%); display: flex; align-items: center; gap: 5px; padding: 2px 12px 3px; border-radius: 99px; background: var(--purple); box-shadow: 0 0 0 2px #fff, 0 3px 0 #0007; color: #fff; font-size: 12.5px; font-weight: 1000; white-space: nowrap; }
.sleep-hint .arrow { display: inline-block; font-size: 11px; color: var(--gold); animation: nudge .7s ease-in-out infinite alternate; }
@keyframes nudge { to { transform: translateX(-4px); } }

/* 队伍四格：属性色放射底，精灵略微探出，默认露出角色和再动次数 */
.slot.t-fire { --ty: #ff7a1a; --ty2: #ffb03a; --tyd: #a33a17; }
.slot.t-water { --ty: #3a8cff; --ty2: #6fc0ff; --tyd: #1f4f9c; }
.slot.t-electric { --ty: #e8b400; --ty2: #ffe05a; --tyd: #8a6300; }
.slot.t-grass { --ty: #36b857; --ty2: #8fe07a; --tyd: #157a3a; }
.slot.t-normal { --ty: #8a8fae; --ty2: #c8cbe0; --tyd: #565a78; }
.team { flex: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; padding: 6px 7px 7px; touch-action: none; }
.team.strip { padding: 8px 7px 7px; touch-action: auto; background: linear-gradient(0deg, #0d0f1acc, #0d0f1a00); }
.slot { position: relative; height: 102px; border-radius: 13px; background: linear-gradient(#0000 52%, #0a0d18d9 70%), repeating-conic-gradient(from 0deg at 50% 44%, #ffffff26 0 12deg, #fff0 12deg 24deg), radial-gradient(circle at 50% 44%, var(--ty2), var(--ty) 58%, var(--tyd)); box-shadow: inset 0 0 0 2px #ffffffb8, 0 3px 0 #0009, 0 5px 10px #0006; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; padding: 0 5px 5px; cursor: pointer; transition: transform .1s; }
.slot:active { transform: scale(.97); }
.slot > * { flex: none; }
.slot .spr { margin-bottom: -1px; }
.slot.empty { background: #0a0d1866; box-shadow: none; border: 2px dashed #ffffff55; color: #ffffffb0; font-size: 12px; justify-content: center; cursor: default; }
.slot .nm { width: 100%; font-weight: 1000; font-size: 12px; line-height: 1.2; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #fff; text-shadow: 0 1px 0 #000a; }
.slot .rl { font-size: 11px; font-weight: 800; color: #d7dcf0; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.slot.tagged .ex { top: 12px; }
.slot .ex { position: absolute; right: 3px; top: 3px; z-index: 4; font-size: 11px; font-weight: 1000; line-height: 15px; padding: 0 5px; border-radius: 8px; background: var(--purple); color: #fff; box-shadow: 0 0 0 1.5px #fff; font-variant-numeric: tabular-nums; }
.slot .ex.out { background: #3b4465; color: #a4abc6; box-shadow: 0 0 0 1.5px #a4abc6; }
.slot.dragging { z-index: 9; box-shadow: inset 0 0 0 2px #fff, 0 0 0 3px var(--gold), 0 10px 20px #000a; transition: none; }
.slot.trig { box-shadow: inset 0 0 0 2px #fff, 0 0 0 3px var(--gold), 0 0 16px #ffd23a88; }
.slot.hop .spr { animation: hop .26s cubic-bezier(.3, 1.3, .5, 1); }
@keyframes hop { 0% { transform: scale(1.08, .9); } 45% { transform: translateY(-20px) scale(.95, 1.06); } 80% { transform: translateY(0) scale(1.08, .92); } }
.slot.ready { box-shadow: inset 0 0 0 2px #fff, 0 0 0 3px var(--green), 0 0 14px #36c96a88; }
.slot.fresh { box-shadow: inset 0 0 0 2px #fff, 0 0 0 3px var(--gold), 0 0 16px #ffd23a88; }
.slot .tag { position: absolute; top: -6px; left: 50%; transform: translateX(-50%); z-index: 3; white-space: nowrap; font-size: 11px; font-weight: 1000; border-radius: 99px; padding: 1px 8px; line-height: 15px; box-shadow: 0 2px 0 #0007; }
.slot .tag.new { background: var(--gold); color: #4a3200; }
.slot .tag.ok { background: var(--green); color: #082a14; }
.slot .tag.zz { background: var(--purple); color: #fff; }
.slot.asleep .spr { opacity: .8; }
.gbar { width: 100%; height: 6px; margin-top: 3px; border-radius: 99px; background: #0a0d18; box-shadow: 0 0 0 1px #ffffff40; overflow: hidden; flex: none; }
.gbar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(#b8ffc6, var(--green)); transition: width .25s; }
.slot.ready .gbar i { background: linear-gradient(#fff0a8, var(--gold)); }
.gbar.stone { background: none; box-shadow: none; }
/* 选牌预览：成长条的亮段、成长文字、花斗志的顺序 */
.gbar { position: relative; }
.gbar i.gain { position: absolute; top: 0; bottom: 0; border-radius: 0; background: #fff !important; animation: gainPulse .9s ease-in-out infinite alternate; }
@keyframes gainPulse { from { opacity: .55; } to { opacity: 1; } }
.slot .rl.pv { color: #b8ffc6; font-weight: 1000; }
.slot .spend { display: inline-block; font-size: 11px; font-weight: 1000; line-height: 14px; padding: 0 6px; border-radius: 7px; background: #2a1c5c; color: var(--purple-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.slot .spend.first { background: var(--gold); color: #4a3200; }
.slot .spend.none { background: #3b4465; color: #c8cbe0; }
.float { position: absolute; left: 50%; top: 14%; z-index: 8; transform: translateX(-50%); pointer-events: none; font-size: 17px; line-height: 1; font-weight: 1000; color: #fff; -webkit-text-stroke: 4px #1a1630; paint-order: stroke fill; white-space: nowrap; animation: float .62s ease-out forwards; }
.float.chips { color: #8fcbff; } .float.mult { color: #ff9a9d; } .float.xmult { color: #e4b3ff; font-size: 23px; }
.float.dou { color: var(--purple-2); } .float.grow { color: #8ff5a3; } .float.gold { color: var(--gold); }
.float.extra, .float.repeat { color: var(--gold); font-size: 20px; }
@keyframes float { 0% { transform: translate(-50%, 8px) scale(.6); opacity: 0; } 18% { transform: translate(-50%, 0) scale(1.15); opacity: 1; } 34% { transform: translate(-50%, -2px) scale(1); } 100% { transform: translate(-50%, -26px); opacity: 0; } }

/* 伤害数字：越大越猛，击倒最大。位置以敌人为准 */
.dmg { position: absolute; left: 50%; bottom: calc(var(--foot, 20px) + var(--foe-h, 120px) * .5); z-index: 5; margin-left: var(--dx, 0); line-height: 1; font-weight: 1000; font-size: 38px; color: #fff; -webkit-text-stroke: 7px #1a1630; paint-order: stroke fill; pointer-events: none; white-space: nowrap; font-variant-numeric: tabular-nums; animation: dmg .8s ease-out forwards; }
.dmg.t1 { font-size: 50px; color: #ffe27a; }
.dmg.t2 { font-size: 66px; color: var(--gold); -webkit-text-stroke-width: 9px; }
.dmg.t3 { font-size: 84px; color: #ff6a3a; -webkit-text-stroke: 11px #fff; animation-duration: .9s; }
@keyframes dmg { 0% { transform: translate(-50%, 0) rotate(var(--rot, 0)) scale(2.2); opacity: 0; } 14% { transform: translate(-50%, 0) rotate(var(--rot, 0)) scale(.92); opacity: 1; } 26% { transform: translate(-50%, 0) rotate(var(--rot, 0)) scale(1.06); } 36% { transform: translate(-50%, 0) rotate(var(--rot, 0)) scale(1); } 76% { opacity: 1; } 100% { transform: translate(-50%, -44px) rotate(var(--rot, 0)) scale(1); opacity: 0; } }
.shard { position: absolute; left: 50%; bottom: calc(var(--foot, 20px) + var(--foe-h, 120px) * .5); z-index: 4; width: 9px; height: 9px; pointer-events: none; }
.orb { position: absolute !important; z-index: 20 !important; width: 14px; height: 14px; margin: 0; border-radius: 50%; background: #fff; box-shadow: 0 0 0 3px var(--oc, #8fcbff); pointer-events: none; }
.orb.chips { --oc: var(--chips); } .orb.mult { --oc: var(--mult); } .orb.xmult { --oc: var(--purple-2); }
.hitflash { position: absolute !important; inset: 0; z-index: 24 !important; background: #fff; pointer-events: none; animation: hitflash .24s ease-out forwards; }
@keyframes hitflash { from { opacity: .75; } to { opacity: 0; } }

/* 底部操作坞 */
.dock { flex: none; background: var(--panel-solid); border-radius: 20px 20px 0 0; box-shadow: 0 -6px 18px #0008, inset 0 2px 0 #ffffff14; padding-top: 2px; }
.score { position: relative; height: 58px; display: flex; align-items: center; gap: 5px; padding: 0 12px; }
.score-name { flex: 1; min-width: 0; line-height: 1.2; }
.score-name b { display: block; font-size: 16px; font-weight: 1000; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #fff; }
.score-name span { display: block; color: var(--dim); font-size: 12px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.score-name span.hot, .hot { color: var(--gold); font-weight: 900; }
.num { position: relative; font-weight: 1000; font-size: 24px; min-width: 56px; height: 44px; padding: 0 9px; display: grid; place-items: center; border-radius: 10px; color: #fff; font-variant-numeric: tabular-nums; text-shadow: 0 2px 0 #0005; transform: skewX(-7deg); }
.num.long { font-size: 18px; padding: 0 7px; }
.num.chips { background: var(--stripes), linear-gradient(180deg, #6fb0ff, var(--chips)); box-shadow: 0 3px 0 var(--blue-dark); }
.num.mult { background: var(--stripes), linear-gradient(180deg, #ff8589, var(--mult)); box-shadow: 0 3px 0 var(--red-dark); }
.num.mult.h1 { background: var(--stripes), linear-gradient(180deg, #ffb35e, #ff7a1a); box-shadow: 0 3px 0 #a33a17; }
.num.mult.h2 { background: var(--stripes), linear-gradient(180deg, #ff77c8, #e6238f); box-shadow: 0 3px 0 #7c1050; }
.num.mult.h3 { background: var(--stripes), linear-gradient(180deg, #c49aff, #8a3cff); box-shadow: 0 3px 0 #3f1a8c, 0 0 14px #b078ff; }
.num.x { background: var(--stripes), linear-gradient(180deg, #a07cff, var(--purple)); box-shadow: 0 3px 0 #2e1c80; min-width: 42px; font-size: 18px; }
.num.bump { animation: bump .2s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes bump { 40% { transform: skewX(-7deg) scale(var(--b, 1.26)); } }
.times { font-weight: 1000; font-size: 18px; color: var(--dim); }
.score::before { content: ""; position: absolute; inset: 4px 6px; border-radius: 12px; background: var(--stripes), linear-gradient(100deg, #6a4cd84d, #ff9a3a33); opacity: 0; transition: opacity .12s; pointer-events: none; }
.score.live::before { opacity: 1; }
.score > * { position: relative; }
.score-name b.total { font-size: 26px; line-height: 1.05; color: var(--gold); font-variant-numeric: tabular-nums; text-shadow: 0 2px 0 #0007; animation: pop .22s; }
.score.kill .num.chips, .score.kill .num.mult { outline: 2px solid var(--gold); outline-offset: 1px; }

.res { display: flex; align-items: center; justify-content: space-between; gap: 8px; height: 28px; margin: 0 8px; padding: 0 12px; border-radius: 99px; background: var(--row); font-size: 12px; color: var(--dim); font-weight: 800; }
.res span { display: inline-flex; align-items: center; gap: 4px; }
.res b { color: var(--text); font-size: 16px; font-weight: 1000; font-variant-numeric: tabular-nums; }
.res .dou b { color: var(--purple-2); }
.res .dou.up { animation: pop .2s; }
.icon-btn { transition: transform .08s; }
.icon-btn:active, .backpill:active, .stab:active { transform: scale(.92); }
.speed-btn { font-size: 13px; font-weight: 1000; color: var(--gold); font-variant-numeric: tabular-nums; }
@keyframes pop { 40% { transform: scale(1.22); } }

/* 手牌：属性纹理、内框、高光。选中才抬起，打出要再按“出牌” */
.card.fire { --ct: #e8622c6b; --cb: #8f2e109e; --c: #e8622c; --c2: #ff9a3a; --cd: #8f2e10; --tex: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40' shape-rendering='crispEdges'%3E%3Cpath d='M10 38c-7-8 2-13 0-22 7 5 9 12 6 22zM30 20c-6-6 1-11 0-17 6 3 7 9 5 17z' fill='%23fff' fill-opacity='.17'/%3E%3C/svg%3E"); }
.card.water { --ct: #2f86e66b; --cb: #164f9e9e; --c: #2f86e6; --c2: #66beff; --cd: #164f9e; --tex: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40'%3E%3Cpath d='M0 12q10-9 20 0t20 0M0 32q10-9 20 0t20 0' fill='none' stroke='%23fff' stroke-opacity='.2' stroke-width='3'/%3E%3C/svg%3E"); }
.card.electric { --ct: #e0a8006b; --cb: #8a63009e; --c: #e0a800; --c2: #ffe05a; --cd: #8a6300; --tex: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40'%3E%3Cpath d='M0 14l10-9 10 9 10-9 10 9M0 34l10-9 10 9 10-9 10 9' fill='none' stroke='%23fff' stroke-opacity='.26' stroke-width='3'/%3E%3C/svg%3E"); }
.card.grass { --ct: #36a14a6b; --cb: #157a3a9e; --c: #36a14a; --c2: #8fe07a; --cd: #157a3a; --tex: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40'%3E%3Cpath d='M6 20C6 10 14 5 22 5c0 9-7 15-16 15zM24 38c0-8 6-13 14-13 0 8-6 13-14 13z' fill='%23fff' fill-opacity='.17'/%3E%3C/svg%3E"); }
.hand { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; padding: 16px 8px 8px; }
.card { position: relative; height: 92px; border-radius: 12px; overflow: visible; color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: space-between; padding: 6px 2px 8px; transition: transform .13s cubic-bezier(.3, 1.5, .5, 1), opacity .13s; background-color: var(--c); background-image: linear-gradient(170deg, #ffffff30 0 34%, #fff0 34.5%), linear-gradient(180deg, var(--ct), var(--cb)), var(--tile, var(--tex)), linear-gradient(180deg, var(--c2), var(--c) 46%, var(--cd)); background-size: auto, auto, 96px 96px, auto; background-position: 0 0, 0 0, center, 0 0; image-rendering: pixelated; box-shadow: 0 4px 0 var(--cd), 0 6px 10px #0008, inset 0 0 0 2px #fff; }
.card::before { content: ""; position: absolute; inset: 4px; border-radius: 8px; box-shadow: inset 0 0 0 1.5px #ffffff66; pointer-events: none; }
.card .rk { position: relative; font-size: 33px; line-height: 1; font-weight: 1000; color: #fff; -webkit-text-stroke: 6px #1a1630; paint-order: stroke fill; font-variant-numeric: tabular-nums; }
.card .gl { position: relative; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; background: #fff; color: var(--c); box-shadow: 0 2px 0 var(--cd), 0 0 0 2px #ffffff55; }
.card .gl svg, .card .gl img { width: 27px !important; height: 27px !important; }
.card:active:not(:disabled) { transform: scale(.95); }
.card.sel { transform: translateY(-15px) scale(1.04); z-index: 2; box-shadow: 0 6px 0 var(--cd), inset 0 0 0 2px #fff, 0 0 0 3px var(--gold), 0 0 18px #ffd23a; }
.card.sel:active:not(:disabled) { transform: translateY(-11px) scale(1); }
.card.dim { opacity: .62; }
.card.deal { animation: deal .26s cubic-bezier(.3, 1.3, .5, 1) both; animation-delay: calc(var(--i, 0) * 50ms); }
@keyframes deal { from { transform: translateY(26px) rotate(7deg) scale(.82); opacity: 0; } }
.card.scoring { transform: translateY(-20px); z-index: 2; box-shadow: 0 6px 0 var(--cd), inset 0 0 0 2px #fff, 0 0 0 3px #fff; }
.card.hit { animation: cardHit .24s cubic-bezier(.3, 1.4, .5, 1); }
@keyframes cardHit { 45% { transform: translateY(-36px) scale(1.1) rotate(-2deg); filter: brightness(1.35); } 100% { transform: translateY(-20px); } }
.card.gone { animation: cardGone .24s ease-in forwards; pointer-events: none; }
@keyframes cardGone { to { transform: translateY(-120px) scale(.55) rotate(8deg); opacity: 0; } }
.card.mini { height: 72px; padding: 4px 2px 5px; }
.card.mini .rk { font-size: 22px; -webkit-text-stroke-width: 4px; }
.card.mini .gl { width: 26px; height: 26px; }
.card.mini .gl svg, .card.mini .gl img { width: 20px !important; height: 20px !important; }

.actions { display: flex; gap: 8px; padding: 4px 10px 12px; }
.actions .play { flex: 1.6; flex-direction: column; gap: 0; line-height: 1.15; min-height: 54px; padding: 4px 8px; font-size: 18px; }
.actions .swap { flex: 1; flex-direction: column; gap: 0; line-height: 1.15; min-height: 54px; padding: 4px 8px; font-size: 16px; }
.actions .play.kill { background: var(--stripes), linear-gradient(180deg, #ffe27a, var(--gold-2)); color: #4a2200; text-shadow: none; box-shadow: 0 5px 0 #8a5a00, 0 0 18px #ffd23a; }

.section { display: table; margin: 12px 0 8px 4px; padding: 3px 16px 4px; border-radius: 8px; font-weight: 1000; color: #fff; font-size: 14px; transform: skewX(-7deg); background: var(--stripes), linear-gradient(100deg, var(--purple), var(--blue)); box-shadow: 0 3px 0 #2a2a7a; text-shadow: 0 1px 0 #0005; }
.foot { flex: none; padding: 8px 12px 12px; background: var(--panel-solid); border-radius: 18px 18px 0 0; box-shadow: 0 -4px 14px #0007; display: flex; gap: 8px; }
.note { color: var(--dim); font-size: 13px; font-weight: 700; }
.card-note { padding: 12px; border-radius: 14px; background: var(--panel); }
/* 直接压在场景上的说明文字一律放到深色底板上 */
.scroll > p.note { margin: 8px 0 4px; padding: 10px 12px; border-radius: 14px; background: var(--panel-solid); color: var(--text); text-shadow: none; box-shadow: 0 3px 0 #0a0d18; }

/* 选项卡：参考站技能小卡的语言，深色圆角 + 属性色细描边 + 数据胶囊 */
.offer { --ty: #4a5378; display: flex; gap: 10px; align-items: center; width: 100%; text-align: left; padding: 9px 10px; margin-bottom: 8px; border-radius: 16px; background: var(--panel-solid); box-shadow: inset 0 0 0 1.5px var(--ty), 0 4px 0 #0a0d18, 0 6px 14px #0007; transition: transform .08s; }
button.offer:active:not(:disabled) { transform: translateY(3px) scale(.99); box-shadow: inset 0 0 0 1.5px var(--ty), 0 1px 0 #0a0d18; }
.offer:disabled { opacity: .62; }
.offer:disabled .price { color: #ff9a9d; }
.offer.static { box-shadow: inset 0 0 0 1.5px #3b4465; background: var(--row); }
.offer.sold { opacity: .7; min-height: 44px; }
.offer .art { flex: none; width: 76px; height: 76px; display: grid; place-items: center; border-radius: 14px; position: relative; overflow: hidden; background: repeating-conic-gradient(from 0deg at 50% 50%, #ffffff1f 0 12deg, #fff0 12deg 24deg), radial-gradient(circle, #8a6cf0, var(--purple) 60%, #3a2a8c); box-shadow: inset 0 0 0 2px #ffffffb8, 0 3px 8px #0006; }
.offer .art.small { width: 58px; height: 58px; }
.offer .art img { width: 48px; height: 48px; }
.offer .body { flex: 1; min-width: 0; }
.offer .title { font-size: 17px; font-weight: 1000; display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; color: #fff; }
.offer .text { font-size: 13px; line-height: 1.4; color: var(--text); margin-top: 3px; font-weight: 700; }
.sub { font-size: 12px; color: var(--dim); margin-top: 3px; line-height: 1.35; font-weight: 700; }
.pill { display: inline-block; font-size: 11px; font-weight: 900; padding: 2px 8px; border-radius: 99px; background: var(--row-2); color: var(--text); white-space: nowrap; }
.pill.warn { background: var(--red-2); color: #fff; }
.pill.safe { background: var(--green-dark); color: #d3f8de; }
.pill.double { position: relative; margin-bottom: 5px; padding: 3px 12px; font-size: 13.5px; font-weight: 1000; background: var(--stripes), linear-gradient(180deg, #ffe27a, var(--gold)); color: #4a3200; box-shadow: 0 2px 0 #8a5a00; }
.price { flex: none; display: inline-flex; align-items: center; gap: 3px; height: 30px; padding: 0 9px 0 5px; border-radius: 99px; background: #0a0d18; color: var(--gold); font-weight: 1000; font-size: 16px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.price img { width: 18px; height: 18px; }

/* 路线：每条路一张大卡，顶部是路线色斜纹，图标压在分界上 */
.fork { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.road { --rc: #3a8cff; --rd: #1f4f9c; position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; padding: 58px 8px 12px; border-radius: 18px; overflow: hidden; background: var(--panel-solid); box-shadow: inset 0 0 0 2px var(--rc), 0 5px 0 #0a0d18, 0 8px 16px #0008; min-height: 200px; transition: transform .08s; }
.road::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 44px; background: var(--stripes), linear-gradient(100deg, var(--rd), var(--rc)); }
.road:active { transform: translateY(3px) scale(.985); }
.road-mart { --rc: #f2a516; --rd: #a86a00; }
.road-grass { --rc: #36b857; --rd: #157a3a; }
.road-daycare { --rc: #ff7fb0; --rd: #b23c70; }
.road.danger { --rc: #ff5a5f; --rd: #8e1d2a; background: linear-gradient(180deg, #4a1820, #2e1018); }
.road-icon { position: absolute; left: 50%; top: 12px; width: 58px; height: 58px; margin-left: -29px; display: grid; place-items: center; border-radius: 50%; background: #fff; box-shadow: 0 0 0 3px var(--rc), 0 3px 8px #0007; }
.road-icon img { width: 44px !important; height: 44px !important; }
.road b { position: relative; margin-top: 14px; font-size: 18px; font-weight: 1000; color: #fff; }
.road p { position: relative; flex: 1; margin: 5px 0 8px; font-size: 13px; line-height: 1.4; font-weight: 700; }
.nextfoe { display: flex; align-items: center; gap: 10px; padding: 8px 12px 8px 10px; margin-bottom: 10px; border-radius: 16px; background: var(--panel-solid); box-shadow: 0 4px 0 #0a0d18, 0 6px 14px #0007; }
.nextfoe.boss { background: var(--stripes), linear-gradient(100deg, #6a1c2a, #2c1a2c 70%); }
.nextfoe .t { font-weight: 1000; color: #fff; }
.nextfoe .s { font-size: 12px; color: var(--dim); font-weight: 700; }
.nextfoe.boss .s { color: var(--gold); }

/* 商店 */
.deckbar { flex: none; display: flex; align-items: stretch; gap: 8px; margin: 0 12px 6px; padding: 6px 8px 7px 10px; border-radius: 16px; background: var(--panel-solid); box-shadow: inset 0 0 0 1.5px var(--gold-2), 0 4px 0 #0a0d18, 0 6px 14px #0007; }
.deck-main { flex: 1; min-width: 0; }
.deck-title { font-size: 12px; line-height: 1.2; color: var(--dim); font-weight: 900; }
.deck-types { display: grid; grid-template-columns: repeat(4, auto); justify-content: space-between; gap: 2px; margin-top: 1px; }
.deck-types.in-sheet { justify-content: start; gap: 14px; margin: 6px 0 2px; }
.dk { display: inline-flex; align-items: center; gap: 2px; border-radius: 8px; padding-right: 2px; }
.dk b { font-size: 21px; line-height: 1; font-weight: 1000; color: #fff; font-variant-numeric: tabular-nums; text-shadow: 0 2px 0 #0007; }
.dk svg { color: var(--ty); }
.dk.up { animation: pop .34s cubic-bezier(.3, 1.6, .5, 1); }
.dk.up b { color: var(--gold); }
.deck-ratio { display: flex; gap: 2px; height: 5px; margin-top: 4px; }
.deck-ratio i { display: block; min-width: 0; border-radius: 3px; background: var(--ty); }
.deck-remove { flex: none; flex-direction: column; gap: 0; line-height: 1.15; min-height: 44px; padding: 3px 12px; font-size: 13.5px; box-shadow: 0 3px 0 #2a2a7a; align-self: center; }
.deck-remove small { font-size: 11.5px; color: var(--gold); }
.cards3 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.cardbuy { display: flex; align-items: center; gap: 8px; padding: 8px; border-radius: 14px; background: var(--panel-solid); text-align: left; box-shadow: 0 4px 0 #0a0d18; transition: transform .08s; }
.cardbuy:active:not(:disabled) { transform: translateY(3px); }
.cardbuy .card { width: 50px; flex: none; }
.cardbuy:disabled { opacity: .62; }
.deckgrid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-top: 8px; }

/* 换界面：旧界面淡出，新界面内容依次进场。只从上方或原地进场，不把内容推出屏幕 */
.screen.leaving { z-index: 5; pointer-events: none; animation: leave .18s ease-in forwards; }
@keyframes leave { to { opacity: 0; } }
.screen.enter > .phead, .screen.enter > .titlebar .phead { animation: pheadIn .32s cubic-bezier(.3, 1.4, .5, 1) both; }
@keyframes pheadIn { from { transform: skewX(-7deg) translateY(-22px) scale(.86); opacity: 0; } }
.screen.enter .scroll > *, .screen.enter .fork > .road, .screen.enter .cards3 > *, .screen.enter .dex > * { animation: listIn .28s cubic-bezier(.3, 1.3, .5, 1) both; animation-delay: calc(var(--i, 0) * 45ms + 60ms); }
@keyframes listIn { from { transform: translateY(16px) scale(.97); opacity: 0; } }
.scroll > :nth-child(2), .fork > :nth-child(2) { --i: 1; } .scroll > :nth-child(3), .fork > :nth-child(3) { --i: 2; } .scroll > :nth-child(4), .fork > :nth-child(4) { --i: 3; } .scroll > :nth-child(5) { --i: 4; } .scroll > :nth-child(n+6) { --i: 5; }
.dex > :nth-child(n+5) { --i: 1; } .dex > :nth-child(n+9) { --i: 2; } .dex > :nth-child(n+13) { --i: 3; } .dex > :nth-child(n+17) { --i: 4; }
.screen.enter > .deckbar, .screen.enter > .team, .screen.enter > .foot, .screen.enter > .startabs, .screen.enter > .dock { animation: fade .22s both; }
.screen.enter .foe-card { animation: hudIn .34s cubic-bezier(.3, 1.3, .5, 1) both; }
@keyframes hudIn { from { transform: translateY(-46px); opacity: 0; } }
.screen.enter .logo { animation: logoIn .42s cubic-bezier(.3, 1.5, .5, 1) both; }
@keyframes logoIn { from { transform: scale(.7); opacity: 0; } }

/* 抽屉 */
.sheet-wrap { position: absolute; inset: 0; z-index: 30; display: flex; flex-direction: column; justify-content: flex-end; background: #0009; animation: fade .14s; }
@keyframes fade { from { opacity: 0; } }
.sheet { max-height: 88%; overflow-y: auto; padding: 16px 16px calc(16px + var(--safe-b)); background: var(--panel-solid); border-radius: 20px 20px 0 0; box-shadow: 0 -8px 24px #000a; animation: rise .18s ease-out; }
.sheet .phead { margin: 0 0 10px; }
@keyframes rise { from { transform: translateY(40px); } }
.sheet-wrap.closing { pointer-events: none; animation: leave .13s ease-in forwards; }
.sheet-wrap.closing .sheet { transition: transform .13s ease-in; transform: translateY(30px); }
.settings { margin-top: 10px; padding: 4px 12px; border-radius: 14px; background: var(--row); }
.setrow { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 48px; font-weight: 900; }
.seg { display: flex; gap: 4px; padding: 3px; border-radius: 99px; background: #0a0d18; }
.seg button { min-width: 48px; height: 44px; border-radius: 99px; font-weight: 1000; color: var(--dim); }
.seg button.on { background: var(--gold); color: #4a3200; }
.toggle { min-width: 64px; height: 44px; border-radius: 99px; font-weight: 1000; background: #3b4465; color: var(--dim); }
.toggle.on { background: var(--green); color: #082a14; }
.sheet h2 { margin: 0 0 4px; font-size: 19px; font-weight: 900; }
.sheet .hero { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 8px; }
.sheet .hero .art { width: 96px; height: 96px; flex: none; background: var(--row); border-radius: 14px; display: grid; place-items: center; overflow: hidden; }
.sheet p { margin: 6px 0; font-size: 14px; line-height: 1.5; }
.sheet .note { font-size: 13px; }
.sheet .btns { display: grid; gap: 10px; margin-top: 12px; }
.nick { width: 100%; height: 44px; margin-top: 6px; padding: 0 12px; border: 0; border-radius: 99px; background: var(--row); color: var(--text); font-size: 16px; font-weight: 800; user-select: text; -webkit-user-select: text; }
.ptable { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 4px; }
.ptable td { padding: 5px 4px; border-bottom: 1px solid var(--line); }
.ptable td:nth-child(n+2) { text-align: right; font-weight: 900; }
.ptable .c { color: #7cb6ff; } .ptable .m { color: #ff8e92; }
.toast { position: absolute; left: 50%; top: calc(var(--safe-t) + 152px); z-index: 60; transform: translateX(-50%); padding: 8px 16px; border-radius: 99px; background: var(--panel-solid); font-weight: 900; box-shadow: 0 4px 12px #000a; white-space: nowrap; animation: rise .15s; }

/* 进化：暗场聚光 → 白色剪影越闪越快 → 白闪 → 新形态亮相 + 放射光芒 → 能力卡弹出 */
.overlay { position: absolute; inset: 0; z-index: 40; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 16px 16px calc(16px + var(--safe-b)); text-align: center; overflow: hidden; }
.evo { background: radial-gradient(circle at 50% 34%, #6a4cd8 0%, #2a2a7a 32%, #1a1030 68%, #0d0a1c 100%); animation: fade .2s; }
.evo > * { position: relative; z-index: 1; }
.evo-rays { position: absolute !important; left: 50%; top: 34%; z-index: 0 !important; width: 860px; height: 860px; margin: -430px; border-radius: 50%; background: repeating-conic-gradient(#ffffff14 0 12deg, #fff0 12deg 24deg); -webkit-mask-image: radial-gradient(closest-side, #000 50%, #0000); mask-image: radial-gradient(closest-side, #000 50%, #0000); pointer-events: none; }
.evo.done { background: radial-gradient(circle at 50% 30%, var(--ty2) 0%, var(--ty) 26%, var(--tyd) 52%, #1a1030 88%); }
.evo.done .evo-rays { background: repeating-conic-gradient(#ffffff4d 0 10deg, #fff0 10deg 20deg); }
.evo .stagebox { position: relative; flex: none; margin-top: 8px; }
.evo .stagebox > .spr { position: absolute; left: 0; top: 0; }
.evo-glow { position: absolute; left: 50%; top: 50%; width: 130%; aspect-ratio: 1; margin: -65%; border-radius: 50%; background: radial-gradient(closest-side, #ffffffd9, #ffffff55 45%, #fff0); opacity: 0; transition: opacity .12s; pointer-events: none; }
.evo-plate { position: absolute; left: 14%; right: 14%; bottom: -5%; height: 16%; border-radius: 50%; background: #ffffff33; box-shadow: inset 0 0 0 2px #ffffff99; }
.evo-spark { position: absolute; left: 50%; top: 50%; width: 10px; height: 10px; margin: -5px; border-radius: 2px; background: #fff; box-shadow: 0 0 0 2px #ffffff66; pointer-events: none; }
.evo-spark.gold { background: var(--gold); box-shadow: 0 0 0 2px #ffd23a66; }
.evo-ring { position: absolute; left: 50%; top: 50%; width: 100%; aspect-ratio: 1; margin: -50%; border-radius: 50%; border: 8px solid #fff; opacity: 0; pointer-events: none; animation: evoRing .7s ease-out; }
.evo-ring.r2 { border-color: var(--gold); animation-delay: .12s; }
@keyframes evoRing { from { transform: scale(.3); opacity: 1; } to { transform: scale(2.1); opacity: 0; } }
.flash { position: absolute !important; inset: 0; z-index: 50 !important; background: #fff; animation: flash 1s ease-out forwards; pointer-events: none; }
@keyframes flash { 0%, 22% { opacity: 1; } 100% { opacity: 0; } }
.evo h2 { margin: 14px 0 2px; font-size: 23px; font-weight: 1000; color: #fff; text-shadow: 0 3px 0 #2a2440; }
.evo h2.slam { padding: 7px 22px 8px; border-radius: 12px; transform: skewX(-7deg); background: var(--stripes), linear-gradient(100deg, var(--red), var(--orange)); box-shadow: 0 5px 0 var(--red-dark), 0 8px 16px #0007; animation: slam .34s cubic-bezier(.3, 1.5, .5, 1); }
@keyframes slam { from { transform: skewX(-7deg) scale(1.9); opacity: 0; } }
.evohint { color: var(--dim); font-size: 13px; }
.evo .panel { width: 100%; max-width: 380px; margin-top: 14px; border-radius: 16px; overflow: hidden; background: var(--panel-solid); box-shadow: 0 0 0 3px var(--gold), 0 8px 22px #000a; text-align: left; animation: cardPop .36s cubic-bezier(.3, 1.5, .5, 1); }
@keyframes cardPop { from { transform: translateY(26px) scale(.8); opacity: 0; } }
.panel-head { display: flex; align-items: center; gap: 8px; padding: 7px 12px; color: #fff; background: var(--stripes), linear-gradient(100deg, var(--tyd), var(--ty)); }
.panel-head small { display: block; font-size: 11px; font-weight: 900; line-height: 1.2; }
.panel-head b { display: block; font-size: 19px; font-weight: 1000; line-height: 1.15; text-shadow: 0 2px 0 #0004; }
.panel-body { padding: 8px 12px 10px; }
.evo .panel p { margin: 3px 0; font-size: 13.5px; line-height: 1.42; }
.evo .btn { margin-top: 14px; width: 100%; max-width: 380px; animation: cardPop .36s .08s cubic-bezier(.3, 1.5, .5, 1) both; }

/* 新能力第一次发动 */
.payoff { position: absolute !important; left: -12px; right: -12px; top: calc(var(--safe-t) + 122px); z-index: 27 !important; display: flex; align-items: center; gap: 12px; padding: 12px 24px 13px; text-align: left; background: var(--stripes), linear-gradient(100deg, var(--tyd), var(--ty) 62%, var(--ty2)); box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--gold), 0 10px 24px #000c; transform: rotate(-2deg); pointer-events: none; animation: payoff 1.3s cubic-bezier(.2, 1.1, .4, 1) forwards; }
.payoff-txt { min-width: 0; flex: 1; }
.payoff b { display: block; font-size: 24px; font-weight: 1000; line-height: 1.15; color: #fff; text-shadow: 0 3px 0 #0005; }
.payoff span { display: block; font-size: 12.5px; color: var(--gold); font-weight: 1000; text-shadow: 0 1px 0 #0007; }
.payoff em { display: block; margin-top: 2px; font-style: normal; font-size: 12px; line-height: 1.3; color: #fff; font-weight: 800; }
@keyframes payoff { 0% { transform: rotate(-2deg) translateX(-110%) skewX(-16deg); } 16% { transform: rotate(-2deg) translateX(3%) skewX(-4deg); } 24% { transform: rotate(-2deg) translateX(0); } 88% { transform: rotate(-2deg) translateX(0); opacity: 1; } 100% { transform: rotate(-2deg) translateX(14%); opacity: 0; } }

/* 震屏只晃场景，操作坞不动，手指能一直点准 */
.battle.shake .bg, .battle.shake .foe-plat { animation: shake .26s; }
.battle.shake .foe-card, .battle.shake .team { animation: shakeUi .26s; }
.battle.shake.big .bg, .battle.shake.big .foe-plat { animation: shakeBig .42s; }
@keyframes shake { 25% { transform: translate(-4px, 2px); } 60% { transform: translate(3px, -2px); } }
@keyframes shakeUi { 25% { transform: translate(-2px, 1px); } 60% { transform: translate(2px, -1px); } }
@keyframes shakeBig { 15% { transform: translate(-7px, 4px); } 35% { transform: translate(6px, -4px); } 55% { transform: translate(-4px, 2px); } 75% { transform: translate(3px, -1px); } }

.winpanel { padding: 10px 12px; border-radius: 14px; background: var(--row); }
.winpanel.stats { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 6px; padding: 0; background: none; }
.winpanel.stats .winrow { flex-direction: column-reverse; align-items: center; justify-content: flex-end; gap: 0; padding: 8px 4px; border-radius: 14px; background: var(--panel-solid); box-shadow: 0 3px 0 #0a0d18; font-size: 12px; color: var(--dim); }
.winpanel.stats .winrow b { font-size: 25px; line-height: 1.1; color: #fff; font-variant-numeric: tabular-nums; }
.winpanel.stats .winrow:first-child b { color: var(--gold); }
.recap.lost .phead { background: var(--stripes), linear-gradient(100deg, #4a5378, #6a4cd8); box-shadow: 0 5px 0 #2a2a7a, 0 8px 16px #0007; }
.confetti { position: absolute !important; top: 0; z-index: 0 !important; width: 9px; height: 13px; pointer-events: none; }
.winrow { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; font-size: 14px; }
.winrow.up b { color: #8ff5a3; }
.goldsplit { margin: -2px 0 3px; font-size: 12px; font-weight: 800; color: var(--dim); font-variant-numeric: tabular-nums; }

/* 标题页：白字 + 金字 + 靛蓝粗描边，斜纹横幅 */
.title { align-items: center; text-align: center; }
.logo { margin-top: 7vh; font-size: 66px; line-height: 1.05; font-weight: 1000; letter-spacing: 2px; -webkit-text-stroke: 12px #2a2a7a; paint-order: stroke fill; filter: drop-shadow(0 6px 0 #1a1446); }
.logo .w { color: #fff; }
.logo .y { color: var(--gold); }
.ribbon { margin-top: 12px; padding: 8px 26px; font-size: 19px; font-weight: 1000; color: #fff; text-shadow: 0 2px 0 #0004; background: var(--stripes), linear-gradient(100deg, var(--red), var(--orange)); transform: skewX(-8deg) rotate(-1.5deg); box-shadow: 0 5px 12px #0007; border-radius: 6px; }
.tagline { margin: 10px 20px 0; font-size: 13px; font-weight: 900; color: #fff; text-shadow: 0 1px 3px #000, 0 0 8px #000; }
.parade { display: flex; justify-content: center; align-items: flex-end; gap: 2px; margin: 2vh 0 1vh; flex: 1; min-height: 80px; }
.menu { width: 100%; max-width: 360px; padding: 0 16px; display: grid; gap: 12px; }
.linkrow { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.linkrow .btn { font-size: 13px; min-height: 44px; padding: 4px; }
.legal { padding: 12px 18px 8px; font-size: 11px; color: #fff; line-height: 1.45; font-weight: 700; text-shadow: 0 1px 2px #000; }

/* 图鉴：没解锁是紫灰格 + 灰色剪影 + ??? + 金色小锁；解锁是头像填满 + 属性色 */
.dex { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.dexcell { position: relative; padding: 5px 3px 5px; border-radius: 14px; background: #3d3f63; box-shadow: inset 0 0 0 2px #ffffff14, 0 3px 0 #0a0d18; text-align: center; font-size: 12px; font-weight: 900; display: flex; flex-direction: column; align-items: center; min-height: 106px; justify-content: flex-end; color: var(--dim); }
.dexcell.known { background: radial-gradient(circle at 50% 36%, var(--ty2), var(--ty) 62%, var(--tyd)); color: #fff; box-shadow: inset 0 0 0 2.5px var(--gold), 0 3px 0 #0a0d18; }
.dexface { width: 62px; height: 62px; border-radius: 12px; box-shadow: 0 0 0 2px #ffffffcc; }
.lock { display: inline-block; flex: none; width: 15px; height: 15px; background: var(--gold); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 10V7a5 5 0 0 1 10 0v3h1a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2zm3 0h4V7a2 2 0 0 0-4 0z'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 10V7a5 5 0 0 1 10 0v3h1a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2zm3 0h4V7a2 2 0 0 0-4 0z'/%3E%3C/svg%3E") center / contain no-repeat; }
.dexcell .lock { position: absolute; top: 5px; right: 5px; }
.dexname { margin-top: 3px; text-shadow: 0 1px 0 #0005; }
.dexcell .how { font-size: 11px; font-weight: 800; line-height: 1.2; min-height: 14px; opacity: .9; }
.hallcard { padding: 10px 12px; margin-bottom: 8px; border-radius: 16px; background: var(--panel-solid); box-shadow: inset 0 0 0 1.5px #3b4465, 0 4px 0 #0a0d18; }
.hallcard .winrow > b { color: var(--gold); font-size: 15px; }
.hallteam { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.hallmon { flex: 1 1 42%; min-width: 0; display: flex; gap: 6px; align-items: center; font-size: 12px; line-height: 1.3; }
.hallmon.wide { flex: none; width: 100%; gap: 10px; padding: 8px 10px; margin-bottom: 6px; border-radius: 14px; background: var(--panel-solid); box-shadow: 0 3px 0 #0a0d18; font-size: 14px; }
.hallmon b { font-size: 13px; }
.credits { width: 100%; border-collapse: collapse; font-size: 12px; line-height: 1.5; }
.credits td { padding: 3px 4px; vertical-align: top; border-bottom: 1px solid var(--line); }
.prose { background: var(--panel-solid); margin: 0 10px 8px; border-radius: 16px; padding: 12px; }
.prose p { font-size: 13px; line-height: 1.6; margin: 0 0 8px; font-weight: 600; }
.prose a { color: #8fcbff; }
.recap .note, .route .note { text-shadow: 0 1px 2px #000; }

@media (max-height: 700px) {
  .slot { height: 84px; }
  .team { padding: 5px 7px 5px; }
  .card { height: 78px; padding: 4px 2px 6px; }
  .card .rk { font-size: 26px; -webkit-text-stroke-width: 5px; }
  .card .gl { width: 29px; height: 29px; }
  .card .gl svg, .card .gl img { width: 22px !important; height: 22px !important; }
  .score { height: 48px; }
  .num { height: 36px; font-size: 20px; min-width: 48px; }
  .num.long { font-size: 16px; }
  .btn { min-height: 44px; }
  .actions { padding-bottom: 8px; }
  .actions .play, .actions .swap { min-height: 48px; }
  .hand { padding-top: 13px; padding-bottom: 7px; }
  .res { height: 25px; }
  .logo { font-size: 54px; margin-top: 4vh; }
  .team.strip .slot { height: 84px; }
  .shop .team.strip .slot { height: 70px; }
  .shop .team.strip .slot .rl { display: none; }
  .shop .phead-sub { display: none; }
  .shop .team.strip { padding-top: 12px; }
  .road { min-height: 170px; }
}
@media (prefers-reduced-motion: reduce) {
  .unlockcard.fresh, .unlockcard.fresh::after, .unlockart .rays, .stab .newtag, .battle.shake .bg, .battle.shake .foe-card, .battle.shake .foe-plat, .battle.shake .team, .slot.hop .spr, .foe-spr.hurt, .foe-spr .spr, .payoff, .screen.leaving, .screen.enter *, .gbar i.gain, .sleep-hint .arrow { animation: none; }
}

/* Safari 兼容补充：旧版不支持 color-mix / HTML paint-order 时保留牌框和文字。 */
#app { touch-action: manipulation; }
@supports not (box-shadow: 0 4px 0 color-mix(in srgb, red 55%, black)) {
  .card { box-shadow: 0 4px 0 #30283d, inset 0 0 0 2px #ffffff55; }
  .card.sel { box-shadow: 0 6px 0 #30283d, 0 0 0 3px var(--gold), 0 0 16px #ffd23a; }
}
@supports not (paint-order: stroke fill) {
  .logo, .card .rk, .dmg, .float {
    -webkit-text-stroke: 0;
    text-shadow: -2px -2px #2a2440, 2px -2px #2a2440, -2px 2px #2a2440, 2px 2px #2a2440;
  }
}

/* 给爬虫和读屏软件的游戏介绍。平时只留在页面结构里，点标题页的“关于这个游戏”才显示。 */
#about { position: fixed; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: normal; }
#about:target { z-index: 98; inset: 0; width: auto; height: auto; clip: auto; max-width: 480px; margin: 0 auto; padding: 16px 18px 40px; overflow-y: auto; -webkit-overflow-scrolling: touch; background: #1a1630; color: #fff; font-size: 15px; line-height: 1.6; }
#about h1 { font-size: 24px; line-height: 1.3; margin: 12px 0; font-weight: 900; }
#about h2 { font-size: 18px; color: var(--gold, #ffd23a); margin: 22px 0 8px; font-weight: 900; }
#about h3 { font-size: 15px; margin: 14px 0 2px; font-weight: 900; }
#about p { margin: 8px 0; }
#about ul { margin: 8px 0; padding-left: 20px; }
#about img { display: block; width: 100%; height: auto; border-radius: 14px; margin: 12px 0; }
#about a { color: #ffd23a; font-weight: 900; }
#about .about-close { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 999px; background: rgba(34,40,58,.95); color: #fff; text-decoration: none; }
.legal a { color: #ffd23a; display: inline-block; padding: 4px 0; position: relative; }
.legal a::after { content: ""; position: absolute; inset: -10px -8px; }
