/* 背景全体のスタイル */
body {
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
    /* または、背景画像を使用する場合は以下のコメントを解除してください */
    /*
    background-image: url('new_year_background.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    */
    text-align: center;
    font-family: 'Yu Gothic', sans-serif;
    margin: 0;
    padding: 0;
    color: #fff;
    position: relative;
}

/* ポップアップのスタイル */
.popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7); /* 半透明の黒背景 */
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0.5s ease;
    z-index: 2000; /* フッターより前面に表示 */
}

.popup.show {
    opacity: 1;
    visibility: visible;
}

.popup-content {
    background-color: #fff;
    padding: 30px 40px;
    border-radius: 10px;
    text-align: center;
    position: relative;
    animation: popup-anim 0.5s ease forwards;
}

.popup-content h2 {
    color: #d2691e;
    font-size: 1.8em;
    margin: 0;
}

.close-button {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 1.5em;
    color: #333;
    cursor: pointer;
    transition: color 0.3s;
}

.close-button:hover {
    color: #d2691e;
}

/* ポップアップのアニメーション */
@keyframes popup-anim {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* 容器のスタイル */
.container {
    margin-top: 50px;
    background: rgba(255, 255, 255, 0.8);
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
    display: inline-block;
}

h1 {
    color: #d2691e;
    font-size: 2em;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

/* ダルマ画像のスタイル */
#daruma {
    width: 200px;
    height: auto;
    cursor: pointer;
    transition: transform 0.1s;
}

#daruma:active {
    transform: scale(0.95);
}

/* 結果表示のスタイル */
.result {
    margin-top: 20px;
    font-size: 1.5em;
    color: #d2691e;
    min-height: 2em;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

/* クリック情報のスタイルを非表示に */
.click-info {
    display: none;
}

/* おみくじを引けない場合のメッセージのスタイル */
.already-drawn {
    margin-top: 20px;
    font-size: 1.3em;
    color: #333;
}

.final-result {
    margin-top: 10px;
    font-size: 1.5em;
    color: #d2691e;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

/* Twitter共有ボタンのスタイル */
.twitter-share-button {
    margin-top: 20px;
    padding: 10px 20px;
    background-color: #1DA1F2;
    color: #fff;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.3s, transform 0.3s;
}

.twitter-share-button:hover {
    background-color: #0d95e8;
    transform: scale(1.05);
}

/* 装飾用の飾り（門松など） */
.decorations {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 100px;
    /* ここに装飾用の画像を追加 */
    background-image: url('kadomatsu.png'); /* 左側用の門松画像を用意してください */
    background-size: contain;
    background-repeat: no-repeat;
    animation: sway 3s infinite alternate;
}

.decorations.right {
    right: 10px;
    left: auto;
    background-image: url('kadomatsu_right.png'); /* 右側用の門松画像を用意してください */
}

/* 飾りのアニメーション */
@keyframes sway {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(5deg);
    }
}

/* 雪のアニメーション（オプション） */
@keyframes snow {
    0% { transform: translateY(0) rotate(0deg); opacity: 1; }
    100% { transform: translateY(100vh) rotate(360deg); opacity: 0; }
}

.snowflake {
    position: absolute;
    top: -10px;
    width: 10px;
    height: 10px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    animation: snow linear infinite;
    pointer-events: none;
}

/* ダルマの揺れアニメーション */
@keyframes shake {
    0% { transform: rotate(0deg); }
    25% { transform: rotate(var(--shake-degree, 5deg)); }
    50% { transform: rotate(calc(-1 * var(--shake-degree, 5deg))); }
    75% { transform: rotate(var(--shake-degree, 5deg)); }
    100% { transform: rotate(0deg); }
}

#daruma.shake {
    animation: shake 0.5s;
    --shake-degree: 5deg; /* default, will be overridden by JS */
}

/* フッターのスタイル */
.footer {
    bottom: 0;
    width: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    color: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px 0;
    box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.3);
    z-index: 1000;
}

.footer a {
    margin-right: 15px;
    display: flex;
    align-items: center;
}

.twitter-logo {
    width: 30px;
    height: 30px;
    transition: transform 0.3s;
}

.twitter-logo:hover {
    transform: scale(1.2);
}

.footer .copyright {
    font-size: 1em;
}

/* レスポンシブデザイン対応 */
@media (max-width: 600px) {
    .footer {
        flex-direction: column;
    }

    .footer a {
        margin-right: 0;
        margin-bottom: 5px;
    }

    /* スマホ画面でダルマを90%に変更 */
    #daruma {
        width: 90vw;
        height: auto;
    }
}

/* アニメーションを減少させるユーザー設定に対応 */
@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
    }
}
