/* =========================================================================
   Nyxiss CSS — sjednocený styl (chat-first)
   Pozn.: načti v <head> po <script src="https://cdn.tailwindcss.com">
   ======================================================================= */

/* ==== Design tokens ==================================================== */
:root{
  /* Avatar */
  --nx-avatar: 11rem;        /* default header */
  --nx-avatar-md: 14rem;     /* header na md+ */
  --nx-avatar-sm: 2.75rem;   /* bubliny v chatu */

  /* Téma */
  --nx-bg:#0b0d16;           /* tmavé pozadí */
  --nx-panel:#10162a;        /* panel */
  --nx-accent:#a855f7;       /* fialová */
  --nx-accent2:#22d3ee;      /* azurová */
  --nx-text:#e6e8ef;
  --nx-muted:#9aa1b2;
  --nx-radius:24px;

  /* Layout */
  --nx-header:58px;          /* výška sticky headeru */

  /* Výšky „hlavy“ na CHATPAGES (default) – LITE je přepíše níž */
  --nx-head-h: 360px;
  --nx-head-h-sm: 280px;

  /* Šířka řádku zpráv (avatar + bublina) */
  --nx-msg-w: clamp(560px, 58vw, 880px);
}
@media (max-width:640px){ :root{ --nx-header:56px; --nx-msg-w: min(92vw, 100%); } }

/* ==== Dark stránka + header =========================================== */
.nx-dark{ background:var(--nx-bg); color:var(--nx-text); }
.nx-dark header,
.nx-dark .site-header{
  background: rgba(11,13,22,.85) !important;
  border-color: rgba(148,163,184,.18) !important;
  backdrop-filter: blur(10px) saturate(120%) !important;
  -webkit-backdrop-filter: blur(10px) saturate(120%) !important;
  box-shadow: 0 1px 0 rgba(168,85,247,.08) !important;
  color: var(--nx-text) !important;
}
.nx-dark header a,
.nx-dark .site-header a{
  color: var(--nx-text) !important;
  transition: color .15s ease, text-shadow .2s ease;
}
.nx-dark header a:hover,
.nx-dark .site-header a:hover{
  color: #fff !important;
  text-shadow: 0 0 10px rgba(168,85,247,.6), 0 0 16px rgba(34,211,238,.4);
}
.nx-dark header .h-5.w-px{ background: rgba(148,163,184,.35) !important; }

/* ==== Avatar =========================================================== */
.nx-avatar{
  width: var(--nx-avatar); height: var(--nx-avatar);
  border-radius: 9999px; background:#fff; overflow:hidden;
  display:inline-flex; align-items:center; justify-content:center;
  padding:.25rem; box-shadow:0 1px 2px rgb(0 0 0 / 0.05);
  outline:2px solid #e0e7ff; outline-offset:0;
}
@media (min-width:768px){ .nx-avatar{ width:var(--nx-avatar-md); height:var(--nx-avatar-md); } }
.nx-avatar--sm{
  width:var(--nx-avatar-sm); height:var(--nx-avatar-sm);
  aspect-ratio:1/1; border-radius:9999px; overflow:hidden; padding:0;
  background:transparent; display:inline-flex; align-items:center; justify-content:center;
}
.nx-head{ width:100%; height:100%; object-fit:contain; object-position:center; transition: transform .35s ease; }
.nx-avatar:not(.nx-avatar--sm):hover .nx-head{ transform: scale(1.05); }
.nx-head--sm{ width:100%; height:100%; object-fit:contain; display:block; }
#chatLog img.nx-head--sm{ max-width:none; height:100%; }

/* Jemné vznášení */
@keyframes nyxiss-float{ 0%{transform:translateY(0)} 50%{transform:translateY(-6px)} 100%{transform:translateY(0)} }
.nx-float{ animation: nyxiss-float 4.8s ease-in-out infinite; will-change: transform; }
@media (prefers-reduced-motion: reduce){ .nx-float{ animation:none; } }

