/* ==========================================================================
   Steam Portal Theme — DESIGN.md implementation
   ========================================================================== */

/* ---------- CSS Custom Properties ----------
   デザイントークン（:root 変数）は css/tokens.css に集約。
   色・タイポ・影・レイアウト寸法の調整はそちらを編集する。 */

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-primary);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.60;
  color: var(--color-text-light);
  background-color: var(--color-deep-dark);
  min-height: 100vh;
}

a {
  color: var(--color-steam-blue);
  text-decoration: none;
}

a:hover {
  color: var(--color-text-white);
}

a:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
  border-radius: 3px;
}

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

/* ---------- Typography ---------- */
h1, .page-title {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.30;
  color: var(--color-text-white);
}

h2, .section-heading {
  font-size: 1.375rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--color-text-white);
}

h3, .card-title {
  font-size: 1.125rem;
  font-weight: 500;
  line-height: 1.40;
  color: var(--color-text-white);
}

h4, .sub-heading {
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.45;
  color: var(--color-text-light);
}

.caption {
  font-size: 0.8125rem;
  font-weight: 400;
  line-height: 1.45;
  color: var(--color-text-muted);
}

.small {
  font-size: 0.75rem;
  font-weight: 400;
  line-height: 1.40;
  color: var(--color-text-muted);
}

.stat-number {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.00;
  letter-spacing: -0.5px;
  color: var(--color-text-white);
}

/* ---------- Top Navigation ---------- */
.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  height: var(--nav-height);
  padding: 0 24px;
  background-color: var(--color-deep-dark);
  border-bottom: 1px solid var(--color-divider);
}

.site-nav__logo {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--color-text-white);
  text-decoration: none;
  margin-right: 32px;
  white-space: nowrap;
}

.site-nav__logo:hover {
  color: var(--color-steam-blue);
}

.site-nav__links {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  flex: 1;
}

.site-nav__link {
  display: block;
  padding: 8px 16px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-light);
  text-decoration: none;
  border-radius: 3px;
  transition: color 0.15s, background-color 0.15s;
}

.site-nav__link:hover {
  color: var(--color-text-white);
  background-color: rgba(255, 255, 255, 0.05);
}

.site-nav__link.is-active {
  color: var(--color-text-white);
  background-color: rgba(255, 255, 255, 0.08);
}

.site-nav__right {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-left: auto;
}
/* 未ログイン時の「Steamでログイン」: 狭幅（390px）でボタン文言を 2 行に折らない */
.site-nav__right > .btn {
  white-space: nowrap;
}

.site-nav__avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

.site-nav__bell {
  position: relative;
  color: var(--color-text-light);
  font-size: 1.125rem;
  text-decoration: none;
  margin-right: 0.5rem;
  display: inline-flex;
  align-items: center;
}

.site-nav__bell:hover {
  color: var(--color-primary);
}

.site-nav__bell-badge {
  position: absolute;
  top: -6px;
  right: -8px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  background: #d94c4c;
  color: #fff;
  border-radius: 9px;
  font-size: 0.625rem;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  box-sizing: border-box;
}

.site-nav__username {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-light);
}

/* Account link (avatar + name) → /mypage. */
.site-nav__account {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

.site-nav__account:hover .site-nav__username {
  color: var(--color-steam-blue);
}

/* ---------- Page Layout ---------- */
.page-wrapper {
  padding-top: var(--nav-height);
  /* Subtract the fixed nav so this doesn't stack with body's own
     min-height:100vh. Stacking two 100vh boxes overflowed by the admin
     toolbar's body offset, showing a phantom vertical scrollbar (admin only).
     body keeps min-height:100vh to fill the background on short pages. */
  min-height: calc(100vh - var(--nav-height));
}

.page-content {
  max-width: var(--content-max-width);
  margin: 0 auto;
  padding: 32px 24px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 24px;
  font-family: var(--font-primary);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s, transform 0.1s;
}

.btn:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
}

.btn--primary {
  background-color: var(--color-steam-blue-bright);
  color: var(--color-text-white);
}

.btn--primary:hover {
  background-color: #47b2ff;
  color: var(--color-text-white);
}

.btn--primary:active {
  background-color: #1590e6;
}

.btn--secondary {
  background-color: rgba(255, 255, 255, 0.1);
  color: var(--color-text-light);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.btn--secondary:hover {
  background-color: rgba(255, 255, 255, 0.15);
  color: var(--color-text-white);
}

.btn--secondary.is-active {
  background-color: var(--color-steam-blue);
  color: var(--color-text-white);
  border-color: var(--color-steam-blue);
}

.btn--ghost {
  background-color: transparent;
  color: var(--color-steam-blue);
  padding: 8px 16px;
}

.btn--ghost:hover {
  background-color: rgba(102, 192, 244, 0.1);
  color: var(--color-steam-blue);
}

/* Destructive actions (withdrawal). Outlined rather than filled so it
   never reads as the primary action on a page. */
.btn--danger {
  background-color: transparent;
  color: var(--color-alert);
  border: 1px solid var(--color-alert-border);
}

.btn--danger:hover {
  background-color: var(--color-alert-tint);
  border-color: var(--color-alert);
}

.btn--large {
  padding: 14px 32px;
  font-size: 1rem;
  font-weight: 700;
}

.btn--steam {
  background-color: var(--color-steam-blue-bright);
  color: var(--color-text-white);
  padding: 14px 32px;
  font-size: 1rem;
  font-weight: 700;
}

.btn--steam:hover {
  background-color: #47b2ff;
  color: var(--color-text-white);
}

/* ---------- Cards ---------- */
.stat-card {
  background-color: var(--color-blue-gray);
  border-radius: 6px;
  padding: 20px;
}

.stat-card--link {
  display: block;
  text-decoration: none;
  border: 1px solid transparent;
  transition: border-color 0.15s, background-color 0.15s;
}

.stat-card--link:hover {
  border-color: var(--color-steam-blue);
  background-color: var(--color-card-hover);
}

.stat-card__value {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.5px;
  color: var(--color-text-white);
  margin-bottom: 4px;
}

.stat-card__label {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--color-text-muted);
}

.content-card {
  background-color: var(--color-dark-blue);
  border-radius: 4px;
  padding: 24px;
}

.content-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.content-card__title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-text-white);
}

/* ---------- Tag Buttons ---------- */
.tag {
  display: inline-block;
  padding: 4px 10px;
  font-size: 0.6875rem;
  font-weight: 700;
  line-height: 1;
  border-radius: 3px;
}

/* ---------- Dashboard ---------- */
.dashboard__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
}

.dashboard__welcome {
  display: flex;
  align-items: center;
  gap: 16px;
}

.dashboard__avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  background-color: var(--color-blue-gray);
}

.dashboard__greeting {
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--color-text-white);
  margin-bottom: 4px;
}

.dashboard__meta {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}

.dashboard__stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.dashboard__section {
  margin-bottom: 32px;
}

.dashboard__section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.dashboard__section-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--color-text-white);
}

.dashboard__empty {
  background-color: var(--color-dark-blue);
  border-radius: 4px;
  padding: 40px;
  text-align: center;
  color: var(--color-text-muted);
}

.dashboard__onboarding {
  background-color: var(--color-dark-blue);
  border-radius: 6px;
  padding: 40px;
  text-align: center;
  margin-top: 24px;
}

.dashboard__onboarding-message {
  font-size: 1.125rem;
  color: var(--color-text-light);
  margin-bottom: 24px;
}

.dashboard__privacy-notice {
  background-color: var(--color-deep-dark);
  border-radius: 4px;
  padding: 20px 24px;
  text-align: left;
  display: inline-block;
  max-width: 520px;
}

.dashboard__privacy-notice p {
  color: var(--color-text-light);
  font-size: 0.875rem;
  margin: 0 0 8px;
}

.dashboard__privacy-detail {
  color: var(--color-text-muted) !important;
  font-size: 0.8125rem !important;
}

.dashboard__privacy-notice .btn--ghost {
  margin-top: 12px;
}

/* ---------- Messages (Drupal) ---------- */
.messages {
  max-width: var(--content-max-width);
  margin: 16px auto;
  padding: 12px 24px;
  border-radius: 4px;
  font-size: 0.875rem;
}

