/* =========================================================================
 * STGRMatchControl — admin UI styling (hub, teams, control, sources, settings)
 * Dark "operations console" look to match the R6 broadcast vibe.
 * ========================================================================= */
:root {
  --bg:        #06060a;
  --bg-2:      #0c0d14;
  --panel:     #14141d;
  --panel-2:   #1a1a2600;
  --line:      #2a2030;
  --line-2:    #201924;
  --text:      #f3eef2;
  --muted:     #9a8f99;
  --accent:    #e8202a;   /* STGR neon red — primary / brand */
  --accent-2:  #f5b026;   /* STGR gold — secondary accent */
  --accent-rgb: 232,32,42;
  --accent2-rgb: 245,176,38;
  --good:      #38d39f;
  --bad:       #ff4d4d;
  --warn:      #ffc83d;
  --radius:    12px;
  --font: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --cond: "Bebas Neue", "Oswald", "Arial Narrow", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background:
    radial-gradient(1100px 560px at 82% -12%, rgba(var(--accent-rgb),.16), transparent 60%),
    radial-gradient(900px 520px at 0% -5%, rgba(var(--accent2-rgb),.10), transparent 58%),
    radial-gradient(800px 800px at 50% 120%, rgba(var(--accent-rgb),.06), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
  min-height: 100vh;
}
/* subtle moving grid texture behind everything */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(rgba(var(--accent-rgb),.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(var(--accent-rgb),.04) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(circle at 50% 0%, #000 0%, transparent 75%);
  -webkit-mask-image: radial-gradient(circle at 50% 0%, #000 0%, transparent 75%);
}
a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ------------------------------- Top bar -------------------------------- */
.topbar {
  display: flex; align-items: center; gap: 18px;
  padding: 0 22px; height: 66px;
  background: linear-gradient(180deg, rgba(20,16,24,.92), rgba(8,8,12,.92));
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(10px) saturate(1.2);
  box-shadow: 0 1px 0 rgba(var(--accent-rgb),.25), 0 8px 30px rgba(0,0,0,.5);
}

.brand {
  display: flex; align-items: center; gap: 12px;
  text-decoration: none; color: var(--text);
}
.brand:hover { text-decoration: none; }
.brand-logo {
  height: 42px; width: auto; display: block;
  filter: drop-shadow(0 0 10px rgba(var(--accent-rgb),.55));
  transition: transform .2s ease, filter .2s ease;
}
.brand:hover .brand-logo {
  transform: scale(1.05);
  filter: drop-shadow(0 0 16px rgba(var(--accent-rgb),.85));
}
.brand-word {
  font-family: var(--cond); letter-spacing: 2px;
  font-size: 28px; line-height: .9; text-transform: uppercase;
  display: flex; flex-direction: column;
  color: var(--text);
}
.brand-word small {
  color: var(--muted); font-family: var(--font); font-weight: 600;
  font-size: 10px; letter-spacing: 3px; margin-top: 2px;
}
.brand-word small b { color: var(--accent-2); font-weight: 800; }
.nav { display: flex; gap: 4px; margin-left: 10px; flex-wrap: wrap; }
.nav a {
  padding: 9px 15px; border-radius: 8px; color: var(--muted);
  font-weight: 700; font-size: 13px; text-decoration: none;
  text-transform: uppercase; letter-spacing: .6px;
  position: relative; transition: color .15s, background .15s;
}
.nav a:hover { background: rgba(var(--accent-rgb),.10); color: var(--text); text-decoration: none; }
.nav a.active {
  background: linear-gradient(180deg, var(--accent), #a8131b);
  color: #fff; box-shadow: 0 0 16px rgba(var(--accent-rgb),.5);
}
.topbar .spacer { flex: 1; }

/* connection / mode pill */
.status-pill {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12px; font-weight: 600; padding: 6px 12px;
  border-radius: 999px; border: 1px solid var(--line);
  background: var(--panel); color: var(--muted);
}
.status-pill .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); }
.status-pill.live .dot { background: var(--good); box-shadow: 0 0 8px var(--good); }
.status-pill.local .dot { background: var(--warn); box-shadow: 0 0 8px var(--warn); }
.status-pill.off .dot { background: var(--bad); }

/* ------------------------------- Layout --------------------------------- */
.wrap { max-width: 1180px; margin: 0 auto; padding: 24px 22px 80px; }
.grid { display: grid; gap: 18px; }
.grid.cols-2 { grid-template-columns: 1fr 1fr; }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 880px) { .grid.cols-2, .grid.cols-3 { grid-template-columns: 1fr; } }

.card {
  background:
    linear-gradient(180deg, rgba(26,22,32,.85), rgba(12,12,18,.92));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  position: relative;
  backdrop-filter: blur(6px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04), 0 10px 30px rgba(0,0,0,.35);
  overflow: hidden;
}
.card::after {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(var(--accent-rgb),.6), transparent);
  opacity: .5;
}
.card > h2, .card > h3 { margin: 0 0 14px; }
.card .accent-edge {
  position: absolute; left: 0; top: 14px; bottom: 14px; width: 3px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  border-radius: 0 4px 4px 0;
  box-shadow: 0 0 14px rgba(var(--accent-rgb),.7);
}
h1 { font-family: var(--cond); letter-spacing: 1.5px; text-transform: uppercase;
     font-size: 38px; margin: 0 0 6px; line-height: 1; }
h2 { font-size: 16px; text-transform: uppercase; letter-spacing: .8px; color: #ece3ea; }
h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); margin: 18px 0 8px; }
.section-sub { color: var(--muted); margin: 0 0 18px; max-width: 760px; }

