/* Forest Frontier v0.10.0-rc49 — active Ruins map priority pass.
   The route itself owns the screen: compact controls above, node guide below start. */

body.theme-ashen.screen-ruins-active #screenRuins .ruins-screen-panel {
  position: relative;
  display: flex !important;
  flex-direction: column !important;
  box-sizing: border-box;
  height: 100% !important;
  min-height: 0 !important;
  padding: 8px !important;
  overflow: hidden !important;
}

body.theme-ashen.screen-ruins-active #screenRuins .ruins-screen-head,
body.theme-ashen.screen-ruins-active #screenRuins > .screen-panel > .ruins-rules,
body.theme-ashen.screen-ruins-active #screenRuins .ruins-result[hidden] {
  display: none !important;
}

body.theme-ashen.screen-ruins-active #screenRuins .ruins-active-run:not([hidden]) {
  display: grid !important;
  grid-template-rows: auto minmax(0, 1fr) auto !important;
  flex: 1 1 auto !important;
  gap: 7px !important;
  min-height: 0 !important;
  margin: 0 !important;
  overflow: hidden !important;
}

body.theme-ashen.screen-ruins-active #screenRuins .ruins-route-head {
  position: relative;
  z-index: 20;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center !important;
  gap: 8px !important;
  min-height: 50px !important;
  padding: 7px 8px !important;
  border: 1px solid rgba(72, 123, 108, .42);
  border-radius: 11px;
  background:
    radial-gradient(circle at 0 0, rgba(48, 113, 94, .13), transparent 48%),
    rgba(5, 15, 13, .9);
}

body.theme-ashen.screen-ruins-active #screenRuins .ruins-route-copy {
  min-width: 0;
}

body.theme-ashen.screen-ruins-active #screenRuins .ruins-route-copy .section-label {
  display: none !important;
}

body.theme-ashen.screen-ruins-active #screenRuins .ruins-route-head h3 {
  margin: 0 !important;
  overflow: hidden;
  color: #ece2ca;
  font: 700 clamp(16px, 4.7vw, 21px)/1.08 Georgia, serif !important;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.theme-ashen.screen-ruins-active #screenRuins .ruins-route-status {
  margin-top: 3px;
  overflow: hidden;
  color: #78cdb3;
  font-size: 10px !important;
  font-weight: 800;
  line-height: 1.15 !important;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.theme-ashen.screen-ruins-active #screenRuins .ruins-route-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

body.theme-ashen.screen-ruins-active #screenRuins .ruins-route-icon-button,
body.theme-ashen.screen-ruins-active #screenRuins .ruins-active-rules > summary {
  display: grid;
  place-items: center;
  box-sizing: border-box;
  width: 38px;
  min-width: 38px;
  height: 38px;
  min-height: 38px;
  margin: 0;
  padding: 0;
  border: 1px solid rgba(98, 135, 123, .48);
  border-radius: 10px;
  background: rgba(10, 22, 19, .92);
  color: #cbd8d3;
  box-shadow: none;
  font: 900 17px/1 system-ui, sans-serif;
  cursor: pointer;
}

body.theme-ashen.screen-ruins-active #screenRuins .ruins-active-rules {
  position: relative;
}

body.theme-ashen.screen-ruins-active #screenRuins .ruins-active-rules > summary {
  list-style: none;
}

body.theme-ashen.screen-ruins-active #screenRuins .ruins-active-rules > summary::-webkit-details-marker {
  display: none;
}

body.theme-ashen.screen-ruins-active #screenRuins .ruins-active-rules[open] > summary {
  border-color: rgba(106, 205, 171, .7);
  color: #8de0c4;
}

body.theme-ashen.screen-ruins-active #screenRuins .ruins-active-rules > div {
  position: absolute;
  top: calc(100% + 7px);
  right: 0;
  z-index: 80;
  width: min(292px, calc(100vw - 42px));
  padding: 11px 12px;
  border: 1px solid rgba(82, 132, 116, .62);
  border-radius: 11px;
  background: rgba(5, 14, 12, .98);
  box-shadow: 0 14px 34px rgba(0, 0, 0, .55);
}

