/* ===================== RESET & BASE ===================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #07070e;
  --bg2: #0d0d18;
  --bg3: #12121f;
  --card: #151525;
  --border: rgba(139, 92, 246, 0.25);
  --purple: #8b5cf6;
  --purple2: #a78bfa;
  --pink: #ec4899;
  --cyan: #22d3ee;
  --green: #22c55e;
  --red: #ef4444;
  --orange: #f59e0b;
  --text: #f1f5f9;
  --text2: #94a3b8;
  --text3: #64748b;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 8px 32px rgba(0,0,0,0.4);
  --glow: 0 0 40px rgba(139, 92, 246, 0.35);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.5;
}

.hidden { display: none !important; }

.accent { color: var(--purple2); }

/* ===================== WELCOME SCREEN ===================== */
#welcome-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  transition: opacity 0.8s ease, visibility 0.8s ease;
}

#welcome-screen.fade-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.welcome-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 40%, rgba(139, 92, 246, 0.18), transparent 70%),
    radial-gradient(ellipse 50% 40% at 20% 80%, rgba(236, 72, 153, 0.1), transparent 60%),
    radial-gradient(ellipse 50% 40% at 80% 20%, rgba(34, 211, 238, 0.08), transparent 60%);
  animation: bgPulse 6s ease-in-out infinite;
}

@keyframes bgPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.welcome-particles {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: var(--purple);
  border-radius: 50%;
  opacity: 0.6;
  animation: floatUp linear infinite;
}

@keyframes floatUp {
  0% { transform: translateY(100vh) scale(0); opacity: 0; }
  10% { opacity: 0.7; }
  90% { opacity: 0.5; }
  100% { transform: translateY(-20vh) scale(1); opacity: 0; }
}

.welcome-content {
  position: relative;
  text-align: center;
  z-index: 2;
}

.logo-ring {
  width: 120px;
  height: 120px;
  margin: 0 auto 2rem;
  border-radius: 50%;
  border: 2px solid var(--purple);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: ringSpin 8s linear infinite;
  box-shadow: 0 0 30px rgba(139, 92, 246, 0.4), inset 0 0 30px rgba(139, 92, 246, 0.15);
}

@keyframes ringSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.logo-core {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--purple), var(--pink));
  display: flex;
  align-items: center;
  justify-content: center;
  animation: ringSpin 8s linear infinite reverse;
  box-shadow: var(--glow);
}

.logo-icon {
  font-size: 2.2rem;
  color: white;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.welcome-title {
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(1.4rem, 4vw, 2.2rem);
  font-weight: 600;
  letter-spacing: 0.35em;
  margin-bottom: 0.5rem;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.15em;
}

.welcome-title .letter {
  display: inline-block;
  opacity: 0;
  transform: translateY(30px);
  animation: letterIn 0.5s ease forwards;
}

.welcome-title .letter:nth-child(1) { animation-delay: 0.3s; }
.welcome-title .letter:nth-child(2) { animation-delay: 0.38s; }
.welcome-title .letter:nth-child(3) { animation-delay: 0.46s; }
.welcome-title .letter:nth-child(4) { animation-delay: 0.54s; }
.welcome-title .letter:nth-child(5) { animation-delay: 0.62s; }
.welcome-title .letter:nth-child(6) { animation-delay: 0.70s; }
.welcome-title .letter:nth-child(7) { animation-delay: 0.78s; }
.welcome-title .letter:nth-child(9) { animation-delay: 0.95s; }
.welcome-title .letter:nth-child(10) { animation-delay: 1.03s; }

@keyframes letterIn {
  to { opacity: 1; transform: translateY(0); }
}

.welcome-brand {
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(2rem, 6vw, 3.5rem);
  font-weight: 800;
  letter-spacing: 0.15em;
  margin-bottom: 2.5rem;
  opacity: 0;
  animation: brandIn 0.8s ease 1.3s forwards;
}

@keyframes brandIn {
  from { opacity: 0; transform: scale(0.8); }
  to { opacity: 1; transform: scale(1); }
}

.brand-word.accent {
  background: linear-gradient(90deg, var(--purple2), var(--pink));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.welcome-loader {
  width: 220px;
  height: 4px;
  background: rgba(139, 92, 246, 0.2);
  border-radius: 4px;
  margin: 0 auto 1rem;
  overflow: hidden;
  opacity: 0;
  animation: brandIn 0.5s ease 1.8s forwards;
}

.loader-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--purple), var(--pink), var(--cyan));
  border-radius: 4px;
  animation: loadBar 2.2s ease 2s forwards;
}

