:root {
  --bg-base: #090b10;
  --bg-surface: #11151f;
  --bg-elevated: #171c29;
  --bg-card-hover: #1c2233;
  --bg-glass: rgba(15, 19, 28, 0.86);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text-primary: #f3f6fc;
  --text-secondary: #9ba5b7;
  --text-muted: #647087;
  --accent-primary: #6366f1;
  --accent-glow: rgba(99, 102, 241, 0.28);
  --accent-cyan: #22d3ee;
  --score-gold: #10b981;
  --score-good: #f59e0b;
  --score-mixed: #64748b;
  --plat-pc: #38bdf8;
  --plat-ps: #3b82f6;
  --plat-switch: #f43f5e;
  --plat-xbox: #22c55e;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --shadow-card: 0 10px 28px -8px rgba(0, 0, 0, 0.6);
}

[data-theme="light"] {
  --bg-base: #f1f5f9;
  --bg-surface: #ffffff;
  --bg-elevated: #f8fafc;
  --bg-card-hover: #f1f5f9;
  --bg-glass: rgba(255, 255, 255, 0.88);
  --border-subtle: rgba(15, 23, 42, 0.09);
  --border-strong: rgba(15, 23, 42, 0.18);
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --shadow-card: 0 8px 20px -6px rgba(15, 23, 42, 0.1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-base);
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Kaku Gothic ProN", "Meiryo", sans-serif;
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Header */
.top-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--bg-glass);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.65rem 1.25rem;
}

.header-inner {
  max-width: 1680px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
}

.brand-logo {
  height: 36px;
  width: auto;
  max-width: 145px;
  display: block;
  object-fit: contain;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.brand:hover .brand-logo {
  transform: translateY(-1px);
}

.brand-copy {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  border-left: 1px solid var(--border-subtle);
  padding-left: 0.75rem;
  line-height: 1.2;
  white-space: nowrap;
  user-select: none;
}

/* Light / Dark Mode Logo Switching */
.logo-light-theme {
  display: none !important;
}
.logo-dark-theme {
  display: block !important;
}

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

/* Accessibility helper */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.search-wrap {
  width: 100%;
  position: relative;
}

.search-input {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  padding: 0.48rem 2rem 0.48rem 2.1rem;
  border-radius: var(--radius-sm);
  font-size: 0.84rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.search-input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.85rem;
  pointer-events: none;
}

.search-kbd {
  position: absolute;
  right: 0.6rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.7rem;
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  padding: 0.05rem 0.35rem;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.lang-switch {
  display: inline-flex;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  padding: 2px;
}

.lang-btn {
  background: transparent;
  color: var(--text-secondary);
  border: none;
  padding: 0.3rem 0.58rem;
  font-size: 0.75rem;
  font-weight: 800;
  border-radius: calc(var(--radius-md) - 3px);
  cursor: pointer;
  transition: all 0.15s;
}

.lang-btn:hover {
  color: var(--text-primary);
}

.lang-btn.active {
  background: var(--accent-primary);
  color: #fff;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  padding: 0.45rem 0.8rem;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
}

.btn:hover {
  border-color: var(--border-strong);
  background: var(--bg-elevated);
}

.btn-sm {
  padding: 0.34rem 0.68rem;
  font-size: 0.77rem;
  border-radius: var(--radius-sm);
  font-weight: 700;
}

.btn-subtle {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border-subtle);
}

.btn-subtle:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.btn-primary {
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: #fff;
  border-color: transparent;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #4f46e5, #4338ca);
  transform: translateY(-1px);
}

.api-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f59e0b;
}

.status-dot.connected {
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
}

/* Main Container & 2-Column Workspace Layout */
.main-container {
  max-width: 1740px;
  margin: 0 auto;
  padding: 1rem 1.25rem 3.5rem;
}

.workspace-layout {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 1.35rem;
  align-items: start;
}

@media (min-width: 1600px) {
  .workspace-layout {
    grid-template-columns: 350px minmax(0, 1fr);
    gap: 1.5rem;
  }
}

