﻿:root {
  color-scheme: dark;
  --bg: #111315;
  --panel: #191d20;
  --panel-2: #20262a;
  --line: #30383d;
  --text: #f3f7f4;
  --muted: #9da8a1;
  --green: #3ddc84;
  --green-2: #1fab63;
  --red: #ff6b6b;
  --blue: #64b5f6;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(61, 220, 132, 0.08), transparent 32%),
    radial-gradient(circle at 92% 8%, rgba(100, 181, 246, 0.12), transparent 26%),
    var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px clamp(16px, 4vw, 48px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(17, 19, 21, 0.9);
  backdrop-filter: blur(16px);
}

.brand,
.top-actions,
.wallet,
.round-status,
.match-meta,
.panel-header,
.summary,
.history-row,
.button-row,
.tag-list {
  display: flex;
  align-items: center;
}

.brand {
  gap: 12px;
}

.brand-logo {
  width: 58px;
  height: 58px;
  object-fit: contain;
  border-radius: 8px;
}

.brand strong,
.brand small {
  display: block;
}

.brand small,
.wallet span,
.section-heading p,
.fine-print,
.empty-slip,
.history-empty,
.empty-state span,
.panel-title p,
.message {
  color: var(--muted);
}

.top-actions {
  gap: 10px;
}

.wallet {
  gap: 10px;
  min-height: 44px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.wallet strong::after {
  content: " cr";
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
}

.icon-button,
.text-button {
  border: 0;
  color: var(--text);
  background: transparent;
}

.icon-button {
  min-width: 46px;
  height: 38px;
  border-radius: 6px;
  background: var(--panel-2);
  font-size: 0.84rem;
  font-weight: 700;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 24px;
  width: min(1180px, calc(100% - 32px));
  margin: 28px auto;
}

.board,
.side-column,
.bet-slip {
  min-width: 0;
}

.notice {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  padding: 14px 16px;
  border: 1px solid rgba(61, 220, 132, 0.28);
  border-radius: 8px;
  background: rgba(61, 220, 132, 0.09);
}

.panel,
.match-card,
.bet-slip {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(25, 29, 32, 0.94);
  box-shadow: var(--shadow);
}

.panel,
.match-card,
.bet-slip {
  padding: 18px;
}

.signup-panel {
  width: min(520px, 100%);
  margin: clamp(42px, 10vh, 120px) auto 0;
}

body:has(#signupPanel:not([hidden])) .layout {
  grid-template-columns: 1fr;
}

body:has(#signupPanel:not([hidden])) .notice {
  width: min(720px, 100%);
  margin: 0 auto;
}

.panel-title {
  margin-bottom: 18px;
  text-align: center;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
  margin: 30px 0 18px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(2rem, 4vw, 4rem);
  line-height: 0.96;
  letter-spacing: 0;
}

h2 {
  font-size: 1rem;
}

.round-status {
  gap: 8px;
  flex: 0 0 auto;
  color: var(--green);
  font-weight: 700;
}

.pulse {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 0 6px rgba(61, 220, 132, 0.15);
}

.matches,
.side-column,
.owner-tools,
.form-grid,
.slip-items,
.history {
  display: grid;
  gap: 14px;
}

.match-meta {
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 0.84rem;
}

.league {
  color: var(--blue);
  font-weight: 700;
}

.teams {
  margin: 18px 0;
  font-size: clamp(1.05rem, 2vw, 1.35rem);
}

.match-details {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: -8px 0 16px;
  color: var(--muted);
  font-size: 0.86rem;
}

.match-details strong {
  color: var(--green);
}

.match-details.locked strong {
  color: var(--red);
}

.match-result,
.settle-box {
  margin: -6px 0 16px;
}

.match-result {
  color: var(--green);
  font-weight: 800;
}

.settle-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.settle-box select {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px;
  background: #111315;
  color: var(--text);
}

.settle-box .secondary-button {
  width: auto;
  padding-inline: 14px;
}

.markets {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.odd-button {
  min-height: 68px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--text);
  text-align: left;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.odd-button:hover,
.odd-button.selected {
  border-color: var(--green);
  background: rgba(61, 220, 132, 0.12);
  transform: translateY(-1px);
}

.odd-button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
  transform: none;
}

.odd-button span,
.odd-button strong {
  display: block;
}

.odd-button span {
  color: var(--muted);
  font-size: 0.78rem;
}

.odd-button strong {
  margin-top: 6px;
  font-size: 1.2rem;
}

.delete-match {
  margin-top: 12px;
  color: var(--red);
}

.side-column {
  position: sticky;
  top: 92px;
  align-self: start;
}

.panel-header {
  justify-content: space-between;
  gap: 12px;
}

.panel-header span {
  color: var(--muted);
  font-size: 0.86rem;
}

.compact {
  margin-bottom: 10px;
}

.empty-slip,
.slip-item,
.stake-field,
.summary,
.history-row,
.empty-state {
  border-radius: 8px;
  background: var(--panel-2);
}

.empty-slip,
.empty-state {
  margin-top: 16px;
  padding: 18px;
  text-align: center;
}

.empty-state strong,
.empty-state span {
  display: block;
}

.empty-state span {
  margin-top: 6px;
}

.slip-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 12px;
}

.slip-item small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.remove-button {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 6px;
  background: rgba(255, 107, 107, 0.14);
  color: var(--red);
  font-weight: 800;
}

.form-grid label,
.stake-field {
  display: grid;
  gap: 8px;
  color: var(--muted);
}

.stake-field,
.summary {
  margin-top: 14px;
  padding: 12px;
}

.form-grid input,
.form-grid select,
.stake-field input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 12px;
  background: #111315;
  color: var(--text);
}

