/* Neon Ladder */
.ladder-page {
  padding: 28px 0 72px;
}

.ladder-shell {
  width: min(94vw, 2080px);
  margin-inline: auto;
}

.ladder-hero {
  position: relative;
  min-height: 300px;
  display: grid;
  grid-template-columns: minmax(520px, 1fr) minmax(520px, 0.92fr);
  gap: clamp(24px, 2.5vw, 56px);
  align-items: end;
  padding: clamp(30px, 2.5vw, 56px);
  border-radius: 34px;
  overflow: hidden;
  background:
    radial-gradient(circle at 82% 40%, rgba(56, 231, 255, 0.13), transparent 32%),
    radial-gradient(circle at 34% 10%, rgba(255, 77, 221, 0.15), transparent 28%),
    linear-gradient(180deg, rgba(20, 6, 34, 0.94), rgba(7, 2, 12, 0.96));
  border: 1px solid rgba(205, 116, 255, 0.26);
  box-shadow: 0 0 42px rgba(150, 52, 255, 0.2);
}

.ladder-hero::before {
  content: "";
  position: absolute;
  inset: 22px;
  border-radius: 26px;
  border: 1px solid rgba(255, 113, 232, 0.15);
  pointer-events: none;
}

.ladder-kicker {
  margin: 0 0 8px;
  color: #ff74e9;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.28em;
}

.ladder-hero h1 {
  margin: 0;
  font-size: clamp(58px, 5vw, 116px);
  line-height: 0.95;
  text-shadow:
    0 0 12px rgba(255,255,255,0.44),
    0 0 32px rgba(165, 72, 255, 0.72),
    7px 0 0 rgba(56, 231, 255, 0.25),
    -7px 0 0 rgba(255, 77, 221, 0.25);
}

.ladder-hero-copy,
.ladder-hero-status {
  position: relative;
  z-index: 2;
}

.ladder-hero-copy p:not(.ladder-kicker) {
  max-width: 780px;
  margin: 22px 0 0;
  color: #d2bee8;
  font-size: 18px;
  line-height: 1.8;
}

.ladder-hero-status {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.ladder-hero-status div {
  min-height: 122px;
  padding: 22px;
  border-radius: 24px;
  background: rgba(14, 5, 24, 0.82);
  border: 1px solid rgba(205, 116, 255, 0.24);
}

.ladder-hero-status span {
  display: block;
  margin-bottom: 14px;
  color: #bda1da;
  font-size: 13px;
  font-weight: 800;
}

.ladder-hero-status strong {
  font-size: clamp(26px, 2vw, 38px);
}

.ladder-layout {
  margin-top: 28px;
  display: grid;
  grid-template-columns: minmax(720px, 1.45fr) minmax(390px, 0.55fr);
  gap: 24px;
  align-items: stretch;
}

.ladder-board-panel,
.ladder-control-panel,
.ladder-history-section {
  position: relative;
  overflow: hidden;
  border-radius: 36px;
  background:
    linear-gradient(180deg, rgba(15, 5, 25, 0.92), rgba(7, 2, 12, 0.96));
  border: 1px solid rgba(205, 116, 255, 0.24);
  box-shadow:
    0 0 42px rgba(150, 52, 255, 0.16),
    inset 0 0 0 1px rgba(255,255,255,0.03);
}

.ladder-board-panel {
  min-height: 980px;
  padding: clamp(22px, 2vw, 34px);
  isolation: isolate;
}

.ladder-board-panel::before {
  content: "";
  position: absolute;
  inset: 22px;
  border-radius: 28px;
  border: 1px solid rgba(255, 113, 232, 0.13);
  z-index: 2;
  pointer-events: none;
}

.ladder-city {
  position: absolute;
  bottom: 0;
  width: min(26vw, 480px);
  opacity: 0.32;
  z-index: 0;
  pointer-events: none;
}

.ladder-city.city-left {
  left: -40px;
}

.ladder-city.city-right {
  right: -40px;
  transform: scaleX(-1);
}

.ladder-spark {
  position: absolute;
  width: min(22vw, 320px);
  z-index: 1;
  opacity: 0.8;
}

.ladder-spark.spark-a {
  right: 6%;
  top: 9%;
  animation: ladderFlicker 1.3s infinite;
}

.ladder-spark.spark-b {
  left: 9%;
  bottom: 12%;
  transform: rotate(180deg);
  animation: ladderFlicker 1.6s infinite 0.2s;
}

.ladder-stage-head,
.start-row,
.ladder-board-wrap,
.result-row {
  position: relative;
  z-index: 3;
}

.ladder-stage-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  min-height: 96px;
  padding: 18px 20px;
  border-radius: 24px;
  background: rgba(10, 3, 18, 0.72);
  border: 1px solid rgba(205, 116, 255, 0.16);
}

