/* aitio.live — premium dark sports streaming */

:root {
  /* Brand palette */
  --bg:          #0A0A0A;
  --bg-card:     #141020;
  --bg-hover:    #1c1630;
  --bg-input:    #110e1a;
  --text:        #F0F0F0;
  --text-muted:  #9A93A8;
  --text-dim:    #5C5670;
  --purple:      #5B2D8E;
  --purple-light:#7B3FA8;
  --purple-glow: rgba(91, 45, 142, 0.4);
  --gold:        #D4A84B;
  --gold-hover:  #E0BA60;
  --gold-dim:    rgba(212, 168, 75, 0.15);
  --red:         #C0392B;
  --red-soft:    #4a1a1a;
  --green:       #22c55e;
  --border:      #2A2040;
  --border-light:#3D3355;
  --radius:      10px;
  --radius-sm:   6px;
  --max-w:       1200px;
  --max-w-narrow:800px;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', sans-serif;
}

/* --- Reset --- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-hover); }

/* Global form element baseline — prevents white-on-white in dark theme */
input, select, textarea {
  background: var(--bg-input);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font);
}
select option {
  background: var(--bg-card);
  color: var(--text);
}

/* --- Header --- */
header {
  background: linear-gradient(180deg, #110e1a 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--border);
  padding: 0.8rem 1.5rem;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
}
nav {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--text);
}
.logo img {
  height: 36px;
  width: auto;
}
.logo-text {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text);
}
.nav-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.lang-switch {
  font-size: 0.8rem;
  display: flex;
  gap: 0.4em;
}
.lang-current {
  color: var(--gold);
  font-weight: 700;
  padding: 0.2em 0.5em;
  background: var(--gold-dim);
  border-radius: var(--radius-sm);
}
.lang-link {
  color: var(--text-muted);
  text-decoration: none;
  padding: 0.2em 0.5em;
  border-radius: var(--radius-sm);
  transition: color 0.2s;
}
.lang-link:hover { color: var(--text); }

/* --- Main --- */
main {
  flex: 1;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 2rem 1.5rem;
  width: 100%;
}

/* --- Section headings --- */
.stream-section { margin-bottom: 2.5rem; }
.stream-section h2 {
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 1.2rem;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

/* --- Category filter chips --- */
.category-filters {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  overflow-x: auto;
  padding-bottom: 0.3rem;
  scrollbar-width: none;
}
.category-filters::-webkit-scrollbar { display: none; }
.filter-chip {
  padding: 0.35rem 0.9rem;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
  font-family: var(--font);
}
.filter-chip:hover { border-color: var(--purple-light); color: var(--text); }
.filter-chip.active {
  background: var(--purple);
  border-color: var(--purple);
  color: white;
}

/* --- Stream Grid --- */
.stream-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.2rem;
}

.stream-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  overflow: hidden;
  transition: border-color 0.25s, transform 0.2s, box-shadow 0.25s;
  display: block;
}
.stream-card:hover {
  border-color: var(--purple-light);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.stream-card.is-live {
  border-color: var(--red);
  box-shadow: 0 0 20px rgba(192, 57, 43, 0.2);
}

.stream-thumb {
  aspect-ratio: 16/9;
  background: #0e0a16;
  position: relative;
  overflow: hidden;
}
.stream-thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-dim);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: linear-gradient(135deg, #110e1a 0%, #1a1430 100%);
}

/* Badges */
.live-badge, .vod-badge {
  position: absolute;
  top: 0.6rem;
  left: 0.6rem;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.live-badge {
  background: var(--red);
  color: white;
  animation: live-pulse 2s ease-in-out infinite;
}
@keyframes live-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(192, 57, 43, 0.5); }
  50% { box-shadow: 0 0 12px 3px rgba(192, 57, 43, 0.3); }
}
.vod-badge {
  background: transparent;
  border: 1px solid var(--gold);
  color: var(--gold);
}

