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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #333;
  overflow: hidden;
}

.screen {
  display: none;
  width: 100vw;
  height: 100vh;
}

.screen.active {
  display: flex;
}

/* Login Screen */
#login-screen {
  justify-content: center;
  align-items: center;
}

.login-box {
  background: white;
  padding: 40px;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  text-align: center;
  min-width: 350px;
}

.login-box h1 {
  color: #667eea;
  margin-bottom: 10px;
  font-size: 2em;
}

.login-box p {
  color: #666;
  margin-bottom: 30px;
}

.login-box input,
.login-box select {
  width: 100%;
  padding: 15px;
  margin-bottom: 15px;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  font-size: 16px;
  transition: border 0.3s;
}

.login-box input:focus,
.login-box select:focus {
  outline: none;
  border-color: #667eea;
}

.login-box button {
  width: 100%;
  padding: 15px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  transition: transform 0.2s;
}

.login-box button:hover {
  transform: translateY(-2px);
}

.login-box button:active {
  transform: translateY(0);
}

/* Login Divider */
.login-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 20px 0;
}

.login-divider::before,
.login-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid #e0e0e0;
}

.login-divider span {
  padding: 0 10px;
  color: #999;
  font-size: 14px;
}

/* Planning Tool Login Button */
.planning-tool-btn {
  background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%) !important;
  margin-bottom: 15px;
}

.planning-tool-btn:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
}

/* Secondary Button */
.secondary-btn {
  background: #f44336 !important;
  font-size: 14px !important;
  padding: 10px !important;
}

.secondary-btn:hover {
  background: #da190b !important;
}

/* User Info Display */
#user-info {
  margin-top: 15px;
  padding: 15px;
  background: #f0f0f0;
  border-radius: 10px;
}

#user-info p {
  margin-bottom: 10px;
  color: #333;
}

#logged-in-username {
  color: #667eea;
}

/* Game Screen */
#game-screen {
  flex-direction: column;
}

#game-container {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  background: #f5f5f5;
  position: relative;
}

#game-header {
  display: none;
}

#room-info {
  display: flex;
  gap: 20px;
  font-weight: bold;
}

#current-room {
  color: #667eea;
  font-size: 1.2em;
}

#player-count {
  color: #666;
}

#controls-info {
  display: flex;
  gap: 15px;
  align-items: center;
}

#controls-info span {
  color: #666;
  font-size: 0.9em;
}

#room-list-btn {
  padding: 8px 16px;
  background: #667eea;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.3s;
}

#room-list-btn:hover {
  background: #5568d3;
}

#game-canvas {
  flex: 1;
  background: #d4d4d4;
  display: block;
  cursor: crosshair;
  width: 100%;
  height: 100%;
  outline: none;
}

/* Chat Messages Overlay - Behind chat container */
#chat-messages-overlay {
  position: fixed;
  bottom: 50px;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  max-width: 90%;
  max-height: 0px; /* Hidden by default - expands when messages are added */
  background: rgba(0, 0, 0, 0.5) !important;
  border-radius: 10px;
  border: none;
  display: none; /* Completely hidden until messages appear */
  padding: 30px 10px 50px 10px;
  z-index: 9998;
  overflow-y: auto;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
  box-sizing: border-box;
  transition: max-height 0.3s ease, opacity 0.3s ease;
}

/* Resize handle for chat overlay */
#chat-resize-handle {
  position: fixed;
  bottom: calc(50px + 200px - 10px);
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 25px;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 10px 10px 0 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px;
  pointer-events: all;
  z-index: 9999;
  user-select: none;
  transition: background 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

#chat-resize-handle:hover {
  background: rgba(255, 255, 255, 0.8);
}

.resize-dots {
  cursor: ns-resize;
  font-size: 14px;
  font-weight: bold;
  color: rgba(0, 0, 0, 0.7);
  flex: 1;
  text-align: center;
}

#chat-overlay-close-btn {
  width: 20px;
  height: 20px;
  border: none;
  background: rgba(220, 53, 69, 0.8);
  color: white;
  border-radius: 50%;
  cursor: pointer;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  padding: 0;
  line-height: 1;
}

#chat-overlay-close-btn:hover {
  background: rgba(220, 53, 69, 1);
  transform: scale(1.1);
}

/* Hide resize handle when no messages */
#chat-messages-overlay:not(:has(.chat-message)) ~ #chat-resize-handle {
  display: none;
}

