* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: Arial, sans-serif;
}

body {
  background-color: #111;
  color: #ffffff;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

.chat-container {
  width: 90%;
  max-width: 800px;
  height: 90vh;
  background-color: #2a2a2a;
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 20px rgba(255, 204, 0, 0.1);
}

.chat-header {
  background-color: #333;
  padding: 15px;
  text-align: center;
  border-bottom: 1px solid #444;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chat-header h1 {
  font-size: 1.5rem;
  font-family: 'Determination Mono', monospace;
  color: #ffcc00;
  letter-spacing: 1px;
  margin: 0 auto;
}

.clear-chat-btn {
  background-color: #777;
  color: #fff;
  border: none;
  padding: 5px 10px;
  border-radius: 5px;
  cursor: pointer;
  font-family: 'Determination Mono', monospace;
  font-size: 0.8rem;
  transition: background-color 0.3s;
}

.clear-chat-btn:hover {
  background-color: #ff6600;
}

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

.message {
  padding: 10px 15px;
  border-radius: 10px;
  max-width: 70%;
  word-wrap: break-word;
}

.user-message {
  align-self: flex-end;
  background-color: #333;
  margin-left: auto;
  border: 1px solid #444;
}

.bot-message {
  align-self: flex-start;
  background-color: #3a3a3a;
  margin-right: auto;
  border: 1px solid #444;
}

.bot-message strong {
  color: #ff9900;
  font-weight: bold;
}

.bot-message em {
  color: #b4b4b4;
  font-style: italic;
}

.bot-message code {
  background-color: #333;
  padding: 2px 4px;
  border-radius: 3px;
  font-family: monospace;
}

.bot-message blockquote {
  border-left: 3px solid #ff9900;
  margin-left: 0;
  padding-left: 10px;
  color: #b4b4b4;
}

.bot-message ul, .bot-message ol {
  padding-left: 20px;
}

.bot-message a {
  color: #ff9900;
  text-decoration: none;
}

.bot-message a:hover {
  text-decoration: underline;
}

.character-container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 10px;
  height: 170px;
  position: relative;
  overflow: hidden;
}

#character-image-container {
  height: 140px;
  width: 140px;
  display: flex;
  justify-content: center;
  align-items: center;
  animation-duration: 1s;
  animation-iteration-count: infinite;
  animation-timing-function: ease-in-out;
}

.bounce {
  animation-name: bounce;
}

@keyframes bounce {
  0% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
  100% { transform: translateY(0); }
}

#character-image {
  max-height: 100%;
  max-width: 100%;
  object-fit: contain;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

#character-image.talk {
  animation: talkBob 0.3s ease-in-out infinite;
}

#character-image.psycho {
  animation: psychoGlitch 0.2s linear infinite;
}

#character-image.breaking {
  animation: breakingShake 0.1s linear infinite;
}

@keyframes talkBob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}

@keyframes psychoGlitch {
  0% { transform: translate(0); }
  25% { transform: translate(-2px, 2px); }
  50% { transform: translate(2px, -2px); }
  75% { transform: translate(-2px, -2px); }
  100% { transform: translate(0); }
}

@keyframes breakingShake {
  0% { transform: translate(0) rotate(0); }
  25% { transform: translate(1px, 1px) rotate(1deg); }
  50% { transform: translate(-1px, -1px) rotate(-1deg); }
  75% { transform: translate(1px, -1px) rotate(1deg); }
  100% { transform: translate(0) rotate(0); }
}

.chat-input {
  display: flex;
  padding: 15px;
  border-top: 1px solid #444;
}

#user-input {
  flex: 1;
  padding: 10px;
  border: none;
  border-radius: 20px;
  background-color: #3a3a3a;
  color: #fff;
  margin-right: 10px;
}

#user-input:focus {
  outline: none;
  background-color: #444;
}