.content-column {
  min-width: 0;
  width: 100%;
}

/* Sticky Left Sidebar on Desktop - Harmonized layout for WQHD/FHD */
.filter-sidebar {
  position: sticky;
  top: 66px;
  max-height: calc(100vh - 80px);
  overflow-y: auto;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 0.85rem 0.95rem;
  display: flex;
  flex-direction: column;
  gap: 0.68rem;
  scrollbar-width: thin;
  box-shadow: 0 4px 20px -4px rgba(0, 0, 0, 0.35);
}

.sidebar-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid var(--border-subtle);
}

.sidebar-header-title {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  letter-spacing: 0.02em;
}

.sidebar-header-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.btn-icon-sm {
  padding: 0.22rem 0.52rem;
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.sidebar-modal-header,
.sidebar-modal-footer {
  display: none;
}

.sidebar-body {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.sidebar-section {
  display: flex;
  flex-direction: column;
  gap: 0.32rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--border-subtle);
}

.sidebar-section.sidebar-section-last,
.sidebar-section:last-of-type {
  border-bottom: none;
  padding-bottom: 0;
}

.sidebar-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
}

.sidebar-label {
  font-size: 0.73rem;
  font-weight: 800;
  color: var(--text-secondary);
  display: block;
  letter-spacing: 0.01em;
}

.full-width {
  width: 100%;
}

.sidebar-density-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.sidebar-actions {
  display: flex;
  gap: 0.4rem;
  padding-top: 0.15rem;
}

.sidebar-actions .btn {
  flex: 1;
  justify-content: center;
}

/* Hamburger & Mobile Filter Controls (Hidden on PC) */
.btn-hamburger {
  display: none;
  border-color: rgba(99, 102, 241, 0.45);
  background: rgba(99, 102, 241, 0.14);
}

.filter-count-badge {
  background: var(--accent-cyan);
  color: #05070b;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 0.05rem 0.4rem;
  border-radius: 99px;
}

.filter-count-badge.hidden {
  display: none;
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  z-index: 85;
  background: rgba(5, 7, 12, 0.78);
  backdrop-filter: blur(6px);
}

.sidebar-backdrop.hidden {
  display: none;
}

.mobile-fab-filter {
  display: none;
  position: fixed;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 75;
  background: linear-gradient(135deg, #6366f1, #06b6d4);
  color: #fff;
  border: none;
  padding: 0.65rem 1.35rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 800;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6);
  cursor: pointer;
}

/* Tablet / Smartphone / Portrait Mode (<= 1024px or Portrait Orientation) */
@media (max-width: 1024px), (orientation: portrait) {
  .workspace-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .btn-hamburger {
    display: inline-flex;
  }

  .mobile-fab-filter {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
  }

  .filter-sidebar {
    display: none;
    position: fixed;
    z-index: 90;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(94vw, 500px);
    max-height: 88vh;
    padding: 0;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.85);
    border-color: var(--border-strong);
  }

  .filter-sidebar.modal-open {
    display: flex;
  }

  .sidebar-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.9rem 1.1rem;
    border-bottom: 1px solid var(--border-subtle);
    position: sticky;
    top: 0;
    background: var(--bg-surface);
    z-index: 5;
  }

  .sidebar-modal-header h3 {
    font-size: 0.98rem;
    font-weight: 800;
  }

  .sidebar-body {
    padding: 1rem 1.1rem;
    overflow-y: auto;
  }

  .sidebar-modal-footer {
    display: block;
    padding: 0.85rem 1.1rem;
    border-top: 1px solid var(--border-subtle);
    position: sticky;
    bottom: 0;
    background: var(--bg-surface);
    z-index: 5;
  }
}

/* Daily Radar Banner */
.daily-radar {
  display: grid;
  grid-template-columns: 1.3fr 2fr;
  gap: 1rem;
  margin-bottom: 1.1rem;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(6, 182, 212, 0.06));
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 0.9rem 1.1rem;
  align-items: center;
}

@media (max-width: 1024px) {
  .daily-radar {
    grid-template-columns: 1fr;
  }
}

