:root {
  color-scheme: dark;
  --bg: #10100f;
  --surface: #171513;
  --surface-2: #1f1b18;
  --surface-3: #28221d;
  --line: #382f28;
  --line-soft: #2a2520;
  --text: #f2eee8;
  --muted: #a9a099;
  --subtle: #746b63;
  --gold: #d7a84d;
  --red: #da5248;
  --green: #4fb579;
  --teal: #51b0a7;
  --paper: #e6dbc8;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 70% 0%, rgba(81, 176, 167, 0.12), transparent 30rem),
    linear-gradient(180deg, #15120f 0%, var(--bg) 24rem);
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(14rem, 18rem) minmax(24rem, 1fr) auto;
  gap: 1rem;
  align-items: center;
  min-height: 4.5rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--line);
  background: rgba(16, 16, 15, 0.93);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  gap: 0.75rem;
  align-items: center;
  min-width: 0;
}

.brand-mark {
  position: relative;
  display: grid;
  width: 2.75rem;
  height: 2.75rem;
  overflow: hidden;
  place-items: center;
  border: 1px solid rgba(215, 168, 77, 0.65);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(215, 168, 77, 0.25), rgba(218, 82, 72, 0.15)),
    #17130f;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.brand-bars {
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(90deg, transparent 0 5px, rgba(255, 255, 255, 0.08) 5px 6px),
    linear-gradient(180deg, transparent 48%, rgba(81, 176, 167, 0.45) 49%, transparent 53%);
}

.brand-text {
  position: relative;
  z-index: 1;
  color: var(--paper);
  font-weight: 900;
  letter-spacing: 0;
}

.brand-name {
  display: block;
  font-size: 1.15rem;
  font-weight: 850;
  line-height: 1;
}

.brand-subtitle {
  display: block;
  margin-top: 0.2rem;
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1;
}

.main-nav {
  display: flex;
  gap: 0.25rem;
  align-items: center;
  min-width: 0;
}

.main-nav a {
  min-height: 2.25rem;
  padding: 0.62rem 0.78rem;
  border-radius: 6px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
  white-space: nowrap;
}

.main-nav a:hover,
.main-nav a.is-active {
  color: var(--text);
  background: var(--surface-2);
}

.top-actions {
  display: flex;
  gap: 0.55rem;
  align-items: center;
  justify-content: end;
  min-width: 0;
}

.top-search {
  position: relative;
  width: min(18rem, 28vw);
  min-width: 12rem;
}

.search {
  display: flex;
  align-items: center;
  width: min(18rem, 28vw);
  min-width: 12rem;
  height: 2.4rem;
  padding: 0 0.75rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}

.top-search .search {
  width: 100%;
  min-width: 0;
}

.search span {
  width: 0.75rem;
  height: 0.75rem;
  margin-right: 0.55rem;
  border: 2px solid var(--muted);
  border-radius: 50%;
}

.search span::after {
  display: block;
  width: 0.45rem;
  height: 2px;
  margin: 0.48rem 0 0 0.45rem;
  background: var(--muted);
  content: "";
  transform: rotate(45deg);
}

.search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
}

.faction-search-results {
  position: absolute;
  top: calc(100% + 0.35rem);
  right: 0;
  z-index: 35;
  display: grid;
  width: min(26rem, 84vw);
  max-height: min(28rem, 70vh);
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(23, 21, 19, 0.98);
  box-shadow: var(--shadow);
}

.faction-search-result {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.18rem 0.75rem;
  align-items: center;
  min-height: 3.7rem;
  padding: 0.72rem 0.85rem;
  border-bottom: 1px solid var(--line-soft);
}

.faction-search-result:last-child {
  border-bottom: 0;
}

.faction-search-result:hover,
.faction-search-result:focus {
  outline: 0;
  background: var(--surface-2);
}

.faction-search-result strong,
.faction-search-result span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.faction-search-result strong {
  font-size: 0.95rem;
  font-weight: 900;
}

.faction-search-result span,
.faction-search-result em,
.faction-search-empty {
  color: var(--muted);
  font-size: 0.78rem;
}

.faction-search-result em {
  grid-row: 1 / 3;
  grid-column: 2;
  align-self: center;
  font-style: normal;
  font-weight: 850;
  white-space: nowrap;
}

.faction-search-empty {
  padding: 0.85rem;
}

.icon-button,
.account-button,
.logout-button,
.wallet-actions button,
.sort-control button,
.primary-action,
.match-action {
  border: 1px solid var(--line);
  color: var(--text);
  background: var(--surface-2);
}

.icon-button {
  display: grid;
  width: 2.4rem;
  height: 2.4rem;
  place-items: center;
  border-radius: 6px;
}

.dot {
  display: block;
  width: 0.72rem;
  height: 0.72rem;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 4px rgba(215, 168, 77, 0.12);
}

.account-button,
.logout-button {
  display: inline-flex;
  gap: 0.5rem;
  align-items: center;
  height: 2.4rem;
  border-radius: 6px;
  font-weight: 750;
}

.account-button {
  padding: 0 0.75rem 0 0.35rem;
}

.logout-button {
  padding: 0 0.85rem;
  color: var(--muted);
  white-space: nowrap;
}

.logout-button:hover {
  color: var(--text);
  background: var(--surface);
}

.logout-button:disabled {
  cursor: wait;
  opacity: 0.7;
}

.avatar {
  display: grid;
  width: 1.75rem;
  height: 1.75rem;
  place-items: center;
  border-radius: 6px;
  color: #17110d;
  background: var(--gold);
  font-size: 0.78rem;
  font-weight: 900;
}

.page-grid {
  display: grid;
  grid-template-columns: minmax(13rem, 16rem) minmax(0, 1fr) minmax(17rem, 21rem);
  gap: 1rem;
  width: min(100%, 1500px);
  margin: 0 auto;
  padding: 1rem;
}

