:root {
  color-scheme: dark;
  --bg-main: #060813;
  --bg-panel: rgba(13, 17, 33, 0.7);
  --bg-card: rgba(22, 28, 51, 0.45);
  --bg-input: rgba(8, 10, 21, 0.6);
  
  --text-main: #f9fafb;
  --text-muted: #9ca3af;
  --text-inverse: #060813;
  
  --border-color: rgba(255, 255, 255, 0.05);
  --border-focus: #00f2fe;
  
  --accent-cyan: #00f2fe;
  --accent-purple: #9d4edd;
  --accent-gradient: linear-gradient(135deg, #00f2fe 0%, #4facfe 100%);
  --accent-purple-gradient: linear-gradient(135deg, #9d4edd 0%, #7209b7 100%);
  --patreon-gradient: linear-gradient(135deg, #ff5e36 0%, #ff8e53 100%);
  
  --discord-color: #5865f2;
  --discord-hover: #4752c4;
  
  --vrchat-color: #00e676;
  --vrchat-accent: #00c853;
  
  --danger-color: #ff5252;
  --danger-hover: #ff1744;
  --warning-color: #ffd600;
  --success-color: #00e676;
  
  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 10px 20px -3px rgba(0, 0, 0, 0.5), 0 4px 8px -2px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 25px 40px -5px rgba(0, 0, 0, 0.7), 0 12px 16px -5px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 20px rgba(0, 242, 254, 0.35);
  
  font-family: 'Cairo', 'Outfit', system-ui, -apple-system, sans-serif;
  line-height: 1.6;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  transition: background-color 0.3s cubic-bezier(0.25, 0.8, 0.25, 1),
              border-color 0.3s cubic-bezier(0.25, 0.8, 0.25, 1),
              box-shadow 0.3s cubic-bezier(0.25, 0.8, 0.25, 1),
              transform 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
}

body {
  min-height: 100vh;
  color: var(--text-main);
  background-color: var(--bg-main);
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(157, 78, 221, 0.15) 0%, transparent 40%),
    radial-gradient(circle at 85% 85%, rgba(0, 242, 254, 0.12) 0%, transparent 40%),
    radial-gradient(circle at 50% 50%, rgba(6, 8, 19, 0.95) 0%, rgba(6, 8, 19, 1) 100%);
  background-attachment: fixed;
  overflow-x: hidden;
}

/* Scrollbar Styles */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
  background: #1e2238;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent-cyan);
  box-shadow: var(--shadow-glow);
}

/* Button & Input Standards */
button, input, select {
  font-family: inherit;
}

button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  border: none;
  border-radius: 10px;
  padding: 10px 22px;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--text-inverse);
  background: var(--accent-gradient);
  box-shadow: 0 4px 14px rgba(0, 242, 254, 0.25);
  position: relative;
  overflow: hidden;
}

button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: all 0.6s ease;
}

button:hover::before {
  left: 100%;
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 242, 254, 0.45);
}

button:active {
  transform: translateY(0);
}

button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

button.ghost {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  box-shadow: none;
}

button.ghost:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 12px rgba(255, 255, 255, 0.05);
}

button.ghost.active,
.ghost-btn-link.active {
  background: rgba(0, 242, 254, 0.08) !important;
  color: var(--accent-cyan) !important;
  border-color: rgba(0, 242, 254, 0.25) !important;
  box-shadow: 0 0 14px rgba(0, 242, 254, 0.15) !important;
}

.ghost-btn-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  border-radius: 10px;
  padding: 10px 22px;
  font-weight: 700;
  font-size: 0.92rem;
  text-decoration: none;
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  cursor: pointer;
}

.ghost-btn-link:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 255, 255, 0.05);
}

button.danger {
  color: #fff;
  background: var(--danger-color);
  box-shadow: 0 4px 14px rgba(255, 82, 82, 0.25);
}