.radar-welcome h2 {
  font-size: 1.05rem;
  font-weight: 800;
  margin-bottom: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.radar-welcome p {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.radar-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.65rem;
}

@media (max-width: 640px) {
  .brand-logo {
    height: 28px;
    max-width: 120px;
  }
  .brand-copy {
    display: none;
  }
  .radar-stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

.stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.55rem 0.75rem;
  display: flex;
  flex-direction: column;
}

.stat-label {
  font-size: 0.72rem;
  color: var(--text-secondary);
}

.stat-value {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
}

/* Filter & Control Bar */
.control-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 0.75rem 1rem;
  margin-bottom: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.tabs-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 0.65rem;
}

.mode-tabs {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.mode-tab {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid transparent;
  padding: 0.42rem 0.8rem;
  border-radius: var(--radius-md);
  font-size: 0.83rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.15s;
}

.mode-tab:hover {
  color: var(--text-primary);
  background: var(--bg-elevated);
}

.mode-tab.active {
  background: var(--accent-primary);
  color: #fff;
  box-shadow: 0 2px 10px var(--accent-glow);
}

.tab-count {
  font-size: 0.7rem;
  background: rgba(0, 0, 0, 0.25);
  padding: 0.05rem 0.4rem;
  border-radius: 999px;
}

.filters-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.platform-pills,
.platform-segment {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.25rem;
  background: var(--bg-elevated);
  padding: 3px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.plat-pill {
  background: transparent;
  color: var(--text-secondary);
  border: none;
  padding: 0.32rem 0;
  border-radius: calc(var(--radius-md) - 2px);
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: 100%;
}

.plat-pill:hover {
  color: var(--text-primary);
  background: var(--bg-card-hover);
}

.plat-pill.active[data-plat="all"] {
  background: var(--text-primary);
  color: var(--bg-base);
}
.plat-pill.active[data-plat="pc"] {
  background: rgba(56, 189, 248, 0.22);
  color: var(--plat-pc);
  box-shadow: inset 0 0 0 1px var(--plat-pc);
}
.plat-pill.active[data-plat="ps5"] {
  background: rgba(59, 130, 246, 0.25);
  color: #93c5fd;
  box-shadow: inset 0 0 0 1px var(--plat-ps);
}
.plat-pill.active[data-plat="switch"] {
  background: rgba(244, 63, 94, 0.24);
  color: #fda4af;
  box-shadow: inset 0 0 0 1px var(--plat-switch);
}
.plat-pill.active[data-plat="xbox"] {
  background: rgba(34, 197, 94, 0.22);
  color: var(--plat-xbox);
  box-shadow: inset 0 0 0 1px var(--plat-xbox);
}

.secondary-filters {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.filter-select {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  padding: 0.32rem 0.55rem;
  border-radius: var(--radius-sm);
  font-size: 0.76rem;
  cursor: pointer;
  line-height: 1.4;
}

.density-switch {
  display: inline-flex;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.density-btn {
  background: transparent;
  color: var(--text-secondary);
  border: none;
  padding: 0.28rem 0.55rem;
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
}

.density-btn.active {
  background: var(--accent-primary);
  color: #fff;
}

/* Steam-style Tag Filter Bar */
.tags-filter-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border-subtle);
}

.tags-filter-label {
  font-size: 0.74rem;
  font-weight: 800;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.tag-pills {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  flex-wrap: wrap;
}

.tag-pill {
  background: var(--bg-elevated);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  font-size: 0.73rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.14s;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.tag-pill:hover {
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.tag-pill.active {
  background: rgba(34, 211, 238, 0.16);
  color: var(--accent-cyan);
  border-color: var(--accent-cyan);
}

.card-tags-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-top: 0.1rem;
}

.mini-tag {
  font-size: 0.65rem;
  font-weight: 600;
  padding: 0.08rem 0.4rem;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.14s;
  position: relative;
  z-index: 2;
}

.mini-tag:hover {
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  background: rgba(34, 211, 238, 0.1);
}

/* Mode Spec & Inline Top Pager */
.spec-and-pager-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding-top: 0.55rem;
  border-top: 1px dashed var(--border-subtle);
}

/* Active Filter Banner */
.active-filter-banner {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.55rem 0.85rem;
  margin-bottom: 0.95rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.active-filter-banner.hidden {
  display: none !important;
}

.active-filter-inner {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  width: 100%;
}

.active-filter-title {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.active-filter-chips {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

.active-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: rgba(99, 102, 241, 0.14);
  color: var(--accent-primary);
  border: 1px solid rgba(99, 102, 241, 0.28);
  padding: 0.2rem 0.55rem;
  border-radius: 99px;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.active-filter-chip:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.35);
  transform: translateY(-1px);
}

.btn-clear-all-filters {
  margin-left: auto;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  transition: color 0.15s ease;
}

.btn-clear-all-filters:hover {
  color: var(--text-primary);
  text-decoration: underline;
}

.mode-spec-info {
  font-size: 0.75rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.spec-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  padding: 0.14rem 0.5rem;
  border-radius: 5px;
  font-size: 0.72rem;
  color: var(--text-primary);
  font-weight: 600;
}

.pager-inline {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.pager-summary {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-right: 0.25rem;
  font-weight: 600;
}

.pagination-bar {
  margin-top: 1.5rem;
  padding: 0.85rem 1rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.pager-buttons {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  flex-wrap: wrap;
}

.page-btn {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  min-width: 32px;
  height: 32px;
  padding: 0 0.55rem;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.page-btn:hover:not(:disabled) {
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

.page-btn.active {
  background: var(--accent-primary);
  color: #fff;
  border-color: transparent;
}

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

.popularity-chip {
  font-size: 0.68rem;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
}

/* Games Grid - High Density */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(295px, 1fr));
  gap: 0.95rem;
}

.games-grid.compact-view {
  grid-template-columns: repeat(auto-fill, minmax(410px, 1fr));
  gap: 0.7rem;
}

/* Game Card (Whole card clickable) */
.game-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease;
  position: relative;
  cursor: pointer;
}

.game-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-card);
  background: var(--bg-card-hover);
}

/*
 * Media Split Layout:
 * IGDB cover is 3:4 aspect ratio.
 * With 36% left column for the cover and container aspect-ratio 25 / 12 (i.e. 36 : 48 = 3 : 4),
 * the left cover slot is an exact 3:4 rectangle so the cover fits edge-to-edge without cropping!
 */
.card-media {
  position: relative;
  aspect-ratio: 25 / 12;
  background: #06080d;
  overflow: hidden;
  border-bottom: 1px solid var(--border-subtle);
}

.card-cover-split {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: 36% 64%;
}

.card-cover-box {
  width: 100%;
  height: 100%;
  background: #05070b;
  display: flex;
  align-items: center;
  justify-content: center;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.card-cover-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.card-ss-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #080b11;
}

.card-ss-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
  display: block;
}

.game-card:hover .card-ss-img {
  transform: scale(1.03);
}

.ss-dots {
  position: absolute;
  bottom: 6px;
  right: 6px;
  display: flex;
  gap: 5px;
  background: rgba(0, 0, 0, 0.7);
  padding: 4px 7px;
  border-radius: 999px;
  z-index: 2;
}

.ss-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.38);
  cursor: pointer;
}

