:root {
  --bg: #fff4e6;
  --card: #ffffff;
  --text: #3b2a20;
  --muted: #8a7566;
  --accent: #f2994a;
  --line: #f3dcc4;
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
  line-height: 1.5;
  max-width: 480px;
  margin: 0 auto;
  padding: 0 16px env(safe-area-inset-bottom);
  -webkit-tap-highlight-color: transparent;
}

.hero {
  text-align: center;
  padding: 32px 0 16px;
}

.hero-cat {
  width: 160px;
  height: 160px;
  animation: bob 2.4s ease-in-out infinite;
}

@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

h1 {
  font-size: 28px;
  margin: 8px 0 0;
}

.tagline {
  color: var(--muted);
  margin: 4px 0 0;
}

.section-title {
  font-size: 18px;
  margin: 24px 0 12px;
}

.game-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.game-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: 18px;
  padding: 14px 16px;
  color: inherit;
  text-decoration: none;
}

a.game-card:active { transform: scale(0.98); }

.game-card.soon { opacity: 0.75; }

.game-icon { font-size: 34px; }

.game-text {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.game-text small { color: var(--muted); }

.badge {
  font-size: 12px;
  background: var(--line);
  color: var(--muted);
  border-radius: 999px;
  padding: 3px 10px;
  white-space: nowrap;
}

footer {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  padding: 40px 0 24px;
}

@media (prefers-reduced-motion: reduce) {
  .hero-cat { animation: none; }
}

.badge.play {
  background: var(--accent);
  color: #fff;
}

/* 게임 결과 창의 전체 순위표 (assets/ranking.js) */
dialog { max-height: calc(100dvh - 32px); overflow-y: auto; }

.ranking {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 2px dashed var(--line);
  text-align: left;
}

.ranking-title { margin: 0 0 8px; font-weight: 700; text-align: center; }

.ranking-form { display: flex; gap: 8px; }

.ranking-form[hidden] { display: none; }

.ranking-form input {
  flex: 1;
  min-width: 0;
  font: inherit;
  font-size: 16px;
  padding: 8px 12px;
  border: 2px solid var(--line);
  border-radius: 12px;
}

dialog .ranking-form button {
  width: auto;
  padding: 8px 16px;
  font-size: 16px;
}

.ranking-message { margin: 6px 0 8px; font-size: 13px; color: var(--muted); text-align: center; min-height: 1em; }

.ranking-list { list-style: none; margin: 0; padding: 0; font-size: 15px; }

.ranking-list li { display: flex; align-items: center; gap: 10px; padding: 5px 8px; border-radius: 10px; }

.ranking-list li:nth-child(odd) { background: var(--bg); }

.ranking-list li.mine { background: #ffe0b8; font-weight: 700; }

.ranking-list .rank { width: 22px; text-align: center; color: var(--muted); }

.ranking-list .who { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.ranking-list .ranking-empty { justify-content: center; color: var(--muted); background: none; }

footer a { color: inherit; }
