:root {
  --bg: #0e0d12;
  --surface: #17151f;
  --surface-2: #201d2b;
  --surface-3: #2a2638;
  --border: rgba(255, 255, 255, 0.08);
  --text: #f5f2f8;
  --text-muted: #a69eb8;
  --accent: #f45d7a;
  --accent-hover: #ff708c;
  --amber: #f5a962;
  --success: #4ade80;
  --warning: #fbbf24;
  --danger: #f87171;
  --radius: 14px;
  --radius-sm: 10px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: radial-gradient(circle at top left, #1c1626 0%, var(--bg) 55%);
  color: var(--text);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.hidden {
  display: none !important;
}

.accent-star {
  color: var(--amber);
}

/* Butonlar & Girdiler */
.text-input,
.select-input {
  width: 100%;
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.text-input:focus,
.select-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(244, 93, 122, 0.18);
}

.select-input {
  width: auto;
  padding: 7px 10px;
  font-size: 0.85rem;
  cursor: pointer;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.08s ease, background-color 0.15s ease, opacity 0.15s ease;
  white-space: nowrap;
}

.btn:active:not(:disabled) {
  transform: scale(0.98);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-sm {
  padding: 7px 12px;
  font-size: 0.82rem;
}

.btn-full {
  width: 100%;
  margin-top: 8px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #e04667);
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--accent-hover), var(--accent));
}

.btn-secondary {
  background: var(--surface-3);
  color: var(--text);
  border-color: var(--border);
}

.btn-secondary:hover:not(:disabled) {
  background: #353047;
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  border-color: var(--border);
}

.btn-ghost:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.11);
}

.btn-danger-ghost {
  background: rgba(248, 113, 113, 0.09);
  color: #fca5a5;
  border-color: rgba(248, 113, 113, 0.25);
}

.btn-danger-ghost:hover:not(:disabled) {
  background: rgba(248, 113, 113, 0.18);
}

.btn-sharing {
  background: linear-gradient(135deg, var(--accent), #e04667);
  color: #fff;
  border-color: transparent;
}

.btn-sharing:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--accent-hover), var(--accent));
}

.error-banner {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: rgba(248, 113, 113, 0.13);
  border: 1px solid rgba(248, 113, 113, 0.35);
  color: #fecaca;
  font-size: 0.88rem;
}

/* Giriş Ekranı */
.login-view {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 32px 28px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}

.brand-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  color: var(--amber);
  background: rgba(245, 169, 98, 0.14);
  border: 1px solid rgba(245, 169, 98, 0.3);
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 12px;
}

.login-title {
  margin: 0 0 8px;
  font-size: 1.7rem;
}

.login-subtitle {
  margin: 0 0 24px;
  color: var(--text-muted);
  font-size: 0.94rem;
  line-height: 1.5;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.field-label {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Üst Çubuk */
.room-view {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 20px;
  background: rgba(23, 21, 31, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  font-weight: 700;
  font-size: 1.08rem;
  letter-spacing: -0.01em;
}

.sync-badge {
  font-size: 0.76rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
}

.sync-badge.status-ok {
  color: #bbf7d0;
  background: rgba(74, 222, 128, 0.12);
  border-color: rgba(74, 222, 128, 0.3);
}

.sync-badge.status-connecting {
  color: #fde68a;
  background: rgba(251, 191, 36, 0.12);
  border-color: rgba(251, 191, 36, 0.3);
}

.sync-badge.status-error {
  color: #fecaca;
  background: rgba(248, 113, 113, 0.12);
  border-color: rgba(248, 113, 113, 0.3);
}

.presence-list {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.presence-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 0.82rem;
  font-weight: 500;
}

.presence-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 8px rgba(74, 222, 128, 0.7);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Ana Alan Grid */
.workspace-grid {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 18px;
  padding: 18px 20px;
  max-width: 1680px;
  width: 100%;
  margin: 0 auto;
}

.workspace-grid.theater-mode {
  grid-template-columns: 1fr;
}

.workspace-grid.theater-mode .side-panel {
  max-height: 440px;
}

.player-column {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.stage-wrapper {
  width: 100%;
}

.video-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #07060a;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
}

.player-layer,
.player-layer iframe,
#yt-player {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: #000;
}

.screen-banner {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 16;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(14, 13, 18, 0.82);
  border: 1px solid rgba(244, 93, 122, 0.45);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  pointer-events: none;
}

.screen-banner-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ef4444;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.85);
}

