/* Tribal Wars Script Vault - Apple Premium Dark Theme Styling */

:root {
  --bg-primary: #000000;
  --bg-secondary: #08080a;
  --bg-tertiary: #121215;
  --bg-card: rgba(18, 18, 21, 0.6);
  --bg-card-hover: rgba(26, 26, 32, 0.85);
  
  --border-color: rgba(255, 255, 255, 0.06);
  --border-color-hover: rgba(255, 255, 255, 0.15);
  
  --text-primary: #f5f5f7;
  --text-secondary: #86868b;
  --text-muted: #515154;
  
  --accent-color: #0071e3;
  --accent-color-hover: #147ce5;
  --accent-gradient: linear-gradient(135deg, #0071e3 0%, #2f80ed 50%, #b2ffd6 100%);
  --text-gradient: linear-gradient(180deg, #ffffff 0%, #a1a1a6 100%);
  
  --success-color: #30d158;
  --danger-color: #ff453a;
  --danger-color-hover: #ff5b52;
  
  --font-stack: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --transition-smooth: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-spring: all 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  background-color: var(--bg-primary);
  /* Always reserve the scrollbar so the layout width never shifts between
     tabs/pages with little vs. lots of content (e.g. empty categories). */
  overflow-y: scroll;
}

body {
  font-family: var(--font-stack);
  background-color: transparent;
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* Scroll-Driven Animation Classes */
.scroll-anim {
  opacity: 0;
  transform: translateY(30px);
  transition: var(--transition-smooth);
}

.scroll-anim.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Translucent Glassmorphic Header */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
  padding: 0.9rem 2rem;
  transition: var(--transition-smooth);
}

.header-container {
  max-width: 1240px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 44px;
  gap: 1.5rem;
}

.logo-section {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
  color: var(--text-primary);
  white-space: nowrap;
  flex-shrink: 0;
}

.logo-icon {
  width: 34px;
  height: 34px;
  background: linear-gradient(135deg, #0071e3, #8625e1);
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 0 20px rgba(0, 113, 227, 0.3);
}

.logo-text {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  background: var(--text-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo-sub {
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.8rem;
  letter-spacing: -0.01em;
}

.nav-buttons {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}

.nav-buttons .btn, .nav-buttons .lang-switch {
  white-space: nowrap;
}

/* Premium Apple Buttons */
.btn {
  font-family: var(--font-stack);
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.55rem 1.2rem;
  border-radius: 980px;
  border: 1px solid transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: var(--transition-spring);
  text-decoration: none;
}

.btn-large {
  padding: 0.8rem 1.8rem;
  font-size: 0.98rem;
}

.btn-primary {
  background-color: var(--text-primary);
  color: var(--bg-primary);
}

.btn-primary:hover {
  background-color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(255, 255, 255, 0.15);
}

.btn-secondary {
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background-color: rgba(255, 255, 255, 0.12);
  border-color: var(--border-color-hover);
  transform: translateY(-2px);
}

.btn-danger {
  background-color: rgba(255, 69, 58, 0.08);
  color: var(--danger-color);
  border: 1px solid rgba(255, 69, 58, 0.2);
}

.btn-danger:hover {
  background-color: var(--danger-color);
  color: white;
  transform: translateY(-1px);
}

.btn-sm {
  font-size: 0.8rem;
  padding: 0.4rem 0.9rem;
}

/* Hero Section */
.hero-section {
  position: relative;
  min-height: 85vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 8rem 2rem 4rem 2rem;
  background-color: transparent;
  z-index: 1;
}

.hero-bg-glow {
  position: absolute;
  top: 15%;
  width: 60%;
  height: 400px;
  background: radial-gradient(circle, rgba(0, 113, 227, 0.18) 0%, rgba(134, 37, 225, 0.05) 50%, transparent 100%);
  filter: blur(80px);
  z-index: -1;
  pointer-events: none;
}

.hero-content {
  max-width: 850px;
}

.hero-tag {
  display: inline-block;
  padding: 0.4rem 1rem;
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: 980px;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 1.5rem;
  color: var(--text-secondary);
}

.hero-title {
  font-size: 4.2rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.04em;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
}

.gradient-text {
  background: linear-gradient(90deg, #0071e3, #30d158, #8625e1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--text-secondary);
  font-weight: 500;
  max-width: 680px;
  margin: 0 auto 2.5rem auto;
  line-height: 1.5;
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
}

/* macOS Mockup Code Editor */
.mockup-container {
  width: 100%;
  max-width: 780px;
  margin: 0 auto;
  perspective: 1000px;
  border-radius: 14px;
}

.mockup-frame {
  background-color: #16161a;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.7), 0 0 40px rgba(0, 113, 227, 0.15);
  overflow: hidden;
  text-align: left;
  transform: rotateX(8deg);
  transition: transform 0.5s ease;
}

.mockup-frame:hover {
  transform: rotateX(0deg) translateY(-5px);
}

.mockup-header {
  background-color: #0e0e11;
  padding: 0.75rem 1.2rem;
  display: flex;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.mockup-dots {
  display: flex;
  gap: 0.4rem;
}

.mockup-dots .dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
}

.dot.red { background-color: #ff5f56; }
.dot.yellow { background-color: #ffbd2e; }
.dot.green { background-color: #27c93f; }

.mockup-tab {
  margin-left: 2rem;
  font-family: "Space Mono", monospace;
  font-size: 0.8rem;
  color: var(--text-secondary);
  background-color: #16161a;
  padding: 0.35rem 1rem;
  border-radius: 6px 6px 0 0;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-bottom: none;
}

.mockup-body {
  padding: 1.5rem;
  font-family: "Space Mono", monospace;
  font-size: 0.88rem;
  line-height: 1.6;
  color: #a9b2c3;
  overflow-x: auto;
}

.code-keyword { color: #f92672; }
.code-comment { color: #75715e; font-style: italic; }
.code-number { color: #ae81ff; }
.code-string { color: #e6db74; }
.code-built_in { color: #66d9ef; }

/* Section Standard Layout */
.section-header {
  text-align: center;
  margin-bottom: 3.5rem;
}

.section-title {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 0.75rem;
}

.section-subtitle {
  color: var(--text-secondary);
  font-size: 1.05rem;
  font-weight: 500;
}

/* Bento Grid Section */
.bento-section {
  width: 100%;
  max-width: 1200px;
  margin: 6rem auto;
  padding: 0 2rem;
}

.bento-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.bento-item {
  position: relative;
  background-color: var(--bg-card);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 2.5rem;
  overflow: hidden;
  transition: var(--transition-smooth);
}

.bento-glow {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 100% 100%, rgba(0, 113, 227, 0.1), transparent 50%);
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
}

.bento-item:hover {
  border-color: var(--border-color-hover);
  transform: translateY(-4px);
  background-color: var(--bg-card-hover);
}

.bento-item:hover .bento-glow {
  opacity: 1;
}

.bento-wide {
  grid-column: span 2;
}

.bento-content {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  z-index: 2;
  position: relative;
}

.bento-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.bento-item h3 {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.bento-item p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* Dashboard Section */
.dashboard-section {
  width: 100%;
  max-width: 1200px;
  margin: 6rem auto;
  padding: 0 2rem;
}

.dashboard {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 2.5rem;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  padding: 2.5rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
}

/* Sidebar Categories */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  border-right: 1px solid var(--border-color);
  padding-right: 1.5rem;
}

.sidebar-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-secondary);
  letter-spacing: 0.1em;
  padding-left: 0.6rem;
}

.category-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.category-item button {
  width: 100%;
  text-align: left;
  padding: 0.65rem 0.9rem;
  border-radius: 9px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-stack);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: var(--transition-smooth);
}

.category-item button:hover {
  background-color: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
}

.category-item.active button {
  background-color: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  box-shadow: inset 0 0 0 1px var(--border-color);
}

.category-count {
  font-size: 0.75rem;
  background-color: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  padding: 0.15rem 0.55rem;
  border-radius: 980px;
}

.category-item.active .category-count {
  background-color: var(--text-primary);
  color: var(--bg-primary);
}

/* Main Panel */
.main-panel {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  min-width: 0; /* allow grid child to shrink instead of overflowing */
}

.search-panel {
  background-color: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 0.8rem;
  display: flex;
  align-items: center;
}

.search-container {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
}

.search-input {
  width: 100%;
  padding: 0.65rem 1rem 0.65rem 2.5rem;
  border-radius: 9px;
  background-color: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-family: var(--font-stack);
  font-size: 0.9rem;
  transition: var(--transition-smooth);
}

.search-input:focus {
  outline: none;
  background-color: rgba(0, 0, 0, 0.5);
  border-color: rgba(255, 255, 255, 0.3);
}

.search-icon {
  position: absolute;
  left: 0.9rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

/* Scripts Grid */
.scripts-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  min-width: 0;
}

/* Script Card styling */
.script-card {
  position: relative;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 1.8rem;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  transition: var(--transition-smooth);
  min-width: 0;
  overflow: hidden; /* keep long code/filenames inside the card */
}

/* "Free" tab in the very top-right corner of free Highlights (clear of the favorites star) */
.free-sticker {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 3;
  background: linear-gradient(135deg, #ffe066, #ffc83d);
  color: #4a3500;
  font-weight: 800;
  font-size: 0.66rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.25rem 0.6rem;
  border-radius: 0 16px 0 10px; /* hugs the card's top-right corner */
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.35);
}

.script-card:hover {
  border-color: var(--border-color-hover);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
  transform: translateY(-2px);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.script-title-area {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.script-name {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.script-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem 0.65rem;
  font-size: 0.78rem;
  color: var(--text-secondary);
  min-width: 0;
}

.script-meta .mono {
  font-family: "Space Mono", monospace;
  opacity: 0.85;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tag {
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.15rem 0.5rem;
  border-radius: 5px;
  text-transform: uppercase;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.script-desc {
  color: var(--text-secondary);
  font-size: 0.94rem;
  line-height: 1.5;
}

/* Quickbar Code Box */
.quickbar-box {
  background-color: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.quickbar-code {
  font-family: "Space Mono", monospace;
  font-size: 0.78rem;
  color: var(--text-secondary);
  flex: 1;
  min-width: 0; /* prevents the code line from forcing the card wider */
  /* Always show the FULL loader, wrapped — no horizontal scrollbar to fight. */
  white-space: pre-wrap;
  word-break: break-all;
  overflow-wrap: anywhere;
  overflow: hidden;
  line-height: 1.55;
  user-select: text;
  transition: color var(--transition-smooth);
}

.quickbar-code:hover {
  color: var(--text-primary);
}

.copy-btn {
  min-width: 145px;
}

.copy-btn.copied {
  background-color: var(--success-color);
  color: white;
}

.card-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border-color);
  padding-top: 1.2rem;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.card-left-actions {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
}

/* Modal Dimmer styling */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

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

.modal {
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  width: 90%;
  max-width: 500px;
  padding: 2.5rem;
  box-shadow: 0 30px 60px rgba(0,0,0,0.6);
  transform: translateY(30px) scale(0.96);
  transition: var(--transition-spring);
}

.modal-overlay.active .modal {
  transform: translateY(0) scale(1);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.8rem;
}

.modal-title {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.05);
  transition: var(--transition-smooth);
}

.modal-close:hover {
  color: var(--text-primary);
  background-color: rgba(255, 255, 255, 0.1);
}

/* Form inputs styling */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-bottom: 1.4rem;
}

.form-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-control {
  font-family: var(--font-stack);
  background-color: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-color);
  border-radius: 9px;
  padding: 0.7rem 0.9rem;
  color: var(--text-primary);
  font-size: 0.95rem;
  transition: var(--transition-smooth);
}

.form-control:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.3);
  background-color: rgba(0, 0, 0, 0.5);
}

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2386868b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.9rem center;
  background-size: 0.9rem;
  padding-right: 2.5rem;
}

/* Drag & Drop Upload Zone */
.drag-drop-zone {
  border: 2px dashed rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 2rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: var(--transition-smooth);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.drag-drop-zone:hover, .drag-drop-zone.dragover {
  border-color: rgba(255, 255, 255, 0.3);
  background-color: rgba(255, 255, 255, 0.02);
}

.drag-drop-icon {
  color: var(--text-secondary);
}

.drag-drop-text {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.file-selected-name {
  font-size: 0.9rem;
  color: var(--success-color);
  font-weight: 600;
  display: none;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.8rem;
  margin-top: 1.8rem;
}

/* Empty States / Skeletons */
.empty-state {
  grid-column: 1 / -1;
  width: 100%;
  box-sizing: border-box;
  text-align: center;
  padding: 5rem 2rem;
  border-radius: 20px;
  border: 1px dashed var(--border-color);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.2rem;
}

.empty-state h3 {
  font-size: 1.3rem;
  font-weight: 700;
}

.empty-state p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  max-width: 420px;
  line-height: 1.5;
}

.loading-container {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  width: 100%;
}

.skeleton-card {
  height: 160px;
  background: linear-gradient(90deg, #121215 25%, #1c1c22 50%, #121215 75%);
  background-size: 200% 100%;
  animation: loading-shimmer 1.4s infinite;
  border-radius: 16px;
  border: 1px solid var(--border-color);
}

@keyframes loading-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Legal Imprint Page Structure */
.imprint-page {
  max-width: 800px;
  margin: 6rem auto;
  padding: 0 2rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.imprint-page h1 {
  font-size: 2.8rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  margin-bottom: 0.5rem;
}

.imprint-page h2 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.6rem;
}

.imprint-page p, .imprint-page address {
  color: var(--text-secondary);
  font-size: 0.98rem;
  line-height: 1.6;
}

.imprint-page address {
  font-style: normal;
}

/* Obfuscated email canvas/image container */
.secure-email-container {
  display: inline-block;
  vertical-align: middle;
  margin-left: 0.35rem;
}

/* Footer Section */
footer {
  margin-top: auto;
  border-top: 1px solid var(--border-color);
  background-color: var(--bg-secondary);
  padding: 3rem 2rem;
  text-align: center;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  align-items: center;
}

.footer-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  transition: var(--transition-smooth);
}

.footer-links a:hover {
  color: var(--text-primary);
}

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

/* ===== Language Switch ===== */
.lang-switch {
  display: inline-flex;
  border: 1px solid var(--border-color);
  border-radius: 980px;
  overflow: hidden;
  background-color: rgba(255, 255, 255, 0.04);
}

.lang-btn {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-stack);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.4rem 0.7rem;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.lang-btn:hover { color: var(--text-primary); }

.lang-btn.active {
  background-color: var(--text-primary);
  color: var(--bg-primary);
}

#admin-btn.is-admin {
  border-color: rgba(48, 209, 88, 0.4);
  color: var(--success-color);
}

/* ===== Panel Toolbar (sort + admin) ===== */
.panel-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.sort-wrap {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.sort-wrap label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.sort-select {
  font-family: var(--font-stack);
  background-color: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-color);
  border-radius: 9px;
  padding: 0.45rem 2.2rem 0.45rem 0.8rem;
  color: var(--text-primary);
  font-size: 0.85rem;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2386868b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.7rem center;
  background-size: 0.85rem;
}

.sort-select:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.3);
}

/* Readable dropdown options (fixes white-on-light-grey on some browsers) */
.sort-select option,
.form-control option {
  background-color: #1c1c22;
  color: #f5f5f7;
}

.show-deleted-wrap {
  display: none;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.82rem;
  color: var(--text-secondary);
  cursor: pointer;
}

.show-deleted-wrap input { accent-color: var(--accent-color); cursor: pointer; }

/* ===== Badges ===== */
.badge {
  display: inline-block;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  padding: 0.12rem 0.45rem;
  border-radius: 5px;
  vertical-align: middle;
  margin-left: 0.2rem;
}

.badge-new { background-color: rgba(48, 209, 88, 0.15); color: var(--success-color); border: 1px solid rgba(48, 209, 88, 0.3); }
.badge-popular { background-color: rgba(255, 159, 10, 0.15); color: #ff9f0a; border: 1px solid rgba(255, 159, 10, 0.3); }
.badge-deleted { background-color: rgba(255, 69, 58, 0.15); color: var(--danger-color); border: 1px solid rgba(255, 69, 58, 0.3); }

/* ===== Favorite button ===== */
.card-header {
  gap: 1rem;
}

.fav-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.2rem;
  flex-shrink: 0;
  transition: var(--transition-smooth);
}

.fav-btn:hover { color: #ffd60a; transform: scale(1.12); }
.fav-btn.active { color: #ffd60a; }

.copy-count { font-variant-numeric: tabular-nums; }

.card-right-actions {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  flex-wrap: wrap;
}

/* Deleted / highlighted cards */
.script-card.is-deleted {
  opacity: 0.78;
  border-style: dashed;
  border-color: rgba(255, 69, 58, 0.7);
  box-shadow: 0 0 0 1px rgba(255, 69, 58, 0.22);
  background-image: linear-gradient(180deg, rgba(255, 69, 58, 0.05), transparent 45%);
}
.script-card.is-deleted:hover { border-color: rgba(255, 69, 58, 0.9); }

.script-card.highlight {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 1px var(--accent-color), 0 12px 40px rgba(0, 113, 227, 0.35);
}

/* ===== Support / Contact Section ===== */
.support-section {
  width: 100%;
  max-width: 1200px;
  margin: 6rem auto;
  padding: 0 2rem;
}

.support-card {
  position: relative;
  background:
    radial-gradient(circle at 0% 0%, rgba(88, 101, 242, 0.18), transparent 55%),
    var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  padding: 3.5rem 2.5rem;
  text-align: center;
  overflow: hidden;
}

.support-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
}

.support-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

#discord-copy-btn { background-color: #5865F2; color: #fff; }
#discord-copy-btn:hover { background-color: #4954d8; box-shadow: 0 10px 25px rgba(88, 101, 242, 0.35); }

/* Donate page tiles */
.donate-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin-top: 2rem;
  width: 100%;
  max-width: 760px;
  text-align: left;
}

.donate-tile {
  background-color: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 18px;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.75rem;
}

.donate-tile h3 { font-size: 1.2rem; font-weight: 700; }
.donate-tile p { color: var(--text-secondary); font-size: 0.92rem; line-height: 1.5; flex: 1; }
.donate-tile .btn { margin-top: 0.5rem; }

@media (max-width: 768px) {
  .donate-grid { grid-template-columns: 1fr; }
}

/* ===== Login error ===== */
.login-error {
  color: var(--danger-color);
  font-size: 0.85rem;
  font-weight: 600;
  min-height: 1.2rem;
  margin-top: -0.6rem;
}

/* ===== Toast ===== */
.vault-toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color-hover);
  color: var(--text-primary);
  padding: 0.8rem 1.4rem;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6);
  opacity: 0;
  pointer-events: none;
  z-index: 300;
  transition: var(--transition-spring);
}

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

/* Responsive adjustments */
@media (max-width: 1024px) {
  .hero-title { font-size: 3.2rem; }
  .bento-grid { grid-template-columns: repeat(2, 1fr); }
  .bento-wide { grid-column: span 2; }
}

@media (max-width: 768px) {
  .hero-title { font-size: 2.5rem; }
  .hero-subtitle { font-size: 1.1rem; }
  .bento-grid { grid-template-columns: 1fr; }
  .bento-wide { grid-column: span 1; }
  
  .dashboard {
    grid-template-columns: 1fr;
    gap: 2rem;
    padding: 1.5rem;
  }
  
  .sidebar {
    border-right: none;
    border-bottom: 1px solid var(--border-color);
    padding-right: 0;
    padding-bottom: 1.5rem;
  }
  
  .category-list {
    flex-direction: row;
    overflow-x: auto;
    padding-bottom: 0.5rem;
  }
  
  .category-item button {
    white-space: nowrap;
  }
  
  header {
    padding: 0.8rem 1.2rem;
  }

  .header-container {
    flex-wrap: wrap;
    gap: 0.6rem;
  }

  .nav-buttons {
    gap: 0.6rem;
    flex-wrap: wrap;
  }

  .nav-buttons .nav-link {
    display: none; /* Hide non-critical header links on mobile */
  }

  .support-card { padding: 2.5rem 1.5rem; }
  .support-actions { flex-direction: column; width: 100%; }
  .support-actions .btn { width: 100%; }
}

/* ===== Logged-in user button ===== */
#user-btn.is-logged-in {
  border-color: rgba(48, 209, 88, 0.4);
  color: var(--success-color);
}

/* ===== Favorites sidebar link ===== */
.favorites-link {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  text-align: left;
  padding: 0.7rem 0.9rem;
  border-radius: 11px;
  border: 1px solid rgba(255, 214, 10, 0.25);
  background: linear-gradient(135deg, rgba(255, 214, 10, 0.08), rgba(255, 214, 10, 0.02));
  color: var(--text-primary);
  font-family: var(--font-stack);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
}
.favorites-link svg { color: #ffd60a; flex-shrink: 0; }
.favorites-link span:first-of-type { flex: 1; }
.favorites-link:hover { border-color: rgba(255, 214, 10, 0.5); transform: translateY(-1px); }
.favorites-link.active {
  background: linear-gradient(135deg, rgba(255, 214, 10, 0.18), rgba(255, 214, 10, 0.05));
  box-shadow: inset 0 0 0 1px rgba(255, 214, 10, 0.4);
}

/* ===== Podium (highlights of the week) ===== */
.podium-section {
  width: 100%;
  max-width: 1200px;
  margin: 5rem auto 2rem;
  padding: 0 2rem;
}
.podium-section .section-title { font-size: clamp(2rem, 4vw, 3rem); }
.podium-section .section-subtitle { font-size: 1.05rem; }
.podium {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.6rem;
  align-items: end;
  max-width: 1040px;
  margin: 3rem auto 0;
}
.podium-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  text-align: center;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 22px;
  padding: 2rem 1.4rem;
  color: var(--text-primary);
  transition: var(--transition-spring);
  overflow: hidden; /* keep the FREE corner tab inside the rounded tile */
}
.podium-tile.podium-clickable { cursor: pointer; }
.podium-copy { margin-top: 0.4rem; }
.podium-tile .free-sticker { border-radius: 0 22px 0 10px; }
.podium-tile:hover { transform: translateY(-6px); border-color: var(--border-color-hover); }
.podium-tile.place-1 {
  padding-top: 2.9rem;
  padding-bottom: 2.9rem;
  border-color: rgba(255, 214, 10, 0.45);
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 214, 10, 0.16), transparent 60%),
    var(--bg-card);
  box-shadow: 0 12px 40px rgba(255, 214, 10, 0.14);
}
.podium-tile.place-2 { border-color: rgba(200, 200, 210, 0.35); }
.podium-tile.place-3 { border-color: rgba(205, 127, 50, 0.4); }
.podium-medal { font-size: 2.8rem; line-height: 1; }
.podium-rank { font-size: 0.78rem; font-weight: 800; letter-spacing: 0.08em; color: var(--text-secondary); }
.podium-name {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.25;
  word-break: break-word;
}
.podium-cat { margin-top: 0.2rem; }
.podium-stats { font-size: 0.9rem; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.podium-placeholder { opacity: 0.38; cursor: default; pointer-events: none; }
.podium-placeholder .podium-name { font-style: italic; color: var(--text-secondary); font-size: 1rem; }

@media (max-width: 640px) {
  .podium { grid-template-columns: 1fr; max-width: 360px; }
  .podium-tile.place-1 { order: -1; }
}

/* ===== Auth tabs (login / register) ===== */
.auth-tabs {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 1.2rem;
  background: rgba(0, 0, 0, 0.25);
  padding: 0.3rem;
  border-radius: 11px;
}
.auth-tab {
  flex: 1;
  padding: 0.55rem;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-stack);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  transition: var(--transition-smooth);
}
.auth-tab.active { background: rgba(255, 255, 255, 0.1); color: var(--text-primary); }
.login-hint {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin: -0.3rem 0 0.8rem;
  line-height: 1.4;
}

