*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 18px; }

:root {
  --bg: #000000;
  --surface: #0d0d0d;
  --surface2: #1a1a1a;
  --border: #262626;
  --primary: #00ffa3;
  --primary-hover: #00cc82;
  --correct: #00ffa3;
  --wrong: #ff4d4d;
  --text: #ffffff;
  --text-muted: #888888;
  --radius: 8px;
  --font: "Pretendard Variable", "Pretendard", -apple-system, sans-serif;
  --ease-out-quart: cubic-bezier(0.165, 0.84, 0.44, 1);
  --ease-in-out-quart: cubic-bezier(0.77, 0, 0.175, 1);
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.022), transparent 32%, rgba(0,255,163,0.045)),
    radial-gradient(ellipse at 50% 100%, rgba(0,255,163,0.18), transparent 58%),
    radial-gradient(ellipse at 0% 20%, rgba(0,255,163,0.09), transparent 38%),
    radial-gradient(ellipse at 100% 12%, rgba(0,212,255,0.055), transparent 34%);
}

a { color: inherit; text-decoration: none; }
.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

header {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
}

header h1 { font-size: 1.1rem; font-weight: 700; }
header h1 a { color: var(--text); font-size: 1.1rem; font-weight: 700; display: flex; align-items: center; }
.site-logo { height: 36px; width: auto; }
header a { color: var(--text-muted); font-size: 0.9rem; transition: color .15s; }
header a:hover { color: var(--text); }
header nav a.active { color: var(--text); }
header nav { display: flex; gap: 16px; margin-left: 18px; }

main { max-width: 900px; margin: 0 auto; padding: 32px 16px; }
main { position: relative; z-index: 2; flex: 1 0 auto; width: 100%; }

/* period toggle */
.period-group {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
}
.period-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-right: 4px;
}
.period-btn {
  padding: 6px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.875rem;
  transition: all .15s;
}
.period-btn:hover { border-color: var(--primary); color: var(--text); }
.period-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #000;
  font-weight: 600;
}

/* search */
.search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: 24px;
}
.search-input {
  width: 100%;
  padding: 9px 40px 9px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.9rem;
  font-family: var(--font);
  outline: none;
  transition: border-color .15s;
}
.search-input:focus { border-color: var(--primary); }
.search-input::placeholder { color: var(--text-muted); }
.search-clear {
  position: absolute;
  right: 10px;
  display: none;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.8rem;
  padding: 0;
}
.search-clear:hover { color: var(--text); }

.search-result {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 20px;
}
.search-result-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.search-rank {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
  min-width: 44px;
}
.search-cat-type {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--surface2);
  color: var(--text-muted);
}
.search-cat-name { font-weight: 700; font-size: 1rem; }
.search-viewers { color: var(--primary); font-size: 0.9rem; font-weight: 600; }
.search-meta { color: var(--text-muted); font-size: 0.8rem; margin-left: auto; }

/* chart section */
.chart-section { margin-bottom: 40px; }
.chart-section h2 { font-size: 1rem; font-weight: 600; margin-bottom: 0; color: var(--text-muted); }
.chart-section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.line-toggle-btns { display: flex; gap: 6px; }
.line-toggle-btns button { font-size: 0.75rem; padding: 4px 10px; border-radius: 6px; border: 1px solid var(--border); background: var(--surface); color: var(--text-muted); cursor: pointer; }
.line-toggle-btns button:hover { color: var(--text); border-color: var(--text-muted); }
.chart-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.chart-wrap--bar  { height: 520px; }
.chart-wrap--line { height: 360px; }

