:root{
  --bg-top:#0b3f6b;
  --bg-bottom:#06325a;
  --accent:#f6c44f;
  --accent-2:#e0a93c;
  --card-bg: rgba(255,255,255,0.04);
  --glass: rgba(255,255,255,0.03);
  --text-light: #f8f9fb;
  --muted: rgba(255,255,255,0.65);
  --radius: 12px;
  --shadow: 0 8px 20px rgba(4,18,36,0.5);
  --glass-border: rgba(255,255,255,0.06);
  --panel-bg: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(0,0,0,0.02));
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
}

/* Reset & basics */
*{box-sizing:border-box}
html,body{height:100%;margin:0;padding:0}
body{
  color:var(--text-light);
  background: linear-gradient(180deg,var(--bg-top) 0%, rgba(8,46,72,0.95) 40%, var(--bg-bottom) 100%);
  background-attachment: fixed;
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
  line-height:1.35;
  font-size:15px;
  overflow-x: hidden;
  min-height: 100vh;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* Container */
.container{
  max-width:1100px;
  margin:0 auto;
  padding:18px;
  width: 100%;
}

/* Top nav */
.topnav{
  position:sticky;
  top:0;
  z-index:30;
  backdrop-filter: blur(6px);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  background: linear-gradient(180deg, rgba(11,63,107,0.95), rgba(6,50,90,0.98));
}

.nav-inner{
  display:flex;
  align-items:center;
  gap:16px;
  flex-wrap: wrap;
  max-width:1100px;
  margin:0 auto;
  padding:12px 18px;
  width: 100%;
  justify-content: space-between;
}

.brand a{ 
  text-decoration:none;
  flex-shrink: 0;
}

.brand .logo{
  font-weight:900;
  font-size:22px;
  color:var(--accent);
  padding:6px 12px;
  border-radius:8px;
  background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(0,0,0,0.04));
  box-shadow: inset 0 -2px 0 rgba(0,0,0,0.2);
  display:inline-block;
  cursor:pointer;
  white-space: nowrap;
  transition: all 300ms ease;
}

/* VIP Logo Styling - Black box with gradient text and animated diamond */
.brand .logo.vip-logo {
  background: #000000;
  border: 2px solid rgba(246, 196, 79, 0.5);
  box-shadow: 0 0 20px rgba(246, 196, 79, 0.3), 0 0 40px rgba(246, 196, 79, 0.1), inset 0 0 20px rgba(246, 196, 79, 0.05);
  animation: vipBoxGlow 2s ease-in-out infinite alternate;
  position: relative;
  overflow: visible;
}