.messages--error {
  background-color: rgba(222, 60, 60, 0.15);
  color: var(--color-alert);
  border-left: 3px solid var(--color-alert);
}

.messages--status {
  background-color: rgba(164, 208, 7, 0.15);
  color: var(--color-price-drop);
  border-left: 3px solid var(--color-price-drop);
}

.messages--warning {
  background-color: rgba(232, 162, 58, 0.15);
  color: var(--color-warning);
  border-left: 3px solid var(--color-warning);
}

/* ---------- Game Cards ---------- */
.game-card-scroll {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: thin;
  scrollbar-color: var(--color-blue-gray) transparent;
}

.game-card-scroll::-webkit-scrollbar {
  height: 6px;
}

.game-card-scroll::-webkit-scrollbar-thumb {
  background: var(--color-blue-gray);
  border-radius: 3px;
}

.game-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

/* Skip rendering cards that are scrolled out of view.
 *
 * A library/wishlist page renders every row of the current page at once — 51
 * cards on a full page, of which ~45 start off-screen. Each card is a
 * translucent panel with a shadow, a gradient top line and a clipped thumbnail,
 * so painting the ones nobody can see is pure cost, and it is paid again on
 * every scroll. `content-visibility: auto` lets the browser skip their layout
 * and paint until they approach the viewport.
 *
 * `contain-intrinsic-size: auto <height>` reserves a placeholder box so the
 * scrollbar stays honest, and the `auto` keyword makes the browser remember
 * each card's real height once it has been rendered. The 368px figure is the
 * measured height of a library card at desktop widths (they range 344–369px).
 *
 * Scoped to the grid on purpose: the dashboard's horizontal `.game-card-scroll`
 * row must keep its cards laid out for the scroller to size itself.
 */
.game-card-grid > .game-card {
  content-visibility: auto;
  contain-intrinsic-size: auto 368px;
}

/* カタログのおすすめ順: 先頭ブロックと以降の境目ラベル。グリッドの 1 行を
   丸ごと使い、サイドバーの区切り（.sidebar__filter-divider）と同じ見た目にする。 */
.game-card-grid__divider {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 4px 0 -4px;
  font-size: 0.75rem;
  color: var(--color-text-dark-muted);
  letter-spacing: 0.5px;
}

.game-card-grid__divider::before,
.game-card-grid__divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background-color: var(--color-divider);
}

/* おすすめ順の「準備中」注記。計算枠が空くのを待つ間、骸骨グリッドの上に出す。
   30 秒待ってレビュー数順に切り替えたときの注記も同じ見た目。 */
.game-card-grid__pending {
  margin: 0 0 12px;
  font-size: 0.8rem;
  color: var(--color-text-dark-muted);
}

/* おすすめ順の遅延読み込み中に出すカードの骸骨（catalog-lazy-grid.js が差し替える）。
   パルスはダッシュボードの .recommendation-card--skeleton と共通の keyframes。 */
.game-card--skeleton {
  pointer-events: none;
  padding: 12px;
  min-height: 300px;
}

.game-card__image-skeleton {
  aspect-ratio: 460 / 215;
  border-radius: 4px;
  background-color: var(--color-blue-gray);
  margin-bottom: 14px;
  animation: skeleton-pulse 1.4s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  .game-card__image-skeleton {
    animation: none;
  }
}

.game-card {
  display: block;
  background-color: var(--color-dark-blue);
  border-radius: 4px;
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s, box-shadow 0.15s;
  min-width: 220px;
  position: relative;
}

.game-card__image {
  border-radius: 4px 4px 0 0;
}

.game-card-scroll .game-card {
  min-width: 220px;
  max-width: 240px;
  flex-shrink: 0;
}

.game-card:hover {
  box-shadow: var(--shadow-elevated);
  color: inherit;
}

.game-card__image {
  width: 100%;
  aspect-ratio: 460 / 215;
  object-fit: cover;
  display: block;
}

/* サムネの遅着フェードイン。image-fallback.js が未ロードの <img> に
   .game-thumb--pending を付け、load で外す。opacity だけなのでスクロール中の
   合成コストは無い。JS 無しではクラスが付かないので隠れたままにはならない。 */
.js-game-thumb {
  transition: opacity 0.15s ease-out;
}

.js-game-thumb.game-thumb--pending {
  opacity: 0;
}

@media (prefers-reduced-motion: reduce) {
  .js-game-thumb {
    transition: none;
  }
}

.game-card__image--placeholder {
  background-color: var(--color-deep-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-dark-muted);
  font-size: 2rem;
}

.game-card--hidden {
  opacity: 0.6;
}

.game-card--hidden:hover {
  opacity: 0.85;
}

.game-card__mature-label {
  font-size: 0.6875rem;
  color: var(--color-text-dark-muted);
  min-width: 0;
  flex: 0 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.game-card__body {
  padding: 12px;
}

.game-card__title {
  display: block;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--color-text-white);
  text-decoration: none;
  margin-bottom: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

a.game-card__title:hover {
  color: var(--color-steam-blue);
}

.game-card__meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.game-card__playtime {
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.game-card__playtime-recent {
  display: inline-block;
  background-color: rgba(102, 192, 244, 0.15);
  color: var(--color-steam-blue);
  font-size: 0.6875rem;
  font-weight: 700;
  padding: 4px 8px;
  line-height: 1;
  border-radius: 3px;
  margin-left: auto;
}

.game-card__reason {
  font-size: 0.75rem;
  color: var(--color-steam-blue);
  margin-bottom: 8px;
}

.game-card__price {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--color-text-white);
}

.game-card__price--free {
  color: var(--color-playing);
}

.game-card__price--unreleased,
.game-card__price--store-hidden {
  color: var(--color-text-muted);
  font-weight: 500;
  font-size: 0.75rem;
}

.game-card__review {
  font-size: 0.6875rem;
  color: var(--color-steam-blue);
}
/* Colour the review label by tier so 不評 / 賛否両論 / 好評 are distinguishable.
   Boundaries match the catalog review buckets. Colours live in
   tokens.css (--color-review-*) and are shared with the detail page. */
.game-card__review--positive {
  color: var(--color-review-positive);
}
.game-card__review--mixed {
  color: var(--color-review-mixed);
}
.game-card__review--negative {
  color: var(--color-review-negative);
}
.game-card__review--none {
  color: var(--color-review-none);
}
/* The label itself links to the Steam review hub. The tier
   colour lives on the parent modifier, so the anchor inherits it instead of
   carrying the tier class — that keeps the specificity fix for the detail page's
   `dd` intact. `color` must be repeated on hover: the global `a:hover` is (0,1,1)
   and would beat a bare modifier class (0,1,0), so only the descendant pair
   (0,2,1) keeps the tier colour while hovering. Underline is the only hover
   affordance — site links are undecorated by default. */
.game-card__review a {
  color: inherit;
}
.game-card__review a:hover {
  color: inherit;
  text-decoration: underline;
}

/* Pricing (sale) */
.game-card__pricing {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Catalog cards put the Steam store link in the price row, right-aligned.
   Wrap so the badge drops to its own line when a sale price fills the row. */
.game-card__pricing--catalog {
  flex-wrap: wrap;
}

/* Combine both classes so this beats .btn--small (same specificity, later in
   the file) and the compact sizing actually applies. */
.game-card__store-link.btn--small {
  margin-left: auto;
  /* Keep the badge on the sale row's single line: tighter than .btn--small.
     Horizontal padding is trimmed; vertical kept roomier to avoid a cramped look. */
  padding: 5px 8px;
  font-size: 0.6875rem;
}

.game-card__discount {
  display: inline-block;
  background-color: var(--color-price-drop);
  color: var(--color-deep-dark);
  font-size: 0.875rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 2px;
}

.game-card__original-price {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  text-decoration: line-through;
}

.game-card__sale-price {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-price-drop);
}

/* ---------- Status Tags ---------- */
.tag--playing {
  background-color: rgba(164, 208, 7, 0.15);
  color: var(--color-playing);
}

.tag--cleared {
  background-color: rgba(102, 192, 244, 0.15);
  color: var(--color-cleared);
}

.tag--next {
  background-color: rgba(232, 162, 58, 0.15);
  color: var(--color-next);
}

.tag--paused {
  background-color: rgba(184, 160, 116, 0.15);
  color: var(--color-paused);
}

.tag--unplayed {
  background-color: rgba(143, 152, 160, 0.15);
  color: var(--color-unplayed);
}

.tag--barely_played {
  background-color: rgba(111, 157, 134, 0.15);
  color: var(--color-barely-played);
}

.tag--endless {
  background-color: rgba(155, 89, 182, 0.15);
  color: var(--color-endless);
}

.tag--dropped {
  background-color: rgba(195, 92, 44, 0.15);
  color: var(--color-dropped);
}

/* ---------- Notification Cards ---------- */
.notification-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.notification-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background-color: var(--color-dark-blue);
  border-radius: 4px;
  padding: 16px;
  /* Per-category accent color; each .notification-card--<category> sets it. */
  --notif-color: var(--color-text-muted);
  border-left: 3px solid var(--notif-color);
}