/* ==== Glow panely / tlačítka ========================================== */
.nx-glow-panel{
  position:relative;
  background: color-mix(in srgb, var(--nx-panel) 92%, black 8%);
  border:1px solid color-mix(in srgb, var(--nx-accent) 65%, white 0%);
  border-radius: var(--nx-radius);
  box-shadow: 0 0 36px rgba(168,85,247,.28), 0 0 64px rgba(34,211,238,.20);
}
.nx-glow-panel::before{
  content:""; position:absolute; inset:-2px; border-radius:inherit;
  background:
    radial-gradient(120% 120% at 100% 0%, rgba(168,85,247,.55), transparent 60%),
    radial-gradient(120% 120% at 0% 100%, rgba(34,211,238,.45), transparent 60%);
  filter: blur(18px); opacity:.6; z-index:-1;
}
@media (prefers-reduced-motion:no-preference){
  .nx-animate-glow{ animation:pulseGlow 4.5s ease-in-out infinite; }
  @keyframes pulseGlow{
    0%,100%{ box-shadow: 0 0 36px rgba(168,85,247,.28), 0 0 64px rgba(34,211,238,.20); }
    50%{ box-shadow: 0 0 46px rgba(168,85,247,.38), 0 0 80px rgba(34,211,238,.30); }
  }
}

/* CTA tlačítka */
.nx-btn-primary{
  position:relative; display:inline-flex; align-items:center; gap:.6rem;
  padding:.8rem 1.1rem; border-radius:14px;
  background:linear-gradient(90deg, var(--nx-accent), var(--nx-accent2));
  color:#fff; font-weight:600;
  box-shadow: 0 10px 30px rgba(168,85,247,.35), 0 6px 20px rgba(34,211,238,.25);
  transition: transform .18s ease, box-shadow .22s ease, filter .22s ease;
}
.nx-btn-primary::after{ content:""; position:absolute; inset:-2px; border-radius:inherit; background:inherit; filter:blur(14px); opacity:.35; z-index:-1; }
.nx-btn-primary:hover{ transform: translateY(-1px); filter:saturate(1.08) brightness(1.05); box-shadow: 0 12px 36px rgba(168,85,247,.45), 0 8px 28px rgba(34,211,238,.30); }
.nx-btn-ghost{
  color:#c7cde0; padding:.8rem 1.1rem; border-radius:14px;
  border:1px solid rgba(148,163,184,.25);
  background:rgba(255,255,255,.02);
  transition: transform .18s ease, box-shadow .22s ease, filter .22s ease, border-color .22s ease;
}
.nx-btn-ghost:hover{ transform: translateY(-1px); border-color: rgba(168,85,247,.45); box-shadow: 0 10px 28px rgba(168,85,247,.20); }

/* ==== „Hlava“ Nyxiss =================================================== */
.nx-head-box{
  position: relative; display:grid; place-items:center;
  height: var(--nx-head-h);
  border-radius: var(--nx-radius);
  background: rgba(255,255,255,.02);
  border: 1px solid rgba(168,85,247,.25);
  box-shadow: inset 0 0 30px rgba(168,85,247,.08);
  perspective: 900px; overflow:hidden;
}
@media (max-width:1024px){ .nx-head-box{ height: var(--nx-head-h-sm); } }

.nx-head-img{
  width:auto; height:auto;
  max-width: min(70%, 520px);
  max-height: 50%;
  object-fit: contain;
  transform-origin: 50% 50%;
  will-change: transform, filter;
  filter:
    drop-shadow(0 12px 40px rgba(168,85,247,.25))
    drop-shadow(0 6px 24px rgba(34,211,238,.18));
}
@media (prefers-reduced-motion: no-preference){
  .nx-head-float{ animation: nxFloat 6s ease-in-out infinite; }
  @keyframes nxFloat{ 0%,100%{transform:translateY(0)} 50%{transform:translateY(-6px)} }
}

/* ==== CHAT LAYOUT (head nahoře, scrolluje jen log) ===================== */
html, body { height: 100%; }                  /* fallback pro 100dvh */
.nx-chatpage { min-height: 100dvh; }
@supports not (height: 1dvh){ .nx-chatpage{ min-height: 100vh; } }

.nx-chatpage__stack{
  display:flex; flex-direction:column;
  min-height:100%;
  overflow:visible;                           /* aura mimo panel */
}

.nx-aura-wrap{
  flex:1 1 auto; display:flex; min-height:0;
  overflow:visible;
}