.ladder-stage-head span {
  color: #ff74e9;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.18em;
}

.ladder-stage-head h2 {
  margin: 6px 0 0;
  font-size: clamp(26px, 2vw, 42px);
}

.ladder-route-chip {
  min-width: 160px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(56, 231, 255, 0.08);
  border: 1px solid rgba(56, 231, 255, 0.25);
  color: #91f1ff;
  font-weight: 900;
  letter-spacing: 0.12em;
  font-size: 12px;
}

.start-row,
.result-row {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0;
  margin-top: 18px;
}

.start-btn {
  margin-inline: 5px;
  min-height: 70px;
  border: 1px solid rgba(145, 241, 255, 0.22);
  border-radius: 20px;
  background:
    radial-gradient(circle at 50% 30%, rgba(255, 77, 221, 0.13), transparent 55%),
    rgba(17, 5, 29, 0.88);
  color: #e8d9ff;
  cursor: pointer;
  font-size: clamp(20px, 1.6vw, 34px);
  font-weight: 900;
  transition: 0.22s ease;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.03);
}

.start-btn small {
  display: block;
  margin-top: 4px;
  color: #a98ec2;
  font-size: 11px;
  letter-spacing: 0.12em;
}

.start-btn:hover,
.start-btn.is-selected {
  transform: translateY(-4px);
  border-color: rgba(255, 113, 232, 0.65);
  box-shadow: 0 0 24px rgba(255, 77, 221, 0.18);
}

.start-btn.is-selected {
  background:
    radial-gradient(circle at 50% 30%, rgba(255, 77, 221, 0.28), transparent 58%),
    rgba(32, 8, 54, 0.96);
}

.start-btn.is-locked {
  opacity: 0.54;
  pointer-events: none;
}

.ladder-board-wrap {
  min-height: 650px;
  margin-top: 20px;
  border-radius: 30px;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 50%, rgba(56, 231, 255, 0.06), transparent 64%),
    radial-gradient(circle at 50% 50%, rgba(255, 77, 221, 0.08), transparent 46%),
    rgba(3, 0, 8, 0.66);
  border: 1px solid rgba(205, 116, 255, 0.18);
}

.ladder-svg {
  display: block;
  width: 100%;
  height: 650px;
}