/* Distinct hue per notification category so the type reads at a glance
   (design MTG: 種類が直感的にわかるアイコン・ラベル・色設計). */
.notification-card--sale     { --notif-color: var(--color-sale); }
.notification-card--japanese { --notif-color: var(--color-jp); }
.notification-card--release  { --notif-color: var(--color-update); }
.notification-card--deck     { --notif-color: var(--color-endless); }
.notification-card--review   { --notif-color: var(--color-sub); }
.notification-card--system   { --notif-color: var(--color-alert); }

.notification-card__icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background-color: color-mix(in srgb, var(--notif-color) 16%, transparent);
  font-size: 0.8125rem;
  color: var(--notif-color);
}

/* Category label pill, shown above the notification title. */
.notification-card__label {
  display: inline-block;
  margin-bottom: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 700;
  line-height: 1.4;
  color: var(--notif-color);
  background-color: color-mix(in srgb, var(--notif-color) 16%, transparent);
}

.notification-card__content {
  flex: 1;
  min-width: 0;
}

.notification-card__title {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--color-text-white);
  margin-bottom: 4px;
}

.notification-card__body {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}

.notification-card__time {
  flex-shrink: 0;
  font-size: 0.75rem;
  color: var(--color-text-dark-muted);
}

.notification-card__meta {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.notification-card__favorite {
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  color: var(--color-text-dark-muted);
  font-size: 0.9375rem;
  line-height: 1;
  transition: color 0.15s ease, transform 0.1s ease;
}

.notification-card__favorite:hover {
  color: var(--color-warning);
}

.notification-card__favorite:active {
  transform: scale(0.92);
}

.notification-card__favorite.is-favorited {
  color: var(--color-warning);
}

/* Dashboard preview reuses .notification-card; clicks anywhere on the
 * card mark it read (handled by notification-dashboard.js). */
.notification-list--dashboard .notification-card {
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.notification-list--dashboard .notification-card:hover {
  background-color: rgba(255, 255, 255, 0.04);
}

/* ---------- Sidebar Layout ---------- */
.page-layout--sidebar {
  display: flex;
  max-width: calc(var(--content-max-width) + var(--sidebar-width) + 24px);
  margin: 0 auto;
  padding-top: 0;
}

.page-layout--sidebar .page-content {
  flex: 1;
  min-width: 0;
}

.sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  padding: 32px 16px 32px 24px;
  border-right: 1px solid var(--color-divider);
}

.sidebar__section {
  margin-bottom: 24px;
}

.sidebar__title {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

.sidebar__filter-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.filter-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8125rem;
  color: var(--color-text-light);
  cursor: pointer;
}

.filter-checkbox input[type="checkbox"] {
  accent-color: var(--color-steam-blue);
}

.filter-checkbox .tag {
  min-width: 95px;
  text-align: left;
}

.filter-checkbox__count {
  margin-left: auto;
  font-size: 0.6875rem;
  color: var(--color-text-dark-muted);
  min-width: 48px;
  text-align: right;
}

.filter-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8125rem;
  color: var(--color-text-light);
  cursor: pointer;
}

.filter-toggle input[type="checkbox"] {
  accent-color: var(--color-steam-blue);
}

.filter-toggle .filter-checkbox__count {
  margin-left: auto;
  font-size: 0.6875rem;
  color: var(--color-text-dark-muted);
}

.filter-radio {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8125rem;
  color: var(--color-text-light);
  cursor: pointer;
}

.filter-radio input[type="radio"] {
  accent-color: var(--color-steam-blue);
}

.sidebar__sub-section {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--color-divider);
}

.sidebar__sub-title {
  display: block;
  font-size: 0.6875rem;
  color: var(--color-text-muted);
  margin-bottom: 6px;
}

/* Active filters bar */
.active-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 12px 0;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--color-divider);
}

.active-filters__label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--color-text-muted);
  margin-right: 4px;
}

.active-filters__tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  font-size: 0.6875rem;
  font-weight: 500;
  border-radius: 3px;
  text-decoration: none;
  cursor: pointer;
  transition: filter 0.15s;
}

.active-filters__tag:hover {
  filter: brightness(1.3);
}

.active-filters__tag--steam {
  background-color: rgba(255, 255, 255, 0.06);
  color: var(--color-text-muted);
}

.active-filters__tag--feature {
  background-color: rgba(102, 192, 244, 0.15);
  color: var(--color-steam-blue);
}

.active-filters__tag--custom {
  background-color: rgba(102, 192, 244, 0.12);
  color: var(--color-steam-blue);
}

.active-filters__tag--search {
  background-color: rgba(255, 255, 255, 0.08);
  color: var(--color-text-light);
}

.active-filters__tag--steam-exclude {
  background-color: rgba(239, 68, 68, 0.15);
  color: #f87171;
  text-decoration: line-through;
  text-decoration-color: rgba(248, 113, 113, 0.5);
  text-decoration-thickness: 1px;
}

.active-filters__tag--steam-exclude i {
  text-decoration: none;
}

/* Sidebar exclude toggle button (🚫) */
.tag-exclude {
  background: transparent;
  border: none;
  padding: 2px 3px;
  border-radius: 3px;
  color: var(--color-text-dark-muted);
  cursor: pointer;
  opacity: 0.35;
  font-size: 0.7rem;
  line-height: 1;
  transition: opacity 0.15s, color 0.15s, background-color 0.15s;
}

.tag-exclude:hover {
  opacity: 0.9;
  color: #f87171;
  background-color: rgba(239, 68, 68, 0.1);
}

.tag-exclude.is-active {
  opacity: 1;
  color: #f87171;
  background-color: rgba(239, 68, 68, 0.15);
}

.filter-checkbox__label {
  flex: 0 1 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Steam tag row: push 🚫 button + count to the right edge as a group.
   Tighten overall row spacing so 9-char Japanese labels like
   "シングルプレイヤー" fit without truncation. */
.js-tag-item .filter-checkbox {
  gap: 6px;
}
.js-tag-item .tag-exclude {
  margin-left: auto;
  margin-right: -4px;
}
.js-tag-item .filter-checkbox__count {
  margin-left: 0;
  min-width: 42px;
}

.js-tag-item.is-excluded .filter-checkbox__label {
  color: var(--color-text-dark-muted);
  text-decoration: line-through;
  text-decoration-color: rgba(248, 113, 113, 0.4);
}

/* Push count back to the right in rows with exclude button (which is before count). */
.js-tag-item .filter-checkbox {
  width: 100%;
}

/* When search is active, excluded-but-not-matching tags are pinned to bottom. */
.js-tag-item.is-pinned {
  order: 2;
}

.sidebar__filter-divider {
  order: 1;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0 2px;
  font-size: 0.6875rem;
  color: var(--color-text-dark-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Respect the `hidden` attribute toggled by JS when no pinned items exist.
   Needs higher specificity than `.sidebar__filter-divider { display: flex }`. */
.sidebar__filter-divider[hidden] {
  display: none;
}

.sidebar__filter-divider::before,
.sidebar__filter-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background-color: var(--color-divider);
}

.active-filters__remove {
  font-size: 0.8125rem;
  line-height: 1;
  opacity: 0.6;
}

.active-filters__tag:hover .active-filters__remove {
  opacity: 1;
}

.active-filters__clear {
  font-size: 0.6875rem;
  color: var(--color-text-dark-muted);
  text-decoration: none;
  margin-left: auto;
}

.active-filters__clear:hover {
  color: var(--color-steam-blue);
}

.sidebar__filter-list--scrollable {
  max-height: 500px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--color-blue-gray) transparent;
}

.sidebar__filter-list--scrollable::-webkit-scrollbar {
  width: 5px;
}

.sidebar__filter-list--scrollable::-webkit-scrollbar-thumb {
  background: var(--color-blue-gray);
  border-radius: 3px;
}

.sidebar__filter-list--scrollable::-webkit-scrollbar-thumb:hover {
  background: var(--color-text-muted);
}

.sidebar__search {
  width: 100%;
  padding: 6px 10px;
  background-color: var(--color-dark-blue);
  border: 1px solid var(--color-border-subtle);
  border-radius: 3px;
  color: var(--color-text-light);
  font-size: 0.8125rem;
  font-family: var(--font-primary);
  margin-bottom: 10px;
}

.sidebar__search::placeholder {
  color: var(--color-text-dark-muted);
}

.sidebar__range {
  width: 100%;
  accent-color: var(--color-steam-blue);
}

.sidebar__range-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.6875rem;
  color: var(--color-text-dark-muted);
  margin-top: 4px;
}