.brand .logo.vip-logo .vip-text {
  background: linear-gradient(135deg, #f6c44f 0%, #0b3f6b 25%, #f6c44f 50%, #06325a 75%, #f6c44f 100%);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: vipTextGradient 3s ease-in-out infinite;
  font-weight: 900;
}

.brand .logo.vip-logo .vip-diamond {
  font-size: 14px;
  animation: vipDiamondSpin 2s ease-in-out infinite;
  filter: drop-shadow(0 0 8px rgba(79, 195, 247, 0.8)) drop-shadow(0 0 15px rgba(246, 196, 79, 0.6));
  display: inline-block;
}

@keyframes vipBoxGlow {
  from { 
    box-shadow: 0 0 15px rgba(246, 196, 79, 0.2), 0 0 30px rgba(246, 196, 79, 0.1), inset 0 0 15px rgba(246, 196, 79, 0.03);
    border-color: rgba(246, 196, 79, 0.4);
  }
  to { 
    box-shadow: 0 0 25px rgba(246, 196, 79, 0.4), 0 0 50px rgba(246, 196, 79, 0.2), inset 0 0 25px rgba(246, 196, 79, 0.08);
    border-color: rgba(246, 196, 79, 0.7);
  }
}

@keyframes vipTextGradient {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes vipDiamondSpin {
  0%, 100% { 
    transform: scale(1) rotate(0deg) translateY(0);
    filter: drop-shadow(0 0 8px rgba(79, 195, 247, 0.8)) drop-shadow(0 0 15px rgba(246, 196, 79, 0.6));
  }
  25% { 
    transform: scale(1.2) rotate(-15deg) translateY(-3px);
    filter: drop-shadow(0 0 12px rgba(79, 195, 247, 1)) drop-shadow(0 0 20px rgba(246, 196, 79, 0.9));
  }
  50% { 
    transform: scale(1.1) rotate(0deg) translateY(-2px);
    filter: drop-shadow(0 0 15px rgba(246, 196, 79, 1)) drop-shadow(0 0 25px rgba(79, 195, 247, 0.8));
  }
  75% { 
    transform: scale(1.2) rotate(15deg) translateY(-3px);
    filter: drop-shadow(0 0 12px rgba(79, 195, 247, 1)) drop-shadow(0 0 20px rgba(246, 196, 79, 0.9));
  }
}

/* Premium Logo Styling - With animated bouncing crown */
.brand .logo.premium-logo {
  background: linear-gradient(135deg, #2a2a3e 0%, #1a1a2e 100%);
  color: #f6c44f;
  box-shadow: 0 0 15px rgba(246, 196, 79, 0.2), inset 0 -2px 0 rgba(0,0,0,0.3);
  border: 1px solid rgba(246, 196, 79, 0.3);
  position: relative;
  overflow: visible;
}

.brand .logo.premium-logo .premium-crown {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 16px;
  animation: premiumCrownBounce 1.5s ease-in-out infinite;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
  z-index: 10;
}

@keyframes premiumCrownBounce {
  0%, 100% { 
    transform: translateX(-50%) translateY(0) rotate(0deg) scale(1);
  }
  15% { 
    transform: translateX(-50%) translateY(-6px) rotate(-8deg) scale(1.1);
  }
  30% { 
    transform: translateX(-50%) translateY(-2px) rotate(0deg) scale(1.05);
  }
  45% { 
    transform: translateX(-50%) translateY(-8px) rotate(8deg) scale(1.15);
  }
  60% { 
    transform: translateX(-50%) translateY(-3px) rotate(0deg) scale(1.08);
  }
  75% { 
    transform: translateX(-50%) translateY(-5px) rotate(-5deg) scale(1.12);
  }
  90% { 
    transform: translateX(-50%) translateY(-1px) rotate(3deg) scale(1.02);
  }
}

/* Admin Logo Styling */
.brand .logo.admin-logo {
  background: linear-gradient(135deg, rgba(239,68,68,0.2), rgba(185,28,28,0.15));
  color: #ef4444;
  box-shadow: 0 0 15px rgba(239,68,68,0.2), inset 0 -2px 0 rgba(0,0,0,0.2);
  border: 1px solid rgba(239,68,68,0.25);
}

.navlinks{
  display:flex;
  gap:8px;
  align-items:center;
  flex-wrap: wrap;
  justify-content: flex-start;
  flex: 1 1 auto;
  min-width: 0;
}

.nav-item{
  color:var(--text-light);
  text-decoration:none;
  padding:8px 10px;
  border-radius:8px;
  opacity:0.95;
  white-space: nowrap;
  font-size: 13px;
  transition: all 220ms ease;
}

.nav-item:hover {
  opacity: 1;
}

.nav-item.active{
  border-bottom:3px solid var(--accent);
  padding-bottom:6px;
}

.nav-cta{
  display:flex;
  gap:8px;
  align-items:center;
  flex-wrap: wrap;
  justify-content: flex-end;
  flex-shrink: 0;
}

/* Avatar in nav */
.nav-avatar{
  width:36px;
  height:36px;
  border-radius:10px;
  background-size:cover;
  background-position:center;
  border:2px solid rgba(255,255,255,0.06);
  cursor:pointer;
  flex-shrink: 0;
}

.nav-dropdown{
  position:absolute;
  right:18px;
  top:58px;
  background: linear-gradient(180deg, rgba(11,63,107,0.98), rgba(6,50,90,0.98));
  padding:8px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,0.12);
  display:none;
  z-index:100000;
  min-width: 180px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 12px 40px rgba(0,0,0,0.4);
}

.nav-dropdown a{
  display:block;
  padding:8px 12px;
  color:var(--text-light);
  text-decoration:none;
  font-size: 11px;
  white-space: nowrap;
  border-radius: 6px;
  transition: all 120ms ease;
}

.nav-dropdown a:hover{
  background: rgba(255,255,255,0.08);
}

.nav-dropdown a:active{
  background: linear-gradient(90deg, rgba(34,197,94,0.3), rgba(22,163,74,0.2));
  color: #4ade80;
}

.nav-dropdown-section{
  padding: 6px 10px !important;
}
.nav-dropdown-section .btn{
  font-size: 10px !important;
  padding: 6px 12px !important;
}
.nav-dropdown-divider{
  height: 1px;
  background: rgba(255,255,255,0.08);
  margin: 6px 0 !important;
}

/* Buttons */
.btn{
  padding:8px 14px;
  border-radius:18px;
  border:0;
  cursor:pointer;
  font-weight:600;
  background:transparent;
  color:var(--text-light);
  text-decoration:none;
  display:inline-block;
  white-space: nowrap;
  font-size: 13px;
  transition: all 220ms ease;
  flex-shrink: 0;
}

.btn.primary{
  background: linear-gradient(180deg,var(--accent), var(--accent-2));
  color:#081829;
  box-shadow: 0 6px 18px rgba(224,169,60,0.12);
}

.btn.ghost{
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.04);
}

.btn:hover {
  transform: translateY(-2px);
}

.btn.filter{
  padding:8px 14px;
}

/* Main */
.main{
  padding-top:18px;
  padding-bottom:40px;
  width: 100%;
}

/* Forms / auth */
.auth{
  display:flex;
  justify-content:center;
  width: 100%;
}

.auth-panel{
  width:100%;
  max-width:720px;
  background:linear-gradient(180deg, rgba(255,255,255,0.02), rgba(0,0,0,0.02));
  padding:18px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,0.03);
}

