/* 2949: powitanie w muzyce. Mała gra: wszystkie utwory wygenerowane w Suno przy jednym albumie. */

html.x29-open,
html.x29-open body {
  overflow: hidden;
}

.x29 {
  --mint: #8eeacb;
  --gold: #f0c96b;
  --red: #ff6f5e;
  --ink: #f4f1e8;
  --muted: rgba(228, 246, 238, .7);
  --dim: rgba(228, 246, 238, .42);
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  position: fixed;
  z-index: 1000;
  inset: 0;
  overflow: hidden;
  background: #040606;
  color: var(--ink);
  opacity: 0;
  transition: opacity 500ms ease;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
}

.x29.is-open {
  opacity: 1;
}

.x29[hidden] {
  display: none;
}

.x29 .sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.x29-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.x29-vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 52%, transparent 38%, rgba(0, 0, 0, .78) 100%);
  pointer-events: none;
}

.x29-kicker {
  margin: 0 0 16px;
  color: var(--mint);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .28em;
  text-transform: uppercase;
}

/* Ekran tytułowy i końcowy. */
.x29-title,
.x29-end {
  position: absolute;
  z-index: 4;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 70px 22px 40px;
  overflow-y: auto;
  text-align: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 500ms ease, visibility 0s linear 500ms;
}

.x29[data-phase="title"] .x29-title,
.x29[data-phase="end"] .x29-end {
  opacity: 1;
  visibility: visible;
  transition: opacity 800ms ease 150ms, visibility 0s;
}

.x29-number {
  margin: 0;
  background: linear-gradient(180deg, #fff 0%, var(--mint) 68%, rgba(142, 234, 203, .35));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-family: var(--mono);
  font-size: clamp(96px, 25vw, 330px);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  line-height: .9;
  letter-spacing: -.06em;
  filter: drop-shadow(0 0 46px rgba(142, 234, 203, .28));
}

.x29-line {
  max-width: 22ch;
  margin: 20px auto 34px;
  font-size: clamp(21px, 2.8vw, 34px);
  font-weight: 680;
  line-height: 1.22;
  letter-spacing: -.025em;
}

.x29-start {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 58px;
  padding: 0 36px;
  border: 0;
  border-radius: 999px;
  background: var(--mint);
  color: #03130d;
  font: inherit;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
  cursor: pointer;
  animation: x29-pulse 2.2s ease-in-out infinite;
  transition: background 200ms ease, transform 200ms ease;
}

.x29-start:hover,
.x29-start:focus-visible {
  background: #d2fdee;
  transform: scale(1.04);
}

.x29-start:focus-visible,
.x29-skip:focus-visible,
.x29-link:focus-visible {
  outline: 2px solid rgba(142, 234, 203, .85);
  outline-offset: 4px;
}

@keyframes x29-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(142, 234, 203, .45), 0 0 40px rgba(142, 234, 203, .3); }
  50% { box-shadow: 0 0 0 16px rgba(142, 234, 203, 0), 0 0 64px rgba(142, 234, 203, .5); }
}

.x29-hint {
  margin: 26px 0 0;
  color: var(--dim);
  font-size: 13px;
  opacity: 0;
}

.x29[data-phase="title"] .x29-hint {
  animation: x29-fade 1200ms 2600ms ease both;
}

.x29-small {
  margin: 10px 0 0;
  color: var(--dim);
  font-size: 12px;
}

.x29-skip {
  position: absolute;
  z-index: 6;
  top: max(14px, env(safe-area-inset-top));
  right: 14px;
  min-height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, .07);
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  cursor: pointer;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  transition: background 200ms ease, color 200ms ease;
}

.x29-skip:hover,
.x29-skip:focus-visible {
  background: rgba(255, 255, 255, .14);
  color: #fff;
}

.x29[data-phase="end"] .x29-skip {
  display: none;
}

/* HUD jak w grze: wynik, poziom, postęp. */
.x29-hud,
.x29-bottom {
  position: absolute;
  z-index: 3;
  right: 0;
  left: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 500ms ease;
}

