/* ==========================================================================
   SoCalSMP Arena — shared stylesheet (public viewer + host panel)
   ========================================================================== */

:root {
  --bg: #0a0812;
  --bg-raised: #14101f;
  --bg-card: #1b1629;
  --border: #2e2542;
  --border-soft: #221c33;

  --purple: #a855f7;
  --purple-bright: #c084fc;
  --purple-dim: #6b3fa0;
  --gold: #f2c14e;
  --gold-bright: #ffd873;

  --text: #f3f0fa;
  --text-muted: #a79cc2;
  --text-faint: #6f6485;

  --font-display: "Press Start 2P", "Rajdhani", system-ui, sans-serif;
  --font-body: "Rajdhani", system-ui, -apple-system, "Segoe UI", sans-serif;

  --radius: 10px;
  --shadow-glow: 0 0 24px rgba(168, 85, 247, 0.25);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background:
    radial-gradient(ellipse 900px 500px at 50% -10%, rgba(168, 85, 247, 0.16), transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.4;
}

h1, h2, h3 {
  margin: 0;
}

a {
  color: var(--purple-bright);
}

/* ---------- Connection-lost banner ---------- */

.connection-lost-banner {
  background: #b91c1c;
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  text-align: center;
  padding: 0.6em 1em;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
}

/* ---------- Header ---------- */

.site-header {
  border-bottom: 1px solid var(--border-soft);
  background: rgba(10, 8, 18, 0.85);
  backdrop-filter: blur(6px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.site-header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.logo {
  height: 44px;
  width: auto;
  filter: drop-shadow(0 0 10px rgba(168, 85, 247, 0.45));
}

.site-title {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.site-title-main {
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.03em;
}

.site-title-sub {
  font-size: 0.8rem;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  height: min(60vh, 480px);
  min-height: 260px;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  border-bottom: 1px solid var(--border-soft);
}

.hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-video-fallback {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to top, rgba(8, 6, 14, 0.96) 0%, rgba(8, 6, 14, 0.55) 45%, rgba(8, 6, 14, 0.35) 100%),
    linear-gradient(to right, rgba(8, 6, 14, 0.35), transparent 40%, transparent 60%, rgba(8, 6, 14, 0.35));
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem 2rem;
  width: 100%;
}

.hero-eyebrow {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  color: var(--bg);
  background: var(--gold);
  padding: 0.4em 0.7em;
  border-radius: 999px;
  margin-bottom: 0.9rem;
  animation: pulse-glow 2s ease-in-out infinite;
}

.hero-eyebrow.is-ended {
  background: #6b7280;
  color: #f3f0fa;
  animation: none;
}

.hero-eyebrow.is-not-started {
  background: var(--purple);
  color: #f3f0fa;
  animation: none;
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 0 rgba(242, 193, 78, 0); }
  50% { box-shadow: 0 0 14px rgba(242, 193, 78, 0.7); }
}

.starts-at {
  margin: 0.6rem 0 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--purple-bright);
}

.sync-status {
  margin: 0.75rem 0 0;
  font-size: 0.8rem;
  color: var(--text-faint);
}

.sync-status.is-error {
  color: #f87171;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 4.5vw, 2.6rem);
  color: var(--text);
  text-shadow: 0 0 18px rgba(168, 85, 247, 0.55), 0 0 46px rgba(168, 85, 247, 0.3);
  margin-bottom: 0.6rem;
}

.hero-tagline {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 46ch;
  margin: 0;
}

/* ---------- Tabs ---------- */

.now-fighting {
  max-width: 1200px;
  margin: 1rem auto 0;
  padding: 0 1.5rem;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--gold-bright);
  text-shadow: 0 0 10px rgba(242, 193, 78, 0.5);
}

.now-fighting.is-decided {
  color: var(--purple-bright);
  text-shadow: 0 0 10px rgba(168, 85, 247, 0.5);
}

.tabs {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem 1.5rem 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.tab-btn {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--gold);
  background: transparent;
  border: 2px solid var(--gold);
  border-radius: 999px;
  padding: 0.5em 1.4em;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.tab-btn:hover {
  box-shadow: 0 0 16px rgba(242, 193, 78, 0.35);
}

.tab-btn.is-active {
  background: var(--gold);
  color: #241a06;
  box-shadow: 0 0 20px rgba(242, 193, 78, 0.45);
}

.tab-btn.is-featured:not(.is-active)::after {
  content: "●";
  color: var(--purple-bright);
  margin-left: 0.5em;
  font-size: 0.7em;
  vertical-align: middle;
}

/* ---------- Page / layout ---------- */

.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem;
}

/* ---------- Bracket ---------- */

.bracket-rounds {
  display: flex;
  gap: 2.25rem;
  align-items: flex-start;
  overflow-x: auto;
  padding: 0.5rem 0.25rem 1.5rem;
}

.bracket-round {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  min-width: 200px;
}

