/* Night Court — player trend page (ds-trend.css) */

body.ds[data-page="trend"] {
  overflow-x: clip;
}

body.ds[data-page="trend"] .trend-hero {
  padding-bottom: 4px;
}

body.ds[data-page="trend"] .trend-hero-grid {
  display: block;
}

body.ds[data-page="trend"] .trend-hero-name {
  font-family: var(--ds-font-body);
  font-weight: 900;
  font-size: clamp(3.25rem, 17vw, 9rem);
  line-height: 0.95;
  letter-spacing: -0.03em;
}

@supports (animation-timeline: scroll()) {
  body.ds[data-page="trend"] .trend-hero-name {
    animation: ds-hero-shrink linear both;
    animation-timeline: scroll();
    animation-range: 0 140px;
  }
}

body.ds[data-page="trend"] .trend-hero-search {
  position: relative;
  z-index: 2;
  margin-top: 20px;
  max-width: 520px;
}

body.ds[data-page="trend"] .trend-search-wrap {
  position: relative;
}

/* プルダウンであることを示すシェブロン */
body.ds[data-page="trend"] .trend-search-wrap::after {
  content: "";
  position: absolute;
  right: 8px;
  top: 50%;
  width: 8px;
  height: 8px;
  margin-top: -6px;
  border-right: 2px solid var(--ds-ink-3);
  border-bottom: 2px solid var(--ds-ink-3);
  transform: rotate(45deg);
  pointer-events: none;
  transition: transform var(--ds-t-fast) var(--ds-ease), border-color var(--ds-t-fast) var(--ds-ease);
}

body.ds[data-page="trend"] .trend-search-wrap:has(.trend-search-input[aria-expanded="true"])::after {
  margin-top: -2px;
  transform: rotate(225deg);
  border-color: var(--ds-volt);
}

body.ds[data-page="trend"] .trend-search-input {
  display: block;
  width: 100%;
  height: 56px;
  padding: 0 36px 0 4px;
  cursor: pointer;
  border: none;
  border-bottom: 1px solid var(--ds-line-strong);
  border-radius: 0;
  background: transparent;
  color: var(--ds-ink);
  font-family: var(--ds-font-body);
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  transition: border-color var(--ds-t-fast) var(--ds-ease), box-shadow var(--ds-t-fast) var(--ds-ease);
}

body.ds[data-page="trend"] .trend-search-input::placeholder {
  color: var(--ds-ink-3);
  font-weight: 500;
}

body.ds[data-page="trend"] .trend-search-input:focus {
  outline: none;
  border-bottom-color: var(--ds-volt);
  box-shadow: 0 2px 0 0 var(--ds-volt);
}

body.ds[data-page="trend"] .trend-suggestions {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 8px);
  z-index: 60;
  margin: 0;
  padding: 6px 0;
  list-style: none;
  max-height: 280px;
  overflow-y: auto;
  border-radius: 16px;
  border: 1px solid var(--ds-line-strong);
  background: color-mix(in srgb, var(--ds-surface-2) 88%, transparent);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.35);
}

body.ds[data-page="trend"] .trend-suggestions.is-open {
  display: block;
}

body.ds[data-page="trend"] .trend-suggestions li {
  position: relative;
  padding: 12px 18px 12px 22px;
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--ds-ink);
  cursor: pointer;
  transition: background-color var(--ds-t-fast) var(--ds-ease);
}

body.ds[data-page="trend"] .trend-suggestions li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 0 2px 2px 0;
  background: var(--ds-volt);
  opacity: 0;
  transform: scaleY(0.4);
  transition: opacity var(--ds-t-fast) var(--ds-ease), transform var(--ds-t-fast) var(--ds-ease);
}

body.ds[data-page="trend"] .trend-suggestions li:hover,
body.ds[data-page="trend"] .trend-suggestions li.is-active {
  outline: none;
  background: color-mix(in srgb, var(--ds-volt) 8%, transparent);
}