.x29[data-phase="run"] .x29-hud,
.x29[data-phase="run"] .x29-bottom,
.x29[data-phase="landing"] .x29-hud,
.x29[data-phase="landing"] .x29-bottom {
  opacity: 1;
}

.x29-hud {
  top: 0;
  display: flex;
  align-items: flex-start;
  gap: 24px;
  padding: max(16px, env(safe-area-inset-top)) 130px 0 clamp(16px, 3vw, 34px);
}

.x29-hud small {
  display: block;
  color: var(--dim);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
}

.x29-score b {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 4px;
  color: #fff;
  font-family: var(--mono);
  font-size: clamp(32px, 4.2vw, 52px);
  font-variant-numeric: tabular-nums;
  line-height: 1;
  text-shadow: 0 0 26px rgba(142, 234, 203, .5);
}

.x29-score em {
  color: var(--dim);
  font-size: .36em;
  font-style: normal;
  text-shadow: none;
}

.x29-level {
  position: absolute;
  top: max(18px, env(safe-area-inset-top));
  left: 50%;
  text-align: center;
  transform: translateX(-50%);
}

.x29-level b {
  display: block;
  margin-top: 6px;
  font-size: clamp(17px, 2vw, 24px);
  letter-spacing: -.01em;
  white-space: nowrap;
}

.x29-bottom {
  bottom: 0;
  display: grid;
  gap: 12px;
  padding: 0 clamp(16px, 3vw, 34px) max(18px, env(safe-area-inset-bottom));
}

.x29-meta {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--dim);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.x29-meta [data-speed] {
  font-family: var(--mono);
  letter-spacing: .04em;
}

.x29-boost {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  opacity: 0;
  transition: color 200ms ease, opacity 900ms ease;
}

/* Podpowiedź w grze pojawia się po chwili i znika, kiedy już ktoś przytrzymał. */
.x29[data-phase="run"] .x29-boost {
  animation: x29-hint 7s 2.5s ease both;
}

.x29.has-boosted .x29-boost {
  animation: none;
  opacity: 0;
}

@keyframes x29-hint {
  0% { opacity: 0; }
  12%, 80% { opacity: 1; }
  100% { opacity: 0; }
}

.x29-boost::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--mint);
  animation: x29-blink 1.2s ease-in-out infinite;
}

.x29.is-boosting .x29-boost {
  color: var(--mint);
}

@keyframes x29-blink {
  0%, 100% { opacity: .3; }
  50% { opacity: 1; }
}

.x29-progress {
  display: flex;
  gap: 3px;
  height: 4px;
}

.x29-progress i {
  position: relative;
  flex: var(--w) 1 0;
  overflow: hidden;
  border-radius: 2px;
  background: rgba(142, 234, 203, .14);
  transition: box-shadow 300ms ease;
}

.x29-progress i::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--mint);
  transform: scaleX(var(--f, 0));
  transform-origin: left center;
}

.x29-progress i.done {
  box-shadow: 0 0 12px rgba(142, 234, 203, .7);
}

/* Piosenka gotowa: jak ukończony poziom. */
.x29-keep {
  position: absolute;
  z-index: 3;
  top: 24%;
  left: 50%;
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--mint);
  font-size: clamp(15px, 1.7vw, 20px);
  font-weight: 760;
  letter-spacing: .12em;
  text-shadow: 0 0 22px rgba(142, 234, 203, .8);
  text-transform: uppercase;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%);
}

.x29-keep::before,
.x29-keep::after {
  content: "";
  width: 54px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--mint));
}

.x29-keep::after {
  background: linear-gradient(-90deg, transparent, var(--mint));
}

.x29-keep.is-on {
  animation: x29-toast 1600ms ease both;
}

@keyframes x29-toast {
  0% { opacity: 0; transform: translate(-50%, 12px) scale(.96); }
  14% { opacity: 1; transform: translate(-50%, 0) scale(1); }
  72% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -10px); }
}

