/* ============================================================
   YouTube Live — tasteful, minimal wireframe
   The stream is the hero; everything else stays quiet.
   ============================================================ */

:root {
  --bg: #0b0c0f;
  --bg-elevated: #14161b;
  --surface: #181b22;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #f5f6f8;
  --text-dim: #a2a8b4;
  --text-faint: #6b7280;
  --accent: #ff3b30;      /* live red */
  --accent-soft: rgba(255, 59, 48, 0.14);
  --radius: 16px;
  --radius-sm: 10px;
  --maxw: 1180px;      /* header / about / footer readable width */
  --stage-maxw: 1600px; /* wider so the video reads as the full-size hero */
  --header-h: 60px;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1200px 600px at 50% -10%, #1b1e27 0%, transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

a { color: inherit; text-decoration: none; }

/* ===================== Header ===================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  background: rgba(11, 12, 15, 0.72);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: var(--stage-maxw);
  height: 100%;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 28px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.brand-mark {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--accent), #ff7a5c);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.header-nav {
  display: flex;
  gap: 22px;
  margin-left: 8px;
  font-size: 14px;
  color: var(--text-dim);
}

.header-nav a { transition: color 0.15s ease; }
.header-nav a:hover { color: var(--text); }

.header-status {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-dim);
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 var(--accent);
  animation: pulse 1.8s infinite;
}

@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(255, 59, 48, 0.55); }
  70%  { box-shadow: 0 0 0 8px rgba(255, 59, 48, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 59, 48, 0); }
}

/* ===================== Stage / hero ===================== */
.stage {
  max-width: var(--stage-maxw);
  margin: 0 auto;
  padding: 32px 24px 24px;
}

.stage-head {
  text-align: center;
  margin-bottom: 22px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin-bottom: 14px;
}

.badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #fff;
  animation: pulse-white 1.6s infinite;
}

@keyframes pulse-white {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.stream-title {
  margin: 0;
  font-size: clamp(24px, 4vw, 40px);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.stream-sub {
  margin: 8px 0 0;
  color: var(--text-dim);
  font-size: 15px;
}

/* ===================== Player ===================== */
/* Mobile-first: video on top, chat stacked below.
   The side-by-side (chat on the right) layout kicks in at >=900px. */
.player-wrap {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  align-items: stretch;
}

.player {
  min-width: 0;
}

.player-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.player-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.player-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background:
    radial-gradient(600px 300px at 50% 40%, #1c1f28 0%, #0b0c0f 70%);
  color: var(--text-dim);
  text-align: center;
  padding: 24px;
}

.placeholder-glyph {
  font-size: 34px;
  color: var(--text-faint);
  margin-bottom: 12px;
}

.placeholder-title {
  margin: 0;
  font-weight: 600;
  color: var(--text);
}

.placeholder-hint {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--text-faint);
}

.placeholder-hint code {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 1px 6px;
  border-radius: 6px;
  font-size: 12px;
}

/* ===================== Chat ===================== */
.chat {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  min-height: 0;
}

.chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border);
}

.chat-close {
  background: none;
  border: none;
  color: var(--text-faint);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
  transition: color 0.15s ease;
}
.chat-close:hover { color: var(--text); }

/* Messages list */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  /* Height when stacked below the video on small screens. */
  min-height: 320px;
  max-height: 460px;
}

.chat-msg {
  font-size: 14px;
  line-height: 1.45;
  word-wrap: break-word;
  overflow-wrap: anywhere;
}
.chat-msg .chat-author {
  font-weight: 650;
  color: var(--text);
  margin-right: 6px;
}
.chat-msg .chat-text { color: var(--text-dim); }

.chat-empty {
  margin: auto;
  color: var(--text-faint);
  font-size: 13px;
  text-align: center;
}

/* Composer */
.chat-composer {
  border-top: 1px solid var(--border);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chat-name {
  width: 100%;
  padding: 8px 11px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 13px;
  font-family: var(--font);
}

.chat-input-row {
  display: flex;
  gap: 8px;
}

.chat-input {
  flex: 1;
  min-width: 0;
  padding: 9px 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px;
  font-family: var(--font);
}

.chat-name::placeholder,
.chat-input::placeholder { color: var(--text-faint); }

.chat-name:focus,
.chat-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.chat-send {
  flex: 0 0 auto;
  padding: 9px 16px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 650;
  font-family: var(--font);
  cursor: pointer;
  transition: filter 0.15s ease;
}
.chat-send:hover { filter: brightness(1.08); }
.chat-send.full { width: 100%; }

/* Account gate */
.chat-auth {
  border-top: 1px solid var(--border);
  padding: 14px 12px;
}
.chat-auth-title {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 650;
  color: var(--text);
}
.chat-auth-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.chat-field {
  width: 100%;
  padding: 9px 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px;
  font-family: var(--font);
}
.chat-field::placeholder { color: var(--text-faint); }
.chat-field:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.chat-auth-msg {
  margin: 0;
  font-size: 12px;
  color: #ffb4ae;
}
.chat-auth-toggle {
  margin: 10px 0 0;
  font-size: 12px;
  color: var(--text-faint);
  text-align: center;
}
.chat-link {
  background: none;
  border: none;
  padding: 0 0 0 4px;
  color: var(--accent);
  font-size: inherit;
  font-family: var(--font);
  font-weight: 600;
  cursor: pointer;
}
.chat-link:hover { text-decoration: underline; }

/* Signed-in bar */
.chat-signedin {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-dim);
}
.chat-signedin-name strong { color: var(--text); }

