/* Patterns L3: Growing Stair */

.stair-page {
  --stair-ink: #242318;
  --stair-paper: #fff0cf;
  --stair-leaf: #4e8b55;
  --stair-gold: #dba94a;
  --stair-seed: #a66e3a;
  --stair-rose: #b66b59;
  color: var(--stair-ink);
}

.stair-topbar {
  border-color: rgba(78, 139, 85, 0.28);
}

.stair-progressbar {
  background: rgba(255, 240, 207, 0.78);
  border: 1px solid rgba(78, 139, 85, 0.18);
  border-radius: 999px;
  height: 8px;
  margin: 0 auto 10px;
  max-width: 1180px;
  overflow: hidden;
}

.stair-progressbar span {
  background: linear-gradient(90deg, var(--stair-leaf), var(--stair-gold), var(--stair-rose));
  display: block;
  height: 100%;
  transition: width 320ms ease;
}

.stair-progress {
  display: flex;
  gap: 7px;
  justify-content: center;
  margin: 0 auto 12px;
}

.stair-progress__dot {
  background: rgba(36, 35, 24, 0.32);
  border: 1px solid rgba(255, 240, 207, 0.72);
  border-radius: 50%;
  height: 10px;
  width: 10px;
}

.stair-progress__dot.is-current {
  background: var(--stair-paper);
  box-shadow: 0 0 0 3px rgba(219, 169, 74, 0.22);
}

.stair-progress__dot.is-filled {
  background: var(--stair-gold);
  box-shadow: 0 0 12px rgba(219, 169, 74, 0.44);
}

.stair-room {
  margin: 0 auto;
  max-width: 1180px;
}

.stair-room__scene {
  background:
    radial-gradient(circle at 18% 18%, rgba(219, 169, 74, 0.24), transparent 24%),
    radial-gradient(circle at 80% 32%, rgba(78, 139, 85, 0.24), transparent 24%),
    linear-gradient(180deg, rgba(255, 240, 207, 0.12), rgba(36, 35, 24, 0.18)),
    url("../img/arena-patterns-sequencegarden.jpg") center center / cover no-repeat;
  border: 1px solid rgba(255, 240, 207, 0.3);
  border-radius: 8px;
  box-shadow: 0 24px 60px rgba(36, 35, 24, 0.34);
  height: min(740px, calc(100vh - 130px));
  min-height: 680px;
  overflow: hidden;
  position: relative;
  isolation: isolate;
}

.stair-room__scene::before {
  background:
    repeating-linear-gradient(90deg, rgba(255, 240, 207, 0.055) 0 1px, transparent 1px 72px),
    radial-gradient(ellipse at 50% 76%, rgba(78, 139, 85, 0.18), transparent 46%),
    linear-gradient(180deg, rgba(20, 20, 20, 0.08), transparent 48%);
  content: "";
  inset: 0;
  position: absolute;
  z-index: 1;
}