/* dashboard stats */
.dashboard-page {
  max-width: 1480px;
  padding: 20px 24px 16px;
}
.dashboard-search {
  width: 100%;
}
.dashboard-search input {
  width: 100%;
  padding: 9px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.85rem;
  outline: none;
}
.dashboard-search input:focus {
  border-color: var(--primary);
}
.category-search {
  width: min(100%, 230px);
  margin-bottom: 0;
  flex: 0 1 230px;
}
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.kpi-card,
.dashboard-card,
.selected-panel,
.category-panel {
  background: linear-gradient(180deg, rgba(26,26,26,0.96), rgba(13,13,13,0.96));
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.kpi-card {
  min-height: 108px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
}
.kpi-label,
.metric-strip span,
.change-grid span,
.efficiency-panel span {
  color: var(--text-muted);
  font-size: 0.74rem;
}
.kpi-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.kpi-label svg,
.card-header h3 svg,
.card-title-with-info > svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  color: var(--primary);
}
.kpi-label svg {
  width: 14px;
  height: 14px;
}
.kpi-card strong {
  display: block;
  font-size: 1.35rem;
  line-height: 1.15;
}
.kpi-card small {
  color: var(--text-muted);
  font-size: 0.72rem;
}
.kpi-card small span {
  font-weight: 600;
}
.positive { color: var(--primary) !important; }
.negative { color: var(--wrong) !important; }
.muted { color: var(--text-muted) !important; }
.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(360px, 1fr);
  gap: 14px;
  align-items: stretch;
}
.dashboard-main {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.detail-close,
.detail-backdrop {
  display: none;
}
.selected-panel {
  padding: 14px 18px 12px;
}
.selected-heading {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}
.selected-poster {
  width: 64px;
  aspect-ratio: 1;
  border-radius: var(--radius);
  background: var(--surface2);
  background-size: cover;
  background-position: center;
  flex: 0 0 auto;
}
.selected-poster.has-image {
  box-shadow: inset 0 -28px 40px rgba(0,0,0,0.25);
}
.selected-type {
  display: inline-block;
  color: var(--text-muted);
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 5px;
}
.selected-heading h3 {
  font-size: 1.7rem;
  line-height: 1.15;
}
.metric-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  border-top: 1px solid var(--border);
}
.metric-strip div {
  padding: 0 16px 0 12px;
  border-right: 1px solid var(--border);
  min-width: 0;
}
.metric-strip div:last-child {
  border-right: none;
  padding-right: 0;
}
.metric-strip strong {
  display: block;
  margin-top: 3px;
  font-size: 1rem;
  line-height: 1.15;
}
.dashboard-card {
  padding: 16px;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.card-header h3,
.dashboard-card h3,
.category-panel h3 {
  font-size: 0.95rem;
}
.card-header h3 {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.card-header p {
  color: var(--text-muted);
  font-size: 0.72rem;
  margin-top: 5px;
}
.card-header.compact {
  margin-bottom: 10px;
}
.card-header a {
  color: var(--primary);
  font-size: 0.78rem;
}
.chart-period {
  display: flex;
  gap: 6px;
  flex: 0 0 auto;
}
.chart-period button {
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.75rem;
}
.chart-period button.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #000;
  font-weight: 700;
}
.dashboard-chart-wrap {
  height: 320px;
  position: relative;
}
.dashboard-chart-wrap canvas {
  transition: opacity 0.16s ease;
}
.chart-card.is-chart-loading .dashboard-chart-wrap canvas {
  opacity: 0.42;
}
.chart-card.is-chart-loading .dashboard-chart-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  pointer-events: none;
  background: linear-gradient(110deg, transparent 0%, rgba(0,255,163,0.08) 40%, rgba(255,255,255,0.08) 50%, rgba(0,255,163,0.08) 60%, transparent 100%);
  background-size: 240% 100%;
  animation: dashboard-chart-shimmer 0.9s ease-in-out infinite;
}
.support-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 0.9fr;
  gap: 10px;
  align-items: stretch;
}
.support-grid > .dashboard-card {
  min-height: 172px;
  max-height: 190px;
  padding: 14px;
  overflow: hidden;
}
.support-grid > .change-card,
.support-grid > .efficiency-card {
  overflow: visible;
}
.card-title-with-info {
  display: flex;
  align-items: center;
  gap: 6px;
  line-height: 1.2;
}
.info-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  border: 1px solid var(--text-muted);
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 0.65rem;
  line-height: 1;
  cursor: help;
  flex: 0 0 auto;
}
.info-button:hover,
.info-button:focus,
.info-button:focus-visible {
  border-color: var(--primary);
  color: var(--primary);
  outline: none;
  z-index: 10;
}
.info-button::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 0;
  bottom: calc(100% + 8px);
  z-index: 5;
  min-width: 320px;
  max-width: min(420px, calc(100vw - 32px));
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: rgba(10,10,10,0.98);
  box-shadow: 0 10px 24px rgba(0,0,0,0.35);
  color: var(--text);
  white-space: pre-line;
  font-size: 0.68rem;
  font-weight: 400;
  line-height: 1.45;
  text-align: left;
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity 0.14s ease, transform 0.14s ease;
}
.info-button:hover::after,
.info-button:focus::after,
.info-button:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}
.change-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}
.change-grid strong,
.efficiency-panel strong {
  display: block;
  margin-top: 5px;
  font-size: 1.04rem;
  line-height: 1.1;
}
.efficiency-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}
.streamer-list {
  list-style: none;
  display: block;
  margin-top: 4px;
  overflow-y: auto;
  min-height: 0;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.streamer-card {
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.streamer-card .card-header {
  flex: 0 0 auto;
}
.streamer-card .streamer-list {
  flex: 1;
}
.streamer-list::-webkit-scrollbar {
  width: 8px;
}
.streamer-list::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 999px;
}
.streamer-list::-webkit-scrollbar-track {
  background: transparent;
}
.streamer-list li {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-bottom: 8px;
}
.streamer-list a {
  color: inherit;
}
.streamer-list a:hover {
  color: var(--text);
}
.streamer-list li::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  border: 1px solid var(--text-muted);
  background: transparent;
  margin-right: 8px;
  vertical-align: 1px;
}
.streamer-list li.is-current::before {
  border-color: var(--primary);
  background: var(--primary);
}
.category-panel {
  padding: 14px;
  position: sticky;
  top: 12px;
  max-height: calc(100vh - 24px);
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
.category-table {
  overflow: hidden;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
}
#categoryRows {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
#categoryRows::-webkit-scrollbar {
  width: 8px;
}
#categoryRows::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 999px;
}
#categoryRows::-webkit-scrollbar-track {
  background: transparent;
}
.category-row {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) 92px 72px 58px 8px;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 42px;
  padding: 8px 4px;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  text-align: left;
  font: inherit;
  font-size: 0.78rem;
}
button.category-row {
  cursor: pointer;
}
button.category-row:hover,
button.category-row.active {
  background: rgba(0,255,163,0.08);
}
.category-row-head {
  color: var(--text-muted);
  min-height: 36px;
  font-size: 0.68rem;
  flex: 0 0 auto;
}
.sort-button {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  padding: 0;
  font: inherit;
  text-align: right;
  cursor: pointer;
}
.sort-button:hover,
.sort-button.active {
  color: var(--text);
}
.sort-mark {
  color: var(--primary);
  font-size: 0.72rem;
  line-height: 1;
  width: 8px;
  text-align: center;
}
.sort-button.two-line-head {
  position: relative;
  padding-right: 12px;
}
.sort-button.two-line-head .sort-mark {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
}
.two-line-head {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  line-height: 1.15;
}
.two-line-head small {
  color: var(--text-muted);
  font-size: 0.58rem;
  font-weight: 400;
}
.category-name-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.category-name-cell img,
.category-fallback {
  width: 20px;
  aspect-ratio: 1;
  border-radius: 4px;
  background: var(--surface2);
  object-fit: cover;
  flex: 0 0 auto;
}
.category-name-cell span:last-child {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.category-row span:not(.category-name-cell) {
  text-align: right;
}
.viewer-cell {
  display: grid;
  grid-template-rows: auto auto;
  justify-items: end;
  row-gap: 2px;
  min-width: 0;
  line-height: 1;
}
.viewer-cell strong {
  display: block;
  font-size: 0.78rem;
  line-height: 1;
}
.viewer-cell small {
  display: block;
  color: var(--text-muted);
  font-size: 0.58rem;
  line-height: 1;
  white-space: nowrap;
}
.category-row::after {
  content: "";
}
.category-count {
  color: var(--text-muted);
  font-size: 0.72rem;
  padding-top: 12px;
}
.empty-state {
  color: var(--text-muted);
  font-size: 0.82rem;
  padding: 20px 4px;
}
.dashboard-page.is-loading .dashboard-search input {
  opacity: 0.65;
}
.dashboard-page.is-loading .kpi-card strong,
.dashboard-page.is-loading .kpi-card small,
.dashboard-page.is-loading .selected-heading h3,
.dashboard-page.is-loading .selected-type,
.dashboard-page.is-loading .metric-strip strong,
.dashboard-page.is-loading .change-grid strong,
.dashboard-page.is-loading .efficiency-panel strong,
.dashboard-page.is-loading .card-header p {
  color: transparent !important;
  border-radius: 6px;
  position: relative;
  overflow: hidden;
  background: #202020;
}
.dashboard-page.is-loading .kpi-card strong::after,
.dashboard-page.is-loading .kpi-card small::after,
.dashboard-page.is-loading .selected-heading h3::after,
.dashboard-page.is-loading .selected-type::after,
.dashboard-page.is-loading .metric-strip strong::after,
.dashboard-page.is-loading .change-grid strong::after,
.dashboard-page.is-loading .efficiency-panel strong::after,
.dashboard-page.is-loading .card-header p::after,
.dashboard-page.is-loading .selected-poster::after,
.skeleton-row span::after,
.skeleton-list-item span::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-120%);
  background: linear-gradient(90deg, transparent, rgba(0,255,163,0.16), rgba(255,255,255,0.13), transparent);
  animation: dashboard-shimmer 1.25s ease-in-out infinite;
}
.dashboard-page.is-loading .kpi-card strong {
  width: 58%;
  min-height: 26px;
}
.dashboard-page.is-loading .kpi-card small {
  width: 72%;
  min-height: 14px;
}
.dashboard-page.is-loading .selected-poster {
  position: relative;
  overflow: hidden;
  background: #202020;
}
.dashboard-page.is-loading .selected-heading h3 {
  width: 240px;
  max-width: 55vw;
}
.dashboard-page.is-loading .selected-type {
  width: 44px;
}
.dashboard-page.is-loading .metric-strip strong,
.dashboard-page.is-loading .change-grid strong,
.dashboard-page.is-loading .efficiency-panel strong {
  width: 70%;
  min-height: 20px;
}
.dashboard-page.is-loading .dashboard-chart-wrap canvas {
  opacity: 0;
}
.dashboard-page.is-loading .dashboard-chart-wrap::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, transparent 0 19%, rgba(255,255,255,0.06) 19% 20%, transparent 20% 39%, rgba(255,255,255,0.06) 39% 40%, transparent 40% 59%, rgba(255,255,255,0.06) 59% 60%, transparent 60% 79%, rgba(255,255,255,0.06) 79% 80%, transparent 80%),
    linear-gradient(110deg, rgba(0,255,163,0.06) 0%, rgba(0,255,163,0.18) 35%, rgba(255,255,255,0.12) 50%, rgba(0,255,163,0.18) 65%, rgba(0,255,163,0.06) 100%);
  background-size: 100% 100%, 240% 100%;
  animation: dashboard-chart-shimmer 1.45s ease-in-out infinite;
}
.skeleton-row span,
.skeleton-list-item span {
  display: block;
  height: 14px;
  border-radius: 999px;
  position: relative;
  overflow: hidden;
  background: #202020;
}
.skeleton-row span:nth-child(1) { width: 78%; }
.skeleton-row span:nth-child(2) { width: 62%; justify-self: end; }
.skeleton-row span:nth-child(3) { width: 58%; justify-self: end; }
.skeleton-row span:nth-child(4) { width: 44%; justify-self: end; }
.skeleton-list-item {
  list-style: none;
}
.skeleton-list-item::before {
  display: none !important;
}
.skeleton-list-item span {
  width: 64%;
}
@keyframes dashboard-shimmer {
  100% { transform: translateX(120%); }
}
@keyframes dashboard-chart-shimmer {
  0% { background-position: 0 0, 120% 0; }
  100% { background-position: 0 0, -120% 0; }
}

