@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@600;700;800&family=Source+Sans+3:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500&display=swap');

:root {
  --bg: #F6F1E7;
  --card: #FFFFFF;
  --border: #E2D5BA;
  --ink: #23291F;
  --muted: #6B6255;
  --muted-light: #A99E8C;
  --accent: #1F5C3D;
  --accent-dark: #143D29;
  --wine: #7A2333;
  --gold: #B8862E;
  --sidebar-grad: linear-gradient(180deg, #143D29 0%, #1F5C3D 60%, #2C7A52 100%);
  --danger: #A6403A;
}

html { scroll-behavior: smooth; }
* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Source Sans 3', system-ui, sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: url("background.jpg");
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  opacity: 0.10;
  z-index: -1;
  pointer-events: none;
}

.shell {
  display: flex;
  min-height: 100vh;
  align-items: stretch;
}

.sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--sidebar-grad);
  color: #F6F1E7;
  display: flex;
  flex-direction: column;
  padding: 28px 22px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand { display: flex; align-items: center; gap: 12px; margin-bottom: 40px; }
.brand-logo { height: 44px; width: auto; }
.brand-name {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: 18px;
  line-height: 1.15;
}
.brand-name span { display: block; font-size: 12px; font-weight: 500; letter-spacing: 0.14em; opacity: 0.75; }

.side-nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }

.side-link {
  color: #E7E0CE;
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 600;
  padding: 10px 14px;
  border-radius: 8px;
  letter-spacing: 0.02em;
  border-left: 3px solid transparent;
}
.side-link:hover { background: rgba(255,255,255,0.08); }
.side-link.active {
  background: rgba(255,255,255,0.14);
  color: #fff;
  border-left: 3px solid var(--gold);
  padding-left: 11px;
}

.side-footer {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10.5px;
  opacity: 0.55;
  padding-top: 18px;
  border-top: 1px solid rgba(255,255,255,0.15);
}

.content {
  flex: 1;
  min-width: 0;
  padding: 44px 48px 70px;
  max-width: 980px;
}

@media (max-width: 820px) {
  .shell { flex-direction: column; }
  .sidebar {
    width: 100%;
    height: auto;
    position: relative;
    flex-direction: row;
    align-items: center;
    padding: 14px 18px;
    gap: 18px;
  }
  .brand { margin-bottom: 0; }
  .side-nav { flex-direction: row; flex-wrap: wrap; gap: 2px; }
  .side-footer { display: none; }
  .content { padding: 28px 20px 50px; }
}

@media (max-width: 480px) {
  .hero { padding: 22px 18px; }
  .hero-top { flex-direction: column; align-items: flex-start; gap: 14px; }
  .countdown-badge { text-align: left; width: 100%; }
  .countdown-badge .eyebrow { text-align: left; }
  .hero-date { font-size: 22px; }
  .countdown-value { font-size: 22px; }
  .filter-bar { flex-direction: column; align-items: stretch; }
  .filter-bar .btn { width: 100%; justify-content: center; }
  .num-chip { min-width: 34px; height: 34px; font-size: 13px; }
  .pagination { flex-wrap: wrap; gap: 6px; }
  .brand-name { font-size: 15px; }
}

.eyebrow {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--gold);
  font-weight: 600;
  margin-bottom: 10px;
  text-transform: uppercase;
}

h1, h2, h3 { font-family: 'Playfair Display', serif; margin: 0; }

.hero {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 38px 40px;
  margin-bottom: 26px;
  box-shadow: 0 8px 28px rgba(35,41,31,0.07);
  position: relative;
}
.hero::after {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--accent), var(--gold), var(--wine));
}

.hero-top { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 20px; margin-bottom: 6px; }

.hero-date { font-family: 'Playfair Display', serif; font-weight: 700; font-size: 28px; margin-bottom: 4px; }

.countdown-badge {
  text-align: right;
}
.countdown-badge .eyebrow { margin-bottom: 4px; text-align: right; }
.countdown-value {
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 500;
  font-size: 24px;
  color: var(--accent);
  letter-spacing: 0.02em;
}
.countdown-note { font-size: 11px; color: var(--muted-light); margin-top: 2px; }

.tier-block { margin-top: 22px; padding-top: 18px; border-top: 1px dashed var(--border); }
.tier-block:first-of-type { border-top: none; margin-top: 18px; padding-top: 0; }

.tier-name {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 10px;
}

.chip-row { display: flex; gap: 8px; flex-wrap: wrap; }

.num-chip {
  min-width: 38px;
  height: 38px;
  padding: 0 4px;
  border-radius: 6px;
  border: 1.5px solid var(--chip-color, var(--accent));
  color: var(--chip-color, var(--accent));
  background: #FCFAF3;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: 15px;
}

.glance-strip { display: flex; flex-direction: column; gap: 10px; margin-bottom: 30px; }
.glance-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 12px 18px;
  text-decoration: none;
  color: var(--ink);
  font-size: 13.5px;
}
.glance-row:hover { border-color: var(--accent); }
.glance-row .g-date { font-weight: 600; }
.glance-row .g-see { font-size: 12px; color: var(--accent); font-weight: 700; letter-spacing: 0.03em; }