/* ===== Script name link ===== */
.script-name-link { color: inherit; text-decoration: none; }
.script-name-link:hover { color: var(--accent-color); text-decoration: underline; }

/* ===== Hidden admin dot in footer ===== */
.admin-dot {
  margin-left: 0.5rem;
  color: var(--text-muted);
  opacity: 0.25;
  text-decoration: none;
  cursor: default;
}
.admin-dot:hover { opacity: 0.6; }

/* ===== Admin control page ===== */
.admin-page { max-width: 1000px; margin: 2.5rem auto 4rem; padding: 0 2rem; width: 100%; }
.admin-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 2.5rem;
}
.admin-tabs { display: flex; gap: 0.6rem; margin: 1.5rem 0; flex-wrap: wrap; }
.admin-tab {
  padding: 0.6rem 1.1rem;
  border: 1px solid var(--border-color);
  border-radius: 11px;
  background: var(--bg-card);
  color: var(--text-secondary);
  font-family: var(--font-stack);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition-smooth);
}
.admin-tab.active { background: rgba(255, 255, 255, 0.08); color: var(--text-primary); border-color: var(--border-color-hover); }
.admin-tab-count {
  display: inline-block;
  margin-left: 0.4rem;
  font-size: 0.72rem;
  background: var(--danger-color);
  color: #fff;
  border-radius: 20px;
  padding: 0.05rem 0.45rem;
}
.admin-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 1.1rem 1.3rem;
  margin-bottom: 0.8rem;
}
.admin-row.is-deleted { opacity: 0.6; border-style: dashed; }
.admin-row-title { font-weight: 700; margin-bottom: 0.3rem; }
.admin-row-detail { color: var(--text-secondary); font-size: 0.9rem; margin: 0.3rem 0; white-space: pre-wrap; }
.admin-row-meta { font-size: 0.78rem; color: var(--text-muted); display: flex; flex-wrap: wrap; gap: 0.3rem; align-items: center; }
.admin-row-actions { flex-shrink: 0; }