/* quiz */
.quiz-page {
  max-width: 1080px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.quiz-intro {
  min-height: min(620px, calc(100svh - 170px));
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(300px, 0.72fr);
  justify-content: center;
  align-items: center;
  gap: 34px;
  padding: 42px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(0,255,163,0.10), transparent 38%),
    linear-gradient(180deg, rgba(26,26,26,0.96), rgba(13,13,13,0.96));
}
.quiz-intro-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
}
.quiz-eyebrow {
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 700;
}
.quiz-intro h2 {
  max-width: 720px;
  font-size: clamp(2rem, 4vw, 3.3rem);
  line-height: 1.12;
  font-weight: 800;
  word-break: keep-all;
}
.quiz-intro p {
  max-width: 620px;
  color: var(--text-muted);
  line-height: 1.7;
}
.quiz-start-btn {
  margin-top: 8px;
}
.quiz-options {
  margin-top: 8px;
  color: var(--text-muted);
}
.quiz-options summary {
  cursor: pointer;
  font-size: 0.82rem;
}
.quiz-options .period-group {
  margin: 12px 0 0;
}
.quiz-preview {
  position: relative;
  min-height: 340px;
}
.quiz-preview::before {
  content: "";
  position: absolute;
  inset: 54px 12px 42px;
  border-radius: 999px;
  background: rgba(0,255,163,0.13);
  filter: blur(42px);
}
.quiz-preview-card {
  position: absolute;
  width: 210px;
  aspect-ratio: 3 / 4;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  padding: 18px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius);
  text-align: center;
  background:
    linear-gradient(to top, rgba(0,0,0,0.9), rgba(0,0,0,0.2)),
    radial-gradient(circle at 50% 24%, rgba(0,255,163,0.24), transparent 30%),
    linear-gradient(145deg, #27312d, #101010 72%);
  box-shadow: 0 24px 60px rgba(0,0,0,0.42);
}
.quiz-preview-card::before {
  content: "?";
  position: absolute;
  top: 34px;
  font-size: 6rem;
  font-weight: 800;
  color: rgba(255,255,255,0.08);
}
.quiz-preview-card-left {
  left: 0;
  top: 20px;
  transform: rotate(-7deg);
}
.quiz-preview-card-right {
  right: 0;
  bottom: 18px;
  transform: rotate(7deg);
  border-color: rgba(0,255,163,0.46);
}
.quiz-preview-card span,
.quiz-preview-card strong,
.quiz-preview-card small {
  position: relative;
  z-index: 1;
}
.quiz-preview-card span {
  margin-bottom: 8px;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(0,0,0,0.42);
  color: rgba(255,255,255,0.72);
  font-size: 0.58rem;
  font-weight: 800;
}
.quiz-preview-card strong {
  font-size: 1rem;
}
.quiz-preview-card small {
  margin-top: 8px;
  color: var(--primary);
  font-weight: 800;
}
.quiz-preview-vs {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border: 1px solid rgba(0,255,163,0.38);
  border-radius: 999px;
  background: rgba(0,0,0,0.72);
  color: var(--primary);
  font-weight: 900;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 28px rgba(0,255,163,0.18);
}
.quiz-game[hidden],
.quiz-intro[hidden] {
  display: none;
}
.quiz-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.quiz-score {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}
.quiz-score span { color: var(--primary); font-weight: 700; font-size: 1.1rem; }
.quiz-score-inline {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 0;
  color: var(--text-muted);
  font-size: 0.78rem;
  line-height: 1;
}
.quiz-score-inline > span + span::before {
  content: "·";
  margin: 0 8px;
  color: var(--text-muted);
}
.quiz-score-inline > span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.quiz-score-inline strong {
  color: var(--primary);
  font-size: 1rem;
  line-height: 1;
}

