/* Hubi — AI-native conversational layer (UI/UX Pro Max). */
:root {
  --hubi-indigo: #1e1b4b;
  --hubi-green: #22c55e;
  --hubi-gold: var(--accent, #f5c518);
}

.hubi-hero {
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  padding: 1.75rem 1.5rem 1.5rem;
  margin-bottom: 1.25rem;
  background: color-mix(in srgb, var(--hubi-indigo) 55%, var(--surface, #14101f));
  border: 1px solid var(--border);
}
.hubi-hero-bg { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.hubi-orb {
  position: absolute;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  filter: blur(48px);
  opacity: 0.45;
}
.hubi-orb-a { left: -40px; top: -60px; background: #4338ca; }
.hubi-orb-b { right: -20px; bottom: -80px; background: color-mix(in srgb, var(--hubi-gold) 70%, transparent); }
.hubi-hero-inner {
  position: relative;
  display: flex;
  gap: 1.1rem;
  align-items: center;
}
.hubi-mascot {
  flex: 0 0 auto;
  width: 72px;
  height: 72px;
  border-radius: 20px;
  box-shadow: 0 0 0 1px var(--border), 0 12px 32px color-mix(in srgb, var(--hubi-indigo) 50%, transparent);
}
.hubi-kicker {
  margin: 0 0 0.2rem;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--hubi-green);
  font-weight: 600;
}
.hubi-title {
  margin: 0;
  font-family: var(--display, Righteous, sans-serif);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  line-height: 1.05;
}
.hubi-lead { margin: 0.4rem 0 0.55rem; max-width: 42rem; }
.hubi-status {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.hubi-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(240px, 0.9fr);
  gap: 1rem;
  align-items: start;
}
.hubi-chat-card,
.hubi-panel {
  background: var(--surface, #14101f);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1rem;
}
.hubi-log {
  min-height: 280px;
  max-height: min(52vh, 480px);
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  padding-right: 0.25rem;
}
.hubi-msg {
  max-width: 92%;
  padding: 0.7rem 0.9rem;
  border-radius: 14px;
  font-size: 0.92rem;
  line-height: 1.45;
}
.hubi-msg.user {
  align-self: flex-end;
  background: color-mix(in srgb, var(--accent) 22%, var(--surface-soft, #1c1828));
}
.hubi-msg.assistant {
  align-self: flex-start;
  background: color-mix(in srgb, var(--hubi-indigo) 35%, var(--surface-soft, #1c1828));
}
.hubi-msg .hubi-who {
  display: block;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.2rem;
  font-weight: 600;
}
.hubi-typing {
  display: inline-flex;
  gap: 0.28rem;
  padding: 0.15rem 0;
}
.hubi-typing i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--hubi-green);
  animation: hubi-dot 1s ease-in-out infinite;
}
.hubi-typing i:nth-child(2) { animation-delay: 0.15s; }
.hubi-typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes hubi-dot {
  0%, 80%, 100% { opacity: 0.3; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-3px); }
}

.hubi-composer {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.6rem;
  margin-top: 0.85rem;
  align-items: end;
}
.hubi-composer textarea {
  width: 100%;
  resize: vertical;
  min-height: 3.2rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-soft, #1c1828);
  color: var(--fg);
  font: inherit;
  padding: 0.7rem 0.85rem;
}
.hubi-composer textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}
.hubi-send { cursor: pointer; min-height: 2.6rem; }
.hubi-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.75rem;
}
.hubi-chips .btn { cursor: pointer; }
.hubi-side { display: flex; flex-direction: column; gap: 0.85rem; }
.hubi-panel h2 {
  margin: 0 0 0.45rem;
  font-size: 0.95rem;
}
.hubi-legend {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  font-size: 0.85rem;
  color: var(--muted);
}
.hubi-legend li { display: flex; gap: 0.5rem; align-items: center; }

.origin-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.12rem 0.42rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--fg);
  white-space: nowrap;
}
.origin-badge.is-licensed { border-color: var(--hubi-green); color: var(--hubi-green); }
.origin-badge.is-human { border-color: var(--accent); color: var(--accent); }
.origin-badge.is-ai { border-color: #818cf8; color: #c7d2fe; background: color-mix(in srgb, #4338ca 35%, transparent); }
.origin-badge.is-cover { border-color: var(--muted); }
#player-origin { flex: 0 0 auto; }

/* Floating dock */
.hubi-dock {
  position: fixed;
  right: 1.1rem;
  bottom: 6.6rem;
  z-index: 40;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.55rem;
}
.hubi-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  cursor: pointer;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--hubi-indigo) 70%, #0f0f23);
  color: var(--fg);
  border-radius: 999px;
  padding: 0.45rem 0.8rem 0.45rem 0.45rem;
  box-shadow: 0 10px 28px color-mix(in srgb, #000 35%, transparent);
  font-weight: 600;
  font-size: 0.88rem;
  transition: transform 180ms ease, border-color 180ms ease;
}
.hubi-chip:hover { transform: translateY(-1px); border-color: var(--accent); }
.hubi-chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.hubi-chip svg { display: block; }
.hubi-float {
  width: min(380px, calc(100vw - 1.6rem));
  background: var(--surface, #14101f);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 0.75rem;
  box-shadow: 0 18px 50px color-mix(in srgb, #000 45%, transparent);
}
.hubi-float[hidden] { display: none !important; }
.hubi-float .hubi-log { min-height: 180px; max-height: 42vh; }
body.page-ai .hubi-dock { display: none; }

@media (max-width: 900px) {
  .hubi-workspace { grid-template-columns: 1fr; }
  .hubi-hero-inner { align-items: flex-start; }
}
@media (max-width: 640px) {
  .hubi-composer { grid-template-columns: 1fr; }
  .hubi-dock { right: 0.7rem; bottom: 7.2rem; }
}

@media (prefers-reduced-motion: reduce) {
  .hubi-chip, .hubi-typing i { animation: none; transition: none; }
  .hubi-orb { display: none; }
}

.dna-axes { display: grid; gap: 0.55rem; margin: 0.8rem 0 0.5rem; }
.dna-axis { display: grid; grid-template-columns: 4.5rem 1fr 2.4rem; gap: 0.5rem; align-items: center; font-size: 0.82rem; }
.dna-axis b { font-weight: 600; }
.dna-bar {
  height: 0.55rem;
  border-radius: 99px;
  background: color-mix(in srgb, var(--border) 70%, transparent);
  overflow: hidden;
}
.dna-bar i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #22c55e);
}
.dna-genres { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.dna-genres span {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.2rem 0.65rem;
  font-size: 0.78rem;
  color: var(--muted);
}
.hubi-dna-cta { margin: 0.65rem 0 0; }
