*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

:root {
  --paper-bg: #f5f0e8;
  --paper-line: #c8d8e8;
  --ink: #2c2c2c;
  --muted: #5b5650;
  --red: #c0392b;
  --green: #27ae60;
  --card: rgba(255, 250, 240, 0.86);
}

html, body {
  min-height: 100%;
  font-family: 'Patrick Hand', system-ui, sans-serif;
  color: var(--ink);
  background-color: var(--paper-bg);
  background-image:
    linear-gradient(90deg, transparent 0, transparent 64px, rgba(192, 57, 43, 0.16) 65px, transparent 67px),
    linear-gradient(var(--paper-line) 1px, transparent 1px);
  background-size: 100% 32px;
  line-height: 1.55;
}

.ep-header {
  width: min(920px, 94vw);
  margin: 0 auto;
  padding: 1rem 0 0.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.ep-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--ink);
  font-family: 'Caveat', cursive;
  font-size: 1.65rem;
  font-weight: 700;
}

.ep-nav { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.ep-nav a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.8rem;
  border: 2px solid rgba(44, 44, 44, 0.26);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
  text-decoration: none;
  font-size: 1rem;
}
.ep-nav a:hover, .ep-nav a:focus-visible { border-color: var(--ink); background: rgba(39, 174, 96, 0.14); }

.ep-wrap { width: min(920px, 94vw); margin: 0 auto; padding: 0.5rem 0 2.5rem; }

.crumbs { margin-bottom: 0.75rem; font-size: 0.98rem; color: var(--muted); }
.crumbs ol { display: flex; flex-wrap: wrap; list-style: none; gap: 0.4rem; }
.crumbs li + li::before { content: "/"; margin-right: 0.4rem; color: var(--muted); }
.crumbs a { color: var(--red); text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }

.ep-hero { margin-bottom: 1.1rem; }
.ep-hero h1 {
  font-family: 'Caveat', cursive;
  font-size: clamp(2.2rem, 5vw, 3.1rem);
  line-height: 1.08;
  margin-bottom: 0.35rem;
}
.ep-lede { font-size: 1.12rem; color: var(--muted); max-width: 72ch; }

.ep-card {
  background: var(--card);
  border: 2px dashed rgba(44, 44, 44, 0.28);
  border-radius: 10px;
  padding: 1.1rem 1.2rem;
  margin-bottom: 1.25rem;
}

.ep-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  margin-bottom: 0.75rem;
}