/* panel = vzhled + aura (před) */
.nx-chat-panel{
  position: relative; z-index: 0; isolation: isolate;
  border-radius: var(--nx-radius);
  background: color-mix(in srgb, var(--nx-panel) 92%, black 8%);
  border: 1px solid rgba(168,85,247,.28);
  overflow: visible;                           /* aura se neřeže */
}
.nx-chat-panel::before{
  content:""; position:absolute; inset:-22px; border-radius:inherit;
  pointer-events:none; z-index:-1;
  background:
    radial-gradient(600px 260px at 20% -20%, rgba(168,85,247,.35), transparent 65%),
    radial-gradient(600px 260px at 120% 120%, rgba(34,211,238,.28), transparent 65%);
  filter: blur(20px); opacity:.75;
}
@media (prefers-reduced-motion: no-preference){
  .nx-chat-panel::before{ animation: nxAuraPulse 4.8s ease-in-out infinite; }
  @keyframes nxAuraPulse{ 0%,100%{opacity:.72; filter:blur(18px)} 50%{opacity:.86; filter:blur(24px)} }
}

/* shell = layout (grid) — stejný element jako panel (obě třídy) */
.nx-chat-shell{
  display:grid;
  grid-template-rows: auto 1fr auto;
  height:100%;
  min-height:0;
  overflow:visible;                            /* scroll má jen log */
}

/* header */
.nx-chat-header{
  display:flex; align-items:center; justify-content:space-between;
  padding:.75rem 1rem;
  border-bottom:1px solid rgba(148,163,184,.20);
  background: linear-gradient(180deg, rgba(255,255,255,.02), rgba(255,255,255,0));
}

/* log (jediný scroll) */
.nx-chat-log{
  padding: 1rem;
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  min-height: 0; scroll-behavior: smooth;
  background: transparent;
}

/* composer */
.nx-composer{
  display:flex; gap:.6rem; align-items:flex-end;
  padding:.6rem;
  border-top:1px solid rgba(148,163,184,.20);
  background: linear-gradient(0deg, rgba(255,255,255,.02), rgba(255,255,255,0));
  z-index:1;
}
.nx-composer textarea{
  flex:1; max-height:180px; resize:none;
  border-radius:12px; border:1px solid rgba(148,163,184,.35);
  background:rgba(255,255,255,.02); color:var(--nx-text);
  padding:.6rem .7rem; outline:none;
}
.nx-composer textarea:focus{
  border-color: rgba(168,85,247,.55);
  box-shadow: 0 0 0 3px rgba(168,85,247,.20);
}
.nx-send{
  white-space:nowrap; border-radius:12px; padding:.65rem .9rem; font-weight:600; color:#fff;
  background: linear-gradient(90deg, var(--nx-accent), var(--nx-accent2));
  border:1px solid rgba(168,85,247,.35);
  box-shadow: 0 10px 24px rgba(168,85,247,.35), 0 8px 18px rgba(34,211,238,.22);
  transition: transform .18s ease, box-shadow .22s ease, filter .22s ease;
}
.nx-send:hover{ transform: translateY(-1px); filter:saturate(1.05) brightness(1.03); }

/* zprávy */
.nx-row{ display:flex; gap:.6rem; margin:.4rem 0; }
.nx-row-user{ justify-content:flex-end; }

.nx-msgline{
  width: var(--nx-msg-w); max-width:100%;
  display:flex; align-items:flex-start; gap:.5rem;
}
.nx-bubble{
  max-width: min(680px, 86%); padding:.6rem .75rem;
  border-radius:14px; line-height:1.45;
  word-wrap:anywhere; white-space:pre-wrap; border:1px solid transparent;
}
.nx-bubble.bot{
  color:var(--nx-text);
  background: rgba(255,255,255,.03);
  border-color: rgba(168,85,247,.28);
  box-shadow: inset 0 0 18px rgba(168,85,247,.10), 0 8px 24px rgba(34,211,238,.12);
  border-top-left-radius:6px;
}
.nx-bubble.user{
  color:#fff;
  background: linear-gradient(90deg, var(--nx-accent), var(--nx-accent2));
  border-color: rgba(168,85,247,.35);
  box-shadow: 0 10px 28px rgba(168,85,247,.28), 0 8px 18px rgba(34,211,238,.18);
  border-top-right-radius:6px;
}

/* ==== LITE (FREE) – specifické úpravy ================================= */

