/* ==========================================================================
   1. 基本スタイル & 全体レイアウト
   ========================================================================== */
body {
  font-family:
    "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN", "Hiragino Sans",
    Meiryo, sans-serif;
  margin: 0;
  padding: 0;
  background-color: #f5f5f5;
  color: #333;
}

.container {
  margin: 0 auto;
  max-width: 800px;
  background: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1);
  box-sizing: border-box;
  margin-top: 40px;
  margin-bottom: 20px;
}

h1 {
  color: #333;
  margin-top: 0;
}

h3 {
  margin-top: 6px;
  margin-bottom: 6px;
  text-shadow:
    1px 1px 4px rgba(255, 255, 255, 0.8),
    -1px 1px 4px rgba(255, 255, 255, 0.8),
    1px -1px 4px rgba(255, 255, 255, 0.8),
    -1px -1px 4px rgba(255, 255, 255, 0.8);
}

/* ==========================================================================
   2. フォームまわり
   ========================================================================== */
.form-group {
  margin-bottom: 15px;
}

label {
  display: block;
  margin-bottom: 5px;
  font-weight: bold;
  text-shadow:
    1px 1px 4px rgba(255, 255, 255, 0.8),
    -1px 1px 4px rgba(255, 255, 255, 0.8),
    1px -1px 4px rgba(255, 255, 255, 0.8),
    -1px -1px 4px rgba(255, 255, 255, 0.8);
}

input[type="number"],
select,
input[type="text"] {
  width: 100%;
  padding: 10px;
  box-sizing: border-box;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 16px;
}

.error-list {
  color: #dc3545;
  margin-bottom: 15px;
}

.field-error {
  color: #dc3545;
  font-size: 14px;
  display: block;
  margin-top: 5px;
}

/* ==========================================================================
   3. ボタンエリア（フレックスボックス）
   ========================================================================== */
.btn-group {
  margin-top: 20px;
  display: flex;
  gap: 10px;
}

