:root {
  --bg-primary: #313338;
  --bg-surface: #2b2d31;
  --bg-card: #2b2d31;
  --bg-modal: #313338;
  --bg-modal-header: #2b2d31;
  --bg-popover: #232428;
  --border-color: #3b3e45;
  --border-glow: rgba(88, 101, 242, 0.35);
  
  --accent-primary: #5865f2; 
  --accent-hover: #4752c4;
  --accent-glow: rgba(88, 101, 242, 0.4);
  
  --live-red: #da373c;
  --live-glow: rgba(218, 55, 60, 0.45);
  
  --success-green: #23a55a;
  --success-hover: #1f9250;
  --success-glow: rgba(35, 165, 90, 0.4);

  --text-primary: #f2f3f5;
  --text-secondary: #dbdee1;
  --text-muted: #949ba4;
  
  --font-family: 'gg sans', 'Noto Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  overflow-x: hidden;
}

.main-container {
  width: 100%;
  max-width: 1200px;
  height: 92vh;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 1.25rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  animation: fadeIn 0.3s ease-out;
}

.viewer-full-container {
  max-width: 1300px;
  height: 94vh;
}

@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.99); }
  to { opacity: 1; transform: scale(1); }
}

.app-header {
  height: 56px;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #1e1f22;
  background: #2b2d31;
  z-index: 20;
}

.logo-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-icon-ztela {
  width: 2.1rem;
  height: 2.1rem;
  background: linear-gradient(135deg, #6366f1, #a855f7);
  border-radius: 0.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 900;
  font-size: 1.25rem;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.app-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.app-sub {
  font-size: 0.75rem;
  font-weight: 600;
  color: #818cf8;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  padding: 0.1rem 0.5rem;
  border-radius: 9999px;
  text-transform: uppercase;
}

.btn-download-header {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.95rem;
  background: var(--success-green);
  color: #ffffff;
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 700;
  border-radius: 0.5rem;
  box-shadow: 0 2px 10px var(--success-glow);
  transition: all 0.2s ease;
  user-select: none;
}

.btn-download-header:hover {
  background: var(--success-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 15px var(--success-glow);
  color: #ffffff;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.8rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-idle {
  background: rgba(181, 186, 193, 0.1);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.badge-live {
  background: rgba(237, 66, 69, 0.15);
  color: #ff7b7d;
  border: 1px solid var(--live-red);
  box-shadow: 0 0 12px var(--live-glow);
}

.badge-live .pulse-dot {
  width: 0.5rem;
  height: 0.5rem;
  background-color: var(--live-red);
  border-radius: 50%;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(237, 66, 69, 0.7); }
  70% { transform: scale(1.1); box-shadow: 0 0 0 6px rgba(237, 66, 69, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(237, 66, 69, 0); }
}

.stage-area {
  flex: 1;
  position: relative;
  background: #0d0e10;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  width: 100%;
  height: 100%;
}

.viewer-stage-area {
  background: #000000;
}

video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  z-index: 1;
  transition: opacity 0.2s ease;
}

.quality-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  z-index: 2;
  pointer-events: none;
}

.video-live-badge {
  position: absolute;
  top: 18px;
  right: 20px;
  z-index: 25;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.68);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 9999px;
  padding: 6px 14px;
  font-weight: 800;
  font-size: 0.8rem;
  color: #ffffff;
  letter-spacing: 0.06em;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.live-dot-pulse {
  width: 8px;
  height: 8px;
  background-color: var(--live-red);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--live-red);
  animation: pulse 1.5s infinite;
}

.placeholder-view {
  position: absolute;
  inset: 0;
  margin: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  color: var(--text-muted);
  text-align: center;
  padding: 2rem;
  max-width: 500px;
  height: fit-content;
  z-index: 5;
}

.placeholder-view svg {
  width: 4.5rem;
  height: 4.5rem;
  stroke: var(--text-muted);
  opacity: 0.6;
}

.placeholder-view h3 {
  font-size: 1.25rem;
  color: var(--text-primary);
  font-weight: 600;
}

.placeholder-view p {
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--text-secondary);
}

