/* ==========================================================================
   レイアウト・基本設定
   ========================================================================== */
main .container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    max-width: 420px;
    margin: auto;
    padding: 0;
}

/* おみくじの外枠（カード） */
.omikuji-container {
    background-color: white;
    padding: 30px 50px;
    /* border-radius: 20px; */
    /* box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1); */
    border: 1px solid #eee;
    text-align: center;
    width: 100%;
    max-width: 380px;
    min-height: 400px;
    margin: 20px auto;
    overflow: hidden;
}

/* ==========================================================================
   アニメーション要素（おみくじの箱）
   ========================================================================== */
.animation-box,
#stopmotion-box {
    width: 240px;
    height: 240px;
    background-color: transparent;
    background-size: 240px 240px;
    background-repeat: no-repeat;
    border: 0 none;
    /* border-radius: 8px; */
    margin: 0 auto 30px;
    display: none;
}

.animation-box {
    background-image: url("omikuji1.png");
}

#stopmotion-box {
    background-image: url("omikuji2.png");
}

#animation-box.is-visible,
#stopmotion-box.is-visible {
    display: block;
}

/* 振るアニメーション */
.shake {
    display: block !important;
    animation: shake-animation 0.2s infinite;
}

@keyframes shake-animation {
    0% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(5px, -5px) rotate(5deg); }
    50% { transform: translate(0, 0) rotate(0deg); }
    75% { transform: translate(-5px, 5px) rotate(-5deg); }
    100% { transform: translate(0, 0) rotate(0deg); }
}

/* ==========================================================================
   結果表示（基本構造）
   ========================================================================== */
#result-display {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 240px;
    height: auto !important;
    padding: 0 0 30px;
    opacity: 0;
    transition: opacity 2.5s ease;
}

#result-display.is-visible {
    opacity: 1;
}

/* 吉凶名（大吉・凶など） */
.fortune-name {
    font-size: 5rem;
    font-weight: bold;
    font-family: "Yuji Boku", serif;
    margin-bottom: 18px;
    transition: transform 0.5s ease;
    width: 1.5em;
    line-height: 1.125;
    height: 2.25em;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
}

/* 初期状態の「？」表示用 */
.initial-state {
    color: #e0e0e0;
    font-size: 4rem;
}

/* ==========================================================================
   吉凶ごとの色分け
   ========================================================================== */
.result-daikichi .fortune-name { color: #d92121; text-shadow: 0 0 24px #f90; }
.result-kichi .fortune-name    { color: #e0730d; }
.result-chukichi .fortune-name { color: #d1a80d; }
.result-shokichi .fortune-name { color: #69a73d; }
.result-suekichi .fortune-name { color: #5aa1a9; }
.result-kyo .fortune-name      { color: #5a74a9; }
.result-daikyo .fortune-name   { color: #4b3a88; text-shadow: 0 0 24px #000; }

/* ==========================================================================
   詳細運勢・ラッキーアイテム
   ========================================================================== */
/* 詳細リスト（アコーディオン） */
.accordion-wrapper {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.8s ease-out;
    width: 100%;
}

.accordion-wrapper.is-open {
    grid-template-rows: 1fr;
}

.accordion-content {
    overflow: hidden;
    min-height: 0;
}

.omikuji-details {
    width: 100%;
    text-align: left;
    margin: 0;
    padding: 0;
    list-style: none;
    border-top: 1px solid #eee;
}

.omikuji-details li {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
    font-size: 0.95rem;
    font-family: sans-serif;
}

.cat-name {
    font-weight: bold;
    color: #c43e3e;
    flex-shrink: 0;
    margin-right: 15px;
}

.cat-msg {
    flex-grow: 1;
}

/* ラッキーアイテムボックス（フェードイン） */
.lucky-item-box {
    width: 100%;
    background-color: #fff9f0;
    border: 2px dashed #e0730d;
    padding: 15px;
    border-radius: 8px;
    margin-top: 20px;
}

.lucky-title {
    font-weight: bold;
    color: #a06000;
    font-size: 0.8rem;
    margin: 0 0 5px;
}

.lucky-title span {
    font-size: 10px;
    color: #aaa;
    margin-left: 5px;
}

.lucky-item-box a {
    font-size: 1.1rem;
    color: #04f;
    font-weight: bold;
    text-decoration: underline;
    display: block;
}

/* 演出用ヘルパークラス */
.hidden-element {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.hidden-element.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* ==========================================================================
   ボタン・その他
   ========================================================================== */
.draw-button {
    background: #c7510b;
    color: white;
    font-size: 1.2rem;
    font-weight: bold;
    border: none;
    padding: 15px 30px;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.draw-button:hover {
    background: #ab460a;
    transform: translateY(-2px);
}

.draw-button:active {
    transform: translateY(1px);
}

.draw-button:disabled {
    background: #ccc;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

/* 補助テキスト・広告・注意事項 */
main #message { margin: 0 10px 20px; }
main #message p { line-height: 1.5; text-align: center;}

#ad {
    margin-top: 0.5em;
    padding: 0.5em 0 1.5em;
    text-align: center;
    border-top: 5px dotted #dddddd;
    border-bottom: 5px dotted #dddddd;
}
#ad p { margin-top: 1em; }
#ad .msg { font-size: 12px; color: #999999; }

#attention {
    margin: 12px auto 10px;
    max-width: 320px;
    font-size: 11px;
    text-align: left;
    color: #aaaaaa;
}