/* EC Regional World Map & 4 Sandboxed Mini-Games + Clean Modal Framing */
.rm-section {
  margin: 18px 0 26px;
  border-radius: 18px;
  border: 1px solid rgba(212, 175, 55, 0.42);
  background: linear-gradient(165deg, #0b191d, #091316);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}
.rm-hub-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(16, 185, 129, 0.25);
  background: rgba(15, 23, 42, 0.88);
}
.rm-hub-title {
  font-weight: 900;
  font-size: 15px;
  letter-spacing: 0.06em;
  color: #f5c542;
  text-transform: uppercase;
}
.rm-hub-sub {
  font-size: 12px;
  color: #b7d4c8;
}
.rm-hub-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.rm-pill {
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 800;
  background: rgba(16, 185, 129, 0.14);
  border: 1px solid rgba(16, 185, 129, 0.45);
  color: #6ee7b7;
}
.rm-pill.gold {
  background: rgba(212, 175, 55, 0.14);
  border-color: rgba(212, 175, 55, 0.5);
  color: #fde68a;
}

.rm-viewport {
  position: relative;
  width: 100%;
  aspect-ratio: 1024 / 571;
  background: #071216;
  overflow: hidden;
}
.rm-map-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.rm-corridor-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 3;
  pointer-events: none;
}
.rm-corridor-line {
  stroke: rgba(16, 185, 129, 0.55);
  stroke-width: 0.45;
  stroke-dasharray: 1.4 1.1;
  fill: none;
}
.rm-corridor-line.active {
  stroke: #f5c542;
  stroke-width: 0.75;
  stroke-dasharray: 2.2 1.1;
  animation: rmDashFlow 1.8s linear infinite;
}
@keyframes rmDashFlow {
  to { stroke-dashoffset: -6.6; }
}
.rm-lanes-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 18px;
  background: rgba(11, 25, 29, 0.94);
  border-top: 1px solid rgba(16, 185, 129, 0.22);
  border-bottom: 1px solid rgba(16, 185, 129, 0.22);
}
.rm-lane-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(16, 185, 129, 0.35);
  background: rgba(15, 23, 42, 0.8);
  color: #d1fae5;
  font-size: 11px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}
.rm-lane-link:hover {
  border-color: #f5c542;
  color: #fde68a;
}
.rm-daily-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 18px;
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.12), rgba(212, 175, 55, 0.1));
  border-bottom: 1px solid rgba(212, 175, 55, 0.28);
  font-size: 12px;
  color: #e2f1ec;
}
.rm-daily-bar strong {
  color: #fde68a;
}
.rm-firewall-note {
  padding: 9px 18px;
  background: rgba(7, 15, 19, 0.96);
  border-top: 1px solid rgba(212, 175, 55, 0.28);
  font-size: 11px;
  color: #a9c5bc;
  line-height: 1.45;
}
.rm-firewall-note strong {
  color: #f5c542;
}
.rm-fascia-pill {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 4;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.86);
  border: 1px solid rgba(212, 175, 55, 0.5);
  color: #f8fafc;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.rm-player-marker {
  position: absolute;
  z-index: 5;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: #f5c542;
  border: 2px solid #04130f;
  box-shadow: 0 0 0 5px rgba(245, 197, 66, 0.35), 0 0 18px rgba(16, 185, 129, 0.8);
  transform: translate(-50%, -50%);
  transition: left 0.55s cubic-bezier(0.22, 1, 0.36, 1), top 0.55s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
  display: grid;
  place-items: center;
  font-size: 12px;
  color: #05160e;
  font-weight: 900;
}
.rm-hotspot {
  position: absolute;
  z-index: 6;
  transform: translate(-50%, -50%);
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.rm-hotspot-ring {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 2px solid #10b981;
  background: rgba(15, 23, 42, 0.72);
  box-shadow: 0 0 0 6px rgba(16, 185, 129, 0.22);
  display: grid;
  place-items: center;
  transition: transform 0.16s ease, border-color 0.16s ease;
}
.rm-hotspot:hover .rm-hotspot-ring,
.rm-hotspot.active .rm-hotspot-ring {
  transform: scale(1.12);
  border-color: #f5c542;
  box-shadow: 0 0 0 8px rgba(245, 197, 66, 0.28);
}
.rm-hotspot.done .rm-hotspot-ring {
  border-color: #f5c542;
  background: rgba(16, 185, 129, 0.3);
}
.rm-hotspot-label {
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(212, 175, 55, 0.45);
  color: #f8fafc;
  font-size: 10.5px;
  font-weight: 800;
  white-space: nowrap;
}

.rm-node-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 16px 18px;
  background: #0a1418;
}
.rm-node-card {
  border-radius: 12px;
  border: 1px solid rgba(16, 185, 129, 0.25);
  background: rgba(15, 23, 42, 0.75);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.rm-node-card.active {
  border-color: #f5c542;
  box-shadow: 0 0 0 1px rgba(245, 197, 66, 0.35);
}
.rm-node-card h3 {
  margin: 0;
  font-size: 14px;
  color: #f8fafc;
}
.rm-node-card p {
  margin: 0;
  font-size: 12px;
  color: #9fb8b0;
}
.rm-crest-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: #fde68a;
}

/* Clean Play Modal Framing: NO 2px white debug border, NO double vertical scrollbars */
dialog.dialog {
  border: 0 !important;
  outline: none !important;
  padding: 0 !important;
  background: transparent !important;
  overflow: hidden !important;
  max-width: min(860px, 94vw) !important;
  width: 100% !important;
  max-height: 90vh !important;
}
dialog.dialog::backdrop {
  background: rgba(4, 10, 14, 0.8);
  backdrop-filter: blur(6px);
}
dialog.dialog .modal {
  border: 1px solid rgba(212, 175, 55, 0.45) !important;
  border-radius: 16px !important;
  background: #0d1a1f !important;
  overflow: hidden !important;
  display: flex;
  flex-direction: column;
  max-height: 88vh;
}
dialog.dialog .modalhead {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 10px !important;
  padding: 14px 18px !important;
  border-bottom: 1px solid rgba(16, 185, 129, 0.25);
  flex-shrink: 0;
}
.rm-modal-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex-shrink: 0;
}
dialog.dialog #dialogBody {
  overflow-y: auto;
  padding: 16px 18px;
  max-height: calc(88vh - 122px);
}

/* Modal Visual Stage (16:9 / 21:9) + STEVIE AI Toggle + Krafty Preview */
.rm-stage-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 21 / 9;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(212, 175, 55, 0.4);
  background: #061013;
  margin-bottom: 14px;
}
.rm-stage-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.rm-stage-bar {
  position: absolute;
  bottom: 10px;
  left: 10px;
  right: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.rm-game-box {
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 12px;
  padding: 14px;
  display: grid;
  gap: 12px;
}
.rm-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.rm-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.rm-krafty-drawer {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px dashed rgba(212, 175, 55, 0.45);
  background: rgba(212, 175, 55, 0.08);
  font-size: 12px;
  color: #fde68a;
}

@media (max-width: 920px) {
  .rm-node-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .rm-node-strip, .rm-grid-3 { grid-template-columns: 1fr; }
  .rm-hotspot-label { display: none; }
}