.stream-info { padding: 0.9rem 1rem; }
.stream-info h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
  line-height: 1.3;
}
.stream-info time {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: block;
}
.stream-info .price {
  display: inline-block;
  margin-top: 0.5rem;
  font-weight: 700;
  font-size: 1rem;
  color: var(--gold);
}

/* --- Stream Detail page --- */
.stream-detail { max-width: var(--max-w-narrow); }
.stream-header { margin-bottom: 1.5rem; }
.stream-header h1 {
  font-size: 1.8rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 0.8rem;
}
.stream-meta {
  display: flex;
  gap: 0.8rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  flex-wrap: wrap;
  align-items: center;
}
.category-tag {
  background: var(--purple);
  color: white;
  padding: 0.2rem 0.7rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.stream-description {
  margin-bottom: 2rem;
  color: var(--text-muted);
  line-height: 1.7;
}

/* Purchase box */
.purchase-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
}
.price-display { margin-bottom: 1.2rem; }
.price-amount {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--gold);
}

.access-section {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}
.access-section p {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 0.8rem;
}

.access-granted {
  margin: 2rem 0;
  text-align: center;
}

.live-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--red);
  font-weight: 700;
  margin-top: 1rem;
  font-size: 0.9rem;
}
.live-dot {
  width: 10px;
  height: 10px;
  background: var(--red);
  border-radius: 50%;
  animation: pulse 1.5s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.5rem;
  border-radius: var(--radius-sm);
  border: none;
  font-size: 0.95rem;
  font-weight: 700;
  font-family: var(--font);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
  line-height: 1;
}
.btn-pay, .btn-primary {
  background: var(--gold);
  color: #0A0A0A;
}
.btn-pay:hover, .btn-primary:hover {
  background: var(--gold-hover);
  color: #0A0A0A;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(212, 168, 75, 0.3);
}
.btn-play {
  background: var(--gold);
  color: #0A0A0A;
  font-size: 1.1rem;
  padding: 0.9rem 2.5rem;
}
.btn-play:hover {
  background: var(--gold-hover);
  color: #0A0A0A;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(212, 168, 75, 0.35);
}
.btn-outline {
  background: transparent;
  border: 1px solid var(--border-light);
  color: var(--text);
}
.btn-outline:hover {
  border-color: var(--purple-light);
  background: var(--bg-hover);
  color: var(--text);
}
.btn-danger { background: var(--red); color: white; }
.btn-danger:hover { background: #a93226; }
.btn-small {
  padding: 0.3rem 0.7rem;
  font-size: 0.78rem;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-family: var(--font);
  font-weight: 600;
}
.btn-small.btn-primary { background: var(--gold); color: #0A0A0A; }
.btn-small.btn-danger { background: var(--red); color: white; }

/* --- Inputs --- */
.input {
  width: 100%;
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  color: var(--text);
  font-size: 0.95rem;
  font-family: var(--font);
  transition: border-color 0.2s;
}
.input:focus {
  outline: none;
  border-color: var(--purple-light);
  box-shadow: 0 0 0 3px var(--purple-glow);
}
.input::placeholder { color: var(--text-dim); }

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

.form-label {
  display: block;
  margin-bottom: 0.8rem;
}
.form-label span {
  display: block;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 0.3rem;
}

/* --- Error box --- */
.error-box {
  background: var(--red-soft);
  border: 1px solid rgba(192, 57, 43, 0.4);
  padding: 0.8rem 1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  color: #ff8a80;
  font-size: 0.9rem;
}

/* --- Player page --- */
.player-page { max-width: 1100px; margin: 0 auto; }
.player-container {
  aspect-ratio: 16/9;
  max-height: calc(100vh - 160px);   /* always leave room for header + DVR bar + controls */
  background: #000;
  border-radius: var(--radius) var(--radius) 0 0;
  overflow: hidden;
  position: relative;
}
.player-container video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  cursor: pointer;
}
.player-waiting {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-muted);
  gap: 0.5rem;
  text-align: center;
  padding: 2rem;
}
.player-waiting h2 { color: var(--text); font-size: 1.2rem; }

