/* Last Light (js/screen-ll.js, js/ll/hud.js): the title, chapter list and
   journal, and the in-game HUD. Minimal and cinematic: big type, high
   contrast, nothing over the middle of the screen while you play.
   Classes are prefixed ll-. Logical properties throughout for Arabic. */

.ll-screen,
.ll-menu-screen {
  --ll-ink: #f2efe8;
  --ll-dim: rgba(242, 239, 232, 0.72);
  --ll-faint: rgba(242, 239, 232, 0.45);
  --ll-amber: #ffc861;
  --ll-amber-deep: #d99a1e;
  --ll-steel: #9fb3c8;
  --ll-bad: #ff6a5c;
  --ll-panel: rgba(8, 11, 16, 0.72);
  --ll-line: rgba(255, 255, 255, 0.16);
  --ll-shadow: 0 2px 10px rgba(0, 0, 0, 0.75), 0 0 2px rgba(0, 0, 0, 0.9);
  font-family: var(--font, sans-serif);
  color: var(--ll-ink);
  background: #04060a;
}
.ll-screen .sr-only,
.ll-menu-screen .sr-only {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.ll-screen kbd.ll-kbd,
.ll-kbd {
  display: inline-grid;
  place-items: center;
  min-inline-size: 1.85em;
  block-size: 1.85em;
  padding: 0 0.4em;
  margin: 0;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-block-end-width: 3px;
  border-radius: 6px;
  background: rgba(10, 14, 20, 0.85);
  color: #fff;
  font: 800 0.85rem/1 var(--font, sans-serif);
  box-shadow: none;
}
.ll-kbd.mini {
  min-inline-size: 1.4em;
  block-size: 1.4em;
  font-size: 0.7rem;
  border-block-end-width: 2px;
}
.ll-pad {
  display: inline-grid;
  place-items: center;
  inline-size: 1.9em;
  block-size: 1.9em;
  border-radius: 50%;
  background: #2f8f3a;
  color: #fff;
  font: 900 0.85rem/1 var(--font, sans-serif);
}
.ll-pad-b {
  background: #b4302c;
}
.ll-ico {
  inline-size: 1.4em;
  block-size: 1.4em;
  flex: none;
}

/* ---------- Buttons ---------- */
.ll-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-block-size: 48px;
  padding: 10px 20px;
  border: 1px solid var(--ll-line);
  border-radius: 10px;
  background: rgba(10, 14, 20, 0.55);
  color: var(--ll-ink);
  font: 600 1.05rem/1.2 var(--font, sans-serif);
  text-align: start;
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
}
.ll-btn svg {
  inline-size: 22px;
  block-size: 22px;
  flex: none;
}
.ll-btn span {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ll-btn small {
  color: var(--ll-dim);
  font-size: 0.82rem;
  font-weight: 500;
}
.ll-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.35);
}
.ll-btn:focus-visible {
  outline: 3px solid var(--ll-amber);
  outline-offset: 3px;
}
.ll-btn.primary {
  background: var(--ll-amber);
  border-color: var(--ll-amber);
  color: #1a1204;
  font-weight: 800;
}
.ll-btn.primary small {
  color: rgba(26, 18, 4, 0.75);
}
.ll-btn.primary:hover {
  background: #ffd98c;
}
.ll-btn.ghost {
  background: transparent;
  border-color: transparent;
}
.ll-btn.ghost:hover {
  background: rgba(255, 255, 255, 0.08);
}
.ll-btn.big {
  min-block-size: 64px;
  padding: 12px 26px;
  font-size: 1.25rem;
}
[dir='rtl'] .ll-btn svg[aria-hidden] path[d^='M15 5'] {
  transform: scaleX(-1);
  transform-origin: center;
}

/* ---------- Menu screens: title, chapters, journal ---------- */
.ll-menu-screen {
  position: relative;
  min-block-size: 100vh;
  min-block-size: 100dvh;
  overflow: hidden;
}
.ll-bg {
  position: fixed;
  inset: 0;
  opacity: 0;
  transition: opacity 1.6s ease;
  background: radial-gradient(120% 80% at 70% 20%, #18263a 0%, #070b12 55%, #030407 100%);
}
.ll-bg.ready {
  opacity: 1;
}
.ll-bg canvas {
  position: absolute;
  inset: 0;
}
.ll-bg-shade {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(3, 4, 7, 0.88) 0%, rgba(3, 4, 7, 0.55) 38%, rgba(3, 4, 7, 0) 70%),
    linear-gradient(0deg, rgba(3, 4, 7, 0.75) 0%, rgba(3, 4, 7, 0) 35%);
}
[dir='rtl'] .ll-bg-shade {
  background:
    linear-gradient(270deg, rgba(3, 4, 7, 0.88) 0%, rgba(3, 4, 7, 0.55) 38%, rgba(3, 4, 7, 0) 70%),
    linear-gradient(0deg, rgba(3, 4, 7, 0.75) 0%, rgba(3, 4, 7, 0) 35%);
}
.ll-title-copy {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-inline-size: 560px;
  margin-block: auto;
  padding: 48px clamp(20px, 7vw, 96px);
}
.ll-kicker {
  margin: 0;
  color: var(--ll-amber);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}
