/* ==========================================================================
   《底牌议会》 style.css — 安静的奢华：深色墨底 + 哑光金细线 + 大留白
   竖屏优先（360–430px），最大内容宽度 480px 居中
   ========================================================================== */

:root {
  --ink: #0B1220;
  --panel: #121A2B;
  --cream: #EDE8DA;
  --gold: #C9A86A;
  --junshi: #B05C50;
  --minxin: #609680;
  --shanglu: #C09646;
  --t-moulue: #B05C50;
  --t-buju: #609680;
  --t-qingbao: #6E86AD;
  --t-xianjing: #8A6BA0;
  --serif: "Songti SC", "Noto Serif SC", "Source Han Serif SC", "SimSun", serif;
  --sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, sans-serif;
  --dim: rgba(237, 232, 218, 0.62);
  --dim2: rgba(237, 232, 218, 0.40);
  --hair: 2px solid rgba(201, 168, 106, 0.55);
  --hair-soft: 2px solid rgba(201, 168, 106, 0.24);
  --r-btn: 32px;
  --r-panel: 18px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; padding: 0;
  background: var(--ink);
  color: var(--cream);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  touch-action: manipulation;
  overscroll-behavior: none;
}
body { min-height: 100dvh; }

img { display: block; max-width: 100%; }
button { font-family: inherit; color: inherit; cursor: pointer; }
input { font-family: inherit; }

/* 可点元素：虚线框提示（设置里可关） */
[data-act] { cursor: pointer; outline: 1px dashed rgba(201, 168, 106, 0.42); outline-offset: 1px; }
body.no-hints [data-act] { outline: none !important; }

.app { max-width: 480px; margin: 0 auto; position: relative; min-height: 100dvh; }
.screen { display: none; }
.screen.active { display: flex; flex-direction: column; }

/* ---------------- 加载页 ---------------- */
.loader {
  position: fixed; inset: 0; z-index: 90;
  background: radial-gradient(120% 90% at 50% 30%, #16203a 0%, var(--ink) 70%);
  display: flex; align-items: center; justify-content: center;
  transition: opacity .35s ease;
}
.loader.out { opacity: 0; pointer-events: none; }
.loader-inner { text-align: center; width: 76%; max-width: 320px; }
.loader-emblem { width: 96px; height: 96px; margin: 0 auto 14px; border-radius: 50%; box-shadow: 0 0 0 2px rgba(201,168,106,.35); }
.loader-title { font-family: var(--serif); font-size: 26px; letter-spacing: .28em; margin-bottom: 22px; color: var(--gold); }
.loader-bar { height: 3px; background: rgba(237,232,218,.12); border-radius: 3px; overflow: hidden; }
.loader-fill { height: 100%; width: 0; background: var(--gold); transition: width .2s ease; }
.loader-text { margin-top: 10px; font-size: 13px; color: var(--dim2); letter-spacing: .08em; }

/* ---------------- 通用按钮 ---------------- */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 22px; border: 0; border-radius: var(--r-btn);
  font-size: 16px; letter-spacing: .08em; line-height: 1.2;
  background: var(--panel) center/100% 100% no-repeat;
  box-shadow: inset 0 0 0 2px var(--gold);
  color: var(--cream);
  transition: transform .12s ease, opacity .12s ease;
}
.btn:active { transform: scale(.985); }
.btn:disabled { opacity: .38; cursor: default; }
.btn.primary { background-image: url("./assets/ui/btn_primary.png"); color: #0B1220; box-shadow: none; font-weight: 600; }
.btn.secondary { background-image: url("./assets/ui/btn_secondary.png"); box-shadow: inset 0 0 0 2px var(--gold); }
.btn.danger { background-image: url("./assets/ui/btn_danger.png"); box-shadow: inset 0 0 0 2px var(--junshi); }
.btn.wide { width: 100%; }
.btn.tall { min-height: 56px; font-size: 17px; }
.btn.tiny { min-height: 44px; padding: 0 16px; font-size: 14px; border-radius: 26px; }
.btn-row { display: flex; gap: 10px; margin: 12px 0; }
.btn-row .btn { flex: 1; }

.link-btn {
  background: none; border: 0; padding: 8px 6px; min-height: 40px;
  color: var(--gold); font-size: 14px; letter-spacing: .06em; text-decoration: underline;
  text-underline-offset: 4px; text-decoration-thickness: 1px;
}
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 999px; font-size: 13px;
  background: rgba(237,232,218,.06); box-shadow: inset 0 0 0 1px rgba(201,168,106,.22);
  color: var(--dim);
}
.chip img { width: 15px; height: 15px; opacity: .85; }
.chip.mine { color: var(--cream); box-shadow: inset 0 0 0 1px rgba(201,168,106,.5); }
.chip.foe { color: var(--cream); box-shadow: inset 0 0 0 1px rgba(176,92,80,.55); }
.chip-btn {
  display: inline-flex; align-items: center; gap: 5px; min-height: 40px; padding: 0 12px;
  border: 0; border-radius: 999px; font-size: 13px; color: var(--cream);
  background: rgba(237,232,218,.05); box-shadow: inset 0 0 0 1px rgba(201,168,106,.28);
}
.chip-btn img { width: 15px; height: 15px; opacity: .9; }
.chip-btn.free { box-shadow: inset 0 0 0 1px rgba(201,168,106,.75); color: var(--gold); }
.chip-btn.passive { box-shadow: inset 0 0 0 1px rgba(96,150,128,.7); }