@keyframes loadBar {
  to { width: 100%; }
}

.welcome-sub {
  font-size: 0.9rem;
  color: var(--text2);
  letter-spacing: 0.1em;
  opacity: 0;
  animation: brandIn 0.5s ease 2s forwards;
}

/* ===================== APP ===================== */
#app {
  min-height: 100vh;
  animation: fadeIn 0.6s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ===================== NAVBAR ===================== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1.5rem;
  background: rgba(7, 7, 14, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.05em;
  transition: transform 0.2s;
}

.nav-brand:hover { transform: scale(1.03); }

.nav-icon {
  font-size: 1.4rem;
  color: var(--purple2);
  text-shadow: 0 0 12px var(--purple);
}

.nav-links {
  display: flex;
  gap: 0.5rem;
}

.nav-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text2);
  padding: 0.45rem 1rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.nav-btn:hover {
  color: var(--text);
  background: rgba(139, 92, 246, 0.1);
  border-color: var(--border);
}

.nav-btn.admin-btn {
  border-color: rgba(139, 92, 246, 0.3);
  color: var(--purple2);
}

/* ===================== DASHBOARD ===================== */
.page {
  padding-bottom: 3rem;
}

.hero-video-wrap {
  position: relative;
  width: 100%;
  height: 280px;
  overflow: hidden;
  background: var(--bg2);
}

@media (min-width: 768px) {
  .hero-video-wrap { height: 360px; }
}

#hero-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.55;
}

.video-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1.5rem 1.5rem 2rem;
  background: linear-gradient(to top, rgba(7,7,14,0.95) 0%, rgba(7,7,14,0.4) 50%, transparent 100%);
}

.video-badge {
  display: inline-block;
  width: fit-content;
  background: var(--red);
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  margin-bottom: 0.6rem;
  animation: pulse 1.5s ease-in-out infinite;
}

.video-title {
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(1.3rem, 3.5vw, 1.9rem);
  font-weight: 700;
  margin-bottom: 0.3rem;
}

.video-desc {
  color: var(--text2);
  font-size: 0.9rem;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 1.5rem 1rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.section-header h3 {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.server-stats {
  font-size: 0.85rem;
  color: var(--text2);
}

.server-stats .dot { margin: 0 0.4rem; color: var(--text3); }

/* ===================== SERVER CARDS ===================== */
.servers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
  padding: 0 1.5rem 2rem;
}

.server-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
  position: relative;
}

.server-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--glow);
  border-color: rgba(139, 92, 246, 0.5);
}

.server-img-wrap {
  position: relative;
  height: 160px;
  overflow: hidden;
  background: var(--bg3);
}

.server-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s;
}

.server-card:hover .server-img-wrap img {
  transform: scale(1.06);
}

.server-status {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  text-transform: uppercase;
}

.server-status.available {
  background: rgba(34, 197, 94, 0.2);
  color: var(--green);
  border: 1px solid rgba(34, 197, 94, 0.4);
}

.server-status.full {
  background: rgba(239, 68, 68, 0.2);
  color: var(--red);
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.server-body {
  padding: 1.1rem 1.2rem 1.3rem;
}

.server-name {
  font-family: 'Orbitron', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.server-meta {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  color: var(--text2);
}

.meta-item .icon {
  font-size: 0.95rem;
}

.meta-item strong {
  color: var(--text);
  font-weight: 600;
}

.btn-join {
  width: 100%;
  padding: 0.7rem;
  border: none;
  border-radius: var(--radius-sm);
  font-family: 'Orbitron', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: all 0.25s;
  text-decoration: none;
  display: block;
  text-align: center;
}

.btn-join.available {
  background: linear-gradient(135deg, var(--purple), var(--pink));
  color: white;
  box-shadow: 0 4px 20px rgba(139, 92, 246, 0.35);
}

.btn-join.available:hover {
  transform: scale(1.02);
  box-shadow: 0 6px 28px rgba(139, 92, 246, 0.5);
}

.btn-join.full {
  background: rgba(239, 68, 68, 0.15);
  color: var(--red);
  border: 1px solid rgba(239, 68, 68, 0.3);
  cursor: not-allowed;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 4rem 1.5rem;
  color: var(--text3);
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.4;
}

.empty-state h3 {
  font-family: 'Orbitron', sans-serif;
  color: var(--text2);
  margin-bottom: 0.4rem;
}

/* ===================== ADMIN LOGIN ===================== */
#admin-login {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 60px);
  padding: 2rem;
}

.admin-login-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 400px;
  text-align: center;
  box-shadow: var(--shadow);
}

