/* ==========================================================
   Watchlist — "Marquee" theme
   Dark cinema: near-black background, gold accent, compact rows.
   Mobile first (375px), widening from 600px.
   ========================================================== */

:root {
  --bg: #12100e;        /* page background */
  --panel: #1d1a16;     /* cards and rows */
  --panel-2: #262119;   /* hover / pressed */
  --line: #3a342c;      /* hairlines and input borders */
  --ink: #f4efe7;       /* main text */
  --muted: #8e877d;     /* secondary text */
  --accent: #e8b84b;    /* gold: buttons, active tab, ticks */
  --accent-ink: #12100e;/* text on gold */
  --danger: #e0684f;    /* errors and delete */
  --radius: 4px;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  padding: 18px 16px 40px;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.55;
  -webkit-text-size-adjust: 100%;
}

/* ---------- header ---------- */

header {
  max-width: 640px;
  margin: 0 auto 16px;
}

h1 {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  /* the name is long, so it wraps on a narrow phone — keep the icon on the
     first line with it rather than letting it drift */
  font-size: 20px;
  line-height: 1.25;
  letter-spacing: -0.3px;
}

h1 .logo {
  color: var(--accent);
  flex: 0 0 auto;
}

.tagline {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12.5px;
}

main {
  max-width: 640px;
  margin: 0 auto;
}

h2 {
  margin: 0 0 12px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--accent);
  font-weight: 700;
}

/* ---------- cards ---------- */

.card {
  background: var(--panel);
  border-radius: var(--radius);
  padding: 15px 14px;
  margin-bottom: 16px;
}

/* ---------- form ---------- */

.field {
  margin-bottom: 12px;
}

label {
  display: block;
  margin-bottom: 5px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--muted);
  font-weight: 700;
}

.optional {
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
}

input,
select {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  /* 16px keeps iOS from zooming in on focus */
  font-size: 16px;
  font-family: inherit;
  padding: 10px 11px;
  min-height: 44px;
}

select {
  /* the default arrow is invisible on a dark field, so draw our own */
  appearance: none;
  -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 17px) 20px, calc(100% - 12px) 20px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 32px;
}

input::placeholder {
  color: #6b645b;
}

input:focus-visible,
select:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

input[aria-invalid="true"] {
  border-color: var(--danger);
}

.error {
  margin: 6px 0 0;
  color: var(--danger);
  font-size: 12px;
}

button {
  font-family: inherit;
  cursor: pointer;
}

.primary {
  width: 100%;
  background: var(--accent);
  color: var(--accent-ink);
  border: 0;
  border-radius: var(--radius);
  padding: 13px;
  min-height: 48px;
  font-size: 15px;
  font-weight: 800;
  transition: filter 0.15s ease;
}

.primary:hover {
  filter: brightness(1.07);
}

/* ---------- search + tabs ---------- */

.search-field {
  margin-bottom: 10px;
}

.tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
}

.tab {
  flex: 1;
  min-height: 40px;
  padding: 8px 4px;
  background: var(--panel);
  border: 0;
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  transition: background 0.15s ease, color 0.15s ease;
}

.tab:hover {
  background: var(--panel-2);
}

.tab.is-on {
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
}

.count {
  opacity: 0.75;
  font-variant-numeric: tabular-nums;
}

/* ---------- list ---------- */

.list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--panel);
  border-radius: var(--radius);
  padding: 11px 12px;
  margin-bottom: 8px;
}

.tick {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: transparent;
  font-size: 16px;
  line-height: 1;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.tick:hover {
  border-color: var(--accent);
  color: var(--line);
}

.tick.is-done {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.item-body {
  flex: 1 1 auto;
  min-width: 0;
}

.item-title {
  font-size: 14.5px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.item-meta {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11.5px;
  overflow-wrap: anywhere;
}

.kind {
  display: inline-block;
  margin-right: 6px;
  padding: 1px 6px;
  border: 1px solid #4a3f26;
  border-radius: 3px;
  color: var(--accent);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.item.is-done .item-title {
  color: #6e675e;
  text-decoration: line-through;
}

.item.is-done .kind {
  color: var(--muted);
  border-color: var(--line);
}

.delete {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  background: transparent;
  border: 0;
  border-radius: var(--radius);
  color: #6e675e;
  font-size: 17px;
  line-height: 1;
  transition: background 0.15s ease, color 0.15s ease;
}

.delete:hover {
  background: var(--panel-2);
  color: var(--danger);
}

/* ---------- empty state ---------- */

.empty {
  margin: 4px 0 0;
  padding: 26px 18px;
  background: var(--panel);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 13px;
  text-align: center;
  line-height: 1.7;
}

/* ---------- help ---------- */

.help {
  margin-top: 18px;
}

.help ol {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.75;
}

.help li + li {
  margin-top: 5px;
}

.help strong {
  color: var(--ink);
  font-weight: 700;
}

.note {
  margin: 12px 0 0;
  padding-top: 11px;
  border-top: 1px solid #2a251f;
  color: var(--muted);
  font-size: 11.5px;
}

/* ---------- toast ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  max-width: calc(100% - 32px);
  margin: 0;
  padding: 10px 16px;
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
}

/* ---------- helpers ---------- */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- wider screens ---------- */

@media (min-width: 600px) {
  body {
    padding: 32px 24px 56px;
    font-size: 15px;
  }

  h1 {
    font-size: 28px;
  }

  .tagline {
    font-size: 13.5px;
  }

  .card {
    padding: 20px 18px;
  }

  /* the three short fields sit on one row once there is space */
  .form-row {
    display: flex;
    gap: 12px;
  }

  .form-row .field {
    flex: 1 1 0;
  }

  .item {
    padding: 13px 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
