/* Coordinates L7: Rule Road */

.road-page {
  --road-ink: #1e2633;
  --road-paper: #f6eddc;
  --road-brass: #c69a35;
  --road-brass-light: #f0cf72;
  --road-blue: #2d5f89;
  --road-cord: #b94e3f;
  --road-green: #4f8f73;
  color: var(--road-ink);
}

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

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

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

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

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

.road-progress__dot.is-current {
  background: var(--road-paper);
  box-shadow: 0 0 0 3px rgba(79, 143, 115, 0.22);
}

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

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

.road-room__scene {
  background:
    radial-gradient(circle at 25% 18%, rgba(240, 207, 114, 0.28), transparent 24%),
    radial-gradient(circle at 82% 30%, rgba(79, 143, 115, 0.26), 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;
}

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

.road-room__scene::after {
  background:
    repeating-linear-gradient(90deg, rgba(30, 38, 51, 0.13) 0 4px, transparent 4px 42px),
    linear-gradient(180deg, #7c6740, #374638);
  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;
}

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

.road-room__arches span {
  background: linear-gradient(180deg, rgba(246, 237, 220, 0.6), rgba(79, 143, 115, 0.48));
  border: 1px solid rgba(255, 247, 228, 0.3);
  border-radius: 28px 28px 4px 4px;
  height: 90px;
  width: 44px;
}

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

.road-room__lamps span {
  background: radial-gradient(circle, #fff6ca 0 35%, var(--road-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;
}

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

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

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

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

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

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

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

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

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

.road-shelf__slot.is-current {
  border-color: rgba(79, 143, 115, 0.62);
}

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

.road-snapshot {
  background:
    linear-gradient(90deg, rgba(30, 38, 51, 0.1) 0 2px, transparent 2px 18px),
    linear-gradient(180deg, #e6d38a, #4f8f73);
  border: 1px solid rgba(53, 82, 47, 0.3);
  border-radius: 6px;
  box-shadow: 0 8px 14px rgba(28, 32, 42, 0.22);
  color: var(--road-ink);
  display: grid;
  gap: 2px;
  min-height: 56px;
  min-width: 0;
  padding: 7px;
  text-align: center;
  width: 100%;
}

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

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

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

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

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

.road-step--active {
  background: rgba(79, 143, 115, 0.26);
  border-color: rgba(79, 143, 115, 0.58);
  color: #fff7df;
}

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

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

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

.road-problem-card,
.road-main-panel,
.road-veth {
  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);
}

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

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

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

.road-rule {
  background: rgba(255, 247, 223, 0.1);
  border: 1px solid rgba(255, 247, 223, 0.16);
  border-radius: 6px;
  display: grid;
  gap: 3px;
  padding: 10px;
}

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

.road-rule strong {
  color: var(--road-brass-light);
  font-family: var(--font-display);
  font-size: 1.42rem;
  line-height: 1;
}

.road-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.road-chip {
  background: rgba(255, 247, 223, 0.1);
  border: 1px solid rgba(255, 247, 223, 0.18);
  border-radius: 999px;
  color: #fff5d8;
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 900;
  padding: 7px 9px;
}

.road-chip.is-selected {
  background: rgba(198, 154, 53, 0.32);
  border-color: rgba(198, 154, 53, 0.66);
}

.road-chip.is-correct {
  background: rgba(79, 143, 115, 0.42);
  border-color: rgba(79, 143, 115, 0.72);
}

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

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

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

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

.road-grid__board {
  aspect-ratio: 1;
  background:
    linear-gradient(90deg, rgba(30, 38, 51, 0.13) 1px, transparent 1px),
    linear-gradient(0deg, rgba(30, 38, 51, 0.13) 1px, transparent 1px),
    linear-gradient(180deg, #ecf4ec, #c9ddd7);
  background-size: calc(100% / 6) calc(100% / 6), calc(100% / 6) calc(100% / 6), 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;
}

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

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

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

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

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

.road-axis--x {
  bottom: 0;
  height: 4px;
  left: 0;
  right: 0;
}

.road-axis--y {
  bottom: 0;
  left: 0;
  top: 0;
  width: 4px;
}

.road-line {
  inset: 0;
  pointer-events: none;
  position: absolute;
  z-index: 3;
}

.road-line line {
  stroke: var(--road-green);
  stroke-linecap: round;
  stroke-width: 2.2;
  vector-effect: non-scaling-stroke;
}

.road-candidate {
  align-items: center;
  background: linear-gradient(180deg, #f7f0da, #d7e4dd);
  border: 2px solid rgba(30, 38, 51, 0.26);
  border-radius: 50%;
  box-shadow: 0 8px 16px rgba(30, 38, 51, 0.22);
  color: var(--road-ink);
  cursor: pointer;
  display: flex;
  font-size: 0.64rem;
  font-weight: 900;
  height: 40px;
  justify-content: center;
  padding: 0;
  position: absolute;
  transform: translate(-50%, 50%);
  width: 40px;
  z-index: 5;
}

.road-candidate.is-selected {
  background: linear-gradient(180deg, #fff7d4, var(--road-brass));
  border-color: rgba(87, 60, 26, 0.54);
  box-shadow: 0 0 0 8px rgba(198, 154, 53, 0.14), 0 8px 16px rgba(30, 38, 51, 0.22);
}

.road-candidate.is-correct {
  background: linear-gradient(180deg, #e6f0d4, var(--road-green));
  color: #fff8df;
}

.road-candidate.is-wrong {
  background: linear-gradient(180deg, #fff7d4, var(--road-cord));
  color: #fff8df;
}

.road-candidate:disabled {
  cursor: default;
}

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

.road-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%;
}

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

.road-lock span {
  background:
    linear-gradient(45deg, transparent 0 42%, var(--road-green) 43% 57%, transparent 58%),
    linear-gradient(180deg, #e6d38a, #4f8f73);
  border: 2px solid rgba(53, 82, 47, 0.45);
  border-radius: 8px;
  height: 48px;
  margin: 0 auto;
  width: 54px;
}

.road-lock.is-ready {
  background: linear-gradient(180deg, #f6edc4, #4f8f73);
  border-color: rgba(53, 82, 47, 0.36);
  box-shadow: 0 0 18px rgba(79, 143, 115, 0.38);
  color: var(--road-ink);
}

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

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

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

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

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

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

.road-veth__arm--left {
  left: 28px;
  transform: rotate(-22deg);
}

.road-veth__arm--right {
  right: 28px;
  transform: rotate(22deg);
}

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

.road-veth__proof span {
  background:
    linear-gradient(45deg, transparent 0 42%, rgba(79, 143, 115, 0.86) 43% 57%, transparent 58%),
    linear-gradient(90deg, rgba(30, 38, 51, 0.12) 0 1px, transparent 1px 20px),
    linear-gradient(180deg, #fff1c8, #d9b56c);
  background-size: auto, 20px 20px, auto;
  border: 2px solid rgba(87, 60, 26, 0.32);
  border-radius: 8px;
  display: block;
  height: 64px;
  transform: rotate(-4deg);
  width: 122px;
}

.road-veth__proof i {
  background: var(--road-green);
  border-radius: 50%;
  box-shadow: 26px 18px 0 var(--road-green), 52px 36px 0 var(--road-green);
  height: 8px;
  left: 32px;
  position: absolute;
  top: 16px;
  width: 8px;
}

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

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

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

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

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

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

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

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

.road-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);
}

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

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

.road-reward__copy p {
  margin: 0;
}

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

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

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

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

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

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

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

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

  .road-veth {
    min-height: 230px;
  }
}

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

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

  .road-workbench {
    top: 290px;
  }

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