/* ========================================
   遊戯王カード価格比較 - Main Stylesheet
   ======================================== */

/* ── Price Table: Shop Name Link ── */
.shop-name-link {
  display: block;
  font-weight: 600;
  color: var(--color-primary);
  text-decoration: none;
  font-size: var(--font-size-sm);
  line-height: 1.3;
}
.shop-name-link:hover {
  text-decoration: underline;
  color: var(--color-primary-dark);
}
.shop-url-text {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 2px;
  word-break: break-all;
  line-height: 1.2;
}

/* ── Shops Grid ── */
.shops-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-md);
  margin-top: var(--space-xl);
}
.shop-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: var(--space-md);
  text-decoration: none;
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
  text-align: center;
  transition: all var(--transition);
}
.shop-card:hover {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.shop-card-icon { font-size: 2rem; }
.shop-card-name { font-weight: 700; font-size: var(--font-size-sm); }
.shop-card-url  { font-size: var(--font-size-xs); color: var(--text-muted); word-break: break-all; }
.shop-card-arrow { color: var(--color-primary); font-size: var(--font-size-sm); margin-top: auto; }

/* ── CSS Variables (Light Theme) ── */
:root {
  /* Brand Colors */
  --color-primary: #7c3aed;
  --color-primary-light: #a78bfa;
  --color-primary-dark: #5b21b6;
  --color-secondary: #2563eb;
  --color-secondary-light: #60a5fa;
  --color-accent: #f59e0b;

  /* Gradient */
  --gradient-brand: linear-gradient(135deg, #7c3aed 0%, #2563eb 100%);
  --gradient-hero: linear-gradient(135deg, #4c1d95 0%, #1e3a8a 60%, #0f172a 100%);
  --gradient-sar: linear-gradient(135deg, #f59e0b, #ef4444, #8b5cf6, #3b82f6, #10b981);

  /* Background */
  --bg-body: #f8fafc;
  --bg-surface: #ffffff;
  --bg-surface-2: #f1f5f9;
  --bg-surface-3: #e2e8f0;
  --bg-overlay: rgba(0, 0, 0, 0.5);

  /* Text */
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --text-inverse: #ffffff;
  --text-link: #7c3aed;

  /* Border */
  --border-color: #e2e8f0;
  --border-color-2: #cbd5e1;
  --border-radius-sm: 6px;
  --border-radius: 12px;
  --border-radius-lg: 16px;
  --border-radius-xl: 24px;
  --border-radius-full: 9999px;

  /* Shadow */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
  --shadow-md: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
  --shadow-lg: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);
  --shadow-xl: 0 25px 50px -12px rgba(0,0,0,0.25);

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;

  /* Typography */
  --font-family: 'Noto Sans JP', 'Hiragino Kaku Gothic ProN', 'Yu Gothic', sans-serif;
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  --font-size-2xl: 1.5rem;
  --font-size-3xl: 1.875rem;
  --font-size-4xl: 2.25rem;

  /* Header */
  --header-height: 64px;

  /* Rarity Colors */
  --rarity-common-bg: #64748b;
  --rarity-common-text: #ffffff;
  --rarity-uncommon-bg: #16a34a;
  --rarity-uncommon-text: #ffffff;
  --rarity-rare-bg: #2563eb;
  --rarity-rare-text: #ffffff;
  --rarity-ex-bg: #d97706;
  --rarity-ex-text: #ffffff;
  --rarity-sr-bg: #7c3aed;
  --rarity-sr-text: #ffffff;

  /* Transitions */
  --transition: 0.2s ease;
  --transition-slow: 0.3s ease;
}

/* ── Dark Theme ── */
[data-theme="dark"] {
  --bg-body: #0f172a;
  --bg-surface: #1e293b;
  --bg-surface-2: #263348;
  --bg-surface-3: #334155;
  --bg-overlay: rgba(0, 0, 0, 0.7);

  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-link: #a78bfa;

  --border-color: #334155;
  --border-color-2: #475569;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow: 0 4px 6px -1px rgba(0,0,0,0.4);
  --shadow-md: 0 10px 15px -3px rgba(0,0,0,0.4);
  --shadow-lg: 0 20px 25px -5px rgba(0,0,0,0.5);
}

/* ── Reset & Base ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  color: var(--text-primary);
  background-color: var(--bg-body);
  line-height: 1.6;
  transition: background-color var(--transition-slow), color var(--transition-slow);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main.main-content {
  flex: 1;
  padding-top: var(--header-height);
}

a {
  color: var(--text-link);
  text-decoration: none;
  transition: opacity var(--transition);
}

a:hover { opacity: 0.8; }

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

ul, ol { list-style: none; }

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
  font-size: inherit;
}

/* ── Layout Utilities ── */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--space-md);
}

@media (min-width: 640px) {
  .container { padding: 0 var(--space-lg); }
}

@media (min-width: 1024px) {
  .container { padding: 0 var(--space-xl); }
}

.text-center { text-align: center; }

/* ── Header ── */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  z-index: 1000;
  box-shadow: var(--shadow-sm);
  transition: background-color var(--transition-slow), border-color var(--transition-slow);
}