.ss-dot.active {
  background: var(--accent-cyan);
  transform: scale(1.25);
}

/* Card Body */
.card-body {
  padding: 0.75rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  flex: 1;
}

.card-top-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.plat-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  align-items: center;
}

.plat-tag {
  font-size: 0.65rem;
  font-weight: 800;
  padding: 0.1rem 0.38rem;
  border-radius: 4px;
  letter-spacing: 0.02em;
}

.plat-tag.pc {
  background: rgba(56, 189, 248, 0.15);
  color: var(--plat-pc);
}
.plat-tag.ps {
  background: rgba(59, 130, 246, 0.18);
  color: #60a5fa;
}
.plat-tag.switch {
  background: rgba(244, 63, 94, 0.18);
  color: #fb7185;
}
.plat-tag.xbox {
  background: rgba(34, 197, 94, 0.16);
  color: var(--plat-xbox);
}
.plat-tag.dlsite {
  background: rgba(59, 130, 246, 0.22);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.4);
}
.plat-tag.fanza {
  background: rgba(244, 63, 94, 0.22);
  color: #fda4af;
  border: 1px solid rgba(244, 63, 94, 0.4);
}
.plat-tag.adult {
  background: rgba(236, 72, 153, 0.2);
  color: #f472b6;
}

.rating-cluster {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.score-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.22rem;
  font-size: 0.74rem;
  font-weight: 800;
  padding: 0.1rem 0.42rem;
  border-radius: 5px;
}

