@import url('https://fonts.googleapis.com/css2?family=Signika:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

:root {
  /* ============================================================
     Theme: Red / Magenta / Pink
     ============================================================ */
  --red:        #E31B3A;
  --magenta:    #C2185B;
  --pink:       #F06292;
  --pink-light: #FCE4EC;
  --pink-pale:  #FFF0F3;
  --accent:     #FF4081;

  --bg:         #FFFFFF;
  --bg-alt:     #FFF8FA;
  --text:       #1A0A0F;
  --text-muted: #7A4A55;
  --text-light: #C2899A;
  --border:     #F5D0D8;
  --shadow:     rgba(195,24,91,.10);

  --max-width:  1160px;
  --radius:     6px;
  --radius-sm:  4px;

  /* A few small derived shades to support hover states and soft
     dividers that the base palette doesn't spell out directly. */
  --magenta-dark: #8f123f;
  --line-soft:    #fbe0e6;
  --radius-lg:    10px;

  --font-body: 'Signika', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  font-size: 15.5px;
}

h1, h2, h3, h4 { font-family: var(--font-body); margin: 0; }

a { color: var(--magenta); text-decoration: none; }
a:hover { color: var(--red); }

img { max-width: 100%; display: block; }

:focus-visible {
  outline: 2px solid var(--pink);
  outline-offset: 2px;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* ============================================================
   Utility strip — small, functional, not decorative chrome
   ============================================================ */
.utility-strip {
  background: var(--text);
  color: rgba(255,255,255,0.72);
  font-size: 12.5px;
}

.utility-strip .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 8px;
  padding-bottom: 8px;
  gap: 12px;
  flex-wrap: wrap;
}

.utility-strip time { font-family: var(--font-mono); color: rgba(255,255,255,0.9); }

/* ============================================================
   Masthead
   ============================================================ */
.site-header {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 0;
  gap: 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand__mark {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(155deg, var(--pink), var(--magenta));
  color: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 15px;
  box-shadow: 0 6px 14px -4px rgba(195, 24, 91, 0.55);
}

.brand__text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand__name {
  font-size: 19px;
  font-weight: 700;
  color: var(--text);
}

.brand__tag {
  font-size: 12px;
  color: var(--text-light);
}

.main-nav ul {
  list-style: none;
  display: flex;
  gap: 4px;
  margin: 0;
  padding: 0;
}

.main-nav a {
  display: block;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 14.5px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
}

.main-nav a:hover { color: var(--magenta); background: var(--pink-pale); }

/* ============================================================
   Hero — latest draw board
   ============================================================ */
.draw-hero {
  background:
    radial-gradient(1100px 420px at 12% -10%, rgba(255, 64, 129, 0.35), transparent 60%),
    linear-gradient(155deg, var(--magenta) 0%, var(--red) 100%);
  color: var(--bg);
  padding: 46px 0 54px;
  position: relative;
  overflow: hidden;
}

.draw-hero__eyebrow {
  font-size: 13.5px;
  color: rgba(255,255,255,0.72);
  margin-bottom: 10px;
}

.draw-hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 32px;
  align-items: end;
}

.draw-hero__title {
  font-size: 30px;
  font-weight: 700;
  margin: 0 0 8px;
  letter-spacing: -0.01em;
}

.draw-hero__meta {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
  color: rgba(255,255,255,0.82);
  font-size: 14px;
  margin-bottom: 26px;
}

.draw-hero__meta strong {
  font-family: var(--font-mono);
  color: var(--bg);
  font-weight: 700;
}

.ball-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
}

.ball {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 17px;
  color: var(--magenta);
  background: linear-gradient(160deg, #ffffff 0%, var(--pink-light) 100%);
  border: 2px solid var(--pink);
  box-shadow:
    inset 0 2px 3px rgba(255,255,255,0.9),
    inset 0 -6px 10px rgba(195, 24, 91, 0.18),
    0 6px 14px -4px rgba(195, 24, 91, 0.5);
}

.ball--accent {
  background: linear-gradient(160deg, var(--accent) 0%, var(--red) 100%);
  color: var(--bg);
  border: 2px solid rgba(255, 255, 255, 0.8);
  box-shadow:
    inset 0 2px 3px rgba(255,255,255,0.35),
    inset 0 -6px 10px rgba(147, 15, 30, 0.35),
    0 6px 14px -4px rgba(195, 24, 91, 0.5);
}

.ball--tag {
  border-radius: 14px;
  width: auto;
  min-width: 54px;
  padding: 0 14px;
  font-size: 15px;
}

.ball-divider {
  width: 1px;
  align-self: stretch;
  background: rgba(255,255,255,0.28);
  margin: 6px 2px;
}

.draw-hero__actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 14px;
}

.draw-hero__logo {
  width: 88px;
  height: 88px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.22);
}
.draw-hero__logo img { width: 100%; height: 100%; object-fit: cover; }

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--magenta);
  color: var(--bg);
  border: none;
  padding: 11px 20px;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
}
.btn:hover { background: var(--magenta-dark); color: var(--bg); }

.btn--outline {
  background: transparent;
  color: var(--magenta);
  border: 1px solid var(--pink);
}
.btn--outline:hover { background: var(--pink-pale); color: var(--magenta-dark); }

.btn--on-dark {
  background: var(--bg);
  color: var(--magenta);
}
.btn--on-dark:hover { background: var(--pink-light); color: var(--magenta-dark); }

