/* Coordinates L4: Mirror Pool */

.mirror-page {
  --mirror-ink: #1e2633;
  --mirror-paper: #f6eddc;
  --mirror-brass: #c69a35;
  --mirror-brass-light: #f0cf72;
  --mirror-blue: #2d5f89;
  --mirror-cord: #b94e3f;
  --mirror-glass: #5aa6b8;
  color: var(--mirror-ink);
}

.mirror-topbar {
  border-color: rgba(198, 154, 53, 0.3);
}

.mirror-progressbar {
  background: rgba(246, 237, 220, 0.76);
  border: 1px solid rgba(45, 95, 137, 0.18);
  border-radius: 999px;
  height: 8px;
  margin: 0 auto 10px;
  max-width: 1180px;
  overflow: hidden;
}

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

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

.mirror-progress__dot {
  background: rgba(30, 38, 51, 0.34);
  border: 1px solid rgba(246, 237, 220, 0.7);
  border-radius: 50%;
  height: 10px;
  width: 10px;
}

.mirror-progress__dot.is-current {
  background: var(--mirror-paper);
  box-shadow: 0 0 0 3px rgba(90, 166, 184, 0.22);
}

.mirror-progress__dot.is-filled {
  background: var(--mirror-brass);
  box-shadow: 0 0 12px rgba(198, 154, 53, 0.44);
}

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

.mirror-room__scene {
  background:
    radial-gradient(circle at 25% 18%, rgba(90, 166, 184, 0.3), transparent 24%),
    radial-gradient(circle at 82% 30%, rgba(240, 207, 114, 0.24), transparent 24%),
    linear-gradient(180deg, rgba(246, 237, 220, 0.1), rgba(33, 38, 51, 0.18)),
    url("../img/arena-coordinates-maproom.jpg") center center / cover no-repeat;
  border: 1px solid rgba(246, 237, 220, 0.28);
  border-radius: 8px;
  box-shadow: 0 24px 60px rgba(30, 38, 51, 0.34);
  height: min(740px, calc(100vh - 130px));
  min-height: 680px;
  overflow: hidden;
  position: relative;
  isolation: isolate;
}

.mirror-room__scene::before {
  background:
    linear-gradient(90deg, rgba(246, 237, 220, 0.14) 0 1px, transparent 1px 10%),
    repeating-linear-gradient(90deg, transparent 0 9%, rgba(246, 237, 220, 0.08) 9% 10%, transparent 10% 20%),
    linear-gradient(180deg, rgba(20, 26, 38, 0.1), transparent 46%);
  content: "";
  inset: 0;
  position: absolute;
  z-index: 1;
}

.mirror-room__scene::after {
  background:
    repeating-linear-gradient(90deg, rgba(30, 38, 51, 0.13) 0 4px, transparent 4px 42px),
    linear-gradient(180deg, #6f806f, #33464b);
  border-top: 1px solid rgba(246, 237, 220, 0.2);
  bottom: -58px;
  box-shadow: 0 -20px 45px rgba(30, 38, 51, 0.3);
  content: "";
  height: 210px;
  left: -3%;
  position: absolute;
  right: -3%;
  transform: skewY(-2deg);
  z-index: -1;
}

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

.mirror-room__arches span {
  background: linear-gradient(180deg, rgba(246, 237, 220, 0.58), rgba(90, 166, 184, 0.5));
  border: 1px solid rgba(255, 247, 228, 0.3);
  border-radius: 28px 28px 4px 4px;
  height: 90px;
  width: 44px;
}

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

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

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

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

.mirror-room__prompt span,
.mirror-shelf__title span,
.mirror-problem-card > span,
.mirror-grid-panel > span,
.mirror-readout span,
.mirror-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;
}

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

.mirror-shelf {
  background: linear-gradient(180deg, rgba(30, 38, 51, 0.9), rgba(32, 36, 47, 0.88));
  border: 2px solid rgba(246, 237, 220, 0.32);
  border-radius: 8px;
  box-shadow: 0 14px 28px rgba(28, 32, 42, 0.28);
  left: 4%;
  padding: 9px 12px;
  position: absolute;
  right: 4%;
  top: 13%;
  z-index: 4;
}

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

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

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

.mirror-shelf__slot {
  background: rgba(246, 237, 220, 0.08);
  border: 1px dashed rgba(246, 237, 220, 0.28);
  border-radius: 6px;
  display: grid;
  min-height: 74px;
  padding: 6px;
  place-items: center;
}