.compact-form {
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.summary {
  justify-content: space-between;
  gap: 12px;
}

.summary span,
.summary strong {
  display: block;
}

.summary span {
  color: var(--muted);
  font-size: 0.78rem;
}

.primary-button,
.secondary-button,
.danger-button {
  width: 100%;
  min-height: 46px;
  border: 0;
  border-radius: 8px;
  font-weight: 800;
}

.primary-button {
  margin-top: 14px;
  background: var(--green);
  color: #092113;
}

.secondary-button {
  background: var(--blue);
  color: #061824;
}

.danger-button {
  background: rgba(255, 107, 107, 0.18);
  color: var(--red);
}

.primary-button:disabled {
  cursor: not-allowed;
  background: #4b5550;
  color: #aab3ae;
}

.button-row {
  gap: 10px;
}

.fine-print {
  margin-top: 10px;
  font-size: 0.78rem;
  text-align: center;
}

.left {
  text-align: left;
}

.text-button {
  color: var(--green);
  font-weight: 700;
}

.admin-content {
  margin-top: 14px;
}

.tag-list {
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-2);
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 700;
}

.tag.used {
  color: var(--muted);
  text-decoration: line-through;
  opacity: 0.72;
}

.history {
  max-height: 250px;
  overflow: auto;
}

.admin-bets-panel {
  display: grid;
  gap: 10px;
  padding-top: 8px;
}

.admin-bets-list {
  display: grid;
  gap: 10px;
  max-height: 360px;
  overflow: auto;
}

.admin-bet-row {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
}

.admin-bet-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.admin-bet-head div,
.admin-bet-items {
  display: grid;
  gap: 4px;
}

.admin-bet-head span,
.admin-bet-row small,
.admin-bet-item em {
  color: var(--muted);
}

.admin-bet-head > strong {
  white-space: nowrap;
}

.admin-bet-head > strong.win {
  color: var(--green);
}

.admin-bet-head > strong.lose {
  color: var(--red);
}

.admin-bet-head > strong.pending {
  color: var(--blue);
}

.admin-bet-item {
  display: grid;
  gap: 3px;
  padding: 8px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.history-row {
  justify-content: space-between;
  gap: 10px;
  padding: 10px;
  font-size: 0.9rem;
}

.history-row strong.win {
  color: var(--green);
}

.history-row strong.lose {
  color: var(--red);
}

.history-row strong.pending {
  color: var(--blue);
}

.history-empty {
  padding: 14px 0;
}

.message {
  min-height: 22px;
  margin-top: 12px;
}

@media (max-width: 900px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .side-column {
    position: static;
  }
}

@media (max-width: 620px) {
  .topbar,
  .section-heading,
  .top-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .wallet {
    justify-content: space-between;
  }

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

  .button-row {
    flex-direction: column;
  }

  .admin-bet-head {
    flex-direction: column;
  }

  .admin-bet-head > strong {
    white-space: normal;
  }

  .settle-box {
    grid-template-columns: 1fr;
  }

  .settle-box .secondary-button {
    width: 100%;
  }
}
