*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --sky-a: #02020e;
  --sky-b: #080818;
  --sky-c: #0f0820;
  --ground: #0a0608;
  --fire-core: #fff3c0;
  --fire-mid: #ff8c00;
  --fire-out: #cc3300;
  --ember: #ff6b35;
  --text: #f0e8d8;
  --text-soft: rgba(240,232,216,0.5);
  --log-bg: rgba(20,12,6,0.92);
  --log-border: rgba(180,120,60,0.3);
  --transition: 3s;
}

html, body {
  height: 100%; width: 100%;
  overflow: hidden;
  background: #02020e;
}

body {
  font-family: 'Lora', serif;
  color: var(--text);
  position: relative;
}

/* ─── MOUNTAINS ─── */
#mountains {
  position: fixed;
  bottom: 37vh;
  left: 0; right: 0;
  height: 25vh;
  z-index: 3;
  pointer-events: none;
}
.mountain-peak {
  position: absolute;
  bottom: 0;
  fill: #06040a;
  opacity: 0.8;
}

/* ─── TENT ─── */
#tent {
  position: absolute;
  bottom: 35vh;
  right: 15%;
  width: 140px;
  height: 110px;
  z-index: 4;
  filter: drop-shadow(0 0 10px rgba(255,100,20,0.1));
}
#tent svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* ─── SHOOTING STARS ─── */
.meteor {
  position: absolute;
  width: 120px;
  height: 2px;
  background: linear-gradient(90deg, rgba(255,255,255,1), transparent);
  border-radius: 50%;
  transform: rotate(-45deg);
  animation: meteor-dash 1.2s ease-in forwards;
  pointer-events: none;
  z-index: 1;
}
@keyframes meteor-dash {
  0% { transform: translate(0, 0) rotate(-45deg); opacity: 1; }
  100% { transform: translate(-400px, 400px) rotate(-45deg); opacity: 0; }
}

/* ─── DRAGGABLE CHAT HEADER ─── */
.logbook-header {
  cursor: grab;
}
.logbook-header:active {
  cursor: grabbing;
}

/* ─── FULLSCREEN FLOATING CHAT ─── */
#logbook-panel.fullscreen {
  /* Only handle sizes and aesthetics here, JS will handle centering */
  width: 80vw !important;
  max-width: 1200px !important;
  height: 80vh !important;
  max-height: 80vh !important;
  
  /* The transparent floating glass effect */
  background: rgba(5, 2, 1, 0.15) !important;
  backdrop-filter: blur(4px) !important;
  border: 1px solid rgba(255, 150, 50, 0.1) !important;
  box-shadow: 0 0 50px rgba(0,0,0,0.8);
}

/* ═══════════════════════════════════════════
   SKY
═══════════════════════════════════════════ */
#sky {
  position: fixed; inset: 0;
  background: radial-gradient(ellipse at 50% 0%, var(--sky-b) 0%, var(--sky-a) 60%);
  transition: background var(--transition) ease;
  z-index: 0;
}

/* ─── YOUTUBE DRAG HANDLE & CONTAINER ─── */
#yt-container {
  position: fixed;
  top: 20px;
  left: 20px;
  width: 200px;
  background: #000;
  z-index: 50;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,0.8);
  transition: transform 0.4s cubic-bezier(0.34,1.56,0.64,1);
  pointer-events: all;
}

#yt-drag-handle {
  width: 100%;
  height: 24px;
  background: rgba(40, 20, 10, 0.9);
  color: rgba(255, 180, 80, 0.8);
  font-size: 0.65rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  border-bottom: 1px solid rgba(255, 120, 30, 0.3);
  font-family: sans-serif;
  text-transform: uppercase;
  letter-spacing: 1px;
}
#yt-drag-handle:active {
  cursor: grabbing;
}

.yt-hidden {
  transform: translateY(-200vh);
  pointer-events: none;
}

/* ─── ADD BY LINK ROW ─── */
.yt-search-row {
  display: flex;
  gap: 8px;
  margin-top: 4px;
  margin-bottom: 8px;
}

.yt-search-row input {
  flex: 1;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  padding: 6px 10px;
  color: var(--text);
  font-family: 'Lora', serif;
  font-size: 0.75rem;
  outline: none;
}
.yt-search-row input:focus {
  border-color: rgba(255,160,60,0.4);
}

.yt-search-row button {
  background: rgba(255,120,30,0.2);
  border: 1px solid rgba(255,120,30,0.4);
  color: rgba(255,200,100,0.9);
  border-radius: 12px;
  padding: 0 12px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
}
.yt-search-row button:hover {
  background: rgba(255,120,30,0.35);
}