.admin-login-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.admin-login-card h2 {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.4rem;
  margin-bottom: 0.4rem;
}

.admin-login-card p {
  color: var(--text2);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

.admin-login-card input {
  width: 100%;
  padding: 0.85rem 1rem;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 1rem;
  margin-bottom: 1rem;
  outline: none;
  transition: border-color 0.2s;
  text-align: center;
  letter-spacing: 0.15em;
}

.admin-login-card input:focus {
  border-color: var(--purple);
}

.error-text {
  color: var(--red);
  font-size: 0.85rem;
  margin-top: 0.75rem;
}

/* ===================== ADMIN DASHBOARD ===================== */
.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 1.5rem 0.5rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.admin-header h2 {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.3rem;
}

.admin-tabs {
  display: flex;
  gap: 0.4rem;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
}

.tab-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text2);
  padding: 0.5rem 1.1rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.tab-btn:hover {
  color: var(--text);
  background: rgba(139, 92, 246, 0.08);
}

.tab-btn.active {
  background: rgba(139, 92, 246, 0.15);
  color: var(--purple2);
  border-color: var(--border);
}

.tab-content {
  padding: 1.5rem;
}

.admin-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
}

.admin-card h3 {
  font-family: 'Orbitron', sans-serif;
  font-size: 1rem;
  margin-bottom: 1rem;
  color: var(--purple2);
}

.hint {
  font-size: 0.85rem;
  color: var(--text3);
  margin-bottom: 1rem;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

@media (min-width: 640px) {
  .form-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.form-grid input[type="text"],
.form-grid input[type="number"],
#video-url,
#create-title {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s;
}

.form-grid input:focus,
#video-url:focus,
#create-title:focus {
  border-color: var(--purple);
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--text2);
  cursor: pointer;
  padding: 0.5rem 0;
}

.checkbox-label input {
  width: 18px;
  height: 18px;
  accent-color: var(--purple);
}

.form-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}

.btn-primary {
  background: linear-gradient(135deg, var(--purple), var(--pink));
  color: white;
  border: none;
  padding: 0.7rem 1.4rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.25s;
  box-shadow: 0 4px 16px rgba(139, 92, 246, 0.3);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(139, 92, 246, 0.45);
}

.btn-primary.glow {
  animation: glowPulse 2s ease-in-out infinite;
}

@keyframes glowPulse {
  0%, 100% { box-shadow: 0 4px 20px rgba(139, 92, 246, 0.4); }
  50% { box-shadow: 0 4px 40px rgba(236, 72, 153, 0.5); }
}

.btn-secondary {
  background: transparent;
  color: var(--text2);
  border: 1px solid var(--border);
  padding: 0.7rem 1.2rem;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-secondary:hover {
  background: rgba(139, 92, 246, 0.1);
  color: var(--text);
}

/* Admin list */
.admin-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.admin-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1rem;
  background: var(--bg2);
  border: 1px solid rgba(139, 92, 246, 0.12);
  border-radius: var(--radius-sm);
  flex-wrap: wrap;
}

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