.header-inner {
  display: flex;
  align-items: center;
  height: var(--header-height);
  gap: var(--space-md);
}

.site-logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: var(--font-size-xl);
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  text-decoration: none;
}

.logo-icon { font-size: 1.5rem; }

.logo-text {
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.site-nav {
  display: none;
  gap: var(--space-xs);
}

@media (min-width: 768px) {
  .site-nav { display: flex; }
}

.nav-link {
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--border-radius-full);
  color: var(--text-secondary);
  font-weight: 500;
  font-size: var(--font-size-sm);
  transition: all var(--transition);
  text-decoration: none;
}

.nav-link:hover,
.nav-link.active {
  background: rgba(124, 58, 237, 0.1);
  color: var(--color-primary);
  opacity: 1;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-left: auto;
}

/* Header Search */
.search-wrapper {
  position: relative;
  display: none;
}

@media (min-width: 768px) {
  .search-wrapper { display: block; }
}

.header-search-input {
  width: 220px;
  padding: 6px 12px 6px 36px;
  border: 1.5px solid var(--border-color);
  border-radius: var(--border-radius-full);
  font-size: var(--font-size-sm);
  background: var(--bg-surface-2);
  color: var(--text-primary);
  transition: all var(--transition);
  outline: none;
}

.header-search-input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15);
  width: 280px;
}

.search-results-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 320px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-lg);
  max-height: 400px;
  overflow-y: auto;
  z-index: 200;
  display: none;
}

.search-results-dropdown.active { display: block; }

.search-result-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 10px var(--space-md);
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
  transition: background var(--transition);
  text-decoration: none;
  color: var(--text-primary);
}

.search-result-item:last-child { border-bottom: none; }

.search-result-item:hover {
  background: var(--bg-surface-2);
  opacity: 1;
}

.search-result-name {
  font-weight: 500;
  font-size: var(--font-size-sm);
}

.search-result-set {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}

.search-result-price {
  margin-left: auto;
  font-weight: 700;
  font-size: var(--font-size-sm);
  color: var(--color-primary);
  white-space: nowrap;
}

.search-no-results {
  padding: var(--space-md);
  text-align: center;
  color: var(--text-muted);
  font-size: var(--font-size-sm);
}

/* Theme Toggle */
.theme-toggle {
  width: 40px;
  height: 40px;
  border-radius: var(--border-radius-full);
  background: var(--bg-surface-2);
  border: 1.5px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
  font-size: 18px;
}

.theme-toggle:hover {
  background: var(--bg-surface-3);
  transform: scale(1.05);
}

.theme-icon-dark { display: none; }

[data-theme="dark"] .theme-icon-light { display: none; }
[data-theme="dark"] .theme-icon-dark { display: block; }

/* Mobile Menu Toggle */
.mobile-menu-toggle {
  width: 40px;
  height: 40px;
  border-radius: var(--border-radius);
  background: var(--bg-surface-2);
  border: 1.5px solid var(--border-color);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
}

@media (min-width: 768px) {
  .mobile-menu-toggle { display: none; }
}

.hamburger-line {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all var(--transition);
}

/* Mobile Nav Overlay */
.mobile-nav-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-overlay);
  z-index: 999;
  display: none;
  align-items: flex-start;
  justify-content: flex-end;
}

.mobile-nav-overlay.active { display: flex; }

.mobile-nav {
  background: var(--bg-surface);
  width: 240px;
  height: 100%;
  padding: calc(var(--header-height) + var(--space-lg)) var(--space-lg) var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.mobile-nav-link {
  display: block;
  padding: var(--space-md);
  border-radius: var(--border-radius);
  color: var(--text-primary);
  font-weight: 500;
  text-decoration: none;
  transition: background var(--transition);
}

.mobile-nav-link:hover {
  background: var(--bg-surface-2);
  opacity: 1;
}

/* ── Hero Section ── */
.hero {
  position: relative;
  padding: var(--space-3xl) 0;
  overflow: hidden;
  background: var(--gradient-hero);
  color: white;
  min-height: 520px;
  display: flex;
  align-items: center;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 50%, rgba(124,58,237,0.3) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(37,99,235,0.3) 0%, transparent 50%);
  pointer-events: none;
}

.hero-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Ccircle cx='30' cy='30' r='4'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
}

