/* ============================================================
   러비너프 이름 궁합 테스트 — 전용 스타일 (격리)
   Prefix: gh-*
   기존 ln-* 토큰을 읽기 전용으로 참조.
============================================================ */

.gh-page,
.gh-page * {
    box-sizing: border-box;
}

.gh-page {
    --gh-pink: #ff6986;
    --gh-pink-light: #ffe3ea;
    --gh-pink-dark: #d84868;
    --gh-orange: #ffb36b;
    --gh-cream: #fff8f2;
    --gh-ink: #3a2a3a;
    --gh-purple: #7a5a8c;
    --gh-grid: #f9d9e1;
    --gh-radius: 4px;
    --gh-font-pixel: 'DungGeunMo', 'Galmuri11', 'Press Start 2P', ui-monospace, monospace;

    padding: 20px 16px 40px;
    color: var(--gh-ink);
    background:
        linear-gradient(180deg, var(--gh-cream) 0%, var(--gh-pink-light) 100%);
    min-height: calc(100vh - 80px);
    position: relative;
    overflow: hidden;
    max-width: 100%;
}

.gh-page::before,
.gh-page::after {
    content: "";
    position: absolute;
    width: 200%;
    height: 200%;
    background-image:
        linear-gradient(var(--gh-grid) 1px, transparent 1px),
        linear-gradient(90deg, var(--gh-grid) 1px, transparent 1px);
    background-size: 24px 24px;
    opacity: 0.35;
    top: 0; left: -50%;
    pointer-events: none;
    z-index: 0;
}
.gh-page > * { position: relative; z-index: 1; }

/* ---------- Tabs (픽셀 스타일) ---------- */
.gh-tabs {
    display: flex;
    gap: 0;
    max-width: 360px;
    margin: 0 auto 22px;
    border: 3px solid var(--gh-ink);
    border-radius: var(--gh-radius);
    background: #fff;
    box-shadow: 4px 4px 0 var(--gh-ink);
    overflow: hidden;
}
.gh-tabs__item {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 8px;
    font-size: 13px;
    font-weight: 900;
    color: var(--gh-purple);
    text-decoration: none;
    background: var(--gh-cream);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}
.gh-tabs__item + .gh-tabs__item {
    border-left: 3px solid var(--gh-ink);
}
.gh-tabs__item:hover {
    background: var(--gh-pink-light);
    color: var(--gh-ink);
}
.gh-tabs__item.is-active {
    background: var(--gh-pink);
    color: #fff;
    cursor: default;
}
.gh-tabs__item.is-active:hover {
    background: var(--gh-pink);
}
.gh-tabs__icon {
    font-size: 14px;
    display: inline-block;
}

/* ---------- Header ---------- */
.gh-header {
    text-align: center;
    margin-bottom: 24px;
}
.gh-header__badge {
    display: inline-block;
    padding: 6px 14px;
    background: var(--gh-pink);
    color: #fff;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.08em;
    border: 2px solid var(--gh-ink);
    box-shadow: 3px 3px 0 var(--gh-ink);
    border-radius: var(--gh-radius);
    margin-bottom: 16px;
}
.gh-header__title {
    font-size: 22px;
    font-weight: 900;
    line-height: 1.35;
    color: var(--gh-ink);
    margin: 0 0 8px;
    text-shadow: 2px 2px 0 var(--gh-pink-light);
}
.gh-header__sub {
    font-size: 12px;
    color: var(--gh-purple);
    margin: 0;
    letter-spacing: 0.02em;
}

/* ---------- Stages ---------- */
.gh-stage {
    display: none;
    animation: gh-fade-in 0.4s ease-out;
}
.gh-stage.is-active { display: block; }

