* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans",
    "Helvetica Neue", Arial, sans-serif;
  color: #1f1f1f;
  background: #f6f7fb;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 32px;
  background: #ffffff;
  border-bottom: 1px solid #e1e4eb;
}

.header h1 {
  margin: 0 0 4px;
  font-size: 22px;
}

.layout {
  padding: 20px 32px 40px;
}

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

.chip {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid #d7dbe4;
  background: #f5f6fa;
  font-size: 12px;
  cursor: pointer;
}

.chip.active {
  background: #1f2937;
  color: #ffffff;
  border-color: #1f2937;
}

.content {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.calendar-header-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.calendar-header-row h2 {
  margin: 0;
  font-size: 26px;
  font-weight: 600;
  line-height: 1.2;
}

.header-filters {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 12px;
  color: #4b5565;
}

.header-filters label,
.header-filters .platform-filter {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.header-filters select {
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid #d7dbe4;
  font-size: 12px;
}

.calendar {
  background: #ffffff;
  border-radius: 12px;
  border: 1px solid #e1e4eb;
  padding: 16px;
}

.insights {
  margin-top: 20px;
  background: #ffffff;
  border-radius: 12px;
  border: 1px solid #e1e4eb;
  padding: 16px;
}

.insights-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 12px;
  gap: 16px;
}

.insights-header h3 {
  margin: 0;
  font-size: 16px;
}

.insights-count {
  font-size: 12px;
  color: #4b5565;
  padding-bottom: 6px;
}

.insights-controls {
  display: flex;
  align-items: flex-end;
  gap: 12px;
}

.insights-filters {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  margin-left: auto;
}

.insights-filters label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: #4b5565;
}

.insights-filters select {
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid #d7dbe4;
  font-size: 12px;
}

.insights-filters input {
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid #d7dbe4;
  font-size: 12px;
}

.label-with-info {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.info-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  margin-left: 6px;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
  cursor: help;
  background: #f8fafc;
  position: relative;
}

.info-icon::after {
  content: attr(data-tooltip);
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  transform: none;
  background: #0f172a;
  color: #f8fafc;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 11px;
  line-height: 1.3;
  width: 240px;
  text-align: left;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
  z-index: 10;
}

.info-icon::before {
  content: "";
  position: absolute;
  right: 8px;
  bottom: calc(100% + 2px);
  transform: none;
  border-width: 6px 6px 0 6px;
  border-style: solid;
  border-color: #0f172a transparent transparent transparent;
  opacity: 0;
  transition: opacity 0.15s ease;
  z-index: 10;
}

.info-icon:hover::after,
.info-icon:hover::before {
  opacity: 1;
}

.insights-table {
  display: grid;
  gap: 8px;
}

.treemap-section {
  margin-top: 24px;
}

.treemap-card {
  background: #ffffff;
  border-radius: 12px;
  border: 1px solid #e1e4eb;
  padding: 16px;
  display: grid;
  gap: 10px;
}

.treemap-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.treemap-header h3 {
  margin: 0;
  font-size: 16px;
}

.treemap-header p {
  margin: 0;
  font-size: 12px;
  color: #6b7280;
}

.treemap {
  position: relative;
  width: 100%;
  height: 180px;
  border-radius: 12px;
  border: 1px solid #e1e4eb;
  background: #0b0f1a;
  overflow: hidden;
}

.summary {
  margin-top: 20px;
  background: #ffffff;
  border-radius: 12px;
  border: 1px solid #e1e4eb;
  padding: 16px;
  display: grid;
  gap: 12px;
}

.summary-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.summary-header h3 {
  margin: 0;
  font-size: 16px;
}

.summary-header p {
  margin: 0;
  font-size: 12px;
  color: #6b7280;
}

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

.summary-card {
  border-radius: 12px;
  border: 1px solid #edf0f6;
  background: #f9fafc;
  padding: 12px;
  display: grid;
  gap: 6px;
}

.summary-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6b7280;
}

.summary-value {
  font-size: 22px;
  font-weight: 600;
  color: #111827;
}

.summary-note {
  font-size: 11px;
  color: #6b7280;
}

.summary-row {
  display: grid;
  gap: 8px;
}

.summary-mix {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.summary-mix-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #eef1f7;
  font-size: 11px;
  color: #4b5565;
}

.summary-mix-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  display: inline-block;
}

.treemap-tile {
  position: absolute;
  border: 1px solid rgba(0, 0, 0, 0.35);
  border-radius: 6px;
  color: #0f172a;
  font-size: 11px;
  font-weight: 600;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  line-height: 1.2;
  text-align: center;
}

.treemap-tile.large {
  font-size: 16.5px;
}

.insights-row {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr 1fr 0.8fr 0.8fr 0.8fr 2fr;
  gap: 12px;
  padding: 10px;
  border-radius: 10px;
  background: #f9fafc;
  border: 1px solid #edf0f6;
  font-size: 12px;
}

.insights-head {
  background: #f1f3f9;
  font-weight: 600;
  color: #4b5565;
}

.sort-button {
  border: none;
  background: transparent;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
  padding: 0;
}

.sort-button.active {
  color: #1f2937;
}

.sort-indicator {
  margin-left: 4px;
  font-size: 10px;
  color: #9aa3b2;
}

.sort-button.active .sort-indicator {
  color: #1f2937;
}

.insights-row div {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.insights-row .desc {
  white-space: normal;
  color: #4b5565;
  font-size: 11px;
  line-height: 1.35;
}

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

.selected-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  border-radius: 999px;
  background: #eef1f7;
  font-size: 11px;
  color: #4b5565;
}

.selected-chip button {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
  color: #7a8597;
}

.clear-button {
  border: 1px solid #d7dbe4;
  background: #ffffff;
  color: #4b5565;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 12px;
  cursor: pointer;
  height: fit-content;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.calendar-header {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 8px;
  font-size: 12px;
  color: #5f6775;
}

.calendar-header div {
  padding: 6px 8px;
  border-radius: 6px;
  background: #f1f3f9;
}

.calendar-header .weekend {
  background: #fdeeee;
}

.day-cell {
  border: 1px solid #e6e9f1;
  border-radius: 10px;
  min-height: 120px;
  padding: 8px;
  background: #fafbff;
}

.day-number {
  font-weight: 600;
  font-size: 12px;
  color: #5b6373;
  margin-bottom: 8px;
}

.game-card {
  background: #ffffff;
  border-radius: 8px;
  border: 1px solid #e5e7f1;
  padding: 6px;
  margin-bottom: 6px;
}

.game-card.highlighted {
  border: 2px solid #f59e0b;
  box-shadow: 0 4px 10px rgba(245, 158, 11, 0.2);
  background: #fff7e6;
}

.game-title-row {
  display: flex;
  align-items: center;
  gap: 4px;
}

.game-title {
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 6px;
}

.hot-badge {
  font-size: 12px;
  line-height: 1;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.tag {
  padding: 2px 6px;
  border-radius: 999px;
  font-size: 10px;
  background: #eef1f7;
  color: #4b5565;
}

.platform-pc {
  background: #001f3f;
  color: #ffffff;
}

.platform-console {
  background: #2e7d32;
  color: #ffffff;
}

.platform-mobile {
  background: #6a1b9a;
  color: #ffffff;
}