.oauth-row{
  display:flex;
  gap:10px;
  margin-bottom:12px;
  flex-wrap: wrap;
}

.oauth-row .btn {
  flex: 1 1 auto;
  min-width: 140px;
}

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

.form label{
  display:flex;
  flex-direction:column;
  color:var(--muted);
  font-size: 13px;
}

.form input[type="text"],
.form input[type="password"],
.form input[type="email"],
.form input[type="url"],
.form input[type="number"],
.form input[type="date"],
.form textarea,
.form select{
  padding:10px;
  border-radius:8px;
  border:1px solid rgba(255,255,255,0.04);
  background:rgba(255,255,255,0.02);
  color:var(--text-light);
  font-size: 16px;
  width: 100%;
  margin-top:6px;
  font-family:inherit;
}

.form textarea {
  resize: vertical;
  min-height: 100px;
}

.form .checkbox{
  display:flex;
  align-items:center;
  gap:8px;
  color:var(--muted);
  font-size: 12px;
  margin-top:10px;
}

.form-msg{
  margin-top:8px;
  color:var(--accent);
  font-size: 13px;
}

/* Search */
.search-section{
  margin-top:8px;
  width: 100%;
}

.search-row{
  display:flex;
  gap:12px;
  align-items:center;
  flex-wrap: wrap;
  width: 100%;
}

.search-input{
  flex:1;
  min-width: 150px;
  padding:12px 18px;
  border-radius:28px;
  border:1px solid var(--glass-border);
  background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(0,0,0,0.02));
  color:var(--text-light);
  outline:none;
  font-size: 14px;
}

.select{
  padding:10px 12px;
  border-radius:8px;
  background:rgba(255,255,255,0.02);
  border:1px solid rgba(255,255,255,0.04);
  color:var(--text-light);
  margin-top:10px;
  position:relative;
  z-index:1000;
  font-size: 13px;
  max-width: 100%;
  font-family:inherit;
}

select, .select {
  -webkit-appearance: menulist;
  appearance: menulist;
  color: var(--text-light);
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.04);
  transition: box-shadow 160ms ease;
}

select:focus, .select:focus {
  outline: none;
  box-shadow: 0 6px 18px rgba(0,0,0,0.35);
  z-index: 100000;
}

option {
  background: #081829;
  color: var(--text-light);
  padding:6px 10px;
}

/* Hero */
.hero{
  margin-top:18px;
  padding:20px;
  border-radius:12px;
  background: linear-gradient(90deg, rgba(246,196,79,0.12), rgba(255,255,255,0.02));
  text-align:center;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255,255,255,0.03);
  width: 100%;
}

.hero h1{
  margin:0;
  font-size:clamp(18px, 5vw, 28px);
  color:var(--accent);
  text-shadow:0 2px 12px rgba(0,0,0,0.5);
}

.hero p{
  margin:8px 0 0;
  color:var(--muted);
  font-size: clamp(13px, 3vw, 15px);
}

/* Featured */
.featured{
  margin-top:22px;
  width: 100%;
}

.featured h2{
  margin:8px 0 14px;
  color:var(--accent);
  font-size: clamp(16px, 4vw, 20px);
}

.grid{
  display:grid;
  gap:12px;
  width: 100%;
}

.featured-grid{
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  display:grid;
  gap:12px;
  width: 100%;
}

.thumb{
  border-radius:10px;
  overflow:hidden;
  background:var(--card-bg);
  border:1px solid rgba(255,255,255,0.03);
  position:relative;
  min-width: 0;
}

.thumb-img{
  width:100%;
  padding-top:56%;
  background-size:cover;
  background-position:center;
  filter: blur(0.4px) saturate(0.98);
  transition: transform 220ms ease;
}

.thumb:focus .thumb-img, .thumb:hover .thumb-img{
  transform: scale(1.03);
}

.thumb-caption{
  padding:8px;
  color:var(--muted);
  font-size:11px;
  background:linear-gradient(180deg,rgba(0,0,0,0.03),transparent);
  min-height: 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  word-wrap: break-word;
}

/* Categories chips */
.categories{
  margin-top:22px;
  width: 100%;
}

.chips{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-top:10px;
  width: 100%;
  justify-content: flex-start;
}

.chip{
  background:linear-gradient(180deg, rgba(255,255,255,0.03), rgba(0,0,0,0.04));
  border-radius:12px;
  padding:8px 14px;
  border:1px solid rgba(255,255,255,0.08);
  color:var(--text-light);
  font-weight:600;
  cursor:pointer;
  font-size: 12px;
  white-space: nowrap;
  transition: all 0.2s ease;
}
.chip:hover{
  background:rgba(246,196,79,0.1);
  border-color:rgba(246,196,79,0.3);
}
.chip.active{
  background:var(--accent);
  color:#000;
  border-color:var(--accent);
  font-weight:700;
}