.admin-item-info strong {
  display: block;
  font-size: 0.95rem;
  margin-bottom: 0.2rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-item-info span {
  font-size: 0.8rem;
  color: var(--text3);
}

.admin-item-actions {
  display: flex;
  gap: 0.4rem;
}

.btn-sm {
  padding: 0.4rem 0.7rem;
  font-size: 0.8rem;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s;
}

.btn-edit {
  background: rgba(139, 92, 246, 0.2);
  color: var(--purple2);
}

.btn-edit:hover { background: rgba(139, 92, 246, 0.35); }

.btn-delete {
  background: rgba(239, 68, 68, 0.15);
  color: var(--red);
}

.btn-delete:hover { background: rgba(239, 68, 68, 0.3); }

/* Create result */
.create-result {
  margin-top: 1.5rem;
  padding: 1.25rem;
  background: rgba(34, 197, 94, 0.08);
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-radius: var(--radius-sm);
}

.create-result h4 {
  color: var(--green);
  margin-bottom: 0.75rem;
  font-size: 1rem;
}

.result-link {
  display: flex;
  gap: 0.5rem;
}

.result-link input {
  flex: 1;
  padding: 0.7rem 1rem;
  background: var(--bg);
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.85rem;
  outline: none;
}

.btn-copy {
  background: var(--green);
  color: white;
  border: none;
  padding: 0.7rem 1.1rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  white-space: nowrap;
}

.btn-copy:hover { opacity: 0.9; }

/* Video preview */
.video-preview {
  margin-top: 1rem;
}

.video-preview video {
  width: 100%;
  max-height: 200px;
  border-radius: var(--radius-sm);
  background: var(--bg);
}

/* ===================== TOAST ===================== */
.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.85rem 1.5rem;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 500;
  z-index: 99999;
  opacity: 0;
  transition: all 0.3s ease;
  box-shadow: var(--shadow);
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast.success { border-color: rgba(34, 197, 94, 0.4); }
.toast.error { border-color: rgba(239, 68, 68, 0.4); }

/* ===================== RESPONSIVE ===================== */
@media (max-width: 480px) {
  .navbar { padding: 0.75rem 1rem; }
  .nav-text { font-size: 0.9rem; }
  .servers-grid {
    grid-template-columns: 1fr;
    padding: 0 1rem 2rem;
  }
  .section-header { padding: 1.2rem 1rem 0.8rem; }
  .tab-content { padding: 1rem; }
  .admin-card { padding: 1.1rem; }
}

/* ===================== INSTANCE BAR ===================== */
.instance-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.instance-select-wrap {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex: 1;
  min-width: 200px;
}

.instance-select-wrap label {
  font-size: 0.85rem;
  color: var(--text2);
  white-space: nowrap;
}

.instance-select-wrap select {
  flex: 1;
  padding: 0.6rem 0.9rem;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.9rem;
  outline: none;
  cursor: pointer;
}

.instance-select-wrap select:focus {
  border-color: var(--purple);
}

/* Field labels for admin forms */
.field-label {
  display: block;
  font-size: 0.8rem;
  color: var(--text2);
  margin: 0.75rem 0 0.35rem;
  font-weight: 500;
}

.field-label:first-of-type {
  margin-top: 0;
}

#edit-title, #edit-video, #create-title, #create-code {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s;
  margin-bottom: 0.25rem;
}

#edit-title:focus, #edit-video:focus, #create-title:focus, #create-code:focus {
  border-color: var(--purple);
}

.navbar.hidden {
  display: none !important;
}


/* Owner profile bar on public dashboard */
.owner-profile {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.5rem;
  background: linear-gradient(90deg, rgba(139,92,246,0.12), transparent);
  border-bottom: 1px solid var(--border);
}

.owner-avatar-wrap {
  position: relative;
  width: 64px;
  height: 64px;
  flex-shrink: 0;
}

.owner-avatar-wrap img {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg3);
  border: 2px solid var(--purple);
  box-shadow: 0 0 20px rgba(139,92,246,0.4);
}

.avatar-ring {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: var(--pink);
  border-right-color: var(--cyan);
  animation: ringSpin 3s linear infinite;
  pointer-events: none;
}

.owner-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.owner-label {
  font-size: 0.75rem;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.owner-name {
  font-family: 'Orbitron', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--purple2);
  text-decoration: none;
}

.owner-name:hover {
  text-decoration: underline;
  color: var(--pink);
}

/* Admin roblox preview */
.roblox-preview {
  margin-top: 0.75rem;
}

.roblox-preview-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.roblox-preview-card img {
  width: 72px;
  height: 72px;
  border-radius: 12px;
  object-fit: cover;
  background: var(--bg3);
}