button.danger:hover {
  background: var(--danger-hover);
  box-shadow: 0 6px 20px rgba(255, 82, 82, 0.45);
}

button.success {
  color: #fff;
  background: var(--success-color);
  box-shadow: 0 4px 14px rgba(0, 230, 118, 0.25);
}

button.success:hover {
  background: var(--vrchat-accent);
  box-shadow: 0 6px 20px rgba(0, 230, 118, 0.45);
}

input, select {
  width: 100%;
  min-height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  padding: 10px 16px;
  color: var(--text-main);
  background: var(--bg-input);
  font-size: 0.95rem;
  outline: none;
  backdrop-filter: blur(10px);
}

input:focus, select:focus {
  border-color: var(--accent-cyan);
  box-shadow: var(--shadow-glow);
  background-color: rgba(13, 17, 33, 0.8);
}

.hidden {
  display: none !important;
}

/* App Shell Structure */
.app-shell {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 64px;
}

/* Header & Branding */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 32px;
  padding: 16px 24px;
  background: rgba(18, 22, 43, 0.4);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.03);
  border-radius: 16px;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-logo-text {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  color: var(--text-inverse);
  background: var(--accent-gradient);
  font-family: 'Outfit', sans-serif;
  font-size: 20px;
  font-weight: 900;
  box-shadow: 0 0 25px rgba(0, 242, 254, 0.4);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  user-select: none;
  animation: logo-glow 3s infinite alternate;
}

@keyframes logo-glow {
  0% { box-shadow: 0 0 15px rgba(0, 242, 254, 0.3); }
  100% { box-shadow: 0 0 30px rgba(0, 242, 254, 0.6); }
}

.brand-block h1 {
  font-size: 1.6rem;
  font-weight: 900;
  line-height: 1.2;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-family: 'Outfit', 'Cairo', sans-serif;
}

.brand-block p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Warnings & Messages */
.warning-banner {
  background: rgba(255, 214, 0, 0.04);
  border: 1px solid rgba(255, 214, 0, 0.2);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 32px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.warning-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.warning-icon {
  font-size: 1.4rem;
}

.warning-header h3 {
  color: var(--warning-color);
  font-size: 1.1rem;
  font-weight: 800;
}

.warning-body p {
  color: var(--text-main);
  font-size: 0.92rem;
  margin-bottom: 14px;
}

.warning-guide {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 10px;
  padding: 16px 20px;
  border: 1px solid rgba(255, 255, 255, 0.03);
}

.warning-guide summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--warning-color);
  user-select: none;
}

.warning-guide ol {
  margin-top: 12px;
  margin-right: 20px;
  font-size: 0.88rem;
}

.warning-guide li {
  margin-bottom: 10px;
  color: var(--text-muted);
}

.warning-guide li strong {
  color: var(--text-main);
}

.warning-guide a {
  color: var(--accent-cyan);
  text-decoration: underline;
}

.warning-guide pre {
  margin-top: 8px;
  background: #030408;
  padding: 10px 14px;
  border-radius: 8px;
  overflow-x: auto;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.warning-guide code {
  font-family: 'Outfit', monospace;
  color: var(--accent-purple);
  font-size: 0.82rem;
}

/* Login Panel Redesign */
.login-surface {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  align-items: center;
  gap: 48px;
  min-height: 380px;
  padding: 56px;
  background: radial-gradient(circle at 100% 0%, rgba(0, 242, 254, 0.06), transparent 50%),
              radial-gradient(circle at 0% 100%, rgba(157, 78, 221, 0.06), transparent 50%),
              rgba(18, 22, 43, 0.35);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 28px;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

.login-surface::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-cyan), var(--accent-purple), transparent);
}

.login-copy .eyebrow {
  display: inline-block;
  background: rgba(0, 242, 254, 0.08);
  color: var(--accent-cyan);
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  margin-bottom: 16px;
  letter-spacing: 1px;
}