.ll-logo {
  margin: 0;
  font-size: clamp(3.2rem, 9vw, 7rem);
  font-weight: 300;
  font-stretch: 125%;
  line-height: 0.95;
  letter-spacing: -0.01em;
  text-shadow: 0 0 40px rgba(255, 200, 97, 0.25), 0 4px 30px rgba(0, 0, 0, 0.6);
}
[lang='ar'] .ll-logo {
  font-weight: 700;
  letter-spacing: 0;
}
.ll-tag {
  margin: 0 0 18px;
  color: var(--ll-dim);
  font-size: 1.15rem;
  line-height: 1.45;
}
.ll-title-nav {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  max-inline-size: 360px;
}
.ll-title-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-block-start: 4px;
}
.ll-title-row .ll-btn {
  min-block-size: 44px;
  font-size: 0.95rem;
  padding-inline: 12px;
}
.ll-credit {
  position: relative;
  z-index: 2;
  margin: 0;
  padding: 0 clamp(20px, 7vw, 96px) 22px;
  color: var(--ll-faint);
  font-size: 0.78rem;
}
@media (prefers-reduced-motion: no-preference) {
  .ll-title-copy > * {
    animation: ll-rise 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  }
  .ll-title-copy > :nth-child(2) {
    animation-delay: 0.12s;
  }
  .ll-title-copy > :nth-child(3) {
    animation-delay: 0.24s;
  }
  .ll-title-copy > :nth-child(4) {
    animation-delay: 0.36s;
  }
}
@keyframes ll-rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* First run: your astronaut. */
.ll-creator {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(2, 3, 6, 0.7);
  backdrop-filter: blur(4px);
}
.ll-creator[hidden] {
  display: none;
}
.ll-creator-card {
  display: flex;
  align-items: center;
  gap: 24px;
  max-inline-size: 560px;
  padding: 26px;
  border: 1px solid var(--ll-line);
  border-radius: 16px;
  background: rgba(10, 14, 20, 0.92);
}
.ll-creator-face {
  flex: none;
  inline-size: 132px;
  block-size: 132px;
  border-radius: 50%;
  background: #1a2533 center / cover no-repeat;
  box-shadow: 0 0 0 3px var(--ll-amber);
}
.ll-creator-txt h2 {
  margin: 4px 0 8px;
  font-size: 1.8rem;
}
.ll-creator-txt p {
  margin: 0 0 16px;
  color: var(--ll-dim);
  line-height: 1.45;
}
.ll-creator-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Chapters and journal. */
.ll-list-screen {
  padding: 28px clamp(16px, 6vw, 80px) 40px;
}
.ll-list-head {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 18px;
  margin-block-end: 22px;
}
.ll-list-head h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 300;
  font-stretch: 120%;
}
.ll-list-sub {
  margin: 0;
  color: var(--ll-dim);
}
.ll-chapters {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 12px;
  max-inline-size: 640px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.ll-chapter {
  display: grid;
  gap: 4px;
  inline-size: 100%;
  padding: 18px 22px;
  border: 1px solid var(--ll-line);
  border-inline-start: 4px solid var(--ll-amber);
  border-radius: 12px;
  background: rgba(10, 14, 20, 0.7);
  color: var(--ll-ink);
  font: inherit;
  text-align: start;
  cursor: pointer;
}
.ll-chapter:hover {
  background: rgba(30, 36, 46, 0.85);
}
.ll-chapter:focus-visible {
  outline: 3px solid var(--ll-amber);
  outline-offset: 3px;
}
.ll-chapter.locked {
  border-inline-start-color: rgba(255, 255, 255, 0.2);
  opacity: 0.6;
  cursor: not-allowed;
}
.ll-chapter-n {
  color: var(--ll-amber);
  font-size: 0.85rem;
  font-weight: 700;
}
.ll-chapter-t {
  font-size: 1.6rem;
  font-weight: 600;
}
.ll-chapter-meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ll-dim);
  font-size: 0.9rem;
}
.ll-chapter-meta svg {
  inline-size: 16px;
  block-size: 16px;
}
.ll-journal {
  position: relative;
  z-index: 2;
  max-inline-size: 980px;
}
.ll-journal h2 {
  margin: 22px 0 12px;
  color: var(--ll-amber);
  font-size: 1rem;
  letter-spacing: 0.04em;
}
.ll-entries {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}
.ll-entry {
  padding: 18px 20px;
  border: 1px solid var(--ll-line);
  border-radius: 12px;
  background: rgba(10, 14, 20, 0.82);
  line-height: 1.5;
}
.ll-entry h3 {
  margin: 0 0 8px;
  font-size: 1.15rem;
}
.ll-entry p {
  margin: 0;
  color: var(--ll-dim);
  font-size: 0.95rem;
}
.ll-entry .ll-entry-src {
  margin-block-start: 10px;
  font-size: 0.82rem;
}
.ll-entry a {
  color: var(--ll-steel);
}
.ll-entry.missing {
  display: grid;
  place-items: center;
  min-block-size: 120px;
  border-style: dashed;
  background: rgba(10, 14, 20, 0.45);
}
.ll-entry.missing .ll-entry-t {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ll-faint);
}
.ll-entry.missing svg {
  inline-size: 18px;
  block-size: 18px;
}
.ll-empty {
  position: relative;
  z-index: 2;
  color: var(--ll-dim);
}