.btn-group button {
  flex: 1;
  padding: 12px;
  color: white;
  border: none;
  border-radius: 4px;
  font-weight: bold;
  font-size: 15px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.btn-all {
  background-color: #ff7f0e;
}
.btn-all:hover {
  background-color: #e06d0b;
}

.btn-cherry {
  background-color: #e377c2;
}
.btn-cherry:hover {
  background-color: #ca5fa9;
}

.btn-watermelon {
  background-color: #2ca02c;
}
.btn-watermelon:hover {
  background-color: #228422;
}

/* ==========================================================================
   4. 結果表示エリア
   ========================================================================== */
.results-container {
  margin-top: 20px;
}

.result-box {
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 20px;
}

.result-box.cherry-mode {
  border: 2px solid #e377c2;
  background-color: #fffafc;
}
.result-box.cherry-mode span {
  color: #e377c2;
}

.result-box.watermelon-mode {
  border: 2px solid #2ca02c;
  background-color: #f5fbf5;
}
.result-box.watermelon-mode span {
  color: #2ca02c;
}

.result-box.all-mode {
  border: 2px solid #ff7f0e;
  background-color: #fffaf5;
}
.result-box.all-mode span {
  color: #ff7f0e;
}

.prob-list {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.prob-item {
  font-size: 16px;
  margin: 0;
}

.prob-item span {
  font-size: 18px;
  font-weight: bold;
}

.chart-section {
  margin-top: 35px;
  text-align: center;
}

.chart-section p {
  margin-top: 6px;
  margin-bottom: 6px;
  font-size: 0.76rem;
}

.chart-section img {
  max-width: 100%;
  height: auto;
  box-sizing: border-box;
}

.chart-border {
  border: 1px solid #ddd;
  border-radius: 6px;
}

/* ==========================================================================
   6. ヘッダーエリア（画像配置用の枠）
   ========================================================================== */
.app-header {
  width: 100%;
  height: 350px;
  background-color: #ffdeea;
  margin-bottom: 0;
  overflow: hidden;
  position: relative;
  background-image: url("../images/magireco_header.fa53b02e25ab.jpg");
  background-repeat: no-repeat no-repeat;
  background-size: cover;
  background-position: center 18%;

  display: flex;
  align-items: center;
  justify-content: center;
}

.app-header h1 {
  position: relative;
  z-index: 2;
  color: #f47bac;
  text-shadow:
    1px 1px 4px rgba(255, 255, 255, 0.8),
    -1px 1px 4px rgba(255, 255, 255, 0.8),
    1px -1px 4px rgba(255, 255, 255, 0.8),
    -1px -1px 4px rgba(255, 255, 255, 0.8);
  margin: 0;
  padding: 0 10px;
  text-align: center;
  font-size: 3.6vw;
}

/* ==========================================================================
   8. フッターエリア
   ========================================================================== */
.app-footer {
  width: 100%;
  background-color: #ffdeea;
  color: #333;
  padding: 15px 0;
  margin-top: 40px;
  font-size: 14px;
}

.footer-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 20px;
  text-align: center;
}

.app-footer p {
  margin: 0;
  color: #333;
}

.footer-x-link {
  color: #333;
  text-decoration: none;
  font-weight: bold;
  transition: color 0.2s ease;
  margin-left: 5px;
}

.footer-x-link:hover {
  color: #ffb6c1;
  text-decoration: underline;
  text-shadow:
    1px 1px 2px rgba(80, 80, 80, 0.5),
    -1px 1px 2px rgba(80, 80, 80, 0.5),
    1px -1px 2px rgba(80, 80, 80, 0.5),
    -1px -1px 2px rgba(80, 80, 80, 0.5);
}

/* ==========================================================================
   📱 レスポンシブ対応（画面幅が600px以下のスマホサイズ）
   ========================================================================== */
@media (max-width: 600px) {
  body {
    padding: 0;
  }
  .app-header {
    height: 188px;
    background-position: top 18%;
  }
  .app-header h1 {
    font-size: 4.6vw;
    opacity: 0.88;
    top: 3%;
  }
  .container {
    padding: 15px;
    margin-top: 20px;
    background: none;
    box-shadow: none;
  }
  .btn-group {
    flex-direction: column;
    gap: 24px;
  }
  .btn-group button {
    width: 100%;
  }
  .prob-list {
    flex-direction: column;
    gap: 5px;
  }
  .chart-display-flex {
    flex-direction: column;
    gap: 10px;
  }
  .chara-mini-side {
    right: 0;
    width: 80px;
  }
  body::before {
    background-position: 40% center;
  }
  .chart-section > p {
    text-shadow:
      1px 1px 1px rgba(255, 255, 255, 0.8),
      -1px 1px 1px rgba(255, 255, 255, 0.8),
      1px -1px 1px rgba(255, 255, 255, 0.8),
      -1px -1px 1px rgba(255, 255, 255, 0.8);
  }
}

/* ==========================================================================
   📱 レスポンシブ対応（画面幅が601px~920px以下のタブレット）
   ========================================================================== */

@media (601px <= width <= 920px) {
  .container {
    max-width: 80%;
  }
}
/* ==========================================================================
   7. キャラクター・背景演出の追加設定
   ========================================================================== */

body {
  position: relative;
  background-color: #f5f5f5;
  z-index: 1;
}

body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url("../images/bg_pc.388442bf8934.jpg");
  background-size: cover;
  background-position: center;
  opacity: 0.25;
  z-index: -1;
  pointer-events: none;
}

.chart-section {
  position: relative;
}

/* 3. グラフの横に表示するキャラ画像の設定 */
.chara-mini-side {
  position: absolute;
  right: 20px;
  bottom: 10%;
  width: 120px;
  height: auto;
  object-fit: contain;
  animation: floatChara 3s ease-in-out infinite;
}

