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

:root {
  --bg: #0f0f0f; --bg2: #1a1a1a; --bg3: #242424;
  --border: #333; --text: #e0e0e0; --text2: #999;
  --accent: #e50914; --brb: #f59e0b; --replay: #3b82f6;
}

body { background: var(--bg); color: var(--text); font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; min-height: 100vh; }

/* LOGIN */
.login-page { display: flex; align-items: center; justify-content: center; }
.login-container { width: 100%; max-width: 400px; padding: 20px; }
.login-box { background: var(--bg2); border: 1px solid var(--border); border-radius: 12px; padding: 40px; text-align: center; }
.login-box h1 { font-size: 2rem; margin-bottom: 8px; }
.login-box p { color: var(--text2); margin-bottom: 30px; }
.form-group { margin-bottom: 16px; }
.form-group input { width: 100%; padding: 12px 16px; background: var(--bg3); border: 1px solid var(--border); border-radius: 8px; color: var(--text); font-size: 1rem; outline: none; transition: border-color .2s; }
.form-group input:focus { border-color: var(--accent); }
button[type="submit"] { width: 100%; padding: 12px; background: var(--accent); border: none; border-radius: 8px; color: white; font-size: 1rem; font-weight: 600; cursor: pointer; transition: opacity .2s; }
button[type="submit"]:hover { opacity: .85; }
button[type="submit"]:disabled { opacity: .5; cursor: not-allowed; }
.error-msg { color: #f87171; margin-top: 12px; font-size: .9rem; }

/* PLAYER PAGE */
.player-page { display: flex; flex-direction: column; height: 100vh; }

header { display: flex; align-items: center; justify-content: space-between; padding: 12px 20px; background: var(--bg2); border-bottom: 1px solid var(--border); flex-shrink: 0; }
.header-left { display: flex; align-items: center; gap: 12px; }
.header-left h1 { font-size: 1.3rem; }
.header-right { display: flex; align-items: center; gap: 16px; }
.clocks { display: flex; gap: 16px; }
.clock { display: flex; align-items: center; gap: 6px; font-size: .9rem; color: var(--text2); }
.btn-logout { padding: 6px 14px; background: transparent; border: 1px solid var(--border); border-radius: 6px; color: var(--text2); cursor: pointer; font-size: .85rem; transition: all .2s; }
.btn-logout:hover { border-color: var(--text); color: var(--text); }

/* BADGES */
.badge { padding: 4px 10px; border-radius: 20px; font-size: .8rem; font-weight: 700; }
.badge-live { background: var(--accent); color: white; }
.badge-brb { background: var(--brb); color: black; }
.badge-replay { background: var(--replay); color: white; }
.badge-offline { background: var(--bg3); color: var(--text2); border: 1px solid var(--border); }

/* MAIN */
main { display: flex; flex: 1; overflow: hidden; }
.player-wrapper { flex: 1; display: flex; align-items: center; justify-content: center; background: #000; overflow: hidden; }
#playerContainer { width: 100%; height: 100%; position: relative; }
.player-section { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.player-section.hidden { display: none; }
video { width: 100%; height: 100%; object-fit: contain; }
.status-screen { text-align: center; padding: 40px; }
.status-icon { font-size: 4rem; margin-bottom: 16px; }
.status-screen h2 { font-size: 1.8rem; margin-bottom: 8px; }
.status-screen p { color: var(--text2); }
.replay-badge { position: absolute; top: 16px; left: 16px; background: var(--replay); color: white; padding: 4px 12px; border-radius: 20px; font-size: .8rem; font-weight: 700; }

/* CHAT */
.chat-wrapper { width: 320px; display: flex; flex-direction: column; background: var(--bg2); border-left: 1px solid var(--border); flex-shrink: 0; }
.chat-header { padding: 14px 16px; font-weight: 600; border-bottom: 1px solid var(--border); }
.chat-messages { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.chat-message { background: var(--bg3); border-radius: 8px; padding: 8px 12px; font-size: .9rem; }
.chat-message .msg-user { font-weight: 600; color: var(--accent); margin-bottom: 2px; font-size: .8rem; }
.chat-message .msg-text { color: var(--text); word-break: break-word; }
.chat-message.is-command .msg-text { color: var(--brb); font-family: monospace; }
.chat-input-area { display: flex; padding: 12px; gap: 8px; border-top: 1px solid var(--border); }
.chat-input-area input { flex: 1; padding: 8px 12px; background: var(--bg3); border: 1px solid var(--border); border-radius: 6px; color: var(--text); font-size: .9rem; outline: none; }
.chat-input-area input:focus { border-color: var(--accent); }
.chat-input-area button { padding: 8px 14px; background: var(--accent); border: none; border-radius: 6px; color: white; cursor: pointer; font-weight: 600; transition: opacity .2s; }
.chat-input-area button:hover { opacity: .85; }

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

@media (max-width: 768px) {
  main { flex-direction: column; }
  .chat-wrapper { width: 100%; height: 280px; border-left: none; border-top: 1px solid var(--border); }
  .clocks { display: none; }
}

.reload-btn {
  position: absolute;
  bottom: 16px;
  right: 16px;
  background: rgba(0,0,0,0.6);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 50%;
  color: white;
  width: 40px;
  height: 40px;
  font-size: 1.2rem;
  cursor: pointer;
  z-index: 10;
  transition: background 0.2s;
}
.reload-btn:hover { background: rgba(255,255,255,0.2); }

/* BRB Video – Controls immer sichtbar */
.brb-video {
  width: 100%;
  height: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
  background: #000;
}
.brb-video.hidden { display: none !important; }

/* Unmute Hinweis für iOS */
.unmute-hint {
  position: absolute;
  bottom: 60px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.7);
  color: white;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  pointer-events: none;
}
.unmute-hint.hidden { display: none !important; }

/* BRB Video: Seekbar ausblenden (Webkit = Chrome/Safari/iOS) */
#brbVideo::-webkit-media-controls-timeline          { display: none !important; }
#brbVideo::-webkit-media-controls-current-time-display { display: none !important; }
#brbVideo::-webkit-media-controls-time-remaining-display { display: none !important; }

/* iOS Autoplay Fallback Overlay */
.brb-play-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 20;
}
.brb-play-overlay.hidden { display: none; }
.brb-play-overlay button {
  padding: 16px 32px;
  background: rgba(0,0,0,0.75);
  border: 2px solid rgba(255,255,255,0.6);
  border-radius: 12px;
  color: white;
  font-size: 1.1rem;
  cursor: pointer;
}
