/**
 * HoPla Chat Theme — Journey, Conv, Spielwiese
 * Eine Akzentfarbe (--journey-accent) + Ableitungen (--hp-accent-live, --hp-chip-*).
 * Layout/Animation bleiben in global.css / journey.css.
 */

:root {
  --bubble-bot-bg: #F5F5F3;
  --bubble-bot-border: color-mix(in srgb, var(--journey-accent) calc(var(--hp-theme-bot-border-pct) * 1%), #EBEBE9);
  --bubble-user-bg: #FDFCFB;
  --bubble-user-border: #EFEFED;
  --bubble-user-fg: #212121;
  --hp-glass-edge: inset 0 1px 0 rgba(255, 255, 255, 0.7);
  --c-border: #ECEAE6;

  --hp-bg-top: #FFFFFF;
  --hp-bg-mid: #FDFCFB;
  --hp-bg-base: #FAFAFA;

  --hp-accent-live: var(--journey-accent);
  --hp-chip-ink: var(--hp-accent-live);
  --hp-chip-fill: var(--journey-accent);

  --hp-theme-widget-border-pct: 54;
  --hp-theme-bot-border-pct: 24;
  --hp-theme-bg-cloud-top: 14;
  --hp-theme-bg-cloud-br: 4;
  --hp-theme-bg-cloud-bl: 3;
  --hp-theme-logo-opacity: 0.08;
  --hp-theme-chip-border-px: 1.5;

  --hp-widget-border: color-mix(in srgb, var(--hp-accent-live) calc(var(--hp-theme-widget-border-pct) * 1%), #E8E8E6);
  --hp-widget-bg: rgba(255, 255, 255, 0.58);
  --hp-track: #EBEBEB;
  --hp-thumb-fill: var(--hp-accent-live);
  --hp-thumb-ring: var(--hp-accent-live);
}

/* Kein Pinch-/Doppel-Tap-Zoom im Chat (ergänzt viewport maximum-scale=1) */
html {
  touch-action: manipulation;
}

/* —— Raum —— */
body {
  background-color: var(--hp-bg-base);
  background-image:
    radial-gradient(ellipse 110% 75% at 50% -18%, color-mix(in srgb, var(--journey-accent) calc(var(--hp-theme-bg-cloud-top) * 1%), #FFFFFF) 0%, transparent 62%),
    radial-gradient(ellipse 65% 50% at 92% 90%, color-mix(in srgb, var(--journey-accent) calc(var(--hp-theme-bg-cloud-br) * 1%), #FFFFFF) 0%, transparent 48%),
    radial-gradient(ellipse 50% 40% at 8% 78%, color-mix(in srgb, var(--journey-accent) calc(var(--hp-theme-bg-cloud-bl) * 1%), #FFFFFF) 0%, transparent 44%),
    linear-gradient(175deg, var(--hp-bg-top) 0%, var(--hp-bg-mid) 45%, var(--hp-bg-base) 100%);
  background-attachment: fixed;
}

main.journey,
#messages {
  background: transparent !important;
}

.logo-background {
  opacity: var(--hp-theme-logo-opacity) !important;
}

/* Layout (position:fixed, Höhen) bleibt in global.css — nur Look */
header {
  background: linear-gradient(180deg, #FAFAF8 0%, #F4F4F2 100%) !important;
  border-bottom: 1px solid #E6E6E4 !important;
  overflow: visible;
}

footer {
  height: calc(var(--foot-h) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: color-mix(in srgb, var(--hp-bg-top) 92%, #FFFFFF);
  border-top: 1px solid #EBEBE9;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  color: var(--c-muted);
  z-index: 30;
}

@keyframes hp-cta-pulse {
  0% {
    transform: scale(1);
    box-shadow: 0 4px 10px color-mix(in srgb, var(--journey-accent) 25%, transparent);
  }
  50% {
    transform: scale(1.08);
    box-shadow: 0 8px 22px color-mix(in srgb, var(--journey-accent) 45%, transparent);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 4px 10px color-mix(in srgb, var(--journey-accent) 25%, transparent);
  }
}

.input-bar button.cta-pulse {
  animation: hp-cta-pulse 2s ease-in-out infinite;
}

.input-bar button:not(.menu-btn):hover:not(:disabled),
.input-bar button:not(.menu-btn):active:not(:disabled),
.input-bar button:not(.menu-btn):focus:not(:disabled) {
  box-shadow:
    0 8px 22px color-mix(in srgb, var(--journey-accent) 45%, transparent),
    0 2px 8px color-mix(in srgb, var(--journey-accent) 25%, transparent);
}

@keyframes hp-header-glow-pulse {
  0%, 100% {
    box-shadow:
      0 0 4px 0 color-mix(in srgb, var(--journey-accent) 25%, transparent),
      0 4px 10px 0 color-mix(in srgb, var(--journey-accent) 25%, transparent);
  }
  50% {
    box-shadow:
      0 0 8px 0 color-mix(in srgb, var(--journey-accent) 45%, transparent),
      0 8px 22px 0 color-mix(in srgb, var(--journey-accent) 45%, transparent);
  }
}

header::after {
  content: "";
  position: absolute;
  left: 10%;
  right: 10%;
  bottom: 0;
  height: 1px;
  pointer-events: none;
  background: linear-gradient(
    90deg,
    transparent 0%,
    color-mix(in srgb, var(--journey-accent) 72%, transparent) 30%,
    color-mix(in srgb, var(--journey-accent) 92%, transparent) 50%,
    color-mix(in srgb, var(--journey-accent) 72%, transparent) 70%,
    transparent 100%
  );
  animation: hp-header-glow-pulse 2s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  header::after,
  .input-bar button.cta-pulse {
    animation: none;
  }
}

.input-bar {
  background: color-mix(in srgb, var(--hp-bg-top) 92%, #FFFFFF) !important;
  border-top: 1px solid #EBEBE9 !important;
}

/* —— Bubbles (Milchglas) —— */
.msg.bot .bubble.bot,
.bubble.bot {
  background: rgba(246, 246, 244, 0.68) !important;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--bubble-bot-border) !important;
  border-top-left-radius: 6px !important;
  box-shadow: var(--hp-glass-edge) !important;
}

.msg.user .bubble.user,
.bubble.user {
  background: rgba(253, 252, 251, 0.64) !important;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--bubble-user-border) !important;
  border-top-right-radius: 6px !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82) !important;
  color: var(--bubble-user-fg) !important;
}

.msg.bot + .msg-choices {
  margin-top: 8px !important;
}

/* —— Chips —— */
.language-dialog-chips button,
.journey .choices .chip,
.choices .chip,
.conv-free-text-actions .chip {
  background: #FFFFFF !important;
  border: calc(var(--hp-theme-chip-border-px) * 1px) solid var(--hp-chip-ink) !important;
  color: var(--hp-chip-ink) !important;
  font-weight: 700 !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

.language-dialog-chips button:hover,
.journey .choices .chip:hover {
  background: var(--hp-chip-fill) !important;
  border-color: var(--hp-chip-ink) !important;
  color: #FFFFFF !important;
  transform: translateY(-1px);
  box-shadow: none !important;
}

.journey .choices .chip.selected,
.journey .choices .chip:active {
  background: var(--hp-chip-fill) !important;
  border-color: var(--hp-chip-ink) !important;
  color: #FFFFFF !important;
}

.journey .chip--primary {
  background: var(--hp-chip-fill) !important;
  border-color: var(--hp-chip-ink) !important;
  color: #FFFFFF !important;
}

.journey .chip--secondary {
  background: #FFFFFF !important;
  border-color: var(--hp-chip-ink) !important;
  color: var(--hp-chip-ink) !important;
  box-shadow: none !important;
}

.journey .chip--secondary:hover {
  background: var(--hp-chip-fill) !important;
  border-color: var(--hp-chip-ink) !important;
  color: #FFFFFF !important;
}

/* —— Widget-Karten —— */
.journey .slider-wrap,
.journey .slider-wrap.scale-only,
.journey .slider-wrap.scale-thin,
.journey .slider-wrap.scale-rich,
.journey .slider-wrap.confirm-slider,
.journey .scale-thin,
.confirm-slider,
.journey .time-picker-wrap,
.consent,
.conv-free-text-box {
  background: var(--hp-widget-bg) !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
  border: 1.5px solid var(--hp-widget-border) !important;
  border-radius: 14px !important;
  box-shadow: var(--hp-glass-edge) !important;
}

.journey .slider {
  background: var(--hp-track) !important;
  height: 6px !important;
}

.journey .slider::-webkit-slider-thumb {
  -webkit-appearance: none !important;
  appearance: none !important;
  width: 24px !important;
  height: 24px !important;
  border-radius: 50% !important;
  background: var(--hp-thumb-fill) !important;
  border: none !important;
  box-shadow:
    0 1px 3px color-mix(in srgb, var(--hp-thumb-ring) 35%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.22) !important;
  cursor: pointer;
}

.journey .slider::-moz-range-thumb {
  width: 24px !important;
  height: 24px !important;
  border-radius: 50% !important;
  background: var(--hp-thumb-fill) !important;
  border: none !important;
  box-shadow:
    0 1px 3px color-mix(in srgb, var(--hp-thumb-ring) 35%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.22) !important;
  cursor: pointer;
}

.journey .scale-ticks {
  opacity: 0.88 !important;
  color: #212121 !important;
  font-weight: 600;
}

.journey .scale-legend,
.journey .scale-caption {
  opacity: 0.78 !important;
  color: #212121 !important;
}

.journey .time-display,
.journey .time-separator {
  color: var(--hp-accent-live) !important;
  font-weight: 600;
}

.journey .time-input {
  border-color: var(--hp-widget-border) !important;
}

.journey .time-input:focus {
  border-color: var(--hp-thumb-ring) !important;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--hp-accent-live) 10%, transparent);
}

.journey .consent-actions .btn {
  border-color: var(--hp-chip-ink) !important;
  color: var(--hp-chip-ink) !important;
  background: #fff !important;
}

.journey .consent-actions .btn.primary {
  background: var(--hp-chip-fill) !important;
  border-color: var(--hp-chip-ink) !important;
  color: #fff !important;
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .msg.bot .bubble.bot,
  .bubble.bot {
    background: var(--bubble-bot-bg) !important;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .msg.user .bubble.user,
  .bubble.user {
    background: var(--bubble-user-bg) !important;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}