.hint { font-size: 12px; color: var(--dim2); letter-spacing: .04em; }

/* ---------------- 序幕 ---------------- */
.prologue-screen { position: relative; min-height: 100dvh; }
.prologue-bg {
  position: absolute; inset: 0 0 auto 0; height: 46dvh;
  background: url("./assets/backgrounds/bg_dorm_game_night.jpg") center/cover no-repeat;
  opacity: .5;
}
.prologue-screen::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(11,18,32,.35) 0%, rgba(11,18,32,.82) 26%, var(--ink) 58%);
}
.prologue-top { position: relative; z-index: 2; padding: calc(var(--safe-t) + 8px) 14px 0; text-align: right; }
.prologue-body {
  position: relative; z-index: 2; margin-top: 20dvh; padding: 0 26px calc(var(--safe-b) + 28px);
  display: flex; flex-direction: column; gap: 20px;
}
.prologue-title { font-family: var(--serif); font-size: 30px; letter-spacing: .3em; color: var(--gold); margin: 0; font-weight: 500; }
.prologue-text { font-size: 16px; line-height: 1.95; color: var(--cream); margin: 0; min-height: 170px; }
.prologue-step { font-size: 13px; color: var(--dim2); letter-spacing: .2em; margin: 0; }

/* ---------------- 主菜单 ---------------- */
.menu-screen { position: relative; min-height: 100dvh; }
.menu-bg {
  position: absolute; inset: 0;
  background: url("./assets/backgrounds/bg_menu.jpg") center/cover no-repeat;
  opacity: .55;
}
.menu-screen::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(11,18,32,.25) 0%, rgba(11,18,32,.72) 46%, var(--ink) 88%);
}
.menu-head { position: relative; z-index: 2; padding: calc(var(--safe-t) + 26px) 22px 0; text-align: center; }
.menu-emblem { width: 84px; height: 84px; margin: 0 auto 12px; border-radius: 50%; box-shadow: 0 0 0 2px rgba(201,168,106,.32); }
.menu-title { width: 100%; max-width: 330px; margin: 0 auto; }
.menu-actions {
  position: relative; z-index: 2; margin-top: 34px; padding: 0 24px calc(var(--safe-b) + 24px);
  display: flex; flex-direction: column; gap: 12px;
}
.menu-sub { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 8px; margin-top: 4px; }
.menu-note { margin: 14px 0 0; font-size: 13px; line-height: 1.8; color: var(--dim2); text-align: center; }

