/* Reactive — custom dashboard/widget styling (no Tailwind build) */

:root {
  --bg: #0e0e10;
  --bg-soft: #17171a;
  --border: #26262b;
  --text: #ffffff;
  --text-dim: #9ca3af;
  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --danger: #dc2626;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

a { color: inherit; text-decoration: none; }

.container { max-width: 72rem; margin: 0 auto; padding: 0 1.5rem; }

/* Layout */
.page { min-height: 100vh; background: var(--bg); }
.main { padding: 3rem 1.5rem; min-height: 100vh; }
.site-header {
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.5rem;
}
.site-header .brand { font-size: 1.5rem; font-weight: 900; letter-spacing: -0.03em; }
.nav { display: flex; gap: 1rem; font-size: 0.875rem; color: var(--text-dim); }
.nav a:hover { color: var(--text); transition: color 0.15s; }
.main { padding: 3rem 1.5rem; }

/* Typography */
.h1 { font-size: 1.875rem; font-weight: 700; }
.h2 { font-size: 1.5rem; font-weight: 700; }
.h3 { font-size: 1.125rem; font-weight: 600; }
.hero-title { font-size: 3rem; font-weight: 900; letter-spacing: -0.04em; line-height: 1.1; }
.dim { color: var(--text-dim); }
.small { font-size: 0.75rem; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.5rem 1rem; border-radius: 0.5rem; border: none;
  font-size: 0.875rem; font-weight: 600; cursor: pointer;
  background: #26262b; color: var(--text); transition: background 0.15s;
}
.btn:hover { background: #2e2e35; }
.btn-accent { background: var(--accent); }
.btn-accent:hover { background: var(--accent-hover); }
.btn-lg { padding: 1rem 2rem; font-size: 1.125rem; }
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #b91c1c; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-block { width: 100%; justify-content: center; }

/* Cards */
.card { background: var(--bg-soft); border: 1px solid var(--border); border-radius: 0.75rem; padding: 1.5rem; }
.card-row { display: flex; gap: 1rem; align-items: center; }

/* Forms */
.field { margin-bottom: 1rem; }
.field label { display: block; font-size: 0.875rem; font-weight: 500; margin-bottom: 0.25rem; }
.input, .textarea {
  width: 100%; background: #17171a; border: 1px solid #3f3f46;
  border-radius: 0.5rem; padding: 0.5rem 0.75rem; color: var(--text); font-size: 0.875rem;
  box-sizing: border-box;
}
.input:focus, .textarea:focus { outline: 2px solid var(--accent); border-color: transparent; }
.file-input {
  width: 100%; font-size: 0.875rem;
}
.file-input::file-selector-button {
  margin-right: 1rem; padding: 0.5rem 1rem; border: none; border-radius: 0.5rem;
  background: #26262b; color: #e5e7eb; font-weight: 600; cursor: pointer;
}
.file-input::file-selector-button:hover { background: #3f3f46; }
input[type="range"] { width: 100%; accent-color: var(--accent); }

/* Grid */
.grid { display: grid; gap: 1rem; }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }

/* Flash */
.flash { position: fixed; top: 1rem; right: 1rem; z-index: 50; max-width: 24rem; padding: 1rem; border-radius: 0.5rem; font-size: 0.875rem; cursor: pointer; }
.flash-info { background: #1e3a5f; border: 1px solid #2563eb; color: #bfdbfe; }
.flash-error { background: #450a0a; border: 1px solid #dc2626; color: #fecaca; }

/* Avatar thumb */
.thumb {
  width: 5rem; height: 5rem; border-radius: 0.5rem; overflow: hidden;
  background: #1f1f23; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.thumb img { width: 100%; height: 100%; object-fit: contain; }

/* Status */
.stat-card { background: rgba(23, 23, 26, 0.5); border: 1px solid var(--border); border-radius: 1rem; padding: 1.5rem; text-align: center; }
.stat-value { font-size: 1.875rem; font-weight: 700; }
.stat-label { font-size: 0.875rem; color: #6b7280; }
.avatar-tile { background: rgba(23, 23, 26, 0.5); border: 1px solid var(--border); border-radius: 0.75rem; padding: 0.75rem; display: flex; flex-direction: column; align-items: center; gap: 0.5rem; }

/* Preview canvas */
.preview-canvas {
  position: relative; height: 400px; overflow: hidden; border-radius: 0.75rem;
  background-image:
    linear-gradient(45deg, #1f1f23 25%, transparent 25%),
    linear-gradient(-45deg, #1f1f23 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #1f1f23 75%),
    linear-gradient(-45deg, transparent 75%, #1f1f23 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
  background-color: #17171a;
  cursor: grab;
  user-select: none;
}
.preview-canvas:active { cursor: grabbing; }

.text-center { text-align: center; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-12 { margin-top: 3rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mb-12 { margin-bottom: 3rem; }
.space-y-2 > * + * { margin-top: 0.5rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.w-full { width: 100%; }
.flex-1 { flex: 1; }

/* OBS widget */
body.widget-body { background: transparent; margin: 0; padding: 0; overflow: hidden; }
#widget-stage { position: relative; display: inline-block; }
#widget-stage .wimg {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  opacity: 0; transition: opacity 60ms linear; user-select: none;
}
#widget-stage .wimg.visible { opacity: 1; }
#widget-stage .wimg.active { opacity: 1; }