.bracket-round h3 {
  font-family: var(--font-display);
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  color: var(--gold);
  text-transform: uppercase;
}

.bracket-match {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.bracket-player {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.6rem 0.8rem;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border-soft);
  cursor: default;
}

.bracket-player:last-child {
  border-bottom: none;
}

button.bracket-player {
  cursor: pointer;
}

button.bracket-player:hover:not(:disabled) {
  background: rgba(168, 85, 247, 0.14);
}

button.bracket-player:disabled {
  cursor: not-allowed;
}

.bracket-player.is-winner {
  color: var(--gold-bright);
  background: rgba(242, 193, 78, 0.1);
}

.bracket-player.is-empty {
  color: var(--text-faint);
  font-style: italic;
  font-weight: 500;
}

.bracket-match.is-current-match {
  border-color: var(--gold);
  box-shadow: 0 0 14px rgba(242, 193, 78, 0.4);
}

.match-pin {
  width: 100%;
  font-size: 0.75rem;
  font-weight: 600;
  border: none;
  border-top: 1px solid var(--border-soft);
  border-radius: 0;
  background: transparent;
  color: var(--text-faint);
  padding: 0.4rem 0.6rem;
}

.match-pin:hover:not(:disabled) {
  color: var(--gold);
}

.match-pin.is-active {
  color: var(--gold);
  background: rgba(242, 193, 78, 0.1);
}

.match-pin:disabled {
  cursor: not-allowed;
  opacity: 0.4;
}

.bracket-champion {
  margin-top: 0.5rem;
  display: inline-block;
  font-family: var(--font-display);
  font-size: 1rem;
  color: #241a06;
  background: linear-gradient(135deg, var(--gold-bright), var(--gold));
  padding: 0.8em 1.4em;
  border-radius: var(--radius);
  box-shadow: 0 0 30px rgba(242, 193, 78, 0.45);
}

.bracket-empty {
  color: var(--text-faint);
  font-style: italic;
}

/* ---------- Host panel ---------- */

#connection-settings,
#event-settings {
  max-width: 1200px;
  margin: 1.5rem auto 0;
  padding: 1rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

#connection-settings label,
#event-settings label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
}

#event-settings input[type="text"] {
  width: 100%;
  max-width: 360px;
}

#save-status,
#event-status {
  margin: 0.4rem 0 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.live-indicator {
  margin: 0.6rem 0 0;
  font-size: 0.9rem;
  font-weight: 700;
}

.checkbox-label {
  display: flex !important;
  align-items: center;
  gap: 0.5em;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
}

#event-settings select {
  display: block;
  margin-top: 0.2rem;
}

.section-label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin: 1rem 0 0.5rem;
}

#match-clock-section .host-actions label {
  margin-bottom: 0;
}

#match-clock-section input[type="number"] {
  width: 70px;
}

body > h1 {
  max-width: 1200px;
  margin: 1.5rem auto 0;
  padding: 0 1.25rem;
  font-family: var(--font-body);
  font-size: 1.3rem;
}

#categories {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.25rem 3rem;
}

.host-category {
  margin: 2rem 0;
  padding: 1.25rem;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.host-category h2 {
  font-size: 1.2rem;
  color: var(--gold);
  margin-bottom: 0.75rem;
}

.host-category h3 {
  font-size: 0.9rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.5rem;
}

input[type="text"],
input[type="password"],
input[type="number"],
textarea {
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.5em 0.7em;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
textarea:focus {
  outline: none;
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.25);
}

.host-category textarea {
  width: 100%;
  min-height: 110px;
  margin-top: 0.5rem;
  resize: vertical;
}

button {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.55em 1em;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}

button:hover {
  border-color: var(--purple);
  color: var(--purple-bright);
}

.host-actions button:first-child {
  border-color: var(--gold);
  color: var(--gold);
}

.host-actions button:first-child:hover {
  background: var(--gold);
  color: #241a06;
}

.host-actions {
  margin: 0.9rem 0;
  display: flex;
  gap: 0.6rem;
}

.roster-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 0.6rem;
}

.roster-row {
  display: flex;
  gap: 0.5rem;
}

.roster-row .roster-name {
  flex: 1;
}

.roster-row .roster-skill {
  width: 150px;
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.5em 0.4em;
}

.roster-row .roster-remove {
  padding: 0 0.75em;
  color: var(--text-muted);
}

.roster-row .roster-remove:hover {
  color: #f87171;
  border-color: #f87171;
}

.bulk-add {
  margin: 0.75rem 0;
  color: var(--text-muted);
}

.bulk-add summary {
  cursor: pointer;
  font-size: 0.85rem;
}

/* ---------- Responsive ---------- */

@media (max-width: 640px) {
  .site-title-main {
    font-size: 1rem;
  }

  .hero {
    height: min(50vh, 360px);
  }

  .tab-btn {
    font-size: 0.85rem;
    padding: 0.45em 1.1em;
  }
}
