/* 《仙侠跑酷 · 云海浮屠》界面样式：水墨仙侠配色，竖屏优先 */
:root {
  --ink: #0e1626;
  --ink2: #16223a;
  --jade: #45e0c0;
  --jade-d: #1aa588;
  --gold: #e8c07a;
  --red: #d8514a;
  --paper: #f2ede4;
  --r: 8px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #0b1220; }
body {
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: #fff; user-select: none; touch-action: none;
}
#stage { position: fixed; inset: 0; }
#cv { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hide { display: none !important; }
.grow { flex: 1; }

/* ---------------- HUD（对齐参考实机：左距离/灵玉胶囊 + 顶部进度条 + 右上暂停） ---------------- */
#hud {
  position: absolute; left: 0; right: 0; top: 0;
  padding: calc(8px + env(safe-area-inset-top)) 10px 8px;
  display: flex; align-items: flex-start; gap: 8px;
  pointer-events: none;
}
#hud .icon { pointer-events: auto; margin-left: auto; }
.hleft { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.hchip {
  display: inline-flex; align-items: center; gap: 5px;
  background: linear-gradient(180deg, rgba(10,22,38,.72), rgba(10,22,38,.55));
  border: 1px solid rgba(120,220,210,.35);
  padding: 5px 11px; border-radius: 20px;
  font-size: 12.5px; color: #cfe6ea;
  backdrop-filter: blur(6px);
  box-shadow: 0 3px 12px rgba(0,0,0,.28);
}
.hchip b { font-size: 17px; color: #fff; font-variant-numeric: tabular-nums; text-shadow: 0 1px 3px rgba(0,0,0,.5); }
.hchip .hu { font-size: 11px; color: #9fbcc4; }
.hchip .hl { font-size: 11.5px; color: #9fbcc4; }
.hchip.jade b { color: #8ff2dc; }
.hchip .jico { width: 18px; height: 18px; object-fit: contain; filter: drop-shadow(0 0 4px rgba(120,255,225,.6)); }
.hprog {
  flex: 1; max-width: 190px; height: 8px; margin-top: 8px;
  border-radius: 8px; overflow: hidden;
  background: rgba(10,22,38,.55); border: 1px solid rgba(120,220,210,.3);
}
.hprog > i {
  display: block; height: 100%; width: 0%;
  background: linear-gradient(90deg, #35d8b6, #8ff2dc);
  box-shadow: 0 0 8px rgba(120,255,225,.7);
  transition: width .18s linear;
}
.icon {
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(10,22,38,.6); border: 1px solid rgba(120,220,210,.35);
  color: #dff6f2; font-size: 15px; display: grid; place-items: center;
  backdrop-filter: blur(6px);
}

/* ---------------- buff 条 ---------------- */
#buffs {
  position: absolute; left: 10px; top: calc(96px + env(safe-area-inset-top));
  display: flex; flex-direction: column; gap: 6px; align-items: flex-start;
}
.buff {
  padding: 4px 10px; border-radius: 20px;
  font-size: 12px; font-weight: 700;
  background: rgba(69, 224, 192, .14); border: 1px solid rgba(69, 224, 192, .45);
  color: #b9fff0;
  animation: pop .2s ease-out;
  text-shadow: 0 1px 3px rgba(0,0,0,.4);
}
.buff.boost { background: rgba(232, 192, 122, .16); border-color: rgba(232, 192, 122, .5); color: #ffe9c2; }
.buff.pill { background: rgba(216, 81, 74, .16); border-color: rgba(216, 81, 74, .5); color: #ffd7d2; }
.buff.bell { background: rgba(147, 214, 255, .14); border-color: rgba(147, 214, 255, .45); color: #d6f0ff; }
.buff.beast { background: rgba(216, 81, 74, .2); border-color: rgba(216, 81, 74, .6); color: #ffc9c4; }
@keyframes pop { from { transform: scale(.8); opacity: 0; } }

/* ---------------- 飘字 ---------------- */
#toast-wrap {
  position: absolute; left: 0; right: 0; top: 34%;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  pointer-events: none;
}
#toast-wrap div {
  padding: 6px 16px; border-radius: var(--r);
  background: rgba(11, 18, 32, .7); border: 1px solid rgba(232, 192, 122, .3);
  font-weight: 700; letter-spacing: 1px; color: #ffe9c2;
  animation: rise .9s ease-out forwards;
}
@keyframes rise { 0% { opacity: 0; transform: translateY(8px); } 20% { opacity: 1; } 100% { opacity: 0; transform: translateY(-18px); } }

/* ---------------- 技能按钮 ---------------- */
.skill {
  position: absolute; right: 14px; bottom: calc(20px + env(safe-area-inset-bottom));
  width: 84px; height: 84px; border-radius: 50%;
  background: radial-gradient(circle at 50% 35%, rgba(232,192,122,.35), rgba(20,30,50,.7));
  border: 2px solid rgba(232, 192, 122, .55);
  color: #ffe9c2; display: flex; flex-direction: column; align-items: center; justify-content: center;
  overflow: hidden; box-shadow: 0 6px 20px rgba(0,0,0,.4);
}
.skill .sic { font-size: 26px; line-height: 1; }
.skill .stx { font-size: 10.5px; margin-top: 2px; opacity: .9; }
.skill .cdmask {
  position: absolute; left: 0; right: 0; bottom: 0; height: 0%;
  background: rgba(6, 10, 18, .68); transition: height .1s linear;
}
.skill.ready { border-color: var(--jade); color: #d8fff6; box-shadow: 0 0 18px rgba(69,224,192,.35); }
.skill:active { transform: scale(.94); }

/* ---------------- 面板 ---------------- */
.scr {
  position: absolute; inset: 0; z-index: 20;
  display: grid; place-items: center;
  padding: 16px;
  background: linear-gradient(180deg, rgba(8,13,24,.86), rgba(8,13,24,.94));
  backdrop-filter: blur(4px);
}
.panel {
  width: 100%; max-width: 420px; max-height: 100%; overflow-y: auto;
  background: linear-gradient(180deg, rgba(22,34,58,.96), rgba(14,22,38,.98));
  border: 1px solid rgba(232, 192, 122, .3);
  border-radius: var(--r);
  padding: 20px 16px; text-align: center;
  box-shadow: 0 16px 50px rgba(0,0,0,.5);
}
.panel.small { max-width: 320px; }
.panel h1 { margin: 0 0 4px; font-size: 22px; letter-spacing: 2px; color: var(--gold); }
.panel h2 { margin: 0 0 12px; font-size: 19px; letter-spacing: 1px; color: var(--gold); }
.panel .sub { margin: 0 0 16px; font-size: 12.5px; color: #9fb3bd; }
.lb { text-align: left; font-size: 12.5px; color: #9fb3bd; margin: 0 0 8px; }

/* 角色选择 */
.chars { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.chars button {
  padding: 6px 2px 0; border-radius: var(--r);
  background: rgba(255,255,255,.04); border: 1.5px solid rgba(255,255,255,.1);
  color: #cfe0e6; display: flex; flex-direction: column; align-items: center;
  min-height: 96px;
}
.chars button canvas { width: 46px; height: 78px; object-fit: contain; }
.chars button span { font-size: 11.5px; margin-top: 2px; }
.chars button.on { border-color: var(--jade); background: rgba(69,224,192,.12); color: #fff; }
.perk {
  min-height: 34px; margin: 10px 0 14px; font-size: 12.5px; color: #b9fff0;
  background: rgba(69,224,192,.1); border: 1px solid rgba(69,224,192,.28);
  border-radius: var(--r); padding: 7px 10px;
}

.big {
  display: block; width: 100%; min-height: 48px; margin: 8px 0 0;
  border-radius: var(--r); font-size: 16px; font-weight: 800; letter-spacing: 2px;
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.16); color: #fff;
}
.big.primary {
  background: linear-gradient(180deg, #35d8b6, #1aa588);
  border-color: #45e0c0; color: #04241f;
  box-shadow: 0 6px 18px rgba(26,165,136,.35);
}
.big.ghost { background: transparent; border-color: rgba(255,255,255,.16); color: #9fb3bd; font-size: 14px; }
.big:active { transform: scale(.985); }

.tips { margin: 14px 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.tips div { font-size: 11.5px; color: #8fa2ad; background: rgba(255,255,255,.04); border-radius: var(--r); padding: 6px 4px; }
.tips b { color: var(--gold); }
.tips span { display: block; margin-top: 2px; color: #6f838f; }
.best { margin-top: 12px; font-size: 12px; color: #8fa2ad; }
.best b { color: #fff; }
.back { display: inline-block; margin-top: 14px; font-size: 12.5px; color: #8fa2ad; text-decoration: none; }

.scores { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 6px 0 14px; }
.scores div { background: rgba(255,255,255,.05); border-radius: var(--r); padding: 10px 4px; }
.scores span { display: block; font-size: 11.5px; color: #9fb3bd; }
.scores b { font-size: 20px; color: #fff; }
.scores i { font-size: 11px; color: #9fb3bd; font-style: normal; }
.newbest { margin: 0 0 12px; color: var(--gold); font-weight: 800; animation: pop .3s ease-out; }

#rotate {
  position: absolute; inset: 0; z-index: 60; display: grid; place-items: center;
  background: #0b1220; color: #9fb3bd; font-size: 15px;
}

@media (max-height: 620px) {
  .panel { padding: 14px 12px; }
  .panel h1 { font-size: 19px; }
  .chars button { min-height: 80px; }
  .chars button canvas { width: 38px; height: 62px; }
  .tips { display: none; }
}
@media (orientation: landscape) and (max-height: 460px) {
  #rotate { display: grid !important; }
}
