@font-face {
    font-family: 'Paperozi';
    src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/2408-3@1.0/Paperlogy-1Thin.woff2') format('woff2');
    font-weight: 100;
    font-display: swap;
}

@font-face {
    font-family: 'Paperozi';
    src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/2408-3@1.0/Paperlogy-2ExtraLight.woff2') format('woff2');
    font-weight: 200;
    font-display: swap;
}

@font-face {
    font-family: 'Paperozi';
    src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/2408-3@1.0/Paperlogy-3Light.woff2') format('woff2');
    font-weight: 300;
    font-display: swap;
}

@font-face {
    font-family: 'Paperozi';
    src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/2408-3@1.0/Paperlogy-4Regular.woff2') format('woff2');
    font-weight: 400;
    font-display: swap;
}

@font-face {
    font-family: 'Paperozi';
    src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/2408-3@1.0/Paperlogy-5Medium.woff2') format('woff2');
    font-weight: 500;
    font-display: swap;
}

@font-face {
    font-family: 'Paperozi';
    src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/2408-3@1.0/Paperlogy-6SemiBold.woff2') format('woff2');
    font-weight: 600;
    font-display: swap;
}

@font-face {
    font-family: 'Paperozi';
    src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/2408-3@1.0/Paperlogy-7Bold.woff2') format('woff2');
    font-weight: 700;
    font-display: swap;
}

@font-face {
    font-family: 'Paperozi';
    src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/2408-3@1.0/Paperlogy-8ExtraBold.woff2') format('woff2');
    font-weight: 800;
    font-display: swap;
}

@font-face {
    font-family: 'Paperozi';
    src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/2408-3@1.0/Paperlogy-9Black.woff2') format('woff2');
    font-weight: 900;
    font-display: swap;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body{
    height: 100%;
    overscroll-behavior: none;     /* 지원 브라우저에서 바운스/풀투리프레시 차단 */
}

/* 디자인 가이드라인 변수 */
:root {
    /* 폰트 패밀리 */
    --font-primary: 'Paperozi', Pretendard, -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    
    /* 폰트 사이즈 */
    --font-size-xl: 18px;      /* 대제목 */
    --font-size-lg: 16px;      /* 제목 */
    --font-size-md: 14px;      /* 본문 */
    --font-size-sm: 12px;      /* 소제목, 라벨 */
    --font-size-xs: 11px;      /* 캡션, 부가정보 */
    
    /* 폰트 두께 */
    --font-weight-light: 300;
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    
    /* 색상 */
    --color-primary: #00a8e6;
    --color-primary-light: #e3f7ff;
    --color-text-primary: #333333;
    --color-text-secondary: #666666;
    --color-text-caption: #999999;
    --color-bg-primary: #ffffff;
    --color-bg-secondary: #fafafa;
    --color-bg-tertiary: #f8f8f8;
    --color-border: #e0e0e0;
    --color-border-light: #f0f0f0;
    --color-accent: #ff6b6b;
    --color-accent-light: #ffe4e1;
    
    /* 간격 */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 12px;
    --spacing-lg: 16px;
    --spacing-xl: 20px;
    --spacing-xxl: 24px;
    
    /* 둥근 모서리 */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    
    /* 그림자 */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 4px 12px rgba(0, 168, 230, 0.3);
    
    /* 줄간격 */
    --line-height-tight: 1.4;
    --line-height-normal: 1.6;
    --line-height-loose: 1.8;
}

body {
    font-family: var(--font-primary);
    background-color: var(--color-bg-primary);
    color: var(--color-text-primary);
    line-height: var(--line-height-normal);
    font-size: var(--font-size-md);
    
    min-height: 100vh;    /* fallback */
    min-height: 100dvh;   /* 주소창 변동 반영 (지원시 우선) */
}

main {
    width: 100%;
    height: 100%;

    margin: 0 auto;
    background-color: #ffffff;

    display: flex;
    flex-direction: column;

    max-width: 480px;
}

/* 헤더 */
.header {
    background-color: #ffffff;
    padding: 16px 20px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1;
}

.back-button {
    background: none;
    border: none;
    font-size: 20px;
    color: #333333;
    cursor: pointer;
    padding: 8px;
    margin-right: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-title {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-size: 18px;
    font-weight: 600;
    color: #333333;
}

.content-wrapper{
    flex: 1;
    overflow: auto;
    -webkit-overflow-scrolling: touch;  /* iOS 부드러운 스크롤 */
    overscroll-behavior: contain;       /* 내부 바운스/전파 억제 */
}

/* 1. 메인 통계 섹션 */
.main-stats {
    padding: 24px 20px;
    background-color: #ffffff;
}

.stats-title {
    font-size: 16px;
    color: #333333;
    font-weight: 600;
    margin-bottom: 20px;
}

.stats-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-xxl);
}