/* ---------- Page Header ---------- */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
}

.page-header__left {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.page-header__title {
  font-size: 1.3125rem;
  font-weight: 700;
  color: var(--color-text-white);
  white-space: nowrap;
}

.page-header__count {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}

.page-header__badge {
  font-size: 0.6875rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 10px;
}

.badge--sale {
  background-color: rgba(164, 208, 7, 0.15);
  color: var(--color-price-drop);
}

a.badge--sale,
button.badge--sale {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: background-color 120ms ease, color 120ms ease;
}

a.badge--sale:hover {
  background-color: rgba(164, 208, 7, 0.25);
}

.badge--sale.is-active {
  background-color: var(--color-price-drop);
  color: var(--color-deep-dark);
}

.badge--sale.is-active:hover {
  background-color: #b6e314;
}

.badge--unread {
  background-color: rgba(102, 192, 244, 0.15);
  color: var(--color-steam-blue);
}

.page-header__right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.page-header__group {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Delivery-channel badges next to the notifications header (links to hub). */
.channel-badges {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

.channel-badges__item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid transparent;
  white-space: nowrap;
}

.channel-badges__item--on {
  background-color: rgba(64, 168, 100, 0.15);
  color: #7ec98f;
  border-color: rgba(64, 168, 100, 0.3);
}

.channel-badges__item--off {
  background-color: rgba(138, 155, 177, 0.12);
  color: var(--color-text-muted);
  border-color: var(--color-border-subtle);
}

.channel-badges__state {
  opacity: 0.85;
  font-weight: 400;
}

.channel-badges:hover .channel-badges__item--off {
  color: var(--color-text-light);
  border-color: rgba(255, 255, 255, 0.2);
}

.channel-badges:hover .channel-badges__item--on {
  border-color: rgba(64, 168, 100, 0.5);
}

.page-header__group--actions {
  position: relative;
  padding-left: 12px;
}

.page-header__group--actions::before {
  content: "";
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 1px;
  background-color: var(--color-border-subtle);
}

/* Tighten the action group's secondary button (sync) inside the header so the
   right side fits at ~1280px even with 5-digit counts like
   "10,000 / 10,000 タイトル". */
.page-header__group--actions .btn--secondary,
.page-header__group--actions .js-sync-trigger {
  padding: 8px 14px;
  font-size: 0.8125rem;
  white-space: nowrap;
}

.page-header__bulk-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background-color: transparent;
  color: var(--color-text-light);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 3px;
  font-size: 0.8125rem;
  font-weight: 500;
  font-family: var(--font-primary);
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
}

.page-header__bulk-toggle:hover:not(:disabled) {
  background-color: rgba(102, 192, 244, 0.1);
  color: var(--color-text-white);
  border-color: rgba(102, 192, 244, 0.4);
}

.page-header__bulk-toggle.is-active {
  background-color: var(--color-steam-blue-bright);
  color: var(--color-text-white);
  border-color: var(--color-steam-blue-bright);
}

.page-header__bulk-toggle.is-active:hover {
  background-color: #47b2ff;
  border-color: #47b2ff;
}

.page-header__bulk-toggle:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.page-header__bulk-count {
  font-weight: 700;
  margin: 0 2px;
}

@media (max-width: 1024px) {
  .page-header__right {
    gap: 12px;
  }

  .page-header__group--actions {
    padding-left: 12px;
  }
}

@media (max-width: 768px) {
  .page-header__group--actions {
    padding-left: 0;
  }

  .page-header__group--actions::before {
    display: none;
  }
}

.page-header__search {
  padding: 8px 12px;
  background-color: var(--color-dark-blue);
  border: 1px solid var(--color-border-subtle);
  border-radius: 3px;
  color: var(--color-text-light);
  font-size: 0.8125rem;
  font-family: var(--font-primary);
  width: 144px;
}

.page-header__search::placeholder {
  color: var(--color-text-dark-muted);
}

/* Search box + submit icon, joined into one control. Enter in the field also
   submits; the icon button is the explicit click target. */
.page-header__search-wrap {
  display: flex;
  align-items: stretch;
}

.page-header__search-wrap .page-header__search {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  border-right: none;
}

.page-header__search-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  background-color: var(--color-dark-blue);
  border: 1px solid var(--color-border-subtle);
  border-radius: 0 3px 3px 0;
  color: var(--color-text-dark-muted);
  font-size: 0.8125rem;
  cursor: pointer;
}

.page-header__search-btn:hover {
  color: var(--color-text-light);
}

.page-header__sort {
  padding: 8px 12px;
  background-color: var(--color-dark-blue);
  border: 1px solid var(--color-border-subtle);
  border-radius: 3px;
  color: var(--color-text-light);
  font-size: 0.8125rem;
  font-family: var(--font-primary);
}

/* Sort direction toggle (↓/↑), rendered next to the sort select. */
.page-header__sort-dir {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  padding: 8px 10px;
  background-color: var(--color-dark-blue);
  border: 1px solid var(--color-border-subtle);
  border-radius: 3px;
  color: var(--color-text-muted);
  font-size: 0.8125rem;
  cursor: pointer;
}

.page-header__sort-dir:hover {
  background-color: var(--color-blue-gray);
  color: var(--color-steam-blue);
}