/* Stars */
#stars {
  position: fixed; inset: 0; z-index: 1;
  pointer-events: none;
  transition: opacity var(--transition) ease;
}

.star {
  position: absolute;
  border-radius: 50%;
  background: white;
  animation: twinkle var(--d, 3s) ease-in-out infinite;
  animation-delay: var(--dl, 0s);
}
@keyframes twinkle {
  0%,100% { opacity: var(--o, 0.7); }
  50%      { opacity: 0.15; }
}

/* Milky Way band */
#milkyway {
  position: fixed;
  top: -5%; left: -10%;
  width: 120%; height: 55%;
  background: radial-gradient(ellipse 70% 30% at 55% 50%,
    rgba(180,160,220,0.06) 0%,
    rgba(120,100,180,0.03) 40%,
    transparent 70%);
  transform: rotate(-25deg);
  z-index: 1;
  pointer-events: none;
  transition: opacity var(--transition) ease;
}

/* Moon / Sun */
#celestial {
  position: fixed;
  z-index: 2;
  pointer-events: none;
  transition: all var(--transition) ease;
  top: 8%; right: 14%;
}

#moon-body {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 38%, #fffce0, #d8d0a8);
  box-shadow: 0 0 30px 8px rgba(255,240,180,0.18), 0 0 70px 20px rgba(200,180,100,0.08);
  transition: opacity var(--transition) ease;
}

#sun-body {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 40%, #fff9e0, #ffcc44);
  box-shadow: 0 0 60px 20px rgba(255,200,60,0.5), 0 0 120px 50px rgba(255,160,20,0.2);
  opacity: 0;
  transition: opacity var(--transition) ease;
  position: absolute; top: 0; left: 0;
}

/* Clouds */
#clouds {
  position: fixed; inset: 0; z-index: 2;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--transition) ease;
  overflow: hidden;
}

.cloud {
  position: absolute;
  border-radius: 100px;
  background: rgba(255,255,255,0.65);
  filter: blur(3px);
  animation: clouddrift linear infinite;
}
.cloud::before, .cloud::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  background: inherit;
}
@keyframes clouddrift {
  from { transform: translateX(-300px); }
  to   { transform: translateX(110vw); }
}

/* Horizon glow from fire */
#horizon {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 42vh;
  background: radial-gradient(ellipse 80% 100% at 50% 100%,
    rgba(180,60,10,0.35) 0%,
    rgba(120,30,0,0.15) 40%,
    transparent 70%);
  z-index: 3;
  pointer-events: none;
  transition: background var(--transition) ease;
}

/* ═══════════════════════════════════════════
   GROUND / FIELD
═══════════════════════════════════════════ */
#scene {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 4;
  pointer-events: none;
}

