* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    overflow-x: hidden;
    font-family: -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif;
}

body {
    background: linear-gradient(180deg, #7ec8f2 0%, #a9dcf7 45%, #d7f0fc 100%);
    min-height: 100vh;
}

/* ---------------- 하늘 & 구름 ---------------- */

.sky {
    position: fixed;
    inset: 0;
    overflow: hidden;
    z-index: 0;
    pointer-events: none;
}

.cloud {
    position: absolute;
    background: #ffffff;
    border-radius: 50%;
    opacity: 0.9;
    filter: blur(0.2px);
}

.cloud::before,
.cloud::after {
    content: "";
    position: absolute;
    background: #ffffff;
    border-radius: 50%;
}

.cloud1 {
    width: 100px;
    height: 40px;
    top: 12%;
    left: -160px;
    animation: driftRight 42s linear infinite;
}

.cloud1::before {
    width: 60px;
    height: 60px;
    top: -30px;
    left: 10px;
}

.cloud1::after {
    width: 46px;
    height: 46px;
    top: -20px;
    left: 55px;
}

.cloud2 {
    width: 70px;
    height: 30px;
    top: 26%;
    left: -120px;
    animation: driftRight 58s linear infinite;
    animation-delay: -14s;
}

.cloud2::before {
    width: 42px;
    height: 42px;
    top: -20px;
    left: 8px;
}

.cloud2::after {
    width: 32px;
    height: 32px;
    top: -14px;
    left: 38px;
}

.cloud3 {
    width: 130px;
    height: 50px;
    top: 62%;
    left: -200px;
    opacity: 0.8;
    animation: driftRight 66s linear infinite;
    animation-delay: -30s;
}

.cloud3::before {
    width: 74px;
    height: 74px;
    top: -38px;
    left: 12px;
}

.cloud3::after {
    width: 56px;
    height: 56px;
    top: -26px;
    left: 68px;
}

.cloud4 {
    width: 80px;
    height: 32px;
    top: 78%;
    left: -140px;
    opacity: 0.85;
    animation: driftRight 50s linear infinite;
    animation-delay: -8s;
}

.cloud4::before {
    width: 46px;
    height: 46px;
    top: -22px;
    left: 8px;
}

.cloud4::after {
    width: 36px;
    height: 36px;
    top: -16px;
    left: 42px;
}

@keyframes driftRight {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(calc(100vw + 260px));
    }
}

/* ---------------- 사용자 페이지 ---------------- */

.stage {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    font-family: 'Gowun Dodum', -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif;
}

.card {
    position: relative;
    width: 100%;
    max-width: 380px;
    min-width: 0;
    background: #ffffff;
    border-radius: 28px;
    padding: 32px 24px;
    box-shadow: 0 16px 40px rgba(30, 90, 150, 0.18);
    text-align: center;
}

.question-card {
    max-width: 320px;
    padding: 40px 20px 32px;
    margin-top: 8vh;
}

.hidden {
    display: none !important;
}

.card-exit {
    animation: cardExit 0.45s ease forwards;
}

.card-enter {
    animation: cardEnter 0.45s ease forwards;
}

@keyframes cardExit {
    from {
        opacity: 1;
        transform: scale(1) rotateX(0deg);
    }
    to {
        opacity: 0;
        transform: scale(1.08) rotateX(14deg);
    }
}