body.ds[data-page="trend"] .trend-suggestions li:hover::before,
body.ds[data-page="trend"] .trend-suggestions li.is-active::before,
body.ds[data-page="trend"] .trend-suggestions li.is-selected::before {
  opacity: 1;
  transform: scaleY(1);
}

body.ds[data-page="trend"] .trend-suggestions li.is-selected {
  color: var(--ds-volt);
}

body.ds[data-page="trend"] .trend-suggestions li.trend-suggestions-empty {
  cursor: default;
  font-weight: 500;
  color: var(--ds-ink-3);
}

body.ds[data-page="trend"] .trend-suggestions li.trend-suggestions-empty:hover {
  background: transparent;
}

body.ds[data-page="trend"] .trend-suggestions li.trend-suggestions-empty::before {
  display: none;
}

body.ds[data-page="trend"] #slots {
  display: flex;
  flex-direction: column;
  gap: 28px;
  margin-top: 28px;
  min-width: 0;
}

body.ds[data-page="trend"] .trend-slot {
  min-width: 0;
}

body.ds[data-page="trend"] .trend-toolbar {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 20px;
}

body.ds[data-page="trend"] .trend-metric-scroll {
  position: relative;
  min-width: 0;
}

body.ds[data-page="trend"] .trend-metric-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 0;
  border: none;
  min-width: 0;
}

@media (max-width: 767px) {
  body.ds[data-page="trend"] .trend-metric-scroll {
    margin-inline: -16px;
    padding-inline: 16px;
    width: auto;
    max-width: none;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
  }

  body.ds[data-page="trend"] .trend-metric-scroll::-webkit-scrollbar {
    display: none;
  }

  body.ds[data-page="trend"] .trend-metric-scroll::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 32px;
    pointer-events: none;
    background: linear-gradient(90deg, transparent, var(--ds-bg));
  }

  body.ds[data-page="trend"] .trend-metric-group {
    flex-wrap: nowrap;
    width: max-content;
    overflow: visible;
  }

  body.ds[data-page="trend"] .trend-metric-check {
    scroll-snap-align: start;
    flex-shrink: 0;
  }
}

body.ds[data-page="trend"] .trend-metric-check {
  --trend-metric-color: var(--ds-volt);
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

body.ds[data-page="trend"] .trend-metric-check span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 14px 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(236, 239, 230, 0.18);
  background: transparent;
  color: var(--ds-ink-2);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.2;
  transition:
    border-color var(--ds-t-fast) var(--ds-ease),
    background-color var(--ds-t-fast) var(--ds-ease),
    color var(--ds-t-fast) var(--ds-ease),
    box-shadow var(--ds-t-fast) var(--ds-ease);
}

body.ds[data-page="trend"] .trend-metric-check span::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--trend-metric-color);
  opacity: 0;
  box-shadow: 0 0 8px color-mix(in srgb, var(--trend-metric-color) 55%, transparent);
  transition: opacity var(--ds-t-fast) var(--ds-ease);
}

body.ds[data-page="trend"] .trend-metric-check:has(input:checked) span {
  border-color: var(--trend-metric-color);
  background: color-mix(in srgb, var(--trend-metric-color) 12%, transparent);
  color: var(--ds-ink);
}

body.ds[data-page="trend"] .trend-metric-check:has(input:checked) span::before {
  opacity: 1;
}

body.ds[data-page="trend"] .trend-metric-check:not(:has(input:checked)):hover span {
  border-color: var(--ds-ink-3);
}

body.ds[data-page="trend"] .trend-metric-check:has(input:focus-visible) span {
  outline: 2px solid var(--ds-ink-3);
  outline-offset: 2px;
}

body.ds[data-page="trend"] .trend-date-group {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin: 0;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--ds-line-strong);
  background: var(--ds-surface);
  width: fit-content;
  max-width: 100%;
}