.sidebar,
.rightbar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.panel,
.live-panel,
.matches-panel,
.headline-strip {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(23, 21, 19, 0.92);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset;
}

.panel,
.live-panel,
.matches-panel {
  padding: 0.85rem;
}

.compact {
  padding: 0.75rem;
}

.panel-heading,
.section-title,
.headline-strip {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
}

.panel-heading h2,
.section-title h2 {
  margin: 0;
  font-size: 0.92rem;
  letter-spacing: 0;
}

.panel-heading span,
.section-title span,
.eyebrow,
.balance-card span,
.balance-card small {
  color: var(--muted);
  font-size: 0.75rem;
}

.headline-strip {
  min-height: 8rem;
  margin-bottom: 1rem;
  padding: 1.1rem;
  overflow: hidden;
  background:
    linear-gradient(115deg, rgba(218, 82, 72, 0.24), transparent 42%),
    linear-gradient(90deg, rgba(16, 16, 15, 0.1), rgba(81, 176, 167, 0.14)),
    var(--surface);
}

.headline-strip h1 {
  max-width: 42rem;
  margin: 0.15rem 0 0;
  font-size: clamp(1.45rem, 3vw, 2.55rem);
  line-height: 1.05;
  letter-spacing: 0;
}

.headline-badge {
  align-self: end;
  display: grid;
  min-width: 9.5rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid rgba(215, 168, 77, 0.35);
  border-radius: 8px;
  background: rgba(16, 16, 15, 0.36);
}

.headline-badge span {
  color: var(--muted);
  font-size: 0.72rem;
}

.headline-badge strong {
  margin-top: 0.12rem;
  color: var(--paper);
  font-size: 0.98rem;
  line-height: 1.15;
}

.eyebrow {
  margin: 0;
  font-weight: 850;
  text-transform: uppercase;
}

.market-total {
  display: grid;
  min-width: 11rem;
  padding: 0.85rem;
  border: 1px solid rgba(215, 168, 77, 0.35);
  border-radius: 8px;
  background: rgba(16, 16, 15, 0.4);
}

.market-total strong {
  margin-top: 0.25rem;
  color: var(--gold);
  font-size: 1.25rem;
}

.date-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.25rem;
  margin-top: 0.75rem;
}

.date-button {
  min-height: 2.1rem;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  font-size: 0.78rem;
  font-weight: 750;
}

.date-button.is-active,
.date-button:hover {
  border-color: rgba(215, 168, 77, 0.35);
  color: var(--text);
  background: var(--surface-2);
}

.event-guide,
.filter-stack,
.bet-list,
.form-list {
  display: grid;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.filter-chip {
  min-height: 2.2rem;
  width: 100%;
  padding: 0 0.75rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  background: var(--surface-2);
  text-align: left;
}

.filter-chip.is-active,
.sort-control button.is-active {
  border-color: rgba(215, 168, 77, 0.6);
  color: var(--paper);
  background: rgba(215, 168, 77, 0.15);
}

.terms-button {
  width: 100%;
  min-height: 2.6rem;
  padding: 0 0.85rem;
  border: 1px solid rgba(215, 168, 77, 0.35);
  border-radius: 8px;
  color: var(--paper);
  background:
    linear-gradient(135deg, rgba(215, 168, 77, 0.14), transparent),
    var(--surface);
  font-weight: 900;
  text-align: left;
}

.terms-button:hover {
  border-color: rgba(215, 168, 77, 0.65);
  background: var(--surface-2);
}

.event-guide div {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  min-height: 2rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.event-time {
  color: var(--gold);
  font-weight: 850;
}

.content {
  min-width: 0;
}

.lobby-search {
  width: 100%;
  min-width: 0;
  margin-top: 0.85rem;
  background: rgba(16, 16, 15, 0.38);
}

.live-panel {
  margin-bottom: 1rem;
}

.live-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 0.8rem;
}

.live-grid .empty-state {
  grid-column: 1 / -1;
}

.live-card {
  display: grid;
  gap: 0.75rem;
  min-width: 0;
  padding: 0.9rem;
  border: 1px solid rgba(79, 181, 121, 0.32);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(79, 181, 121, 0.12), rgba(23, 21, 19, 0.78)),
    var(--surface);
}

.live-meta,
.match-meta,
.team-line,
.bet-row,
.selected-meta,
.form-list li {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
}

.live-pill,
.status-pill,
.tier-pill {
  display: inline-flex;
  align-items: center;
  min-height: 1.45rem;
  padding: 0.18rem 0.45rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
  white-space: nowrap;
}

.live-pill {
  color: #0d1d14;
  background: var(--green);
}

.status-pill {
  color: var(--paper);
  background: rgba(255, 255, 255, 0.08);
}

.status-pill.open {
  color: #17110d;
  background: var(--gold);
}

.tier-pill {
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--muted);
}

.live-scoreboard {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(8rem, auto) minmax(0, 1fr);
  gap: 0.75rem;
  align-items: end;
  min-width: 0;
}

.live-team,
.live-target {
  display: grid;
  min-width: 0;
}

.live-team {
  gap: 0.2rem;
}

.live-team-right {
  justify-items: end;
  text-align: right;
}

