:root {
  --glass: rgba(20, 20, 25, 0.55);
  --glass-strong: rgba(20, 20, 25, 0.72);
  --text: rgba(255, 255, 255, 0.92);
  --muted: rgba(255, 255, 255, 0.72);
  --border: rgba(255, 255, 255, 0.14);
}

* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--text);

  /* background visible behind everything (including modals) */
  background-image: url("/assets/background.jpg");
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(0,0,0,0.22);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.brand-title { font-weight: 800; letter-spacing: 0.2px; }
.brand-subtitle { font-size: 12px; color: var(--muted); margin-top: 2px; }

.topbar-actions { display: flex; gap: 8px; }

.main {
  height: calc(100% - 140px);
  padding: 16px;
  overflow: hidden;
}

.stage {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card {
  width: min(900px, 100%);
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0,0,0,0.35);
  backdrop-filter: blur(14px);
}

#greetingVideo {
  width: 100%;
  height: auto;
  display: block;
  background: rgba(0,0,0,0.35);
}

.caption-wrap {
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  background: rgba(0,0,0,0.18);
}

.caption-label {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}

.caption {
  min-height: 44px;
  color: var(--text);
  line-height: 1.35;
  white-space: pre-wrap;
}

.chat-window {
  width: min(900px, 100%);
  height: 100%;
  padding: 12px;
  overflow-y: auto;
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 16px;
  backdrop-filter: blur(14px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.35);
}

.msg {
  max-width: 82%;
  padding: 10px 12px;
  border-radius: 14px;
  margin: 10px 0;
  border: 1px solid var(--border);
  background: rgba(0,0,0,0.24);
  line-height: 1.35;
  white-space: pre-wrap;
}

.msg.user {
  margin-left: auto;
  background: rgba(20, 40, 80, 0.35);
}

.msg.assistant {
  margin-right: auto;
  background: rgba(0, 0, 0, 0.30);
}

.msg.meta {
  margin: 10px auto;
  max-width: 100%;
  text-align: center;
  color: var(--muted);
  background: rgba(0,0,0,0.18);
}

.composer {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  padding: 10px 12px;
  background: rgba(0,0,0,0.22);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--border);
}

.composer-inner {
  width: min(900px, 100%);
  margin: 0 auto;
  display: flex;
  gap: 10px;
  align-items: flex-end;
  background: var(--glass-strong);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 10px;
  backdrop-filter: blur(14px);
}

#userInput {
  flex: 1;
  resize: none;
  border: none;
  outline: none;
  padding: 10px 10px;
  border-radius: 12px;
  background: rgba(255,255,255,0.10);
  color: var(--text);
  font-size: 15px;
  min-height: 42px;
}

.status-line {
  width: min(900px, 100%);
  margin: 8px auto 0;
  color: var(--muted);
  font-size: 12px;
}

button, a.btn-primary, a.btn-secondary {
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 10px 12px;
  cursor: pointer;
  text-decoration: none;
  color: var(--text);
  background: rgba(255,255,255,0.10);
}

.btn-primary {
  background: rgba(255,255,255,0.18);
  font-weight: 750;
}

.btn-secondary {
  background: rgba(255,255,255,0.10);
}

.btn-ghost { background: transparent; }
.muted { color: var(--muted); }
.hidden { display: none !important; }

/* Modal overlay translucent so background image is visible behind it */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.40);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  z-index: 9999;
}

.modal {
  width: min(560px, 100%);
  background: rgba(10,10,12,0.78);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
  backdrop-filter: blur(16px);
  box-shadow: 0 16px 50px rgba(0,0,0,0.45);
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  justify-content: flex-end;
}

/* Greeting exit transitions */
.transition-slide-up { animation: slideUp 650ms ease forwards; }
@keyframes slideUp { to { transform: translateY(-120%); opacity: 0; } }

.transition-fade { animation: fadeOut 450ms ease forwards; }
@keyframes fadeOut { to { opacity: 0; } }

.transition-zoom { animation: zoomOut 550ms ease forwards; }
@keyframes zoomOut { to { transform: scale(0.92); opacity: 0; } }
