/* Probability L4: Repetition Gallery */

.crowd-page {
  --crowd-peach: #e9a879;
  --crowd-canvas: #f7dec1;
  --crowd-brass: #d0a84b;
  --crowd-magenta: #a8328b;
  --crowd-teal: #5fb6b8;
  --crowd-ink: #241b18;
  --crowd-plum: #442143;
  --crowd-wood: #7b4b2a;
  color: var(--crowd-ink);
}

.crowd-topbar {
  border-color: rgba(208, 168, 75, 0.32);
}

.crowd-progressbar {
  background: rgba(247, 222, 193, 0.74);
  border: 1px solid rgba(168, 50, 139, 0.18);
  border-radius: 999px;
  height: 8px;
  margin: 0 auto 10px;
  max-width: 1180px;
  overflow: hidden;
}

.crowd-progressbar span {
  background: linear-gradient(90deg, var(--crowd-peach), var(--crowd-magenta), var(--crowd-brass));
  display: block;
  height: 100%;
  transition: width 320ms ease;
}

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

.crowd-progress__dot {
  background: rgba(68, 33, 67, 0.42);
  border: 1px solid rgba(247, 222, 193, 0.7);
  border-radius: 50%;
  height: 10px;
  width: 10px;
}

.crowd-progress__dot.is-current {
  background: var(--crowd-canvas);
  box-shadow: 0 0 0 3px rgba(208, 168, 75, 0.22);
}

.crowd-progress__dot.is-filled {
  background: var(--crowd-brass);
  box-shadow: 0 0 12px rgba(208, 168, 75, 0.44);
}

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

.crowd-room__scene {
  background:
    radial-gradient(circle at 24% 18%, rgba(208, 168, 75, 0.26), transparent 24%),
    radial-gradient(circle at 82% 30%, rgba(95, 182, 184, 0.22), transparent 24%),
    linear-gradient(180deg, rgba(255, 238, 204, 0.14), rgba(67, 28, 45, 0.18)),
    linear-gradient(115deg, rgba(168, 50, 139, 0.38), transparent 43%),
    url("../img/arena-probability.jpg") center center / cover no-repeat;
  border: 1px solid rgba(247, 222, 193, 0.28);
  border-radius: 8px;
  box-shadow: 0 24px 60px rgba(44, 22, 44, 0.34);
  height: min(740px, calc(100vh - 130px));
  min-height: 680px;
  overflow: hidden;
  position: relative;
  isolation: isolate;
}

.crowd-room__scene::before {
  background:
    repeating-linear-gradient(90deg, rgba(247, 222, 193, 0.08) 0 20px, rgba(168, 50, 139, 0.08) 20px 40px),
    linear-gradient(180deg, rgba(0, 0, 0, 0.12), transparent 46%);
  content: "";
  height: 150px;
  inset: 0 0 auto;
  opacity: 0.9;
  position: absolute;
  z-index: 1;
}