/* Hide chat overlay when walking */
#chat-messages-overlay.hidden-while-walking {
  opacity: 0;
  pointer-events: none;
}

/* Chat overlay expand steps */
#chat-messages-overlay.step-0 {
  max-height: 0px;
  display: none;
}

#chat-messages-overlay.step-1 {
  max-height: 150px;
  display: flex;
}

#chat-messages-overlay.step-2 {
  max-height: 300px;
  display: flex;
}

#chat-messages-overlay.step-3 {
  max-height: 450px;
  display: flex;
}

/* Chat expand toggle button */
#chat-expand-btn {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  background: rgba(102, 126, 234, 0.9);
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  z-index: 10001;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
}

#chat-expand-btn:hover {
  background: rgba(102, 126, 234, 1);
  transform: scale(1.1);
}

#chat-expand-btn:active {
  transform: scale(0.95);
}

.chat-message {
  display: flex;
  margin-bottom: 8px;
  width: 100%;
}

.chat-message.own {
  justify-content: flex-end;
  padding-right: 0;
  width: 100%;
}

.chat-message.other {
  justify-content: flex-start;
  padding-left: 0;
}

.chat-bubble {
  max-width: 100%;
  padding: 5px 0;
  word-wrap: break-word;
  background: transparent !important;
}

.chat-message.own .chat-bubble {
  color: #90EE90 !important;
  margin-left: auto;
  background: transparent !important;
}

.chat-message.other .chat-bubble {
  color: #FFFFFF !important;
  margin-right: auto;
  background: transparent !important;
}

.chat-bubble-username {
  font-weight: bold;
  font-size: 12px;
  margin-bottom: 4px;
  color: #666;
}

.chat-bubble-text {
  font-size: 14px;
  line-height: 1.4;
}

/* Chat Container - Always visible at bottom */
#chat-container {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  max-width: 90%;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 25px;
  padding: 10px 15px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 10000;
  backdrop-filter: blur(10px);
  pointer-events: auto;
  box-sizing: border-box;
  opacity: 1;
  transition: opacity 0.3s ease;
}

/* Faded state when moving */
#chat-container.collapsed {
  opacity: 0.3;
}

/* Move mic button to the right */
#chat-container {
  flex-direction: row;
  align-items: center;
}

/* Settings Toggle Button (large center button) */
.settings-toggle {
  order: 3;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: #FF9800;
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.settings-toggle:hover {
  background: #F57C00;
  transform: scale(1.1);
}

.settings-toggle.hidden {
  display: none;
}

/* Game Controller Button Layout */
#controller-btns {
  order: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0px;
  padding: 3px;
  position: relative;
  transition: all 0.3s ease;
}

/* Collapsed state - hide all 4 buttons */
#controller-btns.collapsed {
  display: none;
}

/* Expanded state */
#screen-share-btn {
  margin-bottom: -6px;
  transition: all 0.3s ease;
}

#voice-to-text-btn {
  margin-top: -6px;
  transition: all 0.3s ease;
}

#voice-to-text-btn.active {
  background: #FF5722 !important;
  animation: pulse 1.5s infinite;
  box-shadow: 0 0 20px rgba(255, 87, 34, 0.6);
}

.controller-middle {
  display: flex;
  gap: 16px;
  align-items: center;
  transition: all 0.3s ease;
}

.controller-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #667eea;
  border: none;
  color: white;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
  flex-shrink: 0;
  position: relative;
}

.controller-btn:hover {
  background: #5568d3;
  transform: scale(1.1);
}

.chat-input-container {
  order: 2;
  flex: 1;
}

.chat-tabs {
  display: flex;
  background: #f5f5f5;
  border-bottom: 2px solid #e0e0e0;
}

.chat-tab {
  flex: 1;
  padding: 12px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.3s;
}

.chat-tab:hover {
  background: #e0e0e0;
}

.chat-tab.active {
  background: white;
  color: #667eea;
  font-weight: bold;
  border-bottom: 3px solid #667eea;
}

#chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 15px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}


.chat-input-container {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}

/* Translator button color override */
#translator-btn {
  background: #00BCD4;
}

#translator-btn:hover {
  background: #0097A7;
}

#mic-btn.active {
  background: #e74c3c !important;
  animation: pulse 1.5s infinite;
  box-shadow: 0 0 20px rgba(231, 76, 60, 0.6);
}

#translate-btn {
  background: #4CAF50;
}

#translate-btn:hover {
  background: #45a049;
}

#translate-btn.active {
  background: #FFA500;
}

