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

:root {
  --bg:     #0d0d1a;
  --card:   #16162a;
  --border: #2a2a45;
  --accent: #e94560;
  --blue:   #0f3460;
  --text:   #f0f0f0;
  --muted:  #7a7a9a;
  --green:  #4caf50;
  --r: 10px;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', system-ui, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Header ── */
header {
  background: var(--blue);
  border-bottom: 3px solid var(--accent);
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}
header img.logo { height: 40px; width: 40px; object-fit: contain; flex-shrink: 0; }
header h1 { font-size: 1.2rem; font-weight: 700; letter-spacing: 0.5px; }
.log-btns { margin-left: auto; display: flex; gap: 0.4rem; }
.log-btn {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.25rem 0.6rem;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 6px;
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  transition: all 0.15s;
  white-space: nowrap;
}
.log-btn:hover { border-color: var(--accent); color: #fff; }
.badge {
  background: var(--accent);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

main { flex: 1; }

/* ── Waiting ── */
.waiting {
  height: calc(100vh - 60px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  color: var(--muted);
}
.waiting p { font-size: 1.1rem; }
.gen-counter { font-size: 2.5rem; font-weight: 700; color: var(--accent); letter-spacing: 2px; }
.spinner {
  width: 44px; height: 44px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Image grid ── */
.image-grid {
  display: grid;
  gap: 0.8rem;
  padding: 1.2rem;
  width: 100%;
}

.img-cell {
  background: var(--card);
  border-radius: var(--r);
  overflow: hidden;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}
.img-cell img {
  width: 100%;
  height: 48vh;
  object-fit: contain;
  display: block;
}
.img-caption {
  padding: 0.5rem 0.7rem;
  font-size: 0.75rem;
  color: var(--muted);
  font-style: italic;
  line-height: 1.4;
}

/* ── Vote form ── */
.vote-card {
  margin: 0 1.2rem 1.5rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 1.2rem 1.4rem;
}
.vote-card h3 {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1rem;
}

.criterion { margin-bottom: 0.9rem; }
.criterion-label {
  display: block;
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 0.35rem;
}
.scale-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}
.sbt {
  padding: 0.3rem 0.55rem;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.8rem;
  min-width: 38px;
  text-align: center;
  transition: all 0.12s;
  font-family: inherit;
}
.sbt:hover { border-color: var(--accent); }
.sbt.on { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; }

.submit-btn {
  width: 100%;
  margin-top: 1rem;
  padding: 0.7rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s;
  font-family: inherit;
}
.submit-btn:hover { opacity: 0.85; }
.submit-btn:disabled { opacity: 0.35; cursor: not-allowed; }

/* ── Admin panel ── */
.admin-section {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 1.2rem 1.5rem;
}
.admin-section h2 {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1rem;
}

.model-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.8rem;
}
.model-row label { font-size: 0.82rem; color: var(--muted); white-space: nowrap; }
.model-row select {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 0.4rem 0.7rem;
  font-size: 0.88rem;
  font-family: inherit;
  cursor: pointer;
}
.model-row select:focus { outline: none; border-color: var(--accent); }

.prompt-list { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 0.8rem; }
.prompt-row { display: flex; gap: 0.4rem; align-items: flex-start; }
.prompt-row textarea {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 0.5rem 0.7rem;
  font-size: 0.88rem;
  font-family: inherit;
  resize: vertical;
  min-height: 56px;
  transition: border-color 0.15s;
}
.prompt-row textarea:focus { outline: none; border-color: var(--accent); }
.rm-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
  width: 30px; height: 30px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1rem;
  margin-top: 4px;
  flex-shrink: 0;
  transition: all 0.12s;
}
.rm-btn:hover { color: var(--accent); border-color: var(--accent); }

.btn-row { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }
.btn {
  padding: 0.5rem 1.1rem;
  border: none;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: opacity 0.15s;
}
.btn:hover { opacity: 0.82; }
.btn:disabled { opacity: 0.35; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-ghost { background: none; border: 1px solid var(--border); color: var(--text); }

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  margin-left: auto;
}
.pill-idle { background: #1e1e35; color: var(--muted); }
.pill-gen  { background: #1a2e1a; color: var(--green); }
.pill-done { background: #2e1a22; color: var(--accent); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.dot-gen { animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.25} }