/* ===================== About + footer ===================== */
.about {
  max-width: var(--stage-maxw);
  margin: 0 auto;
  padding: 28px 24px 60px;
}

.about-inner {
  max-width: 640px;
}

.about h2 {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 650;
}

.about p {
  margin: 0;
  color: var(--text-dim);
  font-size: 15px;
}

.site-footer {
  border-top: 1px solid var(--border);
}

.footer-inner {
  max-width: var(--stage-maxw);
  margin: 0 auto;
  padding: 20px 24px;
  display: flex;
  justify-content: space-between;
  color: var(--text-faint);
  font-size: 13px;
}

/* ===================== Responsive ===================== */
/* Larger screens: chat moves to the RIGHT of the big video and matches its height.
   The video stays the dominant column; the chat is a slim 340px sidebar. */
@media (min-width: 960px) {
  .player-wrap[data-has-chat="true"] {
    grid-template-columns: minmax(0, 1fr) 340px;
  }
  /* Let the video define the row height; the messages list fills it and scrolls. */
  .player-wrap[data-has-chat="true"] .chat-messages {
    min-height: 0;
    max-height: none;
  }
}

@media (max-width: 560px) {
  .header-nav { display: none; }
  .stage { padding-top: 26px; }
}

/* ===================== Footer admin link ===================== */
.footer-meta {
  display: flex;
  align-items: center;
  gap: 16px;
}
.footer-admin {
  color: var(--text-faint);
  transition: color 0.15s ease;
}
.footer-admin:hover { color: var(--text-dim); }

/* ===================== Control panel (admin.html) ===================== */
.admin-main {
  max-width: 620px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
}

.login-card { max-width: 400px; margin: 24px auto 0; }

.card-title {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.card-sub {
  margin: 6px 0 0;
  color: var(--text-dim);
  font-size: 14px;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

/* Fields */
.field {
  display: block;
  margin-top: 18px;
}
.login-card .field:first-of-type { margin-top: 22px; }

.field-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
  margin-bottom: 7px;
}
.field-label .opt { color: var(--text-faint); font-weight: 400; }

.field input {
  width: 100%;
  padding: 11px 13px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px;
  font-family: var(--font);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field input::placeholder { color: var(--text-faint); }
.field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.field-hint {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-faint);
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 480px) {
  .field-grid { grid-template-columns: 1fr; }
}

/* Buttons */
.primary-btn {
  margin-top: 22px;
  padding: 11px 18px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 650;
  font-family: var(--font);
  cursor: pointer;
  transition: filter 0.15s ease, transform 0.05s ease;
}
.primary-btn:hover { filter: brightness(1.08); }
.primary-btn:active { transform: translateY(1px); }

.ghost-btn {
  padding: 10px 16px;
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 550;
  font-family: var(--font);
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.ghost-btn:hover { color: var(--text); border-color: var(--text-faint); }

.btn-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 22px;
}
.btn-row .primary-btn { margin-top: 0; }

/* Messages */
.form-error,
.form-ok {
  margin: 14px 0 0;
  font-size: 13px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
}
.form-error {
  color: #ffb4ae;
  background: var(--accent-soft);
  border: 1px solid rgba(255, 59, 48, 0.3);
}
.form-ok {
  color: #9ff0c4;
  background: rgba(52, 199, 89, 0.12);
  border: 1px solid rgba(52, 199, 89, 0.3);
}

/* Current source */
.current {
  margin-top: 4px;
  padding: 14px 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.current-label {
  font-size: 12px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.current-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 6px;
}
.current-row code {
  font-size: 14px;
  color: var(--text);
}
.current-time { font-size: 12px; color: var(--text-faint); }

/* Preview */
.preview { margin-top: 22px; }
.preview-label {
  display: block;
  font-size: 12px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}
.preview-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.preview-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
