/* Escape the Tomb of Nefertari — Developed by Slyness */
/* ---------- Start gate (after the preloader) ---------- */
.loader-start {
  margin-top: 26px; padding: 14px 34px; border: 0; border-radius: 3px; cursor: pointer;
  font-family: "Cinzel", serif; font-weight: 700; font-size: 16px; letter-spacing: .25em; text-transform: uppercase;
  color: #1a1206; background: linear-gradient(180deg, var(--gold-2), var(--gold) 55%, var(--gold-d));
  box-shadow: 0 0 0 1px #2a1c08, 0 0 0 3px rgba(226,188,107,.5), 0 0 30px rgba(226,188,107,.45);
  animation: rise .8s both, gatePulse 2.2s 1s ease-in-out infinite;
}
@keyframes gatePulse { 50% { box-shadow: 0 0 0 1px #2a1c08, 0 0 0 3px rgba(226,188,107,.8), 0 0 50px rgba(226,188,107,.8); } }
#loader.ready .loader-bar, #loader.ready .loader-pct, #loader.ready .loader-label { opacity: 0; transition: opacity .5s; }

/* ---------- Slyness splash ---------- */
#slySplash {
  position: fixed; inset: 0; z-index: 2000; overflow: hidden; cursor: default; display: grid; place-items: center;
  background: radial-gradient(ellipse at 50% 46%, #3a2610 0%, #1a1006 45%, #070402 100%);
  --u: min(1vw, 1.78vh);
}
#slySplash::before { content: ""; position: absolute; inset: 0; background: url(../img/tex_pierre.webp) center/cover; opacity: .12; mix-blend-mode: overlay; }
#slySplash.leaving { opacity: 0; transition: opacity .8s ease-in; }
#slySplash.leaving .sp-stage { transform: scale(1.06); transition: transform .8s ease-in; }
.sp-embers { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 3; }
.sp-rays {
  position: absolute; left: 50%; top: 46%; width: calc(160 * var(--u)); aspect-ratio: 1; translate: -50% -50%; border-radius: 50%;
  background: repeating-conic-gradient(from 0deg, rgba(255,214,130,.13) 0 4deg, transparent 4deg 15deg);
  -webkit-mask: radial-gradient(circle, #000 5%, transparent 48%); mask: radial-gradient(circle, #000 5%, transparent 48%);
  opacity: 0; scale: .4; transition: opacity 1.2s ease-out, scale 1.6s cubic-bezier(.2,.8,.2,1);
  animation: spRays 30s linear infinite;
}
@keyframes spRays { to { rotate: 360deg; } }
#slySplash.open .sp-rays { opacity: 1; scale: 1; }
.sp-stage { position: relative; z-index: 2; display: grid; justify-items: center; gap: calc(3 * var(--u)); animation: spIn 1s ease-out both; }
@keyframes spIn { from { opacity: 0; transform: scale(.92); filter: blur(6px); } }
.sp-card {
  position: relative; width: calc(52 * var(--u)); aspect-ratio: 791 / 590; padding: calc(.7 * var(--u)); border-radius: 4px;
  background: linear-gradient(135deg, #6b4e1c, #f6dc9a 22%, #a57a2e 45%, #f1d38a 62%, #7a5518 85%, #e2bc6b);
  box-shadow: 0 0 0 1px #2a1c08, 0 0 calc(4 * var(--u)) rgba(255,190,90,.35), 0 calc(2 * var(--u)) calc(6 * var(--u)) rgba(0,0,0,.8);
  animation: spForge 1.5s ease-in both;
}
/* the frame trembles harder with each hammer blow */
@keyframes spForge {
  0% { transform: none; } 30% { transform: translate(.5px,0); } 32% { transform: translate(-.5px,.5px); }
  60% { transform: translate(-1px,.5px); } 62% { transform: translate(1px,-1px); } 80% { transform: translate(1.5px,1px); }
  82% { transform: translate(-2px,-1px); } 94% { transform: translate(2px,-1.5px); } 97% { transform: translate(-2.5px,1px); } 100% { transform: none; }
}
#slySplash.open .sp-card { box-shadow: 0 0 0 1px #2a1c08, 0 0 calc(9 * var(--u)) rgba(255,200,110,.6), 0 calc(2 * var(--u)) calc(6 * var(--u)) rgba(0,0,0,.8); transition: box-shadow 1.5s; }
.sp-card img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 2px; filter: brightness(.3) saturate(.6); transition: filter 1.4s ease-out .15s; }
#slySplash.open .sp-card img { filter: none; }
.sp-door {
  position: absolute; top: calc(.7 * var(--u)); bottom: calc(.7 * var(--u)); width: calc(50% - .7 * var(--u)); display: grid; place-items: center;
  background: linear-gradient(90deg, rgba(0,0,0,.25), transparent 30%, transparent 70%, rgba(0,0,0,.35)), url(../img/tex_pierre.webp) center/cover;
  box-shadow: inset 0 0 calc(3 * var(--u)) rgba(0,0,0,.7); transition: transform 1.1s cubic-bezier(.6,0,.2,1);
}
.sp-door.l { left: calc(.7 * var(--u)); border-right: 1px solid #1a1006; }
.sp-door.r { right: calc(.7 * var(--u)); border-left: 1px solid #1a1006; }
.sp-door span { font-family: var(--eg); font-size: calc(9 * var(--u)); color: rgba(40,26,10,.75); text-shadow: 1px 1px 0 rgba(255,235,200,.25); }
#slySplash.open .sp-door.l { transform: translateX(-102%); }
#slySplash.open .sp-door.r { transform: translateX(102%); }
.sp-card { overflow: hidden; }
.sp-shine { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.sp-shine::before { content: ""; position: absolute; top: -10%; bottom: -10%; left: -40%; width: 26%; transform: skewX(-20deg); background: linear-gradient(100deg, transparent, rgba(255,250,230,.55) 50%, transparent); }
#slySplash.open .sp-shine::before { animation: spShine 1.2s ease-in-out 1.1s both; }
@keyframes spShine { to { left: 125%; } }
.sp-flash { position: absolute; inset: 0; z-index: 4; pointer-events: none; opacity: 0; background: radial-gradient(circle at 50% 46%, #fff8e0, rgba(255,210,120,.6) 30%, transparent 70%); }
#slySplash.open .sp-flash { animation: spFlash 1s ease-out both; }
@keyframes spFlash { 0% { opacity: 0; } 8% { opacity: 1; } 100% { opacity: 0; } }

/* ---------- Credits: "Developed by Slyness" & WorldEscapeGames logo ---------- */
.credit {
  position: absolute; left: 22px; bottom: 18px; z-index: 3; margin: 0;
  font-family: "Cinzel", serif; font-size: 13px; letter-spacing: .22em; text-transform: uppercase; color: rgba(246,220,154,.75);
  text-shadow: 0 2px 8px #000; animation: rise 1.6s .8s both;
}
.credit b {
  position: relative; display: inline-block; margin-left: .35em; font-size: 1.55em; font-weight: 900; letter-spacing: .08em; text-transform: none;
  background: linear-gradient(100deg, #ff5d84 0%, #ff8fab 30%, #fff0f4 45%, #ff8fab 60%, #e8436b 100%) 0 0 / 250% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 6px rgba(255,93,132,.55)) drop-shadow(0 2px 2px rgba(0,0,0,.8));
  animation: slyShine 4.5s ease-in-out infinite;
}
@keyframes slyShine { 0%, 55% { background-position: 100% 0; } 100% { background-position: -150% 0; } }
.weg-logo { position: absolute; right: 20px; bottom: 14px; z-index: 3; display: block; animation: rise 1.6s .8s both; }
.weg-logo img { display: block; height: 88px; filter: drop-shadow(0 3px 8px rgba(0,0,0,.8)); transition: transform .2s, filter .2s; }
.weg-logo:hover img { transform: scale(1.05); filter: drop-shadow(0 0 10px rgba(120,180,255,.6)) drop-shadow(0 3px 8px #000); }
#inventory .weg-logo { position: static; margin-left: auto; flex: none; animation: none; }
#inventory .weg-logo img { height: calc(var(--inv-h) - 22px); opacity: .95; }

/* Ending: the credit glows and sparkles */
.credit.fx { position: relative; left: auto; bottom: auto; font-size: 15px; margin-top: 18px; animation: rise 1.6s 1.2s both; }
.credit.fx b { font-size: 1.9em; filter: drop-shadow(0 0 10px rgba(255,93,132,.8)) drop-shadow(0 0 24px rgba(255,93,132,.45)) drop-shadow(0 2px 2px rgba(0,0,0,.8)); animation: slyShine 3s ease-in-out infinite, slyPulse 2.4s ease-in-out infinite alternate; }
@keyframes slyPulse { to { transform: scale(1.06); } }
.credit .spark { position: absolute; width: 10px; height: 10px; pointer-events: none; background: radial-gradient(circle, #fff 0 15%, rgba(255,170,200,.9) 30%, transparent 70%); clip-path: polygon(50% 0, 60% 40%, 100% 50%, 60% 60%, 50% 100%, 40% 60%, 0 50%, 40% 40%); animation: twinkle 1.8s ease-in-out infinite; opacity: 0; }
@keyframes twinkle { 0%, 100% { opacity: 0; transform: scale(.3) rotate(0); } 50% { opacity: 1; transform: scale(1.2) rotate(90deg); } }

/* ---------- Leaderboard ---------- */
.help-box { width: min(480px, 92vw); max-height: 90vh; overflow: auto; }
.help-list { list-style: none; margin: 18px 0 20px; padding: 0; text-align: left; }
.help-list li { display: flex; align-items: flex-start; gap: 14px; padding: 10px 12px; margin-bottom: 6px; border-radius: 4px; background: rgba(226,188,107,.07); box-shadow: inset 0 0 0 1px rgba(226,188,107,.18); }
.help-list .eg { flex: none; width: 28px; text-align: center; font-size: 24px; line-height: 1.1; color: var(--gold); }
.help-list p { margin: 0; font-size: 18px; line-height: 1.35; }
.help-list b { color: var(--gold-2); font-weight: 600; }
#btnHelp { font-family: "Cinzel", serif; font-weight: 700; font-size: 16px; justify-content: center; }
.board-box { width: min(460px, 92vw); max-height: 90vh; overflow: auto; }
.lb-list { list-style: none; margin: 18px 0 22px; padding: 0; text-align: left; }
.lb-list li { display: flex; align-items: center; gap: 12px; padding: 9px 12px; margin-bottom: 6px; border-radius: 4px; background: rgba(226,188,107,.07); box-shadow: inset 0 0 0 1px rgba(226,188,107,.18); font-size: 19px; }
.lb-rank { width: 30px; height: 30px; flex: none; display: grid; place-items: center; border-radius: 50%; font-family: "Cinzel", serif; font-weight: 700; font-size: 14px; color: var(--gold-2); box-shadow: inset 0 0 0 1px rgba(226,188,107,.5); }
.lb-list .r1 .lb-rank { background: linear-gradient(135deg, #f6dc9a, #c8973f); color: #2a1c08; box-shadow: 0 0 12px rgba(246,220,154,.6); }
.lb-list .r2 .lb-rank { background: linear-gradient(135deg, #eee, #9a9a9a); color: #222; }
.lb-list .r3 .lb-rank { background: linear-gradient(135deg, #e3a970, #8a5426); color: #2a1406; }
.lb-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.lb-time { font-family: "Cinzel", serif; font-size: 14px; letter-spacing: .06em; color: var(--gold-2); white-space: nowrap; }
.lb-list li.me { background: rgba(246,220,154,.2); box-shadow: inset 0 0 0 1px var(--gold-2), 0 0 16px rgba(246,220,154,.3); }
.lb-empty, .lb-msg { font-style: italic; opacity: .8; margin: 16px 0; font-size: 18px; }
.lb-msg.err { color: #ff9c8a; opacity: 1; }

.end-score { width: min(440px, 90vw); margin: 0 auto 18px; padding: 16px 18px; border-radius: 4px; background: rgba(10,7,3,.6); box-shadow: inset 0 0 0 1px rgba(226,188,107,.4); backdrop-filter: blur(4px); animation: rise 1.6s .9s both; }
.end-score .lb-list { margin: 10px 0 0; max-height: 28vh; overflow-y: auto; }
.end-content { overflow-y: auto; justify-content: safe center; }
#ending .menu-title { margin: 8px 0 14px; }
.end-time { margin-bottom: 14px; }
.end-score .lb-list li { font-size: 17px; padding: 6px 10px; margin-bottom: 4px; }
.score-form { display: flex; gap: 8px; }
.score-form input {
  flex: 1; min-width: 0; padding: 10px 12px; border-radius: 3px; border: 0; outline: none; user-select: text;
  font: 600 18px "Cormorant Garamond", serif; color: var(--text); background: rgba(0,0,0,.5); box-shadow: inset 0 0 0 1px rgba(226,188,107,.5);
}
.score-form input:focus { box-shadow: inset 0 0 0 2px var(--gold-2); }
.score-form .btn { width: auto; margin: 0; padding: 10px 16px; font-size: 13px; }
.end-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.end-actions .btn { width: auto; min-width: 180px; margin: 0; }

@media (max-width: 720px) {
  .credit { left: 12px; bottom: 10px; font-size: 10px; letter-spacing: .14em; }
  .weg-logo { right: 10px; bottom: 8px; }
  .weg-logo img { height: 58px; }
}
