:root {
  --bg: #0b0f16;
  --panel: #121a26;
  --muted: #93a4b8;
  --text: #e7eef7;
  --border: #243246;
  --accent: #4bb3ff;
  --danger: #ff5a6e;
  --ok: #63d297;
  --warn: #ffcc66;
  --radius: 12px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  background: rgba(18, 26, 38, 0.8);
  position: sticky;
  top: 0;
  backdrop-filter: blur(8px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

.grid {
  display: grid;
  gap: 16px;
}
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-3 { grid-template-columns: 1fr 1fr 1fr; }

@media (max-width: 900px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

.h1 { font-size: 28px; margin: 0 0 8px 0; }
.h2 { font-size: 18px; margin: 0 0 8px 0; }
.p { color: var(--muted); margin: 0 0 10px 0; }

.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.spacer { flex: 1; }

.input, .select, .textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #0d1420;
  color: var(--text);
  outline: none;
}

.textarea { min-height: 120px; resize: vertical; }

.btn {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #0d1420;
  color: var(--text);
  cursor: pointer;
}

.btn.primary {
  background: var(--accent);
  border-color: rgba(0,0,0,0.2);
  color: #06111e;
  font-weight: 700;
}

.btn.danger {
  background: transparent;
  border-color: rgba(255,90,110,0.5);
  color: var(--danger);
}

.badge {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(13, 20, 32, 0.7);
  color: var(--muted);
  font-size: 12px;
}

hr.sep {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 16px 0;
}

.table {
  width: 100%;
  border-collapse: collapse;
}
.table th, .table td {
  padding: 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}
.table th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.8px; }
.small { font-size: 12px; color: var(--muted); }
.err { color: var(--danger); }
.ok { color: var(--ok); }
.warn { color: var(--warn); }

.hidden { display: none !important; }

.codebox {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  background: #0a1018;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  overflow-x: auto;
  white-space: pre;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 16px;
}

.dashboard-grid .card-top { grid-column: 1 / -1; }
.dashboard-grid .card-profiles-system { grid-column: 1 / 4; }
.dashboard-grid .card-profiles-my { grid-column: 4 / 7; }
.dashboard-grid .card-editor { grid-column: 1 / 3; }
.dashboard-grid .card-counters { grid-column: 3 / 5; }
.dashboard-grid .card-overlays { grid-column: 5 / 7; }
.dashboard-grid .card-channel { grid-column: 1 / 4; }
.dashboard-grid .card-bits { grid-column: 4 / 7; }

@media (max-width: 1100px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .dashboard-grid .card { grid-column: 1 / -1; }
}

.control-btn-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.dashboard-grid-v2 {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 16px;
}
.dashboard-grid-v2 .top-row { grid-column: 1 / -1; }
.dashboard-grid-v2 .control-row { grid-column: 1 / -1; }
.dashboard-grid-v2 .mid-counters { grid-column: 1 / 3; }
.dashboard-grid-v2 .mid-overlays { grid-column: 3 / 5; }
.dashboard-grid-v2 .mid-chat { grid-column: 5 / 7; }
.dashboard-grid-v2 .shoutout-row { grid-column: 1 / -1; }
.dashboard-grid-v2 .bottom-channel { grid-column: 1 / 4; }
.dashboard-grid-v2 .bottom-bits { grid-column: 4 / 7; }

@media (max-width: 1100px) {
  .dashboard-grid-v2 { grid-template-columns: 1fr; }
  .dashboard-grid-v2 .card { grid-column: 1 / -1; }
}

input, select, textarea, button {
  font-family: inherit;
}

button {
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid #2b4765;
  color: #eaf4ff;
  background: linear-gradient(135deg, #1b3553, #245f96);
  cursor: pointer;
  transition: transform 120ms ease, filter 120ms ease;
}
button:hover { filter: brightness(1.08); }
button:active { transform: translateY(1px); }
button.secondary {
  border-color: #30506c;
  background: linear-gradient(135deg, #1a2738, #21374d);
}
button.danger {
  border-color: #7a2941;
  background: linear-gradient(135deg, #4f1e2e, #7a2a42);
}
button.success {
  border-color: #2c7a68;
  background: linear-gradient(135deg, #1b5d50, #2ea484);
}
button.warn {
  border-color: #8a6530;
  background: linear-gradient(135deg, #6a4b1f, #a67a2f);
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  filter: grayscale(0.2);
}
/* Global terminal-style header */
.scc-global-header {
  width: 100%;
}

.scc-header-container {
  padding-top: 18px;
  padding-bottom: 8px;
}

.scc-terminal-banner {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(124, 255, 178, 0.25);
  border-radius: 18px;
  background:
    radial-gradient(circle at top left, rgba(0, 225, 255, 0.10), transparent 30%),
    radial-gradient(circle at top right, rgba(124, 255, 178, 0.08), transparent 28%),
    linear-gradient(180deg, #10141b 0%, #0b0f15 100%);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.03) inset,
    0 12px 40px rgba(0, 0, 0, 0.35);
  color: #eafcff;
  margin: 0 0 18px;
}

.scc-terminal-scan {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(
      to bottom,
      rgba(255, 255, 255, 0.02) 0px,
      rgba(255, 255, 255, 0.02) 1px,
      transparent 2px,
      transparent 4px
    );
  opacity: 0.25;
}

.scc-terminal-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(124, 255, 178, 0.12);
  background: rgba(255, 255, 255, 0.02);
}

.scc-terminal-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.scc-terminal-dot.red { background: #ff5f57; }
.scc-terminal-dot.yellow { background: #febc2e; }
.scc-terminal-dot.green { background: #28c840; }

.scc-terminal-title {
  margin-left: 6px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: lowercase;
  color: #8fb4c0;
  font-family: Consolas, Monaco, monospace;
}

.scc-terminal-body {
  position: relative;
  padding: 24px;
}

.scc-terminal-brand-row {
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
}

.scc-terminal-logo-wrap {
  width: 92px;
  height: 92px;
  min-width: 92px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
  border: 1px solid rgba(124, 255, 178, 0.16);
  box-shadow:
    0 0 20px rgba(124, 255, 178, 0.12),
    0 0 30px rgba(0, 225, 255, 0.06);
}

.scc-terminal-logo {
  width: 64px;
  height: 64px;
  object-fit: contain;
  image-rendering: auto;
}

.scc-terminal-main {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 320px;
}

.scc-terminal-ascii {
  margin: 0;
  white-space: pre;
  font-family: Consolas, Monaco, monospace;
  font-size: 16px;
  line-height: 1.12;
  color: #7cffb2;
  text-shadow:
    0 0 8px rgba(124, 255, 178, 0.35),
    0 0 16px rgba(124, 255, 178, 0.10);
  opacity: 0;
  transform: translateY(6px);
  animation: sccAsciiIn 700ms ease forwards;
  animation-delay: 120ms;
}

.scc-terminal-name {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 0.01em;
  color: #ffffff;
  opacity: 0;
  transform: translateY(4px);
  animation: sccFadeUp 600ms ease forwards;
  animation-delay: 520ms;
}

.scc-terminal-subtitle {
  font-size: 14px;
  font-weight: 600;
  color: #00e1ff;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0;
  transform: translateY(4px);
  animation: sccFadeUp 600ms ease forwards;
  animation-delay: 720ms;
}

.scc-terminal-boot {
  margin-top: 22px;
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(124, 255, 178, 0.10);
  font-family: Consolas, Monaco, monospace;
  font-size: 13px;
  color: #cdeff4;
}

.scc-boot-line {
  opacity: 0;
  transform: translateY(3px);
  margin: 6px 0;
  animation: sccBootLine 450ms ease forwards;
}

.scc-boot-line:nth-child(1) { animation-delay: 900ms; }
.scc-boot-line:nth-child(2) { animation-delay: 1250ms; }
.scc-boot-line:nth-child(3) { animation-delay: 1600ms; }
.scc-boot-line:nth-child(4) { animation-delay: 1950ms; }
.scc-boot-line:nth-child(5) { animation-delay: 2300ms; }

.scc-boot-line .prompt {
  color: #7cffb2;
  font-weight: 700;
  margin-right: 8px;
}

.scc-boot-line:last-child {
  color: #7cffb2;
  font-weight: 700;
}

.scc-terminal-banner.ready .scc-terminal-boot::after {
  content: "_";
  display: inline-block;
  margin-left: 4px;
  color: #7cffb2;
  animation: sccBlink 1s steps(1) infinite;
}

.scc-header-links {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.scc-link-group {
  border: 1px solid rgba(124, 255, 178, 0.14);
  border-radius: 12px;
  padding: 10px;
  background: rgba(0, 0, 0, 0.18);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.scc-link-title {
  font-size: 11px;
  color: #8fb4c0;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding-right: 4px;
}

.scc-link-group a {
  border: 1px solid rgba(64, 101, 114, 0.75);
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 12px;
  color: #d4f5ff;
  background: rgba(16, 34, 39, 0.45);
  transition: filter 120ms ease, transform 120ms ease;
}

.scc-link-group a:hover {
  text-decoration: none;
  filter: brightness(1.08);
}

.scc-link-group a.active {
  border-color: rgba(124, 255, 178, 0.9);
  color: #08140f;
  background: linear-gradient(135deg, #7cffb2, #00e1ff);
}

@keyframes sccAsciiIn {
  from {
    opacity: 0;
    transform: translateY(6px);
    filter: blur(2px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

@keyframes sccFadeUp {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes sccBootLine {
  from {
    opacity: 0;
    transform: translateY(3px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes sccBlink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

@media (max-width: 900px) {
  .scc-header-links {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .scc-terminal-body {
    padding: 18px;
  }

  .scc-terminal-brand-row {
    align-items: flex-start;
    gap: 16px;
  }

  .scc-terminal-logo-wrap {
    width: 76px;
    height: 76px;
    min-width: 76px;
  }

  .scc-terminal-logo {
    width: 52px;
    height: 52px;
  }

  .scc-terminal-ascii {
    font-size: 12px;
  }

  .scc-terminal-name {
    font-size: 22px;
  }

  .scc-terminal-subtitle {
    font-size: 12px;
  }

  .scc-terminal-boot {
    font-size: 12px;
  }

  .scc-link-group {
    gap: 6px;
  }
}

/* Streamer dashboard readability + resource pagination */
.dashboard-grid-v2 .card > label,
.dashboard-grid-v2 .card .row label,
.dashboard-grid-v2 .card [data-wrap='counter'] > label,
.dashboard-grid-v2 .card [data-wrap='random'] label {
  display: block;
  margin-top: 8px;
  margin-bottom: 4px;
  line-height: 1.2;
  font-size: 14px;
  font-weight: 600;
  color: #e1ecff;
}

.dashboard-grid-v2 .card > input,
.dashboard-grid-v2 .card > select,
.dashboard-grid-v2 .card .row > div > input,
.dashboard-grid-v2 .card .row > div > select,
.dashboard-grid-v2 .card [data-wrap='counter'] > select,
.dashboard-grid-v2 .card [data-wrap='random'] input {
  width: 100%;
}

.dashboard-grid-v2 .card label > input[type='checkbox'] {
  width: auto;
  margin-right: 6px;
  vertical-align: middle;
}

.dashboard-pager {
  margin-top: 10px;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.dashboard-pager-actions {
  display: flex;
  gap: 6px;
}