/* ============================================================
   Page body / section headings
   ============================================================ */
.page-body { padding: 44px 0 70px; }

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.section-heading h2 {
  font-size: 21px;
  font-weight: 700;
  color: var(--text);
}

.section-heading .count {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-light);
}

/* ============================================================
   Category board
   ============================================================ */
.board-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
  gap: 22px;
}

.board {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg);
}

.board__head {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  border-left: 4px solid var(--accent);
}

.board__head img {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--pink-light);
  flex-shrink: 0;
}

.board__head .titles { flex: 1; min-width: 0; }

.board__head h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.board__head .draw-day {
  font-size: 12px;
  color: var(--text-light);
}

.board__head .view-all {
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
}

/* ============================================================
   Results table
   ============================================================ */
table.results-table {
  width: 100%;
  border-collapse: collapse;
}

table.results-table th {
  text-align: left;
  padding: 10px 18px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border);
  background: var(--bg-alt);
}

table.results-table td {
  padding: 13px 18px;
  font-size: 14px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
}

table.results-table tbody tr:last-child td { border-bottom: none; }
table.results-table tbody tr:hover { background: var(--pink-pale); }

table.results-table td.draw-cell a {
  color: var(--text);
  font-weight: 700;
  font-family: var(--font-mono);
}

table.results-table td.date-cell {
  color: var(--text-muted);
  font-size: 13.5px;
  white-space: nowrap;
}

.number-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.chip {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 13px;
  color: var(--magenta);
  background: var(--pink-light);
  border-radius: 20px;
  padding: 3px 10px;
  line-height: 1.5;
}

.chip--accent {
  color: var(--bg);
  background: var(--accent);
}

td.link-cell { text-align: right; white-space: nowrap; }
td.link-cell a { font-weight: 600; font-size: 13px; }

/* ============================================================
   Result detail page
   ============================================================ */
.detail-hero {
  background: linear-gradient(155deg, var(--magenta) 0%, var(--red) 100%);
  color: var(--bg);
  padding: 34px 0 42px;
}

.breadcrumb {
  font-size: 13px;
  color: rgba(255,255,255,0.68);
  margin-bottom: 14px;
}
.breadcrumb a { color: rgba(255,255,255,0.88); }
.breadcrumb a:hover { color: var(--bg); }
.breadcrumb .sep { margin: 0 6px; color: rgba(255,255,255,0.45); }

.detail-hero h1 {
  font-size: 27px;
  font-weight: 700;
  margin: 0 0 6px;
}

.detail-hero .draw-line {
  font-family: var(--font-mono);
  color: rgba(255,255,255,0.8);
  font-size: 14px;
}

.result-panel {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 1px 2px var(--shadow), 0 10px 24px -12px rgba(195, 24, 91, 0.22);
  padding: 30px;
  margin-top: -30px;
  position: relative;
}

.result-panel__label {
  font-size: 12.5px;
  color: var(--text-light);
  margin-bottom: 12px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-top: 26px;
}

.stat-cell {
  background: var(--bg);
  padding: 15px 16px;
}

.stat-cell .label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-light);
  margin-bottom: 5px;
}

.stat-cell .value {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 16.5px;
  color: var(--text);
}

.result-panel__actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
}

.history-section { margin-top: 40px; }

/* ============================================================
   Empty state
   ============================================================ */
.empty-state {
  text-align: center;
  padding: 46px 20px;
  color: var(--text-light);
  font-size: 14.5px;
}

/* ============================================================
   Pagination
   ============================================================ */
.pager {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 22px;
  gap: 12px;
}
.pager .status { font-family: var(--font-mono); font-size: 12.5px; color: var(--text-light); }

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  background: var(--text);
  color: rgba(255,255,255,0.7);
  padding: 46px 0 26px;
  font-size: 13.5px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 32px;
  padding-bottom: 30px;
  border-bottom: 1px solid rgba(255,255,255,0.14);
}

.footer-grid h4 {
  color: var(--bg);
  font-size: 13.5px;
  font-weight: 700;
  margin-bottom: 14px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--bg);
  font-weight: 700;
  font-size: 16px;
  margin-bottom: 10px;
}

.footer-grid p { margin: 0; line-height: 1.6; max-width: 40ch; }

.footer-links { list-style: none; margin: 0; padding: 0; }
.footer-links li { margin-bottom: 8px; }
.footer-links a { color: rgba(255,255,255,0.7); }
.footer-links a:hover { color: var(--bg); }

.footer-bottom {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 20px;
  font-size: 12.5px;
  color: rgba(255,255,255,0.48);
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 860px) {
  .draw-hero__grid { grid-template-columns: 1fr; }
  .draw-hero__actions { flex-direction: row; align-items: center; justify-content: space-between; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid > div:first-child { grid-column: 1 / -1; }
}

@media (max-width: 720px) {
  .site-header__inner { flex-wrap: wrap; }
  .main-nav ul { flex-wrap: wrap; gap: 2px; }
  table.results-table th:nth-child(3),
  table.results-table td:nth-child(3) { display: none; }
  .draw-hero__title { font-size: 24px; }
  .result-panel { padding: 22px; }
  .footer-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .ball { width: 42px; height: 42px; font-size: 14px; }
  .draw-hero { padding: 34px 0 44px; }
  .utility-strip .container { justify-content: center; text-align: center; }
}