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

body {
    font-family: 'Noto Sans JP', sans-serif;
    background: linear-gradient(135deg, #1a0e2e 0%, #2d1b4e 50%, #4a2c7a 100%);
    color: #fff;
    min-height: 100vh;
    overflow-x: hidden;
}

.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Header Styles */
.header {
    text-align: center;
    padding: 2rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.title {
    font-family: 'Cinzel', serif;
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 600;
    margin-bottom: 0.5rem;
    background: linear-gradient(45deg, #ffd700, #ffb347, #ff69b4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 30px rgba(255, 215, 0, 0.3);
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    font-style: italic;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 2rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.reading-section {
    max-width: 800px;
    width: 100%;
    text-align: center;
}

.instruction {
    margin-bottom: 3rem;
}

.instruction h2 {
    font-family: 'Cinzel', serif;
    font-size: 1.8rem;
    margin-bottom: 1rem;
    color: #ffd700;
}

.instruction p {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    opacity: 0.9;
}

.card-meaning {
    font-size: 1rem;
    color: #ffb347;
    font-style: italic;
    margin-top: 1rem;
}

/* Cards Container */
.cards-container {
    margin: 3rem 0;
}

.card-deck {
    display: flex;
    justify-content: center;
    gap: clamp(1rem, 4vw, 2rem);
    flex-wrap: wrap;
}

.card {
    width: clamp(120px, 20vw, 180px);
    height: clamp(200px, 32vw, 280px);
    cursor: pointer;
    perspective: 1000px;
    transition: transform 0.3s ease;
}

.card:hover {
    transform: scale(1.05) translateY(-10px);
}

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

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

.card-front,
.card-back-face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.card-back-face {
    background: linear-gradient(45deg, #4a2c7a, #2d1b4e);
    border: 2px solid #ffd700;
    font-size: 3rem;
    animation: sparkle 2s infinite;
}

.card-front {
    background: linear-gradient(45deg, #fff, #f0f0f0);
    color: #2d1b4e;
    transform: rotateY(180deg);
    font-size: 0.9rem;
    padding: 1rem;
    text-align: center;
    flex-direction: column;
}

.card-front h3 {
    font-family: 'Cinzel', serif;
    font-size: 1.2rem;
    margin-bottom: 1rem;
    color: #4a2c7a;
}

.card-front .card-symbol {
    font-size: 3rem;
    margin: 1rem 0;
}

.card-front .card-meaning {
    font-size: 0.8rem;
    line-height: 1.4;
    opacity: 0.8;
}

@keyframes sparkle {
    0%, 100% { 
        text-shadow: 0 0 10px #ffd700, 0 0 20px #ffd700; 
    }
    50% { 
        text-shadow: 0 0 20px #ff69b4, 0 0 30px #ff69b4; 
    }
}

/* Buttons */
.draw-button,
.reset-button,
.share-button {
    background: linear-gradient(45deg, #ff69b4, #ffd700);
    border: none;
    padding: 1rem 2rem;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: bold;
    color: #2d1b4e;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 20px rgba(255, 105, 180, 0.3);
    margin: 1rem 0.5rem;
}

.draw-button:hover,
.reset-button:hover,
.share-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(255, 105, 180, 0.4);
}

/* Results Section */
.results-section {
    max-width: 800px;
    width: 100%;
    text-align: center;
    animation: fadeInUp 0.8s ease;
}

.results-section h2 {
    font-family: 'Cinzel', serif;
    font-size: 2rem;
    margin-bottom: 2rem;
    color: #ffd700;
}

.reading-results {
    display: grid;
    gap: 2rem;
    margin-bottom: 2rem;
}

.card-result {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 1.5rem;
    border: 1px solid rgba(255, 215, 0, 0.3);
}

.card-result h3 {
    font-family: 'Cinzel', serif;
    color: #ffd700;
    margin-bottom: 0.5rem;
    font-size: 1.3rem;
}

.card-result .position {
    font-size: 0.9rem;
    opacity: 0.7;
    margin-bottom: 1rem;
}

.card-result .meaning {
    font-size: 1rem;
    line-height: 1.6;
}

.overall-fortune {
    background: rgba(255, 215, 0, 0.1);
    border: 2px solid #ffd700;
    border-radius: 20px;
    padding: 2rem;
    margin: 2rem 0;
}

.overall-fortune h3 {
    font-family: 'Cinzel', serif;
    color: #ffd700;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.actions {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 2rem;
}

/* Footer */
.footer {
    text-align: center;
    padding: 1rem;
    opacity: 0.7;
    font-style: italic;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(26, 14, 46, 0.9);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.loading-spinner {
    font-size: 4rem;
    animation: spin 2s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .header {
        padding: 1.5rem 1rem;
    }
    
    .main-content {
        padding: 1.5rem 1rem;
    }
    
    .card-deck {
        gap: 1rem;
    }
    
    .card {
        width: 100px;
        height: 160px;
    }
    
    .actions {
        flex-direction: column;
        align-items: center;
    }
    
    .draw-button,
    .reset-button,
    .share-button {
        width: 100%;
        max-width: 300px;
        margin: 0.5rem 0;
    }
}