/* ---------- The game ---------- */
.ll-screen {
  position: fixed;
  inset: 0;
  overflow: hidden;
  min-block-size: 0;
  user-select: none;
  -webkit-user-select: none;
  --ctl-safe-bottom: 120px;
}
.ll-stage {
  position: absolute;
  inset: 0;
}
.ll-stage canvas {
  position: absolute;
  inset: 0;
}
.ll-hud {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
}
.ll-hud > * {
  pointer-events: none;
}
.ll-hud [hidden] {
  display: none !important;
}
/* A choice, a quick-time event or the bench owns the thumbs. */
.ll-screen.ll-busy .ctl-joy,
.ll-screen.ll-busy .ctl-hint {
  opacity: 0;
}

/* Effects over the picture. */
.ll-fx {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}
.ll-fx > div {
  position: absolute;
  inset: 0;
}
.ll-fx-vig {
  background: radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, 0.42) 100%);
}
.ll-fx-o2 {
  opacity: 0;
  background: radial-gradient(ellipse at center, transparent 22%, rgba(2, 6, 20, 0.55) 60%, rgba(0, 0, 0, 0.96) 100%);
  transition: opacity 0.6s;
}
.ll-fx-o2.beat {
  animation: ll-beat 1.05s ease-in-out infinite;
}
@keyframes ll-beat {
  0%,
  100% {
    filter: brightness(1);
  }
  12% {
    filter: brightness(1.35);
  }
  30% {
    filter: brightness(1.1);
  }
}
.ll-fx-hurt {
  opacity: 0;
  background: radial-gradient(ellipse at center, transparent 45%, rgba(160, 10, 0, 0.55) 100%);
  transition: opacity 0.4s;
}
.ll-fx-alarm {
  opacity: 0;
  background: radial-gradient(ellipse at center, transparent 50%, rgba(255, 30, 10, 0.28) 100%);
}
.ll-fx-alarm.on {
  animation: ll-alarm 1.3s ease-in-out infinite;
}
.ll-fx-alarm.still {
  opacity: 0.5;
}
@keyframes ll-alarm {
  0%,
  100% {
    opacity: 0;
  }
  45% {
    opacity: 1;
  }
}

