:root {
  color-scheme: dark;
  --bg: #0b2a44;
  --bg-highlight: #0f5fa8;
  --card-bg: rgba(12, 24, 38, 0.92);
  --text: #f6fbff;
  --muted: #b9c9da;
  --accent: #4fc3ff;
  --accent-soft: rgba(79, 195, 255, 0.16);
  --border: #1d4b69;
  --shadow: 0 24px 40px rgba(2, 8, 16, 0.55);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Noto Sans JP", "Hiragino Sans", "Yu Gothic", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(79, 195, 255, 0.25), transparent 45%),
    linear-gradient(135deg, var(--bg) 0%, var(--bg-highlight) 100%);
  background-attachment: fixed;
  color: var(--text);
  line-height: 1.6;
}

img {
  max-width: 100%;
  display: block;
}

.container {
  width: min(1120px, 92%);
  margin: 0 auto;
}

.site-header {
  background: linear-gradient(140deg, rgba(4, 35, 66, 0.96), rgba(10, 102, 177, 0.92));
  padding: 48px 0 36px;
  border-bottom: 1px solid var(--border);
}

.site-label {
  margin: 0 0 12px;
  font-size: 0.95rem;
  color: var(--muted);
}

.site-header h1 {
  margin: 0 0 12px;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
}

.site-lead {
  margin: 0;
  color: var(--muted);
}

.section {
  margin: 28px 0;
  padding: 26px 0 30px;
  border-top: 1px solid rgba(79, 195, 255, 0.25);
}

.section:first-of-type {
  margin-top: 40px;
}

.section:last-of-type {
  margin-bottom: 64px;
  border-bottom: 1px solid rgba(79, 195, 255, 0.25);
}

.section-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}

.section-eyebrow {
  margin: 0 0 6px;
  font-size: 0.9rem;
  color: var(--muted);
}

.section-description {
  margin: 6px 0 0;
  color: var(--muted);
}

.section-meta {
  font-weight: 700;
  color: var(--accent);
}

.section-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-title-toggle {
  border: none;
  background: none;
  color: var(--text);
  padding: 0;
  font-size: inherit;
  font-weight: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: baseline;
  gap: 12px;
}

.section-title-toggle::before {
  content: "▾";
  color: var(--accent);
  font-size: 0.9em;
  transition: transform 0.2s ease;
}

.section-title-toggle[aria-expanded="false"]::before {
  transform: rotate(-90deg);
}

.section-title-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 6px;
}

.section-content[hidden] {
  display: none;
}

.mobile-filter-trigger-wrap {
  display: none;
}

.mobile-filter-trigger {
  width: 100%;
  border: 1px solid var(--border);
  background: rgba(9, 29, 47, 0.9);
  color: var(--text);
  border-radius: 12px;
  padding: 12px 14px;
  font-weight: 700;
}

.active-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
}

.active-filter-chip {
  border: 1px solid var(--border);
  background: rgba(8, 26, 42, 0.9);
  color: var(--text);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.8rem;
  cursor: pointer;
}

.filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin: 24px 0;
}

.filter {
  display: grid;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--muted);
}

.filter select,
.filter input {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.95rem;
  background: rgba(10, 30, 48, 0.9);
  color: var(--text);
}

.filter-modal {
  display: none;
}

.search-shortcuts {
  margin: -8px 0 16px;
}

.search-shortcuts[hidden] {
  display: none;
}

.search-shortcuts__title {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.85rem;
}

.search-shortcuts__list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.search-shortcut {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(8, 26, 42, 0.9);
  color: var(--text);
  padding: 4px 10px 4px 4px;
  cursor: pointer;
}

.search-shortcut__icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
  background: rgba(8, 23, 36, 0.9);
}

.search-shortcut__name {
  font-size: 0.85rem;
  line-height: 1;
}

.search-shortcuts__empty {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}

.card {
  background: var(--card-bg);
  border-radius: 18px;
  padding: 18px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  display: grid;
  gap: 16px;
  overflow: hidden;
  min-width: 0;
}

.card-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  min-width: 0;
}

.card-header > div:first-child {
  min-width: 0;
  overflow: hidden;
}

.card-header h3 {
  margin: 0 0 6px;
}

.racket-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.75rem;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
}

.badge-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.badge-group--racket {
  flex-wrap: wrap;
}

.badge--soft {
  background: rgba(135, 206, 250, 0.18);
  color: #8ad7ff;
}

