@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Poppins:wght@400;500;600;700;800&display=swap');

:root {
  --bg: #070b1a;
  --bg2: #0d1430;
  --card: rgba(255, 255, 255, 0.05);
  --card2: rgba(255, 255, 255, 0.08);
  --line: rgba(255, 255, 255, 0.1);
  --text: #eef2ff;
  --muted: #94a3c4;
  --gold: #fbbf24;
  --gold2: #f59e0b;
  --green: #22c55e;
  --red: #ef4444;
  --blue: #3b82f6;
  --radius: 16px;
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color: var(--text);
  background: radial-gradient(1200px 600px at 10% -10%, #1e2a6b 0%, transparent 60%),
    radial-gradient(900px 600px at 110% 10%, #0f5132 0%, transparent 55%), var(--bg);
  background-attachment: fixed;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--gold); text-decoration: none; }
h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.2; }
.big-num, .display { font-family: 'Bebas Neue', 'Poppins', sans-serif; letter-spacing: 1px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.hidden { display: none !important; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.grow { flex: 1; }
.container { max-width: 1200px; margin: 0 auto; padding: 20px 16px 60px; }

/* top bar */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 14px; justify-content: space-between;
  padding: 12px 20px; background: rgba(7, 11, 26, .85); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; color: var(--text); }
.brand .ball {
  width: 34px; height: 34px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ff8a8a, #c1121f 55%, #7a0010);
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.15), 0 4px 14px rgba(193,18,31,.5);
  position: relative; flex: none;
}
.brand .ball::after { content: ''; position: absolute; inset: 4px 15px; border-left: 2px dashed rgba(255,255,255,.7); border-right: 2px dashed rgba(255,255,255,.7); transform: rotate(25deg); }
.nav { display: flex; gap: 6px; flex-wrap: wrap; }
.nav a { color: var(--muted); padding: 8px 12px; border-radius: 10px; font-weight: 500; font-size: 14px; }
.nav a:hover, .nav a.active { color: var(--text); background: var(--card2); }

/* cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.card h3 { font-size: 16px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 1px; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 900px) { .g3, .g4, .g5 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) {
  .g2, .g3, .g5 { grid-template-columns: minmax(0, 1fr); }
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat .v { font-size: 28px; }
  .topbar { padding: 10px 12px; gap: 8px; }
  .brand { font-size: 15px; }
  .brand > span:not(.ball):not(.pill) { max-width: 38vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .nav { gap: 2px; }
  .nav a { padding: 6px 7px; font-size: 13px; }
  .container { padding: 14px 12px 50px; }
}

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--line); background: var(--card2); color: var(--text);
  padding: 10px 16px; border-radius: 12px; font: inherit; font-weight: 600; font-size: 14px;
  cursor: pointer; transition: transform .08s, background .2s, opacity .2s; text-decoration: none; white-space: nowrap;
}
.btn:hover { background: rgba(255,255,255,.14); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .4; cursor: not-allowed; transform: none; }
.btn.gold { background: linear-gradient(135deg, var(--gold), var(--gold2)); color: #1a1200; border: 0; }
.btn.green { background: linear-gradient(135deg, #22c55e, #15803d); border: 0; color: #fff; }
.btn.red { background: linear-gradient(135deg, #ef4444, #b91c1c); border: 0; color: #fff; }
.btn.blue { background: linear-gradient(135deg, #3b82f6, #1d4ed8); border: 0; color: #fff; }
.btn.ghost { background: transparent; }
.btn.lg { padding: 14px 22px; font-size: 17px; border-radius: 14px; }
.btn.xl { padding: 18px 26px; font-size: 22px; border-radius: 16px; }
.btn.sm { padding: 6px 10px; font-size: 12px; border-radius: 9px; }
.btn.live { background: linear-gradient(135deg, #ef4444, #b91c1c); color: #fff; border: 0; animation: pulse 1.4s infinite; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(239,68,68,.6); } 50% { box-shadow: 0 0 0 10px rgba(239,68,68,0); } }

/* forms */
label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; font-weight: 500; }
.field { margin-bottom: 14px; }
input, select, textarea {
  width: 100%; padding: 11px 13px; border-radius: 11px; border: 1px solid var(--line);
  background: rgba(0,0,0,.3); color: var(--text); font: inherit; font-size: 15px; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(251,191,36,.18); }
