/* Card review: intentionally scoped to the existing library, not the brand shell. */
#games.games {
  --card-gap: 24px;
  --card-padding: 20px;
  --card-radius: 22px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--card-gap);
}

#games .game-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  position: relative;
  isolation: isolate;
  border: 1px solid var(--line);
  border-radius: var(--card-radius);
  background: var(--card-surface);
  box-shadow: none;
  font-family: 'Noto Sans KR', sans-serif;
  animation: none;
  transition: border-color .18s ease, transform .18s ease;
}

#games .game-card:hover { box-shadow: none; transform: none; }
#games .card-open { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2; }
#games .card-open:focus-visible { outline: 3px solid var(--teal-dark); outline-offset: -4px; border-radius: var(--card-radius); }

#games.games .game-card .cover {
  position: relative;
  width: 100%;
  flex: none;
  aspect-ratio: 460 / 215;
  min-height: 0;
  background: var(--soft);
  overflow: hidden;
}

#games.games .cover img {
  position: static;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  object-position: center;
  mask-image: none;
  transform: none;
  transition: none;
}

#games .card-image-fallback {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
  padding: 20px;
  text-align: center;
  color: var(--muted);
  background: var(--soft);
}

#games .card-image-fallback svg { width: 28px; height: 28px; }
#games .card-image-fallback strong { font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
#games .card-image-fallback small { font-size: 13px; }
#games .cover.has-image-error img { visibility: hidden; }
#games .cover.has-image-error .card-image-fallback { display: flex; }

#games .game-card .favorite-button {
  position: absolute;
  z-index: 3;
  top: 14px;
  right: 14px;
  left: auto;
  width: 44px;
  height: 44px;
  border: 1px solid #315e6340;
  border-radius: 12px;
  background: rgba(255, 255, 255, .55);
  color: #315e63;
  box-shadow: none;
  transform: none;
  animation: none;
  transition: background-color .14s ease;
}

#games .game-card .favorite-button:hover,
#games .game-card .favorite-button[aria-pressed=true] {
  background: rgba(255, 255, 255, .68);
  color: #315e63;
  box-shadow: none;
  transform: none;
}

#games .favorite-button svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linejoin: round;
  transition: fill .14s ease;
}

#games .favorite-button[aria-pressed=true] svg { fill: currentColor; }

#games .game-card .card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  width: auto;
  min-width: 0;
  padding: var(--card-padding);
  gap: 12px;
  text-align: left;
}

#games .game-card .card-body h3 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.7em;
  margin: 0;
  font: 700 22px / 1.35 'Noto Sans KR', sans-serif;
  letter-spacing: -.4px;
  overflow-wrap: anywhere;
}

#games .game-card .summary {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  height: auto;
  min-height: 3.3em;
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

#games .game-card .card-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  flex-wrap: wrap;
  min-height: 32px;
  margin: 0;
}

#games .card-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: 0 0 auto;
  padding: 5px 9px;
  border: 0;
  border-radius: 9px;
  background: var(--soft);
  color: var(--teal-dark);
  white-space: nowrap;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
}

#games .card-status svg { width: 16px; height: 16px; flex: none; }
#games .card-players { display: inline-flex; align-items: center; gap: 5px; margin: 0; font-size: 15px; line-height: 1.5; font-weight: 700; white-space: nowrap; }
#games .card-players svg { width: 18px; height: 18px; color: var(--muted); flex: none; }

#games .game-card .tags { display: flex; align-items: start; gap: 6px; flex-wrap: wrap; min-height: 28px; margin: 0; }
#games .game-card .tags span { padding: 3px 8px; border-radius: 7px; background: var(--soft); color: var(--teal-dark); font-size: 13px; font-weight: 500; line-height: 1.55; }

#games .game-card .card-meta,
#games .game-card .card-meta.supported {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: start;
  flex-wrap: nowrap;
  gap: 3px;
  min-height: 45px;
  padding: 0;
  border: 0;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  font-weight: 400;
}

#games .game-card .language,
#games .game-card .supported .language { display: inline-flex; align-items: center; gap: 5px; font-size: 14px; font-weight: 500; line-height: 1.5; }
#games .language-check { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 18px; flex: none; background: none; font-size: 15px; }
#games .game-card .card-modes,
#games .game-card .supported .card-modes { padding: 0; font-size: 13px; line-height: 1.5; }
#games .card-modes::before { content: none; }

#games .game-card .card-bottom {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 12px;
  min-height: 61px;
  margin: auto 0 0;
  padding: 12px 0 0;
  border: 0;
  border-top: 1px solid var(--line);
}

#games .card-release { display: flex; flex: 1; align-items: start; flex-direction: column; min-width: 0; gap: 3px; }
#games .card-release > span { font-size: 13px; line-height: 1.5; color: var(--muted); }
#games .game-card .card-bottom time { display: block; font-size: 17px; font-weight: 600; line-height: 1.5; word-break: keep-all; overflow-wrap: anywhere; }
#games .card-date-note { display: block; font-size: 12px; color: var(--muted); }
#games .game-card .card-bottom .card-price { display: block; align-items: initial; flex: 0 0 auto; min-height: 0; padding: 0; border: 0; margin: 0; color: var(--teal-dark); font-size: 21px; font-weight: 700; line-height: 1.5; }

