@import url("https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Manrope:wght@500;600;700;800&display=swap");

:root {
  color-scheme: dark;
  --bg: #101818;
  --panel: #182423;
  --panel-2: #1d2c2a;
  --line: rgba(220, 245, 230, .1);
  --text: #eef4ee;
  --muted: #9aaea5;
  --green: #b9f66b;
  --mint: #5ed7b1;
  --orange: #f4b85f;
  --red: #ff7777;
  font-family: "DM Sans", system-ui, sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(ellipse at 18% -15%, rgba(94, 215, 177, .12), transparent 38rem),
    radial-gradient(ellipse at 95% 4%, rgba(185, 246, 107, .08), transparent 31rem),
    var(--bg);
}
button { font: inherit; }
.boot { padding: 2rem; color: var(--muted); }
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 1.25rem; }
.auth-card {
  width: min(100%, 510px);
  padding: clamp(1.5rem, 5vw, 3rem);
  border: 1px solid var(--line);
  border-radius: 28px;
  background: linear-gradient(145deg, rgba(29,44,42,.96), rgba(20,31,30,.96));
  box-shadow: 0 28px 100px rgba(0,0,0,.38);
}
.brand-mark {
  width: 58px; height: 58px; display: grid; place-items: center;
  border-radius: 18px; color: #101818; font: 800 1.4rem "Manrope", sans-serif;
  background: var(--green); margin-bottom: 2rem;
}
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { font-family: "Manrope", sans-serif; letter-spacing: -.035em; }
h1 { font-size: clamp(2.1rem, 8vw, 3.5rem); line-height: 1.02; margin-bottom: 1rem; }
h2 { font-size: clamp(1.6rem, 5vw, 2.3rem); margin-bottom: .45rem; }
h3 { font-size: 1.05rem; margin-bottom: .6rem; }
.muted { color: var(--muted); line-height: 1.6; }
.eyebrow { color: var(--mint); font-size: .76rem; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; }
.button {
  border: 0; border-radius: 13px; padding: .9rem 1.1rem; cursor: pointer;
  color: #101818; background: var(--green); font-weight: 700;
  transition: transform .16s ease, filter .16s ease;
}
.button:hover { filter: brightness(1.06); transform: translateY(-1px); }
.button.secondary { color: var(--text); background: var(--panel-2); border: 1px solid var(--line); }
.button.ghost { color: var(--muted); background: transparent; border: 1px solid var(--line); }
.button:disabled { cursor: wait; opacity: .55; }
.login-button { display: flex; align-items: center; gap: .7rem; margin-top: 1.8rem; }
.error { color: var(--red); min-height: 1.3rem; margin-top: 1rem; }
.hint { font-size: .83rem; color: var(--muted); margin-top: 1.4rem; }

.shell { min-height: 100vh; display: grid; grid-template-columns: 250px minmax(0,1fr); }
.sidebar {
  position: sticky; top: 0; height: 100vh; padding: 1.3rem 1rem;
  display: flex; flex-direction: column; border-right: 1px solid var(--line);
  background: rgba(14,22,21,.82); backdrop-filter: blur(16px);
}
.sidebar-brand { display: flex; align-items: center; gap: .75rem; padding: .4rem .5rem 1.6rem; }
.sidebar-brand .brand-mark { width: 42px; height: 42px; border-radius: 13px; margin: 0; font-size: 1rem; }
.brand-copy strong { display: block; font: 800 .94rem "Manrope", sans-serif; }
.brand-copy span { color: var(--muted); font-size: .73rem; }
.nav { display: grid; gap: .35rem; }
.nav button {
  width: 100%; text-align: left; border: 0; cursor: pointer; color: var(--muted);
  border-radius: 11px; padding: .75rem .8rem; background: transparent;
}
.nav button:hover, .nav button.active { color: var(--text); background: var(--panel-2); }
.nav button.active { box-shadow: inset 3px 0 var(--green); }
.sidebar-foot { margin-top: auto; display: grid; gap: .6rem; }
.user-chip { padding: .75rem; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.user-chip strong { display: block; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; }
.user-chip span { font-size: .76rem; color: var(--muted); }
.main { min-width: 0; padding: clamp(1.1rem, 4vw, 3rem); }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 2rem; }
.topbar .eyebrow { margin-bottom: .3rem; }
.mobile-brand { display: none; }
.hero {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 2rem;
  padding: clamp(1.4rem, 4vw, 2.5rem); border-radius: 24px; border: 1px solid var(--line);
  background: linear-gradient(115deg, rgba(37,63,55,.82), rgba(26,40,38,.68));
  margin-bottom: 1.25rem;
}
.hero h2 { max-width: 660px; }
.hero p { max-width: 680px; margin-bottom: 0; }
.grid { display: grid; grid-template-columns: repeat(12, minmax(0,1fr)); gap: 1rem; }
.card {
  grid-column: span 4; padding: 1.2rem; min-width: 0;
  border: 1px solid var(--line); border-radius: 18px; background: rgba(24,36,35,.9);
}
.card.wide { grid-column: span 8; }
.card.full { grid-column: 1 / -1; }
.stat { font: 800 2rem "Manrope", sans-serif; margin: .3rem 0; }
.badge { display: inline-flex; padding: .25rem .55rem; border-radius: 99px; color: var(--green); background: rgba(185,246,107,.1); font-size: .75rem; }
.badge.pending { color: var(--orange); background: rgba(244,184,95,.1); }
.list { display: grid; gap: .65rem; margin-top: 1rem; }
.list-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .8rem; border-radius: 12px; background: rgba(255,255,255,.035); }
.list-row strong { display: block; }
.list-row small { color: var(--muted); }
.empty { color: var(--muted); border: 1px dashed var(--line); border-radius: 14px; padding: 1.2rem; }
.status { display: flex; align-items: center; gap: .55rem; color: var(--muted); font-size: .85rem; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--mint); }
.dot.off { background: var(--orange); }
.bottom-nav { display: none; }
.toast { margin: .8rem 0; padding: .8rem 1rem; border-radius: 12px; background: var(--panel-2); color: var(--muted); }
.top-actions { display: flex; align-items: center; gap: .55rem; }
.card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.mmr-pills { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .4rem; color: var(--muted); font-size: .75rem; }
.mmr-pills span { border: 1px solid var(--line); border-radius: 99px; padding: .3rem .5rem; white-space: nowrap; }
.mmr-pills b { color: var(--text); margin-left: .2rem; }
.search-form label { display: block; margin-bottom: .55rem; font-weight: 700; }
.search-row { display: flex; gap: .65rem; }
.search-row input { min-width: 0; flex: 1; padding: .85rem 1rem; color: var(--text); border: 1px solid var(--line); border-radius: 12px; background: var(--bg); font: inherit; }
.search-row input:focus { outline: 2px solid var(--mint); outline-offset: 1px; }
.result-space { margin-top: 1rem; }
.player-card { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.1rem; border: 1px solid var(--line); border-radius: 16px; background: var(--panel-2); }
.player-card h3 { margin: .25rem 0 0; }
.rank-grid { display: flex; gap: .6rem; }
.rank-grid div { display: grid; gap: .2rem; min-width: 92px; padding: .65rem; border-radius: 12px; background: rgba(255,255,255,.04); }
.rank-grid small, .rank-grid span { color: var(--muted); font-size: .72rem; }
.rank-grid strong { font: 800 1.2rem "Manrope", sans-serif; }
.event-title { margin-top: 1rem; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: .75rem; margin-bottom: .8rem; }
.form-grid label { display: grid; gap: .4rem; color: var(--muted); font-size: .84rem; font-weight: 600; }
.form-grid input, .form-grid select, .form-grid textarea { width: 100%; min-width: 0; padding: .75rem .85rem; color: var(--text); border: 1px solid var(--line); border-radius: 11px; background: var(--bg); font: inherit; }
.form-grid textarea { resize: vertical; }
.form-grid input:focus, .form-grid select:focus, .form-grid textarea:focus { outline: 2px solid var(--mint); outline-offset: 1px; }
.form-grid .check-label { display: flex; align-items: center; gap: .5rem; }
.form-grid .check-label input { width: auto; }
.prewrap { white-space: pre-wrap; overflow-wrap: anywhere; }

