* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Yu Mincho", "Hiragino Mincho ProN", "游明朝", serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow-x: hidden;
    position: relative;
}

/* ヘッダー用スタイル */
.site-header {
    background-color: #1a1a1a;
    padding: 0.5rem 1rem;
    width: 100%;
}

.site-header a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: white;
    text-decoration: none;
    font-weight: bold;
    font-size: 1.125rem;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.site-header img {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    object-fit: cover;
}

.main-content {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px;
}

/* 背景の桜の花びらエフェクト */
body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(2px 2px at 20% 30%, rgba(255, 182, 193, 0.2), transparent),
        radial-gradient(2px 2px at 60% 70%, rgba(255, 182, 193, 0.2), transparent),
        radial-gradient(2px 2px at 50% 50%, rgba(255, 182, 193, 0.2), transparent),
        radial-gradient(2px 2px at 80% 10%, rgba(255, 182, 193, 0.2), transparent);
    background-size: 200% 200%;
    animation: sparkle 20s ease-in-out infinite;
    pointer-events: none;
}

@keyframes sparkle {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.6; }
}

.container {
    max-width: 600px;
    width: 100%;
    perspective: 1000px;
}

/* おみくじ箱 */
.omikuji-box {
    background: linear-gradient(145deg, #8b4513, #654321);
    border-radius: 25px;
    padding: 50px 30px;
    text-align: center;
    box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.5),
        inset 0 -5px 20px rgba(0, 0, 0, 0.3),
        inset 0 5px 20px rgba(255, 255, 255, 0.1);
    border: 4px solid #d4af37;
    position: relative;
    overflow: hidden;
    transform-style: preserve-3d;
    transition: transform 0.3s ease;
}

.omikuji-box::before {
    content: '🎋';
    position: absolute;
    top: 15px;
    left: 15px;
    font-size: 2em;
    opacity: 0.3;
}

.omikuji-box::after {
    content: '🎋';
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 2em;
    opacity: 0.3;
}

.omikuji-box h1 {
    color: #ffd700;
    font-size: clamp(2em, 5vw, 3em);
    margin-bottom: 20px;
    text-shadow: 
        2px 2px 4px rgba(0, 0, 0, 0.5),
        0 0 20px rgba(255, 215, 0, 0.3);
    letter-spacing: 12px;
    position: relative;
    animation: glow 2s ease-in-out infinite;
}

@keyframes glow {
    0%, 100% { text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5), 0 0 20px rgba(255, 215, 0, 0.3); }
    50% { text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5), 0 0 30px rgba(255, 215, 0, 0.6); }
}

.shrine-icon {
    font-size: 4em;
    margin-bottom: 20px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.draw-button {
    background: linear-gradient(145deg, #ffd700, #ffed4e);
    color: #8b4513;
    border: 3px solid #d4af37;
    padding: 18px 45px;
    font-size: clamp(1.2em, 3vw, 1.5em);
    font-weight: bold;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 
        0 10px 25px rgba(0, 0, 0, 0.3),
        inset 0 -3px 10px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    letter-spacing: 6px;
    font-family: "Yu Mincho", serif;
    position: relative;
    overflow: hidden;
}

.draw-button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.draw-button:hover::before {
    width: 300px;
    height: 300px;
}

.draw-button:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
}

.draw-button:active {
    transform: translateY(-2px) scale(1.02);
}

.draw-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* おみくじ用紙 */
.omikuji-paper {
    display: none;
    background: 
        linear-gradient(to bottom, #faf8f3 0%, #f5f1e8 100%);
    border-radius: 15px;
    padding: 20px 30px;
    box-shadow: 
        0 30px 60px rgba(0, 0, 0, 0.5),
        inset 0 0 50px rgba(255, 215, 0, 0.1);
    position: relative;
    animation: unfold 1s ease-out;
    max-width: 90vw;
    max-height: 85vh;
    overflow-y: auto;
    margin: 0 auto;
    border: 3px solid #d4af37;
}

@keyframes unfold {
    0% {
        transform: perspective(1000px) rotateX(-90deg) scale(0.5);
        opacity: 0;
    }
    50% {
        transform: perspective(1000px) rotateX(-45deg) scale(0.8);
        opacity: 0.5;
    }
    100% {
        transform: perspective(1000px) rotateX(0) scale(1);
        opacity: 1;
    }
}

.omikuji-paper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 35px,
            rgba(139, 69, 19, 0.05) 35px,
            rgba(139, 69, 19, 0.05) 36px
        );
    pointer-events: none;
    border-radius: 15px;
}

.omikuji-paper.show {
    display: block;
}

.paper-content {
    text-align: center;
    position: relative;
    z-index: 1;
}