@keyframes gh-fade-in {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ---------- Pixel characters ---------- */
.gh-pixel-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin: 20px 0 28px;
}
.gh-pixel-char {
    width: 72px;
    height: 96px;
    image-rendering: pixelated;
    position: relative;
}
.gh-pixel-char__body {
    width: 56px;
    height: 72px;
    margin: 0 auto;
    background: var(--gh-cream);
    border: 3px solid var(--gh-ink);
    box-shadow: 4px 4px 0 var(--gh-ink);
    position: relative;
    top: 12px;
}
.gh-pixel-char__hair {
    position: absolute;
    top: -10px; left: -3px; right: -3px;
    height: 16px;
    background: var(--gh-pink-dark);
    border: 3px solid var(--gh-ink);
    border-bottom: none;
}
.gh-pixel-char__hair--boy {
    background: var(--gh-orange);
}
.gh-pixel-char__face {
    display: flex;
    gap: 8px;
    justify-content: center;
    padding-top: 20px;
}
.gh-pixel-char__eye {
    width: 8px;
    height: 8px;
    background: var(--gh-ink);
    border-radius: 50%;
}
.gh-pixel-char__mouth {
    width: 16px;
    height: 4px;
    background: var(--gh-pink-dark);
    margin: 10px auto 0;
    border-radius: 2px;
}
.gh-pixel-heart {
    font-size: 40px;
    color: var(--gh-pink);
    text-shadow: 3px 3px 0 var(--gh-ink);
    animation: gh-heartbeat 1.2s ease-in-out infinite;
}
@keyframes gh-heartbeat {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.15); }
}