/* Live now row */
.live-now{
  margin-top:28px;
  width: 100%;
}

.live-row{
  display:grid;
  gap:12px;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  width: 100%;
  padding-bottom:8px;
}

.live-card{
  min-width: 0;
  background:var(--card-bg);
  border-radius:12px;
  border:1px solid rgba(255,255,255,0.03);
  box-shadow:0 8px 18px rgba(3,12,26,0.45);
  overflow: hidden;
}

.live-thumb{
  padding-top:56%;
  background-size:cover;
  background-position:center;
  border-radius:12px 12px 0 0;
  position:relative;
  overflow:hidden;
  width: 100%;
}

.badge.live{
  position:absolute;
  left:10px;
  top:10px;
  background:linear-gradient(90deg,#ff4d4d,#ff6f6f);
  padding:6px 9px;
  border-radius:6px;
  font-weight:700;
  color:white;
  display:inline-block;
  font-size: 11px;
}

.live-meta{
  padding:10px;
}

.live-title{
  font-weight:700;
  color:var(--text-light);
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Live grid larger */
.live-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(140px,1fr));
  gap:12px;
  width: 100%;
}

.live-card-large{
  background:var(--card-bg);
  border-radius:12px;
  border:1px solid rgba(255,255,255,0.03);
  overflow:hidden;
  min-width: 0;
}

.live-card-large .live-thumb{
  padding-top:42%;
}

.thumb-caption-small{
  color:var(--muted);
  font-size:11px;
  padding:6px;
}

/* Profile */
.profile-top{
  display:flex;
  gap:16px;
  align-items:center;
  flex-wrap: wrap;
}

.avatar{
  width:96px;
  height:96px;
  border-radius:12px;
  background-size:cover;
  background-position:center;
  border:1px solid rgba(255,255,255,0.04);
  flex-shrink: 0;
}

.profile-info h1{
  margin:0;
  font-size:20px;
}

.profile-stats{
  display:flex;
  gap:12px;
  color:var(--muted);
  margin-top:6px;
  flex-wrap: wrap;
  font-size: 12px;
}

.profile-banner{
  width: 100%;
}

/* Profile page sections */
.cover {
  height:160px;
  background-size:cover;
  background-position:center;
  position:relative;
  width: 100%;
}

.profile-meta {
  display:flex;
  gap:16px;
  padding:16px;
  align-items:center;
  flex-wrap: wrap;
}

.profile-meta .avatar {
  width:80px;
  height:80px;
}

.profile-actions {
  margin-left:auto;
  display:flex;
  gap:8px;
  flex-wrap: wrap;
}

/* Content grids */
#userContentGrid,
#premiumList,
.recent-grid,
.content-grid {
  display: grid;
  gap:12px;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  width: 100%;
}

/* Wallet */
.wallet-summary{
  display:flex;
  gap:12px;
  flex-wrap:wrap;
  width: 100%;
}

.wallet-card{
  flex:1;
  min-width:200px;
  background:linear-gradient(180deg, rgba(255,255,255,0.02), rgba(0,0,0,0.02));
  padding:12px;
  border-radius:10px;
  border:1px solid rgba(255,255,255,0.03);
}

.wallet-label{
  color:var(--muted);
  font-size: 11px;
}

.wallet-value{
  font-weight:800;
  font-size:20px;
  margin-top:6px;
}

/* Wallet page specific */
.wallet-hero{
  display:flex;
  gap:18px;
  align-items:center;
  justify-content:space-between;
  padding:20px;
  border-radius:12px;
  background: linear-gradient(90deg, rgba(6,56,97,0.25), rgba(6,50,82,0.15));
  border: 1px solid rgba(255,255,255,0.03);
  box-shadow: 0 12px 40px rgba(2,8,24,0.45);
  margin-bottom:18px;
  flex-wrap: wrap;
  width: 100%;
}

.wallet-summary-grid{
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap:14px;
  width:100%;
  align-items:stretch;
}

.wallet-card-hero{
  padding:14px;
  border-radius:12px;
  background:linear-gradient(180deg, rgba(255,255,255,0.02), rgba(0,0,0,0.02));
  border:1px solid rgba(255,255,255,0.04);
  display:flex;
  flex-direction:column;
  gap:10px;
  align-items:flex-start;
  min-width: 0;
}

.wallet-value-large{
  font-weight:900;
  font-size:clamp(18px, 4vw, 24px);
  color:var(--accent);
}

.wallet-sub{
  color:var(--muted);
  font-size:12px;
}

.wallet-actions{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  margin-top:6px;
  width: 100%;
}

