/* styles/top-bar.css — split from styles.css (structural only) */

.top-bar {
  position: relative;
  z-index: 30;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  overflow: visible;
  min-height: 96px;
}

.top-bar-empty {
  min-height: 2px;
  z-index: 0;
}

.top-bar-brand-only {
  justify-content: center;
}

.top-bar-with-nav-crystals {
  justify-content: space-between;
  align-items: center;
  min-height: 96px;
}

.top-bar-nav-left {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  margin-right: auto;
}

/* Фигура дня → меню (тот же размер, что у шепота) */
.day-crystal-button {
  appearance: none;
  border: none;
  background: transparent;
  padding: 0;
  margin: 0;
  width: clamp(86px, 8.2vw, 106px);
  height: clamp(86px, 8.2vw, 106px);
  cursor: pointer;
  border-radius: 0;
  position: relative;
  overflow: visible;
  filter: var(--ui-intro-figure-glow);
  transition: transform 220ms ease, filter 220ms ease;
}

.day-crystal-button:hover,
.day-crystal-button:focus-visible {
  transform: translateY(-1px) scale(1.04);
  filter: var(--ui-intro-figure-glow-hover);
  outline: none;
}

.day-crystal-button:active {
  transform: translateY(0) scale(0.98);
}

.day-crystal-button .day-crystal-host,
.day-crystal-button .omen-day-artifact {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  flex: none;
  pointer-events: none;
  /* свечение на кнопке — не дублировать на host */
  filter: none;
}

.day-crystal-button .omen-day-artifact.mode-card-icon-3d,
.day-crystal-button .omen-day-artifact .mode-card-icon-canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
  max-width: 100%;
  max-height: 100%;
  pointer-events: none;
}

.top-bar-brand {
  /* равные боковые колонки → ворон всегда в геометрическом центре бренда */
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  column-gap: clamp(8px, 1.6vw, 22px);
  min-width: 0;
  max-width: min(78vw, 980px);
  width: min(100%, 980px);
  position: relative;
  left: auto;
  top: auto;
  transform: none;
  z-index: 2;
  pointer-events: none;
  grid-column: 2;
  justify-self: center;
}

.top-bar-brand > .top-bar-title-wrap:first-child {
  grid-column: 1;
  justify-self: stretch;
}

.top-bar-brand > .top-bar-raven {
  grid-column: 2;
  justify-self: center;
}

.top-bar-brand > .top-bar-title-wrap:last-of-type {
  grid-column: 3;
  justify-self: stretch;
}

.top-bar-brand .top-bar-raven,
.top-bar-brand .top-bar-raven-host {
  pointer-events: auto;
}

.top-bar-raven {
  --icon-swing: 4deg;
  position: relative;
  width: clamp(96px, 14vw, 160px);
  height: clamp(60px, 9.5vw, 96px);
  flex: 0 0 auto;
  overflow: visible;
  filter:
    drop-shadow(0 0 3px rgba(255, 220, 140, 0.55))
    drop-shadow(0 0 12px rgba(255, 188, 80, 0.48))
    drop-shadow(0 4px 16px rgba(255, 160, 50, 0.36));
}

.top-bar-raven-host {
  width: 100%;
  height: 100%;
  border-radius: 0;
  overflow: visible;
  cursor: grab;
  touch-action: none;
}

.top-bar-raven-host:active {
  cursor: grabbing;
}

.top-bar-raven-canvas {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.top-bar-raven-fx {
  position: absolute;
  inset: -12px -8px -18px;
  pointer-events: none;
  z-index: 3;
  overflow: visible;
}

.top-bar-raven-sparks {
  position: absolute;
  inset: -6px -4px -14px;
  pointer-events: none;
  z-index: 2;
  overflow: visible;
}

.top-bar-raven-spark {
  --x: 50%;
  --delay: 0ms;
  --dur: 3200ms;
  --tx: 0px;
  position: absolute;
  left: var(--x);
  top: 58%;
  width: 2.5px;
  height: 2.5px;
  border-radius: 50%;
  background: rgba(255, 236, 190, 0.95);
  box-shadow:
    0 0 6px rgba(255, 210, 120, 0.85),
    0 0 12px rgba(255, 180, 70, 0.55);
  opacity: 0;
  animation: topBarRavenSparkFall var(--dur) ease-out var(--delay) infinite;
}

.top-bar-app-title,
.top-bar-path-title,
.top-bar-stage-title {
  margin: 0;
  font-family: var(--font-display);
  color: rgba(245, 237, 255, 0.96);
  text-shadow:
    0 0 10px rgba(210, 180, 255, 0.55),
    0 0 22px rgba(150, 210, 255, 0.4),
    0 0 36px rgba(174, 132, 255, 0.32),
    0 6px 18px rgba(8, 6, 24, 0.45);
  animation: modeTitleLevitate 5.8s ease-in-out infinite;
}

.top-bar-app-title,
.top-bar-path-title {
  font-size: clamp(1.55rem, 4.4vw, 2.9rem);
  white-space: nowrap;
  line-height: 1.1;
  text-align: center;
}

.top-bar-title-wrap {
  position: relative;
  display: grid;
  width: 100%;
  min-width: 0;
  justify-items: stretch;
  padding: 4px 8px 16px;
  overflow: visible;
}

.top-bar-title-wrap .top-bar-app-title {
  text-align: right;
  justify-self: end;
}

.top-bar-title-wrap .top-bar-path-title {
  text-align: left;
  justify-self: start;
}

/* Заголовок экрана по центру шапки */
.top-bar-stage-title-wrap {
  position: absolute;
  left: 50%;
  top: calc(50% + 10px);
  transform: translate(-50%, -50%);
  z-index: 1;
  display: grid;
  justify-items: center;
  width: max-content;
  max-width: min(58vw, 520px);
  min-width: 0;
  padding: 2px 8px 8px;
  pointer-events: none;
  overflow: visible;
}

.top-bar-stage-title {
  position: relative;
  z-index: 1;
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.95rem, 5.6vw, 3.55rem);
  line-height: 1.12;
  text-align: center;
  white-space: normal;
  max-width: 100%;
}

