/* Nexora Worlds V7 presentation layer. Gameplay/data remain in the existing bundles. */
:root {
  --nx7-nav-h: 58px;
  --nx7-side-w: 74px;
  --nx7-side-expanded: 218px;
  --nx7-bg: #f2f4f5;
  --nx7-panel: #ffffff;
  --nx7-line: #d8dadd;
  --nx7-text: #202227;
  --nx7-muted: #60646c;
  --nx7-blue: #335fff;
}

.nx7-home body { background: var(--nx7-bg) !important; color: var(--nx7-text); }
.nx7-home .site-shell { min-height: 100vh; display: block; background: var(--nx7-bg); }
.nx7-home .sidebar {
  position: fixed !important;
  z-index: 120;
  top: var(--nx7-nav-h);
  bottom: 0;
  left: 0;
  width: var(--nx7-side-expanded) !important;
  padding: 10px 8px !important;
  background: #fff !important;
  border-right: 1px solid var(--nx7-line);
  box-shadow: none !important;
  transition: width .18s ease;
  overflow: hidden;
}
.nx7-home .site-shell.sidebar-collapsed .sidebar { width: var(--nx7-side-w) !important; }
.nx7-home .brand { display: none !important; }
.nx7-home .sidebar-toggle {
  display: flex;
  width: 46px;
  height: 40px;
  margin: 0 0 8px 5px;
  border: 0;
  background: transparent;
  border-radius: 8px;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  cursor: pointer;
}
.nx7-home .sidebar-toggle:hover { background: #edf0f2; }
.nx7-home .main-nav { display: flex !important; flex-direction: column; gap: 3px; }
.nx7-home .main-nav button {
  position: relative;
  display: grid !important;
  grid-template-columns: 42px 1fr auto;
  align-items: center;
  min-height: 44px;
  width: 100%;
  padding: 0 9px 0 5px !important;
  border: 0 !important;
  border-radius: 8px !important;
  background: transparent !important;
  color: #2d3035 !important;
  text-align: left;
  overflow: hidden;
}
.nx7-home .main-nav button:hover { background: #edf0f2 !important; }
.nx7-home .main-nav button.active { background: #e5e7e9 !important; font-weight: 700; }
.nx7-home .main-nav button > span:first-child { width: 38px; font-size: 21px; text-align: center; }
.nx7-home .main-nav button > span:nth-child(2) { white-space: nowrap; font-size: 14px; }
.nx7-home .main-nav button > i { font-size: 9px; }
.nx7-home .site-shell.sidebar-collapsed .main-nav button { grid-template-columns: 42px 0 0; padding-right: 0 !important; }
.nx7-home .site-shell.sidebar-collapsed .main-nav button > span:nth-child(2),
.nx7-home .site-shell.sidebar-collapsed .main-nav button > i,
.nx7-home .site-shell.sidebar-collapsed .sidebar-footer { opacity: 0; pointer-events: none; }
.nx7-home .sidebar-footer { position: absolute !important; left: 16px; right: 12px; bottom: 16px; font-size: 10px !important; color: #7a7e85 !important; transition: opacity .12s; }

.nx7-home .topbar {
  position: fixed !important;
  z-index: 130;
  inset: 0 0 auto 0;
  height: var(--nx7-nav-h);
  padding: 0 16px !important;
  display: grid !important;
  grid-template-columns: minmax(220px, 1fr) minmax(280px, 600px) minmax(320px, 1fr);
  align-items: center;
  gap: 18px;
  background: rgba(255,255,255,.98) !important;
  border-bottom: 1px solid var(--nx7-line) !important;
  box-shadow: 0 1px 2px rgba(0,0,0,.05) !important;
  backdrop-filter: blur(12px);
}
.nx7-home .top-identity { display: flex; align-items: center; gap: 10px; min-width: 0; }
.nx7-home .top-identity .avatar-thumb {
  width: 38px; height: 38px; border-radius: 50%; border: 2px solid #d5d8dc;
  display: grid; place-items: center; background: linear-gradient(145deg,#252935,#6b7280); color: #fff; font-weight: 800;
}
.nx7-home .top-identity b { display: block; font-size: 14px; line-height: 1.1; }
.nx7-home .top-identity small { display: block; margin-top: 2px; font-size: 11px; color: var(--nx7-muted); }
.nx7-home .search-wrap {
  width: 100% !important; height: 38px !important; margin: 0 !important;
  display: flex !important; align-items: center; gap: 8px;
  border: 1px solid #c8cbd0 !important; border-radius: 9px !important; background: #f7f8f8 !important;
  padding: 0 12px !important;
}
.nx7-home .search-wrap:focus-within { background: #fff !important; border-color: #6c7179 !important; box-shadow: 0 0 0 2px rgba(51,95,255,.12); }
.nx7-home .search-wrap input { color: #202227 !important; font-size: 14px !important; }
.nx7-home .top-actions { display: flex !important; justify-content: flex-end; align-items: center; gap: 5px; }
.nx7-home .top-actions button, .nx7-home .currency-pill {
  height: 38px; min-width: 38px; border: 0; border-radius: 8px; background: transparent; color: #30343a;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-weight: 700; cursor: pointer;
}
.nx7-home .top-actions button:hover, .nx7-home .currency-pill:hover { background: #edf0f2; }
.nx7-home .top-actions button span { font-size: 18px; }
.nx7-home .top-actions button small { display: none; }
.nx7-home .currency-pill { padding: 0 10px; background: #edf0f2; }
.nx7-home .currency-pill i { width: 16px; height: 16px; border: 3px solid #3f444b; transform: rotate(45deg); border-radius: 3px; }

.nx7-home .site-main {
  width: auto !important;
  margin: 0 0 0 var(--nx7-side-expanded) !important;
  padding: calc(var(--nx7-nav-h) + 22px) 30px 56px !important;
  max-width: none !important;
  transition: margin-left .18s ease;
}
.nx7-home .site-shell.sidebar-collapsed .site-main { margin-left: var(--nx7-side-w) !important; }
.nx7-home .hero {
  min-height: 280px !important; max-height: 340px; border-radius: 12px !important; overflow: hidden;
  box-shadow: none !important; border: 1px solid #d3d6da;
}
.nx7-home .hero-content { padding: 34px 38px !important; }
.nx7-home .hero-content h1 { font-size: clamp(34px,4vw,56px) !important; }
.nx7-home .hero-content p { max-width: 650px !important; }
.nx7-home .section { margin-top: 28px !important; }
.nx7-home .section-head { margin-bottom: 12px !important; }
.nx7-home .section-head h2 { color: #202227 !important; font-size: 22px !important; }
.nx7-home .section-head p { display: none; }
.nx7-home .featured-grid {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0,1fr)) !important;
  gap: 18px !important;
}
.nx7-home .featured-grid > article,
.nx7-home .featured-grid .nx-pet-world-card,
.nx7-home .featured-grid .world-card {
  display: block !important;
  min-width: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  overflow: visible !important;
}
.nx7-home .featured-grid .world-art,
.nx7-home .featured-grid .nx-pet-art,
.nx7-home .featured-grid .nx-garden-art {
  width: 100% !important;
  aspect-ratio: 16/9 !important;
  height: auto !important;
  min-height: 0 !important;
  border-radius: 9px !important;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0,0,0,.18);
  transition: transform .14s ease, box-shadow .14s ease;
}
.nx7-home .featured-grid article:hover .world-art,
.nx7-home .featured-grid article:hover .nx-pet-art,
.nx7-home .featured-grid article:hover .nx-garden-art { transform: translateY(-2px); box-shadow: 0 5px 16px rgba(0,0,0,.16); }
.nx7-home .featured-grid .world-art img { width: 100%; height: 100%; object-fit: cover; }
.nx7-home .featured-grid .world-info,
.nx7-home .featured-grid .nx-pet-world-card > div { padding: 9px 1px 0 !important; }
.nx7-home .featured-grid h3 { margin: 0 0 5px !important; color: #202227 !important; font-size: 15px !important; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nx7-home .featured-grid p,
.nx7-home .featured-grid .nx-pet-genre,
.nx7-home .featured-grid .world-info > span { display: none !important; }
.nx7-home .featured-grid footer { margin: 0 !important; padding: 0 !important; border: 0 !important; display: flex !important; gap: 10px; justify-content: flex-start !important; font-size: 12px !important; color: #60646c !important; }
.nx7-home .featured-grid footer b { color: #60646c !important; font-size: 12px !important; }
.nx7-home .project-list, .nx7-home .cta-panel { border-radius: 10px !important; }

/* Character rig and shift-lock presentation */
.nx7-shift-reticle { position: fixed; z-index: 220; left: 50%; top: 50%; transform: translate(-50%,-50%); display: none; pointer-events: none; }
.nx7-shift-reticle i, .nx7-shift-reticle i::before, .nx7-shift-reticle i::after { display: block; width: 4px; height: 4px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.75),0 0 8px rgba(0,0,0,.55); }
.nx7-shift-reticle i::before, .nx7-shift-reticle i::after { content: ""; position: absolute; top: 0; }
.nx7-shift-reticle i::before { left: -9px; }
.nx7-shift-reticle i::after { left: 9px; }
.nx7-shift-reticle span { position: absolute; left: 50%; top: 14px; transform: translateX(-50%); white-space: nowrap; padding: 3px 7px; border-radius: 5px; background: rgba(12,14,18,.68); color: #fff; font: 700 9px/1.2 system-ui; letter-spacing: .08em; }
.nx7-shift-lock .nx7-shift-reticle { display: block; }
.nx7-shift-lock canvas { cursor: none !important; }

/* Studio: Explorer + permanent Toolbox */
.nx-studio-overlay.nx7-studio .nx-left-panel { width: 440px !important; min-width: 440px; }
.nx-studio-overlay.nx7-studio .nx-editor-workspace { grid-template-columns: 440px minmax(0,1fr) 290px !important; }
.nx-studio-overlay.nx7-studio .nx-left-panel .nx-panel-tabs [data-left-tab="toolbox"] { display: none !important; }
.nx7-left-body { height: calc(100% - 78px); min-height: 0; display: grid; grid-template-columns: minmax(0,1fr) 205px; border-top: 1px solid #31343a; }
.nx7-left-body > #nx-explorer { height: 100% !important; min-height: 0; overflow: auto; border-right: 1px solid #30343a; }
.nx7-toolbox-pane { min-width: 0; display: flex; flex-direction: column; background: #202227; color: #e8e9eb; overflow: hidden; }
.nx7-toolbox-pane > header { height: 42px; padding: 0 9px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #34373d; }
.nx7-toolbox-pane > header b { display: block; font-size: 12px; }
.nx7-toolbox-pane > header small { display: block; margin-top: 2px; color: #90949b; font-size: 9px; }
.nx7-toolbox-pane > header button { border: 0; background: transparent; color: #b9bdc4; }
.nx7-toolbox-pane > label { margin: 8px; height: 30px; display: flex; align-items: center; gap: 5px; padding: 0 7px; border: 1px solid #42464d; border-radius: 4px; background: #17191d; }
.nx7-toolbox-pane > label input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: #e8e9eb; font-size: 11px; }
.nx7-toolbox-grid { padding: 0 7px 8px; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 6px; overflow: auto; }
.nx7-toolbox-grid button { min-width: 0; min-height: 78px; padding: 7px 4px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; border: 1px solid #383c43; border-radius: 5px; background: #292c31; color: #e7e9ed; cursor: grab; }
.nx7-toolbox-grid button:hover { border-color: #5d87ff; background: #30343a; }
.nx7-toolbox-grid button.dragging { opacity: .45; }
.nx7-toolbox-grid span { font-size: 22px; color: #a9bfff; }
.nx7-toolbox-grid b { max-width: 100%; font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nx7-toolbox-grid small { color: #838891; font-size: 8px; }
.nx7-toolbox-pane > footer { margin-top: auto; padding: 7px; border-top: 1px solid #34373d; color: #8d929a; font-size: 9px; text-align: center; }
#nx-viewport.nx7-drop-target { outline: 3px solid #4f7cff; outline-offset: -4px; filter: brightness(1.08); }
.nx7-script-tree { margin-top: 4px; border-top: 1px solid #33363c; padding-top: 3px; }
.nx7-script-tree button { width: 100%; min-height: 24px; display: grid; grid-template-columns: 15px 22px 1fr auto; align-items: center; padding: 0 7px; border: 0; background: transparent; color: #cfd2d7; text-align: left; font-size: 11px; }
.nx7-script-tree button:hover { background: #353941; }
.nx7-script-tree button > em { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-style: normal; }
.nx7-script-tree .nx7-script-object { padding-left: 19px; cursor: default; }
.nx7-script-tree .nx7-script-object > b { color: #79a2ff; font-size: 10px; }
.nx7-script-tree .nx7-service-row i { color: #7e838c; font-style: normal; }

/* CodeMirror editor */
.nx-studio-overlay .nx-script-editor { padding: 0 !important; display: flex !important; flex-direction: column; min-height: 0; background: #181a1f !important; }
.nx-studio-overlay .nx-script-editor.hidden { display: none !important; }
.nx7-script-tabs { flex: 0 0 31px; display: flex; align-items: stretch; overflow-x: auto; background: #22252a; border-bottom: 1px solid #35383e; }
.nx7-script-tabs button { min-width: 0; max-width: 210px; padding: 0 9px; display: flex; align-items: center; gap: 7px; border: 0; border-right: 1px solid #34373c; background: #272a30; color: #bfc3ca; font-size: 11px; white-space: nowrap; }
.nx7-script-tabs button.active { background: #181a1f; color: #fff; box-shadow: inset 0 2px #4c78ff; }
.nx7-script-tabs button span { color: #74a0ff; }
.nx7-script-tabs button i { margin-left: auto; color: #858a93; font-style: normal; padding: 3px; }
.nx7-code-editor-shell { flex: 1; min-height: 0; position: relative; }
.nx7-code-editor-shell .CodeMirror { height: 100% !important; font: 12px/1.55 "Cascadia Code",Consolas,monospace; background: #181a1f; }
.nx7-code-editor-shell .CodeMirror-gutters { background: #1e2025; border-right-color: #30333a; }
.nx7-code-editor-shell .CodeMirror-linenumber { color: #666c75; }
.nx7-code-fallback { width: 100% !important; height: 100% !important; resize: none; border: 0; outline: 0; padding: 12px 14px; background: #181a1f !important; color: #d7dae0 !important; font: 12px/1.55 "Cascadia Code",Consolas,monospace; }
.nx7-code-editor-shell .CodeMirror + .nx7-code-fallback { display: none; }

@media (max-width: 1180px) {
  .nx7-home .featured-grid { grid-template-columns: repeat(3,minmax(0,1fr)) !important; }
  .nx7-home .topbar { grid-template-columns: 190px minmax(240px,1fr) 280px; }
  .nx-studio-overlay.nx7-studio .nx-left-panel { width: 360px !important; min-width: 360px; }
  .nx-studio-overlay.nx7-studio .nx-editor-workspace { grid-template-columns: 360px minmax(0,1fr) 260px !important; }
  .nx7-left-body { grid-template-columns: minmax(0,1fr) 170px; }
}
@media (max-width: 820px) {
  :root { --nx7-side-w: 58px; }
  .nx7-home .topbar { grid-template-columns: 44px minmax(0,1fr) auto; padding: 0 8px !important; gap: 8px; }
  .nx7-home .top-identity b, .nx7-home .top-identity small { display: none; }
  .nx7-home .top-identity .avatar-thumb { width: 34px; height: 34px; }
  .nx7-home .top-actions button:nth-of-type(-n+2) { display: none; }
  .nx7-home .currency-pill { padding: 0 7px; }
  .nx7-home .sidebar { width: var(--nx7-side-w) !important; }
  .nx7-home .sidebar-toggle { margin-left: 0; }
  .nx7-home .main-nav button { grid-template-columns: 38px 0 0 !important; padding-left: 0 !important; }
  .nx7-home .main-nav button > span:nth-child(2), .nx7-home .main-nav button > i, .nx7-home .sidebar-footer { display: none; }
  .nx7-home .site-main, .nx7-home .site-shell.sidebar-collapsed .site-main { margin-left: var(--nx7-side-w) !important; padding: calc(var(--nx7-nav-h) + 14px) 12px 40px !important; }
  .nx7-home .hero { min-height: 220px !important; }
  .nx7-home .hero-content { padding: 24px !important; }
  .nx7-home .featured-grid { grid-template-columns: repeat(2,minmax(0,1fr)) !important; gap: 12px !important; }
  .nx7-home .project-list { overflow-x: auto; }
  .nx-studio-overlay.nx7-studio .nx-left-panel { width: 285px !important; min-width: 285px; }
  .nx-studio-overlay.nx7-studio .nx-editor-workspace { grid-template-columns: 285px minmax(0,1fr) !important; }
  .nx-studio-overlay.nx7-studio .nx-right-panel { display: none !important; }
  .nx7-left-body { grid-template-columns: 1fr; grid-template-rows: 1fr 210px; }
  .nx7-left-body > #nx-explorer { border-right: 0; border-bottom: 1px solid #30343a; }
  .nx7-toolbox-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
}

/* Final V7 readability and editor workspace tuning. */
.nx7-home .hero-content .eyebrow { color: #8fc7ff !important; }
.nx7-home .hero-content h1 { color: #ffffff !important; text-shadow: 0 2px 18px rgba(0,0,0,.42); }
.nx7-home .hero-content p { color: #d6dce7 !important; text-shadow: 0 1px 8px rgba(0,0,0,.4); }
.nx-studio-overlay.nx7-studio .nx-bottom-panel.nx7-script-open { height: clamp(220px, 32vh, 340px) !important; }
