/* sggame · 竖屏 750 × 1334 骨架皮肤
 * 资源全部来自素材库命名空间 assets/sgsg（不引用任何外链）
 * 字体：系统中文黑体；美术资产：墨玉鎏金 5 件 + 卡面 */

:root {
  --ink: #080b0a;
  --ink2: #0e1411;
  --ink3: #121a16;
  --gold: #d9b36a;
  --gold2: #f4dfae;
  --red: #a8322a;
  --jade: #4b9a84;
  --txt: #e9e3d6;
  --dim: #9d9890;
  --line: rgba(217, 179, 106, 0.22);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: #040605; overflow: hidden; }
body {
  color: var(--txt);
  font: 26px/1.5 "Microsoft YaHei", "PingFang SC", "Noto Sans SC", sans-serif;
  user-select: none;
}

#viewport {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 50% 30%, #0b1210 0%, #040605 70%);
}
#stage {
  position: relative;
  width: 750px; height: 1334px;
  transform-origin: center center;
  overflow: hidden;
  background:
    radial-gradient(120% 60% at 50% 0%, rgba(75, 154, 132, 0.14) 0%, rgba(8, 11, 10, 0) 60%),
    radial-gradient(90% 50% at 50% 100%, rgba(168, 50, 42, 0.12) 0%, rgba(8, 11, 10, 0) 65%),
    linear-gradient(180deg, #0a0f0d 0%, #070a09 40%, #060807 100%);
}
#stage::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(75% 55% at 50% 45%, rgba(0, 0, 0, 0) 55%, rgba(0, 0, 0, 0.55) 100%);
}