/* ===== Script detail + comments page ===== */
.detail-page { max-width: 820px; margin: 2.5rem auto 4rem; padding: 0 2rem; width: 100%; }
.detail-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 2.2rem;
  margin-bottom: 2rem;
}
.detail-head .tag { margin-bottom: 0.8rem; display: inline-block; }
.detail-title { font-size: 1.8rem; font-weight: 800; line-height: 1.2; margin-bottom: 0.6rem; }
.detail-meta { font-size: 0.82rem; color: var(--text-secondary); display: flex; flex-wrap: wrap; gap: 0.35rem; }
.detail-desc { color: var(--text-secondary); margin: 1.2rem 0; line-height: 1.6; }

.comments-section { margin-top: 1rem; }
.comment-form { display: flex; flex-direction: column; gap: 0.7rem; margin: 1.2rem 0 2rem; }
.comment-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1rem 1.2rem;
  margin-bottom: 0.7rem;
}
.comment-head { display: flex; justify-content: space-between; align-items: baseline; gap: 0.5rem; margin-bottom: 0.35rem; }
.comment-author { font-weight: 700; font-size: 0.92rem; }
.comment-date { font-size: 0.74rem; color: var(--text-muted); }
.comment-text { color: var(--text-secondary); font-size: 0.92rem; line-height: 1.5; white-space: pre-wrap; word-break: break-word; }