.ground {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 38vh;
  background: radial-gradient(ellipse 120% 60% at 50% 100%,
    #110804 0%, #080408 50%, #03020a 100%);
  border-radius: 60% 60% 0 0 / 20% 20% 0 0;
}

.grass-line {
  position: absolute;
  bottom: 37vh;
  left: 0; right: 0;
  height: 6vh;
  background: radial-gradient(ellipse 100% 50% at 50% 100%,
    #0c1008 0%, transparent 70%);
}

.tree {
  position: absolute;
  bottom: 36vh;
}
.tree svg { display: block; }

/* ═══════════════════════════════════════════
   CAMPFIRE
═══════════════════════════════════════════ */
#campfire-wrap {
  position: fixed;
  bottom: 18vh;
  left: 50%; transform: translateX(-50%);
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.logs {
  position: relative;
  width: 90px; height: 22px;
  margin-bottom: -4px;
}
.log {
  position: absolute;
  border-radius: 10px;
  background: linear-gradient(135deg, #3d1a0a, #5c2810, #2a0e04);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.5);
}
.log-1 { width: 80px; height: 14px; bottom: 0; left: 5px; transform: rotate(-8deg); }
.log-2 { width: 80px; height: 14px; bottom: 0; left: 5px; transform: rotate(8deg); }

#fire-svg {
  width: 80px;
  filter: drop-shadow(0 0 18px rgba(255,120,20,0.7)) drop-shadow(0 0 40px rgba(255,60,0,0.4));
  animation: fire-sway 0.15s ease-in-out infinite alternate;
}
@keyframes fire-sway {
  from { transform: scaleX(1) skewX(0deg); }
  to   { transform: scaleX(0.97) skewX(1.5deg); }
}

#flame-1 { animation: flicker1 0.12s ease-in-out infinite alternate; transform-origin: bottom center; }
#flame-2 { animation: flicker2 0.17s ease-in-out infinite alternate; transform-origin: bottom center; }
#flame-3 { animation: flicker3 0.10s ease-in-out infinite alternate; transform-origin: bottom center; }
#flame-4 { animation: flicker4 0.14s ease-in-out infinite alternate; transform-origin: bottom center; }

@keyframes flicker1 { from { transform: scaleY(1) scaleX(1); } to { transform: scaleY(0.88) scaleX(1.05); } }
@keyframes flicker2 { from { transform: scaleY(0.92) scaleX(0.98); } to { transform: scaleY(1.06) scaleX(1.03); } }
@keyframes flicker3 { from { transform: scaleY(1.02) scaleX(1); } to { transform: scaleY(0.85) scaleX(0.96); } }
@keyframes flicker4 { from { transform: scaleY(0.9) scaleX(1.04); } to { transform: scaleY(1.08) scaleX(0.98); } }

.fire-glow {
  position: absolute;
  width: 180px; height: 40px;
  background: radial-gradient(ellipse, rgba(255,100,20,0.4) 0%, transparent 70%);
  bottom: -12px; left: 50%; transform: translateX(-50%);
  animation: glow-pulse 0.8s ease-in-out infinite alternate;
  border-radius: 50%;
}
@keyframes glow-pulse {
  from { opacity: 0.6; transform: translateX(-50%) scaleX(1); }
  to   { opacity: 1;   transform: translateX(-50%) scaleX(1.08); }
}

/* Embers / sparks */
#embers {
  position: fixed;
  bottom: 18vh; left: 50%; transform: translateX(-50%);
  width: 200px; height: 300px;
  pointer-events: none;
  z-index: 6;
  overflow: visible;
}
.ember {
  position: absolute;
  border-radius: 50%;
  animation: rise linear infinite;
  bottom: 20px;
}
@keyframes rise {
  0%   { transform: translateX(0) translateY(0) scale(1); opacity: 0.9; }
  70%  { opacity: 0.6; }
  100% { transform: translateX(var(--dx, 20px)) translateY(-280px) scale(0.2); opacity: 0; }
}

/* Fireflies */
.firefly {
  position: fixed;
  width: 3px; height: 3px;
  border-radius: 50%;
  background: #aaff88;
  box-shadow: 0 0 6px 2px rgba(150,255,100,0.6);
  z-index: 4;
  animation: fly-around var(--t, 12s) ease-in-out infinite, blink var(--bt, 2s) ease-in-out infinite;
}
@keyframes fly-around {
  0%   { transform: translate(0,0); }
  25%  { transform: translate(var(--x1), var(--y1)); }
  50%  { transform: translate(var(--x2), var(--y2)); }
  75%  { transform: translate(var(--x3), var(--y3)); }
  100% { transform: translate(0,0); }
}
@keyframes blink {
  0%,100% { opacity: 0.9; }
  40%,60%  { opacity: 0.05; }
}

/* ═══════════════════════════════════════════
   UI OVERLAY
═══════════════════════════════════════════ */
#ui {
  position: fixed; inset: 0; z-index: 10;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

#topbar {
  pointer-events: all;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 12px;
}

.logo {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.5rem;
  font-weight: 300;
  font-style: italic;
  color: rgba(240,220,180,0.85);
  letter-spacing: 0.06em;
  text-shadow: 0 0 20px rgba(255,120,20,0.4);
}
.logo em { color: #e08040; font-style: normal; }

.online-badge {
  font-size: 0.68rem;
  padding: 4px 10px;
  border-radius: 20px;
  background: rgba(255,120,20,0.12);
  border: 1px solid rgba(255,120,20,0.25);
  color: rgba(255,180,80,0.8);
  display: flex; align-items: center; gap: 5px;
  font-family: 'Lora', serif;
}

.fire-dot {
  font-size: 0.7rem;
  animation: glow-pulse 1.2s ease-in-out infinite alternate;
}

/* ─── Sky switcher ─── */
#sky-switcher {
  pointer-events: all;
  position: fixed;
  top: 62px; right: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 11;
}