/* ---------- 顶栏 ---------- */
#topbar {
  position: relative; z-index: 3;
  height: 96px; padding: 18px 20px 0;
  display: flex; gap: 10px; align-items: flex-start;
}
.res {
  flex: 1 1 0; min-width: 0;
  height: 56px;
  background-image: url("../assets/sgsg/ui/ui_resource_bar@2x.webp");
  background-size: 100% 100%;
  background-repeat: no-repeat;
  display: flex; align-items: center; gap: 8px;
  padding: 0 12px 0 10px;
  font-size: 22px; color: var(--gold2);
  letter-spacing: 0.5px;
}
.res i {
  width: 30px; height: 30px; border-radius: 50%; flex: 0 0 30px;
  display: inline-block;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25);
}
.res i.gold { background: radial-gradient(circle at 35% 30%, #ffe9a8, #c8912e 70%); }
.res i.yuanbao { background: radial-gradient(circle at 35% 30%, #d8f4ff, #4f93b8 70%); }
.res i.jade { background: radial-gradient(circle at 35% 30%, #c9ffe8, #2f7d67 70%); }
.res i.power { background: radial-gradient(circle at 35% 30%, #ffd9c8, #a8322a 70%); }
.res b { font-size: 24px; margin-left: auto; font-weight: 600; }

/* ---------- 页面容器 ---------- */
#page {
  position: relative; z-index: 2;
  height: 1134px; padding: 6px 24px 0;
  overflow: hidden;
}
.page { height: 100%; min-height: 0; display: flex; flex-direction: column; gap: 16px; }
.page-scroll { overflow-y: auto; -webkit-overflow-scrolling: touch; }

/* ---------- 底板 ---------- */
.panel {
  border: 44px solid transparent;
  border-image: url("../assets/sgsg/ui/ui_panel@2x.webp") 96 fill / 44px / 0 stretch;
  padding: 0;
  background-clip: padding-box;
}
.panel-in { padding: 8px 6px; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 84px; min-width: 240px; padding: 0 34px;
  border: 0; background: transparent; cursor: pointer;
  font: 600 32px/1 "Microsoft YaHei", sans-serif;
  color: #f8ecd2; letter-spacing: 2px;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.65);
  background-image: url("../assets/sgsg/ui/ui_btn_primary@2x.webp");
  background-size: 100% 100%; background-repeat: no-repeat;
  transition: transform 0.12s ease, filter 0.12s ease;
}
.btn:active { transform: translateY(2px) scale(0.985); filter: brightness(1.12); }
.btn.sec {
  height: 72px; min-width: 200px; font-size: 27px; color: #e6ded0;
  background-image: url("../assets/sgsg/ui/ui_btn_secondary@2x.webp");
}
.btn[disabled] { filter: grayscale(0.6) brightness(0.7); pointer-events: none; }
.btn-row { display: flex; gap: 18px; justify-content: center; align-items: center; }
.btn.sm { height: 64px; min-width: 0; flex: 1; font-size: 24px; letter-spacing: 1px; }

/* ---------- 卡面 ---------- */
.card {
  position: relative;
  width: 200px; height: 300px;
  background-image: url("../assets/sgsg/ui/ui_card_slot@2x.webp");
  background-size: 100% 100%; background-repeat: no-repeat;
  flex: 0 0 auto;
}
.card .art {
  position: absolute; left: 7.5%; top: 22.6%; width: 85%; height: 69.7%;
  overflow: hidden;
  display: flex; align-items: flex-end; justify-content: center;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(0, 0, 0, 0.25));
}
.card .art img {
  width: 100%; height: 100%; object-fit: contain; object-position: 50% 100%;
  display: block;
}
/* 缺立绘的占位：元素底色 + 姓氏大字 + 待绘标记 */
/* 缺立绘的占位：元素色墨影 + 姓氏 + 待绘小签（等真立绘到位逐张替换） */
.card .ph {
  position: relative; width: 100%; height: 100%; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  background: linear-gradient(180deg, #101713, #080d0b 70%);
}
.card .ph::before {
  content: ""; position: absolute; inset: -20%;
  background: radial-gradient(circle at 50% 34%, var(--ec) 0%, rgba(0, 0, 0, 0) 58%);
  opacity: 0.22;
}
.card .ph::after {
  content: ""; position: absolute; inset: 0;
  background: repeating-linear-gradient(115deg, rgba(255, 255, 255, 0.05) 0 2px, transparent 2px 26px);
  opacity: 0.45;
}
.card .ph .ph-elem {
  position: absolute; top: 2%; left: 0; right: 0; text-align: center;
  font-size: 150px; font-weight: 800; letter-spacing: 10px;
  color: var(--ec); opacity: 0.16; z-index: 1;
}
.card .ph .ph-name {
  position: relative; z-index: 1;
  font-size: 84px; font-weight: 700; color: #e9dfc9;
  letter-spacing: 4px; text-shadow: 0 6px 26px rgba(0, 0, 0, 0.75);
}
.card .ph small {
  position: relative; z-index: 1;
  font-size: 18px; font-weight: 400; letter-spacing: 5px;
  color: rgba(233, 223, 201, 0.5);
  border: 1px solid rgba(217, 179, 106, 0.28); border-radius: 10px;
  padding: 2px 10px;
}
.card .nm {
  position: absolute; left: 0; right: 0; top: 35px;
  text-align: center; font-size: 26px; font-weight: 700;
  color: #fff3dc; text-shadow: 0 2px 6px rgba(0, 0, 0, 0.8);
  letter-spacing: 3px;
}
.card .stars {
  position: absolute; left: 18px; right: 18px; bottom: 22px;
  font-size: 18px; color: #f7cd7a; letter-spacing: 2px;
}
.card .tag {
  position: absolute; right: 12px; top: 70px;
  font-size: 16px; padding: 1px 7px; border-radius: 4px;
  background: rgba(0, 0, 0, 0.55); color: #cfd8cf;
  border: 1px solid rgba(255, 255, 255, 0.18);
}
.card .elem { position: absolute; right: 14px; bottom: 20px; font-size: 18px; }
.card.locked { filter: grayscale(0.9) brightness(0.55); }
.card .new { position: absolute; left: 12px; top: 70px; font-size: 16px; padding: 1px 7px; border-radius: 4px; background: #a8322a; color: #ffe7d2; }

/* ---------- 底栏 ---------- */
#tabbar {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 4;
  height: 104px; display: flex;
  background: linear-gradient(180deg, rgba(18, 26, 22, 0.96), rgba(8, 11, 10, 0.98));
  border-top: 1px solid var(--line);
}
#tabbar button {
  flex: 1; border: 0; background: transparent; cursor: pointer;
  color: #8d877c; font: 500 24px/1 "Microsoft YaHei", sans-serif;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  letter-spacing: 2px;
}
#tabbar button .dot { width: 34px; height: 4px; border-radius: 2px; background: transparent; }
#tabbar button.on { color: var(--gold2); }
#tabbar button.on .dot { background: linear-gradient(90deg, transparent, #d9b36a, transparent); }

/* ---------- 主城 ---------- */
.masthead { text-align: center; padding: 4px 0 2px; }
.masthead h1 { margin: 0; font-size: 44px; letter-spacing: 10px; color: var(--gold2); text-shadow: 0 6px 18px rgba(0, 0, 0, 0.7); }
.masthead p { margin: 6px 0 0; font-size: 20px; color: var(--dim); letter-spacing: 4px; }
.stage-card { display: flex; gap: 10px; align-items: center; }
.stage-card .no {
  font-size: 64px; font-weight: 700; color: var(--gold); line-height: 1;
  text-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
  min-width: 92px; text-align: center;
}
.stage-card .meta { flex: 1; min-width: 0; }
.stage-card .meta h2 { margin: 0; font-size: 32px; color: #f1e8d6; letter-spacing: 2px; }
.stage-card .meta p { margin: 4px 0 0; font-size: 22px; color: var(--dim); }
.stage-card .meta p.warn { color: #e8836a; }
.kv { display: flex; justify-content: space-between; font-size: 24px; color: #cfc7b8; padding: 4px 0; }
.kv span { color: var(--dim); }
.sec-title { font-size: 24px; color: var(--gold); letter-spacing: 3px; display: flex; align-items: center; gap: 10px; }
.sec-title::before { content: ""; width: 8px; height: 22px; background: linear-gradient(180deg, #d9b36a, #7a5a26); display: inline-block; }
.quest { display: flex; align-items: center; gap: 12px; font-size: 24px; padding: 8px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.06); }
.quest .nm { flex: 1; min-width: 0; color: #ded6c7; }
.quest .pr { font-size: 20px; color: var(--dim); }
.quest .st { font-size: 22px; color: var(--gold); }
.hint { font-size: 20px; color: #8a8478; text-align: center; }
.link { font-size: 20px; color: #8a8478; text-decoration: underline; background: none; border: 0; cursor: pointer; }

/* ---------- 抽卡 ---------- */
.gacha-head { text-align: center; }
.gacha-head h2 { margin: 0; font-size: 36px; color: var(--gold2); letter-spacing: 6px; }
.gacha-head p { margin: 6px 0 0; font-size: 20px; color: var(--dim); }
.pity { height: 14px; background: rgba(255, 255, 255, 0.08); border-radius: 7px; overflow: hidden; margin-top: 12px; }
.pity > i { display: block; height: 100%; background: linear-gradient(90deg, #6f5a2a, #f4dfae); }
.pull-grid { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.pull-grid .card { width: 112px; height: 168px; }
.pull-grid .card .nm { font-size: 16px; top: 24px; letter-spacing: 0; }
.pull-grid .card .tag { display: none; }
.pull-grid .card .stars { font-size: 12px; left: 8px; bottom: 9px; letter-spacing: 0; }
.pull-grid .card .elem { font-size: 12px; right: 6px; bottom: 9px; }
.pull-grid .card .ph { font-size: 40px; }
.pull-grid .card .ph small { font-size: 14px; }
.pull-empty { text-align: center; color: #857f73; font-size: 24px; padding: 30px 0; }

/* ---------- 图鉴 ---------- */
.grid { display: flex; flex-wrap: wrap; gap: 18px 18px; justify-content: center; padding: 8px 0 150px; }
.grid .card { cursor: pointer; }
.hero-detail {
  position: absolute; inset: 0; z-index: 20;
  background: rgba(4, 6, 5, 0.86);
  display: flex; align-items: center; justify-content: center;
  padding: 40px;
}
.hero-detail .box { width: 660px; }
.hero-detail .top { display: flex; gap: 16px; align-items: flex-start; }
.hero-detail .top .card { width: 176px; height: 264px; flex: 0 0 176px; }
.hero-detail .info { flex: 1; min-width: 0; padding-top: 4px; }
.hero-detail .info h3 { margin: 0; font-size: 36px; color: var(--gold2); letter-spacing: 4px; }
.hero-detail .info .sub { font-size: 20px; color: var(--dim); margin-top: 4px; }
.hero-detail .info .kv { font-size: 22px; }

/* ---------- 战斗 ---------- */
.battle-stage { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 6px; }
.side { display: flex; gap: 8px; justify-content: center; flex: 0 0 auto; }
.unit {
  width: 118px; position: relative;
  background: rgba(10, 15, 12, 0.7);
  border: 1px solid rgba(217, 179, 106, 0.25);
  border-radius: 8px;
  overflow: visible;
  padding-bottom: 6px;
}
.unit .ph2 {
  height: 142px; display: flex; align-items: center; justify-content: center;
  font-size: 38px; font-weight: 700; color: rgba(255, 255, 255, 0.45);
}
.unit .ph2 img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 8%; display: block; }
.unit .nm2 { text-align: center; font-size: 19px; color: #ded6c7; margin-top: 2px; }
.unit .lv2 { text-align: center; font-size: 16px; color: var(--dim); }
.unit .bar { height: 8px; margin: 4px 6px 0; background: rgba(255, 255, 255, 0.12); border-radius: 4px; overflow: hidden; }
.unit .bar > i { display: block; height: 100%; background: linear-gradient(90deg, #4b9a84, #8fe3c6); transition: width 0.25s; }
.unit[data-side="e"] .bar > i { background: linear-gradient(90deg, #a8322a, #e8836a); }
.unit.dead { filter: grayscale(1) brightness(0.45); }
.unit.acting { box-shadow: 0 0 0 2px var(--gold), 0 0 18px rgba(217, 179, 106, 0.45); }
.float {
  position: absolute; left: 50%; top: 18px; transform: translateX(-50%);
  font: 700 34px/1 "Microsoft YaHei", sans-serif;
  color: #fff3dc; text-shadow: 0 2px 8px rgba(0, 0, 0, 0.9);
  pointer-events: none; animation: floatUp 1s ease-out forwards;
}
.float.crit { font-size: 52px; color: #ff8a3d; }
.float.heal { color: #8fe3c6; }
@keyframes floatUp {
  0% { opacity: 0; transform: translate(-50%, 12px) scale(0.8); }
  22% { opacity: 1; transform: translate(-50%, -6px) scale(1.06); }
  100% { opacity: 0; transform: translate(-50%, -64px) scale(1); }
}
.log {
  flex: 1; min-height: 0; overflow-y: auto;
  background: rgba(6, 9, 8, 0.55);
  border: 1px solid rgba(217, 179, 106, 0.16);
  border-radius: 8px; padding: 10px 14px;
  font-size: 21px; line-height: 1.6; color: #c9c2b4;
}
.log div { padding: 1px 0; }
.log .hl { color: #f4dfae; }
.log .red { color: #e8836a; }
.log .grn { color: #8fe3c6; }
.vs { text-align: center; font-size: 20px; color: #6f6a60; letter-spacing: 6px; }
.result {
  position: absolute; inset: 0; z-index: 18; display: flex; align-items: center; justify-content: center;
  background: rgba(4, 6, 5, 0.88); padding: 40px;
}
.result .box { width: 520px; text-align: center; }
.result h2 { margin: 6px 0 10px; font-size: 52px; letter-spacing: 8px; }
.result h2.win { color: var(--gold2); text-shadow: 0 0 28px rgba(217, 179, 106, 0.45); }
.result h2.lose { color: #9a938a; }
.result p { font-size: 24px; color: #cfc7b8; margin: 6px 0; }

/* 自检输出：保留但不干扰界面 */
#selftest {
  position: fixed; left: -9999px; top: 0; width: 640px;
  font: 12px/1.5 Consolas, monospace; white-space: pre-wrap;
}

/* 滚动条 */
.page-scroll::-webkit-scrollbar, .log::-webkit-scrollbar { width: 6px; }
.page-scroll::-webkit-scrollbar-thumb, .log::-webkit-scrollbar-thumb { background: rgba(217, 179, 106, 0.25); border-radius: 3px; }


/* ---------- 阵容槽位（主城） ---------- */
.slots { display: flex; gap: 12px; justify-content: space-between; margin: 10px 0 14px; }
.slot {
  position: relative; width: 104px; height: 156px;
  border-radius: 8px;
}
.slot .card { transform: scale(0.52); transform-origin: top left; }
.slot.empty {
  border: 2px dashed rgba(217, 179, 106, 0.35); border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, 0.25); cursor: pointer;
}
.slot.empty .plus { font-size: 42px; color: rgba(217, 179, 106, 0.55); }
.slot .slot-lv {
  position: absolute; left: 50%; bottom: -6px; transform: translateX(-50%);
  font-size: 18px; color: #e8dcc2; background: rgba(0, 0, 0, 0.65);
  border: 1px solid rgba(217, 179, 106, 0.35); border-radius: 8px; padding: 0 8px;
  white-space: nowrap;
}
.bag-row { display: flex; justify-content: space-between; font-size: 23px; color: #cfc7b8; padding: 5px 0; border-bottom: 1px solid rgba(255,255,255,0.05); }
.bag-row b { color: #f0e3c5; }

/* ---------- 选将浮层 ---------- */
.picker {
  position: absolute; inset: 0; z-index: 24;
  background: rgba(4, 6, 5, 0.88);
  display: flex; align-items: center; justify-content: center; padding: 30px;
}
.pick-grid { display: flex; flex-wrap: wrap; gap: 10px 10px; justify-content: center; max-height: 900px; overflow-y: auto; }
.pick { position: relative; width: 140px; height: 210px; }
.pick .card { transform: scale(0.7); transform-origin: top left; cursor: pointer; }
.pick.in-team { outline: 2px solid rgba(217, 179, 106, 0.55); outline-offset: -2px; border-radius: 8px; }
.pick-tag { position: absolute; left: 50%; top: -8px; transform: translateX(-50%); font-size: 16px; padding: 1px 8px; border-radius: 8px; background: rgba(168, 50, 42, 0.9); color: #ffe7d2; white-space: nowrap; }

.btn small { font-size: 17px; letter-spacing: 0; color: #e6cf9a; margin-left: 6px; font-weight: 400; }
.btn[disabled] { opacity: 0.72; }
