/* スロ期待値ラボ — スタイル */
:root {
  --bg: #0d1320;
  --bg-soft: #111a2c;
  --panel: #16203395;
  --panel-solid: #162033;
  --border: #26345080;
  --border-strong: #33456b;
  --text: #dfe7f5;
  --text-dim: #93a5c4;
  --text-faint: #6b7d9e;
  --acc-sl: #4cc9f0;      /* スロ系アクセント（シアン） */
  --acc-inv: #f4b942;     /* 投資系アクセント（アンバー） */
  --pos: #3ddc97;
  --neg: #ff6b7a;
  --radius: 14px;
  font-size: 16px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background:
    radial-gradient(1200px 600px at 80% -10%, #1a2a4d55, transparent),
    radial-gradient(900px 500px at -10% 20%, #16324a55, transparent),
    var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI", sans-serif;
  line-height: 1.65;
}

main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px 20px 60px;
}

/* ---------- ヘッダー ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #0d1320e6;
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 12px 20px 10px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 20px;
}
.brand { font-size: 17px; letter-spacing: 0.02em; }
.brand b { font-weight: 800; }
.brand-sub { color: var(--text-dim); font-size: 12px; margin-left: 10px; }

.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-left: auto; }
.tabs button {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-dim);
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  padding: 7px 13px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.tabs button:hover { color: var(--text); background: #ffffff0d; }
.tabs button.active {
  color: #0d1320;
  background: linear-gradient(135deg, #7bd7f5, #4cc9f0);
  border-color: transparent;
}

/* ---------- 汎用 ---------- */
.tab { display: none; }
.tab.active { display: block; animation: fadein 0.25s ease; }
@keyframes fadein { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.tab-head { margin: 8px 0 20px; }
.tab-head h1 { font-size: 26px; margin: 0 0 6px; }
.lead { color: var(--text-dim); max-width: 860px; margin: 0; }
.lead b { color: var(--text); }

.panel {
  background: linear-gradient(180deg, #182338, #141d30);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin: 0 0 18px;
}
.panel h2 { font-size: 19px; margin: 0 0 12px; }
.panel h3 { font-size: 15.5px; margin: 0 0 14px; display: flex; align-items: center; gap: 8px; }
.panel p { margin: 8px 0; color: var(--text-dim); }
.panel p b, .panel li b { color: var(--text); }

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 18px;
}
.grid-2 > * { margin-bottom: 0 !important; }
.grid-2.tight { gap: 6px; }

.hidden { display: none !important; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.chip {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  color: var(--text-dim);
  background: #ffffff08;
}
.chip.warn { border-color: #ff6b7a66; color: #ffb3bb; background: #ff6b7a14; }

.tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 6px;
  letter-spacing: 0.05em;
}
.tag-sl { color: #06222e; background: var(--acc-sl); }
.tag-inv { color: #2b1d02; background: var(--acc-inv); }

.hero { padding: 30px 6px 24px; }
.hero h1 {
  font-size: 34px;
  margin: 0 0 10px;
  background: linear-gradient(100deg, #8fd9f4, #f4d38a);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  width: fit-content;
}
.hero .lead { font-size: 15.5px; }

.formula {
  font-family: "SF Mono", ui-monospace, Menlo, monospace;
  font-size: 13px;
  line-height: 1.6;
  background: #0b1220;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  margin: 10px 0;
  color: #bfe3f7;
  overflow-x: auto;
  white-space: nowrap;
}

.note {
  font-size: 13px;
  color: var(--text-faint);
  border-left: 3px solid var(--border-strong);
  padding-left: 12px;
  margin-top: 12px;
}
.hint-block { font-size: 12.5px; color: var(--text-faint); margin-top: 12px; }
.verdict {
  font-size: 13.5px;
  font-weight: 600;
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  background: #ffffff08;
  border: 1px dashed var(--border-strong);
}
.verdict.pos { border-color: #3ddc9755; color: #a7f3d0; }
.verdict.neg { border-color: #ff6b7a55; color: #ffc2c9; }
.verdict.mid { border-color: #f4b94255; color: #ffe1a8; }

/* ---------- テーブル ---------- */
.table-wrap { overflow-x: auto; }
.map-table, .inf-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.map-table th, .map-table td, .inf-table th, .inf-table td {
  text-align: left;
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.map-table th, .inf-table th {
  color: var(--text-faint);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
}
.map-table td:first-child, .inf-table td:first-child { font-weight: 700; white-space: nowrap; }
.map-table tr:last-child td, .inf-table tr:last-child td { border-bottom: none; }

/* ---------- コントロール ---------- */
.ctl { margin: 0 0 14px; }
.ctl label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 5px;
}
.ctl label .hint { font-weight: 400; color: var(--text-faint); font-size: 11.5px; margin-left: 8px; }
.ctl-inputs {
  display: flex;
  align-items: center;
  gap: 10px;
}
.ctl-inputs input[type="range"] {
  flex: 1;
  accent-color: var(--acc-sl);
  min-width: 60px;
}
.ctl-inputs input[type="number"], .ctl-inputs select {
  width: 110px;
  background: #0b1220;
  border: 1px solid var(--border-strong);
  color: var(--text);
  border-radius: 8px;
  padding: 6px 9px;
  font: inherit;
  font-size: 13.5px;
  font-variant-numeric: tabular-nums;
}
.ctl-inputs select { width: auto; max-width: 100%; flex: 1; }
.ctl-inputs .unit { color: var(--text-faint); font-size: 12px; white-space: nowrap; }

.ctl-inline { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ctl-inline select {
  background: #0b1220;
  border: 1px solid var(--border-strong);
  color: var(--text);
  border-radius: 8px;
  padding: 6px 9px;
  font: inherit;
  font-size: 13px;
}

.preset-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 14px; }

/* ---------- ボタン ---------- */
.btn {
  appearance: none;
  font: inherit;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
  background: #ffffff10;
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  padding: 8px 16px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn:hover { background: #ffffff1c; border-color: #47608f; }
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: linear-gradient(135deg, #4cc9f0, #3a9fd6);
  border-color: transparent;
  color: #06222e;
}
.btn-primary:hover { filter: brightness(1.1); background: linear-gradient(135deg, #4cc9f0, #3a9fd6); }
.btn-sm { padding: 5px 11px; font-size: 12px; border-radius: 8px; }
.btn-ghost { border-style: dashed; color: var(--text-dim); }
.btn-preset { color: var(--text-dim); }
.btn-preset:hover { color: var(--text); }

/* ---------- KPI ---------- */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin: 14px 0;
}
.kpi {
  background: #0b1220;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
}
.kpi .label { font-size: 11px; color: var(--text-faint); margin-bottom: 3px; }
.kpi .value {
  font-size: 19px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}
.kpi .value.small { font-size: 15px; }
.pos { color: var(--pos); }
.neg { color: var(--neg); }
.zero { color: var(--text-dim); }
.acc-sl { color: var(--acc-sl); }
.acc-inv { color: var(--acc-inv); }

/* ---------- その他パーツ ---------- */
.steps { padding-left: 20px; margin: 10px 0; color: var(--text-dim); }
.steps li { margin: 10px 0; }
.steps .btn { margin-left: 10px; }
.bullets { padding-left: 20px; color: var(--text-dim); font-size: 14px; }
.bullets li { margin: 6px 0; }

.mode-toggle { display: flex; gap: 10px; margin-bottom: 16px; }
.mode-btn { font-size: 14px; padding: 9px 18px; opacity: 0.55; }
.mode-btn.active { opacity: 1; border-color: var(--acc-sl); box-shadow: 0 0 0 1px var(--acc-sl) inset; }

.mapping-strip { border-left: 3px solid var(--acc-inv); }

.canvas-wrap { width: 100%; }
.canvas-wrap canvas {
  width: 100%;
  height: 320px;
  display: block;
  background: #0b1220;
  border: 1px solid var(--border);
  border-radius: 10px;
}

.sim-result { border-color: #3a4f7a; }

.inf-actions { display: flex; flex-wrap: wrap; gap: 7px; margin: 10px 0; }
.obs-box {
  font-size: 13.5px;
  background: #0b1220;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  margin: 10px 0;
  color: var(--text-dim);
}
.obs-box b { color: var(--acc-sl); font-variant-numeric: tabular-nums; }
.hidden-truth { color: var(--text-faint); letter-spacing: 0.2em; }
.hidden-truth.revealed { color: var(--acc-inv); letter-spacing: normal; }

.inf-table .bar-cell { position: relative; min-width: 130px; }
.inf-table .bar-track {
  background: #0b1220;
  border-radius: 6px;
  height: 18px;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
}
.inf-table .bar-fill {
  position: absolute;
  inset: 0 auto 0 0;
  background: linear-gradient(90deg, #2d9cc8, var(--acc-sl));
  border-radius: 6px 0 0 6px;
}
.inf-table tr.argmax td { background: #4cc9f00f; }
.inf-table .post-val { font-variant-numeric: tabular-nums; font-weight: 700; }

.site-footer {
  border-top: 1px solid var(--border);
  padding: 22px 20px 34px;
  text-align: center;
  color: var(--text-faint);
  font-size: 12px;
}
.site-footer p { max-width: 900px; margin: 0 auto; }

@media (max-width: 640px) {
  .hero h1 { font-size: 27px; }
  .kpi .value { font-size: 16px; }
  .canvas-wrap canvas { height: 250px; }
  .brand-sub { display: none; }
}