#settings-btn {
  background: #FF9800;
}

#settings-btn:hover {
  background: #F57C00;
}

@keyframes pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.7);
  }
  50% {
    box-shadow: 0 0 0 10px rgba(231, 76, 60, 0);
  }
}

@keyframes slideIn {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(400px);
    opacity: 0;
  }
}

#chat-input {
  flex: 1;
  padding: 12px 20px;
  border: 2px solid #e0e0e0;
  border-radius: 25px;
  font-size: 15px;
  background: white;
  transition: all 0.3s;
}

#chat-input:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

#chat-input::placeholder {
  color: #999;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  justify-content: center;
  align-items: center;
  z-index: 10002;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: white;
  padding: 30px;
  border-radius: 15px;
  min-width: 500px;
  max-width: 650px;
  width: fit-content;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.modal-content h2 {
  color: #667eea;
  margin: 0;
}

.close-btn {
  background: #f44336;
  color: white;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 20px;
  font-weight: bold;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.close-btn:hover {
  background: #d32f2f;
  transform: rotate(90deg);
}

/* Screen Share Modal */
.screen-share-content {
  background: white;
  border-radius: 15px;
  width: 90vw;
  max-width: 1400px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.screen-share-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 2px solid #e0e0e0;
  background: #f8f9fa;
}

.screen-share-header h2 {
  color: #667eea;
  margin: 0;
  font-size: 20px;
}

#screen-share-container {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #000;
  padding: 20px;
  overflow: hidden;
}

#screen-share-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 8px;
}

/* Screen share button active state */
#screen-share-btn.active {
  background: #4CAF50 !important;
  animation: pulse 1.5s infinite;
  box-shadow: 0 0 20px rgba(76, 175, 80, 0.6);
}

#rooms-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
  margin-bottom: 20px;
  max-width: 600px;
}

.room-item {
  padding: 20px;
  background: #f5f5f5;
  border-radius: 15px;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 120px;
  border: 3px solid transparent;
}

.room-item:hover {
  background: #667eea;
  color: white;
  transform: scale(1.05);
  border-color: #764ba2;
  box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.room-item .room-emoji {
  font-size: 2.5em;
  margin-bottom: 10px;
}

.room-item .room-name {
  font-weight: bold;
  font-size: 0.95em;
}

.room-item .room-count {
  font-size: 0.9em;
  opacity: 0.8;
}


#history-list {
  max-height: 400px;
  overflow-y: auto;
  margin-bottom: 20px;
  padding: 10px;
  background: #f5f5f5;
  border-radius: 8px;
}

.history-item {
  padding: 10px;
  margin-bottom: 8px;
  background: white;
  border-radius: 6px;
  border-left: 4px solid #667eea;
  position: relative;
}

.history-item .history-time {
  font-size: 0.8em;
  color: #999;
  margin-bottom: 4px;
}

.history-item .history-user {
  font-weight: bold;
  color: #667eea;
  margin-bottom: 4px;
}

.history-item .history-message {
  color: #333;
}

.history-item .history-translation {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dashed #ddd;
  font-style: italic;
  color: #666;
}

.history-item .correct-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 6px 12px;
  background: #667eea;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.3s;
}

.history-item .correct-btn:hover {
  background: #5568d3;
}

.history-item .corrected-text {
  margin-top: 8px;
  padding: 8px;
  background: #e8f5e9;
  border-radius: 6px;
  border-left: 3px solid #4caf50;
}

.history-item .corrected-label {
  font-size: 11px;
  color: #4caf50;
  font-weight: bold;
  margin-bottom: 4px;
}

/* Scrollbar */
#chat-messages::-webkit-scrollbar {
  width: 8px;
}

#chat-messages::-webkit-scrollbar-track {
  background: #f5f5f5;
}

#chat-messages::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 4px;
}

#chat-messages::-webkit-scrollbar-thumb:hover {
  background: #999;
}

/* Settings */
#close-settings-btn {
  width: 100%;
  padding: 12px;
  background: #e0e0e0;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: bold;
  transition: background 0.3s;
}

#close-settings-btn:hover {
  background: #d0d0d0;
}

.settings-group {
  margin-bottom: 20px;
}

.settings-group label {
  display: block;
  margin-bottom: 10px;
  font-weight: bold;
  color: #333;
  font-size: 14px;
}

.settings-group span {
  color: #667eea;
  font-weight: bold;
}