/* ===== Tags, ratings, verification, My Scripts (v2 features) ===== */

/* Field hint under inputs */
.field-hint { font-size: 0.76rem; color: var(--text-muted); margin-top: 0.4rem; line-height: 1.4; }

/* Verified / approved seal badge */
.badge-verified {
  background-color: rgba(255, 184, 0, 0.14);
  color: #ffce5a;
  border: 1px solid rgba(255, 184, 0, 0.45);
}

/* Approved scripts are visually featured across the catalog */
.script-card.featured {
  border-color: rgba(255, 184, 0, 0.45);
  box-shadow: 0 0 0 1px rgba(255, 184, 0, 0.18), 0 14px 36px rgba(0, 0, 0, 0.5);
  background-image: linear-gradient(180deg, rgba(255, 184, 0, 0.05), transparent 38%);
}
.script-card.featured:hover {
  border-color: rgba(255, 184, 0, 0.7);
  box-shadow: 0 0 0 1px rgba(255, 184, 0, 0.3), 0 18px 44px rgba(0, 0, 0, 0.55);
}

/* Approved rows in the admin uploads list */
.admin-row.is-approved {
  border-color: rgba(255, 184, 0, 0.4);
  background-image: linear-gradient(180deg, rgba(255, 184, 0, 0.05), transparent 60%);
}