.live-team span,
.live-target span {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-team strong {
  overflow: hidden;
  font-size: 2.05rem;
  font-weight: 950;
  letter-spacing: 0;
  line-height: 0.95;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-team-left strong {
  color: #ff835d;
}

.live-team-right strong {
  color: #9dca4c;
}

.live-team.is-leading strong {
  text-shadow: 0 0 20px rgba(157, 202, 76, 0.22);
}

.live-target {
  align-self: center;
  justify-items: center;
  text-align: center;
}

.live-target span {
  color: #9dca4c;
  font-size: 0.7rem;
  text-transform: uppercase;
}

.live-target strong {
  margin-top: 0.1rem;
  color: var(--paper);
  font-size: 1.08rem;
  font-weight: 950;
  line-height: 1.05;
  white-space: nowrap;
}

.live-lead-track {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  height: 0.7rem;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.lead-half {
  display: flex;
  min-width: 0;
}

.lead-half > span {
  display: block;
  width: 0;
  max-width: 100%;
  height: 100%;
}

.lead-left {
  justify-content: flex-end;
  background: rgba(255, 131, 93, 0.1);
}

.lead-left > span {
  border-radius: 999px 0 0 999px;
  background: linear-gradient(90deg, #a74638, #ff835d);
}

.lead-right {
  justify-content: flex-start;
  background: rgba(157, 202, 76, 0.1);
}

.lead-right > span {
  border-radius: 0 999px 999px 0;
  background: linear-gradient(90deg, #77b743, #9dca4c);
}

.lead-center {
  position: absolute;
  top: -0.15rem;
  bottom: -0.15rem;
  left: 50%;
  width: 2px;
  background: rgba(242, 238, 232, 0.72);
  transform: translateX(-50%);
}

.live-card-footer {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.live-card-footer span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-card-footer strong {
  color: var(--paper);
  font-weight: 950;
  white-space: nowrap;
}

.matchup {
  display: grid;
  gap: 0.45rem;
}

.team-line strong,
.team-name {
  overflow: hidden;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.team-line span:last-child,
.match-time {
  color: var(--muted);
  font-size: 0.8rem;
}

.progress-shell {
  height: 0.45rem;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-3);
}

.progress-bar {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--gold));
}

.sort-control {
  display: inline-flex;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.sort-control button {
  min-height: 2rem;
  padding: 0 0.7rem;
  border: 0;
  border-right: 1px solid var(--line);
  color: var(--muted);
  background: transparent;
  font-size: 0.78rem;
  font-weight: 800;
}

.sort-control button:last-child {
  border-right: 0;
}

.match-list {
  display: grid;
  gap: 0.75rem;
  margin-top: 0.85rem;
}

.completed-panel {
  margin-top: 1rem;
}

.page-headline {
  margin-bottom: 1rem;
}

.page-panel {
  min-width: 0;
}

.page-list,
.torn-list {
  display: grid;
  gap: 0.6rem;
  margin-top: 0.85rem;
}

.top-list-search {
  width: min(22rem, 34vw);
}

.result-card,
.torn-list-row,
.bet-board-card,
.history-row {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--surface);
}

.result-card,
.bet-board-card,
.history-row {
  display: grid;
  gap: 0.85rem;
  align-items: center;
  padding: 0.8rem;
}

.result-card {
  grid-template-columns: minmax(8rem, 12rem) minmax(0, 1fr) minmax(9rem, 13rem);
}

.result-card:hover,
.torn-list-row:hover,
.bet-board-card:hover {
  border-color: rgba(215, 168, 77, 0.5);
  background: var(--surface-2);
}

.result-meta,
.result-winner {
  display: grid;
  gap: 0.2rem;
  min-width: 0;
}

.result-meta span,
.result-winner span {
  color: var(--muted);
  font-size: 0.75rem;
}

.result-meta em,
.result-winner small {
  overflow: hidden;
  color: var(--subtle);
  font-size: 0.72rem;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-score {
  display: grid;
  gap: 0.35rem;
  min-width: 0;
}

.result-score-row {
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr) auto;
  gap: 0.55rem;
  align-items: center;
  min-width: 0;
  color: var(--muted);
}

.result-score-row strong {
  overflow: hidden;
  color: var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-score-row.is-winner strong,
.result-score-row.is-winner span:last-child {
  color: var(--green);
}

.result-winner {
  justify-items: end;
  text-align: right;
}

.next-match-card {
  display: grid;
  grid-template-columns: 2.2rem minmax(0, 1fr);
  gap: 0.7rem;
  align-items: start;
  margin-top: 0.8rem;
  padding: 0.75rem;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
}

.next-match-card:hover {
  border-color: rgba(215, 168, 77, 0.5);
  background: var(--surface-2);
}

.next-match-card div {
  display: grid;
  gap: 0.2rem;
  min-width: 0;
}

.next-match-card strong,
.next-match-card span,
.next-match-card small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.next-match-card span,
.next-match-card small {
  color: var(--muted);
  font-size: 0.76rem;
}

.torn-list-head,
.torn-list-row {
  display: grid;
  align-items: center;
}

.torn-list-head {
  min-height: 2.4rem;
  padding: 0 0.8rem;
  border-radius: 6px;
  color: var(--subtle);
  background: var(--surface-2);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.torn-list-row {
  min-height: 4rem;
  padding: 0.65rem 0.8rem;
  color: var(--muted);
}

.faction-list-row {
  grid-template-columns: 3rem minmax(0, 1fr) minmax(8rem, 12rem) minmax(8rem, 11rem);
  gap: 0.8rem;
}

.rank-number {
  color: var(--gold);
  font-weight: 950;
}

.list-faction-name {
  display: flex;
  gap: 0.65rem;
  align-items: center;
  min-width: 0;
}

.list-faction-name strong {
  overflow: hidden;
  color: var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bet-board-card {
  grid-template-columns: minmax(0, 1fr) minmax(7rem, 10rem) auto;
}

.bet-board-main {
  display: grid;
  gap: 0.35rem;
  min-width: 0;
}

.bet-board-main h2 {
  margin: 0;
  overflow: hidden;
  font-size: 1rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bet-board-main p {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.4;
}

.bet-board-side {
  display: grid;
  gap: 0.12rem;
  justify-items: end;
  color: var(--muted);
  font-size: 0.75rem;
  text-align: right;
}

.bet-board-side strong {
  color: var(--gold);
  font-size: 1rem;
}

.wallet-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.wallet-stat-card {
  display: grid;
  gap: 0.35rem;
  min-height: 7rem;
  padding: 1rem;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--surface-2);
}

.wallet-stat-card span,
.wallet-stat-card small {
  color: var(--muted);
}

.wallet-stat-card span {
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.wallet-stat-card strong {
  color: var(--text);
  font-size: 1.55rem;
  line-height: 1;
}

.wallet-stat-card.is-negative strong {
  color: #ff765e;
}

.wallet-detail-grid {
  grid-template-columns: minmax(0, 1fr) minmax(18rem, 24rem);
}

.wallet-history-panel {
  background: rgba(23, 21, 19, 0.92);
}

.side-history-list {
  display: grid;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.side-history-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.65rem;
  align-items: center;
  padding: 0.65rem;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
}

.side-history-row > div {
  display: grid;
  gap: 0.12rem;
  min-width: 0;
}

.side-history-row > div:last-child {
  justify-items: end;
  text-align: right;
}

.side-history-row strong {
  overflow: hidden;
  color: var(--text);
  font-size: 0.84rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.side-history-row span {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.72rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-row {
  grid-template-columns: minmax(0, 1fr) auto;
}

.history-row > div {
  display: grid;
  gap: 0.2rem;
  min-width: 0;
}

.history-row > div:last-child {
  justify-items: end;
  text-align: right;
}

.history-row span {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-layout {
  display: grid;
  grid-template-columns: minmax(17rem, 24rem) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0;
}

.admin-tabs button {
  min-height: 2.45rem;
  padding: 0 1rem;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted);
  background: var(--surface);
  font-weight: 950;
}

.admin-tabs button:hover,
.admin-tabs button.is-active {
  border-color: rgba(215, 168, 77, 0.48);
  color: var(--text);
  background: var(--surface-2);
}

.admin-bets-layout {
  display: grid;
  gap: 1rem;
}

.admin-player-panel,
.admin-detail-panel {
  min-width: 0;
}

.admin-search {
  display: grid;
  gap: 0.4rem;
  margin-top: 0.85rem;
}

.admin-search span {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 850;
}

.admin-search input {
  width: 100%;
  min-height: 2.4rem;
  padding: 0 0.75rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  background: var(--surface);
}

.admin-player-list {
  display: grid;
  gap: 0.55rem;
  margin-top: 0.85rem;
}

.admin-player-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: center;
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
  text-align: left;
}

.admin-player-row:hover,
.admin-player-row.is-selected {
  border-color: rgba(215, 168, 77, 0.52);
  background: var(--surface-2);
}

.admin-player-row > div {
  display: grid;
  gap: 0.18rem;
  min-width: 0;
}

.admin-player-row > div:last-child {
  justify-items: end;
  text-align: right;
}

.admin-player-row strong,
.admin-player-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-player-row strong {
  font-size: 0.9rem;
}

.admin-player-row span {
  color: var(--muted);
  font-size: 0.74rem;
}

.admin-detail-heading {
  display: flex;
  gap: 1rem;
  align-items: start;
  justify-content: space-between;
}

.admin-detail-heading h2 {
  margin: 0.15rem 0;
  font-size: 1.35rem;
}

.admin-detail-heading span {
  color: var(--muted);
  font-size: 0.82rem;
}

.admin-balance-pill {
  display: grid;
  min-width: 10rem;
  padding: 0.75rem;
  border: 1px solid rgba(215, 168, 77, 0.38);
  border-radius: 8px;
  background: rgba(215, 168, 77, 0.06);
  text-align: right;
}

.admin-balance-pill span {
  color: var(--muted);
  font-size: 0.72rem;
}

.admin-balance-pill strong {
  color: var(--gold);
  font-size: 1.25rem;
}

.admin-metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}

.admin-wallet-control {
  display: grid;
  gap: 0.75rem;
  margin-top: 1rem;
  padding: 0.85rem;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
}

.admin-action-buttons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

.secondary-action {
  min-height: 2.45rem;
  border: 1px solid rgba(218, 82, 72, 0.42);
  border-radius: 6px;
  color: var(--text);
  background: rgba(218, 82, 72, 0.12);
  font-weight: 950;
}

.secondary-action:hover {
  background: rgba(218, 82, 72, 0.2);
}

.admin-action-status {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.admin-action-status.success {
  color: var(--green);
}

.admin-action-status.error {
  color: #ff765e;
}

.admin-history-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.admin-bet-list {
  display: grid;
  gap: 0.85rem;
  margin-top: 0.85rem;
}

.admin-bet-match {
  display: grid;
  gap: 0.85rem;
  padding: 0.85rem;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
}

.admin-bet-match-head,
.admin-bet-actions,
.admin-bet-row,
.admin-bet-stats {
  display: grid;
  gap: 0.75rem;
}

.admin-bet-match-head {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
}

.admin-bet-match h3 {
  margin: 0 0 0.2rem;
  font-size: 1.05rem;
}

.admin-bet-match span,
.admin-bet-row span,
.admin-bet-actions span {
  color: var(--muted);
  font-size: 0.78rem;
}

.admin-bet-summary {
  display: grid;
  justify-items: end;
  text-align: right;
}

.admin-bet-summary strong {
  color: var(--gold);
  font-size: 1.05rem;
}

.admin-bet-stats {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.admin-bet-stats span {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: var(--surface);
}

.admin-bet-stats strong {
  color: var(--text);
}

.admin-bet-actions {
  grid-template-columns: minmax(12rem, 1fr) minmax(8rem, auto) minmax(8rem, auto);
  align-items: end;
}

.admin-bet-actions label {
  display: grid;
  gap: 0.35rem;
}

.admin-bet-actions select {
  min-height: 2.45rem;
  padding: 0 0.7rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  background: var(--surface);
}

.admin-bet-rows {
  display: grid;
  gap: 0.45rem;
}

.admin-bet-row {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  padding: 0.65rem;
  border-top: 1px solid var(--line-soft);
}

.admin-bet-row > div {
  display: grid;
  gap: 0.18rem;
  min-width: 0;
}

.admin-bet-row > div:last-child {
  justify-items: end;
  text-align: right;
}

.inline-login-action {
  display: inline-grid;
  min-height: 2.4rem;
  padding: 0 1rem;
  place-items: center;
}

.completed-list {
  gap: 0.5rem;
}

.date-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.5rem;
  padding: 0.35rem 0.1rem 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.match-card {
  display: grid;
  grid-template-columns: 5.4rem minmax(0, 1fr) minmax(9rem, 12rem) auto;
  gap: 0.9rem;
  align-items: center;
  min-height: 5.25rem;
  padding: 0.75rem;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--surface);
}

.completed-card {
  border-color: rgba(79, 181, 121, 0.26);
  background: linear-gradient(135deg, rgba(79, 181, 121, 0.07), var(--surface));
}

.match-card:hover,
.match-card.is-selected {
  border-color: rgba(215, 168, 77, 0.55);
  background: var(--surface-2);
}

.match-time {
  display: grid;
  gap: 0.25rem;
  justify-items: start;
  font-weight: 800;
}

.match-time strong {
  color: var(--text);
  font-size: 1rem;
}

.match-time em {
  color: var(--gold);
  font-size: 0.76rem;
  font-style: normal;
  font-weight: 900;
  white-space: nowrap;
}

.faction-pair {
  display: grid;
  gap: 0.45rem;
  min-width: 0;
}

.faction-row {
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr) auto;
  gap: 0.55rem;
  align-items: center;
  min-width: 0;
}

.result-row.is-winner .team-name,
.result-row.is-winner span:last-child {
  color: var(--green);
}

.result-row span:last-child {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 850;
  white-space: nowrap;
}

.crest {
  display: grid;
  width: 2rem;
  height: 2rem;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 6px;
  color: #fff7e4;
  font-size: 0.7rem;
  font-weight: 950;
}

.crest.gold {
  background: linear-gradient(135deg, #82682a, #d7a84d);
}

.crest.red {
  background: linear-gradient(135deg, #6e201b, #da5248);
}

.crest.green {
  background: linear-gradient(135deg, #1f5c3b, #4fb579);
}

.crest.teal {
  background: linear-gradient(135deg, #205a56, #51b0a7);
}

.crest.ash {
  background: linear-gradient(135deg, #3b3530, #92867a);
}

.crest.violet {
  background: linear-gradient(135deg, #46325a, #9b75bb);
}

.match-market {
  display: grid;
  gap: 0.3rem;
  color: var(--muted);
  font-size: 0.8rem;
}

.match-market strong {
  color: var(--text);
  font-size: 0.95rem;
}

.match-action {
  min-height: 2.3rem;
  padding: 0 0.8rem;
  border-radius: 6px;
  color: #17110d;
  background: var(--gold);
  font-weight: 900;
  white-space: nowrap;
}

.result-action {
  color: var(--paper);
  background: rgba(79, 181, 121, 0.18);
}

.wallet-panel {
  background:
    linear-gradient(155deg, rgba(215, 168, 77, 0.12), transparent 60%),
    var(--surface);
}

.balance-card {
  display: grid;
  gap: 0.2rem;
  margin-top: 0.75rem;
  padding: 0.85rem;
  border: 1px solid rgba(215, 168, 77, 0.35);
  border-radius: 8px;
  background: rgba(16, 16, 15, 0.35);
}

.balance-card strong {
  color: var(--gold);
  font-size: 1.35rem;
}

.wallet-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.wallet-actions button {
  min-height: 2.2rem;
  border-radius: 6px;
  font-weight: 850;
}

.selected-panel {
  min-height: 17rem;
}

.selected-hero {
  display: grid;
  gap: 0.65rem;
}

.selected-vs {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0.65rem;
  align-items: center;
}

.selected-team {
  display: grid;
  gap: 0.45rem;
  justify-items: center;
  min-width: 0;
  padding: 0.75rem 0.4rem;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  text-align: center;
}

.selected-team .team-name {
  max-width: 100%;
}

.vs {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 900;
}

.selected-meta {
  color: var(--muted);
  font-size: 0.78rem;
}

.selected-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
}

.primary-action {
  min-height: 2.45rem;
  border-radius: 6px;
  color: #17110d;
  background: var(--gold);
  font-weight: 950;
}

.bet-row {
  padding: 0.65rem;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
}

.bet-side {
  display: grid;
  gap: 0.15rem;
  min-width: 0;
}

.bet-side strong {
  overflow: hidden;
  font-size: 0.88rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bet-side span,
.bet-amount span {
  color: var(--muted);
  font-size: 0.72rem;
}

.bet-amount {
  display: grid;
  justify-items: end;
  color: var(--gold);
  font-weight: 900;
  white-space: nowrap;
}

.form-list {
  padding: 0;
  list-style: none;
  counter-reset: form;
}

.form-list li {
  min-height: 2.2rem;
  color: var(--muted);
  font-size: 0.83rem;
}

.form-list li::before {
  display: grid;
  width: 1.4rem;
  height: 1.4rem;
  place-items: center;
  border-radius: 5px;
  color: #17110d;
  background: var(--paper);
  content: counter(form);
  counter-increment: form;
  font-size: 0.72rem;
  font-weight: 950;
}

.form-score {
  color: var(--green);
  font-weight: 900;
}

.empty-state {
  padding: 1rem;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  padding: 1rem;
  place-items: center;
  background: rgba(0, 0, 0, 0.68);
}

.bet-modal {
  width: min(100%, 31rem);
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.terms-modal {
  width: min(100%, 42rem);
}

.terms-content {
  margin-top: 1rem;
}

.deposit-instructions-modal {
  width: min(100%, 48rem);
}

.deposit-steps {
  display: grid;
  gap: 1.4rem;
  margin-top: 1rem;
}

.deposit-note {
  padding: 0.75rem 0.85rem;
  border: 1px solid rgba(98, 168, 255, 0.32);
  border-radius: 8px;
  color: var(--paper);
  background: rgba(98, 168, 255, 0.08);
  font-size: 0.9rem;
  line-height: 1.4;
}

.deposit-note + .stake-input {
  margin-top: 0.9rem;
}

.deposit-step {
  display: grid;
  grid-template-columns: 2.4rem minmax(0, 1fr);
  gap: 0.85rem;
  align-items: start;
}

.deposit-step-number {
  display: grid;
  width: 2.15rem;
  height: 2.15rem;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  font-weight: 950;
}

.deposit-step h3 {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.2;
}

.deposit-step p {
  margin: 0.45rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.45;
}

.deposit-step code,
.deposit-inline-actions code {
  display: inline-flex;
  align-items: center;
  min-height: 2.2rem;
  padding: 0.28rem 0.55rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 6px;
  color: var(--paper);
  background: rgba(255, 255, 255, 0.05);
  font-family: "Cascadia Mono", "Consolas", monospace;
  font-size: 0.95rem;
  font-weight: 850;
}

.deposit-inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
  margin-top: 0.7rem;
}

.deposit-rate-line {
  color: var(--muted);
  font-size: 0.86rem;
}

.copy-token-button {
  min-height: 2.2rem;
  padding: 0 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 6px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  font-weight: 850;
}

.copy-token-button:hover {
  color: var(--text);
  background: var(--surface-2);
}

.deposit-inline-actions a {
  color: #62a8ff;
  font-weight: 850;
}

.deposit-inline-actions a:hover {
  color: #8fc1ff;
}

.modal-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
}

.modal-header h2 {
  margin: 0.2rem 0 0;
}

.close-modal {
  color: var(--muted);
}

.modal-match,
.side-picker,
.stake-input,
.modal-preview {
  margin-top: 0.9rem;
}

.modal-match {
  display: grid;
  gap: 0.35rem;
  padding: 0.75rem;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
}

.side-picker,
.picker-block {
  display: grid;
  gap: 0.65rem;
}

.picker-block > span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.picker-buttons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
}

.odds-buttons {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.picker-buttons button {
  min-height: 3rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  background: var(--surface-2);
  font-weight: 900;
}

.picker-buttons button.is-active {
  border-color: rgba(215, 168, 77, 0.65);
  color: var(--text);
  background: rgba(215, 168, 77, 0.15);
}

.stake-input {
  display: grid;
  gap: 0.4rem;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
}

.stake-input input {
  width: 100%;
  min-height: 2.6rem;
  padding: 0 0.75rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  background: var(--surface-2);
}

.modal-preview {
  display: flex;
  justify-content: space-between;
  padding: 0.75rem 0;
  border-top: 1px solid var(--line-soft);
  color: var(--muted);
}

.modal-preview strong {
  color: var(--gold);
}

.modal-backdrop[hidden] {
  display: none;
}

.login-page {
  display: grid;
  min-height: calc(100vh - 4.5rem);
  padding: 1rem;
  place-items: center;
}

.login-card {
  display: grid;
  gap: 1rem;
  width: min(100%, 31rem);
  padding: 1.1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(215, 168, 77, 0.12), rgba(218, 82, 72, 0.08)),
    var(--surface);
  box-shadow: var(--shadow);
}

.login-card h1 {
  margin: 0.2rem 0 0;
  font-size: 1.65rem;
  line-height: 1.1;
}

.login-form {
  display: grid;
  gap: 0.85rem;
}

.login-form label {
  display: grid;
  gap: 0.4rem;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.login-form input {
  width: 100%;
  min-height: 2.7rem;
  padding: 0 0.75rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  background: var(--surface-2);
}

.login-help {
  display: grid;
  gap: 0.7rem;
  padding: 0.85rem;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background:
    repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 5px),
    rgba(16, 16, 15, 0.38);
  color: var(--muted);
  font-family: "Cascadia Mono", "Consolas", monospace;
  font-size: 0.84rem;
  line-height: 1.45;
}

.login-help div {
  display: flex;
  gap: 0.55rem;
  align-items: baseline;
}

.login-help p {
  margin: 0;
}

.login-help strong,
.login-help a {
  color: #74ff5f;
  font-weight: 900;
}

.login-help a {
  text-decoration: underline;
  text-underline-offset: 0.18rem;
}

.login-status {
  padding: 0.75rem;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
  font-size: 0.84rem;
}

.login-status.success {
  border-color: rgba(79, 181, 121, 0.45);
  color: var(--green);
}

.login-status.error {
  border-color: rgba(218, 82, 72, 0.5);
  color: #ff9288;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.detail-page {
  width: min(100%, 1500px);
  margin: 0 auto;
  padding: 1rem;
}

.match-detail-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(13rem, 18rem) minmax(0, 1fr);
  gap: 1rem;
  align-items: stretch;
  min-height: 15rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(115deg, rgba(215, 168, 77, 0.14), transparent 36%),
    linear-gradient(245deg, rgba(218, 82, 72, 0.16), transparent 36%),
    var(--surface);
}

.faction-detail-hero {
  grid-template-columns: minmax(0, 1fr) minmax(15rem, 22rem);
}

.faction-identity {
  justify-items: start;
  text-align: left;
}

.faction-metric-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.detail-team,
.detail-center {
  display: grid;
  gap: 0.55rem;
  align-content: center;
  justify-items: center;
  min-width: 0;
  padding: 1rem;
  text-align: center;
}

.detail-team h1 {
  max-width: 100%;
  margin: 0;
  overflow: hidden;
  font-size: clamp(1.35rem, 3vw, 2.35rem);
  line-height: 1.05;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-team span,
.detail-center span,
.detail-center small {
  color: var(--muted);
  font-size: 0.82rem;
}

.detail-team strong {
  color: var(--gold);
  font-size: 1rem;
}

.detail-center {
  border-inline: 1px solid var(--line-soft);
}

.faction-center {
  border-left: 1px solid var(--line-soft);
  border-right: 0;
}

.detail-vs {
  color: var(--paper);
  font-size: 2.25rem;
  font-weight: 950;
  line-height: 1;
}

.detail-countdown {
  color: var(--gold);
  font-size: 1.25rem;
}

.match-tabs {
  display: flex;
  gap: 0.35rem;
  align-items: center;
  margin: 1rem 0;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
}

.match-tabs a {
  min-height: 2.55rem;
  padding: 0.7rem 0.9rem;
  border: 1px solid transparent;
  border-bottom: 0;
  border-radius: 6px 6px 0 0;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 850;
  white-space: nowrap;
}

.match-tabs a:hover,
.match-tabs a:first-child {
  border-color: var(--line);
  color: var(--text);
  background: var(--surface);
}

.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(18rem, 22rem);
  gap: 1rem;
  align-items: start;
}

.detail-main,
.detail-side {
  display: grid;
  gap: 1rem;
  min-width: 0;
}

.detail-panel {
  scroll-margin-top: 5rem;
}

.match-score-overview {
  display: grid;
  gap: 0.75rem;
  margin-top: 0.85rem;
  padding: 0.85rem;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(255, 131, 93, 0.08), rgba(157, 202, 76, 0.08)),
    rgba(255, 255, 255, 0.03);
}

.match-score-overview + .metric-grid {
  margin-top: 0.85rem;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.65rem;
  margin-top: 0.85rem;
}

.metric {
  display: grid;
  gap: 0.25rem;
  min-height: 4.5rem;
  padding: 0.75rem;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
}

.metric span {
  color: var(--muted);
  font-size: 0.74rem;
}

.metric strong {
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 0.94rem;
}

.comparison-bars {
  display: grid;
  gap: 0.75rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line-soft);
}

.comparison-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.4rem;
  color: var(--muted);
  font-size: 0.78rem;
}

.comparison-label strong {
  color: var(--text);
}

.comparison-track {
  display: flex;
  height: 0.55rem;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-3);
}

.comparison-track span:first-child {
  background: var(--gold);
}

.comparison-track span:last-child {
  background: var(--red);
}

.strength-split {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 2.5rem minmax(0, 1fr);
  gap: 0.85rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line-soft);
}

.strength-divider {
  display: grid;
  align-items: stretch;
  justify-items: center;
  color: var(--subtle);
  font-size: 0.72rem;
  font-weight: 950;
}

.strength-divider::before {
  width: 1px;
  min-height: 100%;
  background: linear-gradient(180deg, transparent, var(--line), transparent);
  content: "";
  grid-area: 1 / 1;
}

.strength-divider span {
  display: grid;
  width: 2rem;
  height: 2rem;
  place-items: center;
  align-self: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  grid-area: 1 / 1;
}

.strength-side {
  display: grid;
  gap: 0.8rem;
  min-width: 0;
}

.strength-side.right .strength-title,
.strength-side.right .strength-label {
  text-align: right;
}

.strength-title {
  display: flex;
  gap: 0.5rem;
  align-items: baseline;
  justify-content: space-between;
  min-width: 0;
}

.strength-title strong {
  overflow: hidden;
  font-size: 0.92rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.strength-title span {
  color: var(--muted);
  font-size: 0.75rem;
  white-space: nowrap;
}

.strength-row {
  display: grid;
  gap: 0.4rem;
}

.strength-label {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.78rem;
}

.strength-label strong {
  color: var(--text);
  font-size: 0.9rem;
}

.strength-track {
  height: 0.58rem;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-3);
}

.strength-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(215, 168, 77, 0.72), var(--gold));
}

.strength-side.right .strength-track span {
  margin-left: auto;
  background: linear-gradient(90deg, var(--red), rgba(218, 82, 72, 0.72));
}

.roster-grid,
.history-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
  margin-top: 0.85rem;
}

.roster-block,
.history-column {
  min-width: 0;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
}

.roster-title {
  display: flex;
  gap: 0.65rem;
  align-items: center;
  min-width: 0;
  padding: 0.75rem;
  border-bottom: 1px solid var(--line-soft);
}

.roster-title h3,
.history-column h3 {
  margin: 0;
  overflow: hidden;
  font-size: 0.95rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.roster-title span {
  color: var(--muted);
  font-size: 0.76rem;
}

.roster-table {
  max-height: 34rem;
  overflow: auto;
}

.roster-row {
  display: grid;
  grid-template-columns: minmax(7rem, 1fr) 3rem minmax(5.5rem, 0.65fr);
  gap: 0.55rem;
  align-items: center;
  min-height: 2.8rem;
  padding: 0.48rem 0.65rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--muted);
  font-size: 0.79rem;
}

.faction-roster-row {
  grid-template-columns: minmax(8rem, 1fr) 3rem minmax(5.8rem, 0.62fr);
}

.roster-row:last-child {
  border-bottom: 0;
}

.roster-row strong {
  display: block;
  overflow: hidden;
  color: var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.roster-row small {
  display: block;
  overflow: hidden;
  color: var(--subtle);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.roster-head {
  position: sticky;
  top: 0;
  z-index: 1;
  min-height: 2rem;
  color: var(--subtle);
  background: var(--surface-2);
  font-size: 0.7rem;
  font-weight: 900;
  text-transform: uppercase;
}

.sort-header {
  display: flex;
  gap: 0.25rem;
  align-items: center;
  justify-content: flex-start;
  min-width: 0;
  min-height: 2rem;
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  font: inherit;
  letter-spacing: 0;
  text-align: left;
  text-transform: uppercase;
}

.sort-header span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sort-header i {
  display: inline-grid;
  width: 0.75rem;
  place-items: center;
  color: var(--gold);
  font-style: normal;
}

.sort-header:hover,
.sort-header.is-active {
  color: var(--paper);
}

.stat-estimate {
  color: var(--gold);
  font-weight: 900;
  white-space: nowrap;
}

.status-dot {
  display: inline-block;
  width: 0.48rem;
  height: 0.48rem;
  margin-right: 0.35rem;
  border-radius: 50%;
  background: var(--subtle);
}

.status-dot.online {
  background: var(--green);
}

.status-dot.idle {
  background: var(--gold);
}

.status-dot.offline {
  background: var(--subtle);
}

.history-column h3 {
  padding: 0.75rem;
  border-bottom: 1px solid var(--line-soft);
}

.war-list {
  display: grid;
}

.war-row {
  display: grid;
  grid-template-columns: 2.2rem minmax(0, 1fr) auto;
  gap: 0.65rem;
  align-items: center;
  min-height: 3.6rem;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.war-row:last-child {
  border-bottom: 0;
}

.war-row strong {
  display: block;
  overflow: hidden;
  font-size: 0.85rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.war-row small {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
}

.war-row > span:last-child {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.result-pill {
  display: grid;
  width: 1.85rem;
  height: 1.85rem;
  place-items: center;
  border-radius: 6px;
  color: #0d1d14;
  background: var(--green);
  font-size: 0.78rem;
  font-weight: 950;
}

.result-pill.loss {
  color: var(--paper);
  background: var(--red);
}

.snapshot-stack {
  display: grid;
  gap: 0.75rem;
  margin-top: 0.85rem;
}

.snapshot-card {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
}

.snapshot-lines {
  display: grid;
  gap: 0.45rem;
  padding: 0.75rem;
}

.snapshot-lines span {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.8rem;
}

.snapshot-lines strong {
  color: var(--text);
}

.detail-bet-button {
  width: 100%;
  margin-top: 0.75rem;
}

.match-bet-list {
  display: grid;
  gap: 0.55rem;
  margin-top: 0.75rem;
}

.match-bet-row {
  display: grid;
  gap: 0.65rem;
  padding: 0.65rem;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
}

.match-bet-row > div:first-child {
  display: grid;
  gap: 0.18rem;
  min-width: 0;
}

.match-bet-row strong {
  overflow: hidden;
  color: var(--text);
  font-size: 0.84rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.match-bet-row span {
  color: var(--muted);
  font-size: 0.73rem;
}

.match-bet-status {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  justify-content: space-between;
}

.compact-action {
  min-height: 1.95rem;
  padding: 0 0.6rem;
  font-size: 0.73rem;
}

@media (max-width: 1180px) {
  .topbar {
    grid-template-columns: 1fr auto;
  }

  .main-nav {
    order: 3;
    grid-column: 1 / -1;
    overflow-x: auto;
  }

  .page-grid {
    grid-template-columns: minmax(0, 1fr) minmax(17rem, 20rem);
  }

  .sidebar {
    display: none;
  }
}

@media (max-width: 900px) {
  .topbar {
    position: static;
  }

  .page-grid {
    grid-template-columns: 1fr;
  }

  .rightbar {
    grid-row: auto;
  }

  .live-grid {
    grid-template-columns: 1fr;
  }

  .match-card {
    grid-template-columns: 4.5rem minmax(0, 1fr);
  }

  .match-market,
  .match-action {
    grid-column: 2;
  }

  .match-detail-hero,
  .detail-grid,
  .roster-grid,
  .history-grid,
  .metric-grid,
  .strength-split,
  .wallet-stat-grid,
  .wallet-detail-grid,
  .admin-layout,
  .admin-metric-grid,
  .admin-history-grid,
  .admin-bet-match-head,
  .admin-bet-actions,
  .admin-bet-row {
    grid-template-columns: 1fr;
  }

  .admin-bet-summary,
  .admin-bet-row > div:last-child {
    justify-items: start;
    text-align: left;
  }

  .admin-bet-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .result-card,
  .bet-board-card {
    grid-template-columns: 1fr;
  }

  .result-winner,
  .bet-board-side {
    justify-items: start;
    text-align: left;
  }

  .detail-center {
    border-block: 1px solid var(--line-soft);
    border-inline: 0;
  }

  .strength-divider {
    min-height: 2.5rem;
  }

  .strength-divider::before {
    width: 100%;
    height: 1px;
    min-height: 0;
    background: linear-gradient(90deg, transparent, var(--line), transparent);
  }

  .strength-side.right .strength-title,
  .strength-side.right .strength-label {
    text-align: left;
  }

  .strength-side.right .strength-track span {
    margin-left: 0;
  }
}

@media (max-width: 620px) {
  .topbar {
    padding: 0.75rem;
  }

  .top-actions {
    grid-column: 1 / -1;
    justify-content: stretch;
  }

  .search {
    width: 100%;
    min-width: 0;
  }

  .top-search {
    width: 100%;
    min-width: 0;
  }

  .faction-search-results {
    left: 0;
    right: auto;
    width: 100%;
  }

  .top-list-search {
    width: 100%;
    min-width: 0;
  }

  .account-button span:last-child {
    display: none;
  }

  .page-grid {
    padding: 0.75rem;
  }

  .headline-strip {
    align-items: stretch;
    flex-direction: column;
  }

  .market-total {
    min-width: 0;
  }

  .selected-vs {
    grid-template-columns: 1fr;
  }

  .picker-buttons,
  .odds-buttons {
    grid-template-columns: 1fr;
  }

  .live-scoreboard {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .live-target {
    grid-column: 1 / -1;
    justify-items: start;
    order: -1;
    text-align: left;
  }

  .live-team strong {
    font-size: 1.7rem;
  }

  .live-card-footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.25rem;
  }

  .live-card-footer span {
    white-space: normal;
  }

  .detail-page {
    padding: 0.75rem;
  }

  .detail-team h1 {
    white-space: normal;
  }

  .roster-row {
    grid-template-columns: minmax(7rem, 1fr) 2.7rem minmax(5.2rem, 0.8fr);
  }

  .faction-roster-row {
    grid-template-columns: minmax(7rem, 1fr) 2.7rem minmax(5.2rem, 0.8fr);
  }

  .faction-list-row {
    grid-template-columns: 2.5rem minmax(0, 1fr) minmax(5rem, auto);
  }

  .faction-list-row span:last-child {
    display: none;
  }

}