.settings-group input[type="range"] {
  width: 100%;
  height: 8px;
  border-radius: 5px;
  background: #e0e0e0;
  outline: none;
  -webkit-appearance: none;
}

.settings-group input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #667eea;
  cursor: pointer;
  transition: background 0.3s;
}

.settings-group input[type="range"]::-webkit-slider-thumb:hover {
  background: #5568d3;
}

.settings-group input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #667eea;
  cursor: pointer;
  border: none;
  transition: background 0.3s;
}

.settings-group input[type="range"]::-moz-range-thumb:hover {
  background: #5568d3;
}

/* Profile Modal */
.profile-section {
  padding: 20px;
  background: #f9f9f9;
  border-radius: 10px;
  margin-bottom: 15px;
}

.profile-section h3 {
  margin-bottom: 15px;
  color: #667eea;
  font-size: 16px;
}

#current-color-display:hover {
  transform: scale(1.1);
  border-color: #667eea;
  box-shadow: 0 0 8px rgba(102, 126, 234, 0.3);
}

/* Object Sidebar */
.sidebar {
  position: fixed;
  top: 0;
  right: -400px;
  width: 400px;
  height: 100vh;
  background: white;
  box-shadow: -5px 0 20px rgba(0, 0, 0, 0.3);
  transition: right 0.3s ease;
  z-index: 10001;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar.active {
  right: 0;
}

.sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  flex-shrink: 0;
}

.sidebar-header h2 {
  margin: 0;
  font-size: 1.5em;
}

.sidebar-header .close-btn {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: 2px solid white;
}

.sidebar-header .close-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: rotate(90deg);
}

#object-categories {
  display: flex;
  gap: 8px;
  padding: 15px;
  flex-wrap: wrap;
  background: #f5f5f5;
  border-bottom: 2px solid #e0e0e0;
  flex-shrink: 0;
}

.category-tab {
  padding: 10px 16px;
  background: white;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 100px;
  justify-content: center;
}

.category-tab:hover {
  background: #e0e0e0;
  border-color: #667eea;
  transform: translateY(-2px);
}

.category-tab.active {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-color: #764ba2;
  font-weight: bold;
}

#object-items {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding: 15px;
  overflow-y: auto;
  flex: 1;
}

.object-item {
  padding: 15px 10px;
  background: white;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 90px;
  border: 3px solid #e0e0e0;
}

.object-item:hover {
  background: #667eea;
  color: white;
  transform: scale(1.05);
  border-color: #764ba2;
  box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.object-item.selected {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-color: #764ba2;
  font-weight: bold;
}

.object-item .object-emoji {
  font-size: 2em;
  margin-bottom: 8px;
}

.object-item .object-name {
  font-size: 0.85em;
  font-weight: 500;
}

#object-items::-webkit-scrollbar {
  width: 8px;
}

#object-items::-webkit-scrollbar-track {
  background: #e0e0e0;
  border-radius: 4px;
}

#object-items::-webkit-scrollbar-thumb {
  background: #667eea;
  border-radius: 4px;
}

#object-items::-webkit-scrollbar-thumb:hover {
  background: #5568d3;
}

.sidebar-footer {
  display: flex;
  gap: 10px;
  padding: 15px;
  background: #f5f5f5;
  border-top: 2px solid #e0e0e0;
  flex-shrink: 0;
}

.save-btn,
.cancel-btn {
  flex: 1;
  padding: 12px 20px;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.save-btn {
  background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
  color: white;
}

.save-btn:hover {
  background: linear-gradient(135deg, #45a049 0%, #3d8b40 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
}

.cancel-btn {
  background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
  color: white;
}

.cancel-btn:hover {
  background: linear-gradient(135deg, #d32f2f 0%, #c62828 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(244, 67, 54, 0.4);
}

/* Custom uploaded objects */
.custom-object {
  position: relative;
}

.delete-custom-btn {
  position: absolute;
  top: 5px;
  right: 5px;
  background: #f44336;
  color: white;
  border: none;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  cursor: pointer;
  display: none;
  font-size: 12px;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.custom-object:hover .delete-custom-btn {
  display: flex;
}

.delete-custom-btn:hover {
  background: #d32f2f;
  transform: scale(1.1);
}

/* Teams-Style Left Sidebar */
#left-sidebar {
  width: 64px;
  background: #2b2b2b;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 0;
  gap: 5px;
  border-right: 1px solid #3a3a3a;
  flex-shrink: 0;
}

.sidebar-item {
  width: 56px;
  padding: 8px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.2s;
  position: relative;
}

.sidebar-item:hover {
  background: rgba(255, 255, 255, 0.1);
}

.sidebar-item.active {
  background: rgba(255, 255, 255, 0.15);
}

.sidebar-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 24px;
  background: #6264a7;
  border-radius: 0 2px 2px 0;
}

.sidebar-icon {
  font-size: 24px;
  line-height: 1;
}

.sidebar-label {
  font-size: 10px;
  color: #e0e0e0;
  text-align: center;
  line-height: 1;
}

/* Version Info */
.version-info {
  padding: 12px 8px;
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  width: 100%;
}

.version-label {
  font-size: 8px;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.version-number {
  font-size: 11px;
  color: #667eea;
  font-weight: 600;
  font-family: 'Courier New', monospace;
}

/* Guest Link Button - Special styling */
#guest-link-btn {
  background: rgba(76, 175, 80, 0.1);
}

/* Profile Button - Push to bottom */
#profile-btn {
  margin-top: auto; /* Push profile and version to bottom */
}

#guest-link-btn:hover {
  background: rgba(76, 175, 80, 0.2);
}