/* Featured (approved) script on its detail page */
.detail-card.featured {
  border-color: rgba(255, 184, 0, 0.45);
  box-shadow: 0 0 0 1px rgba(255, 184, 0, 0.18), 0 14px 36px rgba(0, 0, 0, 0.5);
}

/* Whole card is clickable (opens the detail page) — interactive controls opt out */
.script-card[data-clickable] { cursor: pointer; }
.script-card[data-clickable] .quickbar-box,
.script-card[data-clickable] .card-actions,
.script-card[data-clickable] .fav-btn,
.script-card[data-clickable] .rating-widget,
.script-card[data-clickable] .tag-pill,
.script-card[data-clickable] a,
.script-card[data-clickable] button { cursor: pointer; }
.script-card[data-clickable] .script-desc { cursor: pointer; }

/* My Scripts sidebar link reuses .favorites-link layout, blue theme */
.my-scripts-link {
  margin-top: 0.6rem;
  border-color: rgba(150, 90, 230, 0.35);
  background: linear-gradient(135deg, rgba(150, 90, 230, 0.1), rgba(150, 90, 230, 0.02));
}
.my-scripts-link svg { color: #b98cff; flex-shrink: 0; }
.my-scripts-link:hover { border-color: rgba(150, 90, 230, 0.6); }

/* Referral box in the sidebar (favorites unlock via referrals) */
.referral-box {
  margin-top: 0.8rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(255, 184, 0, 0.06), rgba(255, 184, 0, 0.01));
}
.referral-title { font-weight: 700; font-size: 0.9rem; margin-bottom: 0.35rem; }
.referral-status { font-size: 0.78rem; line-height: 1.4; margin-bottom: 0.6rem; }
.referral-status.ok { color: #5fd08a; }
.referral-status.locked { color: var(--text-muted); }
.referral-label { display: block; font-size: 0.72rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 0.3rem; }
.referral-link-row { display: flex; gap: 0.4rem; }
.referral-input {
  flex: 1; min-width: 0;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-secondary);
  font-family: "Space Mono", monospace;
  font-size: 0.72rem;
  padding: 0.4rem 0.55rem;
}
.referral-link-row .btn-sm { min-width: 38px; padding: 0.4rem 0.6rem; }
.my-scripts-link.active {
  border-color: rgba(150, 90, 230, 0.7);
  background: linear-gradient(135deg, rgba(150, 90, 230, 0.3), rgba(150, 90, 230, 0.08));
  box-shadow: inset 0 0 0 1px rgba(150, 90, 230, 0.6);
}

/* Tag pills on cards */
.script-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.2rem 0 1rem; }
.tag-pill {
  font-family: 'Space Mono', monospace;
  font-size: 0.72rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}
.tag-pill:hover { border-color: var(--accent-color); color: var(--text-primary); background: rgba(0, 113, 227, 0.12); }
.detail-tags .tag-pill { cursor: default; }
.detail-tags { margin: 0.4rem 0 1.4rem; }

