:root {
  --bg0: #04104e;
  --bg: #02051f;
  --bg1: #010318;
  --card: #02052e;
  --card-border: rgba(80, 140, 180, 0.22);
  --tile: #0b2740;
  --tile-border: rgba(70, 150, 150, 0.28);
  --neon: #75f654;
  --mint: #75fcaf;
  --mint-dim: #5cca8d;
  --text: #f3f6fb;
  --muted: #8b93a7;
  --search: #1b1e3d;
  --search-ph: #a4a5b4;
  --danger: #ff5a6a;
  --gold: #ffc410;
  --warn: #ffb020;
  --line: rgba(255, 255, 255, 0.08);
  --shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
  --radius: 16px;
  --safe-top: env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { min-height: 100%; background: var(--bg); color: var(--text); color-scheme: dark;
  font-family: "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased; }
body {
  background: radial-gradient(1200px 700px at 50% -80px, #0a1a6a 0%, transparent 55%),
              linear-gradient(180deg, #05104c 0%, #02051f 32%, #010318 100%);
  background-attachment: fixed;
}
a { color: var(--mint); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img { max-width: 100%; display: block; }

.app { max-width: 430px; margin: 0 auto; min-height: 100vh; padding-bottom: 40px; position: relative; }
.boot { text-align: center; color: var(--muted); padding: 40vh 0; }

/* ----- home ----- */
.hero { text-align: center; padding: calc(18px + var(--safe-top)) 20px 8px; position: relative; }
.hero-tools { position: absolute; top: calc(10px + var(--safe-top)); right: 16px; display: flex; gap: 8px; }
.icon-btn {
  min-width: 52px; height: 30px; padding: 0 10px; border-radius: 16px; border: 1px solid rgba(255,255,255,0.16);
  background: rgba(8, 16, 48, 0.7); color: #d0d6e8; display: flex; align-items: center; justify-content: center;
  font-size: 12px; letter-spacing: 0.04em; white-space: nowrap;
}
.icon-btn.logout { color: #ff8a96; border-color: rgba(255,90,106,0.35); }
.logo-wrap {
  width: 132px; height: 132px; margin: 8px auto 14px; background: #fff; border-radius: 6px;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.08), 0 10px 30px rgba(0,0,0,0.35);
}
.logo-wrap img { width: 100%; height: 100%; object-fit: contain; }
.brand {
  font-size: 42px; font-weight: 700; letter-spacing: 0.08em;
  color: var(--mint); line-height: 1;
  text-shadow: 0 0 18px rgba(117, 252, 175, 0.45), 0 0 40px rgba(80, 200, 255, 0.18);
}
.sub { margin-top: 16px; font-size: 20px; font-weight: 500; letter-spacing: 0.18em; color: #f2f4f8; }

.season-card {
  margin: 28px 16px 18px; padding: 16px 18px; border-radius: 16px;
  background: rgba(2, 6, 40, 0.72); border: 1px solid rgba(80, 140, 200, 0.2);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.season-label { color: var(--mint-dim); font-size: 15px; }
.season-right { text-align: right; }
.season-team { font-size: 20px; font-weight: 650; }
.season-rank { color: var(--mint-dim); font-size: 14px; margin-top: 4px; }
.season-switch { margin-top: 6px; }
.season-switch select {
  background: transparent; border: 0; color: var(--muted); font-size: 12px; text-align: right;
  outline: none; max-width: 200px;
}
.season-note { margin: -6px 22px 12px; font-size: 11px; color: #6d7590; line-height: 1.4; }
.season-card .cal-link { color: var(--mint); font-size: 12px; display: inline-block; margin-top: 6px; }

.tiles {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; padding: 0 14px;
}
.tile {
  aspect-ratio: 1; border-radius: 16px; background: linear-gradient(180deg, #0e2e4a 0%, #0a243c 100%);
  border: 1px solid rgba(70, 160, 160, 0.22);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  color: #fff; box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}
.tile svg { width: 40px; height: 40px; fill: var(--neon); stroke: none; }
.tile .t-label { font-size: 12px; letter-spacing: 0.02em; }
.tile.auction-tile { outline: 1px solid rgba(117, 246, 84, 0.35); }
.tile:active { transform: scale(0.98); }

.search-bar {
  margin: 18px 16px 0; height: 46px; border-radius: 23px; background: var(--search);
  border: 1px solid rgba(255,255,255,0.05);
  display: flex; align-items: center; gap: 10px; padding: 0 16px; color: var(--search-ph); font-size: 16px;
}
.search-bar svg { width: 20px; height: 20px; stroke: var(--search-ph); fill: none; stroke-width: 2; }
.search-bar input {
  flex: 1; background: transparent; border: 0; outline: none; color: var(--text); font-size: 16px; min-width: 0;
}
.search-bar input::placeholder { color: var(--search-ph); }
.search-bar .btn {
  flex: 0 0 auto; height: 32px; padding: 0 12px; border-radius: 16px;
  font-size: 13px; white-space: nowrap; margin: 0;
}
.results-loading {
  color: var(--muted); text-align: center; padding: 18px 8px; font-size: 13px;
}

/* ----- subpages ----- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 8px;
  padding: calc(10px + var(--safe-top)) 10px 10px;
  background: rgba(2, 8, 32, 0.88); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar h1 { flex: 1; font-size: 17px; font-weight: 650; text-align: center; }
.topbar .back, .topbar .ghost {
  min-width: 42px; height: 32px; border: 0; background: transparent; color: var(--mint); font-size: 15px;
}
.page { padding: 12px 14px 32px; }
.card {
  background: rgba(6, 14, 42, 0.86); border: 1px solid var(--card-border);
  border-radius: var(--radius); padding: 14px; margin-bottom: 12px;
}
.card h2 { font-size: 15px; margin-bottom: 10px; color: var(--mint); font-weight: 650; }
.muted { color: var(--muted); font-size: 13px; line-height: 1.5; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tabs { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.tab, .btn {
  border: 1px solid rgba(117, 252, 175, 0.25); background: rgba(8, 24, 48, 0.8);
  color: var(--text); border-radius: 10px; padding: 8px 12px; font-size: 13px;
}
.tab.active, .btn.primary { background: rgba(117, 246, 84, 0.16); border-color: var(--neon); color: var(--neon); }
.btn.danger { border-color: var(--danger); color: #ff8a96; }
.btn.ghost { border-color: var(--line); color: var(--muted); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }

input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not([type="hidden"]):not([type="button"]):not([type="submit"]):not([type="reset"]),
select, textarea {
  width: 100%; background: #0b1228; border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px; padding: 9px 11px; outline: none;
  color: var(--text); color-scheme: dark;
}
input::placeholder, textarea::placeholder { color: var(--search-ph); }
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
textarea:-webkit-autofill,
select:-webkit-autofill {
  -webkit-text-fill-color: var(--text);
  caret-color: var(--text);
  box-shadow: 0 0 0 1000px #0b1228 inset;
}
.search-bar input {
  flex: 1; width: auto; background: transparent; border: 0; outline: none;
  padding: 0; color: var(--text); font-size: 16px; min-width: 0;
  box-shadow: none;
}
textarea { min-height: 70px; resize: vertical; }
label { display: block; font-size: 12px; color: var(--muted); margin: 8px 0 4px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.form-grid .full { grid-column: 1 / -1; }

table { width: 100%; border-collapse: collapse; font-size: 12px; }
th { color: var(--muted); font-weight: 500; text-align: center; padding: 6px 2px; }
td { text-align: center; padding: 8px 2px; border-top: 1px solid var(--line); vertical-align: middle; }
td.left, th.left { text-align: left; }
tr.me td { background: rgba(117, 246, 84, 0.08); }
.team-cell { display: flex; align-items: center; gap: 6px; }
.avatar, .avatar-sm {
  width: 28px; height: 28px; border-radius: 50%; object-fit: cover; background: #1a2340; flex-shrink: 0;
}
.avatar-sm { width: 22px; height: 22px; }
.avatar.crest {
  object-fit: contain;
  background: #0b1028;
  border-radius: 8px;
}
.avatar-ph {
  width: 28px; height: 28px; border-radius: 50%; background: #1c2a4a; color: var(--mint);
  display: flex; align-items: center; justify-content: center; font-size: 11px; flex-shrink: 0;
}

.badge { display: inline-block; border-radius: 8px; padding: 1px 7px; font-size: 11px; }
.badge.queue { background: #17324a; color: #9ad; }
.badge.live { background: rgba(117,246,84,0.15); color: var(--neon); }
.badge.sold { background: rgba(255,196,16,0.15); color: var(--gold); }
.badge.opening { background: rgba(0, 200, 220, 0.15); color: #7ee0ea; }
.badge.unsold { background: #2a2030; color: #c89; }
.badge.unrecorded { background: #2a2a20; color: #cc8; }
.badge.pending { background: rgba(255,176,32,0.15); color: var(--warn); }
.badge.approved { background: rgba(117,246,84,0.15); color: var(--neon); }
.badge.rejected { background: rgba(255,90,106,0.15); color: var(--danger); }
.badge.open { background: #17324a; color: #9ad; }
.badge.owned { background: #1a2030; color: var(--muted); }
.badge.unconfirmed { background: rgba(255,176,32,0.15); color: var(--warn); }
.badge.unowned { background: #17324a; color: #9ad; }
.badge.inactive { background: #2a2030; color: #c89; }
.badge.claimed { background: rgba(117,246,84,0.15); color: var(--neon); }
.badge.played { background: rgba(117,246,84,0.12); color: var(--mint); }
.badge.scheduled { color: var(--muted); background: #1a2030; }

/* calendar */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal .wd { text-align: center; font-size: 11px; color: var(--muted); padding: 4px 0; }
.cal .wd.sun { color: var(--gold); }
.cal-cell {
  min-height: 76px; border-radius: 8px; background: #12182c; border: 1px solid #22283c;
  padding: 4px; font-size: 10px;
}
.cal-cell.empty { opacity: 0.35; }
.cal-date { font-size: 10px; color: #111; background: #ffd614; border-radius: 4px; text-align: center; padding: 1px 0; margin-bottom: 3px; font-weight: 650; }
.ev { border-radius: 4px; padding: 2px 3px; margin-top: 2px; line-height: 1.25; text-align: center; }
.ev.leave { background: #d61224; color: #fff; }
.ev.league { background: #00babc; color: #08141c; }
.ev.champion { background: #ffc410; color: #1c1000; }
.ev.open { background: #ff5c8c; color: #280010; }
.ev.close { background: #ff5876; color: #fff; }
.ev.transfer { background: #b0e024; color: #102000; }
.legend { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; font-size: 11px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; }

/* auction room */
.countdown {
  text-align: center; font-size: 108px; font-weight: 700; line-height: 1; color: #1db954;
  font-family: "Times New Roman", "Noto Serif", serif;
  padding: 8px 0 4px;
  text-shadow: 0 0 24px rgba(29, 185, 84, 0.25);
}
.countdown.paused { color: var(--warn); font-size: 64px; }
.countdown.idle { color: var(--muted); font-size: 42px; font-family: inherit; }
.lot-card { }
.lot-name { font-size: 20px; font-weight: 700; }
.lot-meta { color: var(--muted); font-size: 13px; margin-top: 4px; }
.bio-box {
  margin-top: 10px; background: #0b1224; border-radius: 12px; padding: 12px;
  white-space: pre-wrap; font-size: 13px; line-height: 1.6; color: #e8edf7;
}
.price-line { font-size: 28px; font-weight: 700; color: var(--gold); text-align: center; margin: 8px 0 4px; }
.lead-line { text-align: center; color: var(--mint); font-size: 14px; }
.bid-pad { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-top: 12px; }
.feed { max-height: 280px; overflow: auto; }
.feed-item {
  padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px; white-space: pre-wrap; line-height: 1.5;
}
.feed-item .t { color: var(--muted); font-size: 11px; display: block; margin-bottom: 2px; }

.match-item, .asset-item, .list-item {
  padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px;
}
.score { font-weight: 700; letter-spacing: 0.08em; color: var(--mint); }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: #14223a; border: 1px solid var(--neon); color: var(--text);
  padding: 10px 16px; border-radius: 12px; z-index: 50; max-width: 90%;
  box-shadow: var(--shadow); font-size: 13px;
}
.toast.err { border-color: var(--danger); }

.login-box { margin-top: 24px; }
.role-pills { display: flex; gap: 8px; margin-bottom: 8px; }

.cup { margin-bottom: 16px; }
.cup h3 { font-size: 16px; margin-bottom: 6px; }
.finalists { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 10px 0; font-weight: 650; }
.finalists span.vs { color: var(--gold); font-size: 12px; }

.empty { color: var(--muted); text-align: center; padding: 24px 8px; font-size: 13px; }

@media (min-width: 720px) {
  .app { max-width: 430px; box-shadow: 0 0 0 1px rgba(255,255,255,0.04), 0 0 80px rgba(0,0,40,0.6); }
}

.chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 16px 12px; }
.chip {
  font-size: 11px; border-radius: 999px; padding: 3px 10px;
  background: #121a33; border: 1px solid var(--line); color: var(--muted);
}
.chip.on { border-color: rgba(117,246,84,0.35); color: var(--neon); background: rgba(117,246,84,0.08); }
.chip.off { border-color: rgba(255,90,106,0.3); color: #ff8a96; }

.section-title { font-size: 14px; color: var(--mint); margin: 12px 4px 8px; }
.score-photo {
  width: 100%; max-height: 280px; object-fit: contain; border-radius: 12px;
  background: #000; margin: 8px 0; border: 1px solid var(--line);
}
.player-row { padding: 8px 0; }
.bid-mini { margin: 0 0 10px; }
.pending-card h2 { margin-bottom: 4px; }

.hero .sub { letter-spacing: 0.12em; }


/* ----- 海摘选秀 ----- */
.draft-clock {
  text-align: center; font-size: 48px; font-weight: 700; color: var(--neon);
  line-height: 1.1; padding: 8px 0 2px;
  text-shadow: 0 0 18px rgba(117, 246, 84, 0.25);
  font-variant-numeric: tabular-nums;
}
.draft-clock.waiting, .draft-clock.unlimited, .draft-clock.paused, .draft-clock.none {
  font-size: 20px; color: var(--mint); text-shadow: none; font-weight: 650;
}
.draft-clock.paused { color: var(--warn); }
.draft-turn { text-align: center; color: var(--mint); font-size: 15px; margin: 8px 0 4px; line-height: 1.5; }
.pos-banner {
  background: rgba(255, 176, 32, 0.12); border: 1px solid rgba(255, 176, 32, 0.35);
  color: var(--warn); border-radius: 10px; padding: 8px 10px; margin: 8px 0; font-size: 13px; line-height: 1.45;
}
.warn-text { color: var(--warn); font-size: 12px; line-height: 1.45; margin-top: 6px; }
.draft-order { max-height: 420px; overflow: auto; margin-bottom: 12px; position: relative; }
.draft-order .list-item.current { background: rgba(117, 246, 84, 0.08); border-radius: 8px; padding-left: 8px; padding-right: 8px; }
.draft-clock-config { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); clear: both; }
.draft-add-team { align-items: center; }
.draft-add-team select { flex: 1; min-width: 0; }
.order-pos { color: var(--muted); min-width: 1.6em; display: inline-block; }
.count-warn { color: var(--warn); font-size: 12px; white-space: nowrap; }
.count-ok { color: var(--mint-dim); font-size: 12px; white-space: nowrap; }
.price-tag { color: var(--gold); }
.badge.available, .badge.picked { background: rgba(117,246,84,0.15); color: var(--neon); }
.badge.blocked, .badge.skipped { background: #1a2030; color: var(--muted); }
.badge.auto, .badge.makeup_picked { background: rgba(255,196,16,0.15); color: var(--gold); }
.badge.setup, .badge.paused, .badge.waiting, .badge.unlimited, .badge.running, .badge.closed, .badge.filling {
  background: #17324a; color: #9ad;
}
.badge.live, .badge.running { background: rgba(117,246,84,0.15); color: var(--neon); }
.badge.paused { background: rgba(255,176,32,0.15); color: var(--warn); }
.badge.filling { background: rgba(0, 200, 220, 0.15); color: #7ee0ea; }

.choice { display: flex; align-items: center; gap: 8px; margin: 8px 0; font-size: 14px; }
.choice input { width: auto; margin: 0; }
#pool-card h2 { margin-top: 14px; }

.player-filters { margin-top: 8px; }
.player-filters .filter-search { margin: 0 0 10px; }
.player-filters .filter-grid { margin-top: 4px; }
.player-filters .filter-checks { margin-top: 4px; }
.filter-age { display: flex; align-items: center; gap: 8px; }
.filter-age input { width: 100%; min-width: 0; }
.filter-age span { flex: 0 0 auto; }


.confirm-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(2, 5, 31, 0.72);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.confirm-box {
  width: min(420px, 100%);
  background: #0b1028;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 16px 12px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.45);
}
.confirm-box p {
  margin: 0 0 14px;
  line-height: 1.5;
  color: var(--text);
  white-space: pre-wrap;
}