body.theme-ashen.screen-ruins-active #screenRuins .ruins-active-rules strong {
  color: #dfc77f;
  font-size: 12px;
}

body.theme-ashen.screen-ruins-active #screenRuins .ruins-active-rules p {
  margin: 6px 0 0;
  color: #aab8b3;
  font-size: 11px;
  line-height: 1.42;
}

body.theme-ashen.screen-ruins-active #screenRuins .ruins-route-map {
  width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  margin: 0 !important;
  padding: 8px 6px 14px !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  overscroll-behavior: contain !important;
  touch-action: pan-y !important;
  -webkit-overflow-scrolling: touch !important;
  scroll-behavior: auto !important;
  scroll-padding-block: 74px 86px !important;
}

body.theme-ashen.screen-ruins-active #screenRuins .ruins-labyrinth-map {
  gap: 8px !important;
  min-height: max-content;
}

body.theme-ashen.screen-ruins-active #screenRuins .ruins-labyrinth-head {
  display: none !important;
}

body.theme-ashen.screen-ruins-active #screenRuins .ruins-guardian-caption {
  margin: 0 0 2px;
  font-size: 10px;
}

body.theme-ashen.screen-ruins-active #screenRuins .ruins-medallion-grid {
  grid-auto-rows: var(--ruins-row-gap, 112px) !important;
}

body.theme-ashen.screen-ruins-active #screenRuins .ruins-start-marker {
  margin: 4px 0 0 !important;
  padding: 0 0 4px !important;
}

body.theme-ashen.screen-ruins-active #screenRuins .ruins-start-marker strong {
  font-size: 13px !important;
}

body.theme-ashen.screen-ruins-active #screenRuins .ruins-start-marker small {
  font-size: 9px !important;
}

body.theme-ashen.screen-ruins-active #screenRuins .ruins-node-guide {
  display: grid;
  gap: 9px;
  margin-top: 5px;
  padding: 10px;
  border: 1px solid rgba(70, 111, 97, .5);
  border-radius: 11px;
  background:
    radial-gradient(circle at 50% 0, rgba(40, 92, 75, .13), transparent 54%),
    rgba(4, 11, 9, .83);
}

body.theme-ashen.screen-ruins-active #screenRuins .ruins-node-guide-head {
  display: grid;
  gap: 2px;
  text-align: center;
}

body.theme-ashen.screen-ruins-active #screenRuins .ruins-node-guide-head strong {
  color: #d9bd78;
  font-size: 12px;
  letter-spacing: .09em;
  text-transform: uppercase;
}

body.theme-ashen.screen-ruins-active #screenRuins .ruins-node-guide-head small {
  color: #81938d;
  font-size: 9px;
}

body.theme-ashen.screen-ruins-active #screenRuins .ruins-node-guide-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

body.theme-ashen.screen-ruins-active #screenRuins .ruins-node-guide-item {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  align-items: start;
  gap: 7px;
  min-width: 0;
  padding: 7px;
  border: 1px solid rgba(82, 101, 95, .3);
  border-radius: 8px;
  background: rgba(8, 16, 14, .72);
  color: #aebbb6;
}

body.theme-ashen.screen-ruins-active #screenRuins .ruins-node-guide-item .ruins-medallion-icon {
  width: 25px !important;
  height: 25px !important;
}

body.theme-ashen.screen-ruins-active #screenRuins .ruins-node-guide-item > span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

body.theme-ashen.screen-ruins-active #screenRuins .ruins-node-guide-item strong {
  color: currentColor;
  font-size: 10px;
  line-height: 1.12;
}

body.theme-ashen.screen-ruins-active #screenRuins .ruins-node-guide-item small {
  color: #84958f;
  font-size: 9px;
  line-height: 1.25;
}