.score-pill.high {
  background: rgba(16, 185, 129, 0.18);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.score-pill.mid {
  background: rgba(245, 158, 11, 0.18);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.score-pill.unrated {
  background: rgba(100, 116, 139, 0.18);
  color: var(--text-secondary);
}

.card-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
}

.card-title {
  font-size: 0.96rem;
  font-weight: 800;
  line-height: 1.32;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.15s;
}

.game-card:hover .card-title {
  color: var(--accent-cyan);
}

/* Release badge moved inside card body so it never covers images */
.release-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.release-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.69rem;
  font-weight: 800;
  padding: 0.12rem 0.48rem;
  border-radius: 4px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.release-badge.hot {
  background: rgba(16, 185, 129, 0.16);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.35);
}

.release-badge.upcoming {
  background: rgba(99, 102, 241, 0.18);
  color: #a5b4fc;
  border-color: rgba(99, 102, 241, 0.4);
}

.card-genre-text {
  font-size: 0.72rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-summary {
  font-size: 0.76rem;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.45;
}

.card-footer {
  margin-top: auto;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
}

.store-links {
  display: flex;
  align-items: center;
  gap: 0.32rem;
  flex-wrap: wrap;
}

.store-chip {
  font-size: 0.69rem;
  font-weight: 700;
  padding: 0.22rem 0.5rem;
  border-radius: 5px;
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  transition: all 0.14s;
  position: relative;
  z-index: 2;
}

.store-chip.direct {
  border-color: rgba(34, 211, 238, 0.45);
  background: rgba(34, 211, 238, 0.08);
}

.store-chip:hover {
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  transform: translateY(-1px);
}

.watchlist-btn {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.88rem;
  transition: all 0.15s;
  position: relative;
  z-index: 2;
}

.watchlist-btn:hover {
  border-color: var(--border-strong);
  color: var(--text-primary);
  transform: scale(1.06);
}

.watchlist-btn.saved {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.5);
}

/* Compact View Overrides */
.games-grid.compact-view .game-card {
  flex-direction: row;
  align-items: stretch;
}

.games-grid.compact-view .card-media {
  width: 114px;
  aspect-ratio: 3 / 4;
  flex-shrink: 0;
  border-bottom: none;
  border-right: 1px solid var(--border-subtle);
}

.games-grid.compact-view .card-cover-split {
  grid-template-columns: 1fr;
}

.games-grid.compact-view .card-cover-box {
  border-right: none;
}

.games-grid.compact-view .card-ss-wrap {
  display: none;
}

.games-grid.compact-view .card-summary {
  -webkit-line-clamp: 1;
}

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(5, 7, 12, 0.82);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.modal-backdrop.hidden {
  display: none;
}

.modal-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 1040px;
  max-height: 90vh;
  overflow-y: auto;
  overflow-x: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.75);
}

.modal-box.small {
  max-width: 540px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  background: var(--bg-surface);
  z-index: 10;
}

.modal-close {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  flex-shrink: 0;
}

.modal-body {
  padding: 1.25rem;
}

/* Fixed Detail Grid: min-width: 0 on columns prevents screenshot strip from blowing out width */
.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
  gap: 1.35rem;
  align-items: start;
}

