/* 홈 화면(ko/en/ja) 전용 스타일. 색·글꼴·상단 메뉴·배너·푸터는 base.css */
.wrap { max-width: 1040px; margin: 0 auto; }

/* 첫 화면 */
.hero { text-align: center; padding: 64px 0 40px; }
/* 배경 별가루 캔버스 (shared/homefx.js): 화면에 고정, 모든 내용 뒤.
   body 배경이 캔버스를 가리지 않도록 홈에서는 배경(금빛 번짐 포함)을 html 로 옮김 */
html {
  background:
    radial-gradient(1200px 520px at 50% -180px, rgba(201, 169, 110, 0.09), transparent 70%),
    var(--bg);
}
body { background: transparent; }
/* 카드·소개 상자는 살짝 비쳐서 뒤의 별이 은은하게 보이게 */
:root { --panel: rgba(24, 24, 28, 0.92); --panel-hover: rgba(32, 32, 37, 0.94); }
.page-stars { position: fixed; inset: 0; z-index: -1; width: 100%; height: 100%; pointer-events: none; }
.eyebrow {
  margin: 0 0 18px; font-size: 11px; font-weight: 600; letter-spacing: 0.32em; text-transform: uppercase; color: var(--gold);
}
/* 홈 페이지 버전: 배포가 반영됐는지 확인용. index.html (ko/ja/en) 을 바꿔 배포할 때 세 곳 같이 올림 */
.eyebrow .sitever { margin-left: 0.6em; font-size: 10px; font-weight: 500; letter-spacing: 0.06em; text-transform: none; color: var(--faint, #8a8a96); }
h1 {
  margin: 0 0 16px; font-size: clamp(32px, 6vw, 52px); font-weight: 700; line-height: 1.12;
  letter-spacing: -0.035em; color: #fff;
}
.lead { max-width: 560px; margin: 0 auto; font-size: 15px; color: var(--muted); line-height: 1.75; }
/* 소개 글 아래 해시태그 */
.tags { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 8px; max-width: 600px; margin: 18px auto 0; font-size: 12.5px; }
.tags span { padding: 3px 10px; border-radius: 999px; background: rgba(255, 210, 90, 0.08); color: var(--gold); letter-spacing: 0.01em; }
.stats { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin: 28px 0 0; font-size: 12px; color: var(--muted); }
.stats span { border: 1px solid var(--line); border-radius: 999px; padding: 5px 13px; letter-spacing: 0.02em; }
.stats b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.stats [hidden] { display: none; }

/* 최근 기록 (shared/livefeed.js): 알림창처럼 최근 판 5줄 */
.livefeed {
  max-width: 640px; margin: 4px auto 0;
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  font-size: 13px; overflow: hidden;
}
.livefeed[hidden] { display: none; }
.lf-head {
  display: flex; align-items: center; gap: 8px; padding: 6px 16px;
  border-bottom: 1px solid var(--line);
  font-size: 11px; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted);
}
.lf-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--gold); }
.lf-refresh {
  margin-left: auto; width: 26px; height: 26px; margin-right: -6px;
  display: flex; align-items: center; justify-content: center;
  border: 0; border-radius: 6px; background: transparent; color: var(--faint); cursor: pointer;
  transition: color 0.2s, background 0.2s;
}
.lf-refresh:hover { color: var(--gold); background: var(--surface-2); }
.lf-refresh:disabled { cursor: default; }
.lf-refresh.spin svg { animation: lf-spin 0.6s linear infinite; }
@keyframes lf-spin { to { transform: rotate(360deg); } }
.lf-list { list-style: none; margin: 0; padding: 4px 0; min-height: calc(5 * 34px + 8px); }
.lf-row {
  display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 16px;
  font-variant-numeric: tabular-nums;
}
.lf-ic {
  flex: none; width: 20px; height: 20px; border-radius: 6px; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}
