/* Gate Path replaces the map while the adventure game is active. */
body.adventure-in-game .navbar { display: none !important; }
#screen-adventure.adv-playing .adv-hero,
#screen-adventure.adv-playing #adv-preview-banner,
#screen-adventure.adv-playing .adv-story,
#screen-adventure.adv-playing .adv-map-section { display: none; }
#screen-adventure.adv-playing {
  width: min(1440px, calc(100vw - 24px));
  padding-top: 10px;
}
#screen-adventure.adv-playing .adv-shell { max-width: 1400px; }
#adv-scene {
  padding: 0;
  overflow: visible;
  border: 0;
  background: none;
  box-shadow: none;
}
#adv-scene::before { display: none; }
.adventure-game { color: #f4eddd; font-family: 'Cairo', sans-serif; }
.adventure-game [hidden] { display: none !important; }
.adventure-game-hud {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
  padding: 0 4px;
}
.adventure-game-heading { min-width: 0; }
.adventure-game-heading small, .adventure-game-completion-card small {
  color: #e1c18a;
  font: 700 10px/1.5 'Cinzel', 'Cairo', serif;
  letter-spacing: .16em;
}
#screen-adventure .adventure-game-heading h3 {
  margin: 2px 0 0;
  color: #f5e1b9;
  font: 700 clamp(22px, 3vw, 35px)/1.25 'Cinzel', 'Cairo', serif;
}
#screen-adventure .adventure-game-heading p {
  margin: 2px 0 0;
  color: #bfcdcd;
  font-size: 12px;
}
.adventure-game-status { display: grid; justify-items: end; gap: 5px; flex: none; }
.adventure-game-preview {
  padding: 3px 9px;
  border: 1px solid rgba(141, 202, 183, .55);
  border-radius: 50px;
  color: #c1e6d7;
  background: rgba(24, 54, 56, .7);
  font-size: 10px;
}
.adventure-game-count { color: #efd09b; font-size: 15px; }
.adventure-game-hud-actions { display: flex; gap: 7px; }
.adventure-game-hud-actions button {
  padding: 5px 11px;
  border: 1px solid rgba(233, 203, 148, .45);
  border-radius: 7px;
  background: rgba(17, 32, 49, .9);
  color: #eadfc8;
  font: 700 11px/1.5 'Cairo', sans-serif;
  cursor: pointer;
}
.adventure-game-view {
  position: relative;
  isolation: isolate;
  height: clamp(440px, calc(100dvh - 210px), 740px);
  overflow: hidden;
  border: 1px solid rgba(232, 197, 133, .75);
  border-radius: 16px 5px 16px 5px;
  box-shadow: 0 22px 65px rgba(0, 0, 0, .65), inset 0 0 90px rgba(2, 9, 20, .55);
  background: #101b2d;
  direction: ltr;
  touch-action: pan-y;
}
.adventure-game-view::after {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(4, 13, 25, .38), transparent 34%, rgba(5, 12, 24, .18) 65%, rgba(5, 12, 24, .7)),
    radial-gradient(ellipse at 50% 52%, transparent 29%, rgba(3, 9, 19, .38));
}
.adventure-game-landscape {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(0deg, rgba(10, 22, 33, .43), rgba(9, 16, 31, .22)),
    url('../attached_assets/generated_images/lifequest-adventure-realm.jpg');
  background-size: cover;
  filter: saturate(.8) contrast(1.1);
  transform: scale(1.04);
}
[data-theme="gate"] .adventure-game-landscape { background-position: 8% 72%; }
[data-theme="ruins"] .adventure-game-landscape { background-position: 48% 49%; filter: saturate(.55) contrast(1.16) hue-rotate(10deg); }
[data-theme="trail"] .adventure-game-landscape { background-position: 88% 34%; filter: saturate(.85) contrast(1.1) hue-rotate(-7deg); }
.adventure-game-ridge {
  position: absolute;
  z-index: 0;
  inset: auto 0 0;
  height: 21%;
  background: linear-gradient(0deg, rgba(9, 16, 25, .86), transparent);
  pointer-events: none;
}
.adventure-game-mist {
  position: absolute;
  z-index: 1;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 17% 66%, rgba(169, 194, 201, .21), transparent 31%),
    radial-gradient(ellipse at 80% 37%, rgba(194, 209, 208, .2), transparent 30%),
    linear-gradient(100deg, transparent, rgba(181, 200, 201, .07), transparent);
  background-size: 100% 100%, 100% 100%, 200% 100%;
  animation: adventure-mist 16s ease-in-out infinite alternate;
}
@keyframes adventure-mist { from { background-position: 0 0, 0 0, 0 0; } to { background-position: 0 0, 0 0, 100% 0; } }
.adventure-game-architecture {
  position: absolute;
  z-index: 1;
  width: 23%;
  height: 58%;
  bottom: 8%;
  right: 8%;
  border: clamp(11px, 2vw, 27px) ridge rgba(103, 119, 126, .65);
  border-bottom: 0;
  border-radius: 49% 49% 0 0;
  box-shadow: inset 0 0 38px rgba(10, 20, 33, .78), 0 0 40px rgba(13, 23, 36, .65);
  background: linear-gradient(180deg, rgba(9, 20, 30, .88), transparent);
  opacity: .72;
  pointer-events: none;
}
[data-theme="ruins"] .adventure-game-architecture {
  left: 4%;
  right: auto;
  width: 17%;
  height: 68%;
  opacity: .45;
}
[data-theme="trail"] .adventure-game-architecture { display: none; }
.adventure-game-particles { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.adventure-game-particles i {
  position: absolute;
  left: calc(6% + var(--n) * 11%);
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #edcb8d;
  box-shadow: 0 0 12px 4px rgba(230, 188, 114, .39);
  animation: adventure-ember calc(3s + var(--n) * .47s) ease-in-out infinite alternate;
}
.adventure-game-particles i:nth-child(1) { --n: 0; top: 68%; }
.adventure-game-particles i:nth-child(2) { --n: 1; top: 32%; }
.adventure-game-particles i:nth-child(3) { --n: 2; top: 83%; }
.adventure-game-particles i:nth-child(4) { --n: 3; top: 46%; }
.adventure-game-particles i:nth-child(5) { --n: 4; top: 72%; }
.adventure-game-particles i:nth-child(6) { --n: 5; top: 25%; }
.adventure-game-particles i:nth-child(7) { --n: 6; top: 62%; }
.adventure-game-particles i:nth-child(8) { --n: 7; top: 35%; }
@keyframes adventure-ember { to { opacity: .22; transform: translate(11px,-25px) scale(.6); } }
.adventure-game-objects { position: absolute; z-index: 3; inset: 0; pointer-events: none; }
.adventure-game-object {
  position: absolute;
  display: grid;
  place-items: center;
  width: clamp(51px, 5vw, 72px);
  height: clamp(54px, 5vw, 74px);
  padding: 4px;
  transform: translate(-50%, -50%);
  pointer-events: auto;
  touch-action: manipulation;
  cursor: pointer;
  border: 2px solid rgba(218, 191, 137, .76);
  border-radius: 50% 50% 35% 35%;
  background: radial-gradient(circle at 44% 35%, #57616a, #233041 61%, #172635 90%);
  box-shadow: 0 10px 18px rgba(0, 0, 0, .58), inset 0 1px 8px rgba(255, 227, 173, .27);
  color: #f3d393;
  text-align: center;
  transition: filter .3s, border-color .3s, box-shadow .3s;
}
.adventure-game-object span { font: 700 clamp(22px, 3vw, 36px)/1 'Cinzel', 'Cairo', serif; text-shadow: 0 0 13px rgba(248, 214, 151, .9); }
.adventure-game-object small {
  position: absolute;
  top: calc(100% + 5px);
  left: 50%;
  width: max-content;
  max-width: 115px;
  transform: translateX(-50%);
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(7, 18, 30, .88);
  color: #f1e2c5;
  font: 700 10px/1.35 'Cairo', sans-serif;
}
.adventure-game-object.near, .adventure-game-object:focus-visible {
  border-color: #fff0c5;
  box-shadow: 0 0 0 5px rgba(240, 205, 138, .25), 0 0 31px rgba(239, 198, 114, .64);
}
.adventure-game-object.activated {
  border-color: #ffe1a2;
  color: #fff3d8;
  background: radial-gradient(circle, #aa8346, #584a3a 52%, #2d3c49);
  box-shadow: 0 0 36px rgba(255, 202, 107, .88), inset 0 0 15px rgba(255, 239, 192, .66);
}
.adventure-game-object.inscription { border-radius: 7px; background: linear-gradient(145deg, #727c7d, #283543); }
.adventure-game-player {
  position: absolute;
  z-index: 5;
  width: 64px;
  height: 90px;
  transform: translate(-50%, -70%);
  pointer-events: none;
  filter: drop-shadow(0 6px 10px #050e18);
  transition: left .025s linear, top .025s linear;
}
.adventure-game-player::before {
  content: "";
  position: absolute;
  bottom: 4px;
  left: 6px;
  width: 52px;
  height: 55px;
  clip-path: polygon(36% 0, 64% 0, 79% 19%, 94% 95%, 6% 95%, 21% 19%);
  background: linear-gradient(105deg, #101b2a, #476274 43%, #172336 78%, #b3935d 81%, #111d2e 90%);
  border-radius: 9px;
}
.adventure-game-portrait {
  position: absolute;
  z-index: 2;
  top: 0;
  left: 10px;
  width: 44px;
  height: 44px;
  border: 2px solid #dfbf7f;
  border-radius: 50%;
  background: #26384b center 33% / cover no-repeat;
  box-shadow: 0 0 16px rgba(238, 190, 105, .75);
}
.adventure-game-player-halo {
  position: absolute;
  bottom: -2px;
  left: -8px;
  width: 80px;
  height: 17px;
  border: 1px solid #edc883;
  border-radius: 50%;
  background: rgba(230, 183, 101, .17);
  box-shadow: 0 0 19px rgba(241, 200, 120, .85);
}
.adventure-game-player.walking .adventure-game-portrait { animation: adventure-walk .24s ease-in-out infinite alternate; }
@keyframes adventure-walk { to { transform: translateY(-3px); } }
.adventure-game-prompt, .adventure-game-cinematic {
  position: absolute;
  z-index: 6;
  left: 50%;
  transform: translateX(-50%);
  max-width: min(90%, 580px);
  padding: 7px 17px;
  border: 1px solid rgba(245, 211, 150, .68);
  border-radius: 50px;
  background: rgba(7, 18, 30, .88);
  box-shadow: 0 10px 28px rgba(0, 0, 0, .46);
  color: #f7e5c0;
  font: 700 12px/1.5 'Cairo', sans-serif;
  text-align: center;
  direction: inherit;
  pointer-events: none;
}
.adventure-game-prompt { bottom: 14px; }
.adventure-game-cinematic { top: 5%; border-radius: 7px; font-size: 14px; }
.adventure-game.awakened .adventure-game-architecture { box-shadow: inset 0 0 47px rgba(249, 199, 117, .83), 0 0 65px rgba(238, 176, 95, .8); opacity: 1; }
.adventure-game.wrong .adventure-game-object { animation: adventure-shiver .3s ease-out; }
@keyframes adventure-shiver { 50% { filter: brightness(.35); } }
.adventure-game-griffin {
  position: absolute;
  z-index: 2;
  top: 10%;
  right: 15%;
  width: clamp(165px, 22vw, 245px);
  height: clamp(112px, 15vw, 165px);
  opacity: 0;
  pointer-events: none;
  background: radial-gradient(circle at 52% 48%, rgba(253, 226, 168, .39), rgba(230, 201, 144, .1) 38%, transparent 66%);
  filter: drop-shadow(0 0 27px rgba(247, 207, 138, .65));
}
.adventure-game-griffin i {
  position: absolute;
  inset: 10% 2%;
  background: linear-gradient(145deg, #283845, #091521 70%);
  clip-path: polygon(0 43%, 29% 53%, 10% 6%, 39% 39%, 47% 53%, 48% 40%, 54% 32%, 59% 35%, 64% 53%, 86% 3%, 78% 52%, 100% 39%, 80% 69%, 63% 59%, 60% 76%, 55% 100%, 50% 73%, 41% 60%, 23% 75%);
}
[data-theme="trail"].awakened .adventure-game-griffin { animation: adventure-griffin 3s ease-out forwards; }
@keyframes adventure-griffin { 0% { opacity: 0; transform: translate(90px,32px) scale(.45); } 55% { opacity: .9; } 100% { opacity: .8; transform: translate(0,0) scale(1); } }
.adventure-game-pause, .adventure-game-completion {
  position: absolute;
  z-index: 10;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  overflow-y: auto;
  background: rgba(5, 13, 25, .81);
  backdrop-filter: blur(8px);
  color: #f3e5c8;
  text-align: center;
  direction: inherit;
}
.adventure-game-pause > div, .adventure-game-completion-card {
  width: min(100%, 480px);
  padding: clamp(22px, 4vw, 39px);
  border: 1px solid rgba(231, 191, 118, .7);
  border-radius: 5px 26px 5px 26px;
  background: radial-gradient(circle at 50% 0, rgba(157, 125, 71, .23), transparent 55%), #19283a;
  box-shadow: 0 20px 65px rgba(0, 0, 0, .64);
}
.adventure-game-pause h4, .adventure-game-completion h4 {
  margin: 8px 0 12px;
  font: 700 clamp(22px, 4vw, 34px)/1.3 'Cinzel', 'Cairo', serif;
  color: #ffe0a5;
}
.adventure-game-sigil { font-size: 45px; color: #e9c284; text-shadow: 0 0 20px #e5ad5e; }
.adventure-game-completion p { color: #e0e5db !important; font-size: 14px !important; }
.adventure-game-completion .adventure-game-next { color: #f4d293 !important; }
.adventure-game-completion span { display: block; margin: 12px 0; color: #b8c9c8; font-size: 10px; }
.adventure-game-pause button, .adventure-game-completion button {
  display: block;
  width: 100%;
  min-height: 42px;
  margin-top: 10px;
  border: 1px solid #eccb91;
  border-radius: 5px 12px 5px 12px;
  background: linear-gradient(110deg, #e5c68b, #ad854f);
  color: #142235;
  font: 800 12px 'Cairo', sans-serif;
  cursor: pointer;
}
.adventure-game-pause button + button, .adventure-game-completion button + button { background: #233549; color: #ebd8b6; }
.adventure-game-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 11px;
  color: #aebebd;
  direction: ltr;
}
.adventure-game-controls small { font-size: 11px; }
.adventure-game-dpad { display: none; }
.adventure-game-interact {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 17px;
  border: 1px solid rgba(228, 197, 139, .8);
  border-radius: 7px;
  background: linear-gradient(120deg, #d9bb7c, #9e7c51);
  color: #132134;
  font: 800 12px 'Cairo', sans-serif;
  cursor: pointer;
}
.adventure-game-interact span { font-size: 10px; }
@media (pointer: coarse), (max-width: 700px) {
  .adventure-game-hud { align-items: start; flex-direction: column; gap: 6px; }
  .adventure-game-status { width: 100%; display: flex; align-items: center; flex-wrap: wrap; justify-content: space-between; gap: 5px; }
  .adventure-game-hud-actions { flex: 1 1 100%; justify-content: space-between; }
  .adventure-game-hud-actions button { min-height: 34px; }
  .adventure-game-view { height: clamp(320px, calc(100dvh - 360px), 440px); }
  .adventure-game-controls { align-items: center; margin: 9px 0 0; }
  .adventure-game-controls small { display: none; }
  .adventure-game-dpad { display: grid; grid-template-columns: repeat(3, 43px); grid-template-rows: repeat(2, 40px); gap: 3px; }
  .adventure-game-dpad button, .adventure-game-interact {
    display: grid;
    place-items: center;
    border: 1px solid rgba(228, 197, 139, .68);
    border-radius: 7px;
    background: #23344a;
    color: #f0d9a9;
    font: 800 20px 'Cairo', sans-serif;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
  }
  .adventure-game-dpad button:active, .adventure-game-interact:active { background: #94744d; color: #142235; }
  .adventure-game-dpad [data-move="up"] { grid-column: 2; grid-row: 1; }
  .adventure-game-dpad [data-move="left"] { grid-column: 1; grid-row: 2; }
  .adventure-game-dpad [data-move="down"] { grid-column: 2; grid-row: 2; }
  .adventure-game-dpad [data-move="right"] { grid-column: 3; grid-row: 2; }
  .adventure-game-interact {
    min-width: 112px;
    min-height: 64px;
    padding: 0 13px;
    background: linear-gradient(120deg, #d9bb7c, #9e7c51);
    color: #132134;
    font-size: 13px;
    cursor: pointer;
  }
  .adventure-game-interact span { font-size: 10px; }
  .adventure-game-object small { max-width: 82px; white-space: normal; font-size: 9px; }
}
@media (prefers-reduced-motion: reduce) {
  .adventure-game-mist, .adventure-game-particles i, .adventure-game-player.walking .adventure-game-portrait, [data-theme="trail"].awakened .adventure-game-griffin { animation: none; }
  [data-theme="trail"].awakened .adventure-game-griffin { opacity: .8; }
}