body.theme-ashen.screen-ruins-active #screenRuins .ruins-node-guide-item.normal { color: #d8c79f; }
body.theme-ashen.screen-ruins-active #screenRuins .ruins-node-guide-item.elite { color: #76e09a; }
body.theme-ashen.screen-ruins-active #screenRuins .ruins-node-guide-item.rare { color: #75cfff; }
body.theme-ashen.screen-ruins-active #screenRuins .ruins-node-guide-item.recovery { color: #83d992; }
body.theme-ashen.screen-ruins-active #screenRuins .ruins-node-guide-item.altar { color: #bda5ff; }
body.theme-ashen.screen-ruins-active #screenRuins .ruins-node-guide-item.reward { color: #e1bf68; }
body.theme-ashen.screen-ruins-active #screenRuins .ruins-node-guide-item.event { color: #82cfbd; }
body.theme-ashen.screen-ruins-active #screenRuins .ruins-node-guide-item.sacrifice { color: #de8585; }
body.theme-ashen.screen-ruins-active #screenRuins .ruins-node-guide-item.unknown { color: #899791; }

body.theme-ashen.screen-ruins-active #screenRuins .ruins-leave-button {
  position: relative !important;
  z-index: 6 !important;
  width: 100% !important;
  min-height: 44px !important;
  margin: 0 !important;
  padding: 8px 12px !important;
  border-radius: 11px !important;
  font-size: 12px !important;
  box-shadow: 0 -5px 18px rgba(0, 0, 0, .28) !important;
}

@media (max-width: 479px) {
  body.theme-ashen.screen-ruins-active #screenRuins .ruins-screen-panel {
    padding: 6px !important;
  }

  body.theme-ashen.screen-ruins-active #screenRuins .ruins-route-head {
    min-height: 46px !important;
    padding: 6px 7px !important;
  }

  body.theme-ashen.screen-ruins-active #screenRuins .ruins-route-head h3 {
    font-size: 16px !important;
  }

  body.theme-ashen.screen-ruins-active #screenRuins .ruins-route-status {
    font-size: 9px !important;
  }

  body.theme-ashen.screen-ruins-active #screenRuins .ruins-route-icon-button,
  body.theme-ashen.screen-ruins-active #screenRuins .ruins-active-rules > summary {
    width: 35px;
    min-width: 35px;
    height: 35px;
    min-height: 35px;
  }

  body.theme-ashen.screen-ruins-active #screenRuins .ruins-route-map {
    padding-inline: 4px !important;
  }

  body.theme-ashen.screen-ruins-active #screenRuins .ruins-medallion-node {
    min-height: 94px !important;
    gap: 3px !important;
  }

  body.theme-ashen.screen-ruins-active #screenRuins .ruins-medallion-shell,
  body.theme-ashen.screen-ruins-active #screenRuins .ruins-medallion-node.round .ruins-medallion-shell {
    width: 62px !important;
    height: 62px !important;
  }

  body.theme-ashen.screen-ruins-active #screenRuins .ruins-medallion-node.hex .ruins-medallion-shell {
    width: 64px !important;
    height: 61px !important;
  }

  body.theme-ashen.screen-ruins-active #screenRuins .ruins-medallion-icon {
    width: 32px !important;
    height: 32px !important;
  }

  body.theme-ashen.screen-ruins-active #screenRuins .ruins-medallion-node.boss .ruins-medallion-shell {
    width: 78px !important;
    height: 78px !important;
  }

  body.theme-ashen.screen-ruins-active #screenRuins .ruins-medallion-node.boss .ruins-medallion-icon {
    width: 42px !important;
    height: 42px !important;
  }

  body.theme-ashen.screen-ruins-active #screenRuins .ruins-medallion-node.available::after {
    top: 61px !important;
    font-size: 10px !important;
  }

  body.theme-ashen.screen-ruins-active #screenRuins .ruins-node-label {
    max-width: 102px !important;
    min-height: 24px !important;
    padding: 3px 5px !important;
  }

  body.theme-ashen.screen-ruins-active #screenRuins .ruins-node-label strong {
    font-size: 10px !important;
    line-height: 1.12 !important;
  }

  body.theme-ashen.screen-ruins-active #screenRuins .ruins-node-label small {
    display: none !important;
  }

  body.theme-ashen.screen-ruins-active #screenRuins .ruins-node-guide-grid {
    grid-template-columns: 1fr;
  }

  body.theme-ashen.screen-ruins-active #screenRuins .ruins-node-guide-item {
    grid-template-columns: 28px minmax(0, 1fr);
    padding: 7px 8px;
  }

  body.theme-ashen.screen-ruins-active #screenRuins .ruins-node-guide-item strong {
    font-size: 11px;
  }

  body.theme-ashen.screen-ruins-active #screenRuins .ruins-node-guide-item small {
    font-size: 10px;
  }
}

