:root {
  --paper: #efe6d2; --paper2: #e3d7bd; --ink: #2a2620; --ink2: #5d5446; --cinnabar: #b33a2b; --jade: #3f7d6b; --gold: #c8972f;
  --card: #f7f0e0; --line: #2a262033; --shadow: 0 6px 18px #2a262033;
  --serif: "Songti SC", "STSong", "Noto Serif SC", "Source Han Serif SC", serif;
  --sans: -apple-system, "PingFang SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--paper); color: var(--ink); font-family: var(--sans); overflow: hidden; }
body { background: radial-gradient(ellipse at 50% 30%, #f5eddb 0%, #e8dcc2 60%, #d6c7a6 100%); }
button { font: inherit; color: inherit; cursor: pointer; }
.ic { vertical-align: -3px; flex: none; }
#app { height: 100dvh; display: flex; flex-direction: column; }

/* 主菜单 */
.title { flex: 1; overflow: hidden; display: flex; flex-direction: column; align-items: center; padding: 22px 16px 26px; text-align: center; background: #1b1813; }
.title::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; background: linear-gradient(#1b1813d9 0%, #1b181399 18%, #1b181300 38%, #1b181300 74%, #1b1813b3 100%); }
.title h1 { font-family: var(--serif); font-size: clamp(44px, 9vw, 92px); letter-spacing: .18em; margin: 1vh 0 0 .18em; font-weight: 900; color: #ffe9b0; text-shadow: 0 3px 0 #5a1d12, 0 0 18px #000, 0 2px 6px #000; }
.title .sub { color: #f6efdf; margin: 8px 0 0; font-size: 15px; text-shadow: 0 1px 4px #000; }
.title-gap { flex: 1; }
.btn { border: 1.5px solid var(--ink); background: var(--card); padding: 10px 22px; border-radius: 6px; font-size: 15px; font-weight: 600; transition: transform .1s, background .15s; }
.btn:hover { background: #fff8e8; } .btn:active { transform: translateY(1px); }
.btn.primary { background: var(--cinnabar); color: #fff6e6; border-color: #7d2519; }
.btn.primary:hover { background: #c64433; }
.btn:disabled { opacity: .45; cursor: default; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }

/* 选人 */
.setup { flex: 1; overflow-y: auto; padding: 16px; max-width: 980px; width: 100%; margin: 0 auto; }
.setup h2 { font-family: var(--serif); margin: 6px 0 10px; font-size: 24px; }
.seats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 14px; }
.maps { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 8px; margin-bottom: 12px; }
.mapcard { text-align: left; border: 1.5px solid var(--line); background: var(--card); border-radius: 8px; padding: 8px 10px; }
.mapcard.sel { border-color: var(--cinnabar); box-shadow: 0 0 0 1.5px var(--cinnabar); }
.mapcard { display: grid; grid-template-columns: 128px minmax(0, 1fr); column-gap: 10px; align-content: center; align-items: start; }
.mapcard img { grid-row: span 2; display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 5px; background: #2a2620; }
.mapcard b { font: 800 16px var(--serif); display: block; } .mapcard span { font-size: 12px; color: var(--ink2); line-height: 1.4; }
.qmark { height: 60px; display: grid; place-items: center; font: 900 34px var(--serif); color: var(--ink2); opacity: .5; }
.seat { border: 1.5px solid var(--line); border-radius: 8px; background: var(--card); padding: 8px 6px; text-align: center; min-width: 0; }
.seat.on { border-color: var(--cinnabar); box-shadow: 0 0 0 1px var(--cinnabar); }
.seat.off { opacity: .55; }
.seat img { width: 58px; height: 58px; object-fit: contain; display: block; margin: 0 auto 2px; }
.seat small { display: block; color: var(--ink2); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seat .kind { margin-top: 5px; border: 1px solid var(--line); background: transparent; border-radius: 4px; font-size: 12px; padding: 2px 6px; }
.race-block { margin-bottom: 12px; }
.race-block h3 { margin: 0 0 6px; font-family: var(--serif); font-size: 17px; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.race-block h3 small { font-family: var(--sans); font-weight: 400; color: var(--ink2); font-size: 12.5px; }
.hero-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.hero-card { display: flex; flex-direction: column; gap: 2px; text-align: center; border: 1.5px solid var(--line); border-radius: 8px; background: var(--card); padding: 6px; align-items: center; min-width: 0; }
.hero-card.taken { opacity: .4; }
.hero-card.sel { border-color: var(--cinnabar); }
.hero-card img { width: 72px; height: 72px; object-fit: contain; flex: none; }
.hero-card b { font-family: var(--serif); font-size: 16px; }
.pick-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.pick-head h2 { margin: 0; }
.pick-head .btn { padding: 7px 16px; font-size: 15px; }
.pick { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 380px); gap: 14px; align-items: start; }
.hero-info { position: sticky; top: 0; border: 1.5px solid var(--line); border-radius: 10px; background: var(--card); padding: 14px; }
.hero-info img { display: block; width: 100%; height: 230px; object-fit: contain; }
.hero-info h3 { font: 900 24px var(--serif); margin: 6px 0 0; display: inline-block; }
.hero-info small { color: var(--ink2); margin-left: 8px; }
.hero-info p { margin: 8px 0 0; font-size: 14.5px; line-height: 1.65; }
.setup-foot { position: sticky; bottom: 0; padding: 12px 0; display: flex; justify-content: center; gap: 10px; background: linear-gradient(transparent, #e8dcc2 40%); }

/* 对局 */
.top { display: flex; gap: 6px; padding: 8px 8px 0; align-items: stretch; }
.pcard { cursor: pointer; flex: 1; min-width: 0; display: flex; gap: 6px; background: var(--card); border: 1.5px solid var(--line); border-radius: 8px; padding: 4px 6px; position: relative; transition: transform .15s, box-shadow .15s; }
.pcard.cur { border-color: var(--pc); box-shadow: 0 0 0 1.5px var(--pc), var(--shadow); transform: translateY(1px); }
.pcard.dead { opacity: .4; filter: grayscale(1); }
.pcard img { width: 44px; height: 44px; object-fit: contain; flex: none; }
.pcard .body { min-width: 0; flex: 1; }
.pcard .nm { font-family: var(--serif); font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pcard .nm small { font-family: var(--sans); font-weight: 400; color: var(--ink2); font-size: 11px; }
.hpbar { height: 7px; background: #2a26201f; border-radius: 4px; overflow: hidden; margin: 2px 0; }
.hpbar i { display: block; height: 100%; background: var(--cinnabar); transition: width .25s; }
.pcard .row { display: flex; gap: 6px; align-items: center; font-size: 12px; white-space: nowrap; overflow: hidden; }
.pcard .row .g { color: #93690f; font-weight: 700; }
.pcard .stt { display: flex; gap: 1px; color: #7a2d6d; }
.tools { display: flex; flex-direction: column; gap: 4px; }
.iconbtn { width: 32px; height: 26px; display: grid; place-items: center; border: 1px solid var(--line); background: var(--card); border-radius: 5px; padding: 0; }
.iconbtn.on { background: var(--ink); color: var(--paper); }

.boardwrap { flex: 1; min-height: 0; position: relative; overflow: hidden; }
.world { position: absolute; left: 0; top: 0; transform-origin: 0 0; will-change: transform; background: #55624d; }
.world canvas { position: absolute; left: 0; top: 0; display: block; }
svg.tiles { position: absolute; left: 0; top: 0; overflow: visible; }
.tile-top { fill: transparent; stroke: transparent; cursor: pointer; }
.tile-top:hover { fill: #ffffff33; }
.boardwrap { touch-action: none; background: #2a2620; cursor: grab; }
.sprite { position: absolute; pointer-events: none; transform: translate(-50%, -100%); }
.sprite img { display: block; width: 100%; }
.sprite.bld img { height: 100%; object-fit: contain; object-position: center bottom; filter: drop-shadow(0 2px 2px #0006); }
.sprite.pop { animation: pop .4s ease-out; }
@keyframes pop { 0% { transform: translate(-50%, -100%) scale(.3); } 70% { transform: translate(-50%, -100%) scale(1.15); } 100% { transform: translate(-50%, -100%) scale(1); } }
.lv { position: absolute; font: 700 11px var(--sans); color: #fffaf0; border-radius: 3px; padding: 0 4px; transform: translate(-50%, -50%); pointer-events: none; box-shadow: 0 0 0 1px #2a2620; }
.bhp { position: absolute; width: 56px; height: 6px; background: #2a2620cc; transform: translate(-50%, 0); border-radius: 2px; overflow: hidden; pointer-events: none; }
.bhp i { display: block; height: 100%; background: #e0553f; }
.piece { --step: 230ms; position: absolute; width: 96px; height: 87px; transform: translate(-50%, -96%); transition: left var(--step) linear, top var(--step) linear; pointer-events: none; }
.piece .px { width: 96px; height: 87px; background-repeat: no-repeat; background-size: 576px 87px; image-rendering: pixelated; animation: px-idle .9s steps(2) infinite; filter: drop-shadow(0 2px 0 #0007); }
.piece.flip .px { transform: scaleX(-1); }
.piece.walk .px { animation: px-walk .46s steps(4) infinite; }
/* 精卫展翅：换成飞行精灵，离开地面，地上留影子 */
.piece.soar .px, .piece.soar.walk .px { width: 204px; height: 156px; margin: -96px 0 0 -54px; background-image: url(assets/px_jingwei_fly.png) !important; background-size: 816px 156px; animation: px-flap .52s steps(4) infinite, soar-bob 1.6s ease-in-out infinite alternate; }
.piece.soar::before { content: ""; position: absolute; left: 50%; bottom: -2px; width: 58px; height: 14px; margin-left: -29px; border-radius: 50%; background: #0006; animation: soar-shadow 1.6s ease-in-out infinite alternate; }
@keyframes px-flap { from { background-position-x: 0; } to { background-position-x: -816px; } }
@keyframes soar-bob { from { translate: 0 0; } to { translate: 0 -10px; } }
@keyframes soar-shadow { to { scale: .8; opacity: .7; } }
@keyframes px-idle { from { background-position-x: 0; } to { background-position-x: -192px; } }
@keyframes px-walk { from { background-position-x: -192px; } to { background-position-x: -576px; } }
.piece.active::after { content: ""; position: absolute; left: 50%; bottom: -3px; width: 54px; height: 20px; margin-left: -27px; border: 3px solid var(--pc); border-radius: 50%; z-index: -1; box-shadow: 0 0 0 1px #fff8; }
.floaty { position: absolute; font: 800 22px var(--sans); transform: translate(-50%, -100%); pointer-events: none; animation: floaty 1s ease-out forwards; text-shadow: 0 1px 0 #000, 0 0 5px #000; white-space: nowrap; }
@keyframes floaty { to { margin-top: -46px; opacity: 0; } }
@keyframes pulse { to { background: #ffd76acc; transform: translate(-50%, -50%) scale(1.12); } }

.hud { position: absolute; left: 8px; top: 8px; width: 230px; z-index: 700; pointer-events: none; background: #f7f0e0e0; border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; }
.hud .round { font: 700 13px var(--serif); color: var(--ink2); }
.dice { display: flex; gap: 8px; margin: 3px 0; min-height: 0; }
.die { width: 40px; height: 40px; filter: drop-shadow(0 2px 2px #0005); }
.die.roll { animation: spin .42s ease-out; }
@keyframes spin { 0% { transform: rotate(-200deg) scale(.5) translateY(-30px); } 100% { transform: none; } }
.dice-note { font-size: 12.5px; font-weight: 700; color: var(--cinnabar); }
.log { font-size: 12px; color: var(--ink2); line-height: 1.4; }
.log div:last-child { color: var(--ink); font-weight: 600; }
.minimap { position: absolute; right: 8px; top: 8px; width: 150px; z-index: 700; border: 1.5px solid var(--ink); border-radius: 6px; cursor: pointer; background: #000; }
.mapbtn { position: absolute; right: 8px; top: 92px; width: 44px; z-index: 701; font-size: 12px; }
.loading { position: absolute; inset: 0; display: grid; place-items: center; z-index: 950; background: #2a2620; color: #f6efdf; font: 700 20px var(--serif); }

.dock { position: absolute; left: 0; right: 0; bottom: 0; z-index: 900; display: flex; justify-content: center; padding: 0 8px 10px; pointer-events: none; }
.panel { pointer-events: auto; width: min(640px, 100%); background: var(--card); border: 1.5px solid var(--ink); border-radius: 10px; box-shadow: 0 10px 30px #2a262055; padding: 12px 14px; animation: rise .16s ease-out; max-height: 62dvh; overflow-y: auto; }
@keyframes rise { from { transform: translateY(14px); opacity: 0; } }
.panel h4 { margin: 0 0 3px; font: 800 18px var(--serif); }
.panel p { margin: 0 0 9px; font-size: 13.5px; color: var(--ink2); line-height: 1.5; }
.opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 7px; margin-bottom: 8px; }
.opt { display: flex; gap: 8px; align-items: center; text-align: left; border: 1.5px solid var(--line); background: #fffaf0; border-radius: 8px; padding: 6px 8px; min-width: 0; }
.opt:hover:not(:disabled) { border-color: var(--cinnabar); }
.opt:disabled { opacity: .45; cursor: default; }
.opt img { width: 54px; height: 54px; object-fit: contain; flex: none; }
.opt b { font: 700 15px var(--serif); }
.opt span { display: block; font-size: 12px; line-height: 1.35; color: var(--ink2); }

.toast { position: absolute; left: 50%; top: 8px; transform: translateX(-50%); z-index: 800; background: var(--ink); color: var(--paper); padding: 6px 14px; border-radius: 16px; font-size: 14px; animation: rise .15s; white-space: nowrap; max-width: 94%; overflow: hidden; text-overflow: ellipsis; }
.toast.skill { background: var(--cinnabar); }

.info { position: absolute; z-index: 850; left: 50%; top: 10px; transform: translateX(-50%); width: min(380px, 94%); background: var(--card); border: 1.5px solid var(--ink); border-radius: 10px; padding: 9px 11px; box-shadow: var(--shadow); display: flex; gap: 9px; }
.info img { width: 72px; height: 72px; object-fit: contain; flex: none; }
.info b { font: 800 16px var(--serif); }
.info p { margin: 2px 0 0; font-size: 12.5px; line-height: 1.45; color: var(--ink2); }

/* 全屏层 */
.layer { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 16px; }
.layer.dim { background: #1b1813d9; }
.card-show { width: min(300px, 86vw); background: var(--card); border: 2px solid var(--ink); border-radius: 14px; padding: 12px; text-align: center; animation: flip .32s ease-out; box-shadow: 0 16px 40px #0008; }
.card-show.good { border-color: var(--jade); } .card-show.bad { border-color: var(--cinnabar); }
@keyframes flip { from { transform: perspective(700px) rotateY(90deg); } }
.card-show .tag { font: 800 15px var(--serif); }
.card-show.good .tag { color: var(--jade); } .card-show.bad .tag { color: var(--cinnabar); }
.card-show img { width: 100%; aspect-ratio: 1; object-fit: contain; }
.card-show h3 { margin: 0; font: 900 26px var(--serif); }
.card-show p { margin: 5px 0 0; font-size: 14.5px; }

.battle { position: fixed; inset: 0; z-index: 1000; background: radial-gradient(ellipse at 50% 60%, #4a4032 0%, #1b1813 75%); color: #f4ecd9; display: flex; flex-direction: column; overflow: hidden; }
.battle.shake { animation: shake .22s; }
@keyframes shake { 25% { transform: translate(-7px, 3px); } 50% { transform: translate(6px, -3px); } 75% { transform: translate(-3px, 2px); } }
.bt-head { text-align: center; padding: 12px 8px 0; font: 700 15px var(--serif); opacity: .8; }
.bt-field { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr 1fr; align-items: center; justify-items: center; padding: 8px; }
.fighter { width: 100%; max-width: 380px; display: flex; flex-direction: column; align-items: center; position: relative; min-width: 0; }
.fighter .pic { width: min(36vw, 42vh, 320px); aspect-ratio: 1; position: relative; }
.fighter img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 8px 10px #000a); }
.fighter.lunge-r .pic { animation: lr .2s; } .fighter.lunge-l .pic { animation: ll .2s; }
@keyframes lr { 45% { transform: translateX(13vw) scale(1.05); } } @keyframes ll { 45% { transform: translateX(-13vw) scale(1.05); } }
.fighter.hurt img { filter: brightness(2.4) drop-shadow(0 8px 10px #000a); }
.fighter.down .pic { transition: all .4s; transform: rotate(12deg) translateY(16px); opacity: .25; }
.fighter h3 { margin: 6px 0 4px; font: 800 clamp(17px, 3vw, 24px) var(--serif); }
.bigbar { width: 86%; height: 13px; background: #ffffff22; border-radius: 7px; overflow: hidden; }
.bigbar i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #d9573f, #efa04a); transition: width .18s; }
.fighter small { margin-top: 3px; font-variant-numeric: tabular-nums; opacity: .8; }
.dmg { position: absolute; left: 50%; top: 34%; font: 900 30px var(--sans); color: #fff; text-shadow: 0 2px 4px #000; animation: dmg .7s ease-out forwards; pointer-events: none; white-space: nowrap; }
.dmg.crit { font-size: 46px; color: #ffcf4d; } .dmg.heal { color: #8ee09a; } .dmg.miss { color: #c9c2b2; font-size: 22px; }
@keyframes dmg { 0% { transform: translate(-50%, 8px) scale(.6); } 25% { transform: translate(-50%, -12px) scale(1.15); } 100% { transform: translate(-50%, -66px); opacity: 0; } }
.skillname { position: absolute; left: 50%; top: 16%; transform: translateX(-50%); font: 900 clamp(28px, 6vw, 50px) var(--serif); color: #ffdf8a; text-shadow: 0 0 16px #d9573f, 0 2px 3px #000; animation: sk .85s ease-out forwards; white-space: nowrap; z-index: 3; }
@keyframes sk { 0% { transform: translateX(-50%) scale(1.8); opacity: 0; } 20% { transform: translateX(-50%) scale(1); opacity: 1; } 80% { opacity: 1; } 100% { opacity: 0; } }
.bt-result { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); font: 900 clamp(38px, 9vw, 72px) var(--serif); letter-spacing: .1em; text-shadow: 0 3px 10px #000; animation: pop2 .3s ease-out; z-index: 4; white-space: nowrap; }
@keyframes pop2 { from { transform: translate(-50%, -50%) scale(1.8); opacity: 0; } }
.bt-foot { text-align: center; padding: 8px 8px 16px; }
.bt-foot .btn { background: transparent; color: inherit; border-color: #fff5; }
canvas.fx { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }

.result { background: var(--card); border: 2px solid var(--ink); border-radius: 14px; padding: 20px; width: min(420px, 100%); text-align: center; animation: rise .2s; max-height: 92dvh; overflow-y: auto; }
.result h2 { font: 900 34px var(--serif); margin: 0 0 4px; }
.result img.big { width: 180px; height: 180px; object-fit: contain; }
.result.won { width: min(760px, 100%); }
.result img.ending { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 8px; margin: 8px 0; }
.ending-text { font: 700 19px/1.5 var(--serif); margin: 8px 0 2px; }
.ending-note { color: var(--ink2); font-size: 13px; margin: 2px 0 6px; }
.rank { display: flex; justify-content: space-between; padding: 4px 6px; border-bottom: 1px solid var(--line); font-size: 14px; }
.help { background: var(--card); border: 2px solid var(--ink); border-radius: 12px; padding: 16px 18px; width: min(560px, 100%); max-height: 88dvh; overflow-y: auto; font-size: 14.5px; line-height: 1.65; }
.help h2 { font: 900 24px var(--serif); margin: 0 0 6px; }
.help h3 { font: 800 16px var(--serif); margin: 12px 0 2px; }
.help ul { margin: 2px 0; padding-left: 18px; }

.cover { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 45%; z-index: -2; }
.title { position: relative; isolation: isolate; }
.title .btn { box-shadow: 0 4px 14px #000a; }
.opc-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 10px; margin-top: 12px; }
.opc-tag { color: #ffe9b0; font: 700 17px var(--serif); letter-spacing: .08em; text-shadow: 0 1px 4px #000; }
.btn.ghost { background: #1b1813b3; color: #fff6e6; border-color: #ffe9b080; padding: 9px 20px; font-size: 16px; text-decoration: none; }
.btn.ghost:hover { background: #1b1813e6; }
.poll h3 { margin: 0 0 6px; font: 800 19px/1.4 var(--serif); }
.poll p { margin: 0 0 10px; font-size: 13px; color: var(--ink2); }
.poll-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.poll-opts .btn { padding: 10px 6px; }
.poll-msg { min-height: 20px; text-align: center; color: var(--jade) !important; font-weight: 700; }
@media (max-aspect-ratio: 1/1) { /* 竖屏：封面放中段，保证黄帝和蚩尤都在画面里 */
  .cover { inset: auto 0; top: 21%; height: 58%; -webkit-mask-image: linear-gradient(transparent, #000 9%, #000 91%, transparent); mask-image: linear-gradient(transparent, #000 9%, #000 91%, transparent); }
  .title::before { display: none; }
  .cover { object-position: 57% 45%; }
  .title .sub { font-size: 13px; letter-spacing: -.01em; white-space: nowrap; }
}
.bigbtn { min-width: 132px; font-size: 18px; }
.herobtn { position: relative; }
.herobtn.hot { box-shadow: 0 0 0 2px #ffd76a; }
.badge { position: absolute; right: -7px; top: -7px; min-width: 20px; height: 20px; border-radius: 10px; background: var(--cinnabar); color: #fff; font: 700 12px/20px var(--sans); text-align: center; }
.badge.g { background: var(--jade); }
.bf { color: var(--jade); display: inline-flex; align-items: center; }
.hp { width: min(620px, 100%); max-height: 92dvh; overflow-y: auto; background: var(--card); border: 2px solid var(--ink); border-radius: 12px; padding: 12px 14px; animation: rise .16s; }
.hp-top { display: flex; gap: 10px; }
.hp-top > img { width: 104px; height: 104px; object-fit: contain; flex: none; }
.hp-top h3 { margin: 0; font: 800 21px var(--serif); } .hp-top h3 small { font: 400 12px var(--sans); color: var(--ink2); }
.hp-top p { margin: 2px 0 0; font-size: 12.5px; line-height: 1.4; color: var(--ink2); } .hp-top .race { font-weight: 700; }
.xpbar { height: 6px; background: #2a26201f; border-radius: 3px; overflow: hidden; margin: 3px 0 1px; } .xpbar i { display: block; height: 100%; background: var(--gold); }
.hp h4 { margin: 10px 0 5px; font: 800 15px var(--serif); } .hp h4 small { font: 400 12px var(--sans); color: var(--ink2); }
.sks { display: grid; gap: 6px; }
.sk { display: flex; gap: 8px; align-items: center; background: #fffaf0; border: 1px solid var(--line); border-radius: 8px; padding: 5px 7px; }
.sk.dim > img { filter: grayscale(1); opacity: .55; }
.sk > img { width: 46px; height: 46px; object-fit: contain; flex: none; }
.sk-b { flex: 1; min-width: 0; } .sk-b b { font: 700 14.5px var(--serif); } .sk-b em { font: 400 11px var(--sans); color: var(--ink2); }
.sk-b p { margin: 1px 0 0; font-size: 12px; line-height: 1.35; color: var(--ink2); }
.dots { margin-left: 5px; display: inline-flex; gap: 2px; } .dots i { width: 8px; height: 8px; border-radius: 50%; border: 1px solid var(--ink2); } .dots i.on-true { background: var(--gold); border-color: var(--ink); }
.sk-a { display: flex; flex-direction: column; gap: 3px; align-items: center; flex: none; min-width: 52px; } .sk-a small { font-size: 11px; color: var(--ink2); white-space: nowrap; }
.btn.small { padding: 4px 10px; font-size: 13px; }
.slots { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.slot { border: 1.5px solid var(--line); background: #fffaf0; border-radius: 8px; padding: 4px; text-align: center; min-height: 92px; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; min-width: 0; }
.slot.empty { justify-content: center; color: var(--ink2); opacity: .5; font-size: 13px; }
.slot img { width: 42px; height: 42px; object-fit: contain; } .slot b { font: 700 12.5px var(--serif); } .slot small { font-size: 10.5px; line-height: 1.25; color: var(--ink2); }
.slot.t2 { border-color: #3f7d9b; } .slot.t3 { border-color: #c8972f; box-shadow: 0 0 0 1px #c8972f; }
.note { font-size: 12px; color: var(--ink2); margin: 5px 0 0; }
.hp .btn-row { position: sticky; bottom: -12px; margin: 10px -14px -12px; padding: 8px; background: var(--card); border-top: 1px solid var(--line); }
.castfx { position: absolute; transform: translate(-50%, -100%); z-index: 8000; text-align: center; animation: castup 1.2s ease-out forwards; pointer-events: none; }
.castfx img { width: 76px; height: 76px; object-fit: contain; display: block; margin: 0 auto; filter: drop-shadow(0 0 8px #ffd76a); }
.castfx b { font: 900 22px var(--serif); color: #ffdf8a; text-shadow: 0 2px 3px #000, 0 0 8px #d9573f; white-space: nowrap; }
@keyframes castup { 0% { opacity: 0; margin-top: 16px; } 20% { opacity: 1; margin-top: 0; } 80% { opacity: 1; } 100% { opacity: 0; margin-top: -24px; } }
.sprite.glow img { filter: drop-shadow(0 0 7px #ffd76a); animation: glow 1s ease-in-out infinite alternate; }
@keyframes glow { to { filter: drop-shadow(0 0 14px #ffd76a); } }
@media (max-width: 640px) { .hud { width: 150px; padding: 4px 6px; } .die { width: 28px; height: 28px; } .log div:not(:last-child) { display: none; } .minimap { width: 96px; } .mapbtn { top: 62px; } }
@media (max-width: 720px) {
  .seats { grid-template-columns: repeat(4, 1fr); }
  .pick { grid-template-columns: minmax(0, 1fr); }
  .hero-info { position: static; order: -1; display: flex; gap: 10px; align-items: flex-start; }
  .hero-info img { width: 104px; height: 150px; flex: none; }
  .hero-info p { font-size: 13.5px; }
  .hero-card img { width: 58px; height: 58px; }
  .pcard { flex-direction: column; align-items: center; gap: 0; padding: 3px; text-align: center; }
  .pcard img { width: 34px; height: 34px; }
  .pcard .body { width: 100%; }
  .pcard .nm small { display: none; }
  .pcard .row { justify-content: center; font-size: 11px; }
  .tools { flex-direction: column; }
  .iconbtn { width: 28px; }
}
