/* =========================================================================
   집에 가고 싶다 — css/home-portal.css
   한국어 메인 포털(inc/home-portal.php). 사이트 브랜드(밤하늘 그라데이션 · 픽셀 별 ·
   하드 오프셋 그림자 · Galmuri)를 따르고, 섹션은 박스 대신 여백과 머리말로 나눈다.
   데스크톱: 무대(대기실 말풍선 | 카운트다운) → 공지 → 게임 썸네일(3열) → 이야기 | 기분 · 랭킹 → 쉬어가기
   모바일: 카운트다운 → 대기실 → 공지 → 게임(2열) → 이야기 → 기분 → 랭킹 → 쉬어가기
   게임 썸네일 그림은 css/online-games.css · css/defense-catalog.css 의 online-mini-* 를 그대로 쓴다.
   ========================================================================= */
.hp {
  --hp-dusk: #2c2458;     /* 무대 하단 노을빛 보라 */
  --hp-night: #05070f;    /* 하드 그림자 */
  margin: 0.6rem 0 2.5rem;
}

/* 한국어 메인만 본문 폭을 넓힌다(기본 --maxw 880px) */
.container:has(> .hp) { max-width: 1160px; }

/* ── 공통: 섹션 머리 ───────────────────────────────── */
.hp-sec { margin-top: 3rem; }
.hp-sec__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.1rem; }
.hp-eyebrow { margin: 0 0 0.3rem; font-family: var(--font-hand); font-size: 0.78rem; letter-spacing: 0.04em; color: var(--mint); }
.hp-sec__head h2 { margin: 0; font-family: var(--font-soft); font-size: clamp(1.3rem, 2.6vw, 1.7rem); color: var(--peach); text-shadow: 2px 2px 0 var(--hp-night); }
.hp-sec__more { flex: none; font-family: var(--font-hand); font-size: 0.82rem; color: var(--lavender); text-decoration: none; padding-bottom: 0.2rem; border-bottom: 1px dashed var(--lavender-deep); }
.hp-sec__more:hover { color: var(--peach); border-bottom-color: var(--peach); }
.hp-meta { font-family: var(--font-hand); font-size: 0.74rem; color: var(--ink-faint); white-space: nowrap; }
.hp-empty, .hp-note { font-family: var(--font-soft); font-size: 0.85rem; color: var(--ink-soft); margin: 0.2rem 0; }
.hp-note { font-family: var(--font-hand); font-size: 0.76rem; margin: 0 0 0.5rem; }

/* ── 무대: 밤하늘 위 대기실 말풍선 + 카운트다운 ───────── */
.hp-stage {
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 2.5rem; align-items: center;
  margin-top: 1rem; padding: 2.2rem 2.4rem 2.4rem;
  background: linear-gradient(180deg, var(--sky-deep) 0%, var(--sky) 45%, var(--hp-dusk) 100%);
  box-shadow: inset 0 -3px 0 var(--peach-deep), 6px 6px 0 var(--hp-night);
}
/* 픽셀 별 */
.hp-stage::before {
  content: ""; position: absolute; top: 0; left: 0; width: 2px; height: 2px; background: #fff; opacity: 0.8; pointer-events: none;
  box-shadow: 60px 34px #fff, 180px 90px #ffd27a, 320px 22px #fff, 470px 70px #a7c2e6, 610px 28px #fff, 760px 110px #fff,
    880px 46px #ffd27a, 1010px 84px #fff, 1100px 26px #a7c2e6, 120px 200px #a7c2e6, 540px 180px #fff, 980px 220px #fff,
    260px 300px #fff, 700px 320px #ffd27a, 1060px 340px #fff;
}
.hp-stage > * { position: relative; }
.hp-stage__title { margin: 0 0 1rem; font-family: var(--font-soft); font-size: clamp(1.35rem, 2.8vw, 1.9rem); color: var(--ink); text-shadow: 2px 2px 0 var(--hp-night); }

/* 카운트다운: index.html 원본 블록(인라인 style)이라 배치 값만 !important 로 덮는다 */
.hp-stage__clock > .hero { padding: 0 !important; display: grid; gap: 1rem; justify-items: center; }
.hp-stage__clock .card { display: block !important; width: 100%; padding: 0.4rem 0 !important; background: none !important; border: 0 !important; box-shadow: none !important; }
.hp-stage__clock .stack { margin-top: 0 !important; gap: 0.5rem !important; }
.hp-stage__clock #comfort { font-size: 1.05rem !important; margin: 0; }