.hero-title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: var(--space-md);
  text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.hero-highlight {
  background: linear-gradient(90deg, #fbbf24, #f59e0b);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: rgba(255,255,255,0.85);
  margin-bottom: var(--space-2xl);
  line-height: 1.7;
}

/* Hero Search */
.hero-search {
  position: relative;
  max-width: 640px;
  margin: 0 auto var(--space-2xl);
}

.hero-search-inner {
  display: flex;
  align-items: center;
  background: rgba(255,255,255,0.95);
  border-radius: var(--border-radius-full);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  padding: 6px 6px 6px 20px;
  gap: var(--space-sm);
}

.hero-search-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
}

.hero-search-input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: var(--font-size-base);
  color: #0f172a;
  outline: none;
  padding: 8px 0;
}

.hero-search-input::placeholder { color: #94a3b8; }

.hero-search-btn {
  background: var(--gradient-brand);
  color: white;
  border: none;
  border-radius: var(--border-radius-full);
  padding: 10px 24px;
  font-size: var(--font-size-sm);
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: transform var(--transition), box-shadow var(--transition);
}

.hero-search-btn:hover {
  transform: scale(1.02);
  box-shadow: var(--shadow-md);
}

.hero-search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-xl);
  max-height: 400px;
  overflow-y: auto;
  z-index: 100;
  text-align: left;
  display: none;
}

.hero-search-results.active { display: block; }

/* Hero Stats */
.hero-stats {
  display: flex;
  justify-content: center;
  gap: var(--space-2xl);
  flex-wrap: wrap;
}

.hero-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.hero-stat-num {
  font-size: var(--font-size-3xl);
  font-weight: 700;
  color: #fbbf24;
}

.hero-stat-label {
  font-size: var(--font-size-sm);
  color: rgba(255,255,255,0.7);
}

/* ── Rarity Filter Section ── */
.rarity-filter-section {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  padding: var(--space-md) 0;
  position: sticky;
  top: var(--header-height);
  z-index: 100;
}

.rarity-filter-bar {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.filter-label {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  white-space: nowrap;
}

.rarity-btn {
  background: none;
  border: 1.5px solid transparent;
  border-radius: var(--border-radius-full);
  padding: 4px 12px;
  cursor: pointer;
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  transition: all var(--transition);
}

.rarity-btn:hover {
  border-color: var(--border-color-2);
  background: var(--bg-surface-2);
}

.rarity-btn.active {
  border-color: var(--color-primary);
  background: rgba(124,58,237,0.1);
  color: var(--color-primary);
  font-weight: 600;
}

/* ── Section Common ── */
.cards-section,
.list-section {
  padding: var(--space-3xl) 0;
}

.how-it-works {
  padding: var(--space-3xl) 0;
  background: var(--bg-surface-2);
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-xl);
  gap: var(--space-md);
}

.section-title {
  font-size: var(--font-size-2xl);
  font-weight: 700;
  color: var(--text-primary);
}

.section-title.text-center {
  text-align: center;
  width: 100%;
  margin-bottom: var(--space-xl);
}

.view-all-link {
  font-size: var(--font-size-sm);
  color: var(--color-primary);
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
}

/* ── Cards Grid ── */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: var(--space-md);
}

@media (min-width: 640px) {
  .cards-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: var(--space-lg); }
}

@media (min-width: 1024px) {
  .cards-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
}

.cards-grid.list-view {
  grid-template-columns: 1fr;
}

.cards-grid.list-view .card-item {
  display: flex;
  flex-direction: row;
  align-items: stretch;
}

/* hidden クラスが list-view の display:flex に負けないよう詳細度を上げる */
.cards-grid.list-view .card-item.hidden {
  display: none;
}

.cards-grid.list-view .card-link {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: var(--space-md);
  width: 100%;
  padding: var(--space-sm) var(--space-md);
}

/* リスト表示ではサムネイルを非表示 */
.cards-grid.list-view .card-image-wrap {
  display: none;
}

.cards-grid.list-view .card-body {
  flex: 1;
  display: flex;
  align-items: center;
  gap: var(--space-md);
  flex-wrap: wrap;
  padding: 0;
}

.cards-grid.list-view .card-name {
  font-size: var(--font-size-sm);
  font-weight: 600;
  margin: 0;
  min-width: 120px;
  flex: 1;
}

.cards-grid.list-view .card-set {
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
  white-space: nowrap;
}

.cards-grid.list-view .card-price-info {
  display: flex;
  gap: var(--space-sm);
  align-items: baseline;
  margin-top: 0;
}

.cards-grid.list-view .card-meta {
  display: flex;
  gap: var(--space-xs);
  align-items: center;
  margin-top: 0;
}

/* ── Card Item ── */
.card-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  box-shadow: var(--shadow-sm);
}

.card-item:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--color-primary-light);
}

.card-item.hidden { display: none; }

.card-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