.card-image {
  width: 86px;
  height: 86px;
  object-fit: cover;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(8, 23, 36, 0.9);
}

.card-image--racket {
  width: 88px;
  height: 88px;
  object-fit: contain;
  padding: 8px;
}

.effect {
  margin: 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(6, 20, 34, 0.85);
  color: var(--text);
  font-size: 0.9rem;
}

.stats {
  display: grid;
  gap: 10px;
}

.stat-row {
  display: grid;
  grid-template-columns: 100px 1fr;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
}

.stat-label {
  color: var(--muted);
}

.stat-value {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px;
}

.stat-bar {
  position: relative;
  height: 8px;
  border-radius: 999px;
  background: rgba(247, 251, 255, 0.12);
  overflow: hidden;
}

.stat-bar::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  background-image: linear-gradient(
    to right,
    transparent 0,
    transparent calc(20% - 1px),
    rgba(12, 16, 24, 0.85) calc(20% - 1px),
    rgba(12, 16, 24, 0.85) 20%,
    transparent 20%,
    transparent calc(40% - 1px),
    rgba(12, 16, 24, 0.85) calc(40% - 1px),
    rgba(12, 16, 24, 0.85) 40%,
    transparent 40%,
    transparent calc(60% - 1px),
    rgba(12, 16, 24, 0.85) calc(60% - 1px),
    rgba(12, 16, 24, 0.85) 60%,
    transparent 60%,
    transparent calc(80% - 1px),
    rgba(12, 16, 24, 0.85) calc(80% - 1px),
    rgba(12, 16, 24, 0.85) 80%,
    transparent 80%,
    transparent 100%
  );
}

.stat-fill {
  --stat-width: 0%;
  position: relative;
  z-index: 1;
  display: block;
  width: var(--stat-width);
  height: 100%;
  border-radius: inherit;
  background: #43d37f;
  animation: stat-bar-grow 700ms cubic-bezier(0.2, 0.9, 0.2, 1) forwards;
}

.stat-fill[data-stat-tier="1"] {
  background: #ff6b6b;
}

.stat-fill[data-stat-tier="2"] {
  background: #f59f4c;
}

.stat-fill[data-stat-tier="3"] {
  background: #f4d35e;
}

.stat-fill[data-stat-tier="4"] {
  background: #b5d95d;
}

.stat-fill[data-stat-tier="5"] {
  background: #43d37f;
}

@keyframes stat-bar-grow {
  from {
    width: 0;
  }

  to {
    width: var(--stat-width);
  }
}

.stat-number {
  font-weight: 700;
  color: var(--text);
  font-size: 0.8rem;
}

.accordion {
  border-top: 1px dashed var(--border);
  padding-top: 12px;
  display: grid;
  gap: 8px;
}

.accordion-toggle {
  border: none;
  background: none;
  text-align: left;
  font-weight: 700;
  color: var(--text);
  padding: 0;
  cursor: pointer;
}

.accordion-toggle::after {
  content: "▾";
  float: right;
  color: var(--muted);
}

.accordion-toggle[aria-expanded="true"]::after {
  transform: rotate(180deg);
}

.accordion-panel {
  font-size: 0.9rem;
  color: var(--muted);
}

.info-panel {
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(7, 22, 36, 0.72);
  color: var(--muted);
}

.info-panel p {
  margin: 0;
}

.mobile-bottom-nav {
  display: none;
}

.site-footer {
  background: rgba(7, 22, 36, 0.9);
  padding: 28px 0 40px;
  border-top: 1px solid var(--border);
  color: var(--muted);
}

