:root {
    --primary-red: #DC143C;
    --secondary-red: #8B0000;
    --gold: #FFD700;
    --wood-brown: #8B4513;
    --light-wood: #DEB887;
    --white: #FFFFFF;
    --black: #000000;
    --gray: #696969;
}

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

body {
    font-family: 'Hiragino Kaku Gothic Pro', 'Meiryo', sans-serif;
    background: linear-gradient(to bottom, #87CEEB 0%, #E0F6FF 50%, #F0E68C 100%);
    min-height: 100vh;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
}

/* ヘッダー */
.shrine-header {
    text-align: center;
    margin-bottom: 40px;
    animation: fadeIn 1s ease;
}

.shrine-title {
    font-size: 2.5rem;
    color: var(--primary-red);
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 10px;
}

.kanji {
    font-size: 3rem;
    vertical-align: middle;
}

.subtitle {
    color: var(--gray);
    font-size: 1.1rem;
}

/* 参拝エリア */
.worship-area {
    margin-bottom: 60px;
    position: relative;
}

/* 鳥居 */
.torii-gate {
    width: 300px;
    height: 250px;
    margin: 0 auto 40px;
    position: relative;
}

.torii-top {
    width: 100%;
    height: 40px;
    background: var(--primary-red);
    position: absolute;
    top: 30px;
    border-radius: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.torii-top::before {
    content: '';
    width: 120%;
    height: 30px;
    background: var(--primary-red);
    position: absolute;
    top: -25px;
    left: -10%;
    border-radius: 15px;
}

.torii-pillars {
    display: flex;
    justify-content: space-between;
    position: absolute;
    width: 80%;
    height: 200px;
    left: 10%;
    top: 50px;
}

.pillar {
    width: 40px;
    height: 100%;
    background: var(--primary-red);
    border-radius: 5px;
    box-shadow: 3px 3px 10px rgba(0,0,0,0.2);
}

/* 神社建物 */
.shrine-building {
    width: 400px;
    margin: 0 auto;
    position: relative;
    transition: all 0.3s ease;
}

.shrine-building.glow {
    filter: drop-shadow(0 0 30px var(--gold));
}

.roof {
    width: 100%;
    height: 0;
    border-left: 200px solid transparent;
    border-right: 200px solid transparent;
    border-bottom: 120px solid var(--wood-brown);
    position: relative;
}

.roof::before {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    border-left: 180px solid transparent;
    border-right: 180px solid transparent;
    border-bottom: 100px solid var(--secondary-red);
    top: 20px;
    left: -180px;
}

.shrine-body {
    width: 300px;
    height: 200px;
    background: var(--light-wood);
    margin: 0 auto;
    position: relative;
    border: 5px solid var(--wood-brown);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

/* 鈴 */
.bell-rope {
    position: absolute;
    top: -50px;
    left: 50%;
    transform: translateX(-50%);
    cursor: pointer;
    z-index: 10;
}

.rope {
    width: 4px;
    height: 50px;
    background: var(--white);
    margin: 0 auto;
    box-shadow: 1px 1px 3px rgba(0,0,0,0.3);
}

.bell {
    font-size: 2rem;
    text-align: center;
    animation: swing 2s ease-in-out infinite;
}

.bell.ringing {
    animation: ring 0.5s ease-in-out;
}

/* お賽銭箱 */
.offering-box {
    width: 200px;
    height: 60px;
    background: var(--wood-brown);
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    border: 3px solid var(--secondary-red);
    cursor: pointer;
    border-radius: 5px;
}

.coin-slot {
    width: 100px;
    height: 8px;
    background: var(--black);
    position: absolute;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 4px;
}

.offering-text {
    color: var(--white);
    text-align: center;
    margin-top: 30px;
    font-size: 1.2rem;
}

/* 参拝ボタン */
.worship-instructions {
    text-align: center;
    margin-top: 80px;
}

.worship-btn {
    background: var(--primary-red);
    color: var(--white);
    border: none;
    padding: 15px 40px;
    font-size: 1.2rem;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.worship-btn:hover:not(:disabled) {
    background: var(--secondary-red);
    transform: translateY(-2px);
    box-shadow: 0 7px 20px rgba(0,0,0,0.3);
}

.worship-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.instructions-text {
    margin-top: 10px;
    color: var(--gray);
}

/* 機能カード */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-top: 60px;
}

.feature-card {
    background: var(--white);
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.feature-card h3 {
    color: var(--primary-red);
    margin-bottom: 10px;
}

.feature-card p {
    color: var(--gray);
    margin-bottom: 20px;
}

.feature-btn {
    background: var(--gold);
    color: var(--black);
    border: none;
    padding: 10px 30px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
}

.feature-btn:hover {
    background: #FFC700;
    transform: scale(1.05);
}

/* モーダル */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--white);
    padding: 40px;
    border-radius: 20px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    animation: modalIn 0.3s ease;
}

.close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 2rem;
    cursor: pointer;
    color: var(--gray);
}

.close:hover {
    color: var(--black);
}

/* おみくじ結果 */
.omikuji-result {
    text-align: center;
    margin: 20px 0;
}

.omikuji-result h1 {
    font-size: 4rem;
    margin-bottom: 20px;
}

.omikuji-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 30px;
}

