main .container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  max-width: 450px;
}

/* --- おみくじコンテナのスタイル --- */
.omikuji-container {
    background-color: white;
    padding: 40px 50px;
    border-radius: 20px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    text-align: center;
    width: 90%;
    max-width: 400px;
    margin: 20px auto;
}

/* --- タイトルのスタイル --- */
.title {
    font-size: 2.5rem;
    font-weight: bold;
    color: #c43e3e;
    margin-top: 0;
    margin-bottom: 30px;
    letter-spacing: 0.1em;
}

/* --- 結果表示エリアのスタイル --- */
.result-display {
    min-height: 120px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 3.5rem;
    font-weight: bold;
    margin-bottom: 30px;
    transition: color 0.3s ease;
}

/* --- 初期状態の「？」のスタイル --- */
.initial-state {
    color: #e0e0e0;
    font-size: 4rem;
}

/* --- アニメーション用のボックス --- */
.animation-box {
    width: 80px;
    height: 120px;
    background-color: transparent;
    background-image: url("omikuji.png");
    background-size: 80px 120px	;
    border: 0 none;
    border-radius: 8px;
    margin: 0 auto 30px;
    display: none; /* 初期状態では非表示 */
}

#animation-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(0eg); }
    75% { transform: translate(-5px, 5px) rotate(-5deg); }
    100% { transform: translate(0, 0) rotate(0deg); }
}

/* --- ボタンのスタイル --- */
.draw-button {
    background: linear-gradient(145deg, #ff5f5f, #c43e3e);
    color: white;
    font-size: 1.2rem;
    font-weight: bold;
    border: none;
    padding: 15px 30px;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(206, 68, 68, 0.4);
    transition: all 0.3s ease;
}

.draw-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(206, 68, 68, 0.5);
}

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

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

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

#result-display {
  opacity: 0;
  transition: opacity 2.5s ease; /* 0.5秒かけてopacityを変化させる */
}
#result-display.is-visible {
  opacity: 1;
}

main #message {
  margin: 0 10px 20px;
}
main #message p {
  line-height: 1.5;
}

#ad {
  margin-top: 0.5em;
  padding-top: 0.5em;
  padding-bottom: 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;
}