.login-copy h2 {
  font-size: 2.2rem;
  font-weight: 900;
  margin-bottom: 16px;
  line-height: 1.3;
}

.login-copy p {
  color: var(--text-muted);
  font-size: 0.98rem;
  max-width: 580px;
  line-height: 1.7;
}

.discord-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 52px;
  padding: 14px 36px;
  color: white;
  text-decoration: none;
  font-weight: 800;
  font-size: 1.02rem;
  border-radius: 12px;
  background: linear-gradient(135deg, #5865f2 0%, #4752c4 100%);
  box-shadow: 0 4px 20px rgba(88, 101, 242, 0.3);
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.discord-button:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(88, 101, 242, 0.55);
}

.discord-icon {
  width: 20px;
  height: 20px;
}

.message {
  font-size: 0.85rem;
  color: var(--danger-color);
  padding: 8px 12px;
  background: rgba(255, 82, 82, 0.05);
  border: 1px solid rgba(255, 82, 82, 0.1);
  border-radius: 6px;
}

/* Dashboard & Side Rail Layout */
.dashboard {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 28px;
}

/* Profile Sidebar Rail */
.profile-rail {
  position: sticky;
  top: 24px;
  align-self: start;
  display: grid;
  gap: 20px;
  background: rgba(14, 18, 36, 0.45);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 20px;
  padding: 24px;
  box-shadow: var(--shadow-lg);
}

.rail-title {
  font-weight: 900;
  font-size: 1.05rem;
  letter-spacing: 0.5px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  color: var(--accent-cyan);
}

.identity-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: rgba(8, 10, 21, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.02);
  border-radius: 14px;
  position: relative;
  overflow: hidden;
}

.identity-card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 4px;
  height: 100%;
}

.identity-card.discord-theme::before {
  background: var(--discord-color);
}

.identity-card.vrchat-theme::before {
  background: var(--vrchat-color);
}

.identity-card.patreon-theme::before {
  background: #ff7a00;
}

.identity-card:hover {
  background: rgba(8, 10, 21, 0.7);
  border-color: rgba(255, 255, 255, 0.05);
}

.avatar {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  border-radius: 10px;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.identity-details {
  display: grid;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

.identity-details .label {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 700;
}

.identity-details strong {
  font-size: 0.95rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rank-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: start;
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--bg-main);
  background: #ffeb3b;
  padding: 1px 8px;
  border-radius: 99px;
  width: fit-content;
}

.code-box {
  background: linear-gradient(135deg, rgba(0, 242, 254, 0.03) 0%, rgba(157, 78, 221, 0.03) 100%);
  border: 1px solid rgba(0, 242, 254, 0.15);
  border-radius: 14px;
  padding: 18px;
  text-align: center;
  box-shadow: inset 0 0 15px rgba(0, 242, 254, 0.02);
}

.code-box .label {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 10px;
  font-weight: 700;
}

.code-box strong {
  display: block;
  font-family: 'Outfit', monospace;
  font-size: 1.5rem;
  color: var(--accent-cyan);
  letter-spacing: 2px;
  text-shadow: 0 0 10px rgba(0, 242, 254, 0.2);
}

/* Main Workspace */
.workspace {
  display: grid;
  gap: 28px;
}

.panel {
  background: var(--bg-panel);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 20px;
  padding: 28px;
  box-shadow: var(--shadow-md);
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.02);
  padding-bottom: 16px;
}

.section-head h2 {
  font-size: 1.25rem;
  font-weight: 900;
  letter-spacing: -0.2px;
}

.section-desc {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin-bottom: 20px;
  line-height: 1.6;
}

.eyebrow {
  display: block;
  font-size: 0.7rem;
  color: var(--accent-cyan);
  font-weight: 800;
  text-transform: uppercase;
  margin-bottom: 4px;
  letter-spacing: 1px;
}

.status-pill {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-muted);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