/* Lock scroll těla, když je na stránce FREE chat (moderní) */
body:has(.nx-chatpage[data-tier="free"]){ overflow: hidden !important; }

/* Sekce chat = přesně prostor pod sticky headerem */
.nx-chatpage[data-tier="free"]{
  margin-top: var(--nx-header) !important;                  /* odsun pod menu */
  height: calc(100dvh - var(--nx-header)) !important;       /* přesně 1 screen */
  overflow: hidden !important;                               /* stránka nescrolluje */
  --nx-head-h: 280px;                                        /* LITE head výšky */
  --nx-head-h-sm: 220px;
}
@supports not (height: 1dvh){
  .nx-chatpage[data-tier="free"]{ height: calc(100vh - var(--nx-header)) !important; }
}

/* Vnitřní layout – vyplň výšku, hlava nescrolluje, scroll jen log */
.nx-chatpage[data-tier="free"] .nx-chatpage__stack{
  height:100% !important; display:flex !important; flex-direction:column !important; overflow:visible !important;
}
.nx-chatpage[data-tier="free"] .nx-glow-panel{ flex:0 0 auto !important; overflow:visible !important; }
.nx-chatpage[data-tier="free"] .nx-aura-wrap{ flex:1 1 auto !important; min-height:0 !important; overflow:visible !important; }
.nx-chatpage[data-tier="free"] .nx-chat-shell{
  display:grid !important; grid-template-rows:auto 1fr auto !important;
  height:100% !important; min-height:0 !important; max-height:none !important; overflow:visible !important;
}
.nx-chatpage[data-tier="free"] .nx-chat-log{
  min-height:0 !important; overflow-y:auto !important; -webkit-overflow-scrolling:touch;
}

/* FREE: širší řádky/bubliny */
.nx-chatpage[data-tier="free"] .nx-msgline{ width: clamp(520px, 54vw, 900px); }

/* ==== HOME (hero) — spacing + head size ================================ */
.nx-hero{
  /* menší hlava + prostor od sticky menu */
  --nx-head-h: 360px; --nx-head-h-sm: 175px;
  padding-top: calc(var(--nx-header) + clamp(8px, 1.5vw, 24px));
  padding-bottom: clamp(16px, 3vw, 48px);
  overflow: visible !important;
}
.nx-hero .nx-glow-panel:first-child{ margin-top: clamp(4px, 1vw, 16px); }
@media (max-width:1024px){
  .nx-hero{ padding-top: calc(var(--nx-header) + clamp(8px, 2vw, 20px)); }
  .nx-hero .nx-glow-panel:first-child{ margin-top: clamp(4px, 1vw, 12px); }
}

/* Head box na home používá min-height (ne tvrdou výšku) */
.nx-hero .nx-head-box{ min-height: var(--nx-head-h); height:auto; }
@media (max-width:1024px){ .nx-hero .nx-head-box{ min-height: var(--nx-head-h-sm); } }

/* menší obrázek uvnitř boxu (jen home) */
.nx-hero .nx-head-box .nx-head-img{
  max-width: clamp(120px, 28%, 300px);
  max-height: 90% !important;
}

/* Větší přesažení záře u home panelu */
.nx-hero .nx-glow-panel::before{ inset: -22px !important; }

/* ====== HLAVA: FX balíček (halo + shine) ================================= */

/* 3D tilt má hezčí efekt, když trošku zvedneme sytost a přidáme jemné světlo */
.nx-head-fx .nx-head-img{
  will-change: transform, filter;
  transition: filter .18s ease;
  filter:
    drop-shadow(0 18px 40px rgba(168,85,247,.28))
    drop-shadow(0 10px 28px rgba(34,211,238,.22));
}
.nx-head-fx:hover .nx-head-img{
  filter:
    drop-shadow(0 20px 52px rgba(168,85,247,.36))
    drop-shadow(0 14px 36px rgba(34,211,238,.28));
}

