/* 메인 화면: 게임 고르기 */

.home main { max-width: 920px; }
.home header { padding-top: 28px; }

.game-grid {
  list-style: none;
  margin: 18px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)); /* 휴대폰: 두 줄씩 */
  gap: 12px;
}
@media (min-width: 720px) {
  .game-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
}

.game-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  color: var(--text);
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.game-card:hover, .game-card:focus-visible {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: 0 8px 20px rgba(120, 70, 40, 0.18);
}
.game-card:active { transform: scale(0.98); }
.game-card img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1200 / 630;
  object-fit: cover;
  background: #efe6d6;
}

.gc-body { display: flex; flex-direction: column; gap: 3px; padding: 10px 12px 12px; flex: 1; }
.gc-body b { font-size: 1.02rem; line-height: 1.3; word-break: keep-all; }
.gc-desc { color: var(--muted); font-size: 0.86rem; line-height: 1.35; word-break: keep-all; flex: 1; }
/* 같이 하는 방식: 키워드마다 작은 꼬리표 (단어 중간에서 줄이 바뀌지 않게) */
.gc-who {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-top: 4px;
}
.gc-who i {
  padding: 1px 8px;
  border-radius: 999px;
  background: #fff3c4;
  color: #8a5a1c;
  font-size: 0.75rem;
  font-style: normal;
  font-weight: 700;
  white-space: nowrap;
}
.gc-new {
  display: inline-block;
  vertical-align: 2px;
  margin-left: 2px;
  padding: 0 6px;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font-style: normal;
  font-size: 0.66rem;
  font-weight: 800;
}

.home-foot { margin: 26px 0 0; text-align: center; color: var(--muted); font-size: 0.9rem; }
.home-foot a { color: var(--accent); }

/* 접속자 수 */
.online { margin: 8px 0 0; text-align: center; font-size: 0.92rem; color: var(--muted); }
.online b { color: var(--text); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #3cc26a; vertical-align: 1px; box-shadow: 0 0 0 3px rgba(60, 194, 106, 0.2); }
.game-card { position: relative; }
.gc-live {
  position: absolute; top: 8px; left: 8px; z-index: 1;
  padding: 2px 8px; border-radius: 999px;
  background: rgba(30, 30, 30, 0.62); color: #fff; font-size: 0.72rem; font-weight: 700;
}

/* 랭킹 */
.rank-section { margin: 0 0 18px; background: var(--panel); border: 1px solid var(--border); border-radius: 16px; padding: 14px 14px 12px; }
.rank-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.rank-top h2 { margin: 0; font-size: 1.2rem; }
.rank-period { display: flex; gap: 4px; }
.rank-period button, .rank-tabs button { padding: 4px 12px; font-size: 0.88rem; border-radius: 999px; }
.rank-period button.sel, .rank-tabs button.sel { background: var(--accent); border-color: var(--accent); color: #fff; }
.rank-tabs { display: flex; gap: 6px; overflow-x: auto; margin: 12px 0 4px; padding-bottom: 4px; scrollbar-width: none; }
.rank-tabs button { flex: none; white-space: nowrap; }
.rank-what { margin: 4px 0 6px; color: var(--muted); font-size: 0.85rem; }
.rank-list { list-style: none; margin: 0; padding: 0; }
.rank-list li { display: flex; align-items: center; gap: 10px; padding: 8px 4px; border-top: 1px solid var(--border); }
.rank-list li:first-child { border-top: 0; }
.rank-list .no { width: 38px; text-align: center; font-weight: 800; color: var(--muted); flex: none; }
.rank-list .who { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-list .sc { font-weight: 800; color: var(--accent); flex: none; }
.rank-list .mine { background: #fff6dc; border-radius: 8px; }
.rank-list .empty { justify-content: center; color: var(--muted); padding: 18px 0; }
.rank-me { margin: 8px 0 0; text-align: center; font-weight: 700; font-size: 0.9rem; }
.rank-me:empty { display: none; }
.rank-note { margin: 8px 0 0; color: var(--muted); font-size: 0.78rem; text-align: center; }

/* 랭킹 더 보기 */
.rank-list li[hidden] { display: none; }
.rank-more { display: block; width: 100%; margin: 6px 0 0; padding: 8px; font-size: 0.9rem; font-weight: 700; color: var(--muted); background: transparent; border: 1px dashed var(--border); border-radius: 10px; }
.rank-more[hidden] { display: none; }

/* 펼친 랭킹은 상자 안에서 스크롤, 내 순위 줄은 그 아래에 */
.rank-list.open { max-height: min(55vh, 440px); overflow-y: auto; -webkit-overflow-scrolling: touch; }
.rank-me-row { margin-top: 4px; border-top: 2px solid var(--border); }
.rank-me-row[hidden] { display: none; }
.rank-me-row small { color: var(--muted); font-weight: 600; }

/* 게임 골라 보기: 혼자 · 컴퓨터와 · 한 기기로 · 친구와 · 접속자와 */
.game-filter { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 20px 0 0; }
.game-filter::-webkit-scrollbar { display: none; }
.game-filter button { flex: none; padding: 6px 12px; font-size: 0.9rem; border-radius: 999px; white-space: nowrap; }
.game-filter button.sel { background: var(--accent); border-color: var(--accent); color: #fff; }
.game-filter button small { margin-left: 4px; opacity: 0.7; font-size: 0.8em; }
.game-grid { margin-top: 12px; }
.game-grid li[hidden] { display: none; }
