/* Geometry L7: Fold and Fill */

.fold-page {
  --fold-ink: #251f1b;
  --fold-paper: #fff2d8;
  --fold-gold: #d6a84f;
  --fold-clay: #b86a50;
  --fold-teal: #4f8c8a;
  --fold-blue: #576f9e;
  color: var(--fold-ink);
}

.fold-topbar {
  border-color: rgba(214, 168, 79, 0.28);
}

.fold-progressbar {
  background: rgba(255, 242, 216, 0.78);
  border: 1px solid rgba(214, 168, 79, 0.18);
  border-radius: 999px;
  height: 8px;
  margin: 0 auto 10px;
  max-width: 1180px;
  overflow: hidden;
}

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

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

.fold-progress__dot {
  background: rgba(37, 31, 27, 0.32);
  border: 1px solid rgba(255, 242, 216, 0.72);
  border-radius: 50%;
  height: 10px;
  width: 10px;
}

.fold-progress__dot.is-current {
  background: var(--fold-paper);
  box-shadow: 0 0 0 3px rgba(214, 168, 79, 0.22);
}

.fold-progress__dot.is-filled {
  background: var(--fold-gold);
  box-shadow: 0 0 12px rgba(214, 168, 79, 0.44);
}

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

.fold-room__scene {
  background:
    radial-gradient(circle at 18% 18%, rgba(214, 168, 79, 0.22), transparent 24%),
    radial-gradient(circle at 82% 31%, rgba(79, 140, 138, 0.24), transparent 25%),
    linear-gradient(180deg, rgba(255, 242, 216, 0.12), rgba(37, 31, 27, 0.2)),
    url("../img/arena-geometry-workshop.jpg") center center / cover no-repeat;
  border: 1px solid rgba(255, 242, 216, 0.3);
  border-radius: 8px;
  box-shadow: 0 24px 60px rgba(37, 31, 27, 0.34);
  height: min(740px, calc(100vh - 130px));
  min-height: 680px;
  overflow: hidden;
  position: relative;
  isolation: isolate;
}

.fold-room__scene::before {
  background:
    repeating-linear-gradient(90deg, rgba(255, 242, 216, 0.055) 0 1px, transparent 1px 72px),
    radial-gradient(ellipse at 50% 76%, rgba(214, 168, 79, 0.13), transparent 46%),
    linear-gradient(180deg, rgba(20, 20, 20, 0.08), transparent 48%);
  content: "";
  inset: 0;
  position: absolute;
  z-index: 1;
}

