/* ══════════════════════════════════════════════════════════════
   NVStage ULTIMATE (NVStageULT)
   Self-contained styles. Does NOT alter any existing NEURAVID feature.
   ══════════════════════════════════════════════════════════════ */

/* ── Floating Action Button (gold, pulsating, star + "12" badge) ── */
.nvst-fab {
  position: fixed; right: 22px; bottom: 22px; z-index: 950;
  width: 62px; height: 62px; border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, #fff3b0, #f5c518 55%, #b8860b);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; border: none;
  box-shadow: 0 6px 22px rgba(245,197,24,.45);
  animation: nvst-pulse 2.2s infinite;
  transition: transform .2s;
}
.nvst-fab:hover { transform: scale(1.07); }
.nvst-fab-star { font-size: 1.65rem; line-height: 1; filter: drop-shadow(0 1px 1px rgba(0,0,0,.35)); }
.nvst-fab-badge {
  position: absolute; top: -3px; right: -3px;
  min-width: 22px; height: 22px; padding: 0 5px;
  background: #ef4444; color: #fff; font-size: .72rem; font-weight: 800;
  border-radius: 11px; display: flex; align-items: center; justify-content: center;
  border: 2px solid #0a0e27;
}
@keyframes nvst-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(245,197,24,.6); }
  70%  { box-shadow: 0 0 0 18px rgba(245,197,24,0); }
  100% { box-shadow: 0 0 0 0 rgba(245,197,24,0); }
}

