:root {
  --vermilion: #ff3b1f;
  --ink: #000;
  --text: #f2f2f2;
  --dim: #b9b9be;          /* 黒の上で 9:1 以上のコントラスト */
  --line: rgba(255,255,255,.28);
  --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px); --safe-r: env(safe-area-inset-right, 0px);
  font-family: "Helvetica Neue", Helvetica, Arial, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic", sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--ink); color: var(--text); overflow: hidden; overscroll-behavior: auto;   /* 最初の画面で、下に引いて再読み込みできるように（3D画面は touch-action:none なので影響なし） */ }
body { position: fixed; inset: 0; }
canvas#gl { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; outline: none; cursor: grab; }
canvas#gl:active { cursor: grabbing; }
.en { letter-spacing: .08em; }
.ja { color: var(--dim); font-size: .82em; margin-left: .6em; letter-spacing: .12em; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ボタン（細い線・黒地・白文字） */
.btn { font: inherit; color: var(--text); background: rgba(0,0,0,.55); border: 1px solid var(--line); border-radius: 999px;
  min-height: 44px; padding: 0 20px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
  touch-action: manipulation; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); transition: border-color .2s, box-shadow .2s, background .2s; }
.btn:hover { border-color: rgba(255,255,255,.7); }
.btn:focus-visible, a:focus-visible, .mark:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.btn-main { min-height: 56px; padding: 0 38px; font-size: 1.05rem; border-color: rgba(255,59,31,.8); box-shadow: 0 0 22px rgba(255,59,31,.28), inset 0 0 14px rgba(255,59,31,.12); }
.btn-main:hover { box-shadow: 0 0 30px rgba(255,59,31,.5), inset 0 0 18px rgba(255,59,31,.2); border-color: var(--vermilion); }
.btn-small { font-size: .88rem; padding: 0 16px; }
.btn-icon { width: 44px; padding: 0; }
.btn-icon .slash { display: none; }
.btn-icon[aria-pressed="false"] .slash { display: block; } .btn-icon[aria-pressed="false"] .waves { opacity: .25; }

/* 最初の画面 */
.screen { position: fixed; inset: 0; display: grid; place-items: center; text-align: center; z-index: 20; background: radial-gradient(ellipse at 50% 55%, rgba(0,0,0,.35), rgba(0,0,0,.82)); transition: opacity .9s ease, visibility .9s; }
.screen.gone { opacity: 0; visibility: hidden; pointer-events: none; }
.start-inner { padding: 24px; display: flex; flex-direction: column; align-items: center; gap: 22px; }
.eyebrow { margin: 0; font-size: .74rem; letter-spacing: .5em; color: var(--dim); padding-left: .5em; }
h1 { margin: 0; font-weight: 200; font-size: clamp(2.3rem, 9vw, 4.6rem); letter-spacing: .28em; padding-left: .28em; color: #fff; text-shadow: 0 0 18px rgba(255,255,255,.55), 0 0 60px rgba(255,255,255,.18); }
.start-note { margin: 0; font-size: .8rem; color: var(--dim); letter-spacing: .1em; }

/* 上のバー */
#bar { position: fixed; z-index: 10; top: calc(10px + var(--safe-t)); left: calc(12px + var(--safe-l)); right: calc(12px + var(--safe-r)); display: flex; justify-content: space-between; gap: 10px; pointer-events: none; }
#bar > * { pointer-events: auto; }
#bar[hidden] { display: none; }

/* 案内 */
#hint { position: fixed; z-index: 9; left: 0; right: 0; bottom: calc(34px + var(--safe-b)); margin: 0; text-align: center; font-size: .92rem; color: #fff; text-shadow: 0 0 12px #000, 0 0 3px #000;
  opacity: 0; transition: opacity 1s ease; pointer-events: none; padding: 0 70px; }
#hint.show { opacity: 1; }
#hint .ja { display: block; margin: 4px 0 0; font-size: .78rem; }

/* 画面の外にある看板を知らせる印 */
#marks { position: fixed; inset: 0; z-index: 8; pointer-events: none; }
.mark { position: absolute; top: 50%; display: flex; align-items: center; gap: 8px; min-height: 48px; min-width: 48px; padding: 0 12px; font: inherit; color: #fff; background: rgba(0,0,0,.5);
  border: 1px solid var(--line); border-radius: 999px; pointer-events: auto; cursor: pointer; opacity: 0; visibility: hidden; transition: opacity .4s, visibility .4s, transform .3s; touch-action: manipulation; }
