/* Opening (lane 486): the title screen and the intro cinematic layer. Loaded after css/wowlogin.css, so the .msh-title rules below win over its title block.
   The panorama is plain CSS shapes (no images, no canvas): only transform and opacity animate, so it stays on the compositor. Motion is off under prefers-reduced-motion and under .msh-calm
   (the in-game Reduce motion setting). Targets are >= 44 px; text sits on a darkened vignette (contrast checked in tests/lane486-opening.test.cjs). */

/* ---------------------------------------------------------------- title: layout */
.msh-title { --t-gold: #f7d27a; --t-ink: #fbf3e3; --t-shade: rgba(10, 8, 12, 0.82); display: grid; grid-template-columns: minmax(0, 1fr) auto auto minmax(0, 1fr); grid-template-rows: minmax(12px, 1fr) auto auto auto auto minmax(12px, 1fr) auto; justify-items: center; align-items: center; row-gap: 10px; column-gap: 8px; padding: 12px 16px 10px; background: #0b0a10; overflow-x: hidden; overflow-y: auto; }
.msh-title > .msh-login-bg { position: fixed; inset: 0; grid-area: 1 / 1 / -1 / -1; z-index: 0; background: #0b0a10; }
.msh-title > .msh-logo, .msh-title > .msh-tagline, .msh-title > .msh-login-panel, .msh-title > .msh-login-bl, .msh-title > .msh-login-br, .msh-title > .msh-login-foot { position: relative; z-index: 1; inset: auto; transform: none; margin: 0; }
.msh-title > .msh-logo { grid-column: 1 / -1; grid-row: 2; padding: 0; text-align: center; font: 700 clamp(40px, 9.5vw, 104px)/1 Georgia, 'Times New Roman', serif; letter-spacing: 0.02em; color: var(--t-gold); background: linear-gradient(#fff3c4 8%, #f7d27a 46%, #d79a3a 92%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; text-shadow: none; filter: drop-shadow(0 3px 0 #4a2606) drop-shadow(0 8px 18px rgba(0, 0, 0, 0.85)); }
.msh-title > .msh-tagline { grid-column: 1 / -1; grid-row: 3; font: italic 400 clamp(16px, 2.3vw, 24px)/1.3 Georgia, 'Times New Roman', serif; color: var(--t-ink); text-align: center; text-shadow: 0 2px 6px #000, 0 0 18px rgba(0, 0, 0, 0.9); letter-spacing: 0.04em; }
.msh-title > .msh-login-panel { grid-column: 1 / -1; grid-row: 4; width: min(340px, calc(100vw - 32px)); margin-top: 8px; padding: 0; gap: 8px; background: none; border: 0; box-shadow: none; }
.msh-title .msh-btn-hero { min-height: 56px; font-size: 22px; letter-spacing: 0.04em; border-radius: 8px; box-shadow: 0 0 0 1px #000, 0 4px 14px rgba(0, 0, 0, 0.8), 0 0 26px rgba(247, 210, 122, 0.28), inset 0 1px 0 rgba(255, 230, 170, 0.35); }
.msh-title .msh-btn-hero { order: 1; } .msh-title .msh-status { order: 2; } .msh-title .msh-login-note { order: 3; margin: 4px 0 0; font-size: 13px; line-height: 1.35; color: #e8dcc3; text-shadow: 0 1px 3px #000, 0 0 10px #000; }
.msh-title .msh-status { min-height: 0; text-shadow: 0 1px 3px #000; }
.msh-title .msh-status:empty { display: none; }
.msh-title > .msh-login-bl { grid-column: 2; grid-row: 5; width: auto; flex-direction: row; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 6px; }
.msh-title > .msh-login-br { grid-column: 3; grid-row: 5; width: auto; margin-top: 6px; }
.msh-title .msh-login-bl .msh-btn, .msh-title .msh-login-br .msh-btn { display: block; width: auto; min-width: 44px; min-height: 44px; padding: 8px 16px; font-size: 14px; font-weight: 600; color: #f1e3c1; background: rgba(18, 14, 12, 0.72); border: 1px solid rgba(217, 180, 90, 0.7); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.7); text-shadow: 0 1px 0 #000; }
.msh-title .msh-file-btn { display: flex; align-items: center; justify-content: center; }
.msh-title .msh-login-bl .msh-btn:hover, .msh-title .msh-login-br .msh-btn:hover { background: rgba(60, 24, 20, 0.85); filter: none; }
.msh-title > .msh-login-foot { grid-column: 1 / -1; grid-row: 7; position: relative; padding: 6px 0 2px; font-size: 12px; color: #d8cbb0; text-shadow: 0 1px 3px #000; text-align: center; }
.msh-title .msh-btn:focus-visible { outline: 3px solid #ffe08a; outline-offset: 3px; }

/* phone portrait: one column */
@media (max-width: 560px) {
  .msh-title > .msh-login-bl, .msh-title > .msh-login-br { grid-column: 1 / -1; justify-content: center; width: min(340px, calc(100vw - 32px)); }
  .msh-title > .msh-login-bl { grid-row: 5; } .msh-title > .msh-login-br { grid-row: 6; align-self: start; margin-top: 0; }
  .msh-title > .msh-login-bl .msh-btn { flex: 1 1 140px; }
  .msh-title > .msh-login-br .msh-btn { flex: 0 0 auto; width: 100%; }
}
/* phone landscape and other short screens: logo and tagline on the left, actions on the right */
@media (orientation: landscape) and (max-height: 520px) {
  .msh-title { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: minmax(4px, 1fr) auto auto auto auto minmax(4px, 1fr) auto; column-gap: 20px; row-gap: 6px; padding: 8px 20px 6px; }
  .msh-title > .msh-logo { grid-column: 1; grid-row: 2 / span 2; align-self: end; font-size: clamp(32px, 11vh, 56px); text-align: left; justify-self: start; }
  .msh-title > .msh-tagline { grid-column: 1; grid-row: 4; align-self: start; justify-self: start; text-align: left; font-size: 15px; }
  .msh-title > .msh-login-panel { grid-column: 2 / -1; grid-row: 2 / span 2; width: min(320px, 100%); align-self: end; }
  .msh-title .msh-btn-hero { min-height: 52px; font-size: 20px; }
  .msh-title .msh-login-note { display: none; }
  .msh-title > .msh-login-bl { grid-column: 2; grid-row: 4; width: 100%; justify-content: stretch; flex-wrap: nowrap; margin-top: 0; align-self: start; }
  .msh-title > .msh-login-br { grid-column: 3; grid-row: 4; width: 100%; margin-top: 0; align-self: start; }
  .msh-title .msh-login-bl .msh-btn, .msh-title .msh-login-br .msh-btn { flex: 1 1 0; width: 100%; padding: 6px 8px; font-size: 13px; }
  .msh-title > .msh-login-foot { grid-row: 7; font-size: 11px; padding: 2px 0 0; }
}

/* ---------------------------------------------------------------- title: entrance */
@keyframes msh-rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes msh-fade { from { opacity: 0; } to { opacity: 1; } }
.msh-title > .msh-logo { animation: msh-rise 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) 0.1s both; }
.msh-title > .msh-tagline { animation: msh-rise 0.8s ease-out 0.45s both; }
.msh-title > .msh-login-panel { animation: msh-rise 0.8s ease-out 0.75s both; }
.msh-title > .msh-login-bl, .msh-title > .msh-login-br { animation: msh-rise 0.7s ease-out 1.05s both; }
.msh-title > .msh-login-foot { animation: msh-fade 1s ease-out 1.4s both; }
.msh-title .msh-vista { animation: msh-fade 1.4s ease-out both; }

/* ---------------------------------------------------------------- title: panorama (Ashen Vale Haven, a stand-in for the 3D town) */
.msh-vista { position: absolute; inset: 0; overflow: hidden; transform-origin: 40% 70%; animation: msh-fade 1.4s ease-out both, msh-push 80s ease-in-out 1.4s infinite alternate; }
.msh-v { position: absolute; left: -7%; right: -7%; top: 0; bottom: 0; will-change: transform; pointer-events: none; }
.msh-v-sky { left: 0; right: 0; background: linear-gradient(180deg, #121a38 0%, #33467c 28%, #b98398 58%, #f0b987 78%, #f8dca4 100%); }
.msh-v-sun { left: 0; right: 0; background: radial-gradient(circle at 74% 66%, rgba(255, 244, 205, 0.95) 0 3.5%, rgba(255, 207, 130, 0.55) 9%, rgba(255, 170, 100, 0.18) 24%, transparent 46%); animation: msh-glow 6s ease-in-out infinite alternate; }
.msh-v-far { top: auto; bottom: 30%; height: 27%; background: #5a6590; clip-path: polygon(0 100%, 0 62%, 10% 44%, 24% 58%, 38% 30%, 56% 54%, 72% 34%, 88% 52%, 100% 40%, 100% 100%); opacity: 0.9; animation: msh-drift-far 90s ease-in-out infinite alternate; }
.msh-v-mid { top: auto; bottom: 23%; height: 24%; background: linear-gradient(#3b5a58, #2a4140); clip-path: polygon(0 100%, 0 58%, 14% 40%, 30% 56%, 47% 34%, 63% 55%, 80% 38%, 100% 54%, 100% 100%); animation: msh-drift-mid 90s ease-in-out infinite alternate; }
.msh-v-spire { --sp: min(60vh, 125vw); left: 17%; right: auto; top: auto; bottom: 25%; width: calc(var(--sp) * 0.2); height: var(--sp); animation: msh-drift-spire 90s ease-in-out infinite alternate; }
.msh-sp { position: absolute; }
.msh-sp-shaft { left: 22%; right: 22%; top: 12%; bottom: 3%; clip-path: polygon(34% 0, 66% 0, 100% 100%, 0 100%); background: repeating-linear-gradient(180deg, #d4c093 0 8%, #2f8f86 8% 9.4%, #d4c093 9.4% 17%), #cdb98c; box-shadow: inset -8px 0 0 rgba(60, 40, 20, 0.25); }
.msh-sp-crown { left: 36%; right: 36%; top: 6%; height: 8%; background: radial-gradient(circle at 50% 55%, #fff1b0 0 18%, #ffb338 48%, #b36a1c 100%); border-radius: 40% 40% 20% 20%; box-shadow: 0 0 26px 10px rgba(255, 179, 56, 0.5); animation: msh-glow 3s ease-in-out infinite alternate; }
.msh-sp-crown::before { content: ''; position: absolute; left: -12%; right: -12%; bottom: 96%; height: 90%; background: #9c3f22; clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.msh-sp-ring-hi, .msh-sp-ring-lo { left: 4%; right: 4%; height: 3.4%; background: #b5602a; clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.msh-sp-ring-hi { top: 27%; } .msh-sp-ring-lo { top: 48%; left: 8%; right: 8%; }
.msh-sp-ring-hi::after, .msh-sp-ring-lo::after { content: ''; position: absolute; left: 14%; right: 14%; top: 100%; height: 220%; background: repeating-linear-gradient(90deg, #5f8f5a 0 10%, transparent 10% 22%); }
.msh-sp-plinth { left: 8%; right: 8%; bottom: 0; height: 4%; background: #9a8760; clip-path: polygon(8% 0, 92% 0, 100% 100%, 0 100%); }
.msh-v-town { top: auto; bottom: 19%; height: 17%; animation: msh-drift-town 90s ease-in-out infinite alternate; }
.msh-house { position: absolute; bottom: 0; width: 8.5%; height: 62%; background: radial-gradient(circle at 32% 60%, #ffd27a 0 7%, transparent 8%), radial-gradient(circle at 68% 60%, #ffcf6e 0 7%, transparent 8%), linear-gradient(#2b2030, #1c1620); }
.msh-roof { position: absolute; left: -9%; right: -9%; bottom: 100%; height: 58%; background: #5d2e2c; clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.msh-house-0 { left: 36%; height: 56%; } .msh-house-1 { left: 45%; width: 7%; height: 70%; } .msh-house-2 { left: 53.5%; width: 9.5%; height: 52%; }
.msh-house-3 { left: 64%; width: 7.5%; height: 64%; } .msh-house-4 { left: 72.5%; width: 9%; height: 50%; } .msh-house-5 { left: 83%; width: 7%; height: 60%; } .msh-house-6 { left: 28%; width: 6.5%; height: 46%; }
.msh-v-near { top: auto; bottom: 0; height: 24%; background: linear-gradient(#2c3a22 0%, #151b10 70%, #0b0e08 100%); clip-path: polygon(0 18%, 14% 8%, 30% 16%, 48% 6%, 66% 15%, 84% 7%, 100% 14%, 100% 100%, 0 100%); animation: msh-drift-near 90s ease-in-out infinite alternate; }
.msh-v-near::before { content: ''; position: absolute; left: 0; right: 0; top: 20%; height: 22%; background: repeating-linear-gradient(90deg, #0d0b0a 0 5px, transparent 5px 38px); opacity: 0.85; }
.msh-v-motes { animation: none; }
.msh-mote { position: absolute; bottom: 24%; width: 4px; height: 4px; border-radius: 50%; background: #ffd890; box-shadow: 0 0 8px 2px rgba(255, 190, 90, 0.8); opacity: 0; animation: msh-mote 9s linear infinite; }
.msh-mote:nth-child(1) { left: 18%; } .msh-mote:nth-child(2) { left: 29%; animation-delay: 1.6s; } .msh-mote:nth-child(3) { left: 41%; animation-delay: 3.1s; } .msh-mote:nth-child(4) { left: 52%; animation-delay: 0.8s; }
.msh-mote:nth-child(5) { left: 63%; animation-delay: 4.4s; } .msh-mote:nth-child(6) { left: 74%; animation-delay: 2.3s; } .msh-mote:nth-child(7) { left: 35%; animation-delay: 5.6s; } .msh-mote:nth-child(8) { left: 86%; animation-delay: 6.7s; }
.msh-v-shade { left: 0; right: 0; background: radial-gradient(ellipse 62% 30% at 50% 46%, rgba(8, 6, 10, 0.5) 0%, rgba(8, 6, 10, 0.3) 55%, rgba(8, 6, 10, 0) 100%), radial-gradient(ellipse at 50% 42%, rgba(8, 6, 10, 0.12) 0%, rgba(8, 6, 10, 0.42) 55%, rgba(8, 6, 10, 0.84) 100%), linear-gradient(rgba(8, 6, 10, 0.5) 0%, rgba(8, 6, 10, 0) 34%, rgba(8, 6, 10, 0) 52%, rgba(8, 6, 10, 0.72) 100%); }
@keyframes msh-push { from { transform: scale(1); } to { transform: scale(1.07); } }
@keyframes msh-drift-far { from { transform: translateX(1.2%); } to { transform: translateX(-1.2%); } }
@keyframes msh-drift-mid { from { transform: translateX(2.4%); } to { transform: translateX(-2.4%); } }
@keyframes msh-drift-spire { from { transform: translateX(3.6%); } to { transform: translateX(-3.6%); } }
@keyframes msh-drift-town { from { transform: translateX(5%); } to { transform: translateX(-5%); } }
@keyframes msh-drift-near { from { transform: translateX(7%); } to { transform: translateX(-7%); } }
@keyframes msh-mote { 0% { transform: translate(0, 0); opacity: 0; } 15% { opacity: 0.9; } 100% { transform: translate(26px, -48vh); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .msh-title .msh-vista, .msh-title .msh-v, .msh-title .msh-sp, .msh-title .msh-mote, .msh-title > .msh-logo, .msh-title > .msh-tagline, .msh-title > .msh-login-panel, .msh-title > .msh-login-bl, .msh-title > .msh-login-br, .msh-title > .msh-login-foot { animation: none !important; }
  .msh-title .msh-mote { opacity: 0.5; }
}
.msh-title.msh-calm .msh-vista, .msh-title.msh-calm .msh-v, .msh-title.msh-calm .msh-sp, .msh-title.msh-calm .msh-mote, .msh-title.msh-calm > .msh-logo, .msh-title.msh-calm > .msh-tagline, .msh-title.msh-calm > .msh-login-panel, .msh-title.msh-calm > .msh-login-bl, .msh-title.msh-calm > .msh-login-br, .msh-title.msh-calm > .msh-login-foot { animation: none !important; }
.msh-title.msh-calm .msh-mote { opacity: 0.5; }

/* ---------------------------------------------------------------- intro cinematic */
.msh-cine-layer { position: fixed; inset: 0; z-index: 10800; pointer-events: auto; touch-action: none; user-select: none; -webkit-user-select: none; font: 16px Georgia, 'Times New Roman', serif; color: #fbf3e3; --cine-bars: 0; --cine-bar-h: 11vh; }
.msh-cine-bar { position: absolute; left: 0; right: 0; height: var(--cine-bar-h); background: #000; pointer-events: none; will-change: transform; }
.msh-cine-top { top: 0; transform: translateY(calc((1 - var(--cine-bars)) * -100%)); }
.msh-cine-bottom { bottom: 0; transform: translateY(calc((1 - var(--cine-bars)) * 100%)); }
.msh-cine-card { position: absolute; left: 0; right: 0; top: 36%; padding: 0 16px; text-align: center; pointer-events: none; opacity: 0; visibility: hidden; text-shadow: 0 2px 4px #000, 0 0 24px rgba(0, 0, 0, 0.9); }
.msh-cine-card[hidden] { display: none; }
.msh-cine-zone { margin: 0; font: 700 clamp(30px, 7vw, 76px)/1.05 Georgia, 'Times New Roman', serif; letter-spacing: 0.06em; color: #f7d27a; text-transform: uppercase; }
.msh-cine-sub { margin: 8px 0 0; font: italic 400 clamp(15px, 2.2vw, 24px)/1.3 Georgia, serif; letter-spacing: 0.12em; color: #fbf3e3; }
.msh-cine-caption { position: absolute; left: 0; right: 0; bottom: calc(var(--cine-bar-h) + 18px); margin: 0; padding: 0 16px; text-align: center; font: italic 400 clamp(15px, 2vw, 22px)/1.3 Georgia, serif; letter-spacing: 0.08em; color: #fbf3e3; text-shadow: 0 2px 4px #000, 0 0 16px #000; pointer-events: none; opacity: 0; }
.msh-cine-skip { position: absolute; right: max(14px, env(safe-area-inset-right)); bottom: max(12px, env(safe-area-inset-bottom)); min-width: 112px; min-height: 44px; padding: 8px 18px; font: 700 15px Georgia, serif; letter-spacing: 0.04em; color: #f7d27a; background: rgba(18, 14, 12, 0.82); border: 2px solid #d9b45a; border-radius: 6px; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.8); cursor: pointer; z-index: 2; }
.msh-cine-skip:hover { background: rgba(70, 26, 22, 0.92); }
.msh-cine-skip:focus-visible { outline: 3px solid #ffe08a; outline-offset: 3px; }
.msh-cine-hint { position: absolute; left: max(14px, env(safe-area-inset-left)); bottom: max(18px, env(safe-area-inset-bottom)); margin: 0; font: 13px/1.3 system-ui, sans-serif; color: #efe3c8; text-shadow: 0 1px 3px #000; pointer-events: none; }
/* the HUD steps aside while the flight runs; the game canvas and this layer stay */
body.msh-cine > *:not(canvas):not(.msh-cine-layer):not(script):not(style):not(.msh-wow):not(#canvas-container) { visibility: hidden !important; }
@media (max-width: 520px) { .msh-cine-hint { display: none; } .msh-cine-skip { min-width: 96px; } }
@media (prefers-reduced-motion: reduce) { .msh-cine-bar { transition: none; } }
/* Lane 499: the prologue reuses the caption line as a subtitle: larger, narrower, on a soft dark plate so every line reads over the scene (letterbox bars stay shut). */
.msh-cine-caption.msh-cine-subtitle { left: 50%; right: auto; width: min(46em, calc(100vw - 32px)); transform: translateX(-50%); bottom: calc(var(--cine-bar-h) + 22px); padding: 12px 18px; font: italic 400 clamp(16px, 2.1vw, 24px)/1.4 Georgia, 'Times New Roman', serif; letter-spacing: 0.02em; background: rgba(8, 6, 4, 0.55); border-radius: 6px; text-wrap: balance; }