.fold-room__scene::after {
  background:
    repeating-linear-gradient(90deg, rgba(37, 31, 27, 0.12) 0 4px, transparent 4px 44px),
    linear-gradient(180deg, #756a59, #3a3743);
  border-top: 1px solid rgba(255, 242, 216, 0.2);
  bottom: -58px;
  box-shadow: 0 -20px 45px rgba(37, 31, 27, 0.3);
  content: "";
  height: 210px;
  left: -3%;
  position: absolute;
  right: -3%;
  transform: skewY(-2deg);
  z-index: -1;
}

.fold-room__rafters {
  display: flex;
  gap: 22px;
  left: 5%;
  position: absolute;
  top: 30px;
  z-index: 2;
}

.fold-room__rafters span {
  background: linear-gradient(180deg, rgba(255, 242, 216, 0.48), rgba(75, 68, 76, 0.42));
  border: 1px solid rgba(255, 248, 228, 0.26);
  border-radius: 8px;
  height: 86px;
  transform: skewX(-13deg);
  width: 36px;
}

.fold-room__cubes {
  bottom: 76px;
  display: flex;
  gap: 10px;
  pointer-events: none;
  position: absolute;
  right: 6%;
  z-index: 2;
}

.fold-room__cubes span {
  background: linear-gradient(135deg, #f0d382, #8d6c38);
  border: 1px solid rgba(255, 248, 228, 0.34);
  border-radius: 4px;
  box-shadow: 0 12px 20px rgba(37, 31, 27, 0.3);
  height: 34px;
  transform: rotate(12deg);
  width: 34px;
}

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

.fold-room__prompt span,
.fold-shelf__title span,
.fold-card__title span,
.fold-counter-panel > span,
.fold-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;
}

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

.fold-shelf {
  background: linear-gradient(180deg, rgba(37, 31, 27, 0.9), rgba(55, 60, 70, 0.9));
  border: 2px solid rgba(255, 242, 216, 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;
}

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

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

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

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

.fold-shelf__slot.is-current {
  border-color: rgba(214, 168, 79, 0.62);
}

.fold-shelf__slot.is-filled {
  background: rgba(214, 168, 79, 0.13);
  border-style: solid;
}

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

.fold-token.is-filled {
  background: linear-gradient(180deg, #e6ca74, #7c7040);
  box-shadow: 0 0 18px rgba(214, 168, 79, 0.28);
}

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

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

.fold-steps {
  display: flex;
  gap: 8px;
  justify-content: center;
  left: 50%;
  max-width: 760px;
  position: absolute;
  top: 27%;
  transform: translateX(-50%);
  width: 74%;
  z-index: 5;
}

.fold-step {
  background: rgba(255, 242, 216, 0.86);
  border: 1px solid rgba(37, 31, 27, 0.1);
  border-radius: 999px;
  color: rgba(37, 31, 27, 0.72);
  flex: 1;
  font-size: 0.66rem;
  font-weight: 900;
  min-height: 28px;
  padding: 7px 10px;
  text-align: center;
}

.fold-step--active {
  background: #fff8df;
  color: var(--fold-clay);
  box-shadow: 0 0 0 3px rgba(214, 168, 79, 0.2);
}

.fold-step--complete {
  background: linear-gradient(135deg, var(--fold-gold), #f0d98d);
  color: #342519;
}

.fold-step--pending {
  opacity: 0.74;
}

.fold-workbench {
  align-items: end;
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1.55fr) minmax(260px, 0.78fr) minmax(190px, 0.56fr);
  inset: 32% 4% 5%;
  position: absolute;
  z-index: 6;
}

.fold-card,
.fold-counter-panel,
.fold-pellan {
  background: rgba(255, 242, 216, 0.94);
  border: 2px solid rgba(255, 248, 228, 0.62);
  border-radius: 8px;
  box-shadow: 0 18px 34px rgba(37, 31, 27, 0.24);
}

.fold-card {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  min-height: 360px;
  padding: 13px;
}

.fold-card__title {
  align-items: baseline;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 9px;
}

.fold-card__title span {
  color: rgba(37, 31, 27, 0.54);
}

.fold-card__title strong {
  color: #453018;
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 2vw, 1.72rem);
}

.fold-dimensions {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 10px;
}

.fold-dimensions span {
  background: #fff9e8;
  border: 1px solid rgba(37, 31, 27, 0.12);
  border-radius: 7px;
  color: rgba(37, 31, 27, 0.66);
  font-size: 0.72rem;
  font-weight: 900;
  padding: 8px 10px;
  text-align: center;
  text-transform: uppercase;
}

.fold-dimensions strong {
  color: var(--fold-clay);
  display: block;
  font-family: var(--font-display);
  font-size: 1.35rem;
  line-height: 1;
}

.fold-model {
  background:
    linear-gradient(90deg, rgba(37, 31, 27, 0.05) 1px, transparent 1px),
    linear-gradient(180deg, rgba(37, 31, 27, 0.05) 1px, transparent 1px),
    linear-gradient(180deg, #fffdf0, #f2dfb8);
  background-size: 24px 24px, 24px 24px, auto;
  border: 1px solid rgba(37, 31, 27, 0.14);
  border-radius: 7px;
  display: grid;
  flex: 1;
  min-height: 244px;
  place-items: center;
}

.fold-net-svg,
.fold-box-svg {
  display: block;
  height: min(100%, 280px);
  max-width: 100%;
  width: 100%;
}

.fold-net__face {
  fill: rgba(221, 165, 83, 0.45);
  stroke: rgba(69, 48, 24, 0.62);
  stroke-width: 3;
}

.fold-net__face--base {
  fill: rgba(79, 140, 138, 0.4);
}

.fold-net__crease {
  fill: none;
  stroke: rgba(69, 48, 24, 0.32);
  stroke-dasharray: 5 5;
  stroke-width: 2;
}

.fold-net__label,
.fold-box__label,
.fold-box__caption,
.fold-net__caption {
  fill: #342519;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 900;
  text-anchor: middle;
}

.fold-net__label--small {
  font-size: 12px;
}

.fold-net__caption,
.fold-box__caption {
  fill: rgba(52, 37, 25, 0.68);
  font-size: 13px;
}

.fold-box__top {
  fill: rgba(255, 248, 228, 0.82);
}

.fold-box__front {
  fill: rgba(214, 168, 79, 0.72);
}

.fold-box__side {
  fill: rgba(79, 140, 138, 0.6);
}

.fold-box__edge {
  fill: none;
  stroke: rgba(52, 37, 25, 0.72);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3;
}

.fold-cube {
  fill: rgba(255, 248, 228, 0.82);
  stroke: rgba(52, 37, 25, 0.25);
  stroke-width: 1;
}

.fold-card__actions {
  display: flex;
  justify-content: center;
  margin-top: 10px;
}

.fold-button,
.fold-lock {
  align-items: center;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  font-weight: 900;
  gap: 9px;
  justify-content: center;
  min-height: 46px;
  padding: 10px 16px;
}

.fold-button {
  background: linear-gradient(135deg, var(--fold-teal), #7fc1ae);
  color: #fffdf0;
  min-width: 170px;
}

.fold-button span,
.fold-lock span {
  background: currentColor;
  display: inline-block;
  height: 16px;
  mask: linear-gradient(#000 0 0);
  opacity: 0.88;
  transform: rotate(45deg);
  width: 16px;
}

.fold-button:disabled,
.fold-lock:disabled {
  cursor: default;
  opacity: 0.65;
}

.fold-counter-panel {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 360px;
  padding: 15px;
}

.fold-counter-panel > span {
  color: rgba(37, 31, 27, 0.58);
  text-align: center;
}

.fold-counter {
  align-items: center;
  display: grid;
  gap: 8px;
  grid-template-columns: 48px 1fr 48px;
  margin: 12px 0;
}

.fold-counter button,
.fold-counter__quick button {
  background: #fff9e8;
  border: 1px solid rgba(37, 31, 27, 0.14);
  border-radius: 8px;
  color: var(--fold-ink);
  cursor: pointer;
  font-size: 1rem;
  font-weight: 900;
  min-height: 44px;
}

.fold-counter strong {
  background: linear-gradient(180deg, #fffdf0, #ead091);
  border: 2px solid rgba(214, 168, 79, 0.48);
  border-radius: 8px;
  color: #453018;
  font-family: var(--font-display);
  font-size: clamp(2.15rem, 4vw, 3.4rem);
  line-height: 1;
  min-height: 78px;
  padding: 12px;
  text-align: center;
}

.fold-counter__quick {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.fold-counter-panel p {
  color: rgba(37, 31, 27, 0.66);
  font-size: 0.84rem;
  font-weight: 800;
  line-height: 1.28;
  margin: 10px 0 12px;
  text-align: center;
}

.fold-lock {
  background: linear-gradient(135deg, rgba(37, 31, 27, 0.22), rgba(37, 31, 27, 0.14));
  color: rgba(37, 31, 27, 0.58);
  width: 100%;
}

.fold-lock.is-ready {
  background: linear-gradient(135deg, var(--fold-clay), var(--fold-gold));
  box-shadow: 0 0 0 4px rgba(214, 168, 79, 0.2);
  color: #fffdf0;
}

.fold-pellan {
  align-self: stretch;
  min-height: 360px;
  padding: 14px 12px;
  position: relative;
}

.fold-pellan__cube {
  background:
    linear-gradient(135deg, rgba(255, 248, 228, 0.9), rgba(214, 168, 79, 0.78));
  border: 2px solid rgba(69, 48, 24, 0.16);
  border-radius: 7px;
  height: 58px;
  margin: 0 auto 8px;
  transform: rotate(8deg);
  width: 58px;
}

.fold-pellan__head {
  background: #7a4e37;
  border-radius: 50% 50% 43% 43%;
  height: 62px;
  margin: 0 auto;
  position: relative;
  width: 58px;
}

.fold-pellan__head span {
  background: #fff4d5;
  border-radius: 50%;
  bottom: 15px;
  box-shadow: 21px 0 0 #fff4d5;
  height: 8px;
  left: 14px;
  position: absolute;
  width: 8px;
}

.fold-pellan__body {
  background: linear-gradient(180deg, var(--fold-clay), #633c34);
  border-radius: 28px 28px 12px 12px;
  height: 102px;
  margin: -3px auto 0;
  width: 76px;
}

.fold-pellan__bubble {
  background: #fffdf0;
  border: 2px solid rgba(37, 31, 27, 0.14);
  border-radius: 8px;
  bottom: 14px;
  box-shadow: 0 12px 22px rgba(37, 31, 27, 0.16);
  color: #453018;
  font-size: clamp(0.82rem, 1.2vw, 0.96rem);
  font-weight: 900;
  left: 10px;
  line-height: 1.22;
  padding: 12px;
  position: absolute;
  right: 10px;
  text-align: center;
}

.fold-celebration {
  align-items: center;
  background: rgba(255, 253, 240, 0.96);
  border: 2px solid rgba(214, 168, 79, 0.48);
  border-radius: 8px;
  bottom: 4%;
  box-shadow: 0 18px 34px rgba(37, 31, 27, 0.22);
  display: flex;
  gap: 14px;
  left: 5%;
  padding: 12px 14px;
  position: absolute;
  right: 5%;
  z-index: 9;
}

.fold-celebration strong {
  color: #453018;
  font-family: var(--font-display);
  font-size: clamp(1.02rem, 1.7vw, 1.45rem);
}

.fold-celebration > span {
  color: rgba(37, 31, 27, 0.66);
  font-size: 0.78rem;
  font-weight: 900;
  margin-left: auto;
  white-space: nowrap;
}

.fold-why {
  flex: 1;
  min-width: 220px;
}

.fold-why span {
  color: rgba(37, 31, 27, 0.48);
}

.fold-why p {
  color: rgba(37, 31, 27, 0.72);
  font-size: 0.82rem;
  font-weight: 750;
  line-height: 1.22;
  margin: 2px 0 0;
}

.fold-reward {
  display: grid;
  inset: 4%;
  place-items: center;
  position: absolute;
  z-index: 8;
}

.fold-reward__card {
  background: rgba(255, 253, 240, 0.96);
  border: 2px solid rgba(214, 168, 79, 0.5);
  border-radius: 8px;
  box-shadow: 0 28px 70px rgba(37, 31, 27, 0.36);
  display: grid;
  gap: 14px;
  max-height: 100%;
  max-width: 960px;
  overflow: auto;
  padding: 24px;
  text-align: center;
  width: min(92%, 960px);
}

.fold-reward__copy span {
  color: var(--fold-clay);
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.fold-reward__copy h2 {
  color: #453018;
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3.5rem);
  line-height: 0.94;
  margin: 4px 0 8px;
}

.fold-reward__copy p {
  color: rgba(37, 31, 27, 0.7);
  font-weight: 850;
  margin: 0 auto;
  max-width: 620px;
}

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

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

.fold-reward__badges span {
  background: rgba(214, 168, 79, 0.16);
  border: 1px solid rgba(214, 168, 79, 0.24);
  border-radius: 999px;
  color: #453018;
  font-size: 0.78rem;
  font-weight: 900;
  padding: 8px 12px;
}

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

@media (max-width: 980px) {
  .fold-room__scene {
    height: auto;
    min-height: 980px;
    overflow: visible;
  }

  .fold-shelf,
  .fold-steps,
  .fold-workbench,
  .fold-celebration,
  .fold-room__prompt {
    position: relative;
    inset: auto;
    left: auto;
    right: auto;
    top: auto;
    transform: none;
  }

  .fold-shelf {
    margin: 110px 14px 12px;
  }

  .fold-room__prompt {
    margin: 16px auto 10px;
    max-width: 92%;
  }

  .fold-steps {
    flex-direction: column;
    margin: 0 auto 12px;
    width: 92%;
  }

  .fold-workbench {
    grid-template-columns: 1fr;
    margin: 0 14px 14px;
  }

  .fold-card,
  .fold-counter-panel,
  .fold-pellan {
    min-height: auto;
  }

  .fold-pellan {
    min-height: 280px;
  }

  .fold-celebration {
    flex-direction: column;
    margin: 0 14px 18px;
    text-align: center;
  }

  .fold-celebration > span {
    margin-left: 0;
  }

  .fold-reward__tiles,
  .fold-shelf__rail {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
