/* ============ DOTA1 内战积分系统 ============ */
:root {
  --bg:        #0a0908;
  --bg-2:      #120e0b;
  --panel:     #171210;
  --panel-2:   #1e1813;
  --line:      rgba(217, 163, 74, .16);
  --line-2:    rgba(217, 163, 74, .32);
  --gold:      #d9a34a;
  --gold-2:    #f2cb7d;
  --red:       #c8412b;
  --red-2:     #e8604a;
  --green:     #4fae7c;
  --blue:      #5b8fd6;
  --text:      #eee6d9;
  --muted:     #94897c;
  --dim:       #6a6055;
  --radius:    16px;
  --shadow:    0 10px 30px rgba(0, 0, 0, .55);
  --safe-b:    env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  min-height: 100vh;
  overflow-x: hidden;
  background-image:
    radial-gradient(900px 500px at 50% -260px, rgba(200, 65, 43, .22), transparent 70%),
    radial-gradient(700px 420px at 100% 0%, rgba(217, 163, 74, .07), transparent 60%),
    linear-gradient(180deg, #100c0a 0%, var(--bg) 42%);
  background-attachment: fixed;
}

#app {
  max-width: 620px;
  margin: 0 auto;
  padding: 0 14px calc(96px + var(--safe-b));
}