/* ---------------- 页面通用（选角 / 难度 / 爬塔） ---------------- */
.select-screen, .diff-screen, .tower-screen { min-height: 100dvh; background: var(--ink); }
.page-head {
  display: flex; align-items: center; gap: 10px;
  padding: calc(var(--safe-t) + 10px) 14px 10px; border-bottom: var(--hair-soft);
}
.page-head h2 { margin: 0; font-family: var(--serif); font-size: 19px; letter-spacing: .16em; font-weight: 500; }
.page-foot { padding: 12px 18px calc(var(--safe-b) + 16px); border-top: var(--hair-soft); }

.pick-list { padding: 12px 14px; display: flex; flex-direction: column; gap: 12px; }
.pick-card {
  display: flex; gap: 12px; padding: 12px; border-radius: var(--r-panel);
  background: var(--panel); box-shadow: inset 0 0 0 2px rgba(201,168,106,.16);
}
.pick-card.sel { box-shadow: inset 0 0 0 2px var(--gold); }
.pick-full { width: 108px; height: 150px; object-fit: contain; flex: 0 0 auto; }
.pick-info { flex: 1; min-width: 0; }
.pick-name { font-family: var(--serif); font-size: 20px; letter-spacing: .1em; display: flex; align-items: baseline; gap: 9px; }
.pick-role { font-family: var(--sans); font-size: 12px; color: var(--gold); letter-spacing: .1em; }
.pick-claim { font-size: 13px; color: var(--dim); margin: 3px 0 7px; }
.pick-line { font-size: 12.5px; line-height: 1.65; color: var(--cream); margin-top: 4px; }
.pick-line.dim { color: var(--dim2); }

.diff-list { padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.diff-card { padding: 14px; border-radius: var(--r-panel); background: var(--panel); box-shadow: inset 0 0 0 2px rgba(201,168,106,.16); }
.diff-card.sel { box-shadow: inset 0 0 0 2px var(--gold); }
.diff-name { font-family: var(--serif); font-size: 19px; letter-spacing: .14em; color: var(--gold); }
.diff-desc { font-size: 13.5px; line-height: 1.75; color: var(--dim); margin-top: 6px; }

.tower-meta { padding: 10px 16px; font-size: 13px; color: var(--dim); border-bottom: var(--hair-soft); }
.act { padding: 14px 14px 4px; }
.act-head { font-family: var(--serif); font-size: 17px; letter-spacing: .14em; color: var(--gold); display: flex; flex-direction: column; gap: 4px; }
.act-rule { font-family: var(--sans); font-size: 12px; letter-spacing: 0; color: var(--dim2); line-height: 1.6; }
.act-nodes { display: flex; gap: 8px; margin-top: 10px; }
.node {
  flex: 1; min-height: 62px; border: 0; border-radius: 14px; padding: 6px 2px;
  background: var(--panel); box-shadow: inset 0 0 0 2px rgba(201,168,106,.16);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--dim);
}
.node-label { font-size: 12.5px; }
.node-op { font-size: 11px; color: var(--dim2); }
.node.current { box-shadow: inset 0 0 0 2px var(--gold); color: var(--cream); }
.node.done { opacity: .5; }
.node.locked { opacity: .3; }
.node.boss .node-op { color: var(--junshi); }

/* ---------------- 对战 ---------------- */
.battle-screen { height: 100dvh; overflow: hidden; }
.b-wrap { display: flex; flex-direction: column; height: 100%; padding-top: var(--safe-t); }