#verifyStatus {
  background: rgba(255, 214, 0, 0.08);
  color: #ffd600;
  border-color: rgba(255, 214, 0, 0.2);
}

/* Search Alignment */
.search-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.vrchat-result-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
}

.vrchat-result-card:hover {
  border-color: rgba(0, 242, 254, 0.25);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  transform: translateY(-2px);
}

.result-user-info {
  display: flex;
  align-items: center;
  gap: 14px;
}

.result-user-info strong {
  display: block;
  font-size: 0.95rem;
}

.rank-badge {
  font-size: 0.68rem;
  background: rgba(255, 255, 255, 0.06);
  padding: 2px 8px;
  border-radius: 4px;
  color: var(--text-muted);
  font-weight: 700;
}

.select-user-btn {
  width: 100%;
  min-height: 40px;
  font-size: 0.88rem;
  padding: 8px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  box-shadow: none;
}

.select-user-btn:hover {
  background: var(--accent-gradient);
  color: var(--text-inverse);
  box-shadow: var(--shadow-sm);
  border-color: transparent;
}

/* Verification State Box */
.selected-account-banner {
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.selected-user {
  display: flex;
  align-items: center;
  gap: 16px;
}

.selected-user h3 {
  font-size: 1.1rem;
  font-weight: 800;
}

button.ghost.danger {
  color: var(--danger-color);
  background: rgba(255, 82, 82, 0.03);
  border: 1px solid rgba(255, 82, 82, 0.15);
  box-shadow: none;
}

button.ghost.danger:hover {
  background: rgba(255, 82, 82, 0.08);
  border-color: var(--danger-color);
  color: var(--danger-color);
}

.verification-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 24px;
}

.instructions-text {
  font-size: 0.95rem;
  margin-bottom: 20px;
  line-height: 1.7;
}

.verification-box .verify-token {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.3);
  padding: 14px 20px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  margin-bottom: 24px;
}

.token-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.verification-box strong {
  font-family: 'Outfit', monospace;
  font-size: 1.5rem;
  color: var(--accent-cyan);
  letter-spacing: 2px;
  text-shadow: 0 0 10px rgba(0, 242, 254, 0.2);
}

.copy-button {
  min-height: 34px;
  padding: 6px 14px;
  font-size: 0.82rem;
  background: rgba(0, 242, 254, 0.08);
  color: var(--accent-cyan);
  border: 1px solid rgba(0, 242, 254, 0.2);
  box-shadow: none;
}

.copy-button:hover {
  background: var(--accent-gradient);
  color: var(--text-inverse);
  box-shadow: none;
  border-color: transparent;
}

.copy-button.copied {
  background: var(--success-color);
  color: #fff;
  border-color: var(--success-color);
}

.verify-action-row {
  display: flex;
  justify-content: center;
}

.primary-glow-btn {
  width: 100%;
  background: var(--accent-gradient);
  color: var(--text-inverse);
  font-size: 0.95rem;
  box-shadow: 0 4px 15px rgba(0, 242, 254, 0.2);
}

.primary-glow-btn:hover {
  box-shadow: 0 0 24px rgba(0, 242, 254, 0.45);
}

.error-message {
  background: rgba(255, 82, 82, 0.04);
  border: 1px solid rgba(255, 82, 82, 0.15);
  color: var(--danger-color);
  padding: 12px 16px;
  border-radius: 10px;
  margin-top: 16px;
  text-align: center;
}

/* Success Banner */
.success-banner {
  display: flex;
  align-items: center;
  gap: 20px;
  background: rgba(0, 230, 118, 0.04);
  border: 1px solid rgba(0, 230, 118, 0.15);
  border-radius: 16px;
  padding: 24px;
}

.success-check {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--success-color);
  color: var(--bg-main);
  font-size: 1.3rem;
  font-weight: 900;
  box-shadow: 0 0 15px rgba(0, 230, 118, 0.3);
}