.sky-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(10px);
  cursor: pointer;
  font-size: 1.1rem;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.3s;
  color: white;
}
.sky-btn:hover, .sky-btn.active {
  border-color: rgba(255,160,60,0.6);
  background: rgba(255,100,20,0.2);
  transform: scale(1.08);
}
.sky-btn-label {
  position: absolute;
  right: 44px;
  white-space: nowrap;
  font-size: 0.65rem;
  color: var(--text-soft);
  background: rgba(0,0,0,0.6);
  padding: 2px 7px;
  border-radius: 4px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  font-family: 'Lora', serif;
}
.sky-btn:hover .sky-btn-label { opacity: 1; }

/* ─── Music player ─── */
#music-player {
  pointer-events: all;
  position: fixed;
  bottom: 20px; left: 16px;
  z-index: 11;
  width: min(300px, calc(100vw - 100px));
}

.music-collapsed {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(10,5,2,0.75);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(180,100,30,0.25);
  border-radius: 30px;
  cursor: pointer;
  transition: all 0.3s;
}
.music-collapsed:hover {
  border-color: rgba(180,100,30,0.5);
  background: rgba(15,8,3,0.85);
}

.music-icon { font-size: 1rem; animation: spin-slow 4s linear infinite; animation-play-state: paused; }
.music-icon.playing { animation-play-state: running; }
@keyframes spin-slow { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

.music-info { flex: 1; overflow: hidden; }
.music-title { font-size: 0.78rem; color: rgba(240,220,180,0.9); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.music-artist { font-size: 0.62rem; color: var(--text-soft); }

.music-play-btn {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: rgba(255,120,30,0.25);
  border: 1px solid rgba(255,120,30,0.4);
  color: rgba(255,180,80,0.9);
  font-size: 0.75rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
  pointer-events: all;
}
.music-play-btn:hover { background: rgba(255,120,30,0.4); }

.music-expanded {
  display: none;
  flex-direction: column;
  background: rgba(10,5,2,0.88);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(180,100,30,0.25);
  border-radius: 20px;
  padding: 16px;
  margin-bottom: 10px;
  gap: 12px;
}
.music-expanded.open { display: flex; }

.music-header-row { display: flex; align-items: center; justify-content: space-between; }
.music-close-btn { background: none; border: none; color: var(--text-soft); cursor: pointer; font-size: 1rem; padding: 2px; }

.track-display { text-align: center; }
.track-name { font-family: 'Cormorant Garamond', serif; font-size: 1.1rem; font-weight: 300; font-style: italic; color: rgba(240,220,180,0.9); }
.track-artist { font-size: 0.7rem; color: var(--text-soft); margin-top: 2px; }

.prog-bar {
  height: 2px; background: rgba(255,255,255,0.1);
  border-radius: 2px; cursor: pointer; position: relative;
}
.prog-fill {
  height: 100%; background: linear-gradient(90deg, #e08040, #ffcc44);
  border-radius: 2px; width: 0%; transition: width 0.5s linear;
}
.time-row {
  display: flex; justify-content: space-between;
  font-size: 0.6rem; color: var(--text-soft); margin-top: 2px;
}

.music-controls { display: flex; align-items: center; justify-content: center; gap: 18px; }
.m-ctrl { background: none; border: none; color: var(--text-soft); font-size: 1rem; cursor: pointer; padding: 4px; transition: color 0.2s; }
.m-ctrl:hover { color: var(--text); }
.m-play {
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(255,120,30,0.2);
  border: 1px solid rgba(255,120,30,0.45);
  color: rgba(255,200,100,0.95);
  font-size: 1.1rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.m-play:hover { background: rgba(255,120,30,0.35); transform: scale(1.05); }

.vol-row { display: flex; align-items: center; gap: 8px; font-size: 0.8rem; }
.vol-slider {
  flex: 1; -webkit-appearance: none; height: 2px;
  border-radius: 2px; background: rgba(255,255,255,0.15); outline: none; cursor: pointer;
}
.vol-slider::-webkit-slider-thumb {
  -webkit-appearance: none; width: 10px; height: 10px;
  border-radius: 50%; background: rgba(255,180,80,0.9); cursor: pointer;
}

.playlist-list { display: flex; flex-direction: column; gap: 4px; max-height: 140px; overflow-y: auto; }
.playlist-list::-webkit-scrollbar { width: 2px; }
.playlist-list::-webkit-scrollbar-thumb { background: rgba(255,120,30,0.3); }

.pl-item {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px; border-radius: 10px;
  cursor: pointer; transition: all 0.2s;
}
.pl-item:hover, .pl-item.active { background: rgba(255,120,30,0.12); }
.pl-item.active .pl-nm { color: #e08040; }
.pl-em { font-size: 0.9rem; }
.pl-info { flex: 1; overflow: hidden; }
.pl-nm { font-size: 0.78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-ar { font-size: 0.62rem; color: var(--text-soft); }
.pl-dur { font-size: 0.62rem; color: var(--text-soft); }

.ambient-row { display: flex; flex-wrap: wrap; gap: 5px; }
.amb-chip {
  padding: 4px 10px; border-radius: 15px;
  border: 1px solid rgba(255,255,255,0.1);
  font-size: 0.65rem; cursor: pointer; transition: all 0.2s;
  color: var(--text-soft); background: rgba(0,0,0,0.3);
}
.amb-chip:hover, .amb-chip.on { border-color: rgba(255,160,60,0.5); color: rgba(255,180,80,0.9); background: rgba(255,100,20,0.1); }

/* ─── LOGBOOK CHAT ─── */
#logbook-btn {
  pointer-events: all;
  position: fixed;
  bottom: 20px; right: 16px;
  z-index: 11;
  width: 54px; height: 54px;
  border-radius: 50%;
  background: rgba(10,5,2,0.75);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(180,100,30,0.3);
  cursor: pointer;
  font-size: 1.4rem;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.3s;
  box-shadow: 0 0 20px rgba(0,0,0,0.5);
}
#logbook-btn:hover { border-color: rgba(255,150,50,0.6); transform: scale(1.06); }

.logbook-notif {
  position: absolute;
  top: -3px; right: -3px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: #e05020;
  font-size: 0.55rem;
  display: none;
  align-items: center; justify-content: center;
  color: white;
  font-family: sans-serif;
}
.logbook-notif.show { display: flex; }

#logbook-panel {
  pointer-events: all;
  position: fixed;
  bottom: 84px; right: 16px;
  width: min(340px, calc(100vw - 32px));
  max-height: min(520px, calc(100dvh - 110px));
  z-index: 12;
  display: flex;
  flex-direction: column;
  background: var(--log-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--log-border);
  border-radius: 20px;
  overflow: hidden;
  transform: scale(0.9) translateY(20px);
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.34,1.56,0.64,1);
  transform-origin: bottom right;
}
#logbook-panel.open {
  transform: scale(1) translateY(0);
  opacity: 1;
  pointer-events: all;
}

#logbook-panel.fullscreen {
  bottom: 10vh !important;
  right: 10vw !important;
  width: 80vw !important;
  max-width: 1200px !important;
  height: 80vh !important;
  max-height: 80vh !important;
  background: rgba(5, 2, 1, 0.15) !important;
  backdrop-filter: blur(4px) !important;
  border: 1px solid rgba(255, 150, 50, 0.1) !important;
  box-shadow: 0 0 50px rgba(0,0,0,0.8);
}

#logbook-panel.fullscreen .chat-ta { background: rgba(0, 0, 0, 0.4); }
#logbook-panel.fullscreen .msg-text { background: rgba(0, 0, 0, 0.25); backdrop-filter: blur(2px); }
#logbook-panel.fullscreen .chat-msg.own .msg-text { background: rgba(255, 120, 30, 0.1); }

.logbook-header {
  padding: 14px 16px 10px;
  border-bottom: 1px solid rgba(180,100,30,0.15);
  display: flex; align-items: center; justify-content: space-between;
  flex-shrink: 0;
}
.logbook-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1rem; font-weight: 400; font-style: italic;
  color: rgba(240,200,140,0.9);
  display: flex; align-items: center; gap: 6px;
}
.logbook-close {
  background: none; border: none;
  color: var(--text-soft); cursor: pointer; font-size: 1rem;
  padding: 2px; transition: color 0.2s;
}
.logbook-close:hover { color: var(--text); }