/* Momenty: zdania manifestu jako sceny, nie okienka. */
.x29-moment {
  position: absolute;
  z-index: 4;
  inset: 0;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 18px;
  padding: 100px 22px;
  text-align: center;
  pointer-events: none;
  transition: opacity 380ms ease, transform 380ms ease;
}

.x29-moment::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 12% -20%;
  background: radial-gradient(closest-side, rgba(4, 6, 6, .94), rgba(4, 6, 6, .7) 55%, transparent);
  opacity: 0;
  transition: opacity 400ms ease;
}

.x29-moment.is-on::before {
  opacity: 1;
}

.x29-moment.is-out {
  opacity: 0;
  transform: scale(1.05);
}

.x29-moment-at {
  color: var(--mint);
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: .22em;
  opacity: 0;
}

.x29-moment-title {
  max-width: 15ch;
  font-size: clamp(42px, 7.6vw, 110px);
  font-weight: 820;
  line-height: .95;
  letter-spacing: -.05em;
}

.x29-moment.is-quote .x29-moment-title {
  max-width: 20ch;
  font-family: var(--serif);
  font-size: clamp(32px, 5vw, 70px);
  font-style: italic;
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -.02em;
}

.x29-moment-title .wd {
  display: inline-block;
  padding-bottom: .06em;
  background: linear-gradient(100deg, #fff 30%, var(--mint) 50%, #fff 70%);
  background-position: 100% 0;
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  opacity: 0;
  transform: translateY(.35em);
}

.x29-moment.is-on .wd {
  animation: x29-word 800ms cubic-bezier(.2, .8, .2, 1) both, x29-sweep 1800ms ease both;
  animation-delay: calc(var(--d) * 80ms), calc(var(--d) * 80ms + 280ms);
}

@keyframes x29-word {
  from { opacity: 0; transform: translateY(.35em); }
  to { opacity: 1; transform: none; }
}

@keyframes x29-sweep {
  from { background-position: 100% 0; }
  to { background-position: 0 0; }
}

.x29-moment-sub {
  max-width: 40ch;
  color: var(--muted);
  font-size: clamp(16px, 1.7vw, 22px);
  line-height: 1.5;
  opacity: 0;
}

.x29-moment.is-on .x29-moment-at,
.x29-moment.is-on .x29-moment-sub {
  animation: x29-fade 700ms 520ms ease both;
}

@keyframes x29-fade {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* Automat: trzy bębny stają na zdaniu, które wybrałem. */
.x29-reels {
  display: grid;
  justify-items: center;
  gap: 0;
  font-size: clamp(40px, 9vw, 124px);
  font-weight: 860;
  line-height: 1.25;
  letter-spacing: -.035em;
  filter: drop-shadow(0 0 26px rgba(240, 201, 107, .32));
}

.x29-reel {
  display: block;
  height: 1.25em;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(transparent, #000 18%, #000 82%, transparent);
  mask-image: linear-gradient(transparent, #000 18%, #000 82%, transparent);
}

.x29-reel b {
  display: grid;
  justify-items: center;
}

.x29-moment.is-on .x29-reel b {
  animation: x29-spin var(--dur) cubic-bezier(.12, .6, .25, 1.06) var(--delay) both;
}

@keyframes x29-spin {
  from { transform: translateY(0); }
  to { transform: translateY(var(--to)); }
}

.x29-reel span {
  display: block;
  height: 1.25em;
  color: rgba(244, 241, 232, .32);
  white-space: nowrap;
}

.x29-reel span:last-child {
  color: #fff;
}

.x29-reel:last-child span:last-child {
  color: var(--gold);
}

.x29-slot.is-on .x29-moment-sub {
  animation-delay: 1750ms;
  color: var(--ink);
  font-weight: 650;
}

.x29-slot .x29-moment-sub::before {
  content: "";
  display: block;
  width: min(220px, 50vw);
  height: 2px;
  margin: 0 auto 18px;
  background: linear-gradient(90deg, transparent, var(--gold));
}

/* Koniec: okładka powieszona jak obraz. */
.x29-end-art {
  position: relative;
  width: min(250px, 54vw, 30vh);
  margin: 0 auto 34px;
}

.x29-end-art::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: -110%;
  right: -70%;
  left: -70%;
  height: 220%;
  background: radial-gradient(38% 55% at 50% 0%, rgba(255, 246, 225, .2), transparent 72%);
  pointer-events: none;
}

.x29-end-art img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  border-radius: 3px;
  object-fit: cover;
  box-shadow: 0 40px 80px rgba(0, 0, 0, .7), 0 0 90px rgba(142, 234, 203, .14);
  -webkit-box-reflect: below 12px linear-gradient(transparent 72%, rgba(255, 255, 255, .14));
}

.x29[data-phase="end"] .x29-end-art img {
  animation: x29-hang 1400ms cubic-bezier(.2, .8, .2, 1) both;
}

@keyframes x29-hang {
  from { opacity: 0; transform: translateY(-30px) scale(.94); }
  to { opacity: 1; transform: none; }
}

.x29-end h2 {
  margin: 0 0 14px;
  font-size: clamp(46px, 7.4vw, 100px);
  font-weight: 820;
  line-height: .95;
  letter-spacing: -.05em;
}

.x29-end-text {
  max-width: 40ch;
  margin: 0 auto 30px;
  color: var(--muted);
  font-size: clamp(16px, 1.6vw, 20px);
  line-height: 1.55;
}

.x29-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px 26px;
}

.x29-enter {
  animation: none;
  box-shadow: 0 0 44px rgba(142, 234, 203, .3);
}

.x29-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 4px;
  border: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  font-weight: 650;
  text-decoration: underline;
  text-decoration-color: rgba(142, 234, 203, .5);
  text-underline-offset: 6px;
  cursor: pointer;
}