.crowd-room__scene::after {
  background:
    repeating-linear-gradient(90deg, rgba(36, 24, 25, 0.13) 0 4px, transparent 4px 38px),
    linear-gradient(180deg, #986039, #58311f);
  border-top: 1px solid rgba(255, 239, 202, 0.2);
  bottom: -58px;
  box-shadow: 0 -20px 45px rgba(54, 30, 27, 0.34);
  content: "";
  height: 210px;
  left: -3%;
  position: absolute;
  right: -3%;
  transform: skewY(-2deg);
  z-index: -1;
}

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

.crowd-room__arches span {
  background: linear-gradient(180deg, rgba(247, 222, 193, 0.58), rgba(168, 50, 139, 0.5));
  border: 1px solid rgba(255, 245, 218, 0.3);
  border-radius: 28px 28px 4px 4px;
  height: 90px;
  width: 44px;
}

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

.crowd-room__lanterns span {
  background: radial-gradient(circle, #fff4c7 0 36%, var(--crowd-brass) 37% 58%, rgba(208, 168, 75, 0.08) 59%);
  border-radius: 50%;
  bottom: 0;
  box-shadow: 0 0 40px rgba(208, 168, 75, 0.5);
  height: 54px;
  position: absolute;
  width: 54px;
}

.crowd-room__lanterns span:first-child { left: 0; }
.crowd-room__lanterns span:last-child { right: 0; }

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

.crowd-room__prompt span,
.crowd-shelf__title span,
.crowd-problem-card > span,
.crowd-device-panel > span,
.crowd-meter > span,
.crowd-counter > span,
.crowd-why span {
  color: rgba(255, 248, 226, 0.84);
  display: block;
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.crowd-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;
}

.crowd-shelf {
  background: linear-gradient(180deg, rgba(68, 33, 67, 0.9), rgba(48, 27, 48, 0.88));
  border: 2px solid rgba(247, 222, 193, 0.32);
  border-radius: 8px;
  box-shadow: 0 14px 28px rgba(48, 24, 48, 0.28);
  left: 4%;
  padding: 9px 12px;
  position: absolute;
  right: 4%;
  top: 13%;
  z-index: 4;
}

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

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

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

.crowd-shelf__slot {
  background: rgba(247, 222, 193, 0.08);
  border: 1px dashed rgba(247, 222, 193, 0.28);
  border-radius: 6px;
  display: grid;
  min-height: 74px;
  padding: 6px;
  place-items: center;
}

.crowd-shelf__slot.is-current {
  border-color: rgba(208, 168, 75, 0.62);
}

.crowd-shelf__slot.is-filled {
  animation: crowdCounterArrive 420ms ease both;
  background: rgba(247, 222, 193, 0.16);
  border-style: solid;
}

.crowd-snapshot {
  background:
    linear-gradient(90deg, rgba(36, 27, 24, 0.08) 1px, transparent 1px),
    linear-gradient(0deg, rgba(36, 27, 24, 0.08) 1px, transparent 1px),
    linear-gradient(180deg, #fff1cf, #e8bd78);
  background-size: 18px 18px, 18px 18px, auto;
  border: 1px solid rgba(87, 51, 28, 0.28);
  border-radius: 6px;
  box-shadow: 0 8px 14px rgba(28, 16, 20, 0.22);
  color: var(--crowd-ink);
  display: grid;
  gap: 2px;
  min-height: 56px;
  min-width: 0;
  padding: 7px;
  text-align: center;
  width: 100%;
}

.crowd-shelf__slot:not(.is-filled) .crowd-snapshot {
  background: rgba(247, 222, 193, 0.08);
  box-shadow: none;
  color: rgba(255, 242, 212, 0.5);
}

.crowd-snapshot span {
  font-size: 0.58rem;
  font-weight: 900;
  overflow-wrap: anywhere;
  text-transform: uppercase;
}

.crowd-snapshot strong {
  font-family: var(--font-display);
  font-size: 1.1rem;
  line-height: 1;
}

.crowd-snapshot em {
  font-size: 0.68rem;
  font-style: normal;
}

.crowd-steps {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  left: 10%;
  position: absolute;
  right: 10%;
  top: 27%;
  z-index: 5;
}

.crowd-step {
  background: rgba(36, 24, 40, 0.72);
  border: 1px solid rgba(247, 222, 193, 0.2);
  border-radius: 999px;
  color: rgba(255, 247, 223, 0.74);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.03em;
  padding: 8px 10px;
  text-align: center;
}

.crowd-step--active {
  background: rgba(208, 168, 75, 0.22);
  border-color: rgba(208, 168, 75, 0.52);
  color: #fff7df;
}

.crowd-step--complete {
  background: rgba(95, 182, 184, 0.24);
  border-color: rgba(95, 182, 184, 0.48);
  color: #ddfffb;
}

.crowd-step--pending {
  opacity: 0.62;
}

.crowd-workbench {
  align-items: stretch;
  display: grid;
  gap: 14px;
  grid-template-columns: 182px minmax(0, 1fr) 178px;
  left: 4%;
  position: absolute;
  right: 4%;
  top: 33%;
  z-index: 6;
}

.crowd-problem-card,
.crowd-main-panel,
.crowd-aldra {
  background: rgba(36, 24, 40, 0.84);
  border: 1px solid rgba(247, 222, 193, 0.28);
  border-radius: 8px;
  box-shadow: 0 16px 28px rgba(34, 18, 34, 0.25);
}

.crowd-problem-card {
  color: #fff5d8;
  padding: 14px;
}

.crowd-problem-card h1 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  line-height: 1.05;
  margin: 8px 0;
}

.crowd-problem-card p {
  font-size: 0.88rem;
  line-height: 1.35;
  margin: 0 0 10px;
}

.crowd-facts {
  display: grid;
  gap: 8px;
}

.crowd-facts p {
  background: rgba(255, 247, 223, 0.1);
  border: 1px solid rgba(255, 247, 223, 0.16);
  border-radius: 6px;
  display: grid;
  gap: 3px;
  margin: 0;
  padding: 8px;
}

.crowd-facts span {
  color: rgba(255, 248, 226, 0.72);
  font-size: 0.64rem;
  font-weight: 900;
  text-transform: uppercase;
}

.crowd-facts strong {
  color: var(--crowd-brass);
  font-family: var(--font-display);
  font-size: 1.35rem;
}

.crowd-main-panel {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.crowd-device-panel {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: 90px minmax(0, 1fr);
}

.crowd-device {
  margin: 0 auto;
}

.crowd-device--coin {
  display: flex;
  gap: 10px;
}

.crowd-device--coin span {
  align-items: center;
  background: radial-gradient(circle at 34% 26%, #fff7d4, var(--crowd-brass));
  border: 2px solid rgba(87, 51, 28, 0.4);
  border-radius: 50%;
  color: #3a2318;
  display: flex;
  font-family: var(--font-display);
  font-size: 1.4rem;
  height: 70px;
  justify-content: center;
  width: 70px;
}

.crowd-device--die {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(3, 48px);
}

.crowd-device--die span {
  align-items: center;
  background: #fff7df;
  border: 2px solid rgba(87, 51, 28, 0.28);
  border-radius: 9px;
  color: var(--crowd-ink);
  display: flex;
  font-weight: 900;
  height: 48px;
  justify-content: center;
  width: 48px;
}

.crowd-device--die span.is-hot {
  background: linear-gradient(180deg, var(--crowd-brass), #f0c96a);
  box-shadow: 0 0 12px rgba(208, 168, 75, 0.36);
}

.crowd-device--spinner {
  align-items: center;
  background: var(--spinner-bg);
  border: 8px solid rgba(87, 51, 28, 0.88);
  border-radius: 50%;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.22), 0 12px 18px rgba(20, 12, 18, 0.2);
  display: flex;
  height: 132px;
  justify-content: center;
  position: relative;
  width: 132px;
}

.crowd-device--spinner span {
  background: rgba(255, 247, 223, 0.9);
  border-radius: 50%;
  height: 34px;
  width: 34px;
  z-index: 2;
}

.crowd-device--spinner i {
  background: #2a1b1a;
  clip-path: polygon(0 44%, 78% 0, 100% 50%, 78% 100%, 0 56%);
  height: 16px;
  position: absolute;
  right: 8px;
  top: 56px;
  width: 55px;
  z-index: 3;
}

.crowd-device--spinner strong {
  background: rgba(36, 24, 40, 0.78);
  border-radius: 999px;
  bottom: -30px;
  color: #fff7df;
  font-size: 0.75rem;
  padding: 4px 8px;
  position: absolute;
  text-transform: uppercase;
}

.crowd-meter {
  background: rgba(255, 247, 223, 0.94);
  border: 2px solid rgba(123, 75, 42, 0.34);
  border-radius: 8px;
  color: var(--crowd-ink);
  padding: 12px;
  text-align: center;
}

.crowd-meter > span {
  color: rgba(36, 27, 24, 0.6);
}

.crowd-meter__track {
  background:
    repeating-linear-gradient(90deg, rgba(36, 27, 24, 0.09) 0 12px, transparent 12px 24px),
    rgba(36, 27, 24, 0.08);
  border-radius: 999px;
  height: 22px;
  margin: 10px 0;
  overflow: hidden;
}

.crowd-meter__track i {
  background: linear-gradient(90deg, var(--crowd-teal), var(--crowd-brass));
  display: block;
  height: 100%;
  transition: width 180ms ease;
}

.crowd-meter strong {
  color: var(--crowd-plum);
  display: block;
  font-family: var(--font-display);
  font-size: 2rem;
  line-height: 1;
}

.crowd-meter small {
  color: rgba(36, 27, 24, 0.62);
  display: block;
  font-size: 0.78rem;
  font-weight: 800;
  margin-top: 4px;
}

.crowd-tools {
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) 160px;
}

.crowd-counter {
  background: rgba(24, 18, 28, 0.82);
  border: 1px solid rgba(247, 222, 193, 0.18);
  border-radius: 8px;
  color: #fff7df;
  padding: 10px;
  text-align: center;
}

.crowd-counter.is-correct {
  border-color: rgba(95, 182, 184, 0.74);
  box-shadow: inset 0 0 12px rgba(95, 182, 184, 0.16);
}

.crowd-counter__value {
  font-family: var(--font-display);
  font-size: 1.75rem;
  line-height: 1;
  margin: 5px 0 8px;
}

.crowd-counter__buttons {
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr 1fr;
}

.crowd-counter__buttons button,
.crowd-lock {
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 900;
}

.crowd-counter__buttons button {
  background: rgba(247, 222, 193, 0.95);
  color: var(--crowd-plum);
  font-size: 1.1rem;
  min-height: 34px;
}

.crowd-counter__buttons button:disabled,
.crowd-lock:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.crowd-lock-panel {
  display: grid;
}

.crowd-lock {
  background: linear-gradient(180deg, var(--crowd-brass), #b98323);
  color: #25160f;
  min-height: 100%;
  padding: 10px;
}

.crowd-lock span {
  background: rgba(255, 247, 223, 0.58);
  border-radius: 50%;
  display: block;
  height: 22px;
  margin: 0 auto 5px;
  width: 22px;
}

.crowd-aldra {
  min-height: 300px;
  overflow: visible;
  position: relative;
}

.crowd-aldra__abacus {
  bottom: 44px;
  display: grid;
  gap: 7px;
  left: 24px;
  position: absolute;
  width: 56px;
}

.crowd-aldra__abacus span {
  background: linear-gradient(90deg, var(--crowd-brass) 0 24%, rgba(255, 247, 223, 0.9) 25% 42%, var(--crowd-brass) 43% 58%, rgba(255, 247, 223, 0.9) 59% 76%, var(--crowd-brass) 77%);
  border-radius: 999px;
  height: 8px;
}

.crowd-aldra__head {
  background: #2b5e70;
  border-radius: 50% 50% 44% 44%;
  height: 54px;
  left: 61px;
  position: absolute;
  top: 70px;
  width: 54px;
}

.crowd-aldra__head span {
  background: #f3dbc1;
  border-radius: 50%;
  display: block;
  height: 40px;
  left: 7px;
  position: absolute;
  top: 8px;
  width: 40px;
}

.crowd-aldra__body {
  background: linear-gradient(180deg, #2d7f8e, #173746);
  border-radius: 34px 34px 12px 12px;
  height: 124px;
  left: 52px;
  position: absolute;
  top: 120px;
  width: 72px;
}

.crowd-aldra__arm {
  background: #205a69;
  border-radius: 999px;
  height: 16px;
  position: absolute;
  top: 158px;
  width: 68px;
}

.crowd-aldra__arm--left {
  left: 24px;
  transform: rotate(-18deg);
}

.crowd-aldra__arm--right {
  right: 24px;
  transform: rotate(18deg);
}

.crowd-aldra__bubble {
  background: rgba(255, 247, 223, 0.96);
  border: 1px solid rgba(68, 33, 67, 0.18);
  border-radius: 8px;
  color: var(--crowd-plum);
  font-size: 0.82rem;
  font-weight: 800;
  left: -22px;
  line-height: 1.25;
  padding: 9px 10px;
  position: absolute;
  right: -12px;
  top: 10px;
}

.crowd-celebration {
  background: rgba(36, 24, 40, 0.94);
  border: 2px solid rgba(208, 168, 75, 0.72);
  border-radius: 8px;
  bottom: 20px;
  box-shadow: 0 18px 35px rgba(24, 18, 28, 0.38);
  color: #fff7df;
  left: 50%;
  max-width: 650px;
  padding: 14px;
  position: absolute;
  text-align: center;
  transform: translateX(-50%);
  width: min(650px, 86%);
  z-index: 10;
}

.crowd-celebration strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.2rem;
}

.crowd-celebration p {
  font-size: 0.9rem;
  margin: 6px 0 8px;
}

.crowd-why span {
  color: rgba(255, 248, 226, 0.72);
}

.crowd-celebration > span {
  display: block;
  font-size: 0.78rem;
  font-weight: 900;
  margin-bottom: 8px;
}

.crowd-reward {
  display: grid;
  inset: 0;
  overflow-y: auto;
  padding: 24px;
  place-items: center;
  position: absolute;
  z-index: 20;
}

.crowd-reward__card {
  background: rgba(36, 24, 40, 0.94);
  border: 2px solid rgba(208, 168, 75, 0.72);
  border-radius: 8px;
  box-shadow: 0 24px 52px rgba(18, 12, 22, 0.46);
  color: #fff7df;
  display: grid;
  gap: 12px;
  max-width: 940px;
  padding: 20px;
  text-align: center;
  width: min(940px, 96%);
}

.crowd-reward__copy span {
  color: rgba(255, 248, 226, 0.78);
  display: block;
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

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

.crowd-reward__copy p {
  margin: 0 auto;
  max-width: 680px;
}

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

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

.crowd-reward__badges span {
  background: rgba(247, 222, 193, 0.1);
  border: 1px solid rgba(247, 222, 193, 0.2);
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 800;
  padding: 7px 10px;
}

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

@keyframes crowdCounterArrive {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

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

  .crowd-room__scene::before,
  .crowd-room__scene::after,
  .crowd-room__arches,
  .crowd-room__lanterns {
    display: none;
  }

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

  .crowd-room__prompt,
  .crowd-shelf,
  .crowd-steps,
  .crowd-workbench {
    margin-bottom: 12px;
  }

  .crowd-room__prompt {
    max-width: none;
  }

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

  .crowd-steps,
  .crowd-workbench,
  .crowd-device-panel,
  .crowd-tools {
    grid-template-columns: 1fr;
  }

  .crowd-aldra {
    min-height: 240px;
  }
}
