body.play { height: 100vh; height: 100dvh; overflow: hidden; display: flex; flex-direction: column; background: #05060f; }
.play-bar { flex: 0 0 52px; display: flex; align-items: center; gap: 16px; padding: 0 16px; background: var(--night); border-bottom: 1px solid var(--line); z-index: 5; }
.play-bar .brand { font-size: 14px; }
.play-hint { margin: 0 auto; font-size: 13px; color: var(--text-3); }
.play-actions { display: flex; align-items: center; gap: 8px; }
.bar-link { font-size: 14px; font-weight: 500; text-decoration: none; color: var(--text); padding: 7px 14px; border-radius: 999px; border: 1px solid rgba(255, 62, 165, .55); }
.bar-link:hover { background: rgba(255, 62, 165, .14); }
.bar-btn { width: 36px; height: 36px; display: grid; place-items: center; border: 0; border-radius: 10px; background: rgba(242, 245, 255, .08); cursor: pointer; }
.bar-btn:hover:not(:disabled) { background: rgba(242, 245, 255, .16); }
.bar-btn:disabled { opacity: .35; cursor: default; }

.stage { position: relative; flex: 1; min-height: 0; }
#unity-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; background: #05060f; outline: none; }

.loader { position: absolute; inset: 0; display: grid; place-items: center; transition: opacity .6s ease; z-index: 2; }
.loader.is-gone { opacity: 0; pointer-events: none; }
.loader-bg { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(7,6,21,.35) 0%, rgba(7,6,21,.55) 45%, rgba(7,6,21,.9) 100%), url(../img/loader-bg.jpg) center 60% / cover no-repeat, #0b0a1e;
  animation: kenburns 30s ease-in-out infinite alternate; }