.stream-info-bar {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.4rem 0;
}
.stream-info-bar h1 {
  font-size: 1.1rem;
  font-weight: 600;
}

/* Player overlay controls (fullscreen, cast) */
.player-controls {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  display: flex;
  gap: 0.4rem;
  z-index: 10;
  opacity: 0;
  transition: opacity 0.3s;
}
.player-container:hover .player-controls { opacity: 1; }
.control-btn {
  background: rgba(0,0,0,0.6);
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #fff;
  transition: background 0.2s;
}
.control-btn:hover { background: rgba(0,0,0,0.85); }
.control-btn svg { stroke: #fff; fill: none; }

/* DVR timeline bar */
.dvr-bar {
  background: var(--surface, #1a1a2e);
  padding: 0.6rem 1rem 0.5rem;
  border-radius: 0 0 8px 8px;
}
.dvr-timeline-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.dvr-time {
  font-size: 0.75rem;
  color: var(--text-muted, #888);
  min-width: 3em;
  font-variant-numeric: tabular-nums;
}
.dvr-time:last-of-type { text-align: right; }
.dvr-track {
  flex: 1;
  height: 6px;
  background: rgba(255,255,255,0.15);
  border-radius: 3px;
  position: relative;
  cursor: pointer;
}
.dvr-fill {
  height: 100%;
  background: var(--accent, #e63946);
  border-radius: 3px 0 0 3px;
  width: 0%;
  pointer-events: none;
}
.dvr-thumb {
  position: absolute;
  top: 50%;
  left: 0%;
  width: 14px;
  height: 14px;
  background: #fff;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 1px 4px rgba(0,0,0,0.5);
  pointer-events: none;
}
/* (dvr-info-row replaced by dvr-transport) */
.dvr-clock {
  font-size: 0.9rem;
  font-weight: 600;
  color: #fff;
  font-variant-numeric: tabular-nums;
}
.dvr-behind {
  font-size: 0.8rem;
  color: var(--gold, #f4a261);
  font-variant-numeric: tabular-nums;
  min-width: 3.5em;
}
.dvr-speed-group {
  display: flex;
  gap: 2px;
  margin-left: auto;
}
.dvr-speed {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
  color: var(--text-muted, #888);
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
}
.dvr-speed:hover { background: rgba(255,255,255,0.2); color: #fff; }
.dvr-speed.dvr-speed-active {
  background: var(--accent, #e63946);
  border-color: var(--accent, #e63946);
  color: #fff;
  font-weight: 600;
}
.dvr-live-btn {
  background: var(--purple, #5B2D8E);
  border: 1px solid var(--gold, #D4A84B);
  color: var(--gold, #D4A84B);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 3px 12px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
}
.dvr-live-btn:hover { background: var(--purple-light, #7B3FA8); color: var(--gold-hover, #E0BA60); }
/* Engaged (you ARE at the live edge): red bg + white text. */
.dvr-live-btn.dvr-live-active {
  background: #dc2626;
  border-color: #dc2626;
  color: #fff;
}
/* REWIND-to-start: opposite colours to LIVE so the jump-to-start / jump-to-live
   pair both stand out. */
#btn-rewind {
  background: var(--gold, #D4A84B);
  border: 1px solid var(--purple, #5B2D8E);
  color: var(--purple, #5B2D8E);
  width: 44px;
}
#btn-rewind:hover { background: var(--gold-hover, #E0BA60); color: var(--purple, #5B2D8E); }
/* Engaged (you ARE in DVR/archive mode): red bg + white text. */
#btn-rewind.rew-active { background: #dc2626; border-color: #dc2626; color: #fff; }

/* Clip mark buttons */
.dvr-mark-group {
  display: flex;
  gap: 3px;
}
.dvr-mark-btn {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  color: var(--text-muted, #888);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 3px;
  transition: all 0.15s;
}
.dvr-mark-btn:hover { background: rgba(255,255,255,0.2); color: #fff; }
.dvr-mark-btn:disabled { opacity: 0.35; cursor: default; }
.dvr-mark-btn.dvr-mark-waiting {
  animation: mark-pulse 1.2s ease-in-out infinite;
  border-color: var(--gold, #f4a261);
}
@keyframes mark-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(244,162,97,0.4); }
  50% { box-shadow: 0 0 8px 2px rgba(244,162,97,0.6); }
}
.dvr-mark-btn.dvr-mark-active {
  background: var(--gold, #f4a261);
  border-color: var(--gold, #f4a261);
  color: #000;
}
.dvr-mark-btn svg { width: 14px; height: 14px; }
.dvr-mark-time {
  font-size: 0.65rem;
  color: var(--gold, #f4a261);
  font-variant-numeric: tabular-nums;
  min-width: 0;
}
.dvr-mark-status {
  font-size: 0.65rem;
  color: var(--green, #22c55e);
  transition: opacity 0.3s;
}

/* Timeline clip markers */
.dvr-clip-region {
  position: absolute;
  top: 0;
  height: 100%;
  background: rgba(244, 162, 97, 0.35);
  border-left: 2px solid var(--gold, #f4a261);
  border-right: 2px solid var(--gold, #f4a261);
  border-radius: 2px;
  pointer-events: none;
  z-index: 1;
}
.dvr-mark-in-flag {
  position: absolute;
  top: -4px;
  width: 2px;
  height: calc(100% + 8px);
  background: var(--gold, #f4a261);
  pointer-events: none;
  z-index: 2;
}
.dvr-mark-in-flag::after {
  content: 'IN';
  position: absolute;
  top: -14px;
  left: -6px;
  font-size: 0.55rem;
  font-weight: 700;
  color: var(--gold, #f4a261);
}

/* Transport controls row */
.dvr-transport {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 0.4rem;
  flex-wrap: wrap;
}
.dvr-btn {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
  color: var(--text-muted, #888);
  width: 32px;
  height: 28px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  padding: 0;
}
.dvr-btn:hover { background: rgba(255,255,255,0.2); color: #fff; }
.dvr-btn:active { background: rgba(255,255,255,0.3); }
.dvr-btn-play {
  width: 38px;
  height: 32px;
  background: var(--accent, #e63946);
  border-color: var(--accent, #e63946);
  color: #fff;
}
.dvr-btn-play:hover { background: #c0313e; }
.dvr-sep {
  width: 1px;
  height: 20px;
  background: rgba(255,255,255,0.15);
  margin: 0 4px;
  flex-shrink: 0;
}

/* Clip list below player */
.clip-list {
  background: var(--surface, #1a1a2e);
  padding: 0.5rem 1rem 0.7rem;
  border-radius: 0 0 8px 8px;
  margin-top: 1px;
}
.clip-list-title {
  font-size: 0.8rem;
  color: var(--text-muted, #888);
  margin: 0 0 0.4rem;
  font-weight: 600;
}
.clip-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  font-size: 0.8rem;
}
.clip-item:last-child { border-bottom: none; }
.clip-range {
  color: #fff;
  font-variant-numeric: tabular-nums;
}
.clip-dur {
  color: var(--text-muted, #888);
  font-variant-numeric: tabular-nums;
  min-width: 3em;
}
.clip-action {
  background: rgba(255,255,255,0.1);
  border: none;
  color: #fff;
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 3px;
  cursor: pointer;
  transition: background 0.15s;
}
.clip-action:hover { background: rgba(255,255,255,0.25); }
.clip-del { color: var(--red, #e63946); margin-left: auto; }
.clip-del:hover { background: rgba(230,57,70,0.2); }
.clip-download { color: var(--green, #2ecc71); text-decoration: none; font-weight: bold; }
.clip-download:hover { background: rgba(46,204,113,0.2); }
.clip-status-tag { color: var(--gold, #f0c040); font-size: 0.7rem; cursor: default; }
.clip-buy-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(255,255,255,0.1);
}
.clip-price-info { display: flex; align-items: baseline; gap: 0.4rem; }
.clip-price-info #clip-price-display {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
}
.clip-price-breakdown {
  font-size: 0.7rem;
  color: var(--text-muted, #888);
}
.clip-buy-btn {
  background: var(--accent, #e63946);
  border: none;
  color: #fff;
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0.4rem 1.2rem;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
}
.clip-buy-btn:hover { background: #c62d3a; }

/* --- Payment providers --- */
.payment-page { max-width: 600px; margin: 0 auto; text-align: center; }
.payment-page h1 {
  margin-bottom: 0.5rem;
  font-size: 1.4rem;
}
.payment-summary {
  margin-bottom: 2rem;
  color: var(--text-muted);
}
.payment-summary .payment-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}
.payment-summary .price-display {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--gold);
  margin-top: 0.5rem;
}
.payment-providers {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.8rem;
  margin-bottom: 2rem;
}
.provider-form { display: contents; }
.provider-btn {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: var(--radius);
  padding: 0.8rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  transition: all 0.2s;
}
.provider-btn:hover {
  border-color: var(--gold);
  box-shadow: 0 0 0 1px var(--gold);
}
.provider-btn img { max-height: 32px; max-width: 100%; }
.payment-back { margin-top: 1rem; }
.payment-back a { color: var(--text-muted); font-size: 0.9rem; }

/* --- Login pages (admin + manager) --- */
.login-page {
  max-width: 340px;
  margin: 4rem auto;
  text-align: center;
}
.login-page h1 {
  font-size: 1.3rem;
  margin-bottom: 1.5rem;
  color: var(--text);
}
.login-page form {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.login-page .btn {
  margin-top: 0.3rem;
  width: 100%;
}
/* back compat: admin-login class */
.admin-login { max-width: 340px; margin: 4rem auto; text-align: center; }
.admin-login input {
  display: block;
  width: 100%;
  padding: 0.65rem 0.8rem;
  margin-bottom: 0.6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  color: var(--text);
  font-size: 0.95rem;
  font-family: var(--font);
}
.admin-login input:focus {
  outline: none;
  border-color: var(--purple-light);
}
.admin-login .btn { width: 100%; }

/* --- Admin pages --- */
.admin-page { max-width: 1000px; }
.admin-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}
.admin-card h2 {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gold);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}
.admin-card h3 {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.stream-form label {
  display: block;
  margin-bottom: 0.8rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.stream-form input, .stream-form textarea, .stream-form select {
  display: block;
  width: 100%;
  padding: 0.5rem 0.7rem;
  margin-top: 0.3rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  color: var(--text);
  font-size: 0.9rem;
  font-family: var(--font);
}
.stream-form input:focus, .stream-form textarea:focus, .stream-form select:focus {
  outline: none;
  border-color: var(--purple-light);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
.admin-table th, .admin-table td {
  padding: 0.55rem 0.6rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.admin-table th {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.admin-table td { color: var(--text); }

/* Worker / status indicators */
.worker-status { padding: 0.8rem; border-radius: var(--radius-sm); }
.worker-running { border-left: 3px solid var(--green); }
.worker-starting { border-left: 3px solid var(--gold); }
.worker-off { color: var(--text-muted); }

.status-live { color: var(--red); font-weight: 700; }
.status-upcoming { color: var(--gold); }
.status-ended { color: var(--text-muted); }
.status-paid { color: var(--green); }
.status-pending { color: var(--text-muted); }

/* Demigod banner */
.demigod-banner {
  background: linear-gradient(90deg, var(--gold-dim) 0%, transparent 100%);
  border: 1px solid rgba(212, 168, 75, 0.3);
  border-radius: var(--radius-sm);
  padding: 0.6rem 1rem;
  margin-bottom: 1rem;
  color: var(--gold);
  font-size: 0.85rem;
  font-weight: 600;
}

/* Port warning */
.port-warning {
  background: var(--red-soft);
  border: 1px solid rgba(192, 57, 43, 0.4);
  border-radius: var(--radius-sm);
  padding: 0.6rem 1rem;
  margin-bottom: 1rem;
  color: #ff8a80;
  font-size: 0.85rem;
}

code {
  background: var(--bg);
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  font-size: 0.82rem;
  border: 1px solid var(--border);
}

/* --- Error page --- */
.error-page { text-align: center; padding: 4rem 0; }
.error-page h1 {
  margin-bottom: 0.5rem;
  font-size: 1.5rem;
}
.error-page p { color: var(--text-muted); margin-bottom: 2rem; }

/* --- Empty state --- */
.empty-state {
  text-align: center;
  padding: 5rem 2rem;
  color: var(--text-dim);
}
.empty-state h2 {
  color: var(--text-muted);
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}

/* --- Footer --- */
footer {
  border-top: 1px solid var(--border);
  padding: 1.2rem 1.5rem;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.8rem;
}

/* ========================================
   RESPONSIVE BREAKPOINTS
   ======================================== */

/* Phone: < 600px */
@media (max-width: 599px) {
  header { padding: 0.6rem 1rem; }
  .logo-text { font-size: 1rem; }
  .logo img { height: 28px; }
  main { padding: 1.2rem 1rem; }
  .stream-grid { grid-template-columns: 1fr; gap: 1rem; }
  .stream-header h1 { font-size: 1.4rem; }
  .purchase-box { padding: 1.5rem 1rem; }
  .price-amount { font-size: 1.8rem; }
  .launch-buttons { flex-direction: column; }
  .player-container { border-radius: 0; margin-left: -1rem; margin-right: -1rem; width: calc(100% + 2rem); }
  .payment-providers { grid-template-columns: repeat(3, 1fr); }
}

/* Tablet: 600px - 1023px */
@media (min-width: 600px) and (max-width: 1023px) {
  .stream-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Desktop: 1024px+ — defaults, no overrides needed */

/* TV / large screen: 1400px+ */
@media (min-width: 1400px) {
  :root { --max-w: 1600px; }
  .stream-grid { grid-template-columns: repeat(4, 1fr); }
  .stream-info h3 { font-size: 1.05rem; }
  .player-page { max-width: 1400px; }
}

/* Utility: hide on mobile */
@media (max-width: 599px) {
  .hide-mobile { display: none !important; }
}
@media (min-width: 600px) {
  .hide-desktop { display: none !important; }
}

/* ---- Help layer + ? toggle (skeleton; fuller content TBD) ---- */
#btn-help { font-weight: 800; font-size: 18px; line-height: 1; }
#help-layer { position: absolute; inset: 0; z-index: 60; background: rgba(0,0,0,0.88);
  display: flex; align-items: center; justify-content: center; padding: 24px; }
#help-layer .help-panel { background: var(--bg-card, #1a1a22); border: 1px solid var(--gold, #D4A84B);
  border-radius: 8px; max-width: 520px; width: 100%; padding: 20px 24px; color: var(--text, #eee); position: relative; }
#help-layer h3 { color: var(--gold, #D4A84B); margin: 0 0 12px; }
#help-layer ul { margin: 0; padding-left: 1.1em; line-height: 1.7; }
#help-layer .help-close { position: absolute; top: 6px; right: 12px; background: transparent; border: none;
  color: var(--text-muted, #999); font-size: 22px; cursor: pointer; }
#help-layer .help-wip { margin: 14px 0 0; color: var(--text-muted, #999); font-size: 0.85em; font-style: italic; }
