.nyx-app-launcher {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
  z-index: 800;
}

.nyx-launch-btn {
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--card-bg);
  color: var(--cyan);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color .16s, background .16s, box-shadow .16s, color .16s;
}

.nyx-launch-btn svg {
  width: 21px;
  height: 21px;
}

.nyx-launch-btn:hover,
.nyx-launch-btn.open {
  color: var(--magenta);
  border-color: var(--cyan);
  background: color-mix(in srgb, var(--cyan) 9%, var(--card-bg));
  box-shadow: var(--glow-cyan);
}

.nyx-apps-pop {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 366px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: color-mix(in srgb, var(--dark2) 96%, transparent);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .72), inset 0 1px 0 rgba(255,255,255,.04);
  backdrop-filter: blur(18px);
  display: none;
}

.nyx-apps-pop.open {
  display: block;
  animation: nyx-launch-in .14s ease-out;
}

@keyframes nyx-launch-in {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.nyx-apps-head,
.nyx-lang-row {
  min-height: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--cyan);
  font-family: 'Share Tech Mono', monospace;
  font-size: 11px;
  letter-spacing: .12em;
}

.nyx-current-app {
  color: var(--text-color);
  opacity: .55;
}

.nyx-apps-grid {
  margin: 10px 0 12px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.nyx-app {
  width: 100%;
  height: 90px;
  min-width: 0;
  padding: 8px 5px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text-color);
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 9px;
  overflow: hidden;
  transition: background .14s, border-color .14s, color .14s;
}

.nyx-app:hover {
  color: var(--cyan);
  border-color: var(--border);
  background: color-mix(in srgb, var(--cyan) 8%, transparent);
}

.nyx-app.active {
  color: var(--magenta);
  border-color: color-mix(in srgb, var(--magenta) 55%, transparent);
  background: color-mix(in srgb, var(--magenta) 9%, transparent);
}

.nyx-app-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nyx-app-icon svg,
.nyx-app-icon img {
  width: 34px;
  height: 34px;
  object-fit: contain;
  filter: drop-shadow(0 0 5px color-mix(in srgb, var(--cyan) 55%, transparent));
  animation: nyx-logo-float 4s ease-in-out infinite;
}

