:root {
    --bg-color: #FFFFFF;
    --text-color: #0F172A;
    --text-muted: #64748B;
    --accent: #2563EB;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'aglet-mono', Consolas, monospace;
}

html,
body {
    background-color: var(--bg-color);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    min-height: 100dvh;
    /* 모바일 브라우저 상/하단 바 동적 오차 방지 */
    overflow-x: hidden;
}

/* 모바일 브라우저 상/하단 탭 영역(URL바 등) 제외하고 정확한 정중앙 배치를 위한 처리 */
@media (max-width: 768px) {
    body {
        min-height: 100svh;
    }
}

.workspace-container {
    padding: 1rem;
    max-width: 1000px;
    width: 100%;
    position: relative;
    /* z-index: 10; 제거됨 - 하위 요소들의 독립적인 z-index(로고는 뒤로, 글자는 앞으로) 사용을 위함 */
    pointer-events: none;
    /* Let drag pass through to canvas */
}

#canvas-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 20;
    /* 로고들(10, 20) 보다 앞쪽으로 배치하여 비주얼이 최상단에 오도록 설정 */
    pointer-events: auto;
    /* 3D control 상호작용 받기 */
}

.workspace-container * {
    pointer-events: auto;
    /* workspace 안의 요소들은 정상 클릭되게 복구 */
}

.header {
    text-align: center;
    margin-bottom: 3rem;
    animation: fadeInDown 0.8s ease-out forwards;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 400;
    letter-spacing: -1px;
    color: var(--text-color);
}

.subtitle {
    font-size: 1rem;
    font-weight: 400;
    letter-spacing: -1px;
    color: rgba(0, 0, 0, 0.2);
}

.main-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    animation: fadeInUp 0.8s ease-out 0.2s forwards;
    opacity: 0;
}

.comparison-slider {
    position: relative;
    width: 50%;
    /* 기존의 70% 사이즈로 추가 축소 (비주얼 대비) */
    max-width: 400px;
    user-select: none;
    -webkit-user-drag: none;
    display: flex;
    cursor: pointer;
}

.canvas-pixelated {
    display: block;
    width: 100%;
    height: auto;
    object-fit: contain;
}

/* 액션 패널 및 버튼 그룹 */
.actions-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    width: 100%;
    max-width: 450px;
}

.button-group {
    display: flex;
    gap: 1.2rem;
}

.action-btn {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background-color: var(--text-color);
    color: var(--bg-color);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s, background-color 0.2s;
}

.action-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 15px 35px rgba(37, 99, 235, 0.2);
    background-color: var(--accent);
    color: white;
}

.action-btn:active {
    transform: scale(0.95);
}

/* 시드 인풋 감싸는 그룹 */
.seed-input-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    background: rgba(0, 0, 0, 0.03);
    padding: 0.6rem 1.2rem;
    border-radius: 99px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    transition: background 0.2s, border-color 0.2s;
}

.seed-input-wrapper:focus-within {
    background: white;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.seed-input-wrapper label {
    font-size: 0.9rem;
    font-weight: 400;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    user-select: none;
}

#seed-input {
    background: transparent;
    border: none;
    outline: none;
    font-size: 1.1rem;
    font-weight: 400;
    color: var(--text-color);
    width: 100px;
    font-family: inherit;
    text-align: center;
}

/* 스피너 숨기기 (크롬/사파리/파폭) */
#seed-input::-webkit-outer-spin-button,
#seed-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    appearance: none;
    margin: 0;
}

#seed-input[type=number] {
    -moz-appearance: textfield;
    appearance: textfield;
}

/* 애니메이션 */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* -------------------------------- */
/* 카운트다운 타이머 등 메인 디스플레이 영역 */
/* -------------------------------- */
.main-display {
    position: fixed;
    /* 브라우저 뷰포트 기준 절대 중앙 고정 (3D 씬과 센터 완벽 동기화) */
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    pointer-events: none;
    /* Let drag pass through to canvas */
}

.countdown {
    font-size: 14px;
    font-weight: 400;
    color: var(--text-color);
    letter-spacing: 0.1em;
    line-height: 1.6;
    /* 줄바꿈 시 간격 확보 */
    font-variant-numeric: tabular-nums;
    /* 숫자 폭을 일정하게 맞춰 좌우 흔들림 방지 */
}

/* 로고가 3D 공간의 완벽한 중앙에 위치하도록 타이머 위치를 절대 좌표로 분리 */
.countdown-group {
    position: fixed;
    /* 독립적인 최상위 배치를 위해 fixed 사용 */
    top: 60%;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    /* 타이머와 스케줄 사이 간격 */
    z-index: 30;
    /* 비주얼(20) 보다 확연히 앞에 오도록 단독 지정 */
}

/* 텍스트 영역을 클릭하거나 드래그할 수 없게 하여, 그 뒤의 3D 캔버스가 이벤트를 받게 함 */
.countdown-group,
.countdown-group * {
    pointer-events: none;
    user-select: none;
    -webkit-user-select: none;
}

.exhibition-schedule {
    font-size: 13px;
    font-weight: 400;
    line-height: 1.6;
    color: rgba(0, 0, 0);
    letter-spacing: 0.05em;
}

/* 브라우저 하단 푸터 로고 */
.footer-logo {
    position: fixed;
    bottom: 2.5rem;
    /* 브라우저 하단 여백 */
    left: 50%;
    transform: translateX(-50%);
    /* 로고 높이 (적절한 크기로 조정) */
    width: 30%;
    max-width: 200px;
    z-index: 40;
    /* 3D 캔버스(30) 보다 앞쪽에 오도록 가장 높은 값 설정 */
    opacity: 0.85;
    /* 약간 투명하게 하여 은은하게 표시 */
    user-select: none;
    -webkit-user-drag: none;
    pointer-events: none;
    /* 3D 캔버스 조작 방해 금지 */
}