:root {
    --primary-color: #FF4757;
    --secondary-color: #2F3542;
    --bg-color: #FFF9F0;
    --card-bg: #FFFFFF;
    --accent-color: #FFA502;
    --text-color: #2F3542;
    --shadow: 0 10px 30px rgba(0,0,0,0.1);
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

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

body {
    font-family: 'Nanum Gothic', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Hero Section */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: radial-gradient(circle at center, #FFFFFF 0%, #FFF9F0 100%);
}

.title {
    font-family: 'Outfit', sans-serif;
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.highlight {
    color: var(--primary-color);
    position: relative;
    display: inline-block;
}

.highlight::after {
    content: '';
    position: absolute;
    bottom: 5px;
    left: 0;
    width: 100%;
    height: 15px;
    background: rgba(255, 71, 87, 0.2);
    z-index: -1;
}

.subtitle {
    font-size: 1.2rem;
    color: #747d8c;
    margin-bottom: 2rem;
}

.mascot-svg-container {
    width: 250px;
    height: 250px;
    margin: 0 auto;
    filter: drop-shadow(0 10px 20px rgba(0,0,0,0.1));
}

.wing-l {
    animation: flapL 2s ease-in-out infinite;
    transform-origin: 40px 110px;
}

.wing-r {
    animation: flapR 2s ease-in-out infinite;
    transform-origin: 160px 110px;
}

@keyframes flapL {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(15deg); }
}

@keyframes flapR {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(-15deg); }
}

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

.cta-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 1.2rem 3rem;
    font-size: 1.2rem;
    font-weight: 800;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(255, 71, 87, 0.3);
    transition: var(--transition);
}

.mode-selector {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.cta-btn.secondary {
    background-color: var(--secondary-color);
    box-shadow: 0 10px 20px rgba(47, 53, 66, 0.3);
}

.cta-btn.secondary:hover {
    box-shadow: 0 15px 25px rgba(47, 53, 66, 0.4);
}

/* Fortune Section */
#fortune-section {
    padding: 100px 0;
    background-color: white;
    min-height: 100vh;
}

.section-title {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 3rem;
}

.deck {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 15px;
    perspective: 1000px;
}

.card {
    aspect-ratio: 5/8;
    background-color: var(--primary-color);
    border: 4px solid white;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: rgba(255,255,255,0.3);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: var(--transition);
    position: relative;
    transform-style: preserve-3d;
}

.card.shuffling {
    animation: cardShuffle 0.8s ease-in-out infinite;
}

@keyframes cardShuffle {
    0% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(10px, -10px) rotate(5deg); }
    50% { transform: translate(-10px, 10px) rotate(-5deg); }
    75% { transform: translate(10px, 10px) rotate(5deg); }
    100% { transform: translate(0, 0) rotate(0deg); }
}

.card:hover {
    transform: translateY(-10px) rotateY(10deg) scale(1.05);
    box-shadow: 0 15px 30px rgba(255, 71, 87, 0.3);
    z-index: 10;
}

.card.selected {
    transform: scale(0.9);
    filter: grayscale(0.5) brightness(0.7);
    cursor: default;
}

.card::before {
    content: '🧧';
    font-size: 2.5rem;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(8px);
}

.modal.hidden {
    display: none;
}

/* Modal Result Layout */
.result-container {
    display: flex;
    flex-direction: column;
    gap: 30px;
    max-height: 70vh;
    overflow-y: auto;
    padding-right: 10px;
}

.modal-content {
    background: white;
    padding: 3rem;
    border-radius: 40px;
    max-width: 600px;
    width: 95%;
    text-align: center;
    position: relative;
    animation: zoomIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes zoomIn {
    from { opacity: 0; transform: scale(0.5); }
    to { opacity: 1; transform: scale(1); }
}

.close-btn {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 2rem;
    cursor: pointer;
    color: #a4b0be;
    z-index: 10;
}

.result-item {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 15px;
    border-radius: 20px;
    background: #f8f9fa;
    animation: slideIn 0.5s ease-out forwards;
    opacity: 0;
}

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

.result-tag {
    background: var(--primary-color);
    color: white;
    padding: 5px 12px;
    border-radius: 10px;
    font-weight: 800;
    font-size: 0.8rem;
    margin-bottom: 5px;
    display: inline-block;
}

.card-display {
    flex-shrink: 0;
    width: 100px;
    aspect-ratio: 5/8;
    perspective: 1000px;
}

.card-inner {
    width: 100%;
    height: 100%;
    position: relative;
    transition: transform 0.8s;
    transform-style: preserve-3d;
}

.card-inner.flipped {
    transform: rotateY(180deg);
}

.card-front, .card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 15px;
    border: 8px solid white;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-front {
    background-color: var(--primary-color);
    font-size: 3rem;
    color: white;
}

.card-back {
    background-color: white;
    transform: rotateY(180deg);
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
}

.fortune-text h4 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.fortune-text p {
    font-size: 1.1rem;
    color: #57606f;
}

.retry-btn {
    margin-top: 2rem;
    background: #f1f2f6;
    border: none;
    padding: 1rem 2rem;
    border-radius: 30px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}

.retry-btn:hover {
    background: #dfe4ea;
}

.footer {
    padding: 3rem 0;
    text-align: center;
    font-size: 0.9rem;
    color: #a4b0be;
}

.hidden {
    display: none !important;
}

.collection-link {
    background: none;
    border: none;
    color: var(--primary-color);
    text-decoration: underline;
    font-weight: 700;
    margin-top: 1.5rem;
    cursor: pointer;
    font-size: 1rem;
}

.mascot-mini-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

.mascot-bubble {
    background: #f1f2f6;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 0.9rem;
    position: relative;
    display: inline-block;
    color: #2f3542;
    border: 2px solid var(--primary-color);
}

.mascot-bubble::after {
    content: '';
    position: absolute;
    left: -10px;
    top: 50%;
    transform: translateY(-50%);
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
    border-right: 10px solid var(--primary-color);
}

/* Collection Grid */
.collection-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-top: 20px;
}

.collection-item {
    aspect-ratio: 5/8;
    background: #f1f2f6;
    border-radius: 10px;
    position: relative;
    overflow: hidden;
    filter: grayscale(1);
    opacity: 0.3;
}

.collection-item.unlocked {
    filter: none;
    opacity: 1;
    border: 2px solid var(--primary-color);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

/* Seasonal Themes */
body.spring { --bg-color: #fff0f6; }
body.summer { --bg-color: #e3f2fd; }
body.autumn { --bg-color: #fff3e0; }
body.winter { --bg-color: #f5f5f5; }