.action-btn{
  min-width:90px;
  font-size: 12px;
  flex: 1 1 auto;
}

.token-box{
  display:flex;
  gap:12px;
  align-items:center;
  flex-wrap: wrap;
}

.token-bubble{
  background:linear-gradient(90deg,var(--accent),var(--accent-2));
  color:#081829;
  padding:8px 12px;
  border-radius:12px;
  font-weight:800;
  box-shadow:0 8px 18px rgba(224,169,60,0.12);
  white-space: nowrap;
  font-size: 12px;
}

.tx-panel{
  margin-top:14px;
  background:linear-gradient(180deg, rgba(255,255,255,0.01), rgba(0,0,0,0.02));
  padding:12px;
  border-radius:10px;
  border:1px solid rgba(255,255,255,0.03);
  width: 100%;
  overflow-x: auto;
}

.tx-table{
  width:100%;
  border-collapse:collapse;
  min-width: 400px;
}

.tx-table th,.tx-table td{
  padding:8px;
  text-align:left;
  border-bottom:1px dashed rgba(255,255,255,0.03);
  color:var(--muted);
  font-size:12px;
}

.tx-type{
  font-weight:700;
  color:var(--text-light);
}

.tx-amount{
  font-weight:800;
  color:var(--accent);
}

.referral-box{
  margin-top:12px;
  padding:12px;
  border-radius:10px;
  background:linear-gradient(180deg, rgba(255,255,255,0.01), rgba(0,0,0,0.02));
  border:1px solid rgba(255,255,255,0.03);
  width: 100%;
}

.ref-code{
  font-weight:900;
  color:var(--accent);
  letter-spacing:1px;
  font-size: 14px;
  word-break: break-all;
}

/* Upload */
.upload-hero{
  display:flex;
  gap:18px;
  align-items:flex-start;
  flex-wrap:wrap;
  width: 100%;
}

.upload-preview{
  max-width:360px;
  width: 100%;
  border-radius:12px;
  overflow:hidden;
  border:1px solid rgba(255,255,255,0.05);
  background:linear-gradient(180deg, rgba(255,255,255,0.01), rgba(0,0,0,0.02));
  box-shadow:0 10px 30px rgba(3,9,20,0.45);
}

.big-upload-btn{
  padding:12px 20px;
  border-radius:26px;
  font-size:13px;
  font-weight:800;
  background:linear-gradient(90deg,var(--accent),var(--accent-2));
  color:#081829;
  border:none;
  cursor:pointer;
  box-shadow:0 10px 30px rgba(224,169,60,0.14);
  white-space: nowrap;
}

/* Comments */
.comment-row{
  display:flex;
  gap:10px;
  align-items:flex-start;
  padding:10px;
  border-radius:10px;
  background:linear-gradient(180deg, rgba(255,255,255,0.01), rgba(0,0,0,0.02));
  margin-bottom:8px;
  flex-wrap: wrap;
}

.comment-avatar{
  width:40px;
  height:40px;
  border-radius:8px;
  background-size:cover;
  background-position:center;
  border:1px solid rgba(255,255,255,0.04);
  flex-shrink: 0;
}

.comment-body{
  flex:1;
  min-width: 150px;
}

/* Chat messages */
.chat-msg{
  padding:8px;
  border-radius:8px;
  margin-bottom:8px;
  background:rgba(255,255,255,0.02);
  font-size: 12px;
  word-break: break-word;
  overflow-wrap: break-word;
}

/* Video page */
.player-wrap{
  background:rgba(0,0,0,0.6);
  border-radius:8px;
  padding:8px;
  width: 100%;
}

.video-meta{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  margin-top:10px;
  flex-wrap:wrap;
  width: 100%;
}

.video-actions{
  display:flex;
  gap:6px;
  flex-wrap: wrap;
}

.related-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(130px,1fr));
  gap:12px;
  margin-top:12px;
  width: 100%;
}

.video-16by9 {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  border-radius:8px;
  overflow:hidden;
  background:#000;
}

.video-16by9 > video,
.video-16by9 > iframe {
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  border:0;
  display:block;
}

.stat {
  color:var(--muted);
  font-size:11px;
  margin-right:6px;
  white-space: nowrap;
}

.emoji-btn {
  font-size:15px;
  padding:6px 8px;
  border-radius:8px;
  cursor:pointer;
  border: 1px solid rgba(255,255,255,0.04);
  background: rgba(255,255,255,0.02);
  color: var(--text-light);
  flex-shrink: 0;
}

.emoji-btn.active {
  background: rgba(246,196,79,0.12);
}

/* Subscriptions */
.subscriptions-hero{
  padding:20px;
  border-radius:12px;
  margin-bottom:18px;
  background: linear-gradient(90deg, rgba(246,196,79,0.12), rgba(255,255,255,0.02));
  box-shadow: 0 10px 30px rgba(2,10,30,0.45);
  display:flex;
  gap:20px;
  align-items:center;
  justify-content:space-between;
  flex-wrap:wrap;
  width: 100%;
}

