/* The access page (cloud/worker.js, accessPage; its life is access.js): the gate's picture behind, the title, and the
   login card in holo glass, with the install button astride its corner and the install guide. One look with the
   game's windows (plaza/dialogs.css): night panels in a thin neon rim with cut corners. Nothing scrolls on a phone,
   upright or sideways. The picture's two sizes come from the page, as --bg-small and --bg-large. */
@property --turn { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
:root {
  color-scheme: dark;
  --cyan: #5ff3ff; --pale: #e4feff; --night: #080d29; --text: #f4fbff; --muted: #b9cafa; --gold: #ffd36a;
  --pad: 22px; --field: 46px;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; height: 100vh; height: 100svh; overflow: hidden; background: #050c21; color: var(--text);
  font: 400 15px/1.45 "Inter", system-ui, sans-serif; -webkit-tap-highlight-color: transparent;
}

/* ---- The world behind: the picture, the portal's light, the motes, a shade for the words ---- */
.scene { position: fixed; inset: 0; overflow: hidden; }
.world { position: absolute; inset: 0; transform: translate3d(var(--wx, 0px), var(--wy, 0px), 0) scale(1.07); will-change: transform; }
.bg {
  position: absolute; inset: 0; opacity: 0;
  background: var(--bg-small, none) 70% 45% / cover no-repeat;
}
/* The picture: the small one (1344 wide) on phones, the large one where the screen has the pixels for it. */
@media (min-width: 900px), (min-width: 500px) and (min-resolution: 2dppx) { .bg { background-image: var(--bg-large, none); } }
.ready .bg { animation: bg-in 1.9s cubic-bezier(.2, .7, .2, 1) both; }
.pulse { position: absolute; left: var(--fx, 70%); top: var(--fy, 50%); border-radius: 50%; mix-blend-mode: screen; pointer-events: none; opacity: 0; }
.pulse {
  width: calc(var(--fr, 90px) * 7); height: calc(var(--fr, 90px) * 7); margin: calc(var(--fr, 90px) * -3.5);
  background: radial-gradient(circle, #cffbff70, #5ff3ff38 22%, #8a5cff26 44%, transparent 68%);
}
.ready .pulse { animation: fade-in 1.4s .8s both, pulse 4.2s ease-in-out 2.2s infinite; }
#motes { position: absolute; inset: 0; width: 100%; height: 100%; }
.shade {
  position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(90deg, #04091de6 0%, #04091da6 26%, #04091d33 52%, transparent 68%),
    linear-gradient(0deg, #050c21cc, transparent 22%),
    radial-gradient(120% 90% at 60% 45%, transparent 55%, #02040eb0);
}
.flash {
  position: fixed; z-index: 6; left: var(--sx, 70%); top: var(--sy, 50%); width: 40px; height: 40px; margin: -20px; border-radius: 50%;
  background: radial-gradient(circle, #fff, #cffbff 30%, #5ff3ff 55%, #5ff3ff00 72%); opacity: 0; pointer-events: none;
}
.warp .flash { animation: flash 1.9s cubic-bezier(.6, 0, .9, .4) both; }

/* ---- The page: the title, then the card ---- */
.stage {
  position: relative; z-index: 2; height: 100%; display: grid; align-content: center; justify-items: start;
  gap: 26px; padding: 24px clamp(24px, 7vw, 120px) 44px; overflow: auto; scrollbar-width: none;
}
.brand { transform: translate3d(var(--tx, 0px), var(--ty, 0px), 0); }
.title { position: relative; margin: 0 0 0 -2%; line-height: 0; animation: title-in 1.1s cubic-bezier(.2, 1.2, .3, 1) .25s both; }
.title img {
  display: block; width: min(34vw, 540px, 44svh); min-width: 200px; height: auto;
  filter: drop-shadow(0 8px 26px #01091ecc) drop-shadow(0 0 22px #5ff3ff40); animation: float 6s ease-in-out 1.4s infinite;
}
/* A light crossing the title, cut to the title's own shape. */
.title::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; mix-blend-mode: screen;
  background: linear-gradient(105deg, transparent 42%, #ffffffc4 50%, transparent 58%) 260% 0 / 260% 100% no-repeat;
  -webkit-mask: url(/access-title.webp) center / 100% 100% no-repeat; mask: url(/access-title.webp) center / 100% 100% no-repeat;
  animation: sheen 5.5s ease-in-out 1.6s infinite, float 6s ease-in-out 1.4s infinite;
}

.card {
  --cut: 26px; --nick: 8px; --rim: 1.5px; --k: .7px;
  --shape: polygon(var(--cut) 0, calc(100% - var(--nick)) 0, 100% var(--nick), 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, var(--nick) 100%, 0 calc(100% - var(--nick)), 0 var(--cut));
  position: relative; width: min(420px, 100%);
  transform: perspective(1100px) rotateY(var(--ry, 0deg)) rotateX(var(--rx, 0deg));
}
.card-glow {
  position: absolute; inset: -26px; z-index: -1; filter: blur(30px); opacity: .5; pointer-events: none;
  background: radial-gradient(60% 60% at 20% 10%, #5ff3ff80, transparent 70%), radial-gradient(60% 60% at 85% 95%, #8a5cff80, transparent 70%);
  animation: fade-half 1s .6s both;
}
/* The glass: what is behind shows through, blurred. */
.card-glass {
  position: absolute; inset: 0; clip-path: var(--shape);
  -webkit-backdrop-filter: blur(16px) saturate(1.35); backdrop-filter: blur(16px) saturate(1.35);
  background:
    radial-gradient(90% 70% at 0% 0%, #1d5fa84d, transparent 60%),
    radial-gradient(80% 70% at 100% 100%, #6a3fd040, transparent 62%),
    radial-gradient(#5ff3ff1c 1px, transparent 1.6px) 0 0 / 22px 22px,
    linear-gradient(165deg, #0e1848d6, #070b24e0 55%, #0b1440d6);
  animation: project .6s cubic-bezier(.2, .9, .2, 1) .55s both;
}
/* The rim: a thin neon line with cut corners, a light running along it (plaza/dialogs.css, .qx-frame). */
.card-rim {
  position: absolute; inset: 0; pointer-events: none;
  clip-path: polygon(evenodd,
    var(--cut) 0, calc(100% - var(--nick)) 0, 100% var(--nick), 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, var(--nick) 100%, 0 calc(100% - var(--nick)), 0 var(--cut), var(--cut) 0,
    calc(var(--cut) + var(--k)) var(--rim), calc(100% - var(--nick) - var(--k)) var(--rim), calc(100% - var(--rim)) calc(var(--nick) + var(--k)), calc(100% - var(--rim)) calc(100% - var(--cut) - var(--k)), calc(100% - var(--cut) - var(--k)) calc(100% - var(--rim)), calc(var(--nick) + var(--k)) calc(100% - var(--rim)), var(--rim) calc(100% - var(--nick) - var(--k)), var(--rim) calc(var(--cut) + var(--k)), calc(var(--cut) + var(--k)) var(--rim));
  background: linear-gradient(135deg, #e4feff, #5ff3ff 9%, #5ff3ff70 30%, #5ff3ff4d 50%, #5ff3ff70 70%, #5ff3ff 91%, #e4feff);
  animation: project .6s cubic-bezier(.2, .9, .2, 1) .55s both; transition: filter .3s;
}
.card-rim::after {
  content: ""; position: absolute; inset: 0;
  background: conic-gradient(from var(--turn), transparent 0 78%, #5ff3ff 90%, #fff 96%, transparent 100%);
  animation: turn 5.5s linear infinite;
}
.card.bad .card-rim { filter: hue-rotate(150deg) saturate(1.6) brightness(1.2); }
/* A slow scan line down the glass. */
.card-scan { position: absolute; inset: 0; clip-path: var(--shape); overflow: hidden; pointer-events: none; }
.card-scan::after {
  content: ""; position: absolute; left: 0; right: 0; top: -30%; height: 30%;
  background: linear-gradient(180deg, transparent, #5ff3ff12 70%, #5ff3ff30); animation: scan 7s linear 2s infinite;
}
.card-body { position: relative; padding: var(--pad); animation: rise .5s ease-out .95s both; }
.card h2 { margin: 0; font: 800 22px/1.15 "Inter", system-ui, sans-serif; letter-spacing: .01em; text-shadow: 0 0 16px #5ff3ff66; }
.lead { margin: 3px 0 14px; color: var(--muted); font-size: 13.5px; }
.who, .error { margin: 0 0 12px; padding: 9px 12px; font-size: 13.5px; clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px); }
.who { background: #16234acc; border-left: 2px solid var(--cyan); }
.who a { color: var(--cyan); font-weight: 700; }
.error { color: #ffd0dc; background: #4a1530d9; border-left: 2px solid #ff6b8f; animation: shake .45s .9s both; }
[hidden] { display: none !important; }

/* The tabs: radio inputs before the bar and the forms, as on the real page, so they work with no script. */
.tab, .os { position: absolute; opacity: 0; pointer-events: none; }
.tabs { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); padding: 3px; background: #050a20b3; border: 1px solid #5ff3ff33; clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px); }
.tabs::before {
  content: ""; position: absolute; top: 3px; bottom: 3px; left: 3px; width: calc((100% - 6px) / 3);
  background: linear-gradient(180deg, #5ff3ff3d, #5ff3ff1a); box-shadow: inset 0 0 0 1px #5ff3ffb0, 0 0 14px #5ff3ff55;
  clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px);
  transition: transform .38s cubic-bezier(.3, 1.3, .4, 1);
}
#tab-login:checked ~ .tabs::before { transform: translateX(100%); }
#tab-register:checked ~ .tabs::before { transform: translateX(200%); }
.tabs label { position: relative; display: grid; place-items: center; min-height: 38px; padding: 0 2px; text-align: center; font-size: 13px; font-weight: 700; color: var(--muted); cursor: pointer; transition: color .2s, text-shadow .2s; }
#tab-visitor:checked ~ .tabs [for=tab-visitor], #tab-login:checked ~ .tabs [for=tab-login], #tab-register:checked ~ .tabs [for=tab-register] { color: #fff; text-shadow: 0 0 10px #5ff3ffaa; }
#tab-visitor:focus-visible ~ .tabs [for=tab-visitor], #tab-login:focus-visible ~ .tabs [for=tab-login], #tab-register:focus-visible ~ .tabs [for=tab-register] { outline: 2px solid var(--cyan); outline-offset: -2px; }

/* The forms share one place; the one shown slides in. Only the one shown is in the flow, so the card always has
   its height, with or without the script (which only animates the height between two tabs, access.js). */
.forms { position: relative; margin: 0 -4px; padding: 0 4px 4px; overflow: hidden; transition: height .38s cubic-bezier(.3, 1, .3, 1); }
.forms form { position: absolute; top: 0; left: 4px; right: 4px; visibility: hidden; opacity: 0; transform: translateX(18px); transition: opacity .2s, transform .2s, visibility 0s .2s; }
#tab-visitor:checked ~ .forms .visitor, #tab-login:checked ~ .forms .login, #tab-register:checked ~ .forms .register, #tab-forgot:checked ~ .forms .forgot, #tab-reset:checked ~ .forms .reset {
  position: relative; left: 0; right: 0; visibility: visible; opacity: 1; transform: none; transition: opacity .32s .12s, transform .38s cubic-bezier(.2, 1, .3, 1) .12s, visibility 0s;
}
.field { margin-top: 11px; }
.field label { display: block; margin-bottom: 5px; color: var(--cyan); font: 800 10.5px/1.2 "Inter", system-ui, sans-serif; letter-spacing: .16em; text-transform: uppercase; }
.field input {
  width: 100%; height: var(--field); padding: 0 13px; color: inherit; font: inherit; font-size: 16px;
  background: linear-gradient(180deg, #0a1540cc, #060a22cc); border: 1px solid #5ff3ff40; border-radius: 0;
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
  transition: border-color .2s, background .2s, box-shadow .2s;
}
.field input:hover { border-color: #5ff3ff80; }
.field input:focus { outline: none; border-color: var(--cyan); background: linear-gradient(180deg, #0e2058e0, #081030e0); box-shadow: inset 0 -2px 0 var(--cyan), inset 0 0 18px #5ff3ff26; }
button { font: inherit; cursor: pointer; }
.go {
  position: relative; overflow: hidden; display: block; width: 100%; min-height: 48px; margin-top: 15px; padding: 0 14px; border: 0;
  color: #2a1606; font: 900 15.5px/1.1 "Inter", system-ui, sans-serif; letter-spacing: .03em; text-shadow: 0 1px 0 #ffe9c088;
  background: linear-gradient(180deg, #ffe58c, #f8bd3e 50%, #d98a1c);
  clip-path: polygon(9px 0, calc(100% - 9px) 0, 100% 9px, 100% calc(100% - 9px), calc(100% - 9px) 100%, 9px 100%, 0 calc(100% - 9px), 0 9px);
  transition: filter .15s, transform .1s;
}
.go::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(105deg, transparent 40%, #ffffffa6 50%, transparent 60%) 250% 0 / 250% 100% no-repeat; animation: sheen 3.2s ease-in-out infinite;
}
.go:hover { filter: brightness(1.12) drop-shadow(0 0 10px #ffd36a88); }
.go:active { transform: translateY(1px); filter: brightness(.95); }
.go:focus-visible, .foot a:focus-visible, .sheet-close:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.note { margin: 10px 0 0; color: #8d9cc4; font-size: 12.5px; line-height: 1.4; }
/* Password recovery (worker.js accessPage, views 'forgot' and 'reset'): a short line above the form, the way back, a sent notice. */
.hint { margin: 4px 0 0; color: #b9c6ec; font-size: 13.5px; line-height: 1.45; }
.hint strong { color: #fff; }
.back { margin: 12px 0 0; font-size: 13px; text-align: center; }
.back a { color: var(--cyan); text-decoration: none; }
.back a:hover { text-decoration: underline; }
.done { margin: 0 0 12px; padding: 9px 12px; font-size: 13.5px; color: #d6ffe9; background: #0f3a2ed9; border-left: 2px solid #5dffa8; clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px); }

.foot { position: fixed; z-index: 3; left: clamp(24px, 7vw, 120px); bottom: max(10px, env(safe-area-inset-bottom)); display: flex; gap: 14px; font-size: 12px; animation: rise .6s 1.3s both; }
.foot a { padding: 4px 2px; border: 0; background: none; color: #93a4d4; font: inherit; text-decoration: none; }
.foot a:hover { color: #dbe6ff; text-decoration: underline; }
/* The install button: astride the card's top right corner, so nobody misses it. Not once the hub is installed. */
.install-spot {
  position: absolute; z-index: 3; top: -19px; right: -10px;
  filter: drop-shadow(0 0 9px #5fb8ffb0) drop-shadow(0 6px 10px #000a);
  animation: pop .6s cubic-bezier(.3, 1.6, .5, 1) 1.5s both, beacon 3.2s ease-in-out 2.4s infinite;
}
@media (display-mode: standalone), (display-mode: fullscreen) { .install-spot { display: none; } }
.install-open {
  --cut: 10px;
  --shape: polygon(var(--cut) 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, var(--cut) 100%, 0 calc(100% - var(--cut)), 0 var(--cut));
  position: relative; isolation: isolate; overflow: hidden; display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 16px 0 11px; border: 0;
  color: #fff; font: 800 12.5px/1 "Inter", system-ui, sans-serif; letter-spacing: .09em; text-transform: uppercase; text-shadow: 0 1px 2px #0a0f3c;
  background: linear-gradient(135deg, #fff, #9ff4ff 40%, #c9b3ff); clip-path: var(--shape); transition: transform .12s, filter .15s;
}
.install-open::before { content: ""; position: absolute; inset: 1.5px; z-index: -1; clip-path: var(--shape); background: linear-gradient(120deg, #7446ff, #2f7dff 55%, #1fc4f2); }
.install-open::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(105deg, transparent 40%, #ffffff8c 50%, transparent 60%) 250% 0 / 250% 100% no-repeat; animation: sheen 3.8s ease-in-out 1s infinite; }
.install-open svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.install-open:hover { filter: brightness(1.15); transform: translateY(-1px) scale(1.04); }
.install-open:active { transform: translateY(1px); }
.install-open:focus-visible { outline: 2px solid #fff; outline-offset: -4px; }

/* The install guide: a holo window (plaza/dialogs.css, .qx-frame), the steps for the visitor's own device. */
dialog.install { width: min(94vw, 500px); max-width: none; max-height: none; padding: 0; border: 0; background: none; overflow: visible; color: var(--text); filter: drop-shadow(0 0 14px #5ff3ff40) drop-shadow(0 22px 44px #000000b0); }
dialog.install::backdrop { background: radial-gradient(ellipse at 50% 45%, #060c2acc, #02040ef0 78%); -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px); }
dialog.install[open] { animation: project .4s cubic-bezier(.2, .9, .2, 1) both; }
.sheet {
  --cut: 26px; --nick: 8px;
  --shape: polygon(var(--cut) 0, calc(100% - var(--nick)) 0, 100% var(--nick), 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, var(--nick) 100%, 0 calc(100% - var(--nick)), 0 var(--cut));
  position: relative; isolation: isolate; padding: 20px 20px 18px; clip-path: var(--shape);
  background: linear-gradient(135deg, #e4feff, #5ff3ff 9%, #5ff3ff70 30%, #5ff3ff4d 50%, #5ff3ff70 70%, #5ff3ff 91%, #e4feff);
}
.sheet::before {
  content: ""; position: absolute; inset: 1.5px; z-index: -1; clip-path: var(--shape);
  background:
    radial-gradient(90% 70% at 0% 0%, #1d5fa83d, transparent 60%), radial-gradient(80% 70% at 100% 100%, #6a3fd033, transparent 62%),
    radial-gradient(#5ff3ff17 1px, transparent 1.6px) 0 0 / 22px 22px, linear-gradient(165deg, #0e1848, #070b24 55%, #0b1440);
}
.sheet-head { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; align-items: center; padding-right: 34px; }
.sheet-head img { grid-row: span 2; width: 58px; height: 58px; border-radius: 14px; box-shadow: 0 0 0 1px #5ff3ff80, 0 0 18px #5ff3ff55; animation: float 5s ease-in-out infinite; }
.eyebrow { margin: 0; align-self: end; color: var(--cyan); font: 800 10.5px/1.2 "Inter", system-ui, sans-serif; letter-spacing: .18em; text-transform: uppercase; }
.sheet h2 { margin: 0; align-self: start; font: 800 21px/1.15 "Inter", system-ui, sans-serif; text-shadow: 0 0 16px #5ff3ff66; }
.sheet-lead { margin: 12px 0 14px; color: var(--muted); font-size: 13.5px; }
.sheet-close { position: absolute; top: 12px; right: 12px; width: 34px; height: 34px; padding: 0; border: 1px solid #5ff3ff80; background: #080d29; color: var(--pale); font-size: 20px; line-height: 1; clip-path: polygon(7px 0, 100% 0, 100% calc(100% - 7px), calc(100% - 7px) 100%, 0 100%, 0 7px); }
.sheet-close:hover { background: #14306a; }
.sheet :is(button, label):focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
#os-android:checked ~ .tabs::before { transform: translateX(100%); }
#os-pc:checked ~ .tabs::before { transform: translateX(200%); }
#os-ios:checked ~ .tabs [for=os-ios], #os-android:checked ~ .tabs [for=os-android], #os-pc:checked ~ .tabs [for=os-pc] { color: #fff; text-shadow: 0 0 10px #5ff3ffaa; }
#os-ios:focus-visible ~ .tabs [for=os-ios], #os-android:focus-visible ~ .tabs [for=os-android], #os-pc:focus-visible ~ .tabs [for=os-pc] { outline: 2px solid var(--cyan); outline-offset: -2px; }
.way { display: none; }
#os-ios:checked ~ .way.ios, #os-android:checked ~ .way.android, #os-pc:checked ~ .way.pc { display: block; animation: rise .3s ease-out both; }
.way .go { margin-top: 12px; }
.steps { list-style: none; counter-reset: step; display: grid; gap: 7px; margin: 12px 0 0; padding: 0; }
.steps li {
  counter-increment: step; display: grid; grid-template-columns: auto auto 1fr; align-items: center; gap: 11px; min-height: 44px; padding: 5px 12px 5px 9px;
  border: 1px solid #5ff3ff33; background: linear-gradient(180deg, #0a1540cc, #060a22cc); font-size: 14px; line-height: 1.3;
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
}
.steps li::before { content: counter(step); display: grid; place-items: center; width: 24px; height: 24px; color: #04162a; font: 900 13px/1 "Inter", system-ui, sans-serif; background: var(--cyan); clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px); }
.steps strong { color: #fff; }
.step-icon { display: grid; place-items: center; width: 32px; height: 32px; border: 1px solid #5ff3ff66; border-radius: 8px; background: #10224e; color: #9ff4ff; }
.step-icon svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.step-icon svg circle:not([r="9"]) { fill: currentColor; stroke: none; }
.sheet-done { display: flex; align-items: center; gap: 9px; margin: 12px 0 0; padding: 9px 12px; background: #0f3d47cc; border-left: 2px solid #5dffc8; color: #c0fff0; font-size: 13px; }
.sheet-done svg { flex: none; width: 18px; height: 18px; fill: none; stroke: #5dffc8; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.sheet-update { margin: 9px 0 0; color: #8d9cc4; font-size: 12px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }


/* The jump, two seconds and a half (access.js sends the form at its end): the card is drawn into the rift while the
   picture closes in on it, the light takes the screen, then fades to the night the game opens on. */
.warp .card { transition: transform 1s cubic-bezier(.6, -0.2, .9, .5), opacity .6s .4s; transform: translate3d(var(--jx, 0px), var(--jy, 0px), 0) scale(.05) rotate(40deg); opacity: 0; }
.warp .brand, .warp .foot { transition: opacity .6s; opacity: 0; }
.warp .world { transition: transform 2.3s cubic-bezier(.5, 0, .8, .4); transform: translate3d(var(--zx, 0px), var(--zy, 0px), 0) scale(2.4); }
.warp body::after { content: ""; position: fixed; inset: 0; z-index: 7; background: #020d1f; animation: fade-in .7s ease-in 1.8s both; }

/* ---- A phone held upright: the picture on top, the card at the bottom, growing upwards ---- */
@media (max-width: 700px) and (orientation: portrait) {
  :root { --pad: 18px; }
  .world { inset: 0 0 auto; height: 60svh; -webkit-mask: linear-gradient(#000 62%, transparent 97%); mask: linear-gradient(#000 62%, transparent 97%); }
  .shade { background: linear-gradient(180deg, #04091dcc, transparent 24%), radial-gradient(130% 80% at 50% 30%, transparent 60%, #02040e90); }
  .stage { grid-template-rows: auto 1fr; align-content: stretch; justify-items: center; gap: 0; padding: max(10px, env(safe-area-inset-top)) 14px calc(34px + env(safe-area-inset-bottom)); }
  .title { margin: 0; }
  .title img { width: min(64vw, 270px, 30svh); }
  .card { align-self: end; }
  .foot { left: 0; right: 0; justify-content: center; bottom: max(4px, env(safe-area-inset-bottom)); }
  .install-spot { right: -6px; }
  .sheet { padding: 18px 16px 16px; }
}
@media (max-width: 700px) and (orientation: portrait) and (max-height: 720px) {
  :root { --field: 42px; --pad: 15px; }
  .note { display: none; }
  .lead { margin-bottom: 10px; }
  .field { margin-top: 8px; }
  .go { min-height: 44px; margin-top: 12px; }
  .title img { width: min(52vw, 22svh); }
}
/* ---- A phone held sideways: the card on the left, compact, the title in the sky on the right ---- */
@media (max-height: 520px) and (orientation: landscape) {
  :root { --pad: 13px; --field: 38px; }
  .stage { grid-template-columns: minmax(0, 390px) 1fr; align-items: end; align-content: stretch; gap: 0 16px; padding: 6px max(16px, env(safe-area-inset-right)) 28px max(16px, env(safe-area-inset-left)); }
  .card { grid-area: 1 / 1; }
  .brand { grid-area: 1 / 2; align-self: start; justify-self: end; }
  .title { margin: 4px 0 0; }
  .title img { width: min(30vw, 250px); }
  .card h2 { display: inline; font-size: 17px; }
  .lead { display: inline; margin: 0 0 0 8px; font-size: 12.5px; }
  .who, .error { margin: 6px 0 0; padding: 5px 10px; font-size: 12.5px; }
  .tabs { margin-top: 8px; }
  .tabs label { min-height: 32px; }
  .pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .field { margin-top: 7px; }
  .field label { margin-bottom: 3px; }
  .go { min-height: 40px; margin-top: 10px; }
  .note { display: none; }
  .foot { left: max(16px, env(safe-area-inset-left)); bottom: max(3px, env(safe-area-inset-bottom)); }
  .install-spot { top: -24px; right: -8px; }
  .install-open { height: 32px; font-size: 11.5px; }
  dialog.install { width: min(96vw, 720px); }
  .sheet { padding: 12px 16px; }
  .sheet-head img { width: 40px; height: 40px; border-radius: 10px; }
  .sheet h2 { font-size: 18px; }
  .sheet-lead, .sheet-update { display: none; }
  .sheet .tabs { margin-top: 8px; }
  .steps { grid-template-columns: 1fr 1fr; margin-top: 8px; }
  .steps li { min-height: 40px; font-size: 13px; }
  .sheet-done { margin-top: 8px; padding: 6px 12px; }
  .way .go { margin-top: 8px; }
}
@media (min-width: 701px) and (max-height: 760px) and (min-height: 521px) {
  :root { --field: 42px; --pad: 18px; }
  .field { margin-top: 8px; }
  .lead { margin-bottom: 10px; }
}

@keyframes bg-in { from { opacity: 0; transform: scale(1.16); filter: blur(14px) brightness(.4); } to { opacity: 1; transform: none; filter: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes fade-half { from { opacity: 0; } to { opacity: .5; } }
@keyframes pulse { 0%, 100% { transform: scale(.9); opacity: .6; } 50% { transform: scale(1.12); opacity: 1; } }
@keyframes turn { to { --turn: 360deg; } }
@keyframes scan { to { top: 130%; } }
@keyframes sheen { 0%, 55% { background-position: 260% 0; } 100% { background-position: -160% 0; } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
@keyframes title-in { from { opacity: 0; transform: scale(.7) translateY(-20px); filter: blur(10px) brightness(2.2); } to { opacity: 1; transform: none; filter: none; } }
@keyframes project { from { opacity: 0; transform: scaleY(.02); filter: brightness(3); } 60% { opacity: 1; } to { opacity: 1; transform: none; filter: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: scale(.3) rotate(-12deg); } to { opacity: 1; transform: none; } }
@keyframes beacon { 0%, 100% { filter: drop-shadow(0 0 9px #5fb8ffb0) drop-shadow(0 6px 10px #000a); } 50% { filter: drop-shadow(0 0 20px #7fd4ff) drop-shadow(0 6px 10px #000a); } }
@keyframes shake { 20% { transform: translateX(-7px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(2px); } }
@keyframes flash { 0%, 30% { opacity: 0; transform: scale(1); } 55% { opacity: 1; } 100% { opacity: 1; transform: scale(110); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .bg, .pulse { opacity: 1; }
  .pulse { opacity: .7; }
  .card-scan, .title::after, .go::after, .card-rim::after, .install-open::after { display: none; }
}
