﻿/* =============================================
   TWITCH IRL DASHBOARD â€“ style.css
   ============================================= */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* Mobile: kein blaues Flash beim Tippen, kein 300ms Delay */
button, a, input, select, label, summary {
  -webkit-tap-highlight-color: transparent;
}
button {
  touch-action: manipulation;
}

:root {
  --bg-0:          #0e0e10;
  --bg-1:          #18181b;
  --bg-2:          #1f1f23;
  --bg-3:          #26262c;
  --border:        #2e2e35;
  --text-1:        #efeff1;
  --text-2:        #adadb8;
  --text-3:        #6e6e7a;
  --purple:        #9147ff;
  --purple-dim:    #5c2fa6;
  --teal:          #00c8af;
  --orange:        #ff6905;
  --gold:          #f2a900;
  --blue:          #5bc8e8;
  --radius-sm:     6px;
  --radius-md:     10px;
  --radius-lg:     14px;
  --header-h:      52px;
  --divider-h:     12px;
  --chat-font-size: 14px;
}

html, body {
  height: 100%;
  overflow: hidden;
  background: var(--bg-0);
  color: var(--text-1);
  font-family: 'Segoe UI Variable', 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* =============================================
   SCREENS (Setup / Login)
   ============================================= */

.screen {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-0);
  z-index: 100;
  padding: 16px;
}

.setup-box,
.login-box {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}

.brand h1 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-1);
}

.brand p {
  color: var(--text-2);
  font-size: 13px;
}

.setup-desc {
  color: var(--text-2);
  text-align: center;
  font-size: 13px;
}

.setup-steps {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--bg-2);
  border-radius: var(--radius-md);
  padding: 16px;
}

.step {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-size: 13px;
  color: var(--text-2);
}

.step-num {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--purple);
  color: white;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.step strong { color: var(--text-1); }

.step code {
  display: inline-block;
  margin-top: 4px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 3px 8px;
  font-family: 'Consolas', monospace;
  font-size: 12px;
  color: var(--teal);
  word-break: break-all;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.input-group label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.input-group input {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: var(--text-1);
  font-size: 14px;
  font-family: 'Consolas', monospace;
  outline: none;
  transition: border-color 0.15s;
}

.input-group input:focus { border-color: var(--purple); }

/* =============================================
   BUTTONS
   ============================================= */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: var(--radius-sm);
  padding: 12px 18px;
  min-height: 44px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s, opacity 0.15s;
  user-select: none;
  white-space: nowrap;
  touch-action: manipulation;
}

.btn:active { transform: scale(0.96); }
.btn-full   { width: 100%; }
.btn-large  { padding: 14px 22px; font-size: 15px; }
.btn-sm     { padding: 7px 14px; min-height: 34px; font-size: 12px; font-weight: 600; }

.voice-test-btn {
  background: var(--bg-3);
  color: var(--text-1);
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.voice-test-btn:hover { background: var(--bg-4, var(--bg-3)); border-color: var(--purple); color: var(--purple); }

.btn-primary {
  background: var(--purple);
  color: white;
}
.btn-primary:hover { background: #a970ff; }

.btn-twitch {
  background: var(--purple);
  color: white;
}
.btn-twitch:hover { background: #a970ff; }

.btn-ghost {
  background: transparent;
  color: var(--text-2);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--bg-2); color: var(--text-1); }

.icon-btn {
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px;
  min-width: 44px;
  min-height: 44px;
  color: var(--text-2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s, transform 0.1s;
  touch-action: manipulation;
}
.icon-btn:hover  { background: var(--bg-2); color: var(--text-1); }
.icon-btn:active { background: var(--bg-3); color: var(--text-1); transform: scale(0.88); }

/* =============================================
   DASHBOARD LAYOUT
   ============================================= */

#dashboard {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Alle direkten und indirekten Flex-Kinder des Dashboards
   dÃ¼rfen unter ihre Inhaltsbreite schrumpfen und nie horizontal Ã¼berlaufen */
#dashboard > * {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

/* --- Header --- */
#header {
  flex: 0 0 var(--header-h);
  height: var(--header-h);
  background: var(--bg-1);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  gap: 12px;
  z-index: 10;
}

#user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

#avatar-wrapper {
  position: relative;
  flex-shrink: 0;
}

#user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--purple);
  display: block;
  cursor: pointer;
  transition: border-color 0.15s, opacity 0.15s;
}
#user-avatar:hover { border-color: var(--text-2); opacity: 0.85; }
#avatar-wrapper.open #user-avatar { border-color: var(--text-1); }

.avatar-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 4px;
  min-width: 140px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  z-index: 200;
  animation: fade-in-down 0.12s ease;
}
.avatar-menu[hidden] { display: none; }

@keyframes fade-in-down {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.avatar-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 9px 12px;
  background: none;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
  transition: background 0.12s, color 0.12s;
}
.avatar-menu-item:hover {
  background: color-mix(in srgb, #e74c3c 12%, var(--bg-3));
  color: #e74c3c;
}
.avatar-menu-item:active { transform: scale(0.97); }

.user-details {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

#user-name {
  font-size: 14px;
  font-weight: 800;
  color: var(--text-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.status-row {
  display: flex;
  align-items: center;
  gap: 4px;
}

.status-label {
  font-size: 10px;
  color: var(--text-3);
  margin-right: 6px;
}

/* Klickbare Panel-View-Toggle im Header */
.status-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-right: 6px;
  user-select: none;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-3);
  transition: background 0.3s;
  flex-shrink: 0;
}
.status-dot.status-connected    { background: #0fca50; }
.status-dot.status-connecting   { background: var(--gold); animation: pulse-dot 1s infinite; }
.status-dot.status-disconnected { background: #e63535; }
.status-dot.status-error        { background: #e63535; }

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.3; }
}

#header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

/* =============================================
   PANEL HEADER (shared)
   ============================================= */

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--bg-1);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 5;
  flex-shrink: 0;
}

.panel-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-2);
}

.panel-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.event-badge {
  background: var(--purple);
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  min-width: 22px;
  text-align: center;
}

.swipe-hint-label {
  font-size: 11px;
  color: var(--text-3);
  font-style: italic;
}

