/* My Life — hand-drawn top-down walking game */

body[data-page="my_life"] {
  overflow: hidden;
  overscroll-behavior: none;
  background: #d9ddd6;
}

.life {
  position: fixed;
  inset: 0;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

#world {
  display: block;
  width: 100%;
  height: 100%;
  cursor: crosshair;
  touch-action: none;
}

/* HUD ------------------------------------------------------------------ */
.life-hud {
  position: absolute;
  z-index: 5;
}

.life-hud--title {
  top: 86px;
  left: max(40px, calc((100vw - 1160px) / 2 + 40px));
  pointer-events: none;
}

.life-hud--title h1 {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 300;
  font-size: 44px;
  line-height: 1;
  color: #1c1b19;
}

.life-hud--title p {
  margin: 8px 0 0;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #6d6962;
}

.life-hud--journal {
  top: 90px;
  right: max(40px, calc((100vw - 1160px) / 2 + 40px));
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  padding: 8px 12px;
  border: 1px solid rgba(28, 27, 25, 0.25);
  background: rgba(243, 241, 236, 0.86);
  color: #1c1b19;
  cursor: pointer;
}

.life-hud--journal .label {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 18px;
  line-height: 1;
}

.life-hud--journal .count {
  font-size: 10px;
  letter-spacing: 0.12em;
  color: #6d6962;
}

.life-hud--journal:hover {
  border-color: #1c1b19;
}

.life-hud--title .scene {
  margin-top: 6px;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 17px;
  letter-spacing: 0;
  text-transform: none;
  color: #1c1b19;
}

.life-hud--zoom {
  right: max(24px, calc((100vw - 1160px) / 2 + 40px));
  bottom: 24px;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(28, 27, 25, 0.3);
  background: rgba(243, 241, 236, 0.9);
}

.life-hud--zoom button {
  width: 34px;
  height: 32px;
  border: none;
  background: none;
  color: #1c1b19;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.life-hud--run {
  right: max(24px, calc((100vw - 1160px) / 2 + 40px));
  bottom: 100px;
  width: 36px;
  padding: 7px 0;
  border: 1px solid rgba(28, 27, 25, 0.3);
  background: rgba(243, 241, 236, 0.9);
  color: #1c1b19;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 15px;
  cursor: pointer;
}

.life-hud--run[aria-pressed="true"] {
  background: #1c1b19;
  color: #f6f2e8;
}

.life-hud--zoom button + button {
  border-top: 1px solid rgba(28, 27, 25, 0.2);
}

#zoomMap {
  font-size: 11px;
}

body[data-life-scene="world"] .life-hud--run {
  bottom: 136px;
}

.life-hud--zoom button:hover {
  background: rgba(28, 27, 25, 0.06);
}

.life-hud--journal[hidden] {
  display: none;
}