.ep-tabs, .ep-cats { display: inline-flex; flex-wrap: wrap; gap: 0.4rem; }
.ep-tab, .ep-cat-btn, .ep-btn {
  min-height: 40px;
  padding: 0.35rem 0.85rem;
  border-radius: 8px;
  border: 2px solid rgba(44, 44, 44, 0.28);
  background: #fffcf6;
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
  cursor: pointer;
}
.ep-tab.is-active, .ep-cat-btn.is-active { background: var(--ink); color: #fff; border-color: var(--ink); }
.ep-btn--primary { background: var(--green); color: #fff; border-color: #1e8449; font-weight: 700; }
.ep-btn--primary:disabled { opacity: 0.48; cursor: not-allowed; }
.ep-btn--next { background: var(--red); color: #fff; border-color: #962d22; font-weight: 700; }

.ep-status { display: flex; flex-wrap: wrap; gap: 0.65rem; font-size: 1rem; color: var(--muted); }
.ep-pill { background: rgba(39, 174, 96, 0.14); color: var(--ink); padding: 0.15rem 0.65rem; border-radius: 999px; font-weight: 700; }

.ep-chart-head { margin-bottom: 0.65rem; }
.ep-chart-head h2 { font-family: 'Caveat', cursive; font-size: 1.8rem; line-height: 1.15; }
.ep-chart-head p { font-size: 0.96rem; color: var(--muted); }

.ep-canvas-box {
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 270px;
  max-height: 420px;
  border: 2px solid rgba(44, 44, 44, 0.35);
  border-radius: 8px;
  overflow: hidden;
  background: #faf6ee;
}
#ep-canvas { width: 100%; height: 100%; display: block; touch-action: none; cursor: crosshair; }

.ep-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 0.6rem 0 0.75rem;
  font-size: 0.95rem;
  color: var(--muted);
}
.ep-dot { display: inline-block; width: 11px; height: 11px; border-radius: 50%; margin-right: 5px; vertical-align: -1px; }
.ep-dot--known { background: var(--ink); }
.ep-dot--guess { background: var(--red); }
.ep-dot--truth { background: var(--green); }

.ep-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; }

.ep-reveal {
  margin-top: 0.85rem;
  padding: 0.85rem 1rem;
  border-left: 4px solid var(--green);
  background: rgba(39, 174, 96, 0.08);
  border-radius: 6px;
}
.ep-reveal-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.65rem; margin-bottom: 0.35rem; font-size: 1.05rem; }
.ep-badge { padding: 0.1rem 0.55rem; border-radius: 999px; font-size: 0.9rem; font-weight: 700; }
.ep-badge.is-ok { background: rgba(39, 174, 96, 0.2); color: #166534; }
.ep-badge.is-miss { background: rgba(192, 57, 43, 0.18); color: #991b1b; }
.ep-ride-link { color: var(--red); font-weight: 700; margin-left: 0.35rem; }

.ep-summary {
  margin-top: 0.9rem;
  padding: 1rem;
  border: 2px solid var(--green);
  border-radius: 8px;
  background: #fffdf8;
}
.ep-summary h3 { font-family: 'Playfair Display', serif; font-size: 1.35rem; margin-bottom: 0.35rem; }
.ep-tiles { font-size: 1.5rem; letter-spacing: 0.15rem; margin: 0.35rem 0; }
.ep-summary-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; margin-top: 0.65rem; }

.ep-prose h2 { font-family: 'Caveat', cursive; font-size: 1.95rem; margin: 0 0 0.5rem; }
.ep-prose p, .ep-prose li { font-size: 1.06rem; margin-bottom: 0.6rem; }
.ep-prose ol, .ep-prose ul { padding-left: 1.35rem; margin-bottom: 0.6rem; }
.ep-prose a { color: var(--red); font-weight: 700; }

.table-wrap { overflow-x: auto; border-radius: 8px; border: 1px solid rgba(44, 44, 44, 0.2); background: #fffdf8; }
.cmp { width: 100%; border-collapse: collapse; font-size: 0.98rem; text-align: left; }
.cmp th, .cmp td { padding: 0.6rem 0.75rem; border-bottom: 1px solid rgba(44, 44, 44, 0.14); vertical-align: top; }
.cmp thead th { background: rgba(44, 44, 44, 0.06); font-weight: 700; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }

.ep-shot { margin: 0.85rem 0 0.25rem; }
.ep-shot img { width: 100%; height: auto; border-radius: 8px; border: 2px solid rgba(44, 44, 44, 0.24); display: block; }
.ep-shot figcaption { font-size: 0.94rem; color: var(--muted); margin-top: 0.4rem; }

.qa { border-top: 1px dashed rgba(44, 44, 44, 0.22); padding: 0.6rem 0; }
.qa:first-of-type { border-top: 0; }
.qa summary { cursor: pointer; font-weight: 700; font-size: 1.08rem; list-style: none; }
.qa summary::-webkit-details-marker { display: none; }
.qa p { margin-top: 0.4rem; color: var(--ink); }

.ep-disclaimer { font-size: 0.94rem; color: var(--muted); border-top: 1px dashed rgba(44, 44, 44, 0.25); padding-top: 0.75rem; margin-top: 0.5rem; }

.market-floor {
  width: min(920px, 94vw);
  margin: 0 auto 2rem;
  padding: 1.15rem 1.25rem;
  background: rgba(255, 250, 240, 0.78);
  border-top: 2px dashed rgba(44, 44, 44, 0.28);
}
.market-floor-inner { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 1rem; }
.market-floor-kicker { grid-column: 1 / -1; color: var(--muted); }
.market-floor-column h2 { font-family: 'Caveat', cursive; font-size: 1.4rem; margin-bottom: 0.35rem; }
.market-floor-column nav { display: flex; flex-direction: column; gap: 0.25rem; }
.market-floor-column a { color: var(--ink); text-decoration: none; }
.market-floor-column a:hover { color: var(--red); text-decoration: underline; }