.stair-room__scene::after {
  background:
    repeating-linear-gradient(90deg, rgba(36, 35, 24, 0.12) 0 4px, transparent 4px 44px),
    linear-gradient(180deg, #6c7a4e, #3b4d35);
  border-top: 1px solid rgba(255, 240, 207, 0.2);
  bottom: -58px;
  box-shadow: 0 -20px 45px rgba(36, 35, 24, 0.3);
  content: "";
  height: 210px;
  left: -3%;
  position: absolute;
  right: -3%;
  transform: skewY(-2deg);
  z-index: -1;
}

.stair-room__arches {
  display: flex;
  gap: 18px;
  left: 6%;
  position: absolute;
  top: 28px;
  z-index: 2;
}

.stair-room__arches span {
  background: linear-gradient(180deg, rgba(255, 240, 207, 0.5), rgba(78, 139, 85, 0.48));
  border: 1px solid rgba(255, 248, 228, 0.28);
  border-radius: 28px 28px 4px 4px;
  height: 90px;
  width: 44px;
}

.stair-room__lamps {
  inset: auto 5% 72px 5%;
  pointer-events: none;
  position: absolute;
  z-index: 2;
}

.stair-room__lamps span {
  background: radial-gradient(circle, #fff6ca 0 35%, var(--stair-gold) 36% 58%, rgba(219, 169, 74, 0.08) 59%);
  border-radius: 50%;
  bottom: 0;
  box-shadow: 0 0 40px rgba(219, 169, 74, 0.5);
  height: 54px;
  position: absolute;
  width: 54px;
}

.stair-room__lamps span:first-child { left: 0; }
.stair-room__lamps span:last-child { right: 0; }

.stair-room__prompt {
  left: 50%;
  max-width: min(720px, 66%);
  position: absolute;
  text-align: center;
  text-shadow: 0 3px 10px rgba(20, 18, 16, 0.56);
  top: 3%;
  transform: translateX(-50%);
  z-index: 5;
}

.stair-room__prompt span,
.stair-shelf__title span,
.stair-card__title span,
.stair-counter span,
.stair-why span {
  color: rgba(255, 248, 228, 0.84);
  display: block;
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.stair-room__prompt h1 {
  color: #fff7df;
  font-family: var(--font-display);
  font-size: clamp(1.28rem, 2.35vw, 2rem);
  line-height: 1.04;
  margin: 3px 0 0;
}

.stair-shelf {
  background: linear-gradient(180deg, rgba(36, 35, 24, 0.9), rgba(44, 54, 40, 0.9));
  border: 2px solid rgba(255, 240, 207, 0.32);
  border-radius: 8px;
  box-shadow: 0 14px 28px rgba(28, 26, 22, 0.28);
  left: 4%;
  padding: 9px 12px;
  position: absolute;
  right: 4%;
  top: 13%;
  z-index: 4;
}

.stair-shelf__title {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 7px;
}

.stair-shelf__title strong {
  color: #fff2c8;
  font-size: 0.82rem;
}

.stair-shelf__rail {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.stair-shelf__slot {
  background: rgba(255, 240, 207, 0.08);
  border: 1px dashed rgba(255, 240, 207, 0.28);
  border-radius: 6px;
  display: grid;
  min-height: 74px;
  padding: 6px;
  place-items: center;
}

.stair-shelf__slot.is-current {
  border-color: rgba(219, 169, 74, 0.62);
}

.stair-shelf__slot.is-filled {
  background: rgba(219, 169, 74, 0.13);
  border-style: solid;
}

.stair-token {
  background: linear-gradient(180deg, #bfb49d, #706550);
  border: 2px solid rgba(255, 248, 228, 0.18);
  border-radius: 7px;
  color: #fff7df;
  display: grid;
  min-height: 60px;
  padding: 7px;
  place-items: center;
  text-align: center;
  width: 100%;
}

.stair-token.is-filled {
  background: linear-gradient(180deg, #f0d07a, #9a7431);
  box-shadow: 0 0 18px rgba(219, 169, 74, 0.28);
}

.stair-token span {
  font-size: 0.64rem;
  font-weight: 900;
  text-transform: uppercase;
}

.stair-token strong {
  font-family: var(--font-display);
  font-size: clamp(1rem, 1.25vw, 1.25rem);
  line-height: 1;
}

.stair-steps {
  display: flex;
  gap: 8px;
  justify-content: center;
  left: 50%;
  position: absolute;
  top: 28%;
  transform: translateX(-50%);
  width: min(820px, 82%);
  z-index: 5;
}

.stair-step {
  background: rgba(255, 240, 207, 0.13);
  border: 1px solid rgba(255, 240, 207, 0.24);
  border-radius: 999px;
  color: rgba(255, 248, 228, 0.74);
  flex: 1;
  font-size: 0.62rem;
  font-weight: 900;
  min-height: 34px;
  padding: 9px 10px;
  text-align: center;
  text-transform: uppercase;
}

.stair-step--active {
  background: rgba(219, 169, 74, 0.92);
  color: #2a251b;
}

.stair-step--complete {
  background: rgba(78, 139, 85, 0.88);
  color: #fff7df;
}

.stair-step--pending {
  opacity: 0.58;
}

.stair-workbench {
  align-items: stretch;
  bottom: 8%;
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1.8fr) minmax(230px, 0.78fr) minmax(180px, 0.54fr);
  left: 5%;
  position: absolute;
  right: 5%;
  top: 35%;
  z-index: 5;
}

.stair-card,
.stair-control-panel {
  background: rgba(36, 35, 24, 0.84);
  border: 1px solid rgba(255, 240, 207, 0.24);
  border-radius: 8px;
  box-shadow: 0 18px 36px rgba(28, 26, 22, 0.28);
  color: #fff7df;
}

.stair-card {
  align-content: start;
  display: grid;
  gap: 12px;
  padding: 16px;
}

.stair-card__title {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.stair-card__title strong {
  color: #fff2c8;
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 1.7vw, 1.55rem);
  line-height: 1;
}

.stair-card__track {
  align-items: center;
  display: grid;
  gap: 9px;
  position: relative;
}

.stair-card__track--terms {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  min-height: 108px;
}

.stair-card__track--gaps {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin: 0 6%;
  min-height: 54px;
}

.stair-card__track--terms::before {
  background: linear-gradient(90deg, transparent, rgba(219, 169, 74, 0.62), transparent);
  content: "";
  height: 8px;
  left: 4%;
  position: absolute;
  right: 4%;
  top: 50%;
  transform: translateY(-50%);
  z-index: 0;
}

.stair-stone {
  align-items: center;
  background:
    radial-gradient(circle at 30% 18%, rgba(255, 248, 228, 0.35), transparent 26%),
    linear-gradient(180deg, #beb49c, #6f6552);
  border: 3px solid rgba(255, 248, 228, 0.22);
  border-radius: 8px;
  box-shadow: inset 0 -14px 22px rgba(36, 35, 24, 0.28), 0 12px 18px rgba(28, 26, 22, 0.28);
  color: #fff7df;
  display: grid;
  gap: 4px;
  min-height: 96px;
  min-width: 0;
  padding: 8px;
  place-items: center;
  position: relative;
  text-align: center;
  z-index: 1;
}

.stair-stone--next {
  background:
    radial-gradient(circle at 30% 18%, rgba(255, 248, 228, 0.32), transparent 26%),
    linear-gradient(180deg, #e3c875, #8b6b2f);
  border-color: rgba(255, 248, 228, 0.58);
}

.stair-stone--next.is-ready {
  animation: stair-ready 900ms ease-in-out infinite;
}

.stair-stone span {
  font-size: 0.64rem;
  font-weight: 900;
  opacity: 0.76;
  text-transform: uppercase;
}

.stair-stone strong {
  font-family: var(--font-display);
  font-size: clamp(1.28rem, 2.4vw, 2.35rem);
  line-height: 0.9;
}

.stair-gap-marker {
  align-items: center;
  background: rgba(36, 35, 24, 0.72);
  border: 1px solid rgba(255, 240, 207, 0.2);
  border-radius: 999px;
  color: #fff7df;
  display: flex;
  font-weight: 900;
  min-height: 38px;
  justify-content: center;
  min-width: 0;
  position: relative;
  z-index: 2;
}

.stair-gap-marker.is-locked {
  background: rgba(219, 169, 74, 0.92);
  box-shadow: 0 0 14px rgba(219, 169, 74, 0.32);
  color: #2a251b;
}

.stair-card p {
  color: rgba(255, 248, 228, 0.82);
  line-height: 1.35;
  margin: 0;
}

.stair-control-panel {
  align-content: start;
  display: grid;
  gap: 10px;
  padding: 14px;
}

.stair-counter {
  display: grid;
  gap: 8px;
  text-align: center;
}

.stair-counter.is-disabled {
  opacity: 0.54;
}

.stair-counter__row {
  align-items: center;
  display: grid;
  gap: 8px;
  grid-template-columns: 42px minmax(0, 1fr) 42px;
}

.stair-counter__row button,
.stair-counter__quick button {
  background: linear-gradient(180deg, #eee0bb, #b8a06c);
  border: 2px solid rgba(36, 35, 24, 0.22);
  border-radius: 8px;
  color: #29251a;
  cursor: pointer;
  font-family: var(--font-display);
  min-height: 40px;
}

.stair-counter__row button {
  font-size: 1.2rem;
}

.stair-counter__row button:disabled,
.stair-counter__quick button:disabled {
  cursor: default;
  opacity: 0.45;
}

.stair-counter__row strong {
  align-items: center;
  background: rgba(255, 248, 228, 0.12);
  border: 1px solid rgba(255, 248, 228, 0.22);
  border-radius: 8px;
  color: #ffe29b;
  display: flex;
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 3vw, 3rem);
  justify-content: center;
  line-height: 0.9;
  min-height: 66px;
}

.stair-counter__quick {
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr 1fr;
}

.stair-counter__quick button {
  font-size: 0.82rem;
}

.stair-lock {
  background: linear-gradient(180deg, #6f6b5e, #353127);
  border: 2px solid rgba(255, 240, 207, 0.28);
  border-radius: 8px;
  color: rgba(255, 248, 228, 0.72);
  cursor: default;
  display: grid;
  gap: 5px;
  min-height: 58px;
  padding: 9px;
  place-items: center;
}

.stair-lock span {
  background: currentColor;
  border-radius: 999px;
  height: 6px;
  opacity: 0.42;
  width: 48px;
}

.stair-lock strong {
  font-family: var(--font-display);
  font-size: 0.95rem;
}

.stair-lock.is-ready {
  background: linear-gradient(180deg, #e4bc59, #785b22);
  border-color: rgba(255, 247, 212, 0.76);
  box-shadow: 0 0 20px rgba(219, 169, 74, 0.38);
  color: #241f18;
  cursor: pointer;
}

.stair-aldra {
  align-self: end;
  display: grid;
  gap: 8px;
  justify-items: center;
  min-width: 0;
  position: relative;
}

.stair-aldra__head {
  background: linear-gradient(180deg, #f1c88c, #a0664e);
  border-radius: 50%;
  height: 46px;
  position: relative;
  width: 46px;
  z-index: 2;
}

.stair-aldra__head span {
  background: rgba(36, 35, 24, 0.28);
  border-radius: 999px;
  height: 6px;
  left: 12px;
  position: absolute;
  top: 25px;
  width: 22px;
}

.stair-aldra__body {
  background: linear-gradient(180deg, #efe0bc, #80654d);
  border-radius: 26px 26px 8px 8px;
  height: 94px;
  margin-top: -10px;
  width: 66px;
}

.stair-aldra__bell {
  background: linear-gradient(180deg, #e4bc59, #7f5820);
  border-radius: 999px 999px 8px 8px;
  height: 42px;
  position: absolute;
  right: 22px;
  top: 46px;
  transform: rotate(-12deg);
  width: 38px;
}

.stair-aldra__bell::after {
  background: #ffe29b;
  border-radius: 50%;
  bottom: -5px;
  content: "";
  height: 10px;
  left: 14px;
  position: absolute;
  width: 10px;
}

.stair-aldra__bubble {
  background: rgba(36, 35, 24, 0.86);
  border: 1px solid rgba(255, 240, 207, 0.24);
  border-radius: 8px;
  box-shadow: 0 14px 28px rgba(28, 26, 22, 0.24);
  color: #fff7df;
  font-size: 0.88rem;
  font-weight: 800;
  line-height: 1.28;
  padding: 12px;
  text-align: center;
}

.stair-why {
  background: rgba(255, 248, 228, 0.12);
  border: 1px solid rgba(255, 248, 228, 0.18);
  border-radius: 8px;
  padding: 10px 12px;
}

.stair-why p {
  color: rgba(255, 248, 228, 0.86);
  line-height: 1.35;
  margin: 4px 0 0;
}

.stair-celebration {
  background: rgba(36, 35, 24, 0.9);
  border: 2px solid rgba(219, 169, 74, 0.56);
  border-radius: 8px;
  bottom: 24px;
  box-shadow: 0 18px 38px rgba(28, 26, 22, 0.34);
  color: #fff7df;
  display: grid;
  gap: 10px;
  left: 50%;
  max-width: 560px;
  padding: 16px;
  position: absolute;
  text-align: center;
  transform: translateX(-50%);
  width: min(560px, calc(100% - 44px));
  z-index: 14;
}

.stair-celebration > strong {
  color: #ffe29b;
  font-family: var(--font-display);
  font-size: 1.25rem;
}

.stair-celebration > span {
  color: rgba(255, 248, 228, 0.78);
  font-weight: 900;
}

.stair-reward {
  display: grid;
  height: 100%;
  padding: 34px;
  place-items: center;
  position: relative;
  z-index: 5;
}

.stair-reward__card {
  background: rgba(36, 35, 24, 0.9);
  border: 2px solid rgba(219, 169, 74, 0.5);
  border-radius: 8px;
  box-shadow: 0 24px 54px rgba(28, 26, 22, 0.38);
  color: #fff7df;
  display: grid;
  gap: 16px;
  max-width: 900px;
  padding: 24px;
  text-align: center;
  width: min(900px, 100%);
}

.stair-reward__copy span {
  color: #ffe29b;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.stair-reward__copy h2 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 4rem);
  line-height: 0.95;
  margin: 4px 0 6px;
}

.stair-reward__copy p {
  color: rgba(255, 248, 228, 0.82);
  margin: 0;
}

.stair-reward__tiles {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.stair-reward__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.stair-reward__badges span {
  background: rgba(255, 248, 228, 0.12);
  border: 1px solid rgba(255, 248, 228, 0.2);
  border-radius: 999px;
  color: #fff2c8;
  font-size: 0.78rem;
  font-weight: 900;
  padding: 8px 12px;
}

.stair-reward__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

@keyframes stair-ready {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

@media (max-width: 980px) {
  .stair-room__scene {
    height: auto;
    min-height: 1080px;
    overflow-y: auto;
  }

  .stair-workbench {
    grid-template-columns: 1fr;
    position: relative;
    inset: auto;
    margin: 250px 20px 30px;
  }

  .stair-aldra {
    display: none;
  }
}

@media (max-width: 720px) {
  .stair-shelf__rail,
  .stair-reward__tiles {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .stair-steps {
    flex-direction: column;
    top: 24%;
  }

  .stair-card__track {
    gap: 5px;
  }

  .stair-stone {
    min-height: 76px;
    padding: 6px;
  }

  .stair-gap-marker {
    font-size: 0.72rem;
    min-height: 30px;
  }

  .stair-room__prompt {
    max-width: calc(100% - 28px);
  }
}
