body:has(.r3d-page) {
  overflow: hidden;
}

body:has(.r3d-page) .global-footer,
body:has(.r3d-page) .side-float-dock {
  display: none;
}

body:has(.r3d-page) .page-shell {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.r3d-page {
  --r3d-ink: #f0e1cf;
  --r3d-muted: rgba(240, 225, 207, 0.65);
  --r3d-line: rgba(240, 225, 207, 0.14);
  box-sizing: border-box;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
  height: calc(100vh - 50px);
  margin: 50px 0 0;
  background: #0b1218;
  color: var(--r3d-ink);
  overflow: hidden;
}

.r3d-page:fullscreen,
.r3d-page:-webkit-full-screen {
  width: 100vw;
  height: 100vh;
  margin: 0;
}

.r3d-page:fullscreen .r3d-rail,
.r3d-page:-webkit-full-screen .r3d-rail {
  display: none;
}

.r3d-rail {
  box-sizing: border-box;
  width: 260px;
  flex: 0 0 260px;
  height: 100%;
  padding: 14px 12px 18px;
  background: rgba(10, 14, 20, 0.92);
  border-right: 1px solid var(--r3d-line);
  overflow: auto;
}

.r3d-rail-title {
  margin: 0 0 12px;
  padding: 0 4px 8px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: #fff4d4;
  border-bottom: 1px solid var(--r3d-line);
}

.r3d-rail-group {
  margin-bottom: 18px;
}

.r3d-rail-label,
.r3d-filter-title {
  font-size: 12px;
  letter-spacing: 0.08em;
  color: rgba(255, 244, 212, 0.55);
  margin-bottom: 8px;
}

.r3d-realm-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 4px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

html.dmj-theme-midnight body .r3d-page .r3d-rail .r3d-filter-group .r3d-filter-toggle,
html body .r3d-page .r3d-rail .r3d-filter-group .r3d-filter-toggle {
  width: 22px !important;
  height: 22px !important;
  min-width: 22px;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 4px !important;
  background: transparent !important;
  color: var(--r3d-muted) !important;
  box-shadow: none !important;
  opacity: 1 !important;
  line-height: 22px !important;
  font-size: 16px !important;
}

.r3d-filter-toggle::before {
  content: "›";
  display: block;
  transform: rotate(90deg);
  line-height: 22px;
}

.r3d-filter-group.is-collapsed .r3d-filter-toggle::before {
  transform: none;
}

html body .r3d-page .r3d-rail .r3d-realm-list button.r3d-realm-btn[data-id] {
  appearance: none;
  width: 100%;
  height: auto !important;
  display: flex;
  align-items: center;
  gap: 8px;
  text-align: left;
  padding: 8px 10px !important;
  border-radius: 8px !important;
  border: 1px solid transparent !important;
  background: transparent !important;
  color: rgba(232, 238, 244, 0.72) !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  line-height: 1.3 !important;
  box-shadow: none !important;
  opacity: 1 !important;
}

html body .r3d-page .r3d-rail .r3d-realm-list button.r3d-realm-btn[data-id]::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.28);
  flex: 0 0 8px;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.04);
}