.stat-card {
    background-color: var(--color-bg-tertiary);
    padding: var(--spacing-lg) var(--spacing-md);
    border-radius: var(--radius-md);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.stat-card.primary {
    background-color: var(--color-primary-light);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
}

.stat-card:nth-child(1)::before {
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
}

.stat-card:nth-child(2)::before {
    background: linear-gradient(90deg, #f093fb 0%, #f5576c 100%);
}

.stat-card:nth-child(3)::before {
    background: linear-gradient(90deg, #4facfe 0%, #00f2fe 100%);
}

/* .stat-icon 제거됨 - 중복 제거 */

.stat-number {
    font-family: var(--font-primary);
    font-size: 22px;
    font-weight: var(--font-weight-bold);
    color: var(--color-text-primary);
    margin-bottom: var(--spacing-sm);
}

.stat-label {
    font-family: var(--font-primary);
    font-size: var(--font-size-xs);
    color: var(--color-text-secondary);
}

/* 실시간 피드 */
.live-feed {
    background-color: var(--color-bg-secondary);
    border-radius: var(--radius-md);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
}

.feed-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
}

.live-badge {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    color: var(--color-accent);
    font-family: var(--font-primary);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
}

.live-dot {
    width: var(--spacing-sm);
    height: var(--spacing-sm);
    background-color: var(--color-accent);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.feed-title {
    font-family: var(--font-primary);
    font-size: var(--font-size-md);
    color: var(--color-text-primary);
    font-weight: var(--font-weight-medium);
}

.feed-items {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.feed-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm);
    background-color: var(--color-bg-primary);
    border-radius: var(--radius-sm);
    font-family: var(--font-primary);
    font-size: var(--font-size-sm);
}

.feed-time {
    min-width: 50px;
    color: var(--color-text-caption);
    font-family: var(--font-primary);
    font-size: var(--font-size-xs);
    text-align: center;
    flex-shrink: 0;
}

.feed-text {
    flex: 1;
    color: var(--color-text-primary);
    font-family: var(--font-primary);
}

.feed-status {
    font-family: var(--font-primary);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    color: var(--color-primary);
    min-width: 30px;
    text-align: center;
    flex-shrink: 0;
}

.feed-notice {
    margin-top: 12px;
    padding: 8px;
    background-color: #e3f7ff;
    border-radius: 6px;
    font-size: 12px;
    color: #00a8e6;
    text-align: center;
}

/* 주차별 통계 */
.week-stats {
    background-color: #f8f8f8;
    border-radius: 8px;
    padding: 16px;
}

.week-stats-title {
    font-size: 14px;
    color: #666666;
    margin-bottom: 12px;
    font-weight: 500;
}

.week-bars {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.week-bar-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.week-label {
    min-width: 60px;
    font-size: 12px;
    color: #666666;
}

.week-progress {
    flex: 1;
    height: 20px;
    background-color: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.week-fill {
    height: 100%;
    background: linear-gradient(90deg, #00a8e6 0%, #0090c9 100%);
    border-radius: 10px;
    transition: width 0.5s ease;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 8px;
}

.week-percent {
    font-size: 10px;
    color: white;
    font-weight: 600;
}

.week-count {
    min-width: 30px;
    text-align: right;
    font-size: 12px;
    color: #333333;
    font-weight: 500;
}

/* 컨테이너 통일 */
.content-wrapper {
    margin: 0 auto;
}

/* 섹션 공통 스타일 */
section {
    padding: 24px 20px;
}

.section-card {
    background-color: #ffffff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}
/* 2. 오늘의 닮은꼴 평가 섹션 */
.vote-section {
    padding: 24px 20px;
    background-color: #fafafa;
    border-top: 1px solid #f0f0f0;
}

.section-title {
    font-size: 18px;
    font-weight: 600;
    color: #333333;
    margin-bottom: 16px;
}

.vote-card {
    background-color: #ffffff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.vote-images {
    display: flex;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-lg);
}

.vote-image {
    flex: 1;
    height: 150px;
    background-color: var(--color-border-light);
    border-radius: var(--radius-md);
    position: relative;
    overflow: hidden;
}

.vote-image img{
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.vote-label {
    position: absolute;
    bottom: var(--spacing-sm);
    left: var(--spacing-sm);
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-sm);
    font-family: var(--font-primary);
    font-size: var(--font-size-xs);
}

.vote-question {
    font-family: var(--font-primary);
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-medium);
    margin-bottom: var(--spacing-md);
    color: var(--color-text-primary);
}

.similarity-scale {
    margin-bottom: 16px;
}

.scale-labels {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #999999;
    margin-bottom: 8px;
}

.scale-track {
    height: 40px;
    background: linear-gradient(to right, #f0f0f0 0%, #e3f7ff 50%, #00a8e6 100%);
    border-radius: 20px;
    position: relative;
    cursor: pointer;
}

.scale-thumb {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 32px;
    height: 32px;
    background-color: white;
    border: 3px solid #00a8e6;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.vote-buttons {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-lg);
}

.vote-btn {
    padding: var(--spacing-md) var(--spacing-sm);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background-color: var(--color-bg-primary);
    font-family: var(--font-primary);
    font-size: var(--font-size-sm);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.vote-btn .emoji {
    font-size: 20px;
    line-height: 1;
}

.vote-btn .label {
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
    color: var(--color-text-primary);
}

.vote-btn:hover {
    background-color: var(--color-bg-tertiary);
    border-color: var(--color-primary);
}

.vote-btn.selected {
    background-color: var(--color-primary-light);
    border-color: var(--color-primary);
    color: var(--color-primary);
    font-weight: var(--font-weight-semibold);
}

.vote-result {
    display: none;
    background-color: var(--color-bg-tertiary);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    margin-top: var(--spacing-md);
}

.vote-result.show {
    display: block;
}

.result-summary {
    text-align: center;
    font-family: var(--font-primary);
    font-size: var(--font-size-md);
    color: var(--color-text-primary);
    margin-bottom: var(--spacing-md);
}

.result-highlight {
    font-family: var(--font-primary);
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
    color: var(--color-primary);
}

/* 3. 응원 메시지 섹션 */
.message-section {
    background-color: var(--color-bg-primary);
}

.message-list {
    margin-top: var(--spacing-lg);
}

.message-item {
    padding: var(--spacing-lg);
    background-color: var(--color-bg-tertiary);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-md);
}

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-sm);
}

.message-author {
    font-family: var(--font-primary);
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-medium);
    color: var(--color-primary);
}

.message-time {
    font-family: var(--font-primary);
    font-size: var(--font-size-sm);
    color: var(--color-text-caption);
}

.message-content {
    font-family: var(--font-primary);
    font-size: var(--font-size-md);
    color: var(--color-text-primary);
    line-height: var(--line-height-tight);
}

.message-reactions {
    display: flex;
    gap: var(--spacing-md);
    margin-top: var(--spacing-md);
}

.btn-icon {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 16px;
    font-size: 12px;
    color: #666666;
    cursor: pointer;
    transition: all 0.2s;

    &.non_border{
        border: none;
        padding: 0;
        background-color: initial;
    }
}

.btn-icon:hover {
    background-color: #f0f0f0;
}

.btn-icon.active {
    background-color: #ffe4e1;
    border-color: #ff6b6b;
    color: #ff6b6b;
}

/* 4. 완성 갤러리 with 좋아요 */
.gallery-section {
    /* padding: 24px 0; */
    background-color: #fafafa;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.gallery-card {
    background-color: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.gallery-preview {
    position: relative;
    aspect-ratio: 1;
    background-color: #f0f0f0;
    border-radius: 8px;
    overflow: hidden;
}

.gallery-preview img{
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.gallery-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
}

.gallery-footer {
    padding: 12px;
}

.gallery-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.gallery-baby-name {
    font-size: 13px;
    font-weight: 500;
    color: #333333;
}

.gallery-date {
    font-size: 11px;
    color: #999999;
}

.toggle-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px;
    background-color: #f8f8f8;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    color: #666666;
    cursor: pointer;
    transition: all 0.2s;

    &.border{
        padding: 4px 8px;
        background-color: #ffffff;
        border: 1px solid #e0e0e0;
        width: auto;
    }
}

.toggle-btn:hover {
    background-color: #ffe4e1;
    color: #ff6b6b;
}

.toggle-btn.active {
    background-color: #ffe4e1;
    color: #ff6b6b;
}

/* 5. 오늘의 정보 */
.info-section {
    background-color: #ffffff;
}

.info-card {
    background-color: #e3f7ff;
    border-radius: 12px;
    padding: 20px;
    border-left: 4px solid #00a8e6;
}

.info-title {
    font-size: 14px;
    font-weight: 600;
    color: #00a8e6;
    margin-bottom: 12px;
}

.info-content {
    font-size: 14px;
    color: #333333;
    line-height: 1.6;
}

.info-tips {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #d0e8f2;
}

.info-tip {
    display: flex;
    align-items: flex-start;
    margin-bottom: 8px;
}

.tip-number {
    min-width: 24px;
    height: 24px;
    background-color: #00a8e6;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    margin-right: 12px;
}

.tip-text {
    font-size: 13px;
    color: #666666;
    line-height: 1.5;
}

/* 메시지 입력 */
.message-input-box {
    margin-top: 16px;
    padding: 12px;
    background-color: #f8f8f8;
    border-radius: 8px;
}

.message-input {
    width: 100%;
    padding: 12px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-family: var(--font-primary);
    font-size: 14px;
    resize: none;
    margin-bottom: 8px;
}

.message-input::placeholder {
    font-family: var(--font-primary);
    color: var(--color-text-caption);
}

.message-submit {
    width: 100%;
    padding: 12px;
    background-color: #00a8e6;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

/* 플로팅 CTA */
.floating-cta {
    position: sticky;
    bottom: 20px;
    width: 100%;
    z-index: 1;
    display: flex;
    justify-content: center;
    padding: 0 2.5%;
}

.cta-button {
    width: 95%;
    background-color: var(--color-primary);
    color: white;
    border: none;
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    font-family: var(--font-primary);
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-semibold);
    cursor: pointer;
    box-shadow: var(--shadow-lg);
}

/* 삭제할 스타일 제거 */

.participant-count {
    text-align: center;
    font-family: var(--font-primary);
    font-size: var(--font-size-sm);
    color: var(--color-text-caption);
    margin-top: var(--spacing-sm);
}

/* 이미지 모달 */
.l_modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 9999;
    padding: var(--spacing-lg);
}

.l_modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s;
}

