:root {
  --bg-main: #0b0e14;
  --bg-card: #151a23;
  --bg-subtle: #1f2633;
  --border: #2a3447;
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --primary: #9146ff; /* Twitch Purple */
  --primary-hover: #772ce8;
  --secondary: #3b82f6;
  --danger: #ef4444;
  --success: #10b981;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.5;
}

.dash-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Header */
.dash-header {
  height: 64px;
  background-color: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 19px;
  font-weight: 700;
}

.logo-emoji {
  font-size: 24px;
}

.header-logo strong {
  color: var(--primary);
}

.header-user {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-pill {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  color: #c4b5fd;
}

.hidden {
  display: none !important;
}

/* Main */
.dash-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 24px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
  user-select: none;
  text-decoration: none;
}

.btn-primary {
  background-color: var(--primary);
  color: #fff;
}
.btn-primary:hover {
  background-color: var(--primary-hover);
}

.btn-secondary {
  background-color: var(--bg-subtle);
  color: var(--text-main);
  border-color: var(--border);
}
.btn-secondary:hover {
  background-color: #2b3548;
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
}
.btn-ghost:hover {
  color: var(--text-main);
  background-color: var(--bg-subtle);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}
.btn-xs {
  padding: 3px 8px;
  font-size: 11px;
}
.btn-block {
  width: 100%;
}

/* Auth Card */
.auth-section {
  width: 100%;
  max-width: 480px;
}

.auth-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.4);
}

.auth-header {
  text-align: center;
  margin-bottom: 24px;
}

.auth-header h2 {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 8px;
}

.auth-header p {
  font-size: 13px;
  color: var(--text-muted);
}

.auth-tabs {
  display: flex;
  background-color: var(--bg-subtle);
  border-radius: var(--radius-sm);
  padding: 4px;
  margin-bottom: 20px;
}

.tab-btn {
  flex: 1;
  padding: 8px;
  background: transparent;
  border: none;
  border-radius: 4px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tab-btn.active {
  background-color: var(--primary);
  color: #fff;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.form-input {
  background-color: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  padding: 10px 14px;
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s ease;
}

.form-input:focus {
  border-color: var(--primary);
}

.form-hint {
  font-size: 11px;
  color: var(--text-muted);
}

.twitch-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(145, 70, 255, 0.15);
  border: 1px solid rgba(145, 70, 255, 0.4);
  color: #c4b5fd;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  margin-top: 4px;
}

.error-msg {
  background-color: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
}

/* Dashboard Section */
.dashboard-section {
  width: 100%;
  max-width: 1380px;
}

.dash-grid {
  display: grid;
  grid-template-columns: 460px 1fr;
  gap: 24px;
}

@media (max-width: 1024px) {
  .dash-grid {
    grid-template-columns: 1fr;
  }
}

.dash-col-links {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.card {
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
}

/* Profile Card */
.profile-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.profile-info {
  display: flex;
  align-items: center;
  gap: 14px;
}

.avatar-box {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #6366f1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.profile-info h3 {
  font-size: 17px;
  font-weight: 700;
}

.channel-link {
  font-size: 12px;
  color: var(--text-muted);
  text-decoration: none;
}
.channel-link:hover {
  color: var(--primary);
}

.channel-status-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: #34d399;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 4px 10px;
  border-radius: 20px;
}

.status-dot-pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: #34d399;
  box-shadow: 0 0 8px #34d399;
}

/* Link Cards */
.link-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.card-tag {
  align-self: flex-start;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 3px 8px;
  border-radius: 4px;
}

.tag-obs {
  background: rgba(59, 130, 246, 0.18);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.tag-mod {
  background: rgba(145, 70, 255, 0.18);
  color: #c4b5fd;
  border: 1px solid rgba(145, 70, 255, 0.3);
}

.link-card h4 {
  font-size: 15px;
  font-weight: 700;
}

.link-card p {
  font-size: 12px;
  color: var(--text-muted);
}

.copy-box {
  display: flex;
  gap: 8px;
  background-color: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px;
}

.copy-input {
  flex: 1;
  background: transparent;
  border: none;
  color: #93c5fd;
  padding: 6px 8px;
  font-size: 12px;
  font-family: Consolas, monospace;
  outline: none;
}

.obs-alert-box {
  background: rgba(234, 179, 8, 0.08);
  border: 1px solid rgba(234, 179, 8, 0.25);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-top: 4px;
}

.obs-alert-header {
  font-size: 12px;
  font-weight: 700;
  color: #fde047;
  margin-bottom: 6px;
}

.obs-tips {
  padding-left: 16px;
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.obs-tips strong {
  color: var(--text-main);
}

.obs-tips kbd {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1px 4px;
  font-size: 10px;
  color: #fde047;
}

.mod-action-box {
  margin-top: 6px;
}

/* Stream Embed */
.stream-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 480px;
}

.stream-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.stream-header-title {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-weight: 700;
  font-size: 15px;
}

.stream-header-title small {
  font-size: 11px;
  color: #34d399;
  font-weight: 500;
}

.stream-embed-container {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
}

.stream-embed-container iframe {
  width: 100%;
  height: 100%;
  display: block;
}

.stream-footer-hint {
  margin-top: 12px;
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
}