.top-bar-stage-title-wrap::before {
  content: "";
  position: absolute;
  left: -10%;
  right: -10%;
  bottom: 0;
  height: 30px;
  pointer-events: none;
  background:
    radial-gradient(ellipse 70% 90% at 50% 55%, rgba(188, 148, 255, 0.42), rgba(188, 148, 255, 0) 72%),
    radial-gradient(circle at 48% 46%, rgba(132, 209, 255, 0.34), rgba(132, 209, 255, 0) 66%);
  filter: blur(14px);
  opacity: 0.82;
  animation: topBarTitleGlowPulse 2.6s ease-in-out infinite;
}

.top-bar-with-stage-title:not(.top-bar-with-nav-crystals) {
  justify-content: center;
  min-height: 96px;
}

.top-bar-title-sparks {
  inset: auto -10% -4px -10%;
  height: 38px;
  top: auto;
  bottom: 0;
  overflow: visible;
}

.top-bar-title-sparks .mode-title-spark {
  top: 42%;
  width: 2.4px;
  height: 2.4px;
  background: rgba(248, 242, 255, 0.92);
  box-shadow:
    0 0 6px rgba(210, 180, 255, 0.75),
    0 0 12px rgba(150, 210, 255, 0.5);
  animation-name: topBarTitleSparkFall;
}

.top-bar-title-wrap::before {
  content: "";
  position: absolute;
  left: -14%;
  right: -14%;
  bottom: 2px;
  height: 28px;
  pointer-events: none;
  background:
    radial-gradient(ellipse 70% 90% at 50% 55%, rgba(188, 148, 255, 0.42), rgba(188, 148, 255, 0) 72%),
    radial-gradient(circle at 32% 48%, rgba(174, 132, 255, 0.38), rgba(174, 132, 255, 0) 64%),
    radial-gradient(circle at 68% 44%, rgba(132, 209, 255, 0.34), rgba(132, 209, 255, 0) 66%);
  filter: blur(14px);
  opacity: 0.88;
  animation: topBarTitleGlowPulse 2.6s ease-in-out infinite;
}

.top-bar-omen {
  position: relative;
  z-index: 5;
  grid-column: 1;
  justify-self: start;
  align-self: center;
  margin-left: 0;
  margin-right: 0;
  max-width: min(280px, 26vw);
  width: auto;
  min-width: 0;
  pointer-events: auto;
  flex: 0 1 auto;
  padding: 2px 8px 3px;
  box-sizing: border-box;
  overflow: visible;
}

.top-bar-omen .menu-omen {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
  font-size: clamp(0.62rem, 0.95vw, 0.72rem);
  line-height: 1.3;
  white-space: normal;
}

.top-bar-omen .mode-predictions-label {
  font-size: clamp(0.52rem, 0.82vw, 0.6rem);
  margin-bottom: 1px;
  line-height: 1.2;
}

/* Фигура слева от всего блока (label+текст), по высоте блока */
.top-bar-omen .omen-day-artifact {
  flex: 0 0 clamp(86px, 8.2vw, 106px);
  width: clamp(86px, 8.2vw, 106px);
  height: clamp(86px, 8.2vw, 106px);
  max-width: clamp(86px, 8.2vw, 106px);
  max-height: clamp(86px, 8.2vw, 106px);
  margin-top: 0;
  align-self: center;
}

.top-bar-omen.mode-predictions-frame--with-artifact {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

@media (max-width: 900px) {
  .top-bar-brand {
    max-width: min(92vw, 720px);
    width: min(100%, 720px);
    column-gap: 8px;
  }

  .top-bar-raven {
    width: clamp(84px, 13vw, 120px);
    height: clamp(52px, 8.5vw, 76px);
  }

  .top-bar-app-title,
  .top-bar-path-title {
    font-size: clamp(1.35rem, 3.8vw, 2.2rem);
  }

  .top-bar-omen {
    max-width: min(250px, 30vw);
  }

  .top-bar-omen .menu-omen {
    font-size: 0.6rem;
  }

  .top-bar-omen .omen-day-artifact {
    flex: 0 0 clamp(82px, 8vw, 100px);
    width: clamp(82px, 8vw, 100px);
    height: clamp(82px, 8vw, 100px);
    max-width: clamp(82px, 8vw, 100px);
    max-height: clamp(82px, 8vw, 100px);
  }
}

.controls {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 0;
  min-height: 32px;
  overflow: visible;
  margin-left: auto;
}

.app-disclaimer {
  margin: 0;
  padding: 8px 16px 18px;
  text-align: center;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  line-height: 1.45;
  color: rgba(168, 158, 196, 0.38);
  user-select: text;
  pointer-events: auto;
}

.app-disclaimer-mail {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid rgba(168, 158, 196, 0.22);
}

.app-disclaimer-mail:hover,
.app-disclaimer-mail:focus-visible {
  color: rgba(198, 188, 220, 0.62);
  border-bottom-color: rgba(198, 188, 220, 0.4);
  outline: none;
}