.mirror-shelf__slot.is-current {
  border-color: rgba(90, 166, 184, 0.62);
}

.mirror-shelf__slot.is-filled {
  animation: mirrorMarkArrive 420ms ease both;
  background: rgba(246, 237, 220, 0.16);
  border-style: solid;
}

.mirror-snapshot {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.28), transparent 44%),
    linear-gradient(180deg, #c9f0f5, #5aa6b8);
  border: 1px solid rgba(42, 79, 86, 0.3);
  border-radius: 6px;
  box-shadow: 0 8px 14px rgba(28, 32, 42, 0.22);
  color: var(--mirror-ink);
  display: grid;
  gap: 2px;
  min-height: 56px;
  min-width: 0;
  padding: 7px;
  text-align: center;
  width: 100%;
}

.mirror-shelf__slot:not(.is-filled) .mirror-snapshot {
  background: rgba(246, 237, 220, 0.08);
  box-shadow: none;
  color: rgba(255, 242, 212, 0.5);
}

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

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

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

.mirror-step {
  background: rgba(30, 38, 51, 0.74);
  border: 1px solid rgba(246, 237, 220, 0.2);
  border-radius: 999px;
  color: rgba(255, 247, 223, 0.74);
  font-size: 0.66rem;
  font-weight: 900;
  letter-spacing: 0.03em;
  padding: 8px 10px;
  text-align: center;
}

.mirror-step--active {
  background: rgba(90, 166, 184, 0.26);
  border-color: rgba(90, 166, 184, 0.58);
  color: #fff7df;
}

.mirror-step--complete {
  background: rgba(45, 95, 137, 0.32);
  border-color: rgba(91, 128, 168, 0.54);
  color: #e5f3ff;
}

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

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

.mirror-problem-card,
.mirror-main-panel,
.mirror-aldra {
  background: rgba(30, 38, 51, 0.86);
  border: 1px solid rgba(246, 237, 220, 0.28);
  border-radius: 8px;
  box-shadow: 0 16px 28px rgba(20, 26, 36, 0.25);
}

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

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

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

.mirror-readout {
  display: grid;
  gap: 8px;
}

.mirror-readout 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: 9px;
}

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

.mirror-readout strong {
  color: var(--mirror-brass-light);
  font-family: var(--font-display);
  font-size: 1.32rem;
  line-height: 1;
}

.mirror-main-panel {
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) 150px;
  padding: 12px;
}

.mirror-grid-panel {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.mirror-grid-panel > span {
  color: rgba(255, 248, 226, 0.72);
}

.mirror-grid {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) 22px;
  min-height: 384px;
}

