/* ───────────────────────────────────────────────
   1ball.pk — shared styles (tokens, header, footer, multi-stream)
   Light by default, follows the device's dark mode automatically.
   ─────────────────────────────────────────────── */
:root {
  --bg: #eef1f8;
  --surface: #ffffff;
  --surface-2: #f5f7fc;
  --ink: #0b1033;
  --muted: #5b6385;
  --line: #dce1f0;
  --accent: #2b3bff;
  --accent-ink: #ffffff;
  --live: #ff4d2e;
  --shadow: 0 1px 2px rgba(11, 16, 51, .06), 0 6px 20px rgba(11, 16, 51, .05);

  --font-display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --font-body: "Figtree", "Segoe UI", system-ui, -apple-system, sans-serif;

  --wrap: 1600px;
  --gutter: clamp(14px, 3vw, 28px);
  --header-h: 60px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a0d1f;
    --surface: #121735;
    --surface-2: #181e42;
    --ink: #eef0ff;
    --muted: #9aa2cc;
    --line: #242b57;
    --accent: #7b88ff;
    --accent-ink: #0a0d1f;
    --live: #ff6a4d;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .25);
  }
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
img { max-width: 100%; }

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ── Header ───────────────────────────────────── */
.header {
  position: sticky;
  top: 0;
  z-index: 1000;
  height: var(--header-h);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.header-content {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.brand {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.4rem;
  letter-spacing: -.03em;
  line-height: 1;
}
.brand-name { line-height: 1; }
.brand-tld { color: var(--muted); font-weight: 600; }
.brand-tagline {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: .6875rem;
  letter-spacing: .02em;
  line-height: 1.2;
  color: var(--muted);
  white-space: nowrap;
}

.header-right { display: flex; align-items: center; gap: 8px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font: 600 .875rem/1 var(--font-body);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color .15s, border-color .15s;
}
@media (hover: hover) { .btn:hover { border-color: var(--accent); } }
.btn-solid {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}
@media (hover: hover) { .btn-solid:hover { filter: brightness(1.08); } }
.btn svg { flex: none; }

/* ── Mirror links ─────────────────────────────── */
.mirrors {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  font-size: .875rem;
  color: var(--muted);
}
.mirrors a {
  text-decoration: none;
  font-weight: 600;
  color: var(--ink);
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
}
@media (hover: hover) { .mirrors a:hover { border-color: var(--accent); color: var(--accent); } }

/* ── Footer ───────────────────────────────────── */
.section-footer {
  margin-top: auto;
  padding: 28px 0 36px;
  color: var(--muted);
  font-size: .8125rem;
  line-height: 1.6;
  text-align: center;
}
.section-footer p { margin: 0 auto; max-width: 70ch; border-top: 1px solid var(--line); padding-top: 20px; text-align: center; }

.live-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--live);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--live) 60%, transparent);
  animation: pulse 2s infinite;
  flex: none;
}
@keyframes pulse {
  70% { box-shadow: 0 0 0 7px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

/* ── Phones ───────────────────────────────────── */
@media (max-width: 640px) {
  :root { --header-h: 56px; }
  .brand { font-size: 1.25rem; }
  .btn { padding: 0 14px; min-height: 38px; }
  .btn .btn-label { display: none; }
  .btn-icon { width: 38px; padding: 0; }
  /* Discord button always shows its label, like desktop */
  .btn-discord { width: auto; padding: 0 14px; }
  .btn-discord .btn-label { display: inline; }
  /* Slim footer on small screens */
  .section-footer { padding: 14px 0 18px; font-size: .75rem; }
  .section-footer p { padding-top: 12px; }
}

/* ── MULTI STREAM OVERLAY ─────────────────────── */
#msOverlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 8, 24, .78);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.ms-modal {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 20px;
  width: 100%;
  max-width: 1160px;
  height: 88vh;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.ms-modal-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.ms-modal-title { font: 800 1.1rem var(--font-display); letter-spacing: -.02em; }
.ms-modal-sub { font-size: .8125rem; color: var(--muted); flex: 1; }
.ms-close-btn {
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink);
  padding: 8px 16px;
  border-radius: 999px;
  cursor: pointer;
  font: 600 .8125rem var(--font-body);
}
@media (hover: hover) { .ms-close-btn:hover { border-color: var(--accent); } }

.ms-panels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 14px;
  flex: 1;
  overflow: hidden;
  min-height: 0;
  height: 0;
}
.ms-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
  height: 100%;
}
.ms-search-area { display: flex; flex-direction: column; height: 100%; min-height: 300px; }
.ms-search-wrap { padding: 10px; border-bottom: 1px solid var(--line); flex-shrink: 0; }
.ms-search-input {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  padding: 10px 12px;
  font: 500 16px var(--font-body); /* 16px stops iOS zoom */
}
.ms-search-input::placeholder { color: var(--muted); }
.ms-results { flex: 1; overflow-y: auto; padding: 6px 0; }
.ms-result-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--line);
}
@media (hover: hover) { .ms-result-item:hover { background: var(--surface-2); } }
.ms-result-sport {
  font-size: .6875rem;
  font-weight: 700;
  background: var(--surface-2);
  border: 1px solid var(--line);
  padding: 2px 8px;
  border-radius: 999px;
  flex-shrink: 0;
}
.ms-result-title { flex: 1; font-size: .8125rem; line-height: 1.3; }
.ms-result-time { font-size: .75rem; color: var(--muted); flex-shrink: 0; font-variant-numeric: tabular-nums; }
.ms-no-results { padding: 20px; text-align: center; color: var(--muted); font-size: .875rem; }

.ms-player-area { display: flex; flex-direction: column; flex: 1; min-height: 0; overflow: hidden; }
.ms-panel-topbar {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px;
  border-bottom: 1px solid var(--line); flex-shrink: 0;
}
.ms-panel-title { flex: 1; font-size: .75rem; font-weight: 700; line-height: 1.3; }
.ms-change-btn {
  background: var(--surface-2); border: 1px solid var(--line); color: var(--ink);
  padding: 5px 12px; border-radius: 999px; cursor: pointer; font: 600 .75rem var(--font-body); flex-shrink: 0;
}
@media (hover: hover) { .ms-change-btn:hover { border-color: var(--accent); } }
.ms-stream-btns {
  display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 10px;
  flex-shrink: 0; border-bottom: 1px solid var(--line);
}
.ms-stream-btn {
  background: var(--surface-2); border: 1px solid var(--line); color: var(--muted);
  padding: 5px 12px; border-radius: 999px; cursor: pointer; font: 600 .75rem var(--font-body);
}
.ms-stream-btn.active { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
@media (hover: hover) { .ms-stream-btn:hover:not(.active) { color: var(--ink); border-color: var(--accent); } }
.ms-iframe-wrap { flex: 1; position: relative; min-height: 200px; background: #000; }
.ms-iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: none; }

@media (max-width: 700px) {
  #msOverlay { padding: 0; align-items: flex-start; }
  .ms-modal { border-radius: 0; height: 100dvh; max-height: 100dvh; border: none; }
  .ms-panels { grid-template-columns: 1fr; overflow-y: auto; gap: 10px; padding: 10px; }
  .ms-panel { min-height: 420px; height: auto; flex-shrink: 0; }
  .ms-player-area { min-height: 420px; }
  .ms-stream-btns { max-height: 76px; overflow-y: auto; }
  .ms-iframe-wrap { min-height: 240px; }
  .ms-search-area { min-height: 300px; }
  .ms-modal-sub { display: none; }
}