.quiz-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
@media (max-width: 600px) {
  .quiz-cards {
    grid-template-columns: 1fr;
    gap: 10px;
    margin-bottom: 10px;
  }
  .quiz-card {
    min-height: clamp(168px, 28svh, 220px);
    aspect-ratio: auto;
  }
}

.quiz-card {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  aspect-ratio: 3 / 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.quiz-card:not(.is-choice-disabled):hover {
  border-color: var(--primary);
  background-color: var(--surface2);
}
.quiz-card.is-choice-disabled {
  cursor: default;
}
.quiz-card .cat-type {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(0,0,0,0.45);
  color: rgba(255,255,255,0.7);
  margin-bottom: 10px;
}
.quiz-card .cat-name {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 4px;
  text-shadow: 0 2px 10px rgba(0,0,0,0.9), 0 0 4px rgba(0,0,0,0.8);
}
.quiz-card .cat-viewers {
  font-size: 0.95rem;
  color: var(--text-muted);
  visibility: hidden;
  margin-top: 12px;
  background: rgba(0,0,0,0.55);
  padding: 3px 12px;
  border-radius: 999px;
  backdrop-filter: blur(4px);
}
.quiz-card .cat-meta {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.95);
  visibility: hidden;
  margin-top: 6px;
  text-shadow: 0 1px 6px rgba(0,0,0,0.9);
  white-space: pre-line;
  line-height: 1.6;
  min-height: calc(0.82rem * 1.6 * 3);
}