/* Letterbox for cinematic shots. */
.ll-bars {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}
.ll-bars i {
  position: absolute;
  inset-inline: 0;
  block-size: 9vh;
  background: #000;
  transform: scaleY(0);
  transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.ll-bars i:first-child {
  inset-block-start: 0;
  transform-origin: top;
}
.ll-bars i:last-child {
  inset-block-end: 0;
  transform-origin: bottom;
}
.ll-bars.on i {
  transform: scaleY(1);
}
.ll-cine .ll-obj,
.ll-cine .ll-meters,
.ll-cine .ctl-layer {
  opacity: 0;
}

/* Objective, top left. */
.ll-obj {
  position: absolute;
  inset-block-start: max(22px, env(safe-area-inset-top));
  inset-inline-start: max(26px, env(safe-area-inset-left));
  max-inline-size: min(460px, 70vw);
  padding-inline-start: 14px;
  border-inline-start: 3px solid var(--ll-amber);
  transition: opacity 0.4s;
}
.ll-obj.out {
  opacity: 0;
}
.ll-obj-text {
  margin: 0;
  font-size: 1.22rem;
  font-weight: 650;
  line-height: 1.3;
  text-shadow: var(--ll-shadow);
}
.ll-obj-hint {
  margin: 6px 0 0;
  color: var(--ll-amber);
  font-size: 1rem;
  font-weight: 500;
  text-shadow: var(--ll-shadow);
}
@media (prefers-reduced-motion: no-preference) {
  .ll-obj.new {
    animation: ll-obj-in 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
  }
  .ll-obj-hint:not([hidden]) {
    animation: ll-fade-in 0.5s ease;
  }
}
@keyframes ll-obj-in {
  0% {
    opacity: 0;
    transform: translateX(-16px);
  }
  100% {
    opacity: 1;
    transform: none;
  }
}
[dir='rtl'] .ll-obj.new {
  animation-name: ll-obj-in-rtl;
}
@keyframes ll-obj-in-rtl {
  0% {
    opacity: 0;
    transform: translateX(16px);
  }
  100% {
    opacity: 1;
    transform: none;
  }
}
@keyframes ll-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Meters, top right, only when they matter. */
.ll-meters {
  position: absolute;
  inset-block-start: max(20px, env(safe-area-inset-top));
  inset-inline-end: 76px;
  display: grid;
  gap: 8px;
  min-inline-size: 210px;
  padding: 10px 14px;
  border-radius: 12px;
  background: linear-gradient(90deg, rgba(5, 8, 12, 0), rgba(5, 8, 12, 0.55));
}
[dir='rtl'] .ll-meters {
  background: linear-gradient(270deg, rgba(5, 8, 12, 0), rgba(5, 8, 12, 0.55));
}
.ll-meter {
  display: grid;
  grid-template-columns: 20px 48px 1fr auto;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 700;
  text-shadow: var(--ll-shadow);
}
.ll-meter .ll-ico {
  inline-size: 18px;
  block-size: 18px;
  color: var(--ll-steel);
}
.ll-meter-bar {
  position: relative;
  block-size: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.18);
  overflow: hidden;
}
.ll-meter-bar i {
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  inline-size: 100%;
  background: #e9f1f7;
  border-radius: 3px;
  transition: inline-size 0.25s linear;
}
.ll-meter-v {
  min-inline-size: 4.4em;
  text-align: end;
}
.ll-meter.warn .ll-meter-bar i {
  background: var(--ll-amber);
}
.ll-meter.warn .ll-ico,
.ll-meter.warn .ll-meter-v {
  color: var(--ll-amber);
}
.ll-meter.bad .ll-meter-bar i {
  background: var(--ll-bad);
}
.ll-meter.bad .ll-ico,
.ll-meter.bad .ll-meter-v {
  color: var(--ll-bad);
}
@media (prefers-reduced-motion: no-preference) {
  .ll-meter.bad {
    animation: ll-pulse 0.9s ease-in-out infinite;
  }
}
@keyframes ll-pulse {
  50% {
    opacity: 0.55;
  }
}

/* Countdown, top centre. */
.ll-timer {
  position: absolute;
  inset-block-start: max(18px, env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-shadow: var(--ll-shadow);
}
.ll-timer-label {
  color: var(--ll-dim);
  font-size: 0.85rem;
  font-weight: 600;
}
.ll-timer-time {
  font-size: 2.2rem;
  font-weight: 300;
  font-stretch: 112%;
  line-height: 1.1;
}
.ll-timer.low .ll-timer-time {
  color: var(--ll-bad);
  font-weight: 600;
}

/* Waypoint diamond and distance. */
.ll-way {
  position: absolute;
  left: 0;
  top: 0;
  inline-size: 0;
  block-size: 0;
  will-change: transform;
}
.ll-way-d {
  position: absolute;
  left: -9px;
  top: -9px;
  inline-size: 14px;
  block-size: 14px;
  border: 2px solid var(--ll-amber);
  background: rgba(255, 200, 97, 0.18);
  transform: rotate(45deg);
  box-shadow: 0 0 10px rgba(255, 200, 97, 0.55), 0 0 0 1px rgba(0, 0, 0, 0.5);
}
.ll-way-m {
  position: absolute;
  top: 14px;
  left: 0;
  transform: translateX(-50%);
  color: var(--ll-amber);
  font-size: 0.82rem;
  font-weight: 800;
  white-space: nowrap;
  text-shadow: var(--ll-shadow);
}
.ll-way-arrow {
  display: none;
  position: absolute;
  left: -6px;
  top: -6px;
  inline-size: 12px;
  block-size: 12px;
  border-block-start: 3px solid var(--ll-amber);
  border-inline-end: 3px solid var(--ll-amber);
  transform: rotate(var(--ang)) translateX(19px) rotate(45deg);
  transform-origin: 6px 6px;
}
[dir='rtl'] .ll-way-arrow {
  border-inline-end: 0;
  border-inline-start: 3px solid var(--ll-amber);
}
.ll-way.edge .ll-way-arrow {
  display: block;
}
.ll-way.near .ll-way-d {
  inline-size: 11px;
  block-size: 11px;
  left: -7px;
  top: -7px;
}
@media (prefers-reduced-motion: no-preference) {
  .ll-way.pulse .ll-way-d {
    animation: ll-way-pulse 1.1s ease-in-out infinite;
  }
}
@keyframes ll-way-pulse {
  50% {
    box-shadow: 0 0 22px 6px rgba(255, 200, 97, 0.75);
    transform: rotate(45deg) scale(1.35);
  }
}

/* Faint dots on lockers and finds near you. */
.ll-dots .ll-dot {
  position: absolute;
  left: -5px;
  top: -5px;
  inline-size: 10px;
  block-size: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.18), 0 0 10px rgba(255, 255, 255, 0.6);
}
.ll-dots .ll-dot.collectible {
  background: var(--ll-amber);
  box-shadow: 0 0 0 3px rgba(255, 200, 97, 0.25), 0 0 12px rgba(255, 200, 97, 0.8);
}