.page-header__filter-btn {
  padding: 7px 10px;
  background-color: var(--color-dark-blue);
  border: 1px solid var(--color-border-subtle);
  border-radius: 3px;
  color: var(--color-text-light);
  font-size: 0.8125rem;
  font-family: var(--font-primary);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.page-header__filter-btn:hover {
  background-color: var(--color-blue-gray);
  color: var(--color-text-white);
}

.page-header__filter-btn.is-active {
  background-color: var(--color-steam-blue);
  color: var(--color-text-white);
  border-color: var(--color-steam-blue);
}

/* ---------- Ownership Badges ---------- */
/* 基底 game-card.html.twig は画像リンクに __image-link を使う。カタログ変種は
   そこに所持/Wishlist バッジ（position:absolute）を重ねるためアンカーが必要。 */
.game-card__image-wrap,
.game-card__image-link {
  display: block;
  position: relative;
}

/* カード画像上のバッジ行。所持・日本語化MOD・成人向けMOD が同じ角に重なって
   隠れないよう 1 本の flex 行に並べ、3 つ入らない幅（180px 列）では折り返す。 */
.game-card__badges {
  position: absolute;
  top: 8px;
  left: 8px;
  right: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.game-card__badges:empty {
  display: none;
}

.game-card__badge {
  font-size: 0.625rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 2px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.game-card__badge--owned {
  background-color: rgba(164, 208, 7, 0.9);
  color: var(--color-deep-dark);
}

.game-card__badge--wishlist {
  background-color: rgba(102, 192, 244, 0.9);
  color: var(--color-deep-dark);
}

/* ストアで表示されていない作品。情報バッジなので無彩色にして、所持／日本語化
   MOD／成人向けパッチの色付きバッジより目立たせない。 */
.game-card__badge--store-hidden {
  background-color: rgba(60, 68, 80, 0.9);
  color: var(--color-text-muted);
}

/* ---------- Tag Dropdown ---------- */
.tag-dropdown {
  position: relative;
  display: inline-block;
}

.tag--interactive {
  cursor: pointer;
  border: none;
  font-family: var(--font-primary);
  transition: filter 0.15s;
}

.tag--interactive:hover {
  filter: brightness(1.2);
}

.tag__caret {
  font-size: 0.5rem;
  margin-left: 2px;
  vertical-align: middle;
}

.tag-dropdown__menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 50;
  margin-top: 4px;
  padding: 4px 0;
  background-color: var(--color-deep-dark);
  border: 1px solid var(--color-border-subtle);
  border-radius: 4px;
  box-shadow: var(--shadow-elevated);
  list-style: none;
  min-width: 120px;
}

.tag-dropdown__menu.is-open {
  display: block;
}

/* Bring card to front when its dropdown is open, and let the menu escape the
 * card's box.
 *
 * The menu is `position: absolute; top: 100%`, so it hangs below the card's
 * bottom edge. That is fine until the card is paint-contained: the grid's
 * `content-visibility: auto` (see .game-card-grid > .game-card) implies
 * `contain: layout style paint`, and paint containment CLIPS descendants at the
 * border box — the menu was cut off mid-list. Raising z-index does not help,
 * because clipping is not a stacking question.
 *
 * `content-visibility: visible` drops the containment, but only for the one
 * card that currently has a menu open, so the other ~50 cards keep the
 * scroll-performance win. The card is on screen and already rendered at this
 * point, and its size is unchanged, so nothing reflows visibly.
 *
 * Both selectors are kept: `:has()` covers CSS-only, and `.dropdown-open` is
 * set by JS (app.js / status-change.js / wishlist-tag-change.js).
 */
.game-card:has(.tag-dropdown__menu.is-open),
.game-card.dropdown-open {
  z-index: 40;
  content-visibility: visible;
}

.tag-dropdown__menu li {
  padding: 4px 8px;
  cursor: pointer;
}

.tag-dropdown__menu li:hover {
  background-color: rgba(255, 255, 255, 0.05);
}

.tag-dropdown__menu .tag {
  width: 100%;
  text-align: left;
  display: block;
}

/* ---------- Custom Tags ---------- */
.game-card__custom-tags {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
}

.game-card__custom-tags-list {
  display: flex;
  flex-wrap: nowrap;
  gap: 4px;
  overflow: hidden;
  flex: 1;
  min-width: 0;
}

.custom-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  font-size: 0.6875rem;
  font-weight: 500;
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex-shrink: 0;
  font-family: var(--font-primary);
  border-radius: 10px;
  background-color: rgba(102, 192, 244, 0.12);
  color: var(--color-steam-blue);
  border: 1px solid rgba(102, 192, 244, 0.2);
}

.custom-tag__remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  font-size: 0.625rem;
  line-height: 1;
  border: none;
  background: none;
  color: var(--color-steam-blue);
  opacity: 0.5;
  cursor: pointer;
  padding: 0;
  border-radius: 50%;
  transition: opacity 0.15s, background-color 0.15s;
}

.custom-tag__remove:hover {
  opacity: 1;
  background-color: rgba(102, 192, 244, 0.2);
}

a.custom-tag {
  text-decoration: none;
  transition: filter 0.15s;
}

a.custom-tag:hover {
  filter: brightness(1.3);
  color: var(--color-steam-blue);
}

.custom-tag--add {
  background-color: transparent;
  border: 1px dashed var(--color-text-dark-muted);
  color: var(--color-text-dark-muted);
  cursor: pointer;
  padding: 2px 10px;
  font-size: 0.75rem;
  transition: border-color 0.15s, color 0.15s;
}

.custom-tag--add:hover {
  border-color: var(--color-steam-blue);
  color: var(--color-steam-blue);
}

/* ---------- Card Actions row ---------- */
.game-card__actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  row-gap: 4px;
  margin-bottom: 4px;
}

/* Library card Play button — launches the Steam client. Intentionally small and
   clearly a button, distinct from the title heading. */
.game-card__play-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
  color: var(--color-text-white);
  background-color: var(--color-steam-green);
  border-radius: 3px;
  text-decoration: none;
  white-space: nowrap;
  margin-left: auto; /* pin to the right end of the actions row */
}

.game-card__play-btn:hover {
  background-color: var(--color-steam-green-hover);
}

/* In the library actions row the Play button owns the right end, so keep recent
   playtime next to total playtime instead of pushing it right. (Dashboard uses
   .game-card__meta and is unaffected.) */
.game-card__actions .game-card__playtime-recent {
  margin-left: 0;
}

.game-card__play-btn .fa-play {
  font-size: 0.6875rem;
}

.game-card__sale-type {
  display: inline-block;
  background-color: rgba(164, 208, 7, 0.15);
  color: var(--color-price-drop);
  font-size: 0.6875rem;
  font-weight: 700;
  padding: 4px 8px;
  line-height: 1;
  border-radius: 3px;
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-left: auto;
}

.game-card__sale-end {
  display: inline-block;
  background-color: var(--color-price-drop);
  color: var(--color-deep-dark);
  font-size: 0.6875rem;
  font-weight: 700;
  padding: 4px 8px;
  line-height: 1;
  border-radius: 3px;
}

.game-card__card-actions {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--color-divider);
}

/* ---------- Game Card extras ---------- */
.game-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 8px;
}

.game-card__tag {
  font-size: 0.625rem;
  padding: 2px 6px;
  border-radius: 2px;
  background-color: rgba(255, 255, 255, 0.06);
  color: var(--color-text-muted);
  text-decoration: none;
  transition: background-color 0.15s, color 0.15s;
}

.game-card__tag:hover {
  background-color: rgba(102, 192, 244, 0.15);
  color: var(--color-steam-blue);
}

.game-card__target {
  font-size: 0.6875rem;
  color: var(--color-text-dark-muted);
  margin-top: 6px;
}

.game-card__meta + .game-card__pricing {
  margin-top: 8px;
}

.game-card__title-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 8px;
}

.game-card__title-row .game-card__title {
  flex: 1;
  min-width: 0;
  margin-bottom: 0;
}

.game-card__title-row .game-card__review {
  flex-shrink: 0;
  font-size: 0.6875rem;
}

.game-card__price-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.game-card__price-row .game-card__target {
  margin-left: auto;
  margin-top: 0;
  font-size: 0.75rem;
  font-weight: 500;
  font-family: var(--font-primary);
  color: var(--color-text-muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 3px;
  transition: background-color 0.15s, color 0.15s;
}

.game-card__price-row .game-card__target--edit:hover {
  background-color: rgba(255, 255, 255, 0.06);
  color: var(--color-text-light);
}

.game-card__price-row .game-card__target--set {
  color: var(--color-text-dark-muted);
  border: 1px dashed var(--color-text-dark-muted);
}

.game-card__price-row .game-card__target--set:hover {
  border-color: var(--color-steam-blue);
  color: var(--color-steam-blue);
}

.game-card__price-row .game-card__target--reached {
  color: var(--color-price-drop);
  font-weight: 700;
}

.game-card__price-row .game-card__target--reached:hover {
  background-color: rgba(164, 208, 7, 0.1);
}

/* ---------- Wishlist Tags ---------- */
.tag--wl-must {
  background-color: rgba(222, 60, 60, 0.15);
  color: var(--color-must);
}

.tag--wl-sale {
  background-color: rgba(164, 208, 7, 0.15);
  color: var(--color-sale);
}

.tag--wl-japanese {
  background-color: rgba(102, 192, 244, 0.15);
  color: var(--color-jp);
}

.tag--wl-subscription {
  background-color: rgba(46, 204, 113, 0.15);
  color: var(--color-sub);
}

.tag--wl-update {
  background-color: rgba(232, 162, 58, 0.15);
  color: var(--color-update);
}

.tag--wl-none {
  background-color: rgba(143, 152, 160, 0.1);
  color: var(--color-text-dark-muted);
}

/* ---------- Filter Tabs ---------- */
.filter-tabs-row {
  display: flex;
  align-items: stretch;
  gap: 16px;
  border-bottom: 1px solid var(--color-divider);
  margin-bottom: 24px;
}

.filter-tabs-row .filter-tabs {
  border-bottom: none;
  margin-bottom: 0;
  flex: 1;
  min-width: 0;
}

.filter-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--color-divider);
  margin-bottom: 24px;
  overflow-x: auto;
}

