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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.container {
    text-align: center;
    z-index: 10;
    position: relative;
}

header {
    margin-bottom: 3rem;
}

h1 {
    font-size: 2.5rem;
    color: white;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.subtitle {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 1rem;
}

.language-selector {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 1rem;
}

.lang-btn {
    padding: 0.5rem 1rem;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.lang-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.lang-btn.active {
    background: rgba(255, 255, 255, 0.4);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.cookie-container {
    position: relative;
    width: 300px;
    height: 300px;
    margin: 0 auto;
    perspective: 1000px;
}

.cookie {
    width: 200px;
    height: 120px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    cursor: pointer;
    transform-style: preserve-3d;
    transition: transform 0.5s ease;
}

.cookie:hover {
    transform: translate(-50%, -50%) rotateY(10deg);
}

.cookie-left,
.cookie-right {
    position: absolute;
    width: 100px;
    height: 120px;
    background: linear-gradient(135deg, #f5d0a9 0%, #e6b88a 100%);
    border-radius: 60px;
    box-shadow: 
        inset 2px 2px 5px rgba(0, 0, 0, 0.2),
        0 5px 20px rgba(0, 0, 0, 0.3);
    transition: transform 0.6s ease;
}

.cookie-left {
    left: 0;
    transform-origin: right center;
}

.cookie-right {
    right: 0;
    transform-origin: left center;
}

.cookie.open .cookie-left {
    transform: rotateY(-120deg);
}

.cookie.open .cookie-right {
    transform: rotateY(120deg);
}

.fortune-paper {
    position: absolute;
    width: 180px;
    padding: 20px;
    background: linear-gradient(135deg, #ffffff 0%, #f0f0f0 100%);
    border-radius: 5px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
    transition: all 0.5s ease;
    z-index: 10;
}

.fortune-paper.show {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

.fortune-text {
    font-size: 0.9rem;
    color: #333;
    margin-bottom: 10px;
    line-height: 1.4;
    font-style: italic;
}

.lucky-numbers {
    font-size: 0.7rem;
    color: #666;
    font-weight: bold;
}

.click-hint {
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 1.1rem;
    animation: bounce 2s infinite;
}

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

.controls {
    margin-top: 3rem;
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.new-cookie-btn,
.share-btn {
    display: none;
    padding: 0.8rem 1.5rem;
    border: none;
    background: white;
    color: #667eea;
    border-radius: 25px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.new-cookie-btn:hover,
.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.stats {
    margin-top: 2rem;
    color: rgba(255, 255, 255, 0.9);
    font-size: 1rem;
}

footer {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
}

/* パーティクル効果 */
.particles {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 1;
}

.particle {
    position: absolute;
    width: 10px;
    height: 10px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    animation: float linear infinite;
}

@keyframes float {
    from {
        transform: translateY(100vh) scale(0);
    }
    to {
        transform: translateY(-100vh) scale(1);
    }
}

/* レスポンシブデザイン */
@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .cookie-container {
        width: 250px;
        height: 250px;
    }
    
    .cookie {
        width: 160px;
        height: 100px;
    }
    
    .cookie-left,
    .cookie-right {
        width: 80px;
        height: 100px;
    }
    
    .fortune-paper {
        width: 150px;
        padding: 15px;
    }
    
    .language-selector {
        flex-wrap: wrap;
    }
}

/* アクセシビリティ向上 */
@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}

/* ダークモード対応 */
@media (prefers-color-scheme: dark) {
    body {
        background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    }
    
    .fortune-paper {
        background: linear-gradient(135deg, #2d2d2d 0%, #1a1a1a 100%);
    }
    
    .fortune-text {
        color: #f0f0f0;
    }
    
    .lucky-numbers {
        color: #aaa;
    }
}