#guest-link-btn .sidebar-label {
  font-size: 10px;
  font-weight: 600;
  color: #4CAF50;
}

/* Chat Panel & Activity Panel & Calendar Panel & Bookmark Panel */
#chat-panel,
#activity-panel,
#calendar-panel,
#bookmark-panel {
  position: absolute;
  top: 0;
  left: 72px; /* After left sidebar */
  width: 320px;
  height: 100%;
  background: #f5f5f5;
  display: flex;
  flex-direction: column;
  border-right: 1px solid #e0e0e0;
  z-index: 100;
  box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
}

.chat-panel-header {
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #e0e0e0;
  background: white;
}

.chat-panel-header h2 {
  font-size: 20px;
  font-weight: 600;
  color: #242424;
  margin: 0;
}

.header-actions {
  display: flex;
  gap: 4px;
}

.icon-btn {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: background 0.2s;
}

.icon-btn:hover {
  background: rgba(0, 0, 0, 0.05);
}

.chat-filters {
  padding: 12px 16px;
  display: flex;
  gap: 8px;
  background: white;
  border-bottom: 1px solid #e0e0e0;
  overflow-x: auto;
}

.filter-btn {
  padding: 6px 12px;
  border: none;
  background: transparent;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 500;
  color: #616161;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.filter-btn:hover {
  background: rgba(0, 0, 0, 0.05);
}

.filter-btn.active {
  background: #e8eaed;
  color: #242424;
}

.chat-quick-items {
  background: white;
  border-bottom: 1px solid #e0e0e0;
}

.quick-item {
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: background 0.2s;
  font-size: 14px;
  color: #242424;
}

.quick-item:hover {
  background: rgba(0, 0, 0, 0.03);
}

.quick-icon {
  font-size: 16px;
  width: 20px;
  text-align: center;
}

.chat-section {
  background: white;
  margin-top: 1px;
}

.section-header {
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: #616161;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: background 0.2s;
}

.section-header:hover {
  background: rgba(0, 0, 0, 0.03);
}

.expand-icon {
  font-size: 10px;
  transition: transform 0.2s;
}

.section-header.collapsed .expand-icon {
  transform: rotate(0deg);
}

.chat-list {
  max-height: 400px;
  overflow-y: auto;
}

.chat-list-item {
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: background 0.2s;
  border-left: 3px solid transparent;
}

.chat-list-item:hover {
  background: rgba(0, 0, 0, 0.03);
}

.chat-list-item.active {
  background: rgba(0, 0, 0, 0.05);
  border-left-color: #6264a7;
}

.chat-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 14px;
  flex-shrink: 0;
}

.chat-info {
  flex: 1;
  min-width: 0;
}

.chat-name {
  font-size: 14px;
  font-weight: 500;
  color: #242424;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-status {
  font-size: 12px;
  color: #616161;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.poke-btn {
  background: transparent;
  border: none;
  font-size: 20px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.2s;
  flex-shrink: 0;
  opacity: 0;
}

.chat-list-item:hover .poke-btn {
  opacity: 1;
}

.poke-btn:hover {
  background: rgba(102, 126, 234, 0.1);
  transform: scale(1.2);
}

.poke-btn:active {
  transform: scale(0.9);
}

/* Adjust game container to work with sidebar */
#game-screen {
  display: none;
}

#game-screen.active {
  display: flex;
  flex-direction: row;
}

#game-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
}