.filter-tabs__favorite {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  font-size: 0.875rem;
  font-weight: 500;
  font-family: var(--font-primary);
  color: var(--color-text-muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.15s;
}

.filter-tabs__favorite:hover:not([disabled]) {
  color: var(--color-text-white);
}

.filter-tabs__favorite.is-active {
  color: var(--color-warning);
  border-bottom-color: var(--color-warning);
}

.filter-tabs__favorite[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
}

.filter-tabs__favorite .fa-star {
  font-size: 0.8125rem;
}

.filter-tabs__item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  font-size: 0.875rem;
  font-weight: 500;
  font-family: var(--font-primary);
  color: var(--color-text-muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.15s;
}

.filter-tabs__item:hover {
  color: var(--color-text-white);
}

.filter-tabs__item.is-active {
  color: var(--color-text-white);
  border-bottom-color: var(--color-steam-blue);
}

.filter-tabs__count {
  font-size: 0.6875rem;
  color: var(--color-text-dark-muted);
}

/* ---------- Notification extras ---------- */
.notification-card--unread {
  background-color: rgba(102, 192, 244, 0.05);
}

/* ---------- Recommendation Cards ---------- */
.recommendation-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.recommendation-card {
  display: flex;
  gap: 20px;
  background-color: var(--color-dark-blue);
  border-radius: 4px;
  overflow: hidden;
  transition: box-shadow 0.15s;
}

.recommendation-card:hover {
  box-shadow: var(--shadow-card);
}

.recommendation-card__image-link {
  flex-shrink: 0;
  width: 300px;
  position: relative;
}

/* Proselytize boost — badge on the card image (no card border). */
.recommendation-card__boost-badge,
.game-card__boost-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  font-size: 0.6875rem;
  font-weight: 700;
  color: #fff;
  background-color: var(--color-steam-blue);
  border-radius: 3px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.game-card--recommend .game-card__image-link {
  position: relative;
}

.recommendation-card__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.recommendation-card__body {
  flex: 1;
  padding: 20px 20px 20px 0;
  display: flex;
  flex-direction: column;
}

.recommendation-card__title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--color-text-white);
  text-decoration: none;
  margin-bottom: 8px;
}

.recommendation-card__title:hover {
  color: var(--color-steam-blue);
}

.recommendation-card__reason {
  font-size: 0.875rem;
  color: var(--color-steam-blue);
  margin-bottom: 12px;
}

.recommendation-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 16px;
}

.recommendation-card__footer {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: auto;
}

/* タイトル行＝タイトル＋Steam 評価。評価のティア色は共通の
   .game-card__review--{tier} が持つので、ここでは色を上書きしない。 */
.recommendation-card__title-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 8px;
}

.recommendation-card__title-row .recommendation-card__title {
  margin-bottom: 0;
  /* 長いタイトルは 1 行で省略。全文は title 属性と詳細ページで。 */
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.recommendation-card__review {
  flex-shrink: 0;
  font-size: 0.8125rem;
}

.recommendation-card__price {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-text-white);
}

/* Dashboard "おすすめ" section: these cards carry only a title, a one-line
   reason, and a store link, so the full-width horizontal layout used on the
   standalone recommendations page leaves the right half empty. Inside the
   dashboard we reuse the horizontal-scroll pattern from the "最近プレイ"
   section with slightly wider vertical cards and a single-line reason. */
.dashboard__section--recommendations .recommendation-list {
  display: flex;
  flex-direction: row;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: thin;
  scrollbar-color: var(--color-blue-gray) transparent;
}

.dashboard__section--recommendations .recommendation-list::-webkit-scrollbar {
  height: 6px;
}

.dashboard__section--recommendations .recommendation-list::-webkit-scrollbar-thumb {
  background: var(--color-blue-gray);
  border-radius: 3px;
}

.dashboard__section--recommendations .recommendation-card {
  flex-direction: column;
  gap: 0;
  width: 280px;
  flex-shrink: 0;
}

.dashboard__section--recommendations .recommendation-card__image-link {
  width: 100%;
  aspect-ratio: 460 / 215;
}

.dashboard__section--recommendations .recommendation-card__body {
  padding: 12px 14px 14px;
}

.dashboard__section--recommendations .recommendation-card__reason {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Skeleton placeholder shown while the おすすめ fragment loads (lazy).
   dashboard-recommendations.js swaps this out for the real cards. */
.recommendation-card--skeleton {
  pointer-events: none;
}

.recommendation-card--skeleton .recommendation-card__image-link {
  background-color: var(--color-blue-gray);
}

.recommendation-card--skeleton .recommendation-card__image-link,
.skeleton-line {
  animation: skeleton-pulse 1.4s ease-in-out infinite;
}

.skeleton-line {
  height: 12px;
  border-radius: 3px;
  background-color: var(--color-blue-gray);
  margin-bottom: 10px;
}

.skeleton-line--title {
  width: 70%;
  height: 16px;
}

.skeleton-line--reason {
  width: 90%;
}

@keyframes skeleton-pulse {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 0.7; }
}

@media (prefers-reduced-motion: reduce) {
  .recommendation-card--skeleton .recommendation-card__image-link,
  .skeleton-line {
    animation: none;
    opacity: 0.5;
  }
}

/* ---------- Recommendations list page (/recommendations) ---------- */

/* The list page is a single flat grid (~30 cards) interleaved across the
   three signals; no per-section dividers are needed because each card's
   reason text already conveys its source signal. */
.recommendation-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

@media (max-width: 1024px) {
  .recommendation-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .recommendation-grid {
    grid-template-columns: 1fr;
  }
}

/* Card variant for the list page — vertical stack of image, title, tags,
   reason, price, store badge. Reuses .game-card chrome (background, hover,
   rounded corners) so it visually matches the rest of the portal. */
.game-card--recommend {
  display: flex;
  flex-direction: column;
}

.game-card--recommend .game-card__title {
  white-space: normal;
  text-overflow: clip;
  margin-bottom: 8px;
  line-height: 1.3;
}

.game-card--recommend .game-card__tags {
  margin: 0 0 8px;
}

.game-card--recommend .game-card__reason {
  margin: 0 0 8px;
}

.game-card--recommend .game-card__pricing {
  margin: 0 0 12px;
}

.game-card--recommend .game-card__footer {
  display: flex;
  align-items: center;
  margin-top: auto;
}

.recommendations__info {
  background-color: rgba(102, 192, 244, 0.08);
  border: 1px solid rgba(102, 192, 244, 0.15);
  border-radius: 4px;
  padding: 12px 16px;
  font-size: 0.8125rem;
  color: var(--color-steam-blue);
  margin-bottom: 24px;
}

.btn--small {
  padding: 6px 14px;
  font-size: 0.75rem;
}

.btn__icon {
  margin-right: 4px;
  font-size: 0.85em;
}

.page-header__filter-btn i {
  margin-right: 4px;
  font-size: 0.85em;
}

/* ---------- Notification Settings (P-08) ---------- */
.notif-settings {
  max-width: 640px;
}

.notif-settings__section {
  margin-bottom: 32px;
}

.notif-settings__section-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-text-white);
  margin-bottom: 4px;
}

.notif-settings__section-desc {
  font-size: 0.75rem;
  color: var(--color-text-dark-muted);
  margin-bottom: 16px;
}

.notif-settings__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  background-color: var(--color-dark-blue);
  border-radius: 4px;
  margin-bottom: 6px;
}

.notif-settings__item-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text-white);
  display: flex;
  align-items: center;
  gap: 8px;
}

.notif-settings__item-desc {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin-top: 2px;
}

.notif-settings__always-badge {
  font-size: 0.5625rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 2px;
  background-color: rgba(164, 208, 7, 0.15);
  color: var(--color-price-drop);
}

.notif-settings__actions {
  margin-top: 24px;
}

/* Delivery-hour select (per-user notification delivery time) */
.notif-settings__delivery-hour {
  flex-shrink: 0;
}

.notif-settings__delivery-hour select,
select.notif-settings__delivery-hour {
  min-width: 88px;
  padding: 8px 10px;
  font-size: 0.875rem;
  color: var(--color-text-white);
  background-color: var(--color-deep-dark);
  border: 1px solid var(--color-border-subtle);
  border-radius: 4px;
  cursor: pointer;
}