.life-collection {
  top: 86px;
  right: max(24px, calc((100vw - 1160px) / 2 + 40px));
  width: 290px;
  padding: 10px 12px;
  border: 1px solid #b9ad98;
  background: rgba(246, 242, 232, 0.96);
  box-shadow: 3px 3px 0 rgba(59, 47, 32, 0.08);
  color: #342b24;
}
.life-collection[hidden] { display: none; }
.life-collection__rooms, .life-collection__search, .life-collection__pages { display: flex; align-items: center; gap: 8px; }
.life-collection__search { margin: 8px 0; }
.life-collection button, .life-collection select, .life-collection input {
  min-height: 32px;
  border: 1px solid #c6bba8;
  border-radius: 2px;
  background: #faf6ed;
  color: inherit;
  font: 12px Inter, sans-serif;
}
.life-collection button { padding: 5px 9px; cursor: pointer; white-space: nowrap; }
.life-collection button:hover:not(:disabled) { background: #e8ddc9; }
.life-collection button:disabled { opacity: 0.35; cursor: default; }
.life-collection input, .life-collection select { min-width: 0; flex: 1; width: 100%; padding: 5px 6px; }
.life-collection input:focus-visible, .life-collection button:focus-visible, .life-collection select:focus-visible { outline: 2px solid #9b6546; outline-offset: 2px; }
.life-collection__results[hidden] { display: none; }
.life-collection__results { display: grid; gap: 4px; margin-top: 8px; max-height: min(280px, 32vh); overflow-y: auto; }
.life-collection__results button { text-align: left; white-space: normal; padding: 7px 8px; }
.life-collection__results button[aria-current] { border-color: #997547; background: #ede1cd; }
.life-collection__results span, .life-collection__results small { display: block; }
.life-collection__results small { font-size: 10px; color: #786d5c; margin-top: 3px; }
.life-collection__pages output { flex: 1; text-align: center; font: 11px Inter, sans-serif; }
@media (max-width: 699px) {
  .life-collection { top: 138px; left: 16px; right: 16px; width: auto; padding: 7px 9px; }
  .life-collection__search { margin: 5px 0; }
  .life-collection button, .life-collection input, .life-collection select { min-height: 30px; }
  .life-hud--title .scene { max-width: calc(100vw - 32px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}

.life-symbols {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.life-travel-launcher {
  left: max(24px, calc((100vw - 1160px) / 2 + 40px));
  bottom: 24px;
  padding: 5px 5px 0;
  border: 1px solid rgba(28, 27, 25, 0.3);
  border-radius: 3px;
  background: #f6f2e8;
  color: #2a2723;
  box-shadow: 3px 4px 0 rgba(28, 27, 25, 0.1);
  cursor: pointer;
  transition: transform 0.18s, box-shadow 0.18s;
}

.life-travel-launcher:hover {
  transform: translateY(-3px) rotate(-1deg);
  box-shadow: 4px 7px 0 rgba(28, 27, 25, 0.1);
}

.life-travel-launcher #minimap {
  display: block;
  width: 180px;
  height: 113.4px;
  background: #e9e5da;
}

.life-travel-launcher__heli {
  position: absolute;
  top: -18px;
  right: -12px;
  width: 68px;
  height: 54px;
  border: 1px solid #a8a08e;
  border-radius: 50% 45% 48% 42%;
  background: #f6f2e8;
  transform: rotate(8deg);
}

.life-travel-launcher__heli svg { width: 64px; height: 50px; }
.life-travel-launcher__caption {
  display: flex;
  justify-content: space-between;
  padding: 5px 7px 6px;
  font-family: var(--font-serif);
  font-size: 20px;
  font-style: italic;
  line-height: 1;
}

/* A small paper atlas, opened from the map in the corner. */
.life-travel {
  position: fixed;
  inset: auto auto 24px max(24px, calc((100vw - 1160px) / 2 + 40px));
  margin: 0;
  padding: 24px 24px 16px;
  width: 424px;
  max-width: calc(100vw - 32px);
  max-height: calc(100dvh - 100px);
  box-sizing: border-box;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid #aaa18d;
  border-radius: 4px;
  background: #f6f2e8;
  color: #2a2723;
  box-shadow: 5px 6px 0 rgba(28, 27, 25, 0.12), 0 20px 80px rgba(28, 27, 25, 0.2);
  font-family: var(--font-sans);
}

.life-travel::backdrop { background: rgba(37, 42, 35, 0.25); }
.life-travel__head { display: flex; align-items: center; justify-content: space-between; padding-right: 12px; }
.life-travel__head > svg { width: 80px; height: 60px; transform: rotate(-6deg); }
.life-travel__eyebrow {
  margin: 0 0 5px;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #9b3d2b;
}
.life-travel h2 { margin: 0; font: italic 38px/1 var(--font-serif); }
.life-travel__intro { margin: 12px 0 18px; font-size: 12px; color: #716a5d; line-height: 1.5; }
.life-travel__worlds { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.life-travel__worlds button {
  position: relative;
  padding: 12px 11px;
  border: 1px solid #c9c1af;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.2);
  text-align: left;
  color: #2a2723;
  cursor: pointer;
}
.life-travel__worlds button span { display: block; font: 22px/1.1 var(--font-serif); }
.life-travel__worlds small { display: block; margin-top: 6px; font-size: 10px; color: #716a5d; }
.life-travel__worlds button[aria-current="location"] { border-color: #9b3d2b; background: #efe6d7; }
.life-travel__worlds button[aria-current="location"]::after {
  content: '';
  position: absolute;
  top: 7px;
  right: 7px;
  width: 4px;
  height: 4px;
  background: #9b3d2b;
  border-radius: 50%;
}
.life-travel__divider { display: flex; justify-content: space-between; gap: 8px; margin: 22px 0 10px; font-size: 10px; }
.life-travel__divider > :first-child { letter-spacing: 0.06em; text-transform: uppercase; }
#travelCount { color: #716a5d; white-space: nowrap; }
.life-travel__scope { display: flex; gap: 4px; margin: 0 0 10px; padding: 3px; border: 1px solid #c9c1af; border-radius: 3px; }
.life-travel__scope button { flex: 1; padding: 8px 6px; border: 0; border-radius: 2px; background: transparent; color: #716a5d; font-size: 11px; cursor: pointer; }
.life-travel__scope button[aria-pressed="true"] { background: #e9e1d0; color: #8c3828; }
.life-travel__scope button:hover { background: #efe8da; }
.life-travel__search { display: flex; align-items: center; gap: 9px; padding: 10px; border: 1px solid #c9c1af; background: #fcf9f1; border-radius: 2px; }
.life-travel__search svg { flex-shrink: 0; width: 17px; height: 17px; fill: none; stroke: #716a5d; stroke-width: 1.4; }
.life-travel__search input { width: 100%; min-width: 0; padding: 0; border: 0; outline: 0; background: transparent; font: 12px/1.5 var(--font-sans); color: #2a2723; user-select: text; }
.life-travel__search input::placeholder { color: #82796c; }
.life-travel__search:focus-within { outline: 2px solid #9b3d2b; outline-offset: 2px; }
.life-travel__destinations { display: grid; grid-template-columns: 1fr 1fr; align-content: start; gap: 0 12px; max-height: 184px; overflow-y: auto; overscroll-behavior: contain; margin-top: 8px; scrollbar-color: #b6ad9a transparent; scrollbar-width: thin; }
.life-travel__destinations button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  min-height: 44px;
  padding: 8px 6px;
  border: 0;
  border-bottom: 1px solid #ddd5c4;
  background: transparent;
  color: #3e3b34;
  text-align: left;
  font-size: 12px;
  cursor: pointer;
}
.life-travel__destinations small { font-size: 9px; color: #8a8070; letter-spacing: 0.05em; }
.life-travel__destination-name small { display: block; margin-top: 2px; font-size: 10px; letter-spacing: 0; }
.life-travel__destinations button:hover, .life-travel__worlds button:hover { background: #e9e1d0; }
.life-travel button:disabled { opacity: 0.5; cursor: wait; }
.life-travel__status { margin: 10px 0 0; font-size: 12px; color: #9b3d2b; line-height: 1.5; }
.life-travel__status:empty { display: none; }
.life-travel__foot { display: flex; justify-content: space-between; gap: 8px; border-top: 1px solid #c9c1af; margin-top: 16px; padding-top: 12px; font-size: 9px; color: #716a5d; }
.life-travel__foot > :last-child { white-space: nowrap; font-style: italic; }
.life-travel-launcher:focus-visible, .life-travel button:focus-visible, .life-travel__destinations:focus-visible { outline: 2px solid #9b3d2b; outline-offset: 3px; }
.life-flight {
  position: absolute;
  z-index: 10;
  left: 50%;
  top: 100px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: calc(100vw - 32px);
  padding: 6px 18px 6px 10px;
  border: 1px solid #b6ad9a;
  border-radius: 3px;
  background: #f6f2e8;
  box-shadow: 2px 3px 0 rgba(28, 27, 25, 0.1);
  font: italic 21px/1.2 var(--font-serif);
  color: #2a2723;
  pointer-events: none;
}
.life-flight[hidden] { display: none; }
.life-flight svg { flex-shrink: 0; width: 48px; height: 36px; }
@media (prefers-reduced-motion: reduce) {
  .life-travel-launcher { transition: none; }
}

.life-hud--hint {
  left: 50%;
  bottom: 22px;
  margin: 0;
  transform: translateX(-50%);
  padding: 6px 14px;
  background: rgba(243, 241, 236, 0.82);
  color: #6d6962;
  font-size: 11px;
  letter-spacing: 0.06em;
  white-space: nowrap;
  pointer-events: none;
  transition: opacity 0.8s ease;
}

.life-hud--hint.is-faded {
  opacity: 0;
}

/* Paper panels ----------------------------------------------------------- */
.life-card,
.life-journal {
  background: #f6f2e8;
  color: #1c1b19;
  border: 1px solid rgba(28, 27, 25, 0.35);
  box-shadow: 4px 5px 0 rgba(28, 27, 25, 0.12), 0 20px 40px rgba(28, 27, 25, 0.12);
}

.life-card {
  position: absolute;
  z-index: 8;
  right: max(76px, calc((100vw - 1160px) / 2 + 92px));
  bottom: 24px;
  width: min(360px, calc(100vw - 48px));
  padding: 24px 26px 22px;
  transform: rotate(-0.6deg);
  animation: card-in 0.35s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.life-card[hidden],
.life-journal[hidden] {
  display: none;
}

@keyframes card-in {
  from {
    opacity: 0;
    transform: translateY(12px) rotate(-0.6deg);
  }

  to {
    opacity: 1;
    transform: rotate(-0.6deg);
  }
}

.life-card__close {
  position: absolute;
  top: 8px;
  right: 10px;
  width: 30px;
  height: 30px;
  border: none;
  background: none;
  color: #6d6962;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.life-card__close:hover {
  color: #1c1b19;
}

.life-card__kicker {
  margin: 0 0 6px !important;
  font-size: 10px !important;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #9b3d2b !important;
}

.life-card__title {
  margin: 0 30px 10px 0;
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 30px;
  line-height: 1.1;
}

.life-card__body {
  margin: 0 !important;
  font-size: 14px !important;
  line-height: 1.6;
  color: #4a4741 !important;
}

.life-card__body:empty {
  display: none;
}

.life-card--wide {
  width: min(420px, calc(100vw - 48px));
}

.life-card__img {
  display: block;
  width: 100%;
  max-height: 260px;
  margin: 4px 0 12px;
  object-fit: contain;
  background: #ebe5d8;
  border: 1px solid rgba(28, 27, 25, 0.25);
}

.life-card__img[hidden],
.life-card__embed[hidden] {
  display: none;
}

.life-card__embed {
  margin-top: 6px;
}

.life-card__embed iframe {
  display: block;
  width: 100%;
  height: 152px;
  border: 0;
  border-radius: 12px;
}

.life-card__link {
  display: inline-block;
  margin-top: 14px;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #1c1b19;
}

/* Journal */
.life-journal {
  position: absolute;
  z-index: 9;
  top: 150px;
  right: max(24px, calc((100vw - 1160px) / 2 + 40px));
  width: min(320px, calc(100vw - 48px));
  max-height: calc(100vh - 200px);
  overflow-y: auto;
  padding: 18px 22px 16px;
}

.life-journal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.life-journal__head h2 {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 26px;
}

.life-journal__head .life-card__close {
  position: static;
}

.life-journal ol {
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: stop;
}

.life-journal li {
  display: flex;
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px solid rgba(28, 27, 25, 0.1);
  font-size: 13px;
  color: #1c1b19;
}

.life-journal li::before {
  counter-increment: stop;
  content: counter(stop, decimal-leading-zero);
  min-width: 20px;
  color: #a19c93;
  font-size: 10px;
  padding-top: 3px;
}

.life-journal li.is-unknown {
  color: #a19c93;
  font-style: italic;
}

.life-journal li .tag {
  margin-left: auto;
  color: #a19c93;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding-top: 3px;
}

/* Nav sits straight on the map; a soft paper fade (not a bar) keeps it legible */
body[data-page="my_life"] .header,
body[data-page="my_life"] .header.header--frosted {
  background: transparent;
  border-bottom-color: transparent;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.life::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 130px;
  z-index: 4;
  background: linear-gradient(to bottom, rgba(243, 241, 236, 0.85), rgba(243, 241, 236, 0));
  pointer-events: none;
}

.life-hud--title h1,
.life-hud--title p {
  text-shadow: 0 0 10px rgba(243, 241, 236, 0.9), 0 0 2px rgba(243, 241, 236, 0.9);
}

body[data-page="my_life"] .header .nav-link,
body[data-page="my_life"] .navbar-brand {
  color: #1c1b19 !important;
}

@media (max-width: 768px) {
  .life-hud--title {
    top: 70px;
    left: 16px;
  }

  .life-hud--title h1 {
    font-size: 32px;
  }

  .life-hud--journal {
    top: 72px;
    right: 16px;
  }

  .life-travel-launcher { left: 16px; bottom: 52px; }
  .life-travel-launcher #minimap { width: 134px; height: 84.42px; }
  .life-travel-launcher__heli { width: 57px; height: 46px; right: -9px; top: -15px; }
  .life-travel-launcher__heli svg { width: 54px; height: 42px; }
  .life-travel-launcher__caption { font-size: 18px; }
  .life-travel { left: 16px; bottom: max(16px, env(safe-area-inset-bottom)); padding: 22px 18px 16px; max-height: calc(100dvh - 80px); }
  .life-travel__worlds button span { font-size: 21px; }
  .life-travel__search input { font-size: 16px; }
  .life-flight { top: 135px; font-size: 19px; }

  .life-hud--zoom {
    right: 16px;
    bottom: 52px;
  }

  .life-hud--run {
    right: 16px;
    bottom: 128px;
    width: 52px;
    padding: 10px 0;
  }

  body[data-life-scene="world"] .life-hud--run {
    bottom: 164px;
  }

  .life-hud--hint {
    bottom: 14px;
    font-size: 10px;
  }

  .life-card {
    left: 16px;
    right: 16px;
    bottom: 16px;
    width: auto;
  }

  .life-journal {
    top: 130px;
    right: 16px;
  }
}

/* In-game computer */
.life-screen {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 90px 24px 24px;
  background: rgba(28, 27, 25, 0.35);
}

.life-screen[hidden] {
  display: none;
}

.life-screen__monitor {
  display: flex;
  flex-direction: column;
  width: min(1100px, 100%);
  height: min(760px, 100%);
  padding: 14px 14px 18px;
  background: #e6dfcf;
  border: 1.5px solid #1c1b19;
  border-radius: 10px;
  box-shadow: 5px 6px 0 rgba(28, 27, 25, 0.18), 0 24px 60px rgba(28, 27, 25, 0.25);
}

.life-screen__bar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 4px 10px;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 18px;
  color: #1c1b19;
}

.life-screen__bar a {
  margin-left: auto;
  font-family: var(--font-sans);
  font-style: normal;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #4a4741;
}

.life-screen__bar button {
  width: 30px;
  height: 30px;
  border: none;
  background: none;
  font-size: 22px;
  line-height: 1;
  color: #4a4741;
  cursor: pointer;
}

.life-screen iframe {
  flex: 1;
  width: 100%;
  border: 1.5px solid #1c1b19;
  border-radius: 4px;
  background: #f3f1ec;
}

/* Dialogs take focus themselves when opened; no outline on the dialog box */
.life-keepsake:focus, .life-travel:focus { outline: none; }