.detail-col {
  min-width: 0;
  width: 100%;
}

@media (max-width: 860px) {
  .detail-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.gallery-main {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #05070b;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  margin-bottom: 0.65rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery-main img,
.gallery-main iframe {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: none;
  display: block;
}

.gallery-thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 0.5rem;
  width: 100%;
}

.gallery-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 6px;
  object-fit: cover;
  cursor: pointer;
  opacity: 0.6;
  border: 2px solid transparent;
  transition: opacity 0.15s, border-color 0.15s;
  display: block;
  background: #05070b;
}

.gallery-thumb:hover {
  opacity: 0.9;
}

.gallery-thumb.active {
  opacity: 1;
  border-color: var(--accent-cyan);
}

.trailer-thumb-btn {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 6px;
  background: rgba(99, 102, 241, 0.18);
  border: 1px solid rgba(99, 102, 241, 0.45);
  color: #e0e7ff;
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  transition: all 0.15s;
}

.trailer-thumb-btn:hover {
  background: rgba(99, 102, 241, 0.32);
}

.detail-cover-header {
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
  margin-bottom: 0.9rem;
}

.detail-cover-img {
  width: 88px;
  aspect-ratio: 3 / 4;
  object-fit: contain;
  background: #05070b;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.rating-breakdown {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  margin: 0.85rem 0;
}

.rating-box {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.8rem;
}

.rating-box-label {
  font-size: 0.72rem;
  color: var(--text-secondary);
}

.rating-box-val {
  font-size: 1.3rem;
  font-weight: 800;
}

.store-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
  margin-top: 0.6rem;
}

.store-btn-large {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.85rem;
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 700;
  transition: all 0.15s;
}

.store-btn-large:hover {
  border-color: var(--accent-cyan);
  background: var(--bg-card-hover);
}

/* Form Elements */
.form-group {
  margin-bottom: 0.9rem;
}

.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 0.3rem;
}

.form-input {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
}

.form-hint {
  font-size: 0.74rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

.toast {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  z-index: 200;
  background: var(--bg-elevated);
  border: 1px solid var(--accent-primary);
  color: var(--text-primary);
  padding: 0.7rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.84rem;
  font-weight: 600;
  box-shadow: var(--shadow-card);
}

.toast.hidden {
  display: none;
}

/* Wide / Full-HD+ Screens (1920px and above): Scale all sizes to ~110% and widen card/panel gaps by ~1.1x */
@media (min-width: 1920px) {
  html {
    font-size: 110%;
  }

  :root {
    --radius-sm: 7px;
    --radius-md: 11px;
    --radius-lg: 15px;
  }

  .header-inner {
    max-width: 2040px;
  }

  .main-container {
    max-width: 2100px;
    padding: 1.15rem 1.4rem 3.8rem;
  }

  /* Panel-to-panel spacing (~1.1x wider) */
  .workspace-layout {
    grid-template-columns: 346px minmax(0, 1fr);
    gap: 1.4rem;
  }

  .filter-sidebar {
    top: 74px;
    max-height: calc(100vh - 90px);
    gap: 0.95rem;
  }

  .sidebar-body {
    gap: 0.95rem;
  }

  .daily-radar {
    gap: 1.15rem;
    margin-bottom: 1.25rem;
  }

  .radar-stats {
    gap: 0.75rem;
  }

  .control-panel {
    gap: 0.8rem;
    margin-bottom: 1.25rem;
  }

  /* Card-to-card spacing (~1.1x wider) */
  .games-grid {
    grid-template-columns: repeat(auto-fill, minmax(324px, 1fr));
    gap: 1.1rem;
  }

  .games-grid.compact-view {
    grid-template-columns: repeat(auto-fill, minmax(450px, 1fr));
    gap: 0.8rem;
  }

  .games-grid.compact-view .card-media {
    width: 126px;
  }

  .pagination-bar {
    margin-top: 1.65rem;
  }

  .page-btn {
    min-width: 35px;
    height: 35px;
  }

  .watchlist-btn {
    width: 31px;
    height: 31px;
    border-radius: 7px;
  }

  .ss-dot {
    width: 7px;
    height: 7px;
  }

  .modal-box {
    max-width: 1144px;
  }

  .modal-close {
    width: 35px;
    height: 35px;
  }

  .gallery-thumbs {
    grid-template-columns: repeat(auto-fill, minmax(106px, 1fr));
  }

  .detail-cover-img {
    width: 97px;
  }
}

/* ==========================================================================
   Site Footer
   ========================================================================== */
.site-footer {
  margin-top: 3.5rem;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  padding: 1.75rem 1.25rem 2.25rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  text-align: center;
}

.site-footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
}