body.ds[data-page="trend"] .trend-date-group-label {
  font-family: var(--ds-font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ds-ink-3);
}

body.ds[data-page="trend"] .trend-date-input {
  appearance: none;
  min-height: 36px;
  padding: 4px 8px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--ds-ink);
  color-scheme: dark;
  font-family: var(--ds-font-mono);
  font-size: 13px;
  font-weight: 500;
  transition: box-shadow var(--ds-t-fast) var(--ds-ease);
}

body.ds[data-page="trend"] .trend-date-input::-webkit-calendar-picker-indicator {
  filter: invert(0.85);
  opacity: 0.62;
  cursor: pointer;
}

body.ds[data-page="trend"] .trend-date-input:focus {
  outline: none;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--ds-volt) 45%, transparent);
}

body.ds[data-page="trend"] .trend-chart-area {
  position: relative;
  min-height: 300px;
}

body.ds[data-page="trend"] .trend-chart-metric-label {
  position: absolute;
  top: 4px;
  left: 0;
  z-index: 2;
  margin: 0;
  font-family: var(--ds-font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  pointer-events: none;
}

body.ds[data-page="trend"] .trend-chart-metric-label[hidden] {
  display: none !important;
}

@media (min-width: 768px) {
  body.ds[data-page="trend"] .trend-chart-area {
    min-height: 440px;
  }
}

body.ds[data-page="trend"] .trend-chart-area canvas {
  display: block;
  width: 100% !important;
  height: 300px !important;
}

@media (min-width: 768px) {
  body.ds[data-page="trend"] .trend-chart-area canvas {
    height: 440px !important;
  }
}

body.ds[data-page="trend"] .trend-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 300px;
  text-align: center;
  padding: 24px 16px;
}

@media (min-width: 768px) {
  body.ds[data-page="trend"] .trend-state {
    min-height: 440px;
  }
}

body.ds[data-page="trend"] .trend-state-title {
  margin: 0;
  font-family: var(--ds-font-display);
  font-weight: 900;
  font-size: clamp(2.5rem, 12vw, 4.5rem);
  line-height: 0.95;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  -webkit-text-stroke: 1px var(--ds-ink-3);
  color: transparent;
}

body.ds[data-page="trend"] .trend-state-desc {
  margin: 0;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.5;
  color: var(--ds-ink-3);
  max-width: 22em;
}

body.ds[data-page="trend"] .trend-placeholder[hidden],
body.ds[data-page="trend"] .trend-empty-msg[hidden],
body.ds[data-page="trend"] .trend-range-empty-msg[hidden],
body.ds[data-page="trend"] .trend-chart-area canvas[hidden],
body.ds[data-page="trend"] .trend-table-wrap[hidden] {
  display: none !important;
}

body.ds[data-page="trend"] .trend-table-wrap {
  margin-top: 24px;
}

body.ds[data-page="trend"] .trend-table tbody td:not(:first-child),
body.ds[data-page="trend"] .trend-table thead th:not(:first-child) {
  font-family: var(--ds-font-mono);
  font-size: 13px;
}

@media (max-width: 767px) {
  body.ds[data-page="trend"] .trend-table thead th:first-child,
  body.ds[data-page="trend"] .trend-table tbody td:first-child {
    position: sticky;
    left: 0;
    z-index: 2;
    min-width: 4.5rem;
    background: var(--ds-surface);
    box-shadow: 4px 0 12px rgba(0, 0, 0, 0.22);
    text-align: left;
    font-family: var(--ds-font-mono);
    font-size: 12px;
    font-weight: 500;
    color: var(--ds-ink-2);
  }

  body.ds[data-page="trend"] .trend-table thead th:first-child {
    z-index: 5;
  }
}

@media (prefers-reduced-transparency: reduce) {
  body.ds[data-page="trend"] .trend-suggestions {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: var(--ds-surface-2);
  }
}
