/* App Factory 共通スタイル。色は商品データの theme で上書きされる */
:root {
  --af-bg: #12101d;
  --af-card: #1e1b30;
  --af-text: #f2eefc;
  --af-sub: #b9b3cf;
  --af-primary: #8b6ff0;
  --af-accent: #ffd700;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--af-bg);
  color: var(--af-text);
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", sans-serif;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 24px 12px;
  line-height: 1.7;
}

.af-app { width: 100%; max-width: 520px; }

.af-card {
  background: var(--af-card);
  border-radius: 16px;
  padding: 28px 22px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, .35);
}

.af-title {
  font-size: 1.5rem;
  text-align: center;
  margin-bottom: 8px;
  color: var(--af-accent);
}

.af-tagline {
  text-align: center;
  color: var(--af-sub);
  font-size: .95rem;
  margin-bottom: 24px;
}

.af-progress {
  height: 6px;
  background: rgba(255, 255, 255, .12);
  border-radius: 3px;
  margin-bottom: 20px;
  overflow: hidden;
}

.af-progress-bar {
  height: 100%;
  background: var(--af-primary);
  border-radius: 3px;
  transition: width .3s ease;
}

.af-qnum { color: var(--af-sub); font-size: .85rem; margin-bottom: 6px; }

.af-question { font-size: 1.1rem; font-weight: bold; margin-bottom: 20px; }

.af-btn {
  display: block;
  width: 100%;
  padding: 14px 16px;
  margin-bottom: 12px;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 12px;
  background: rgba(255, 255, 255, .06);
  color: var(--af-text);
  font-size: 1rem;
  text-align: left;
  cursor: pointer;
  transition: background .15s, transform .1s;
}

.af-btn:hover { background: rgba(255, 255, 255, .14); transform: translateY(-1px); }

.af-btn-primary {
  background: var(--af-primary);
  border: none;
  text-align: center;
  font-weight: bold;
  color: #fff;
}

.af-btn-primary:hover { background: var(--af-primary); filter: brightness(1.15); }

.af-btn.af-correct { background: rgba(80, 200, 120, .35); border-color: #50c878; }
.af-btn.af-wrong { background: rgba(220, 80, 80, .35); border-color: #dc5050; }
.af-btn:disabled { cursor: default; transform: none; }

.af-explain {
  background: rgba(255, 255, 255, .07);
  border-left: 4px solid var(--af-accent);
  border-radius: 8px;
  padding: 12px 14px;
  font-size: .92rem;
  margin: 4px 0 16px;
}

.af-explain .af-verdict { font-weight: bold; margin-bottom: 4px; }

.af-result-icon { font-size: 3.2rem; text-align: center; margin-bottom: 8px; }

.af-result-img {
  display: block;
  max-width: 200px;
  max-height: 200px;
  margin: 0 auto 12px;
  border-radius: 14px;
}

.af-result-name {
  font-size: 1.4rem;
  font-weight: bold;
  text-align: center;
  color: var(--af-accent);
  margin-bottom: 4px;
}

.af-result-score { text-align: center; color: var(--af-sub); margin-bottom: 16px; }

.af-result-desc { font-size: .95rem; margin-bottom: 22px; white-space: pre-line; }

.af-share-label {
  text-align: center;
  color: var(--af-sub);
  font-size: .85rem;
  margin-bottom: 10px;
}

.af-share-row { display: flex; gap: 10px; margin-bottom: 22px; }

.af-share-btn {
  flex: 1;
  display: block;
  padding: 12px;
  border-radius: 12px;
  text-align: center;
  text-decoration: none;
  font-weight: bold;
  font-size: .95rem;
  color: #fff;
}

.af-share-x { background: #000; border: 1px solid #444; }
.af-share-bsky { background: #1185fe; }

.af-cta { margin-bottom: 6px; }

.af-cta a {
  display: block;
  padding: 13px;
  margin-bottom: 10px;
  border-radius: 12px;
  background: var(--af-accent);
  color: #201a00;
  text-align: center;
  text-decoration: none;
  font-weight: bold;
}

.af-retry {
  background: none;
  border: none;
  color: var(--af-sub);
  text-decoration: underline;
  cursor: pointer;
  display: block;
  margin: 10px auto 0;
  font-size: .9rem;
}

/* シミュレーター型 */
.af-form { margin-bottom: 6px; }

.af-field { display: block; margin-bottom: 14px; }

.af-field-label {
  display: block;
  font-size: .88rem;
  color: var(--af-sub);
  margin-bottom: 6px;
}

.af-field-row { display: flex; align-items: center; gap: 8px; }

.af-field-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.af-field-numwrap { display: flex; align-items: center; gap: 6px; }

.af-input-num { width: 110px; padding: 8px 10px; text-align: right; flex: none; }

.af-range {
  width: 100%;
  margin-top: 10px;
  accent-color: var(--af-primary);
  cursor: pointer;
}

.af-input {
  flex: 1;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 10px;
  background: rgba(255, 255, 255, .06);
  color: var(--af-text);
  font-size: 1.05rem;
}

.af-input:focus { outline: 2px solid var(--af-primary); }

.af-suffix { color: var(--af-sub); font-size: .9rem; white-space: nowrap; }

.af-sim-out { margin-top: 18px; }

.af-sim-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 10px 4px;
  border-bottom: 1px solid rgba(255, 255, 255, .1);
}

.af-sim-label { color: var(--af-sub); font-size: .9rem; }

.af-sim-value { font-size: 1.1rem; font-weight: bold; }

.af-sim-highlight .af-sim-value { color: var(--af-accent); font-size: 1.45rem; }

.af-chart {
  width: 100%;
  height: auto;
  margin: 16px 0 6px;
}

.af-disclaimer {
  margin-top: 14px;
  font-size: .75rem;
  color: var(--af-sub);
  line-height: 1.6;
}

.af-footer {
  text-align: center;
  margin-top: 18px;
  font-size: .8rem;
}

.af-footer a { color: var(--af-sub); }
