/* =========================
   YEAR TRIVIA — CORE MODULE (Base)
   ========================= */
.igc-trivia-wrap { margin-top: 10px; }
.igc-trivia-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.igc-trivia-section { margin: 16px 0; }

.igc-list li { 
  display: grid; 
  grid-template-columns: 120px 1fr auto; 
  gap: 8px; 
  padding: 8px 10px; 
  border: 1px solid var(--igc-border); 
  border-radius: 10px; 
  background: var(--igc-card-bg); 
}
.igc-wtag { font-size: 12px; color: var(--igc-muted); }

.igc-month-table { display: grid; gap: 6px; }
.igc-row { 
  display: grid; 
  grid-template-columns: 1.4fr repeat(5, .9fr); 
  gap: 6px; 
  padding: 8px 10px; 
  border: 1px solid var(--igc-border); 
  border-radius: 10px; 
  background: var(--igc-card-bg); 
}
.igc-row.igc-head { font-weight: 700; background: rgba(0,0,0,.02); }

/* =========================
   YEAR TRIVIA — THEME TOKENS (Local)
   ========================= */
.igc-trivia-wrap{
  --c-bg: var(--igc-card-bg);
  --c-border: var(--igc-border);
  --c-muted: var(--igc-muted);
  --c-pill: #f3f4f6;
  --radius: 12px;
  --pad: 14px;
  --shadow: 0 2px 8px rgba(0,0,0,.06);
  color:#111; 
  line-height:1.45;
}
.igc-title { margin:0 0 8px; font-size:26px; font-weight:800; }
.igc-muted, .igc-subtle { color:var(--c-muted); }
.igc-subtle { margin-bottom:6px; }

/* =========================
   LAYOUT GRIDS & CARDS
   ========================= */
.igc-grid{ display:grid; gap:12px; }
.igc-grid-autofit{ grid-template-columns: repeat(auto-fit, minmax(260px,1fr)); }
.igc-grid-2{ grid-template-columns: repeat(2, minmax(0,1fr)); }