.quiz-card.correct { border-color: var(--correct); background: rgba(0,255,163,.08); }
.quiz-card.wrong   { border-color: var(--wrong);   background: rgba(255,77,77,.08); }
.quiz-card.correct .cat-viewers,
.quiz-card.wrong .cat-viewers,
.quiz-card.is-revealed .cat-viewers { visibility: visible; }
.quiz-card.correct .cat-meta,
.quiz-card.wrong .cat-meta,
.quiz-card.is-revealed .cat-meta { visibility: visible; opacity: 1; }
.quiz-card.correct .cat-viewers { color: var(--correct); font-weight: 600; }
.quiz-card.wrong   .cat-viewers { color: var(--wrong); }

/* 이미지 로딩 shimmer */
.quiz-card.is-loading {
  position: relative;
  overflow: hidden;
  background: #202020;
}
.quiz-card.is-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  transform: translateX(-120%);
  background: linear-gradient(90deg, transparent, rgba(0,255,163,0.16), rgba(255,255,255,0.13), transparent);
  animation: dashboard-shimmer 1.25s ease-in-out infinite;
}
.quiz-card.is-loading > * {
  position: relative;
  z-index: 1;
}
.quiz-card.has-image {
  animation: fadeInBg 0.2s var(--ease-out-quart);
}
@keyframes fadeInBg {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes fadeInMarquee {
  from { opacity: 0; }
  to   { opacity: 0.55; }
}

/* 배경 이미지 */
.quiz-card.has-image {
  background-size: cover;
  background-position: center;
  position: relative;
  overflow: hidden;
}
.quiz-card.has-image::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.92) 0%, rgba(0,0,0,0.5) 45%, rgba(0,0,0,0.1) 100%);
  transition: background .15s;
}
.quiz-card.has-image.correct::before {
  background: linear-gradient(to top, rgba(0,255,163,0.55) 0%, rgba(0,255,163,0.2) 60%, rgba(0,0,0,0.2) 100%);
}
.quiz-card.has-image.wrong::before {
  background: linear-gradient(to top, rgba(255,77,77,0.55) 0%, rgba(255,77,77,0.2) 60%, rgba(0,0,0,0.2) 100%);
}
.quiz-card.has-image > * { position: relative; z-index: 1; }

/* 왼쪽 오픈 카드 — viewers 항상, meta는 hover시만 */
.quiz-card.is-open .cat-viewers { visibility: visible; color: var(--primary); font-weight: 700; }
.quiz-card.is-open .cat-meta {
  visibility: visible;
  opacity: 0;
  transition: opacity .2s;
}
.quiz-card.is-open:hover .cat-meta { opacity: 1; }
.quiz-card.is-open.correct .cat-meta,
.quiz-card.is-open.wrong .cat-meta {
  opacity: 1;
}
.quiz-card.is-open.correct .cat-viewers {
  color: var(--correct);
}
.quiz-card.is-open.wrong .cat-viewers {
  color: var(--wrong);
}

/* 계속하기 버튼 */
.quiz-next {
  display: none;
  margin-top: 16px;
  width: 100%;
  padding: 12px;
  background: var(--primary);
  color: #000;
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s;
}
.quiz-next:hover { background: var(--primary-hover); }
.quiz-next.visible { display: block; }
.quiz-next.is-correct {
  background: var(--correct);
  color: #000;
}
.quiz-next.is-wrong {
  background: var(--wrong);
  color: #fff;
}
.quiz-next.is-correct:hover {
  background: var(--primary-hover);
}
.quiz-next.is-wrong:hover {
  background: #ff3333;
}

/* 게임 오버 */
.quiz-gameover {
  display: none;
  padding: 0 0 48px;
}
.quiz-gameover.visible { display: block; }

.gameover-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
  align-items: center;
}
@media (max-width: 600px) { .gameover-layout { grid-template-columns: 1fr; } }