.nyx-app-icon svg {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nyx-logo-convert .ar,
.nyx-logo-compress .ar {
  fill: none;
  stroke: var(--cyan);
  stroke-width: 5;
}

.nyx-logo-convert .ar2,
.nyx-logo-compress .ar2,
.nyx-logo-compress .bar {
  stroke: var(--magenta);
}

.nyx-logo-convert .dash {
  stroke-dasharray: 46;
  animation: nyx-convert-dash 2.4s linear infinite;
}

.nyx-logo-compress .dash {
  stroke-dasharray: 30;
  animation: nyx-short-dash 2.4s linear infinite;
}

.nyx-logo-compress .bar {
  stroke-width: 5;
}

.nyx-logo-pdf .d1 {
  fill: none;
  stroke: var(--cyan);
  stroke-width: 4;
}

.nyx-logo-pdf .d2 {
  fill: none;
  stroke: var(--magenta);
  stroke-width: 4;
}

.nyx-logo-pdf .dash {
  stroke-dasharray: 8 7;
  animation: nyx-short-dash 2.4s linear infinite;
}

.nyx-logo-qr .q1 {
  fill: none;
  stroke: var(--cyan);
  stroke-width: 4;
}

.nyx-logo-qr .q2,
.nyx-logo-password .k2 {
  fill: var(--magenta);
  stroke: none;
}

.nyx-logo-password .k1 {
  fill: none;
  stroke: var(--cyan);
  stroke-width: 4;
}

.nyx-logo-barvy .c1 { fill: var(--cyan); opacity: .9; }
.nyx-logo-barvy .c2 { fill: var(--magenta); opacity: .75; }
.nyx-logo-barvy .c3 { fill: var(--green, #00ff88); opacity: .7; }
.nyx-logo-kalkulacka .ca1 { fill: none; stroke: var(--cyan); stroke-width: 4; }
.nyx-logo-kalkulacka .ca3 { fill: none; stroke: var(--magenta); stroke-width: 3; }
.nyx-logo-kalkulacka .ca2 { fill: var(--magenta); stroke: none; }
.nyx-logo-minecraft .mc1 { fill: none; stroke: var(--cyan); stroke-width: 4; }
.nyx-logo-minecraft .mc2 { fill: var(--magenta); stroke: none; }

@keyframes nyx-logo-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

@keyframes nyx-convert-dash {
  to { stroke-dashoffset: -92; }
}

@keyframes nyx-short-dash {
  to { stroke-dashoffset: -60; }
}

.nyx-app-name {
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
  white-space: nowrap;
  font-family: 'Orbitron', monospace;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0;
}

.nyx-lang-row {
  padding-top: 11px;
  border-top: 1px solid var(--border);
}

.nyx-lang-switch {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, 42px);
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: rgba(0,0,0,.18);
}

.nyx-lang-indicator {
  position: absolute;
  z-index: 0;
  top: 3px;
  left: 3px;
  width: 42px;
  height: 28px;
  border-radius: 5px;
  background: var(--cyan);
  box-shadow: 0 0 10px color-mix(in srgb, var(--cyan) 45%, transparent);
  transform: translateX(0);
  transition: transform .28s cubic-bezier(.22, 1, .36, 1), background .2s, box-shadow .2s;
  pointer-events: none;
}

.nyx-lang-switch[data-lang="en"] .nyx-lang-indicator {
  transform: translateX(42px);
}

.nyx-lang-switch button {
  position: relative;
  z-index: 1;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--text-color);
  cursor: pointer;
  font-family: 'Share Tech Mono', monospace;
  font-size: 11px;
  transition: color .2s ease, text-shadow .2s ease;
}

.nyx-lang-switch button.active {
  color: var(--dark);
  text-shadow: none;
}

html.nyx-lang-transition body > *:not(:has(.nyx-app-launcher)):not(.nyx-app-launcher) {
  transition: opacity .18s ease, filter .18s ease;
}

html.nyx-lang-out body > *:not(:has(.nyx-app-launcher)):not(.nyx-app-launcher) {
  opacity: .25;
  filter: blur(1px);
}

@media (max-width: 700px) {
  .nyx-apps-pop {
    position: fixed;
    top: 72px;
    right: 12px;
    left: 12px;
    width: auto;
    max-height: calc(100vh - 88px);
    overflow: auto;
  }

  .nyx-apps-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 390px) {
  .nyx-apps-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  .nyx-app-icon svg,
  .nyx-app-icon img,
  .nyx-app-icon .dash,
  .nyx-lang-indicator {
    animation: none;
    transition: none;
  }

  html.nyx-lang-transition body > * {
    transition: none;
  }
}

/* ═══════════ NYXIUM · LAUNCHER ANIMATIONS (Apple-grade) ═══════════ */
:root { --nyx-spring: cubic-bezier(.34, 1.56, .64, 1); --nyx-ease: cubic-bezier(.16, 1, .3, 1); }

/* launcher arrives with a gentle pop */
.nyx-app-launcher { animation: nyx-pop-in .55s var(--nyx-spring) both; }
@keyframes nyx-pop-in { from { opacity: 0; transform: scale(.8); } to { opacity: 1; transform: none; } }

/* launch button — glass + spring hover + open morph */
.nyx-launch-btn {
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  backdrop-filter: blur(14px) saturate(1.3);
  transition: transform .4s var(--nyx-spring), border-color .18s, background .18s, box-shadow .25s, color .18s;
}
.nyx-launch-btn:hover { transform: translateY(-2px); }
.nyx-launch-btn.open { transform: scale(1.06); }
.nyx-launch-btn:active { transform: scale(.93); }
.nyx-launch-btn svg { transition: transform .5s var(--nyx-spring); }
.nyx-launch-btn:hover svg { transform: scale(1.1); }
.nyx-launch-btn.open svg { transform: rotate(45deg) scale(.9); }

/* popup — springy drop out of the button */
.nyx-apps-pop { transform-origin: top right; }
.nyx-apps-pop.open { animation: nyx-launch-in .44s var(--nyx-spring); }
@keyframes nyx-launch-in {
  0%   { opacity: 0; transform: translateY(-12px) scale(.9); filter: blur(6px); }
  55%  { filter: blur(0); }
  100% { opacity: 1; transform: none; filter: blur(0); }
}

/* heading + language row ease in */
.nyx-apps-pop.open .nyx-apps-head { animation: nyx-fade-down .42s .03s var(--nyx-ease) backwards; }
.nyx-apps-pop.open .nyx-lang-row  { animation: nyx-fade-down .42s .28s var(--nyx-ease) backwards; }
@keyframes nyx-fade-down { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* app tiles — staggered spring reveal */
.nyx-apps-pop.open .nyx-app { animation: nyx-app-in .5s var(--nyx-spring) backwards; }
@keyframes nyx-app-in { from { opacity: 0; transform: translateY(12px) scale(.78); } to { opacity: 1; transform: none; } }
.nyx-apps-pop.open .nyx-app:nth-child(1) { animation-delay: .06s; }
.nyx-apps-pop.open .nyx-app:nth-child(2) { animation-delay: .10s; }
.nyx-apps-pop.open .nyx-app:nth-child(3) { animation-delay: .14s; }
.nyx-apps-pop.open .nyx-app:nth-child(4) { animation-delay: .18s; }
.nyx-apps-pop.open .nyx-app:nth-child(5) { animation-delay: .22s; }
.nyx-apps-pop.open .nyx-app:nth-child(6) { animation-delay: .26s; }
.nyx-apps-pop.open .nyx-app:nth-child(7) { animation-delay: .30s; }
.nyx-apps-pop.open .nyx-app:nth-child(8) { animation-delay: .34s; }

/* tile hover — lift, glow, icon pop */
.nyx-app {
  transition: background .14s, border-color .14s, color .14s,
              transform .4s var(--nyx-spring), box-shadow .3s var(--nyx-ease);
}
.nyx-app:hover { transform: translateY(-4px) scale(1.05); box-shadow: 0 12px 26px -12px color-mix(in srgb, var(--cyan) 55%, transparent); }
.nyx-app:active { transform: translateY(-1px) scale(.99); }
.nyx-app-icon { transition: transform .45s var(--nyx-spring); }
.nyx-app:hover .nyx-app-icon { transform: scale(1.18) rotate(-4deg); }

/* active app — gentle pulsing presence */
.nyx-app.active .nyx-app-icon { animation: nyx-active-pulse 2.6s ease-in-out infinite; }
@keyframes nyx-active-pulse {
  0%, 100% { filter: drop-shadow(0 0 3px color-mix(in srgb, var(--magenta) 35%, transparent)); }
  50%      { filter: drop-shadow(0 0 11px color-mix(in srgb, var(--magenta) 70%, transparent)); }
}

/* respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .nyx-app-launcher, .nyx-launch-btn, .nyx-launch-btn svg,
  .nyx-apps-pop.open, .nyx-apps-pop.open .nyx-app,
  .nyx-apps-pop.open .nyx-apps-head, .nyx-apps-pop.open .nyx-lang-row,
  .nyx-app, .nyx-app-icon, .nyx-app.active .nyx-app-icon {
    animation: none !important;
  }
  .nyx-launch-btn.open svg, .nyx-launch-btn:hover svg { transform: none; }
}