/* ── Main overlay panel (#nvstUltPanel) ── */
.nvst-panel {
  position: fixed; inset: 0; z-index: 960;
  background: linear-gradient(160deg, #0a0e27 0%, #161a3a 55%, #0a0e27 100%);
  color: #f1f5f9; overflow-y: auto; display: none;
}
.nvst-panel.open { display: block; }
.nvst-panel::-webkit-scrollbar { width: 10px; }
.nvst-panel::-webkit-scrollbar-track { background: rgba(255,255,255,.04); }
.nvst-panel::-webkit-scrollbar-thumb { background: linear-gradient(var(--neon-purple,#8b5cf6), var(--neon-cyan,#0ea5e9)); border-radius: 5px; }
.nvst-panel { scrollbar-color: #8b5cf6 #0a0e27; scrollbar-width: thin; }

.nvst-panel-header {
  position: sticky; top: 0; z-index: 6;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.1rem 1.6rem;
  background: rgba(10,14,39,.92); backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(139,92,246,.35);
}
.nvst-panel-header h2 { font-size: 1.5rem; font-weight: 800; letter-spacing: .5px; }
.nvst-panel-header .nvst-sub { font-size: .8rem; color: #94a3b8; margin-top: .15rem; }
.nvst-panel-body { padding: 1.6rem; max-width: 1180px; margin: 0 auto; }
.nvst-close {
  width: 40px; height: 40px; border-radius: 10px; font-size: 1.1rem;
  background: rgba(255,255,255,.06); color: #f1f5f9; border: 1px solid rgba(255,255,255,.12);
  display: flex; align-items: center; justify-content: center; cursor: pointer; transition: .2s;
}
.nvst-close:hover { background: #ef4444; border-color: #ef4444; }

/* ── Feature tile grid ── */
.nvst-tile-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
@media (max-width:1024px){ .nvst-tile-grid { grid-template-columns: repeat(3,1fr); } }
@media (max-width:768px){ .nvst-tile-grid { grid-template-columns: repeat(2,1fr); } }
@media (max-width:480px){ .nvst-tile-grid { grid-template-columns: 1fr; } }
.nvst-tile {
  background: rgba(255,255,255,.04); border: 1px solid rgba(139,92,246,.28);
  border-radius: 16px; padding: 1.1rem; cursor: pointer; transition: .22s;
  display: flex; flex-direction: column; gap: .5rem; position: relative; overflow: hidden;
}
.nvst-tile::before {
  content: ""; position: absolute; inset: 0; opacity: 0; transition: .25s;
  background: linear-gradient(135deg, rgba(15,240,252,.12), rgba(192,132,252,.12));
}
.nvst-tile:hover { transform: translateY(-4px); border-color: var(--neon-cyan,#0ea5e9); box-shadow: 0 10px 30px rgba(0,0,0,.4); }
.nvst-tile:hover::before { opacity: 1; }
.nvst-tile-icon {
  width: 46px; height: 46px; border-radius: 12px; font-size: 1.2rem;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, rgba(15,240,252,.18), rgba(192,132,252,.22));
  color: #0ea5e9;
}
.nvst-tile-title { font-weight: 700; font-size: .98rem; }
.nvst-tile-desc { font-size: .76rem; color: #94a3b8; line-height: 1.35; }
.nvst-tag {
  position: absolute; top: .7rem; right: .7rem; font-size: .6rem; font-weight: 700;
  padding: .12rem .45rem; border-radius: 999px; letter-spacing: .5px;
}
.nvst-tag.new { background: #22c55e; color: #06281a; }
.nvst-tag.imp { background: rgba(245,197,24,.2); color: #f5c518; border: 1px solid rgba(245,197,24,.5); }

/* ── Secondary modal (#nvstUltSub) ── */
.nvst-sub {
  position: fixed; inset: 0; z-index: 970; display: none;
  align-items: center; justify-content: center; padding: 1.5rem;
  background: rgba(5,7,20,.7); backdrop-filter: blur(6px);
}
.nvst-sub.open { display: flex; }
.nvst-sub-inner {
  width: min(820px, 100%); max-height: 86vh; display: flex; flex-direction: column;
  background: linear-gradient(160deg, #11163a, #0b0f2e);
  border: 1px solid rgba(139,92,246,.4); border-radius: 18px; overflow: hidden;
  box-shadow: 0 24px 70px rgba(0,0,0,.6);
}
.nvst-sub-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.3rem; border-bottom: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.03);
}
.nvst-sub-header h3 { font-size: 1.15rem; font-weight: 800; }
.nvst-sub-body { padding: 1.3rem; overflow-y: auto; }
.nvst-sub-body::-webkit-scrollbar { width: 8px; }
.nvst-sub-body::-webkit-scrollbar-thumb { background: #8b5cf6; border-radius: 4px; }

/* ── Generic helpers ── */
.nvst-row { display: flex; gap: .75rem; flex-wrap: wrap; }
.nvst-mt { margin-top: 1rem; }
.nvst-mb { margin-bottom: 1rem; }
.nvst-section-title { font-size: .8rem; text-transform: uppercase; letter-spacing: 1px; color: #94a3b8; margin: 1.2rem 0 .6rem; }
.nvst-divider { height: 1px; background: rgba(255,255,255,.08); margin: 1rem 0; }
.nvst-muted { color: #94a3b8; font-size: .82rem; }
.nvst-tnum { font-family: 'Exo 2', sans-serif; }

.nvst-input {
  width: 100%; padding: .7rem .9rem; border-radius: 10px; font-size: .85rem;
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.14); color: #f1f5f9;
}
.nvst-input:focus { outline: none; border-color: #0ea5e9; box-shadow: 0 0 0 3px rgba(15,240,252,.15); }
.nvst-textarea {
  width: 100%; min-height: 90px; padding: .7rem .9rem; border-radius: 10px; font-size: .85rem;
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.14); color: #f1f5f9; resize: vertical;
}
.nvst-textarea:focus { outline: none; border-color: #0ea5e9; }

.nvst-btn {
  display: inline-flex; align-items: center; gap: .45rem; padding: .55rem 1.1rem;
  border-radius: 10px; font-weight: 600; font-size: .82rem; cursor: pointer; border: 1px solid transparent; transition: .18s;
}
.nvst-btn-gold { background: linear-gradient(135deg, #f5c518, #b8860b); color: #1a1400; }
.nvst-btn-gold:hover { box-shadow: 0 0 18px rgba(245,197,24,.5); }
.nvst-btn-cyan { background: linear-gradient(135deg, #0ff0fc, #0ea5e9); color: #04222a; }
.nvst-btn-cyan:hover { box-shadow: 0 0 18px rgba(15,240,252,.45); }
.nvst-btn-outline { background: transparent; border-color: rgba(255,255,255,.2); color: #f1f5f9; }
.nvst-btn-outline:hover { border-color: #0ea5e9; color: #0ea5e9; }
.nvst-btn-purple { background: linear-gradient(135deg, #c084fc, #8b5cf6); color: #1a0a2e; }
.nvst-btn-purple:hover { box-shadow: 0 0 18px rgba(192,132,252,.45); }
.nvst-btn-block { width: 100%; justify-content: center; }

/* ── Lists / cards ── */
.nvst-list { display: flex; flex-direction: column; gap: .6rem; }
.nvst-item {
  display: flex; align-items: center; gap: .8rem; padding: .8rem .9rem;
  background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08); border-radius: 12px;
}
.nvst-item .nvst-thumb {
  width: 44px; height: 44px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 1.1rem;
  background: linear-gradient(135deg, rgba(15,240,252,.2), rgba(192,132,252,.25)); color: #0ea5e9;
}
.nvst-item .nvst-grow { flex: 1; min-width: 0; }
.nvst-item .nvst-name { font-weight: 600; font-size: .9rem; }
.nvst-item .nvst-meta { font-size: .75rem; color: #94a3b8; }
.nvst-hvs {
  font-size: .75rem; font-weight: 800; padding: .2rem .55rem; border-radius: 999px;
  background: rgba(34,197,94,.16); color: #4ade80; border: 1px solid rgba(34,197,94,.4);
}

/* ── 4x4 grids (stage / moods / presets) ── */
.nvst-4x4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: .6rem; }
@media (max-width:600px){ .nvst-4x4 { grid-template-columns: repeat(2,1fr); } }
.nvst-cell {
  aspect-ratio: 1 / 1; border-radius: 12px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: .25rem; text-align: center;
  background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.1); font-size: .8rem;
  transition: .18s; position: relative;
}
.nvst-cell.filled { background: linear-gradient(135deg, rgba(15,240,252,.18), rgba(192,132,252,.2)); border-color: rgba(15,240,252,.5); }
.nvst-cell.host { background: linear-gradient(135deg, #f5c518, #b8860b); color: #1a1400; border-color: #f5c518; font-weight: 700; }
.nvst-cell .nvst-live-dot { width: 8px; height: 8px; border-radius: 50%; background: #ef4444; box-shadow: 0 0 8px #ef4444; }
.nvst-cell .nvst-cell-name { font-weight: 700; }
.nvst-cell .nvst-cell-sub { font-size: .65rem; opacity: .8; }

.nvst-mood { cursor: pointer; }
.nvst-mood:hover { transform: scale(1.05); border-color: #0ea5e9; box-shadow: 0 0 16px rgba(15,240,252,.3); }
.nvst-preset { cursor: pointer; font-size: .78rem; }
.nvst-preset:hover { border-color: #c084fc; background: rgba(192,132,252,.18); }
.nvst-preset.sel { border-color: #c084fc; background: rgba(192,132,252,.28); color: #fff; }

/* ── Stats grid ── */
.nvst-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: .8rem; }
@media (max-width:700px){ .nvst-stats { grid-template-columns: repeat(2,1fr); } }
.nvst-stat {
  background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08);
  border-radius: 14px; padding: 1rem;
}
.nvst-stat .nvst-stat-val { font-size: 1.5rem; font-weight: 700; font-family: 'Exo 2', sans-serif; }
.nvst-stat .nvst-stat-lbl { font-size: .74rem; color: #94a3b8; margin-top: .2rem; }
.nvst-stat .nvst-stat-ic { font-size: 1rem; color: #0ea5e9; margin-bottom: .4rem; }

/* ── Coach chat ── */
.nvst-chat { display: flex; flex-direction: column; gap: .6rem; max-height: 320px; overflow-y: auto; padding-right: .3rem; }
.nvst-msg { max-width: 82%; padding: .6rem .85rem; border-radius: 14px; font-size: .85rem; line-height: 1.4; }
.nvst-msg.user { align-self: flex-end; background: linear-gradient(135deg, #0ff0fc, #0ea5e9); color: #04222a; border-bottom-right-radius: 4px; }
.nvst-msg.coach { align-self: flex-start; background: rgba(192,132,252,.16); border: 1px solid rgba(192,132,252,.3); color: #f1f5f9; border-bottom-left-radius: 4px; }
.nvst-msg .nvst-who { font-size: .65rem; opacity: .7; margin-bottom: .2rem; display: block; }
.nvst-chat-input-row { display: flex; gap: .5rem; margin-top: .8rem; }
.nvst-qactions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .8rem; }

/* ── World map (stylized) ── */
.nvst-map {
  position: relative; width: 100%; aspect-ratio: 2 / 1; border-radius: 16px; overflow: hidden;
  background:
    radial-gradient(circle at 20% 30%, rgba(15,240,252,.18), transparent 40%),
    radial-gradient(circle at 70% 60%, rgba(192,132,252,.18), transparent 45%),
    linear-gradient(135deg, #0a1530, #111a3e);
  border: 1px solid rgba(139,92,246,.3);
}
.nvst-map .nvst-dot {
  position: absolute; width: 12px; height: 12px; border-radius: 50%;
  background: #0ff0fc; box-shadow: 0 0 12px #0ff0fc; animation: nvst-blink 1.6s infinite;
}
@keyframes nvst-blink { 0%,100%{opacity:.35;transform:scale(.8)} 50%{opacity:1;transform:scale(1.2)} }

/* ── Royalties / earnings line items ── */
.nvst-line { display: flex; align-items: center; justify-content: space-between; padding: .65rem 0; border-bottom: 1px dashed rgba(255,255,255,.08); }
.nvst-line:last-child { border-bottom: none; }
.nvst-total-box {
  margin-top: 1rem; padding: 1.1rem; border-radius: 14px; text-align: center;
  background: linear-gradient(135deg, rgba(245,197,24,.16), rgba(184,134,11,.12));
  border: 1px solid rgba(245,197,24,.4);
}
.nvst-total-box .nvst-total-val { font-size: 2rem; font-weight: 800; font-family: 'Exo 2', sans-serif; color: #f5c518; }
.nvst-total-box .nvst-total-lbl { font-size: .78rem; color: #d4b14a; }

/* ── Chain (cover royalties) ── */
.nvst-chain { display: flex; flex-direction: column; gap: .5rem; }
.nvst-chain-node {
  display: flex; align-items: center; gap: .8rem; padding: .75rem .9rem; border-radius: 12px;
  background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08); margin-left: calc(var(--lvl,0) * 26px);
  border-left: 3px solid #c084fc;
}
.nvst-chain-node .nvst-lvl { font-size: .65rem; color: #94a3b8; }
.nvst-chain-arrow { color: #94a3b8; font-size: .8rem; padding-left: calc(var(--lvl,0) * 26px); }

/* ── Translation cards (NVDub) ── */
.nvst-lang-card { padding: .85rem; border-radius: 12px; background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08); }
.nvst-lang-card .nvst-lang { font-size: .72rem; text-transform: uppercase; letter-spacing: 1px; color: #0ea5e9; font-weight: 700; }
.nvst-lang-card .nvst-lang-text { font-size: .9rem; margin-top: .35rem; direction: ltr; }

/* ── Toast (bottom-center) ── */
.nvst-toast-wrap { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 999; display: flex; flex-direction: column; gap: .5rem; align-items: center; pointer-events: none; }
.nvst-toast {
  background: rgba(17,22,58,.96); border: 1px solid rgba(15,240,252,.4); color: #f1f5f9;
  padding: .7rem 1.2rem; border-radius: 12px; font-size: .85rem; box-shadow: 0 8px 30px rgba(0,0,0,.5);
  animation: nvst-toastIn .3s ease; max-width: 90vw;
}
.nvst-toast.gold { border-color: rgba(245,197,24,.6); }
@keyframes nvst-toastIn { from { transform: translateY(16px); opacity: 0; } to { transform: none; opacity: 1; } }