@media (max-width: 768px) {
  html {
    scroll-behavior: smooth;
  }

  body {
    padding-bottom: 84px;
  }

  body.modal-open {
    overflow: hidden;
  }

  .filters {
    display: none;
  }

  .mobile-filter-trigger-wrap {
    display: block;
    margin: 12px 0;
  }

  .section-header-actions {
    width: 100%;
    justify-content: space-between;
  }

  .filter-modal {
    position: fixed;
    inset: 0;
    z-index: 30;
    background: rgba(2, 8, 14, 0.7);
    padding: 16px;
  }

  .filter-modal.is-open {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .filter-modal__panel {
    width: min(100%, 560px);
    max-height: min(88vh, 700px);
    background: rgba(9, 27, 43, 0.98);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 14px;
    display: grid;
    gap: 12px;
    overflow: auto;
  }

  .filter-modal__header {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
  }

  .filter-modal__header h3 {
    margin: 0;
    font-size: 1rem;
  }

  .filter-modal__close {
    border: 1px solid var(--border);
    background: rgba(6, 20, 33, 0.9);
    color: var(--text);
    width: 34px;
    height: 34px;
    border-radius: 50%;
  }

  .filters.filters--modal {
    display: grid;
    grid-template-columns: 1fr;
    margin: 0;
  }

  .search-shortcuts--modal {
    margin: 0;
  }

  .search-shortcuts--modal {
    min-width: 0;
    overflow-x: hidden;
  }

  .search-shortcuts--modal .search-shortcuts__list {
    flex-direction: column;
    flex-wrap: nowrap;
    width: 100%;
    min-width: 0;
    overflow-x: hidden;
  }

  .search-shortcuts--modal .search-shortcut {
    min-width: 0;
    width: 100%;
    max-width: 100%;
    flex-shrink: 0;
    box-sizing: border-box;
  }

  .search-shortcuts--modal .search-shortcut__name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .search-shortcuts--near-search {
    margin: 0;
  }

  .search-shortcuts--near-search .search-shortcuts__list {
    max-height: min(32vh, 220px);
    overflow-y: auto;
    padding-right: 2px;
  }

  /* モーダル内は候補を全件表示（リスト内スクロールなし） */
  .search-shortcuts--modal.search-shortcuts--near-search .search-shortcuts__list {
    max-height: none;
    overflow-y: visible;
    padding-right: 0;
  }

  .filter-modal__apply {
    border: 1px solid var(--accent);
    background: var(--accent-soft);
    color: var(--accent);
    padding: 12px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.95rem;
  }


  .card--compact {
    gap: 10px;
    padding: 12px;
    border-radius: 14px;
  }

  .card--compact .card-header {
    gap: 10px;
    align-items: flex-start;
  }

  .card--compact .card-header h3 {
    margin-bottom: 4px;
    font-size: 1rem;
    line-height: 1.35;
  }

  .card--compact .badge {
    padding: 3px 10px;
    font-size: 0.7rem;
    line-height: 1.2;
  }

  .card--compact .card-image,
  .card--compact .card-image--racket {
    width: 60px;
    height: 60px;
    border-radius: 12px;
  }

  .card--compact .card-image--racket {
    padding: 6px;
  }

  .card--compact .stats {
    gap: 6px;
  }

  .card--compact .stat-row {
    font-size: 0.78rem;
    gap: 6px;
  }

  .card--compact .effect {
    margin: 0;
    padding: 9px 10px;
    font-size: 0.8rem;
    line-height: 1.45;
  }

  .card--compact .accordion {
    padding-top: 8px;
    gap: 6px;
  }

  .card--compact .accordion-toggle {
    font-size: 0.85rem;
    line-height: 1.35;
  }

  .card--compact .accordion-panel {
    font-size: 0.8rem;
    line-height: 1.5;
  }

  .card--compact .card-details {
    display: grid;
    gap: 10px;
  }

  .card-grid {
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 12px;
  }

  .mobile-bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 20;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
    background: rgba(4, 17, 28, 0.94);
    border-top: 1px solid var(--border);
    backdrop-filter: blur(8px);
  }

  .mobile-bottom-nav__item {
    text-decoration: none;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 700;
    text-align: center;
    padding: 8px 4px;
    border-radius: 10px;
    transition: background-color 0.2s ease, color 0.2s ease;
  }

  .mobile-bottom-nav__item.is-active {
    background: var(--accent-soft);
    color: var(--accent);
  }
}

@media (max-width: 640px) {
  .card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }

  .card {
    padding: 14px;
    gap: 12px;
  }

  .card-header {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .card-header h3 {
    margin-bottom: 4px;
    font-size: 0.98rem;
  }

  .card-image {
    width: 72px;
    height: 72px;
    border-radius: 12px;
  }

  .card-image--racket {
    width: 74px;
    height: 74px;
    padding: 6px;
  }

  .badge {
    padding: 4px 10px;
    font-size: 0.68rem;
  }

  .stat-row {
    grid-template-columns: 1fr;
  }

  .stat-value {
    grid-template-columns: 1fr auto;
  }
}

@media (max-width: 360px) {
  .card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .card {
    padding: 12px;
  }
}