/* Card Image */
.card-image-wrap {
  position: relative;
  aspect-ratio: 3/4;
  overflow: hidden;
  background: linear-gradient(135deg, #1e293b, #334155);
}

.card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.card-item:hover .card-image {
  transform: scale(1.05);
}

.card-image-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #2d1b69, #1e40af, #0f2b5e);
  gap: 8px;
}

.card-placeholder-icon {
  font-size: 3rem;
  opacity: 0.6;
}

.card-placeholder-num {
  font-size: var(--font-size-sm);
  color: rgba(255,255,255,0.5);
  font-weight: 500;
}

.card-rarity-badge {
  position: absolute;
  top: var(--space-sm);
  right: var(--space-sm);
}

/* Card Body */
.card-body {
  padding: var(--space-md);
}

.card-name {
  font-size: var(--font-size-base);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-set {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  margin-bottom: var(--space-sm);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-number {
  opacity: 0.7;
}

.card-price-info {
  display: flex;
  gap: var(--space-sm);
  align-items: flex-start;
  margin-bottom: var(--space-sm);
}

.price-min, .price-max {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.price-label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.price-value {
  font-size: var(--font-size-lg);
  font-weight: 800;
  color: var(--color-primary);
}

.price-max-val {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  font-weight: 600;
}

.price-unknown {
  font-size: var(--font-size-lg);
  font-weight: 600;
  color: var(--text-secondary);
}

.card-meta {
  display: flex;
  gap: var(--space-xs);
  flex-wrap: wrap;
}

/* ── Rarity Badges ── */
.rarity-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 8px;
  border-radius: var(--border-radius-full);
  font-size: var(--font-size-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.rarity-common {
  background: var(--rarity-common-bg);
  color: var(--rarity-common-text);
}

.rarity-uncommon {
  background: var(--rarity-uncommon-bg);
  color: var(--rarity-uncommon-text);
}

.rarity-rare {
  background: var(--rarity-rare-bg);
  color: var(--rarity-rare-text);
}

.rarity-ex {
  background: linear-gradient(135deg, #d97706, #b45309);
  color: #fff;
  box-shadow: 0 0 8px rgba(217, 119, 6, 0.4);
}

.rarity-sr {
  background: linear-gradient(135deg, #7c3aed, #5b21b6);
  color: #fff;
  box-shadow: 0 0 8px rgba(124, 58, 237, 0.4);
}

.rarity-sar {
  background: var(--gradient-sar);
  background-size: 200% 200%;
  animation: rarityShimmer 3s ease infinite;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.5);
}

@keyframes rarityShimmer {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ── Extended Rarity Badges (r/u/c short codes + new rarities) ── */
.rarity-r { background: var(--rarity-rare-bg); color: var(--rarity-rare-text); }
.rarity-u { background: var(--rarity-uncommon-bg); color: var(--rarity-uncommon-text); }
.rarity-c { background: var(--rarity-common-bg); color: var(--rarity-common-text); }
.rarity-rr {
  background: linear-gradient(135deg, #1e40af, #3b82f6);
  color: #fff;
  box-shadow: 0 0 8px rgba(59, 130, 246, 0.4);
}
.rarity-rrr {
  background: linear-gradient(135deg, #1e3a8a, #312e81);
  color: #fff;
  box-shadow: 0 0 10px rgba(49, 46, 129, 0.5);
}
.rarity-hr {
  background: linear-gradient(135deg, #ca8a04, #fde68a, #ca8a04);
  background-size: 200% 200%;
  animation: rarityShimmer 2s ease infinite;
  color: #1a1a1a;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.6);
}
.rarity-ur {
  background: linear-gradient(135deg, #b45309, #d97706);
  color: #fff;
  box-shadow: 0 0 10px rgba(180, 83, 9, 0.5);
}
.rarity-mur {
  background: linear-gradient(135deg, #7c3aed, #f59e0b, #ef4444, #3b82f6);
  background-size: 300% 300%;
  animation: rarityShimmer 2s ease infinite;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.6);
  box-shadow: 0 0 16px rgba(124, 58, 237, 0.7);
}
.rarity-ma {
  background: linear-gradient(135deg, #991b1b, #dc2626);
  color: #fff;
  box-shadow: 0 0 10px rgba(153, 27, 27, 0.5);
}
.rarity-bwr {
  background: linear-gradient(135deg, #155e75, #0891b2);
  color: #fff;
  box-shadow: 0 0 8px rgba(8, 145, 178, 0.4);
}
.rarity-ar {
  background: linear-gradient(135deg, #0f766e, #14b8a6);
  color: #fff;
  box-shadow: 0 0 8px rgba(15, 118, 110, 0.4);
}
.rarity-ace {
  background: linear-gradient(135deg, #78350f, #d97706, #fbbf24);
  color: #fff;
  box-shadow: 0 0 10px rgba(120, 53, 15, 0.5);
}
.rarity-ssr {
  background: linear-gradient(135deg, #475569, #94a3b8, #475569);
  background-size: 200% 200%;
  animation: rarityShimmer 3s ease infinite;
  color: #fff;
  box-shadow: 0 0 10px rgba(148, 163, 184, 0.5);
}
.rarity-s {
  background: linear-gradient(135deg, #64748b, #94a3b8);
  color: #fff;
}
.rarity-master-ball {
  background: linear-gradient(135deg, #4a1d96, #7c3aed);
  color: #fff;
  box-shadow: 0 0 10px rgba(74, 29, 150, 0.5);
}
.rarity-monster-ball {
  background: linear-gradient(135deg, #7f1d1d, #ef4444);
  color: #fff;
  box-shadow: 0 0 8px rgba(127, 29, 29, 0.4);
}
.rarity-sa {
  background: linear-gradient(135deg, #5b21b6, #8b5cf6);
  color: #fff;
  box-shadow: 0 0 8px rgba(91, 33, 182, 0.4);
}
.rarity-csr {
  background: linear-gradient(135deg, #9d174d, #ec4899);
  color: #fff;
  box-shadow: 0 0 8px rgba(157, 23, 77, 0.4);
}
.rarity-chr {
  background: linear-gradient(135deg, #be185d, #f472b6);
  color: #fff;
}
.rarity-k {
  background: linear-gradient(135deg, #065f46, #10b981);
  color: #fff;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
}
.rarity-a {
  background: linear-gradient(135deg, #0369a1, #38bdf8);
  background-size: 200% 200%;
  animation: rarityShimmer 4s ease infinite;
  color: #fff;
  box-shadow: 0 0 10px rgba(14, 165, 233, 0.4);
}
.rarity-pr {
  background: linear-gradient(135deg, #701a75, #c026d3, #a21caf);
  background-size: 200% 200%;
  animation: rarityShimmer 3s ease infinite;
  color: #fff;
  box-shadow: 0 0 10px rgba(162, 28, 175, 0.5);
}
.rarity-h {
  background: linear-gradient(135deg, #854d0e, #fde68a);
  color: #1a1a1a;
  box-shadow: 0 0 8px rgba(202, 138, 4, 0.4);
}
.rarity-tr {
  background: linear-gradient(135deg, #92400e, #b45309);
  color: #fff;
}
.rarity-promo {
  background: linear-gradient(135deg, #b91c1c, #ef4444);
  color: #fff;
  box-shadow: 0 0 8px rgba(185, 28, 28, 0.4);
}

/* Stock/Shop Badges */
.shop-count-badge {
  display: inline-flex;
  align-items: center;
  background: rgba(37, 99, 235, 0.1);
  color: var(--color-secondary);
  border-radius: var(--border-radius-full);
  padding: 2px 8px;
  font-size: var(--font-size-xs);
  font-weight: 600;
}

.out-of-stock-badge {
  display: inline-flex;
  align-items: center;
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border-radius: var(--border-radius-full);
  padding: 2px 8px;
  font-size: var(--font-size-xs);
  font-weight: 600;
}

/* ── Empty State ── */
.cards-empty {
  text-align: center;
  padding: var(--space-3xl) var(--space-xl);
  color: var(--text-muted);
}

.empty-icon {
  font-size: 3rem;
  display: block;
  margin-bottom: var(--space-md);
}

.view-more-wrap {
  text-align: center;
  margin-top: var(--space-2xl);
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 12px 28px;
  border-radius: var(--border-radius-full);
  font-size: var(--font-size-base);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  border: 2px solid transparent;
  text-decoration: none;
}

.btn-primary {
  background: var(--gradient-brand);
  color: white;
  box-shadow: var(--shadow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  opacity: 1;
}

.btn-outline {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: transparent;
}

.btn-outline:hover {
  background: rgba(124,58,237,0.1);
  opacity: 1;
}

/* ── How It Works ── */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-xl);
  margin-top: var(--space-xl);
}

.step-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  padding: var(--space-xl);
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition);
}

.step-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.step-icon {
  font-size: 2.5rem;
  margin-bottom: var(--space-md);
}

.step-title {
  font-size: var(--font-size-lg);
  font-weight: 700;
  margin-bottom: var(--space-sm);
  color: var(--text-primary);
}

.step-desc {
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
  line-height: 1.7;
}

/* ── Page Hero (Inner pages) ── */
.page-hero {
  background: var(--gradient-brand);
  padding: var(--space-2xl) 0;
  color: white;
}

.page-title {
  font-size: var(--font-size-3xl);
  font-weight: 700;
  margin-bottom: var(--space-sm);
}

.page-subtitle {
  color: rgba(255,255,255,0.8);
  font-size: var(--font-size-base);
}

/* ── Filter Bar (List page) ── */
.filter-bar {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  padding: var(--space-md) var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
  box-shadow: var(--shadow-sm);
}

@media (min-width: 768px) {
  .filter-bar {
    flex-direction: row;
    align-items: center;
  }
}

.filter-search {
  position: relative;
  flex: 1;
}

.filter-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1rem;
  pointer-events: none;
}

.filter-search-input {
  width: 100%;
  padding: 10px 16px 10px 40px;
  border: 1.5px solid var(--border-color);
  border-radius: var(--border-radius-full);
  background: var(--bg-surface-2);
  color: var(--text-primary);
  font-size: var(--font-size-sm);
  outline: none;
  transition: all var(--transition);
}

.filter-search-input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(124,58,237,0.15);
}

.filter-controls {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
  align-items: center;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.filter-label {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.filter-select {
  padding: 8px 12px;
  border: 1.5px solid var(--border-color);
  border-radius: var(--border-radius);
  background: var(--bg-surface-2);
  color: var(--text-primary);
  font-size: var(--font-size-sm);
  cursor: pointer;
  outline: none;
  transition: all var(--transition);
  min-width: 120px;
}

.filter-select:focus {
  border-color: var(--color-primary);
}

/* Results Bar */
.results-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
}

.results-count {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  font-weight: 500;
}

.view-toggle {
  display: flex;
  gap: 4px;
}

.view-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--border-radius);
  background: var(--bg-surface-2);
  border: 1.5px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
}

.view-btn.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: white;
}

/* ── Breadcrumb ── */
.breadcrumb {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  padding: 12px 0;
}

.breadcrumb .container {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: var(--font-size-sm);
  color: var(--text-muted);
}

.breadcrumb a {
  color: var(--text-link);
  text-decoration: none;
}

.breadcrumb-sep {
  color: var(--text-muted);
}

/* ── Card Detail ── */
.card-detail-section {
  padding: var(--space-2xl) 0 var(--space-3xl);
}

.card-detail-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-2xl);
}

@media (min-width: 900px) {
  .card-detail-layout {
    grid-template-columns: 300px 1fr;
  }
}

/* Card Detail Left */
.card-detail-image-wrap {
  width: 100%;
  max-width: 300px;
  margin: 0 auto;
}

.card-detail-image {
  width: 100%;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-xl);
}

.card-detail-placeholder {
  width: 100%;
  aspect-ratio: 3/4;
  border-radius: var(--border-radius-lg);
  background: linear-gradient(135deg, #2d1b69, #1e40af, #0f2b5e);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  box-shadow: var(--shadow-xl);
}

.card-placeholder-icon-lg { font-size: 5rem; opacity: 0.6; }
.card-placeholder-num-lg {
  font-size: var(--font-size-lg);
  color: rgba(255,255,255,0.5);
  font-weight: 700;
}

.card-info-box {
  margin-top: var(--space-lg);
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.card-info-table {
  width: 100%;
  border-collapse: collapse;
}

.card-info-table th,
.card-info-table td {
  padding: 10px var(--space-md);
  text-align: left;
  border-bottom: 1px solid var(--border-color);
  font-size: var(--font-size-sm);
}

.card-info-table tr:last-child th,
.card-info-table tr:last-child td {
  border-bottom: none;
}

.card-info-table th {
  color: var(--text-muted);
  font-weight: 600;
  background: var(--bg-surface-2);
  width: 100px;
  white-space: nowrap;
}

.card-info-table td {
  color: var(--text-primary);
}

/* Card Detail Right */
.card-detail-title {
  font-size: var(--font-size-3xl);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-xs);
}

.card-detail-set {
  color: var(--text-muted);
  font-size: var(--font-size-base);
  margin-bottom: var(--space-lg);
}

.price-summary {
  margin-bottom: var(--space-2xl);
}

.price-range-display {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  padding: var(--space-lg);
  margin-bottom: var(--space-sm);
  box-shadow: var(--shadow-sm);
}

.price-range-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.price-range-label {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
}

.price-range-value {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 800;
  color: var(--color-primary);
}

.price-range-item.price-range-max .price-range-value {
  color: var(--text-secondary);
  font-size: clamp(1.2rem, 2.5vw, 1.5rem);
}

.price-range-divider {
  color: var(--text-muted);
  font-size: var(--font-size-xl);
  font-weight: 300;
}

.price-shop-count {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
}

/* Price Table */
.price-table-wrap {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--space-md);
}

.price-table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-surface-2);
}

.price-table-title {
  font-size: var(--font-size-lg);
  font-weight: 700;
  color: var(--text-primary);
}

.price-table-controls {
  display: flex;
  gap: var(--space-sm);
}

.sort-btn {
  padding: 6px 14px;
  border: 1.5px solid var(--border-color);
  border-radius: var(--border-radius-full);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: var(--font-size-xs);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.sort-btn.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: white;
}

.sort-btn:hover:not(.active) {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.price-table-container {
  overflow-x: auto;
}

.price-table {
  width: 100%;
  border-collapse: collapse;
}

.price-table thead th {
  background: var(--bg-surface-2);
  padding: 12px var(--space-md);
  text-align: left;
  font-size: var(--font-size-xs);
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 2px solid var(--border-color);
  white-space: nowrap;
  cursor: pointer;
}

.price-table thead th:hover { color: var(--color-primary); }

.price-table tbody tr {
  border-bottom: 1px solid var(--border-color);
  transition: background var(--transition);
}

.price-table tbody tr:last-child { border-bottom: none; }

.price-table tbody tr:hover {
  background: var(--bg-surface-2);
}

.price-table tbody tr.row-cheapest {
  background: rgba(124,58,237,0.05);
  border-left: 3px solid var(--color-primary);
}

.price-table tbody tr.row-cheapest:hover {
  background: rgba(124,58,237,0.1);
}

.price-table tbody tr.row-no-stock {
  opacity: 0.5;
}

.price-table td {
  padding: 14px var(--space-md);
  font-size: var(--font-size-sm);
  color: var(--text-primary);
  vertical-align: middle;
}

.td-rank { width: 50px; }
.td-shop { min-width: 140px; }
.td-condition { width: 80px; }
.td-price { width: 120px; }
.td-stock { width: 100px; }
.td-link { width: 120px; }

.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: var(--font-size-xs);
  font-weight: 700;
}

.rank-1 {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: white;
  box-shadow: 0 2px 8px rgba(245,158,11,0.4);
}

.shop-name { font-weight: 600; }

.condition-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--border-radius-full);
  background: rgba(37,99,235,0.1);
  color: var(--color-secondary);
  font-size: var(--font-size-xs);
  font-weight: 600;
}

.table-price {
  font-size: var(--font-size-base);
  font-weight: 700;
  color: var(--text-primary);
}

.price-cheapest {
  color: var(--color-primary);
  font-size: var(--font-size-lg);
}

.stock-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--border-radius-full);
  font-size: var(--font-size-xs);
  font-weight: 600;
}

.in-stock {
  background: rgba(22, 163, 74, 0.1);
  color: #16a34a;
}

.no-stock {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.shop-link-btn {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  background: var(--gradient-brand);
  color: white;
  border-radius: var(--border-radius-full);
  font-size: var(--font-size-xs);
  font-weight: 600;
  text-decoration: none;
  transition: all var(--transition);
  white-space: nowrap;
}

.shop-link-btn:hover {
  transform: scale(1.04);
  box-shadow: var(--shadow);
  opacity: 1;
}

.shop-link-disabled {
  background: var(--bg-surface-3);
  color: var(--text-muted);
  pointer-events: none;
}

/* Price Note */
.price-note {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  padding: var(--space-md);
  background: rgba(245,158,11,0.08);
  border: 1px solid rgba(245,158,11,0.2);
  border-radius: var(--border-radius);
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
}

/* ── Not Found ── */
.not-found-section {
  padding: var(--space-3xl) 0;
}

.not-found-icon { font-size: 4rem; margin-bottom: var(--space-lg); display: block; }
.not-found-title { font-size: var(--font-size-3xl); font-weight: 700; margin-bottom: var(--space-md); }
.not-found-desc { color: var(--text-muted); margin-bottom: var(--space-xl); }

/* ── Shortcode Price Table ── */
.shortcode-price-table {
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  margin: var(--space-xl) 0;
}

.shortcode-card-header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md);
  background: var(--bg-surface-2);
  border-bottom: 1px solid var(--border-color);
  font-size: var(--font-size-sm);
}

.card-set-inline { color: var(--text-muted); }

.shortcode-error {
  color: #ef4444;
  padding: var(--space-md);
  background: rgba(239,68,68,0.1);
  border-radius: var(--border-radius);
}

/* ── Footer ── */
.site-footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border-color);
  padding: var(--space-3xl) 0 var(--space-lg);
  margin-top: auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-2xl);
  margin-bottom: var(--space-2xl);
}

@media (min-width: 640px) {
  .footer-grid { grid-template-columns: 2fr 1fr 1fr; }
}

.footer-logo {
  font-size: var(--font-size-xl);
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: none;
  display: block;
  margin-bottom: var(--space-md);
}

.footer-desc {
  color: var(--text-muted);
  font-size: var(--font-size-sm);
  line-height: 1.7;
}

.footer-heading {
  font-size: var(--font-size-sm);
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-md);
}

.footer-nav {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.footer-nav a {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--transition);
}

.footer-nav a:hover {
  color: var(--color-primary);
  opacity: 1;
}

.footer-stat-items {
  display: flex;
  gap: var(--space-xl);
}

.footer-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.footer-stat-num {
  font-size: var(--font-size-2xl);
  font-weight: 800;
  color: var(--color-primary);
}

.footer-stat-label {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}

.footer-bottom {
  border-top: 1px solid var(--border-color);
  padding-top: var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

@media (min-width: 640px) {
  .footer-bottom {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}

.footer-copy,
.footer-updated {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-surface-2); }
::-webkit-scrollbar-thumb { background: var(--border-color-2); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--color-primary-light); }

/* ── Animations ── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.card-item {
  animation: fadeInUp 0.4s ease both;
}

.card-item:nth-child(1)  { animation-delay: 0.02s; }
.card-item:nth-child(2)  { animation-delay: 0.04s; }
.card-item:nth-child(3)  { animation-delay: 0.06s; }
.card-item:nth-child(4)  { animation-delay: 0.08s; }
.card-item:nth-child(5)  { animation-delay: 0.10s; }
.card-item:nth-child(6)  { animation-delay: 0.12s; }
.card-item:nth-child(7)  { animation-delay: 0.14s; }
.card-item:nth-child(8)  { animation-delay: 0.16s; }
.card-item:nth-child(9)  { animation-delay: 0.18s; }
.card-item:nth-child(10) { animation-delay: 0.20s; }

/* ── List Prompt (未検索状態) ── */
.list-prompt {
  text-align: center;
  padding: var(--space-3xl) var(--space-md);
  color: var(--text-muted);
}

.list-prompt-icon {
  font-size: 3.5rem;
  display: block;
  margin-bottom: var(--space-lg);
  opacity: 0.55;
}

.list-prompt-text {
  font-size: var(--font-size-lg);
  color: var(--text-secondary);
  font-weight: 500;
  margin-bottom: var(--space-sm);
}

.list-prompt-sub {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
}

/* ── Autocomplete Suggestions ── */
.list-search-suggestions {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 24px rgba(0,0,0,.18);
  z-index: 200;
  max-height: 320px;
  overflow-y: auto;
}
.list-search-suggestions.active { display: block; }

.suggestion-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 1rem;
  cursor: pointer;
  gap: var(--space-sm);
  transition: background var(--transition-fast);
}
.suggestion-item:hover,
.suggestion-item.highlighted {
  background: var(--primary-light, rgba(59,130,246,.08));
}
.suggestion-name {
  font-size: var(--font-size-sm);
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}
.suggestion-name mark {
  background: transparent;
  color: var(--primary);
  font-weight: 700;
}
.suggestion-set {
  font-size: 0.68rem;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}
.suggestion-set-label {
  font-style: italic;
}

/* ── Pagination ── */
.pagination {
  display: flex;
  gap: var(--space-xs);
  justify-content: center;
  align-items: center;
  padding: var(--space-xl) 0 var(--space-lg);
  flex-wrap: wrap;
}

.page-btn {
  min-width: 36px;
  height: 36px;
  padding: 0 var(--space-sm);
  border-radius: var(--border-radius-sm);
  background: var(--bg-surface-2);
  border: 1.5px solid var(--border-color);
  font-size: var(--font-size-sm);
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
}

.page-btn:hover:not(:disabled) {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: var(--bg-surface);
}

.page-btn.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
  font-weight: 600;
}

.page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.page-ellipsis {
  padding: 0 var(--space-xs);
  color: var(--text-muted);
  line-height: 36px;
  user-select: none;
}

/* ── Focus Styles ── */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: var(--border-radius-sm);
}

/* ── Mobile: 2列カードグリッド ── */
@media (max-width: 639px) {
  /* カードグリッドを2列固定 */
  .cards-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-sm);
  }

  /* カード本体のパディングを縮小 */
  .card-body {
    padding: var(--space-xs) var(--space-sm);
  }

  /* カード名を小さく・2行まで */
  .card-name {
    font-size: 0.78rem;
    -webkit-line-clamp: 2;
  }

  /* セット名を小さく */
  .card-set {
    font-size: 0.63rem;
    margin-bottom: var(--space-xs);
  }

  /* 価格表示を縮小 */
  .price-value {
    font-size: var(--font-size-sm);
  }

  .price-label {
    font-size: 9px;
  }

  .card-price-info {
    margin-bottom: 0;
  }

  /* バッジを縮小 */
  .shop-count-badge,
  .out-of-stock-badge {
    font-size: 0.6rem;
    padding: 1px 5px;
  }

  .card-meta {
    gap: 2px;
    margin-top: var(--space-xs);
  }

  /* レアリティバッジを縮小 */
  .card-rarity-badge {
    font-size: 0.6rem;
    padding: 2px 5px;
  }
}

/* ── Print ── */
@media print {
  .site-header, .site-footer, .filter-bar, .hero-search { display: none; }
  .main-content { padding-top: 0; }
}
