/* Core tokens live in base.css; these are channel-page-only. */
:root { --live: #00c44f; --offline: #6d6d7a; }
* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
body { background: var(--bg); color: var(--text); font-family: 'Segoe UI', system-ui, sans-serif; }
.page-content { max-width: clamp(720px, 60vw, 1100px); margin: 0 auto; padding: 40px 24px; }

/* Channel header */
.channel-header { display: flex; align-items: center; gap: 20px; margin-bottom: 32px; }
.avatar-wrap { flex-shrink: 0; }
.channel-avatar,
.channel-avatar-fallback { width: 72px; height: 72px; border-radius: 50%; }
.channel-avatar { object-fit: cover; background: var(--border); }
.channel-avatar-fallback { background: var(--accent); display: flex; align-items: center; justify-content: center; font-size: 1.6rem; font-weight: 700; color: #fff; }
.channel-meta { display: flex; flex-direction: column; gap: 8px; }
h1 { font-size: 1.6rem; }
.badge-row { display: flex; gap: 8px; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; display: inline-block; }
.badge-live { background: #00c44f22; color: var(--live); }
.badge-live::before { background: var(--live); }
.badge-offline { background: #6d6d7a22; color: var(--offline); }
.badge-offline::before { background: var(--offline); }

/* Cockpit stats HUD (mod/broadcaster, live only) */
.cockpit-hud { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; margin-bottom: 20px; display: flex; flex-direction: column; gap: 14px; }
.cockpit-tiles { display: flex; flex-wrap: wrap; gap: 10px; }
.cockpit-tile { flex: 1 1 90px; min-width: 90px; display: flex; flex-direction: column; gap: 3px; padding: 8px 12px; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; }
.cockpit-tile-label { font-size: 0.64rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.cockpit-tile-value { font-size: 1.3rem; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.cockpit-goals { display: flex; flex-direction: column; gap: 10px; }
.cockpit-goal { display: flex; flex-direction: column; gap: 5px; }
.cockpit-goal-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.cockpit-goal-label { font-size: 0.78rem; font-weight: 600; color: var(--text); }
.cockpit-goal-count { font-size: 0.74rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.cockpit-goal-bar { height: 8px; border-radius: 999px; background: var(--border); overflow: hidden; }
.cockpit-goal-fill { height: 100%; background: var(--accent); border-radius: 999px; transition: width .3s ease; }

/* Quick actions (mod/broadcaster) */
.quick-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; margin-bottom: 20px; }
.quick-actions-label { font-size: 0.64rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-right: 2px; }
.quick-action-btn { background: var(--bg); border: 1px solid var(--border); border-radius: 8px; color: var(--text); font-size: 0.74rem; font-weight: 600; padding: 5px 11px; cursor: pointer; transition: color .15s, border-color .15s, background .15s; }
.quick-action-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.quick-action-btn:disabled { opacity: 0.5; cursor: default; }
.quick-action-ad { border-color: var(--danger); color: var(--danger); }
.quick-action-ad:hover:not(:disabled) { border-color: var(--danger); color: var(--accent-text); background: var(--danger); }

/* Quick-action toast */
.qa-toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 1000; max-width: min(90vw, 460px); display: flex; flex-direction: column; gap: 2px; background: var(--card); border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: 8px; padding: 10px 14px; color: var(--text); font-size: 0.82rem; box-shadow: 0 6px 20px rgba(0,0,0,.3); }
.qa-toast-error { border-left-color: var(--danger); }
.qa-toast-link { color: var(--accent); font-size: 0.76rem; word-break: break-all; }

/* Stream panel */
.stream-panel { margin-bottom: 32px; }
.stream-layout { display: flex; gap: 16px; align-items: flex-start; }
.stream-left { flex: 1 1 0; min-width: 0; }
.stream-video { position: relative; width: 100%; padding-top: 56.25%; background: #000; border-radius: 8px; overflow: hidden; }
.stream-video iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: none; }
.stream-info { margin-top: 12px; display: flex; flex-direction: column; gap: 4px; }
.stream-game { font-size: 0.85rem; color: var(--accent); font-weight: 600; }
.stream-title { font-size: 1rem; color: var(--text); }

/* Inline live chat */
.stream-chat-col { width: 340px; flex-shrink: 0; height: 460px; background: var(--card); border: 1px solid var(--border); border-radius: 8px; display: flex; flex-direction: column; overflow: hidden; }
.stream-chat-header { padding: 8px 14px 6px; border-bottom: none; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); flex-shrink: 0; }

/* Tabs */
.stream-chat-tabs { display: flex; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.stream-chat-tab { flex: 1; background: none; border: none; border-bottom: 2px solid transparent; color: var(--muted); font-size: 0.72rem; font-weight: 600; padding: 5px 4px 4px; cursor: pointer; transition: color .15s, border-color .15s; text-transform: uppercase; letter-spacing: 0.04em; }
.stream-chat-tab:hover { color: var(--text); }
.stream-chat-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

.chat-controls { flex-shrink: 0; border-bottom: 1px solid var(--border); padding: 6px 8px; }
.chat-controls-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.chat-mode-chip { background: none; border: 1px solid var(--border); border-radius: 999px; color: var(--muted); font-size: 0.68rem; font-weight: 600; padding: 3px 9px; cursor: pointer; transition: color .15s, border-color .15s, background .15s; text-transform: uppercase; letter-spacing: 0.03em; }
.chat-mode-chip:hover:not(:disabled) { color: var(--text); border-color: var(--text); }
.chat-mode-chip.active { color: var(--accent-text); background: var(--accent); border-color: var(--accent); }
.chat-mode-chip:disabled { opacity: 0.5; cursor: default; }
.chat-mode-slow-secs { width: 46px; background: var(--card); border: 1px solid var(--border); border-radius: 6px; color: var(--text); font-size: 0.7rem; padding: 2px 4px; }
.chat-controls-note { margin: 5px 0 1px; font-size: 0.7rem; color: var(--danger); }

.stream-chat-msgs { flex: 1; overflow-y: auto; padding: 8px 10px; display: flex; flex-direction: column; gap: 3px; }
.stream-chat-msg { font-size: 0.82rem; line-height: 1.4; word-break: break-word; padding: 1px 0; }
.stream-chat-system { font-size: 0.78rem; color: var(--muted); font-style: italic; padding: 3px 0; }
.stream-chat-msg { position: relative; }
.stream-chat-del { display: none; position: absolute; right: 0; top: 0; background: none; border: none; color: var(--muted); font-size: 1rem; line-height: 1; cursor: pointer; padding: 0 2px; }
.stream-chat-del:hover { color: var(--danger); }
.stream-chat-msg:hover .stream-chat-del { display: block; }
.stream-chat-author { font-weight: 700; margin-right: 4px; }
.stream-chat-author.is-bridge { color: #9146ff; }
.stream-chat-bot-badge { display: inline-block; margin-right: 4px; font-size: 0.6rem; font-weight: 900; line-height: 1; padding: 2px 4px; border-radius: 3px; color: #fff; background: #a970ff; letter-spacing: 0.3px; vertical-align: middle; }
.stream-chat-badge { height: 18px; width: auto; vertical-align: middle; margin-right: 3px; display: inline-block; }
.stream-chat-text { color: var(--text); }
.stream-chat-mod-alias { font-weight: 500; color: var(--accent); opacity: 0.9; }
.stream-chat-highlight { padding-left: 7px; border-left: 3px solid var(--accent); background: rgba(145,70,255,0.07); }
.stream-chat-raid-chip { display: inline-block; margin-left: 6px; font-size: 0.66rem; font-weight: 700; line-height: 1; padding: 2px 6px; border-radius: 9px; color: var(--accent); background: rgba(145,70,255,0.16); white-space: nowrap; vertical-align: middle; }
.stream-chat-footer { flex-shrink: 0; border-top: 1px solid var(--border); padding: 8px 10px; }
.stream-chat-input-wrap { display: flex; gap: 6px; align-items: center; }
.stream-chat-color-picker { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--border); padding: 0; cursor: pointer; flex-shrink: 0; background: none; }
.stream-chat-color-picker::-webkit-color-swatch-wrapper { padding: 0; }
.stream-chat-color-picker::-webkit-color-swatch { border-radius: 50%; border: none; }
.stream-chat-input { flex: 1; min-width: 0; background: var(--bg); border: 1px solid var(--border); border-radius: 6px; color: var(--text); font-size: 0.82rem; padding: 6px 8px; }
.stream-chat-input:focus { outline: none; border-color: var(--accent); }
.stream-chat-send { background: var(--accent); color: #fff; border: none; border-radius: 6px; padding: 6px 12px; font-size: 0.8rem; font-weight: 600; cursor: pointer; white-space: nowrap; }
.stream-chat-send:hover { opacity: 0.85; }
.stream-chat-login { text-align: center; font-size: 0.8rem; color: var(--muted); }
.stream-chat-login a { color: var(--accent); text-decoration: none; font-weight: 600; }
.stream-chat-login a:hover { text-decoration: underline; }
@media (max-width: 820px) {
  .stream-layout { flex-direction: column; }
  .stream-chat-col { width: 100%; height: 300px; }
}
.twitch-link { display: inline-block; margin-top: 8px; padding: 5px 14px; border-radius: 999px; border: 1px solid var(--accent); color: var(--accent); font-size: 0.82rem; font-weight: 600; text-decoration: none; transition: background .15s, color .15s; width: fit-content; }
.twitch-link:hover { background: var(--accent); color: #fff; }

/* Offline panel */
.offline-panel { margin-bottom: 32px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.offline-msg { color: var(--muted); font-size: 0.95rem; }

/* Quick links */
.quick-links { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 600px) { .quick-links { grid-template-columns: 1fr; } }
.quick-card { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 18px 20px; text-decoration: none; color: var(--text); display: flex; flex-direction: column; gap: 4px; transition: border-color .15s; }
.quick-card:hover { border-color: var(--accent); }
.quick-card-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.quick-card-title { font-size: 1rem; font-weight: 600; }

/* Clips */
.clips-section { margin-bottom: 32px; }
.section-heading { font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 16px; }
.clips-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 720px) { .clips-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .clips-grid { grid-template-columns: 1fr; } }
.clip-card { display: block; text-decoration: none; color: var(--text); background: var(--card); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; transition: border-color .15s; }
.clip-card:hover { border-color: var(--accent); }
.clip-thumb-wrap { position: relative; aspect-ratio: 16/9; background: var(--border); overflow: hidden; }
.clip-thumb { width: 100%; height: 100%; object-fit: cover; display: block; }
.clip-duration { position: absolute; bottom: 6px; right: 8px; background: rgba(0,0,0,.7); color: #fff; font-size: 0.72rem; padding: 1px 5px; border-radius: 4px; }
.clip-info { padding: 10px 12px; }
.clip-title { font-size: 0.88rem; font-weight: 600; line-height: 1.3; margin-bottom: 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.clip-sub { font-size: 0.72rem; color: var(--muted); }

/* Schedule */
.schedule-section { margin-bottom: 32px; }
.schedule-list { display: flex; flex-direction: column; }
.schedule-row { display: grid; grid-template-columns: 150px 170px 1fr; align-items: baseline; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.schedule-row:last-child { border-bottom: none; }
.schedule-date { font-size: 0.82rem; font-weight: 600; }
.schedule-time { font-size: 0.78rem; color: var(--muted); }
.schedule-title { font-size: 0.88rem; }
.schedule-game { color: var(--muted); font-size: 0.78rem; }
.collab-badge { display: inline-block; background: rgba(145,70,255,0.15); color: var(--accent); font-size: 0.68rem; font-weight: 700; padding: 1px 6px; border-radius: 4px; vertical-align: middle; text-transform: uppercase; letter-spacing: 0.04em; margin-left: 4px; }
.schedule-with { font-size: 0.78rem; color: var(--muted); margin-left: 4px; }
.schedule-channel-link { color: var(--accent); text-decoration: none; font-weight: 600; }
.schedule-channel-link:hover { text-decoration: underline; }
@media (max-width: 600px) { .schedule-row { grid-template-columns: 1fr; gap: 2px; } }

/* Tabs */
.tab-bar { display: flex; gap: 4px; margin: 20px 0 24px; border-bottom: 1px solid var(--border); }
.tab-btn { background: none; border: none; color: var(--muted); font-size: 0.88rem; font-weight: 600; padding: 8px 16px; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color .15s, border-color .15s; }
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-panel { margin-bottom: 32px; }

/* Featured clip */
.featured-clip-wrap { margin-bottom: 28px; }
.featured-clip { position: relative; width: 100%; padding-top: 56.25%; }
.featured-clip iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: none; border-radius: 8px; }
.featured-clip-title { margin-top: 10px; font-size: 0.88rem; color: var(--muted); }

/* Empty state */
.empty-state { color: var(--muted); font-size: 0.88rem; padding: 20px 0; }

/* Stream sessions */
.streams-section { margin-bottom: 32px; }
.sessions-list { display: flex; flex-direction: column; gap: 12px; }

.session-card { background: var(--card); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.session-header { width: 100%; background: none; border: none; color: var(--text); cursor: pointer; padding: 16px 20px; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; text-align: left; }
.session-header:hover { background: rgba(255,255,255,.03); }
.session-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; flex: 1; }
.session-date { font-size: 0.82rem; font-weight: 600; }
.session-game { font-size: 0.75rem; color: var(--accent); font-weight: 600; padding: 2px 8px; background: rgba(145,70,255,.15); border-radius: 999px; }
.session-dur { font-size: 0.75rem; color: var(--muted); }
.session-title { font-size: 0.82rem; color: var(--muted); margin-top: 2px; }
.session-chevron { font-size: 1.4rem; color: var(--muted); transform: rotate(0deg); transition: transform .2s; flex-shrink: 0; }
.session-header[aria-expanded="true"] .session-chevron { transform: rotate(90deg); }

.session-body { padding: 0 20px 20px; }

/* Posts */
.posts-list { margin-bottom: 16px; display: flex; flex-direction: column; gap: 10px; }
.post-empty { color: var(--muted); font-size: 0.85rem; padding: 8px 0; }
.post-item { border-left: 2px solid var(--border); padding: 10px 14px; border-radius: 0 6px 6px 0; position: relative; }
.post-item.post-pinned { border-left-color: var(--accent); background: rgba(145,70,255,.06); }
.post-pin-badge { font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--accent); display: block; margin-bottom: 4px; }
.post-header { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }
.post-avatar { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.post-avatar-fallback { background: var(--accent); display: flex; align-items: center; justify-content: center; font-size: 0.72rem; font-weight: 700; color: #fff; }
.post-author { font-size: 0.82rem; font-weight: 600; }
.post-time { font-size: 0.72rem; color: var(--muted); margin-right: auto; }
.post-action { background: none; border: none; color: var(--muted); font-size: 0.72rem; cursor: pointer; padding: 2px 6px; border-radius: 4px; }
.post-action:hover { color: var(--text); background: rgba(255,255,255,.06); }
.post-action-delete:hover { color: #f55; }
.post-content { font-size: 0.88rem; line-height: 1.5; color: var(--text); white-space: pre-wrap; word-break: break-word; }

/* Post form */
.post-form { margin-top: 8px; }
.post-textarea { width: 100%; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; color: var(--text); font-size: 0.88rem; padding: 10px 14px; resize: vertical; min-height: 72px; font-family: inherit; }
.post-textarea:focus { outline: none; border-color: var(--accent); }
.post-form-footer { display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin-top: 8px; }
.post-charcount { font-size: 0.72rem; color: var(--muted); }
.post-submit { padding: 6px 18px; background: var(--accent); border: none; border-radius: 999px; color: #fff; font-size: 0.82rem; font-weight: 600; cursor: pointer; transition: opacity .15s; }
.post-submit:hover { opacity: .85; }

/* Header action buttons */
.header-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }

/* Support / Buy me a coffee button */
.support-link { margin-top: 8px; padding: 6px 18px; border-radius: 999px; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-text); font-size: 0.82rem; font-weight: 600; text-decoration: none; cursor: pointer; transition: opacity .15s; width: fit-content; }
.support-link:hover { opacity: .85; }

/* Follow button */
.follow-btn { margin-top: 8px; padding: 6px 18px; border-radius: 999px; border: 1px solid var(--accent); background: transparent; color: var(--accent); font-size: 0.82rem; font-weight: 600; cursor: pointer; transition: background .15s, color .15s; }
.follow-btn:hover { background: var(--accent); color: #fff; }
.follow-btn.following { background: var(--accent); color: #fff; }
.follow-btn.following:hover { background: transparent; color: var(--accent); }

/* ── Live activity feed (mod/broadcaster cockpit) ────────────────────────── */
.activity-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}
.activity-filter {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.78rem;
  padding: 4px 12px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.1s, color 0.1s, border-color 0.1s;
}
.activity-filter:hover {
  color: var(--text);
}
.activity-filter.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.activity-feed {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 520px;
  overflow-y: auto;
}
.activity-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  border-left: 3px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
}
.activity-item[data-cat="subs"]    { border-left-color: #a970ff; }
.activity-item[data-cat="bits"]    { border-left-color: #3ea6ff; }
.activity-item[data-cat="raids"]   { border-left-color: #ff7b39; }
.activity-item[data-cat="follows"] { border-left-color: #ff5c8a; }
.activity-item[data-cat="rewards"] { border-left-color: #38d9a9; }
.activity-icon {
  font-size: 1rem;
  line-height: 1;
  flex-shrink: 0;
}
.activity-text {
  flex: 1;
  font-size: 0.85rem;
  color: var(--text);
  overflow-wrap: anywhere;
}
.activity-time {
  font-size: 0.7rem;
  color: var(--muted);
  flex-shrink: 0;
}