/* ------------------------------- Forms ---------------------------------- */
label { display: block; font-size: 12px; color: var(--muted); margin: 0 0 5px;
        text-transform: uppercase; letter-spacing: .5px; }
.field { margin-bottom: 14px; }
input[type=text], input[type=number], input[type=url], select, textarea {
  width: 100%; padding: 10px 12px; background: #0a111c; color: var(--text);
  border: 1px solid var(--line); border-radius: 8px; font-size: 14px;
  font-family: var(--font);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb),.18); }
input[type=color] {
  width: 46px; height: 38px; padding: 2px; background: #0a111c;
  border: 1px solid var(--line); border-radius: 8px; cursor: pointer;
}
.row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 0; }
.row.tight { gap: 8px; }
.inline { display: flex; gap: 8px; align-items: center; }

/* ------------------------------- Buttons -------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 16px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--panel); color: var(--text); cursor: pointer;
  font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px;
  font-family: var(--font); user-select: none; transition: transform .04s ease, filter .15s;
}
.btn:hover { filter: brightness(1.15); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: linear-gradient(180deg, var(--accent), #b6151d); border-color: var(--accent);
  color: #fff; box-shadow: 0 0 18px rgba(var(--accent-rgb),.35); }
.btn.primary:hover { box-shadow: 0 0 24px rgba(var(--accent-rgb),.6); }
.btn.blue    { background: linear-gradient(180deg, var(--accent-2), #c98a14); border-color: var(--accent-2); color: #1a1200;
  box-shadow: 0 0 18px rgba(var(--accent2-rgb),.3); }
.btn.good    { background: var(--good); border-color: var(--good); color: #04231a; }
.btn.bad     { background: transparent; border-color: var(--bad); color: var(--bad); }
.btn.ghost   { background: transparent; }
.btn.sm      { padding: 6px 10px; font-size: 12px; }
.btn.block   { width: 100%; }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn-group { display: flex; gap: 8px; flex-wrap: wrap; }

.stepper { display: inline-flex; align-items: stretch; border: 1px solid var(--line);
  border-radius: 8px; overflow: hidden; }
.stepper button { background: var(--panel); color: var(--text); border: 0; width: 42px;
  font-size: 20px; cursor: pointer; font-weight: 700; }
.stepper button:hover { background: var(--accent); color: #fff; }
.stepper .val { min-width: 64px; display: flex; align-items: center; justify-content: center;
  font-family: var(--cond); font-size: 30px; background: #0a0a10; }

/* segmented control */
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button { background: #0a0a10; color: var(--muted); border: 0; padding: 9px 14px;
  cursor: pointer; font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; }
