/* 브랜드, 검색, 게임 목록을 한 화면에 배치합니다. */
:root {
  --purple: #5541a4;
  --purple-dark: #3c2c78;
  --lavender: #eee8fa;
  --line: #e9e1d6;
  --muted: #6b6278;
  --page-padding: clamp(14px, 3vw, 36px);
  background: #faf8f2;
  color: #2d2443;
}

.site-header { border-bottom: 1px solid var(--line); background: #fffdfa; }
.topbar {
  max-width: 1360px;
  min-height: 72px;
  margin: 0 auto;
  padding: 12px var(--page-padding);
  border: 0;
  background: transparent;
}
.brand { flex: none; font-size: 24px; letter-spacing: -1.4px; }
.portal-mark { flex: none; }
.top-actions { width: min(540px, 68%); }
.search { border-color: #e6deee; background: #fff; }
.search:focus-within { border-color: var(--purple); }
.random-button { border-color: #dfd5f2; background: #e9e2f7; color: var(--purple-dark); }
.random-button:hover { background: #ded4f2; }

main { max-width: 1360px; padding: 22px var(--page-padding) 36px; }
.main-nav { flex-direction: row; margin-bottom: 20px; }
.nav-item { min-height: 44px; }
.nav-item b { margin-left: 4px; }
.nav-item.selected { background: var(--lavender); color: var(--purple-dark); }
.nav-icon { color: var(--purple); }
.section-heading h1 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: clamp(21px, 3vw, 30px);
  font-weight: 800;
}
#result-count {
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  min-height: 24px;
  padding: 0 6px;
  border-radius: 8px;
  background: var(--lavender);
  color: var(--purple-dark);
  font-size: 12px;
  letter-spacing: 0;
}
.library-toolbar { flex-wrap: wrap; justify-content: flex-start; gap: 7px 14px; margin: 12px 0 14px; }
.filter-tabs { padding: 2px; border-radius: 12px; background: #eee8f4; }
.filter-tabs button { color: #60546f; }
.filter-tabs button.active { background: var(--purple-dark); color: #fff; }
.filter-tabs button:not(.active):hover { background: #e6dbf1; }
.duration-control { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; }
.sort-control select, .duration-control select { border-color: #e5dcea; color: #493c5b; }
.duration-control select {
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid #e5dcea;
  border-radius: 9px;
  background: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.clear-discovery { min-height: 44px; padding: 0 10px; border-radius: 8px; color: var(--purple-dark); font-size: 12px; }
.clear-discovery:hover { background: var(--lavender); }
.search-status { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); }

.games-grid { gap: 14px; }
.game-card { border-color: #e9e1e9; border-radius: 19px; box-shadow: 0 3px 10px #34225008; }
.card-cover { aspect-ratio: 1.52; background: #ebe5f1; }
.card-title { color: #302648; }
.card-description, .card-controls { color: var(--muted); }
.card-controls { font-size: 11px; }
.card-meta { border-color: #f0eaf1; color: #6a5d76; }
.card-launch { min-width: 76px; background: #453382; color: #fff; }
.card-launch:hover { background: #30245e; }
.favorite-button { color: #564488; }
.favorite-button[aria-pressed=true] { border-color: #e6d8f4; background: #f0e7fc; color: #6640a5; }
.cover-badge.new { background: #e1f3a8; color: #394727; }
.empty-state { border-color: #dcd0eb; background: #f2edf8; }
.player-logo { padding: 0; background: transparent; }

@media (min-width: 1180px) {
  .games-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .card-body { padding: 14px 13px 13px; }
  .card-description { font-size: 12px; }
}
@media (min-width: 850px) and (max-width: 1179px) {
  .games-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 849px) and (min-width: 601px) {
  .games-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 800px) {
  .main-nav { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
  .nav-icon { display: none; }
  .nav-item { gap: 4px; padding-inline: 4px; font-size: 12px; }
  .nav-item b { margin-left: 0; font-size: 10px; }
}
@media (max-width: 600px) {
  .topbar { flex-direction: column; align-items: stretch; gap: 9px; padding-block: 10px; }
  .brand { font-size: 23px; }
  .portal-mark { width: 34px; height: 34px; }
  .top-actions { width: 100%; }
  main { padding-top: 10px; }
  .main-nav { margin-bottom: 12px; }
  .nav-item { font-size: 11px; }
  .library-toolbar { gap: 4px; margin-top: 4px; }
  .filter-tabs { gap: 2px; }
  .filter-tabs button { min-width: 44px; padding: 0 6px; font-size: 12px; }
  .duration-control > span { display: none; }
  .duration-control select { width: 89px; padding: 0 6px; }
  .game-card {
    display: grid;
    grid-template-columns: clamp(84px, 27vw, 132px) minmax(0, 1fr);
    grid-template-areas: "cover body" "favorite body" "modes modes";
    grid-template-rows: auto 1fr auto;
    align-items: start;
    gap: 5px 11px;
    padding: 10px;
  }
  .card-cover { grid-area: cover; align-self: start; width: 100%; aspect-ratio: 1.45; border-radius: 10px; }
  .cover-badges { top: 5px; left: 5px; max-width: calc(100% - 10px); }
  .cover-badge:not(.new) { display: none; }
  .card-body { grid-area: body; padding: 0; }
  .card-title-row { min-height: 28px; padding: 0; }
  .card-title { font-size: 16px; }
  .card-description { display: none; }
  .card-controls { min-height: 31px; margin: 1px 0 6px; }
  .card-meta { padding-top: 5px; }
  .favorite-button { position: static; grid-area: favorite; background: #f3edf9; }
}
@media (max-width: 360px) {
  .nav-item { padding-inline: 2px; }
  .nav-item b { display: none; }
}