/* Tag filter bar above the grid */
.tag-filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.2rem;
  padding: 0.8rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
}
.tag-filter-label { font-size: 0.82rem; color: var(--text-muted); font-weight: 600; }
.tag-chip {
  font-family: 'Space Mono', monospace;
  font-size: 0.74rem;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  background: rgba(0, 113, 227, 0.15);
  border: 1px solid rgba(0, 113, 227, 0.4);
  color: #4ca5ff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.tag-chip .tag-chip-x { font-weight: 700; }
.tag-clear-btn {
  font-size: 0.76rem;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: underline;
  margin-left: 0.3rem;
}
.tag-clear-btn:hover { color: var(--text-primary); }

/* Rating thumbs widget */
.rating-widget { display: inline-flex; gap: 0.4rem; align-items: center; }
.rate-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.35rem 0.6rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  transition: all 0.15s ease;
}
.rate-btn:hover { color: var(--text-primary); border-color: var(--accent-color); }
.rate-up.active { color: var(--success-color); border-color: rgba(48, 209, 88, 0.5); background: rgba(48, 209, 88, 0.12); }
.rate-down.active { color: var(--danger-color); border-color: rgba(255, 69, 58, 0.5); background: rgba(255, 69, 58, 0.12); }
.rate-count { font-family: 'Space Mono', monospace; }
.detail-rating { margin: 0.5rem 0 1.5rem; }

/* My Scripts stats banner */
.mine-stats {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.4rem;
  flex-wrap: wrap;
}
.mine-stat {
  flex: 1;
  min-width: 120px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 1rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.mine-stat-num { font-size: 1.6rem; font-weight: 800; line-height: 1; }
.mine-stat-label { font-size: 0.78rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }

/* ===== Calm ambient aurora background ===== */
#bg-aurora {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  overflow: hidden;
}

/* Interactive particle network sits just above the aurora, below content */
#bg-net {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
  display: block;
}
#bg-aurora::before,
#bg-aurora::after {
  content: "";
  position: absolute;
  width: 65vw;
  height: 65vw;
  border-radius: 50%;
  filter: blur(130px);
  opacity: 0.35;
  will-change: transform;
}
#bg-aurora::before {
  top: -15%;
  left: -10%;
  background: radial-gradient(circle, rgba(0, 113, 227, 0.55), transparent 70%);
  animation: aurora-drift-a 30s ease-in-out infinite alternate;
}
#bg-aurora::after {
  bottom: -20%;
  right: -10%;
  background: radial-gradient(circle, rgba(134, 37, 225, 0.45), transparent 70%);
  animation: aurora-drift-b 38s ease-in-out infinite alternate;
}
@keyframes aurora-drift-a {
  0%   { transform: translate(0, 0) scale(1); }
  100% { transform: translate(16vw, 12vh) scale(1.25); }
}
@keyframes aurora-drift-b {
  0%   { transform: translate(0, 0) scale(1.15); }
  100% { transform: translate(-14vw, -10vh) scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  #bg-aurora::before, #bg-aurora::after { animation: none; }
}

/* ===== Paywall / locked scripts ===== */
.quickbar-box.locked {
  position: relative;
  border-color: rgba(0, 113, 227, 0.35);
}
.quickbar-code.locked-code {
  filter: blur(5px);
  user-select: none;
  pointer-events: none;
  white-space: nowrap;
  overflow: hidden;
  flex: 1;
  min-width: 0;
  font-family: "Space Mono", monospace;
  font-size: 0.78rem;
  color: var(--text-secondary);
}
.unlock-btn { white-space: nowrap; }

.paywall-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1.2rem;
}
.paywall-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #4ca5ff;
  background: radial-gradient(circle at 50% 35%, rgba(0, 113, 227, 0.25), rgba(0, 113, 227, 0.05));
  border: 1px solid rgba(0, 113, 227, 0.4);
}
.paywall-text {
  color: var(--text-secondary);
  font-size: 0.98rem;
  line-height: 1.55;
  max-width: 380px;
}

/* ===== Admin: paywall toggle + users ===== */
.paywall-switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 1.2rem 1.4rem;
  margin-bottom: 1.4rem;
}
.paywall-switch-row .switch-info h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: 0.2rem; }
.paywall-switch-row .switch-info p { color: var(--text-secondary); font-size: 0.85rem; }
.toggle-switch {
  position: relative;
  width: 52px;
  height: 30px;
  flex-shrink: 0;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.15);
  transition: background 0.25s ease;
}
.toggle-switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.1);
}
.toggle-switch.on { background: var(--success-color); }
.toggle-switch.on::after { transform: translateX(22px); }
.user-unlock-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.12rem 0.5rem;
  border-radius: 5px;
}
.user-unlock-badge.yes { background: rgba(48, 209, 88, 0.15); color: var(--success-color); border: 1px solid rgba(48, 209, 88, 0.3); }
.user-unlock-badge.no { background: rgba(255, 255, 255, 0.06); color: var(--text-secondary); border: 1px solid var(--border-color); }

/* ===== Just-uploaded card highlight ===== */
.script-card.just-uploaded {
  animation: justUploadedPulse 2.4s ease;
  border-color: var(--accent-color);
}
@keyframes justUploadedPulse {
  0%   { box-shadow: 0 0 0 0 rgba(0, 113, 227, 0.55); }
  30%  { box-shadow: 0 0 0 8px rgba(0, 113, 227, 0.18); }
  100% { box-shadow: 0 0 0 0 rgba(0, 113, 227, 0); }
}

/* ===== Versioning ===== */
.ver-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  color: #ffce5a;
  font-weight: 600;
}
.rolling-btn.on { border-color: rgba(255, 184, 0, 0.5); color: #ffce5a; }

.versions-block {
  margin-top: 0.5rem;
  border-top: 1px solid var(--border-color);
  padding-top: 1rem;
}
.versions-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.7rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.ver-rolling {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: rgba(255, 184, 0, 0.14);
  color: #ffce5a;
  border: 1px solid rgba(255, 184, 0, 0.4);
  padding: 0.1rem 0.45rem;
  border-radius: 5px;
}
.versions-list { list-style: none; display: flex; flex-direction: column; gap: 0.6rem; }
.version-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.6rem;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.25);
}
.version-row.is-primary { border-color: rgba(255, 184, 0, 0.4); background: rgba(255, 184, 0, 0.04); }
.version-main { display: flex; align-items: center; flex-wrap: wrap; gap: 0.5rem 0.8rem; min-width: 0; }
.version-tag { font-weight: 700; font-size: 0.85rem; }
.version-date { color: var(--text-muted); font-size: 0.78rem; }
.version-note { color: var(--text-secondary); font-size: 0.84rem; }
.version-actions { display: flex; gap: 0.4rem; flex-shrink: 0; }