.loader-inner { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; padding: 0 16px; }
.loader-hex { margin-bottom: 22px; filter: drop-shadow(0 0 14px rgba(255, 62, 165, .5)); }
.hex-track { fill: #0B0A1E; stroke: rgba(242, 245, 255, .14); stroke-width: 3; stroke-linejoin: round; }
.hex-run { fill: none; stroke: var(--magenta); stroke-width: 3; stroke-linejoin: round; stroke-dasharray: 40 124; animation: hexrun 2.4s linear infinite; }
@keyframes hexrun { to { stroke-dashoffset: -164; } }
.loader-title { margin: 0; font: 700 clamp(28px, 4vw, 40px)/1 var(--display); letter-spacing: .08em; text-shadow: 0 0 30px rgba(255, 62, 165, .45); }
.loader-bar { width: min(340px, 70vw); height: 3px; margin-top: 30px; border-radius: 3px; background: rgba(242, 245, 255, .12); overflow: hidden; }
.loader-fill { width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--magenta), var(--cyan)); box-shadow: 0 0 12px var(--cyan); transition: width .25s ease; }
.loader-status { margin: 16px 0 0; font-size: 15px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.loader-tip { margin: 6px 0 0; font-size: 13px; color: var(--text-3); }

.mobile, .error { position: absolute; inset: 0; z-index: 3; overflow-y: auto; background: var(--night); }
.mobile { display: flex; align-items: center; justify-content: center; padding: 24px 16px calc(24px + env(safe-area-inset-bottom)); }
.mobile[hidden], .error[hidden] { display: none; }
.mobile-card { width: min(440px, 100%); }
.mobile-art { aspect-ratio: 16 / 9; border-radius: 16px; margin-bottom: 26px; background: url(../img/street-tokyo-sm.jpg) center / cover; box-shadow: 0 20px 60px rgba(0, 0, 0, .5); }
.mobile h1 { margin: 0 0 10px; font: 700 32px/1.1 var(--display); }
.mobile p { margin: 0 0 24px; color: var(--text-2); }
.try-anyway { display: block; margin: 22px auto 0; border: 0; background: none; color: var(--text-3); font-size: 14px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.error { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 16px; gap: 6px; }
.error-title { margin: 0; font: 700 28px/1.2 var(--display); }
.error p { max-width: 30em; color: var(--text-2); margin: 0 0 18px; }

@media (max-aspect-ratio: 4/3) { .loader-bg { background-position: 72% center; } }
@media (max-width: 720px) {
  .play-hint { display: none; }
  .play-bar .brand span { display: none; }
  .play-actions { margin-left: auto; }
}

/* Game-only page: no header, the canvas fills the window. */
body.play .stage { flex: 1 1 100%; height: 100%; }
.fs-float { position: absolute; right: 14px; bottom: 14px; z-index: 6; width: 38px; height: 38px; border-radius: 10px; border: 1px solid rgba(255,255,255,.14); background: rgba(11,10,30,.55); color: #F2F5FF; display: grid; place-items: center; cursor: pointer; opacity: .55; transition: opacity .2s; }
.fs-float:hover { opacity: 1; }
.fs-float:disabled, .fs-float[hidden] { display: none; }
/* ---- touch devices in portrait: turn sideways ---- */
.rotate { position: absolute; inset: 0; z-index: 8; display: grid; place-items: center; padding: 24px 16px calc(24px + env(safe-area-inset-bottom));
  background: radial-gradient(120% 80% at 50% 30%, #1D0225 0%, #0B0A1E 55%, #070615 100%); text-align: center; }
.rotate[hidden] { display: none; }
.rotate-card { width: min(420px, 100%); text-align: center; }
.rotate-card .mg-line { margin-bottom: 20px; }
.rotate-alt { font: 500 14px/1.4 var(--ui); color: var(--kcyan); text-decoration: none; border-bottom: 1px solid rgba(65,232,255,.4); }
.rotate-phone { position: relative; width: 58px; height: 98px; margin: 0 auto 34px; border: 2px solid rgba(242,245,255,.85); border-radius: 13px;
  box-shadow: 0 0 24px rgba(65,232,255,.25), inset 0 0 18px rgba(65,232,255,.12); animation: mg-tilt 2.8s cubic-bezier(.65,0,.35,1) infinite; }
.rotate-phone::after { content: ""; position: absolute; left: 50%; bottom: 6px; width: 14px; height: 2px; margin-left: -7px; border-radius: 2px; background: rgba(242,245,255,.5); }
.rotate-hex { position: absolute; left: 50%; top: 50%; width: 22px; height: 25px; margin: -14px 0 0 -11px; background: var(--cyan);
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); opacity: .85; box-shadow: 0 0 12px var(--cyan); }
@keyframes mg-tilt { 0%, 18% { transform: rotate(0deg); } 42%, 72% { transform: rotate(-90deg); } 96%, 100% { transform: rotate(0deg); } }
@media (prefers-reduced-motion: reduce) { .rotate-phone { animation: none; transform: rotate(-90deg); } }


/* ---- fullscreen offer (kit panel, top centre) ---- */
.fs-ask { position: absolute; left: 50%; top: calc(18px + env(safe-area-inset-top)); z-index: 12; transform: translateX(-50%);
  width: min(460px, calc(100vw - 32px)); padding: 24px 28px 20px; animation: mg-drop .4s cubic-bezier(.2,.8,.2,1) both; }
.fs-ask[hidden] { display: none; }
.fs-ask .mg-title { font-size: 20px; margin-bottom: 6px; }
.fs-ask .mg-line { font-size: 15px; margin-bottom: 18px; }
@keyframes mg-drop { from { opacity: 0; transform: translate(-50%, -12px); } }
@media (max-height: 520px) { .fs-ask { top: 10px; padding: 16px 18px 14px; width: auto; } .fs-ask .fs-l { display: none; }
  .fs-ask .mg-title { font-size: 16px; margin-bottom: 12px; } .fs-ask .mg-btn { height: 44px; font-size: 13px; padding: 0 18px; } }
@media (prefers-reduced-motion: reduce) { .fs-ask { animation: none; } }
.stage:fullscreen { width: 100vw; height: 100vh; }

/* ---- loader note ---- */
.loader-title { letter-spacing: .14em; text-shadow: 0 0 40px rgba(150,200,255,.35), 0 4px 30px rgba(0,0,0,.7); }
.loader-note { width: min(520px, calc(100vw - 32px)); box-sizing: border-box; margin-top: 34px; padding: 18px 22px 16px; --ch: 14px; }
.loader-note .mg-note a { color: var(--kcyan); text-decoration: none; border-bottom: 1px solid rgba(65,232,255,.4); }
@media (max-height: 520px) { .loader-note { margin-top: 18px; padding: 12px 16px; } .loader-note .mg-note { font-size: 12.5px; } }