.empty-stage {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  background: radial-gradient(circle at center, #1f1a2c 0%, #09080d 75%);
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: 10px;
}

.empty-stage h2 {
  margin: 0 0 6px;
  font-size: 1.25rem;
}

.empty-stage p {
  margin: 0;
  max-width: 420px;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.autoplay-overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  background: rgba(10, 9, 14, 0.8);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.autoplay-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 26px;
  text-align: center;
  max-width: 340px;
}

.autoplay-box p {
  margin: 0 0 14px;
  color: var(--text-muted);
  font-size: 0.94rem;
}

/* Yüzen Emoji Tepkileri */
.reaction-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 15;
}

.floating-reaction {
  position: absolute;
  bottom: 18px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(18, 16, 24, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 1.35rem;
  animation: floatUp 2.6s ease-out forwards;
}

.floating-reaction-name {
  font-size: 0.74rem;
  color: var(--text-muted);
  font-weight: 600;
}

@keyframes floatUp {
  0% {
    opacity: 0;
    transform: translateY(10px) scale(0.8);
  }
  15% {
    opacity: 1;
    transform: translateY(-20px) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(-220px) scale(1.1);
  }
}

/* Medya Çubuğu & Şu An Oynatılan */
.media-bar {
  display: flex;
  gap: 10px;
  align-items: center;
}

.media-input {
  flex: 1;
  min-width: 0;
}

.media-bar-buttons {
  display: flex;
  gap: 8px;
}

.now-playing-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.now-playing-meta {
  min-width: 0;
}

.now-playing-title {
  font-weight: 600;
  font-size: 1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.now-playing-subtitle {
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 0.84rem;
}

.now-playing-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.rate-label {
  color: var(--text-muted);
  font-size: 0.82rem;
}

/* Yan Panel (Sohbet + Sıra) */
.side-panel {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  height: calc(100vh - 102px);
  min-height: 440px;
}

.panel-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}

.tab-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 13px;
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
}

.tab-btn.active {
  color: var(--text);
  border-bottom-color: var(--accent);
  background: rgba(244, 93, 122, 0.06);
}

.tab-badge {
  background: var(--surface-3);
  color: var(--text);
  border-radius: 999px;
  padding: 1px 7px;
  font-size: 0.74rem;
}

.tab-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

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

.chat-msg {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 9px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.chat-msg.is-self {
  background: rgba(244, 93, 122, 0.12);
  border-color: rgba(244, 93, 122, 0.25);
}

.chat-msg-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}

.chat-author {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--amber);
}

.chat-msg.is-self .chat-author {
  color: #fda4af;
}

.chat-time {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.chat-text {
  font-size: 0.91rem;
  line-height: 1.4;
  word-break: break-word;
}

.system-pill {
  align-self: center;
  font-size: 0.78rem;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 12px;
  text-align: center;
}

.typing-indicator {
  padding: 4px 14px;
  font-size: 0.78rem;
  color: var(--text-muted);
  font-style: italic;
}

.reaction-strip {
  display: flex;
  justify-content: space-between;
  gap: 4px;
  padding: 8px 12px;
  border-top: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
}

.reaction-btn {
  flex: 1;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 5px 0;
  font-size: 1.15rem;
  cursor: pointer;
  transition: transform 0.1s ease, background-color 0.15s ease;
}

.reaction-btn:hover {
  background: var(--surface-3);
  transform: scale(1.12);
}

.chat-form {
  display: flex;
  gap: 8px;
  padding: 10px 12px 12px;
  border-top: 1px solid var(--border);
}

.chat-input {
  flex: 1;
  min-width: 0;
  padding: 9px 12px;
}

/* Sıra ve Geçmiş */
.queue-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.section-heading {
  margin: 0 0 8px;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.queue-current-empty,
.muted-note {
  color: var(--text-muted);
  font-size: 0.86rem;
}

.queue-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.queue-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.queue-thumb {
  width: 60px;
  height: 36px;
  object-fit: cover;
  border-radius: 6px;
  background: #000;
  flex-shrink: 0;
}

.queue-item-info {
  flex: 1;
  min-width: 0;
}

.queue-item-title {
  font-size: 0.86rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.queue-item-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.queue-item-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.icon-btn {
  background: var(--surface-3);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 7px;
  font-size: 0.76rem;
  cursor: pointer;
}

.icon-btn:hover {
  background: #3b354f;
}

/* Mobil Uyum */
@media (max-width: 980px) {
  .workspace-grid {
    grid-template-columns: 1fr;
    padding: 12px;
    gap: 14px;
  }

  .side-panel {
    height: 460px;
    min-height: 380px;
  }

  .topbar {
    padding: 10px 12px;
  }

  .media-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .media-bar-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .now-playing-bar {
    flex-direction: column;
    align-items: flex-start;
  }
}
