/* Start menu (js/menu.js): text over a live 3D scene. Sizes hang off one unit, --u (1/100 of a 16:9 frame fitted to the screen). */

/* THE TITLE lockup (.gsl-title) and the palette live in css/brand.css; this file only places it. */

body.in-menu #hud, body.in-menu #touch, body.in-menu #net-ui { display: none; }
body.in-menu.sm-rich #map { filter: saturate(1.25) contrast(1.08); }

#start-menu { position: fixed; inset: 0; z-index: 40; overflow: hidden; color: #fff; font-family: var(--font); --u: min(1vw, 1.78vh);
  --pl: calc(var(--u) * 4 + var(--safe-l, 0px)); --pr: calc(var(--u) * 5 + var(--safe-r, 0px)); --pb: calc(var(--u) * 3.2 + var(--safe-b, 0px));
  transition: opacity .6s ease; overscroll-behavior: contain; }
#start-menu.out { opacity: 0; pointer-events: none; }
#start-menu.parked { visibility: hidden; }
#start-menu * { box-sizing: border-box; }
:where(#start-menu) button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
#start-menu .bebas { font-family: 'Bebas Neue', Impact, 'Arial Narrow', sans-serif; font-weight: 400; letter-spacing: .1em; }

/* the scene is not ready yet: a dark warm gradient stands in, then fades away */
.sm-veil { position: absolute; inset: 0; background: radial-gradient(120% 90% at 30% 25%, #7a4438 0%, #4a2238 42%, #17101c 100%); transition: opacity 1.4s ease; }
#start-menu.scene-in .sm-veil { opacity: 0; }
.sm-grade { position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(270deg, rgba(40, 14, 40, .82) 0%, rgba(40, 14, 40, .4) 46%, rgba(40, 14, 40, 0) 66%), linear-gradient(0deg, rgba(20, 8, 24, .66), rgba(20, 8, 24, 0) 42%); }

#menu-title { position: absolute; right: calc(var(--u) * 4.5 + var(--safe-r, 0px)); top: calc(var(--u) * 3.2 + var(--safe-t, 0px)); animation: sm-rise .7s cubic-bezier(.2, .9, .25, 1) both; }
#menu-title[data-variant="plain"] { right: var(--pr); top: calc(var(--u) * 6 + var(--safe-t, 0px)); }
@keyframes sm-rise { from { opacity: 0; transform: translateY(14px); } }

/* controls hint, top-left in the sky */
.sm-keys { position: absolute; left: var(--pl); top: calc(var(--u) * 3.4 + var(--safe-t, 0px)); margin: 0; display: grid; gap: 3px; font: 700 12px/1.5 ui-monospace, 'SF Mono', Menlo, monospace; letter-spacing: .08em; text-transform: uppercase; text-shadow: var(--on-scene); }
.sm-keys b { display: inline-block; min-width: 20px; margin-right: 3px; padding: 0 5px; text-align: center; color: var(--plum); background: rgba(255, 255, 255, .9); border-radius: 4px; font-weight: 800; text-shadow: none; }
.sm-keys span { margin-left: 4px; }

/* the list */
.sm-list { position: absolute; right: var(--pr); bottom: calc(var(--pb) + var(--u) * 3.6); display: grid; gap: calc(var(--u) * .5); justify-items: end; animation: sm-rise .7s .1s cubic-bezier(.2, .9, .25, 1) both; }
.sm-row { display: block; min-height: calc(var(--u) * 4); padding: 0 calc(var(--u) * 1.6) !important; margin-right: calc(var(--u) * -1.6); font-size: calc(var(--u) * 3.4); line-height: 1.18; text-transform: uppercase; white-space: nowrap; opacity: .86; outline: 0; text-shadow: var(--on-scene); transition: opacity .12s ease; }
.sm-row.on { opacity: 1; background: var(--gold) !important; color: #2a0f2a !important; text-shadow: none; }
.sm-row:focus-visible { box-shadow: 0 0 0 3px #fff; }
.sm-hint { position: absolute; right: var(--pr); bottom: var(--pb); margin: 0; max-width: min(calc(var(--u) * 46), 80vw); text-align: right; font: 600 max(12px, calc(var(--u) * 1.35))/1.35 var(--font); text-shadow: var(--on-scene); }
.sm-row .sm-lock, .sm-row .sm-soon { display: none; }
.sm-row.locked { opacity: .7; cursor: default; }
.sm-row.locked .sm-lock { display: inline-block; width: .5em; height: .5em; margin-right: .3em; vertical-align: .08em; }
.sm-row.locked .sm-soon { display: inline-block; margin-right: .6em; padding: .25em .5em .15em; vertical-align: .32em; font-size: .36em; line-height: 1; letter-spacing: .16em; border: 1.5px solid currentColor; border-radius: 3px; }
.sm-hint.note { color: #fff; opacity: 1; padding: 6px 10px; margin-right: -10px; background: rgba(23, 16, 28, .82); border-left: 3px solid var(--gold); text-align: left; }
.sm-hint a { color: var(--gold); font-weight: 700; text-underline-offset: 3px; }
body.in-menu #map .maplibregl-ctrl-attrib { display: none; } /* the menu's small print carries the attribution */
.sm-hint em { font-style: normal; color: var(--gold); }
.sm-hint em::before { content: ''; display: inline-block; width: 7px; height: 7px; margin: 0 6px 1px 8px; border-radius: 50%; background: #5ff0b5; }

/* bottom-left: who is larping, the maker's link, the small print */
.sm-left { position: absolute; left: var(--pl); bottom: var(--pb); max-width: min(calc(var(--u) * 46), 46vw); display: flex; flex-direction: column; align-items: flex-start; gap: calc(var(--u) * 1.1); animation: sm-rise .7s .2s cubic-bezier(.2, .9, .25, 1) both; }
.sm-who { max-width: calc(var(--u) * 25); font: 700 max(11px, calc(var(--u) * 1.3))/1.4 var(--font); letter-spacing: .1em; text-transform: uppercase; text-shadow: var(--on-scene); }
.sm-who b { display: block; font-size: max(16px, calc(var(--u) * 2.3)); font-weight: 800; letter-spacing: .01em; text-transform: none; line-height: 1.15; overflow: hidden; text-overflow: ellipsis; }
.sm-who-acts { display: flex; gap: 4px 16px; margin-top: 2px; white-space: nowrap; }
.sm-link { min-height: 28px; font: 700 max(12px, calc(var(--u) * 1.3))/1 var(--font) !important; letter-spacing: .04em; text-transform: none; color: var(--gold) !important; text-decoration: underline; text-underline-offset: 3px; text-shadow: var(--on-scene); }
.sm-link:focus-visible, .sm-x:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.sm-x, .mk-cert { display: inline-flex; align-items: center; text-decoration: none; }
.sm-x { gap: max(8px, calc(var(--u) * 1.1)); min-height: 36px; padding: 4px max(14px, calc(var(--u) * 1.8)) 4px 5px; color: #fff; background: rgba(23, 16, 28, .82); border: max(1.5px, calc(var(--u) * .25)) solid rgba(255, 255, 255, .5); border-radius: 99px; font: 700 max(12px, calc(var(--u) * 1.5))/1.2 ui-monospace, 'SF Mono', Menlo, monospace; }
.mk-av { position: relative; flex: none; display: block; width: 28px; height: 28px; }
.mk-av img { display: block; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .85); }
.mk-av i { position: absolute; right: -5px; bottom: -4px; display: grid; place-items: center; box-sizing: border-box; width: 15px; height: 15px; padding: 0; border: 0; border-radius: 50%; background: #fff; color: #17101c; box-shadow: 0 0 0 1.5px #17101c; font: 900 9px/1 Arial, sans-serif; font-style: normal; }
.mk-av.nopic i { position: static; width: 100%; height: 100%; box-shadow: none; font-size: 15px; } /* the photo did not load: the X mark alone */
.sm-x .mk-t b, .mk-cert .mk-t b { font-weight: 700; }
.sm-x .mk-t b { color: var(--gold); }
.mk-cert { gap: 10px; min-height: 28px; color: var(--muted, #6f6a60); font: 600 11px/1.2 var(--font); }
.mk-cert .mk-av { width: 22px; height: 22px; } .mk-cert .mk-av img { box-shadow: 0 0 0 1.5px var(--ink, #2b2a33); } .mk-cert .mk-av i { width: 12px; height: 12px; font-size: 7px; right: -4px; bottom: -3px; }
.mk-cert .mk-t b { color: var(--ink, #2b2a33); }
body.touch .mk-cert { min-height: 44px; }
.sm-foot { margin: 0; font: 500 max(10px, calc(var(--u) * 1.05))/1.35 var(--font); opacity: .9; text-shadow: var(--on-scene); }

/* sub-screens: one compact panel over the scene */
.sm-panel { position: absolute; right: var(--pr); bottom: var(--pb); width: min(440px, calc(100vw - 32px)); max-height: calc(100% - var(--pb) - 16px - var(--safe-t, 0px)); overflow: auto; -webkit-overflow-scrolling: touch; padding: 18px 20px 16px;
  background: rgba(23, 16, 28, .9); border: 2px solid rgba(255, 210, 122, .55); border-radius: 4px; box-shadow: 0 18px 50px rgba(10, 4, 14, .5); animation: sm-rise .25s ease both; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.sm-panel h2 { margin: 0; font-size: 34px; line-height: 1; color: var(--gold); text-transform: uppercase; }
.sm-panel .sm-sub { margin: 4px 0 14px; font-size: 13.5px; line-height: 1.35; opacity: .85; }
.sm-field { display: block; margin-top: 12px; }
.sm-field > span, .sm-set > span { display: block; margin-bottom: 5px; font: 800 11px/1.2 var(--font); letter-spacing: .14em; text-transform: uppercase; opacity: .8; }
.sm-field input { width: 100%; height: 48px; padding: 0 12px; font: 700 18px var(--font); color: #fff; background: rgba(255, 255, 255, .08); border: 0; border-bottom: 2px solid var(--gold); border-radius: 3px 3px 0 0; outline: 0; }
.sm-field input::placeholder { color: var(--text-faint); font-weight: 500; }
.sm-field input:focus { background: rgba(255, 255, 255, .16); }
.sm-field input.shake { animation: sm-shake .35s; border-color: #ff7a59; }
@keyframes sm-shake { 25% { transform: translateX(-5px); } 50% { transform: translateX(5px); } 75% { transform: translateX(-3px); } }
#menu-join { letter-spacing: .3em; text-transform: uppercase; font-size: 22px; }
.sm-seg { display: flex; flex-wrap: wrap; gap: 6px; }
.sm-seg button { min-height: 44px; padding: 0 14px !important; font-size: 19px; line-height: 44px; text-transform: uppercase; background: rgba(255, 255, 255, .1) !important; opacity: .85; }
.sm-seg button.on { background: var(--gold) !important; color: #2a0f2a !important; opacity: 1; }
.sm-seg button:focus-visible, .sm-btn:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.sm-set { margin-top: 12px; }
.sm-set small { display: block; margin-top: 5px; font-size: 12px; line-height: 1.35; opacity: .75; }
.sm-code { display: flex; gap: 5px; margin-top: 14px; }
.sm-code span { display: grid; place-items: center; width: 42px; height: 52px; background: rgba(255, 255, 255, .1); border-bottom: 2px solid var(--gold); font: 400 32px/1 'Anton', Impact, sans-serif; }
.sm-pane p { margin: 10px 0 2px; font-size: 13.5px; opacity: .85; }
.sm-pane .sm-acts { display: flex; gap: 18px; }
.sm-pane .sm-link { min-height: 44px; font-size: 13.5px !important; }
.sm-btns { display: flex; gap: 8px; margin-top: 16px; }
.sm-btn { min-height: 48px; padding: 0 16px !important; font-size: 22px; line-height: 48px; text-transform: uppercase; background: rgba(255, 255, 255, .12) !important; white-space: nowrap; }
.sm-btn.primary { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; background: var(--gold) !important; color: #2a0f2a !important; }
.sm-btn.danger { width: 100%; background: transparent !important; border: 2px dashed rgba(255, 255, 255, .5) !important; font-size: 19px; }
.sm-btn.danger.armed { background: #ff5a36 !important; border-style: solid !important; border-color: #ff5a36 !important; }
.sm-note { min-height: 17px; margin: 9px 0 0; font-size: 12.5px; font-weight: 600; opacity: .85; }
.sm-note.err { color: #ffa28a; opacity: 1; }
@media (hover: hover) { .sm-row:not(.on):hover { opacity: 1; } .sm-seg button:not(.on):hover, .sm-btn:not(.primary):hover { background: rgba(255, 255, 255, .2) !important; } .sm-btn.primary:hover { background: #ffe0a3 !important; } }

/* touch: 44 px targets */
@media (pointer: coarse) { .sm-row { min-height: 44px; line-height: 44px; } .sm-link { min-height: 44px; } .sm-x { min-height: 44px; } .sm-keys { display: none; } }
body.touch .sm-row { min-height: 44px; line-height: 44px; } body.touch .sm-link, body.touch .sm-x { min-height: 44px; } body.touch .sm-keys { display: none; }
@media (max-width: 900px) { .sm-keys { display: none; } }

/* phone, upright: title across the top, founder behind and above the list, small print under everything */
@media (orientation: portrait) and (max-width: 700px) {
  #start-menu { --u: 2.15vw; --pl: calc(16px + var(--safe-l, 0px)); --pr: calc(18px + var(--safe-r, 0px)); --pb: calc(12px + var(--safe-b, 0px)); }
  #menu-title { --tu: calc(var(--u) * .86); right: 50%; margin-right: calc(var(--tu) * -21); top: calc(14px + var(--safe-t, 0px)); }
  #menu-title[data-variant="plain"] { right: var(--pr); margin-right: 0; }
  .sm-grade { background: linear-gradient(0deg, rgba(20, 8, 24, .9) 0%, rgba(30, 10, 32, .6) 34%, rgba(40, 14, 40, 0) 58%), linear-gradient(180deg, rgba(40, 14, 40, .45), rgba(40, 14, 40, 0) 30%); }
  .sm-list { bottom: calc(var(--pb) + 96px); gap: 2px; }
  .sm-row { font-size: 29px; padding: 0 12px !important; margin-right: -12px; }
  .sm-hint { bottom: calc(var(--pb) + 56px); height: 34px; max-width: calc(100vw - 34px); font-size: 12.5px; display: flex; align-items: flex-end; justify-content: flex-end; }
  .sm-left { max-width: none; right: var(--pr); bottom: var(--pb); gap: 6px; }
  .sm-left .sm-who { position: fixed; left: var(--pl); bottom: calc(var(--pb) + 334px); max-width: calc(100vw - 32px); font-size: 11px; }
  .sm-left .sm-x { position: fixed; left: var(--pl); bottom: calc(var(--pb) + 286px); font-size: 12px; }
  .sm-left [data-act="board"] { position: relative; z-index: 1; display: inline-flex; align-items: center; margin-bottom: -12px; font-size: 12px !important; } /* feedback board link: sits between the hint and the small print; the 44px hit area spills over the small print */
  .sm-foot { font-size: 10px; }
  .sm-panel { left: 12px; right: 12px; width: auto; bottom: var(--pb); padding: 16px 16px 14px; }
}
/* phone, sideways: everything shrinks to the short side; the list keeps 44 px rows */
@media (orientation: landscape) and (max-height: 500px) {
  #start-menu { --pb: calc(8px + var(--safe-b, 0px)); }
  #menu-title { top: calc(6px + var(--safe-t, 0px)); --tu: calc(var(--u) * .82); }
  .sm-list { bottom: calc(var(--pb) + 22px); gap: 0; }
  .sm-row { font-size: 24px; }
  .sm-hint { font-size: 11.5px; max-width: 52vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .sm-left { gap: 5px; max-width: 44vw; } .sm-who { max-width: none; white-space: nowrap; }
  .sm-foot { font-size: 9.5px; }
  .sm-panel { bottom: var(--pb); max-height: calc(100% - var(--pb) - 8px); padding: 10px 16px 10px; width: min(430px, 56vw); }
  .sm-panel h2 { font-size: 26px; } .sm-panel .sm-sub { margin-bottom: 4px; font-size: 12.5px; }
  .sm-field, .sm-set { margin-top: 7px; } .sm-btns { margin-top: 10px; } .sm-code { margin-top: 8px; } .sm-code span { height: 44px; }
}
@media (orientation: portrait) and (max-width: 700px), (orientation: landscape) and (max-height: 500px) { #start-menu.has-panel #menu-title { visibility: hidden; } }
@media (prefers-reduced-motion: reduce) { #menu-title, .sm-list, .sm-left, .sm-panel { animation: none; } .sm-veil { transition-duration: .01s; } }