.notif-settings__delivery-hour select:disabled,
select.notif-settings__delivery-hour:disabled {
  opacity: 0.5;
  cursor: default;
}

/* Toggle Switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-switch__slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  /* Neutral gray OFF track: the old --color-blue-gray (#2a475e) read as a dim
     blue against the dark item background and was hard to tell from ON,
     especially on pages with a single toggle (e.g. /mypage). */
  background-color: #5a626c;
  border-radius: 24px;
  transition: background-color 0.2s;
}

.toggle-switch__slider::before {
  content: '';
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: var(--color-text-muted);
  border-radius: 50%;
  transition: transform 0.2s, background-color 0.2s;
}

.toggle-switch input:checked + .toggle-switch__slider {
  background-color: rgba(102, 192, 244, 0.3);
}

.toggle-switch input:checked + .toggle-switch__slider::before {
  transform: translateX(20px);
  background-color: var(--color-steam-blue);
}

.toggle-switch input:disabled + .toggle-switch__slider {
  cursor: not-allowed;
  opacity: 0.5;
}

/* ---------- Game Detail (P-06) ---------- */
.game-detail__header {
  display: flex;
  gap: 24px;
  margin-bottom: 32px;
}

.game-detail__cover {
  width: 460px;
  /* Steam header ratio (460×215). Fixes the height for both the <img> and the
     masked placeholder <div>, so the mature placeholder fills the same area as
     a shown cover instead of collapsing to its icon+label height. */
  aspect-ratio: 460 / 215;
  flex-shrink: 0;
  border-radius: 4px;
  object-fit: cover;
}

.game-detail__header-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.game-detail__title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--color-text-white);
  margin-bottom: 8px;
}

.game-detail__review {
  font-size: 0.875rem;
  color: var(--color-steam-blue);
  margin-bottom: 12px;
}

/* ストアで表示されていない旨の注記（タイトル直下） */
.game-detail__store-hidden {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 12px;
  padding: 4px 10px;
  border-radius: 4px;
  background: rgba(60, 68, 80, 0.6);
  color: var(--color-text-muted);
  font-size: 0.8125rem;
}

/* 「日本語のレビュー：」の見出しと「(18,888)」の件数、基本情報の「（日本語）」
   はティア色を継がず本文色にする。ティア色はラベル（リンク）
   だけに残す。 */
.game-detail__review-scope,
.game-detail__review-count,
.game-detail__info-list dd .game-detail__review-scope {
  color: var(--color-text-light);
}
.game-detail__review-count {
  margin-left: 0.25em;
}

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

.game-detail__columns {
  display: flex;
  gap: 32px;
}

.game-detail__main {
  flex: 1;
  min-width: 0;
}

.game-detail__info {
  /* 320px: 基本情報 dl はラベル列 auto + 値列 1fr。最長ラベル「アーリーアクセス」が
     入ると値列が 280px 幅では約 186px まで狭まり、OS 既定フォントで描かれていた
     「日本語化MODを報告」ボタンが収まらず文字が折れて 2 行になっていた（EA 有無で
     見た目が変わる）。フォント指定と合わせて修正し、EA 付きでも 1 行に収まる
     幅に広げる。 */
  width: 320px;
  flex-shrink: 0;
}

.game-detail__section {
  margin-bottom: 28px;
}

.game-detail__section-title {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--color-divider);
}

/* Second line = description under a section title (e.g. 布教一覧). Smaller,
   lighter, and reset from the title's uppercase/tracking. */
.game-detail__section-subtitle {
  display: block;
  margin-top: 4px;
  font-size: 0.75rem;
  font-weight: 400;
  text-transform: none;
  letter-spacing: normal;
  color: var(--color-text-muted);
}

/* User section */
.game-detail__user-section {
  background-color: var(--color-dark-blue);
  border-radius: 4px;
  padding: 20px;
  margin-bottom: 28px;
}

.game-detail__user-section .game-detail__section-title {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 12px;
}

.game-detail__user-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.game-detail__playtime {
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

.game-detail__target {
  font-size: 0.8125rem;
  font-weight: 500;
  font-family: var(--font-primary);
  color: var(--color-text-muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 3px;
  transition: background-color 0.15s, color 0.15s;
}

.game-detail__target:hover {
  background-color: rgba(255, 255, 255, 0.06);
  color: var(--color-text-light);
}

.game-detail__target--reached {
  color: var(--color-price-drop);
  font-weight: 700;
  cursor: default;
}

.game-detail__target--set {
  border: 1px dashed var(--color-text-dark-muted);
  color: var(--color-text-dark-muted);
}

.game-detail__target--set:hover {
  border-color: var(--color-steam-blue);
  color: var(--color-steam-blue);
}

.game-detail__user-actions {
  margin-top: 12px;
}

/* Price card */
.game-detail__price-card {
  background-color: var(--color-dark-blue);
  border-radius: 4px;
  padding: 16px;
}

.game-detail__price-main {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.game-detail__price-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-text-white);
}

.game-detail__price-value--unreleased {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text-muted);
}

.game-detail__price-sale-end {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  margin-bottom: 8px;
}

.game-detail__price-meta {
  display: flex;
  gap: 16px;
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}

/* 最安値の記録日・補足 */
.game-detail__price-meta-date {
  opacity: 0.85;
}

.game-detail__price-note {
  margin-top: 4px;
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

/* DLC list */
.game-detail__dlc-list {
  list-style: none;
}

.game-detail__dlc-list li {
  padding: 8px 12px;
  background-color: var(--color-dark-blue);
  border-radius: 3px;
  margin-bottom: 4px;
}

.game-detail__dlc-link {
  font-size: 0.875rem;
  color: var(--color-steam-blue);
}

.game-detail__dlc-link:hover {
  color: var(--color-text-white);
}

/* Info sidebar */
.game-detail__info-list {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 16px;
  font-size: 0.8125rem;
  margin-bottom: 20px;
}

.game-detail__info-list dt {
  color: var(--color-text-dark-muted);
  font-weight: 500;
}

.game-detail__info-list dd {
  color: var(--color-text-light);
}

/* Review tier colours on the detail page — same tokens as the cards.
   Applies to both the header review line (.game-detail__review)
   and the info-list value (dd.game-detail__review-value).

   The info-list needs `dd` in the selector: `.game-detail__info-list dd` above is
   class+element, which outranks a bare modifier class, so a plain
   `.game-detail__review--positive` loses and the value falls back to the list's
   light text colour. Keep the `dd` half of each pair when editing. */
.game-detail__review--positive,
.game-detail__info-list dd.game-detail__review--positive {
  color: var(--color-review-positive);
}
.game-detail__review--mixed,
.game-detail__info-list dd.game-detail__review--mixed {
  color: var(--color-review-mixed);
}
.game-detail__review--negative,
.game-detail__info-list dd.game-detail__review--negative {
  color: var(--color-review-negative);
}
.game-detail__review--none,
.game-detail__info-list dd.game-detail__review--none {
  color: var(--color-review-none);
}

/* Review label → Steam review hub link, same rationale as `.game-card__review a`
   above (tier colour inherited from the parent, repeated on hover to outrank the
   global `a:hover`). */
.game-detail__review a,
.game-detail__review-value a {
  color: inherit;
}
.game-detail__review a:hover,
.game-detail__review-value a:hover {
  color: inherit;
  text-decoration: underline;
}

.game-detail__badge {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 2px;
  /* Neutral default so unmodified badges (未確認 / 非対応) still read as a badge.
     Colored variants below override these. */
  background-color: rgba(255, 255, 255, 0.08);
  color: var(--color-text-muted);
}

.game-detail__badge--ok {
  background-color: rgba(164, 208, 7, 0.15);
  color: var(--color-price-drop);
}

.game-detail__badge--info {
  background-color: rgba(102, 192, 244, 0.15);
  color: var(--color-steam-blue);
}

.game-detail__badge--warning {
  background-color: rgba(232, 162, 58, 0.15);
  color: var(--color-warning);
}

.game-detail__badge--alert {
  background-color: rgba(222, 60, 60, 0.15);
  color: var(--color-alert);
}

.game-detail__lang--jp {
  color: var(--color-steam-blue);
  font-weight: 700;
}

.game-detail__store-link {
  width: 100%;
  text-align: center;
}

/* ---------- Pagination ---------- */
.pagination {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin-top: 32px;
}

.pagination__item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  font-size: 0.875rem;
  color: var(--color-text-muted);
  background-color: var(--color-dark-blue);
  border-radius: 3px;
  cursor: pointer;
  transition: background-color 0.15s;
}

