/* Learning objectives shown before Level 1 (objective.js). Sits above every screen, HUD, dock and toast. */
.lo-modal { position: fixed; inset: 0; z-index: 5000; display: grid; place-items: center; padding: 16px; background: radial-gradient(circle at 50% 45%, rgba(10, 44, 54, .78), rgba(2, 7, 12, .94) 70%); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); opacity: 0; touch-action: none; user-select: none; -webkit-user-select: none; cursor: default; }
.lo-modal[hidden] { display: none; }
.lo-modal.is-open { animation: lo-fade-in .45s ease forwards; }
.lo-modal.is-leaving { animation: lo-fade-out .45s ease forwards; }
@keyframes lo-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes lo-fade-out { from { opacity: 1; } to { opacity: 0; } }

/* While the objective is shown, nothing else is on screen (the loading text, the narrator dock, toasts). */
body.lo-open #loading-screen > *,
body.lo-open .lobby-toast,
body.lo-open .narrator,
body.lo-open .board-button,
body.lo-open .admin-badge { visibility: hidden; }

.lo-card { position: relative; overflow: hidden; width: min(880px, 100%); max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow-y: auto; padding: clamp(28px, 5vw, 56px) clamp(22px, 5vw, 64px) clamp(26px, 4vw, 44px); border-radius: 22px; border: 1px solid rgba(84, 223, 215, .38); background: linear-gradient(160deg, rgba(14, 42, 58, .97), rgba(7, 19, 31, .98) 62%); box-shadow: 0 40px 110px rgba(0, 0, 0, .6), 0 0 0 1px rgba(84, 223, 215, .08) inset, 0 0 60px rgba(84, 223, 215, .12); text-align: center; color: var(--paper, #eef1e8); }
.lo-modal.is-open .lo-card { animation: lo-rise .6s cubic-bezier(.2, .9, .3, 1.05) both; }
.lo-modal.is-leaving .lo-card { animation: lo-sink .45s ease forwards; }
@keyframes lo-rise { from { opacity: 0; transform: translateY(26px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes lo-sink { from { transform: none; } to { transform: scale(.97); } }

/* Faint laboratory grid and glow behind the text. */
.lo-card::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .22; background-image: linear-gradient(rgba(109, 190, 195, .16) 1px, transparent 1px), linear-gradient(90deg, rgba(109, 190, 195, .16) 1px, transparent 1px); background-size: 34px 34px; mask-image: radial-gradient(circle at 50% 30%, #000, transparent 70%); -webkit-mask-image: radial-gradient(circle at 50% 30%, #000, transparent 70%); }
.lo-glow { position: absolute; left: 50%; top: -140px; width: 420px; height: 280px; transform: translateX(-50%); pointer-events: none; background: radial-gradient(ellipse, rgba(84, 223, 215, .28), transparent 68%); }
.lo-card > *:not(.lo-glow) { position: relative; }

.lo-eyebrow { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 0 0 18px; font: 500 13px/1.2 "DM Mono", monospace; letter-spacing: .2em; text-transform: uppercase; color: var(--cyan, #54dfd7); }
.lo-eyebrow b { font-weight: 500; }
.lo-eyebrow span { width: 34px; height: 1px; background: currentColor; opacity: .6; }
.lo-header { margin: 0 auto clamp(10px, 2vh, 18px); max-width: 30ch; font: 700 clamp(17px, min(2.4vw, 3vh), 25px)/1.35 Manrope, sans-serif; color: var(--mint, #b4f9dc); }
/* Five objectives: wider card, and every size also follows the screen height so the list fits without scrolling. */
.lo-card { width: min(980px, 100%); padding-top: clamp(18px, 5vh, 56px); padding-bottom: clamp(16px, 4vh, 44px); touch-action: pan-y; }
.lo-eyebrow { margin-bottom: clamp(8px, 2vh, 18px); }
.lo-list { counter-reset: lo; display: grid; gap: clamp(6px, 1.3vh, 12px); margin: 0 auto; max-width: 820px; padding: 0; list-style: none; text-align: left; }
.lo-list li { counter-increment: lo; display: grid; grid-template-columns: auto 1fr; align-items: center; gap: clamp(10px, 2vw, 18px); padding: clamp(6px, 1.5vh, 14px) clamp(12px, 2vw, 20px); border-radius: 14px; border: 1px solid rgba(84, 223, 215, .2); background: rgba(84, 223, 215, .06); font: 600 clamp(13.5px, min(1.75vw, 2.25vh), 19px)/1.42 Manrope, sans-serif; color: #fff; }
.lo-list li::before { content: counter(lo); display: grid; place-items: center; width: clamp(26px, min(3.4vw, 4.2vh), 36px); aspect-ratio: 1; border-radius: 50%; border: 1px solid rgba(84, 223, 215, .55); background: rgba(84, 223, 215, .14); color: var(--cyan, #54dfd7); font: 500 clamp(14px, 1.6vw, 17px)/1 "DM Mono", monospace; }
.lo-modal.is-open .lo-list li { animation: lo-item .5s ease both; }
.lo-modal.is-open .lo-list li:nth-child(2) { animation-delay: .08s; }
.lo-modal.is-open .lo-list li:nth-child(3) { animation-delay: .16s; }
.lo-modal.is-open .lo-list li:nth-child(4) { animation-delay: .24s; }
.lo-modal.is-open .lo-list li:nth-child(5) { animation-delay: .32s; }
@keyframes lo-item { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.lo-timer { position: relative; width: clamp(56px, min(9vw, 10vh), 96px); aspect-ratio: 1; margin: clamp(10px, 2.6vh, 28px) auto 0; }
.lo-timer svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.lo-timer circle { fill: none; stroke-width: 7; }
.lo-ring-track { stroke: rgba(84, 223, 215, .14); }
.lo-ring { stroke: var(--cyan, #54dfd7); stroke-linecap: round; filter: drop-shadow(0 0 6px rgba(84, 223, 215, .55)); }
.lo-timer strong { position: absolute; inset: 0; display: grid; place-items: center; font: 500 clamp(22px, min(4vw, 4.4vh), 38px)/1 "DM Mono", monospace; color: #fff; }
.lo-timer strong.is-tick { animation: lo-tick .45s ease; }
@keyframes lo-tick { from { transform: scale(1.35); opacity: .3; } to { transform: none; opacity: 1; } }

@media (max-width: 560px) {
  .lo-eyebrow { font-size: 11px; letter-spacing: .14em; gap: 8px; }
  .lo-eyebrow span { width: 18px; }
  .lo-card { border-radius: 18px; padding-left: 16px; padding-right: 16px; }
  .lo-list li { gap: 10px; padding: 8px 12px 8px 10px; font-size: 13.5px; line-height: 1.38; }
}
@media (max-height: 520px) {
  .lo-modal { padding: 8px; }
  .lo-card { max-height: calc(100vh - 16px); max-height: calc(100dvh - 16px); }
  .lo-list li { font-size: 13px; line-height: 1.32; }
}
/* Short and wide (a phone held sideways): two columns, the fifth objective across both. */
@media (max-height: 520px) and (min-width: 700px) {
  .lo-card { width: 100%; max-width: 1100px; padding: 14px 22px 12px; }
  .lo-eyebrow { margin-bottom: 6px; }
  .lo-header { max-width: none; margin-bottom: 10px; font-size: 16px; }
  .lo-timer { width: 50px; margin-top: 8px; }
  .lo-timer strong { font-size: 20px; }
  .lo-list { grid-template-columns: 1fr 1fr; max-width: none; }
  .lo-list li:last-child { grid-column: 1 / -1; }
}
@media (prefers-reduced-motion: reduce) {
  .lo-modal.is-open .lo-card, .lo-modal.is-open .lo-list li, .lo-timer strong.is-tick { animation: none; }
}