.subscriptions-hero h1{
  margin:0;
  color:var(--accent);
  font-size:clamp(18px, 5vw, 24px);
}

.subscriptions-hero p{
  margin:4px 0 0;
  color:var(--muted);
  max-width:640px;
  font-size: 13px;
}

.billing-toggle{
  display:inline-flex;
  background:rgba(255,255,255,0.03);
  padding:6px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,0.04);
  gap:6px;
  align-items:center;
  flex-wrap: wrap;
}

.billing-toggle button{
  border:0;
  background:transparent;
  color:var(--muted);
  padding:6px 10px;
  border-radius:999px;
  cursor:pointer;
  font-weight:700;
  font-size: 12px;
  white-space: nowrap;
}

.billing-toggle button.active{
  background:linear-gradient(90deg,var(--accent),var(--accent-2));
  color:#081829;
  box-shadow:0 6px 18px rgba(224,169,60,0.12);
}

.plans-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(200px,1fr));
  gap:16px;
  margin-top:18px;
  width: 100%;
}

.plan-card{
  background: linear-gradient(180deg, rgba(255,255,255,0.015), rgba(0,0,0,0.02));
  border-radius:12px;
  padding:16px;
  border:1px solid rgba(255,255,255,0.04);
  display:flex;
  flex-direction:column;
  gap:12px;
  align-items:stretch;
  position:relative;
  transition:transform 220ms ease, box-shadow 220ms ease;
}

.plan-card:hover{
  transform:translateY(-6px);
  box-shadow: 0 18px 40px rgba(3,12,26,0.45);
}

.plan-ribbon{
  position:absolute;
  left:-12px;
  top:12px;
  transform:rotate(-12deg);
  background:var(--accent);
  color:#081829;
  padding:6px 14px;
  font-weight:800;
  border-radius:6px;
  box-shadow:0 6px 18px rgba(224,169,60,0.12);
  font-size: 10px;
  white-space: nowrap;
}

.plan-title{
  font-size:15px;
  font-weight:800;
  color:var(--text-light);
  display:flex;
  align-items:center;
  gap:10px;
}

.plan-price{
  font-size:16px;
  font-weight:900;
  color:var(--accent);
}

.plan-features{
  color:var(--muted);
  font-size:12px;
  display:flex;
  flex-direction:column;
  gap:6px;
  margin-top:8px;
}

.plan-cta{
  display:flex;
  gap:6px;
  margin-top:10px;
  align-items:center;
  flex-wrap:wrap;
}

.plan-bonus{
  font-size:11px;
  color:#ffdFA8;
  font-weight:700;
}

.most-popular{
  border:2px solid rgba(246,196,79,0.18);
  transform:scale(1.02);
}

.subscribe-btn {
  min-width: 90px;
  flex: 1 1 auto;
}

/* Modals */
.modal-overlay{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,0.6);
  backdrop-filter: blur(8px);
  display:none;
  align-items:center;
  justify-content:center;
  z-index:300;
  padding: 16px;
  overflow-y: auto;
}

.modal-overlay.open {
  display: flex;
}