/* Pickups and journal finds, right side. */
.ll-toasts {
  position: absolute;
  inset-block-start: 34%;
  inset-inline-end: max(22px, env(safe-area-inset-right));
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}
.ll-toast {
  display: flex;
  align-items: center;
  gap: 10px;
  max-inline-size: 300px;
  padding: 9px 16px 9px 12px;
  border-radius: 999px;
  background: rgba(8, 11, 16, 0.78);
  border: 1px solid var(--ll-line);
  font-size: 1rem;
  font-weight: 650;
  backdrop-filter: blur(6px);
  transition: opacity 0.45s, transform 0.45s;
}
.ll-toast .ll-ico {
  color: var(--ll-amber);
}
.ll-toast span {
  display: flex;
  flex-direction: column;
}
.ll-toast small {
  color: var(--ll-amber);
  font-size: 0.75rem;
  font-weight: 700;
}
.ll-toast.journal {
  border-color: rgba(255, 200, 97, 0.5);
}
.ll-toast.dim {
  color: var(--ll-dim);
}
.ll-toast.out {
  opacity: 0;
  transform: translateX(14px);
}
@media (prefers-reduced-motion: no-preference) {
  .ll-toast {
    animation: ll-toast-in 0.35s cubic-bezier(0.2, 0.7, 0.2, 1);
  }
}
@keyframes ll-toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* Chapter title card. */
.ll-title {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 16px;
  opacity: 0;
  transition: opacity 0.7s ease;
}
.ll-title.in {
  opacity: 1;
}
.ll-title.out {
  opacity: 0;
}
.ll-title-sub {
  order: 2;
  margin: 14px 0 0;
  color: var(--ll-dim);
  font-size: clamp(1rem, 2.4vw, 1.3rem);
  text-shadow: var(--ll-shadow);
}
.ll-title-main {
  margin: 0;
  font-size: clamp(2.6rem, 8vw, 5.6rem);
  font-weight: 300;
  font-stretch: 125%;
  letter-spacing: 0.02em;
  text-shadow: 0 0 40px rgba(255, 200, 97, 0.35), 0 4px 24px rgba(0, 0, 0, 0.8);
}
@media (prefers-reduced-motion: no-preference) {
  .ll-title.in .ll-title-main {
    animation: ll-title-in 3.4s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  }
}
@keyframes ll-title-in {
  from {
    letter-spacing: 0.22em;
    filter: blur(6px);
  }
  to {
    letter-spacing: 0.02em;
    filter: blur(0);
  }
}

/* Subtitles, bottom centre. */
.ll-sub {
  position: absolute;
  inset-inline: 0;
  inset-block-end: max(54px, calc(env(safe-area-inset-bottom) + 34px));
  display: flex;
  justify-content: center;
  padding-inline: 16px;
  opacity: 0;
  transition: opacity 0.25s;
}
.ll-sub.on {
  opacity: 1;
}
.ll-sub-line {
  max-inline-size: 46ch;
  margin: 0;
  padding: 8px 18px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.42);
  font-size: clamp(1.1rem, 2.2vw, 1.4rem);
  font-weight: 550;
  line-height: 1.35;
  text-align: center;
  text-shadow: var(--ll-shadow);
}
.ll-sub-name {
  margin-inline-end: 0.5em;
  font-weight: 800;
}
.ll-sub-line.radio .ll-sub-text {
  font-style: italic;
}
.ll-sub-radio {
  display: inline-block;
  margin-inline-end: 0.35em;
  vertical-align: -0.2em;
  color: var(--ll-dim);
}
.ll-sub-radio .ll-ico {
  inline-size: 1em;
  block-size: 1em;
}

