/* ==========================================================
   仲間はずれ探し - style.css
   配色・余白・カード・ボタンは基準実装（number-memory / letter-trace）を踏襲する。
   すべてのクラスに .odd- プレフィックスを付与（WP干渉防止）。
   ========================================================== */

[hidden] { display: none !important; }

.odd-body {
  margin: 0;
  background: #e9ecef;
}

.odd-app,
.odd-app *,
.odd-app *::before,
.odd-app *::after {
  box-sizing: border-box;
}

.odd-app {
  /* ---- CSS変数（基準実装と共通） ---- */
  --odd-red: #E03131;
  --odd-blue: #1971C2;
  --odd-green: #2F9E44;
  --odd-bg: #f4f6fb;
  --odd-card: #ffffff;
  --odd-text: #212529;
  --odd-muted: #5c6670; /* 基準実装の #868e96 は白地で 4.5:1 に届かないため暗くした(DS-22) */
  --odd-primary: #3b5bdb;
  --odd-primary-dark: #2f49b3;
  --odd-border: #dee2e6;
  --odd-radius: 16px;

  position: relative;
  display: flex;
  flex-direction: column;
  max-width: 560px;
  min-height: 640px;
  margin: 0 auto;
  padding: 16px 16px max(16px, env(safe-area-inset-bottom));
  background: var(--odd-bg);
  color: var(--odd-text);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN",
    "Yu Gothic", "Meiryo", "Noto Sans JP", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
}

/* 詳細度0のリセット（個別クラスのmargin等を邪魔しない） */
:where(.odd-app) :is(h1, h2, p, dl, dd, ul, ol) { margin: 0; padding: 0; }
:where(.odd-app) :is(ul, ol) { list-style: none; }

.odd-app button,
.odd-app a,
.odd-app summary { touch-action: manipulation; }

