/* きらめき＆リアクション — キャンディカラーの夜のステージ */
:root {
  --bg: #0f0b1d;
  --bg-2: #140f27;
  --panel: #1b1433;
  --panel-2: #231a42;
  --line: #352a5c;
  --ink: #fbf7ff;
  --ink-2: #cdc2e8;
  --ink-3: #9a8cc0;
  --accent: #ff6fb5;
  --accent-2: #ffd166;
  --accent-3: #6ee7ff;
  --accent-ink: #2a0718;
  --warn: #ffd166;
  --warn-bg: rgba(255, 209, 102, .08);
  --ok: #8ef0b8;
  --window-bg: rgba(18, 10, 34, .86);
}
body { background: radial-gradient(1200px 600px at 15% -10%, rgba(255, 111, 181, .10), transparent 60%), radial-gradient(1000px 600px at 100% 30%, rgba(110, 231, 255, .06), transparent 60%), var(--bg); }
.section-alt { background: linear-gradient(180deg, rgba(255, 255, 255, .02), rgba(255, 255, 255, 0)), var(--bg-2); }
.brand-mark { color: var(--accent); }
.checker { background-color: #e6e1ef; background-image: conic-gradient(#c9c1d9 25%, transparent 0 50%, #c9c1d9 0 75%, transparent 0); background-size: 20px 20px; }

/* ------------------------------------------------------------ hero */
.hero { position: relative; }
.hero-stage { position: relative; min-height: max(640px, min(calc(100svh - var(--header-h) - 30px), 940px)); overflow: hidden; isolation: isolate; cursor: crosshair; display: grid; align-content: center; padding-bottom: 150px; }
.hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -3; transform: scale(1.03); }
.hero-shade { position: absolute; inset: 0; z-index: -2; pointer-events: none; background: linear-gradient(90deg, rgba(15, 11, 29, .9) 0%, rgba(15, 11, 29, .62) 36%, rgba(15, 11, 29, .12) 70%), linear-gradient(0deg, rgba(15, 11, 29, .85) 0%, rgba(15, 11, 29, 0) 34%); }
.hero-fx { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; }
.hero-copy { padding-top: clamp(24px, 5vh, 70px); cursor: auto; }
.hero-copy > * { max-width: 620px; }
.hero .eyebrow { color: var(--accent-2); }
.hero h1 { font-size: clamp(38px, 5.2vw, 76px); font-weight: 800; letter-spacing: .04em; line-height: 1.18; text-shadow: 0 0 40px rgba(255, 111, 181, .35), 0 6px 30px rgba(0, 0, 0, .6); }
.hero-lead { font-size: clamp(15px, 1.5vw, 17.5px); color: #ece4ff; text-shadow: 0 2px 12px rgba(0, 0, 0, .7); }
.hero-lead strong { color: #fff; }
.hero .chip { background: rgba(15, 11, 29, .55); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px 22px; margin-top: 24px; padding-left: 4px; }
.hero-territory { display: flex; gap: 8px; align-items: flex-start; margin: 16px 0 0; font-size: 13px; color: var(--ink-2); text-shadow: 0 1px 6px rgba(0, 0, 0, .8); }
.hero-territory svg { width: 17px; height: 17px; color: var(--accent-2); flex: none; margin-top: 3px; }
.hotbar { position: absolute; left: 50%; bottom: 46px; transform: translateX(-50%); display: flex; gap: 8px; padding: 8px; border-radius: 16px; background: rgba(12, 8, 24, .72); border: 1px solid rgba(255, 255, 255, .16); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); cursor: auto; box-shadow: 0 20px 50px -20px #000; }
.hb { position: relative; width: 70px; height: 78px; padding: 4px 4px 2px; border-radius: 12px; border: 1px solid rgba(255, 255, 255, .14); background: rgba(255, 255, 255, .04); color: var(--ink); display: grid; justify-items: center; align-content: start; gap: 0; transition: border-color .2s, background .2s, transform .15s; }
.hb:hover { transform: translateY(-2px); border-color: rgba(255, 255, 255, .4); }
.hb img { width: 46px; height: 46px; object-fit: contain; filter: drop-shadow(0 0 6px rgba(255, 255, 255, .35)); }
.hb span { font-size: 11px; font-weight: 700; line-height: 1.6; white-space: nowrap; }
.hb kbd { position: absolute; left: 4px; top: 4px; min-width: 0; padding: 0 4px; font-size: 10px; line-height: 1.4; border-bottom-width: 2px; }
.hb.is-active { border-color: var(--accent-2); background: rgba(255, 209, 102, .14); box-shadow: 0 0 18px rgba(255, 209, 102, .45) inset, 0 0 16px rgba(255, 209, 102, .35); }
.hb.is-cast { animation: hb-cast .35s ease; }
@keyframes hb-cast { 40% { transform: scale(.92); } }
.hero-hint { position: absolute; left: var(--gutter); bottom: 12px; margin: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12.5px; color: rgba(255, 255, 255, .85); text-shadow: 0 1px 6px #000; pointer-events: none; }
.hero-hint svg { width: 15px; height: 15px; color: var(--accent-2); }
.hint-sub { color: rgba(255, 255, 255, .62); font-size: 11.5px; }
@media (max-width: 760px) {
  .hero-stage { min-height: 0; padding-bottom: 0; align-content: start; }
  .hero h1 br { display: none; }
  .hero-shade { background: linear-gradient(180deg, rgba(15, 11, 29, .82) 0%, rgba(15, 11, 29, .45) 55%, rgba(15, 11, 29, .9) 100%); }
  .hotbar { position: relative; left: auto; bottom: auto; transform: none; margin: 150px 12px 0; justify-content: space-between; gap: 4px; }
  .hb { width: auto; flex: 1; height: 72px; }
  .hb img { width: 38px; height: 38px; }
  .hb kbd { display: none; }
  .hero-hint { position: static; padding: 10px 14px 16px; }
}

/* ------------------------------------------------------------ catalog */
.catalog-tools { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.catalog-tools .seg span b { font-family: var(--font-mono); font-size: 12px; opacity: .8; }
.bg-seg input:checked + span { background: var(--accent-3); color: #03222a; }
.cat-desc { margin: 0 0 18px; font-size: 14px; color: var(--ink-2); min-height: 1.6em; }
.fx-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 176px), 1fr)); }
@media (max-width: 520px) { .fx-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } .fx-body { padding: 8px 10px 10px; } .fx-body h3 { font-size: 13.5px; } }
.fx-card { position: relative; display: grid; grid-template-rows: auto 1fr; padding: 0; border: 1px solid var(--line); border-radius: var(--radius-m); background: var(--panel); color: var(--ink); text-align: left; overflow: hidden; transition: transform .25s var(--ease-out), border-color .25s, box-shadow .25s; font: inherit; }
.fx-card:hover, .fx-card:focus-visible { transform: translateY(-3px); border-color: var(--accent); box-shadow: 0 16px 40px -18px rgba(255, 111, 181, .55); }
.fx-card[hidden] { display: none; }
.fx-media { position: relative; display: block; width: 100%; aspect-ratio: 1; overflow: hidden; padding: 0; border: 0; color: inherit; cursor: pointer; font: inherit; }
.fx-media:focus-visible { outline-offset: -3px; }
.fx-insp { justify-self: start; margin-top: 6px; padding: 0; border: 0; background: none; color: var(--accent-3); font-size: 12px; font-weight: 700; text-decoration: underline; text-underline-offset: .2em; }
.fx-insp:hover { color: #a5f1ff; }
.fx-media img, .fx-media canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.fx-media canvas { opacity: 0; transition: opacity .15s; }
.fx-card.is-playing .fx-media canvas { opacity: 1; }
.fx-card.is-playing .fx-media img { opacity: 0; }
.fx-media .badges { position: absolute; left: 8px; top: 8px; right: 8px; display: flex; flex-wrap: wrap; gap: 4px; z-index: 2; }
.fx-body { padding: 10px 12px 12px; display: grid; gap: 2px; align-content: start; }
.fx-body h3 { font-size: 14.5px; margin: 0; line-height: 1.4; }
.fx-id { font: 11px/1.4 var(--font-mono); color: var(--ink-3); letter-spacing: 0; overflow-wrap: anywhere; }
.fx-meta { font-size: 11.5px; color: var(--ink-2); }
.bg-dark .fx-media { background: radial-gradient(circle at 50% 45%, #2a1f4a, #120d22 70%); }
.bg-light .fx-media { background: #f6f3fb; }
.bg-checker .fx-media { background-color: #e6e1ef; background-image: conic-gradient(#c9c1d9 25%, transparent 0 50%, #c9c1d9 0 75%, transparent 0); background-size: 18px 18px; }
.bg-night .fx-media { background: url("media/bg/village-square-night.webp") center / cover; }
.bg-light .fx-media .badge-muted, .bg-checker .fx-media .badge-muted { background: rgba(30, 20, 60, .75); color: #fff; }

/* ------------------------------------------------------------ test stage */
.stage-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 22px; align-items: start; }
@media (max-width: 1020px) { .stage-layout { grid-template-columns: minmax(0, 1fr); } }
.test-stage { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius-l); overflow: hidden; border: 1px solid var(--line); cursor: crosshair; background: #120d22; box-shadow: 0 30px 80px -40px #000; touch-action: manipulation; }
.ts-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.test-stage.bg-dark { background: radial-gradient(circle at 50% 45%, #2a1f4a, #0d0918 75%); }
.test-stage.bg-light { background: #f6f3fb; }
.test-stage.bg-checker { background-color: #e6e1ef; background-image: conic-gradient(#c9c1d9 25%, transparent 0 50%, #c9c1d9 0 75%, transparent 0); background-size: 22px 22px; }
.test-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.ts-empty { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); margin: 0; display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; background: rgba(12, 8, 24, .66); border: 1px solid rgba(255, 255, 255, .2); font-size: 14px; color: #fff; pointer-events: none; transition: opacity .3s; }
.ts-empty svg { width: 16px; height: 16px; color: var(--accent-2); }
.ts-empty.is-hidden { opacity: 0; }
.ts-count { position: absolute; right: 12px; top: 10px; padding: 3px 9px; border-radius: 6px; background: rgba(0, 0, 0, .6); color: #fff; font-size: 12px; pointer-events: none; }
.ts-count::before { content: "配置中 "; font-family: var(--font-sans); }
.stage-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 12px; }
.size-field { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); }
.size-field input { width: 120px; }
.palette { padding: 16px; display: grid; gap: 12px; }
.palette-head { display: flex; justify-content: space-between; align-items: center; }
.pal-random { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); }
.pal-random input { accent-color: var(--accent); width: 16px; height: 16px; }
.pal-cats { display: flex; flex-wrap: wrap; gap: 4px; }
.pal-cats label { position: relative; }
.pal-cats input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.pal-cats span { display: inline-block; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line); font-size: 12.5px; color: var(--ink-2); }
.pal-cats input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 700; }
.pal-cats input:focus-visible + span { outline: 3px solid var(--accent-2); outline-offset: 2px; }
.pal-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; max-height: 340px; overflow-y: auto; padding: 2px; }
@media (max-width: 1020px) { .pal-grid { grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); max-height: 220px; } }
.pal-item { position: relative; aspect-ratio: 1; padding: 0; border-radius: 9px; border: 1px solid var(--line); background: radial-gradient(circle, #2a1f4a, #120d22 75%); display: grid; place-items: center; transition: border-color .15s, transform .15s; }
.pal-item img { width: 92%; height: 92%; object-fit: contain; }
.pal-item:hover { transform: scale(1.06); border-color: rgba(255, 255, 255, .45); }
.pal-item[aria-selected="true"] { border-color: var(--accent-2); box-shadow: 0 0 0 2px var(--accent-2), 0 0 14px rgba(255, 209, 102, .5); }
.pal-item[hidden] { display: none; }
.pal-item .lp { position: absolute; right: 2px; bottom: 1px; font: 700 8.5px/1 var(--font-mono); color: #fff; background: rgba(0, 0, 0, .55); padding: 1px 3px; border-radius: 3px; }
.pal-current { margin: 0; font-size: 13px; color: var(--ink-2); min-height: 1.6em; }
.pal-current b { color: var(--ink); }

/* ------------------------------------------------------------ inspector */
.inspect-layout { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 28px; align-items: start; }
@media (max-width: 860px) { .inspect-layout { grid-template-columns: minmax(0, 1fr); } .insp-view { justify-self: center; } }
.insp-view { display: grid; gap: 12px; justify-items: center; }
.insp-canvas-wrap { position: relative; width: 320px; max-width: 100%; aspect-ratio: 1; border-radius: var(--radius-m); overflow: hidden; border: 1px solid var(--line); }
.insp-canvas-wrap.bg-dark { background: radial-gradient(circle at 50% 45%, #2a1f4a, #0d0918 75%); }
.insp-canvas-wrap.bg-light { background: #f6f3fb; }
.insp-canvas-wrap.bg-checker { background-color: #e6e1ef; background-image: conic-gradient(#c9c1d9 25%, transparent 0 50%, #c9c1d9 0 75%, transparent 0); background-size: 20px 20px; }
.insp-canvas-wrap canvas { width: 100%; height: 100%; }
.insp-frame { position: absolute; right: 8px; bottom: 8px; padding: 2px 8px; border-radius: 6px; background: rgba(0, 0, 0, .65); color: #fff; font-size: 12px; }
.insp-controls { display: flex; gap: 6px; }
.ic { width: 42px; height: 42px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); display: grid; place-items: center; transition: border-color .2s, background .2s; }
.ic:hover { border-color: var(--accent); }
.ic svg { width: 18px; height: 18px; }
.ic-main { width: 52px; background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.ic-main:hover { background: #ff86c2; }
.insp-side .field { flex-wrap: wrap; }
.fps-strip { margin-top: 18px; padding: 14px; border-radius: var(--radius-m); background: var(--panel); border: 1px solid var(--line); overflow: hidden; }
.fps-title { margin: 0 0 10px; font-size: 13px; font-weight: 700; color: var(--ink-2); }
.fps-row { display: grid; grid-template-columns: 56px minmax(0, 1fr); align-items: center; gap: 10px; margin-top: 6px; }
.fps-label { font: 700 12px/1.1 var(--font-mono); color: var(--ink); }
.fps-label small { display: block; font: 500 10px/1.3 var(--font-sans); color: var(--ink-3); }
.fps-cells { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 2px; }
.fps-cells i { height: 26px; border-radius: 4px; background: #2a2150; display: grid; place-items: center; font: 600 10px/1 var(--font-mono); font-style: normal; color: var(--ink-3); }
.fps-cells i.is-now { background: var(--accent); color: var(--accent-ink); }
#fps12 i { grid-column: span 2; }

/* ------------------------------------------------------------ chooser & table */
.chooser { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); gap: 12px; }
.choice { display: grid; gap: 4px; padding: 16px 18px; border-radius: var(--radius-m); border: 1px solid var(--line); background: var(--panel); color: var(--ink); text-align: left; font: inherit; transition: border-color .2s, transform .2s, box-shadow .2s; }
.choice strong { font-size: 16px; }
.choice span { font-size: 13px; color: var(--ink-2); }
.choice:hover { transform: translateY(-2px); border-color: rgba(255, 255, 255, .35); }
.choice[aria-pressed="true"] { border-color: var(--accent-2); box-shadow: 0 0 0 1px var(--accent-2), 0 14px 40px -20px var(--accent-2); }
.choose-answer { min-height: 1.8em; margin: 14px 0 18px; font-size: 14.5px; color: var(--ink); }
.choose-answer:empty { margin: 6px 0; }
.compare-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-m); overflow: hidden; }
.compare-table th, .compare-table td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: center; vertical-align: middle; }
.compare-table thead th { font-size: 13px; color: var(--ink); background: var(--panel-2); line-height: 1.45; }
.compare-table tbody th { text-align: left; color: var(--ink-2); font-weight: 600; white-space: nowrap; }
.compare-table td small { display: block; font-size: 11.5px; color: var(--ink-3); }
.compare-table td.y { color: var(--ok); font-weight: 800; }
.compare-table td.n { color: var(--ink-3); }
.compare-table tr:last-child th, .compare-table tr:last-child td { border-bottom: 0; }
.compare-table th:nth-child(5), .compare-table td:nth-child(5) { background: rgba(255, 111, 181, .06); }
.table-wrap { overflow-x: auto; }

/* ------------------------------------------------------------ price */
.price-group-title { font-size: 15px; color: var(--ink-2); margin: 26px 0 14px; letter-spacing: .08em; }
.price-free { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.price-territory { display: flex; align-items: center; justify-content: center; gap: 8px; margin: -12px auto 10px; font-size: 13.5px; color: var(--ink-2); text-align: center; flex-wrap: wrap; }
.price-territory svg { width: 18px; height: 18px; color: var(--accent-2); }

/* ------------------------------------------------------------ misc */
.start-layout { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 24px; align-items: start; }
@media (max-width: 960px) { .start-layout { grid-template-columns: minmax(0, 1fr); } }
.checklist li.is-important > svg { color: var(--accent-2); }
.cta-band { background: radial-gradient(700px 300px at 85% 0%, rgba(255, 111, 181, .2), transparent 60%), radial-gradient(500px 260px at 0% 100%, rgba(110, 231, 255, .12), transparent 60%), var(--panel); }
.party-fx { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 260; pointer-events: none; display: none; }
.party-fx.is-on { display: block; }
.easter-hint { color: var(--ink-3); cursor: help; }