/* Timed choices (Telltale): bottom centre, keys 1-3, a closing bar. */
.ll-choice {
  position: absolute;
  inset-inline: 0;
  inset-block-end: max(130px, calc(env(safe-area-inset-bottom) + 120px));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding-inline: 16px;
  pointer-events: auto !important;
}
.ll-choice-bar {
  inline-size: min(560px, 80vw);
  block-size: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.15);
  overflow: hidden;
}
.ll-choice-bar i {
  display: block;
  block-size: 100%;
  background: #fff;
  transform-origin: center;
}
.ll-choice-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}
.ll-opt {
  display: flex;
  align-items: center;
  gap: 12px;
  min-block-size: 58px;
  max-inline-size: 320px;
  padding: 10px 20px 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 12px;
  background: rgba(6, 9, 13, 0.82);
  color: var(--ll-ink);
  font: 650 1.08rem/1.25 var(--font, sans-serif);
  text-align: start;
  cursor: pointer;
  pointer-events: auto;
  backdrop-filter: blur(6px);
  transition: transform 0.15s, background 0.15s, opacity 0.35s, border-color 0.15s;
}
.ll-opt:hover,
.ll-opt.focus,
.ll-opt:focus-visible {
  border-color: var(--ll-amber);
  background: rgba(30, 24, 10, 0.9);
  outline: none;
}
.ll-opt.locked {
  opacity: 0.55;
  cursor: not-allowed;
}
.ll-opt-lock {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--ll-dim);
  font-size: 0.8rem;
  font-weight: 500;
}
.ll-opt-lock .ll-ico {
  inline-size: 16px;
  block-size: 16px;
}
.ll-opt-text {
  flex: 1;
}
.ll-opt.picked {
  border-color: var(--ll-amber);
  background: var(--ll-amber);
  color: #1a1204;
}
.ll-opt.picked kbd {
  border-color: rgba(26, 18, 4, 0.6);
  background: rgba(255, 255, 255, 0.3);
  color: #1a1204;
}
.ll-opt.faded {
  opacity: 0;
}
.ll-opt.nope {
  animation: ll-nope 0.35s;
}
@keyframes ll-nope {
  25% {
    transform: translateX(-6px);
  }
  75% {
    transform: translateX(6px);
  }
}
@media (prefers-reduced-motion: no-preference) {
  .ll-choice.in .ll-opt {
    animation: ll-toast-in 0.4s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  }
  .ll-choice.in .ll-opt:nth-child(2) {
    animation-delay: 0.06s;
  }
  .ll-choice.in .ll-opt:nth-child(3) {
    animation-delay: 0.12s;
  }
}

/* Quick-time events: a ring with the key, in the world or bottom centre. */
.ll-qte {
  position: absolute;
  left: 0;
  top: 0;
  inline-size: 0;
  block-size: 0;
  transform: translate(50vw, 54vh);
  pointer-events: auto !important;
}
.ll-qte-btn {
  position: absolute;
  left: -58px;
  top: -58px;
  inline-size: 116px;
  block-size: 116px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(6, 9, 13, 0.8) 55%, rgba(6, 9, 13, 0) 72%);
  color: #fff;
  cursor: pointer;
  pointer-events: auto;
  touch-action: none;
}
.ll-qte-ring {
  position: absolute;
  inset: 0;
  transform: rotate(-90deg);
}
.ll-qte-ring circle {
  fill: none;
}
.ll-qte-ring .time {
  stroke: rgba(255, 255, 255, 0.6);
  stroke-width: 2.5;
}
.ll-qte-ring .track {
  stroke: rgba(255, 255, 255, 0.14);
  stroke-width: 7;
}
.ll-qte-ring .fill {
  stroke: var(--ll-amber);
  stroke-width: 7;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.08s linear;
}
.ll-qte-key {
  position: relative;
  display: grid;
  place-items: center;
  font-size: 1.4rem;
}
.ll-qte-key .ll-kbd {
  min-inline-size: 2.2em;
  block-size: 2.2em;
  font-size: 1.5rem;
  border-color: rgba(255, 255, 255, 0.8);
}
.ll-qte-key .ll-kbd.wide {
  font-size: 0.85rem;
}
.ll-qte-ad {
  display: flex;
  gap: 6px;
}
.ll-qte-ad .ll-kbd {
  min-inline-size: 1.7em;
  block-size: 1.7em;
  font-size: 0.95rem;
}
.ll-tapico .ll-ico {
  inline-size: 40px;
  block-size: 40px;
}
.ll-qte-btn.down .ll-qte-key {
  transform: scale(0.9);
}
.ll-qte-btn.k-turn .ll-qte-key {
  transform: rotate(var(--spin, 0deg));
}
.ll-qte-btn.hit {
  animation: ll-hit 0.14s ease-out;
}
@keyframes ll-hit {
  50% {
    transform: scale(1.08);
  }
}
.ll-qte-label {
  position: absolute;
  top: 66px;
  left: 0;
  transform: translateX(-50%);
  margin: 0;
  white-space: nowrap;
  font-size: 1.1rem;
  text-shadow: var(--ll-shadow);
}
.ll-qte-label b {
  color: var(--ll-amber);
  margin-inline-end: 0.3em;
}
.ll-qte.ok .ll-qte-btn {
  animation: ll-qte-ok 0.5s ease-out forwards;
}
.ll-qte.miss .ll-qte-btn {
  animation: ll-qte-miss 0.5s ease-out forwards;
}
@keyframes ll-qte-ok {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 200, 97, 0.9);
  }
  100% {
    box-shadow: 0 0 0 40px rgba(255, 200, 97, 0);
    opacity: 0;
    transform: scale(1.2);
  }
}
@keyframes ll-qte-miss {
  0%,
  100% {
    transform: none;
  }
  20%,
  60% {
    transform: translateX(-8px);
  }
  40%,
  80% {
    transform: translateX(8px);
  }
  100% {
    opacity: 0;
  }
}
.ll-qte.dock {
  transform: none !important;
  left: auto;
  top: auto;
  /* Physical right in both languages: the left thumb has the joystick. */
  right: 110px;
  inset-block-end: 160px;
  position: absolute;
}
.ll-qte.dock .ll-qte-btn {
  inline-size: 150px;
  block-size: 150px;
  left: -75px;
  top: -75px;
}
.ll-qte.dock .ll-qte-label {
  top: 84px;
}