.b-top { display: flex; align-items: center; gap: 8px; padding: 8px 12px 4px; }
.b-side { display: flex; align-items: center; gap: 7px; flex: 0 0 auto; }
.b-side.rev { flex-direction: row-reverse; }
.b-avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: contain; background: rgba(237,232,218,.05); box-shadow: 0 0 0 2px rgba(201,168,106,.3); }
.b-score { display: flex; flex-direction: column; line-height: 1.1; }
.b-score b { font-size: 22px; font-weight: 600; letter-spacing: .02em; }
.b-score span { font-size: 11px; color: var(--dim2); letter-spacing: .08em; }
.b-center { flex: 1; text-align: center; min-width: 0; display: flex; flex-direction: column; align-items: center; }
.b-round { font-size: 12.5px; color: var(--dim); letter-spacing: .08em; }
.b-phase { font-size: 12px; color: var(--gold); letter-spacing: .16em; margin-top: 1px; }
.b-tools { display: inline-flex; gap: 5px; margin-top: 4px; }
.tool {
  display: inline-flex; align-items: center; gap: 3px; min-height: 40px; padding: 0 9px;
  border: 0; border-radius: 999px; font-size: 12.5px; color: var(--dim); white-space: nowrap; flex: 0 0 auto;
  background: rgba(237,232,218,.05); box-shadow: inset 0 0 0 1px rgba(201,168,106,.2);
}
.tool img { width: 15px; height: 15px; opacity: .85; flex: 0 0 auto; }

.b-res {
  display: flex; align-items: center; gap: 7px; padding: 2px 12px 6px;
  border-bottom: var(--hair-soft); flex-wrap: nowrap; overflow-x: auto;
}
.b-res::-webkit-scrollbar { height: 0; }
.b-res .chip, .b-res .apdots, .b-res .relics { flex: 0 0 auto; }
.apdots { display: inline-flex; gap: 3px; }
.dot { width: 8px; height: 8px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(201,168,106,.5); }
.dot.on { background: var(--gold); }
.relics { display: inline-flex; gap: 4px; }
.relic { display: inline-flex; align-items: center; gap: 3px; padding: 2px 7px; border-radius: 999px; font-size: 11px; color: var(--gold); box-shadow: inset 0 0 0 1px rgba(201,168,106,.4); }
.relic img { width: 13px; height: 13px; opacity: .9; }

.b-intel { display: flex; flex-wrap: nowrap; overflow-x: auto; gap: 5px; padding: 6px 12px 2px; }
.b-intel::-webkit-scrollbar { height: 0; }
.b-intel .chip-btn { flex: 0 0 auto; }

