* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    background: #fdfdfd;
    font-family: 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
    color: #333;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.container {
    width: 100%;
    max-width: 480px;
    padding: 20px;
    text-align: center;
}

header {
    margin-bottom: 30px;
}

.logo {
    font-size: 1.2rem;
    font-weight: 800;
    color: #ff8c00;
    margin-bottom: 10px;
}

header h1 {
    font-size: 1.8rem;
    font-weight: 900;
    margin-bottom: 8px;
    letter-spacing: -1px;
}

header p {
    color: #888;
    font-size: 0.95rem;
}

.test-card {
    background: white;
    border-radius: 32px;
    padding: 30px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.08);
    min-height: 400px;
}

/* 📁 업로드 박스 */
.upload-box {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border: 3px dashed #eee;
    background: #f8f9fa;
    border-radius: 24px;
    padding: 60px 20px;
    cursor: pointer;
    transition: all 0.3s;
}

.upload-box:hover, .upload-box.dragover {
    border-color: #ff8c00;
    background: #fff8f0;
}

.upload-icon { font-size: 3rem; margin-bottom: 20px; }
.upload-text strong { display: block; font-size: 1.1rem; margin-bottom: 8px; color: #1a1a1a; }
.upload-text span { font-size: 0.9rem; color: #999; }

/* 🖼️ 프리뷰 영역 */
.preview-wrapper {
    width: 200px;
    height: 200px;
    margin: 0 auto 30px;
    border-radius: 100px; /* 원형으로 변경 */
    overflow: hidden;
    background: #f0f0f0;
    border: 6px solid #fff;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

#image-preview { width: 100%; height: 100%; object-fit: cover; }
#webcam-container canvas { width: 100% !important; height: 100% !important; border-radius: 100px; }

/* 🏆 결과 강조 영역 */
#analysis-result h2 {
    font-size: 1.4rem;
    font-weight: 800;
    margin-bottom: 15px;
    color: #1a1a1a;
    line-height: 1.4;
    word-break: keep-all;
}

.main-result-box {
    background: #fff8f0;
    padding: 20px;
    border-radius: 20px;
    margin-top: 20px;
}

.match-percentage {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: #ff8c00;
}

.match-percentage span { font-size: 1.8rem; }

.bar-bg {
    height: 14px;
    background: #eee;
    border-radius: 7px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff8c00, #ffb800);
    border-radius: 7px;
    width: 0;
    transition: width 1s ease-out;
}

.btn-restart {
    width: 100%;
    padding: 18px;
    background: #1a1a1a;
    color: white;
    border: none;
    border-radius: 16px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    margin-top: 30px;
}

.hidden { display: none !important; }
.btn-webcam-link { background: none; border: none; color: #bbb; font-size: 0.8rem; margin-top: 15px; cursor: pointer; text-decoration: underline; }

/* 로딩 */
.loading-spinner { padding: 40px 0; }
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #ff8c00;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

footer { margin-top: 30px; font-size: 0.8rem; color: #ccc; }