/* 이름점 (/gunghap). Colors come only from theme.css tokens. */

.gh button { font-family: inherit; cursor: pointer; }
.gh button:not(.btn) { font-size: inherit; }
.gh button.btn { border: 0; font-size: var(--fs-button); font-weight: var(--weight-button); }
.gh button.btn-secondary { border: 1px solid var(--color-ink); background: transparent; }

.gh-lead { max-width: 32em; line-height: 1.6; text-wrap: balance; }

/* ---------- form ---------- */
.gh-form { display: flex; flex-direction: column; gap: 16px; margin-top: 32px; }
.gh-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.gh-field { display: flex; flex-direction: column; gap: 6px; font-size: var(--fs-small); color: var(--color-ink-soft); }
.gh-field input {
  width: 100%;
  height: 56px;
  padding: 0 16px;
  border: 1px solid var(--color-line);
  border-radius: 16px;
  background: var(--color-surface);
  color: var(--color-ink);
  font: inherit;
  font-size: 20px;
  font-weight: var(--weight-title);
}
.gh-field input::placeholder { color: var(--color-ink-soft); font-weight: var(--weight-body); }
.gh-field input:focus-visible { outline: 2px solid var(--color-ink); outline-offset: 2px; }
.gh-error { font-size: var(--fs-small); font-weight: var(--weight-title); }

/* ---------- result ---------- */
.gh-result {
  margin-top: 40px;
  padding: 32px 24px;
  border: 1px solid var(--color-line);
  border-radius: 24px;
  background: var(--color-surface);
  box-shadow: var(--shadow-soft);
  scroll-margin-top: calc(var(--nav-height) + 16px);
}
.gh-result[hidden] { display: none; }
.gh-names { font-size: clamp(24px, 4vw, 32px); font-weight: var(--weight-title); letter-spacing: var(--tracking-title); text-align: center; }
.gh-scores { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 24px; }
.gh-score {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 16px 8px;
  border-radius: 16px;
  background: var(--color-bg);
}
.page .gh-score + .gh-score { margin-top: 0; }
.gh-dir { font-size: var(--fs-small); color: var(--color-ink-soft); text-align: center; }
.gh-pct { font-size: clamp(44px, 9vw, 64px); font-weight: var(--weight-title); line-height: 1.1; letter-spacing: var(--tracking-title); }
.gh-comment { margin-top: 20px; text-align: center; text-wrap: balance; }
.gh-line { font-size: var(--fs-small); color: var(--color-ink-soft); text-align: center; }
.gh-line[hidden] { display: none; }

/* ---------- notebook pyramid ---------- */
.gh-book { margin-top: 28px; padding-top: 24px; border-top: 1px dashed var(--color-line); }
.gh-book-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px; }
.gh-book-title { margin: 0; font-size: var(--fs-small); font-weight: var(--weight-title); }
.gh-flip {
  padding: 4px 0;
  border: 0;
  background: none;
  color: var(--color-ink);
  font-size: var(--fs-small);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.gh-flip:focus-visible { outline: 2px solid var(--color-ink); outline-offset: 3px; }
.gh-pyramid { --cell: min(36px, calc((100vw - 96px) / 10)); display: flex; flex-direction: column; align-items: center; gap: 4px; margin-top: 16px; }
.gh-row { display: flex; gap: 2px; }
.gh-cell {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--cell);
  height: var(--cell);
  font-size: calc(var(--cell) * 0.5);
  font-variant-numeric: tabular-nums;
}
.gh-letters .gh-cell { font-weight: var(--weight-title); border-bottom: 2px solid var(--color-line); }
.gh-letters .is-second { color: var(--color-ink-soft); }
.gh-row.is-last .gh-cell {
  border-radius: 999px;
  background: var(--color-vermilion);
  color: var(--color-on-accent);
  font-size: calc(var(--cell) * 0.6);
  font-weight: var(--weight-title);
}
.gh-note { margin-top: 16px; font-size: var(--fs-small); color: var(--color-ink-soft); text-align: center; text-wrap: balance; }
.gh-result .actions { justify-content: center; margin-top: 28px; }
.gh-toast { margin-top: 12px; font-size: var(--fs-small); text-align: center; }
.gh-toast[hidden] { display: none; }

/* Rows appear one after another, like writing them out. */
@keyframes gh-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.gh-pyramid.is-playing .gh-row { animation: gh-rise var(--dur-section) ease-out both; }
.gh-pyramid.is-playing .gh-row:nth-child(2) { animation-delay: 150ms; }
.gh-pyramid.is-playing .gh-row:nth-child(3) { animation-delay: 300ms; }
.gh-pyramid.is-playing .gh-row:nth-child(4) { animation-delay: 450ms; }
.gh-pyramid.is-playing .gh-row:nth-child(5) { animation-delay: 600ms; }
.gh-pyramid.is-playing .gh-row:nth-child(6) { animation-delay: 750ms; }
.gh-pyramid.is-playing .gh-row:nth-child(7) { animation-delay: 900ms; }
.gh-pyramid.is-playing .gh-row:nth-child(8) { animation-delay: 1050ms; }
.gh-pyramid.is-playing .gh-row:nth-child(9) { animation-delay: 1200ms; }
.gh-pyramid.is-playing .gh-row:nth-child(10) { animation-delay: 1350ms; }
.gh-pyramid.is-playing .gh-row:nth-child(11) { animation-delay: 1500ms; }
.gh-pyramid.is-playing .gh-row:nth-child(12) { animation-delay: 1650ms; }
@media (prefers-reduced-motion: reduce) {
  .gh-pyramid.is-playing .gh-row { animation: none; }
}

/* ---------- next ---------- */
.gh-next { margin-top: 48px; padding-top: 32px; border-top: 1px solid var(--color-line); }
.gh-next h2 { margin-bottom: 8px; font-size: 22px; font-weight: var(--weight-title); }
.gh-result + .gh-next, .gh-form + .gh-next { margin-top: 48px; }
.gh > .meta { margin-top: 32px; }

@media (max-width: 599px) {
  .gh-fields { grid-template-columns: 1fr; }
  .gh-result { padding: 24px 16px; }
  .gh-form .btn { width: 100%; }
}
