/* THE INTRO: the entry screen and the bell film (js/ui/intro.js).
   Obsidian, bronze, crimson, molten gold. No blur stacks: the one blurred
   layer is the small logo glow, and only its opacity animates. */
.intro { position: fixed; inset: 0; z-index: 1000; overflow: hidden; background: #030204; color: var(--bone); -webkit-tap-highlight-color: transparent; transition: opacity 0.65s ease; }
.intro.is-out { opacity: 0; pointer-events: none; }
.intro--calm { transition-duration: 0.25s; }

/* the film */
.intro__stage { position: absolute; inset: 0; }
.intro__video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #030204; }
.intro__stage.is-shake { animation: intro-shake 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97); }
@keyframes intro-shake {
  0% { transform: translate3d(0, 0, 0) scale(1.012); }
  12% { transform: translate3d(-6px, 4px, 0) scale(1.018); }
  26% { transform: translate3d(5px, -4px, 0) scale(1.016); }
  42% { transform: translate3d(-3px, 2px, 0) scale(1.012); }
  60% { transform: translate3d(2px, -1px, 0) scale(1.006); }
  80% { transform: translate3d(-1px, 0, 0); }
  100% { transform: translate3d(0, 0, 0); }
}
/* the glint on the title: a light band, masked to the letters of the logo */
.intro__glint { position: absolute; pointer-events: none; opacity: 0;
  -webkit-mask: url('../art/intro/threnyx-logo.png') center / 100% 100% no-repeat; mask: url('../art/intro/threnyx-logo.png') center / 100% 100% no-repeat;
  background: linear-gradient(105deg, transparent 0 38%, rgba(255, 236, 190, 0.35) 44%, rgba(255, 252, 238, 0.95) 50%, rgba(255, 236, 190, 0.35) 56%, transparent 62% 100%) 120% 0 / 260% 100% no-repeat; }
.intro__glint.is-on { animation: intro-glint 1.15s cubic-bezier(0.45, 0, 0.2, 1) forwards; }
@keyframes intro-glint {
  0% { opacity: 1; background-position: 120% 0; }
  85% { opacity: 1; }
  100% { opacity: 0; background-position: -20% 0; }
}

/* the live layer: flames, embers, the strike */
.intro__fx { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }

/* the entry screen */
.intro__entry { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 34px;
  padding: calc(env(safe-area-inset-top, 0px) + 24px) calc(env(safe-area-inset-right, 0px) + 20px) calc(env(safe-area-inset-bottom, 0px) + 18vh) calc(env(safe-area-inset-left, 0px) + 20px);
  cursor: pointer; transition: opacity 0.5s ease;
  background:
    radial-gradient(60% 34% at 50% 40%, rgba(122, 16, 32, 0.34), transparent 70%),
    radial-gradient(90% 40% at 50% 104%, rgba(140, 26, 18, 0.42), transparent 70%),
    radial-gradient(140% 80% at 50% 45%, #0b0709 0%, #040305 62%, #020103 100%); }
.intro.is-playing .intro__entry { opacity: 0; pointer-events: none; }
.intro__mark { position: relative; width: min(80vw, 440px); display: grid; justify-items: center; gap: 16px; }
.intro__logo, .intro__glow { display: block; width: 100%; height: auto; user-select: none; -webkit-user-drag: none; }
.intro__logo { position: relative; filter: drop-shadow(0 0 1px rgba(255, 200, 120, 0.7)) drop-shadow(0 2px 6px rgba(0, 0, 0, 0.8)); }
/* the molten edge: a blurred, hotter copy behind, breathing */
.intro__glow { position: absolute; left: 0; top: 0; filter: blur(9px) saturate(1.8) brightness(1.15) sepia(0.4) hue-rotate(-18deg); opacity: 0.55; animation: intro-breathe 3.8s ease-in-out infinite; }
@keyframes intro-breathe { 50% { opacity: 0.95; } }
.intro__rule { display: block; width: 58%; height: 1px; background: linear-gradient(90deg, transparent, rgba(233, 196, 111, 0.75), transparent); }

.intro__enter { position: relative; min-width: 220px; min-height: 52px; padding: 0 30px; border: 0; border-radius: 2px; background: rgba(18, 10, 10, 0.55); color: #f3d79a;
  font: 800 15px/1 var(--font-ui); letter-spacing: 0.34em; text-indent: 0.34em; text-transform: uppercase; cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(233, 196, 111, 0.55), 0 0 0 1px rgba(0, 0, 0, 0.6); }
/* the slow pulse: a glow ring whose opacity breathes */
.intro__enter::after { content: ''; position: absolute; inset: -1px; border-radius: inherit; pointer-events: none; box-shadow: 0 0 22px rgba(240, 150, 60, 0.45), inset 0 0 14px rgba(233, 196, 111, 0.25); opacity: 0.25; animation: intro-breathe-btn 2.6s ease-in-out infinite; }
@keyframes intro-breathe-btn { 50% { opacity: 1; } }
.intro__enter:focus { outline: none; }
.intro__enter:focus-visible { box-shadow: inset 0 0 0 1px rgba(233, 196, 111, 0.9), 0 0 0 3px rgba(233, 196, 111, 0.45); }
.intro__sound { margin: -18px 0 0; font: 500 13px/1.3 var(--font-ui); letter-spacing: 0.08em; color: rgba(235, 229, 216, 0.55); text-align: center; }
/* tapped, the film still loading: the button becomes a quiet loader */
.intro.is-starting .intro__enter { pointer-events: none; }
.intro.is-loading .intro__enter span { visibility: hidden; }
.intro.is-loading .intro__enter::before { content: ''; position: absolute; left: 50%; top: 50%; width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%; border: 2px solid rgba(233, 196, 111, 0.25); border-top-color: #f3d79a; animation: intro-spin 0.8s linear infinite; }
@keyframes intro-spin { to { transform: rotate(360deg); } }

/* skip */
.intro__skip { position: absolute; z-index: 3; top: calc(env(safe-area-inset-top, 0px) + 12px); right: calc(env(safe-area-inset-right, 0px) + 12px); min-width: 64px; min-height: 40px; padding: 0 14px; border: 0; border-radius: 20px;
  background: rgba(6, 4, 6, 0.42); color: rgba(243, 215, 154, 0.85); font: 600 13px/1 var(--font-ui); letter-spacing: 0.16em; text-transform: uppercase; cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(233, 196, 111, 0.28); opacity: 0; transition: opacity 0.4s ease; }
.intro__skip.is-on { opacity: 1; }
.intro__skip:focus { outline: none; }
.intro__skip:focus-visible { opacity: 1; box-shadow: inset 0 0 0 1px rgba(233, 196, 111, 0.9), 0 0 0 3px rgba(233, 196, 111, 0.4); }

/* waiting: Retry / Continue, or the game still loading */
.intro__wait { position: absolute; z-index: 4; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  padding: calc(env(safe-area-inset-top, 0px) + 24px) 24px calc(env(safe-area-inset-bottom, 0px) + 24px);
  background: radial-gradient(70% 40% at 50% 48%, rgba(90, 14, 24, 0.35), transparent 70%), #030204; animation: intro-in 0.35s ease-out; }
.intro__wait[hidden] { display: none; }
@keyframes intro-in { from { opacity: 0; } }
.intro__wait img { width: min(56vw, 280px); height: auto; opacity: 0.92; }
.intro__msg { margin: 0; font: 500 15px/1.35 var(--font-ui); letter-spacing: 0.06em; color: rgba(235, 229, 216, 0.8); text-align: center; }
.intro__bar { display: none; position: relative; width: min(44vw, 200px); height: 2px; overflow: hidden; background: rgba(233, 196, 111, 0.15); }
.intro__bar i { position: absolute; top: 0; bottom: 0; width: 40%; background: linear-gradient(90deg, transparent, #f3d79a, transparent); animation: intro-bar 1.3s ease-in-out infinite; }
@keyframes intro-bar { from { left: -40%; } to { left: 100%; } }
.intro__wait.is-loading .intro__bar { display: block; }
.intro__acts { display: flex; flex-direction: column; align-items: stretch; gap: 10px; width: min(78vw, 300px); }
.intro__acts:empty { display: none; }
.intro__btn { min-height: 48px; padding: 0 18px; border: 0; border-radius: 2px; background: rgba(255, 255, 255, 0.04); color: rgba(235, 229, 216, 0.85); font: 600 14px/1 var(--font-ui); letter-spacing: 0.18em; text-transform: uppercase; cursor: pointer; box-shadow: inset 0 0 0 1px rgba(235, 229, 216, 0.2); }
.intro__btn--main { color: #1a0f08; background: linear-gradient(180deg, #f3d79a, #c89a4a); box-shadow: 0 0 18px rgba(240, 150, 60, 0.3); }
.intro__btn:focus { outline: none; }
.intro__btn:focus-visible { box-shadow: 0 0 0 3px rgba(233, 196, 111, 0.55); }

/* reduced motion: the same screens, still */
.intro--calm .intro__glow, .intro--calm .intro__enter::after, .intro--calm .intro__bar i { animation: none; }
.intro--calm .intro__glow { opacity: 0.7; }
.intro--calm .intro__enter::after { opacity: 0.6; }
.intro--calm .intro__entry { transition-duration: 0.2s; }
@media (prefers-reduced-motion: reduce) {
  .intro__stage.is-shake, .intro__glint.is-on { animation: none; }
}