.chat-prompts {
  display: flex; gap: 6px;
  overflow-x: auto; padding: 8px 12px 6px;
  scrollbar-width: none; flex-shrink: 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.chat-prompts::-webkit-scrollbar { display: none; }

.prompt-pill {
  white-space: nowrap; padding: 4px 10px;
  border-radius: 15px; border: 1px solid rgba(255,255,255,0.1);
  font-size: 0.63rem; cursor: pointer;
  color: var(--text-soft); background: rgba(255,255,255,0.03);
  transition: all 0.2s; flex-shrink: 0;
  font-family: 'Lora', serif;
}
.prompt-pill:hover { border-color: rgba(255,160,60,0.4); color: rgba(255,180,80,0.8); }

.chat-msgs {
  flex: 1; overflow-y: auto;
  padding: 12px 14px;
  display: flex; flex-direction: column; gap: 10px;
  scroll-behavior: smooth;
}
.chat-msgs::-webkit-scrollbar { width: 2px; }
.chat-msgs::-webkit-scrollbar-thumb { background: rgba(180,100,30,0.2); }

.chat-msg { display: flex; gap: 9px; align-items: flex-start; animation: msgIn 0.35s ease; }
@keyframes msgIn { from { opacity:0; transform: translateY(8px); } to { opacity:1; transform:none; } }

.chat-msg.own { flex-direction: row-reverse; }

.msg-av {
  width: 28px; height: 28px; border-radius: 50%;
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem; flex-shrink: 0;
}
.msg-body { max-width: 80%; }
.msg-sender { font-size: 0.6rem; color: var(--text-soft); margin-bottom: 2px; font-style: italic; }
.chat-msg.own .msg-sender { text-align: right; }

.msg-text {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px; padding: 8px 12px;
  font-size: 0.82rem; line-height: 1.55;
  color: rgba(240,228,208,0.9); word-break: break-word;
}
.chat-msg.own .msg-text {
  background: rgba(255,120,30,0.15);
  border-color: rgba(255,120,30,0.25);
}

.sys-msg {
  text-align: center; font-size: 0.62rem;
  color: rgba(240,200,140,0.35);
  font-style: italic; padding: 2px 0;
  font-family: 'Cormorant Garamond', serif;
}

.chat-input-row {
  padding: 10px 12px;
  border-top: 1px solid rgba(180,100,30,0.15);
  display: flex; gap: 8px; align-items: flex-end;
  flex-shrink: 0;
}
.chat-ta {
  flex: 1; background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 16px; padding: 8px 12px;
  color: var(--text); font-family: 'Lora', serif;
  font-size: 0.82rem; outline: none; resize: none;
  max-height: 80px; line-height: 1.4;
  transition: border-color 0.2s;
}
.chat-ta::placeholder { color: var(--text-soft); }
.chat-ta:focus { border-color: rgba(255,160,60,0.35); }

.chat-send {
  width: 34px; height: 34px; border-radius: 50%;
  background: rgba(255,120,30,0.2);
  border: 1px solid rgba(255,120,30,0.35);
  color: rgba(255,200,80,0.9);
  font-size: 0.85rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s; flex-shrink: 0;
}
.chat-send:hover { background: rgba(255,120,30,0.35); transform: scale(1.05); }

#conn-status {
  position: fixed; top: 16px; left: 50%; transform: translateX(-50%);
  font-size: 0.62rem; color: var(--text-soft);
  background: rgba(0,0,0,0.5); backdrop-filter: blur(10px);
  padding: 4px 12px; border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.06);
  z-index: 20; pointer-events: none;
  opacity: 0; transition: opacity 0.5s;
  font-family: 'Lora', serif; font-style: italic;
}
#conn-status.show { opacity: 1; }