.gameover-info {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.gameover-info h2 { font-size: 1.6rem; font-weight: 800; }
.gameover-info .streak-count { font-size: 4rem; font-weight: 800; color: var(--primary); line-height: 1.1; }
.gameover-info p { color: var(--text-muted); margin: 0 0 8px; }
.gameover-gif { width: 220px; height: 220px; object-fit: contain; border-radius: var(--radius); }
.gameover-msg { font-size: 1rem; font-weight: 600; color: var(--text) !important; margin-bottom: 12px !important; }

.quiz-hint {
  color: var(--text);
  font-size: 1rem;
  font-weight: 700;
  margin: 0;
}

/* index landing */
.home-page {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 1480px;
  padding: 44px 24px 34px;
}
.home-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(440px, 0.92fr);
  gap: 18px;
  align-items: stretch;
}
.home-copy {
  position: relative;
  z-index: 1;
  min-height: 360px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  padding: 40px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(20,20,20,0.86), rgba(8,8,8,0.9));
}
.home-marquee-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s var(--ease-out-quart);
}
.home-marquee-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(0,0,0,0.52), rgba(0,0,0,0.62)),
    linear-gradient(180deg, rgba(0,0,0,0.24), rgba(0,0,0,0.82));
}
.home-marquee-bg.is-visible {
  opacity: 1;
}
.home-marquee-track {
  display: flex;
  gap: 10px;
  width: max-content;
  opacity: 0.68;
  filter: saturate(1);
  animation: home-marquee-left 82s linear infinite;
}
.home-marquee-reverse {
  animation-name: home-marquee-right;
}
.home-marquee-item {
  width: 136px;
  aspect-ratio: 3 / 4;
  flex: 0 0 auto;
  border-radius: 6px;
  background-position: center;
  background-size: cover;
}
@keyframes home-marquee-left {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
@keyframes home-marquee-right {
  0% { transform: translateX(-50%); }
  100% { transform: translateX(0); }
}
.home-eyebrow {
  position: relative;
  z-index: 1;
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 700;
  margin-bottom: 12px;
}
.home-copy h2 {
  position: relative;
  z-index: 1;
  max-width: none;
  font-size: clamp(2.05rem, 2.65vw, 2.25rem);
  line-height: 1.08;
  font-weight: 800;
  word-break: keep-all;
  white-space: nowrap;
}
.home-copy p {
  position: relative;
  z-index: 1;
  max-width: none;
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.65;
  margin-top: 16px;
  word-break: keep-all;
  white-space: nowrap;
}
.home-actions {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 10px;
  margin-top: 24px;
}
.home-live-card,
.home-panel {
  background: linear-gradient(180deg, rgba(26,26,26,0.96), rgba(13,13,13,0.96));
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.home-live-card {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 26px;
}
.home-live-card .home-card-header {
  margin-bottom: 18px;
}
.home-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.home-card-header h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.08rem;
}
.home-card-header h3 svg,
.home-quiz-panel span svg {
  width: 18px;
  height: 18px;
  color: var(--primary);
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: 0 0 auto;
}
.home-card-header span,
.home-card-header a {
  color: var(--text-muted);
  font-size: 0.72rem;
}
.home-card-header a:hover {
  color: var(--text);
}
.home-kpis {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.home-kpis div {
  position: relative;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  column-gap: 12px;
  min-height: 96px;
  padding: 15px 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: rgba(0,0,0,0.18);
}
.home-kpis div::before {
  content: none;
  position: absolute;
  left: 13px;
  top: 15px;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: rgba(0,255,163,0.13);
  box-shadow: inset 0 0 0 1px rgba(0,255,163,0.18);
}
.home-kpis div::after {
  content: none;
  position: absolute;
  left: 21px;
  top: 23px;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--primary);
  box-shadow: 0 0 12px rgba(0,255,163,0.45);
}
.home-kpi-icon {
  position: static;
  grid-row: 1 / span 3;
  align-self: center;
  width: 24px;
  height: 24px;
  padding: 6px;
  border-radius: 999px;
  color: var(--primary);
  background: rgba(0,255,163,0.13);
  box-shadow: inset 0 0 0 1px rgba(0,255,163,0.18), 0 0 16px rgba(0,255,163,0.08);
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.home-kpis div > span,
.home-kpis div > strong,
.home-kpis div > small {
  grid-column: 2;
}
.home-kpis span,
.home-rank-name small,
.home-quiz-panel span,
.home-quiz-panel p {
  color: var(--text-muted);
  font-size: 0.72rem;
}
.home-kpis strong {
  display: block;
  margin-top: 6px;
  font-size: 1.08rem;
  line-height: 1.12;
}
.home-kpis small {
  display: block;
  margin-top: 6px;
  color: var(--text-muted);
  font-size: 0.62rem;
  line-height: 1.35;
}
.home-kpis small span {
  font-weight: 700;
}
.home-panels {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(410px, 1fr) minmax(410px, 1fr) minmax(420px, 1.05fr);
  gap: 10px;
  margin-top: 12px;
}
.home-panel {
  min-height: 214px;
  padding: 20px;
}
.home-ticker-panel {
  display: grid;
  grid-template-rows: auto auto;
  align-content: center;
  gap: 16px;
}
.home-ticker-panel .home-card-header {
  margin-bottom: 0;
}
.home-ticker {
  min-height: 118px;
}
.home-ticker a {
  display: grid;
  grid-template-columns: 24px 64px minmax(0, 1fr) 96px;
  align-items: start;
  column-gap: 14px;
  row-gap: 6px;
  min-height: 118px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(0,0,0,0.2);
  opacity: 0;
  transform: translateY(7px);
  transition: opacity 0.24s ease, transform 0.24s ease;
}
.home-ticker.is-swapping a {
  opacity: 1;
  transform: translateY(0);
}
.home-rank {
  color: var(--text-muted);
  font-size: 1rem;
  font-weight: 700;
  grid-row: 1 / 3;
}
.home-ticker img,
.home-rank-fallback {
  width: 64px;
  aspect-ratio: 3 / 4;
  border-radius: 6px;
  background: var(--surface2);
  object-fit: cover;
}
.home-rank-name {
  min-width: 0;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.home-rank-name strong {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 0.86rem;
}
.home-rank-name small {
  display: block;
  margin-top: 3px;
}
.home-ticker-value {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  align-self: start;
  padding-top: 2px;
}
.home-ticker-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  width: 96px;
  align-self: center;
}
.home-sparkline {
  display: block;
  width: 96px;
  height: 28px;
  margin-top: 0;
}
.home-sparkline svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.home-sparkline polyline {
  fill: none;
  stroke: var(--primary);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 5px rgba(0,255,163,0.35));
}
.home-sparkline svg.negative polyline {
  stroke: var(--wrong);
  filter: drop-shadow(0 0 5px rgba(255,77,77,0.28));
}
.home-empty {
  color: var(--text-muted);
  font-size: 0.8rem;
  padding: 20px 0;
}
.home-quiz-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
}
.home-quiz-panel span {
  display: flex;
  align-items: center;
  gap: 7px;
}
.home-quiz-panel h3 {
  font-size: 1.24rem;
  line-height: 1.28;
}
.home-quiz-panel p {
  line-height: 1.55;
}
.home-quiz-panel .btn {
  align-self: flex-start;
  margin-top: 8px;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background .15s;
}
.btn svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: 0 0 auto;
}
.btn-primary { background: var(--primary); color: #000; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--primary); }

/* footer */
.site-footer {
  position: relative;
  z-index: 2;
  flex-shrink: 0;
  padding: 16px 24px;
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
}
.site-footer a { color: var(--text-muted); transition: color .15s; }
.site-footer a:hover { color: var(--text); }
.site-footer--fixed {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 10;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* ── 반응형 ─────────────────────────────────────────────── */
@media (max-width: 600px) {
  header { padding: 12px 16px; }
  header h1 { font-size: 1rem; }
  main { padding: 24px 12px; }
  .dashboard-page {
    min-height: calc(100svh - 153px);
    padding: 14px 10px 12px;
  }
  .kpi-grid {
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-bottom: 8px;
  }
  .kpi-card {
    min-height: 70px;
    padding: 9px 10px;
    gap: 4px;
  }
  .kpi-label { font-size: 0.62rem; }
  .kpi-card strong { font-size: 0.96rem; line-height: 1.08; }
  .kpi-card small { font-size: 0.56rem; line-height: 1.25; }
  .dashboard-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
  .category-panel { order: 1; }
  body.has-mobile-sheet {
    overflow: hidden;
  }
  .detail-backdrop {
    position: fixed;
    inset: 0;
    z-index: 30;
    display: block;
    border: 0;
    background: rgba(0,0,0,0.58);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease;
  }
  .dashboard-page.is-detail-open .detail-backdrop {
    opacity: 1;
    pointer-events: auto;
  }
  .dashboard-main {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    order: 2;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: min(88vh, 760px);
    padding: 18px 10px max(12px, env(safe-area-inset-bottom));
    overflow-y: auto;
    overscroll-behavior: contain;
    border: 1px solid var(--border);
    border-bottom: 0;
    border-radius: 14px 14px 0 0;
    background: #0a0a0a;
    box-shadow: 0 -18px 46px rgba(0,0,0,0.55);
    transform: translateY(105%);
    transition: transform 0.22s var(--ease-out-quart);
  }
  .dashboard-page.is-detail-open .dashboard-main {
    transform: translateY(0);
  }
  .detail-close {
    position: sticky;
    top: -6px;
    z-index: 5;
    align-self: flex-end;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    margin: -8px 0 -4px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface2);
    color: var(--text-muted);
    font: inherit;
    font-size: 1.15rem;
    line-height: 1;
  }
  .detail-close:active {
    color: var(--text);
    border-color: var(--text-muted);
  }
  .selected-panel,
  .dashboard-card,
  .category-panel {
    border-radius: 6px;
  }
  .selected-panel { padding: 12px; }
  .selected-heading {
    gap: 10px;
    margin-bottom: 10px;
  }
  .selected-poster { width: 48px; }
  .selected-heading h3 { font-size: 1.3rem; }
  .metric-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border-top: 1px solid var(--border);
  }
  .metric-strip div {
    border-right: none;
    padding: 10px 8px 0 0;
  }
  .metric-strip strong { font-size: 0.92rem; }
  .chart-card .card-header { align-items: flex-start; flex-direction: column; }
  .chart-period { width: 100%; }
  .chart-period button { flex: 1; }
  .category-panel .card-header { align-items: stretch; flex-direction: column; }
  .category-search {
    width: 100%;
    flex-basis: auto;
  }
  .category-panel {
    position: static;
    max-height: none;
    padding: 12px;
  }
  .category-table { min-height: 0; }
  #categoryRows {
    min-height: 340px;
    max-height: clamp(340px, 48vh, 460px);
  }
  .dashboard-chart-wrap { height: 260px; }
  .support-grid { grid-template-columns: 1fr; }
  .support-grid > .dashboard-card {
    max-height: none;
    min-height: 0;
  }
  .streamer-card {
    height: 220px;
  }
  .category-row {
    grid-template-columns: minmax(112px, 1fr) 76px 58px 42px;
    gap: 8px;
    min-height: 48px;
    padding: 7px 0;
    font-size: 0.72rem;
  }
  .viewer-cell strong {
    font-size: 0.72rem;
  }
  .viewer-cell small {
    font-size: 0.52rem;
  }
  .category-row::after { display: none; }
  .category-row-head {
    position: sticky;
    top: 0;
    z-index: 2;
    min-height: 34px;
    background: #111;
    font-size: 0.62rem;
  }
  .sort-button.two-line-head { padding-right: 0; }
  .sort-button.two-line-head .sort-mark {
    position: static;
    transform: none;
  }
  .category-name-cell img,
  .category-fallback { width: 20px; }
  .category-name-cell {
    gap: 7px;
  }
  .category-count {
    padding-top: 9px;
    font-size: 0.68rem;
  }
  .change-grid,
  .efficiency-panel {
    gap: 12px;
  }
  .info-button::after {
    left: 50%;
    transform: translate(-50%, 4px);
    min-width: min(320px, calc(100vw - 28px));
  }
  .info-button:hover::after,
  .info-button:focus::after,
  .info-button:focus-visible::after {
    transform: translate(-50%, 0);
  }

  .home-page {
    justify-content: flex-start;
    padding: 22px 12px 18px;
  }
  .home-hero,
  .home-panels {
    grid-template-columns: 1fr;
  }
  .home-marquee-bg {
    display: none;
  }
  .home-copy {
    min-height: 0;
    padding: 22px 18px;
  }
  .home-eyebrow {
    font-size: 0.68rem;
    margin-bottom: 9px;
  }
  .home-copy h2 {
    font-size: 1.8rem;
    white-space: normal;
  }
  .home-copy p {
    margin-top: 12px;
    font-size: 0.84rem;
    line-height: 1.55;
    white-space: normal;
  }
  .home-actions {
    flex-direction: column;
    margin-top: 16px;
  }
  .home-actions .btn {
    width: 100%;
    text-align: center;
  }
  .home-live-card,
  .home-panel {
    padding: 12px;
  }
  .home-kpis {
    gap: 8px;
  }
  .home-kpis div {
    grid-template-columns: 1fr;
    min-height: 86px;
    padding: 10px;
  }
  .home-kpis div::before,
  .home-kpis div::after {
    display: none;
  }
  .home-kpi-icon {
    display: none;
  }
  .home-kpis div > span,
  .home-kpis div > strong,
  .home-kpis div > small {
    grid-column: 1;
  }
  .home-kpis strong {
    font-size: 1rem;
  }
  .home-kpis small {
    font-size: 0.58rem;
  }
  .home-panels {
    gap: 10px;
    margin-top: 10px;
  }
  .home-panel {
    min-height: 118px;
  }
  .home-ticker a {
    grid-template-columns: 20px 42px minmax(0, 1fr) minmax(70px, auto);
    min-height: 72px;
    padding: 10px;
    gap: 8px;
  }
  .home-sparkline {
    display: none;
  }
  .home-ticker-side {
    width: auto;
  }
  .home-ticker img,
  .home-rank-fallback {
    width: 42px;
  }
  .home-quiz-panel .btn {
    align-self: stretch;
    text-align: center;
  }

  .search-meta { margin-left: 0; width: 100%; }

  .chart-wrap--bar  { height: 360px; }
  .chart-wrap--line { height: 260px; }

  .site-footer {
    padding: 10px 12px;
    gap: 5px;
    font-size: 0.64rem;
    line-height: 1.35;
  }

  .streak-count { font-size: 3rem; }
}