.lf-ic img, .lf-ic svg { width: 100%; height: 100%; object-fit: contain; }
.lf-who { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.lf-game::after { content: '·'; margin: 0 6px; color: var(--faint); }
.lf-name { color: var(--text); font-weight: 500; }
/* 이름 앞 작은 국기 (shared/flag.js) */
.flag { display: inline-block; width: 16px; height: 12px; margin-right: 5px; vertical-align: -1px; border-radius: 2px; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12); }
.lf-name.anon { color: var(--faint); font-weight: 400; }
.lf-rank { flex: none; min-width: 34px; text-align: right; color: var(--muted); font-size: 12px; }
.lf-rank.r1 { color: var(--gold); }
.lf-rank.r2 { color: var(--silver); }
.lf-rank.r3 { color: var(--bronze); }
.lf-score { flex: none; min-width: 64px; text-align: right; color: var(--text); font-weight: 600; }
.lf-time { flex: none; min-width: 52px; text-align: right; color: var(--faint); font-size: 12px; }
.lf-empty { display: flex; align-items: center; justify-content: center; height: calc(5 * 34px); color: var(--faint); font-size: 12px; }
.lf-foot {
  display: flex; align-items: center; justify-content: space-between; padding: 4px 8px;
  border-top: 1px solid var(--line);
}
.lf-page { font-size: 11px; color: var(--faint); letter-spacing: 0.06em; font-variant-numeric: tabular-nums; }
.lf-nav {
  width: 28px; height: 24px; border: 0; border-radius: 6px; background: transparent; cursor: pointer;
  font: inherit; font-size: 18px; line-height: 1; color: var(--muted);
  transition: color 0.2s, background 0.2s;
}
.lf-nav:hover:not(:disabled) { color: var(--gold); background: var(--surface-2); }
.lf-nav:disabled { color: var(--faint); opacity: 0.35; cursor: default; }

/* 섹션 제목: 작은 글씨 + 가는 선 */
h2 {
  display: flex; align-items: center; gap: 14px;
  margin: 56px 0 18px; font-size: 12px; font-weight: 600; letter-spacing: 0.24em; text-transform: uppercase; color: var(--muted);
}
/* 게임 목록 제목 옆 전체 개수 (예: 전체 17개) */
.gcount { padding: 3px 10px; border: 1px solid var(--line); border-radius: 999px; font-size: 12px; font-weight: 600; letter-spacing: 0.04em; text-transform: none; white-space: nowrap; }
.gcount b { color: var(--text); font-weight: 800; }
h2::after { content: ''; flex: 1; height: 1px; background: var(--line); }

/* 게임 카드 */
.games { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); }
.gamebox {
  display: flex; flex-direction: column;
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px; overflow: hidden;
  transition: border-color 0.25s, transform 0.25s, background 0.25s;
}
.gamebox:hover { border-color: var(--line-strong); transform: translateY(-2px); background: var(--panel-hover); }

/* 카드 대표 이미지 (shared/homefx.js 가 게임 배경 이미지로 넣음) */
.cover { position: relative; display: block; aspect-ratio: 2.2 / 1; overflow: hidden; background: #050506; }
.cover img {
  display: block; width: 100%; height: 100%; object-fit: cover;
  filter: brightness(0.62) saturate(0.85); transform: scale(1.01);
  transition: transform 0.9s cubic-bezier(0.2, 0.7, 0.2, 1), filter 0.5s;
}
.cover::before {   /* 위쪽을 살짝 어둡게 (게임 화면의 점수 표시가 덜 보이게) */
  content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(to bottom, rgba(12, 12, 15, 0.45) 0%, rgba(12, 12, 15, 0) 35%);
  transition: opacity 0.5s;
}
.cover::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to bottom, rgba(24, 24, 28, 0) 40%, var(--surface) 100%);
}
/* 마우스를 올리면 원래 색 그대로 선명하게 (아래쪽은 카드와 이어지게 얇게만 흐림) */
.gamebox:hover .cover img { transform: scale(1.06); filter: none; }
.gamebox:hover .cover::before { opacity: 0; }
.gamebox:hover .cover::after { background: linear-gradient(to bottom, rgba(32, 32, 37, 0) 72%, var(--surface-2) 100%); }
.cover-play {
  position: absolute; z-index: 1; right: 14px; bottom: 12px;
  padding: 6px 14px; border-radius: 999px;
  background: var(--gold); color: #141416; font-size: 12px; font-weight: 800; letter-spacing: 0.16em;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
  transform-origin: center;
  animation: play-pulse 1.4s ease-in-out infinite;   /* 시작하는 곳을 바로 알도록 항상 보이고 천천히 커졌다 작아짐 */
}
.gamebox:hover .cover-play { animation-duration: 0.7s; }
@keyframes play-pulse {
  0%, 100% { scale: 1; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.45), 0 0 0 0 rgba(201, 169, 110, 0.6); }
  50% { scale: 1.1; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.45), 0 0 0 7px rgba(201, 169, 110, 0); }
}