.mark.show { opacity: .9; visibility: visible; }
.mark.left { left: calc(8px + var(--safe-l)); flex-direction: row-reverse; } .mark.right { right: calc(8px + var(--safe-r)); }
.mark .k { font-size: 1.25rem; line-height: 1; text-shadow: 0 0 10px currentColor; }
.mark .arrow { width: 10px; height: 10px; border-left: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); opacity: .8; }
.mark.right .arrow { transform: rotate(-135deg); }
.mark.vermilion .k { color: #ff6a50; }
.mark.pulse { animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 rgba(255,255,255,0); } 50% { box-shadow: 0 0 16px rgba(255,255,255,.25); } }

/* 右下の小さなJSIネオン */
#jsi { position: fixed; z-index: 9; right: calc(14px + var(--safe-r)); bottom: calc(12px + var(--safe-b)); min-width: 48px; min-height: 44px; display: grid; place-items: center; padding: 0 10px;
  font-weight: 300; letter-spacing: .28em; padding-left: calc(10px + .28em); font-size: .8rem; color: #fff; text-decoration: none; text-shadow: 0 0 6px #fff, 0 0 18px rgba(255,255,255,.55); opacity: .75; transition: opacity .3s; }
#jsi:hover { opacity: 1; }
#jsi[hidden] { display: none; }
.noscript { position: fixed; z-index: 30; inset: 0; display: grid; place-items: center; background: #000; margin: 0; }

/* ===== 店の中（作品一覧） ===== */
body.no3d .back, body.no3d .more { display: none; }
body.no3d #list { transition: none; }
#bar { z-index: 30; }
#list { scrollbar-color: #555 #000; scrollbar-width: thin; position: fixed; inset: 0; z-index: 20; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  background: radial-gradient(ellipse at 50% 0%, rgba(40,40,46,.55), rgba(0,0,0,.97) 60%), #000; opacity: 0; transition: opacity .25s ease; }
#list[hidden] { display: none; } #list.show { opacity: 1; }
body.in-list #allworks, body.in-list #hint, body.in-list #marks, body.in-list #jsi { display: none; }
body.in-list #bar { justify-content: flex-end; }   /* 一覧では「All works」が消えるので、音ボタンを右に寄せて「戻る」と重ならないようにする */body.entering #bar, body.entering #hint, body.entering #marks, body.entering #jsi { opacity: 0; pointer-events: none; transition: opacity .2s; }
.list-inner { max-width: 1040px; margin: 0 auto; padding: calc(64px + var(--safe-t)) calc(18px + var(--safe-r)) calc(40px + var(--safe-b)) calc(18px + var(--safe-l)); }
.list-head { position: fixed; top: calc(10px + var(--safe-t)); left: calc(12px + var(--safe-l)); z-index: 31; }
.list-head .back { background: rgba(0,0,0,.82); border-color: rgba(255,255,255,.5); }   /* 下にスクロールしても、いつも上に出ていて、文字が重なっても読める */.back .en { margin-left: .5em; } .back .ja { margin-left: .5em; }
.all-title { margin: 8px 0 22px; font-weight: 300; font-size: 1.3rem; letter-spacing: .1em; }
.group { margin-bottom: 34px; }
.sign-title { display: flex; align-items: baseline; gap: 14px; margin: 6px 0 18px; font-weight: 300; }
.sign-title .k { font-size: clamp(2.6rem, 9vw, 3.6rem); line-height: 1; color: #fff; text-shadow: 0 0 10px rgba(255,255,255,.75), 0 0 36px rgba(255,255,255,.25); font-family: "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif JP", serif; font-weight: 700; }
.sign-title .l { font-size: .85rem; letter-spacing: .5em; color: var(--dim); }
.group.vermilion .sign-title .k { color: #ffd9cf; text-shadow: 0 0 10px rgba(255,59,31,.95), 0 0 38px rgba(255,59,31,.45); }
.btn .ja { margin-left: .7em; }
.more { margin-top: 4px; }
.list-foot { margin-top: 46px; padding-top: 22px; border-top: 1px solid rgba(255,255,255,.14); }
.foot-links { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.foot-link { color: var(--text); text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; border-bottom: 1px solid rgba(255,255,255,.35); font-size: .9rem; }
.foot-link:hover { border-color: #fff; }
.credit { margin: 14px 0 0; font-size: .72rem; line-height: 1.7; color: #9a9aa2; }

@media (prefers-reduced-motion: reduce) {
  #list { transition-duration: .01s; }
  .screen, #hint, .mark { transition-duration: .01s; } .mark.pulse { animation: none; }
}

/* 雨を長押ししたときの、ふりがな・ローマ字・英語 */
#word { position: fixed; left: 0; right: 0; bottom: 17%; z-index: 12; margin: 0; text-align: center; pointer-events: none; opacity: 0; transition: opacity .5s; display: flex; flex-direction: column; gap: .25em; align-items: center; text-shadow: 0 0 14px #000, 0 0 3px #000; }
#word.show { opacity: 1; }
#word .furi { font-size: 1.15rem; letter-spacing: .3em; color: #fff; }
#word .romaji { font-size: .95rem; letter-spacing: .22em; color: #cfd0d6; }
#word .en { font-size: 1rem; color: #ff6a4d; letter-spacing: .06em; }

/* 作品がまだない看板の中 */
.empty { margin: 8px 0 0; color: var(--dim); font-size: 1rem; letter-spacing: .08em; display: flex; gap: .8em; align-items: baseline; }
.empty .ja { font-size: .85rem; }


/* ---------- 作品カード（バナー型：左に説明、右にiPhone枠で動くアプリ） ---------- */
.count { margin: 0 0 18px; font-size: 1.05rem; color: var(--text); letter-spacing: .06em; }
.cards { display: grid; gap: 22px; grid-template-columns: 1fr; }
.card { position: relative; display: grid; grid-template-columns: 1fr; gap: 0; border: 1px solid rgba(255,255,255,.26); border-radius: 22px; overflow: hidden;
  background: radial-gradient(120% 90% at 85% 40%, rgba(255,255,255,.10), rgba(255,255,255,0) 60%), #101013; }
.card .body { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 22px 20px 8px; }
.card .badge { padding: 4px 12px; font-size: .78rem; letter-spacing: .08em; color: #fff; background: rgba(255,59,31,.18); border: 1px solid rgba(255,59,31,.85); border-radius: 999px; }
.card .name { margin: 0; font-size: 1.5rem; line-height: 1.25; font-weight: 700; letter-spacing: .01em; color: #fff; }
.card .body > .en { margin: 0; font-size: 1.02rem; line-height: 1.65; color: #f0f0f3; }
.card .body > .ja { margin: 0; font-size: .92rem; line-height: 1.6; color: #cfcfd5; }
.langs { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 2px 0 0; padding: 0; }
.langs li { font-size: .82rem; padding: 4px 12px; border: 1px solid rgba(255,255,255,.4); border-radius: 999px; color: #fff; }
.note { margin: 0; font-size: .85rem; line-height: 1.55; color: #cfcfd5; }
.card .btn { margin-top: 10px; min-height: 52px; padding: 0 24px; font-size: 1.02rem; display: inline-flex; align-items: center; }
.card .btn .arr { margin-left: .8em; }
.card .btn.open { text-decoration: none; background: #fff; color: #000; border-color: #fff; font-weight: 700; }
.card .btn.open .ja { color: #333; }
.card .btn.open:hover { background: #ffe3dc; }
.card .btn.soon { cursor: default; color: #cfcfd5; border-style: dashed; background: transparent; }
.card.featured { border-color: rgba(255,59,31,.8); box-shadow: 0 0 28px rgba(255,59,31,.22), inset 0 0 26px rgba(255,59,31,.07); }
.card.featured .btn.open { background: var(--vermilion); border-color: var(--vermilion); color: #fff; box-shadow: 0 0 18px rgba(255,59,31,.45); }
.card.featured .btn.open .ja { color: #ffe3dc; }
.card.featured .btn.open:hover { background: #ff5a3f; }

.stage { display: flex; justify-content: center; align-items: flex-end; padding: 18px 20px 0; overflow: hidden; }
.phone { position: relative; width: min(220px, 62vw); aspect-ratio: 9 / 17.2; background: #050506; border: 3px solid #3b3b42; border-bottom: 0; border-radius: 34px 34px 0 0; padding: 9px 9px 0;
  box-shadow: 0 0 0 1px #000, 0 -6px 40px rgba(255,255,255,.08), inset 0 0 0 2px #121214; transform: translateY(14px); }
.phone .notch { position: absolute; z-index: 2; top: 15px; left: 50%; width: 30%; height: 18px; border-radius: 999px; background: #000; transform: translateX(-50%); }
.phone .screen { width: 100%; height: 100%; border-radius: 26px 26px 0 0; overflow: hidden; background: #111; }
.phone video, .phone img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 0; }

@media (min-width: 720px) {
  .card { grid-template-columns: 1.15fr .85fr; min-height: 380px; }
  .card .body { padding: 34px 8px 34px 34px; justify-content: center; }
  .card .name { font-size: 1.9rem; }
  .stage { padding: 30px 30px 0 0; }
  .phone { width: min(250px, 100%); }
}

.card .body > .en, .card .body > .ja, .card .note { letter-spacing: .01em; }
.card .body > .en { font-size: 1.05rem; }

/* ---------- サムネ型（横長バナー：左に作品名、右にスマホで動く画面。説明は下） ---------- */
.card, .card.featured { display: flex; flex-direction: column; min-height: 0; background: #0e0e10; padding: 10px; gap: 0; }
.card .thumb { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 6px; aspect-ratio: 800 / 440; overflow: hidden; border-radius: 12px; padding: 0 5% 0 6%; }
.thumb .tt { flex: 1 1 auto; min-width: 0; }
.thumb .ttl { margin: 0; font-weight: 800; line-height: 1.12; font-size: clamp(1.25rem, 6.4vw, 2.5rem); letter-spacing: 0; }
.thumb .cat { margin: .7em 0 0; font-weight: 700; line-height: 1.4; font-size: clamp(.7rem, 3vw, 1.05rem); opacity: .92; letter-spacing: .02em; }
.thumb .phone { flex: none; width: auto; height: 86%; aspect-ratio: 9 / 18; border: 3px solid #111; border-bottom: 3px solid #111; border-radius: 18px; padding: 4px; transform: none; box-shadow: 0 10px 28px rgba(0,0,0,.4); background: #000; }
.thumb .phone .screen { border-radius: 13px; }
.thumb .phone .notch { top: 7px; height: 6px; width: 26%; }
.thumb .badge { position: absolute; left: 10px; top: 10px; padding: 3px 10px; font-size: .7rem; color: #fff; background: rgba(0,0,0,.72); border: 1px solid rgba(255,59,31,.9); border-radius: 999px; }
.card .body { padding: 18px 10px 14px; gap: 8px; }
.card .name { font-size: 1.3rem; }
.bar-open { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 56px; margin: 4px 0 0; padding: 0 14px; border-top: 1px solid rgba(255,255,255,.22); color: #fff; text-decoration: none; }
.bar-open .kind { font-size: .78rem; letter-spacing: .2em; color: #cfcfd5; }
.bar-open .go { display: inline-flex; align-items: baseline; font-size: 1.05rem; font-weight: 700; }
.bar-open .arr { margin-left: .8em; }
.bar-open:hover { background: rgba(255,255,255,.08); }
.card.featured .bar-open .go { color: #ff7a63; }
.bar-open.soon { color: #cfcfd5; }
@media (min-width: 720px) {
  .cards { grid-template-columns: repeat(2, 1fr); align-items: start; }
  .card, .card.featured { grid-template-columns: none; }
  .card .body { padding: 20px 14px 16px; }
}
.card .thumb { display: block; }
.thumb .tt { position: absolute; left: 6%; top: 50%; transform: translateY(-50%); width: 52%; }
.thumb .phone { position: absolute; right: 6%; top: 8%; bottom: 8%; height: auto; width: auto; aspect-ratio: 9 / 18; }
.thumb .phone .screen { position: absolute; inset: 4px; width: auto; height: auto; }
.thumb .phone video, .thumb .phone img { position: absolute; inset: 0; width: 100%; height: 100%; }
.bar-open .kind, .bar-open .go, .bar-open .go span { white-space: nowrap; }
@media (max-width: 460px) { .bar-open .kind { display: none; } .bar-open { justify-content: flex-end; } .bar-open .go { font-size: 1rem; } }
/* スマホ枠の大きさは、中の画面（動画と同じ 9:16）に合わせて決める＝見切れない */
.thumb .phone { aspect-ratio: auto; width: auto; padding: 4px; }
.thumb .phone .screen { position: relative; inset: auto; height: 100%; width: auto; aspect-ratio: 9 / 16; }
.thumb .phone video, .thumb .phone img { object-fit: cover; object-position: 50% 50%; }

/* ---------- 一覧の上の固定ヘッダー帯（スクロールしても文字と重ならない） ---------- */
.list-head::before { content: ""; position: fixed; z-index: -1; left: 0; right: 0; top: 0; height: calc(64px + var(--safe-t));
  background: rgba(0,0,0,.92); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border-bottom: 1px solid rgba(255,255,255,.22); }
.list-head .back { background: transparent; border-color: rgba(255,255,255,.55); min-height: 44px; }
body.in-list #bar { z-index: 32; }
.list-inner { padding-top: calc(88px + var(--safe-t)); }

/* ---------- ENTER の演出 ---------- */
#intro { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 22; pointer-events: none; }
#intro[hidden] { display: none; }
#start.intro-go { transition: opacity 1.4s ease .15s, visibility 1.4s; }
#start.intro-go .start-inner > :not(h1) { opacity: 0; transition: opacity .3s; }
#start.intro-go h1 { visibility: hidden; }