.share-link-banner {
  position: absolute;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(24, 25, 32, 0.95);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-glow);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6);
  padding: 0.5rem 0.75rem 0.5rem 1.25rem;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  gap: 1rem;
  z-index: 30;
  animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
  from { opacity: 0; transform: translate(-50%, -15px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

.share-link-text {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-family: monospace;
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-copy-mini {
  background: var(--accent-primary);
  color: white;
  border: none;
  padding: 0.35rem 0.9rem;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.2s ease;
}

.btn-copy-mini:hover {
  background: var(--accent-hover);
}

.player-controls-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 30;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.88) 0%, rgba(0, 0, 0, 0.45) 60%, transparent 100%);
  padding: 24px 24px 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: auto;
}

.stage-area.controls-hidden {
  cursor: none;
}

.stage-area.controls-hidden .player-controls-overlay,
.stage-area.controls-hidden .video-live-badge {
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
}

.yt-controls-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.yt-controls-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.yt-control-btn {
  background: transparent;
  border: none;
  color: #f2f3f5;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease, color 0.15s ease;
  user-select: none;
}

.yt-control-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  transform: scale(1.08);
}

.yt-volume-control {
  display: flex;
  align-items: center;
  cursor: pointer;
  position: relative;
  padding: 2px 4px;
  border-radius: 9999px;
  transition: background 0.2s ease;
}

.yt-volume-control:hover,
.yt-volume-control.active {
  background: rgba(255, 255, 255, 0.1);
}

.yt-volume-slider-wrap {
  width: 0px;
  opacity: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  transition: width 0.22s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.22s ease, margin 0.22s ease;
  margin-left: 0;
}

.yt-volume-control:hover .yt-volume-slider-wrap,
.yt-volume-control.active .yt-volume-slider-wrap {
  width: 68px;
  opacity: 1;
  margin-left: 6px;
  margin-right: 6px;
}

.yt-volume-range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.35);
  outline: none;
  cursor: pointer;
  transition: background 0.15s;
}

.yt-volume-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #ffffff;
  cursor: pointer;
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.6);
  transition: transform 0.15s ease;
}

.yt-volume-range::-webkit-slider-thumb:hover {
  transform: scale(1.25);
  background: #5865f2;
}

.player-settings-popover {
  position: absolute;
  bottom: calc(100% + 14px);
  right: 0;
  width: 220px;
  background: #232428;
  border: 1px solid #383a40;
  border-radius: 10px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.85);
  padding: 10px;
  z-index: 150;
  animation: popIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.settings-popover-title {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  color: #949ba4;
  letter-spacing: 0.06em;
  padding: 4px 6px 8px 6px;
  border-bottom: 1px solid #2e3035;
  margin-bottom: 6px;
}

.settings-menu-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.settings-group-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: #dbdee1;
  padding: 4px 6px 2px 6px;
}

.settings-options-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.settings-menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: transparent;
  border: none;
  color: #b5bac1;
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
}

.settings-menu-item:hover {
  background: #313338;
  color: #f2f3f5;
}

.settings-menu-item.active {
  background: rgba(88, 101, 242, 0.18);
  color: #ffffff;
  font-weight: 700;
}

.settings-menu-item .item-check {
  font-size: 0.8rem;
  color: #5865f2;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.settings-menu-item.active .item-check {
  opacity: 1;
}

.settings-menu-divider {
  height: 1px;
  background: #2e3035;
  margin: 6px 0;
}

.settings-menu-action {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.25);
  color: #a5b4fc;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.settings-menu-action:hover {
  background: rgba(99, 102, 241, 0.25);
  border-color: rgba(99, 102, 241, 0.5);
  color: #ffffff;
}

.dock-bar-container {
  height: 72px;
  background: #1e1f22;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  border-top: 1px solid #2b2d31;
  position: relative;
  z-index: 40;
}

.dock-info-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 180px;
}

