/* 動くファンタジー背景 — シネマティックな夜のテーマ */
:root {
  --bg: #07090f;
  --bg-2: #0b0f18;
  --panel: #111827;
  --panel-2: #172033;
  --line: #232d44;
  --ink: #eef3fa;
  --ink-2: #a9b5c9;
  --ink-3: #7a879e;
  --accent: #5fd6c4;
  --accent-2: #ffb86b;
  --accent-ink: #03140f;
  --warn: #ffb86b;
  --warn-bg: rgba(255, 184, 107, .08);
  --ok: #7ee2a8;
  --bar-base: #66728f;
  --grid: rgba(255, 255, 255, .07);
}
body { background: radial-gradient(1400px 700px at 80% -10%, rgba(95, 214, 196, .08), transparent 60%), var(--bg); }
.section-alt { background: linear-gradient(180deg, var(--bg-2), #0a0d15); }
.brand-mark { color: var(--accent); }
.eyebrow { color: var(--accent); }

/* ------------------------------------------------------------ hero */
.hero { position: relative; overflow: hidden; padding: clamp(36px, 6vh, 84px) 0 clamp(52px, 8vh, 100px); isolation: isolate; }
.hero-ambient { position: absolute; inset: -12%; z-index: -2; }
.hero-ambient img { width: 100%; height: 100%; object-fit: cover; filter: blur(44px) saturate(1.35) brightness(.42); transform: scale(1.08); transition: opacity .8s; }
.hero::after { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(ellipse at 70% 40%, transparent 0%, rgba(7, 9, 15, .55) 70%), linear-gradient(180deg, rgba(7, 9, 15, 0) 70%, var(--bg) 100%); pointer-events: none; }
.hero-inner { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.3fr); gap: clamp(28px, 4vw, 60px); align-items: center; }
.hero h1 { font-size: clamp(36px, 4.4vw, 64px); font-weight: 800; letter-spacing: .04em; line-height: 1.18; text-shadow: 0 6px 40px rgba(0, 0, 0, .5); }
.hero-lead { font-size: clamp(15px, 1.4vw, 17px); color: #cfd8e6; }
.hero-lead strong { color: #fff; }
.hero .chips { margin-top: 18px; }
.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: 18px 0 0; font-size: 13px; color: var(--ink-2); }
.hero-territory svg { width: 17px; height: 17px; color: var(--accent-2); flex: none; margin-top: 3px; }
@media (max-width: 960px) {
  .hero-inner { grid-template-columns: minmax(0, 1fr); }
  .hero h1 br { display: none; }
}

/* game view（エンジンのプレビュー風フレーム） */
.gameview { margin: 0; border-radius: 14px; overflow: hidden; background: #0b0f17; border: 1px solid #2a3550; box-shadow: 0 50px 120px -40px rgba(0, 0, 0, .95), 0 0 60px -20px rgba(95, 214, 196, .35); }
.gv-bar { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: #141b2a; border-bottom: 1px solid #222c42; font-size: 12px; }
.gv-dots { display: inline-flex; gap: 6px; }
.gv-dots i { width: 10px; height: 10px; border-radius: 50%; background: #39445f; }
.gv-dots i:first-child { background: #e0685f; } .gv-dots i:nth-child(2) { background: #e3b14f; } .gv-dots i:nth-child(3) { background: #5bc27a; }
.gv-tab { padding: 2px 10px; border-radius: 6px; background: #0b0f17; border: 1px solid #2a3550; color: var(--ink); font-weight: 700; }
.gv-meta { margin-left: auto; color: var(--accent); font-size: 11.5px; letter-spacing: .04em; white-space: nowrap; }
.gv-screen { position: relative; aspect-ratio: 16 / 9; background: #000; container-type: inline-size; }
.gv-screen video { width: 100%; height: 100%; object-fit: cover; }
.title-screen { position: absolute; inset: 0; display: grid; justify-items: center; align-content: center; text-align: center; padding: 4cqw; background: radial-gradient(ellipse at center, rgba(4, 8, 14, .18), rgba(4, 8, 14, .62)); }
.ts-kicker { margin: 0 0 1.2cqw; font: italic 600 clamp(9px, 1.7cqw, 14px)/1 var(--font-serif); letter-spacing: .32em; text-transform: uppercase; color: rgba(255, 255, 255, .78); }
.ts-logo { margin: 0; font-family: var(--font-serif); font-weight: 700; font-size: clamp(20px, 5.6cqw, 50px); line-height: 1.22; letter-spacing: .08em; color: #fff; text-shadow: 0 0 2.4cqw rgba(95, 214, 196, .65), 0 .4cqw 1.6cqw rgba(0, 0, 0, .85); }
.ts-menu { list-style: none; padding: 0; margin: 3.4cqw 0 0; display: grid; gap: .5cqw; }
.ts-menu a { position: relative; display: inline-grid; justify-items: center; color: #fff; text-decoration: none; font-weight: 700; font-size: clamp(11px, 2.2cqw, 18px); letter-spacing: .14em; padding: .2cqw 3cqw; text-shadow: 0 2px 8px rgba(0, 0, 0, .8); }
.ts-menu a small { font-size: clamp(8px, 1.25cqw, 11px); font-weight: 500; letter-spacing: .04em; color: rgba(255, 255, 255, .72); }
.ts-menu a::before { content: ""; position: absolute; left: .4cqw; top: 1.1em; border-left: .9cqw solid var(--accent-2); border-top: .55cqw solid transparent; border-bottom: .55cqw solid transparent; opacity: 0; transform: translateY(-50%); }
.ts-menu a.is-active::before, .ts-menu a:hover::before, .ts-menu a:focus-visible::before { opacity: 1; animation: ts-bob .7s ease-in-out infinite alternate; }
@keyframes ts-bob { to { transform: translate(-.5cqw, -50%); } }
.ts-press { margin: 3cqw 0 0; font: 700 clamp(9px, 1.7cqw, 14px)/1 var(--font-mono); letter-spacing: .42em; color: rgba(255, 255, 255, .88); animation: ts-press 1.6s ease-in-out infinite; }
@keyframes ts-press { 50% { opacity: .2; } }
html.reduced .ts-press, html.reduced .ts-menu a::before { animation: none; }
.gv-controls { display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: #141b2a; border-top: 1px solid #222c42; }
.gv-btn { width: 34px; height: 34px; border-radius: 8px; border: 1px solid #2a3550; background: #0b0f17; color: var(--ink); display: grid; place-items: center; transition: border-color .2s; }
.gv-btn:hover { border-color: var(--accent); }
.gv-btn svg { width: 16px; height: 16px; }
.gv-name { display: inline-flex; align-items: center; gap: 8px; margin-left: 6px; font-size: 13.5px; font-weight: 700; }
.gv-res { margin-left: auto; font-size: 11.5px; color: var(--ink-3); white-space: nowrap; }
.gameview figcaption { padding: 8px 12px 10px; background: #0b0f17; border-top: 1px solid #1b2336; }
@media (max-width: 520px) { .gv-res { display: none; } .gv-meta { font-size: 10.5px; } }

/* ------------------------------------------------------------ area filter & clip grid */
.area-filter { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.area-filter label { position: relative; }
.area-filter input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.area-filter span { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); font-size: 14px; color: var(--ink-2); transition: all .2s; }
.area-filter span b { font: 700 12px var(--font-mono); color: var(--ink-3); }
.area-filter input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 700; }
.area-filter input:checked + span b { color: var(--accent-ink); }
.area-filter input:focus-visible + span { outline: 3px solid var(--accent-2); outline-offset: 2px; }
.clip-grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr)); }
.clip { position: relative; display: grid; grid-template-rows: auto 1fr; border-radius: var(--radius-m); overflow: hidden; background: var(--panel); border: 1px solid var(--line); transition: transform .3s var(--ease-out), border-color .3s, box-shadow .3s; }
.clip:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); box-shadow: 0 20px 50px -24px rgba(95, 214, 196, .4); }
.clip[hidden] { display: none; }
.clip-media { position: relative; aspect-ratio: 16 / 9; background: #000; overflow: hidden; }
.clip-media video { width: 100%; height: 100%; object-fit: cover; }
.clip-area { position: absolute; left: 10px; top: 10px; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 6px; background: rgba(0, 0, 0, .6); color: #fff; letter-spacing: .06em; }
.clip-media .badge-free { position: absolute; right: 10px; top: 10px; }
.vplay { position: absolute; right: 10px; bottom: 10px; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; border: 1px solid rgba(255, 255, 255, .45); background: rgba(0, 0, 0, .55); color: #fff; transition: background .2s, transform .2s; z-index: 4; }
.vplay:hover { background: rgba(0, 0, 0, .8); transform: scale(1.06); }
.vplay svg { width: 16px; height: 16px; }
.vplay .ic-pause { display: none; }
.vcard.is-playing .vplay .ic-play { display: none; }
.vcard.is-playing .vplay .ic-pause { display: block; }
.clip-body { padding: 14px 16px 16px; display: grid; gap: 6px; align-content: start; }
.clip-body h3 { font-size: 16.5px; margin: 0; }
.clip-motion { margin: 0; font-size: 13.5px; color: var(--ink-2); }
.clip-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 6px; }
.meter { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--ink-2); }
.meter i { width: 16px; height: 6px; border-radius: 2px; background: #2a3550; }
.meter i.on { background: var(--accent); }
.meter span { margin-left: 4px; }
.clip-foot .btn { min-height: 32px; padding: 4px 12px; font-size: 12.5px; }

/* ------------------------------------------------------------ loop checker */
.loop-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
.loop-player { min-width: 0; }
.loop-screen { position: relative; aspect-ratio: 16 / 9; background: #000; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); }
.loop-screen video { width: 100%; height: 100%; object-fit: cover; }
.loop-hud { position: absolute; left: 12px; top: 10px; display: flex; gap: 14px; font-size: 12px; color: #fff; background: rgba(0, 0, 0, .58); padding: 4px 10px; border-radius: 6px; letter-spacing: .04em; }
.loop-seam-flash { position: absolute; right: 12px; top: 10px; font: 800 12px/1 var(--font-mono); padding: 6px 9px; border-radius: 6px; background: var(--accent-2); color: #2a1606; opacity: 0; transition: opacity .3s; letter-spacing: .1em; }
.loop-seam-flash.is-on { opacity: 1; transition: none; }
.timeline { position: relative; height: 28px; margin-top: 12px; border-radius: 8px; background: #0b0f17; border: 1px solid var(--line); overflow: hidden; }
.tl-ticks { position: absolute; inset: 0; background-image: repeating-linear-gradient(90deg, rgba(255, 255, 255, .13) 0 1px, transparent 1px calc(100% / 112)); }
.tl-xfade { position: absolute; top: 0; bottom: 0; right: 0; width: calc(12 / 112 * 100%); background: rgba(255, 184, 107, .28); border-left: 2px solid var(--accent-2); }
.tl-head { position: absolute; top: 0; bottom: 0; left: 0; width: 2px; margin-left: -1px; background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.tl-legend { display: flex; justify-content: space-between; gap: 12px; margin-top: 6px; }
.k-xfade { display: inline-block; width: 12px; height: 10px; margin-right: 6px; vertical-align: -1px; background: rgba(255, 184, 107, .5); border-left: 2px solid var(--accent-2); }
.loop-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.seg-small span { padding: 4px 10px; font-size: 13px; }
.loop-side .field { flex-wrap: wrap; }
.lp-motion-text { margin: 12px 0 0; font-size: 14px; color: var(--ink-2); }
@media (max-width: 960px) { .loop-layout { grid-template-columns: minmax(0, 1fr); } }

/* motion chart（強調：選択中だけアクセント、他はグレー） */
.motion-chart { margin-top: 36px; padding: clamp(18px, 3vw, 28px); border-radius: var(--radius-l); background: var(--panel); border: 1px solid var(--line); }
.mc-title { font-size: 18px; margin: 0 0 4px; }
.mc-legend { margin: 0; display: flex; align-items: center; gap: 6px; }
.sw { display: inline-block; width: 14px; height: 10px; border-radius: 2px; vertical-align: -1px; }
.sw-sel { background: var(--accent); } .sw-base { background: var(--bar-base); }
.mc-rows { display: grid; gap: 2px; margin-top: 18px; position: relative; }
.mc-row { display: grid; grid-template-columns: minmax(150px, 220px) minmax(0, 1fr) 56px; align-items: center; gap: 12px; width: 100%; padding: 3px 6px; border: 0; border-radius: 8px; background: transparent; color: inherit; text-align: left; font: inherit; }
.mc-row:hover, .mc-row:focus-visible { background: rgba(255, 255, 255, .045); }
.mc-name { font-size: 13.5px; line-height: 1.35; }
.mc-name .badge { margin-left: 6px; vertical-align: 1px; }
.mc-track { position: relative; height: 18px; background-image: linear-gradient(90deg, var(--grid) 1px, transparent 1px); background-size: calc(100% / 3.5) 100%; }
.mc-bar { position: absolute; left: 0; top: 2px; bottom: 2px; width: calc(var(--v) * 100%); max-height: 24px; background: var(--bar-base); border-radius: 0 4px 4px 0; transition: background .2s, filter .2s; }
.mc-row:hover .mc-bar { filter: brightness(1.15); }
.mc-row.is-selected .mc-bar { background: var(--accent); }
.mc-level { font-size: 12.5px; color: var(--ink-2); text-align: right; white-space: nowrap; }
.mc-row.is-selected .mc-level { color: var(--ink); font-weight: 700; }
.mc-axis { position: relative; height: 20px; margin: 6px 0 0; }
.mc-axis span { position: absolute; top: 0; transform: translateX(-50%); font-size: 11.5px; color: var(--ink-3); }
.mc-tip { position: fixed; z-index: 150; pointer-events: none; padding: 8px 12px; border-radius: 10px; background: rgba(8, 11, 18, .96); border: 1px solid var(--line); box-shadow: 0 12px 30px -10px #000; font-size: 13px; line-height: 1.55; opacity: 0; transition: opacity .12s; max-width: 260px; }
.mc-tip.is-on { opacity: 1; }
.mc-tip b { font: 800 16px var(--font-mono); color: var(--ink); }
.mc-tip .k { display: inline-block; width: 12px; height: 2px; background: var(--accent); vertical-align: middle; margin-right: 6px; }
.mc-table { margin-top: 14px; }
.mc-table summary { cursor: pointer; font-size: 13.5px; color: var(--accent); }
.table-wrap { overflow-x: auto; margin-top: 10px; }
.mc-table table { width: 100%; border-collapse: collapse; font-size: 13px; }
.mc-table th, .mc-table td { padding: 7px 10px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.mc-table td.num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; text-align: right; }
.mc-table th { color: var(--ink-3); font-weight: 700; }
@media (max-width: 640px) {
  .mc-row { grid-template-columns: minmax(0, 1fr) 52px; grid-template-areas: "name level" "track track"; gap: 4px 10px; padding: 6px; }
  .mc-name { grid-area: name; } .mc-level { grid-area: level; } .mc-track { grid-area: track; }
  .mc-axis { margin-left: 6px !important; margin-right: 6px !important; }
}

/* ------------------------------------------------------------ size */
.size-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; align-items: center; }
@media (max-width: 900px) { .size-layout { grid-template-columns: minmax(0, 1fr); } }
.size-diagram { padding: 34px 10px 10px; }
.sd-outer { position: relative; aspect-ratio: 16 / 9; border: 2px solid var(--accent-2); border-radius: 10px; background: rgba(255, 184, 107, .05); }
.sd-inner { position: absolute; left: 10%; top: 10%; width: 80%; height: 80%; border: 2px solid var(--accent); border-radius: 8px;
  background: linear-gradient(rgba(7, 9, 15, .35), rgba(7, 9, 15, .35)), url("media/poster/07_coastal_port_05_beach_day.webp") center / cover; }
.sd-label { position: absolute; left: 10px; top: 8px; display: grid; font: 800 15px/1.25 var(--font-mono); color: var(--accent-2); text-shadow: 0 1px 8px rgba(0, 0, 0, .8); }
.sd-inner .sd-label { color: #fff; }
.sd-label small { font: 600 11.5px/1.4 var(--font-sans); color: var(--ink-2); }
.sd-inner .sd-label small { color: #e6f6f2; }
.sd-outer > .sd-label { top: -30px; left: 0; display: flex; align-items: baseline; gap: 8px; }
.pixel-compare { border: 1px solid var(--line); border-radius: var(--radius-m); padding: 12px 16px; background: var(--panel); }
.pixel-compare summary { cursor: pointer; font-weight: 700; font-size: 14.5px; }
.pc-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; margin-top: 12px; }
.pc-grid figure { margin: 0; }
.pc-grid img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; image-rendering: pixelated; border-radius: 6px; border: 1px solid var(--line); }
.pc-grid figcaption { font-size: 12px; color: var(--ink-3); margin-top: 6px; }

/* ------------------------------------------------------------ uses */
.uses-grid .usecase { aspect-ratio: 16 / 9; container-type: inline-size; }
.uses-grid .usecase video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.uc-stage { position: absolute; left: 6%; bottom: 10%; display: grid; gap: 2px; color: #fff; text-shadow: 0 2px 10px rgba(0, 0, 0, .8); }
.uc-stage span { font: 700 clamp(9px, 3.2cqw, 13px)/1 var(--font-mono); letter-spacing: .2em; color: var(--accent); }
.uc-stage strong { font-family: var(--font-serif); font-size: clamp(18px, 8cqw, 32px); letter-spacing: .1em; }
.uc-stage em { font-style: normal; font-size: clamp(10px, 3.6cqw, 14px); font-weight: 700; color: #ffe2bd; }
.uc-dialog { position: absolute; left: 5%; right: 5%; bottom: 6%; padding: 9px 13px 11px; }
.uc-dialog .window-text { min-height: 0; font-size: clamp(10.5px, 3.6cqw, 14px); line-height: 1.6; }
.uc-dialog .window-name { font-size: clamp(9.5px, 3.1cqw, 12px); top: -13px; padding: 1px 9px; }
.uc-scene { position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-50%); padding: 3cqw 0; text-align: center; color: #fff; background: linear-gradient(90deg, transparent, rgba(0, 0, 0, .55) 20%, rgba(0, 0, 0, .55) 80%, transparent); display: grid; gap: 2px; }
.uc-scene span { font: 700 clamp(9px, 3cqw, 12px)/1 var(--font-mono); letter-spacing: .3em; color: var(--accent-2); }
.uc-scene strong { font-family: var(--font-serif); font-size: clamp(16px, 7cqw, 28px); letter-spacing: .12em; }
.uc-standby { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; color: #fff; background: rgba(0, 0, 0, .25); text-shadow: 0 2px 14px rgba(0, 0, 0, .85); }
.uc-standby strong { font-size: clamp(18px, 8cqw, 34px); letter-spacing: .14em; }
.uc-standby span { font-size: clamp(10px, 3.6cqw, 14px); color: rgba(255, 255, 255, .85); }

/* ------------------------------------------------------------ misc */
.start-layout { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 24px; align-items: start; }
@media (max-width: 960px) { .start-layout { grid-template-columns: minmax(0, 1fr); } }
.price-territory { display: flex; align-items: center; justify-content: center; gap: 8px; margin: -12px auto 26px; 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); }
.cta-band { background: radial-gradient(800px 300px at 90% 0%, rgba(95, 214, 196, .16), transparent 60%), var(--panel); }
.checklist li.is-important > svg { color: var(--accent-2); }