@keyframes cardEnter {
    from {
        opacity: 0;
        transform: scale(0.85) translateY(24px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.calendar-card .intro {
    color: #6a8bab;
    font-size: 0.95rem;
    margin: 0 0 12px;
}

.question-card .question {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2b3a4a;
    margin: 0;
    line-height: 1.4;
}

.button-area {
    position: relative;
    height: 160px;
    margin-top: 28px;
}

.btn {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 104px;
    transform: translate(-50%, -50%) scale(1);
    border: none;
    border-radius: 999px;
    padding: 14px 0;
    font-size: 1rem;
    font-weight: 700;
    text-align: center;
    cursor: pointer;
    transition: transform 0.35s ease, left 0.35s ease, top 0.35s ease, opacity 0.3s ease;
    box-shadow: 0 8px 18px rgba(30, 90, 150, 0.2);
}

.yes-btn {
    top: 50%;
    left: 25%;
    background: linear-gradient(135deg, #ff9ec7, #ffd36e);
    color: #ffffff;
    z-index: 2;
}

.no-btn {
    top: 50%;
    left: 75%;
    background: #ffffff;
    color: #6a8bab;
    border: 2px solid #cfe4ff;
    z-index: 3;
}

/* ---------------- 달력 ---------------- */

.calendar-card h2 {
    margin: 0 0 12px;
    font-size: 1.15rem;
    color: #2b3a4a;
}

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

.nav-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #4a90d9;
    cursor: pointer;
    padding: 4px 10px;
}

.calendar-title {
    font-weight: 700;
    color: #2b3a4a;
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    font-size: 0.75rem;
    color: #9db3c8;
    text-align: center;
    margin-bottom: 4px;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.calendar-cell {
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 0.85rem;
    color: #b9c6d4;
}

.calendar-cell.empty {
    visibility: hidden;
}

.calendar-cell.disabled {
    color: #d7e2ec;
}

.calendar-cell.has-schedule {
    position: relative;
    background: #eaf4ff;
    color: #2b7de9;
    font-weight: 700;
    cursor: pointer;
}

.calendar-cell.has-schedule::after {
    content: "";
    position: absolute;
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%);
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #2b7de9;
}

.calendar-cell.selected {
    background: #2b7de9;
    color: #ffffff;
}

.calendar-cell.selected::after {
    background: #ffffff;
}

.time-list {
    margin-top: 18px;
    text-align: left;
}

.time-list h3 {
    font-size: 0.95rem;
    color: #2b3a4a;
    margin: 0 0 8px;
}

.time-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.time-option {
    border: 2px solid #cfe4ff;
    background: #ffffff;
    border-radius: 14px;
    padding: 10px;
    font-size: 0.95rem;
    color: #2b3a4a;
    cursor: pointer;
    text-align: center;
}

.time-option.selected {
    border-color: #2b7de9;
    background: #eaf4ff;
    font-weight: 700;
}

.confirm-btn {
    position: static;
    display: block;
    width: 100%;
    margin-top: 20px;
    transform: none;
    background: linear-gradient(135deg, #6fb1ff, #2b7de9);
    color: #ffffff;
}

.confirm-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ---------------- 이름 입력 ---------------- */

.name-card h2 {
    margin: 0 0 16px;
    color: #2b3a4a;
}

.name-input {
    width: 100%;
    padding: 14px;
    border-radius: 16px;
    border: 2px solid #cfe4ff;
    font-size: 1rem;
    text-align: center;
    margin-bottom: 16px;
}

/* ---------------- 완료 화면 ---------------- */

.done-card .final-message {
    font-size: 1.2rem;
    font-weight: 700;
    color: #2b3a4a;
    line-height: 1.7;
    margin: 0;
}

/* ---------------- 어드민 페이지 ---------------- */

.admin-body {
    background: #eaf6ff;
}

.admin-wrap {
    max-width: 640px;
    margin: 0 auto;
    padding: 24px 16px 60px;
}

.admin-wrap h1 {
    color: #2b3a4a;
    font-size: 1.4rem;
}

.admin-card {
    background: #ffffff;
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 8px 22px rgba(30, 90, 150, 0.1);
    overflow-x: auto;
}

.admin-card h2 {
    margin: 0 0 14px;
    font-size: 1.05rem;
    color: #2b3a4a;
}

.admin-form label {
    display: block;
    margin-bottom: 14px;
    font-size: 0.9rem;
    color: #4a5a6a;
}

.admin-form input,
.admin-form textarea {
    display: block;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    margin-top: 6px;
    padding: 10px;
    border-radius: 10px;
    border: 1px solid #cfd9e3;
    font-size: 0.95rem;
    font-family: inherit;
}

.admin-form input[type="date"],
.admin-form input[type="time"] {
    font-size: 0.85rem;
    padding: 8px 6px;
}

.admin-form button,
.admin-table button[type="submit"] {
    border: none;
    border-radius: 999px;
    padding: 10px 22px;
    font-weight: 700;
    cursor: pointer;
    background: #2b7de9;
    color: #ffffff;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.admin-table th,
.admin-table td {
    border-bottom: 1px solid #eef2f6;
    padding: 8px 6px;
    text-align: left;
}

.danger-btn {
    border: none;
    border-radius: 999px;
    padding: 6px 14px;
    background: #ff6b6b;
    color: #ffffff;
    cursor: pointer;
    font-weight: 700;
}

/* ---------------- 반응형 (320px 이상) ---------------- */

@media (max-width: 360px) {
    .card {
        padding: 24px 16px;
    }

    .question-card .question {
        font-size: 1.35rem;
    }

    .btn {
        padding: 13px 22px;
        font-size: 0.95rem;
    }
}
