/* Lethal Earth Atlas: the Expedition (full-screen first-person adventure + 3D case files) */
html.xp-on, html.xp-on body { overflow: hidden; }
.xp { position: fixed; inset: 0; z-index: 300; background: #020305; color: var(--silver); opacity: 0; transition: opacity .7s var(--ease);
  overscroll-behavior: contain; touch-action: manipulation; }
.xp.on { opacity: 1; }
.xp__cv { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.xp__vig { position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(120% 90% at 50% 45%, transparent 45%, rgba(2, 3, 5, .75) 100%); }
.xp__flash { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .7s;
  background: radial-gradient(60% 60% at 50% 40%, rgba(150, 100, 255, .35), transparent 70%); mix-blend-mode: screen; }
.xp.flash-good .xp__flash { opacity: 1; transition-duration: .08s; }
.xp__fade { position: absolute; inset: 0; pointer-events: none; background: #000; opacity: 0; transition: opacity 1.1s ease; }
.xp.dark .xp__fade { opacity: .92; }
.xp.shake .xp__cv { animation: xpshake 2.2s ease-in both; }
@keyframes xpshake { 0%, 100% { transform: none; } 20% { transform: translate(1px, -1px); } 40% { transform: translate(-2px, 1px); }
  60% { transform: translate(2px, 2px); } 80% { transform: translate(-3px, -1px); } }
@media (prefers-reduced-motion: reduce) { .xp.shake .xp__cv { animation: none; } }

/* HUD */
.xp__hud { position: absolute; z-index: 3; top: 0; left: 0; right: 0; display: flex; align-items: center; gap: 12px;
  padding: max(14px, env(safe-area-inset-top)) 16px 0; }
.xp__file, .xp__score { display: flex; gap: 10px; align-items: baseline; padding: 8px 14px; border-radius: 999px;
  border: 1px solid rgba(231, 227, 218, .14); background: rgba(6, 6, 8, .55); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  font: 600 11px/1 var(--sans); letter-spacing: .16em; color: var(--silver-2); font-variant-numeric: tabular-nums; }
.xp__file b { color: var(--silver); font-weight: 700; }
.xp__score { margin-left: auto; }
.xp__score b { color: var(--amber); font-weight: 700; text-shadow: 0 0 14px rgba(255, 181, 74, .5); }
.xp__exit { width: 38px; height: 38px; border-radius: 50%; border: 1px solid rgba(231, 227, 218, .18); background: rgba(6, 6, 8, .55);
  color: var(--silver-2); font-size: 14px; cursor: pointer; }
.xp__exit:hover { color: #fff; border-color: rgba(180, 140, 255, .5); }
.xp__track { position: absolute; z-index: 3; top: calc(max(14px, env(safe-area-inset-top)) + 54px); left: 50%; width: min(420px, 70vw);
  transform: translateX(-50%); height: 2px; background: rgba(231, 227, 218, .12); border-radius: 2px; opacity: 0; transition: opacity .8s; }
.xp.playing .xp__track { opacity: 1; }
.xp__track i { position: absolute; top: 50%; width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px; border-radius: 50%;
  border: 1px solid rgba(231, 227, 218, .35); background: #08080b; transition: background .4s, border-color .4s, box-shadow .4s; }
.xp__track i.ok { background: var(--violet); border-color: var(--violet); box-shadow: 0 0 10px var(--violet); }
.xp__track i.ko { background: #3a1410; border-color: #a3311f; }
.xp__walker { position: absolute; top: 50%; left: 0; width: 13px; height: 13px; margin: -6.5px 0 0 -6.5px; border-radius: 50%;
  background: var(--amber); box-shadow: 0 0 14px var(--amber); }

/* intro / end panels */
.xp__panel { position: absolute; z-index: 4; left: 50%; top: 50%; width: min(560px, calc(100% - 32px)); transform: translate(-50%, -50%);
  padding: clamp(26px, 5vw, 44px); border-radius: 22px; text-align: center;
  background: rgba(6, 6, 8, .62); border: 1px solid rgba(231, 227, 218, .12); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 40px 120px -30px #000; transition: opacity .6s var(--ease), transform .6s var(--ease); }
.xp__panel h2 { margin: 0 0 16px; font: 700 clamp(28px, 4.4vw, 44px)/1.08 var(--serif); }
.xp__panel p { margin: 0 0 26px; color: var(--silver-2); }
.xp__eyebrow { margin: 0 0 14px !important; font: 600 11px/1 var(--sans); letter-spacing: .26em; text-transform: uppercase; color: var(--amber) !important; }
.xp__hint { margin: 16px 0 0 !important; font: 500 11px/1 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--dim) !important; }
.xp__intro { animation: xpin 1.2s var(--ease) .3s both; }
.xp__intro.gone { opacity: 0; transform: translate(-50%, -40%); pointer-events: none; }
@keyframes xpin { from { opacity: 0; transform: translate(-50%, -44%); } }
.xp__end { opacity: 0; transform: translate(-50%, -44%); }
.xp__end.show { opacity: 1; transform: translate(-50%, -50%); }
.xp__dots { display: flex; gap: 10px; justify-content: center; margin: -8px 0 28px; }
.xp__dots i { width: 14px; height: 14px; border-radius: 50%; background: rgba(231, 227, 218, .16); }
.xp__dots i.ok { background: var(--amber); box-shadow: 0 0 12px rgba(255, 181, 74, .6); }

/* the line spoken by the narrator, low on screen while you walk */
.xp__sub { position: absolute; z-index: 3; left: 50%; bottom: max(28px, env(safe-area-inset-bottom)); width: min(640px, calc(100% - 32px));
  transform: translateX(-50%); margin: 0; text-align: center; font: 700 clamp(18px, 2.4vw, 26px)/1.3 var(--serif); color: var(--silver);
  text-shadow: 0 2px 20px #000, 0 0 2px #000; opacity: 0; pointer-events: none; }
.xp__sub.show { animation: subin 4.2s ease both; }
@keyframes subin { 0% { opacity: 0; transform: translate(-50%, 8px); } 12%, 80% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; } }

/* the desk: where each case file lands */
.xp__desk { position: absolute; z-index: 4; left: 0; right: 0; bottom: 0; display: flex; justify-content: center;
  padding: 0 16px max(16px, env(safe-area-inset-bottom)); pointer-events: none; }
.dos { width: min(560px, 100%); perspective: 1600px; pointer-events: auto;
  transform: translateY(115%) rotateX(38deg) rotateZ(-3deg); opacity: 0; transform-origin: 50% 100%;
  transition: transform 1s cubic-bezier(.16, 1, .3, 1), opacity .5s; }
.dos.in { transform: none; opacity: 1; }
.dos.out { transform: translate(-40%, 120%) rotateZ(-12deg); opacity: 0; transition-duration: .6s; transition-timing-function: cubic-bezier(.6, 0, .8, .4); }
.dos.thud .dos__book { animation: thud .32s ease; }
@keyframes thud { 30% { transform: translateY(5px) scale(.992); } }
.dos__book { position: relative; transform-style: preserve-3d; }
.dos__page { position: relative; max-height: min(74svh, 640px); overflow: hidden auto; padding: 26px clamp(20px, 4vw, 34px) 22px; border-radius: 6px;
  color: #1c1915; background:
    radial-gradient(120% 80% at 10% 0%, rgba(255, 255, 255, .5), transparent 50%),
    radial-gradient(80% 60% at 100% 100%, rgba(120, 90, 50, .18), transparent 60%),
    repeating-linear-gradient(0deg, transparent 0 27px, rgba(60, 80, 120, .08) 27px 28px),
    #e8e0cc;
  box-shadow: 0 2px 0 #cfc5ad, 0 4px 0 #bfb498, 0 40px 90px -20px rgba(0, 0, 0, .9), 0 0 0 1px rgba(0, 0, 0, .2) inset; }
.dos__no { margin: 0 0 12px; font: 700 11px/1 ui-monospace, "Courier New", monospace; letter-spacing: .18em; color: #7a2a1c; }
.dos__q { margin: 0 0 18px; padding-right: 64px; font: 700 clamp(19px, 2.6vw, 24px)/1.25 var(--serif); color: #15120e; }
.dos__opts { display: grid; }
.dos__opt { position: relative; display: flex; gap: 14px; align-items: center; width: 100%; padding: 14px 8px; text-align: left; cursor: pointer;
  border: 0; border-bottom: 1px dashed rgba(28, 25, 21, .28); background: transparent; color: #1c1915; font: 600 16px/1.3 var(--sans);
  transition: background .25s, opacity .4s, transform .25s var(--ease); -webkit-tap-highlight-color: transparent; }
.dos__opt:hover:not(:disabled), .dos__opt:focus-visible { background: rgba(124, 77, 255, .1); transform: translateX(4px); outline: none; }
.dos__opt:disabled { cursor: default; }
.dos__box { flex: none; position: relative; width: 20px; height: 20px; border: 2px solid #1c1915; border-radius: 2px; }
.dos__opt.right .dos__box { border-color: var(--violet-2); }
.dos__opt.right .dos__box::after { content: ""; position: absolute; left: 4px; top: -6px; width: 8px; height: 17px; border: solid var(--violet-2);
  border-width: 0 4px 4px 0; transform: rotate(40deg); animation: tick .35s var(--ease) both; }
@keyframes tick { from { clip-path: inset(100% 0 0 0); } to { clip-path: inset(0); } }
.dos__opt.right span { color: #3b1fa0; text-decoration: underline 2px rgba(124, 77, 255, .6); text-underline-offset: 4px; }
.dos__opt.dim { opacity: .45; }
.dos__bar { position: absolute; left: 40px; top: 50%; height: 1.25em; width: 0; transform: translateY(-50%) rotate(-.6deg); background: #111;
  border-radius: 2px; transition: width .45s cubic-bezier(.6, 0, .2, 1); }
.dos__opt.wrong .dos__bar { width: calc(100% - 52px); }
.dos__why { margin: 18px 0 0; padding: 4px 0 4px 14px; border-left: 3px solid; font: 500 15px/1.55 var(--sans); color: #2a251f; min-height: 3em; }
.dos__why.good { border-color: var(--violet-2); }
.dos__why.bad { border-color: #a3311f; }
.dos__foot { display: flex; justify-content: flex-end; margin-top: 16px; }
.dos__next { animation: xpup .5s var(--ease) both; }
@keyframes xpup { from { opacity: 0; transform: translateY(8px); } }
.dos__stamp { position: absolute; top: 18px; right: 14px; padding: 6px 10px; border: 3px solid; border-radius: 4px; pointer-events: none;
  font: 900 15px/1 var(--serif); letter-spacing: .12em; opacity: 0; transform: rotate(-14deg) scale(3); }
.dos__stamp.hit { animation: stampin .34s cubic-bezier(.3, 1.6, .5, 1) forwards; }
.dos__stamp.good { color: #5a2fd6; border-color: #5a2fd6; }
.dos__stamp.bad { color: #a3311f; border-color: #a3311f; }
@keyframes stampin { 0% { opacity: 0; transform: rotate(-14deg) scale(3); } 60% { opacity: .95; } 100% { opacity: .88; transform: rotate(-14deg) scale(1); } }

/* the folder cover, hinged at the top, flips open */
.dos__cover { position: absolute; inset: 0; transform-origin: 50% 0; transform-style: preserve-3d; pointer-events: none;
  transition: transform 1.05s cubic-bezier(.6, 0, .2, 1); }
.dos.open .dos__cover { transform: rotateX(172deg); }
.dos.open .dos__front, .dos.open .dos__inner { opacity: 0; transition: opacity .35s .8s; }
.dos__front, .dos__inner { position: absolute; inset: 0; border-radius: 6px; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.dos__front { display: grid; place-content: center; text-align: center; gap: 10px; color: #2a1d10;
  background: radial-gradient(90% 70% at 30% 20%, rgba(255, 255, 255, .25), transparent 60%), linear-gradient(160deg, #c9a46a, #a9824b);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .25) inset, 0 30px 80px -20px #000; }
.dos__top { margin: 0; padding: 6px 14px; border: 3px solid #8e2416; color: #8e2416; font: 900 clamp(20px, 3.4vw, 30px)/1 var(--serif);
  letter-spacing: .14em; transform: rotate(-6deg); justify-self: center; }
.dos__big { margin: 0; font: 900 clamp(34px, 6vw, 54px)/1 var(--serif); letter-spacing: .08em; }
.dos__org { margin: 0; font: 700 11px/1 ui-monospace, "Courier New", monospace; letter-spacing: .2em; }
.dos__tape { position: absolute; top: -10px; left: 50%; width: 120px; height: 22px; margin-left: -60px; background: rgba(240, 235, 220, .55); transform: rotate(-2deg); }
.dos__inner { transform: rotateX(180deg); background: linear-gradient(200deg, #b08a52, #8c6a3a); }
@media (prefers-reduced-motion: reduce) { .dos, .dos__cover { transition-duration: .01s !important; } }

/* the launcher on the page */
.launch { display: grid; grid-template-columns: 1fr; padding: 0 !important; overflow: hidden; min-height: 0 !important; }
.launch__art { min-height: 260px; background-size: cover; background-position: 50% 60%; position: relative; }
.launch__art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, var(--ink-2), transparent 60%); }
.launch__copy { padding: 6px clamp(24px, 5vw, 48px) clamp(28px, 5vw, 44px); text-align: center; }
.launch__k { margin: 0 0 10px; font: 600 11px/1 var(--sans); letter-spacing: .24em; text-transform: uppercase; color: var(--amber); }
.launch__t { margin: 0 0 26px; font: 700 clamp(24px, 3.4vw, 34px)/1.15 var(--serif); }
.launch__hp { margin: 16px 0 0; font: 500 11px/1 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--dim); }
.dos .dos__next { background: #17130f; color: #efe8d6; border: 1px solid #17130f; box-shadow: 0 10px 24px -10px rgba(0, 0, 0, .6); }
.dos .dos__next:hover { background: #3b1fa0; border-color: #3b1fa0; }
/* stamp lands bottom-left, beside the button, never over the question */
.dos__stamp { top: auto; right: auto; bottom: 22px; left: clamp(20px, 4vw, 34px); }
.dos__q { padding-right: 0; }
.xp__file, .xp__score { white-space: nowrap; }
@media (max-width: 560px) { .xp__file span { display: none; } .xp__score span { display: none; } }
@media (hover: none) { .xp__hint { display: none; } }

/* choice mode */
.dos__opt span { display: grid; gap: 3px; }
.dos__opt b { font: 700 16px/1.25 var(--sans); }
.dos__opt small { font: 500 13px/1.3 var(--sans); color: #6b6355; }
.dos__opt.chosen { background: rgba(124, 77, 255, .1); }
.dos__opt.chosen .dos__box { border-color: var(--violet-2); }
.dos__opt.chosen .dos__box::after { content: ""; position: absolute; left: 4px; top: -6px; width: 8px; height: 17px; border: solid var(--violet-2);
  border-width: 0 4px 4px 0; transform: rotate(40deg); animation: tick .35s var(--ease) both; }
.dos__why.note { border-color: #8a7a5c; font-style: italic; }
.dos__range { padding: 6px 0 4px; }
.dos__range output { display: block; margin-bottom: 14px; font: 700 30px/1 var(--serif); color: #15120e; }
.dos__range input { width: 100%; accent-color: var(--violet-2); height: 28px; }
.dos__range p { margin: 10px 0 0; font: 500 13px/1.4 var(--sans); color: #6b6355; }
.xp__sub { animation-duration: var(--d, 4.2s) !important; }
.xp__sub.good { color: #ffd38a; }
.xp__sub.bad { color: #ffb1a1; }
.xp.live .xp__sub { bottom: max(48px, env(safe-area-inset-bottom)); font-size: clamp(19px, 2.6vw, 28px); }
.xp.fainting .xp__cv { animation: faint 3.4s ease-in both; }
@keyframes faint { to { filter: blur(6px) brightness(.5); transform: scale(1.04) rotate(-1.5deg); } }
@media (prefers-reduced-motion: reduce) { .xp.fainting .xp__cv { animation: none; } }
.dos__page { scrollbar-width: thin; scrollbar-color: rgba(28, 25, 21, .3) transparent; }
@media (max-height: 760px) {
  .dos__page { max-height: 66svh; padding-top: 18px; padding-bottom: 16px; }
  .dos__q { margin-bottom: 10px; font-size: 19px; }
  .dos__no { margin-bottom: 8px; }
  .dos__opt { padding: 9px 6px; }
  .dos__opt small { font-size: 12px; }
  .dos__why { margin-top: 10px; font-size: 14px; }
  .dos__foot { margin-top: 10px; }
}
/* narration stays readable on a white-hot sky or a black night */
.xp__sub { width: auto; max-width: min(680px, calc(100% - 32px)); padding: 12px 20px; border-radius: 14px;
  background: rgba(6, 6, 8, .58); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.xp__sub:empty { display: none; }
