/* 포털 — 게임(남색)·한자(붉은 먹색) 두 앱의 색을 카드에 각각 씀 */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #F9F9FC;
  --text: #1A1C1E;
  --muted: #5B5F68;
  --line: #E0E2EC;
  --card: #FFFFFF;
  --game: #4A5D7E;
  --game-soft: #D6E3FF;
  --hanja: #B5523B;
  --hanja-soft: #F6E3DC;
  --hanja-font: 'Noto Serif KR', 'Noto Serif CJK KR', 'AppleMyungjo', 'Batang', serif;
  --shadow: 0 2px 12px rgba(30, 40, 60, 0.08);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1A1C1F;
    --text: #EEF0F4;
    --muted: #AEB3BD;
    --line: #33373E;
    --card: #24272C;
    --game: #9DB3DB;
    --game-soft: #2C3A52;
    --hanja: #E07A5F;
    --hanja-soft: #4A2E26;
    --shadow: none;
  }
}

html, body {
  min-height: 100%;
  font-family: system-ui, -apple-system, 'Apple SD Gothic Neo', 'Noto Sans KR', sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
}
[hidden] { display: none !important; }

/* 상단 바 — 두 앱과 같은 구성 */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 8px;
  padding: calc(env(safe-area-inset-top) + 10px) 16px 10px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.topbar > * { white-space: nowrap; flex: 0 0 auto; }
.topbar-title { font-weight: 800; color: var(--game); margin-right: auto; }
.topbar-user { color: var(--muted); font-size: 14px; flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.topbar-btn {
  font: inherit; font-size: 14px; font-weight: 600; color: var(--game);
  background: none; border: none; padding: 6px 8px; border-radius: 8px; cursor: pointer;
}

.portal {
  max-width: 520px; margin: 0 auto;
  padding: 16px 16px calc(env(safe-area-inset-bottom) + 24px);
  display: flex; flex-direction: column; gap: 24px;
}

.hero { text-align: center; padding: 36px 0 8px; }
.brand { font-size: 48px; font-weight: 800; letter-spacing: 8px; color: var(--game); }
.brand-sub { margin-top: 6px; font-size: 17px; font-weight: 600; letter-spacing: 2px; color: var(--muted); }

/* 앱 카드 — 폰은 세로 2장, 넓으면 좌우 */
.apps { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 480px) { .apps { grid-template-columns: 1fr 1fr; } }

.app-card {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 28px 18px 22px;
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
  text-decoration: none; color: var(--text); text-align: center;
  transition: transform .08s ease;
}
.app-card:active { transform: scale(0.98); }
.app-icon {
  width: 84px; height: 84px; display: grid; place-items: center;
  border-radius: 24px; font-size: 44px; line-height: 1;
}
.app-game .app-icon { background: var(--game-soft); }
.app-hanja .app-icon { background: var(--hanja); color: #FFF; font-family: var(--hanja-font); font-size: 50px; }
.app-name { font-size: 24px; font-weight: 800; }
.app-game .app-name { color: var(--game); }
.app-hanja .app-name { color: var(--hanja); }
.app-desc { font-size: 14px; color: var(--muted); line-height: 1.45; min-height: 2.9em; }
.app-go {
  margin-top: 6px; padding: 10px 22px; border-radius: 999px;
  font-weight: 700; font-size: 15px; color: #FFF;
}
.app-game .app-go { background: var(--game); }
.app-hanja .app-go { background: var(--hanja); }
.app-game { border-color: var(--game-soft); }
.app-hanja { border-color: var(--hanja-soft); }