#games .card-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; min-height: 40px; border-top: 1px solid var(--line); padding-top: 10px; margin-top: 0; font-size: 13px; }
#games .card-detail-hint { color: var(--muted); margin-right: auto; display: inline-flex; align-items: center; gap: 4px; }
#games .card-detail-hint svg { width: 15px; height: 15px; }
#games .card-steam { position: relative; z-index: 3; display: inline-flex; align-items: center; gap: 4px; min-height: 32px; color: var(--teal-dark); text-decoration: none; font-weight: 600; }
#games .card-steam:hover { text-decoration: underline; text-underline-offset: 3px; }
#games .card-steam svg { width: 15px; height: 15px; }
#games .card-actions .card-memo { position: relative; z-index: 3; align-self: auto; min-height: 32px; margin: 0; padding: 3px 6px; border: 0; border-radius: 5px; background: var(--soft); color: var(--teal-dark); font-size: 13px; font-weight: 500; }

#games.games.list-view { grid-template-columns: minmax(0, 1fr); gap: 16px; }
#games.games.list-view .game-card { display: grid; grid-template-columns: minmax(240px, 28%) minmax(0, 1fr); align-items: center; min-height: 0; }
#games.games.list-view .cover { align-self: start; width: 100%; flex: none; aspect-ratio: 460 / 215; min-height: 0; }
#games.games.list-view .cover img { position: static; width: 100%; height: 100%; object-fit: contain; }
#games.games.list-view .favorite-button { left: 14px; right: auto; top: 14px; }
#games.games.list-view .card-body { display: grid; grid-template-columns: minmax(0, 1fr) 170px; grid-template-areas: 'title price' 'summary price' 'top price' 'tags price' 'meta actions'; align-items: start; gap: 8px 24px; padding: 18px 22px; }
#games.games.list-view .card-body h3 { grid-area: title; font-size: 21px; min-height: 0; margin: 0; }
#games.games.list-view .summary { grid-area: summary; min-height: 0; height: auto; font-size: 15px; -webkit-line-clamp: 2; }
#games.games.list-view .card-topline { grid-area: top; justify-content: flex-start; gap: 10px 16px; margin: 0; min-height: 0; }
#games.games.list-view .card-players { font-size: 15px; }
#games.games.list-view .tags { grid-area: tags; margin: 0; min-height: 0; }
#games.games.list-view .card-meta { grid-area: meta; flex-direction: row; flex-wrap: wrap; gap: 4px 10px; margin: 0; min-height: 0; }
#games.games.list-view .card-bottom { grid-area: price; border: 0; padding: 0; margin: 0; min-height: 0; gap: 10px; align-self: center; align-items: flex-end; flex-direction: column-reverse; text-align: right; }
#games.games.list-view .card-release { flex: none; align-items: flex-end; }
#games.games.list-view .card-bottom .card-price { font-size: 21px; }
#games.games.list-view .card-actions { grid-area: actions; align-self: end; justify-content: flex-end; gap: 6px 10px; border: 0; margin: 0; padding: 0; min-height: 0; }
#games.games.list-view .card-detail-hint { margin: 0; }

@media (min-width: 1600px) {
  #games.games { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 1100px) {
  #games.games { grid-template-columns: repeat(2, minmax(0, 1fr)); --card-gap: 20px; --card-padding: 18px; }
  #games.games.list-view .game-card { grid-template-columns: minmax(200px, 32%) minmax(0, 1fr); }
  #games.games.list-view .card-body { grid-template-columns: minmax(0, 1fr); grid-template-areas: 'title' 'summary' 'top' 'tags' 'meta' 'price' 'actions'; padding: 16px 18px; gap: 8px; }
  #games.games.list-view .card-bottom { flex-direction: row; align-items: flex-end; justify-content: space-between; text-align: left; padding-top: 10px; border-top: 1px solid var(--line); }
  #games.games.list-view .card-release { align-items: flex-start; }
  #games.games.list-view .card-actions { justify-content: flex-start; border-top: 1px solid var(--line); padding-top: 8px; }
  #games.games.list-view .card-detail-hint { margin-right: auto; }
}

@media (max-width: 700px) {
  #games.games { grid-template-columns: minmax(0, 1fr); --card-gap: 18px; --card-padding: 18px; --card-radius: 20px; }
  #games .game-card .card-body h3 { font-size: 21px; min-height: 0; }
  #games .game-card .summary { font-size: 15px; min-height: 0; }
  #games .card-status { font-size: 13px; }
  #games .card-players { font-size: 15px; }
  #games .game-card .card-bottom time { font-size: 17px; }
  #games.games.list-view .game-card { display: flex; flex-direction: column; }
  #games.games.list-view .cover { width: 100%; aspect-ratio: 460 / 215; min-height: 0; }
  #games.games.list-view .card-body { width: 100%; padding: 18px; gap: 10px; }
  #games .card-steam, #games .card-actions .card-memo { min-height: 44px; }
}

@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  #games .game-card:hover { transform: translateY(-2px); border-color: var(--teal); box-shadow: none; }
  #games.games .game-card:hover .cover img { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  #games .game-card, #games .favorite-button, #games .favorite-button svg { transition: none; animation: none; }
  #games .game-card:hover { transform: none; }
}