/* 정렬 1~3위 카드는 한 줄 전체: 왼쪽 큰 이미지(게임 화면 전체), 오른쪽 정보 */
@media (min-width: 760px) {
  .games > .gamebox.has-cover:nth-child(-n+3) {
    grid-column: 1 / -1;
    display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); grid-template-rows: auto 1fr;
  }
  .games > .gamebox.has-cover:nth-child(-n+3) .cover { grid-row: 1 / 3; aspect-ratio: auto; min-height: 320px; }
  .games > .gamebox.has-cover:nth-child(-n+3) .cover::after { background: linear-gradient(to right, rgba(24, 24, 28, 0) 55%, var(--surface) 100%); }
  .games > .gamebox.has-cover:nth-child(-n+3):hover .cover::after { background: linear-gradient(to right, rgba(32, 32, 37, 0) 78%, var(--surface-2) 100%); }
  .games > .gamebox.has-cover:nth-child(-n+3) .cover-play { right: auto; left: 18px; bottom: 16px; font-size: 14px; padding: 9px 20px; }
  .games > .gamebox.has-cover:nth-child(-n+3) .game { padding: 26px 26px 18px; align-items: flex-start; }
  .games > .gamebox.has-cover:nth-child(-n+3) .title { font-size: 22px; }
  .games > .gamebox.has-cover:nth-child(-n+3) .desc { font-size: 14px; margin-top: 6px; }
  .games > .gamebox.has-cover:nth-child(-n+3) .top3 { padding: 12px 26px 18px; }
}
@media (max-width: 759px) {
  .games > .gamebox.has-cover:nth-child(-n+3) .cover { aspect-ratio: 4 / 3; }
}
/* 큰 카드: 게임 화면을 자르지 않고 통째로, 남는 곳은 같은 그림을 흐리게 깔아 채움 */
.cover-bg { display: none; }
.games > .gamebox.has-cover:nth-child(-n+3) .cover-bg {
  display: block; position: absolute; inset: -24px;
  background-size: cover; background-position: center;
  filter: blur(22px) brightness(0.5) saturate(1.1);
}
.games > .gamebox.has-cover:nth-child(-n+3) .cover img { position: absolute; inset: 0; object-fit: contain; object-position: 50% 50% !important; }
/* 휴대폰·태블릿(마우스 없음)은 마우스오버가 없으니 처음부터 선명하게 */
@media (hover: none) {
  .cover img { filter: none; }
  .cover::before { opacity: 0; }
  .cover::after { background: linear-gradient(to bottom, rgba(24, 24, 28, 0) 72%, var(--surface) 100%); }
}
@media (hover: none) and (min-width: 760px) {
  .games > .gamebox.has-cover:nth-child(-n+3) .cover::after { background: linear-gradient(to right, rgba(24, 24, 28, 0) 78%, var(--surface) 100%); }
}

/* 마우스를 따라다니는 은은한 조명 (shared/homefx.js 가 --mx, --my 를 넣음) */
@media (hover: hover) and (pointer: fine) {
  .gamebox, .games > .game { position: relative; }
  .gamebox::after, .games > .game::after {
    content: ''; position: absolute; inset: 0; z-index: 2; border-radius: inherit; pointer-events: none;
    background: radial-gradient(380px circle at var(--mx, 50%) var(--my, 50%), rgba(201, 169, 110, 0.09), transparent 65%);
    opacity: 0; transition: opacity 0.35s;
  }
  .gamebox:hover::after, .games > .game:hover::after { opacity: 1; }
}
.game {
  display: flex; align-items: center; gap: 16px; padding: 18px 20px;
  color: inherit; text-decoration: none;
}
.games > .game {   /* 다른 서비스 (gamebox 없이 바로 링크) */
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px;
  transition: border-color 0.25s, background 0.25s;
}
.games > .game:hover { border-color: var(--line-strong); background: var(--panel-hover); color: inherit; }
.game:hover { color: inherit; }
.icon {
  flex: none; width: 56px; height: 56px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}