.stream-quality-tag {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent-primary);
  background: rgba(88, 101, 242, 0.15);
  padding: 0.25rem 0.6rem;
  border-radius: 0.4rem;
  border: 1px solid rgba(88, 101, 242, 0.3);
}

.dock-controls-center {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.dock-pill {
  background: var(--bg-card);
  border-radius: 9999px;
  display: flex;
  align-items: center;
  overflow: visible;
  position: relative;
  transition: background 0.2s ease;
}

.dock-pill:hover {
  background: #353744;
}

.dock-btn {
  background: transparent;
  border: none;
  color: var(--text-primary);
  height: 44px;
  padding: 0 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: 9999px;
  transition: all 0.2s ease;
  user-select: none;
}

.dock-btn svg {
  width: 1.25rem;
  height: 1.25rem;
  fill: currentColor;
}

.dock-btn.active {
  color: var(--success-green);
}

.dock-btn.muted {
  color: var(--live-red);
}

.dock-chevron {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  height: 44px;
  padding: 0 0.75rem 0 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 0 9999px 9999px 0;
  transition: color 0.2s ease;
}

.dock-chevron:hover {
  color: var(--text-primary);
}

.dock-chevron svg {
  width: 1rem;
  height: 1rem;
  fill: currentColor;
}

.btn-hangup {
  background: var(--live-red);
  color: white;
  border: none;
  width: 48px;
  height: 44px;
  border-radius: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 15px var(--live-glow);
  transition: all 0.2s ease;
}

.btn-hangup:hover:not(:disabled) {
  background: #da373a;
  transform: scale(1.05);
}

.btn-hangup:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-hangup svg {
  width: 1.3rem;
  height: 1.3rem;
  fill: white;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  animation: fadeIn 0.2s ease-out;
}

.discord-modal {
  width: 90%;
  max-width: 520px;
  background: var(--bg-modal);
  border-radius: 0.85rem;
  border: 1px solid var(--border-color);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.85);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: modalScale 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalScale {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

.modal-mascot-header {
  position: relative;
  background: #2b2d31;
  padding: 1.25rem 1.5rem 0.75rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  border-bottom: 1px solid #1e1f22;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.3rem;
  border-radius: 0.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.modal-close:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.08);
}

.mascot-img-wrap {
  width: 165px;
  height: 105px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-mascot-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.4));
}

.modal-mascot-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.modal-mascot-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.modal-body {
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.settings-group {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.settings-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.pill-selector-group {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
}

.pill-option {
  background: #1e1f22;
  border: 1px solid #383a40;
  padding: 0.6rem 0.4rem;
  border-radius: 0.5rem;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.pill-option:hover:not(.locked) {
  background: #35373c;
  color: var(--text-primary);
}

.pill-option.active {
  background: var(--accent-primary);
  color: white;
  border-color: var(--accent-primary);
  box-shadow: 0 0 12px var(--accent-glow);
}

.pill-selector-fps {
  grid-template-columns: repeat(3, 1fr);
}

.pill-option.locked {
  background: #18191c;
  border-color: #2e3035;
  color: #6d727a;
  cursor: pointer;
  position: relative;
}

.pill-option.locked:hover {
  background: rgba(244, 63, 94, 0.08);
  border-color: rgba(244, 63, 94, 0.3);
  color: #f43f5e;
}

.lock-icon {
  width: 12px;
  height: 12px;
  opacity: 0.75;
}

.locked-advice-banner {
  background: rgba(244, 63, 94, 0.12);
  border: 1px solid rgba(244, 63, 94, 0.35);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  animation: fadeIn 0.2s ease-out;
}

.advice-content {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #f87171;
  line-height: 1.3;
}

.advice-content svg {
  flex-shrink: 0;
}

.btn-advice-download {
  background: #f43f5e;
  color: #ffffff;
  text-decoration: none;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 6px;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.btn-advice-download:hover {
  background: #e11d48;
  transform: scale(1.04);
}

.pulse-shake {
  animation: pulseShake 0.4s ease-in-out;
}

@keyframes pulseShake {
  0% { transform: scale(1); }
  25% { transform: scale(1.02) translateX(-3px); }
  50% { transform: scale(1.02) translateX(3px); }
  75% { transform: scale(1.01) translateX(-2px); }
  100% { transform: scale(1); }
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.25rem 0;
  cursor: pointer;
  user-select: none;
}

.checkbox-row input {
  width: 1.15rem;
  height: 1.15rem;
  accent-color: var(--accent-primary);
  cursor: pointer;
}

.checkbox-row span {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-primary);
}

.modal-footer {
  padding: 1rem 1.5rem;
  background: var(--bg-modal-header);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.85rem;
  border-top: 1px solid var(--border-color);
}

.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border: none;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.6rem 1.2rem;
  border-radius: 0.4rem;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  text-decoration: underline;
}

.btn-primary {
  background: var(--accent-primary);
  color: white;
  border: none;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.65rem 1.4rem;
  border-radius: 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
}

.btn-primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 4px 15px var(--accent-glow);
}

.popover-menu {
  position: absolute;
  bottom: 58px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-popover);
  border: 1px solid var(--border-color);
  border-radius: 0.85rem;
  padding: 0.75rem;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.8);
  min-width: 240px;
  display: none;
  flex-direction: column;
  gap: 0.5rem;
  z-index: 100;
  animation: popIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes popIn {
  from { opacity: 0; transform: translate(-50%, 10px) scale(0.95); }
  to { opacity: 1; transform: translate(-50%, 0) scale(1); }
}