.seg button.on { background: var(--accent-2); color: #1a1200; }
.seg.atk button.on { background: var(--accent); color: #fff; }

/* toggle switch */
.switch { position: relative; display: inline-block; width: 52px; height: 28px; }
.switch input { display: none; }
.switch .track { position: absolute; inset: 0; background: #1a2435; border: 1px solid var(--line);
  border-radius: 999px; transition: .2s; }
.switch .track::after { content: ""; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px;
  background: var(--muted); border-radius: 50%; transition: .2s; }
.switch input:checked + .track { background: rgba(56,211,159,.25); border-color: var(--good); }
.switch input:checked + .track::after { left: 27px; background: var(--good); }

/* ------------------------------- Tables/lists --------------------------- */
.list { display: flex; flex-direction: column; gap: 8px; }
.list-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  background: #0a111c; border: 1px solid var(--line-2); border-radius: 8px;
}
.list-item .logo-chip {
  width: 40px; height: 40px; border-radius: 8px; object-fit: contain;
  background: #050a12; border: 1px solid var(--line-2); flex: 0 0 auto;
}
.list-item .grow { flex: 1; min-width: 0; }
.list-item .name { font-weight: 700; }
.list-item .sub { color: var(--muted); font-size: 12px; }
.tag { font-family: var(--cond); font-size: 16px; letter-spacing: 1px; padding: 1px 8px;
  border-radius: 5px; background: #050a12; border: 1px solid var(--line); }

/* ---- Saved teams: responsive card grid (wraps both ways) ---------------- */
.team-grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(248px, 1fr));
}
.team-grid .empty { grid-column: 1 / -1; }
.team-card {
  position: relative; overflow: hidden; cursor: pointer;
  display: flex; flex-direction: column; gap: 12px;
  padding: 16px 16px 14px 20px;
  background: #0a111c; border: 1px solid var(--line-2); border-radius: 12px;
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.team-card:hover {
  transform: translateY(-3px); border-color: var(--accent);
  box-shadow: 0 12px 26px rgba(0,0,0,.4);
}
.team-card .tc-stripe { position: absolute; left: 0; top: 0; bottom: 0; width: 6px; }
.team-card .tc-head { display: flex; align-items: center; gap: 12px; }
.team-card .tc-logo {
  width: 58px; height: 58px; border-radius: 10px; object-fit: contain;
  background: #050a12; border: 1px solid var(--line-2); flex: 0 0 auto;
}
.team-card .tc-id { min-width: 0; }
.team-card .tc-name {
  font-weight: 800; font-size: 19px; line-height: 1.1;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.team-card .tc-id .tag { margin-top: 5px; display: inline-block; }
.team-card .tc-players { display: flex; flex-wrap: wrap; gap: 6px; min-height: 24px; }
.team-card .tc-chip {
  font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px;
  background: #050a12; border: 1px solid var(--line-2); color: var(--text);
}
.team-card .tc-chip.more { color: var(--muted); }
.team-card .tc-empty { color: var(--muted); font-size: 12px; }
.team-card .tc-foot {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line);
  color: var(--muted); font-size: 12px;
}
.team-card .tc-edit { color: var(--accent); font-weight: 700; }

.player-row { display: flex; gap: 8px; margin-bottom: 8px; }
.player-row input.pname { flex: 2; }
.player-row input.prole { flex: 1; }
.player-row select.crole { flex: 0 0 130px; }
.player-row select.pplat { flex: 0 0 84px; }

.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11px;
  font-weight: 700; text-transform: uppercase; letter-spacing: .5px; }
.pill.atk { background: rgba(var(--accent-rgb),.18); color: var(--accent); }
.pill.def { background: rgba(var(--accent2-rgb),.18); color: var(--accent-2); }

/* copy-able URL boxes (sources page) */
.url-box { display: flex; gap: 8px; align-items: center; }
.url-box input { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 12px; }
.hint { color: var(--muted); font-size: 12px; margin-top: 6px; }
.kbd { font-family: ui-monospace, monospace; background:#0a111c; border:1px solid var(--line);
  border-radius:5px; padding:1px 6px; font-size:12px; }

.banner { padding: 12px 16px; border-radius: 8px; margin-bottom: 18px; font-size: 13px;
  border: 1px solid; display: flex; gap: 10px; align-items: center; }
.banner.warn { background: rgba(255,200,61,.08); border-color: rgba(255,200,61,.4); color: #ffdf8a; }
.banner.info { background: rgba(var(--accent2-rgb),.08); border-color: rgba(var(--accent2-rgb),.4); color: #f6dca0; }

.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--good); color: #04231a; padding: 10px 18px; border-radius: 8px; font-weight: 700;
  opacity: 0; transition: .25s; z-index: 100; pointer-events: none; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* hub home tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px,1fr)); gap: 16px; }
.tile { display: block; padding: 24px; border-radius: var(--radius); border: 1px solid var(--line);
  background: linear-gradient(160deg, rgba(26,22,32,.85), rgba(10,10,16,.92)); color: var(--text);
  text-decoration: none; transition: transform .18s ease, border-color .18s, box-shadow .18s;
  position: relative; overflow: hidden; }