/* 탭(라디오 기반): 픽셀 칩 */
.hp-tabs__input { position: absolute; opacity: 0; pointer-events: none; }
.hp-tabs__bar { display: flex; gap: 0.4rem; margin-bottom: 0.9rem; }
.hp-tabs__tab { cursor: pointer; padding: 0.38rem 0.8rem; font-family: var(--font-hand); font-size: 0.82rem; color: var(--ink-soft); border: 2px solid var(--line); background: rgba(5, 7, 15, 0.35); }
.hp-tabs__tab:hover { color: var(--ink); border-color: var(--lavender-deep); }
.hp-tabs__panel { display: none; }
.hp-tabs__input:nth-of-type(1):checked ~ .hp-tabs__bar .hp-tabs__tab:nth-of-type(1),
.hp-tabs__input:nth-of-type(2):checked ~ .hp-tabs__bar .hp-tabs__tab:nth-of-type(2) { color: #13203a; background: var(--peach); border-color: var(--peach); box-shadow: 2px 2px 0 var(--hp-night); }
.hp-tabs__input:nth-of-type(1):checked ~ .hp-tabs__panel--0,
.hp-tabs__input:nth-of-type(2):checked ~ .hp-tabs__panel--1 { display: block; }
.hp-tabs__input:focus-visible ~ .hp-tabs__bar { outline: 2px solid var(--lavender); outline-offset: 3px; }

/* 대기실 말풍선 */
.hp-feed { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.75rem; }
.hp-feed a { position: relative; display: block; width: fit-content; max-width: 92%; padding: 0.6rem 0.85rem; background: rgba(14, 16, 32, 0.85); border: 2px solid var(--line); box-shadow: 3px 3px 0 var(--hp-night); color: var(--ink); text-decoration: none; font-family: var(--font-soft); }
.hp-feed li:nth-child(even) a { margin-left: auto; }
.hp-feed a:hover { border-color: var(--lavender-deep); }
.hp-feed p { margin: 0 0 0.15rem; font-size: 0.93rem; line-height: 1.45; }
.hp-feed .is-bye a { border-color: var(--mint-deep); }
.hp-feed .is-bye p::before { content: "퇴근 "; color: var(--mint); font-family: var(--font-hand); font-size: 0.78rem; }
.hp-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1.3rem; }
.hp-actions .btn { font-size: 0.86rem; padding: 0.5rem 1rem; white-space: nowrap; }