.popover-header {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0.25rem 0.5rem;
  letter-spacing: 0.05em;
}

.popover-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.75rem;
  border-radius: 0.5rem;
  color: var(--text-primary);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease;
}

.popover-item:hover {
  background: var(--accent-primary);
  color: white;
}

.popover-item.active {
  background: rgba(88, 101, 242, 0.2);
  color: var(--text-primary);
  font-weight: 600;
}

.password-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 1.5rem;
  animation: fadeIn 0.25s ease-out;
}

.password-modal-card {
  background: #2b2d31;
  border: 1px solid #3b3e45;
  border-radius: 12px;
  width: 100%;
  max-width: 440px;
  padding: 24px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  gap: 18px;
  animation: popIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.password-modal-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
}

.lock-icon-wrap {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(88, 101, 242, 0.15);
  border: 1px solid rgba(88, 101, 242, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}

.password-modal-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #f2f3f5;
  margin: 0;
}

.password-modal-subtitle {
  font-size: 0.88rem;
  line-height: 1.4;
  color: #949ba4;
  margin: 0;
}

.password-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.password-input-group {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.password-input-group input {
  width: 100%;
  background: #1e1f22;
  border: 1px solid #383a40;
  color: #dbdee1;
  padding: 10px 42px 10px 14px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  outline: none;
  transition: border-color 0.15s, background-color 0.15s;
}

.password-input-group input:focus {
  border-color: #5865F2;
  background: #18191c;
}

.btn-eye-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: #949ba4;
  width: 30px;
  height: 30px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s, background-color 0.15s;
}

.btn-eye-toggle:hover {
  color: #f2f3f5;
  background: #313338;
}

.password-error-text {
  font-size: 0.82rem;
  color: #f47b67;
  font-weight: 500;
  text-align: center;
  background: rgba(244, 123, 103, 0.12);
  border: 1px solid rgba(244, 123, 103, 0.3);
  padding: 6px 12px;
  border-radius: 6px;
}

.btn-unlock-stream {
  background: #5865F2;
  color: #ffffff;
  border: none;
  padding: 12px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s, box-shadow 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-unlock-stream:hover {
  background: #4752c4;
  box-shadow: 0 4px 16px rgba(88, 101, 242, 0.4);
}

.ended-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(30, 31, 34, 0.95);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 40;
  padding: 2rem;
  animation: fadeIn 0.3s ease-out;
}

.ended-card {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  max-width: 620px;
  gap: 24px;
  padding: 28px 32px;
  background: rgba(30, 31, 34, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
  animation: popIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.ended-mascot-wrap {
  flex-shrink: 0;
  width: 140px;
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ended-mascot-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.4));
  pointer-events: none;
}

