/* INFINITY ── コックピット（蓋にかざした先）
   ページは明るく。宇宙は「窓」の中だけ。 */
body.cockpit { background: var(--bg); }
.ck-top { position: sticky; top: 0; z-index: 20; display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 62px; padding: env(safe-area-inset-top) 18px 0; background: rgba(255, 252, 244, .92); border-bottom: 1px solid var(--line); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.logo { display: inline-flex; align-items: center; gap: 9px; min-height: 44px; color: var(--ink); text-decoration: none; font-family: var(--hud); font-weight: 900; font-size: 16px; letter-spacing: .14em; }
.logo svg { width: 38px; height: 19px; fill: none; stroke: var(--amber); stroke-width: 2.6; stroke-linecap: round; }
.logo svg circle { fill: var(--sky); stroke: none; }
.ck-top-r { display: flex; align-items: center; gap: 10px; }
.demo { color: var(--sky-d); }

.cp { width: min(100% - 32px, 1120px); margin: 0 auto; padding: 18px 0 24px; display: grid; gap: 18px; }
.cp > * { min-width: 0; }
@media (min-width: 920px) {
  .cp { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); align-items: start; gap: 34px; padding-top: 30px; }
  .ck-view { position: sticky; top: 86px; }
}
.ck-name { margin: 0 0 12px; text-align: center; font-weight: 900; font-size: 18px; letter-spacing: .1em; color: var(--ink); overflow-wrap: anywhere; }