.igc-card{ 
  background:var(--c-bg); 
  border:1px solid var(--c-border); 
  border-radius:var(--radius); 
  padding:var(--pad); 
  box-shadow:var(--shadow); 
}
.igc-card-info{ border-color:#c7d2fe; }

/* =========================
   PILLS / CHIPS (Scoped)
   ========================= */
.igc-pills{ display:flex; gap:8px; flex-wrap:wrap; margin: 8px 0 0; }
.igc-trivia-wrap .pill{ 
  background:var(--c-pill); 
  border:1px solid var(--c-border); 
  border-radius:999px; 
  padding:5px 10px; 
  font-weight:600; 
}
.igc-trivia-wrap .pill-gh{ background:#fde8e8; border-color:#f5b5b5; color:#9f1d1d; }
.igc-trivia-wrap .pill-rh{ background:#e6f7ed; border-color:#a8e0bf; color:#166f3c; }

/* =========================
   SECTIONS & TYPOGRAPHY
   ========================= */
.igc-ul{ margin:0; padding-left:18px; line-height:1.7; }
.igc-empty{ color:var(--c-muted); }

/* =========================
   MONTH TABLE STRUCTURE
   ========================= */
.igc-month-table .igc-head{
  display:grid; grid-template-columns: 1.2fr repeat(5, .8fr); gap:6px;
  font-weight:700; background:#f9fafb; border:1px solid var(--c-border);
  border-radius:8px; padding:6px 8px;
}
.igc-month-table .igc-row{
  display:grid; grid-template-columns: 1.2fr repeat(5, .8fr); gap:6px;
  border:1px solid var(--c-border); border-radius:10px; padding:8px 10px; background:#fff;
}
.igc-month-label{ font-weight:600; }
.igc-chip{ display:inline-block; border-radius:999px; padding:2px 8px; font-weight:600; border:1px solid transparent; }
.igc-chip--gh{ background:#fde8e8; border-color:#f5b5b5; }
.igc-chip--rh{ background:#e6f7ed; border-color:#a8e0bf; }

/* =========================
   LEGEND & LIST ROWS
   ========================= */
.igc-legend{ display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.igc-legend-label{ font-size:13px; color:var(--c-muted); }

.igc-list{ list-style:none; padding:0; margin:0; display:grid; gap:8px; }
.igc-list-row{
  border-radius:10px; padding:8px 10px; display:flex; gap:10px; align-items:baseline; flex-wrap:wrap;
  border:1px solid var(--c-border); background:#fff;
}
.igc-row--past{ background:#f9fafb; border-color:#e5e7eb; }
.igc-row--today{ background:#fff7ed; border-color:#fdba74; }
.igc-row--future{ background:#ecfdf5; border-color:#a7f3d0; }

.igc-link{ text-decoration:none; }
.igc-wtag{ opacity:.75; }

/* =========================
   BADGES
   ========================= */
.igc-badge{
  display:inline-block; padding:.15rem .5rem; border-radius:999px; font-size:12px; font-weight:600;
  border:1px solid; line-height:1.2;
}
.igc-badge--past{ background:#f3f4f6; color:#374151; border-color:#e5e7eb; }
.igc-badge--today{ background:#fff7ed; color:#92400e; border-color:#fdba74; }
.igc-badge--future{ background:#ecfdf5; color:#065f46; border-color:#a7f3d0; }

.igc-trivia-header{ margin-bottom:14px; }
.igc-pills--right { margin: 0; }
.igc-legends .pill.pill-weekend{
  background:#f3f4f6; color:#374151; border:1px solid #b0b0b0; font-weight:500; font-size:13px; padding:5px 12px; border-radius:999px; white-space:nowrap; box-shadow:0 1px 2px rgba(0,0,0,.05);
}

/* =========================
   YEAR TRIVIA — HEADINGS POLISH
   ========================= */
:root {
  --igc-accent: #2563eb;
  --igc-accent-2: #22c55e;
  --igc-muted: #6b7280;
  --igc-border: #e5e7eb;
  --igc-card-bg: #fff;
  --igc-gradient: linear-gradient(90deg, var(--igc-accent), var(--igc-accent-2));
}

.igc-trivia-wrap .igc-title{
  margin: 0 0 14px; font-weight: 900; line-height: 1.15; letter-spacing: -0.02em;
  font-size: clamp(28px, 3.2vw, 40px);
  background: var(--igc-gradient);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.igc-section-header{
  display:flex; align-items:center; justify-content:space-between; gap: 12px;
  margin: 18px 0 10px; padding-bottom: 8px; border-bottom: 1px dashed var(--igc-border);
}
.igc-h3{
  position: relative; margin: 0; font-weight: 800; letter-spacing: -0.01em; line-height: 1.2;
  font-size: clamp(18px, 2.2vw, 24px); padding-left: 14px;
}
.igc-h3::before{
  content:""; position:absolute; left:0; top:50%; transform:translateY(-50%);
  width:6px; height:22px; border-radius:6px;
  background: linear-gradient(180deg, var(--igc-accent), var(--igc-accent-2));
  box-shadow: 0 0 0 2px rgba(37,99,235,.08);
}
.igc-card-title{
  margin: 0 0 8px; font-weight: 800; font-size: clamp(16px, 1.8vw, 20px);
  display:flex; align-items:center; gap:8px;
}
.igc-card-title::after{
  content:""; flex:1 1 auto; height: 1px; margin-left: 6px;
  background: linear-gradient(90deg, rgba(37,99,235,.25), rgba(34,197,94,.25));
}
.igc-h4{
  margin: 0 0 10px; font-weight: 800; font-size: clamp(15px, 1.6vw, 18px); color: #111;
  position: relative; padding-bottom: 4px;
}
.igc-h4::after{
  content:""; position:absolute; left:0; bottom:0; width: 48px; height: 3px; border-radius: 3px;
  background: var(--igc-gradient);
}
.igc-legend, .igc-pills.igc-pills--right{ display:flex; flex-wrap:wrap; align-items:center; gap:8px; }
.igc-legend .igc-legend-label{ font-weight:700; color:#111; }
#igc-month-summary .igc-section-header{ margin-top: 24px; }
#igc-month-summary .igc-h3{ padding-left: 16px; }
#igc-month-summary .igc-h3::before{ height: 24px; }
.igc-section{ margin: 18px 0 6px; }
.igc-section-header a.igc-link{ text-decoration: none; border-bottom: 1px dotted transparent; }
.igc-section-header a.igc-link:hover{ border-bottom-color: currentColor; }

/* =========================
   TRIVIA CHARTS — RICH STYLE
   ========================= */
.igc-card--chart { padding-bottom: .5rem; }
.igc-chart { width: 100%; margin: .25rem 0 .75rem; }
.igc-chart-svg { width: 100%; height: auto; display: block; }

:root {
  --igc-bar-top:    hsl(234 95% 85%);
  --igc-bar-bottom: hsl(245 75% 54%);
  --igc-focus:      hsl(217 91% 60%);
  --igc-bar-low:    0.75;
  --igc-bar-med:    0.9;
  --igc-bar-high:   1;
}

.igc-gridline { stroke: currentColor; opacity: .08; shape-rendering: crispEdges; }
.igc-axis-y, .igc-axis-x { font-size: 12px; fill: currentColor; opacity: .7; }

.igc-bargrp { transform-box: fill-box; transform-origin: 50% 100%; }
.igc-bar {
  transition: y .6s ease, height .6s ease, transform .2s ease, opacity .2s ease, filter .2s ease;
  opacity: var(--bar-opacity, 1);
}
.igc-bargrp.low  { --bar-opacity: var(--igc-bar-low); }
.igc-bargrp.med  { --bar-opacity: var(--igc-bar-med); }
.igc-bargrp.high { --bar-opacity: var(--igc-bar-high); }

.igc-bargrp:hover .igc-bar,
.igc-bargrp:focus-within .igc-bar {
  transform: translateY(-2px);
  filter: url(#igcFocusHalo) url(#igcBarShadow);
}
.igc-hit { cursor: pointer; }

.igc-val { font-size: 11px; font-weight: 600; fill: currentColor; opacity: .85; pointer-events: none; }
.igc-val.inside { fill: white; opacity: .95; text-shadow: 0 1px 1px rgba(0,0,0,.35); }

/* =========================
   MEDIA QUERIES (Merged)
   ========================= */
@media (max-width: 560px) {
  .igc-list li { grid-template-columns: 1fr; }
  .igc-wtag { justify-self: start; }
  .igc-row { grid-template-columns: 1.2fr repeat(5, .8fr); }
  .igc-list-row .igc-date { min-width: 0; flex: 1 1 100%; }
  .igc-date-main { white-space: nowrap; }
  .igc-list > li.igc-list-row {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 8px;
  }
  .igc-list-row .igc-meta {
    position: absolute;
    top: 8px; right: 10px;
    margin-left: 0;
  }
  .igc-list-row .igc-title-cell {
    order: 3; flex: 1 1 100%; margin-left: 0;
  }
}
@media (max-width: 860px){ .igc-grid-2{ grid-template-columns: 1fr; } }
@media (max-width: 640px){
  .igc-section-header{ align-items:flex-start; }
  .igc-legend, .igc-pills.igc-pills--right{ justify-content:flex-start; }
}
@media (prefers-contrast: more) {
  .igc-bar { filter: none; }
}

/* =========================
   ANIMATIONS
   ========================= */
.igc-chart.rich .igc-bar { animation: igc-rise .7s ease var(--delay, 0s) backwards; }
.igc-chart.rich .igc-bargrp:nth-child(12n+1) .igc-bar { --delay: .02s; }
.igc-chart.rich .igc-bargrp:nth-child(12n+2) .igc-bar { --delay: .05s; }
.igc-chart.rich .igc-bargrp:nth-child(12n+3) .igc-bar { --delay: .08s; }
.igc-chart.rich .igc-bargrp:nth-child(12n+4) .igc-bar { --delay: .11s; }
.igc-chart.rich .igc-bargrp:nth-child(12n+5) .igc-bar { --delay: .14s; }
.igc-chart.rich .igc-bargrp:nth-child(12n+6) .igc-bar { --delay: .17s; }
.igc-chart.rich .igc-bargrp:nth-child(12n+7) .igc-bar { --delay: .20s; }
.igc-chart.rich .igc-bargrp:nth-child(12n+8) .igc-bar { --delay: .23s; }
.igc-chart.rich .igc-bargrp:nth-child(12n+9) .igc-bar { --delay: .26s; }
.igc-chart.rich .igc-bargrp:nth-child(12n+10) .igc-bar { --delay: .29s; }
.igc-chart.rich .igc-bargrp:nth-child(12n+11) .igc-bar { --delay: .32s; }
.igc-chart.rich .igc-bargrp:nth-child(12n+12) .igc-bar { --delay: .35s; }

@keyframes igc-rise {
  from { transform: translateY(6px); opacity: 0; }
  to   { transform: translateY(0);   opacity: 1; }
}

/* === GH/RH list date split styling === */
.igc-date .igc-link { display: inline-block; text-decoration: none; }
.igc-date-main {
  display: block; white-space: nowrap; font-weight: 700;
}
.igc-date-dow {
  display: block; font-size: 12px; line-height: 1.2; color: var(--c-muted); margin-top: 1px;
}
.igc-list-row .igc-meta { order: 2; margin-left: auto; align-self: flex-start; display: flex; gap: 8px; align-items: center; }

/* Weekend highlight */
.igc-date-dow.is-sat,
.igc-date-dow.is-sun {
  display: inline-block; padding: 2px 6px; border-radius: 6px; font-weight: 700; border: 1px solid transparent;
}
.igc-date-dow.is-sat { background: #fee2e2; color: #991b1b; border-color: #fca5a5; }
.igc-date-dow.is-sun { background: #fee2e2; color: #991b1b; border-color: #fca5a5; }

/* --- Fix title alignment + equal GH/RH cards --- */
.igc-list-row .igc-date { flex: 0 0 190px; min-width: 190px; }
.igc-list-row .igc-title-cell { flex: 1 1 auto; margin-left: 0; }
@media (max-width: 560px) {
  .igc-list-row .igc-title-cell {
    flex: 1 1 100%;   /* full width, own row */
    margin-left: 0;   /* no offset */
    order: 3;         /* always after date & badge */
  }
}
@media (min-width: 861px) {
  #igc-gh-rh-grid .igc-grid-2 { align-items: stretch; }
  #igc-gh-rh-grid .igc-card { display: flex; flex-direction: column; max-height: 65vh; }
  #igc-gh-rh-grid .igc-card .igc-h4 { margin-bottom: 10px; flex: 0 0 auto; }
  #igc-gh-rh-grid .igc-card > .igc-list {
    flex: 1 1 auto; min-height: 0; overflow: auto; padding-right: 4px; scrollbar-width: thin;
  }
}
@media (max-width: 860px) {
  #igc-gh-rh-grid .igc-card > .igc-list { overflow: visible; max-height: none; }
}