.rp-label {
  font-size: 0.8rem;
  color: var(--text2);
  margin-bottom: 0.2rem;
}

.rp-id {
  font-size: 0.85rem;
  color: var(--purple2);
  font-weight: 600;
}

.online-num {
  transition: color 0.3s;
}


/* Floating Discord button */
.discord-float {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9000;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #5865F2;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 24px rgba(88, 101, 242, 0.5);
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
  text-decoration: none;
  animation: discordPulse 2.5s ease-in-out infinite;
}

.discord-float:hover {
  transform: scale(1.1);
  background: #4752c4;
  box-shadow: 0 8px 32px rgba(88, 101, 242, 0.65);
  animation: none;
}

.discord-float.hidden {
  display: none !important;
}

@keyframes discordPulse {
  0%, 100% { box-shadow: 0 6px 24px rgba(88, 101, 242, 0.45); }
  50% { box-shadow: 0 6px 32px rgba(88, 101, 242, 0.75); }
}

@media (max-width: 480px) {
  .discord-float {
    bottom: 1rem;
    right: 1rem;
    width: 50px;
    height: 50px;
  }
}


a.owner-profile {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}
a.owner-profile:hover .owner-name {
  color: var(--pink);
  text-decoration: underline;
}


/* Fancy input boxes */
.input-box {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  padding: 0.9rem 1rem;
  margin: 0.75rem 0;
  background: linear-gradient(135deg, rgba(139,92,246,0.08), rgba(236,72,153,0.05));
  border: 1px solid rgba(139,92,246,0.28);
  border-radius: 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.input-box:focus-within {
  border-color: rgba(139,92,246,0.6);
  box-shadow: 0 0 0 3px rgba(139,92,246,0.12);
}
.input-box.discord-box {
  background: linear-gradient(135deg, rgba(88,101,242,0.12), rgba(88,101,242,0.04));
  border-color: rgba(88,101,242,0.35);
}
.input-box-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(139,92,246,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}
.discord-box .input-box-icon {
  background: rgba(88,101,242,0.2);
}
.input-box-body {
  flex: 1;
  min-width: 0;
}
.input-box-body .field-label {
  margin-top: 0;
  margin-bottom: 0.35rem;
}
.input-box-body input[type="text"],
.input-box-body textarea {
  width: 100%;
  padding: 0.65rem 0.85rem;
  background: var(--bg);
  border: 1px solid rgba(139,92,246,0.2);
  border-radius: 10px;
  color: var(--text);
  font-size: 0.9rem;
  outline: none;
  font-family: inherit;
  resize: vertical;
}
.input-box-body input:focus,
.input-box-body textarea:focus {
  border-color: var(--purple);
}
.input-hint {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.75rem;
  color: var(--text3);
  line-height: 1.35;
}

/* Owner profile bar + JOIN */
.owner-profile {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.5rem;
  background: linear-gradient(90deg, rgba(139,92,246,0.14), transparent);
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
}
.owner-left {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 0;
}
.btn-owner-join {
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--purple), var(--pink));
  color: #fff !important;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  padding: 0.65rem 1.25rem;
  border-radius: 10px;
  text-decoration: none;
  box-shadow: 0 4px 18px rgba(139,92,246,0.4);
  transition: transform 0.2s, box-shadow 0.2s;
}
.btn-owner-join:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 24px rgba(236,72,153,0.45);
}

/* Link preview card */
.link-preview-card {
  display: flex;
  gap: 0.9rem;
  align-items: center;
  padding: 0.9rem;
  margin-top: 0.75rem;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 14px;
}
.link-preview-card img {
  width: 72px;
  height: 72px;
  border-radius: 14px;
  object-fit: cover;
  background: var(--bg3);
  flex-shrink: 0;
}
.lpc-body { min-width: 0; }
.lpc-click {
  font-size: 0.78rem;
  color: var(--green);
  margin-top: 0.3rem;
  word-break: break-all;
}
.lpc-src {
  font-size: 0.72rem;
  color: var(--text3);
  margin-top: 0.2rem;
  word-break: break-all;
}