.fortune-level {
    font-size: clamp(2em, 6vw, 3em);
    font-weight: bold;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    letter-spacing: 12px;
    animation: fadeInScale 0.8s ease-out 0.3s both;
    background: linear-gradient(45deg, #c41e3a, #ff6b6b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.fortune-message {
    font-size: clamp(1em, 2vw, 1.2em);
    color: #333;
    margin-bottom: 15px;
    padding: 12px 15px;
    line-height: 1.6;
    border: 2px solid #d4af37;
    border-radius: 10px;
    background: rgba(255, 215, 0, 0.05);
    animation: fadeInScale 0.8s ease-out 0.5s both;
    letter-spacing: 2px;
}

.fortune-items {
    margin-bottom: 15px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    animation: fadeInScale 0.8s ease-out 0.7s both;
}

.fortune-item {
    padding: 10px 12px;
    background: linear-gradient(135deg, rgba(250, 248, 243, 0.9), rgba(255, 252, 240, 0.7));
    border-radius: 5px;
    border: 2px solid #d4af37;
    border-top: 3px solid #ffd700;
    box-shadow: 
        0 3px 8px rgba(139, 69, 19, 0.15),
        inset 0 1px 2px rgba(255, 255, 255, 0.8);
    transition: all 0.3s ease;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.fortune-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(212, 175, 55, 0.5) 50%, 
        transparent);
}

.fortune-item::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(139, 69, 19, 0.2) 50%, 
        transparent);
}

.fortune-item:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 
        0 5px 15px rgba(139, 69, 19, 0.25),
        inset 0 1px 3px rgba(255, 255, 255, 0.9);
    background: linear-gradient(135deg, rgba(255, 250, 240, 1), rgba(255, 253, 245, 0.9));
    border-top-color: #ffed4e;
}

.item-label {
    font-size: 0.9em;
    color: #c41e3a;
    font-weight: bold;
    margin-bottom: 6px;
    letter-spacing: 2px;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
    border-bottom: 1px dotted #d4af37;
    padding-bottom: 4px;
    position: relative;
    z-index: 1;
}

.item-value {
    font-size: 0.85em;
    color: #333;
    line-height: 1.5;
    letter-spacing: 0.5px;
    position: relative;
    z-index: 1;
    text-shadow: 0 1px 1px rgba(255, 255, 255, 0.5);
}

.daily-word {
    font-size: clamp(1em, 2vw, 1.15em);
    color: #c41e3a;
    padding: 12px 18px;
    border: 2px solid #d4af37;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.8), rgba(255, 215, 0, 0.1));
    margin-top: 0;
    line-height: 1.8;
    letter-spacing: 2px;
    animation: fadeInScale 0.8s ease-out 0.9s both;
    box-shadow: 0 5px 20px rgba(212, 175, 55, 0.3);
    font-weight: bold;
}

.reset-button {
    display: none;
    background: linear-gradient(145deg, #8b4513, #654321);
    color: #ffd700;
    border: 3px solid #d4af37;
    padding: 10px 30px;
    font-size: clamp(0.9em, 2vw, 1em);
    font-weight: bold;
    border-radius: 25px;
    cursor: pointer;
    margin-top: 15px;
    transition: all 0.3s ease;
    font-family: "Yu Mincho", serif;
    letter-spacing: 3px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    animation: fadeInScale 0.8s ease-out 1.1s both;
}

.reset-button.show {
    display: inline-block;
}

.reset-button:hover {
    background: linear-gradient(145deg, #654321, #4a3319);
    transform: scale(1.05) translateY(-3px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}

.reset-button:active {
    transform: scale(1) translateY(0);
}

.loading {
    display: none;
    color: #ffd700;
    font-size: clamp(1em, 2.5vw, 1.3em);
    margin-top: 25px;
    animation: pulse 1.5s infinite;
    letter-spacing: 2px;
}

.loading.show {
    display: block;
}

@keyframes pulse {
    0%, 100% { 
        opacity: 1;
        transform: scale(1);
    }
    50% { 
        opacity: 0.5;
        transform: scale(1.05);
    }
}

/* スクロールバーのスタイル */
.omikuji-paper::-webkit-scrollbar {
    width: 10px;
}

.omikuji-paper::-webkit-scrollbar-track {
    background: rgba(212, 175, 55, 0.1);
    border-radius: 10px;
}

.omikuji-paper::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #d4af37, #b8941f);
    border-radius: 10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.omikuji-paper::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #ffd700, #d4af37);
}

/* スマホ対応 */
@media (max-width: 768px) {
    body {
        padding: 15px;
    }

    .omikuji-box {
        padding: 40px 20px;
        border-radius: 20px;
    }

    .omikuji-box h1 {
        letter-spacing: 8px;
        margin-bottom: 15px;
    }

    .shrine-icon {
        font-size: 3em;
        margin-bottom: 15px;
    }

    .draw-button {
        padding: 15px 35px;
        letter-spacing: 4px;
    }

    .omikuji-paper {
        padding: 25px 20px;
        max-height: 80vh;
    }

    .fortune-level {
        letter-spacing: 8px;
        margin-bottom: 20px;
    }

    .fortune-message {
        padding: 15px;
        margin-bottom: 25px;
    }

    .fortune-items {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .fortune-item {
        padding: 15px;
    }

    .daily-word {
        padding: 18px;
        margin-top: 25px;
    }

    .reset-button {
        padding: 12px 30px;
        margin-top: 25px;
        letter-spacing: 3px;
    }
}

@media (max-width: 480px) {
    .omikuji-box {
        padding: 30px 15px;
    }

    .omikuji-paper {
        padding: 20px 15px;
    }

    .fortune-level {
        letter-spacing: 5px;
    }
}