select option { background: #111a3a; }
input[type=checkbox] { width: auto; transform: scale(1.3); margin-right: 8px; accent-color: var(--gold); }
input[type=color] { padding: 2px; height: 44px; }
.check { display: flex; align-items: center; color: var(--text); font-size: 14px; cursor: pointer; margin: 8px 0; }

/* pills/badges */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 600; background: var(--card2); border: 1px solid var(--line); white-space: nowrap; }
.st-registered { background: rgba(148,163,196,.15); color: #cbd5e1; }
.st-available { background: rgba(59,130,246,.18); color: #93c5fd; }
.st-live { background: rgba(239,68,68,.2); color: #fca5a5; }
.st-sold { background: rgba(34,197,94,.18); color: #86efac; }
.st-unsold { background: rgba(245,158,11,.18); color: #fcd34d; }
.st-rejected { background: rgba(100,100,100,.25); color: #9ca3af; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; }
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--red); display: inline-block; animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .2; } }

/* avatar */
.avatar { width: 48px; height: 48px; border-radius: 12px; object-fit: cover; background: linear-gradient(135deg,#334155,#1e293b); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; color: #cbd5e1; flex: none; overflow: hidden; }
.team-logo { border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; color: #fff; flex: none; overflow: hidden; text-shadow: 0 1px 2px rgba(0,0,0,.4); }
.team-logo img { width: 100%; height: 100%; object-fit: cover; }

/* table */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 10px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; }
tr:hover td { background: rgba(255,255,255,.02); }
.table-wrap { overflow-x: auto; }

/* toast */
#toasts { position: fixed; bottom: 20px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 10px; max-width: min(420px, calc(100vw - 40px)); }
.toast { padding: 12px 16px; border-radius: 12px; background: #1e293b; border: 1px solid var(--line); box-shadow: var(--shadow); font-weight: 500; animation: slidein .25s; }
.toast.error { border-color: rgba(239,68,68,.6); background: #3b0d0d; }
.toast.ok { border-color: rgba(34,197,94,.6); background: #0b2e1a; }
@keyframes slidein { from { transform: translateY(20px); opacity: 0; } }

/* modal */
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.7); backdrop-filter: blur(4px); z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal { background: #0f1736; border: 1px solid var(--line); border-radius: 18px; padding: 24px; width: min(640px, 100%); max-height: 92vh; overflow: auto; box-shadow: var(--shadow); }
.modal h2 { font-size: 20px; }

/* stat */
.stat { padding: 16px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); }
.stat .k { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; font-weight: 600; }
.stat .v { font-family: 'Bebas Neue', sans-serif; font-size: 38px; line-height: 1.1; }

/* tabs */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.tabs button { background: transparent; border: 0; color: var(--muted); font: inherit; font-weight: 600; padding: 9px 14px; border-radius: 10px; cursor: pointer; }
.tabs button.active { background: var(--card2); color: var(--gold); }

/* player card (shared) */
.pcard { display: flex; gap: 14px; align-items: center; padding: 12px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); }
.pcard .avatar { width: 56px; height: 56px; }
.pcard .name { font-weight: 700; }

.stars { color: var(--gold); letter-spacing: 1px; white-space: nowrap; line-height: 1; }
.gbadge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 99px; font-weight: 700; white-space: nowrap; color: var(--g); background: color-mix(in srgb, var(--g) 16%, transparent); border: 1px solid color-mix(in srgb, var(--g) 45%, transparent); line-height: 1.5; }
select.gsel { padding: 5px 8px; font-size: 13px; width: auto; min-width: 110px; }
.qgroup { position: sticky; top: 0; z-index: 1; padding: 6px 4px; font-size: 13px; font-weight: 700; color: var(--gold); background: #0b1230; border-bottom: 1px solid var(--line); }

.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.kbd { font-family: ui-monospace, monospace; font-size: 11px; padding: 1px 6px; border-radius: 5px; border: 1px solid var(--line); background: rgba(0,0,0,.3); color: var(--muted); }

/* confetti */
.confetti { position: fixed; top: -20px; width: 10px; height: 16px; z-index: 2000; pointer-events: none; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); } }

/* sold stamp overlay */
.stamp-wrap { position: fixed; inset: 0; z-index: 1500; display: flex; align-items: center; justify-content: center; pointer-events: none; background: radial-gradient(circle, rgba(0,0,0,.55), rgba(0,0,0,.85)); animation: fadein .3s; }
.stamp { text-align: center; animation: stampin .5s cubic-bezier(.2,1.6,.4,1); }
.stamp .word { font-family: 'Bebas Neue', sans-serif; font-size: clamp(90px, 18vw, 240px); line-height: .9; padding: 0 30px; border: 10px solid currentColor; border-radius: 20px; transform: rotate(-8deg); display: inline-block; text-shadow: 0 6px 30px rgba(0,0,0,.6); }
.stamp .sub { margin-top: 30px; font-size: clamp(20px, 3vw, 36px); font-weight: 700; color: #fff; }
@keyframes stampin { from { transform: scale(3); opacity: 0; } }
@keyframes fadein { from { opacity: 0; } }

@media print {
  body { background: #fff; color: #000; }
  .no-print, .topbar { display: none !important; }
}
