/* SAT Strategy Deck — single stylesheet, light/dark, no dependencies. */

:root {
  --bg: #f7f5f0;
  --surface: #ffffff;
  --surface-2: #f0ece4;
  --ink: #14130f;
  --ink-2: #4a4640;
  --ink-3: #807a70;
  --line: #d9d3c5;
  --accent: #b4121b;
  --accent-soft: #f5dad9;
  --good: #2c6e3f;
  --good-soft: #d9ead3;
  --radius: 6px;
  --shadow: 0 1px 0 rgba(0, 0, 0, 0.04), 0 2px 6px rgba(0, 0, 0, 0.04);
}

[data-theme="dark"] {
  --bg: #0e0d0b;
  --surface: #1a1814;
  --surface-2: #221f1a;
  --ink: #f4ede0;
  --ink-2: #c4bdaf;
  --ink-3: #7a7266;
  --line: #2c2820;
  --accent: #d24d55;
  --accent-soft: #3a1e21;
  --good: #79c08b;
  --good-soft: #1f3a26;
  --shadow: 0 1px 0 rgba(0, 0, 0, 0.6), 0 2px 6px rgba(0, 0, 0, 0.5);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--ink); }
a:hover { color: var(--accent); }

button {
  font: inherit;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 6px 10px;
  cursor: pointer;
  transition: background 0.1s ease, border-color 0.1s ease, transform 0.1s ease;
}
button:hover { background: var(--surface-2); border-color: var(--ink-3); }
button:active { transform: translateY(1px); }
button.primary { background: var(--accent); color: white; border-color: var(--accent); }
button.primary:hover { background: var(--accent); filter: brightness(0.9); }

input, select {
  font: inherit;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 6px 10px;
}
input:focus, select:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }

/* Topbar */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  position: sticky; top: 0; z-index: 10;
}
.brand { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.logo {
  font: 700 22px/1 "JetBrains Mono", "Fira Mono", "Menlo", monospace;
  letter-spacing: 0.04em;
  color: var(--accent);
}
.subtitle { font-size: 12px; color: var(--ink-3); letter-spacing: 0.06em; text-transform: uppercase; }
.controls { display: flex; gap: 8px; align-items: center; }
.controls input[type=search] { width: 280px; }
.controls button { width: 36px; padding: 6px 0; }

main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px;
}

/* Strategy of the day */
.sotd {
  background: var(--accent);
  color: white;
  border-radius: 8px;
  padding: 22px 26px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}
.sotd-label {
  font-size: 11px;
  letter-spacing: 0.18em;
  opacity: 0.85;
  margin-bottom: 6px;
}
.sotd-rule {
  font-size: 22px;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 8px;
}
.sotd-why { font-size: 14px; opacity: 0.92; margin-bottom: 12px; }
.sotd-source { font-size: 12px; }
.sotd-source a { color: white; text-decoration: underline; text-decoration-color: rgba(255,255,255,0.4); }
.sotd-source a:hover { text-decoration-color: white; }

/* Filters */
.filters { margin-bottom: 18px; }
.filter-row {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.filter-group { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.filter-group.right { margin-left: auto; align-items: flex-end; gap: 6px; flex-direction: row; flex-wrap: wrap; }
.filter-label {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  font-size: 12px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  cursor: pointer;
  user-select: none;
  color: var(--ink-2);
  transition: all 0.1s ease;
}
.chip:hover { color: var(--ink); }
.chip.active {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}

/* Progress */
.progress {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.progress-bar {
  height: 6px;
  background: var(--surface-2);
  border-radius: 999px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--good);
  width: 0%;
  transition: width 0.3s ease;
}
.progress-text { font-size: 12px; color: var(--ink-3); }

/* Cards */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 14px; }
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
  box-shadow: var(--shadow);
}
.card:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(0,0,0,0.06); }

.card-header { display: flex; align-items: flex-start; gap: 10px; }
.card-checkbox {
  appearance: none;
  width: 20px; height: 20px;
  border: 1.5px solid var(--ink-3);
  border-radius: 4px;
  cursor: pointer;
  flex-shrink: 0;
  margin-top: 1px;
  position: relative;
  transition: all 0.1s ease;
}
.card-checkbox:checked {
  background: var(--good);
  border-color: var(--good);
}
.card-checkbox:checked::after {
  content: "";
  position: absolute;
  left: 5px; top: 1px;
  width: 6px; height: 11px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.card.practiced { opacity: 0.55; }
.card.practiced .card-rule { text-decoration: line-through; text-decoration-color: var(--ink-3); }

.card-body { flex: 1; min-width: 0; }
.card-section {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 2px;
}
.card-rule { font-size: 15px; font-weight: 600; line-height: 1.35; margin: 0 0 6px; }
.card-why { font-size: 13px; color: var(--ink-2); line-height: 1.5; }

.card-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.tag {
  font-size: 10px;
  color: var(--ink-3);
  background: var(--surface-2);
  padding: 2px 7px;
  border-radius: 4px;
  letter-spacing: 0.04em;
}

.card-source {
  font-size: 11px;
  color: var(--ink-3);
  border-top: 1px solid var(--line);
  padding-top: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.card-source .channel { font-weight: 600; color: var(--ink-2); letter-spacing: 0.04em; }
.card-source a { color: var(--accent); text-decoration: none; font-size: 11px; }
.card-source a:hover { text-decoration: underline; }

.empty {
  text-align: center;
  color: var(--ink-3);
  padding: 40px 20px;
  font-size: 14px;
}

/* In-feed ad — occupies one grid cell, styled like a card, with a required label */
.ad-slot {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: var(--shadow);
  min-height: 260px;         /* reserved so the grid doesn't reflow when the ad loads */
  overflow: hidden;
}
.ad-slot .ad-label {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.ad-slot .ad-target { flex: 1; display: block; min-height: 0; }
.ad-slot .adsbygoogle { display: block; width: 100%; }

footer {
  max-width: 1100px;
  margin: 24px auto 32px;
  padding: 0 24px;
  font-size: 11px;
  color: var(--ink-3);
  line-height: 1.7;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

/* Mobile */
@media (max-width: 700px) {
  .topbar { flex-wrap: wrap; padding: 14px 16px; }
  .controls { width: 100%; }
  .controls input[type=search] { flex: 1; width: auto; }
  main { padding: 16px; }
  .cards { grid-template-columns: 1fr; }
  .sotd-rule { font-size: 18px; }
  .filter-group.right { width: 100%; margin-left: 0; }
  .ad-slot { min-height: 300px; }
}