#send-button {
  padding: 10px 20px;
  border: none;
  border-radius: 20px;
  background-color: #ff9900;
  color: #000;
  cursor: pointer;
  transition: background-color 0.3s;
}

#send-button:hover {
  background-color: #ffaa33;
}

.typing {
  font-weight: bold;
  color: #ff9900;
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #2a2a2a;
}

::-webkit-scrollbar-thumb {
  background: #444;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* Psycho meter styling - more subtle */
.psycho-meter {
  width: 80%;
  height: 8px;
  background-color: #3a3a3a;
  border-radius: 5px;
  margin-top: 10px;
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.3);
}

.psycho-meter-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #5df542, #ffcc00, #ff6600);
  border-radius: 5px;
  transition: width 0.5s ease;
}

.psycho-meter-label {
  font-size: 0.8rem;
  color: #ccc;
  margin-top: 5px;
  text-align: center;
}

/* Shake animation for breaking point */
.shake {
  animation: shake 0.5s ease-in-out infinite;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-3px) rotate(-1deg); }
  50% { transform: translateX(3px) rotate(1deg); }
  75% { transform: translateX(-3px) rotate(-1deg); }
}

/* New styles for sound toggle */
#sound-toggle {
  margin-left: 10px;
  cursor: pointer;
  accent-color: #ff9900;
}
.sound-toggle-label {
  font-size: 0.9rem;
  color: #fff;
  margin-left: 4px;
  cursor: pointer;
}

/* Add new styles for info panel */
.chat-layout {
  display: flex;
  width: 100%;
  height: 100%;
}

