:root {
  --bg: #0f1115;
  --panel: #161a22;
  --panel-2: #1b2029;
  --line: #262c38;
  --text: #e7eaf0;
  --muted: #8b93a7;
  --accent: #4ade80;

  --lv0: #1b2029;
  --lv1: #14532d;
  --lv2: #16a34a;
  --lv3: #4ade80;

  --cell: 12px;
  --gap: 3px;
  --pitch: 15px; /* cell + gap */
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Pretendard", -apple-system, BlinkMacSystemFont, "Segoe UI",
               "Malgun Gothic", "Apple SD Gothic Neo", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body { padding: 0 20px 80px; }

.wrap {
  max-width: 1000px;
  margin: 0 auto;
}

/* ---------- 배너 ---------- */
.banner {
  margin-top: 20px;
  padding: 12px 16px;
  border: 1px solid #3f3a1a;
  background: #221f10;
  color: #e8d98a;
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.5;
}
.banner strong { color: #fbe38a; }

/* ---------- 헤더 ---------- */
.head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 40px 0 28px;
}

h1 {
  margin: 0;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.sub {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
}

/* ---------- 통계 ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 28px;
}

.stat {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px 16px;
}

.stat .label {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
}

.stat .value {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
}

.stat .value .unit {
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  margin-left: 3px;
}

.stat.hot .value { color: var(--accent); }

/* ---------- 패널 / 히트맵 ---------- */
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 28px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
}

.panel-head h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}

.legend {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--muted);
}
.legend i {
  width: 11px;
  height: 11px;
  border-radius: 3px;
  display: block;
}
.legend .lv0 { background: var(--lv0); box-shadow: inset 0 0 0 1px var(--line); }
.legend .lv1 { background: var(--lv1); }
.legend .lv2 { background: var(--lv2); }
.legend .lv3 { background: var(--lv3); }

.hm-scroll {
  overflow-x: auto;
  padding-bottom: 4px;
}

.hm {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  gap: 6px;
  width: max-content;
}

.hm-corner { grid-column: 1; grid-row: 1; }

.hm-months {
  grid-column: 2;
  grid-row: 1;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: var(--pitch);
  font-size: 11px;
  color: var(--muted);
  height: 14px;
}

.hm-dow {
  grid-column: 1;
  grid-row: 2;
  display: grid;
  grid-template-rows: repeat(7, var(--cell));
  gap: var(--gap);
  font-size: 10px;
  color: var(--muted);
  padding-right: 4px;
}
.hm-dow span {
  line-height: var(--cell);
  text-align: right;
}

.hm-grid {
  grid-column: 2;
  grid-row: 2;
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(7, var(--cell));
  grid-auto-columns: var(--cell);
  gap: var(--gap);
}

.cell {
  width: var(--cell);
  height: var(--cell);
  border-radius: 3px;
  background: var(--lv0);
  padding: 0;
  border: 0;
  cursor: default;
}
.cell.lv1 { background: var(--lv1); }
.cell.lv2 { background: var(--lv2); }
.cell.lv3 { background: var(--lv3); }
.cell.has { cursor: pointer; }
.cell.has:hover { outline: 1px solid rgba(255,255,255,.55); outline-offset: 1px; }
.cell.future { background: transparent; }
.cell.today { box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.6); }

.tooltip {
  position: fixed;
  z-index: 50;
  background: #0a0c10;
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 12px;
  padding: 6px 9px;
  border-radius: 7px;
  pointer-events: none;
  white-space: nowrap;
  transform: translate(-50%, -100%);
}

/* ---------- 필터 ---------- */
.filters {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 18px;
}

.filter-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.filter-label {
  font-size: 12px;
  color: var(--muted);
  min-width: 30px;
}

select {
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 13px;
  font-family: inherit;
}

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

.chip {
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--muted);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
}
.chip:hover { color: var(--text); }
.chip.on {
  background: rgba(74, 222, 128, .13);
  border-color: rgba(74, 222, 128, .5);
  color: var(--accent);
}

.count {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 16px;
}

/* ---------- 목록 ---------- */
.month-block { margin-bottom: 36px; }

.month-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  margin: 0 0 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.month-title em {
  font-style: normal;
  color: var(--accent);
  font-weight: 600;
}

.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.card.flash {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(74, 222, 128, .18);
}

.thumb {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  padding: 0;
  cursor: pointer;
  overflow: hidden;
  background: linear-gradient(135deg, var(--c1), var(--c2));
}

.thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.thumb .ph {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  color: rgba(255, 255, 255, .82);
  letter-spacing: .05em;
}

.thumb .play {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(10, 12, 16, .72);
  border: 1px solid rgba(255, 255, 255, .25);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  padding-left: 3px;
  transition: transform .12s ease, background .12s ease;
}
.thumb:hover .play {
  transform: translate(-50%, -50%) scale(1.08);
  background: rgba(74, 222, 128, .88);
  color: #08110b;
}

.player {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border: 0;
  display: block;
}

.sample-player {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--panel-2);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
  padding: 12px;
}
.sample-player b { color: var(--text); font-size: 14px; }

.meta { padding: 14px 15px 16px; }

.meta .date {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 5px;
}

.meta h3 {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.meta .memo {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
  color: #b9c0cf;
  white-space: pre-wrap;
}

.meta .tags {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.meta .tags span {
  font-size: 11px;
  color: var(--muted);
  background: var(--panel-2);
  border-radius: 999px;
  padding: 3px 9px;
}

.empty {
  text-align: center;
  color: var(--muted);
  padding: 60px 20px;
  font-size: 14px;
  border: 1px dashed var(--line);
  border-radius: 12px;
}

.foot {
  margin-top: 50px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

/* ---------- 반응형 ---------- */
@media (max-width: 820px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .cards { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 560px) {
  body { padding: 0 14px 60px; }
  .head { padding: 28px 0 20px; }
  h1 { font-size: 24px; }
  .cards { grid-template-columns: 1fr; }
  .stat { padding: 14px 13px; }
  .stat .value { font-size: 24px; }
  .panel { padding: 16px 14px; }
}