.ladder-base-line {
  stroke: rgba(145, 241, 255, 0.34);
  stroke-width: 6;
  filter: url(#ladderGlow);
}

.ladder-bridge-line {
  stroke: rgba(255, 77, 221, 0.58);
  stroke-width: 7;
  stroke-linecap: round;
  filter: url(#ladderGlow);
}

.ladder-node {
  fill: rgba(255,255,255,0.9);
  filter: url(#ladderGlow);
}

#routePath {
  fill: none;
  stroke: url(#ladderPathGradient);
  stroke-width: 12;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: url(#ladderGlow);
  stroke-dasharray: 1000;
  stroke-dashoffset: 1000;
  opacity: 0;
}

#routePath.is-running {
  opacity: 1;
  animation: ladderRouteDraw 3.9s cubic-bezier(.14,.82,.22,1) forwards;
}

#routeOrb {
  fill: #fff;
  stroke: #ff4ddd;
  stroke-width: 5;
  filter: url(#ladderGlow);
  opacity: 0;
}

#routeOrb.is-running {
  opacity: 1;
}

.result-card {
  position: relative;
  margin-inline: 5px;
  min-height: 116px;
  padding: 14px 10px;
  border-radius: 20px;
  background: rgba(22, 8, 34, 0.82);
  border: 1px solid rgba(205, 116, 255, 0.16);
  text-align: center;
  overflow: hidden;
}

.result-card::before {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.06);
}

.result-card b,
.result-card span {
  position: relative;
  z-index: 1;
  display: block;
}

.result-card b {
  margin-top: 5px;
  font-size: 15px;
}

.result-card span {
  margin-top: 6px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.result-card.legendary { border-color: rgba(255, 197, 109, 0.48); color: #ffd58f; }
.result-card.epic { border-color: rgba(255, 77, 221, 0.48); color: #ff87ec; }
.result-card.rare { border-color: rgba(56, 231, 255, 0.42); color: #91f1ff; }
.result-card.normal { border-color: rgba(198, 182, 216, 0.22); color: #d9c7e9; }

.result-card.is-final {
  transform: translateY(-5px);
  box-shadow: 0 0 30px rgba(255, 77, 221, 0.22);
}

.ladder-result-panel {
  position: absolute;
  z-index: 12;
  left: 50%;
  top: 52%;
  width: min(90%, 640px);
  transform: translate(-50%, -50%) scale(0.84);
  opacity: 0;
  pointer-events: none;
  padding: 30px;
  text-align: center;
  border-radius: 34px;
  background:
    radial-gradient(circle at 50% 25%, rgba(255, 77, 221, 0.20), transparent 36%),
    linear-gradient(180deg, rgba(22, 8, 36, 0.97), rgba(6, 1, 12, 0.98));
  border: 1px solid rgba(255, 113, 232, 0.46);
  box-shadow:
    0 0 72px rgba(255, 77, 221, 0.36),
    inset 0 0 0 1px rgba(255,255,255,0.04);
  transition: 0.42s ease;
}

.ladder-result-panel.is-show {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

.ladder-result-panel > span {
  display: inline-flex;
  height: 34px;
  align-items: center;
  padding: 0 14px;
  border-radius: 999px;
  color: #ff87ec;
  background: rgba(255, 77, 221, 0.12);
  border: 1px solid rgba(255, 77, 221, 0.38);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.16em;
}

.ladder-result-panel.legendary > span { color: #ffd58f; border-color: rgba(255, 197, 109, 0.42); background: rgba(255, 197, 109, 0.12); }
.ladder-result-panel.epic > span { color: #ff87ec; }
.ladder-result-panel.rare > span { color: #91f1ff; border-color: rgba(56, 231, 255, 0.38); background: rgba(56, 231, 255, 0.1); }
.ladder-result-panel.normal > span { color: #d9c7e9; border-color: rgba(198, 182, 216, 0.24); background: rgba(198, 182, 216, 0.08); }

.ladder-result-panel img {
  display: block;
  width: min(80%, 360px);
  margin: 16px auto 8px;
  filter:
    drop-shadow(0 0 24px rgba(255, 77, 221, 0.26))
    drop-shadow(0 0 64px rgba(163, 61, 255, 0.38));
}

.ladder-result-panel h2 {
  margin: 8px 0;
  font-size: clamp(34px, 2.5vw, 58px);
}

.ladder-result-panel p {
  margin: 0;
  color: #cab4df;
}

.ladder-result-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 24px;
}

.ladder-result-actions button,
.ladder-result-actions a {
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  font-weight: 900;
  text-decoration: none;
}

.ladder-result-actions button {
  border: 1px solid rgba(255, 130, 237, 0.34);
  background: rgba(31, 10, 50, 0.88);
  color: #fff;
  cursor: pointer;
}

.ladder-result-actions a {
  color: #fff;
  background: linear-gradient(135deg, #7920e9, #ff4ddd);
  box-shadow: 0 0 30px rgba(255, 77, 221, 0.28);
}

.ladder-control-panel {
  display: grid;
  gap: 16px;
  padding: 22px;
}

.panel-block {
  padding: 22px;
  border-radius: 26px;
  background: rgba(15, 5, 25, 0.84);
  border: 1px solid rgba(205, 116, 255, 0.20);
}

.ladder-selected h2 {
  margin: 0 0 8px;
  font-size: clamp(38px, 3vw, 58px);
}

.ladder-selected span {
  color: #bfa8d8;
}

.ladder-jackpot-img {
  min-height: 190px;
  display: grid;
  place-items: center;
}

.ladder-jackpot-img img {
  width: min(92%, 260px);
  filter: drop-shadow(0 0 28px rgba(255, 197, 109, 0.18));
}

.ladder-product h3 {
  margin: 8px 0;
  font-size: 25px;
}

.ladder-product p {
  margin: 0;
  color: #bfa8d8;
  line-height: 1.65;
}

.price-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(205, 116, 255, 0.18);
}

.price-row span {
  color: #bfa8d8;
  font-weight: 800;
}

.price-row strong {
  font-size: 30px;
}

.ladder-probability {
  display: grid;
  gap: 8px;
  margin: 16px 0;
}

.ladder-probability div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255,255,255,0.045);
  border: 1px solid rgba(255,255,255,0.055);
}

.ladder-probability b,
.ladder-probability span {
  font-size: 13px;
}

.ladder-probability .legendary { color: #ffd58f; }
.ladder-probability .epic { color: #ff87ec; }
.ladder-probability .rare { color: #91f1ff; }
.ladder-probability .normal { color: #d9c7e9; }

.ladder-play-btn,
.ladder-reset-btn {
  width: 100%;
  height: 60px;
  border: 0;
  border-radius: 18px;
  color: #fff;
  font-weight: 900;
  cursor: pointer;
}

.ladder-play-btn {
  background: linear-gradient(135deg, #7920e9, #ff4ddd);
  box-shadow: 0 0 30px rgba(255, 77, 221, 0.28);
}

.ladder-play-btn:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  filter: grayscale(0.7);
}

.ladder-reset-btn {
  position: relative;
  margin-top: 10px;
  background: rgba(31, 10, 50, 0.88);
  border: 1px solid rgba(255, 130, 237, 0.28);
}

.ladder-reset-btn::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 12px);
  z-index: 10;
  width: max-content;
  max-width: min(260px, 78vw);
  padding: 9px 12px;
  border-radius: 12px;
  background: rgba(6, 1, 12, 0.96);
  border: 1px solid rgba(255, 130, 237, 0.34);
  color: #fff;
  font-size: 12px;
  line-height: 1.45;
  box-shadow: 0 0 24px rgba(255, 77, 221, 0.22);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 6px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.ladder-reset-btn::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: calc(100% + 5px);
  z-index: 11;
  border: 7px solid transparent;
  border-top-color: rgba(255, 130, 237, 0.34);
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%);
  transition: opacity 0.18s ease;
}

.ladder-reset-btn:hover {
  border-color: rgba(255, 213, 143, 0.5);
  box-shadow: 0 0 24px rgba(255, 197, 109, 0.14);
}

.ladder-reset-btn:hover::before,
.ladder-reset-btn:hover::after {
  opacity: 1;
  transform: translate(-50%, 0);
}

.ladder-reset-btn:hover::before {
  transform: translateX(-50%);
}

.mini-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}

.mini-head h3 {
  margin: 0;
  font-size: 22px;
}

.mini-head span {
  color: #91f1ff;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.14em;
}

.ladder-recent-list {
  display: grid;
  gap: 10px;
}

.ladder-recent-item {
  display: grid;
  grid-template-columns: 54px 1fr auto;
  gap: 12px;
  align-items: center;
  min-height: 72px;
  padding: 10px;
  border-radius: 18px;
  background: rgba(22, 8, 34, 0.82);
  border: 1px solid rgba(205, 116, 255, 0.14);
}

.ladder-recent-item img {
  width: 54px;
  height: 54px;
  object-fit: contain;
}

.ladder-recent-item b {
  display: block;
  font-size: 14px;
}

.ladder-recent-item p {
  margin: 4px 0 0;
  color: #a98ec2;
  font-size: 12px;
}

.ladder-recent-item span {
  font-size: 12px;
  font-weight: 900;
}

.ladder-recent-item.legendary span { color: #ffd58f; }
.ladder-recent-item.epic span { color: #ff87ec; }
.ladder-recent-item.rare span { color: #91f1ff; }

.ladder-history-section {
  margin-top: 28px;
  padding: clamp(24px, 2vw, 38px);
}

.ladder-section-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin-bottom: 22px;
}

.ladder-section-head h2 {
  margin: 0;
  font-size: clamp(30px, 2.3vw, 48px);
}

.ladder-section-head span {
  color: #bfa8d8;
}

.ladder-history-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.empty-history {
  grid-column: 1 / -1;
  min-height: 120px;
  display: grid;
  place-items: center;
  border-radius: 22px;
  background: rgba(22, 8, 34, 0.82);
  border: 1px solid rgba(205, 116, 255, 0.16);
  color: #bfa8d8;
}

.ladder-history-card {
  min-height: 250px;
  padding: 14px;
  border-radius: 22px;
  background:
    radial-gradient(circle at 50% 30%, rgba(163, 61, 255, 0.16), transparent 36%),
    rgba(19, 7, 31, 0.88);
  border: 1px solid rgba(205, 116, 255, 0.20);
}

.ladder-history-card.legendary { border-color: rgba(255, 197, 109, 0.50); }
.ladder-history-card.epic { border-color: rgba(255, 77, 221, 0.48); }
.ladder-history-card.rare { border-color: rgba(56, 231, 255, 0.42); }
.ladder-history-card.normal { border-color: rgba(198, 182, 216, 0.22); }

.ladder-history-card img {
  display: block;
  width: 100%;
  height: 130px;
  object-fit: contain;
}

.ladder-history-card h3 {
  margin: 8px 0 6px;
  font-size: 17px;
}

.ladder-history-card p {
  margin: 0;
  color: #bfa8d8;
  font-size: 13px;
}

.ladder-history-card span {
  display: inline-flex;
  margin-top: 10px;
  height: 27px;
  align-items: center;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  font-size: 11px;
  font-weight: 900;
}

.ladder-history-card.legendary span { color: #ffd58f; }
.ladder-history-card.epic span { color: #ff87ec; }
.ladder-history-card.rare span { color: #91f1ff; }
.ladder-history-card.normal span { color: #d9c7e9; }

@keyframes ladderRouteDraw {
  to { stroke-dashoffset: 0; }
}

@keyframes ladderFlicker {
  0%, 100% { opacity: 0.42; }
  45% { opacity: 1; }
  52% { opacity: 0.26; }
  68% { opacity: 0.88; }
}

@media (max-width: 1480px) {
  .ladder-layout {
    grid-template-columns: minmax(620px, 1.25fr) minmax(360px, 0.75fr);
  }

  .ladder-history-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 1180px) {
  .ladder-hero,
  .ladder-layout {
    grid-template-columns: 1fr;
  }

  .ladder-hero-status {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .ladder-control-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ladder-recent {
    grid-column: 1 / -1;
  }

  .ladder-history-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .ladder-page {
    padding-top: 14px;
  }

  .ladder-hero,
  .ladder-board-panel,
  .ladder-control-panel,
  .ladder-history-section {
    border-radius: 24px;
  }

  .ladder-hero {
    padding: 24px 18px;
  }

  .ladder-hero h1 {
    font-size: 50px;
  }

  .ladder-hero-status,
  .ladder-control-panel,
  .ladder-history-grid {
    grid-template-columns: 1fr;
  }

  .ladder-board-panel {
    min-height: 780px;
    padding: 18px;
  }

  .ladder-stage-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .start-row,
  .result-row {
    gap: 0;
  }

  .start-btn {
    margin-inline: 3px;
    min-height: 58px;
    border-radius: 14px;
    font-size: 17px;
  }

  .start-btn small {
    display: none;
  }

  .ladder-board-wrap {
    min-height: 500px;
  }

  .ladder-svg {
    height: 500px;
  }

  .result-card {
    margin-inline: 3px;
    min-height: 92px;
    padding: 10px 5px;
    border-radius: 14px;
  }

  .result-card b {
    font-size: 12px;
  }

  .result-card span {
    font-size: 9px;
  }

  .ladder-city {
    display: none;
  }

  .ladder-result-actions {
    grid-template-columns: 1fr;
  }
}