.ended-text-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  gap: 10px;
  flex: 1;
}

.ended-title {
  font-size: 1.55rem;
  font-weight: 700;
  color: #f2f3f5;
  margin: 0;
  line-height: 1.25;
}

.ended-desc {
  font-size: 0.95rem;
  line-height: 1.6;
  color: #949ba4;
  margin: 0;
}

@media (max-width: 600px) {
  .ended-card {
    flex-direction: column;
    text-align: center;
    padding: 20px;
    gap: 16px;
  }
  .ended-text-wrap {
    align-items: center;
    text-align: center;
  }
  .ended-mascot-wrap {
    width: 110px;
    height: 110px;
  }
}

.unmute-prompt-banner {
  position: absolute;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 35;
  animation: fadeIn 0.3s ease-out;
}

.btn-floating-unmute {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(88, 101, 242, 0.92);
  backdrop-filter: blur(8px);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 10px 18px;
  border-radius: 30px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5), 0 0 15px rgba(88, 101, 242, 0.5);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-floating-unmute:hover {
  background: #4752c4;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6), 0 0 20px rgba(88, 101, 242, 0.7);
}

.btn-floating-unmute:active {
  transform: translateY(0);
}

@media (max-width: 768px) {
  body {
    margin: 0;
    padding: 0;
    overflow: hidden;
    background: #000000;
    height: 100dvh;
    width: 100vw;
  }

  .main-container,
  .viewer-full-container {
    width: 100vw;
    height: 100dvh;
    max-width: 100vw;
    max-height: 100dvh;
    border-radius: 0;
    border: none;
    box-shadow: none;
    margin: 0;
    padding: 0;
  }

  .app-header {
    height: 48px;
    padding: 0 12px;
    background: #1e1f22;
  }

  .app-title {
    font-size: 1rem;
  }

  .app-sub {
    font-size: 0.7rem;
    padding: 0.1rem 0.4rem;
  }

  .btn-download-header {
    display: none; 
  }

  .stage-area,
  .viewer-stage-area {
    flex: 1;
    width: 100vw;
    height: calc(100dvh - 48px);
    background: #000000;
  }

  .stage-area video,
  .quality-canvas {
    object-fit: contain;
  }

  .player-controls-overlay {
    padding: 12px 14px;
  }

  .bottom-left-controls,
  .bottom-right-controls {
    gap: 8px;
  }

  .ctrl-btn {
    width: 36px;
    height: 36px;
  }

  .video-live-badge {
    top: 12px;
    right: 12px;
    padding: 4px 10px;
    font-size: 0.72rem;
  }

  
  :fullscreen,
  :-webkit-full-screen,
  :-moz-full-screen {
    width: 100vw !important;
    height: 100vh !important;
    background: #000000 !important;
  }
}

body.landing-mode {
  background-color: #404eed;
  padding: 0;
  display: block;
  min-height: 100vh;
  overflow-x: hidden;
  overflow-y: auto;
}

.discord-landing {
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: #404eed;
  color: #ffffff;
}

.discord-navbar {
  width: 100%;
  padding: 24px 0;
  z-index: 10;
}

.discord-nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.discord-nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #ffffff;
}

.discord-logo-img {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  object-fit: cover;
}

.discord-logo-text {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -0.5px;
  color: #ffffff;
}

.discord-nav-links {
  display: flex;
  align-items: center;
  gap: 36px;
}

.discord-nav-item {
  color: #ffffff;
  text-decoration: none;
  font-size: 16px;
  font-weight: 600;
  transition: opacity 0.2s ease;
}

.discord-nav-item:hover {
  text-decoration: underline;
  opacity: 0.9;
}

.discord-nav-actions {
  display: flex;
  align-items: center;
}

.discord-btn-login {
  background: #ffffff;
  color: #23272a;
  border: none;
  border-radius: 40px;
  padding: 10px 22px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
  transition: all 0.2s ease;
}

.discord-btn-login:hover {
  color: #404eed;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
  transform: translateY(-1px);
}