.l_modal_content {
    position: relative;
    max-width: 95vw;
    max-height: 95vh;
    background: var(--color-bg-primary);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.l_modal_close {
    position: absolute;
    top: var(--spacing-md);
    right: var(--spacing-md);
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 20px;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.l_modal_close:hover {
    background: rgba(0, 0, 0, 0.7);
}

.l_modal_images {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
    padding: var(--spacing-xl);
    overflow-y: auto;
    max-height: 90vh;
}

.l_modal_image_item {
    text-align: center;
}

.l_modal_image_label {
    display: block;
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text-primary);
    margin-bottom: var(--spacing-md);
    font-family: var(--font-primary);
}

.l_modal_image_item img {
    max-width: 100%;
    width: 100%;
    height: 300px;
    border-radius: var(--radius-md);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    object-fit: cover;
}

.l_modal_open {
    overflow: hidden;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* 데스크톱 환경에서 가로 배치 */
@media (min-width: 768px) {
    .l_modal_content {
        max-width: 1000px;
    }
    
    .l_modal_images {
        flex-direction: row;
        justify-content: center;
        align-items: flex-start;
        padding: var(--spacing-xl) var(--spacing-xxl);
    }
    
    .l_modal_image_item {
        flex: 1;
        max-width: 400px;
    }
    
    .l_modal_image_item img {
        height: 400px;
    }
}

/* 모바일 최적화 */
@media (max-width: 767px) {
    .l_modal {
        padding: var(--spacing-md);
    }
    
    .l_modal_content {
        max-width: 100%;
        max-height: 100%;
    }
    
    .l_modal_images {
        padding: var(--spacing-lg);
        gap: var(--spacing-xl);
    }
    
    .l_modal_image_item img {
        height: 250px;
    }
    
    .l_modal_close {
        top: var(--spacing-sm);
        right: var(--spacing-sm);
        width: 36px;
        height: 36px;
        font-size: 18px;
    }
}