.modal-panel{
  width:100%;
  max-width:520px;
  background: linear-gradient(180deg, #0b3f6b 0%, #06325a 100%);
  padding:18px;
  border-radius:12px;
  border:1px solid rgba(246,196,79,0.2);
  color:var(--text-light);
  margin: auto;
  box-shadow: 0 20px 50px rgba(0,0,0,0.5), 0 0 0 1px rgba(246,196,79,0.1);
}

.modal-row{
  display:flex;
  gap:10px;
  margin-top:10px;
  align-items:center;
  flex-wrap: wrap;
}

.modal-row label {
  flex: 1;
  min-width: 150px;
}

.modal-actions{
  display:flex;
  gap:8px;
  justify-content:flex-end;
  margin-top:14px;
  flex-wrap: wrap;
}

.small-muted{
  font-size:11px;
  color:var(--muted);
}

/* Age gate modal */
.modal{
  position:fixed;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  background:rgba(0,0,0,0.6);
  backdrop-filter: blur(8px);
  opacity:0;
  pointer-events:none;
  transition:all 240ms ease;
  z-index:100;
  padding: 16px;
  overflow-y: auto;
}

.modal.open{
  opacity:1;
  pointer-events:auto;
}

.modal-panel{
  max-width:520px;
  background: linear-gradient(180deg, #0b3f6b 0%, #06325a 100%);
  padding:22px;
  border-radius:12px;
  border:1px solid rgba(246,196,79,0.2);
  text-align:center;
  width: 100%;
  margin: auto;
  box-shadow: 0 20px 50px rgba(0,0,0,0.5), 0 0 0 1px rgba(246,196,79,0.1);
}

.modal h2{
  margin:0 0 8px;
  color:var(--accent);
  font-size: clamp(16px, 4vw, 20px);
}

.modal p{
  color:var(--muted);
  margin:0 0 18px;
  font-size: 13px;
}

.modal .modal-actions{
  display:flex;
  gap:10px;
  justify-content:center;
  margin-bottom:10px;
  flex-wrap:wrap;
}

.remember{
  display:block;
  color:var(--muted);
  font-size:12px;
}

/* Age Gate Black Panel */
.age-gate-panel {
  background: #000 !important;
  border: 1px solid rgba(255,255,255,0.15) !important;
  box-shadow: 0 25px 80px rgba(0,0,0,0.8);
}

/* Live messaging */
.messaging {
  display:flex;
  gap:16px;
  height: auto;
  min-height: calc(100vh - 200px);
  flex-wrap: wrap;
  width: 100%;
}

.conversations {
  width:100%;
  background:var(--card-bg);
  border:1px solid rgba(255,255,255,0.03);
  border-radius:12px;
  padding:12px;
  overflow:auto;
  max-height: 500px;
}

.chat-area {
  flex:1;
  min-width: 100%;
  display:flex;
  flex-direction:column;
  background:var(--panel-bg);
  border:1px solid rgba(255,255,255,0.03);
  border-radius:12px;
  overflow:hidden;
}

.messages {
  flex:1;
  padding:12px;
  overflow:auto;
  max-height: 500px;
}

.input-row {
  padding:10px;
  border-top:1px solid rgba(255,255,255,0.03);
  display:flex;
  gap:8px;
  align-items:center;
  flex-wrap: wrap;
}

.conv-item {
  padding:10px;
  border-radius:8px;
  cursor:pointer;
  margin-bottom:8px;
  background:transparent;
  display:flex;
  gap:8px;
  align-items:center;
  word-break: break-word;
  overflow-wrap: break-word;
}

.conv-item.active {
  background:linear-gradient(90deg, rgba(246,196,79,0.08), rgba(224,169,60,0.02));
}

.group-create {
  margin-bottom:12px;
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}

.msg.row {
  display:flex;
  gap:8px;
  align-items:flex-start;
  margin-bottom:10px;
}

.msg.me {
  justify-content:flex-end;
}

.msg .bubble {
  max-width:85%;
  padding:10px;
  border-radius:10px;
  word-wrap: break-word;
  overflow-wrap: break-word;
  font-size: 13px;
}

/* Footer */
.site-footer{
  padding:22px;
  text-align:center;
  color:var(--muted);
  border-top:1px solid rgba(255,255,255,0.02);
  margin-top:30px;
  font-size: 11px;
  width: 100%;
}

/* Meta classes */
.meta-small{
  font-size:11px;
  color:var(--muted);
}

.muted-note{
  color:var(--muted);
  font-size:13px;
}

/* Card */
.card{
  transition:all 220ms ease;
  text-decoration:none;
  color:inherit;
}

.card.thumb{
  border-radius:10px;
  overflow:hidden;
  background:var(--card-bg);
  border:1px solid rgba(255,255,255,0.03);
  position:relative;
  min-width: 0;
}

.card-link{
  display:block;
}

/* Responsive Breakpoints */

/* Small tablets and large phones (481px - 768px) */
@media(max-width: 768px) {
  .container { 
    padding: 12px; 
  }
  
  .nav-inner {
    gap: 8px;
    padding: 10px 12px;
  }

  .brand .logo {
    font-size: 18px;
    padding: 4px 8px;
  }

  .navlinks {
    gap: 6px;
  }

  .nav-item {
    padding: 6px 8px;
    font-size: 12px;
  }

  .nav-cta {
    gap: 6px;
  }

  .btn {
    padding: 6px 10px;
    font-size: 12px;
  }

  .featured-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  }

  .live-row {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  }

  #userContentGrid,
  #premiumList,
  .recent-grid,
  .content-grid {
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  }

  .live-grid {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  }

  .plans-grid {
    grid-template-columns: 1fr;
  }

  .most-popular {
    transform: scale(1);
  }

  .wallet-summary-grid {
    grid-template-columns: 1fr;
  }

  .wallet-card-hero {
    padding: 12px;
  }

  .action-btn {
    flex: 1;
    min-width: 70px;
  }

  .upload-hero {
    flex-direction: column;
  }

  .upload-preview {
    max-width: 100%;
  }

  .profile-actions {
    margin-left: 0;
    width: 100%;
  }

  .subscriptions-hero {
    flex-direction: column;
    align-items: flex-start;
  }

  .messaging {
    flex-direction: column;
  }

  .conversations {
    width: 100%;
    min-width: 100%;
    max-height: none;
  }

  .chat-area {
    min-width: 100%;
  }

  .modal-panel {
    padding: 16px;
  }

  .hero {
    padding: 16px;
  }

  .auth-panel {
    padding: 14px;
  }

  .search-input {
    min-width: 120px;
  }
}

/* Small phones (max 480px) */
@media(max-width: 480px) {
  .container { 
    padding: 10px; 
  }

  .nav-inner {
    gap: 6px;
    padding: 8px 10px;
  }

  .brand .logo {
    font-size: 16px;
    padding: 3px 6px;
  }

  .navlinks {
    gap: 4px;
    flex: 0 1 auto;
  }

  .nav-item {
    display: none;
  }

  .nav-item.active {
    display: inline-block;
  }

  .nav-cta {
    gap: 4px;
  }

  .btn {
    padding: 6px 8px;
    font-size: 11px;
  }

  .featured-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  }

  .live-row {
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  }

  #userContentGrid,
  #premiumList,
  .recent-grid,
  .content-grid {
    grid-template-columns: repeat(auto-fill, minmax(95px, 1fr));
  }

  .live-grid {
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  }

  .hero h1 {
    font-size: 18px;
  }

  .hero p {
    font-size: 12px;
  }

  .hero {
    padding: 14px;
  }

  .search-input {
    min-width: 100%;
  }

  .plans-grid {
    grid-template-columns: 1fr;
  }

  .plan-card {
    padding: 12px;
  }

  .wallet-summary-grid {
    grid-template-columns: 1fr;
  }

  .wallet-card-hero {
    padding: 10px;
  }

  .wallet-value-large {
    font-size: 16px;
  }

  .action-btn {
    padding: 6px 8px;
    font-size: 11px;
    flex: 1;
  }

  .tx-table {
    font-size: 10px;
  }

  .tx-table th,
  .tx-table td {
    padding: 6px 4px;
  }

  .comment-row {
    padding: 6px;
  }

  .comment-avatar {
    width: 32px;
    height: 32px;
  }

  .oauth-row {
    gap: 6px;
  }

  .oauth-row .btn {
    flex: 1;
    font-size: 11px;
  }

  .form input,
  .form textarea,
  .form select {
    font-size: 16px;
  }

  .video-meta {
    gap: 6px;
  }

  .video-actions {
    gap: 4px;
  }

  .stat {
    font-size: 10px;
    margin-right: 4px;
  }

  .emoji-btn {
    padding: 4px 6px;
    font-size: 13px;
  }

  .billing-toggle button {
    padding: 5px 8px;
    font-size: 11px;
  }

  .profile-meta {
    gap: 10px;
    padding: 12px;
  }

  .profile-meta .avatar {
    width: 64px;
    height: 64px;
  }

  .auth-panel {
    padding: 12px;
  }

  .modal-overlay {
    padding: 12px;
  }
}

