/* Number Theory L4: Rule Bells */

.bell-page {
  --bell-ink: #241f1a;
  --bell-paper: #f8ecd3;
  --bell-stone: #8b877a;
  --bell-slate: #49525f;
  --bell-gold: #d9ab4d;
  --bell-green: #5c936c;
  --bell-rust: #a65741;
  --bell-blue: #4d688d;
  color: var(--bell-ink);
}

.bell-topbar {
  border-color: rgba(139, 135, 122, 0.32);
}

.bell-progressbar {
  background: rgba(248, 236, 211, 0.76);
  border: 1px solid rgba(73, 82, 95, 0.2);
  border-radius: 999px;
  height: 8px;
  margin: 0 auto 10px;
  max-width: 1180px;
  overflow: hidden;
}

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

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

.bell-progress__dot {
  background: rgba(36, 31, 26, 0.34);
  border: 1px solid rgba(248, 236, 211, 0.7);
  border-radius: 50%;
  height: 10px;
  width: 10px;
}

.bell-progress__dot.is-current {
  background: var(--bell-paper);
  box-shadow: 0 0 0 3px rgba(217, 171, 77, 0.22);
}

.bell-progress__dot.is-filled {
  background: var(--bell-gold);
  box-shadow: 0 0 12px rgba(217, 171, 77, 0.44);
}

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

.bell-room__scene {
  background:
    radial-gradient(circle at 22% 18%, rgba(217, 171, 77, 0.28), transparent 24%),
    radial-gradient(circle at 82% 30%, rgba(92, 147, 108, 0.24), transparent 24%),
    linear-gradient(180deg, rgba(248, 236, 211, 0.1), rgba(36, 31, 26, 0.18)),
    url("../img/arena-numbertheory.jpg") center center / cover no-repeat;
  border: 1px solid rgba(248, 236, 211, 0.28);
  border-radius: 8px;
  box-shadow: 0 24px 60px rgba(36, 31, 26, 0.34);
  height: min(740px, calc(100vh - 130px));
  min-height: 680px;
  overflow: hidden;
  position: relative;
  isolation: isolate;
}

.bell-room__scene::before {
  background:
    linear-gradient(90deg, rgba(248, 236, 211, 0.08) 0 1px, transparent 1px 9%),
    repeating-linear-gradient(90deg, transparent 0 9%, rgba(248, 236, 211, 0.06) 9% 10%, transparent 10% 20%),
    linear-gradient(180deg, rgba(20, 20, 20, 0.08), transparent 46%);
  content: "";
  inset: 0;
  position: absolute;
  z-index: 1;
}

.bell-room__scene::after {
  background:
    repeating-linear-gradient(90deg, rgba(36, 31, 26, 0.16) 0 4px, transparent 4px 44px),
    linear-gradient(180deg, #776b55, #40382f);
  border-top: 1px solid rgba(248, 236, 211, 0.2);
  bottom: -58px;
  box-shadow: 0 -20px 45px rgba(36, 31, 26, 0.3);
  content: "";
  height: 210px;
  left: -3%;
  position: absolute;
  right: -3%;
  transform: skewY(-2deg);
  z-index: -1;
}

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

.bell-room__arches span {
  background: linear-gradient(180deg, rgba(248, 236, 211, 0.52), rgba(73, 82, 95, 0.5));
  border: 1px solid rgba(255, 247, 228, 0.28);
  border-radius: 28px 28px 4px 4px;
  height: 90px;
  width: 44px;
}

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

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

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

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

.bell-room__prompt span,
.bell-shelf__title span,
.bell-question-card > span,
.bell-rule-bench__title span,
.bell-evidence span,
.bell-verdict span,
.bell-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;
}

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

