/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    /* 모바일 탭 하이라이트 제거 */
    -webkit-tap-highlight-color: transparent;
    /* 텍스트 선택 방지 */
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

:root {
    --color-primary: #FFB3D9;
    --color-secondary: #FFF8B8;
    --color-accent: #B8F4D9;
    --color-background: #FFFEF9;
    --color-text: #333333;
    --color-text-light: #666666;
    --shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.08);
    --shadow-medium: 0 8px 30px rgba(0, 0, 0, 0.12);
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Noto Sans KR', sans-serif;
    background: linear-gradient(135deg, var(--color-background) 0%, #FFF5F9 100%);
    color: var(--color-text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* Container */
.container {
    max-width: 800px;
    width: 100%;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header */
header {
    text-align: center;
    padding: 40px 0 20px;
    animation: fadeInDown 0.8s ease-out;
}

.logo {
    font-family: 'Poppins', sans-serif;
    font-size: 3rem;
    font-weight: 600;
    background: linear-gradient(135deg, var(--color-primary) 0%, #FF8EC7 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
}

.subtitle {
    font-size: 1.1rem;
    color: var(--color-text-light);
    font-weight: 400;
}

/* Main Content */
main {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px 0;
}

/* Cat Container */
.cat-container {
    margin-bottom: 40px;
    animation: fadeInUp 1s ease-out;
}

.cat-image-wrapper {
    position: relative;
    width: 300px;
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cat-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    animation: float 3s ease-in-out infinite;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.1));
    transition: var(--transition-smooth);
}

.cat-image:hover {
    transform: scale(1.05) rotate(2deg);
}

.cat-shadow {
    position: absolute;
    bottom: -20px;
    width: 60%;
    height: 20px;
    background: radial-gradient(ellipse, rgba(0, 0, 0, 0.15), transparent);
    border-radius: 50%;
    animation: shadowPulse 3s ease-in-out infinite;
}

/* Category Section */
.category-section {
    width: 100%;
    max-width: 650px;
    margin-bottom: 40px;
    animation: fadeInUp 1.1s ease-out;
}

.category-title {
    text-align: center;
    font-size: 1.4rem;
    color: var(--color-text);
    margin-bottom: 25px;
    font-weight: 600;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 15px;
}

.category-card {
    background: white;
    border: 2px solid transparent;
    border-radius: 15px;
    padding: 20px 15px;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    box-shadow: var(--shadow-soft);
    position: relative;
    overflow: hidden;
}

.category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
    opacity: 0;
    transition: var(--transition-smooth);
    z-index: 0;
}

.category-card:hover:not(.active) {
    transform: translateY(-5px);
    box-shadow: var(--shadow-medium);
    border-color: var(--color-primary);
}

.category-card:hover:not(.active)::before {
    opacity: 0.1;
}

.category-card.active {
    background: linear-gradient(135deg, var(--color-primary) 0%, #FF8EC7 100%);
    border-color: var(--color-primary);
    color: white;
    transform: translateY(-3px);
    box-shadow: var(--shadow-medium);
}

.category-card.active:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 10px 35px rgba(255, 142, 199, 0.35);
}

.category-card.active .category-icon {
    transform: scale(1.2);
}

.category-icon {
    font-size: 2rem;
    transition: var(--transition-smooth);
    position: relative;
    z-index: 1;
}

.category-name {
    font-size: 0.95rem;
    font-weight: 600;
    position: relative;
    z-index: 1;
}

.category-hint {
    text-align: center;
    font-size: 0.85rem;
    color: var(--color-text-light);
    margin-top: 10px;
    font-style: italic;
}

/* Button Container */
.button-container {
    animation: fadeInUp 1.3s ease-out;
}

.quote-button {
    background: linear-gradient(135deg, var(--color-primary) 0%, #FF8EC7 100%);
    color: white;
    border: none;
    padding: 18px 50px;
    font-size: 1.3rem;
    font-weight: 700;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: var(--shadow-medium);
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: 'Noto Sans KR', sans-serif;
    position: relative;
    overflow: hidden;
}

.quote-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.quote-button:hover::before {
    left: 100%;
}

.quote-button:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 12px 40px rgba(255, 142, 199, 0.4);
}

.quote-button:active {
    transform: translateY(-1px) scale(1.02);
}

.button-icon {
    font-size: 1.5rem;
    animation: sparkle 1.5s ease-in-out infinite;
}

/* Loading Overlay */
.loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 254, 249, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.loading-overlay.active {
    display: flex;
    animation: fadeIn 0.3s ease-out;
}

.loading-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.loading-cat {
    font-size: 5rem;
    animation: bounce 1s ease-in-out infinite;
}

.loading-cat-image {
    width: 200px;
    height: 200px;
    object-fit: contain;
    animation: bounce 1s ease-in-out infinite;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.15));
}

.loading-text {
    font-size: 1.3rem;
    color: var(--color-text);
    margin-top: 20px;
    font-weight: 500;
}

.loading-dots {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 15px;
}

.loading-dots span {
    width: 12px;
    height: 12px;
    background: var(--color-primary);
    border-radius: 50%;
    animation: dotPulse 1.4s ease-in-out infinite;
}

.loading-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.loading-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

.loading-ad-container {
    margin-top: 30px;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Footer */
footer {
    text-align: center;
    padding: 30px 0;
    color: var(--color-text-light);
    font-size: 0.9rem;
}

/* Animations */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-15px);
    }
}

@keyframes shadowPulse {
    0%, 100% {
        opacity: 0.15;
        transform: scale(1);
    }
    50% {
        opacity: 0.25;
        transform: scale(1.1);
    }
}

@keyframes sparkle {
    0%, 100% {
        transform: scale(1) rotate(0deg);
    }
    50% {
        transform: scale(1.2) rotate(180deg);
    }
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-20px);
    }
}

@keyframes dotPulse {
    0%, 80%, 100% {
        transform: scale(0);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .logo {
        font-size: 2.2rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .cat-image-wrapper {
        width: 250px;
        height: 250px;
    }

    .category-title {
        font-size: 1.2rem;
    }

    .category-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 12px;
    }

    .category-card {
        padding: 15px 10px;
    }

    .category-icon {
        font-size: 1.8rem;
    }

    .category-name {
        font-size: 0.85rem;
    }

    .quote-button {
        padding: 15px 40px;
        font-size: 1.1rem;
    }

    .loading-cat {
        font-size: 4rem;
    }

    .loading-text {
        font-size: 1.1rem;
    }

    .loading-cat-image {
        width: 150px;
        height: 150px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 15px;
    }

    header {
        padding: 30px 0 15px;
    }

    .logo {
        font-size: 1.8rem;
    }

    .cat-image-wrapper {
        width: 200px;
        height: 200px;
    }

    .category-title {
        font-size: 1.1rem;
        margin-bottom: 20px;
    }

    .category-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .category-card {
        padding: 18px 12px;
    }

    .category-icon {
        font-size: 2rem;
    }

    .category-name {
        font-size: 0.9rem;
    }

    .category-hint {
        font-size: 0.8rem;
    }

    .quote-button {
        padding: 12px 30px;
        font-size: 1rem;
    }
}