/* 宇宙の窓（白いふちの、角まるの窓） */
.viewport { position: relative; width: min(100%, 560px); margin: 0 auto; aspect-ratio: 1 / 1; isolation: isolate; overflow: hidden; border-radius: 40px; background: radial-gradient(circle at 50% 45%, var(--space-2) 0%, var(--space) 70%); box-shadow: 0 0 0 10px #fff, 0 0 0 12px var(--line-2), var(--shadow-l); transition: transform .3s; }
.viewport::after { content: ''; position: absolute; inset: 0; z-index: 3; pointer-events: none; border-radius: inherit; box-shadow: inset 0 0 50px rgba(5, 8, 25, .55); }
.vp-stars { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; }
.vp-strut { display: none; }
.stage { position: absolute; inset: 5%; z-index: 1; display: block; padding: 0; border: 0; background: none; cursor: zoom-in; -webkit-tap-highlight-color: transparent; }
.stage .em { position: absolute; inset: 0; opacity: 0; transform: rotate(-40deg) scale(.6); filter: blur(8px); transition: opacity .6s ease, transform 1.4s cubic-bezier(.22, 1.25, .36, 1), filter .7s ease; }
.stage .em.on { opacity: 1; transform: none; filter: none; }
.stage .em.out { opacity: 0; transform: rotate(34deg) scale(1.2); filter: blur(10px); }
.stage .em svg { width: 100%; height: 100%; }
.stage .flash { position: absolute; inset: 6%; border-radius: 50%; background: radial-gradient(circle, rgba(242, 251, 255, .95), rgba(159, 216, 255, .35) 35%, rgba(159, 216, 255, 0) 65%); pointer-events: none; animation: flash 1.05s ease-out forwards; }
@keyframes flash { 0% { opacity: 0; transform: scale(.4); } 18% { opacity: 1; } 100% { opacity: 0; transform: scale(1.5); } }
.stage.shake { animation: shake .9s cubic-bezier(.36, .07, .19, .97) 2; }
@keyframes shake { 10%, 90% { transform: translate(-1px, 0); } 20%, 80% { transform: translate(2px, 1px); } 30%, 50%, 70% { transform: translate(-3px, -1px); } 40%, 60% { transform: translate(3px, 1px); } }
.scan { position: absolute; inset: 8%; border-radius: 50%; border: 1px solid rgba(255, 176, 74, .3); opacity: 0; transition: opacity .3s; pointer-events: none; }
.scan i { position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(from 0deg, rgba(255, 176, 74, .3), rgba(255, 176, 74, 0) 22%); animation: spin 1.8s linear infinite; }
[data-state='loading'] .scan { opacity: 1; }
.vp-r { position: absolute; z-index: 4; font-family: var(--hud); font-weight: 800; font-size: 10.5px; letter-spacing: .12em; color: rgba(255, 200, 120, .85); white-space: nowrap; }
.vp-r.tl { top: 5%; left: 9%; }
.vp-r.tr { top: 5%; right: 9%; }
.vp-r.bl { bottom: 5%; left: 9%; }
.vp-r.br { bottom: 5%; right: 9%; }
[data-state='released'] .vp-r { color: rgba(190, 225, 255, .9); }

/* 計器盤 */
.ck-panel { display: flex; flex-direction: column; gap: 14px; }
.state { padding: 4px 2px 0; }
.state .label { margin: 0; }
.state-title { margin: 6px 0 0; font-weight: 900; font-size: clamp(34px, 8vw, 48px); line-height: 1.2; letter-spacing: .06em; color: var(--ink); }
html[lang='en'] .state-title { font-family: var(--hud); font-weight: 900; letter-spacing: .04em; }
[data-state='sealed'] .state-title, [data-state='gathering'] .state-title { color: var(--amber-t); }
[data-state='released'] .state-title { color: var(--sky-d); }
[data-state='rumbling'] .state-title { color: var(--alert); }
[data-state='error'] .state-title { font-size: 26px; letter-spacing: .04em; }
.state-desc { margin: 6px 0 0; font-size: 15.5px; color: var(--sub); }
/* 以前にも使われたアドレスのときの注記 */
.state-note { margin: 10px 0 0; padding: 10px 13px; border: 1px solid var(--line); border-left: 3px solid var(--amber); border-radius: 12px; background: var(--card); font-size: 13.5px; line-height: 1.7; color: var(--sub); overflow-wrap: anywhere; }
.state-note[hidden] { display: none; }
.amount { padding: 16px 18px; border: 1px solid #FFD9A8; border-radius: var(--r); background: var(--amber-soft); }
.amount .label { margin: 0; }
.amount-v { margin: 4px 0 0; display: flex; align-items: baseline; gap: 10px; }
.amount-v b { font-family: var(--hud); font-size: clamp(36px, 8vw, 48px); font-weight: 900; color: var(--amber-t); letter-spacing: .01em; line-height: 1.1; }
[data-state='released'] .amount { background: var(--ice-soft); border-color: #C3DCF8; }
[data-state='released'] .amount-v b { color: var(--sky-d); }
.amount-v span { font-family: var(--hud); font-weight: 800; font-size: 15px; color: var(--sub); }
.amount-sub { margin: 4px 0 0; font-family: var(--hud); font-weight: 700; font-size: 13px; color: var(--sub); }
.amount-fiat { margin: 2px 0 0; font-size: 14px; font-weight: 700; color: var(--sky-d); }
.facts { margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.facts div { padding: 11px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); box-shadow: var(--shadow); animation: riseIn .5s var(--spring-soft) both; animation-delay: calc(var(--i, 0) * 60ms); }
.facts dt { font-family: var(--hud); font-weight: 800; font-size: 11px; letter-spacing: .14em; color: var(--sub); }
.facts dt small { margin-left: 6px; font-family: var(--sans); font-weight: 700; font-size: 11.5px; letter-spacing: .02em; }
.facts dd { margin: 3px 0 0; font-family: var(--hud); font-weight: 800; font-size: 16px; color: var(--ink); overflow-wrap: anywhere; }
.facts dd.hot { color: var(--amber-t); }
.facts dd.cool { color: var(--sky-d); }
.facts dd.sig, .facts dd.conf { color: var(--signal-d); }

/* ボタンの並び */
.console { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.key { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-height: 68px; padding: 12px 16px; border: 2px solid var(--line); border-radius: 18px; background: var(--card); color: var(--ink); text-align: left; text-decoration: none; cursor: pointer; box-shadow: 0 4px 0 var(--line-2); transition: transform .15s, border-color .25s, background-color .25s, box-shadow .15s; }
.key:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--line-2); }
.key:hover { border-color: var(--sun); background: #FFFDF6; }
.key b { font-family: var(--hud); font-weight: 900; font-size: 11.5px; letter-spacing: .16em; color: var(--amber-t); }
.key span { font-size: 14.5px; font-weight: 900; line-height: 1.5; }
.key::after { content: none; }
.key.ice b { color: var(--sky-d); }
.key.ice.primary { border-color: var(--sky); background: var(--ice-soft); box-shadow: 0 4px 0 #9CC6F5; }
.key.ice:hover { border-color: var(--sky); }
.key.wide { grid-column: 1 / -1; }
.key.primary { border-color: var(--amber); background: var(--amber-soft); box-shadow: 0 4px 0 #F2C48A; }

.err { padding: 14px 16px; border: 1px solid #F6C9BD; border-radius: 16px; background: var(--alert-soft); font-size: 14.5px; }
.err p { margin: 0 0 10px; }
.comms { padding: 12px 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--card-2); }
.comms .label { margin: 0 0 6px; }
.log { list-style: none; margin: 0; padding: 0; font-family: var(--mono); font-size: 11.5px; line-height: 1.85; color: var(--sub); }
.log li { opacity: 0; animation: logIn .01s linear forwards; animation-delay: calc(var(--i) * 220ms); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.log li::before { content: '▸ '; color: var(--amber); }
.log li.ok { color: var(--signal-d); }
.log li.warn { color: var(--alert); }
@keyframes logIn { to { opacity: 1; } }
.netline { margin: 0; font-family: var(--hud); font-weight: 700; font-size: 11.5px; letter-spacing: .08em; color: var(--sub); }
.netline.fresh { animation: netFresh 1.6s ease; }
@keyframes netFresh { 0% { color: var(--amber-t); } 100% { color: var(--sub); } }
.ck-chain { padding: 12px 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--card); box-shadow: var(--shadow); --cube: 30px; }
.ck-chain .blk { width: calc(var(--cube) + 32px); }
.uplink { position: sticky; top: 62px; z-index: 19; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; width: min(100% - 32px, 1120px); margin: 12px auto 0; padding: 12px 16px; border: 1px solid #B9E6D2; border-radius: 18px; background: var(--signal-soft); box-shadow: var(--shadow); animation: riseIn .6s var(--spring-soft) both; }
.uplink p { flex: 1 1 260px; margin: 0; font-size: 14px; line-height: 1.6; }
.uplink p b { display: block; }
.uplink .btn { min-height: 44px; }
/* 知らせを閉じる×（右上の角。文字やボタンに重ならないよう、右に余白をとる） */
.uplink { padding-right: 60px; }
.uplink p { flex-basis: 180px; }
.uplink-x { position: absolute; top: 10px; right: 10px; width: 40px; height: 40px; }

.ck-foot { display: flex; justify-content: center; align-items: center; gap: 10px; padding: 18px 20px calc(96px + env(safe-area-inset-bottom)); }
.ck-foot p { margin: 0; font-size: 12.5px; color: var(--sub); }
.led { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--signal); }

/* 見本の切り替え */
.demo-bar { position: fixed; left: 50%; bottom: calc(14px + env(safe-area-inset-bottom)); z-index: 25; display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; width: min(100% - 24px, 540px); padding: 5px; transform: translateX(-50%); border: 1px solid var(--line-2); border-radius: 999px; background: rgba(255, 255, 255, .95); box-shadow: var(--shadow-l); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.demo-bar button { min-height: 44px; border: 0; border-radius: 999px; background: none; color: var(--sub); font-weight: 900; font-size: 13.5px; cursor: pointer; transition: color .2s, background-color .2s; }
.demo-bar button[aria-pressed='true'] { background: var(--amber); color: #fff; }

/* シートの中身 */
.choices { display: grid; gap: 8px; }
.choice { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 14px 16px; border: 2px solid var(--line); border-radius: 16px; background: var(--card); color: var(--ink); text-align: left; cursor: pointer; }
.choice strong { font-size: 16px; font-weight: 900; }
.choice span:last-child { font-size: 13.5px; color: var(--sub); }
.choice[aria-pressed='true'] { border-color: var(--amber); background: var(--amber-soft); }
.pick-info { margin-top: 12px; animation: riseIn .45s var(--spring-soft) both; }
.pick-info p { margin: 0; font-size: 14.5px; color: var(--ink); }
.fee { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin: 0 0 4px !important; }
.fee .label { width: 100%; }
.fee b { font-family: var(--hud); font-size: 26px; font-weight: 900; color: var(--sky-d); }
.pick-info .btn { margin-top: 12px; }

/* 拡大 */
.zoom { position: fixed; inset: 0; z-index: 70; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 20px; border: 0; background: rgba(16, 22, 52, .96); color: #fff; cursor: zoom-out; animation: popIn .4s var(--spring-soft); }
.zimg { width: min(94vw, 94vh - 60px); aspect-ratio: 1 / 1; }
.zimg svg { width: 100%; height: 100%; }
.noscript { padding: 20px; }