/* Rotující „halo“ kolem hlavy (conic gradient) */
.nx-head-fx::after{
  content:"";
  position:absolute; inset:-10px;
  border-radius: inherit;
  pointer-events:none; z-index:0;
  background:
    conic-gradient(from 0deg,
      rgba(168,85,247,.0) 0%,
      rgba(168,85,247,.18) 12%,
      rgba(34,211,238,.22) 28%,
      rgba(168,85,247,.0) 42%,
      rgba(168,85,247,.0) 58%,
      rgba(34,211,238,.18) 74%,
      rgba(168,85,247,.0) 100%);
  filter: blur(18px);
  opacity:.55;
  animation: nxHaloSpin 18s linear infinite;
  mix-blend-mode: screen;
}
@keyframes nxHaloSpin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce){
  .nx-head-fx::after{ animation: none; }
}

/* „Shine“ – světelný průjezd přes hlavu */
.nx-head-shine{
  position:absolute; inset: 8% 12%;
  border-radius: 24px;
  z-index:1; pointer-events:none;
  background:
    linear-gradient(105deg,
      rgba(255,255,255,0) 0%,
      rgba(255,255,255,.08) 35%,
      rgba(255,255,255,.18) 50%,
      rgba(255,255,255,.08) 65%,
      rgba(255,255,255,0) 100%);
  transform: translateX(-120%);
  filter: blur(2px);
  opacity:.6;
  animation: nxShine 3.8s ease-in-out infinite;
}
@keyframes nxShine {
  0%   { transform: translateX(-120%); opacity:.0; }
  8%   { opacity:.6; }
  50%  { transform: translateX(0%);   opacity:.35; }
  92%  { opacity:.6; }
  100% { transform: translateX(120%); opacity:0; }
}
@media (prefers-reduced-motion: reduce){
  .nx-head-shine{ display:none; }
}

/* Lehké zvýraznění, když je box v hoveru/focusu (lepší kontrast) */
.nx-head-fx:hover::after{
  opacity:.75;
  filter: blur(20px);
}


/* ==== CHIPS (BUTTONS) ================================================== */
.nx-chip{
  display:inline-flex; align-items:center; gap:.5rem;
  padding:.5rem .75rem; border-radius:9999px;
  border:1px solid rgba(168,85,247,.35);
  background:rgba(255,255,255,.04);
  color:#d1d5db; font-weight:500; line-height:1;
  appearance:none; -webkit-appearance:none; cursor:pointer;
}
button.nx-chip{ border-width: 1px !important; } /* přebije reset */
.nx-chip__dot{
  width:.6rem; height:.6rem; border-radius:9999px;
  background:linear-gradient(90deg, var(--nx-accent), var(--nx-accent2));
  box-shadow:0 0 10px rgba(168,85,247,.6); flex:0 0 auto;
}
.nx-chip:hover{ border-color: rgba(168,85,247,.55); box-shadow: 0 10px 18px rgba(168,85,247,.18); }
.nx-chip:focus-visible{
  outline: 2px solid color-mix(in srgb, var(--nx-accent) 70%, var(--nx-accent2) 30%);
  outline-offset: 2px;
}
.nx-chip[aria-pressed="true"]{
  border-color: rgba(168,85,247,.6);
  background: rgba(168,85,247,.12);
  box-shadow: 0 0 18px rgba(168,85,247,.25) inset;
}
/* === LITE chat – HEAD se nesmí řezat + composer se musí vykreslit === */



/* Shell = 3 řádky a prostřední řádek smí srolovat */
.nx-chatpage[data-tier="free"] .nx-chat-shell{
  grid-template-rows: auto minmax(0,1fr) auto !important;
  overflow: visible !important;   /* ať nic neschová composer */
}

/* Log je JEDINÝ scroll */
.nx-chatpage[data-tier="free"] .nx-chat-log{
  min-height: 0 !important;
  max-height: none !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;
}

/* Panel nic neřeže (kvůli auře i composeru) */
.nx-chatpage[data-tier="free"] .nx-chat-panel{
  overflow: visible !important;
}
/* === LITE chat: head neuřezat + composer vždy vidět =================== */

/* 1) Hlava – žádné ořezávání + o fous menší obrázek */
.nx-chatpage[data-tier="free"] .nx-head-box{
  overflow: visible !important;
}


/* 2) Panel neschovávat obsah (kvůli auře i composeru) */
.nx-chatpage[data-tier="free"] .nx-chat-panel{
  overflow: visible !important;
}



/* 4) Log je JEDINÝ scroll */
.nx-chatpage[data-tier="free"] .nx-chat-log{
  min-height: 0 !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;
}

