/* Main menu, final layer: gilt lettering and brass on verdigris lacquer, set into the keeper's
   workshop (the specimen-jar backdrop, Verdigris grade). Loaded last; rules are scoped to the
   home screen (and the boot state before it) so other screens are untouched. The layout editor
   positions groups with translate/scale, which the entrance animations (transform/opacity)
   compose with rather than override. */

/* ---- first paint: the poster (a baked still of the drained jar), then the live jar over it ---- */
html,body:not([data-phase]),body[data-phase="home"]{background:#0c0e14}
.menu-poster{position:fixed;inset:0;z-index:2;pointer-events:none;transition:opacity 1.2s cubic-bezier(.4,0,.2,1)}
.menu-poster img{position:absolute;inset:0;display:block;width:100%;height:100%;object-fit:cover;user-select:none}
/* The still is baked without the live grade's lens vignette (its frame is wider than any screen);
   this redraws that vignette for the screen it lands on (radius in screen heights; stops measured
   from the live grade with and without it, tools/menu-workshop/render-poster.mjs --keep-vignette). */
.menu-poster:after{content:'';position:absolute;inset:0;
 background:radial-gradient(circle at 50% 50%,rgba(0,0,0,0) 38vh,rgba(0,0,0,.0125) 42.5vh,rgba(0,0,0,.029) 47.5vh,rgba(0,0,0,.049) 52.5vh,rgba(0,0,0,.086) 57.5vh,
  rgba(0,0,0,.118) 62.5vh,rgba(0,0,0,.164) 67.5vh,rgba(0,0,0,.225) 72.5vh,rgba(0,0,0,.265) 77.5vh,rgba(0,0,0,.29) 82.5vh,rgba(0,0,0,.3) 97.5vh)}
.menu-poster.retiring{opacity:0}
.menu-poster.retired{display:none}
.menu-specimen{position:fixed;inset:0;width:100%;height:100%;display:block;z-index:2;opacity:0;pointer-events:none;transition:opacity 1.2s cubic-bezier(.4,0,.2,1)}
.menu-specimen.visible{opacity:1}
body.reduced-motion .menu-specimen,body.reduced-motion .menu-poster{transition-duration:.15s}

/* boot status: only while nothing else can show (the app's first moment, or a restored match) */
#loading.boot-status{position:fixed;left:50%;bottom:clamp(26px,6.5vh,110px);z-index:4;transform:translateX(-50%);display:flex;flex-direction:column;align-items:center;gap:clamp(8px,1vh,20px);
 pointer-events:none;font:italic 400 clamp(13px,.86vw,32px)/1.3 "Palatino Linotype","Book Antiqua",Palatino,Georgia,serif;letter-spacing:.03em;color:#e9e2c6;text-shadow:0 1px 10px rgba(0,0,0,.85);transition:opacity .6s ease}
#loading .loading-message{display:block;height:auto;max-width:none;margin:0;color:inherit;font:inherit}
#loading .loading-track{position:relative;width:clamp(150px,12vw,480px);height:1px;border:0;overflow:visible;background:linear-gradient(90deg,transparent,rgba(232,193,122,.3) 18%,rgba(232,193,122,.3) 82%,transparent)}
#loading .loading-track span{display:block;height:1px;width:calc(var(--boot-progress,0) * 100%);animation:none;background:linear-gradient(90deg,rgba(232,193,122,0),#e8c17a 40%,#fff3cf);box-shadow:0 0 9px rgba(255,214,140,.7);transition:width .45s ease}
#loading.ready,body[data-phase="home"] #loading{opacity:0}
body.awaiting-world #loading{opacity:1}
body.awaiting-world #app{opacity:0;pointer-events:none;transition:opacity .3s}

body[data-phase="home"]{
 --display:"Palatino Linotype","Book Antiqua",Palatino,"Iowan Old Style",Georgia,serif;
 --gilt-hi:#fff3cf;--gilt:#e8c17a;--gilt-deep:#a9763b;
 --ink:#f2ead2;--ink-soft:#cdc6a8;--ink-faint:#959aa6;
 --hair:rgba(232,193,122,.42);
 /* verdigris lacquer: deep blue-green under brass */
 --lacquer-top:rgba(19,27,44,.9);--lacquer-bottom:rgba(6,10,19,.93);
 --lacquer-lit-top:rgba(28,38,61,.93);--lacquer-lit-bottom:rgba(10,15,26,.95);
 --panel-top:rgba(14,19,30,.88);--panel-bottom:rgba(5,8,15,.92);
 --well:rgba(3,5,10,.62);
}

/* ---- legibility: a verdigris shade pooling from the left, a soft lens vignette ---- */
.screen.home{background:none!important}
.screen.home:before{content:'';position:absolute;inset:0;pointer-events:none;z-index:0;
 background:radial-gradient(ellipse 60% 105% at 0% 48%,rgba(4,6,10,.86) 0%,rgba(6,8,14,.54) 42%,rgba(6,8,14,0) 74%),linear-gradient(0deg,rgba(3,5,9,.5),transparent 24%)}
.screen.home:after{background:radial-gradient(ellipse 120% 95% at 60% 45%,transparent 58%,rgba(2,4,7,.5))!important;box-shadow:none!important}

/* ---- title: gilt lettering, a struck rule, letterspaced motto ---- */
.screen.home .home-title{left:6.4%;top:10.5%;width:42%;z-index:2;display:flex;flex-direction:column;align-items:flex-start;text-align:left}
/* the gilt is painted through the glyphs (background-clip:text), so the box must reach the
   descender of the p; the extra padding is taken back with a negative margin */
.screen.home .home-title h1{order:1;margin:0 0 -.23em;padding:0 .04em .3em 0;font:400 clamp(64px,7.4vw,290px)/.92 var(--display);letter-spacing:-.012em;
 background:linear-gradient(176deg,#fff6d8 0%,#f3d695 22.7%,#cf9a52 43.8%,#f7dfa0 56.8%,#b07a3a 81.1%,#94632e 100%);-webkit-background-clip:text;background-clip:text;color:transparent;text-shadow:none;
 filter:drop-shadow(0 2px 0 rgba(5,8,15,.66)) drop-shadow(0 12px 26px rgba(0,0,0,.55))}
.screen.home .home-title h1:before{display:none}
.screen.home .home-title:after{content:'';order:2;display:block;width:clamp(210px,15.5vw,620px);height:12px;margin:clamp(8px,1vh,28px) 0 clamp(8px,1vh,26px) .12em;
 background:radial-gradient(circle,var(--gilt) 0 2.2px,transparent 2.8px) 50% 50%/12px 12px no-repeat,
  linear-gradient(90deg,transparent,var(--hair) 14%,var(--gilt) 44%,transparent 45.5%,transparent 54.5%,var(--gilt) 56%,var(--hair) 86%,transparent) 50% 50%/100% 1px no-repeat}
.screen.home .home-title .eyebrow{order:3;margin:0 0 0 .2em;padding:0;font:500 clamp(11px,.78vw,30px)/1.3 var(--display);letter-spacing:.46em;text-transform:uppercase;color:var(--ink-soft);text-shadow:0 1px 8px rgba(0,0,0,.7)}

/* ---- the menu: an index ruled in gilt ---- */
.screen.home .home-menu{left:6.4%;top:41%;width:clamp(320px,24.5vw,980px);max-width:none;z-index:3;display:flex;flex-direction:column;align-items:stretch;gap:0!important;
 padding:clamp(4px,.4vh,12px) 0 clamp(4px,.4vh,12px) clamp(18px,1.4vw,54px)!important;border:0!important;border-left:1px solid transparent!important;
 border-image:linear-gradient(180deg,transparent,var(--hair) 12%,var(--hair) 88%,transparent) 1!important;background:none!important;box-shadow:none!important;overflow:visible!important}

/* primary: a brass-bound lacquer plate with gilt corners and an arrow medallion */
.screen.home .home-menu .menu-button.primary{position:relative;display:flex;align-items:center;justify-content:space-between;gap:1em;width:100%;min-height:0;margin:0;
 padding:clamp(15px,1.6vh,42px) clamp(20px,1.5vw,54px);text-align:left;clip-path:none;border-radius:3px;
 font:500 clamp(21px,1.55vw,62px)/1.05 var(--display);font-variant:small-caps;letter-spacing:.05em;color:var(--ink)!important;text-shadow:0 1px 0 rgba(0,0,0,.65);
 border:1px solid rgba(232,193,122,.55)!important;
 background:radial-gradient(120% 150% at 0% 0%,rgba(255,200,120,.09),transparent 55%),linear-gradient(180deg,var(--lacquer-top),var(--lacquer-bottom))!important;
 box-shadow:inset 0 1px 0 rgba(255,230,175,.22),inset 0 0 0 3px var(--well),inset 0 0 0 4px rgba(232,193,122,.16),0 16px 36px rgba(0,0,0,.5)!important;
 transition:border-color .25s,box-shadow .25s,background .25s,transform .2s}
.screen.home .home-menu .menu-button.primary:before{content:'';position:absolute;inset:6px;pointer-events:none;opacity:.75;
 background:linear-gradient(var(--gilt),var(--gilt)) top left/10px 1px no-repeat,linear-gradient(var(--gilt),var(--gilt)) top left/1px 10px no-repeat,
  linear-gradient(var(--gilt),var(--gilt)) top right/10px 1px no-repeat,linear-gradient(var(--gilt),var(--gilt)) top right/1px 10px no-repeat,
  linear-gradient(var(--gilt),var(--gilt)) bottom left/10px 1px no-repeat,linear-gradient(var(--gilt),var(--gilt)) bottom left/1px 10px no-repeat,
  linear-gradient(var(--gilt),var(--gilt)) bottom right/10px 1px no-repeat,linear-gradient(var(--gilt),var(--gilt)) bottom right/1px 10px no-repeat}
.screen.home .home-menu .menu-button.primary:after{content:'';position:static;flex:0 0 auto;width:1.4em;height:1.4em;border-radius:50%;transform:none;opacity:1;
 border:1px solid rgba(232,193,122,.7);
 background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12h13M13 6l6 6-6 6' fill='none' stroke='%23e8c17a' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/58% no-repeat,radial-gradient(circle,rgba(232,193,122,.2),transparent 70%);
 transition:transform .25s,border-color .25s}
.screen.home .home-menu .menu-button.primary:hover,.screen.home .home-menu .menu-button.primary:focus-visible,body[data-entering] .screen.home .home-menu .menu-button.primary{border-color:rgba(255,214,140,.92)!important;
 background:radial-gradient(120% 150% at 0% 0%,rgba(255,200,120,.18),transparent 60%),linear-gradient(180deg,var(--lacquer-lit-top),var(--lacquer-lit-bottom))!important;
 box-shadow:inset 0 1px 0 rgba(255,230,175,.3),inset 0 0 0 3px var(--well),inset 0 0 0 4px rgba(232,193,122,.26),0 16px 36px rgba(0,0,0,.5),0 0 40px rgba(255,170,80,.16)!important;padding-left:clamp(20px,1.5vw,54px)}
.screen.home .home-menu .menu-button.primary:hover:after,.screen.home .home-menu .menu-button.primary:focus-visible:after{transform:translateX(4px);border-color:var(--gilt-hi)}
.screen.home .home-menu .menu-button.primary:active{transform:translateY(1px)}
body[data-phase="home"] .screen.home button:focus-visible,body[data-phase="home"] .screen.home input:focus-visible{outline:2px solid var(--gilt-hi)!important;outline-offset:3px}
/* while the Hollow Ring loads, a gilt hairline charges along the plate's inner edge */
.screen.home .home-menu .menu-button.primary .plate-progress{position:absolute;left:7px;right:7px;bottom:7px;height:1px;pointer-events:none;opacity:0;transition:opacity .8s ease .5s}
.screen.home .home-menu .menu-button.primary .plate-progress:before{content:'';position:absolute;left:0;top:0;height:1px;width:calc(var(--world-progress,0) * 100%);
 background:linear-gradient(90deg,rgba(232,193,122,0),var(--gilt) 45%,var(--gilt-hi));box-shadow:0 0 10px rgba(255,214,140,.6);transition:width .6s ease}
body[data-world="loading"] .screen.home .home-menu .menu-button.primary .plate-progress{opacity:1;transition-delay:0s}
/* ...and a line beneath it says so, then resolves. It takes no space of its own (it sits in the
   gap above the room code), so nothing moves when it goes. */
.screen.home .home-menu .world-status{position:relative;height:0;margin:0;padding:0;overflow:visible;
 font:italic 400 clamp(11px,.72vw,28px)/1 var(--display);letter-spacing:.04em;color:var(--ink-soft);text-shadow:0 1px 8px rgba(0,0,0,.7)}
.screen.home .home-menu .world-status span{display:none;position:absolute;left:.3em;top:clamp(7px,.8vh,20px);white-space:nowrap}
body[data-world="loading"] .screen.home .home-menu .world-status .world-loading{display:inline;animation:status-breathe 2.6s ease-in-out infinite}
body[data-world="ready"] .screen.home .home-menu .world-status .world-ready{display:inline;color:var(--gilt);animation:status-resolve 3.6s ease forwards}
body[data-entering] .screen.home .home-menu .world-status .world-loading{color:var(--gilt)}
@keyframes status-breathe{0%,100%{opacity:.55}50%{opacity:1}}
@keyframes status-resolve{0%{opacity:0}12%{opacity:1}72%{opacity:1}100%{opacity:0}}

/* room code: a ledger line with a brass tab */
.screen.home .home-menu .join-row{display:grid!important;grid-template-columns:minmax(0,1fr) auto;grid-template-areas:'label label' 'code join';align-items:end;column-gap:clamp(8px,.6vw,22px);row-gap:clamp(2px,.3vh,10px);width:100%;margin:clamp(32px,3.6vh,92px) 0 0!important;padding:0!important;background:none!important;border:0!important;box-shadow:none!important}
.screen.home .home-menu .join-row label{grid-area:label;padding-bottom:0;font:500 clamp(10px,.66vw,26px)/1.2 var(--display);font-style:normal;letter-spacing:.26em;text-transform:uppercase;color:var(--ink-faint)}
.screen.home .home-menu .join-row input{grid-area:code;min-width:0;width:auto;height:auto;padding:.3em .15em .3em;font:500 clamp(15px,1vw,40px)/1 var(--display);letter-spacing:.28em;text-transform:uppercase;color:var(--ink);
 background:transparent!important;border:0!important;border-bottom:1px dashed rgba(232,193,122,.55)!important;border-radius:0;box-shadow:none!important;outline-offset:6px}
.screen.home .home-menu .join-row input::placeholder{color:rgba(205,198,168,.42);font-style:italic;font-weight:400;letter-spacing:.08em;text-transform:none}
.screen.home .home-menu .join-row input:focus{border-bottom-style:solid!important;border-bottom-color:var(--gilt)!important}
.screen.home .home-menu .join-row button{grid-area:join;min-height:0;padding:.42em 1em!important;font:500 clamp(13px,.86vw,34px)/1 var(--display);font-variant:small-caps;font-style:normal;letter-spacing:.08em;text-decoration:none!important;
 color:var(--gilt)!important;background:linear-gradient(180deg,var(--lacquer-top),var(--lacquer-bottom))!important;border:1px solid rgba(232,193,122,.45)!important;border-radius:2px;box-shadow:inset 0 1px 0 rgba(255,230,175,.18)}
.screen.home .home-menu .join-row button:hover{color:var(--gilt-hi)!important;border-color:var(--gilt)!important}

/* secondary links: an index of entries with gilt lozenges */
.screen.home .home-menu .home-links{display:flex!important;flex-direction:column;align-items:flex-start;gap:clamp(3px,.5vh,14px);width:100%;margin:clamp(22px,3vh,74px) 0 0!important;padding:0!important;border:0!important}
.screen.home .home-menu .home-links button{position:relative;min-height:0;padding:.22em 0 .22em 1.35em!important;background:none!important;border:0!important;box-shadow:none!important;
 font:italic 400 clamp(15px,1.02vw,40px)/1.25 var(--display)!important;letter-spacing:.01em;color:var(--ink-soft)!important;text-align:left;text-shadow:0 1px 8px rgba(0,0,0,.6);transition:color .2s,transform .2s}
.screen.home .home-menu .home-links button:before{content:'';position:absolute;left:.18em;top:50%;width:.34em;height:.34em;border:1px solid var(--gilt-deep);transform:translateY(-50%) rotate(45deg);transition:background .2s,border-color .2s}
.screen.home .home-menu .home-links button:hover,.screen.home .home-menu .home-links button:focus-visible{color:var(--ink)!important;transform:translateX(3px);background:none!important}
.screen.home .home-menu .home-links button:hover:before,.screen.home .home-menu .home-links button:focus-visible:before{background:var(--gilt);border-color:var(--gilt)}
.screen.home .unlock-ready-count{display:inline-grid;place-items:center;min-width:1.45em;height:1.45em;margin-left:.45em;padding:0 .35em;border-radius:1em;font:600 .62em/1 var(--display);font-style:normal;color:#24160a;background:linear-gradient(180deg,#f6dc9e,#c9934c);vertical-align:.18em}

/* ---- the placard: names the specimen once it has taken shape (filled in by the backdrop) ---- */
.screen.home .overlook-caption{position:absolute;left:auto;top:auto;right:clamp(20px,3vw,120px);bottom:clamp(20px,4.6vh,140px);z-index:3;display:flex;flex-direction:column;align-items:center;gap:.12em;
 min-width:clamp(190px,13vw,520px);padding:clamp(12px,1.25vh,36px) clamp(18px,1.3vw,50px) clamp(13px,1.35vh,38px);text-align:center;
 font:italic 400 clamp(17px,1.15vw,46px)/1.15 var(--display);color:var(--ink);text-shadow:none;letter-spacing:.01em;
 background:linear-gradient(180deg,var(--panel-top),var(--panel-bottom));border:1px solid rgba(232,193,122,.45);border-radius:2px;
 box-shadow:inset 0 0 0 3px var(--well),inset 0 0 0 4px rgba(232,193,122,.14),0 18px 40px rgba(0,0,0,.5)}
.screen.home .overlook-caption.placard-pending{display:none}
.screen.home .overlook-caption small{display:block;margin-top:.4em;font:500 clamp(9px,.56vw,22px)/1.3 var(--display);font-style:normal;letter-spacing:.3em;text-transform:uppercase;color:var(--ink-faint)}
.screen.home .overlook-caption .placard-kicker{font:500 clamp(9px,.56vw,22px)/1.2 var(--display);font-style:normal;letter-spacing:.32em;text-transform:uppercase;color:var(--ink-faint)}
.screen.home .overlook-caption .placard-name{display:block;padding:.05em .1em .12em;font:italic 500 clamp(24px,1.7vw,68px)/1.06 var(--display);
 background:linear-gradient(176deg,#fff2cc,#ecc278 58%,#b98443);-webkit-background-clip:text;background-clip:text;color:transparent}
.screen.home .overlook-caption .placard-sub{display:flex;align-items:center;gap:.7em;font:500 clamp(11px,.7vw,28px)/1.2 var(--display);font-style:normal;font-variant:small-caps;letter-spacing:.18em;color:var(--gilt)}
.screen.home .overlook-caption .placard-sub:before,.screen.home .overlook-caption .placard-sub:after{content:'';width:clamp(14px,1.1vw,44px);height:1px;background:linear-gradient(90deg,transparent,var(--hair))}
.screen.home .overlook-caption .placard-sub:after{background:linear-gradient(90deg,var(--hair),transparent)}
.screen.home .overlook-caption .placard-origin{margin-top:.2em;font:italic clamp(11px,.72vw,28px)/1.2 var(--display);color:var(--ink-soft)}

/* ---- top tools on the menu: brass rings ---- */
body[data-phase="home"] .topbar{background:none!important}
body[data-phase="home"] .topbar .icon-button{display:grid;place-items:center;width:clamp(36px,2.15vw,84px);height:clamp(36px,2.15vw,84px);padding:0;border-radius:50%;
 color:var(--gilt)!important;border:1px solid rgba(232,193,122,.45)!important;background:radial-gradient(circle at 50% 30%,var(--lacquer-lit-top),var(--lacquer-bottom))!important;
 box-shadow:inset 0 1px 0 rgba(255,230,175,.2),0 6px 16px rgba(0,0,0,.45)!important;transition:border-color .2s,box-shadow .2s,color .2s}
body[data-phase="home"] .topbar .icon-button .icon{width:52%;height:52%}
body[data-phase="home"] .topbar .icon-button:hover,body[data-phase="home"] .topbar .icon-button:focus-visible{color:var(--gilt-hi)!important;border-color:var(--gilt)!important;box-shadow:inset 0 1px 0 rgba(255,230,175,.3),0 6px 16px rgba(0,0,0,.45),0 0 22px rgba(255,170,80,.22)!important}
body[data-phase="home"] .connection-note{font:italic clamp(13px,.78vw,30px)/1.3 var(--display);letter-spacing:.02em;color:var(--ink-soft);background:linear-gradient(180deg,var(--panel-top),var(--panel-bottom))!important;border:1px solid rgba(232,193,122,.38)!important;border-radius:2px;box-shadow:0 10px 26px rgba(0,0,0,.45)!important}
body[data-phase="home"] .toast{font-family:var(--display);color:var(--ink);background:linear-gradient(180deg,var(--panel-top),var(--panel-bottom));border:1px solid rgba(232,193,122,.4);box-shadow:0 12px 30px rgba(0,0,0,.5)}

/* ---- arrival: lettering settles in; the placard arrives with its specimen ---- */
@keyframes home-rise{from{opacity:0;transform:translateY(16px)}to{opacity:1;transform:none}}
@keyframes home-fade{from{opacity:0}to{opacity:1}}
@keyframes placard-in{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:none}}
.screen.home.arriving .home-title{animation:home-rise 1.1s .15s cubic-bezier(.2,.7,.2,1) both}
.screen.home.arriving .home-menu>*{animation:home-rise .9s cubic-bezier(.2,.7,.2,1) both}
.screen.home.arriving .home-menu>:nth-child(1){animation-delay:.45s}
.screen.home.arriving .home-menu>:nth-child(2){animation-delay:.55s}
.screen.home.arriving .home-menu>:nth-child(3){animation-delay:.65s}
.screen.home.arriving .home-menu>:nth-child(4){animation-delay:.8s}
.screen.home.arriving .overlook-caption{animation:home-fade 1.4s 1s both}
.screen.home .overlook-caption.specimen-placard,.screen.home.arriving .overlook-caption.specimen-placard{animation:placard-in 1.2s .1s cubic-bezier(.2,.7,.2,1) both}
body.reduced-motion .screen.home *,body.reduced-motion .screen.home{animation:none!important;transition-duration:.01s!important}
@media (prefers-reduced-motion:reduce){.screen.home *,.screen.home{animation:none!important}}

/* ---- short desktops ---- */
@media(max-height:700px) and (min-width:761px){
 .screen.home .home-title{top:7%}
 .screen.home .home-title h1{font-size:clamp(54px,6.2vw,200px)}
 .screen.home .home-menu{top:38%}
 .screen.home .home-menu .join-row{margin-top:24px!important}
 .screen.home .home-menu .home-links{margin-top:14px!important}
 .screen.home .overlook-caption{bottom:14px;right:16px}
}