.tile::before {
  content: ""; position: absolute; inset: 0; opacity: 0; transition: opacity .18s;
  background: radial-gradient(420px 160px at 50% -20%, rgba(var(--accent-rgb),.18), transparent 70%);
}
.tile:hover { border-color: rgba(var(--accent-rgb),.7); transform: translateY(-4px);
  text-decoration: none; box-shadow: 0 14px 36px rgba(0,0,0,.5), 0 0 0 1px rgba(var(--accent-rgb),.2); }
.tile:hover::before { opacity: 1; }
.tile .ico { font-size: 30px; filter: drop-shadow(0 0 10px rgba(var(--accent-rgb),.4)); }
.tile .t { font-family: var(--cond); font-size: 24px; letter-spacing: 1.5px; text-transform: uppercase;
  margin: 10px 0 4px; position: relative; }
.tile .d { color: var(--muted); font-size: 13px; position: relative; }

.empty { color: var(--muted); text-align: center; padding: 24px; border: 1px dashed var(--line);
  border-radius: 8px; }
.divider { height: 1px; background: var(--line); margin: 18px 0; }
.muted { color: var(--muted); }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }

/* ----------------------------- Theme presets --------------------------- */
.preset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.preset {
  display: flex; flex-direction: column; gap: 8px; text-align: left;
  padding: 10px; background: #0a111c; border: 1px solid var(--line-2);
  border-radius: 10px; cursor: pointer; color: var(--text);
  font-family: var(--font); transition: border-color .15s, transform .04s ease, box-shadow .15s;
}
.preset:hover { border-color: var(--accent-2); }
.preset:active { transform: translateY(1px); }
.preset.active { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(var(--accent-rgb),.35); }
.preset .sw-row { display: flex; gap: 4px; padding: 8px; border-radius: 6px;
  border: 1px solid rgba(255,255,255,.08); }
.preset .sw { width: 22px; height: 22px; border-radius: 5px; flex: 1 1 0;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.4); }
.preset .pl { font-weight: 700; font-size: 13px; }
.preset .pm { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; }
/* Starting Soon backdrop preview tile */
.preset .ssbg-prev { display: block; height: 58px; border-radius: 7px;
  border: 1px solid rgba(255,255,255,.08); background-color: #06080c; }
.ssbg-desc { font-size: 11px; color: var(--muted); line-height: 1.3; }

/* ------------------------------- Hero ----------------------------------- */
.hero {
  position: relative; display: flex; align-items: center; gap: 30px;
  padding: 38px 34px; margin-bottom: 26px;
  border: 1px solid var(--line); border-radius: 16px; overflow: hidden;
  background:
    radial-gradient(600px 300px at 88% -40%, rgba(var(--accent-rgb),.22), transparent 65%),
    linear-gradient(120deg, rgba(20,16,24,.92), rgba(8,8,12,.95));
  box-shadow: 0 18px 50px rgba(0,0,0,.5);
}
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(115deg, transparent 0 22px, rgba(var(--accent-rgb),.035) 22px 23px);
}
.hero-logo {
  width: 150px; height: auto; flex: 0 0 auto; position: relative;
  filter: drop-shadow(0 0 26px rgba(var(--accent-rgb),.55));
  animation: float 5s ease-in-out infinite;
}
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.hero-body { position: relative; z-index: 1; }
.hero .eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--cond); letter-spacing: 4px; text-transform: uppercase;
  font-size: 14px; color: var(--accent-2); margin-bottom: 8px;
}
.hero .eyebrow::before {
  content: ""; width: 26px; height: 2px; background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
}
.hero h1 {
  font-size: 54px; line-height: .92; margin: 0 0 10px;
  background: linear-gradient(180deg, #fff 30%, #d9cdd6);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero h1 .accentword { color: var(--accent); -webkit-text-fill-color: var(--accent);
  text-shadow: 0 0 24px rgba(var(--accent-rgb),.5); }
.hero p { color: var(--muted); max-width: 620px; margin: 0 0 18px; font-size: 15px; line-height: 1.6; }
.hero .cta-row { display: flex; gap: 10px; flex-wrap: wrap; }
@media (max-width: 760px) {
  .hero { flex-direction: column; text-align: center; padding: 30px 20px; }
  .hero h1 { font-size: 40px; }
  .hero .eyebrow { justify-content: center; }
}