/* ---------- Form ---------- */
.gh-form {
    max-width: 340px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.gh-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.gh-field__label {
    font-size: 12px;
    font-weight: 900;
    color: var(--gh-purple);
    padding-left: 4px;
    letter-spacing: 0.04em;
}
.gh-input {
    width: 100%;
    box-sizing: border-box;
    padding: 14px 16px;
    font-size: 16px;
    font-weight: 700;
    color: var(--gh-ink);
    background: #fff;
    border: 3px solid var(--gh-ink);
    border-radius: var(--gh-radius);
    box-shadow: 3px 3px 0 var(--gh-ink);
    outline: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.gh-input::placeholder { color: #c4a0b0; font-weight: 500; }
.gh-input:focus {
    transform: translate(-1px, -1px);
    box-shadow: 4px 4px 0 var(--gh-pink);
    border-color: var(--gh-pink);
}

/* ---------- Buttons ---------- */
.gh-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 22px;
    font-size: 15px;
    font-weight: 900;
    font-family: inherit;
    color: var(--gh-ink);
    background: #fff;
    border: 3px solid var(--gh-ink);
    border-radius: var(--gh-radius);
    box-shadow: 4px 4px 0 var(--gh-ink);
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.1s ease, box-shadow 0.1s ease;
}
.gh-btn:hover {
    transform: translate(-1px, -1px);
    box-shadow: 5px 5px 0 var(--gh-ink);
}
.gh-btn:active {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0 var(--gh-ink);
}
.gh-btn--primary {
    background: var(--gh-pink);
    color: #fff;
}
.gh-btn--ghost {
    background: var(--gh-cream);
}
.gh-btn--block {
    display: flex;
    width: 100%;
    margin-top: 10px;
}
.gh-btn__sparkle { font-size: 14px; }

.gh-hint {
    font-size: 11px;
    color: var(--gh-purple);
    text-align: center;
    margin: 6px 0 0;
    min-height: 16px;
}
.gh-hint.is-error { color: var(--gh-pink-dark); font-weight: 900; }

/* ---------- Pyramid (calc stage) ---------- */
.gh-calc-label {
    text-align: center;
    font-size: 14px;
    font-weight: 900;
    color: var(--gh-pink-dark);
    margin-bottom: 20px;
    letter-spacing: 0.1em;
    animation: gh-blink 1s step-start infinite;
}
@keyframes gh-blink {
    50% { opacity: 0.3; }
}
.gh-pyramid {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 20px 4px;
}
.gh-pyramid__row {
    display: flex;
    gap: 8px;
    opacity: 0;
    transform: translateY(-8px);
    animation: gh-row-drop 0.5s forwards;
}
@keyframes gh-row-drop {
    to { opacity: 1; transform: translateY(0); }
}
.gh-pyramid__cell {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 3px solid var(--gh-ink);
    border-radius: var(--gh-radius);
    box-shadow: 3px 3px 0 var(--gh-ink);
    font-size: 18px;
    font-weight: 900;
    color: var(--gh-ink);
}
.gh-pyramid__cell--char {
    background: var(--gh-pink);
    color: #fff;
    font-size: 16px;
}
.gh-pyramid__cell--final {
    background: var(--gh-orange);
    animation: gh-cell-pop 0.6s ease-out;
}
@keyframes gh-cell-pop {
    0%   { transform: scale(0.6); }
    60%  { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* ---------- Result stage ---------- */
.gh-result-names {
    text-align: center;
    font-size: 14px;
    font-weight: 900;
    color: var(--gh-purple);
    margin-bottom: 16px;
    letter-spacing: 0.02em;
}
.gh-result-names b { color: var(--gh-ink); }

.gh-result-heart {
    position: relative;
    width: 220px;
    height: 200px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.gh-result-heart__shape {
    font-size: 200px;
    color: var(--gh-pink);
    text-shadow:
        5px 5px 0 var(--gh-ink),
        -2px -2px 0 #fff;
    line-height: 1;
    animation: gh-heart-pop 0.7s ease-out;
}
@keyframes gh-heart-pop {
    0%   { transform: scale(0); opacity: 0; }
    60%  { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(1); }
}
.gh-result-heart__percent {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -40%);
    font-size: 42px;
    font-weight: 900;
    color: #fff;
    text-shadow: 3px 3px 0 var(--gh-ink);
    letter-spacing: -0.02em;
}

.gh-result-comment {
    text-align: center;
    font-size: 16px;
    font-weight: 700;
    color: var(--gh-ink);
    background: #fff;
    border: 3px solid var(--gh-ink);
    border-radius: var(--gh-radius);
    box-shadow: 4px 4px 0 var(--gh-ink);
    padding: 16px 14px;
    margin: 0 auto 24px;
    max-width: 340px;
    line-height: 1.5;
}

.gh-result-pyramid {
    max-width: 340px;
    margin: 0 auto 24px;
    padding: 14px;
    background: var(--gh-cream);
    border: 3px solid var(--gh-ink);
    border-radius: var(--gh-radius);
    box-shadow: 3px 3px 0 var(--gh-ink);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}
.gh-result-pyramid .gh-pyramid__cell {
    width: 32px;
    height: 32px;
    font-size: 14px;
    box-shadow: 2px 2px 0 var(--gh-ink);
}
.gh-result-pyramid .gh-pyramid__row {
    animation: none;
    opacity: 1;
    transform: none;
    gap: 6px;
}

.gh-result-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 24px;
}

.gh-cta {
    max-width: 340px;
    margin: 0 auto;
    padding: 20px 18px 22px;
    background: var(--gh-pink-light);
    border: 3px dashed var(--gh-pink-dark);
    border-radius: 8px;
    text-align: center;
    /* 내부 ln-btn-block 그림자(4px)가 튀어나가지 않도록 여유 */
    margin-right: auto;
    margin-left: auto;
}
.gh-cta .gh-btn--block {
    /* 버튼 shadow 가 우하단으로 4px 나가므로 컨테이너 내부에서 미리 상쇄 */
    width: calc(100% - 4px);
}
.gh-cta__icon {
    font-size: 24px;
    color: var(--gh-pink-dark);
    margin-bottom: 6px;
}
.gh-cta__text {
    font-size: 14px;
    font-weight: 700;
    color: var(--gh-ink);
    margin-bottom: 14px;
    line-height: 1.5;
}

/* ---------- Mobile fit ---------- */
@media (max-width: 360px) {
    .gh-header__title { font-size: 19px; }
    .gh-pyramid__cell { width: 38px; height: 38px; font-size: 16px; }
    .gh-result-heart { width: 180px; height: 170px; }
    .gh-result-heart__shape { font-size: 170px; }
    .gh-result-heart__percent { font-size: 36px; }
}