/* ---------- トップバー（戻るリンク／効果音） ---------- */
.odd-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  margin-bottom: 4px;
}
.odd-app a.odd-back,
.odd-app .odd-sound-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--odd-card);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.08s ease, background-color 0.15s ease;
}
.odd-app a.odd-back { color: var(--odd-primary); }
.odd-app .odd-sound-btn { margin-left: auto; color: var(--odd-muted); }
.odd-app a.odd-back:hover { background: #edf2ff; color: var(--odd-primary-dark); }
.odd-app .odd-sound-btn:hover { background: #f1f3f5; }
.odd-app a.odd-back:active,
.odd-app .odd-sound-btn:active { transform: scale(0.94); }
.odd-back svg,
.odd-sound-btn svg { display: block; width: 22px; height: 22px; }
.odd-app a.odd-back:focus-visible,
.odd-sound-btn:focus-visible,
.odd-btn:focus-visible,
.odd-details summary:focus-visible { outline: 3px solid #ffd43b; outline-offset: 2px; }

/* ---------- 画面共通 ---------- */
.odd-screen {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 16px;
}

.odd-card {
  background: var(--odd-card);
  border-radius: var(--odd-radius);
  padding: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

/* ---------- ボタン ---------- */
.odd-btn {
  display: block;
  width: 100%;
  min-height: 52px;
  padding: 12px 20px;
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.08s ease, background-color 0.15s ease, opacity 0.15s ease;
}
.odd-btn:active:not(:disabled) { transform: scale(0.97); }
.odd-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.odd-btn--primary { background: var(--odd-primary); color: #fff; box-shadow: 0 4px 0 var(--odd-primary-dark); }
.odd-btn--primary:hover:not(:disabled) { background: #4263eb; }
.odd-btn--cta { min-height: 64px; font-size: 1.25rem; }
.odd-app a.odd-btn--x {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; background: #111; color: #fff; text-decoration: none;
}
.odd-app a.odd-btn--x:hover { background: #333; color: #fff; }
.odd-btn--ghost { min-height: 48px; background: transparent; color: #495057; border: 1px solid var(--odd-border); }

/* ---------- ① スタート画面 ---------- */
.odd-hero { padding-top: 4px; text-align: center; }
.odd-title {
  font-size: clamp(1.4rem, 5.5vw, 1.8rem);
  font-weight: 800;
  line-height: 1.35;
}
.odd-subtitle { font-size: 1.1rem; font-weight: 700; color: var(--odd-primary); }

.odd-rule__lead { text-align: center; font-size: 1.05rem; margin-bottom: 12px; }
.odd-rule__lead strong { color: var(--odd-primary); }

/* 図解（CSS だけで描く。押せない） */
.odd-figure {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin: 0 auto 14px;
  max-width: 280px;
  padding: 12px;
  background: var(--odd-bg);
  border-radius: 12px;
}
.odd-figure__card {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 4px 6px;
  font-size: 1rem;
  font-weight: 700;
  white-space: nowrap;
  background: #fff;
  border: 2px solid var(--odd-border);
  border-radius: 10px;
}
.odd-figure__card--odd { border-color: var(--odd-primary); box-shadow: 0 0 0 3px #dbe4ff; }
.odd-figure__mark {
  position: absolute;
  top: -10px;
  right: -8px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1;
  color: #fff;
  background: var(--odd-primary);
  border-radius: 50%;
}

.odd-rule__list { font-size: 1rem; display: grid; gap: 6px; }
.odd-rule__list li { padding-left: 1.2em; position: relative; }
.odd-rule__list li::before { content: "●"; position: absolute; left: 0; color: var(--odd-primary); font-size: 0.6em; top: 0.6em; }

.odd-records { display: flex; justify-content: space-around; text-align: center; gap: 8px; }
.odd-records__item { flex: 1; }
.odd-records__item dt { font-size: 0.75rem; color: var(--odd-muted); }
.odd-records__item dd { font-size: 1.3rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.odd-records__item:nth-child(2) dd { color: var(--odd-primary); }

.odd-details { padding: 4px 16px; font-size: 0.9rem; color: var(--odd-muted); }
.odd-details summary {
  display: flex;
  align-items: center;
  min-height: 44px;
  cursor: pointer;
  font-weight: 700;
  list-style: none;
}
.odd-details summary::-webkit-details-marker { display: none; }
.odd-details summary::before { content: "▶"; margin-right: 8px; font-size: 0.75em; }
.odd-details[open] summary::before { content: "▼"; }
.odd-table { width: 100%; margin: 4px 0 8px; border-collapse: collapse; }
.odd-table th, .odd-table td { padding: 6px 4px; text-align: left; border-bottom: 1px solid var(--odd-border); }
.odd-table td:first-child { font-weight: 800; color: var(--odd-primary); }

/* ---------- ② プレイ画面 ---------- */
.odd-quiz-head { text-align: center; }
.odd-progress { font-size: 1.1rem; font-weight: 800; }
.odd-instruction { font-size: 1.05rem; font-weight: 700; color: var(--odd-muted); }

/* カード領域(ゲーム領域): 長押しメニュー・テキスト選択を抑止する(DS-23) */
.odd-choices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding-top: 6px;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
.odd-choice {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 72px;
  padding: 8px 6px;
  font: inherit;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
  color: var(--odd-text);
  background: #fff;
  border: 2px solid var(--odd-border);
  border-radius: 14px;
  box-shadow: 0 3px 0 #ced4da;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  transition: transform 0.05s ease, background-color 0.12s ease;
}
.odd-choice--single { font-size: 2rem; }
/* 5 枚目は最終行の中央に、他のカードと同じ幅(列の幅 = (全体 − 隙間) / 2)で置く */
.odd-choice:last-child:nth-child(odd) { grid-column: 1 / -1; width: calc(50% - 7px); justify-self: center; }
.odd-choice:hover:not(:disabled) { background: #f1f3f5; }
.odd-choice:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 0 0 #ced4da; }
.odd-choice:disabled { color: var(--odd-text); cursor: default; }
.odd-choice:focus-visible { outline: 3px solid #ffd43b; outline-offset: 2px; }
.odd-choice[data-state="correct"],
.odd-choice[data-state="answer"] {
  background: #ebfbee;
  border-color: #237a38;
  box-shadow: 0 0 0 3px #b2f2bb;
}
.odd-choice[data-state="answer"] { border-style: dashed; }
.odd-choice[data-state="wrong"] {
  background: #fff5f5;
  border-color: #c92a2a;
  box-shadow: 0 0 0 3px #ffc9c9;
}
/* 正誤は色だけで示さない: ○ / × の記号を角に付ける */
.odd-choice__mark {
  position: absolute;
  top: -10px;
  right: -8px;
  display: none;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1;
  color: #fff;
  background: #237a38;
  border-radius: 50%;
}
.odd-choice[data-state] .odd-choice__mark { display: flex; }
.odd-choice[data-state="wrong"] .odd-choice__mark { background: #c92a2a; }

.odd-explain { scroll-margin: 8px 0 16px; } /* 解答後のスクロールで、カードの下に余白を残す */
.odd-explain__judge { font-size: 1.5rem; font-weight: 900; }
.odd-explain__judge[data-result="correct"] { color: #237a38; }
.odd-explain__judge[data-result="wrong"] { color: #c92a2a; }
.odd-explain__text { margin-top: 6px; margin-bottom: 14px; font-size: 1.0625rem; line-height: 1.7; }
.odd-explain .odd-btn { min-height: 52px; }

/* ---------- ③ 結果画面 ---------- */
.odd-result__title { text-align: center; font-size: 1.4rem; font-weight: 800; }
.odd-result__main { position: relative; text-align: center; padding-top: 24px; }

.odd-new-record {
  display: inline-block; margin-bottom: 8px; padding: 2px 14px;
  background: #c92a2a; color: #fff;
  font-weight: 900; letter-spacing: 0.08em; border-radius: 999px;
  animation: odd-blink 0.9s ease-in-out infinite alternate;
}
@keyframes odd-blink { from { transform: scale(1); } to { transform: scale(1.08); } }

.odd-result__rank {
  width: 96px; height: 96px; margin: 0 auto 8px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; color: #fff;
  font-size: 3.4rem; font-weight: 900; line-height: 1;
  background: var(--odd-muted); /* 色は app.js が RANKS の color で上書きする */
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  animation: odd-pop 0.5s;
}
@keyframes odd-pop {
  0% { transform: scale(0.6); opacity: 0; }
  70% { transform: scale(1.12); opacity: 1; }
  100% { transform: scale(1); }
}

.odd-result__message { font-size: 1.1rem; font-weight: 800; }
.odd-result__note { font-weight: 700; color: var(--odd-muted); }
.odd-result__score { font-size: 2.6rem; font-weight: 900; line-height: 1.3; font-variant-numeric: tabular-nums; }

.odd-stats { display: flex; justify-content: space-around; text-align: center; gap: 8px; }
.odd-stats__item { flex: 1; }
.odd-stats__item dt { font-size: 0.75rem; color: var(--odd-muted); }
.odd-stats__item dd { font-size: 1.15rem; font-weight: 800; font-variant-numeric: tabular-nums; }

.odd-actions { display: grid; gap: 12px; }

/* スポンサー欄の置き場（中身は common/sponsor.js が出力する） */
.odd-zone { text-align: center; }
.odd-zone--start { margin-top: 8px; }
.odd-zone--result { margin-top: 48px; } /* 操作ボタンの下端から35px以上離す */

/* ---------- レスポンシブ ---------- */
@media (max-width: 380px) {
  .odd-app { padding-left: 12px; padding-right: 12px; }
}
@media (min-width: 600px) {
  .odd-app { margin-top: 16px; margin-bottom: 16px; border-radius: 20px; box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12); }
}

/* 動きを減らす設定への配慮(DS-20) */
@media (prefers-reduced-motion: reduce) {
  .odd-app *, .odd-app *::before, .odd-app *::after {
    animation: none !important;
    transition: none !important;
  }
}