/* 5) Composer – jistota, že je vykreslený */
.nx-chatpage[data-tier="free"] .nx-composer{
  display: flex !important;
  flex: 0 0 auto !important;
  z-index: 1;
}
/* === FREE chat: aura + plný panel + scroll jen v logu ================== */
body:has(.nx-chatpage[data-tier="free"]){ overflow:hidden !important; }

.nx-chatpage[data-tier="free"]{
  /* sekce přesně pod sticky headerem */
  margin-top: var(--nx-header) !important;
  height: calc(100dvh - var(--nx-header)) !important;
}
@supports not (height:1dvh){
  .nx-chatpage[data-tier="free"]{ height: calc(100vh - var(--nx-header)) !important; }
}

.nx-chatpage[data-tier="free"] .nx-chat-panel{ overflow: visible !important; position: relative !important; isolation:isolate !important; }
.nx-chatpage[data-tier="free"] .nx-chat-shell{ grid-template-rows: auto minmax(0,1fr) auto !important; }
.nx-chatpage[data-tier="free"] .nx-chat-log{ min-height:0 !important; overflow-y:auto !important; }
.nx-chatpage[data-tier="free"] .nx-composer{ flex:0 0 auto !important; z-index:1; }



.nx-chatpage[data-tier="free"] .nx-msgline{
  width: clamp(720px, 70vw, 1200px) !important;
  max-width: 100%;
}
.nx-chatpage[data-tier="free"] .nx-head-box{ overflow: visible !important; }
.nx-chatpage[data-tier="free"] .nx-head-box .nx-head-img{
  max-height: 60% !important; /* klidně 74–82 % podle oka */
  object-fit: contain !important;
}
/* --- FREE chat: top fix (nadřazené ostatním) ------------------------- */

/* 1) Nepoužívej margin-top, posuň sekci paddingem */
.nx-chatpage[data-tier="free"]{
  margin-top: 0 !important;
  padding-top: calc(var(--nx-header) + 12px) !important; /* bezpečný offset pod menu */
  height: calc(100dvh - var(--nx-header)) !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
}

/* 2) Aura prvního panelu NESMÍ přesahovat nahoru do menu */
.nx-chatpage[data-tier="free"] .nx-glow-panel:first-child::before{
  inset: 0 -22px -22px -22px !important;  /* nahoře 0 → žádný přesah do headeru */
}

/* 3) Pro jistotu dovol „dýchat“ obsahu, ale neřezat ho */
.nx-chatpage[data-tier="free"] .nx-glow-panel:first-child{
  overflow: visible !important;
}
/* FREE: chat panel roztáhni na plnou šířku kontejneru */
.nx-chatpage[data-tier="free"] .nx-aura-wrap{ display:flex; }
.nx-chatpage[data-tier="free"] .nx-aura-wrap > .nx-chat-panel{
  flex: 1 1 auto;
  width: 100%;
  max-width: none;      /* jistota, ať ho nic nezužuje */
}
/* Aura pro spodní chat panel (když nemá nx-glow-panel) */
.nx-chatpage[data-tier="free"] .nx-chat-panel{
  position: relative !important;
  isolation: isolate !important;
  overflow: visible !important;
  border: 1px solid rgba(168,85,247,.28);
  background: color-mix(in srgb, var(--nx-panel) 92%, black 8%);
}
.nx-chatpage[data-tier="free"] .nx-chat-panel::before{
  content:"";
  position:absolute;
  inset:-22px;                /* přesah aury mimo panel */
  border-radius:inherit;
  z-index:-1;
  pointer-events:none;
  background:
    radial-gradient(600px 260px at 20% -20%, rgba(168,85,247,.35), transparent 65%),
    radial-gradient(600px 260px at 120% 120%, rgba(34,211,238,.28), transparent 65%);
  filter: blur(20px);
  opacity:.8;
}
/* Nesmí nic kolem panelu ořezávat */
.nx-chatpage[data-tier="free"] .nx-aura-wrap,
.nx-chatpage[data-tier="free"] .nx-chatpage__stack{ overflow: visible !important; }

#nxHeadRotator { display:none !important; }

/* === HOME: kompaktní avatar v pravém rohu hero panelu ================= */
.nx-hero{
  --nx-head-h: 220px;
  --nx-head-h-sm: 160px;
}