.audio-notice {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%,-50%);
  background: rgba(10,5,2,0.9); backdrop-filter: blur(20px);
  border: 1px solid rgba(180,100,30,0.3);
  border-radius: 20px; padding: 28px 32px;
  text-align: center; z-index: 50;
  max-width: 280px;
}
.audio-notice h2 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.5rem; font-weight: 300; font-style: italic;
  color: rgba(240,210,160,0.95); margin-bottom: 8px;
}
.audio-notice p {
  font-size: 0.8rem; color: var(--text-soft); line-height: 1.6; margin-bottom: 20px;
}
.enter-btn {
  padding: 10px 28px; border-radius: 30px;
  background: rgba(255,120,30,0.2);
  border: 1px solid rgba(255,120,30,0.4);
  color: rgba(255,200,100,0.95);
  font-family: 'Cormorant Garamond', serif;
  font-size: 1rem; font-style: italic;
  cursor: pointer; transition: all 0.3s;
}
.enter-btn:hover { background: rgba(255,120,30,0.35); }

@media (max-width: 768px) {
  #logbook-panel.fullscreen {
    bottom: 5vh !important;
    right: 5vw !important;
    width: 90vw !important;
    height: 90vh !important;
    max-height: 90vh !important;
  }
}

@media (max-width: 480px) {
  #music-player { width: calc(100vw - 90px); }
  #logbook-panel { width: calc(100vw - 32px); right: 16px; }
  #sky-switcher { top: auto; bottom: 84px; right: 16px; flex-direction: row; }
  .sky-btn-label { display: none; }
}