/* Extra small phones (max 360px) */
@media(max-width: 360px) {
  .container { 
    padding: 8px; 
  }

  .featured-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  #userContentGrid,
  #premiumList,
  .recent-grid,
  .content-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .live-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .live-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .btn {
    padding: 5px 6px;
    font-size: 10px;
  }

  .hero {
    padding: 12px;
  }

  .hero h1 {
    font-size: 16px;
  }

  .hero p {
    font-size: 11px;
  }

  .nav-avatar {
    width: 28px;
    height: 28px;
  }

  .profile-meta .avatar {
    width: 56px;
    height: 56px;
  }

  .nav-inner {
    gap: 4px;
  }

  .brand .logo {
    font-size: 14px;
  }
}

/* Desktop (1024px and up) */
@media(min-width: 1024px) {
  .featured-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  #userContentGrid,
  #premiumList,
  .recent-grid,
  .content-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .live-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .live-row {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  }

  .plans-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .messaging {
    flex-direction: row;
  }

  .conversations {
    width: 320px;
    min-width: 260px;
    max-height: 600px;
  }

  .chat-area {
    flex: 1;
    min-width: auto;
  }
}

/* Defensive fixes */
select:focus, .select:focus {
  position: relative;
  z-index: 200000 !important;
}

/* Prevent layout shifts */
html {
  scroll-behavior: smooth;
}

/* Ensure images don't overflow */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Video player container */
.player-card {
  width: 100%;
  overflow: hidden;
}

/* Prevent horizontal scroll */
body, html {
  max-width: 100%;
  overflow-x: hidden;
}

/* Link styling - No underlines anywhere */
a, .link, .card-link, .thumb-caption a, .nav-item, .navlinks a {
  text-decoration: none !important;
}

a:hover, .link:hover, .card-link:hover {
  text-decoration: none !important;
}

.link {
  color: var(--accent);
  cursor: pointer;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  margin-top: 0;
  margin-bottom: 0.5em;
  word-wrap: break-word;
}

p {
  margin: 0;
  word-wrap: break-word;
}

a {
  color: inherit;
}

/* Ensure text doesn't overflow */
pre {
  overflow-x: auto;
  max-width: 100%;
}

code {
  word-break: break-word;
  overflow-wrap: break-word;
}