.omikuji-details p {
    background: #F5F5F5;
    padding: 10px;
    border-radius: 10px;
}

/* 絵馬 */
.ema-form {
    margin-bottom: 30px;
}

.ema-form textarea {
    width: 100%;
    height: 100px;
    padding: 15px;
    border: 2px solid var(--gold);
    border-radius: 10px;
    font-size: 1.1rem;
    resize: none;
    margin-bottom: 15px;
}

.ema-form button {
    background: var(--primary-red);
    color: var(--white);
    border: none;
    padding: 10px 30px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 1.1rem;
}

.ema-list h3 {
    color: var(--primary-red);
    margin-bottom: 15px;
}

.ema-item {
    background: #FFF8DC;
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 10px;
    border-left: 4px solid var(--gold);
}

.ema-item small {
    color: var(--gray);
}

/* 御朱印 */
.goshuin-paper {
    background: #FFF8DC;
    padding: 40px;
    border: 3px solid var(--primary-red);
    border-radius: 10px;
    text-align: center;
    margin: 20px 0;
    position: relative;
}

.goshuin-stamp {
    font-size: 5rem;
    color: var(--primary-red);
    margin-bottom: 20px;
}

.goshuin-paper h3 {
    font-size: 2rem;
    color: var(--primary-red);
    margin-bottom: 10px;
}

.goshuin-date {
    margin-top: 20px;
    font-size: 1.2rem;
}

.worship-count {
    color: var(--gray);
    margin-top: 10px;
}

/* エフェクト */
#effectCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.coin {
    position: fixed;
    width: 30px;
    height: 30px;
    background: var(--gold);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    box-shadow: 0 3px 10px rgba(0,0,0,0.3);
    transition: all 0.8s ease;
    z-index: 100;
}

.blessing-effect {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
    color: var(--gold);
    font-weight: bold;
    z-index: 1000;
    transition: all 1.5s ease;
    text-shadow: 0 0 20px var(--gold);
}

/* アニメーション */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes ring {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-30deg); }
    75% { transform: rotate(30deg); }
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* レスポンシブ */
@media (max-width: 768px) {
    .shrine-title {
        font-size: 2rem;
    }
    
    .torii-gate {
        width: 250px;
        height: 200px;
    }
    
    .shrine-building {
        width: 300px;
    }
    
    .roof {
        border-left-width: 150px;
        border-right-width: 150px;
        border-bottom-width: 90px;
    }
    
    .roof::before {
        border-left-width: 135px;
        border-right-width: 135px;
        border-bottom-width: 75px;
        left: -135px;
    }
    
    .shrine-body {
        width: 250px;
        height: 150px;
    }
    
    .features {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}