/* SILBERO.DIGITAL — monochromatic dark mode, mobile-first */

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

body {
  background: #111;
  color: #ddd;
  font-family: 'Courier New', Courier, monospace;
  font-size: 15px;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

.hidden { display: none !important; }

/* ============================================
   LANGUAGE SELECTOR
   ============================================ */

#lang-select {
  height: 100vh;
  height: 100dvh;
  background: #050505;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

#lang-content {
  text-align: center;
}

#lang-logo {
  font-size: 28px;
  letter-spacing: 6px;
  color: #ccc;
  margin-bottom: 48px;
  font-weight: normal;
  font-family: 'Courier New', monospace;
}

#lang-logo span { color: #666; }

#lang-flags {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 280px;
  margin: 0 auto;
}

.lang-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  background: #0a0a0a;
  border: 1px solid #222;
  color: #999;
  font-family: 'Courier New', monospace;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.15s;
  letter-spacing: 1px;
}

.lang-btn:hover {
  background: #151515;
  border-color: #444;
  color: #ddd;
}

.lang-btn .flag {
  font-size: 22px;
  font-family: system-ui;
}

/* RTL support */
[dir="rtl"] #input-area { flex-direction: row-reverse; }
[dir="rtl"] .chat-msg-wrapper { flex-direction: row-reverse; }
[dir="rtl"] #input { text-align: right; }

/* ============================================
   SPLASH / CONSENT SCREEN
   ============================================ */

#splash {
  height: 100vh;
  height: 100dvh;
  overflow-y: auto;
  background: #050505;
  padding: 20px;
  display: flex;
  justify-content: center;
}

#splash-content {
  max-width: 560px;
  width: 100%;
}

#splash-logo {
  text-align: center;
  font-size: 28px;
  letter-spacing: 6px;
  color: #ccc;
  margin: 40px 0 36px 0;
  font-weight: normal;
}

#splash-logo span {
  color: #666;
}

.splash-section {
  margin-bottom: 28px;
}

.splash-section h2 {
  color: #888;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 10px;
  font-weight: normal;
}

.splash-section p {
  color: #777;
  font-size: 14px;
  line-height: 1.7;
  margin-bottom: 10px;
}

/* Consent checkboxes */
#consent-section {
  background: #0a0a0a;
  border: 1px solid #222;
  padding: 16px;
  margin-bottom: 28px;
}

.consent-label {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 16px;
  cursor: pointer;
  line-height: 1.6;
}

.consent-label:last-child {
  margin-bottom: 0;
}

.consent-label input[type="checkbox"] {
  margin-top: 4px;
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  accent-color: #888;
}

.consent-label span {
  color: #888;
  font-size: 13px;
}

.consent-label em {
  color: #555;
  font-style: italic;
}

.consent-label a {
  color: #999;
}

/* Big button */
#btn-silbero {
  display: block;
  width: 100%;
  padding: 16px;
  background: #1a1a1a;
  border: 2px solid #333;
  color: #aaa;
  font-family: inherit;
  font-size: 20px;
  letter-spacing: 4px;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 24px;
}

#btn-silbero:not(:disabled):hover {
  background: #222;
  border-color: #555;
  color: #ddd;
}

#btn-silbero:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* OAuth buttons */
#oauth-section {
  margin-bottom: 24px;
}

#oauth-divider {
  text-align: center;
  margin-bottom: 14px;
  position: relative;
}

#oauth-divider::before {
  content: '';
  position: absolute;
  left: 0; right: 0; top: 50%;
  border-top: 1px solid #1a1a1a;
}

#oauth-label {
  background: #050505;
  padding: 0 12px;
  position: relative;
  color: #444;
  font-size: 12px;
  letter-spacing: 1px;
}

#oauth-buttons {
  display: flex;
  gap: 8px;
}

.oauth-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px;
  background: #0d0d0d;
  border: 1px solid #222;
  color: #777;
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
  letter-spacing: 1px;
}

.oauth-btn:hover {
  background: #151515;
  border-color: #444;
  color: #aaa;
}

.oauth-btn svg { flex-shrink: 0; }

#splash-footer {
  text-align: center;
  color: #333;
  font-size: 11px;
  letter-spacing: 1px;
  padding-bottom: 40px;
}

/* ============================================
   NAME PROMPT
   ============================================ */

#name-prompt {
  height: 100vh;
  height: 100dvh;
  background: #050505;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

#name-prompt-content {
  max-width: 400px;
  width: 100%;
  text-align: center;
}

#name-logo {
  font-size: 24px;
  letter-spacing: 6px;
  color: #ccc;
  margin-bottom: 40px;
  font-weight: normal;
}

#name-logo span { color: #666; }

#name-label {
  display: block;
  color: #888;
  font-size: 16px;
  margin-bottom: 16px;
  letter-spacing: 1px;
}

#input-name {
  width: 100%;
  background: #0a0a0a;
  border: 1px solid #333;
  color: #ddd;
  font-family: inherit;
  font-size: 22px;
  padding: 12px 16px;
  text-align: center;
  outline: none;
  caret-color: #888;
  letter-spacing: 2px;
}

#input-name:focus {
  border-color: #555;
}

#name-hint {
  color: #444;
  font-size: 12px;
  margin: 10px 0 24px 0;
}

#btn-enter {
  display: block;
  width: 100%;
  padding: 14px;
  background: #1a1a1a;
  border: 2px solid #333;
  color: #aaa;
  font-family: inherit;
  font-size: 18px;
  letter-spacing: 4px;
  cursor: pointer;
}

#btn-enter:hover {
  background: #222;
  border-color: #555;
  color: #ddd;
}

