/* src/styles.css — dark / premium "reading the opponent" theme */
:root {
  --bg: #0a0d12;            /* 近黒 */
  --ink: #eef1f6;
  --muted: #7e8796;
  --line: rgba(255,255,255,0.08);
  --glass: rgba(255,255,255,0.045);
  --glass-2: rgba(255,255,255,0.07);
  --accent: #e6c372;        /* 洗練ゴールド */
  --accent-soft: rgba(230,195,114,0.16);
  --strong: #34d399;
  --weak: #97a3b4;
  --bluff: #fb7185;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: -apple-system, "Hiragino Sans", "Segoe UI", sans-serif;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  letter-spacing: 0.01em;
  /* 上から差すスポットライト＋ビネット */
  background:
    radial-gradient(130% 90% at 50% -10%, #1b2532 0%, #0c1017 52%, #06080c 100%) fixed;
  /* スマホ前提: タップの青ハイライト除去・誤選択防止・ダブルタップ拡大防止 */
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
  overscroll-behavior: none;
}
#app {
  max-width: 440px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;            /* モバイルのアドレスバー増減に追従 */
  display: flex;
  flex-direction: column;
  /* ノッチ・ホームインジケータ回避 */
  padding:
    calc(env(safe-area-inset-top) + 14px)
    calc(env(safe-area-inset-right) + 18px)
    calc(env(safe-area-inset-bottom) + 20px)
    calc(env(safe-area-inset-left) + 18px);
  position: relative;
}
button { font-family: inherit; cursor: pointer; }
/* 解説文だけは読み返せるよう選択を許可 */
.fb-explain { -webkit-user-select: text; user-select: text; }

