body {
    background-color: black;
    color: red;
    font-family: 'Courier New', monospace;
    margin: 0;
    padding: 10px;
    height: 100vh;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

.main-frame {
    display: flex;
    background-color: black;
    width: 900px;
    height: 600px;
    padding: 10px;
    gap: 10px;
    border: 1px solid #333;
    border-radius: 5px;
    box-shadow: 0 0 15px rgba(255, 0, 0, 0.2);
}

.image-container {
    flex-shrink: 0;
    width: 200px;
}

#hal-image {
    width: 100%;
    filter: drop-shadow(0 0 5px rgba(255, 0, 0, 0.5));
}

.conversation-container {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    height: 100%;
}

#conversation {
    flex-grow: 1;
    background-color: #111;
    color: red;
    border: 1px solid #333;
    padding: 10px;
    overflow-y: auto;
    margin-bottom: 10px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    resize: none;
    width: 100%;
    box-sizing: border-box;
    outline: none;
    border-radius: 3px;
}

.user-message {
    color: #ff6b6b;
    margin-bottom: 8px;
    font-weight: bold;
}

.hal-message {
    color: #4ecdc4;
    margin-bottom: 8px;
    font-weight: bold;
}

.input-container {
    display: flex;
    gap: 10px;
}

#user-input {
    flex-grow: 1;
    background-color: #111;
    color: red;
    border: 1px solid #333;
    padding: 10px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    height: 20px;
    border-radius: 3px;
}

#user-input:focus {
    outline: none;
    border-color: #4ecdc4;
}

.status-indicator {
    margin-top: -2px;
    color: #4ecdc4;
    font-size: 14px;
    font-family: 'Courier New', monospace;
    font-weight: bold;
}

#send-button {
    background-color: #900;
    color: white;
    border: none;
    padding: 0 10px;
    cursor: pointer;
    font-size: 14px;
    border-radius: 3px;
    height: 40px;
    font-weight: bold;
}

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

.loading {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid #4ecdc4;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
    margin-right: 5px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.error-message {
    color: #ff4444;
    font-style: italic;
    font-weight: bold;
}

.thinking-message {
    color: #4ecdc4;
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    font-weight: bold;
    font-size: 14px;
}

.thinking-dots {
    display: flex;
    margin-left: 5px;
}

.thinking-dot {
    width: 4px;
    height: 4px;
    background-color: #4ecdc4;
    border-radius: 50%;
    margin: 0 2px;
    animation: pulse 1.5s infinite ease-in-out;
}

.thinking-dot:nth-child(2) {
    animation-delay: 0.3s;
}

.thinking-dot:nth-child(3) {
    animation-delay: 0.6s;
}

@keyframes pulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

.hal-loader {
  --s: 10px;
  --g: 2px;  
  
  height: calc(1.353*var(--s) + var(--g));
  aspect-ratio: 3;
  background:
    linear-gradient(#ff1818 0 0) left/33% 100% no-repeat,
    conic-gradient(from -90deg at var(--s) calc(0.353*var(--s)),
      #fff 135deg,#666 0 270deg,#aaa 0); 
  background-blend-mode: multiply;
  --_m:
    linear-gradient(to bottom right,
       #0000 calc(0.25*var(--s)),#000 0 calc(100% - calc(0.25*var(--s)) - 1.414*var(--g)),#0000 0),
    conic-gradient(from -90deg at right var(--g) bottom var(--g),#000 90deg,#0000 0);
  -webkit-mask: var(--_m);
          mask: var(--_m);
  background-size:   calc(100%/3) 100%;
  -webkit-mask-size: calc(100%/3) 100%;
          mask-size: calc(100%/3) 100%;
  -webkit-mask-composite: source-in;
          mask-composite: intersect;
  animation: l7 steps(3) 1.5s infinite;
  margin-left: 8px;
  transform: translateY(1px);
}

@keyframes l7 {
  to {background-position: 150% 0%}
}