/* Head box absolutně v pravém horním rohu hero panelu */
.nx-hero .nx-head-box.nx-head-corner{
  position: absolute;
  top: 1.5rem; right: 1.5rem;
  width: clamp(180px, 26vw, 300px);
  height: clamp(180px, 26vw, 300px);
  min-height: 0;
  margin: 0;
  background: radial-gradient(120% 120% at 60% 30%,
                              rgba(168,85,247,.18) 0%,
                              rgba(34,211,238,.10) 40%,
                              rgba(11,13,22,0)    70%);
  border: 1px solid rgba(168,85,247,.18);
  border-radius: 22px;
  overflow: hidden;
  z-index: 1;
  pointer-events: auto;
}
@media (min-width: 768px){
  .nx-hero .nx-head-box.nx-head-corner{
    top: 2rem; right: 2rem;
  }
}

.nx-hero .nx-head-box.nx-head-corner .nx-head-img{
  max-width: 92% !important;
  max-height: 96% !important;
  /* posun hlavy doprava-nahoru ať překračuje "vykouknutí" z rohu */
  object-fit: contain;
  object-position: 60% 40%;
}

/* Hero už nemá grid — text je samostatně, hlava overlapuje */
.nx-hero .nx-hero-grid{ display: block; }

/* Tablet (641–768px): hlavu zmenšit + jemný fade, ať nepřebíjí text */
@media (max-width: 768px) and (min-width: 641px){
  .nx-hero .nx-head-box.nx-head-corner{
    width: 140px; height: 140px;
    top: 1rem; right: 1rem;
    opacity: .7;
  }
}

/* Mobile (≤640px): hlavu úplně schovat — na 320–640px nemá kam */
@media (max-width: 640px){
  .nx-hero .nx-head-box.nx-head-corner{ display: none; }
  /* Místo ní necháme jen text — kompaktnější hero */
  .nx-hero--compact .nx-glow-panel{ padding: 1.25rem 1rem; }
}

/* Compact hero spacing */
.nx-hero--compact{ padding-top: 1.5rem; padding-bottom: 1.5rem; }
/* === CHATY: S velikost (≈ polovina M) ================================ */
.nx-chatpage,
.nx-chatpage[data-tier="free"]{
  --nx-head-h: 230px;     /* dřív 460px */
  --nx-head-h-sm: 180px;  /* dřív 320px */
}

.nx-chatpage .nx-head-box{
  min-height: var(--nx-head-h) !important;
  height: auto !important;
  overflow: visible !important;
}

.nx-chatpage .nx-head-box .nx-head-img{
  /* dřív clamp(240px, 38vw, 720px) */
  max-width: clamp(120px, 19vw, 360px) !important;
  max-height: 84% !important;
  object-fit: contain !important;
}

/* notebooky / tablety na šířku */
@media (max-width: 1024px){
  .nx-chatpage,
  .nx-chatpage[data-tier="free"]{
    --nx-head-h: 190px;     /* dřív 380px */
    --nx-head-h-sm: 170px;  /* dřív 300px */
  }
  .nx-chatpage .nx-head-box .nx-head-img{
    /* dřív clamp(220px, 52vw, 640px) */
    max-width: clamp(110px, 26vw, 320px) !important;
    max-height: 82% !important;
  }
}

/* mobily */
@media (max-width: 640px){
  .nx-chatpage,
  .nx-chatpage[data-tier="free"]{
    --nx-head-h: 160px;     /* dřív 320px */
    --nx-head-h-sm: 160px;  /* dřív 280px */
  }
  .nx-chatpage .nx-head-box .nx-head-img{
    /* dřív clamp(200px, 82vw, 560px) */
    max-width: clamp(100px, 41vw, 280px) !important;
    max-height: 80% !important;
  }
}
/* Když probíhá nahrávání, obal získá třídu .nyx-talking */
.nyx-talking #nyx-head {
  transform: scale(3);            /* ×3 zvětšení */
  transform-origin: center 55%;   /* jemný posun, ať „roste“ pěkně ze středu */
  z-index: 10;
}
#nyx-mic[aria-pressed="true"] {
  box-shadow: 0 0 0 2px rgba(255,255,255,.25), 0 0 30px 8px rgba(0,200,255,.28);
}