.success-banner h3 {
  color: var(--success-color);
  font-size: 1.1rem;
  margin-bottom: 6px;
  font-weight: 800;
}

.success-banner p {
  font-size: 0.88rem;
  color: var(--text-muted);
}

/* Step locking layer */
.panel.locked {
  position: relative;
}

.panel.locked::after {
  content: "خطوة مغلقة - اربط حسابك أولاً";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 20px;
  background: rgba(6, 8, 19, 0.85);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 1.25rem;
  color: var(--text-muted);
  pointer-events: none;
  z-index: 10;
}

/* Image Slots & Drag Area */
.uploads {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-top: 20px;
  width: 100%;
}

.upload-card {
  background: rgba(20, 26, 48, 0.35);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.03);
  border-radius: 18px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
  box-shadow: var(--shadow-sm);
}

.upload-card:hover {
  transform: translateY(-4px);
  border-color: rgba(0, 242, 254, 0.25);
  box-shadow: 0 12px 30px rgba(0, 242, 254, 0.1);
  background: rgba(20, 26, 48, 0.55);
}

.upload-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.upload-badge {
  font-size: 0.68rem;
  font-weight: 800;
  background: rgba(0, 242, 254, 0.08);
  color: var(--accent-cyan);
  padding: 3px 8px;
  border-radius: 4px;
}

.image-preview-container {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.03);
  background: #030407;
}

.image-preview-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.upload-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(6, 8, 19, 0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.image-preview-container:hover .upload-overlay {
  opacity: 1;
}

.upload-overlay .upload-icon {
  transform: translateY(12px);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.image-preview-container:hover .upload-icon {
  transform: translateY(0);
}

.file-select-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  width: 100%;
  height: 100%;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
}

.upload-icon {
  font-size: 1.6rem;
}

.file-input-hidden {
  display: none;
}

.url-block {
  display: grid;
  gap: 8px;
}

.url-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 700;
}

.url-display {
  display: flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.03);
  border-radius: 8px;
  padding: 6px 12px;
  justify-content: space-between;
}

.url-text {
  font-family: 'Outfit', monospace;
  font-size: 0.75rem;
  color: var(--accent-cyan);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  direction: ltr;
  padding-left: 10px;
  flex: 1;
}

.copy-url-btn {
  min-height: 28px;
  padding: 2px 12px;
  font-size: 0.72rem;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-main);
  box-shadow: none;
  border-radius: 6px;
}

.copy-url-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  box-shadow: none;
}

/* Upload State Loader */
.upload-card.uploading .upload-overlay {
  opacity: 1 !important;
  background: rgba(6, 8, 19, 0.85);
}

.upload-card.uploading .upload-icon {
  animation: pulse-glow 1s infinite alternate;
}

@keyframes pulse-glow {
  0% { transform: scale(1); opacity: 0.7; }
  100% { transform: scale(1.18); opacity: 1; filter: drop-shadow(0 0 10px var(--accent-cyan)); }
}

/* Admin Specific */
.admin-panel {
  border-color: rgba(157, 78, 221, 0.2);
}

.admin-list {
  display: grid;
  gap: 14px;
  margin-top: 24px;
}