.main-chat {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.info-layout {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.info-panel {
  width: 250px;
  background: #2a2a2a;
  padding: 15px;
  border-left: 1px solid #444;
  overflow-y: auto;
  transition: background-color 0.3s ease;
  flex: 1;
}

.info-header {
  color: #ffcc00;
  font-size: 1.2rem;
  margin-bottom: 15px;
  text-align: center;
  border-bottom: 1px solid #444;
  padding-bottom: 8px;
  font-family: 'Determination Mono', monospace;
}

.info-item {
  margin: 15px 0;
  padding: 12px;
  background: #333;
  border-radius: 8px;
  opacity: 0.5;
  filter: blur(2px);
  transition: all 0.5s ease;
  border-left: 3px solid #444;
  transform: translateX(-5px);
}

.info-item.unlocked {
  opacity: 1;
  filter: blur(0);
  border-left: 3px solid #ffcc00;
  box-shadow: 0 2px 10px rgba(255, 204, 0, 0.2);
  transform: translateX(0);
  animation: infoUnlock 0.6s ease-out;
}

.info-item h3 {
  color: #ffcc00;
  font-size: 0.9rem;
  margin-bottom: 8px;
  font-weight: bold;
}

.info-item p {
  color: #eee;
  font-size: 0.85rem;
  line-height: 1.5;
}

.locked-text {
  color: #777;
  font-style: italic;
  letter-spacing: 1px;
}

@keyframes infoUnlock {
  0% { transform: translateX(-20px); opacity: 0.3; }
  50% { transform: translateX(5px); opacity: 0.8; }
  100% { transform: translateX(0); opacity: 1; }
}

/* New flash animation for panel */
.panel-flash {
  animation: panelFlash 0.4s ease-out;
}

@keyframes panelFlash {
  0% { background-color: #2a2a2a; }
  50% { background-color: #444; }
  100% { background-color: #2a2a2a; }
}

/* Add styles for user profile panel */
.user-profile-panel {
  width: 250px;
  background: #252525;
  padding: 15px;
  border-left: 1px solid #444;
  border-top: 1px solid #444;
  overflow-y: auto;
  height: 250px;
}

.profile-header {
  color: #ffcc00;
  font-size: 1.2rem;
  margin-bottom: 15px;
  text-align: center;
  border-bottom: 1px solid #444;
  padding-bottom: 8px;
  font-family: 'Determination Mono', monospace;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.profile-toggle {
  cursor: pointer;
  font-size: 1rem;
  color: #ccc;
}

.profile-fields {
  display: none;
}

.profile-fields.visible {
  display: block;
  animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
  0% { opacity: 0; }
  100% { opacity: 1; }
}

.profile-field {
  margin-bottom: 10px;
}

.profile-field label {
  display: block;
  color: #ffcc00;
  font-size: 0.8rem;
  margin-bottom: 3px;
}

.profile-field textarea {
  height: 60px;
  resize: vertical;
}

.profile-field input, .profile-field textarea {
  width: 100%;
  background: #333;
  border: 1px solid #444;
  color: #fff;
  padding: 6px 8px;
  border-radius: 4px;
  font-size: 0.85rem;
}

.profile-field input:focus, .profile-field textarea:focus {
  border-color: #ffcc00;
  outline: none;
  box-shadow: 0 0 5px rgba(255, 204, 0, 0.3);
}

.save-profile {
  background: #ff9900;
  color: #000;
  border: none;
  padding: 8px 12px;
  border-radius: 4px;
  font-weight: bold;
  cursor: pointer;
  margin-top: 10px;
  width: 100%;
  transition: background 0.2s;
}

.save-profile:hover {
  background: #ffaa33;
}

/* Add styles for personality panel */
.personality-panel {
  width: 250px;
  background: #252525;
  padding: 15px;
  border-left: 1px solid #444;
  overflow-y: auto;
}

.personality-sliders {
  display: none;
  padding-top: 10px;
}

.personality-sliders.visible {
  display: block;
  animation: fadeIn 0.3s ease-out;
}

.slider-container {
  margin-bottom: 15px;
}

.slider-container label {
  display: block;
  color: #ffcc00;
  font-size: 0.8rem;
  margin-bottom: 5px;
}

.personality-slider {
  width: 80%;
  height: 8px;
  -webkit-appearance: none;
  background: #3a3a3a;
  border-radius: 5px;
  outline: none;
}

.personality-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #ff9900;
  cursor: pointer;
}

.slider-value {
  display: inline-block;
  width: 20px;
  text-align: center;
  color: #fff;
  margin-left: 5px;
}

.reset-button {
  background-color: #555;
  color: #fff;
  border: none;
  padding: 8px 12px;
  border-radius: 4px;
  cursor: pointer;
  margin-top: 10px;
  width: 100%;
  transition: background 0.2s;
}

.reset-button:hover {
  background-color: #777;
}

/* Add styles for system prompt panel */
.system-prompt-panel {
  width: 250px;
  background: #252525;
  padding: 15px;
  border-left: 1px solid #444;
  border-bottom: 1px solid #444;
  overflow-y: auto;
}

.prompt-editor {
  display: none;
  padding-top: 10px;
}

.prompt-editor.visible {
  display: block;
  animation: fadeIn 0.3s ease-out;
}

.prompt-field {
  margin-bottom: 15px;
}

.prompt-field label {
  display: block;
  color: #ffcc00;
  font-size: 0.8rem;
  margin-bottom: 5px;
}

.prompt-field textarea {
  width: 100%;
  height: 150px;
  background: #333;
  border: 1px solid #444;
  color: #fff;
  padding: 8px;
  border-radius: 4px;
  font-size: 0.85rem;
  resize: vertical;
  font-family: monospace;
}

.prompt-field textarea:focus {
  border-color: #ffcc00;
  outline: none;
  box-shadow: 0 0 5px rgba(255, 204, 0, 0.3);
}

.prompt-templates {
  margin-bottom: 15px;
}

.prompt-templates label {
  display: block;
  color: #ffcc00;
  font-size: 0.8rem;
  margin-bottom: 5px;
}

.prompt-templates select {
  width: 100%;
  background: #333;
  border: 1px solid #444;
  color: #fff;
  padding: 6px;
  border-radius: 4px;
  font-size: 0.85rem;
  margin-bottom: 10px;
}