/* ===== インテリ雀士診断 / Day0 LIFF ===== */
/* スマホ最優先・LINE内ブラウザ向け */

:root {
  --bg: #0f1720;
  --bg-card: #16212e;
  --bg-elev: #1e2c3c;
  --text: #f2f5f8;
  --text-dim: #9fb0c0;
  --primary: #1fa463;       /* LINEグリーン寄り */
  --primary-press: #178050;
  --border: #2a3a4c;
  --accent: #e0b341;
  --danger: #d9534f;
  --radius: 14px;
  --maxw: 520px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN",
    "Noto Sans JP", "Yu Gothic", Meiryo, sans-serif;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

.app {
  max-width: var(--maxw);
  margin: 0 auto;
  min-height: 100dvh;
  position: relative;
}

/* ===== 画面切り替え ===== */
.screen {
  display: none;
  flex-direction: column;
  min-height: 100dvh;
  padding: env(safe-area-inset-top) 20px calc(env(safe-area-inset-bottom) + 16px);
}
.screen.is-active { display: flex; }

.screen-inner {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 24px 0;
}
.screen-inner.centered { align-items: center; text-align: center; }

.screen-footer {
  padding: 12px 0 8px;
}

/* ===== テキスト ===== */
.title {
  font-size: 26px;
  font-weight: 700;
  margin: 0 0 18px;
  letter-spacing: 0.02em;
}
.lead {
  font-size: 16px;
  color: var(--text);
  margin: 0 0 16px;
}
.note {
  font-size: 14px;
  color: var(--text-dim);
  margin: 8px 0 0;
}

/* ===== ボタン ===== */
.btn {
  display: block;
  width: 100%;
  padding: 16px;
  font-size: 17px;
  font-weight: 700;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s, transform 0.05s;
}
.btn:active { transform: scale(0.99); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:active { background: var(--primary-press); }
.btn-primary:disabled { background: var(--border); color: var(--text-dim); cursor: default; }
.btn-secondary { background: var(--bg-elev); color: var(--text); border: 1px solid var(--border); }

/* ===== 問題画面 ===== */
.quiz-header { padding-top: 12px; }
.progress {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-dim);
  margin-bottom: 8px;
}
.progress-bar {
  height: 6px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--primary);
  border-radius: 999px;
  transition: width 0.3s ease;
}

.q-question {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 14px;
  text-align: center;
}

.q-hand-img-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 18px;
  text-align: center;
}
.q-hand-img {
  width: 100%;
  max-height: 140px;
  object-fit: contain;
  display: block;
}

/* ===== 選択肢（4つ横並び・牌画像） ===== */
.choices {
  display: flex;
  flex-direction: row;
  gap: 10px;
  justify-content: center;
}
.choice {
  position: relative;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  padding: 0;
  width: 60px;
  flex: none;
  transition: border-color 0.15s;
}
.choice:active { opacity: 0.8; }
.choice.is-selected {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary);
}
.choice-img {
  width: 100%;
  display: block;
  object-fit: contain;
}
.choice-label {
  display: block;
  text-align: center;
  padding: 3px 0;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-dim);
  background: var(--bg-elev);
}
.choice.is-selected .choice-label {
  background: var(--primary);
  color: #fff;
}

/* ===== スピナー ===== */
.spinner {
  width: 44px;
  height: 44px;
  border: 4px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 18px;
}
@keyframes spin { to { transform: rotate(360deg); } }