.boot { padding: 80px 0; text-align: center; color: var(--dim); letter-spacing: .2em; }

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 10px;
  padding: 14px 4px 12px;
  margin: 0 -14px 4px;
  padding-left: 18px; padding-right: 18px;
  background: linear-gradient(180deg, rgba(10,9,8,.96) 55%, rgba(10,9,8,.75) 100%);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(217,163,74,.10);
}
.brand { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.brand b {
  font-size: 16px; letter-spacing: .08em; font-weight: 800;
  background: linear-gradient(180deg, #f7dca4, var(--gold));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.brand span { font-size: 10px; letter-spacing: .34em; color: var(--dim); text-transform: uppercase; }
.topbar .spacer { flex: 1; }
.mepill {
  display: flex; align-items: center; gap: 8px;
  background: rgba(217,163,74,.08);
  border: 1px solid var(--line);
  border-radius: 999px; padding: 5px 12px 5px 6px; font-size: 13px;
}
.mepill .av { width: 22px; height: 22px; border-radius: 50%; background: linear-gradient(135deg, var(--gold), var(--red)); color: #1a1210; font-weight: 900; font-size: 11px; display: grid; place-items: center; }
.mepill b { color: var(--gold-2); font-variant-numeric: tabular-nums; }

/* ---------- 通用 ---------- */
.card {
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}
.card.flat { box-shadow: none; background: rgba(255,255,255,.02); }
.sec-title {
  display: flex; align-items: center; gap: 8px;
  margin: 20px 2px 10px; font-size: 12px; letter-spacing: .18em; color: var(--muted);
  text-transform: uppercase;
}
.sec-title::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--line-2), transparent); }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.mono { font-variant-numeric: tabular-nums; }
.center { text-align: center; }
.row { display: flex; align-items: center; gap: 10px; }
.grow { flex: 1; min-width: 0; }
.ell { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.btn {
  appearance: none; border: 1px solid var(--line-2);
  background: rgba(217,163,74,.07); color: var(--gold-2);
  font: inherit; font-weight: 600; font-size: 14px;
  padding: 10px 16px; border-radius: 12px; cursor: pointer;
  transition: transform .08s ease, filter .15s ease, background .15s ease;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; pointer-events: none; }
.btn.primary {
  background: linear-gradient(180deg, #e2ae55, #b9762b);
  border-color: #f0c774; color: #23160a; font-weight: 800;
  box-shadow: 0 6px 18px rgba(200,120,40,.28), inset 0 1px 0 rgba(255,255,255,.35);
}
.btn.danger { border-color: rgba(200,65,43,.5); color: var(--red-2); background: rgba(200,65,43,.10); }
.btn.ghost { background: transparent; border-color: rgba(255,255,255,.12); color: var(--muted); }
.btn.sm { padding: 6px 12px; font-size: 12.5px; border-radius: 10px; }
.btn.block { width: 100%; }
.btn-row { display: flex; gap: 8px; }
.btn-row > .btn { flex: 1; }

input, select, textarea {
  width: 100%; font: inherit; color: var(--text);
  background: rgba(0,0,0,.34); border: 1px solid rgba(255,255,255,.10);
  border-radius: 12px; padding: 11px 13px; outline: none;
  transition: border-color .15s ease, background .15s ease;
}
.row > input, .row > select, .row > label, .field.grow { min-width: 0; }
input[type="datetime-local"], input[type="date"], input[type="number"] { min-width: 0; }
input:focus, select:focus, textarea:focus { border-color: var(--line-2); background: rgba(0,0,0,.5); }
input::placeholder, textarea::placeholder { color: var(--dim); }
label.field { display: block; margin-bottom: 12px; }
label.field > span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; letter-spacing: .06em; }
textarea { resize: vertical; min-height: 72px; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }

.chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; padding: 3px 9px; border-radius: 999px;
  border: 1px solid var(--line); background: rgba(217,163,74,.07); color: var(--gold-2);
  letter-spacing: .03em; white-space: nowrap;
}
.chip.gray { border-color: rgba(255,255,255,.12); background: rgba(255,255,255,.04); color: var(--muted); }
.chip.red { border-color: rgba(200,65,43,.45); background: rgba(200,65,43,.12); color: #f08b76; }
.chip.green { border-color: rgba(79,174,124,.4); background: rgba(79,174,124,.12); color: #7fd0a4; }
.chip.blue { border-color: rgba(91,143,214,.4); background: rgba(91,143,214,.12); color: #8fb6e8; }
.chip > i.tx { font-style: normal; margin-left: 6px; cursor: pointer; opacity: .6; }

/* ---------- 首页英雄卡 ---------- */
.hero {
  position: relative; overflow: hidden;
  border-radius: 20px; padding: 20px;
  border: 1px solid rgba(217,163,74,.26);
  background:
    radial-gradient(420px 200px at 88% -30%, rgba(200,65,43,.45), transparent 70%),
    radial-gradient(320px 180px at 10% 120%, rgba(217,163,74,.18), transparent 70%),
    linear-gradient(160deg, #221913, #140f0c 70%);
  box-shadow: var(--shadow);
  margin-bottom: 14px;
}
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: repeating-linear-gradient(115deg, rgba(255,255,255,.035) 0 1px, transparent 1px 9px);
  opacity: .5; mix-blend-mode: overlay;
}
.hero .k { font-size: 11px; letter-spacing: .3em; color: rgba(217,163,74,.75); text-transform: uppercase; }
.hero .big {
  font-size: 46px; line-height: 1.05; font-weight: 900; letter-spacing: -.02em;
  font-variant-numeric: tabular-nums; margin: 6px 0 2px;
  background: linear-gradient(180deg, #fff3d6, var(--gold));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero .sub { font-size: 12.5px; color: var(--muted); }
.progress { height: 8px; border-radius: 99px; background: rgba(0,0,0,.45); overflow: hidden; margin-top: 14px; border: 1px solid rgba(255,255,255,.06); }
.progress > i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--red), var(--gold)); transition: width .5s cubic-bezier(.2,.8,.2,1); }
.hero .hint { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--dim); margin-top: 7px; }

/* ---------- 榜单 ---------- */
.podium { display: grid; grid-template-columns: 1fr 1.15fr 1fr; gap: 8px; align-items: end; margin-bottom: 4px; }
.podium .p {
  text-align: center; border-radius: 14px 14px 12px 12px; padding: 12px 6px 10px;
  background: linear-gradient(180deg, rgba(217,163,74,.12), rgba(217,163,74,.03));
  border: 1px solid var(--line);
  position: relative;
}
.podium .p.first { padding-top: 20px; background: linear-gradient(180deg, rgba(242,203,125,.24), rgba(217,163,74,.05)); border-color: rgba(242,203,125,.45); }
.podium .crown { font-size: 18px; line-height: 1; }
.podium .nm { font-size: 13px; font-weight: 700; margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.podium .pt { font-size: 18px; font-weight: 900; color: var(--gold-2); font-variant-numeric: tabular-nums; }
.podium .rk { font-size: 10px; letter-spacing: .2em; color: var(--dim); }

.rank-row {
  display: flex; align-items: center; gap: 11px;
  padding: 11px 12px; border-radius: 13px; margin-bottom: 6px;
  background: rgba(255,255,255,.022); border: 1px solid transparent;
}
.rank-row.me { background: rgba(217,163,74,.09); border-color: var(--line-2); }
.rank-row .no { width: 22px; text-align: center; font-size: 13px; font-weight: 800; color: var(--dim); font-variant-numeric: tabular-nums; }
.rank-row:nth-child(1) .no, .rank-row.top1 .no { color: var(--gold-2); }
.av-lg {
  width: 34px; height: 34px; border-radius: 11px; flex: none;
  display: grid; place-items: center; font-weight: 900; font-size: 14px; color: #1a1210;
  background: linear-gradient(135deg, #f2cb7d, #b9762b);
}
.rank-row .meta { font-size: 11px; color: var(--dim); display: flex; gap: 8px; margin-top: 1px; }
.rank-row .pts { font-weight: 900; font-size: 17px; color: var(--gold-2); font-variant-numeric: tabular-nums; }

/* ---------- 房间卡片 ---------- */
.room {
  display: block; width: 100%; text-align: left; cursor: pointer; font: inherit; color: inherit;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; margin-bottom: 10px; box-shadow: var(--shadow);
  transition: border-color .15s ease, transform .08s ease;
}
.room:active { transform: scale(.995); }
.room .head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.room .ttl { font-weight: 700; font-size: 15.5px; }
.room .time { font-size: 12.5px; color: var(--muted); }
.room .foot { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.team-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.team-box {
  border-radius: 12px; padding: 10px 11px; border: 1px solid rgba(91,143,214,.22); background: rgba(91,143,214,.07);
}
.team-box.b { border-color: rgba(200,65,43,.22); background: rgba(200,65,43,.07); }
.team-box .h { font-size: 10.5px; letter-spacing: .22em; color: var(--muted); margin-bottom: 6px; }
.team-box .pl { font-size: 13px; padding: 3px 0; display: flex; align-items: center; gap: 6px; }
.team-box .pl i { width: 5px; height: 5px; border-radius: 50%; background: var(--blue); flex: none; }
.team-box.b .pl i { background: var(--red-2); }
.team-box .pl.win { color: var(--gold-2); font-weight: 700; }

.pill-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.pill-list .who { font-size: 12.5px; padding: 4px 10px; border-radius: 999px; background: rgba(255,255,255,.045); border: 1px solid rgba(255,255,255,.07); }
.pill-list .who.me { border-color: var(--line-2); color: var(--gold-2); }

/* ---------- 弹窗 ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0,0,0,.68); backdrop-filter: blur(4px);
  display: flex; align-items: flex-end; justify-content: center;
  animation: fadein .18s ease;
}
@keyframes fadein { from { opacity: 0 } }
.sheet {
  width: 100%; max-width: 620px; max-height: 88vh; overflow-y: auto;
  background: linear-gradient(180deg, #1d1712, #14100d);
  border: 1px solid var(--line-2); border-bottom: none;
  border-radius: 22px 22px 0 0; padding: 18px 16px calc(22px + var(--safe-b));
  animation: slideup .26s cubic-bezier(.2,.85,.25,1);
  box-shadow: 0 -20px 60px rgba(0,0,0,.7);
}
@keyframes slideup { from { transform: translateY(24px); opacity: .4 } }
.sheet h3 { margin: 0 0 14px; font-size: 17px; letter-spacing: .02em; }
.sheet .grab { width: 38px; height: 4px; border-radius: 99px; background: rgba(255,255,255,.16); margin: -6px auto 12px; }

/* ---------- 提示 ---------- */
.toast-root { position: fixed; left: 0; right: 0; bottom: calc(88px + var(--safe-b)); z-index: 200; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast {
  max-width: 84%; padding: 9px 16px; border-radius: 999px; font-size: 13.5px;
  background: rgba(28, 22, 17, .96); border: 1px solid var(--line-2); color: var(--text);
  box-shadow: var(--shadow); animation: toastin .2s ease;
}
.toast.err { border-color: rgba(200,65,43,.6); color: #ffb3a2; }
.toast.ok { border-color: rgba(79,174,124,.55); color: #a7e3c1; }
@keyframes toastin { from { transform: translateY(8px); opacity: 0 } }

/* ---------- 底部导航 ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  display: flex; justify-content: center; gap: 2px;
  padding: 8px 10px calc(8px + var(--safe-b));
  background: linear-gradient(180deg, rgba(12,10,8,.86), rgba(10,9,8,.99) 60%);
  backdrop-filter: blur(16px);
  border-top: 1px solid rgba(217,163,74,.12);
}
.tabbar button {
  flex: 1; max-width: 120px; appearance: none; border: 0; background: none; cursor: pointer;
  font: inherit; font-size: 10.5px; letter-spacing: .1em; color: var(--dim);
  display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 4px 0;
  transition: color .15s ease;
}
.tabbar button svg { width: 21px; height: 21px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.tabbar button.on { color: var(--gold-2); }
.tabbar button.on svg { filter: drop-shadow(0 0 8px rgba(217,163,74,.45)); }
.tabbar .dot { position: absolute; margin-left: 16px; margin-top: -2px; width: 6px; height: 6px; border-radius: 50%; background: var(--red); }

/* ---------- 登录 ---------- */
.auth-wrap { padding-top: 9vh; }
.auth-logo { text-align: center; margin-bottom: 22px; }
.auth-logo .gem {
  width: 66px; height: 66px; margin: 0 auto 12px; border-radius: 20px;
  background: linear-gradient(150deg, rgba(242,203,125,.22), rgba(200,65,43,.16));
  border: 1px solid var(--line-2); display: grid; place-items: center;
  box-shadow: 0 0 40px rgba(217,163,74,.18);
}
.auth-logo .gem svg { width: 38px; height: 38px; }
.auth-logo h1 { font-size: 22px; margin: 0; letter-spacing: .12em; }
.auth-logo p { margin: 6px 0 0; font-size: 12.5px; color: var(--muted); }
.switcher { display: flex; background: rgba(0,0,0,.35); border-radius: 12px; padding: 3px; margin-bottom: 16px; border: 1px solid rgba(255,255,255,.06); }
.switcher button { flex: 1; appearance: none; border: 0; background: none; color: var(--muted); font: inherit; font-size: 13.5px; padding: 8px; border-radius: 9px; cursor: pointer; }
.switcher button.on { background: rgba(217,163,74,.14); color: var(--gold-2); font-weight: 700; }

/* ---------- 列表行 ---------- */
.rowline { display: flex; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px dashed rgba(255,255,255,.07); }
.rowline:last-child { border-bottom: 0; }
.rowline .t { font-size: 14px; }
.rowline .s { font-size: 11.5px; color: var(--dim); }
.delta.pos { color: var(--green); font-weight: 800; }
.delta.neg { color: var(--red-2); font-weight: 800; }

.empty { text-align: center; padding: 32px 16px; color: var(--dim); font-size: 13px; }
.empty .ic { font-size: 26px; opacity: .5; margin-bottom: 8px; }

.shot { width: 100%; border-radius: 12px; border: 1px solid var(--line); display: block; margin-top: 8px; background: #000; }
.uploader {
  border: 1.5px dashed rgba(217,163,74,.35); border-radius: 14px;
  padding: 22px; text-align: center; color: var(--muted); cursor: pointer;
  background: rgba(217,163,74,.04); font-size: 13px;
}
.uploader:active { background: rgba(217,163,74,.09); }
.uploader img { max-width: 100%; border-radius: 10px; }
.seg { display: flex; gap: 8px; }
.seg button {
  flex: 1; appearance: none; font: inherit; cursor: pointer; padding: 12px 8px; border-radius: 12px;
  border: 1px solid rgba(255,255,255,.10); background: rgba(0,0,0,.3); color: var(--muted); font-size: 13.5px;
}
.seg button.on { border-color: var(--line-2); background: rgba(217,163,74,.14); color: var(--gold-2); font-weight: 700; }
.seg.team button.on.a { border-color: rgba(91,143,214,.6); background: rgba(91,143,214,.16); color: #9fc2f0; }
.seg.team button.on.b { border-color: rgba(200,65,43,.6); background: rgba(200,65,43,.16); color: #f0917c; }

.tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 12px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button {
  appearance: none; border: 1px solid rgba(255,255,255,.09); background: rgba(255,255,255,.03);
  color: var(--muted); font: inherit; font-size: 12.5px; padding: 7px 13px; border-radius: 999px; cursor: pointer; white-space: nowrap;
}
.tabs button.on { border-color: var(--line-2); background: rgba(217,163,74,.13); color: var(--gold-2); font-weight: 700; }

.kv { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; font-size: 13.5px; border-bottom: 1px dashed rgba(255,255,255,.06); }
.kv:last-child { border-bottom: 0; }
.kv .v { color: var(--gold-2); font-weight: 700; }

.tip {
  font-size: 12px; color: var(--muted); line-height: 1.6;
  border-left: 2px solid rgba(217,163,74,.35); padding-left: 10px; margin: 10px 0 0;
}
.badge-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--red); display: inline-block; margin-right: 5px; vertical-align: middle; }