.x29-link:hover {
  color: var(--mint);
}

/* Wejście do rozmowy: mały czat, który właśnie pisze. */
.x29-talk {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 0 22px 0 14px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(24, 34, 31, .9);
  color: var(--ink);
  font-size: 15px;
  font-weight: 650;
  text-decoration: none;
  isolation: isolate;
  transition: transform 300ms ease, box-shadow 300ms ease;
}

.x29-talk::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  padding: 1px;
  border-radius: inherit;
  background: conic-gradient(from var(--x29-angle, 0deg), transparent 0 60%, rgba(142, 234, 203, .95) 75%, transparent 90%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  animation: x29-orbit 5s linear infinite;
}

@property --x29-angle {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}

@keyframes x29-orbit {
  to { --x29-angle: 360deg; }
}

.x29-talk:hover,
.x29-talk:focus-visible {
  box-shadow: 0 0 40px rgba(142, 234, 203, .25);
  transform: translateY(-2px);
}

.x29-talk-dots {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 28px;
  padding: 0 10px;
  border-radius: 14px;
  border-bottom-left-radius: 4px;
  background: rgba(60, 74, 70, .9);
}

.x29-talk-dots b {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(228, 246, 238, .85);
  animation: x29-type 1.2s ease-in-out infinite;
}

.x29-talk-dots b:nth-child(2) { animation-delay: .15s; }
.x29-talk-dots b:nth-child(3) { animation-delay: .3s; }

@keyframes x29-type {
  0%, 80%, 100% { opacity: .25; transform: none; }
  40% { opacity: 1; transform: translateY(-3px); }
}

@media (max-width: 640px) {
  .x29-hud {
    flex-direction: column;
    gap: 10px;
    padding-right: 110px;
  }

  .x29-level {
    position: static;
    text-align: left;
    transform: none;
  }

  .x29-level b {
    font-size: 16px;
  }

  .x29-keep {
    top: 27%;
  }

  .x29-keep::before,
  .x29-keep::after {
    width: 24px;
  }

  .x29-meta .x29-boost {
    max-width: 60%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .x29,
  .x29-title,
  .x29-end,
  .x29-moment {
    transition: none;
  }

  .x29-start,
  .x29-boost::before,
  .x29-end-art img {
    animation: none !important;
  }
}