/* ===== Premium code preview ===== */
.preview-section { margin-top: 2.5rem; }
.code-preview { margin-top: 0.8rem; }
.code-block {
  background: #16161a;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.3rem 1.4rem;
  overflow-x: auto;
  font-family: "Space Mono", monospace;
  font-size: 0.82rem;
  line-height: 1.65;
  color: #a9b2c3;
  max-height: 520px;
  overflow-y: auto;
}
.code-block code { white-space: pre; }
.preview-locked {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.8rem;
  padding: 2.5rem 1.5rem;
  border: 1px dashed rgba(255, 184, 0, 0.4);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255, 184, 0, 0.05), transparent 70%);
}
.preview-lock-icon { font-size: 1.8rem; }
.preview-locked p { color: var(--text-secondary); max-width: 380px; }

/* ===== Plans page ===== */
.plans-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.4rem;
  max-width: 1080px;
  margin: 0 auto;
  align-items: stretch;
}
.plan-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 18px;
  padding: 2rem 1.8rem;
}
.plan-card.featured-plan { border-color: rgba(0, 113, 227, 0.5); box-shadow: 0 0 0 1px rgba(0, 113, 227, 0.2), 0 16px 40px rgba(0, 0, 0, 0.5); }
.plan-card.premium-plan { border-color: rgba(255, 184, 0, 0.45); background-image: linear-gradient(180deg, rgba(255, 184, 0, 0.05), transparent 40%); }
.plan-badge {
  position: absolute;
  top: -0.7rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent-color, #0071e3);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
}
.plan-name { font-size: 1.3rem; font-weight: 800; letter-spacing: -0.02em; }
.plan-price { font-size: 1.7rem; font-weight: 800; }
.plan-sub { color: var(--text-muted); font-size: 0.84rem; margin-bottom: 0.6rem; }
.plan-features { list-style: none; display: flex; flex-direction: column; gap: 0.55rem; margin: 0.6rem 0 1.4rem; flex: 1; }
.plan-features li { position: relative; padding-left: 1.6rem; font-size: 0.9rem; color: var(--text-secondary); line-height: 1.4; }
.plan-features li::before { position: absolute; left: 0; top: 0; font-weight: 700; }
.plan-features li.yes { color: var(--text-primary); }
.plan-features li.yes::before { content: '✓'; color: var(--success-color, #30d158); }
.plan-features li.no::before { content: '✕'; color: var(--text-muted); }
.plan-features li.cond { color: var(--text-primary); }
.plan-features li.cond::before { content: '✓'; color: #ffce5a; }

.paywall-banner {
  max-width: 1080px;
  margin: 0 auto 1.6rem;
  padding: 0.9rem 1.2rem;
  border: 1px solid rgba(0, 113, 227, 0.4);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(0, 113, 227, 0.12), rgba(134, 37, 225, 0.08));
  color: var(--text-primary);
  font-size: 0.92rem;
  line-height: 1.5;
  text-align: center;
}
.plan-card .btn { width: 100%; }

.paywall-plans-link { color: var(--accent-color, #4ca5ff); font-size: 0.86rem; font-weight: 600; text-decoration: none; }
.paywall-plans-link:hover { text-decoration: underline; }

@media (max-width: 860px) {
  .plans-grid { grid-template-columns: 1fr; max-width: 460px; }
}

/* ============================================================
   v3 batch: tier colors, favorites, comments, versions, menus
   ============================================================ */

/* --- DreamTeamS verified = light green (point 18) --- */
.badge-verified {
  background-color: rgba(82, 220, 130, 0.14);
  color: #7ef0a3;
  border: 1px solid rgba(82, 220, 130, 0.5);
}
.script-card.featured {
  border-color: rgba(82, 220, 130, 0.5);
  box-shadow: 0 0 0 1px rgba(82, 220, 130, 0.18), 0 14px 36px rgba(0, 0, 0, 0.5);
  background-image: linear-gradient(180deg, rgba(82, 220, 130, 0.05), transparent 38%);
}
.script-card.featured:hover {
  border-color: rgba(82, 220, 130, 0.75);
  box-shadow: 0 0 0 1px rgba(82, 220, 130, 0.3), 0 18px 44px rgba(0, 0, 0, 0.55);
}
.detail-card.featured {
  border-color: rgba(82, 220, 130, 0.5);
  box-shadow: 0 0 0 1px rgba(82, 220, 130, 0.18), 0 14px 36px rgba(0, 0, 0, 0.5);
}
.admin-row.is-approved {
  border-color: rgba(82, 220, 130, 0.4);
  background-image: linear-gradient(180deg, rgba(82, 220, 130, 0.05), transparent 60%);
}

/* --- Own scripts = subtle purple outline for the owner (point 19) --- */
.script-card.owned {
  border-color: rgba(150, 90, 230, 0.42);
  background-image: linear-gradient(180deg, rgba(150, 90, 230, 0.04), transparent 40%);
}
.script-card.owned:hover { border-color: rgba(150, 90, 230, 0.6); }

/* --- Favorites = gold (point 9) --- */
.fav-btn.active { color: #ffce5a; }
.fav-btn.active svg { fill: #ffce5a; stroke: #ffce5a; }

/* --- Language badges + upload language picker (point 23) --- */
.lang-badge {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 0.08rem 0.4rem;
  border-radius: 4px;
  background: rgba(0, 113, 227, 0.14);
  color: #79b8ff;
  border: 1px solid rgba(0, 113, 227, 0.3);
}
.lang-check-row { display: flex; gap: 1.2rem; }
.lang-check { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.9rem; color: var(--text-secondary); cursor: pointer; }
.lang-check input { accent-color: var(--accent-color, #0071e3); }

/* --- User dropdown menu (point 21) --- */
.user-menu {
  position: fixed;
  z-index: 2000;
  min-width: 190px;
  background: var(--bg-card, #1a1a1f);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.55);
  padding: 0.4rem;
  display: flex;
  flex-direction: column;
}
.user-menu-item {
  text-align: left;
  background: none;
  border: none;
  color: var(--text-primary);
  font-family: var(--font-stack);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.6rem 0.8rem;
  border-radius: 8px;
  cursor: pointer;
}
.user-menu-item:hover { background: rgba(255, 255, 255, 0.06); }
.user-menu-item.danger { color: #ff6b6b; }
.user-menu-item.danger:hover { background: rgba(255, 80, 80, 0.1); }

/* --- Generic info modal body --- */
.info-body { line-height: 1.5; }

/* --- Comments: name row, votes, premium highlight (points 15, 16) --- */
.comment-name-row { display: flex; gap: 0.5rem; align-items: center; }
.comment-name-row .form-control { flex: 1; }
.comment-name-row .btn-sm { flex-shrink: 0; white-space: nowrap; }
.comment-item.premium-comment {
  border: 1px solid rgba(255, 184, 0, 0.4);
  background: linear-gradient(180deg, rgba(255, 184, 0, 0.05), transparent 60%);
  border-radius: 12px;
  padding: 1rem 1.1rem;
}
.comment-badge {
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  padding: 0.08rem 0.45rem;
  border-radius: 4px;
  vertical-align: middle;
}
.comment-badge.premium { background: rgba(255, 184, 0, 0.16); color: #ffce5a; border: 1px solid rgba(255, 184, 0, 0.45); }
.comment-badge.team { background: rgba(82, 220, 130, 0.16); color: #7ef0a3; border: 1px solid rgba(82, 220, 130, 0.45); }
.comment-actions { display: flex; gap: 0.5rem; margin-top: 0.6rem; }
.cvote {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  border-radius: 8px;
  padding: 0.25rem 0.6rem;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.15s ease;
}
.cvote:hover { color: var(--text-primary); border-color: var(--border-color-hover); }
.cvote.clike.active { color: #7ef0a3; border-color: rgba(82, 220, 130, 0.5); }
.cvote.cdislike.active { color: #ff8080; border-color: rgba(255, 80, 80, 0.5); }

/* --- Premium code preview window (points 1, 14) --- */
.code-window {
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
  background: #16161a;
}
.code-window-bar {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.6rem 0.9rem;
  background: #0e0e11;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.code-dots { display: inline-flex; gap: 0.35rem; }
.code-dots i { width: 10px; height: 10px; border-radius: 50%; background: #3a3a42; display: block; }
.code-dots i:nth-child(1) { background: #ff5f57; }
.code-dots i:nth-child(2) { background: #febc2e; }
.code-dots i:nth-child(3) { background: #28c840; }
.code-fname { flex: 1; font-family: "Space Mono", monospace; font-size: 0.78rem; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.code-window-body { max-height: 540px; overflow-x: hidden; overflow-y: auto; }
.code-window-body .code-block { border: none; border-radius: 0; margin: 0; max-height: none; overflow-x: hidden; }
.code-window-body .code-block code { white-space: pre-wrap; word-break: break-word; overflow-wrap: anywhere; }
.preview-status { padding: 1.3rem 1.4rem; color: var(--text-muted); margin: 0; }

/* Green flash to confirm the referral link was copied (point 6) */
@keyframes flashGreen {
  0%   { box-shadow: 0 0 0 0 rgba(82, 220, 130, 0.0); border-color: var(--border-color); }
  15%  { box-shadow: 0 0 0 3px rgba(82, 220, 130, 0.35); border-color: rgba(82, 220, 130, 0.8); background: rgba(82, 220, 130, 0.12); }
  100% { box-shadow: 0 0 0 0 rgba(82, 220, 130, 0.0); border-color: var(--border-color); }
}
.flash-green { animation: flashGreen 1.1s ease; }
.ref-copied-line { color: #7ef0a3; font-weight: 600; }

/* Green "copied" state for buttons that aren't .copy-btn (detail/preview/versions) */
.btn.copied { background-color: var(--success-color, #30d158); color: #fff; border-color: transparent; }

/* ============================================================
   v4 batch: golden P, favorite glow, comment trash, aliases
   ============================================================ */

/* Golden "P" badge for Premium (points 3, 4) */
.p-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.2em;
  height: 1.2em;
  font-size: 0.82em;
  font-weight: 800;
  line-height: 1;
  color: #1c1500;
  background: linear-gradient(135deg, #ffd76a, #f0a400);
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(255, 184, 0, 0.5);
  vertical-align: middle;
  margin-left: 0.2em;
}

/* Favorites: golden dotted, gently glowing ring (point 6) */
.script-card.favorited {
  outline: 2px dotted rgba(255, 206, 90, 0.8);
  outline-offset: 3px;
  animation: favGlow 2.6s ease-in-out infinite;
}
@keyframes favGlow {
  0%, 100% { box-shadow: 0 0 12px rgba(255, 206, 90, 0.22); }
  50%      { box-shadow: 0 0 22px rgba(255, 206, 90, 0.42); }
}
@media (prefers-reduced-motion: reduce) {
  .script-card.favorited { animation: none; box-shadow: 0 0 16px rgba(255, 206, 90, 0.3); }
}

/* Comment trash button: sits bottom-right, styled like the vote buttons (point 1) */
.comment-actions .cdelete { margin-left: auto; }
.cdelete:hover { color: #ff8080; border-color: rgba(255, 80, 80, 0.5); }

/* Login prompt shown to visitors instead of the comment form */
.comment-login-prompt {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 1rem 1.2rem;
  border: 1px solid var(--border-color);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(0, 113, 227, 0.1), rgba(134, 37, 225, 0.07));
}
.comment-login-prompt .clp-icon {
  flex-shrink: 0;
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 10px;
  color: #79b8ff;
  background: rgba(0, 113, 227, 0.14);
  border: 1px solid rgba(0, 113, 227, 0.3);
}
.comment-login-prompt .clp-text { flex: 1; color: var(--text-secondary); font-size: 0.95rem; line-height: 1.4; }
.comment-login-prompt .btn { flex-shrink: 0; }
@media (max-width: 520px) {
  .comment-login-prompt { flex-direction: column; text-align: center; }
}

/* Alias list in the user dropdown (point 2) */
.user-menu-aliases {
  border-top: 1px solid var(--border-color);
  margin-top: 0.3rem;
  padding: 0.5rem 0.8rem 0.3rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.user-menu-label { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); }
.user-menu-alias { font-size: 0.82rem; color: var(--text-secondary); font-family: "Space Mono", monospace; }

/* --- Admin sub bar --- */
.admin-subbar { display: flex; justify-content: flex-end; margin-bottom: 1rem; }
.admin-row.is-resolved { opacity: 0.75; }

/* --- Footer: active page + delete link (points 6, 11, 22) --- */
.footer-links a.active {
  color: #fff;
  background: linear-gradient(135deg, rgba(0, 113, 227, 0.95), rgba(134, 37, 225, 0.95));
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  box-shadow: 0 0 16px rgba(90, 120, 255, 0.55);
}
.footer-links a.footer-danger { color: #ff7a7a; }
.footer-links a.footer-danger:hover { color: #ff5a5a; }