.mirror-grid__board {
  aspect-ratio: 1;
  background:
    linear-gradient(90deg, rgba(30, 38, 51, 0.1) 1px, transparent 1px),
    linear-gradient(0deg, rgba(30, 38, 51, 0.1) 1px, transparent 1px),
    linear-gradient(180deg, #ecf4ec, #c9ddd7);
  background-size: calc(100% / 16) calc(100% / 16), calc(100% / 16) calc(100% / 16), auto;
  border: 2px solid rgba(246, 237, 220, 0.7);
  border-radius: 8px;
  box-shadow: inset 0 0 22px rgba(30, 38, 51, 0.18), 0 14px 24px rgba(20, 26, 36, 0.22);
  grid-column: 2;
  grid-row: 1;
  overflow: visible;
  position: relative;
}

.mirror-grid__xlabels,
.mirror-grid__ylabels {
  color: rgba(255, 248, 226, 0.74);
  font-size: 0.52rem;
  font-weight: 900;
}

.mirror-grid__xlabels {
  display: grid;
  grid-column: 2;
  grid-row: 2;
  grid-template-columns: repeat(17, minmax(0, 1fr));
  padding-top: 4px;
  text-align: center;
}

.mirror-grid__ylabels {
  display: grid;
  grid-column: 1;
  grid-row: 1;
  grid-template-rows: repeat(17, minmax(0, 1fr));
  padding-right: 5px;
  text-align: right;
}

.mirror-grid__ylabels span {
  transform: translateY(-0.45em);
}

.mirror-axis {
  background: rgba(30, 38, 51, 0.36);
  position: absolute;
  z-index: 2;
}

.mirror-axis.is-active {
  background: var(--mirror-glass);
  box-shadow: 0 0 16px rgba(90, 166, 184, 0.58);
}

.mirror-axis--x {
  height: 4px;
  left: 0;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
}

.mirror-axis--y {
  bottom: 0;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
  width: 4px;
}

.mirror-grid-point {
  background: transparent;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  height: 28px;
  padding: 0;
  position: absolute;
  transform: translate(-50%, 50%);
  width: 28px;
  z-index: 4;
}

.mirror-grid-point:disabled {
  cursor: default;
}

.mirror-grid-point span {
  background: rgba(30, 38, 51, 0.12);
  border: 1px solid rgba(30, 38, 51, 0.12);
  border-radius: 50%;
  display: block;
  height: 7px;
  left: 50%;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  transition: background 180ms ease, box-shadow 180ms ease, transform 180ms ease;
  width: 7px;
}

.mirror-grid-point:hover span,
.mirror-grid-point:focus-visible span {
  background: rgba(45, 95, 137, 0.56);
  box-shadow: 0 0 0 6px rgba(45, 95, 137, 0.12);
  transform: translate(-50%, -50%) scale(1.08);
}

.mirror-grid-point.is-selected span {
  background: var(--mirror-cord);
  box-shadow: 0 0 0 7px rgba(185, 78, 63, 0.13);
}

.mirror-grid-point.is-correct span {
  background: var(--mirror-brass);
  box-shadow: 0 0 0 7px rgba(198, 154, 53, 0.17), 0 0 18px rgba(198, 154, 53, 0.46);
}

.mirror-original,
.mirror-image-pin {
  align-items: center;
  border: 2px solid rgba(87, 60, 26, 0.58);
  border-radius: 50% 50% 50% 0;
  box-shadow: 0 8px 16px rgba(30, 38, 51, 0.26);
  display: flex;
  font-family: var(--font-display);
  height: 34px;
  justify-content: center;
  pointer-events: none;
  position: absolute;
  transform: translate(-50%, 50%) rotate(-45deg);
  width: 34px;
  z-index: 6;
}

.mirror-original strong,
.mirror-image-pin strong {
  transform: rotate(45deg);
}

.mirror-original {
  background: linear-gradient(180deg, #dcecff, var(--mirror-blue));
  color: #fff8df;
}

.mirror-image-pin {
  background: linear-gradient(180deg, #fff7d4, #a85645);
  color: #fff8df;
  font-size: 0.74rem;
}

.mirror-image-pin.is-correct {
  background: linear-gradient(180deg, #fff7d4, var(--mirror-brass));
  color: var(--mirror-ink);
}

.mirror-lock-panel {
  background: rgba(255, 247, 223, 0.94);
  border: 2px solid rgba(123, 83, 42, 0.3);
  border-radius: 8px;
  color: var(--mirror-ink);
  display: grid;
  padding: 10px;
  place-items: center;
  text-align: center;
}

.mirror-lock {
  align-items: center;
  background: rgba(30, 38, 51, 0.14);
  border: 2px solid rgba(30, 38, 51, 0.14);
  border-radius: 8px;
  color: rgba(30, 38, 51, 0.48);
  cursor: pointer;
  display: grid;
  gap: 8px;
  min-height: 156px;
  padding: 12px;
  width: 100%;
}

.mirror-lock:disabled {
  cursor: default;
}

.mirror-lock span {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.72), rgba(90, 166, 184, 0.72));
  border: 2px solid rgba(42, 79, 86, 0.45);
  border-radius: 8px;
  height: 48px;
  margin: 0 auto;
  width: 48px;
}

.mirror-lock.is-ready {
  background: linear-gradient(180deg, #d6f4f7, #5aa6b8);
  border-color: rgba(42, 79, 86, 0.36);
  box-shadow: 0 0 18px rgba(90, 166, 184, 0.38);
  color: var(--mirror-ink);
}

.mirror-lock strong {
  font-size: 0.9rem;
}

.mirror-aldra {
  min-height: 300px;
  overflow: visible;
  padding: 12px;
  position: relative;
}

.mirror-aldra__head {
  background: #bd815c;
  border-radius: 42% 42% 48% 48%;
  height: 46px;
  left: 50%;
  position: absolute;
  top: 42px;
  transform: translateX(-50%);
  width: 40px;
}

.mirror-aldra__head span {
  background: rgba(30, 38, 51, 0.28);
  border-radius: 999px;
  height: 4px;
  left: 9px;
  position: absolute;
  top: 24px;
  width: 22px;
}

.mirror-aldra__body {
  background: linear-gradient(180deg, #3f6d92, #27384c);
  border-radius: 28px 28px 10px 10px;
  height: 116px;
  left: 50%;
  position: absolute;
  top: 84px;
  transform: translateX(-50%);
  width: 70px;
}

.mirror-aldra__arm {
  background: #bd815c;
  border-radius: 999px;
  height: 12px;
  position: absolute;
  top: 118px;
  width: 58px;
}

.mirror-aldra__arm--left {
  left: 28px;
  transform: rotate(-22deg);
}

.mirror-aldra__arm--right {
  right: 28px;
  transform: rotate(22deg);
}

.mirror-aldra__pool {
  height: 92px;
  left: 50%;
  position: absolute;
  top: 190px;
  transform: translateX(-50%);
  width: 122px;
}

.mirror-aldra__pool span {
  background:
    radial-gradient(ellipse at 50% 40%, rgba(255, 255, 255, 0.62), transparent 34%),
    linear-gradient(180deg, #c9f0f5, #5aa6b8);
  border: 2px solid rgba(42, 79, 86, 0.32);
  border-radius: 50%;
  box-shadow: 0 0 18px rgba(90, 166, 184, 0.34);
  display: block;
  height: 62px;
  width: 122px;
}

.mirror-aldra__bubble {
  background: rgba(246, 237, 220, 0.96);
  border: 1px solid rgba(90, 166, 184, 0.32);
  border-radius: 8px;
  box-shadow: 0 14px 24px rgba(20, 26, 36, 0.22);
  color: var(--mirror-ink);
  font-size: 0.86rem;
  line-height: 1.25;
  padding: 10px;
  position: absolute;
  right: 8px;
  top: -30px;
  width: 178px;
}

.mirror-why {
  background: rgba(255, 247, 223, 0.95);
  border: 1px solid rgba(90, 166, 184, 0.22);
  border-radius: 8px;
  color: var(--mirror-ink);
  margin: 8px 0;
  padding: 10px 12px;
  text-align: left;
}

.mirror-why span {
  color: rgba(30, 38, 51, 0.58);
}

.mirror-why p {
  font-size: 0.88rem;
  line-height: 1.28;
  margin: 4px 0 0;
}

.mirror-celebration {
  background: rgba(30, 38, 51, 0.92);
  border: 1px solid rgba(246, 237, 220, 0.28);
  border-radius: 8px;
  bottom: 18px;
  box-shadow: 0 18px 34px rgba(20, 26, 36, 0.32);
  color: #fff5d8;
  left: 50%;
  max-width: min(720px, 84%);
  padding: 14px 18px;
  position: absolute;
  text-align: center;
  transform: translateX(-50%);
  z-index: 12;
}

.mirror-celebration > strong {
  color: var(--mirror-brass-light);
  display: block;
  font-family: var(--font-display);
  font-size: 1.4rem;
}

.mirror-celebration > span {
  display: block;
  font-size: 0.8rem;
  margin-bottom: 10px;
}

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

.mirror-reward__card {
  background: rgba(30, 38, 51, 0.94);
  border: 1px solid rgba(246, 237, 220, 0.3);
  border-radius: 8px;
  box-shadow: 0 24px 54px rgba(20, 26, 36, 0.38);
  color: #fff5d8;
  display: grid;
  gap: 14px;
  max-width: 860px;
  padding: 24px;
  text-align: center;
  width: min(100%, 860px);
}

.mirror-reward__copy span {
  color: rgba(255, 248, 226, 0.72);
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.mirror-reward__copy h2 {
  color: #c9f0f5;
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3.6rem);
  line-height: 0.95;
  margin: 4px 0;
}

.mirror-reward__copy p {
  margin: 0;
}

.mirror-reward__marks {
  display: grid;
  gap: 9px;
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

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

.mirror-reward__badges span {
  background: rgba(246, 237, 220, 0.12);
  border: 1px solid rgba(246, 237, 220, 0.18);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 900;
  padding: 7px 10px;
}

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

@keyframes mirrorMarkArrive {
  from {
    opacity: 0;
    transform: translateY(8px) rotate(-1deg);
  }
  to {
    opacity: 1;
    transform: translateY(0) rotate(0);
  }
}

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

  .mirror-workbench {
    grid-template-columns: 1fr;
    position: relative;
    top: 230px;
  }

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

  .mirror-aldra {
    min-height: 230px;
  }
}

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

  .mirror-steps {
    grid-template-columns: 1fr;
  }

  .mirror-workbench {
    top: 290px;
  }

  .mirror-grid {
    min-height: 300px;
  }
}