@media (min-width: 680px) {
  body.theme-ashen.screen-ruins-active #screenRuins .ruins-node-guide-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* v0.10.0-rc65 — compact Ruins result and first special-rune choice. */
body.theme-ashen.screen-ruins-active #screenRuins .ruins-result:not([hidden]) {
  display: block !important;
  flex: 1 1 auto !important;
  min-height: 0 !important;
  max-height: none !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

body.theme-ashen.screen-ruins-active #screenRuins .ruins-result-collapse {
  display: block;
  width: 100%;
}

body.theme-ashen.screen-ruins-active #screenRuins .ruins-result-summary {
  min-height: 66px !important;
  padding: 9px 11px !important;
  gap: 9px !important;
}

body.theme-ashen.screen-ruins-active #screenRuins .ruins-result-summary-title {
  flex: 1 1 auto;
  min-width: 0;
}

body.theme-ashen.screen-ruins-active #screenRuins .ruins-result-summary-title > span {
  font-size: 9px !important;
  letter-spacing: .09em !important;
}

body.theme-ashen.screen-ruins-active #screenRuins .ruins-result-summary-title > strong {
  display: -webkit-box !important;
  margin-top: 2px !important;
  overflow: hidden !important;
  font-size: clamp(17px, 4.7vw, 20px) !important;
  line-height: 1.08 !important;
  text-overflow: clip !important;
  white-space: normal !important;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

body.theme-ashen.screen-ruins-active #screenRuins .ruins-result-summary-meta {
  min-width: 54px;
  grid-template-columns: 1fr !important;
  column-gap: 0 !important;
}

body.theme-ashen.screen-ruins-active #screenRuins .ruins-result-summary-meta b,
body.theme-ashen.screen-ruins-active #screenRuins .ruins-result-summary-meta span {
  grid-column: 1 !important;
}

body.theme-ashen.screen-ruins-active #screenRuins .ruins-result-body {
  gap: 8px !important;
  padding: 9px 10px 11px !important;
}

body.theme-ashen.screen-ruins-active #screenRuins .ruins-result-secondary {
  display: grid;
  gap: 7px;
  min-width: 0;
}

body.theme-ashen.screen-ruins-active #screenRuins .ruins-summary-metrics.compact {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 5px !important;
}

body.theme-ashen.screen-ruins-active #screenRuins .ruins-summary-metrics.compact > div {
  min-height: 45px;
  padding: 5px 2px !important;
  border-radius: 7px;
}

body.theme-ashen.screen-ruins-active #screenRuins .ruins-summary-metrics.compact span {
  font-size: 8px !important;
  line-height: 1.05;
}

body.theme-ashen.screen-ruins-active #screenRuins .ruins-summary-metrics.compact strong {
  margin-top: 2px;
  font-size: 13px !important;
  line-height: 1;
}

body.theme-ashen.screen-ruins-active #screenRuins .ruins-summary-unlocks {
  display: flex !important;
  flex-wrap: wrap;
  gap: 5px !important;
}

body.theme-ashen.screen-ruins-active #screenRuins .ruins-summary-unlocks span {
  flex: 1 1 135px;
  min-width: 0;
  padding: 5px 7px !important;
  border: 1px solid rgba(76, 145, 124, .25);
  border-left: 2px solid #62b59e;
  border-radius: 0 6px 6px 0;
  font-size: 10px;
  line-height: 1.2;
}

body.theme-ashen.screen-ruins-active #screenRuins .ruins-result-loot {
  margin-top: 0 !important;
}

body.theme-ashen.screen-ruins-active #screenRuins .ruins-result-loot summary {
  min-height: 36px;
  padding: 8px 9px !important;
  font-size: 11px !important;
}

