:root {
  --bg: #0f0f1a;
  --panel: #1a1a2e;
  --ink: #f5f5fa;
  --quiet: #a8a8c0;
  --line: #2e2e48;
  --accent: #ff5fa2;
  --accent2: #6ad1ff;
  --good: #3ccf8e;
  --warn: #ffc44d;
  --off: #8a8aa0;
  --font: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); }
a { color: var(--accent2); }
button, input, select, textarea { font: inherit; }
.wrap-page { max-width: 640px; margin: 0 auto; padding: 24px 20px 48px; }
.brand { font-weight: 800; letter-spacing: .04em; color: var(--ink); text-decoration: none; }
.brand span { color: var(--accent); }
h1 { font-size: 28px; line-height: 1.35; margin: 24px 0 8px; }
p.lead { color: var(--quiet); line-height: 1.7; margin: 0 0 20px; }
.card-box { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 20px; margin: 16px 0; }
label { display: block; font-size: 13px; color: var(--quiet); margin: 14px 0 6px; }
input[type=text], input[type=url], select, textarea {
  width: 100%; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line);
  background: #11111f; color: var(--ink);
}
textarea { min-height: 72px; resize: vertical; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 18px; border-radius: 999px;
  border: 0; background: var(--accent); color: #fff; font-weight: 700; cursor: pointer; text-decoration: none; }
.btn.sub { background: transparent; border: 1px solid var(--line); color: var(--ink); }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: default; }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.muted { color: var(--quiet); font-size: 13px; line-height: 1.6; }
.error { color: #ff8080; font-size: 14px; margin-top: 10px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); font-size: 14px; }

/* 空き枠の表 */
.slots { display: grid; grid-template-columns: 44px repeat(7, 1fr); gap: 4px; align-items: center; }
.slots .h { text-align: center; font-size: 12px; color: var(--quiet); }
.slots button { aspect-ratio: 1.2; border-radius: 8px; border: 1px solid var(--line); background: transparent; cursor: pointer; }
.slots button.on { background: color-mix(in srgb, var(--accent2) 45%, transparent); border-color: var(--accent2); }
.slots div.cell { aspect-ratio: 1.2; border-radius: 8px; border: 1px solid var(--line); }
.slots div.cell.on { background: color-mix(in srgb, var(--accent2) 45%, transparent); border-color: var(--accent2); }

/* 状態の丸 */
.status { display: inline-block; padding: 8px 16px; border-radius: 999px; font-weight: 800; }
.status.open { background: color-mix(in srgb, var(--good) 20%, transparent); color: var(--good); border: 2px solid var(--good); }
.status.conditional { background: color-mix(in srgb, var(--warn) 20%, transparent); color: var(--warn); border: 2px solid var(--warn); }
.status.closed { background: color-mix(in srgb, var(--off) 20%, transparent); color: var(--off); border: 2px solid var(--off); }

/* スライド */
.story { position: fixed; inset: 0; display: flex; flex-direction: column; background: var(--bg); user-select: none; }
.story .bars { display: flex; gap: 4px; padding: 12px 12px 0; }
.story .bars i { flex: 1; height: 3px; border-radius: 2px; background: rgba(255,255,255,.2); }
.story .bars i.done { background: #fff; }
.story .stage { flex: 1; position: relative; overflow: hidden; }
.slide { position: absolute; inset: 0; padding: 40px 28px 96px; display: none; flex-direction: column; justify-content: center; max-width: 560px; margin: 0 auto; }
.slide.show { display: flex; animation: rise .45s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.slide .kicker { color: var(--quiet); font-size: 15px; margin-bottom: 8px; }
.slide .big { font-size: 64px; font-weight: 900; line-height: 1.05; letter-spacing: -.02em; }
.slide .big small { font-size: 24px; font-weight: 700; margin-left: 4px; }
.slide .mid { font-size: 28px; font-weight: 800; line-height: 1.35; }
.slide .note { color: var(--quiet); font-size: 13px; margin-top: 16px; line-height: 1.6; }
.slide.c1 { background: radial-gradient(120% 80% at 10% 0%, #3b1d5e 0%, transparent 60%), radial-gradient(100% 80% at 100% 100%, #5e1d3d 0%, transparent 60%); }
.slide.c2 { background: radial-gradient(120% 80% at 90% 0%, #123f5e 0%, transparent 60%); }
.slide.c3 { background: radial-gradient(120% 80% at 0% 100%, #5e3a12 0%, transparent 60%); }
.list .item { display: grid; grid-template-columns: 28px 1fr auto; gap: 10px; align-items: center; margin: 10px 0; }
.list .rank { font-weight: 900; color: var(--accent); font-size: 20px; }
.list .bar { height: 8px; border-radius: 4px; background: var(--accent2); margin-top: 6px; }
.list .name { font-weight: 700; font-size: 17px; }
.list .val { color: var(--quiet); font-size: 14px; white-space: nowrap; }
.months { display: grid; grid-template-columns: repeat(12, 1fr); gap: 4px; align-items: end; height: 180px; margin-top: 16px; }
.months div { background: var(--accent); border-radius: 4px 4px 0 0; min-height: 2px; }
.months-l { display: grid; grid-template-columns: repeat(12, 1fr); gap: 4px; font-size: 11px; color: var(--quiet); text-align: center; margin-top: 4px; }
.quiz button { display: block; width: 100%; text-align: left; margin: 8px 0; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); font-weight: 700; cursor: pointer; }
.quiz button.right { border-color: var(--good); background: color-mix(in srgb, var(--good) 25%, var(--panel)); }
.quiz button.wrong { border-color: #ff8080; opacity: .7; }
.story .foot { position: absolute; left: 0; right: 0; bottom: 0; padding: 16px 20px 24px; display: flex; gap: 10px; justify-content: center; background: linear-gradient(transparent, var(--bg) 40%); }
.tap { position: absolute; top: 0; bottom: 80px; width: 35%; z-index: 2; }
.tap.prev { left: 0; } .tap.next { right: 0; width: 65%; }
.icon { width: 88px; height: 88px; border-radius: 50%; object-fit: cover; background: var(--panel); border: 2px solid var(--accent); }
.loading { display: flex; height: 100vh; align-items: center; justify-content: center; flex-direction: column; gap: 12px; color: var(--quiet); }
.spinner { width: 36px; height: 36px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.previews { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0; }
.previews img { width: 100%; border-radius: 8px; border: 1px solid var(--line); }
.brand img.logo { height: 22px; width: auto; display: block; }
.topbar .brand img.logo { height: 20px; }
