/* F422: login A — prologue last scene fills the screen (no blur), logo top centre, cream panel bottom centre, dark only behind the bottom link row. */
body.start-active :is(header,footer,#stick,#combat-controls,#skill-controls,#mana-hud,#quick-items,#settings-button,#social-button,#home,#message){visibility:hidden}
body #start-screen{position:fixed;inset:0;z-index:15;display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:auto minmax(0,1fr) auto auto;justify-items:center;box-sizing:border-box;padding:0 16px;overflow:auto;overscroll-behavior:contain;touch-action:pan-y;font-size:var(--readable-font-size,15px);color:var(--ui-panel-start-fg);background-color:var(--ui-panel-start-canvas);background-image:linear-gradient(to top,var(--ui-panel-start-backdrop),var(--ui-panel-start-backdrop) 45%,transparent),linear-gradient(to top,var(--ui-panel-start-backdrop),transparent 60%),url('/client/assets/login/last-scene.jpg');background-repeat:no-repeat;background-position:left bottom,left bottom,center;background-size:100% 180px,100% 180px,cover}
@media (max-aspect-ratio:3/4){body #start-screen{background-image:linear-gradient(to top,var(--ui-panel-start-backdrop),var(--ui-panel-start-backdrop) 45%,transparent),linear-gradient(to top,var(--ui-panel-start-backdrop),transparent 60%),url('/client/assets/login/last-scene.jpg');background-position:left bottom,left bottom,25% center}}
body #start-screen[hidden],body #start-screen [hidden]{display:none!important}
body #start-topbar{grid-row:1;grid-column:1;justify-self:end;align-self:start;position:relative;z-index:1;margin:max(12px,env(safe-area-inset-top)) -4px 0 0}
body #start-topbar .language-choices{display:flex;gap:4px;padding:4px;border-radius:12px;background:var(--ui-panel-start-bg)}
body #start-topbar .language-choices button{min-width:60px;min-height:44px;padding:4px 10px;border:0;border-radius:9px;background:var(--ui-panel-start-bg);color:var(--ui-panel-start-fg);font-size:13px}
body #start-topbar .language-choices button[aria-pressed=true]{background:var(--ui-panel-start-accent);color:var(--ui-panel-start-accent-fg);font-weight:700}
body #start-intro{grid-row:1;grid-column:1;justify-self:center;align-self:start;min-width:0;max-width:100%;margin-top:clamp(40px,8vh,96px)}
body #start-story{display:grid;justify-items:center;gap:10px;text-align:center}
body #start-eyebrow{margin:0;padding:4px 10px;border-radius:999px;background:var(--ui-panel-start-accent);color:var(--ui-panel-start-accent-fg);font-size:14px;font-weight:600;line-height:1.5}
body #start-title{margin:0;font-size:clamp(56px,6.2vw,104px);line-height:1.1;letter-spacing:.06em;font-weight:800;color:var(--ui-panel-start-fg);text-shadow:0 0 2px var(--ui-panel-start-bg),0 0 10px var(--ui-panel-start-bg),0 0 22px var(--ui-panel-start-bg),0 0 40px var(--ui-panel-start-bg)}
body #start-subtitle{margin:0;padding:4px 12px;border-radius:999px;background:var(--ui-panel-start-bg);color:var(--ui-panel-start-fg);font-size:16px;line-height:1.5}
/* The panel sits right of the two people: never left of 38.5% of the width (the man's arm in the 16:9 frame) plus 32px. */
body #start-card{grid-row:3;grid-column:1;justify-self:start;width:min(400px,100%);box-sizing:border-box;margin:24px 0 12px max(calc(50% - 200px),calc(38.5% + 32px));padding:22px 24px;border:1px solid var(--ui-panel-start-line);border-radius:20px;background:var(--ui-panel-start-bg);color:var(--ui-panel-start-fg);box-shadow:0 12px 40px var(--ui-panel-start-shadow)}
body #start-main{min-width:0}
body #start-welcome{margin:0;font-size:1.4em;line-height:1.35;color:var(--ui-panel-start-fg)}
body #start-help{margin:4px 0 14px;font-size:.87em;line-height:1.5;color:var(--ui-panel-start-muted)}
body #start-screen button{position:static;min-height:44px;min-width:0;max-width:100%;border-image:none;border:1px solid var(--ui-panel-start-line);border-radius:10px;padding:8px 12px;box-shadow:none;background:var(--ui-panel-start-soft);color:var(--ui-panel-start-fg);text-shadow:none;font:inherit;line-height:1.3;overflow-wrap:anywhere;cursor:pointer}
body #start-login #login-form{display:grid;gap:10px;margin:0}
body #start-login label{display:grid;gap:4px;font-size:.87em;color:var(--ui-panel-start-fg)}
body #start-login input{width:100%;min-width:0;min-height:46px;box-sizing:border-box;padding:8px 12px;font:inherit;font-size:max(16px,1em);border:1px solid var(--ui-panel-start-muted);border-radius:10px;background:var(--ui-panel-start-input);color:var(--ui-panel-start-fg);user-select:text;-webkit-user-select:text;touch-action:auto}
body #start-login #login-submit{min-height:46px;background:var(--ui-panel-start-accent);color:var(--ui-panel-start-accent-fg);border-color:var(--ui-panel-start-accent);font-weight:700}
body #start-login #login-status{margin:8px 0 0;font-size:.87em;line-height:1.5;color:var(--ui-panel-start-danger)}
body #start-login #login-status:empty{display:none}
body #start-screen button:disabled{cursor:wait}
body #start-actions{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:8px;margin-top:10px}
body #start-invite{grid-column:1 / -1}
body #start-actions #start-create{background:var(--ui-panel-start-bg);border-color:var(--ui-panel-start-muted);color:var(--ui-panel-start-fg)}
body #start-actions :is(#start-guest,#start-invite){background:var(--ui-panel-start-bg);border-color:var(--ui-panel-start-bg);color:var(--ui-panel-start-accent);font-size:.87em}
/* Bottom row: version update link, terms and privacy on the dark band; no install line. */
body #start-links{grid-row:4;grid-column:1;justify-self:stretch;display:flex;flex-wrap:wrap;justify-content:center;align-items:center;column-gap:2px;min-height:52px;margin:0 -16px;padding:0 16px max(0px,env(safe-area-inset-bottom))}
body #start-footer{display:contents}
body #start-links>button,body #start-footer button{min-width:44px;padding:4px 8px;border:0;background:transparent;color:var(--ui-panel-start-bg);font-size:13px}
body #start-news{font-size:14px}
body #start-news-title{font-weight:600;font-size:.93em;white-space:nowrap}
body #start-links .start-dot{color:var(--ui-panel-start-bg);font-size:13px}
body #start-screen :is(button,input):focus-visible{outline:3px solid var(--ui-panel-start-accent);outline-offset:3px}
body #start-links button:focus-visible{outline-color:var(--ui-panel-start-bg)}
@media (max-height:820px){body.desktop-ui #start-intro{margin-top:28px}body.desktop-ui #start-title{font-size:clamp(48px,5.6vw,76px)}body.desktop-ui #start-eyebrow{font-size:13px}body.desktop-ui #start-subtitle{font-size:15px}body.desktop-ui #start-card{padding:18px 22px;margin-bottom:4px}body.desktop-ui #start-help{margin-bottom:10px}body.desktop-ui #start-login #login-form{gap:8px}body.desktop-ui #start-login :is(input,#login-submit){min-height:44px}}
/* Phone portrait (F406: body.desktop-ui decides phone or PC): panel spans the width and stays low so both people show above it. */
@media (orientation:portrait){body:not(.desktop-ui) #start-screen{background-size:100% 150px,100% 150px,cover}body:not(.desktop-ui) #start-intro{margin-top:max(64px,calc(env(safe-area-inset-top) + 56px))}body:not(.desktop-ui) #start-story{gap:8px}body:not(.desktop-ui) #start-eyebrow{font-size:12px}body:not(.desktop-ui) #start-title{font-size:48px}body:not(.desktop-ui) #start-subtitle{font-size:14px}body:not(.desktop-ui) #start-card{justify-self:center;width:min(480px,100%);margin:16px 0 4px;padding:14px 16px}body:not(.desktop-ui) :is(#start-welcome,#start-help){display:none}body:not(.desktop-ui) #start-login #login-form{gap:8px}body:not(.desktop-ui) #start-login input{min-height:44px}body:not(.desktop-ui) #start-login #login-submit{min-height:44px}body:not(.desktop-ui) #start-actions{margin-top:8px}body:not(.desktop-ui) #start-links{min-height:48px}}
/* Phone landscape: a two-row bar (id, password, log in / new, guest, invite) so the heads and shoulders stay visible. */
@media (orientation:landscape){body:not(.desktop-ui) #start-screen{background-size:100% 120px,100% 120px,cover}body:not(.desktop-ui) #start-intro{margin-top:max(8px,env(safe-area-inset-top))}body:not(.desktop-ui) #start-story{gap:2px}body:not(.desktop-ui) #start-eyebrow{display:none}body:not(.desktop-ui) #start-title{font-size:34px}body:not(.desktop-ui) #start-subtitle{font-size:12px}body:not(.desktop-ui) #start-card{justify-self:center;width:min(640px,100%);margin:12px 0 4px;padding:10px 14px}body:not(.desktop-ui) :is(#start-welcome,#start-help){display:none}body:not(.desktop-ui) #start-main{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;align-items:end}body:not(.desktop-ui) :is(#start-login,#start-login #login-form,#start-actions){display:contents}body:not(.desktop-ui) #start-login label{gap:2px;font-size:12px}body:not(.desktop-ui) #start-login :is(input,#login-submit){min-height:44px}body:not(.desktop-ui) #start-login #login-status{grid-column:1 / -1;margin:0}body:not(.desktop-ui) #start-invite{grid-column:auto}body:not(.desktop-ui) #start-links{min-height:44px}}