body.theme-ashen.screen-ruins-active #screenRuins .special-rune-choice {
  display: grid;
  gap: 8px;
  min-width: 0;
  margin: 0 !important;
  padding: 10px !important;
  border: 1px solid rgba(103, 190, 121, .55) !important;
  border-radius: 10px !important;
  background:
    radial-gradient(circle at 100% 0, rgba(92, 194, 116, .12), transparent 48%),
    linear-gradient(180deg, rgba(16, 37, 29, .94), rgba(8, 17, 14, .96)) !important;
  box-shadow: inset 3px 0 0 rgba(99, 202, 126, .6);
}

body.theme-ashen.screen-ruins-active #screenRuins .special-rune-choice-head {
  display: grid;
  gap: 2px;
  min-width: 0;
}

body.theme-ashen.screen-ruins-active #screenRuins .special-rune-choice-head > span,
body.theme-ashen.screen-ruins-active #screenRuins .special-rune-choice.claimed > span {
  color: #76c68b;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: .11em;
  text-transform: uppercase;
}

body.theme-ashen.screen-ruins-active #screenRuins .special-rune-choice-head > strong,
body.theme-ashen.screen-ruins-active #screenRuins .special-rune-choice.claimed > strong {
  color: #d8f0de;
  font-size: 14px;
  line-height: 1.15;
}

body.theme-ashen.screen-ruins-active #screenRuins .special-rune-choice-head > small,
body.theme-ashen.screen-ruins-active #screenRuins .special-rune-choice.claimed > small {
  color: #9fb5aa;
  font-size: 9px;
  line-height: 1.3;
}

body.theme-ashen.screen-ruins-active #screenRuins .special-rune-choice-actions {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 6px !important;
}

body.theme-ashen.screen-ruins-active #screenRuins .special-rune-choice-card {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-width: 0;
  min-height: 54px;
  margin: 0;
  padding: 7px 8px;
  border: 1px solid rgba(90, 180, 112, .48);
  border-radius: 9px;
  background: rgba(4, 13, 10, .82);
  color: #dbe7df;
  box-shadow: none;
  text-align: left;
}

body.theme-ashen.screen-ruins-active #screenRuins .special-rune-choice-card:hover,
body.theme-ashen.screen-ruins-active #screenRuins .special-rune-choice-card:focus-visible {
  border-color: rgba(116, 226, 144, .85);
  background: rgba(10, 31, 23, .95);
  box-shadow: 0 0 0 2px rgba(82, 190, 112, .12);
  transform: none;
}

body.theme-ashen.screen-ruins-active #screenRuins .special-rune-choice-glyph {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(186, 170, 93, .72);
  border-radius: 50%;
  color: #8fe0a2;
  background: rgba(13, 29, 22, .92);
  font-size: 18px;
  line-height: 1;
}

body.theme-ashen.screen-ruins-active #screenRuins .special-rune-choice-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

body.theme-ashen.screen-ruins-active #screenRuins .special-rune-choice-copy strong {
  overflow: hidden;
  color: #d9eadc;
  font-size: 12px;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.theme-ashen.screen-ruins-active #screenRuins .special-rune-choice-copy small {
  overflow: hidden;
  color: #95aaa0;
  font-size: 9px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.theme-ashen.screen-ruins-active #screenRuins .special-rune-choice-card em {
  min-width: 58px;
  color: #7fe09b;
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
  text-align: right;
}

body.theme-ashen.screen-ruins-active #screenRuins .relic-tutorial-next {
  min-height: 42px;
}

@media (max-width: 380px) {
  body.theme-ashen.screen-ruins-active #screenRuins .ruins-result-body {
    padding-inline: 8px !important;
  }

  body.theme-ashen.screen-ruins-active #screenRuins .special-rune-choice {
    padding: 8px !important;
  }

  body.theme-ashen.screen-ruins-active #screenRuins .special-rune-choice-card {
    grid-template-columns: 32px minmax(0, 1fr) auto;
    gap: 6px;
    min-height: 50px;
    padding: 6px 7px;
  }

  body.theme-ashen.screen-ruins-active #screenRuins .special-rune-choice-glyph {
    width: 30px;
    height: 30px;
    font-size: 16px;
  }

  body.theme-ashen.screen-ruins-active #screenRuins .special-rune-choice-card em {
    min-width: 52px;
    font-size: 9px;
  }
}