/* === avatar：暗闇でこちらを見据える人影。目だけが光る === */
.avatar-figure {
  display: flex; justify-content: center; padding: 10px;
  background: radial-gradient(circle at 50% 42%, var(--accent-soft), transparent 62%);
}
.avatar-svg { width: min(300px, 82vw); height: auto; filter: drop-shadow(0 22px 34px rgba(0,0,0,0.6)); }
.av-shadow { fill: rgba(0,0,0,0.45); }
.av-body { fill: #12161e; }
.av-arm rect { fill: #161d29; }
.av-eye { fill: #f3ead2; filter: drop-shadow(0 0 3px rgba(243,234,210,0.5)); }  /* 光を受けた目 */
.av-mouth { fill: #2c333d; }
.av-chips circle { fill: var(--accent); stroke: #a8853a; stroke-width: 1; }
.av-head { transform-box: fill-box; transform-origin: center; }

/* 1 手の震え */
@keyframes shake { 0%,100%{transform:translateX(0)} 25%{transform:translateX(-2px)} 75%{transform:translateX(2px)} }
.tell-shake .av-arm-right { animation: shake 0.12s linear infinite; transform-box: fill-box; transform-origin: center; }

/* 2 固まる（全身が不自然に静止→わずかな硬直の表現として一瞬縮む） */
@keyframes freeze { 0%{transform:scale(1)} 10%{transform:scale(0.985)} 100%{transform:scale(0.985)} }
.tell-freeze .avatar-svg { animation: freeze 0.4s ease-out forwards; }

/* 3 即ベット（チップが素早く前に出る） */
@keyframes instantBet { 0%{transform:translateY(0)} 30%{transform:translateY(28px)} 100%{transform:translateY(28px)} }
.tell-instantBet .av-chips { animation: instantBet 0.25s ease-out forwards; transform-box: fill-box; }

/* 4 長考（頭がゆっくり傾く） */
@keyframes longThink { 0%{transform:rotate(0)} 100%{transform:rotate(-10deg)} }
.tell-longThink .av-head { animation: longThink 2s ease-in-out forwards; }

/* 5 目線をそらす（目が横にずれる） */
@keyframes eyesAway { 0%{transform:translateX(0)} 100%{transform:translateX(-5px)} }
.tell-eyesAway .av-eye { animation: eyesAway 0.8s ease-in-out forwards; transform-box: fill-box; }

/* 6 凝視（顔がわずかに前進・固定） */
@keyframes stareDown { 0%{transform:scale(1)} 100%{transform:scale(1.06)} }
.tell-stareDown .av-head { animation: stareDown 0.6s ease-out forwards; }

/* 7 呼吸が浅い（体が速く上下） */
@keyframes breathFast { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-3px)} }
.tell-breathFast .av-body { animation: breathFast 0.5s ease-in-out infinite; transform-box: fill-box; }

/* 8 喉や口を触る（腕が顔へ） */
@keyframes touchFace { 0%{transform:translate(0,0) rotate(0)} 100%{transform:translate(-30px,-72px) rotate(6deg)} }
.tell-touchFace .av-arm-right { animation: touchFace 1s ease-in-out forwards; transform-box: fill-box; transform-origin: bottom; }

/* 9 チップを丁寧に置く（ゆっくり静かに前へ） */
@keyframes chipsGentle { 0%{transform:translateY(0)} 100%{transform:translateY(26px)} }
.tell-chipsGentle .av-chips { animation: chipsGentle 1.8s ease-in-out forwards; transform-box: fill-box; }

/* 10 前のめり（上半身が前に出る） */
@keyframes leanForward { 0%{transform:translateY(0) scale(1)} 100%{transform:translateY(8px) scale(1.05)} }
.tell-leanForward .av-head, .tell-leanForward .av-body { animation: leanForward 0.7s ease-out forwards; }

/* 11 自分のチップを見る（目が下に流れる） */
@keyframes chipGlance { 0%,100%{transform:translate(0,0)} 30%,62%{transform:translate(2px,3px)} }
.tell-chipGlance .av-eye { animation: chipGlance 1.3s ease-in-out; transform-box: fill-box; }

/* 12 早めにチップへ手を伸ばす（右手がチップへ寄る） */
@keyframes earlyReach { 0%{transform:translate(0,0)} 100%{transform:translate(9px,-15px)} }
.tell-earlyReach .av-arm-right { animation: earlyReach 0.6s ease-out forwards; transform-box: fill-box; transform-origin: bottom; }

/* 13 手札を見直す（カードを少し持ち上げて覗く） */
@keyframes recheckCards { 0%,100%{transform:translateY(0)} 38%,70%{transform:translateY(-7px)} }
.tell-recheckCards .av-cards { animation: recheckCards 1.5s ease-in-out; transform-box: fill-box; }

/* 14 チップを指で弾く（くるりと回す遊び） */
@keyframes chipFlip { 0%,100%{transform:translateY(0) rotate(0)} 50%{transform:translateY(-12px) rotate(180deg)} }
.tell-chipFlip .av-chips { animation: chipFlip 0.55s ease-in-out 2; transform-box: fill-box; transform-origin: center; }

/* 15 心配げに唇を横に引く（口が横に広がる） */
@keyframes worriedLips { 0%,100%{transform:scaleX(1) scaleY(1)} 45%,75%{transform:scaleX(1.8) scaleY(0.7)} }
.tell-worriedLips .av-mouth { animation: worriedLips 1.4s ease-in-out; transform-box: fill-box; transform-origin: center; }

/* 16 ベット後に立ち上がる（上半身が立ち上がる） */
@keyframes standUp { 0%{transform:translateY(0)} 100%{transform:translateY(-24px)} }
.tell-standUp .av-head, .tell-standUp .av-body { animation: standUp 0.8s ease-out forwards; }

/* === 画面の入り（上品なフェードアップ） === */
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.screen { flex: 1 0 auto; display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 8px 4px; animation: fadeUp .4s ease both; }
/* 短い画面（導入・本編開始・結果）は縦中央に。問題画面は上寄せで全要素を確保 */
.screen.intro, .screen.result, .screen:not(.intro):not(.question):not(.result) { justify-content: center; }
.screen.question { justify-content: flex-start; padding-top: 2vh; }
.screen.encyclopedia, .screen.tell-detail { justify-content: flex-start; }

/* === home menu === */
.menu-sub { color: var(--muted); margin: -2px 0 16px; }
.menu-btn { width: 100%; max-width: 320px; padding: 16px 20px; font-size: 17px; }
.menu-badge {
  display: inline-block; margin-left: 8px; padding: 1px 9px; border-radius: 999px;
  font-size: 13px; background: var(--bluff); color: #1a0d10; font-weight: 800;
}

/* === encyclopedia === */
.enc-head { display: flex; align-items: center; gap: 10px; width: 100%; max-width: 380px; margin-bottom: 2px; }
.enc-head h2 { margin: 0; }
.back-btn { padding: 8px 14px; font-size: 14px; }
.enc-note { color: var(--muted); font-size: 13px; max-width: 380px; text-align: center; margin: 0 0 6px; }
.enc-group { width: 100%; max-width: 380px; margin: 0 auto; }
.enc-group + .enc-group { margin-top: 22px; }
.enc-group-title {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin: 4px 2px 10px; padding-left: 11px; border-left: 3px solid var(--muted);
  font-size: 13px;
}
.enc-group-title.g-value { border-left-color: var(--strong); }
.enc-group-title.g-bluff { border-left-color: var(--bluff); }
.enc-group-title.g-mixed { border-left-color: var(--accent); }
.enc-group-label { font-weight: 800; color: var(--ink); font-size: 13.5px; }
.enc-group-count { color: var(--muted); font-size: 11px; font-weight: 600; margin-left: auto; }
.enc-list { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 10px; }
.enc-card {
  text-align: left; width: 100%; padding: 14px 16px; border-radius: 14px;
  background: var(--glass); border: 1px solid var(--line); color: var(--ink);
  transition: transform .12s ease, border-color .12s ease;
}
.enc-card:hover { transform: translateY(-1px); border-color: rgba(255,255,255,0.18); }
.enc-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.enc-name { font-size: 16px; font-weight: 700; }
.enc-meta { font-size: 12px; color: var(--muted); margin: 4px 0; }
.enc-summary { font-size: 13px; line-height: 1.55; color: #cdd4de; }

/* read badges & reliability */
.badge { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.badge-value { background: rgba(52,211,153,0.16); color: var(--strong); border: 1px solid rgba(52,211,153,0.4); }
.badge-bluff { background: rgba(251,113,133,0.16); color: var(--bluff); border: 1px solid rgba(251,113,133,0.4); }
.badge-mixed { background: rgba(230,195,114,0.16); color: var(--accent); border: 1px solid rgba(230,195,114,0.4); }
.badge-weak { background: rgba(151,163,180,0.16); color: var(--weak); border: 1px solid rgba(151,163,180,0.4); }
.rel { font-weight: 700; }
.rel-高 { color: var(--strong); }
.rel-中 { color: var(--accent); }
.rel-低 { color: var(--muted); }

/* === tell detail === */
.tell-detail .detail-avatar { display: flex; justify-content: center; }
.detail-badges { display: flex; gap: 10px; align-items: center; margin: 2px 0 6px; }
.detail-text {
  max-width: 380px; font-size: 14px; line-height: 1.75; color: #cdd4de; text-align: left;
  -webkit-user-select: text; user-select: text;
}

/* === ライブ攻略ガイド === */
.guide-body { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 22px; -webkit-user-select: text; user-select: text; }
.guide-section { text-align: left; }
.guide-title {
  margin: 0 0 4px; font-size: 17px; color: var(--accent); letter-spacing: 0.02em;
  border-left: 3px solid var(--accent); padding-left: 10px;
}
.guide-intro { margin: 0 0 12px; font-size: 13px; color: var(--muted); line-height: 1.6; }
.guide-item {
  background: var(--glass); border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 14px; margin-bottom: 10px;
}
.guide-item-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.guide-item-name { font-size: 15px; font-weight: 700; color: var(--ink); }
.guide-item-text { margin: 0; font-size: 13px; line-height: 1.7; color: #cdd4de; }
.guide-item-text b { color: var(--ink); }

/* === situation：ポーカーHUD風 === */
.situation {
  width: 100%; max-width: 380px; margin: 8px auto 4px;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}

/* ポット：チップ型の数値ピル */
.sit-pot-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 16px 6px 12px; border-radius: 999px;
  background: linear-gradient(180deg, rgba(243,215,150,0.12), rgba(216,169,78,0.05));
  border: 1px solid rgba(216,169,78,0.35);
  box-shadow: 0 4px 16px rgba(0,0,0,0.28), inset 0 1px 0 rgba(255,255,255,0.08);
}
.sit-chip-ico { width: 18px; height: 18px; color: var(--accent); opacity: 0.95; }
.sit-pot-label {
  font-size: 10px; letter-spacing: 0.22em; font-weight: 700; color: var(--accent);
}
.sit-pot-val { font-size: 17px; font-weight: 800; color: var(--ink); letter-spacing: 0.02em; }
.sit-pot-val small {
  font-size: 10px; font-weight: 700; color: var(--muted); margin-left: 3px; letter-spacing: 0.08em;
}

/* アクション：ガラスのカード */
.sit-card {
  width: 100%; box-sizing: border-box;
  padding: 12px 18px 14px; border-radius: 16px;
  background: var(--glass); border: 1px solid var(--line);
  backdrop-filter: blur(6px);
  box-shadow: 0 6px 22px rgba(0,0,0,0.22), inset 0 1px 0 rgba(255,255,255,0.05);
}
.sit-eyebrow {
  font-size: 10px; letter-spacing: 0.24em; text-transform: uppercase;
  color: var(--muted); font-weight: 700; margin-bottom: 6px;
}
.sit-action {
  margin: 0; font-size: 18px; font-weight: 600; color: var(--ink); line-height: 1.62;
}

/* === text === */
.screen h1 {
  margin: 6px 0 2px; font-size: 27px; font-weight: 800; letter-spacing: 0.04em;
  background: linear-gradient(180deg, #fbeec4, #d8a94e);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.intro p { line-height: 1.75; color: #cfd6e0; }
.intro-hook { font-size: 21px; font-weight: 700; color: var(--accent); letter-spacing: 0.02em; margin: 6px 0 8px; }
.intro-lead { font-size: 17px; color: var(--ink); margin-top: 6px; }

/* === buttons === */
.btn {
  border: 1px solid var(--line); border-radius: 12px; padding: 12px 22px; font-size: 16px;
  background: var(--glass); color: var(--ink); backdrop-filter: blur(6px);
  transition: transform .14s ease, border-color .14s ease, background .14s ease, box-shadow .14s ease;
}
.btn:hover { transform: translateY(-1px); background: var(--glass-2); border-color: rgba(255,255,255,0.18); }
.btn:disabled { opacity: 0.55; cursor: default; transform: none; }
.btn-primary {
  border: none; color: #1a130a; font-weight: 800; letter-spacing: 0.03em;
  background: linear-gradient(135deg, #f3d796, #d8a94e);
  box-shadow: 0 8px 24px rgba(216,169,78,0.30), inset 0 1px 0 rgba(255,255,255,0.4);
}
.btn-primary:hover { box-shadow: 0 12px 30px rgba(216,169,78,0.42); }

.q-top { width: 100%; display: flex; align-items: center; gap: 8px; min-height: 30px; }
.q-slot { flex: 0 0 76px; display: flex; align-items: center; }
.q-slot:last-child { justify-content: flex-end; }
.q-heading { flex: 1; text-align: center; color: var(--muted); font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; }
.quit-btn {
  padding: 6px 12px; font-size: 12px; border-radius: 10px;
  color: var(--muted); background: var(--glass); border: 1px solid var(--line);
}
.quit-btn:hover { transform: none; color: var(--ink); border-color: rgba(255,255,255,0.18); background: var(--glass-2); }

/* === 2択：ガラスのカード＋色の発光 === */
.q-choices { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-top: 4px; }
.choice {
  min-width: 120px; padding: 15px 22px; font-weight: 700; font-size: 17px; border-radius: 14px;
  border: 1px solid var(--line); position: relative; overflow: hidden;
}
.choice::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; opacity: 0.9;
}
.choice-value::after { background: var(--strong); box-shadow: 0 0 16px var(--strong); }
.choice-bluff::after { background: var(--bluff);  box-shadow: 0 0 16px var(--bluff); }
.choice-value:hover { border-color: var(--strong); }
.choice-bluff:hover { border-color: var(--bluff); }

/* 回答後：正解＝緑で点灯＋✓ / 誤答した選択＝赤＋✕。残りは薄く後退 */
.choice.is-correct, .choice.is-wrong { opacity: 1; }
.choice.is-correct {
  border-color: var(--strong); color: #d8ffec;
  background: rgba(52,211,153,0.14);
}
.choice.is-correct::after { background: var(--strong); box-shadow: 0 0 18px var(--strong); opacity: 1; }
.choice.is-wrong {
  border-color: var(--bluff); color: #ffe2e7;
  background: rgba(251,113,133,0.14);
}
.choice.is-wrong::after { background: var(--bluff); box-shadow: 0 0 18px var(--bluff); opacity: 1; }
.choice.is-correct::before, .choice.is-wrong::before {
  position: absolute; top: 5px; right: 9px; font-size: 13px; font-weight: 800; line-height: 1;
}
.choice.is-correct::before { content: "✓"; color: var(--strong); }
.choice.is-wrong::before { content: "✕"; color: var(--bluff); }

/* === feedback：ガラスのパネル === */
.q-feedback {
  width: 100%; max-width: 380px; margin-top: 6px;
  background: var(--glass); border: 1px solid var(--line); border-radius: 16px;
  padding: 18px 18px 16px; text-align: center; backdrop-filter: blur(8px);
  box-shadow: 0 16px 40px rgba(0,0,0,0.4);
}
.fb-mark { font-size: 22px; font-weight: 800; letter-spacing: 0.04em; }
.fb-mark.ok { color: var(--strong); text-shadow: 0 0 20px rgba(52,211,153,0.5); }
.fb-mark.ng { color: var(--bluff); text-shadow: 0 0 20px rgba(251,113,133,0.5); }
.fb-answer { margin-top: 6px; color: var(--muted); font-size: 14px; }
.fb-answer b { color: var(--ink); }
.fb-explain { font-size: 14px; line-height: 1.7; text-align: left; color: #cdd4de; margin: 12px 0 14px; }

/* === result === */
.result-score {
  font-size: 30px; font-weight: 800; letter-spacing: 0.02em;
  background: linear-gradient(180deg, #fbeec4, #d8a94e);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.result-best { color: var(--muted); font-size: 14px; letter-spacing: 0.04em; }