.form-grid small { font-weight: 400; }
.member-filter-label { display: grid; gap: .45rem; max-width: 520px; margin: 1rem 0; color: var(--muted); font-size: .84rem; font-weight: 600; }
.member-filter-label input { width: 100%; padding: .8rem .9rem; color: var(--text); border: 1px solid var(--line); border-radius: 11px; background: var(--bg); font: inherit; }
.member-filter-label input:focus { outline: 2px solid var(--mint); outline-offset: 1px; }
.training-history { margin-top: 1rem; border-top: 1px solid var(--line); padding-top: .8rem; }
.training-history summary { color: var(--mint); cursor: pointer; font-weight: 700; }
.bid-actions { display: flex; flex-wrap: wrap; gap: .55rem; margin-top: 1rem; }
.series-choices > div { display: flex; flex-wrap: wrap; gap: .4rem; margin: .5rem 0; }
.series-choices button[aria-pressed="true"] { border-color: var(--gold, #ffc440); color: var(--gold, #ffc440); }
.section-title { margin-top: 1.5rem; }
.table-wrap { width: 100%; overflow-x: auto; margin-top: 1rem; }
table { width: 100%; border-collapse: collapse; min-width: 650px; font-size: .83rem; }
th, td { text-align: left; padding: .68rem .55rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; }
td:first-child { color: var(--green); font-weight: 700; }
[hidden] { display: none !important; }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .mobile-brand { display: flex; align-items: center; gap: .6rem; }
  .mobile-brand .brand-mark { width: 38px; height: 38px; border-radius: 12px; margin: 0; font-size: .9rem; }
  .bottom-nav {
    display: flex; overflow-x: auto; gap: .4rem; position: sticky; bottom: 0;
    padding: .65rem .7rem calc(.65rem + env(safe-area-inset-bottom));
    background: rgba(14,22,21,.94); border-top: 1px solid var(--line); z-index: 5;
  }
  .bottom-nav button { flex: 1 0 auto; border: 0; border-radius: 10px; padding: .65rem .8rem; color: var(--muted); background: transparent; }
  .bottom-nav button.active { color: var(--green); background: var(--panel-2); }
  .main { padding-bottom: 1.5rem; }
  .hero { align-items: flex-start; flex-direction: column; }
  .card { grid-column: span 6; }
}
@media (max-width: 560px) {
  .main { padding: 1rem .85rem 1rem; }
  .topbar { margin-bottom: 1.15rem; }
  .top-actions { gap: .35rem; }
  .top-actions .button { padding: .65rem .7rem; font-size: .76rem; }
  .topbar .button { padding: .7rem .8rem; font-size: .83rem; }
  .hero { border-radius: 18px; margin-bottom: .85rem; }
  .grid { gap: .75rem; }
  .card, .card.wide { grid-column: 1 / -1; padding: 1rem; }
  .bottom-nav button { font-size: .76rem; }
  .search-row { align-items: stretch; flex-direction: column; }
  .player-card { align-items: flex-start; flex-direction: column; }
  .rank-grid { width: 100%; }
  .rank-grid div { min-width: 0; flex: 1; }
  .mmr-pills { justify-content: flex-start; }
  .form-grid { grid-template-columns: 1fr; }
}
