:root {
  --ink: #2b2130;
  --paper: #fdf8f3;
  --card: #ffffff;
  --accent: #8b5cf6;
  --accent-dark: #6d28d9;
  --accent-soft: #ede9fe;
  --muted: #756b7a;
  --border: #e8e0ee;
  --error: #c0392b;
  --success: #1f9d55;
  font-size: 16px;
  color-scheme: light;
}

/* Dark mode: follows system preference unless explicitly overridden */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #f0eaf5;
    --paper: #1c1620;
    --card: #2a2230;
    --accent: #a78bfa;
    --accent-dark: #c4b5fd;
    --accent-soft: #3f3350;
    --muted: #a89bb0;
    --border: #453a4d;
    --error: #ff6b6b;
    --success: #4ade80;
    color-scheme: dark;
  }
}

/* Dark mode: explicit toggle wins in both directions */
:root[data-theme="dark"] {
  --ink: #f0eaf5;
  --paper: #1c1620;
  --card: #2a2230;
  --accent: #a78bfa;
  --accent-dark: #c4b5fd;
  --accent-soft: #3f3350;
  --muted: #a89bb0;
  --border: #453a4d;
  --error: #ff6b6b;
  --success: #4ade80;
  color-scheme: dark;
}

/* Colour-blind friendly palette: swaps the usual red/green pair for a
   blue/orange pair (Okabe-Ito colour-safe palette), since red-green
   confusion is by far the most common form of colour blindness. */
:root[data-colorblind="true"] {
  --error: #d55e00;
  --success: #0072b2;
}

:root[data-theme="dark"][data-colorblind="true"] {
  --error: #e69f00;
  --success: #56b4e9;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.5;
}

.wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}

header.site-header {
  text-align: center;
  margin-bottom: 2rem;
}

header.site-header h1 {
  font-size: 2.4rem;
  margin: 0 0 0.35rem;
}

header.site-header h1 a {
  color: var(--ink);
  text-decoration: none;
}

header.site-header p {
  color: var(--muted);
  margin: 0;
}

nav.site-nav {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1rem;
}

nav.site-nav a {
  padding: 0.45rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--ink);
  text-decoration: none;
  font-size: 0.9rem;
  background: var(--card);
}

nav.site-nav a.active,
nav.site-nav a:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 1.5rem;
}

input[type="text"], select, textarea {
  font: inherit;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.65rem 0.85rem;
  background: var(--card);
  color: var(--ink);
}

input[type="text"] {
  flex: 1 1 220px;
}

#submitted_by {
  max-width: 260px;
  padding: 0.4rem 0.75rem;
}

select {
  flex: 0 0 auto;
}

.lie-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.lie-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem 1.15rem;
}

.lie-card p.lie-text {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
}

.lie-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  color: var(--muted);
}

.badge {
  display: inline-block;
  background: var(--accent-soft);
  color: var(--accent-dark);
  border-radius: 999px;
  padding: 0.2rem 0.65rem;
  font-weight: 600;
  font-size: 0.75rem;
}

.empty-state, .status-message {
  text-align: center;
  color: var(--muted);
  padding: 2rem 1rem;
}

.status-message.error { color: var(--error); }
.status-message.success { color: var(--success); }

form.submit-form {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

form.submit-form label {
  font-weight: 600;
  font-size: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

form.submit-form textarea {
  resize: vertical;
  min-height: 90px;
  font-weight: normal;
}

.char-count {
  font-weight: normal;
  color: var(--muted);
  font-size: 0.78rem;
  align-self: flex-end;
}

/* honeypot field: hidden from real users, present for bots */
.hp-field {
  position: absolute;
  left: -9999px;
  top: -9999px;
  opacity: 0;
  height: 0;
  overflow: hidden;
}

button.primary {
  font: inherit;
  font-weight: 700;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 0.75rem 1.25rem;
  cursor: pointer;
}

button.primary:hover { background: var(--accent-dark); }
button.primary:disabled { opacity: 0.6; cursor: not-allowed; }

button.secondary {
  font: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  background: var(--card);
  color: var(--accent-dark);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.65rem 1rem;
  cursor: pointer;
  flex: 0 0 auto;
}

button.secondary:hover { background: var(--accent-soft); }

.results-heading {
  margin: 0 0 0.75rem;
  color: var(--muted);
  font-size: 0.85rem;
}


footer.site-footer {
  text-align: center;
  color: var(--muted);
  font-size: 0.8rem;
  margin-top: 3rem;
}

.settings-bar {
  display: flex;
  justify-content: center;
  gap: 1.25rem;
  margin-top: 0.9rem;
  flex-wrap: wrap;
}

.switch-control {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}

.switch-control input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.switch-track {
  width: 36px;
  height: 20px;
  background: var(--border);
  border-radius: 999px;
  position: relative;
  transition: background 0.15s ease;
  flex: 0 0 auto;
}

.switch-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--card);
  transition: transform 0.15s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

.switch-control input:checked + .switch-track {
  background: var(--accent);
}

.switch-control input:checked + .switch-track .switch-thumb {
  transform: translateX(16px);
}

.switch-control input:focus-visible + .switch-track {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