/* ── 공지: 띠 한 줄 ───────────────────────────────── */
.hp-notice { display: flex; align-items: center; gap: 0.7rem; margin-top: 1.4rem; padding: 0.4rem 0; color: var(--ink); text-decoration: none; font-family: var(--font-soft); font-size: 0.92rem; min-width: 0; border-bottom: 1px dashed var(--line); }
.hp-notice:hover .hp-notice__text { color: var(--peach); }
.hp-notice__tag { flex: none; font-family: var(--font-hand); font-size: 0.72rem; font-weight: 700; padding: 0.18rem 0.5rem; background: var(--peach); color: #13203a; box-shadow: 2px 2px 0 var(--hp-night); }
.hp-notice__text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── 게임 썸네일: 틀 없이 그림과 이름만 ─────────────── */
.hp-game-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.6rem 1.3rem; }
.hp-game { display: block; color: var(--ink); text-decoration: none; }
.hp-game:focus-visible { outline: 2px solid var(--peach); outline-offset: 4px; }
.hp-game__thumb { position: relative; display: block; aspect-ratio: 2 / 1; overflow: hidden; border: 2px solid var(--line); box-shadow: 4px 4px 0 var(--hp-night); transition: transform 0.15s var(--ease-soft), box-shadow 0.15s var(--ease-soft), border-color 0.15s; }
.hp-game:hover .hp-game__thumb { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--hp-night); border-color: var(--peach); }
.hp-game__thumb > span:not(.hp-game__new) { display: block; width: 100%; height: 100%; min-height: 0; max-height: none; aspect-ratio: auto; box-shadow: none; box-sizing: border-box; }
/* 위 :not() 규칙과 같은 우선순위로 맞춰 블록 퍼즐의 grid 배치를 유지 */
.hp-game__thumb > span.online-mini-block { display: grid; }
.hp-game__new { position: absolute; top: 0.5rem; left: 0.5rem; font-family: var(--font-hand); font-size: 0.68rem; font-weight: 700; padding: 0.18rem 0.45rem; background: var(--peach); color: #13203a; box-shadow: 2px 2px 0 var(--hp-night); }
.hp-game__body { display: flex; flex-direction: column; gap: 0.25rem; padding-top: 0.85rem; }
.hp-game__title { font-family: var(--font-soft); font-weight: 700; font-size: 1.05rem; }
.hp-game:hover .hp-game__title { color: var(--peach); }
.hp-game__sub { font-family: var(--font-soft); font-size: 0.84rem; color: var(--ink-soft); }
.hp-game__meta { display: flex; align-items: center; gap: 0.45rem; margin-top: 0.15rem; font-family: var(--font-hand); font-size: 0.74rem; color: var(--ink-faint); }
.hp-game__mode { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hp-game__badge { flex: none; white-space: nowrap; font-size: 0.68rem; font-weight: 700; padding: 0.1rem 0.4rem; background: var(--mint); color: #13203a; }
.hp-game__badge.is-multi { background: var(--peach); }
@media (prefers-reduced-motion: reduce) { .hp-game__thumb, .hp-game:hover .hp-game__thumb { transition: none; transform: none; } }

/* ── 이야기 | 기분 · 랭킹 ──────────────────────────── */
.hp-columns { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 3.5rem; margin-top: 3rem; }
.hp-columns > .hp-sec, .hp-columns__side > .hp-sec:first-child { margin-top: 0; }
.hp-columns__side { padding-left: 2rem; border-left: 1px dashed var(--line); }

.hp-stories { list-style: none; margin: 0; padding: 0; }
.hp-stories li + li { border-top: 1px dashed var(--line); }
.hp-stories a { display: grid; grid-template-columns: 2.6rem minmax(0, 1fr) auto; align-items: baseline; gap: 0.8rem; padding: 0.95rem 0; color: var(--ink); text-decoration: none; }
.hp-stories__no { font-family: var(--font-hand); font-size: 1.15rem; color: var(--peach); text-shadow: 2px 2px 0 var(--hp-night); }
.hp-stories__title { font-family: var(--font-soft); font-size: 1rem; line-height: 1.5; }
.hp-stories a:hover .hp-stories__title { color: var(--peach); }

.hp-bars { list-style: none; margin: 0 0 0.4rem; padding: 0; display: grid; gap: 0.5rem; }
.hp-bars li { display: grid; grid-template-columns: 6rem 1fr 2.6rem; align-items: center; gap: 0.6rem; font-family: var(--font-soft); font-size: 0.84rem; color: var(--ink-soft); }
.hp-bars__track { height: 0.6rem; background: var(--line); }
.hp-bars__track span { display: block; height: 100%; background: var(--peach); box-shadow: inset 0 -2px 0 var(--peach-deep); }
.hp-bars__num { text-align: right; font-family: var(--font-hand); font-variant-numeric: tabular-nums; }

.hp-columns__side .hp-sec + .hp-sec { margin-top: 2.4rem; }
.hp-rank { list-style: none; margin: 0 0 0.6rem; padding: 0; }
.hp-rank li { display: flex; align-items: center; gap: 0.7rem; padding: 0.45rem 0; font-family: var(--font-soft); font-size: 0.92rem; }
.hp-rank__no { width: 1.6rem; height: 1.6rem; flex: none; display: grid; place-items: center; font-family: var(--font-hand); font-size: 0.8rem; color: var(--ink); background: var(--line); box-shadow: 2px 2px 0 var(--hp-night); }
.hp-rank li:first-child .hp-rank__no { background: var(--peach); color: #13203a; }
.hp-rank__name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hp-rank__score { font-family: var(--font-hand); font-variant-numeric: tabular-nums; color: var(--ink-soft); font-size: 0.82rem; }

/* ── 잠깐 쉬어가기 ────────────────────────────────── */
.hp-shortcuts__group { display: grid; grid-template-columns: 6rem 1fr; gap: 1rem; align-items: start; padding: 0.5rem 0; }
.hp-shortcuts h3 { margin: 0.5rem 0 0; font-family: var(--font-hand); font-size: 0.8rem; color: var(--ink-soft); font-weight: 400; }
.hp-shortcuts ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.55rem; }
.hp-shortcuts li a { display: inline-flex; align-items: center; padding: 0.45rem 0.9rem; border: 2px solid var(--line); background: var(--card-solid); box-shadow: 2px 2px 0 var(--hp-night); color: var(--ink); text-decoration: none; font-family: var(--font-soft); font-size: 0.86rem; }
.hp-shortcuts li a:hover { border-color: var(--peach); color: var(--peach); transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--hp-night); }

/* ── 반응형 ───────────────────────────────────────── */
@media (max-width: 900px) {
  .hp-stage { grid-template-columns: minmax(0, 1fr); gap: 1.8rem; padding: 1.6rem 1.3rem 1.8rem; }
  .hp-stage__clock { order: -1; }
  .hp-columns { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .hp-columns__side { padding-left: 0; border-left: 0; }
  .hp-columns__side > .hp-sec:first-child { margin-top: 3rem; }
}
@media (max-width: 760px) {
  .hp-sec { margin-top: 2.4rem; }
  .hp-game-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.2rem 0.9rem; }
  .hp-game__thumb { aspect-ratio: 16 / 10; }
  .hp-game__sub, .hp-game__mode { display: none; }
  .hp-game__title { font-size: 0.95rem; }
}
@media (max-width: 480px) {
  .hp-stage { padding: 1.3rem 1rem 1.5rem; }
  .hp-feed a { max-width: 100%; }
  .hp-actions .btn { flex: 1 1 0; min-width: 0; text-align: center; font-size: 0.8rem; padding: 0.5rem 0.4rem; }
  .hp-shortcuts__group { grid-template-columns: 1fr; gap: 0.4rem; }
  .hp-shortcuts h3 { margin: 0; }
  .hp-stories a { grid-template-columns: 2rem minmax(0, 1fr); }
  .hp-stories .hp-meta { grid-column: 2; }
}