html body .r3d-page .r3d-rail .r3d-realm-list button.r3d-realm-btn[data-id][data-id="all"]::before { background: #8eb7e8; }
html body .r3d-page .r3d-rail .r3d-realm-list button.r3d-realm-btn[data-id][data-id="eastlands"]::before { background: #7dbe86; }
html body .r3d-page .r3d-rail .r3d-realm-list button.r3d-realm-btn[data-id][data-id="westlands"]::before { background: #d7b56a; }

html body .r3d-page .r3d-rail .r3d-realm-list button.r3d-realm-btn[data-id]:hover {
  background: rgba(255, 255, 255, 0.06) !important;
  color: #fff !important;
}

html body .r3d-page .r3d-rail .r3d-realm-list button.r3d-realm-btn[data-id].is-active {
  background: rgba(126, 182, 255, 0.16) !important;
  border-color: rgba(168, 206, 255, 0.55) !important;
  color: #fff !important;
}

html body .r3d-page .r3d-rail .r3d-realm-list button.r3d-realm-btn[data-id].is-active::before {
  box-shadow: 0 0 0 3px rgba(168, 206, 255, 0.2);
}

.r3d-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  margin: 6px 0;
  color: var(--r3d-muted);
  cursor: pointer;
}

.r3d-main {
  position: relative;
  box-sizing: border-box;
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.r3d-toolbar {
  position: absolute;
  z-index: 8;
  left: 12px;
  right: 12px;
  top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(8, 10, 14, 0.42);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  backdrop-filter: blur(14px) saturate(1.2);
  border: 1px solid rgba(240, 225, 207, 0.16);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.r3d-title {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.r3d-title::before {
  content: "";
  width: 3px;
  height: 1.15em;
  border-radius: 2px;
  background: linear-gradient(180deg, #ffe28a 0%, #c9a24a 100%);
  box-shadow: 0 0 10px rgba(224, 184, 106, 0.35);
  flex-shrink: 0;
}

.r3d-title strong {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.12em;
  line-height: 1.1;
  color: #fff4d4;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.45), 0 0 18px rgba(224, 184, 106, 0.18);
}

.r3d-switch-label {
  margin-left: 6px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: rgba(255, 244, 212, 0.72);
  white-space: nowrap;
}

.r3d-altlink {
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(224, 184, 106, 0.85);
  background: linear-gradient(180deg, rgba(224, 184, 106, 0.28), rgba(120, 84, 28, 0.22));
  box-shadow: 0 0 0 1px rgba(224, 184, 106, 0.18), 0 0 16px rgba(224, 184, 106, 0.22);
  color: #ffe7a8 !important;
  text-decoration: none !important;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.35);
}

.r3d-altlink:hover {
  color: #fff8dc !important;
  border-color: #ffe28a;
  background: linear-gradient(180deg, rgba(255, 226, 138, 0.42), rgba(160, 112, 36, 0.28));
}

.r3d-zoom-tools {
  margin-left: auto;
  display: flex;
  gap: 6px;
}

html.dmj-theme-midnight body .r3d-page .r3d-main .r3d-toolbar .r3d-zoom-tools button,
html body .r3d-page .r3d-main .r3d-toolbar .r3d-zoom-tools button {
  height: 32px !important;
  min-width: 32px;
  padding: 0 10px !important;
  border-radius: 6px !important;
  border: 1px solid rgba(240, 225, 207, 0.18) !important;
  background: rgba(16, 20, 32, 0.72) !important;
  color: #e8f4ff !important;
  box-shadow: none !important;
  opacity: 1 !important;
  cursor: pointer;
  font-size: 14px !important;
  font-weight: 500 !important;
  line-height: 30px !important;
}

html.dmj-theme-midnight body .r3d-page .r3d-main .r3d-toolbar .r3d-zoom-tools button:hover,
html body .r3d-page .r3d-main .r3d-toolbar .r3d-zoom-tools button:hover {
  border-color: rgba(126, 200, 255, 0.55) !important;
  background: rgba(30, 48, 78, 0.9) !important;
  color: #fff !important;
}

.r3d-viewport {
  position: absolute;
  inset: 0;
  outline: none;
}

.r3d-viewport canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

.r3d-filter-group {
  margin-bottom: 12px;
}

.r3d-filter-title {
  margin-bottom: 4px;
}

.r3d-filter-group .r3d-check {
  font-size: 13px;
  margin: 3px 0;
}

.r3d-filter-group [data-count] {
  color: rgba(232, 238, 244, 0.4);
  margin-left: 4px;
}

.r3d-filter-bar {
  display: flex;
  align-items: center;
  gap: 4px;
}

.r3d-filter-bar .r3d-check {
  flex: 1 1 auto;
}

.r3d-filter-subs {
  padding-left: 18px;
}

.r3d-filter-group.is-collapsed .r3d-filter-subs {
  display: none;
}

.r3d-filter-subs .r3d-check {
  font-size: 12px;
  color: rgba(232, 238, 244, 0.78);
}

.r3d-pins {
  position: absolute;
  inset: 0;
  z-index: 2;
  overflow: hidden;
  pointer-events: none;
}

.r3d-pin,
.r3d-label {
  position: absolute;
  left: 0;
  top: 0;
  pointer-events: auto;
}

.r3d-pin {
  transform: translate(-50%, -100%);
  text-decoration: none;
}

.r3d-pin img {
  width: 18px;
  height: 18px;
  display: block;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.85));
}

.r3d-pin:hover img {
  transform: scale(1.3);
}

.r3d-label {
  transform: translate(-50%, -50%);
  pointer-events: none;
  color: #f4ead8;
  font-weight: 700;
  white-space: nowrap;
  text-shadow: 0 1px 2px #000, 0 0 6px rgba(0, 0, 0, 0.9);
}

.r3d-label.is-zone { font-size: 15px; }
.r3d-label.is-big { font-size: 13px; }
.r3d-label.is-mid { font-size: 12px; font-weight: 600; }
.r3d-label.is-small { font-size: 11px; font-weight: 600; color: rgba(244, 234, 216, 0.88); }

.r3d-status {
  position: absolute;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(6, 10, 14, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 13px;
  pointer-events: none;
  z-index: 3;
}

.r3d-status.is-done {
  opacity: 0;
  transition: opacity 0.6s ease;
}

.r3d-hud {
  position: absolute;
  left: 16px;
  bottom: 16px;
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: rgba(232, 238, 244, 0.7);
  z-index: 3;
  pointer-events: none;
}

@media (max-width: 860px) {
  .r3d-page {
    flex-direction: column;
    height: auto;
    min-height: calc(100vh - 50px);
    overflow: auto;
  }
  .r3d-rail {
    width: 100%;
    flex: none;
    height: auto;
    max-height: 42vh;
    border-right: 0;
    border-bottom: 1px solid var(--r3d-line);
  }
  .r3d-main {
    height: 68vh;
    min-height: 420px;
  }
}