.pagination__item:hover {
  background-color: var(--color-blue-gray);
  color: var(--color-text-white);
}

.pagination__item.is-active {
  background-color: var(--color-steam-blue-bright);
  color: var(--color-text-white);
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .site-nav {
    padding: 0 16px;
  }

  .site-nav__links {
    display: none;
  }

  .page-content {
    padding: 24px 16px;
  }

  .dashboard__header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .dashboard__stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .game-card-grid {
    grid-template-columns: 1fr;
  }

  .page-layout--sidebar {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--color-divider);
    padding: 16px;
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .page-header__right {
    flex-wrap: wrap;
  }

  .page-header__search {
    width: 100%;
  }

  .recommendation-card {
    flex-direction: column;
  }

  .recommendation-card__image-link {
    width: 100%;
  }

  .recommendation-card__body {
    padding: 16px;
  }

  .game-detail__header {
    flex-direction: column;
  }

  .game-detail__cover {
    width: 100%;
  }

  .game-detail__columns {
    flex-direction: column;
  }

  .game-detail__info {
    width: 100%;
  }
}

/* ---------- Drupal overrides ---------- */
/* Hide admin toolbar spacing when using our nav */
body.toolbar-fixed {
  padding-top: 0 !important;
}

/* Hide default Drupal page title if we provide our own */
.page-content .block-page-title-block {
  display: none;
}

/* Drupal tabs (local tasks) */
.tabs {
  margin-bottom: 24px;
}

.tabs ul {
  list-style: none;
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--color-divider);
  padding-bottom: 0;
}

.tabs ul li a {
  display: block;
  padding: 8px 16px;
  font-size: 0.875rem;
  color: var(--color-text-muted);
  border-radius: 3px 3px 0 0;
}

.tabs ul li a:hover {
  color: var(--color-text-white);
}

.tabs ul li a.is-active {
  color: var(--color-text-white);
  border-bottom: 2px solid var(--color-steam-blue);
}

/* ==========================================================================
   Bulk Mode (まとめて操作) — selection overlay, card check badge,
   bottom fixed operation bar.
   ========================================================================== */

/* Card overlay (always in DOM, hidden unless page is in bulk mode). */
.game-card__bulk-overlay {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 10;
  padding: 0;
  border: 0;
  background-color: transparent;
  cursor: pointer;
  border-radius: 4px;
  transition: box-shadow 120ms ease, background-color 120ms ease;
}

.is-bulk-mode .game-card__bulk-overlay {
  display: block;
}

/* Hide the selected-state check dot by default; only the outline is visible on hover. */
.game-card__bulk-check {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background-color: var(--color-steam-blue-bright);
  color: var(--color-text-white);
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

/* Hover state in bulk mode (not selected). */
.is-bulk-mode .game-card__bulk-overlay:hover {
  box-shadow: 0 0 0 2px rgba(102, 192, 244, 0.3);
}

/* Selected state: solid border + tint + visible check badge. */
.is-bulk-mode .game-card__bulk-overlay.is-selected {
  box-shadow: 0 0 0 2px var(--color-steam-blue);
  background-color: rgba(102, 192, 244, 0.08);
}

.is-bulk-mode .game-card__bulk-overlay.is-selected .game-card__bulk-check {
  display: inline-flex;
}

/* Disable the card's own hover lift while in bulk mode (since click
   no longer navigates to detail). */
.is-bulk-mode .game-card:hover {
  transform: none;
  box-shadow: none;
}

/* ==========================================================================
   Bottom Operation Bar
   ========================================================================== */
.bulk-op-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 900;
  background-color: var(--color-blue-gray);
  border-top: 1px solid var(--color-border-subtle);
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.6);
}

.is-bulk-mode .bulk-op-bar {
  display: block;
}

/* Push content up so pagination never sits under the bar. */
.is-bulk-mode .page-content {
  padding-bottom: 76px;
}

.bulk-op-bar__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.bulk-op-bar__status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--color-text-white);
  font-size: 0.875rem;
  font-weight: 500;
}

.bulk-op-bar__count {
  font-weight: 700;
  color: var(--color-steam-blue);
  min-width: 2ch;
  text-align: center;
}

.bulk-op-bar__divider {
  width: 1px;
  height: 24px;
  background-color: var(--color-border-subtle);
}

.bulk-op-bar__actions {
  display: flex;
  gap: 8px;
  flex: 1 1 auto;
}

.bulk-op-bar__action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background-color: transparent;
  color: var(--color-text-light);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 3px;
  font-size: 0.8125rem;
  font-family: var(--font-primary);
  cursor: pointer;
  transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
}

.bulk-op-bar__action:hover:not(:disabled) {
  background-color: rgba(102, 192, 244, 0.1);
  color: var(--color-text-white);
  border-color: rgba(102, 192, 244, 0.4);
}

.bulk-op-bar__action:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.bulk-op-bar__exit {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 14px;
  background-color: transparent;
  color: var(--color-muted);
  border: 1px solid transparent;
  border-radius: 3px;
  font-size: 0.8125rem;
  font-family: var(--font-primary);
  cursor: pointer;
  transition: color 120ms ease, border-color 120ms ease;
}

.bulk-op-bar__exit:hover {
  color: var(--color-text-white);
  border-color: var(--color-border-subtle);
}

@media (max-width: 768px) {
  .bulk-op-bar__inner {
    padding: 10px 12px;
    gap: 10px;
    flex-wrap: wrap;
  }

  .bulk-op-bar__actions {
    order: 3;
    width: 100%;
    flex: 0 0 auto;
  }

  .bulk-op-bar__divider {
    display: none;
  }

  .is-bulk-mode .page-content {
    padding-bottom: 130px;
  }
}

/* Narrow phones: keep every action on a single row.
   Wishlist shows three actions (wishlist tag / target price / custom tag) whose
   natural width is ~403px including gaps, so at 375-414px the flex items get
   shrunk below their content width and the Japanese labels wrap their last one
   or two characters. Fix: equal-width items that never wrap, and drop the icons
   - fa-tag and fa-tags are barely distinguishable at this size while the labels
   are what carry the meaning. Leaves ~113px per button at 375px against a
   longest label of ~90px. */
@media (max-width: 480px) {
  .bulk-op-bar__actions {
    gap: 6px;
  }

  .bulk-op-bar__action {
    flex: 1 1 0;
    min-width: 0;
    justify-content: center;
    padding: 10px 6px;
    white-space: nowrap;
  }

  .bulk-op-bar__action > i {
    display: none;
  }
}

/* ==========================================================================
   Game thumbnail fallback
   game-thumb.html.twig renders these when a header image is missing
   (No Image) or the title is gated (成人向け). The placeholder div carries
   the same sizing class as the <img> it replaces (game-card__image,
   recommendation-card__image, playtime-*__thumb, game-detail__cover,
   proselytize-rec__image), so width/aspect-ratio come from that class and
   only the centering/coloring is defined here. The double-class selector
   keeps `display` winning over the sizing class regardless of CSS load order.
   ========================================================================== */
.game-thumb--placeholder.game-thumb--noimage,
.game-thumb--placeholder.game-thumb--mature {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  background-color: var(--color-deep-dark);
  color: var(--color-text-dark-muted);
  font-size: 0.6875rem;
  line-height: 1.3;
  text-align: center;
  overflow: hidden;
}

.game-thumb--placeholder i {
  font-size: 1.6rem;
}

.game-thumb--mature {
  color: var(--color-warning);
}

/* Empty-state message inside a card grid: span all columns so it is not
   squeezed into a single grid cell. Harmless (ignored) outside a grid. */
.empty-state {
  grid-column: 1 / -1;
}

/* Secondary note under an empty-state message (e.g. F2P library guidance). */
.empty-state__note {
  margin-top: 0.5rem;
  color: var(--color-text-muted);
  font-size: 0.9em;
}