.site-footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.25rem;
}

.site-footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.15s ease;
}

.site-footer-links a:hover {
  color: var(--text-primary);
  text-decoration: underline;
}

.site-footer-credit {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.site-footer-credit a {
  color: var(--text-secondary);
  text-decoration: underline;
}

.site-footer-credit a:hover {
  color: var(--text-primary);
}

.site-footer-copy {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

/* ==========================================================================
   About Page Layout & Typography
   ========================================================================== */
.about-container {
  max-width: 920px;
  margin: 0 auto;
  padding: 2.25rem 1.25rem 4rem;
}

.about-header {
  margin-bottom: 2rem;
  text-align: center;
}

.about-page-title {
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.about-page-desc {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Table of Contents */
.about-toc {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  margin-bottom: 2.5rem;
}

.about-toc-title {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.about-toc-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.about-toc-list a {
  display: inline-block;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  text-decoration: none;
  transition: all 0.15s ease;
}

.about-toc-list a:hover {
  color: var(--text-primary);
  border-color: var(--accent-primary);
  background: var(--bg-card-hover);
}

/* Content Sections */
.about-section {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 2rem 2.25rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-card);
}

.about-section-header {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding-bottom: 0.85rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
}

.about-section-num {
  font-size: 0.8rem;
  font-weight: 800;
  background: var(--accent-primary);
  color: #ffffff;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-sm);
}

.about-section-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.about-section-body {
  color: var(--text-primary);
  font-size: 0.92rem;
  line-height: 1.85;
}

.about-section-body p {
  margin-bottom: 1rem;
}

.about-section-body p:last-child {
  margin-bottom: 0;
}

.about-section-body h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 1.5rem 0 0.5rem;
  padding-left: 0.6rem;
  border-left: 3px solid var(--accent-primary);
}

.about-section-body ul,
.about-section-body ol {
  margin: 0.5rem 0 1rem;
  padding-left: 1.5rem;
}

.about-section-body li {
  margin-bottom: 0.35rem;
}

.about-section-body a {
  color: var(--plat-pc);
  text-decoration: underline;
  word-break: break-all;
}

.about-section-body a:hover {
  filter: brightness(1.15);
}

/* Contact Specific */
.contact-box {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.15rem 1.35rem;
  margin: 1.25rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.contact-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
}

.contact-email {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.95rem;
  color: var(--plat-pc);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  padding: 0.3rem 0.6rem;
  border-radius: var(--radius-sm);
  display: inline-block;
  width: fit-content;
  max-width: 100%;
  word-break: break-all;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.contact-email:hover {
  background: rgba(56, 189, 248, 0.12);
  border-color: var(--plat-pc);
  color: #fff;
}

/* Meta Data Box for Operators / Info */
.info-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
}

.info-table th,
.info-table td {
  padding: 0.65rem 0.85rem;
  text-align: left;
  font-size: 0.88rem;
  border-bottom: 1px solid var(--border-subtle);
}

.info-table th {
  width: 25%;
  color: var(--text-secondary);
  font-weight: 600;
  background: var(--bg-elevated);
}

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

@media (max-width: 768px) {
  .about-container {
    padding: 1.5rem 1rem 3rem;
  }
  .about-section {
    padding: 1.35rem 1.25rem;
  }
  .about-page-title {
    font-size: 1.5rem;
  }
  .info-table th {
    width: 32%;
  }
}