@media (max-width: 1180px) {
  .home-panels {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .quiz-page {
    justify-content: flex-start;
    padding-inline: 12px;
  }
  .quiz-intro {
    min-height: 0;
    display: block;
    padding: 24px 18px;
  }
  .quiz-preview {
    display: none;
  }
  .quiz-intro h2 {
    font-size: 1.8rem;
  }
  .quiz-topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 8px;
  }
  .quiz-cards {
    gap: 8px;
    margin-bottom: 8px;
  }
  .quiz-card {
    min-height: clamp(156px, 26svh, 205px);
    aspect-ratio: auto;
    padding: 12px;
    border-width: 1px;
  }
  .quiz-card .cat-type {
    font-size: 0.52rem;
    padding: 1px 6px;
    margin-bottom: 6px;
  }
  .quiz-card .cat-name {
    font-size: 1rem;
    margin-bottom: 2px;
  }
  .quiz-card .cat-viewers {
    font-size: 0.78rem;
    margin-top: 6px;
    padding: 2px 9px;
  }
  .quiz-card .cat-meta {
    font-size: 0.66rem;
    line-height: 1.35;
    margin-top: 4px;
    min-height: calc(0.66rem * 1.35 * 2);
  }
  .quiz-hint {
    font-size: 0.88rem;
  }
  .quiz-score-inline {
    font-size: 0.7rem;
  }
  .quiz-score-inline strong {
    font-size: 0.86rem;
  }
  .quiz-next {
    margin-top: 8px;
    padding: 10px;
    font-size: 0.9rem;
  }
  .gameover-gif { width: 160px; height: 160px; }
}