/* The bench: the recipe on top, your things below. */
.ll-craft {
  position: absolute;
  inset-inline: 0;
  inset-block-end: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 24px 16px max(22px, env(safe-area-inset-bottom));
  background: linear-gradient(0deg, rgba(3, 5, 8, 0.92) 0%, rgba(3, 5, 8, 0.7) 70%, rgba(3, 5, 8, 0) 100%);
  pointer-events: auto !important;
}
.ll-craft-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.ll-craft-name {
  margin: 0;
  color: var(--ll-amber);
  font-size: 1rem;
  font-weight: 800;
}
.ll-craft-steps {
  display: flex;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.ll-craft-steps li {
  display: grid;
  place-items: center;
  inline-size: 50px;
  block-size: 50px;
  border: 2px dashed rgba(255, 255, 255, 0.25);
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.3);
}
.ll-craft-steps li.done {
  border-style: solid;
  border-color: var(--ll-amber);
  background: rgba(255, 200, 97, 0.18);
  color: var(--ll-amber);
}
.ll-craft-steps li.next {
  border-color: #fff;
  color: #fff;
}
@media (prefers-reduced-motion: no-preference) {
  .ll-craft-steps li.next {
    animation: ll-pulse 1.2s ease-in-out infinite;
  }
}
.ll-craft-steps .ll-ico {
  inline-size: 28px;
  block-size: 28px;
}
.ll-craft-hint {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 650;
  text-shadow: var(--ll-shadow);
}
.ll-craft-hint.missing {
  color: var(--ll-bad);
}
.ll-craft.wrong .ll-craft-steps {
  animation: ll-nope 0.35s;
}
.ll-craft-inv {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  max-inline-size: 900px;
}
.ll-inv-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  inline-size: 96px;
  padding: 12px 6px 8px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 12px;
  background: rgba(14, 19, 26, 0.9);
  color: var(--ll-ink);
  font: 600 0.8rem/1.2 var(--font, sans-serif);
  cursor: pointer;
  pointer-events: auto;
}
.ll-inv-item .ll-ico {
  inline-size: 30px;
  block-size: 30px;
  color: var(--ll-steel);
}
.ll-inv-item:hover,
.ll-inv-item.focus,
.ll-inv-item:focus-visible {
  border-color: var(--ll-amber);
  outline: none;
}
.ll-inv-n {
  position: absolute;
  inset-block-start: 4px;
  inset-inline-end: 6px;
  color: var(--ll-amber);
}
.ll-inv-item .ll-kbd.mini {
  position: absolute;
  inset-block-start: 4px;
  inset-inline-start: 4px;
}
.ll-craft-empty {
  color: var(--ll-dim);
}
.ll-craft-leave {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-block-size: 44px;
  padding: 6px 14px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ll-dim);
  font: 600 0.95rem var(--font, sans-serif);
  cursor: pointer;
  pointer-events: auto;
}
.ll-craft-leave:hover {
  color: #fff;
}

/* Pause button (always reachable on phones). */
.ll-pausebtn {
  position: absolute;
  inset-block-start: max(14px, env(safe-area-inset-top));
  inset-inline-end: max(14px, env(safe-area-inset-right));
  display: grid;
  place-items: center;
  inline-size: 48px;
  block-size: 48px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  background: rgba(6, 9, 13, 0.45);
  color: rgba(255, 255, 255, 0.85);
  cursor: pointer;
  pointer-events: auto !important;
}
.ll-pausebtn:focus-visible {
  outline: 3px solid var(--ll-amber);
}

/* Fade to black (and the failure line on it). */
.ll-fade {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px;
  background: #000;
  opacity: 1;
  pointer-events: none;
  transition-property: opacity;
  transition-timing-function: ease;
  text-align: center;
}
.ll-fade p {
  margin: 0;
  opacity: 0;
  transition: opacity 0.6s 0.3s;
}
.ll-fade.has-text p {
  opacity: 1;
}
.ll-fade-text {
  font-size: clamp(1.4rem, 3.4vw, 2.2rem);
  font-weight: 300;
  font-stretch: 112%;
}
.ll-fade-sub {
  color: rgba(242, 239, 232, 0.62);
  font-size: 0.95rem;
}

