:root {
  color-scheme: dark;
  --bg: #101614; --panel: #17201d; --soft: #1c2722; --line: #2c3932;
  --text: #edf3ee; --muted: #a3b3a9; --green: #bbf480; --lime: #a9e873;
  --warn: #f4bf75; --bad: #ffb0a8; --shadow: 0 20px 55px #070d0a55;
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  font-synthesis: none; background: var(--bg); color: var(--text);
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 300px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(1.75rem, 3.8vw, 2.9rem); line-height: 1.15; letter-spacing: -.055em; }
h2 { font-size: 1.09rem; letter-spacing: -.025em; }
h3 { font-size: .97rem; }
button, a, input, select { font: inherit; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .45; }
:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }
[hidden] { display: none !important; }
.num { font-variant-numeric: tabular-nums; }
.muted, .sub { color: var(--muted); }
.sub { font-size: .86rem; line-height: 1.6; }
.good { color: var(--green); }
.negative, .error { color: var(--bad); }
.error { min-height: 1.5em; font-size: .84rem; }
.loading { padding: 3rem; color: var(--muted); }
.brand { display: inline-flex; align-items: center; gap: .65rem; font-size: 1rem; font-weight: 780; white-space: nowrap; }
.brand img { width: 37px; height: 37px; }
.brand small { display: block; color: var(--green); font: 700 .59rem/1.4 system-ui, sans-serif; letter-spacing: .2em; }
.button {
  display: inline-flex; justify-content: center; align-items: center; gap: .45rem; min-height: 39px;
  border: 1px solid var(--line); border-radius: 8px; padding: .5rem .86rem; background: var(--soft);
  color: var(--text); font-size: .83rem; font-weight: 700; text-align: center;
}
.button:hover:not(:disabled) { border-color: #738e7e; background: #263930; }
.primary { background: var(--green); border-color: var(--green); color: #152319; }
.primary:hover:not(:disabled) { background: #d0ff9f; border-color: #d0ff9f; }
.ghost { background: transparent; }
.button.small { padding: .3rem .62rem; min-height: 32px; font-size: .77rem; }
.pill { display: inline-flex; gap: .4rem; align-items: center; padding: .2rem .46rem; border-radius: 5px; background: #27362e; color: #b9d6c5; font-size: .69rem; white-space: nowrap; }
.pill.active { color: var(--green); background: #385333; }
.pill.wait { color: var(--warn); background: #443624; }
.site-link { display: inline-flex; align-items: center; gap: .5rem; color: var(--muted); font-size: .81rem; }
.site-link:hover { color: var(--text); }

.landing { min-height: 100svh; display: grid; grid-template-rows: auto 1fr; background: #101815; }
.public-head { display: flex; align-items: center; justify-content: space-between; padding: 1rem clamp(1.1rem, 5vw, 5rem); border-bottom: 1px solid #2b3a32; }
.auth-layout { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(350px, 1fr); }
.cover {
  min-height: 570px; background: linear-gradient(0deg,#0b1815f7,#11292030 80%), url('/assets/stadium.webp') 57% center / cover;
  padding: clamp(2rem, 6vw, 6.25rem); display: flex; flex-direction: column; justify-content: flex-end;
}
.cover .tag { align-self: start; text-transform: uppercase; }
.cover h1 { font-size: clamp(3rem, 7.4vw, 7.8rem); font-weight: 900; margin: .7rem 0 .55rem; }
.cover h1 span { display: block; color: var(--green); font: 800 .42em/1.1 system-ui, sans-serif; letter-spacing: -.04em; margin-top: .16em; }
.cover p { color: #d1e2d8; font-size: clamp(.92rem, 1.5vw, 1.1rem); margin-top: .85rem; }
.cover-facts { display: flex; gap: clamp(.7rem, 3.2vw, 3rem); flex-wrap: wrap; padding-top: 1.15rem; margin-top: 2rem; border-top: 1px solid #b1cabb3f; }
.cover-facts span { display: grid; gap: .2rem; color: #cadad0; font-size: .73rem; }
.cover-facts b { color: var(--text); font-size: 1rem; }
.auth-wrap { display: grid; align-items: center; padding: clamp(1.15rem, 4vw, 4rem); }
.auth { width: min(100%, 440px); margin: auto; }
.auth h2 { font-size: 1.9rem; margin: .7rem 0 .35rem; }
.tabs { display: flex; align-items: center; border-bottom: 1px solid var(--line); gap: 1.25rem; margin-bottom: 1.25rem; }
.tab { min-height: 43px; color: var(--muted); background: none; border: 0; border-bottom: 2px solid transparent; padding: .35rem .1rem; font-weight: 740; font-size: .86rem; }
.tab.current { border-bottom-color: var(--green); color: var(--green); }
label.field { display: grid; gap: .4rem; font-size: .81rem; font-weight: 670; }
input:not([type=checkbox]), select {
  width: 100%; min-height: 42px; border: 1px solid var(--line); border-radius: 8px;
  background: #101916; color: var(--text); padding: .5rem .7rem; font-size: .89rem;
}
input[type=checkbox] { width: 17px; height: 17px; margin: 0; accent-color: var(--green); vertical-align: middle; }
.auth form, .form-stack { display: grid; gap: .85rem; }
.auth .primary { min-height: 46px; }
.hint { font-size: .76rem; color: var(--muted); line-height: 1.55; }

.shell { min-height: 100svh; display: grid; grid-template-columns: 220px minmax(0, 1fr); }
.sidebar { height: 100svh; position: sticky; top: 0; display: flex; flex-direction: column; padding: 1.3rem .9rem .85rem; border-right: 1px solid var(--line); background: #121b17; }
.sidebar .brand { margin: 0 .25rem 1.45rem; }
.club-chip { display: flex; gap: .62rem; align-items: center; padding: .65rem; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; }
.club-chip div { min-width: 0; }
.club-chip strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .82rem; }
.club-chip small { font-size: .69rem; color: var(--muted); }
.side-nav { display: grid; gap: .25rem; margin: 1.3rem 0 .8rem; }
.nav { display: flex; align-items: center; gap: .63rem; min-height: 42px; border: 1px solid transparent; border-radius: 8px; background: transparent; text-align: left; color: var(--muted); padding: .48rem .72rem; font-weight: 700; font-size: .84rem; }
.nav:hover { background: var(--soft); color: var(--text); }
.nav.current { color: var(--green); border-color: #3d5841; background: #243629; }
.nav .icon { width: 17px; height: 17px; flex: none; }
.sidebar-foot { display: grid; gap: .45rem; margin-top: auto; padding-top: .65rem; }
.sidebar-foot .site-link { padding: .32rem .5rem; }
.main { width: min(100%, 1515px); margin: 0 auto; padding: 1.6rem clamp(.9rem, 3vw, 2.6rem) 2.5rem; min-width: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: .9rem; margin-bottom: 1.15rem; }
.topbar .sub { font-size: .76rem; }
.account, .inline, .filters { display: flex; align-items: center; gap: .55rem; flex-wrap: wrap; }
.section-title { margin-bottom: 1.15rem; }
.section-title .sub { margin-top: .45rem; }
.hero {
  background: linear-gradient(90deg, #10241cf5, #10241c68 56%, #0d1b1a52), url('/assets/stadium.webp') 53% 53% / cover;
  min-height: 234px; display: flex; align-items: end; justify-content: space-between; gap: 1rem;
  padding: clamp(1rem, 3vw, 2rem); border: 1px solid #4c6853; border-radius: 14px; box-shadow: var(--shadow);
}
.hero h1 { margin: .5rem 0; overflow-wrap: anywhere; }
.hero .sub { color: #deece2; }
.hero .button { flex: none; }
.metrics { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: .75rem; margin: .9rem 0; }
.metric { padding: .8rem 1rem; min-width: 0; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.metric small { display: block; color: var(--muted); font-size: .74rem; margin-bottom: .3rem; }
.metric strong { display: block; font-size: clamp(1rem,2.1vw,1.5rem); overflow-wrap: anywhere; }
.duo { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: .9rem; }
.stack { display: grid; gap: .9rem; }
.panel { min-width: 0; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.panel-head { padding: .85rem 1rem; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: .6rem; flex-wrap: wrap; }
.panel-body { padding: .85rem 1rem 1rem; }
.panel-body > .sub + * { margin-top: .65rem; }
.rows { display: grid; }
.row { min-height: 47px; padding: .55rem 0; display: flex; align-items: center; justify-content: space-between; gap: .6rem; border-bottom: 1px solid var(--line); font-size: .83rem; }
.row:last-child { border-bottom: 0; }
.row > :last-child { flex-shrink: 0; }
.row small { display: block; margin-top: .15rem; font-size: .72rem; }
.fixture { min-height: 49px; display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: .5rem; padding: .45rem 0; align-items: center; text-align: center; }
.fixture > :first-child { justify-content: flex-end; }
.team { display: inline-flex; align-items: center; gap: .38rem; min-width: 0; font-size: .81rem; }
.team span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crest { --crest: #1b7854; display: inline-grid; flex: none; place-items: center; width: 32px; height: 36px; background: var(--crest); color: #fff; font-size: .53rem; font-weight: 880; text-shadow: 0 1px 3px #000; }
.crest.shield { clip-path: polygon(0 7%,50% 0,100% 7%,100% 52%,86% 78%,50% 100%,14% 78%,0 52%); }
.crest.round { border-radius: 50%; height: 32px; border: 1px solid #c5dbcb88; }
.crest.diamond { clip-path: polygon(50% 0,100% 50%,50% 100%,0 50%); }
.crest.stripes { background: repeating-linear-gradient(90deg,transparent 0 18%,#04110d66 18% 33%),var(--crest); }
.crest.halves { background: linear-gradient(90deg,transparent 50%,#04110d77 50%),var(--crest); }
.crest.large { width: 80px; height: 87px; font-size: 1.1rem; }
.crest.large.round { height: 80px; }
.crest.tiny { width: 22px; height: 24px; font-size: .46rem; }
.crest.tiny.round { height: 22px; }
.score { min-width: 57px; font: 800 1rem system-ui,sans-serif; padding: .25rem .4rem; border-radius: 6px; background: #25332b; }
.score small { display: block; font-size: .63rem; color: var(--muted); }
table { width: 100%; border-collapse: collapse; font-size: .8rem; }
th, td { padding: .58rem .65rem; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font-size: .72rem; color: var(--muted); background: #1c2922; }
tr:last-child td { border-bottom: 0; }
.mine td { background: #2b412f; }
.table-wrap { overflow-x: auto; }
.qual { color: var(--green); font-weight: 780; }
.setup { width: min(1010px, 100%); margin: 0 auto; padding: 1.35rem clamp(.85rem, 3vw, 1.6rem) 2.25rem; }
.setup .section-title { margin-top: 1.4rem; }
.club-design { display: grid; grid-template-columns: 115px 1fr; align-items: center; gap: 1rem; }
.crest-preview { display: grid; justify-items: center; gap: .55rem; color: var(--muted); font-size: .76rem; }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .65rem; }
.colors { display: flex; flex-wrap: wrap; gap: .45rem; align-items: center; }
.swatch { width: 27px; height: 27px; border-radius: 50%; border: 1px solid #ffffff44; padding: 0; background: var(--swatch); }
.swatch[aria-pressed=true] { outline: 2px solid var(--green); outline-offset: 2px; }
.group-head { margin: .45rem 0 .35rem; display: flex; justify-content: space-between; align-items: center; gap: .7rem; }
.player-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: .45rem; }
.player-pick { display: flex; justify-content: space-between; align-items: center; gap: .42rem; min-width: 0; padding: .51rem; border: 1px solid var(--line); border-radius: 7px; background: #131b18; cursor: pointer; font-size: .81rem; }
.player-pick:has(:checked) { border-color: #61895f; background: #223629; }
.player-pick small { display: block; font-size: .67rem; color: var(--muted); }
.cta-row { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; }
.league-grid, .facility-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: .9rem; }
.facility-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
.league-card, .facility-card { display: grid; gap: .6rem; padding: 1rem; }
.league-card .button, .facility-card .button { justify-self: start; }
.filters select { width: auto; min-height: 34px; font-size: .78rem; }
.filters input { flex: 1; min-width: 125px; }
.schedule-group { max-height: 570px; overflow: auto; }
.match-day { padding: .42rem 0 .1rem; border-bottom: 1px solid var(--line); }
.match-day h3 { color: var(--muted); font-size: .75rem; }
.tactics-layout { display: grid; grid-template-columns: minmax(220px, .85fr) minmax(0, 1.15fr); gap: .9rem; }
.pitch { min-height: 270px; padding: .8rem .7rem; display: grid; grid-template-rows: repeat(4,1fr); align-items: center; gap: .25rem; border: 1px solid #78a36c; border-radius: 9px; background: repeating-linear-gradient(0deg,#245a43 0 14%,#286249 14% 28%); }
.pitch-line { display: flex; gap: .25rem; justify-content: space-evenly; }
.pitch-line span { font-size: .66rem; color: #fff; text-align: center; }
.pitch-line b { display: block; margin: 0 auto .15rem; border-radius: 50%; width: 24px; height: 24px; line-height: 24px; background: var(--green); color: #192418; }
.notice { position: fixed; z-index: 3; bottom: 1rem; right: 1rem; max-width: min(370px, calc(100vw - 2rem)); border: 1px solid #73926f; background: #24382b; color: var(--text); width: max-content; padding: .65rem .85rem; border-radius: 8px; box-shadow: var(--shadow); font-size: .83rem; }
.notice.problem { border-color: #9d6b62; background: #452b25; }
.dialog { border: 1px solid var(--line); border-radius: 12px; background: var(--panel); color: var(--text); width: min(430px, calc(100% - 2rem)); padding: 1.1rem; box-shadow: var(--shadow); }
.dialog::backdrop { background: #050b09c2; }

@media (max-width: 1030px) {
  .shell { grid-template-columns: 170px minmax(0, 1fr); }
  .sidebar { padding-left: .65rem; padding-right: .65rem; }
  .league-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 780px) {
  .auth-layout { grid-template-columns: 1fr; }
  .cover { min-height: 320px; padding: 1.5rem 1.2rem; }
  .cover-facts { margin-top: 1.1rem; }
  .auth-wrap { padding: 1.4rem 1.15rem 2rem; }
  .shell { display: block; }
  .sidebar { position: static; height: auto; padding: .6rem .85rem 0; border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar .brand { margin: 0; }
  .sidebar .club-chip, .sidebar-foot { display: none; }
  .side-nav { display: flex; overflow-x: auto; gap: .25rem; margin: .35rem 0 .45rem; }
  .nav { flex: none; white-space: nowrap; padding: .35rem .52rem; min-height: 35px; font-size: .75rem; }
  .nav .icon { width: 15px; height: 15px; }
  .main { padding-top: .75rem; }
  .topbar { margin-bottom: .65rem; }
  .hero { min-height: 190px; }
  .duo, .tactics-layout { grid-template-columns: 1fr; }
  .player-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
}
@media (max-width: 480px) {
  .cover { min-height: 286px; }
  .cover h1 { font-size: 3rem; }
  .cover-facts { gap: .8rem; }
  .cover-facts b { font-size: .9rem; }
  .auth h2 { font-size: 1.6rem; }
  .hero { align-items: start; justify-content: flex-end; flex-direction: column; }
  .metrics { gap: .4rem; }
  .metric { padding: .63rem .44rem; }
  .metric small { font-size: .67rem; }
  .metric strong { font-size: .93rem; }
  .club-design { grid-template-columns: 74px 1fr; gap: .6rem; }
  .crest.large { width: 63px; height: 69px; }
  .crest.large.round { height: 63px; }
  .player-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .league-grid, .facility-grid { grid-template-columns: 1fr; }
  th, td { padding-left: .5rem; padding-right: .5rem; }
}
@media (max-width: 420px) {
  .side-nav { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); overflow: visible; }
  .nav { justify-content: center; gap: .3rem; padding: .33rem .2rem; }
  .topbar > .sub { display: none; }
  .topbar { justify-content: flex-end; }
}