.b-lanes { flex: 1 1 0; min-height: 0; overflow-y: auto; padding: 8px 12px 4px; display: flex; flex-direction: column; justify-content: safe center; gap: 8px; }
.lane {
  border-radius: var(--r-panel); background: var(--panel);
  box-shadow: inset 0 0 0 2px rgba(201,168,106,.18);
  padding: 7px 10px; position: relative;
}
.lane.drop-ok { box-shadow: inset 0 0 0 2px var(--gold); background: #16203a; }
.lane-head { display: flex; align-items: center; gap: 8px; }
.lane-icon {
  width: 30px; height: 30px; flex: 0 0 auto; border-radius: 7px;
  background-repeat: no-repeat; background-color: rgba(237,232,218,.04);
}
.lane-title { display: flex; flex-direction: column; line-height: 1.2; min-width: 66px; }
.lane-title b { font-family: var(--serif); font-size: 16px; letter-spacing: .1em; }
.lane-title span { font-size: 11px; color: var(--dim2); }
.lane-counts { margin-left: auto; font-size: 11.5px; color: var(--dim); }
.lane-body { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.lane-slots { display: flex; align-items: center; gap: 4px; flex: 1; min-width: 0; }
.mini {
  width: 30px; height: 42px; border-radius: 5px; flex: 0 0 auto;
  background: #0a0f1b center/cover no-repeat;
  box-shadow: inset 0 0 0 1px rgba(201,168,106,.22);
  font-size: 9.5px; line-height: 1.1; color: var(--dim);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  overflow: hidden; padding: 1px; text-align: center;
}
.mini.backed { background-image: url("./assets/cards/card_back.jpg"); }
.mini.empty { box-shadow: inset 0 0 0 1px rgba(237,232,218,.08); }
.mini.open { background: rgba(237,232,218,.04); color: var(--cream); }
.mini.open b { color: var(--gold); font-size: 10px; }
.vs { font-size: 10px; color: var(--dim2); padding: 0 1px; }
.lane-marks { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; justify-content: flex-end; max-width: 42%; }
.mark { display: inline-flex; align-items: center; gap: 2px; font-size: 11px; padding: 2px 6px; border-radius: 999px; }
.mark img { width: 12px; height: 12px; }
.mark.mine { color: var(--gold); box-shadow: inset 0 0 0 1px rgba(201,168,106,.5); }
.mark.foe { color: var(--junshi); box-shadow: inset 0 0 0 1px rgba(176,92,80,.5); }
.flagbtn {
  display: inline-flex; align-items: center; gap: 3px; min-height: 40px; padding: 0 10px;
  border: 0; border-radius: 999px; font-size: 12px; color: var(--dim);
  background: rgba(237,232,218,.05); box-shadow: inset 0 0 0 1px rgba(201,168,106,.28);
}
.flagbtn img { width: 14px; height: 14px; }

.b-actions { padding: 4px 12px 2px; }
.act-hint { text-align: center; margin-top: 2px; }
.b-hand { padding: 2px 0 calc(var(--safe-b) + 6px); }
.hand-hint { padding: 0 14px 2px; font-size: 11px; }
.hand-scroll {
  display: flex; gap: 6px; overflow-x: auto; overflow-y: hidden;
  padding: 6px 12px 8px; scroll-snap-type: x proximity; touch-action: pan-x;
}
.hand-scroll::-webkit-scrollbar { height: 0; }
.hand-empty { padding: 18px 14px; font-size: 13px; color: var(--dim2); text-align: center; }

/* ---------------- 卡牌 ---------------- */
.card {
  position: relative; width: 104px; height: 146px; flex: 0 0 auto;
  border-radius: 10px; overflow: hidden; user-select: none; -webkit-user-drag: none;
  scroll-snap-align: center;
}
.card img, .mini img, .intro-img, .menu-emblem, .loader-emblem, .b-avatar {
  -webkit-user-drag: none; user-drag: none; pointer-events: none;
}
.card-frame { position: absolute; inset: 0; width: 100%; height: 100%; }
.card-art { position: absolute; left: 6%; top: 15.5%; width: 89.8%; height: 49.4%; overflow: hidden; }
.card-art img { width: 100%; height: 100%; object-fit: cover; }
.card-type {
  position: absolute; right: 7%; top: 3.4%; font-size: 10px; letter-spacing: .12em;
  font-weight: 600; opacity: .95;
}
.card-name {
  position: absolute; left: 8%; top: 64%; width: 68%; text-align: center;
  font-family: var(--serif); font-size: 13px; letter-spacing: .06em; color: var(--cream);
}
.card-effect {
  position: absolute; left: 7%; top: 72%; width: 70%; height: 26%;
  font-size: 9.5px; line-height: 1.28; color: var(--dim); text-align: center;
  overflow: hidden;
}
.badge {
  position: absolute; width: 26px; height: 26px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: #0B1220; box-shadow: inset 0 0 0 2px var(--gold);
  color: var(--gold); font-size: 15px; font-weight: 600;
}
.badge-cost { left: 11.3%; top: 8.1%; transform: translate(-50%, -50%); }
.badge-power { left: 88%; top: 86.3%; transform: translate(-50%, -50%); }
.hand-card.poor { opacity: .55; }
.hand-card.sel { transform: translateY(-6px); }
.hand-card.sel::after {
  content: ""; position: absolute; inset: 0; border-radius: 10px; box-shadow: inset 0 0 0 3px var(--gold);
}
.zoom-card { width: 130px; height: 182px; }
.zoom-card .badge { width: 28px; height: 28px; font-size: 16px; }
.zoom-card .card-name { font-size: 14px; top: 66.5%; }
.zoom-card .card-effect { font-size: 10px; line-height: 1.3; top: 76%; height: 22%; color: var(--cream); }
.zoom-card .card-type { font-size: 10.5px; }
.drag-ghost { position: fixed; z-index: 80; pointer-events: none; opacity: .9; transform: rotate(-3deg); }
.drag-ghost .card { transform: scale(1.05); }

/* ---------------- 卡片放大面板 ---------------- */
.zoom-sheet {
  position: fixed; left: 0; right: 0; bottom: calc(var(--safe-b) + 162px); z-index: 60;
  display: flex; justify-content: center; padding: 0 12px;
  background: none; pointer-events: none;
  transform: translateY(10px); opacity: 0; transition: transform .18s ease, opacity .18s ease;
}
.zoom-sheet.in { transform: translateY(0); opacity: 1; }
.zoom-inner {
  display: flex; gap: 12px; width: 100%; max-width: 452px; pointer-events: auto;
  background: rgba(18,26,43,.97); border-radius: 18px; padding: 10px 12px;
  box-shadow: inset 0 0 0 2px rgba(201,168,106,.7), 0 10px 30px rgba(0,0,0,.5);
}
.zoom-side { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.zoom-name { font-family: var(--serif); font-size: 18px; letter-spacing: .08em; display: flex; align-items: baseline; gap: 8px; }
.zoom-name span { font-family: var(--sans); font-size: 11.5px; color: var(--gold); }
.zoom-eff { font-size: 13px; line-height: 1.6; color: var(--cream); }
.zoom-meta { font-size: 12.5px; color: var(--dim); }
.zoom-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.zoom-btns .btn.tiny { min-height: 38px; font-size: 13px; padding: 0 12px; }
.zoom-hint { font-size: 11.5px; color: var(--dim2); margin-top: auto; }

/* ---------------- 揭晓结算 ---------------- */
.b-reveal { flex: 1; overflow-y: auto; padding: 10px 12px 4px; }
.rv-lane { border-radius: var(--r-panel); background: var(--panel); box-shadow: inset 0 0 0 2px rgba(201,168,106,.18); padding: 9px 11px; margin-bottom: 8px; }
.rv-head { display: flex; align-items: baseline; gap: 8px; }
.rv-head b { font-family: var(--serif); font-size: 17px; letter-spacing: .12em; }
.rv-head span { font-size: 11.5px; color: var(--dim2); }
.rv-win { margin-left: auto; font-size: 13px; color: var(--gold); }
.rv-row { display: flex; align-items: flex-start; gap: 8px; margin-top: 6px; }
.rv-tag { font-size: 11px; padding: 1px 7px; border-radius: 999px; flex: 0 0 auto; margin-top: 2px; }
.rv-tag.mine { box-shadow: inset 0 0 0 1px rgba(201,168,106,.55); color: var(--gold); }
.rv-tag.foe { box-shadow: inset 0 0 0 1px rgba(176,92,80,.55); color: var(--junshi); }
.rv-card { display: inline-flex; flex-direction: column; align-items: center; font-size: 11px; padding: 3px 8px; margin: 0 5px 4px 0; border-radius: 8px; background: rgba(237,232,218,.05); box-shadow: inset 0 0 0 1px rgba(201,168,106,.22); }
.rv-card b { font-weight: 500; }
.rv-card.cut { box-shadow: inset 0 0 0 1px rgba(176,92,80,.7); }
.rv-card.cut::after { content: " -" attr(data-cut); }
.rv-none { font-size: 12px; color: var(--dim2); }
.rv-sum { font-size: 13px; color: var(--cream); margin-top: 5px; line-height: 1.6; }
.rv-notes { font-size: 11.5px; color: var(--dim); margin-top: 4px; line-height: 1.6; }
.rv-notes.foe { color: rgba(237,232,218,.5); }
.rv-log { margin-top: 4px; }
.rv-log-title { font-size: 13px; color: var(--gold); letter-spacing: .1em; margin-bottom: 5px; }
.rv-log ul { list-style: none; margin: 0; padding: 0; }
.log-item { font-size: 12.5px; line-height: 1.6; padding: 4px 8px; border-radius: 8px; margin-bottom: 3px; background: rgba(237,232,218,.035); color: var(--dim); }
.log-item.good { color: #CFE0D4; background: rgba(96,150,128,.13); }
.log-item.bad { color: #E6C3BE; background: rgba(176,92,80,.13); }
.log-item .log-t { font-size: 10.5px; color: var(--dim2); margin-right: 6px; }
.log-empty { font-size: 12.5px; color: var(--dim2); }

/* ---------------- 教程卡 ---------------- */
.tut-card { margin: 6px 12px 0; padding: 8px 11px; border-radius: var(--r-panel); background: rgba(201,168,106,.1); box-shadow: inset 0 0 0 2px rgba(201,168,106,.45); }
.tut-head { display: flex; align-items: center; gap: 8px; }
.tut-num { font-size: 11px; color: var(--gold); letter-spacing: .1em; }
.tut-head b { font-family: var(--serif); font-size: 15px; letter-spacing: .1em; }
.tut-skip { margin-left: auto; background: none; border: 0; font-size: 12px; color: var(--dim2); text-decoration: underline; min-height: 40px; }
.tut-text { font-size: 12.5px; line-height: 1.65; margin: 5px 0 7px; color: var(--cream); }
.tut-wait { font-size: 12px; color: var(--gold); }
.tut-card .btn.tiny { min-height: 40px; font-size: 13px; }

/* ---------------- 结算画面 ---------------- */
.result-screen { position: relative; min-height: 100dvh; }
.result-bg { position: absolute; inset: 0; background: url("./assets/backgrounds/bg_victory.jpg") center/cover no-repeat; opacity: .5; }
.result-bg.lose { background-image: url("./assets/backgrounds/bg_defeat.jpg"); }
.result-body {
  position: relative; z-index: 2; min-height: 100dvh; padding: calc(var(--safe-t) + 24px) 24px calc(var(--safe-b) + 24px);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center;
}
.result-hero { width: 150px; height: 150px; object-fit: contain; }
.result-title { font-family: var(--serif); font-size: 28px; letter-spacing: .24em; margin: 0; color: var(--gold); font-weight: 500; }
.result-text { font-size: 15px; margin: 0; color: var(--cream); }
.result-score { font-size: 30px; font-weight: 600; letter-spacing: .1em; margin: 4px 0; }
.result-stats { font-size: 13px; color: var(--dim); line-height: 1.9; }
.result-line { font-size: 14px; color: var(--gold); margin: 6px 0 0; }
.result-actions { width: 100%; margin-top: 14px; display: flex; flex-direction: column; gap: 10px; }

/* ---------------- 弹窗 ---------------- */
.modal-root { position: fixed; inset: 0; z-index: 70; display: none; }
.modal-root.on { display: block; }
.modal-wrap {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  padding: 20px 16px calc(var(--safe-b) + 16px);
  background: rgba(6, 10, 18, .74);
}
.modal-panel {
  position: relative; width: 100%; max-width: 440px; max-height: 86dvh; overflow-y: auto;
  background: var(--panel); border-radius: 20px; box-shadow: inset 0 0 0 2px var(--gold);
  padding: 20px 18px 18px;
}
.modal-wrap.wide .modal-panel { max-width: 470px; }
.modal-close {
  position: absolute; top: 8px; right: 8px; width: 40px; height: 40px; border: 0; border-radius: 50%;
  background: rgba(237,232,218,.06); display: flex; align-items: center; justify-content: center;
}
.modal-close img { width: 16px; height: 16px; opacity: .8; }
.m-title { font-family: var(--serif); font-size: 20px; letter-spacing: .16em; color: var(--gold); margin: 0 0 12px; padding-right: 34px; }
.m-sec { font-size: 14px; letter-spacing: .1em; color: var(--gold); margin: 16px 0 6px; }
.m-text { font-size: 14px; line-height: 1.8; color: var(--cream); margin: 0 0 10px; }
.m-text.dim { color: var(--dim2); font-size: 13px; }
.m-list { margin: 0 0 8px; padding-left: 18px; }
.m-list li { font-size: 13.5px; line-height: 1.8; color: var(--cream); margin-bottom: 4px; }
.m-scroll { max-height: 62dvh; overflow-y: auto; }
.m-scroll .m-sec:first-child { margin-top: 0; }
.card-table { border-radius: 12px; background: rgba(237,232,218,.03); padding: 6px 8px; }
.ct-row { display: flex; flex-wrap: wrap; gap: 4px 8px; padding: 5px 0; border-bottom: 1px solid rgba(237,232,218,.06); font-size: 12.5px; line-height: 1.6; }
.ct-row:last-child { border-bottom: 0; }
.ct-id { color: var(--gold); font-size: 11.5px; min-width: 30px; }
.ct-name { color: var(--cream); min-width: 56px; }
.ct-cost, .ct-pow { color: var(--dim); }
.ct-lane { color: var(--dim2); }
.ct-eff { color: var(--dim); flex: 1 1 100%; }
.card-table-title { font-size: 14px; letter-spacing: .12em; margin: 12px 0 5px; }
.reward-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 12px; }
.reward-item {
  flex: 1 1 120px; min-height: 64px; text-align: left; padding: 8px 10px;
  border: 0; border-radius: 12px; background: rgba(237,232,218,.05);
  box-shadow: inset 0 0 0 1px rgba(201,168,106,.3);
  display: flex; flex-direction: column; gap: 2px;
}
.reward-item b { font-size: 14px; font-family: var(--serif); letter-spacing: .06em; }
.reward-item span { font-size: 11.5px; color: var(--dim); line-height: 1.45; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid rgba(237,232,218,.07); font-size: 14px; }
.note-row { padding: 9px 0; border-bottom: 1px solid rgba(237,232,218,.07); }
.note-head { font-family: var(--serif); font-size: 16px; letter-spacing: .1em; color: var(--gold); }
.intro-wrap { display: flex; justify-content: center; margin: 10px 0 14px; }
.intro-img { width: 190px; height: 190px; object-fit: contain; }
.bid-row { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 14px 0 6px; }
.bid-input {
  width: 120px; height: 56px; text-align: center; font-size: 24px; color: var(--gold);
  background: rgba(11,18,32,.8); border: 0; border-radius: 16px; box-shadow: inset 0 0 0 2px var(--gold);
}
.empty { padding: 30px 16px; text-align: center; color: var(--dim2); font-size: 14px; }

/* ---------------- Toast ---------------- */
.toast-root { position: fixed; left: 0; right: 0; top: calc(var(--safe-t) + 74px); z-index: 95; display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; }
.toast {
  max-width: 86%; padding: 9px 15px; border-radius: 999px; font-size: 13px; line-height: 1.5;
  background: rgba(18,26,43,.96); box-shadow: inset 0 0 0 2px rgba(201,168,106,.5);
  color: var(--cream); text-align: center; transition: opacity .4s ease, transform .4s ease;
}
.toast.out { opacity: 0; transform: translateY(-8px); }

.noscript { padding: 40px 20px; text-align: center; color: var(--cream); }

/* ---------------- 低配模式 ---------------- */
body.low-spec .card { box-shadow: none; }
body.low-spec .menu-bg, body.low-spec .result-bg, body.low-spec .prologue-bg { opacity: .3; }
body.low-spec * { transition: none !important; animation: none !important; }
body.low-spec .btn:active { transform: none; }

/* ---------------- 横屏 ---------------- */
@media (orientation: landscape) and (max-height: 520px) {
  .b-lanes { max-height: 46dvh; }
  .hand-scroll { padding-top: 2px; }
  .card { width: 88px; height: 124px; }
  .zoom-card { width: 170px; height: 238px; }
  .b-wrap { flex-direction: column; }
  .landscape-tip { display: block; }
}
.landscape-tip {
  display: none; text-align: center; font-size: 12px; color: var(--dim2);
  padding: 4px 12px 0; letter-spacing: .08em;
}