.admin-user-row {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.admin-user-details {
  display: grid;
  gap: 6px;
  flex: 1;
}

.user-main {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-main strong {
  font-size: 1.05rem;
}

.badge {
  font-size: 0.68rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 4px;
}

.badge.active {
  background: rgba(0, 230, 118, 0.08);
  color: var(--success-color);
  border: 1px solid rgba(0, 230, 118, 0.15);
}

.badge.inactive {
  background: rgba(255, 82, 82, 0.08);
  color: var(--danger-color);
  border: 1px solid rgba(255, 82, 82, 0.15);
}

.user-sub {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.user-sub code {
  font-family: 'Outfit', monospace;
  background: rgba(0, 0, 0, 0.2);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--accent-cyan);
}

.admin-action-btn {
  min-height: 38px;
  font-size: 0.85rem;
  padding: 6px 16px;
}

/* Sub tabs and responsive components */
.upload-group-section {
  background: rgba(255, 255, 255, 0.005);
  border: 1px solid rgba(255, 255, 255, 0.02);
  border-radius: 16px;
  padding: 28px;
  margin-top: 20px;
  box-shadow: 0 4px 25px rgba(0, 0, 0, 0.15);
  width: 100%;
  box-sizing: border-box;
}

.group-section-title {
  font-family: 'Cairo', sans-serif;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--accent-cyan);
  margin-top: 0;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-right: 4px solid var(--accent-cyan);
  padding-right: 14px;
}

[dir="ltr"] .group-section-title {
  border-right: none;
  border-left: 4px solid var(--accent-cyan);
  padding-right: 0;
  padding-left: 14px;
}

.ratio-badge {
  font-size: 0.7rem;
  background: rgba(0, 242, 254, 0.08);
  border: 1px solid rgba(0, 242, 254, 0.15);
  padding: 2px 8px;
  border-radius: 4px;
  color: var(--accent-cyan);
  font-weight: 750;
}

.sub-tab-header {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  padding-bottom: 14px;
  width: 100%;
}

.sub-tab-btn {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  padding: 10px 22px;
  border-radius: 30px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
  font-family: 'Cairo', sans-serif;
}

.sub-tab-btn:hover {
  background: rgba(0, 242, 254, 0.05);
  border-color: rgba(0, 242, 254, 0.2);
  color: var(--text-main);
}

.sub-tab-btn.active {
  background: rgba(0, 242, 254, 0.12);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  box-shadow: 0 0 14px rgba(0, 242, 254, 0.1);
}

/* Upload Grid Layouts */
.uploads-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 24px;
  width: 100%;
}

.upload-card.ratio-16-9-card {
  grid-column: span 2;
}

@media (max-width: 580px) {
  .upload-card.ratio-16-9-card {
    grid-column: span 1;
  }
}

.image-preview-container.ratio-9-16 {
  aspect-ratio: 9 / 16;
  max-width: 135px;
  height: auto;
  margin: 0 auto;
  border: 1px dashed rgba(255, 255, 255, 0.08);
}

.image-preview-container.ratio-16-9 {
  aspect-ratio: 16 / 9;
  width: 100%;
  height: auto;
  border: 1px dashed rgba(255, 255, 255, 0.08);
}

/* Permissions & Role Cards */
.players-list-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  width: 100%;
}

.player-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.player-card:hover {
  border-color: rgba(0, 242, 254, 0.2);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.player-card-body {
  display: flex;
  align-items: center;
  gap: 16px;
}

.player-card-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.player-card-info strong {
  font-size: 1.02rem;
  font-weight: 800;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-card-actions {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 6px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.03);
}

.player-card-actions select, .role-select-wrapper select {
  height: 42px;
  padding: 0 14px;
}

/* Neon role badges */
.role-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: 6px;
  width: fit-content;
  text-transform: uppercase;
}