/* ============================================
   TERMINAL
   ============================================ */

#terminal {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  padding: 8px;
  gap: 6px;
}

/* Header */
#header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  background: #1a1a1a;
  border: 1px solid #333;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 2px;
  flex-shrink: 0;
}

#terminal-id {
  color: #ccc;
  font-weight: bold;
  font-size: 14px;
}

#status {
  color: #555;
  margin-left: auto;
  font-size: 11px;
}

#status.online { color: #888; }
#status.receiving { color: #ccc; }
#status.transmitting { color: #fff; }

#ws-status {
  color: #444;
  font-size: 10px;
}

/* Main area */
#main-area {
  flex: 1;
  display: flex;
  gap: 6px;
  overflow: hidden;
}

/* Sidebar: user image + collected data */
#sidebar {
  width: 220px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
}

#visual-panel {
  flex-shrink: 0;
  background: #141414;
  border: 1px solid #2a2a2a;
  overflow: hidden;
}

#glitch-canvas {
  width: 100%;
  height: auto;
  display: block;
}

/* Mobile: sidebar on top, smaller */
@media (max-width: 767px) {
  #main-area {
    flex-direction: column;
  }
  #sidebar {
    width: 100%;
    height: auto;
  }
  #visual-panel {
    width: 160px;
  }
}

/* IRC-style chat log */
#chat-log {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  background: #161616;
  border: 1px solid #2a2a2a;
  padding: 8px;
  gap: 10px;
}

/* Individual chat message */
.chat-msg {
  flex-shrink: 0;
  padding-bottom: 12px;
  border-bottom: 1px solid #333;
  margin-bottom: 4px;
}

.chat-msg-wrapper {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

/* Avatar column: image + timer overlay + name label */
.chat-msg-avatar-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  flex-shrink: 0;
  width: 80px;
}

.chat-msg-avatar {
  width: 80px;
  height: 80px;
  position: relative;
  background: #151515;
  background-size: cover;
  background-position: center;
  border: 1px solid #2a2a2a;
  overflow: hidden;
}

.chat-msg.self .chat-msg-avatar {
  border-color: #3a3a3a;
}

/* Timer overlay — clinical, harsh, monospace */
.chat-msg-timer {
  position: absolute;
  top: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.85);
  color: #999;
  font-family: 'Courier New', monospace;
  font-size: 9px;
  font-weight: bold;
  padding: 1px 4px;
  letter-spacing: 1px;
  border-left: 1px solid #333;
  border-bottom: 1px solid #333;
  text-transform: uppercase;
  pointer-events: none;
}

/* Name label below avatar */
.chat-msg-name-label {
  font-family: 'Courier New', monospace;
  font-size: 9px;
  color: #777;
  text-align: center;
  letter-spacing: 1px;
  text-transform: uppercase;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0 2px;
}

.chat-msg.self .chat-msg-name-label {
  color: #999;
}

/* Per-character glitch pulse on avatar (during text animation) */
.chat-msg-avatar.glitching {
  animation: avatarGlitch 0.12s ease-out;
  filter: contrast(1.3) brightness(1.15);
}

@keyframes avatarGlitch {
  0%   { transform: scale(1.12) translate(-2px, 1px); filter: contrast(1.5) brightness(1.2); }
  50%  { transform: scale(0.94) translate(2px, -1px); }
  100% { transform: scale(1.0)  translate(0, 0); filter: contrast(1.0); }
}


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

.chat-msg-header {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}

.chat-msg-name {
  color: #fff;
  font-size: 16px;
  font-weight: bold;
  letter-spacing: 1px;
}

.chat-msg.self .chat-msg-name {
  color: #fff;
}

.chat-msg-time {
  color: #aaa;
  font-size: 12px;
}

.chat-msg-confidence {
  color: #999;
  font-size: 11px;
}

/* Waveform */
.chat-msg-waveform {
  width: 100%;
  height: 80px;
  display: block;
  background: #141414;
  border: 1px solid #2a2a2a;
  margin: 6px 0;
}

/* Decoded text */
.chat-msg-text {
  font-size: 18px;
  color: #fff;
  line-height: 1.6;
  word-break: break-word;
}

.chat-msg-text .cursor {
  animation: blink 600ms step-end infinite;
  color: #888;
}

/* System messages */
.chat-system {
  color: #888;
  font-size: 12px;
  padding: 4px 0;
  flex-shrink: 0;
  border-bottom: 1px solid #111;
}

@keyframes blink {
  50% { opacity: 0; }
}

/* Input area */
#input-area {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 12px;
  background: #1e1e1e;
  border-top: 2px solid #555;
  border-bottom: 2px solid #555;
  flex-shrink: 0;
}

#prompt {
  color: #555;
  font-size: 18px;
}

#input {
  flex: 1;
  background: transparent;
  border: none;
  color: #fff;
  font-family: inherit;
  font-size: 18px;
  outline: none;
  caret-color: #888;
  min-width: 0;
}

#input::placeholder { color: #666; font-style: italic; }
#input:disabled { color: #444; }

#btn-send {
  background: #1a1a1a;
  border: 1px solid #333;
  color: #888;
  padding: 8px 16px;
  font-family: inherit;
  font-size: 13px;
  letter-spacing: 2px;
  cursor: pointer;
  flex-shrink: 0;
}

#btn-send:hover {
  background: #252525;
  color: #bbb;
}

/* Scrollbar */
#swim-lanes::-webkit-scrollbar { width: 4px; }
#swim-lanes::-webkit-scrollbar-track { background: #141414; }
#swim-lanes::-webkit-scrollbar-thumb { background: #252525; }