.discord-hero-section {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px 80px;
  position: relative;
  overflow: hidden;
}

.discord-hero-bg-left {
  position: absolute;
  left: -20px;
  bottom: -5px;
  width: clamp(540px, 46vw, 840px);
  z-index: 1;
  pointer-events: none;
  user-select: none;
}

.discord-art-left {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
}

.discord-hero-content {
  max-width: 860px;
  margin: 0 auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 2;
}

.discord-hero-title {
  font-size: clamp(34px, 5.2vw, 56px);
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: -0.5px;
  color: #ffffff;
  margin-bottom: 24px;
  text-transform: none;
}

.discord-hero-desc {
  font-size: clamp(16px, 1.8vw, 19px);
  font-weight: 400;
  color: rgba(255, 255, 255, 0.95);
  line-height: 1.65;
  max-width: 780px;
  margin: 0 auto 36px auto;
}

.discord-hero-buttons {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
}

.discord-btn-primary {
  background: #ffffff;
  color: #23272a;
  border-radius: 40px;
  padding: 16px 32px;
  font-size: 17px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  transition: all 0.2s ease;
  border: none;
  cursor: pointer;
}

.discord-btn-primary:hover {
  color: #404eed;
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.25);
}

.discord-btn-secondary {
  background: #23272a;
  color: #ffffff;
  border-radius: 40px;
  padding: 16px 32px;
  font-size: 17px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  transition: all 0.2s ease;
  cursor: pointer;
}

.discord-btn-secondary:hover {
  background: #2f3136;
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.3);
}

@media (max-width: 1180px) {
  .discord-hero-bg-left {
    position: relative;
    left: 0;
    bottom: 0;
    width: 100%;
    max-width: 580px;
    margin: 40px auto 0 auto;
  }
}

@media (max-width: 860px) {
  .discord-nav-links {
    display: none;
  }

  .discord-hero-buttons {
    flex-direction: column;
    width: 100%;
  }

  .discord-btn-primary,
  .discord-btn-secondary {
    width: 100%;
    max-width: 340px;
    justify-content: center;
  }
}


.viewer-page {
  background: #000000;
}

.viewer-layout {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 12px;
  width: 100%;
  max-width: 1392px;
}

.viewer-layout > .main-container {
  flex: 1;
  min-width: 0;
}

.viewer-host-rail {
  width: 116px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 16px 10px;
  background: #2b2d31;
  border: 1px solid #383a40;
  border-radius: 36px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  box-sizing: border-box;
  animation: fadeIn 0.3s ease-out;
}

.host-rail-profile {
  position: relative;
  width: 84px;
  height: 84px;
}

.host-rail-avatar {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  object-fit: cover;
  background: #1e1f22;
  border: 3px solid #5865f2;
  box-sizing: border-box;
}

.host-rail-status {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #23a55a;
  border: 3px solid #2b2d31;
}

.host-rail-status.is-idle {
  background: #f0b232;
}

.host-rail-status.is-dnd {
  background: #f23f43;
}

.host-rail-status.is-offline {
  display: none;
}

.host-rail-guests {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding-top: 10px;
  border-top: 1px solid #383a40;
}

.host-rail-guest {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  max-width: 100%;
}

.host-rail-guest .host-rail-profile,
.host-rail-guest .host-rail-avatar {
  width: 64px;
  height: 64px;
}

.host-rail-guest .host-rail-avatar {
  border-color: #23a55a;
}

.host-rail-guest .host-rail-status {
  width: 18px;
  height: 18px;
}

.host-rail-name {
  max-width: 100%;
  font-size: 14px;
  font-weight: 600;
  color: #dbdee1;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.host-rail-add {
  width: 68px;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 16px;
  background: #5865f2;
  color: #ffffff;
  cursor: pointer;
  transition: background-color 0.15s, transform 0.15s;
}

.host-rail-add:hover {
  background: #4752c4;
  transform: translateY(-1px);
}

.join-call-overlay {
  position: fixed;
  z-index: 200;
}