/* Pause menu and chapter end card. */
.ll-menu {
  position: absolute;
  inset: 0;
  z-index: 9;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(2, 3, 6, 0.66);
  backdrop-filter: blur(6px);
}
.ll-menu[hidden] {
  display: none;
}
.ll-menu.ll-end-wrap {
  background: transparent;
  backdrop-filter: none;
}
.ll-menu-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  inline-size: min(420px, 100%);
}
.ll-menu-card h2 {
  margin: 0 0 10px;
  font-size: clamp(2rem, 6vw, 3rem);
  font-weight: 300;
  font-stretch: 120%;
}
.ll-menu-btns {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ll-menu-note {
  margin: 8px 0 0;
  color: var(--ll-faint);
  font-size: 0.85rem;
}
.ll-end {
  inline-size: min(520px, 100%);
}
.ll-end h2 {
  font-size: clamp(2.4rem, 8vw, 4rem);
}
.ll-end-rows {
  display: grid;
  gap: 2px;
  margin-block-end: 16px;
  border-block: 1px solid var(--ll-line);
}
.ll-end-row {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 0;
  font-size: 1.05rem;
}
.ll-end-row + .ll-end-row {
  border-block-start: 1px solid rgba(255, 255, 255, 0.08);
}
.ll-end-row span {
  color: var(--ll-dim);
}
.ll-end-row b {
  text-align: end;
  font-weight: 650;
}
.ll-tbc {
  margin: 0 0 6px;
  color: var(--ll-dim);
  font-size: 1.1rem;
  font-style: italic;
}

/* The controller's prompt and joystick, in this game's look. */
.ll-screen .ctl-prompt {
  padding: 7px 16px 7px 7px;
  border-color: rgba(255, 255, 255, 0.35);
  background: rgba(6, 9, 13, 0.82);
  font-size: 1rem;
}
[dir='rtl'] .ll-screen .ctl-prompt {
  padding: 7px 7px 7px 16px;
}
.ll-screen .ctl-prompt kbd {
  background: var(--ll-amber);
  border-color: var(--ll-amber-deep);
}
.ll-screen .ctl-prompt.is-dock {
  min-block-size: 72px;
  bottom: 150px;
  background: rgba(217, 154, 30, 0.95);
  color: #1a1204;
  font-size: 1.1rem;
}
.ll-screen .ctl-hint {
  inset-block-end: 18px;
}

/* ---------- Phones ---------- */
@media (max-width: 640px) {
  .ll-title-copy {
    margin-block: auto 0;
    padding: 32px 20px 16px;
  }
  .ll-tag {
    font-size: 1rem;
  }
  .ll-title-nav {
    max-inline-size: none;
  }
  .ll-bg-shade {
    background: linear-gradient(0deg, rgba(3, 4, 7, 0.95) 0%, rgba(3, 4, 7, 0.6) 55%, rgba(3, 4, 7, 0.15) 100%);
  }
  .ll-creator-card {
    flex-direction: column;
    text-align: center;
  }
  .ll-creator-actions {
    justify-content: center;
  }
  /* The top of a phone, in order: objective (two lines, hint two lines),
     then the meters as one row, then the countdown. */
  .ll-obj {
    inset-inline-start: 16px;
    max-inline-size: calc(100vw - 84px);
  }
  .ll-obj-text,
  .ll-obj-hint {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
  }
  .ll-obj-text {
    font-size: 1.05rem;
  }
  .ll-obj-hint {
    font-size: 0.9rem;
  }
  .ll-meters,
  [dir='rtl'] .ll-meters {
    inset-block-start: 118px;
    inset-inline: 10px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px 14px;
    min-inline-size: 0;
    padding: 4px 8px;
    background: rgba(5, 8, 12, 0.45);
  }
  .ll-meter {
    grid-template-columns: 16px 44px auto;
    gap: 5px;
    font-size: 0.78rem;
  }
  .ll-meter-l {
    display: none;
  }
  .ll-meter-bar {
    inline-size: 44px;
  }
  .ll-meter-v {
    min-inline-size: 0;
  }
  .ll-timer {
    inset-block-start: 152px;
  }
  .ll-timer-time {
    font-size: 1.7rem;
  }
  .ll-toasts {
    inset-block-start: 216px !important;
  }
  .ll-sub {
    inset-block-end: max(244px, calc(env(safe-area-inset-bottom) + 232px));
  }
  .ll-sub-line {
    font-size: 1.05rem;
  }
  .ll-choice {
    inset-block-end: max(24px, env(safe-area-inset-bottom));
  }
  .ll-choice-row {
    flex-direction: column;
    align-items: stretch;
    inline-size: 100%;
  }
  .ll-opt {
    max-inline-size: none;
  }
  .ll-qte.dock {
    right: 95px;
    inset-block-end: 130px;
  }
  .ll-inv-item {
    inline-size: 76px;
  }
  .ll-craft-steps li {
    inline-size: 42px;
    block-size: 42px;
  }
  .ll-end-row {
    flex-direction: column;
    gap: 2px;
  }
  .ll-end-row b {
    text-align: start;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ll-bars i,
  .ll-title,
  .ll-toast,
  .ll-fade {
    transition-duration: 0.01s !important;
  }
}
