:root {
  --bg: #07110e;
  --bg-elevated: #0d1d17;
  --bg-card: #12261f;
  --bg-card-hover: #183229;
  --border: rgba(167, 243, 208, 0.14);
  --border-strong: rgba(52, 211, 153, 0.35);
  --text: #ecfdf5;
  --text-muted: #94b8aa;
  --primary: #10b981;
  --primary-bright: #34d399;
  --gold: #f59e0b;
  --gold-bright: #fbbf24;
  --danger: #ef4444;
  --info: #38bdf8;
  --radius: 14px;
  --shadow: 0 14px 36px rgba(0, 0, 0, 0.42);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  background:
    radial-gradient(circle at top right, rgba(16, 185, 129, 0.16), transparent 42%),
    radial-gradient(circle at bottom left, rgba(245, 158, 11, 0.10), transparent 36%),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}

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

/* Navbar */
.navbar {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(14px);
  background: rgba(7, 17, 14, 0.86);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.brand-badge {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--primary), var(--gold));
  color: #04120c;
  font-weight: 900;
  font-size: 1rem;
}

.brand-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
  display: block;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.nav-link {
  padding: 0.45rem 0.85rem;
  border-radius: 9px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: all 0.16s ease;
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.nav-link.active {
  background: rgba(16, 185, 129, 0.18);
  color: var(--primary-bright);
  border: 1px solid var(--border-strong);
}

.ws-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.76rem;
  font-weight: 600;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.ws-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold);
}

.ws-pill.connected .ws-dot {
  background: var(--primary-bright);
  box-shadow: 0 0 10px var(--primary-bright);
}

/* Container & Layout */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
}

.grid {
  display: grid;
  gap: 1.25rem;
}

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

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

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

.grid-main-side {
  grid-template-columns: 1.55fr 1fr;
}

@media (max-width: 960px) {
  .grid-main-side,
  .grid-4,
  .grid-3 {
    grid-template-columns: 1fr;
  }
}

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

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.card-title {
  margin: 0;
  font-size: 1.08rem;
  font-weight: 700;
}

.muted {
  color: var(--text-muted);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 0.6rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  transition: transform 0.12s ease, background 0.16s ease, opacity 0.16s ease;
}

.btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.14);
}

.btn:active:not(:disabled) {
  transform: scale(0.98);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), #059669);
  color: #03150e;
  font-weight: 700;
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--primary-bright), var(--primary));
}

.btn-gold {
  background: linear-gradient(135deg, var(--gold-bright), #d97706);
  color: #1f1202;
  font-weight: 800;
}

.btn-danger {
  background: rgba(239, 68, 68, 0.18);
  border-color: rgba(239, 68, 68, 0.45);
  color: #fca5a5;
}

.btn-danger:hover:not(:disabled) {
  background: rgba(239, 68, 68, 0.3);
}

.btn-outline {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--primary-bright);
}

.btn-sm {
  padding: 0.38rem 0.7rem;
  font-size: 0.8rem;
  border-radius: 8px;
}

.btn-lg {
  padding: 0.9rem 1.4rem;
  font-size: 1.05rem;
}

/* Forms */
.form-grid {
  display: grid;
  gap: 0.9rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

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

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-group.full {
  grid-column: 1 / -1;
}

label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
}

input,
select,
textarea {
  width: 100%;
  padding: 0.62rem 0.8rem;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  font-size: 0.92rem;
  font-family: inherit;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary-bright);
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.15);
}

/* Badges & Pills */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.24rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border);
}

.badge-emerald {
  background: rgba(16, 185, 129, 0.16);
  color: var(--primary-bright);
  border-color: rgba(52, 211, 153, 0.35);
}

.badge-gold {
  background: rgba(245, 158, 11, 0.18);
  color: var(--gold-bright);
  border-color: rgba(251, 191, 36, 0.38);
}

.badge-danger {
  background: rgba(239, 68, 68, 0.18);
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.38);
}

.badge-info {
  background: rgba(56, 189, 248, 0.18);
  color: #7dd3fc;
  border-color: rgba(56, 189, 248, 0.38);
}

/* Stats Strip */
.stat-box {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.9rem 1rem;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-value {
  font-size: 1.45rem;
  font-weight: 800;
  margin-top: 0.2rem;
}

/* Auction Spotlight */
.auction-stage {
  position: relative;
  overflow: hidden;
  background: linear-gradient(160deg, #102a21 0%, #0a1713 100%);
  border: 1px solid var(--border-strong);
}

.player-hero {
  display: flex;
  gap: 1.4rem;
  align-items: center;
  flex-wrap: wrap;
}

.player-avatar {
  width: 128px;
  height: 128px;
  border-radius: 18px;
  object-fit: cover;
  border: 2px solid var(--border-strong);
  background: linear-gradient(135deg, #153c2f, #091b14);
  display: grid;
  place-items: center;
  font-size: 2.5rem;
  font-weight: 900;
  color: var(--primary-bright);
  flex-shrink: 0;
}

.bid-display {
  margin-top: 1.2rem;
  padding: 1rem 1.25rem;
  border-radius: 14px;
  background: rgba(7, 17, 14, 0.75);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.bid-amount {
  font-size: clamp(1.9rem, 4vw, 2.8rem);
  font-weight: 900;
  color: var(--gold-bright);
  letter-spacing: -0.02em;
}

.timer-track {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  margin-top: 1rem;
}

.timer-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary-bright), var(--gold-bright));
  transition: width 0.35s linear;
}

.timer-fill.urgent {
  background: linear-gradient(90deg, #ef4444, #f97316);
}

.status-banner {
  margin-top: 1rem;
  padding: 0.85rem 1.1rem;
  border-radius: 12px;
  font-weight: 800;
  text-align: center;
  letter-spacing: 0.03em;
}

.status-banner.sold {
  background: rgba(16, 185, 129, 0.22);
  border: 1px solid var(--primary-bright);
  color: var(--primary-bright);
}

.status-banner.unsold {
  background: rgba(239, 68, 68, 0.18);
  border: 1px solid rgba(239, 68, 68, 0.5);
  color: #fca5a5;
}

/* Tables */
.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

th,
td {
  padding: 0.7rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

th {
  color: var(--text-muted);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
}

tr:hover td {
  background: rgba(255, 255, 255, 0.025);
}

/* Tabs */
.tabs {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.tab-btn {
  padding: 0.55rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
}

.tab-btn.active {
  background: rgba(16, 185, 129, 0.2);
  border-color: var(--border-strong);
  color: var(--primary-bright);
}

/* Team Cards */
.team-card {
  border-left: 4px solid var(--primary);
  background: var(--bg-elevated);
  border-radius: 12px;
  padding: 0.95rem 1rem;
  border-top: 1px solid var(--border);
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: transform 0.14s ease, border-color 0.14s ease;
}

.team-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
}

/* Toast */
.toast-container {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  max-width: 360px;
}

.toast {
  padding: 0.75rem 1rem;
  border-radius: 10px;
  background: #102a21;
  border: 1px solid var(--border-strong);
  color: var(--text);
  box-shadow: var(--shadow);
  font-size: 0.88rem;
  font-weight: 600;
}

.toast.error {
  background: #2b1113;
  border-color: rgba(239, 68, 68, 0.55);
  color: #fecaca;
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(2, 8, 6, 0.75);
  backdrop-filter: blur(5px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-backdrop.open {
  display: flex;
}

.modal {
  width: 100%;
  max-width: 620px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 1.35rem;
  box-shadow: var(--shadow);
}

.hidden {
  display: none !important;
}
