:root {
  --bg:#0f0f13;
  --panel:#17171d;
  --text:#f3f3f3;
  --muted:#aab2bb;
  --accent:#4cc9f0;
  --accent-2:#98ff98;
  --pill:#1b1f27;
  --pill-done:#303540;
  --danger:#ff6b6b;
}

* { box-sizing: border-box; }
html, body { height:100%; }
body {
  margin:0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Hiragino Kaku Gothic ProN", "Noto Sans JP", sans-serif;
  color:var(--text);
  background:linear-gradient(180deg,#0c0d10,#14161c);
  font-size: 18px;
  line-height: 1.6;
}

/* ===== 共通UI ===== */
button {
  background:var(--accent);
  color:#03202a;
  border:none;
  padding:12px 18px;
  border-radius:12px;
  font-weight:700;
  font-size:16px;
  cursor: pointer;
}
button.primary { background: var(--accent); }
button:disabled { opacity:.55; cursor:not-allowed; }

/* スクリーン切替 */
.screen { display:none; padding:24px; max-width:1000px; margin:0 auto; }
.screen.active { display:block; }

.centered { display:flex; justify-content:center; align-items:center; text-align:center; }
.column { flex-direction: column; gap: 16px; }
.sub { color: var(--muted); margin-top: -8px; }

/* パネル */
.panel {
  background: var(--panel);
  border:1px solid #23242b;
  border-radius: 16px;
  padding: 20px;
}
.panel h2 { margin:0 0 10px 0; }

/* ヘッダー */
.header {
  padding:18px 18px 10px;
  background:var(--panel);
  border-bottom:1px solid #222;
}
.header h1 {
  margin:0;
  font-size: clamp(22px, 3.5vw, 30px);
}

/* メイン */
main {
  padding:18px;
  display:grid;
  gap:22px;
  grid-template-columns: 1fr;
  max-width:1000px;
  margin:0 auto;
}

/* 月バー */
.months { margin-top:8px; }
.months-bar { display:flex; gap:10px; flex-wrap:wrap; }
.month-pill {
  background: var(--pill);
  color:#dbe2ea;
  border:1px solid #2a2e36;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 16px;
  letter-spacing: .5px;
  transition: opacity .2s ease, transform .08s ease;
}
.month-pill.active { outline: 2px solid var(--accent); outline-offset: 2px; }
.month-pill.done { background: var(--pill-done); color:#9aa0a6; opacity: .75; }

/* プロフィール（アバター） */
.profile { margin-top: -4px; }
.avatar-wrap { display:flex; flex-direction: column; align-items:center; gap:10px; }
.avatar {
  width:96px; height:96px; border-radius: 12px;
  background: #20242e;
  border: 1px solid #2a2e36;
  box-shadow: inset 0 0 0 3px #0d0f14;
  image-rendering: pixelated;  /* ドット感 */
  position: relative;
}
.avatar.pixel::after {
  content:'👵'; /* 仮の絵文字。後で画像差し替えOK */
  position:absolute; inset:0; display:grid; place-items:center;
  font-size:56px;
}
.avatar.bob { animation: bob 1.2s ease-in-out 1; }
@keyframes bob {
  0% { transform: translateY(0) }
  50% { transform: translateY(-6px) }
  100% { transform: translateY(0) }
}
.avatar.shake { animation: shake .25s linear 1; }
@keyframes shake {
  0% { transform: translateX(0) }
  25% { transform: translateX(-6px) }
  50% { transform: translateX(6px) }
  75% { transform: translateX(-4px) }
  100% { transform: translateX(0) }
}

.avatar-labels { display:flex; gap:8px; flex-wrap:wrap; justify-content:center; }
.pill {
  background:#121318; border:1px solid #23242b; color:#dbe2ea;
  border-radius: 999px; padding: 4px 10px; font-size: 13px;
}

/* ステータス */
.status { gap:14px; flex-wrap:wrap; }
.stat {
  background:#121318;
  padding:12px 14px;
  border-radius:14px;
  border:1px solid #23242b;
  min-width:140px;
}
.stat span { color:var(--muted); font-size: 13px; letter-spacing:.3px; }
.stat b { display:block; font-size: 26px; margin-top:4px; }

/* カード */
.cards h2 { margin:0 0 10px 0; font-size:20px; color:#e6edf6; }
.card-list {
  display:grid; gap:14px;
  grid-template-columns: repeat(auto-fit, minmax(260px,1fr));
}

/* 大富豪っぽい動き：配られる/並ぶアニメ */
.card {
  background:#121318;
  border:1px solid #23242b;
  border-radius:16px;
  padding:16px;
  transition:transform .16s ease, border-color .2s ease, box-shadow .2s ease, opacity .2s ease, filter .2s ease;
  cursor:pointer;
  position: relative;
  animation: deal .22s ease both;
}
@keyframes deal { from { transform: translateY(12px); opacity: 0 } to { transform: translateY(0); opacity:1 } }

.card:hover:not(.disabled),
.card:focus-visible:not(.disabled) {
  transform: translateY(-4px) scale(1.02);
  border-color:var(--accent);
  box-shadow: 0 10px 22px rgba(0,0,0,.28), 0 0 0 4px rgba(76,201,240,.12);
  outline: none;
}
.card h4 { margin:0 0 8px 0; font-size:18px; }
.effects { color:var(--muted); font-size:14px; line-height:1.6; }
.selected { outline:2px solid var(--accent); outline-offset: 2px; }

/* 選択後の演出：選んだカードは浮き上がり→固定、他はグレーアウト */
.card.picked {
  transform: translateY(-8px) scale(1.03);
  box-shadow: 0 14px 28px rgba(0,0,0,.32);
}
.card.disabled {
  opacity: .35;
  filter: grayscale(40%);
  pointer-events: none;
  transform: none !important;
  box-shadow: none !important;
  border-color:#23242b !important;
}

/* 選択グリッド（キャラ/家族/地区） */
.select-grid {
  display:grid; gap:12px;
  grid-template-columns: repeat(auto-fit, minmax(220px,1fr));
}
.option {
  background:#121318;
  border:1px solid #23242b;
  border-radius:16px;
  padding:14px;
  cursor:pointer;
  transition: transform .12s ease, border-color .2s ease, box-shadow .2s ease;
}
.option:hover { transform: translateY(-3px); border-color: var(--accent); box-shadow: 0 10px 22px rgba(0,0,0,.28); }
.option.selected { outline:2px solid var(--accent); outline-offset: 2px; }
.option h4 { margin:0 0 6px 0; }
.option p { margin:0; color: var(--muted); font-size: 14px; }

/* フッター */
footer { padding:18px; border-top:1px solid #222; background:var(--panel); }
button.cta-pulse { animation: pulse 1.4s ease-out 2; }
@keyframes pulse {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(76,201,240,.0); }
  60% { transform: scale(1.04); box-shadow: 0 0 0 12px rgba(76,201,240,.18); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(76,201,240,.0); }
}

/* エンディング */
.ending.hidden { display: none; }
.ending {
  position: fixed; inset: 0; background: rgba(0,0,0,.6);
  display: grid; place-items: center; z-index: 999;
}
.ending-card {
  background:#14161c; border:1px solid #2a2e36; border-radius: 16px;
  padding: 24px; min-width: 340px; text-align: center; color:#e8eef6;
  box-shadow: 0 10px 30px rgba(0,0,0,.4);
}
.ending-card h2 { margin: 0 0 10px 0; font-size:22px; }
.ending-card button { margin-top: 14px; }