@keyframes floatChara {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

@media (max-width: 600px) {
}

/* ==========================================================================
   8. インジケーターの表示
   ========================================================================== */

.prob-row {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
  width: 100%;
  box-sizing: border-box;
}

.setting-label {
  width: 70px;
  font-size: 14px;
  flex-shrink: 0;
}

.gauge-container {
  flex-grow: 1;
  height: 16px; /* バーの太さ */
  background-color: #eee; /* 未満部分のグレー */
  border-radius: 8px;
  margin: 0 15px;
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
  min-width: 100px;
}

.gauge-bar {
  height: 100%;
  background: linear-gradient(90deg, #ff9f43, #ff7f0e);
  border-radius: 8px 0 0 8px;
  transition: width 0.5s ease-out;
}

.cherry-mode .gauge-bar {
  background: linear-gradient(90deg, #f3a683, #e377c2);
}
.watermelon-mode .gauge-bar {
  background: linear-gradient(90deg, #55efc4, #2ca02c);
}

.prob-value {
  width: 60px;
  text-align: right;
  font-size: 16px;
  font-weight: bold;
  flex-shrink: 0;
}

/* 
======================================================
  ロード画面用処理
======================================================
*/
#loading-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 240, 245, 0.85);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
}

.loading-box {
  text-align: center;
}

.magic-spinner {
  width: 80px;
  height: 80px;
  margin: 0 auto 20px;
  border-radius: 50%;
  position: relative;

  background: conic-gradient(
    from 0deg,

    /* 設定1 */
    /* #d91980 0%,
    #ff69b4 25%,
    #ffb6c1 50%,
    #ff69b4 75%,
    #d91980 100% */
    /* 設定2 */ #f9208d 0%,
    #ff1493 12%,
    #ff1493 15%,
    #ff69b4 30%,
    #ffd1dc 45%,
    #ffffff 55%,
    #ffb6c1 60%,
    #ff1493 75%,
    #ff1493 90%,
    #f9208d 100%
  );

  box-shadow:
    0 0 20px rgba(255, 20, 147, 0.6),
    inset 0 0 10px rgba(255, 255, 255, 0.5);

  animation: magic-rotate 1.6s linear infinite;
}

.magic-spinner::after {
  content: "";
  position: absolute;
  top: 6px;
  left: 6px;
  right: 6px;
  bottom: 6px;
  border-radius: 50%;

  background: radial-gradient(
    circle,
    rgba(255, 245, 250, 1) 0%,
    rgba(255, 240, 245, 0.85) 100%
  );

  box-shadow: inset 1px 1px 3px rgba(0, 0, 0, 0.15);
}
.loading-text {
  color: #ff1493;
  font-weight: bold;
  font-size: 1.1rem;
  letter-spacing: 0.1em;
  animation: magic-blink 1.5s ease-in-out infinite;
  position: relative;
}

.loading-text::after {
  content: "";
  position: absolute;
  animation: dot-animation 2.5s steps(1, end) infinite;
}

@keyframes dot-animation {
  0% {
    content: "";
  }
  25% {
    content: ".";
  }
  50% {
    content: "..";
  }
  75% {
    content: "...";
  }
  100% {
    content: "";
  }
}

@keyframes magic-rotate {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

@keyframes magic-blink {
  0%,
  100% {
    opacity: 0.6;
  }
  50% {
    opacity: 1;
  }
}

.disclaimer,
.result-notice {
  font-size: 0.78rem;
  color: #777777;
  line-height: 1.5;
  text-align: center;
  margin-top: 15px;
  padding: 0 10px;
  text-shadow:
    1px 1px 4px rgba(255, 255, 255, 0.8),
    -1px 1px 4px rgba(255, 255, 255, 0.8),
    1px -1px 4px rgba(255, 255, 255, 0.8),
    -1px -1px 4px rgba(255, 255, 255, 0.8);
}
