/* The snowy exterior and the sorting room share their logo, type and audio. */
#entry {
  position: fixed; inset: 0; z-index: 55; isolation: isolate; overflow: auto;
  color: #fff7dd; background: #071c41; overscroll-behavior: contain;
  transition: opacity .65s ease; font-family: 'Chakra Petch', system-ui, sans-serif;
}
html.at-gate #hud, html.at-gate #curtain, html.entered-from-porch #curtain { visibility: hidden; }
html.at-gate #a2hs { z-index: 60; }
html.at-gate #a2hs .setp { max-height: 90dvh; overflow-y: auto; overscroll-behavior: contain; }
.entryScene,.entryShade,.entryWeather { position: absolute; inset: 0; pointer-events: none; }
.entryScene { background: url('../assets/entrance.webp') 58% 48% / cover no-repeat; }
.entryShade { background: linear-gradient(90deg, #061537b8, #071a3a5c 32%, transparent 58%),linear-gradient(0deg,#05143177,transparent 23%); }
.entryContent { position: relative; min-height: 100%; width: 43%; max-width: 800px; box-sizing: border-box; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: max(18px,env(safe-area-inset-top)) 0 max(18px,env(safe-area-inset-bottom)) max(18px,env(safe-area-inset-left)); gap: clamp(18px,4.2vh,44px); }
.entryBrand { width: 100%; }
.entryBrand h1 { margin: 0 auto; width: 94%; max-width: 550px; line-height: 0; }
.entryBrand img { width: 100%; height: auto; filter: drop-shadow(0 7px 12px #030e2a9c); }
.entryBrand p { margin: .4rem 10px 0; font: 600 clamp(16px,1.45vw,23px)/1.3 'Fraunces',Georgia,serif; color: #fff2d3; text-shadow: 0 2px 5px #03132f,0 0 12px #081735; }
.entryActions { display: flex; flex-direction: column; align-items: center; gap: .7rem; }
#entry button { touch-action: manipulation; cursor: pointer; -webkit-tap-highlight-color: transparent; }
#entryBegin { position: relative; isolation:isolate; overflow:hidden; width: max-content; max-width: 94vw; display: inline-flex; align-items: center; justify-content: center; gap: .54em; min-height: 56px; padding: .55em 1.32em; border: 2px solid #ffdf89; border-radius: 100px; color: #fff6d3; background: linear-gradient(180deg,#d84041 0%,#ac1d32 49%,#85152b 52%,#a92735 100%); font: 600 clamp(20px,2vw,29px)/1.18 'Fraunces',Georgia,serif; text-shadow: 0 2px 1px #731c27; box-shadow: inset 0 0 0 2px #9d462c,inset 0 0 0 3px #ffce7c9c, 0 4px 0 #633725,0 8px 18px #05122b94; transition: transform .18s,box-shadow .18s; }
#entryBegin::after { content:''; position:absolute; inset:0; pointer-events:none; background:linear-gradient(110deg,transparent 39%,#fff8bd38 50%,transparent 60%); transform:translateX(-125%); animation:entryPolish 8s ease-in-out 2s infinite; }
#entryBegin svg { width: 1.15em; height: 1em; color:#ffdd86; }
@media (hover:hover) { #entryBegin:hover { transform: translateY(-2px); box-shadow:inset 0 0 0 2px #a45c37,0 5px 0 #693621,0 9px 25px #ffd78644; } }
#entryBegin:active { transform:translateY(2px); }
#entry button:focus-visible,#entry a:focus-visible { outline: 3px solid #fff1ab; outline-offset: 4px; }
#entryFullRow { display:flex; flex-direction:column; align-items:center; gap:0; }
#entryFullHint,#entryStatus { font: 600 14px/1.3 'Chakra Petch',system-ui,sans-serif; margin:0; color:#fff6e5; text-shadow:0 1px 3px #000,0 1px 8px #07132f; }
#entryFullHint { margin:3px 8px 0; }
#entryFull { display:flex; align-items:center; justify-content:center; gap:.48em; min-height:44px; padding:0 .75em; background:transparent; color:#fff0b4; border:0; font:700 15px/1.15 'Chakra Petch',system-ui,sans-serif; text-shadow:0 1px 4px #020c20; }
#entryFull:hover span { text-decoration:underline; text-underline-offset:3px; }
#entryFull svg { width:16px; height:16px; }
#entryStatus:empty { display:none; }
#entryClassic { color:#ffdf85; text-underline-offset:3px; }
.entryBrowserTip {
  position: fixed; top: max(20px, var(--safeT)); right: max(20px, var(--safeR));
  display: flex; align-items: center; gap: 12px; box-sizing: border-box;
  max-width: min(390px, 50vw); padding: 10px 5px 10px 15px;
  border: 1px solid #c89b59; border-radius: 12px; text-align: left; color: #372637;
  background: linear-gradient(135deg, #fff9e9, #f8e8c8);
  box-shadow: inset 0 0 0 3px #fff8e4, inset 0 0 0 4px #c6a777, 0 6px 18px #07122d66;
}
.entryBrowserTip::before {
  content: ''; flex: 0 0 43px; height: 46px;
  background: url('../../knockabout/assets/img/ui/seal.webp') center / contain no-repeat;
  transform: rotate(-9deg);
}
.entryBrowserTip p { margin: 0; font: 600 17px/1.2 'Fraunces', Georgia, serif; }
.entryBrowserTip strong { display: block; margin-top: 2px; color: #9b1830; font: 700 18px/1.1 'Chakra Petch', system-ui, sans-serif; letter-spacing: .12em; }
#entryBrowserTipClose {
  align-self: center; flex: 0 0 44px; height: 44px; padding: 0; border: 0; border-radius: 50%;
  background: transparent; color: #745e51; font: 400 24px/1 system-ui, sans-serif;
}
#entryBrowserTipClose:hover { color: #83152b; background: #9c623412; }
#entry #entryBrowserTipClose:focus-visible { outline-color: #923043; outline-offset: -5px; }
@media (max-aspect-ratio: 1/1) {
  .entryBrowserTip { position: relative; inset: auto; order: 1; max-width: 100%; }
  .entryActions { order: 2; }
}
@media (prefers-reduced-motion: no-preference) {
  .entryBrowserTip { animation: entryNoteArrives .55s cubic-bezier(.16,1,.3,1) both; }
  @keyframes entryNoteArrives {
    from { opacity: 0; transform: translateY(-9px) rotate(-2deg); }
    to { opacity: 1; transform: none; }
  }
}
.entryWeather { overflow:hidden; }
.entryFlake { position:absolute; top:-12px; width:var(--size); height:var(--size); border-radius:50%; background:#e6f6ff; opacity:var(--alpha); animation:entrySnow var(--period) linear var(--delay) infinite; }
.entryStar { position:absolute; width:9px; height:9px; background:#fff0a5; clip-path:polygon(50% 0,60% 40%,100% 50%,60% 60%,50% 100%,40% 60%,0 50%,40% 40%); animation:entryTwinkle 5s ease-in-out var(--delay) infinite; }
#entry.leaving { opacity:0; pointer-events:none; }
@keyframes entrySnow { to { transform:translate3d(var(--drift),calc(100dvh + 22px),0); } }
@keyframes entryTwinkle { 0%,48%,100% { opacity:0; transform:scale(.35); } 69% { opacity:.94; transform:scale(1); } }
@keyframes entryPolish { 0%,75% { transform:translateX(-125%); } 95%,100% { transform:translateX(125%); } }
@media (max-aspect-ratio: 1/1) {
  #entry { background: linear-gradient(#071c45,#183865 65%,#081b33); }
  .entryScene { background-image:url('../assets/entrance-portrait.webp'); background-position:50% 50%; background-size: cover; }
  .entryShade { background:linear-gradient(180deg,#081c45c7 0%,#061a3e4a 18%,transparent 35%,transparent 59%,#06182ebf 79%,#04142ced); }
  .entryContent { width:100%; max-width:none; min-height:100%; justify-content:space-between; gap:12px; padding:max(3dvh,env(safe-area-inset-top)) max(10px,env(safe-area-inset-right)) max(2dvh,env(safe-area-inset-bottom)) max(10px,env(safe-area-inset-left)); }
  .entryBrand h1 { width:min(77vw,35dvh,410px); }
  .entryBrand p { margin:.25rem 2px 0; font-size:clamp(15px,3.6vw,21px); }
  .entryActions { gap:8px; }
  #entryBegin { min-height:54px; font-size:23px; }
  #entryFullHint { margin-top:5px; }
}
@media (min-aspect-ratio: 1/1) and (max-height:530px) {
  .entryContent { gap:8px; padding-top:max(6px,env(safe-area-inset-top)); padding-bottom:max(4px,env(safe-area-inset-bottom)); }
  .entryBrand h1 { width:min(33vw,50dvh); }
  .entryBrand p { font-size:15px; }
  .entryActions { gap:5px; }
  #entryBegin { font-size:20px; min-height:45px; }
  #entryFullRow { flex-direction:row; gap:1px; flex-wrap:wrap; justify-content:center; }
  #entryFull { font-size:14px; }
  #entryFullHint { margin:0; font-size:13px; }
}
@media (prefers-reduced-motion: reduce) {
  #entry, #entryBegin { transition:none; }
  .entryFlake,.entryStar { display:none; }
  #entryBegin::after { animation:none; }
}


#entryBegin[aria-busy=true] ~ #entryStatus { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }

@media (prefers-reduced-motion: no-preference) {
  #entry.leaving .entryScene { transform-origin:64% 57%; animation:stepInside .65s ease-in both; }
  @keyframes stepInside { to { transform:scale(1.065); } }
}