/* Player avatars on server cards */
.player-avatars {
  display: flex;
  align-items: center;
  padding: 0 1.2rem 0.9rem;
  margin-top: -0.25rem;
}
.player-av {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--card);
  margin-left: -8px;
  background: var(--bg3);
  box-shadow: 0 0 0 1px rgba(139,92,246,0.25);
}
.player-avatars .player-av:first-child {
  margin-left: 0;
}
.player-more {
  margin-left: 0.4rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text2);
  background: rgba(139,92,246,0.15);
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
}
.players-preview {
  margin-top: 0.6rem;
}
.players-preview-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}
.players-preview-row .player-av {
  margin-left: 0;
  width: 36px;
  height: 36px;
}




/* Home mode tabs SERVER CONDO / CONDO VIDEO */
.home-mode-tabs {
  display: flex;
  gap: 0.6rem;
  justify-content: center;
  flex-wrap: wrap;
  padding: 1.1rem 1.25rem 0.25rem;
}
.mode-tab {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 0.7rem 1.35rem;
  border-radius: 999px;
  border: 1px solid rgba(139,92,246,0.35);
  background: rgba(15,15,28,0.85);
  color: var(--text2);
  cursor: pointer;
  transition: all 0.2s ease;
}
.mode-tab:hover {
  border-color: rgba(236,72,153,0.55);
  color: var(--text);
}
.mode-tab.active {
  background: linear-gradient(135deg, var(--purple), var(--pink));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 6px 22px rgba(139,92,246,0.35);
}

/* Condo video panel */
.panel-video {
  padding: 1rem 1.25rem 2.5rem;
  max-width: 960px;
  margin: 0 auto;
}
.condo-video-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}
.condo-video-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(139,92,246,0.3);
  box-shadow: 0 12px 40px rgba(0,0,0,0.45);
}
.condo-video-frame video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
  display: block;
}
.btn-play-video {
  position: absolute;
  inset: 0;
  margin: auto;
  width: min(200px, 50%);
  height: 64px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(139,92,246,0.95), rgba(236,72,153,0.95));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  cursor: pointer;
  box-shadow: 0 8px 28px rgba(139,92,246,0.45);
  transition: transform 0.2s, box-shadow 0.2s;
  z-index: 2;
}
.btn-play-video:hover {
  transform: scale(1.05);
  box-shadow: 0 10px 32px rgba(236,72,153,0.5);
}
.btn-play-video .play-icon {
  font-size: 1.25rem;
}
.btn-play-video .play-label {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}
.btn-lets-play {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 0.95rem 1.75rem;
  border: none;
  border-radius: 14px;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(135deg, #22c55e, #16a34a);
  box-shadow: 0 8px 28px rgba(34,197,94,0.35);
  transition: transform 0.2s, box-shadow 0.2s;
  width: 100%;
  max-width: 420px;
}
.btn-lets-play:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 12px 32px rgba(34,197,94,0.45);
}

@media (max-width: 600px) {
  .mode-tab {
    font-size: 0.65rem;
    padding: 0.6rem 1rem;
  }
  .btn-play-video {
    height: 56px;
  }
}


/* Multi condo video admin */
.condo-video-admin-list {
  margin: 0.6rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.condo-video-add-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.5rem;
}
.condo-video-add-row input {
  flex: 1;
  min-width: 120px;
  padding: 0.55rem 0.75rem;
  background: var(--bg);
  border: 1px solid rgba(139,92,246,0.25);
  border-radius: 10px;
  color: var(--text);
  font-size: 0.85rem;
}

/* Playlist on public */
.condo-video-playlist {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  max-height: 240px;
  overflow-y: auto;
}
.cv-playlist-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  text-align: left;
  padding: 0.65rem 0.85rem;
  border-radius: 12px;
  border: 1px solid rgba(139,92,246,0.22);
  background: rgba(15,15,28,0.9);
  color: var(--text2);
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.15s, background 0.15s;
}
.cv-playlist-item:hover {
  border-color: rgba(236,72,153,0.45);
  color: var(--text);
}
.cv-playlist-item.active {
  border-color: transparent;
  background: linear-gradient(135deg, rgba(139,92,246,0.35), rgba(236,72,153,0.25));
  color: #fff;
}
.cv-num {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(139,92,246,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}
.cv-name {
  font-size: 0.88rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
