@font-face {
    font-family: 'Pretendard-Regular';
    src: url('https://cdn.jsdelivr.net/gh/MACHI08/aurahud-fonts@main/Pretendard-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Pretendard-Regular', -apple-system, BlinkMacSystemFont, system-ui, 'Segoe UI', 'Noto Sans KR', sans-serif;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.app {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.card {
    width: 100%;
    max-width: 640px;
    padding: 20px 24px 24px;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
}

.card-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 12px;
    text-align: center;
}

.button-row {
    margin-top: 4px;
    margin-bottom: 8px;
    display: flex;
    justify-content: center;
}

.content-row {
    display: flex;
    gap: 32px; /* 웹캠과 결과 영역 사이 여유를 조금 더 넓게 */
    margin-top: 12px;
}

.cam-panel {
    flex: 0 0 auto;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

#webcam-container {
    display: flex;
    justify-content: center;
}

/* 웹캠 화면 모서리를 살짝 둥글게 */
#webcam-container canvas {
    border-radius: 14px;
    overflow: hidden;
}

.info-panel {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.bottom-panel {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#label-container {
    margin-top: 16px;
    font-size: 14px;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

#result-title {
    display: none; /* 나이 추정 전에는 보이지 않음 */
    font-weight: 700;
    text-align: center;
}

#result-age {
    display: none; /* 나이 추정 전에는 보이지 않음 */
    font-size: 13px;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.7);
    align-self: center;
}

#result-advice {
    display: none; /* 나이 추정 전에는 보이지 않음 */
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.4);
}

/* 버튼 주변 원형 링이 번지는 이펙트 */
button.burst-active::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 0;
    height: 0;
    border-radius: 50%;
    border: 2px solid currentColor; /* 버튼 글자 색상 기반 */
    opacity: 0.8;
    pointer-events: none;
    animation: button-burst 0.4s ease-out forwards;
}

@keyframes button-burst {
    0% {
        width: 0;
        height: 0;
        opacity: 0.8;
    }
    100% {
        width: 220%;
        height: 220%;
        opacity: 0;
    }
}

button {
    padding: 8px 14px;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    margin-right: 8px;
    transition: transform 0.1s ease, box-shadow 0.2s ease, background-color 0.2s ease, color 0.2s ease;
    position: relative;
    overflow: hidden; /* 버튼 밖으로 이펙트가 삐져나가지 않도록 */
}

button:disabled {
    cursor: default;
    opacity: 0.7;
    box-shadow: none;
    transform: none;
}

#progress-wrapper {
    width: 220px;
    height: 16px;
    border-radius: 8px;
    margin: 10px auto 0;
    display: none;
    border: 1px solid #999;
}

#progress-bar {
    height: 100%;
    width: 0%;
    border-radius: 8px;
}

#progress-text {
    margin-top: 4px;
    font-size: 12px;
    text-align: center;
    display: none;
}

/* 작은 화면에서는 위아래로 쌓이도록 */
@media (max-width: 600px) {
    .card {
        max-width: 100%;
    }

    .content-row {
        flex-direction: column;
        align-items: center;
    }

    #progress-wrapper {
        margin-left: auto;
        margin-right: auto;
    }
}

/* ========= 1) 화이트 & 블루 미니멀 (theme-light) ========= */
body.theme-light {
    background-color: #f3f4f6;
    color: #111827;
}

body.theme-light .card {
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
}

body.theme-light .card-title {
    color: #111827;
}

body.theme-light button {
    background-color: #2563eb;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

body.theme-light button#restart-button {
    background-color: #ffffff;
    color: #2563eb;
    border: 1px solid #2563eb;
    box-shadow: none;
}

body.theme-light button:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35);
}

body.theme-light #progress-wrapper {
    border-color: #bfdbfe;
}

body.theme-light #progress-bar {
    background: linear-gradient(to right, #60a5fa, #2563eb);
}

body.theme-light #result-advice {
    background-color: #eff6ff;
}

/* ========= 2) 다크 & 네온 (theme-dark) ========= */
body.theme-dark {
    background-color: #020617;
    color: #e5e7eb;
}

body.theme-dark .card {
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid #1f2937;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.7);
}

body.theme-dark .card-title {
    color: #e5e7eb;
}

body.theme-dark button {
    background-color: #0f172a;
    color: #e5e7eb;
    border: 1px solid #38bdf8;
    box-shadow: 0 4px 14px rgba(56, 189, 248, 0.5);
}

body.theme-dark button#restart-button {
    border-color: #22c55e;
    color: #bbf7d0;
}

body.theme-dark button:hover:not(:disabled) {
    background-color: #020617;
    transform: translateY(-1px);
    box-shadow: 0 8px 22px rgba(56, 189, 248, 0.7);
}

body.theme-dark #progress-wrapper {
    border-color: #374151;
    background-color: #020617;
}

body.theme-dark #progress-bar {
    background: linear-gradient(to right, #22c55e, #0ea5e9);
}

body.theme-dark #progress-text {
    color: #e5e7eb;
}

body.theme-dark #result-age {
    border-color: #38bdf8;
}

body.theme-dark #result-advice {
    background-color: rgba(15, 23, 42, 0.9);
    border-color: #1f2937;
}

/* ========= 3) 파스텔 카드형 귀여운 스타일 (theme-pastel) ========= */
body.theme-pastel {
    background-color: #fff7d6;
    color: #374151;
}

body.theme-pastel .card {
    background-color: #ffffff;
    border: 2px solid #fde68a;
    box-shadow: 0 10px 22px rgba(251, 191, 36, 0.35);
}

body.theme-pastel .card-title {
    color: #92400e;
}

body.theme-pastel button {
    background-color: #f59e0b;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
}

body.theme-pastel button#restart-button {
    background-color: #ffffff;
    color: #f97316;
    border: 1px solid #fb923c;
    box-shadow: none;
}

body.theme-pastel button:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 7px 18px rgba(245, 158, 11, 0.45);
}

body.theme-pastel #progress-wrapper {
    border-color: #fed7aa;
}

body.theme-pastel #progress-bar {
    background: linear-gradient(to right, #bef264, #facc15);
}

body.theme-pastel #progress-text {
    color: #92400e;
    font-weight: 500;
}

body.theme-pastel #result-age {
    border-color: #fcd34d;
}

body.theme-pastel #result-advice {
    background-color: #fffbeb;
    border-color: #fed7aa;
}