.section-heading {
  font-family: 'Playfair Display', serif;
  font-size: 17px;
  margin: 0 0 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-heading::after { content: ""; flex: 1; height: 1px; background: var(--border); }

.info-row { display: flex; gap: 20px; flex-wrap: wrap; margin-bottom: 10px; }
.info-panel {
  flex: 1 1 260px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 22px 24px;
}
.info-panel h3 { font-size: 15px; margin-bottom: 8px; }
.info-panel p { font-size: 13.5px; line-height: 1.6; color: var(--muted); margin: 0; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: none;
  border-radius: 3px;
  font-weight: 700;
  font-size: 13.5px;
  padding: 10px 18px;
  cursor: pointer;
  font-family: 'Source Sans 3', sans-serif;
  text-decoration: none;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-outline { background: transparent; color: var(--accent); border: 1.5px solid var(--accent); }
.btn-block { width: 100%; justify-content: center; }

.filter-bar {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 18px 22px;
  margin-bottom: 30px;
  display: flex;
  align-items: flex-end;
  gap: 14px;
  flex-wrap: wrap;
}
.filter-field label { display: block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); margin-bottom: 6px; }
.input {
  padding: 9px 11px;
  border-radius: 3px;
  border: 1px solid var(--border);
  background: #FCFAF3;
  color: var(--ink);
  font-size: 13px;
  font-family: 'Source Sans 3', sans-serif;
}
.input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.clear-link { font-size: 12.5px; color: var(--wine); font-weight: 600; text-decoration: none; }

.timeline { position: relative; padding-left: 26px; }
.timeline::before {
  content: "";
  position: absolute;
  left: 5px; top: 6px; bottom: 6px;
  width: 2px;
  background: var(--border);
}

.timeline-item { position: relative; margin-bottom: 22px; }
.timeline-item::before {
  content: "";
  position: absolute;
  left: -26px; top: 22px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--gold);
  border: 2px solid var(--card);
  box-shadow: 0 0 0 2px var(--gold);
}

.timeline-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 20px 24px;
}
.timeline-card-date { font-family: 'Playfair Display', serif; font-weight: 700; font-size: 17px; margin-bottom: 14px; }

.pagination { display: flex; justify-content: center; gap: 10px; margin-top: 30px; }
.page-link {
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--ink);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
}
.page-link.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.page-link.disabled { opacity: 0.35; pointer-events: none; }

.empty-state { text-align: center; padding: 44px 20px; color: var(--muted); background: var(--card); border: 1px dashed var(--border); border-radius: 4px; }

.prose h2 { font-size: 20px; margin: 26px 0 10px; }
.prose h2:first-child { margin-top: 0; }
.prose p, .prose li { font-size: 14px; line-height: 1.7; color: var(--muted); }
.prose strong { color: var(--ink); }

.admin-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 22px;
  margin-bottom: 18px;
  box-shadow: 0 8px 28px rgba(35,41,31,0.07);
}
.admin-card h3 { font-size: 15px; margin: 0 0 14px; }
.admin-card.danger-card { border-color: var(--danger); }
.admin-card.danger-card h3 { color: var(--danger); }

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

.error-text { color: var(--danger); font-size: 13px; margin: 8px 0; }
.success-text { color: var(--accent); font-size: 13px; margin: 8px 0; }

.login-card { max-width: 380px; margin: 60px auto 0; text-align: center; }
.lock-icon { font-size: 24px; margin-bottom: 10px; }
.login-card h2 { font-size: 19px; margin: 0 0 6px; }
.muted { color: var(--muted); font-size: 13px; margin-bottom: 16px; }

.draws-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.draws-table th {
  text-align: left;
  vertical-align: top;
  padding: 12px 14px;
  background: #FCFAF3;
  border: 1px solid var(--border);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  white-space: nowrap;
}
.draws-table th:last-child { text-align: center; }
.draws-table td { padding: 12px 14px; border: 1px solid var(--border); vertical-align: top; }
.draws-table td:first-child { font-weight: 600; white-space: nowrap; }
.draws-table td:last-child { text-align: center; white-space: nowrap; }
.draws-table tbody tr:nth-child(even) { background: #FCFAF3; }

.number-pill-row { display: flex; flex-wrap: nowrap; gap: 4px; }
.number-pill {
  display: inline-block;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 2px 6px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
}

.btn-icon { background: none; border: none; color: var(--danger); cursor: pointer; font-size: 15px; opacity: 0.6; }
.btn-icon:hover { opacity: 1; }

#editModalOverlay {
  display: none; position: fixed; inset: 0; background: rgba(20,61,41,0.45); z-index: 100;
  align-items: flex-start; justify-content: center; padding: 40px 20px; overflow-y: auto;
}
.modal-box { background: #fff; border-radius: 4px; max-width: 520px; width: 100%; padding: 26px; }