.role-administrator {
  background: linear-gradient(135deg, #ff1744 0%, #ff9100 100%);
  color: #fff;
  box-shadow: 0 0 10px rgba(255, 23, 68, 0.4);
}

.role-admin {
  background: linear-gradient(135deg, #ff3d00 0%, #ff9100 100%);
  color: #fff;
  box-shadow: 0 0 8px rgba(255, 61, 0, 0.3);
}

.role-gatekeeper {
  background: linear-gradient(135deg, #651fff 0%, #d500f9 100%);
  color: #fff;
  box-shadow: 0 0 8px rgba(101, 31, 255, 0.3);
}

.role-dancer {
  background: linear-gradient(135deg, #f50057 0%, #ff4081 100%);
  color: #fff;
  box-shadow: 0 0 8px rgba(245, 0, 87, 0.3);
}

.role-bartender {
  background: linear-gradient(135deg, #2979ff 0%, #1565c0 100%);
  color: #fff;
  box-shadow: 0 0 8px rgba(41, 121, 255, 0.3);
}

.role-vip_gold {
  background: linear-gradient(135deg, #ffd600 0%, #ff8f00 100%);
  color: #060813;
  font-weight: 900;
  box-shadow: 0 0 12px rgba(255, 214, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.role-vip_silver {
  background: linear-gradient(135deg, #cfd8dc 0%, #78909c 100%);
  color: #060813;
  font-weight: 800;
  box-shadow: 0 0 8px rgba(207, 216, 220, 0.3);
}

.role-vip_bronze {
  background: linear-gradient(135deg, #a1887f 0%, #5d4037 100%);
  color: #fff;
  box-shadow: 0 0 8px rgba(161, 136, 127, 0.3);
}

.role-select-wrapper {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}

.role-select-wrapper label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 700;
}

.player-roles-container {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.roles-checkbox-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(115px, 1fr));
  gap: 12px;
  margin-top: 10px;
  padding: 12px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.02);
  width: 100%;
}

.role-checkbox-item {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  user-select: none;
}

.role-checkbox-item:hover {
  color: var(--text-main);
}

.role-checkbox-item input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border: 1px solid var(--border-color);
  border-radius: 5px;
  outline: none;
  cursor: pointer;
  position: relative;
  background: var(--bg-input);
  transition: all 0.2s ease;
  flex: 0 0 18px;
}

.role-checkbox-item input[type="checkbox"]:checked {
  background: var(--accent-cyan);
  border-color: var(--accent-cyan);
  box-shadow: 0 0 10px rgba(0, 242, 254, 0.4);
}

.role-checkbox-item input[type="checkbox"]:checked::after {
  content: "✓";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: var(--bg-main);
  font-size: 0.82rem;
  font-weight: 900;
}

.player-card-actions-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
}

/* Patreon Section Integration */
.patreon-integration-box {
  margin-top: 32px;
  padding-top: 28px;
  border-top: 1px solid var(--border-color);
}

.patreon-integration-box h3 {
  font-size: 1.1rem;
  font-weight: 900;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.patreon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 10px 28px;
  color: white;
  text-decoration: none;
  font-weight: 800;
  font-size: 0.95rem;
  border-radius: 10px;
  border: 1px solid #ff7a00;
  background: var(--patreon-gradient);
  box-shadow: 0 4px 18px rgba(255, 94, 54, 0.3);
  cursor: pointer;
}

.patreon-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(255, 94, 54, 0.55);
}

.patreon-linked-card {
  background: rgba(255, 94, 54, 0.03);
  border: 1px solid rgba(255, 94, 54, 0.15);
  border-radius: 12px;
  padding: 22px;
}

.patreon-linked-card:hover {
  border-color: rgba(255, 94, 54, 0.3);
  box-shadow: 0 0 20px rgba(255, 94, 54, 0.08);
}

.patreon-email {
  margin: 6px 0 0 0;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-family: 'Outfit', sans-serif;
}

.patreon-actions {
  display: flex;
  gap: 12px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.patreon-refresh-btn {
  min-height: 38px;
  padding: 8px 18px;
  font-size: 0.85rem;
  font-weight: 800;
  border: 1px solid rgba(255, 94, 54, 0.25);
  background: transparent;
  color: #ff8e53;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.patreon-refresh-btn:hover {
  background: rgba(255, 94, 54, 0.08);
  border-color: #ff5e36;
  color: white;
}

.patreon-unlink-btn {
  min-height: 38px;
  padding: 8px 18px;
  font-size: 0.85rem;
  font-weight: 800;
  border: 1px solid rgba(255, 82, 82, 0.25);
  background: transparent;
  color: var(--danger-color);
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.patreon-unlink-btn:hover {
  background: rgba(255, 82, 82, 0.08);
  border-color: var(--danger-color);
  color: white;
}

/* Header Action Layout */
.header-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  background: rgba(0, 0, 0, 0.35);
  padding: 6px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.03);
}

.header-actions button,
.header-actions .ghost-btn-link {
  min-height: 34px !important;
  padding: 6px 14px !important;
  font-size: 0.8rem !important;
  font-weight: 800 !important;
  border-radius: 8px !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  border: 1px solid transparent !important;
  background: transparent !important;
  color: var(--text-muted) !important;
  box-shadow: none !important;
  text-decoration: none !important;
  cursor: pointer !important;
}

.header-actions button:hover,
.header-actions .ghost-btn-link:hover {
  background: rgba(255, 255, 255, 0.05) !important;
  color: var(--text-main) !important;
  transform: none !important;
  box-shadow: none !important;
}

.header-actions button.active,
.header-actions .ghost-btn-link.active {
  background: rgba(0, 242, 254, 0.08) !important;
  color: var(--accent-cyan) !important;
  border-color: rgba(0, 242, 254, 0.25) !important;
  box-shadow: 0 0 10px rgba(0, 242, 254, 0.1) !important;
}

.header-actions #logoutBtn {
  color: #ff5252 !important;
}

.header-actions #logoutBtn:hover {
  background: rgba(255, 82, 82, 0.12) !important;
  color: #fff !important;
}

/* Tab Switching Items */
.tab-header {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  background: var(--bg-panel);
  padding: 6px;
  border-radius: 14px;
  border: 1px solid var(--border-color);
}

.tab-btn {
  flex: 1;
  min-height: 42px;
  border-radius: 10px;
  font-size: 0.92rem;
  background: transparent;
  color: var(--text-muted);
  box-shadow: none;
  border: none;
  font-weight: 700;
  font-family: 'Cairo', sans-serif !important;
  cursor: pointer;
}

.tab-btn:hover {
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-main);
  transform: none;
}

.tab-btn.active {
  background: var(--bg-card);
  color: var(--accent-cyan);
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(0, 242, 254, 0.15);
}

.tab-btn.active:hover {
  transform: none;
  background: var(--bg-card);
}

.tab-content.hidden {
  display: none !important;
}

.admin-defaults-section {
  margin-top: 36px;
  padding-top: 36px;
  border-top: 1px solid var(--border-color);
}

.admin-defaults-section h3 {
  font-size: 1.15rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.admin-defaults-section .section-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}

/* Admin Dashboard Stats */
.admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 20px;
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.stat-label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 8px;
  font-weight: 700;
}

.stat-card strong {
  font-size: 2rem;
  color: var(--accent-cyan);
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
}

/* Admin Login Card Specifics */
.admin-login-card {
  max-width: 460px;
  margin: 60px auto;
  padding: 40px;
  text-align: center;
}

.admin-login-card .lock-icon {
  font-size: 2.2rem;
  margin-bottom: 16px;
  display: block;
}

.admin-login-card h2 {
  font-size: 1.5rem;
  font-weight: 900;
  margin-bottom: 12px;
}

.admin-login-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 24px;
}

/* Mobile & Small Screens Optimization */
@media (max-width: 960px) {
  .dashboard {
    grid-template-columns: 1fr;
  }
  
  .profile-rail {
    position: static;
  }
  
  .login-surface {
    grid-template-columns: 1fr;
    text-align: center;
    padding: 40px 24px;
    gap: 36px;
  }
  
  .login-surface::before {
    height: 4px;
  }
  
  .discord-button {
    width: 100%;
  }
  
  .search-row {
    grid-template-columns: 1fr;
  }
  
  .admin-user-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
  
  .admin-user-row button {
    width: 100%;
  }
}