.bell-shelf {
  background: linear-gradient(180deg, rgba(36, 31, 26, 0.9), rgba(44, 39, 34, 0.88));
  border: 2px solid rgba(248, 236, 211, 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;
}

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

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

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

.bell-shelf__slot {
  background: rgba(248, 236, 211, 0.08);
  border: 1px dashed rgba(248, 236, 211, 0.28);
  border-radius: 6px;
  display: grid;
  min-height: 74px;
  padding: 6px;
  place-items: center;
}

.bell-shelf__slot.is-current {
  border-color: rgba(217, 171, 77, 0.62);
}

.bell-shelf__slot.is-filled {
  animation: bellRingIn 420ms ease both;
  background: rgba(248, 236, 211, 0.16);
  border-style: solid;
}

.bell-snapshot {
  background:
    radial-gradient(circle at 50% 18%, rgba(255, 247, 212, 0.42) 0 12%, transparent 13%),
    linear-gradient(180deg, #f0d178, #a87628);
  border: 1px solid rgba(55, 48, 38, 0.34);
  border-radius: 44% 44% 8px 8px / 36% 36% 8px 8px;
  box-shadow: 0 8px 14px rgba(28, 26, 22, 0.22);
  color: var(--bell-ink);
  display: grid;
  gap: 2px;
  min-height: 56px;
  min-width: 0;
  padding: 7px;
  text-align: center;
  width: 100%;
}

.bell-shelf__slot:not(.is-filled) .bell-snapshot {
  background: rgba(248, 236, 211, 0.08);
  border-radius: 6px;
  box-shadow: none;
  color: rgba(255, 242, 212, 0.5);
}

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

.bell-snapshot strong {
  font-family: var(--font-display);
  font-size: clamp(0.84rem, 1vw, 1.05rem);
  line-height: 1.02;
}

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

.bell-step {
  background: rgba(248, 236, 211, 0.13);
  border: 1px solid rgba(248, 236, 211, 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;
}

.bell-step--active {
  background: rgba(217, 171, 77, 0.92);
  color: #2b241d;
}

.bell-step--complete {
  background: rgba(92, 147, 108, 0.88);
  color: #f8f2df;
}

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

.bell-workbench {
  bottom: 9%;
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(210px, 0.82fr) minmax(0, 2.2fr) minmax(190px, 0.72fr);
  left: 5%;
  position: absolute;
  right: 5%;
  top: 33%;
  z-index: 5;
}

.bell-question-card,
.bell-rule-bench,
.bell-verdict {
  background: rgba(36, 31, 26, 0.82);
  border: 1px solid rgba(248, 236, 211, 0.24);
  border-radius: 8px;
  box-shadow: 0 18px 36px rgba(28, 26, 22, 0.28);
}

.bell-question-card {
  align-content: start;
  color: #fff7df;
  display: grid;
  gap: 12px;
  padding: 16px;
}

.bell-question-card h1 {
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 2vw, 1.8rem);
  line-height: 1;
  margin: 0;
}

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

.bell-number-stone {
  background:
    radial-gradient(circle at 45% 25%, rgba(255, 247, 212, 0.36) 0 17%, transparent 18%),
    linear-gradient(180deg, #b9b4a6, #6e6a60);
  border: 3px solid rgba(255, 247, 212, 0.22);
  border-radius: 34% 42% 38% 36% / 32% 36% 42% 38%;
  box-shadow: inset 0 -16px 22px rgba(36, 31, 26, 0.22), 0 18px 26px rgba(28, 26, 22, 0.3);
  color: #26231e;
  display: grid;
  min-height: 170px;
  padding: 16px;
  place-items: center;
  text-align: center;
}

.bell-number-stone span,
.bell-number-stone em {
  font-size: 0.68rem;
  font-style: normal;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.bell-number-stone strong {
  font-family: var(--font-display);
  font-size: clamp(4rem, 7vw, 6.5rem);
  line-height: 0.8;
}

.bell-main-panel {
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) 230px;
  min-height: 0;
}

.bell-rule-bench {
  color: #fff7df;
  display: grid;
  gap: 14px;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  min-width: 0;
  padding: 14px;
}

.bell-rule-bench__title {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.bell-rule-bench__title strong {
  color: #fff2c8;
  font-size: 0.82rem;
}

.bell-rule-bench p {
  color: rgba(255, 248, 228, 0.82);
  line-height: 1.32;
  margin: 0;
}

.bell-digits {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: center;
}

.bell-digit {
  background: linear-gradient(180deg, #ede1c6, #b6ab93);
  border: 2px solid rgba(36, 31, 26, 0.22);
  border-radius: 8px;
  box-shadow: 0 8px 12px rgba(27, 25, 22, 0.22);
  color: var(--bell-ink);
  cursor: pointer;
  display: grid;
  min-height: 90px;
  min-width: 74px;
  padding: 10px;
  place-items: center;
  transition: transform 140ms ease, background 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.bell-digit:hover:not(:disabled) {
  transform: translateY(-2px);
}

.bell-digit:disabled {
  cursor: default;
}

.bell-digit strong {
  font-family: var(--font-display);
  font-size: 2rem;
  line-height: 0.9;
}

.bell-digit span {
  font-size: 0.6rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.bell-digit.is-needed {
  border-color: rgba(217, 171, 77, 0.6);
}

.bell-digit.is-marked {
  background: linear-gradient(180deg, #f3d77f, #b9872c);
  border-color: rgba(255, 247, 212, 0.72);
  box-shadow: 0 8px 12px rgba(27, 25, 22, 0.24), 0 0 16px rgba(217, 171, 77, 0.36);
}

.bell-evidence {
  background: rgba(255, 248, 228, 0.11);
  border: 1px solid rgba(255, 248, 228, 0.16);
  border-radius: 8px;
  padding: 12px;
  text-align: center;
}

.bell-evidence strong {
  color: #ffe29b;
  display: block;
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 1.55vw, 1.36rem);
  line-height: 1.08;
  margin-top: 4px;
}

.bell-side-panel {
  display: grid;
  gap: 12px;
  grid-template-rows: minmax(0, 1fr) auto;
  min-width: 0;
}

.bell-verdict {
  color: #fff7df;
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr 1fr;
  padding: 14px;
}

.bell-verdict span {
  grid-column: 1 / -1;
}

.bell-verdict__button {
  background: rgba(248, 236, 211, 0.13);
  border: 1px solid rgba(248, 236, 211, 0.24);
  border-radius: 7px;
  color: rgba(255, 248, 228, 0.78);
  cursor: pointer;
  font-weight: 900;
  min-height: 58px;
}

.bell-verdict__button:disabled {
  cursor: default;
  opacity: 0.54;
}

.bell-verdict__button.is-selected {
  background: linear-gradient(180deg, var(--bell-gold), #8a621f);
  border-color: rgba(255, 247, 212, 0.72);
  color: #241f1a;
  opacity: 1;
}

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

.bell-lock {
  background: linear-gradient(180deg, #69645b, #33302b);
  border: 2px solid rgba(248, 236, 211, 0.28);
  border-radius: 8px;
  color: rgba(255, 248, 228, 0.7);
  cursor: default;
  display: grid;
  gap: 6px;
  min-height: 110px;
  padding: 10px;
  place-items: center;
  text-align: center;
}

.bell-lock.is-ready {
  background: linear-gradient(180deg, #e4bc59, #785b22);
  border-color: rgba(255, 247, 212, 0.76);
  box-shadow: 0 0 20px rgba(217, 171, 77, 0.38);
  color: #241e18;
  cursor: pointer;
}

.bell-lock span {
  background:
    radial-gradient(circle at 50% 18%, currentColor 0 10%, transparent 11%),
    linear-gradient(180deg, currentColor 0 100%);
  border-radius: 44% 44% 8px 8px / 36% 36% 8px 8px;
  height: 42px;
  opacity: 0.72;
  width: 42px;
}

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

.bell-aldra {
  align-self: end;
  color: #fff7df;
  min-height: 260px;
  position: relative;
}

.bell-aldra__head {
  background: #bd815c;
  border-radius: 42% 42% 48% 48%;
  height: 50px;
  left: 50%;
  position: absolute;
  top: 38px;
  transform: translateX(-50%);
  width: 44px;
  z-index: 3;
}

.bell-aldra__head span {
  background: #3d3027;
  border-radius: 12px 12px 5px 5px;
  height: 16px;
  left: -2px;
  position: absolute;
  right: -2px;
  top: -4px;
}

.bell-aldra__body {
  background: linear-gradient(180deg, #5c936c, #354f3d);
  border-radius: 24px 24px 10px 10px;
  height: 110px;
  left: 50%;
  position: absolute;
  top: 84px;
  transform: translateX(-50%);
  width: 68px;
  z-index: 2;
}

.bell-aldra__arm {
  background: rgba(255, 235, 198, 0.86);
  border-radius: 999px;
  height: 9px;
  position: absolute;
  top: 118px;
  width: 58px;
  z-index: 3;
}

.bell-aldra__arm--left {
  left: 44px;
  transform: rotate(-26deg);
}

.bell-aldra__arm--right {
  right: 44px;
  transform: rotate(28deg);
}

.bell-aldra__bell {
  background: linear-gradient(180deg, #f0d178, #a87628);
  border-radius: 45% 45% 8px 8px / 44% 44% 8px 8px;
  height: 48px;
  left: 20px;
  position: absolute;
  top: 88px;
  transform: rotate(-12deg);
  width: 54px;
  z-index: 4;
}

.bell-aldra__bubble {
  background: rgba(255, 248, 228, 0.96);
  border: 1px solid rgba(217, 171, 77, 0.32);
  border-radius: 8px;
  box-shadow: 0 14px 26px rgba(26, 23, 20, 0.26);
  color: var(--bell-ink);
  font-weight: 800;
  line-height: 1.25;
  padding: 12px 14px;
  position: absolute;
  right: 0;
  top: 0;
  width: min(230px, 100%);
  z-index: 5;
}

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

.bell-why p {
  color: #fff7df;
  line-height: 1.32;
  margin: 3px 0 0;
}

.bell-celebration {
  background: rgba(36, 31, 26, 0.92);
  border: 1px solid rgba(217, 171, 77, 0.42);
  border-radius: 8px;
  bottom: 22px;
  box-shadow: 0 18px 34px rgba(26, 23, 20, 0.38);
  color: #fff7df;
  left: 50%;
  max-width: min(720px, 78%);
  padding: 14px 18px;
  position: absolute;
  text-align: center;
  transform: translateX(-50%);
  z-index: 14;
}

.bell-celebration > strong {
  color: #ffe29b;
  display: block;
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 1.7vw, 1.45rem);
  line-height: 1.05;
}

.bell-celebration > span {
  color: rgba(255, 248, 228, 0.78);
  display: block;
  font-size: 0.82rem;
  font-weight: 900;
  margin-bottom: 10px;
  text-transform: uppercase;
}

.bell-reward {
  display: grid;
  inset: 0;
  padding: 26px;
  place-items: center;
  position: absolute;
  z-index: 10;
}

.bell-reward__card {
  background: linear-gradient(180deg, rgba(36, 31, 26, 0.94), rgba(52, 47, 39, 0.94));
  border: 1px solid rgba(217, 171, 77, 0.42);
  border-radius: 8px;
  box-shadow: 0 24px 50px rgba(26, 23, 20, 0.4);
  color: #fff7df;
  display: grid;
  gap: 16px;
  max-height: 100%;
  max-width: 900px;
  overflow-y: auto;
  padding: 24px;
  text-align: center;
  width: min(900px, 100%);
}

.bell-reward__copy span {
  color: rgba(255, 248, 228, 0.7);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.bell-reward__copy h2 {
  color: #ffe29b;
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 0.96;
  margin: 4px 0 6px;
}

.bell-reward__copy p {
  margin: 0;
}

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

.bell-reward__bells .bell-snapshot {
  min-height: 90px;
}

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

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

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

.bell-reward .reward-stars {
  color: rgba(255, 255, 255, 0.28);
  font-size: 1.8rem;
}

.bell-reward .reward-stars span.is-filled {
  color: var(--bell-gold);
}

@keyframes bellRingIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

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

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

  .bell-main-panel {
    grid-template-columns: 1fr;
  }

  .bell-aldra {
    display: none;
  }
}

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

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

  .bell-digits {
    flex-wrap: wrap;
  }

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