.join-call-card {
  position: relative;
}

.join-call-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #b5bac1;
  cursor: pointer;
}

.join-call-close:hover {
  background: #35373c;
  color: #ffffff;
}

.join-call-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
}

.join-call-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #5865f2;
  background: #1e1f22;
}

.join-call-handle {
  font-size: 13px;
  color: #949ba4;
}

.join-call-steps {
  margin: 0;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 14px;
  color: #dbdee1;
  line-height: 1.4;
}

.join-call-note {
  font-size: 12px;
  color: #949ba4;
  line-height: 1.5;
}

.join-call-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.join-call-btn {
  text-decoration: none;
  text-align: center;
}

.join-call-btn-secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  border-radius: 6px;
  background: #4e5058;
  color: #ffffff;
  font-size: 14px;
  font-weight: 600;
  transition: background-color 0.15s;
}

.join-call-btn-secondary:hover {
  background: #6d6f78;
}

@media (max-width: 760px) {
  .viewer-layout {
    flex-direction: column;
    align-items: stretch;
  }

  .viewer-host-rail {
    width: auto;
    flex-direction: row;
    justify-content: flex-start;
    padding: 8px 12px;
  }

  .host-rail-name {
    flex: 1;
    text-align: left;
    font-size: 13px;
  }
}

.zc-landing {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  width: 100%;
  padding: 32px 16px;
  box-sizing: border-box;
  background: radial-gradient(ellipse at top, #1e2150 0%, #111214 60%);
}

.zc-landing-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 640px;
  width: 100%;
  text-align: center;
}

.zc-landing-logo {
  width: 88px;
  height: 88px;
  object-fit: contain;
  margin-bottom: 18px;
}

.zc-landing-title {
  margin: 0 0 16px;
  color: #ffffff;
  font-size: 48px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.zc-landing-desc {
  margin: 0 0 32px;
  color: #b5bac1;
  font-size: 17px;
  line-height: 1.6;
}

.zc-landing-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
}

.zc-landing-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 26px;
  border: none;
  border-radius: 12px;
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.12s ease, filter 0.12s ease, box-shadow 0.12s ease;
}

.zc-landing-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
}

.zc-landing-btn--primary {
  background: #5865f2;
  color: #ffffff;
  box-shadow: 0 6px 18px rgba(88, 101, 242, 0.35);
}

.zc-landing-btn--secondary {
  background: #23a55a;
  color: #ffffff;
  box-shadow: 0 6px 18px rgba(35, 165, 90, 0.3);
}

.zc-landing-note {
  margin: 22px 0 0;
  color: #80848e;
  font-size: 13px;
}

@media (max-width: 520px) {
  .zc-landing-title { font-size: 38px; }
  .zc-landing-desc { font-size: 15px; }
  .zc-landing-btn { width: 100%; }
}

.zc-top-promo {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin: 0 auto 12px;
  flex-shrink: 0;
}

.zc-top-promo-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.zc-top-promo-icon {
  width: 60px;
  height: 60px;
  object-fit: contain;
  flex-shrink: 0;
}

.zc-top-banner {
  display: block;
  position: static;
  inset: auto;
  width: 468px;
  max-width: 100%;
  height: 60px;
  object-fit: contain;
  z-index: auto;
  border-radius: 6px;
  flex-shrink: 0;
}

.zc-top-server {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: rgba(24, 25, 32, 0.95);
  border: 1px solid var(--border-glow);
  border-radius: 9999px;
  padding: 0.35rem 0.5rem 0.35rem 1.25rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.zc-top-server-ip strong {
  color: var(--text-primary);
  font-family: monospace;
  font-size: 0.9rem;
}

.zc-top-server-online {
  display: flex;
  align-items: center;
  gap: 6px;
}

.zc-top-server-online i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #23a55a;
}

@media (min-width: 769px) {
  .viewer-page .zc-top-promo {
    display: flex;
  }

  .viewer-page .zc-top-promo ~ .viewer-layout .viewer-full-container {
    height: calc(94vh - 120px);
  }
}
