* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Open Sans", system-ui, sans-serif;
  height: 100vh;
  overflow: hidden;
  transition: background 0.6s ease;
  background: #f8f7f5;
  color: #1c1917;
}
body.theme-dungeon { background: linear-gradient(165deg, #1c1410 0%, #2a1f18 100%); color: #f0e6d8; }
body.theme-forest { background: linear-gradient(165deg, #152015 0%, #1e2a1e 100%); color: #e4f0e0; }
body.theme-ocean { background: linear-gradient(165deg, #0a3a52 0%, #0e7490 100%); color: #e0f7ff; }
body.theme-office { background: linear-gradient(165deg, #f1f5f9 0%, #e2e8f0 100%); color: #1e293b; }
body.theme-city { background: linear-gradient(165deg, #1e1b4b 0%, #3730a3 100%); color: #e0e7ff; }

#gate { display: flex; align-items: center; justify-content: center; height: 100vh; }
.gate-box {
  background: white;
  border-radius: 20px;
  padding: 48px 40px;
  width: 400px;
  text-align: center;
  box-shadow: 0 8px 32px rgba(0,0,0,0.08);
}
.gate-box h2 { font-family: "Crimson Pro", Georgia, serif; font-weight: 600; font-size: 2rem; margin: 0 0 8px; }
.gate-box p { color: #78716c; margin: 0 0 20px; font-size: 0.95rem; }
.gate-box input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid #e7e5e4;
  margin-bottom: 12px;
  font-size: 1rem;
}
.gate-box input:focus { outline: none; border-color: #a8a29e; }

button {
  background: #1c1917;
  color: white;
  border: none;
  padding: 9px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  transition: background 0.15s;
}
button:hover { background: #292524; }
button.secondary {
  background: transparent;
  color: #44403c;
  border: 1px solid #d6d3d1;
}
button.secondary:hover { background: #f5f5f4; }

#app { display: none; height: 100vh; }
#topbar {
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(12px);
  padding: 10px 18px;
  display: flex;
  gap: 10px;
  align-items: center;
  border-bottom: 1px solid #e7e5e4;
}
body[class*="theme-"] #topbar { background: rgba(0,0,0,0.4); border-bottom-color: rgba(255,255,255,0.1); }

.menu-wrap { position: relative; }
.dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  background: white;
  border-radius: 10px;
  min-width: 180px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  z-index: 100;
  overflow: hidden;
}
.dropdown button {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  color: #1c1917;
  border: none;
  padding: 10px 14px;
  border-radius: 0;
}
.dropdown button:hover { background: #f5f5f4; }

#workspace { display: flex; height: calc(100vh - 52px); }
#left {
  width: 380px;
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  border-right: 1px solid #e7e5e4;
}
body[class*="theme-"] #left { background: rgba(0,0,0,0.3); border-right-color: rgba(255,255,255,0.08); }
#graph { flex: 1; }
#right {
  width: 280px;
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(10px);
  padding: 16px;
  font-size: 0.82rem;
  border-left: 1px solid #e7e5e4;
  overflow-y: auto;
}
body[class*="theme-"] #right { background: rgba(0,0,0,0.3); border-left-color: rgba(255,255,255,0.08); }

#messages { flex: 1; overflow-y: auto; padding: 16px; }
.bubble {
  display: inline-block;
  max-width: 88%;
  padding: 10px 12px;
  border-radius: 12px;
  background: #f5f5f4;
  margin-bottom: 10px;
  line-height: 1.4;
}
body[class*="theme-"] .bubble { background: rgba(255,255,255,0.12); }

#input-row {
  display: flex;
  padding: 12px;
  gap: 8px;
  border-top: 1px solid #e7e5e4;
  background: rgba(255,255,255,0.6);
  align-items: center;
}
#user-input, #pov-select {
  padding: 10px 12px;
  border: 1px solid #e7e5e4;
  border-radius: 8px;
  font-size: 0.9rem;
  background: white;
}
#user-input { flex: 1; }
#user-input:focus, #pov-select:focus { outline: none; border-color: #a8a29e; }

.panel {
  background: #fafaf9;
  border: 1px solid #e7e5e4;
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 12px;
}
.panel strong { display: block; margin-bottom: 6px; color: #1c1917; }
body[class*="theme-"] .panel { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.1); }
body[class*="theme-"] .panel strong { color: inherit; }

#theme-label { margin-left: auto; font-size: 0.75rem; opacity: 0.7; }
