/* 猫鼠大作战 — 界面样式 */
:root {
  --cream: #F7E7C8;
  --cream-2: #EFD9B4;
  --paper: #FFF8E9;
  --brown: #3A2418;
  --brown-2: #5C3B26;
  --tomato: #E4572E;
  --gold: #F2C14E;
  --ink: #2B1B12;
  --line: #E2C79A;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--ink); }
body {
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", system-ui, sans-serif;
  color: var(--brown);
  user-select: none;
  touch-action: manipulation;
  -webkit-font-smoothing: antialiased;
}
#app { position: fixed; inset: 0; overflow: hidden; }
#game { position: absolute; inset: 0; display: block; touch-action: none; }
.hidden { display: none !important; }
button { font-family: inherit; }

/* ---------------- 通用按钮 ---------------- */
.btn {
  border: 0; cursor: pointer; font-weight: 900; border-radius: 999px;
  transition: transform .12s ease, filter .12s ease, box-shadow .12s ease;
  color: #FFF6E4; letter-spacing: .12em;
}
.btn.primary {
  background: linear-gradient(#F4703F, #D8431D);
  padding: 14px 54px; font-size: 20px;
  border: 3px solid #7A2A12;
  box-shadow: 0 6px 0 #8E3218, 0 14px 26px rgba(228, 87, 46, .35);
}
.btn.primary:hover { filter: brightness(1.06); transform: translateY(-2px); box-shadow: 0 8px 0 #8E3218, 0 18px 30px rgba(228, 87, 46, .4); }
.btn.primary:active { transform: translateY(4px); box-shadow: 0 2px 0 #8E3218; }
.btn.ghost {
  background: rgba(58, 36, 24, .08); color: var(--brown);
  border: 2px solid rgba(58, 36, 24, .28);
  padding: 11px 26px; font-size: 14px; letter-spacing: .08em;
}
.btn.ghost:hover { background: rgba(58, 36, 24, .14); }

/* ---------------- 标题页 ---------------- */
.overlay {
  position: absolute; inset: 0; z-index: 20;
  display: flex; align-items: center; justify-content: center;
}
#title {
  flex-direction: column; background: var(--cream);
  overflow-y: auto; overscroll-behavior: none;
}
.hero {
  position: relative; flex: 0 0 clamp(190px, 34vh, 340px);
  width: 100%; overflow: hidden; background: #FAEBCB;
}
.hero picture, .hero img { display: block; width: 100%; height: 100%; }
.hero img { object-fit: cover; object-position: center 50%; }
.hero-shade {
  position: absolute; inset: 0;
  background: linear-gradient(180deg,
    rgba(43, 27, 18, .16) 0%,
    rgba(43, 27, 18, 0) 20%,
    rgba(250, 235, 203, 0) 86%,
    rgba(250, 235, 203, .8) 96%,
    #FAEBCB 100%);
}
.hero-top {
  position: absolute; inset: 0;
  box-shadow: inset 0 0 100px rgba(43, 27, 18, .45);
  background: radial-gradient(120% 80% at 50% 0%, transparent 40%, rgba(20, 12, 8, .25) 100%);
}
.title-inner {
  position: relative; z-index: 2; margin-top: -14px;
  flex: 1; width: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 13px; padding: 0 20px 18px;
}
.tips { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.tips span {
  font-size: 11px; color: #7C5638; background: #F2E2C6;
  border-radius: 999px; padding: 4px 12px; letter-spacing: .02em;
}
.tips b { color: var(--brown); margin-right: 4px; }
.brand { text-align: center; }
.logo {
  font-size: clamp(40px, 6.4vw, 70px); font-weight: 900; line-height: 1.02;
  letter-spacing: .05em; color: var(--brown);
  text-shadow: 0 2px 0 #FFF8E9, 0 5px 0 rgba(242, 193, 78, .55), 0 14px 24px rgba(58, 36, 24, .28);
  transform: rotate(-1.2deg);
}
.logo .hot { color: var(--tomato); }
.logo-en {
  margin-top: 4px; font-size: 10.5px; font-weight: 800;
  letter-spacing: .38em; color: #8A5A3A;
}
.tagline { margin: 8px 0 0; font-size: 13.5px; color: #6B4A32; letter-spacing: .06em; }

.char-grid {
  width: min(1020px, 100%);
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px;
  max-height: 316px; overflow-y: auto; align-content: start;
  padding: 4px 8px 6px 4px; scrollbar-width: thin;
}
.char-grid::-webkit-scrollbar { width: 8px; }
.char-grid::-webkit-scrollbar-thumb { background: #D9BE96; border-radius: 4px; }
.char-grid::-webkit-scrollbar-track { background: transparent; }
.char-card {
  background: var(--paper);
  border: 3px solid var(--line);
  border-radius: 18px;
  padding: 10px 8px 9px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  cursor: pointer; position: relative;
  box-shadow: 0 5px 0 rgba(58, 36, 24, .12);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.char-card:hover { transform: translateY(-3px); box-shadow: 0 8px 0 rgba(58, 36, 24, .12); }
.char-card.sel {
  border-color: var(--tomato);
  box-shadow: 0 8px 0 rgba(228, 87, 46, .18), 0 0 0 4px rgba(242, 193, 78, .45);
  transform: translateY(-4px);
}
.char-card .portrait { width: 86px; height: 86px; display: block; object-fit: contain; }
.c-body { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 0; }
.c-name { font-size: 16px; font-weight: 900; letter-spacing: .04em; }
.c-title { font-size: 10.5px; color: #8A6A52; }
.c-perk {
  margin-top: 4px; font-size: 10px; font-weight: 700;
  color: #7C5638; background: #F2E2C6; border-radius: 999px; padding: 2px 8px;
  white-space: nowrap;
}
.c-weapon { font-size: 10px; color: #9B7B5F; }
.char-card .pick {
  position: absolute; top: 6px; right: 6px; width: 18px; height: 18px;
  border-radius: 50%; background: var(--tomato); color: #fff;
  font-size: 11px; display: none; place-items: center; font-weight: 900;
}
.char-card.sel .pick { display: grid; }

.title-actions { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.meta { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.best { font-size: 12px; color: #7C5638; letter-spacing: .06em; }
.best b { color: var(--tomato); font-size: 15px; }
.hint { font-size: 11px; color: #9B7B5F; text-align: center; }
.credit { font-size: 9.5px; color: rgba(90, 58, 38, .55); letter-spacing: .04em; }

/* ---------------- HUD ---------------- */
#hud { position: absolute; inset: 0; pointer-events: none; z-index: 10; touch-action: none; }
#hud.hidden { display: none; }
#xpWrap {
  position: absolute; top: 0; left: 0; right: 0; height: 6px;
  background: rgba(20, 10, 5, .55);
}
#xpFill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, #FFE08A, #F2A93B);
  box-shadow: 0 0 14px rgba(242, 193, 78, .85);
  transition: width .16s linear;
}
.hud-top {
  position: absolute; top: 14px; left: 14px; right: 14px;
  display: flex; align-items: flex-start; justify-content: space-between; gap: 10px;
}
.panel {
  display: flex; align-items: center; gap: 10px;
  background: rgba(35, 20, 12, .74);
  border: 2px solid rgba(247, 231, 200, .16);
  border-radius: 16px; padding: 7px 13px 7px 9px;
  color: var(--cream);
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 22px rgba(0, 0, 0, .28);
}
.avatar-wrap {
  position: relative; width: 52px; height: 52px; border-radius: 50%;
  border: 3px solid var(--gold); overflow: hidden; background: var(--cream); flex: none;
}
#avatar { width: 100%; height: 100%; display: block; object-fit: cover; object-position: 50% 16%; transform: scale(1.12); }
#lvlBadge {
  position: absolute; right: -7px; bottom: -7px;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--tomato); color: #FFF6E4; font-size: 11px; font-weight: 900;
  display: grid; place-items: center; border: 2px solid var(--cream);
}
.hp-panel { max-width: 56vw; }
.hp-col { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.hp-row { display: flex; justify-content: space-between; gap: 10px; font-size: 11px; font-weight: 800; letter-spacing: .02em; white-space: nowrap; }
#hpText { overflow: hidden; text-overflow: ellipsis; max-width: 110px; }
#pName { color: #FFE9C2; }
#hpText { color: rgba(247, 231, 200, .6); font-weight: 700; font-variant-numeric: tabular-nums; }
.hp-bar {
  position: relative; width: 190px; height: 13px; border-radius: 8px;
  background: #2A1710; border: 2px solid rgba(0, 0, 0, .4); overflow: hidden;
}
#hpFill {
  height: 100%; width: 100%;
  background: linear-gradient(180deg, #FF7B5E, #D93A1E);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .25);
  transition: width .12s linear;
}
#hpFill.low { background: linear-gradient(180deg, #FF4B3A, #A3160B); animation: pulse 0.9s infinite; }
@keyframes pulse { 50% { filter: brightness(1.35); } }
#shieldPips {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  display: flex; gap: 3px;
}
#shieldPips i {
  width: 7px; height: 7px; border-radius: 50%;
  background: #7FD1FF; box-shadow: 0 0 6px #7FD1FF;
}
.wave-panel {
  display: flex; flex-direction: column; align-items: center;
  color: var(--cream); text-shadow: 0 2px 0 rgba(0, 0, 0, .45);
  min-width: 92px; padding-top: 2px;
}
#waveLabel { font-size: 10.5px; font-weight: 800; letter-spacing: .22em; color: var(--gold); }
#timer { font-size: 24px; font-weight: 900; letter-spacing: .06em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.score-panel { flex-direction: column; align-items: flex-end; gap: 0; padding: 6px 14px; }
.kills { font-size: 10.5px; color: #D9BE9B; letter-spacing: .08em; }
.kills b { color: #FFF3D8; font-size: 13px; }
.score { font-size: 20px; font-weight: 900; color: var(--gold); line-height: 1.15; font-variant-numeric: tabular-nums; }

#bossBar {
  position: absolute; top: 92px; left: 50%; transform: translateX(-50%);
  width: min(560px, 74vw); text-align: center; color: var(--cream);
}
.boss-name {
  display: inline-block; font-size: 13px; font-weight: 900; letter-spacing: .26em;
  padding: 3px 16px 3px 19px; margin-bottom: 6px;
  background: rgba(35, 20, 12, .8); border-radius: 999px;
  border: 2px solid rgba(242, 193, 78, .55);
  color: #FFE9B8; text-shadow: 0 2px 0 rgba(0, 0, 0, .5);
}
.boss-track {
  height: 10px; border-radius: 999px; overflow: hidden;
  background: rgba(20, 10, 5, .65); border: 2px solid rgba(247, 231, 200, .35);
}
#bossFill { height: 100%; width: 100%; background: linear-gradient(90deg, #FF5A3C, var(--gold)); transition: width .15s linear; }

#buffs {
  position: absolute; left: 14px; bottom: 26px;
  display: flex; flex-wrap: wrap; gap: 6px; max-width: 46vw;
}
.buff {
  position: relative; width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(35, 20, 12, .82); border: 2px solid rgba(247, 231, 200, .35);
  color: var(--cream); font-size: 13px; font-weight: 900;
}
.buff i {
  position: absolute; right: -4px; bottom: -4px;
  min-width: 15px; height: 15px; padding: 0 3px; border-radius: 999px;
  background: var(--gold); color: #4A2B12; font-style: normal;
  font-size: 9.5px; font-weight: 900; display: grid; place-items: center;
  border: 1.5px solid #3A2418;
}
#pauseBtn {
  position: absolute; right: 14px; top: 82px;
  width: 34px; height: 34px; border-radius: 50%;
  background: rgba(35, 20, 12, .72); border: 2px solid rgba(247, 231, 200, .3);
  color: var(--cream); font-size: 11px; letter-spacing: -1px;
  pointer-events: auto; cursor: pointer; backdrop-filter: blur(8px);
}
#pauseBtn:hover { background: rgba(35, 20, 12, .9); }

#dashBtn {
  position: absolute; right: 24px; bottom: 30px;
  width: 84px; height: 84px; border-radius: 50%;
  background: radial-gradient(circle at 34% 28%, #FFEFC2, var(--gold) 55%, #D9A321);
  border: 4px solid #6B4A2A; color: #4A2B12;
  font-size: 16px; font-weight: 900; letter-spacing: .06em;
  display: grid; place-items: center;
  pointer-events: auto; cursor: pointer; touch-action: none;
  box-shadow: 0 6px 0 #8A6A2B, 0 12px 26px rgba(0, 0, 0, .35);
  transition: transform .08s ease;
  overflow: hidden;
}
#dashBtn span { position: relative; z-index: 2; }
#dashBtn::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(rgba(25, 12, 5, .62) calc(var(--cd, 0) * 1turn), transparent 0);
  z-index: 1;
}
#dashBtn.pressed { transform: translateY(4px) scale(.98); }

#joy {
  position: fixed; width: 124px; height: 124px; margin: -62px 0 0 -62px;
  border-radius: 50%; display: none; pointer-events: none; z-index: 12;
  background: rgba(35, 20, 12, .22);
  border: 2px solid rgba(247, 231, 200, .38);
  backdrop-filter: blur(2px);
}
#joy.on { display: block; }
#joyKnob {
  position: absolute; left: 50%; top: 50%;
  width: 56px; height: 56px; margin: -28px 0 0 -28px; border-radius: 50%;
  background: radial-gradient(circle at 34% 28%, #FFF9EA, var(--gold));
  border: 3px solid #6B4A2A;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .42);
  transform: translate(-50%, -50%);
}

#toast {
  position: absolute; top: 150px; left: 50%;
  transform: translate(-50%, -12px);
  background: rgba(35, 20, 12, .86); color: var(--cream);
  padding: 8px 24px; border-radius: 999px;
  border: 2px solid rgba(242, 193, 78, .5);
  font-size: 14px; font-weight: 900; letter-spacing: .12em;
  opacity: 0; transition: opacity .25s ease, transform .25s ease;
  pointer-events: none; white-space: nowrap;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------------- 升级 ---------------- */
#levelup { background: rgba(25, 14, 8, .62); backdrop-filter: blur(7px); }
#pause, #over { background: rgba(25, 14, 8, .55); backdrop-filter: blur(5px); }
.lu-box { width: min(900px, 94vw); text-align: center; }
.lu-head { color: var(--cream); margin-bottom: 18px; }
.lu-tag {
  display: inline-block; font-size: 10px; font-weight: 900; letter-spacing: .42em;
  color: var(--gold); border: 2px solid rgba(242, 193, 78, .55);
  border-radius: 999px; padding: 3px 14px 3px 18px; margin-bottom: 8px;
}
.lu-head h2 { margin: 0; font-size: 30px; letter-spacing: .12em; text-shadow: 0 3px 0 rgba(0, 0, 0, .35); }
.lu-sub { margin-top: 4px; font-size: 12px; color: rgba(247, 231, 200, .7); }
.lu-sub b { color: var(--gold); }
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.up-card {
  position: relative; text-align: center; cursor: pointer;
  background: var(--paper); color: var(--brown);
  border: 3px solid var(--line); border-radius: 20px;
  padding: 18px 14px 14px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  box-shadow: 0 8px 0 rgba(20, 12, 8, .35);
  transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease;
  animation: cardIn .28s cubic-bezier(.2, .9, .3, 1.4) both;
  font-family: inherit;
}
@keyframes cardIn { from { opacity: 0; transform: translateY(16px) scale(.96); } }
.up-card:hover { transform: translateY(-7px); box-shadow: 0 15px 0 rgba(20, 12, 8, .32); }
.up-card:active { transform: translateY(2px); box-shadow: 0 3px 0 rgba(20, 12, 8, .35); }
.up-icon {
  width: 58px; height: 58px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 25px; font-weight: 900;
  background: #E8DCC6; color: #6B5540;
  border: 3px solid rgba(58, 36, 24, .18);
}
.up-rarity { font-size: 9.5px; font-weight: 900; letter-spacing: .2em; color: #9B7B5F; }
.up-name { font-size: 20px; font-weight: 900; letter-spacing: .04em; }
.up-desc { font-size: 12.5px; line-height: 1.5; color: #6B4A32; min-height: 38px; white-space: pre-line; }
.up-stack { font-size: 10.5px; color: #A9876A; letter-spacing: .08em; }
.up-card.r-rare { border-color: #7FB3DE; }
.up-card.r-rare .up-icon { background: #D6E9F8; color: #2D6E9E; border-color: #9CC8E8; }
.up-card.r-rare .up-rarity { color: #2D6E9E; }
.up-card.r-epic { border-color: #C08BE8; }
.up-card.r-epic .up-icon { background: #EEDFFA; color: #7A3EA8; border-color: #D2ADE8; }
.up-card.r-epic .up-rarity { color: #7A3EA8; }
.up-card.r-epic::before {
  content: ""; position: absolute; inset: -3px; border-radius: 20px;
  box-shadow: 0 0 26px rgba(176, 107, 224, .5); pointer-events: none;
}

/* ---------------- 弹窗 ---------------- */
.modal {
  width: min(430px, 90vw); text-align: center;
  background: var(--paper); border: 4px solid var(--brown);
  border-radius: 26px; padding: 26px 26px 22px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .5), inset 0 4px 0 rgba(255, 255, 255, .6);
}
.modal h2 { margin: 6px 0 6px; font-size: 28px; letter-spacing: .08em; }
.muted { font-size: 12px; color: #9B7B5F; margin: 0 0 14px; line-height: 1.6; }
.modal-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; align-items: center; }
.modal-actions .btn.primary { padding: 12px 42px; font-size: 17px; }
#pauseStats { font-variant-numeric: tabular-nums; }
.over-tag { font-size: 9.5px; font-weight: 900; letter-spacing: .34em; color: #B08A6A; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 14px 0 4px; }
.stat {
  background: #F3E3C8; border-radius: 12px; padding: 8px 6px;
  display: flex; flex-direction: column; gap: 1px;
}
.stat span { font-size: 10px; color: #9B7B5F; letter-spacing: .12em; }
.stat b { font-size: 19px; color: var(--brown); font-variant-numeric: tabular-nums; }
.stat.wide { grid-column: span 2; }
.stat.wide b { color: var(--tomato); font-size: 24px; }

/* ---------------- 响应式 ---------------- */
@media (max-width: 760px) {
  .hero { flex-basis: 27vh; min-height: 165px; }
  .hero-shade {
    background: linear-gradient(180deg,
      rgba(43, 27, 18, .14) 0%,
      rgba(43, 27, 18, 0) 18%,
      rgba(250, 235, 203, 0) 78%,
      rgba(250, 235, 203, .85) 94%,
      #FAEBCB 100%);
  }
  .title-inner { margin-top: -8px; gap: 9px; padding: 0 14px 12px; }
  .logo { font-size: clamp(34px, 10vw, 48px); }
  .logo-en { font-size: 8.5px; letter-spacing: .26em; }
  .tagline { font-size: 11.5px; }
  .char-grid { grid-template-columns: repeat(2, 1fr); gap: 9px; max-height: 300px; }
  .char-card { padding: 8px 6px; border-radius: 15px; }
  .char-card .portrait { width: 60px; height: 60px; }
  .char-card:last-child:nth-child(odd) {
    grid-column: span 2; flex-direction: row; justify-content: center; gap: 16px; padding: 10px 18px;
  }
  .char-card:last-child:nth-child(odd) .c-body { align-items: flex-start; }
  .tips { display: none; }
  .c-name { font-size: 14px; }
  .c-title { font-size: 9.5px; }
  .c-perk { font-size: 9px; }
  .btn.primary { padding: 12px 40px; font-size: 18px; }
  .hint { font-size: 10px; }

  .hud-top { top: 9px; left: 9px; right: 9px; gap: 6px; }
  .panel { padding: 5px 9px 5px 6px; border-radius: 13px; gap: 8px; }
  .avatar-wrap { width: 42px; height: 42px; border-width: 2px; }
  #lvlBadge { width: 18px; height: 18px; font-size: 9.5px; right: -5px; bottom: -5px; }
  .hp-panel { max-width: 52vw; }
  .hp-bar { width: 96px; height: 11px; }
  .hp-row { font-size: 9.5px; gap: 6px; }
  #hpText { max-width: 64px; }
  #pName { max-width: 44px; overflow: hidden; text-overflow: ellipsis; }
  #timer { font-size: 19px; }
  #waveLabel { font-size: 9px; letter-spacing: .16em; }
  .score { font-size: 16px; }
  .kills { font-size: 9px; }
  #pauseBtn { top: 74px; right: 10px; width: 30px; height: 30px; }
  #bossBar { top: 82px; }
  #toast { top: 132px; font-size: 12.5px; }
  #dashBtn { width: 72px; height: 72px; right: 16px; bottom: 24px; font-size: 14px; }
  #buffs { left: 10px; bottom: 12px; max-width: 52vw; }
  .buff { width: 29px; height: 29px; font-size: 11.5px; }
  .up-card { padding: 12px 10px; }
  .up-name { font-size: 17px; }
  .up-desc { font-size: 11.5px; min-height: 0; }
  .cards { grid-template-columns: 1fr; gap: 9px; }
  .lu-box { max-height: 86vh; overflow-y: auto; padding: 4px; }
  .lu-head { margin-bottom: 10px; }
  .lu-head h2 { font-size: 22px; }
  .up-card { flex-direction: row; text-align: left; align-items: center; gap: 12px; padding: 10px 14px; }
  .up-icon { width: 44px; height: 44px; font-size: 19px; flex: none; }
  .up-name { font-size: 16px; }
  .up-desc { flex: 1; font-size: 11px; }
  .up-stack { position: absolute; right: 12px; top: 10px; font-size: 9px; }
  .up-rarity { display: none; }
  .modal { padding: 22px 18px 18px; }
}
@media (pointer: coarse) {
  .hint { display: none; }
}
@media (max-height: 520px) and (orientation: landscape) {
  .hero { display: none; }
  .title-inner { margin-top: 12px; }
  .logo { font-size: 32px; }
}



/* ---------------- 模式选择 / 乱斗 ---------------- */
.mode-tabs { display: flex; gap: 10px; justify-content: center; }
.mode-tab {
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  padding: 8px 22px; border-radius: 14px; cursor: pointer;
  background: #F2E2C6; border: 3px solid transparent;
  color: var(--brown); transition: .15s; font-family: inherit;
  box-shadow: 0 3px 0 rgba(58, 36, 24, .1);
}
.mode-tab b { font-size: 14px; letter-spacing: .06em; }
.mode-tab span { font-size: 10px; color: #8A6A52; }
.mode-tab.sel {
  background: var(--paper); border-color: var(--tomato);
  box-shadow: 0 0 0 3px rgba(242, 193, 78, .35), 0 4px 0 rgba(58, 36, 24, .12);
  transform: translateY(-2px);
}

#board {
  position: absolute; right: 14px; top: 160px; width: 158px;
  display: flex; flex-direction: column; gap: 3px;
}
.b-row {
  display: flex; align-items: center; gap: 5px;
  background: rgba(35, 20, 12, .68); border: 1px solid rgba(247, 231, 200, .14);
  border-radius: 8px; padding: 3px 6px; color: #EAD9BE;
  font-size: 10px; font-weight: 700; letter-spacing: .02em;
  backdrop-filter: blur(6px);
}
.b-row.me { background: rgba(228, 87, 46, .8); color: #FFF3DC; border-color: rgba(242, 193, 78, .55); }
.b-row i { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.b-row b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 800; }
.b-row em { font-style: normal; color: var(--gold); font-weight: 900; }
.b-row.me em { color: #FFE9B8; }
.b-row u { text-decoration: none; font-size: 9px; opacity: .8; }
.b-row s { text-decoration: none; font-size: 9px; color: #C9A98A; }
.b-row.me s { color: #FFE3C2; }

#feed {
  position: absolute; top: 142px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  pointer-events: none; width: 60vw; max-width: 460px;
}
.feed-item {
  background: rgba(35, 20, 12, .8); border: 1px solid rgba(247, 231, 200, .18);
  border-radius: 999px; padding: 3px 12px;
  color: #EAD9BE; font-size: 10.5px; font-weight: 700; letter-spacing: .02em;
  animation: feedIn .22s ease both;
  white-space: nowrap;
}
.feed-item b { font-weight: 900; }
.feed-item .arrow { color: var(--gold); margin: 0 5px; }
.feed-item.out { opacity: 0; transition: opacity .4s; }
@keyframes feedIn { from { opacity: 0; transform: translateY(-6px); } }

#respawn {
  position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center;
  color: var(--cream); text-shadow: 0 3px 0 rgba(0, 0, 0, .45);
  pointer-events: none;
  background: rgba(25, 14, 8, .58); border-radius: 22px;
  border: 2px solid rgba(247, 231, 200, .22);
  padding: 14px 38px 16px; backdrop-filter: blur(5px);
}
#respawn b { font-size: 64px; font-weight: 900; color: var(--gold); line-height: 1; }
#respawn span { font-size: 13px; letter-spacing: .2em; margin-top: 4px; }

.rank-list { display: flex; flex-direction: column; gap: 4px; margin: 10px 0 6px; }
.rank-row {
  display: flex; align-items: center; gap: 7px;
  background: #F3E3C8; border-radius: 9px; padding: 5px 9px;
  font-size: 12px; font-weight: 700; color: var(--brown);
}
.rank-row.me { background: #F9D9C6; box-shadow: inset 0 0 0 2px rgba(228, 87, 46, .5); }
.rank-row span { width: 16px; text-align: center; color: #A9876A; font-weight: 900; }
.rank-row i { width: 8px; height: 8px; border-radius: 50%; }
.rank-row b { flex: 1; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-row em { font-style: normal; color: #C0392B; font-weight: 900; }

.up-card.k-weapon_up { border-color: #E8B33C; }
.up-card.k-weapon_up .up-icon { background: #FBEBC0; color: #8A5A12; border-color: #E8C877; }
.up-card.k-switch { border-color: #7FB3DE; }
.up-card.k-switch .up-icon { background: #D6E9F8; color: #2D6E9E; border-color: #9CC8E8; }

@media (max-width: 760px) {
  .mode-tab { padding: 6px 14px; }
  .mode-tab b { font-size: 12.5px; }
  .mode-tab span { font-size: 9px; }
  #board { width: 118px; right: 8px; top: 128px; }
  .b-row { font-size: 9px; padding: 2px 4px; }
  #feed { top: 118px; width: 76vw; }
  #respawn b { font-size: 52px; }
}

/* ---------------- 阵营切换 ---------------- */
.faction-tabs {
  display: inline-flex; gap: 4px; padding: 3px;
  background: #F2E2C6; border-radius: 999px;
  box-shadow: inset 0 2px 4px rgba(58, 36, 24, .08);
}
.faction-tab {
  border: 0; background: transparent; cursor: pointer;
  font-family: inherit; font-size: 12px; font-weight: 800;
  color: #8A6A52; letter-spacing: .06em;
  padding: 5px 18px; border-radius: 999px; transition: .15s;
}
.faction-tab.sel {
  background: var(--paper); color: var(--brown);
  box-shadow: 0 2px 0 rgba(58, 36, 24, .14);
}
.faction-tab[data-faction="cat"].sel { color: #7A3EA8; }
@media (max-width: 760px) {
  .faction-tab { padding: 4px 14px; font-size: 11px; }
}

#dashBtn {
  background-size: 52% !important;
  background-position: center 30% !important;
  background-repeat: no-repeat !important;
  display: flex; align-items: flex-end; justify-content: center;
  padding-bottom: 15px;
}
#dashBtn span {
  position: static; display: block; width: 100%;
  text-align: center; font-size: 9.5px; line-height: 1;
  letter-spacing: .02em; white-space: nowrap;
  text-shadow: 0 1px 2px rgba(58,36,24,.65);
  color: #FFF6E0; z-index: 2;
}
#dashBtn::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit;
  background: linear-gradient(180deg, rgba(255,246,224,.55), rgba(255,246,224,0) 45%, rgba(58,36,24,.45));
  z-index: 1;
}

/* ---------------- 角色详情 ---------------- */
.cm-overlay {
  position: fixed; inset: 0; z-index: 60; display: none;
  align-items: center; justify-content: center;
  background: rgba(43, 27, 18, .55); backdrop-filter: blur(3px);
  padding: 16px;
}
.cm-overlay.on { display: flex; }
.cm-card {
  position: relative; width: min(520px, 100%); max-height: 88vh; overflow: auto;
  background: #FFF8E7; border: 3px solid #3A2418; border-radius: 22px;
  box-shadow: 0 6px 0 #B8905F, 0 24px 48px rgba(0,0,0,.35);
  padding: 18px 20px 20px;
}
.cm-close {
  position: absolute; right: 10px; top: 8px; width: 34px; height: 34px;
  border: 0; border-radius: 50%; background: #F2E2C6; color: #6B4A33;
  font-size: 22px; line-height: 1; cursor: pointer; font-weight: 800;
}
.cm-head { display: flex; gap: 14px; align-items: center; }
#cmPortrait {
  width: 108px; height: 108px; border-radius: 18px; object-fit: cover;
  border: 3px solid #3A2418; background: #F2E2C6; flex: none;
}
.cm-title #cmName { font-size: 22px; font-weight: 900; color: #3A2418; letter-spacing: .04em; }
.cm-title #cmSub { font-size: 12px; color: #8A6A52; margin-top: 2px; }
.cm-tags { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.cm-tags span {
  font-size: 11px; font-weight: 800; color: #7A4A2E;
  background: #F2E2C6; border-radius: 999px; padding: 3px 10px;
}
.cm-desc { font-size: 12px; line-height: 1.6; color: #6B4A33; margin: 10px 0 8px; }
.cm-bars { display: grid; gap: 7px; margin-bottom: 14px; }
.cm-bar { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #8A6A52; }
.cm-bar span { width: 30px; flex: none; }
.cm-bar i { flex: 1; height: 10px; background: #EADBC2; border-radius: 999px; overflow: hidden; }
.cm-bar i b { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #E4572E, #F2A03D); }
.cm-bar em { width: 44px; text-align: right; font-style: normal; font-weight: 800; color: #3A2418; }
.cm-kits { display: grid; gap: 8px; }
.cm-kit {
  display: flex; gap: 10px; align-items: center;
  background: #F7EBD6; border: 2px solid #E3CBA8; border-radius: 14px; padding: 8px 10px;
}
.cm-kit img { width: 36px; height: 36px; border-radius: 10px; object-fit: contain; background: #FFF8E7; }
.cm-kit b { display: block; font-size: 14px; color: #3A2418; }
.cm-kit span { display: block; font-size: 11px; color: #8A6A52; margin-top: 2px; line-height: 1.4; }
@media (max-width: 560px) {
  #cmPortrait { width: 86px; height: 86px; }
  .cm-title #cmName { font-size: 22px; }
}

.c-info {
  position: absolute; right: 8px; bottom: 8px;
  border: 0; border-radius: 999px; padding: 3px 9px;
  background: #3A2418; color: #FFF6E0; font-size: 10px; font-weight: 800;
  cursor: pointer; opacity: 0; transition: .15s; font-family: inherit;
}
.char-card:hover .c-info, .char-card.sel .c-info { opacity: 1; }
@media (hover: none) { .c-info { opacity: 1; } }

.cm-talent {
  font-size: 12px; line-height: 1.5; color: #7A4A2E;
  background: #FFF1D6; border: 2px dashed #E3CBA8; border-radius: 12px;
  padding: 8px 10px; margin: 0 0 12px;
}

.up-icon-img { width: 36px; height: 36px; object-fit: contain; display: block; }

.item-btn {
  position: fixed; right: 18px; bottom: 176px; z-index: 20;
  width: 54px; height: 54px; border-radius: 50%;
  border: 3px solid #3A2418; background: linear-gradient(180deg, #FFF6E0, #F2C14E);
  color: #3A2418; font: 800 20px/1 "Microsoft YaHei", sans-serif;
  display: none; align-items: center; justify-content: center;
  box-shadow: 0 4px 0 #B8905F, 0 8px 18px rgba(0,0,0,.25); cursor: pointer;
}

.cov-panel { display: flex; flex-direction: column; align-items: center; gap: 6px; margin: 4px 0 6px; }
.cov-head { font-size: 12px; font-weight: 800; color: #7A4A2E; letter-spacing: .04em; }
.cov-head span { font-weight: 600; color: #A98A6C; margin-left: 6px; }
.cov-list { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.cov { border: 2px solid #E3CBA8; background: #FFF8E7; color: #8A6A52; border-radius: 999px; padding: 4px 12px; font-size: 11px; font-weight: 800; cursor: pointer; font-family: inherit; }
.cov.on { background: #3A2418; color: #FFF6E0; border-color: #3A2418; }

.c-elem {
  position: absolute; left: 8px; top: 8px; width: 22px; height: 22px;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 900; color: #FFF6E0; border: 2px solid #3A2418;
  background: #8A6A52; z-index: 2;
}
.el-fire { background: #E4572E; }
.el-ice { background: #4B7DA8; }
.el-thunder { background: #B06BE0; }
.el-light { background: #F2C14E; color: #3A2418; }
.el-dark { background: #4A4A55; }

.profile { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 12px; color: #8A6A52; font-weight: 700; margin: 2px 0 4px; flex-wrap: wrap; }
.profile .pb { width: 20px; height: 20px; border-radius: 50%; background: #F2E2C6; border: 2px solid #3A2418; display: flex; align-items: center; justify-content: center; font-size: 11px; }
.c-lv { position: absolute; left: 8px; bottom: 8px; font-size: 10px; font-weight: 900; color: #3A2418; background: #FFE9B8; border: 2px solid #3A2418; border-radius: 999px; padding: 1px 6px; z-index: 2; }

.elem-pick { position: fixed; inset: 0; z-index: 80; display: none; align-items: center; justify-content: center; background: rgba(43,27,18,.55); }
.elem-pick.on { display: flex; }
.ep-box { background: #FFF8E7; border: 3px solid #3A2418; border-radius: 18px; padding: 16px 18px; box-shadow: 0 6px 0 #B8905F; text-align: center; }
.ep-title { font-size: 14px; font-weight: 900; color: #3A2418; margin-bottom: 10px; }
.ep-list { display: flex; gap: 8px; }
.ep-btn { width: 44px; height: 44px; border-radius: 50%; border: 2px solid #3A2418; font-size: 16px; font-weight: 900; cursor: pointer; color: #FFF6E0; }
.ep-btn[data-el=fire] { background: #E4572E; }
.ep-btn[data-el=ice] { background: #4B7DA8; }
.ep-btn[data-el=thunder] { background: #B06BE0; }
.ep-btn[data-el=light] { background: #F2C14E; color: #3A2418; }
.ep-btn[data-el=dark] { background: #4A4A55; }

.up-card { animation: cardIn .22s ease-out both; }
@keyframes cardIn { from { opacity: 0; transform: translateY(14px) scale(.96); } to { opacity: 1; transform: none; } }

.rune-btn { border: 2px solid #3A2418; background: #F2E2C6; color: #3A2418; border-radius: 999px; font-size: 11px; font-weight: 900; padding: 3px 10px; cursor: pointer; font-family: inherit; }
.rune-modal { position: fixed; inset: 0; z-index: 70; display: none; align-items: center; justify-content: center; background: rgba(43,27,18,.55); }
.rune-modal.on { display: flex; }
.rm-box { width: min(420px, 92vw); background: #FFF8E7; border: 3px solid #3A2418; border-radius: 18px; padding: 14px; box-shadow: 0 6px 0 #B8905F; }
.rm-head { display: flex; align-items: center; justify-content: space-between; font-weight: 900; color: #3A2418; margin-bottom: 10px; }
.rm-head span { font-size: 11px; color: #8A6A52; font-weight: 700; }
.rm-close { border: 0; background: #F2E2C6; width: 28px; height: 28px; border-radius: 50%; font-size: 18px; cursor: pointer; }
.rm-row { display: flex; align-items: center; justify-content: space-between; padding: 7px 0; border-bottom: 1px dashed #E3CBA8; }
.rm-info b { display: block; color: #3A2418; font-size: 13px; }
.rm-info span { font-size: 11px; color: #8A6A52; }
.rm-ctl { display: flex; align-items: center; gap: 8px; }
.rm-ctl button { width: 26px; height: 26px; border-radius: 50%; border: 2px solid #3A2418; background: #F2E2C6; font-weight: 900; cursor: pointer; }
.rm-ctl em { font-style: normal; font-weight: 900; color: #3A2418; width: 14px; text-align: center; }
.rm-foot { text-align: center; margin-top: 10px; }
.rm-foot button { border: 2px solid #3A2418; background: #FFF6E0; border-radius: 999px; padding: 4px 14px; font-weight: 800; cursor: pointer; }


.guide-btn { margin-top: 6px; border: 2px solid #3A2418; background: #FFF6E0; color: #3A2418; border-radius: 999px; padding: 4px 14px; font-size: 11px; font-weight: 800; cursor: pointer; font-family: inherit; }
.guide-modal { position: fixed; inset: 0; z-index: 90; display: none; align-items: center; justify-content: center; background: rgba(43,27,18,.55); padding: 14px; }
.guide-modal.on { display: flex; }
.guide-box { width: min(560px, 100%); max-height: 86vh; background: #FFF8E7; border: 3px solid #3A2418; border-radius: 20px; box-shadow: 0 6px 0 #B8905F; display: flex; flex-direction: column; }
.guide-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; font-weight: 900; color: #3A2418; border-bottom: 2px solid #E3CBA8; }
.guide-close { border: 0; background: #F2E2C6; width: 30px; height: 30px; border-radius: 50%; font-size: 18px; cursor: pointer; }
.guide-body { overflow-y: auto; padding: 8px 16px 16px; }
.guide-body h4 { margin: 12px 0 4px; color: #B5482A; font-size: 14px; }
.guide-body ul { margin: 0; padding-left: 18px; }
.guide-body li { font-size: 12px; line-height: 1.7; color: #6B4A33; }


/* 移动端安全区 */
#hud { padding-top: env(safe-area-inset-top); padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); }
#pauseBtn { top: calc(74px + env(safe-area-inset-top)); }
#dashBtn { bottom: calc(24px + env(safe-area-inset-bottom)); }
#itemBtn { bottom: calc(176px + env(safe-area-inset-bottom)); }

.mission-hud { position: fixed; left: 12px; top: 104px; display: flex; flex-direction: column; gap: 4px; pointer-events: none; z-index: 20; width: max-content; max-width: 44vw; }
.mission-hud .m-row { white-space: nowrap; background: rgba(43,27,18,.72); border: 1px solid rgba(255,255,255,.14); border-radius: 8px; padding: 3px 8px; font-size: 11px; color: #FFE9C6; font-weight: 700; }
.mission-hud .m-row.done { color: #9CE8A8; text-decoration: line-through; opacity: .75; }

.lu-refresh { margin-top: 10px; border: 2px dashed #B8905F; background: #FFF6E0; color: #6B4A32; border-radius: 10px; padding: 8px 14px; font-size: 12px; font-weight: 800; cursor: pointer; font-family: inherit; }
.lu-refresh:hover { background: #FFE9C6; }

.rm-attr { margin-top: 10px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; font-size: 11px; color: #6B4A32; }
.rm-attr b { font-size: 12px; color: #B5482A; }
.rm-attr button { border: 2px solid #B8905F; background: #FFF6E0; border-radius: 8px; padding: 4px 8px; font-size: 11px; font-weight: 800; cursor: pointer; font-family: inherit; }

.title-tools { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin: 8px 0 2px; }

.rotate-hint { display: none; position: fixed; inset: 0; z-index: 200; background: #2B1B12; color: #FFF6E0; font-size: 22px; font-weight: 900; text-align: center; align-items: center; justify-content: center; flex-direction: column; gap: 10px; }
.rotate-hint span { font-size: 12px; font-weight: 600; opacity: .7; }
@media (orientation: portrait) and (pointer: coarse) { .rotate-hint { display: flex; } }

@media (orientation: landscape) and (max-height: 520px) {
  #title .title-inner { zoom: 0.58; }
  #title { padding: 2px 6px; overflow-y: auto; }
}
@media (orientation: landscape) and (max-height: 400px) {
  #title .title-inner { zoom: 0.48; }
}

@media (orientation: landscape) and (max-height: 520px) {
  #title { align-items: flex-start; justify-content: flex-start; padding-top: 4px; }
}

.save-text { width: 100%; box-sizing: border-box; height: 170px; font-family: monospace; font-size: 11px; border: 2px solid #B8905F; border-radius: 10px; padding: 8px; background: #FFFDF6; color: #3A2418; resize: vertical; }

@media (orientation: landscape) and (max-height: 520px) {
  #title .title-inner { zoom: 0.50; }
  .char-grid { max-height: 38vh; }
  #title { overflow: hidden; }
}
@media (orientation: landscape) and (max-height: 400px) {
  #title .title-inner { zoom: 0.42; }
}

@media (orientation: landscape) and (max-height: 560px) {
  #title { overflow: hidden !important; align-items: stretch; }
  #title .title-inner { display: flex; flex-direction: column; height: calc(100vh - 8px); max-height: calc(100vh - 8px); margin: 0; padding: 4px 10px 6px; gap: 4px; transform: none !important; zoom: 1 !important; width: 100% !important; box-sizing: border-box; }
  #title .title-inner > * { flex: 0 0 auto; }
  #title .char-grid { flex: 1 1 auto; min-height: 52px; max-height: none !important; overflow-y: auto; }
}

@media (orientation: landscape) and (max-height: 560px) {
  #title { justify-content: flex-start !important; align-items: stretch !important; }
  #title .title-inner { margin: 0 !important; }
  #title .logo, #title .logo-en { display: none !important; }
  #title .char-grid { min-height: 96px; }
}

@media (orientation: landscape) and (max-height: 560px) {
  #title .title-inner { justify-content: flex-start !important; align-content: flex-start !important; }
  #title .brand { flex: 0 0 auto; }
}

/* 全局弹性主页（不依赖媒体查询） */
#title { align-items: stretch !important; justify-content: flex-start !important; padding: 0 !important; overflow: hidden !important; }
#title .title-inner { display: flex !important; flex-direction: column !important; justify-content: flex-start !important; height: 100% !important; max-height: 100% !important; margin: 0 !important; padding: 6px 12px 8px !important; gap: 4px !important; box-sizing: border-box !important; transform: none !important; zoom: 1 !important; width: 100% !important; }
#title .title-inner > * { flex: 0 0 auto; }
#title .char-grid { flex: 1 1 auto !important; min-height: 80px !important; max-height: none !important; overflow-y: auto !important; }
@media (max-height: 700px) { #title .logo, #title .logo-en { display: none !important; } }

@media (max-height: 780px) { #title .brand { display: none !important; } }
@media (max-height: 640px) { #title .foot, #title .tips { display: none !important; } }

html, body { overflow: hidden !important; overscroll-behavior: none; }
#title { overflow: hidden !important; position: fixed !important; inset: 0 !important; touch-action: none; }
#title .char-grid { touch-action: pan-y; }

/* 主页：上下标签缩小，中间选角区放大，卡片变小且整体居中 */
#title .title-inner { justify-content: center !important; }
#title .char-grid { grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)) !important; gap: 8px !important; flex: 1 1 auto !important; max-height: 54vh !important; }
#title .char-card { padding: 6px 4px !important; border-radius: 12px !important; }
#title .char-card .portrait { width: 52px !important; height: 52px !important; }
#title .char-card .c-name { font-size: 12px !important; }
#title .char-card .c-title { font-size: 10px !important; }
#title .char-card .c-perk { font-size: 9px !important; }
#title .mode-tab { padding: 5px 12px !important; }
#title .mode-tab b { font-size: 12px !important; }
#title .mode-tab span { font-size: 9px !important; }
#title .guide-btn { font-size: 10px !important; padding: 2px 8px !important; }
#startBtn { font-size: 17px !important; padding: 8px 34px !important; }
#title .cov-list { transform: scale(.9); transform-origin: center; }

#title .title-tools { display: none !important; }
#setBtn { position: fixed; top: 10px; right: 12px; z-index: 40; border: 2px solid #3A2418; background: #FFF6E0; color: #3A2418; border-radius: 999px; padding: 3px 14px; font-size: 12px; font-weight: 800; cursor: pointer; font-family: inherit; display: none; }
.set-row { display: block; width: 100%; margin: 6px 0; border: 2px solid #B8905F; background: #FFF6E0; color: #3A2418; border-radius: 10px; padding: 10px 12px; font-size: 13px; font-weight: 800; cursor: pointer; font-family: inherit; text-align: left; }

#startBtn { font-size: 15px !important; padding: 6px 26px !important; }

/* 保留 j 版整体布局，应用最新的卡片细节 */
#title .c-info { position: static !important; width: 100% !important; margin: 4px 0 0 !important; padding: 3px 0 !important; text-align: center; opacity: 1 !important; }
#title .c-lv { position: static !important; margin: 2px 0 0 !important; }

/* 手机端：1.2.3 自适应布局 */
@media (pointer: coarse) {
  #title .hero { height: 12vh !important; min-height: 64px !important; }
  #title .brand { margin-top: -54px !important; position: relative; z-index: 3; }
  #title .title-inner { zoom: 0.5 !important; }
  #title .char-grid { max-height: 300px !important; }
  #title .char-card .portrait { width: 48px !important; height: 48px !important; }
  #title .char-card .c-title { display: block !important; }
  #title .char-card .c-perk { display: none !important; }
  #title .cov-title { display: none !important; }
  #title .mode-tab b { font-size: 13px !important; }
  #title .mode-tab span { display: none !important; }
  #title #startBtn { font-size: 14px !important; padding: 5px 22px !important; }
}

@media (pointer: coarse) {
  #title .hero { display: flex !important; }
  #title .brand { display: block !important; }
  #title .logo { display: block !important; }
}

#profile { display: flex !important; }

.map-modal { position: fixed; inset: 0; z-index: 120; display: none; align-items: center; justify-content: center; background: rgba(43,27,18,.55); padding: 16px; }
.map-modal.on { display: flex; }
.map-box { width: min(520px, 96vw); background: #FFF8E7; border: 3px solid #3A2418; border-radius: 20px; box-shadow: 0 6px 0 #B8905F; padding: 14px; }
.map-head { font-size: 16px; font-weight: 900; color: #3A2418; margin-bottom: 10px; text-align: center; }
.map-list { display: flex; flex-direction: column; gap: 10px; }
.map-card { text-align: left; border: 3px solid #3A2418; background: #F2E2C6; border-radius: 14px; padding: 12px 14px; cursor: pointer; font-family: inherit; }
.map-card b { display: block; font-size: 15px; color: #3A2418; }
.map-card span { font-size: 11px; color: #8A6A52; }
.map-card:hover { background: #FFE9C6; }
.map-cancel { margin-top: 10px; width: 100%; border: 0; background: transparent; color: #8A6A52; font-size: 12px; cursor: pointer; font-family: inherit; }

.up-card.k-evo_main { border-color: #E4A11B !important; box-shadow: 0 0 0 4px rgba(228,161,27,.28), 0 8px 0 rgba(58,36,24,.18) !important; background: linear-gradient(180deg, #FFF6DC, #FFEFC2) !important; }
.up-card.k-evo_main .up-rarity { color: #B4760F !important; }
.up-card.k-evo_sub { border-color: #4B7DA8 !important; box-shadow: 0 0 0 4px rgba(75,125,168,.25), 0 8px 0 rgba(58,36,24,.18) !important; background: linear-gradient(180deg, #EAF4FF, #D9E9FA) !important; }
.up-card.k-evo_sub .up-rarity { color: #3A6A96 !important; }


#title .c-sub { font-size: 10px; font-weight: 800; color: #B4760F; background: #FFF0CC; border-radius: 6px; padding: 1px 6px; }

#title .c-sub { display: none !important; }

/* ---- UI polish ---- */
.panel { background: linear-gradient(180deg, rgba(74,47,28,.92), rgba(44,26,15,.92)) !important; border: 2px solid rgba(228,161,27,.55) !important; box-shadow: 0 10px 24px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,240,200,.18) !important; }
.avatar-wrap { border: 3px solid #E4A11B !important; box-shadow: 0 0 0 2px rgba(58,36,24,.6), inset 0 0 0 2px rgba(255,246,224,.5) !important; }
.hp-bar { background: #22120A !important; border: 2px solid rgba(0,0,0,.5) !important; box-shadow: inset 0 2px 4px rgba(0,0,0,.6); }
#hpFill { background: linear-gradient(180deg, #FF9A6A, #E4572E 55%, #B93518) !important; box-shadow: inset 0 2px 0 rgba(255,255,255,.28), 0 0 10px rgba(228,87,46,.35) !important; }
.wave-panel { background: rgba(35,20,12,.55); border-radius: 14px; padding: 6px 14px 4px; }
#timer { text-shadow: 0 2px 0 rgba(0,0,0,.5), 0 0 14px rgba(255,211,77,.25); }
.score-panel .kills b { color: #FFD34D; text-shadow: 0 0 10px rgba(255,211,77,.3); }
.up-card { transition: transform .15s ease, box-shadow .15s ease; }
.up-card:hover { transform: translateY(-6px); }
.up-card .up-icon, .up-card .up-ico { box-shadow: 0 4px 10px rgba(0,0,0,.25), inset 0 0 0 2px rgba(255,246,224,.6); }
#pause .pm-box, #over .over-box, #over .panel { border: 3px solid #E4A11B !important; box-shadow: 0 12px 30px rgba(0,0,0,.4), inset 0 0 0 3px rgba(255,246,224,.35) !important; }

/* ---- results screen ---- */
#over .modal {
  background: linear-gradient(180deg, #FFF8E7 0%, #F6E7C4 100%) !important;
  border: 3px solid #3A2418 !important;
  border-radius: 22px !important;
  box-shadow: 0 16px 0 rgba(58,36,24,.18), 0 24px 60px rgba(0,0,0,.45) !important;
  padding: 26px 30px 22px !important;
  position: relative;
  overflow: hidden;
}
#over .modal::after {
  content: ''; position: absolute; inset: 8px; border: 2px dashed rgba(138,106,82,.35); border-radius: 16px; pointer-events: none;
}
.over-tag {
  display: inline-block; background: #3A2418; color: #FFD34D;
  font-size: 9.5px; letter-spacing: .34em; padding: 4px 12px; border-radius: 999px; margin-bottom: 10px;
}
#overTitle {
  font-size: 30px !important; color: #3A2418 !important; letter-spacing: .06em;
  text-shadow: 0 2px 0 #FFE9B8, 0 4px 0 rgba(58,36,24,.12);
  margin: 2px 0 14px !important;
}
#over .stats {
  display: grid !important; grid-template-columns: 1fr 1fr; gap: 10px !important;
  margin: 0 0 18px !important;
}
#over .stat {
  background: rgba(255,255,255,.55) !important;
  border: 2px solid rgba(138,106,82,.45) !important;
  border-radius: 12px !important;
  padding: 9px 12px !important;
  display: flex; flex-direction: column; gap: 2px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.7);
}
#over .stat span { font-size: 10.5px !important; color: #8A6A52 !important; letter-spacing: .08em; }
#over .stat b { font-size: 20px !important; color: #3A2418 !important; }
#over .stat.wide { grid-column: 1 / -1; background: linear-gradient(180deg,#FFEFC2,#FFE29A) !important; border-color: #E4A11B !important; }
#over .stat.wide b { font-size: 28px !important; color: #B4760F !important; }
#over .modal-actions { gap: 10px !important; }
#over .modal-actions .btn { min-width: 130px; }
.rank-list { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 4px; margin-bottom: 4px; }

#over .modal-actions { flex-direction: row !important; justify-content: center; flex-wrap: wrap; }
#over .modal { width: min(430px, 94vw) !important; }

#title .c-weapon { display: flex; align-items: center; gap: 3px; }
#title .c-wicon { width: 18px; height: 18px; object-fit: contain; }

#title .c-wicon { width: 12px !important; height: 12px !important; opacity: .9; }
@media (pointer: coarse) { #title .c-wicon { width: 10px !important; height: 10px !important; } }

#title .char-card .portrait {
  width: 78px !important; height: 78px !important;
  object-fit: contain !important;
  object-position: 50% 50% !important;
  transform: none;
  border-radius: 12px;
  background: #FFF6E0;
}

.credit-link { color: #B4760F; text-decoration: underline; }

#bossBar { display: flex; flex-direction: column; gap: 4px; }
.boss-row { display: flex; align-items: center; gap: 8px; }
.boss-row .boss-name { font-size: 11px; min-width: 74px; }
.boss-row .boss-track { flex: 1; height: 9px; }
.boss-row .boss-fill { height: 100%; background: linear-gradient(90deg,#FF5A3C,#FFD34D); border-radius: 999px; }

.codex-overlay { position: fixed; inset: 0; z-index: 130; display: none; align-items: center; justify-content: center; background: rgba(30,18,10,.6); padding: 14px; }
.codex-overlay.on { display: flex; }
.codex-box { width: min(920px, 96vw); max-height: 88vh; overflow: auto; background: #FFF8E7; border: 3px solid #3A2418; border-radius: 18px; padding: 14px 16px; }
.codex-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.codex-head b { font-size: 18px; color: #3A2418; }
.codex-head span { font-size: 11px; color: #8A6A52; }
.codex-close { margin-left: auto; border: 0; background: #3A2418; color: #FFE9B8; width: 26px; height: 26px; border-radius: 50%; cursor: pointer; }
.codex-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.cx-item { background: rgba(255,255,255,.6); border: 2px solid rgba(138,106,82,.4); border-radius: 12px; padding: 8px; display: grid; grid-template-columns: 34px 1fr; gap: 2px 8px; align-items: center; }
.cx-item img { width: 34px; height: 34px; object-fit: contain; grid-row: span 3; }
.cx-item b { font-size: 12px; color: #3A2418; }
.cx-item span { font-size: 9.5px; color: #B4760F; }
.cx-item em { font-size: 9.5px; color: #8A6A52; font-style: normal; }
@media (pointer: coarse) { .codex-grid { grid-template-columns: repeat(2, 1fr); } }

#buffs { display: none !important; }
.pause-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 18px; margin: 8px 0; text-align: left; }
.pg-row { display: flex; justify-content: space-between; font-size: 11px; border-bottom: 1px dashed rgba(138,106,82,.25); padding: 2px 0; }
.pg-row b { color: #B4760F; }
.pause-buffs { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; margin-top: 6px; }
@media (pointer: coarse) {
  .panel { padding: 4px 8px 4px 6px !important; border-radius: 12px !important; }
  .avatar-wrap { width: 38px !important; height: 38px !important; border-width: 2px !important; }
  #lvlBadge { width: 17px !important; height: 17px !important; font-size: 9px !important; }
  .hp-bar { width: 124px !important; height: 10px !important; }
  .hp-row { font-size: 9px !important; }
  #timer { font-size: 18px !important; }
  #waveLabel { font-size: 9px !important; }
  .score-panel .kills { font-size: 9px !important; }
  .up-card { width: 150px !important; padding: 10px 8px !important; }
  .up-card .up-name { font-size: 14px !important; }
  .up-card .up-desc { font-size: 10px !important; }
  .up-icon, .up-ico { width: 42px !important; height: 42px !important; }
}

#pause .modal { max-height: 88vh !important; overflow-y: auto !important; padding: 16px 18px !important; }
#pauseStats { margin: 6px 0 10px !important; }
.pause-grid { gap: 2px 14px !important; }
.pg-row { font-size: 10.5px !important; padding: 1px 0 !important; }
@media (pointer: coarse) {
  #pause .modal { width: min(360px, 94vw) !important; padding: 12px 14px !important; }
  #pause h2 { font-size: 18px !important; margin: 4px 0 6px !important; }
  .pause-grid { grid-template-columns: 1fr 1fr 1fr !important; gap: 2px 8px !important; }
  .pg-row { font-size: 9px !important; }
  .pg-row b { font-size: 9.5px !important; }
  #pause .modal-actions .btn { min-width: 100px !important; padding: 8px 12px !important; font-size: 12px !important; }
}

#cards { gap: 10px !important; justify-content: center !important; }
.up-card { max-width: 168px; }
.up-card .up-desc { white-space: pre-wrap; font-size: 10px; line-height: 1.35; }
@media (pointer: coarse) {
  #cards { gap: 8px !important; }
  .up-card { width: 150px !important; max-width: 30vw !important; }
  .up-card .up-desc { font-size: 9px !important; }
  #pause .modal-actions .btn { min-width: 76px !important; padding: 5px 8px !important; font-size: 10.5px !important; border-width: 2px !important; }
  #pause .modal-actions { gap: 6px !important; }
  .pause-grid { grid-template-columns: 1fr 1fr 1fr !important; gap: 3px 10px !important; }
  .pg-row { font-size: 10.5px !important; }
  .pg-row b { font-size: 11.5px !important; }
}

#cards { display: flex !important; flex-wrap: wrap !important; align-items: stretch !important; justify-content: center !important; gap: 10px !important; }
#cards .up-card, #cards .lu-refresh { flex: 0 0 168px !important; width: 168px !important; max-width: 168px !important; }
@media (pointer: coarse) {
  #cards .up-card, #cards .lu-refresh { flex: 0 0 150px !important; width: 150px !important; max-width: 150px !important; }
  .lu-refresh { font-size: 10px !important; min-height: 70px; display: flex; align-items: center; justify-content: center; }
}

#over .modal { width: min(362px, 92vw) !important; padding: 18px 20px 16px !important; }
#overTitle { font-size: 22px !important; margin: 0 0 8px !important; }
#over .stat b { font-size: 17px !important; }
#over .stat.wide b { font-size: 22px !important; }
#over .stat { padding: 6px 9px !important; }
#over .over-tag { font-size: 8.5px !important; padding: 3px 10px !important; }
@media (pointer: coarse) {
  #over .modal { width: min(330px, 92vw) !important; }
  #over .stats { gap: 6px !important; }
  #over .stat span { font-size: 9px !important; }
  #over .stat b { font-size: 15px !important; }
}

.boss-row { flex-direction: column !important; align-items: center !important; gap: 2px !important; padding: 2px 0 !important; }
.boss-row .boss-name { min-width: 0 !important; font-size: 10.5px !important; text-align: center !important; }
.boss-row .boss-track { width: 100% !important; height: 8px !important; }

.boss-row .boss-fill { background: #E4462E !important; }
.boss-row .boss-track { background: rgba(58,36,24,.35) !important; }

@keyframes overPop { 0% { transform: scale(.86) translateY(14px); opacity: 0; } 60% { transform: scale(1.02) translateY(0); opacity: 1; } 100% { transform: scale(1); opacity: 1; } }
#over:not(.hidden) .modal { animation: overPop .32s ease-out both; }
@keyframes overRow { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
#over:not(.hidden) .stat { animation: overRow .3s ease-out both; }
#over:not(.hidden) .stat:nth-child(2) { animation-delay: .04s; }
#over:not(.hidden) .stat:nth-child(3) { animation-delay: .08s; }
#over:not(.hidden) .stat:nth-child(4) { animation-delay: .12s; }
#over:not(.hidden) .stat:nth-child(5) { animation-delay: .16s; }
#over:not(.hidden) .stat:nth-child(6) { animation-delay: .2s; }

.boss-track { background: #2E1B10 !important; border: 2px solid #3A2418 !important; border-radius: 6px !important; overflow: hidden !important; height: 12px !important; }
.boss-row .boss-fill { background: #FF4B3A !important; box-shadow: inset 0 1px 0 rgba(255,255,255,.35) !important; }
.boss-row .boss-name { color: #3A2418 !important; font-weight: 700 !important; }
#bossBar { background: rgba(255,246,224,.9) !important; border: 2px solid #3A2418 !important; border-radius: 10px !important; padding: 4px 8px !important; }

.boss-row .boss-track { height: 12px !important; min-height: 12px !important; background: #2E1B10 !important; border: 2px solid #3A2418 !important; border-radius: 6px !important; overflow: hidden !important; }
.boss-row .boss-fill { height: 12px !important; min-height: 12px !important; background: #FF4B3A !important; border-radius: 0 !important; box-shadow: inset 0 1px 0 rgba(255,255,255,.35) !important; }

#bossBar { display: none !important; }

#splash { position: fixed; inset: 0; background: #000; z-index: 300; display: none; align-items: center; justify-content: center; opacity: 1; transition: opacity .6s ease; }
html.native #splash { display: flex; }
#splash.gone { opacity: 0; pointer-events: none; }
#splashBg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: blur(24px) brightness(0.5) saturate(1.1); transform: scale(1.12); }
#splashVid { position: relative; z-index: 1; width: 100%; height: 100%; object-fit: contain; background: transparent; }
#splashSkip { position: absolute; z-index: 3; background: transparent; border: 0; padding: 0; margin: 0; color: transparent; cursor: pointer; outline: none; }

/* 桌面主页微调：角色面板略大，底部文字下移 */
@media (min-width: 761px) {
  .title-inner { gap: 11px; padding-bottom: 8px; }
  .char-grid { max-height: 332px; gap: 11px; }
  .char-card { padding: 11px 9px 10px; }
  .char-card .portrait { width: 92px; height: 92px; }
  .profile { margin-top: 6px; }
}

@media (min-width: 761px) {
  .logo { font-size: clamp(36px, 5.2vw, 60px); }
  .logo-en { margin-top: 2px; }
  .tagline { margin-top: 5px; font-size: 12.5px; }
  .title-inner { gap: 9px; padding-bottom: 6px; }
  .char-grid { max-height: 360px; }
  .credit { font-size: 9px; }
}

.char-card .c-title, .char-card .c-perk { display: none; }
.char-card { gap: 1px; }


.set-note { margin-top: 10px; font-size: 11px; color: #8A6A52; text-align: center; }
@media (max-width: 760px) {
  .guide-box { max-height: 86vh; max-height: 86dvh; }
  .guide-body { min-height: 0; -webkit-overflow-scrolling: touch; }
  .guide-head { flex: 0 0 auto; }
  #pause .modal, #over .modal { max-height: 86vh; max-height: 86dvh; overflow-y: auto; }
  .lu-box { max-height: 86vh; max-height: 86dvh; }
  .set-row { padding: 9px 12px; font-size: 13px; }
}

#over .modal { position: relative; }
#over .modal-actions {
  position: sticky; bottom: -2px; z-index: 3;
  margin-top: 10px; padding: 10px 0 4px;
  background: linear-gradient(180deg, rgba(255,248,231,0), #FFF8E7 28%);
}
#pause .modal-actions { position: sticky; bottom: 0; background: #FFF8E7; padding-top: 8px; z-index: 3; }

.diff-tabs { display: flex; gap: 6px; justify-content: center; margin: 2px 0 0; }
.diff-tab { border: 2px solid #3A2418; background: #FFF6E0; color: #3A2418; border-radius: 999px; padding: 3px 16px; font-size: 11px; font-weight: 800; font-family: inherit; cursor: pointer; }
.diff-tab.sel { background: #E4572E; border-color: #B33B1E; color: #FFF6E0; }
.diff-tab[data-diff="hard"].sel { background: #7A3EA8; border-color: #55286F; }

#skillCdTxt { position: absolute; inset: 0; display: grid; place-items: center; z-index: 3; font-size: 20px; font-weight: 900; color: #FFF6E0; text-shadow: 0 2px 4px rgba(0,0,0,.6); pointer-events: none; }
#statusBar { position: absolute; right: 18px; bottom: 108px; display: flex; flex-direction: column; gap: 4px; align-items: flex-end; z-index: 12; pointer-events: none; }
.status-chip { background: rgba(42,23,16,.72); color: #FFF6E0; border: 1px solid rgba(255,230,190,.4); border-radius: 999px; padding: 2px 8px; font-size: 10px; font-weight: 800; }
.status-chip b { color: #FFD34D; margin-left: 4px; }
.cm-sig { margin-top: 10px; padding: 8px 10px; border: 2px dashed #E3CBA8; border-radius: 12px; background: #FFF1D6; font-size: 12px; line-height: 1.55; color: #7A4A2E; }
.cm-sig b { color: #B5482A; }
#trainBar { position: absolute; top: 52px; left: 50%; transform: translateX(-50%); z-index: 40; display: flex; gap: 6px; align-items: center; background: rgba(42,23,16,.82); border: 2px solid #E4A11B; border-radius: 999px; padding: 5px 10px; }
#trainBar.hidden { display: none; }
#trainBar button { border: 0; border-radius: 999px; padding: 3px 9px; font-size: 10px; font-weight: 800; background: #FFF6E0; color: #3A2418; cursor: pointer; font-family: inherit; }
#trainBar span { color: #FFD34D; font-size: 10px; font-weight: 800; }

.train-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; margin-top: 8px; }
.train-pick { border: 2px solid #E3CBA8; background: #FFF6E0; color: #3A2418; border-radius: 10px; padding: 7px 8px; font-family: inherit; font-size: 12px; font-weight: 800; text-align: left; cursor: pointer; }
.train-pick span { display: block; font-size: 10px; font-weight: 400; color: #8A6A52; margin-top: 2px; }
.train-slots { display: flex; gap: 6px; margin-bottom: 8px; }
.train-slot { flex: 1; border: 2px solid #E3CBA8; background: #FFF6E0; color: #3A2418; border-radius: 10px; padding: 6px; font-family: inherit; font-weight: 800; }
.train-slot.on { background: #E4572E; color: #FFF6E0; border-color: #B33B1E; }
#trainBar { flex-wrap: wrap; max-width: 94vw; justify-content: center; }
#trainBar button { min-height: 24px; }

@media (max-width: 760px) {
  #title .title-inner { padding-left: 10px; padding-right: 10px; gap: 9px; }
  #title .char-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 10px !important; padding: 4px 4px 10px; }
  #title .char-card { padding: 10px 8px 9px !important; border-radius: 16px !important; }
  #title .char-card .portrait { width: 74px !important; height: 74px !important; }
  #title .char-card .c-name { font-size: 15px; }
  #title .char-card .c-weapon { font-size: 9.5px; }
  #title .char-card .c-info { opacity: 1; bottom: 6px; right: 6px; font-size: 9px; padding: 2px 7px; }
  .mode-tabs { width: 100%; }
  .mode-tab { flex: 1; padding: 8px 8px; border-radius: 14px; }
  .mode-tab b { font-size: 14px; }
  .mode-tab span { font-size: 9.5px; }
  .faction-tabs { margin-top: 4px; }
  .faction-tab { padding: 4px 14px; font-size: 11px; }
  .cov-panel { padding: 8px 8px 10px; width: 100%; }
  .cov-head { font-size: 11px; }
  .cov-list { gap: 6px !important; }
  .cov { min-height: 30px; padding: 4px 10px !important; font-size: 10.5px !important; }
  .title-actions { width: 100%; }
  #startBtn { width: min(280px, 82vw); padding: 12px 0; font-size: 17px; }
  .meta .best, .hint { font-size: 10.5px; }
  .credit { font-size: 8.5px; line-height: 1.5; }
  #trainBar { top: 46px; gap: 4px; padding: 4px 6px; max-width: 96vw; }
  #trainBar button { font-size: 9px; padding: 3px 6px; min-height: 20px; }
  #trainBar span { font-size: 9px; }
  #statusBar { right: 10px; bottom: 94px; gap: 3px; }
  .status-chip { font-size: 9px; padding: 1px 6px; }
  #dashBtn { width: 68px; height: 68px; }
  #skillCdTxt { font-size: 17px; }
  .cm-card { width: 94vw; max-height: 84vh; }
  #cmPortrait { width: 72px; height: 72px; }
  .cm-title #cmName { font-size: 20px; }
  .cm-desc { font-size: 11.5px; }
  .cm-kit img { width: 32px; height: 32px; }
  .guide-box { width: 94vw; }
  .train-grid { grid-template-columns: 1fr 1fr; }
  .train-pick { font-size: 11px; padding: 6px; }
}

.codex-box { width: min(1040px, 96vw); padding: 12px 14px; }
.codex-body { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.codex-group { background: rgba(255,255,255,.62); border: 2px solid rgba(138,106,82,.35); border-radius: 12px; padding: 8px 9px; }
.codex-gh { display: flex; align-items: baseline; gap: 6px; margin-bottom: 3px; }
.codex-gh b { font-size: 13px; color: #3A2418; }
.codex-gh i { font-size: 9px; color: #B4760F; font-style: normal; background: #FBEBC0; border-radius: 999px; padding: 1px 6px; }
.codex-gh em { margin-left: auto; font-size: 9px; color: #8A6A52; font-style: normal; }
.codex-group p { margin: 0 0 6px; font-size: 9.5px; line-height: 1.5; color: #8A6A52; }
.codex-chars { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 3px 6px; }
.codex-char { display: flex; align-items: center; gap: 5px; min-width: 0; }
.codex-char img { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; background: #F2E2C6; flex: none; }
.codex-char b { display: block; font-size: 10px; color: #3A2418; line-height: 1.2; }
.codex-char span { display: block; font-size: 8.5px; color: #8A6A52; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 760px) {
  .codex-body { grid-template-columns: 1fr; gap: 6px; }
  .codex-box { padding: 10px; max-height: 90vh; }
  .codex-chars { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .settings-grid { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 761px) { .settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; } }

#pause .modal {
  width: min(620px, 94vw) !important;
  max-height: 88vh !important;
  padding: 16px 20px 14px !important;
  overflow-y: auto !important;
}
#pause h2 { font-size: 22px !important; margin: 2px 0 8px !important; }
#pauseStats { margin: 4px 0 8px !important; }
.pause-grid { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; gap: 2px 18px !important; }
.pg-row { font-size: 11px !important; padding: 2px 0 !important; }
.pause-buffs { justify-content: flex-start !important; margin-top: 4px !important; }
#pause .modal-actions {
  flex-direction: row !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
  margin-top: 10px !important;
  padding: 10px 0 0 !important;
  border-top: 1px solid rgba(138,106,82,.35);
  background: transparent !important;
}
#pause .modal-actions .btn {
  flex: 1 1 0;
  min-width: 0 !important;
  padding: 8px 4px !important;
  font-size: 13px !important;
}
@media (max-width: 760px) {
  #pause .modal { width: 94vw !important; padding: 12px 14px !important; }
  #pause h2 { font-size: 19px !important; }
  .pause-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 2px 12px !important; }
  .pg-row { font-size: 10.5px !important; }
  #pause .modal-actions { gap: 6px !important; }
  #pause .modal-actions .btn { flex: 1 1 44%; font-size: 12px !important; padding: 8px 4px !important; }
}

#levelup .lu-box { width: min(920px, 94vw); }
#cards { display: flex !important; flex-wrap: wrap !important; align-items: stretch !important; justify-content: center !important; gap: 10px !important; }
#cards .up-card {
  flex: 1 1 0 !important;
  width: auto !important;
  max-width: none !important;
  min-width: 0 !important;
  flex-direction: row !important;
  align-items: flex-start !important;
  text-align: left !important;
  gap: 10px !important;
  padding: 12px !important;
}
#cards .up-card .up-icon { flex: none; width: 46px !important; height: 46px !important; font-size: 20px !important; }
#cards .up-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; align-items: flex-start; }
#cards .up-name { font-size: 14px !important; line-height: 1.25; }
#cards .up-desc { font-size: 10.5px !important; line-height: 1.42 !important; white-space: normal !important; min-height: 0 !important; }
#cards .up-stack { font-size: 9px !important; margin-top: 2px; }
#cards .lu-refresh { flex: 1 0 100% !important; width: auto !important; max-width: none !important; min-height: 34px; margin-top: 0 !important; }
@media (max-width: 760px) {
  #cards { flex-direction: column !important; flex-wrap: nowrap !important; gap: 7px !important; }
  #cards .up-card { flex: 0 0 auto !important; width: 100% !important; padding: 10px 11px !important; gap: 8px !important; }
  #cards .up-icon { width: 40px !important; height: 40px !important; font-size: 17px !important; }
  #cards .up-name { font-size: 13.5px !important; }
  #cards .up-desc { font-size: 10px !important; line-height: 1.35 !important; }
  #cards .lu-refresh { flex: 0 0 auto !important; }
}

#errBadge { position: fixed; left: 10px; bottom: 12px; z-index: 150; border: 2px solid #B5482A; background: #FFF3D8; color: #B5482A; border-radius: 999px; padding: 4px 10px; font: 800 10px/1.2 system-ui, sans-serif; cursor: pointer; box-shadow: 0 3px 8px rgba(0,0,0,.25); }
.err-actions { display: flex; gap: 6px; margin-bottom: 8px; }
.err-actions button { border: 2px solid #C9A87A; background: #FFF6E0; color: #3A2418; border-radius: 8px; padding: 5px 10px; font: 800 11px/1 system-ui, sans-serif; cursor: pointer; }
.err-pre { margin: 0; white-space: pre-wrap; word-break: break-word; font: 10px/1.45 Consolas, monospace; color: #5C3B26; max-height: 55vh; overflow: auto; background: #FFFDF6; border: 1px solid #E3CBA8; border-radius: 10px; padding: 8px; }

#splash { background: #1a1008; }
#splashPoster { position: absolute; inset: 0; background: url('../assets/brand/hero-wide.jpg') center/cover no-repeat; filter: brightness(.72) saturate(1.05); }
#splashVid { opacity: 0; transition: opacity .5s ease; }
#splashVid.playing { opacity: 1; }

#splashStart { display: none; position: absolute; z-index: 4; left: 50%; bottom: 14%; transform: translateX(-50%); padding: 12px 38px; border: 0; border-radius: 999px; background: #E4572E; color: #FFF6E0; font: 900 18px/1 system-ui, sans-serif; letter-spacing: .08em; box-shadow: 0 6px 0 #8E3218, 0 12px 26px rgba(0,0,0,.35); cursor: pointer; }
#splash.poster-mode #splashStart { display: block; }
#splash.poster-mode #splashSkip { display: none; }

.relic-overlay .relic-box { width: min(760px, 94vw); }
.relic-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.relic-card { border: 3px solid var(--rc, #B06BE0); background: linear-gradient(180deg, #FFF8E7, #F6E9CC); border-radius: 14px; padding: 12px 10px; text-align: left; cursor: pointer; font-family: inherit; color: #3A2418; }
.relic-card b { display: block; font-size: 15px; margin-bottom: 6px; }
.relic-pos { display: block; font-size: 11px; color: #2E7D4F; font-weight: 800; }
.relic-neg { display: block; font-size: 10px; color: #B33B4A; margin-top: 4px; }
.relic-tip { font-size: 10px; color: #8A6A52; text-align: center; margin: 8px 0 0; }
.pause-relics { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; margin-top: 6px; font-size: 10px; }
.pause-relics b { color: #8A6A52; }
.adv-card.locked { opacity: .45; }
@media (max-width: 760px) { .relic-grid { grid-template-columns: 1fr; } }

#splashVid, #splashVid2 { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; opacity: 0; transition: opacity .42s ease; }
#splashVid.on, #splashVid2.on { opacity: 1; }

.rune-modal { padding: 10px; }
.rm-box { width: min(560px, 96vw); max-height: 88dvh; display: flex; flex-direction: column; padding: 12px 14px; }
.rm-head { flex: 0 0 auto; }
.rm-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding-right: 4px; }
.rm-row { padding: 6px 0; }
.rm-ctl button { width: 34px; height: 34px; font-size: 16px; }
.rm-ctl em { width: 52px; font-size: 11px; }
.rm-foot { flex: 0 0 auto; padding-top: 8px; }
@media (max-width: 760px) {
  .rm-box { width: 96vw; max-height: 86dvh; }
  .rm-info span { font-size: 10px; }
  .rm-ctl { gap: 5px; }
}