.icon img { width: 100%; height: 100%; object-fit: contain; border-radius: 14px; }
.title { font-size: 17px; font-weight: 650; letter-spacing: -0.02em; color: #fff; }
.desc { font-size: 13px; color: var(--muted); margin-top: 4px; line-height: 1.5; }

/* 순위·별점·플레이 수 */
.rk {
  display: inline-block; margin-right: 8px; padding: 1px 8px; border-radius: 999px;
  border: 1px solid var(--line-strong); color: var(--muted);
  font-size: 11px; font-weight: 600; letter-spacing: 0.04em; vertical-align: 2px; font-variant-numeric: tabular-nums;
}
.rk.r1 { color: var(--gold); border-color: rgba(201, 169, 110, 0.55); background: var(--gold-soft); }
.rk.r2 { color: var(--silver); border-color: rgba(184, 188, 198, 0.4); }
.rk.r3 { color: var(--bronze); border-color: rgba(183, 132, 95, 0.45); }
.endb {   /* 엔딩이 있는 게임 */
  display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: 999px;
  border: 1px solid rgba(255, 210, 80, 0.55); background: rgba(255, 200, 60, 0.14); color: #ffd866;
  font-size: 11px; font-weight: 700; letter-spacing: 0.02em; vertical-align: 2px; white-space: nowrap; cursor: help;
}
.updb {   /* 최근 7일 안에 버전이 바뀐 게임: 꽉 찬 색 태그 + 새로고침 아이콘 (shared/upbadge.js) */
  display: inline-flex; align-items: center; gap: 3px; margin-left: 8px; padding: 2px 7px 2px 5px; border-radius: 6px;
  background: linear-gradient(135deg, #2fe0a0, #17a9d6); box-shadow: 0 2px 8px rgba(30, 200, 170, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  vertical-align: 2px; line-height: 1; cursor: help;
  animation: updb-pop 2.6s ease-in-out infinite;
}
.updb b { font: 900 10px/1 "Arial Black", Arial, sans-serif; color: #fff; letter-spacing: 0.02em; text-shadow: 0 1px 1px rgba(0, 60, 60, 0.35); }
.updb svg { display: block; }
.updb.new {   /* 최근 7일 안에 나온 새 게임: 기울어진 별 모양 스티커 */
  padding: 0; background: none; box-shadow: none; margin: -10px 0 -10px 6px; vertical-align: middle;
  transform: rotate(-12deg); filter: drop-shadow(0 2px 5px rgba(255, 60, 120, 0.45));
  animation: updb-wiggle 2.6s ease-in-out infinite;
}
@keyframes updb-pop { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.08); } }
@keyframes updb-wiggle { 0%, 100% { transform: rotate(-12deg) scale(1); } 50% { transform: rotate(-4deg) scale(1.08); } }
@media (prefers-reduced-motion: reduce) { .updb, .updb.new { animation: none; } }
.plays { margin-top: 8px; font-size: 12px; color: var(--faint); display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; font-variant-numeric: tabular-nums; }
.plays .stars { color: var(--gold); letter-spacing: 1.5px; font-size: 12px; }
.plays .stars .off { color: rgba(255, 255, 255, 0.14); }
.plays .rate { color: var(--muted); }
.plays .norate { color: var(--faint); }

/* 카드 아래 TOP 3 */
.top3 {
  list-style: none; margin: auto 0 0; padding: 10px 20px 14px;
  border-top: 1px solid var(--line); font-size: 13px; color: var(--muted);
}
.top3 li { display: flex; align-items: center; gap: 10px; padding: 3px 0; }
.top3 .rank { flex: none; width: 20px; text-align: center; font-size: 13px; filter: saturate(0.6); }
.top3 .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.top3 .sc { flex: none; font-weight: 500; font-variant-numeric: tabular-nums; color: var(--muted); }
.top3 .empty { color: var(--faint); justify-content: center; font-size: 12px; }

/* 소개 글 */
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px;
  padding: 8px 28px 24px; margin-top: 14px;
}
.card h3 { margin: 26px 0 8px; font-size: 16px; font-weight: 650; letter-spacing: -0.015em; color: #fff; }
.card h3.with-icon { display: flex; align-items: center; gap: 12px; }
.card h3 + p { margin-top: 6px; }
.card section + h3, .card ul + p + h3, .card ul + h3 { padding-top: 22px; border-top: 1px solid var(--line); }
.icon.sm { width: 32px; height: 32px; border-radius: 9px; }
.icon.sm img { border-radius: 9px; }
.icon.sm svg { width: 26px; height: 26px; }
.card p, .card li { font-size: 14px; margin: 5px 0; color: var(--muted); line-height: 1.75; }
.card ul { padding-left: 18px; margin: 8px 0; }
.card li::marker { color: var(--faint); }
.card a { color: var(--text); font-weight: 500; }
.card a:hover { color: var(--gold); }

@media (max-width: 560px) {
  .hero { padding: 44px 0 28px; }
  .card { padding: 4px 18px 20px; }
  h2 { margin-top: 44px; }
  .lf-row { gap: 8px; padding: 0 12px; }
  .lf-head { padding: 6px 12px; }
  .lf-rank { min-width: 28px; }
  .lf-score { min-width: 54px; }
  .lf-time { min-width: 44px; font-size: 11px; }
}

@media (prefers-reduced-motion: reduce) {
  .gamebox, .games > .game { transition: none; }
  .gamebox:hover { transform: none; }
  .cover img { transition: none; }
  .cover-play { animation: none; }
  .gamebox:hover .cover img { transform: scale(1.01); }
}
