:root {
  --bg-dark: #0c0c0f;
  --bg-card: #12121a;
  --bg-hover: #1a1a25;
  --text-dim: #6b6b80;
  --text-main: #a0a0b0;
  --text-bright: #ffffff;
  --accent: #7c5cff;
  --accent-hover: #9b7fff;
  --accent-soft: rgba(124, 92, 255, 0.15);
  --border: #1e1e2a;
  --success: #22c55e;
  --error: #ef4444;
  --pending: #eab308;
}

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

html,
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-dark);
  color: var(--text-main);
  min-height: 100vh;
  text-transform: lowercase;
  letter-spacing: 0.02em;
  overflow-x: hidden;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 3rem;
}

.logo {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-bright);
  text-decoration: none;
  letter-spacing: 0.1em;
}

.logo:hover {
  color: #fff;
}

nav a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.85rem;
  margin-left: 2rem;
  transition: color 0.2s ease;
}

nav a:hover {
  color: var(--text-bright);
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.post-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.post-card .image-preview {
  width: 100%;
  height: 180px;
  background: var(--bg-dark);
  border-radius: 4px;
  margin-bottom: 1rem;
  overflow: hidden;
}

.post-card .image-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.post-card h3 {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-bright);
  margin-bottom: 0.5rem;
}

.post-card p {
  font-size: 0.85rem;
  color: var(--text-dim);
  line-height: 1.5;
  margin-bottom: 1rem;
}

.post-card .meta {
  font-size: 0.75rem;
  color: var(--text-dim);
  opacity: 0.7;
}

.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-dim);
}

.empty-state h2 {
  font-size: 1.2rem;
  font-weight: 400;
  margin-bottom: 0.5rem;
}

.form-container {
  max-width: 500px;
  margin: 4rem auto;
}

.form-container h1 {
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--text-bright);
  margin-bottom: 2rem;
  text-align: center;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-bottom: 0.5rem;
}

.form-group input,
.form-group textarea {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.75rem 1rem;
  color: var(--text-bright);
  font-size: 0.9rem;
  font-family: inherit;
  text-transform: lowercase;
  transition: border-color 0.2s ease;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
}

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

.btn {
  display: inline-block;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.75rem 1.5rem;
  color: var(--text-main);
  font-size: 0.85rem;
  font-family: inherit;
  text-transform: lowercase;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn:hover {
  background: var(--bg-hover);
  border-color: var(--accent);
  color: var(--text-bright);
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  width: 100%;
}

.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.error-msg {
  color: var(--error);
  font-size: 0.85rem;
  margin-top: 1rem;
  text-align: center;
}

.success-msg {
  color: var(--success);
  font-size: 0.85rem;
  margin-top: 1rem;
  text-align: center;
}

.post-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.9);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  padding: 2rem;
}

.post-modal.active {
  display: flex;
}

.post-modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  max-width: 700px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  padding: 2rem;
  position: relative;
}

.post-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 1.5rem;
  cursor: pointer;
  transition: color 0.2s ease;
}

.post-modal-close:hover {
  color: var(--text-bright);
}

.post-modal-content h2 {
  font-size: 1.3rem;
  font-weight: 500;
  color: var(--text-bright);
  margin-bottom: 1rem;
}

.post-modal-content .post-image {
  width: 100%;
  max-height: 400px;
  object-fit: contain;
  border-radius: 4px;
  margin-bottom: 1.5rem;
}

.post-modal-content .post-body {
  color: var(--text-main);
  line-height: 1.7;
  white-space: pre-wrap;
}

.post-modal-content .post-date {
  margin-top: 1.5rem;
  font-size: 0.8rem;
  color: var(--text-dim);
  opacity: 0.7;
}

.admin-bar {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.admin-bar span {
  font-size: 0.8rem;
  color: var(--text-dim);
}

@media (max-width: 768px) {
  .container {
    padding: 1rem;
  }

  header {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }

  nav a {
    margin: 0 1rem;
  }

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

.hero {
  min-height: 70vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 4rem 0;
}

.hero-content {
  margin-bottom: 4rem;
}

.hero-title {
  font-size: 3.5rem;
  font-weight: 600;
  color: var(--text-bright);
  margin-bottom: 0.5rem;
  letter-spacing: 0.15em;
}

.hero-subtitle {
  font-size: 1.1rem;
  color: var(--text-dim);
  margin-bottom: 2rem;
}

.hero-stats {
  display: flex;
  gap: 3rem;
  justify-content: center;
  margin-bottom: 2rem;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-value {
  font-size: 2rem;
  font-weight: 600;
  color: var(--text-bright);
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-dim);
}

.hero-btn {
  padding: 1rem 2.5rem;
  font-size: 0.9rem;
}

.hero-features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  max-width: 800px;
}

.feature {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  text-align: center;
}

.feature-icon {
  margin-bottom: 0.75rem;
  color: var(--accent);
}

.feature-icon svg {
  width: 2rem;
  height: 2rem;
  stroke-width: 1.5;
}

.feature h3 {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-bright);
  margin-bottom: 0.5rem;
}

.feature p {
  font-size: 0.8rem;
  color: var(--text-dim);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.tag {
  font-size: 0.7rem;
  padding: 0.25rem 0.5rem;
  background: var(--bg-dark);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-dim);
}

.tag.keyless {
  border-color: #2a4a2a;
  color: #5a8a5a;
}

.tag.mobile {
  border-color: #2a3a5a;
  color: #5a7aaa;
}

.post-modal-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.markdown-editor {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.editor-toolbar {
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
}

.editor-toolbar button {
  background: var(--bg-dark);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-dim);
  padding: 0.4rem 0.6rem;
  font-size: 0.75rem;
  cursor: pointer;
  font-family: inherit;
  text-transform: lowercase;
}

.editor-toolbar button:hover {
  color: var(--text-bright);
  border-color: var(--accent);
}

.checkbox-group {
  display: flex;
  gap: 2rem;
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.checkbox-item input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  accent-color: var(--text-dim);
}

.checkbox-item label {
  margin: 0;
}

.post-body {
  line-height: 1.7;
}

.post-body h1,
.post-body h2,
.post-body h3 {
  color: var(--text-bright);
  margin: 1rem 0 0.5rem 0;
}

.post-body p {
  margin-bottom: 0.75rem;
}

.post-body code {
  background: var(--bg-dark);
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  font-family: monospace;
  font-size: 0.85em;
}

.post-body pre {
  background: var(--bg-dark);
  padding: 1rem;
  border-radius: 6px;
  overflow-x: auto;
  margin: 1rem 0;
}

.post-body pre code {
  background: none;
  padding: 0;
}

.post-body ul,
.post-body ol {
  margin-left: 1.5rem;
  margin-bottom: 0.75rem;
}

.post-body a {
  color: var(--text-bright);
}

@media (max-width: 768px) {
  .hero-title {
    font-size: 2rem;
  }

  .hero-features {
    grid-template-columns: 1fr;
  }

  .hero-stats {
    gap: 2rem;
  }
}

.post-card {
  text-decoration: none;
  display: block;
}

.script-page {
  max-width: 900px;
  margin: 0 auto;
}

.script-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2rem;
  margin-bottom: 2rem;
}

.script-info h1 {
  font-size: 1.8rem;
  font-weight: 600;
  color: var(--text-bright);
  margin-bottom: 0.75rem;
}

.script-meta {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}

.script-date {
  font-size: 0.8rem;
  color: var(--text-dim);
}

.script-actions .btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.script-actions .btn svg {
  width: 1rem;
  height: 1rem;
}

.script-image {
  margin-bottom: 2rem;
  border-radius: 8px;
  overflow: hidden;
}

.script-image img {
  width: 100%;
  max-height: 400px;
  object-fit: cover;
}

.script-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.script-section h2 {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-bright);
  margin-bottom: 1rem;
}

.script-description {
  color: var(--text-main);
  line-height: 1.7;
}

.script-code-container {
  background: var(--bg-dark);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}

.script-code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
}

.script-code-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-dim);
}

.script-code-info svg {
  width: 1rem;
  height: 1rem;
}

.script-code {
  padding: 1rem;
  margin: 0;
  overflow-x: auto;
  max-height: 400px;
  overflow-y: auto;
}

.script-code code {
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 0.85rem;
  color: var(--text-main);
  white-space: pre;
}

.script-loadstring {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  margin-top: 1.5rem;
}

.script-loadstring h3 {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-bright);
  margin-bottom: 1rem;
}

.loadstring-box {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--bg-dark);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1rem;
}

.loadstring-box code {
  flex: 1;
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 0.8rem;
  color: #9d7cd8;
  word-break: break-all;
}

.loadstring-box .btn {
  flex-shrink: 0;
}

.btn-small {
  padding: 0.5rem 0.75rem;
  font-size: 0.75rem;
}

.btn-small svg {
  width: 0.875rem;
  height: 0.875rem;
}

.script-not-found {
  text-align: center;
  padding: 4rem 2rem;
}

.script-not-found h2 {
  font-size: 1.5rem;
  color: var(--text-bright);
  margin-bottom: 0.5rem;
}

.script-not-found p {
  color: var(--text-dim);
  margin-bottom: 2rem;
}

.file-upload {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.file-upload .btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.file-upload .btn svg {
  width: 1rem;
  height: 1rem;
}

.file-name {
  font-size: 0.85rem;
  color: var(--text-dim);
}

.script-preview {
  margin-top: 1rem;
  background: var(--bg-dark);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}

.script-preview-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-dim);
}

.script-preview-header svg {
  width: 1rem;
  height: 1rem;
}

.script-preview pre {
  padding: 1rem;
  margin: 0;
  max-height: 200px;
  overflow-y: auto;
}

.script-preview code {
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 0.8rem;
  color: var(--text-main);
  white-space: pre;
}

@media (max-width: 768px) {
  .script-header {
    flex-direction: column;
  }

  .script-info h1 {
    font-size: 1.4rem;
  }

  .loadstring-box {
    flex-direction: column;
    align-items: stretch;
  }
}

.dashboard-header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.dashboard {
  max-width: 900px;
  margin: 0 auto;
}

.dashboard h1 {
  font-size: 1.5rem;
  color: var(--text-bright);
  margin-bottom: 2rem;
}

.dashboard-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.stat-card svg {
  width: 1.5rem;
  height: 1.5rem;
  color: var(--accent);
}

.stat-info {
  display: flex;
  flex-direction: column;
}

.stat-info .stat-value {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-bright);
}

.stat-info .stat-label {
  font-size: 0.75rem;
  color: var(--text-dim);
}

.dashboard-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

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

.section-header h2 {
  font-size: 1rem;
  color: var(--text-bright);
}

.section-header .btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-header .btn svg {
  width: 1rem;
  height: 1rem;
}

.upload-form {
  background: var(--bg-hover);
  border-radius: 6px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

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

.scripts-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.script-item,
.pending-item {
  background: var(--bg-hover);
  border-radius: 6px;
  padding: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.script-item-info,
.pending-item-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.script-item h3,
.pending-item h3 {
  font-size: 0.9rem;
  color: var(--text-bright);
}

.status-badge {
  font-size: 0.7rem;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  text-transform: uppercase;
}

.status-badge.pending {
  background: rgba(234, 179, 8, 0.2);
  color: var(--pending);
}

.status-badge.approved {
  background: rgba(34, 197, 94, 0.2);
  color: var(--success);
}

.status-badge.rejected {
  background: rgba(239, 68, 68, 0.2);
  color: var(--error);
}

.script-item-meta,
.pending-item-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.pending-item .author {
  font-size: 0.8rem;
  color: var(--text-dim);
}

.date {
  font-size: 0.75rem;
  color: var(--text-dim);
}

.form-footer {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.85rem;
  color: var(--text-dim);
}

.form-footer a {
  color: var(--accent);
  text-decoration: none;
}

.form-footer a:hover {
  text-decoration: underline;
}

.hero-buttons {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
}

.hero-btn {
  padding: 1rem 2rem;
}

.review-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  padding: 2rem;
}

.review-modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  max-width: 700px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  padding: 2rem;
  position: relative;
}

.review-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 1.5rem;
  cursor: pointer;
}

.modal-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1rem 0;
  color: var(--text-dim);
  font-size: 0.85rem;
}

.modal-description {
  margin: 1.5rem 0;
  line-height: 1.6;
}

.modal-code {
  margin: 1.5rem 0;
}

.modal-code h4 {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-bottom: 0.5rem;
}

.modal-code pre {
  background: var(--bg-dark);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1rem;
  max-height: 200px;
  overflow-y: auto;
}

.modal-code code {
  font-family: 'Consolas', monospace;
  font-size: 0.8rem;
  color: var(--text-main);
}

.modal-actions {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  margin-top: 1.5rem;
}

.btn-approve {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}

.btn-approve:hover {
  background: #16a34a;
}

.btn-reject {
  background: var(--error);
  border-color: var(--error);
  color: #fff;
}

.btn-reject:hover {
  background: #dc2626;
}

.pending-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.empty-state {
  text-align: center;
  padding: 2rem;
  color: var(--text-dim);
}

/* RScripts-style components */
.main-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.main-header .logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-bright);
  text-decoration: none;
}

.main-header .logo svg {
  width: 1.5rem;
  height: 1.5rem;
  color: var(--accent);
}

.header-nav {
  display: flex;
  gap: 1.5rem;
}

.header-nav a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s;
}

.header-nav a:hover {
  color: var(--text-bright);
}

.header-nav a svg {
  width: 1rem;
  height: 1rem;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-main);
}

.btn-outline:hover {
  background: var(--bg-hover);
  border-color: var(--accent);
  color: var(--text-bright);
}

.home-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

.hero-section {
  text-align: center;
  padding: 3rem 0;
}

.hero-section h1 {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text-bright);
  margin-bottom: 0.5rem;
}

.hero-desc {
  color: var(--text-dim);
  margin-bottom: 2rem;
}

.search-box {
  display: flex;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  max-width: 600px;
  margin: 0 auto 1.5rem;
}

.search-box svg {
  width: 1.25rem;
  height: 1.25rem;
  color: var(--text-dim);
  margin-right: 0.75rem;
}

.search-box input {
  flex: 1;
  background: none;
  border: none;
  color: var(--text-bright);
  font-size: 0.95rem;
  outline: none;
}

.search-box input::placeholder {
  color: var(--text-dim);
}

.filter-tags {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.filter-tag {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 0.5rem 1rem;
  font-size: 0.8rem;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.2s;
}

.filter-tag:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.filter-tag svg {
  width: 0.9rem;
  height: 0.9rem;
}

.features-section {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  margin: 3rem 0;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
}

.feature-card .feature-icon {
  width: 2.5rem;
  height: 2.5rem;
  background: var(--accent-soft);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}

.feature-card .feature-icon svg {
  width: 1.25rem;
  height: 1.25rem;
  color: var(--accent);
}

.feature-card h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-bright);
  margin-bottom: 0.5rem;
}

.feature-card p {
  font-size: 0.85rem;
  color: var(--text-dim);
  line-height: 1.5;
}

.scripts-section {
  margin-top: 2rem;
}

.scripts-section .section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.scripts-section h2 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-bright);
}

.scripts-section h2 svg {
  width: 1.25rem;
  height: 1.25rem;
  color: var(--accent);
}

.view-all {
  color: var(--accent);
  font-size: 0.85rem;
  text-decoration: none;
}

.view-all:hover {
  text-decoration: underline;
}

.scripts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

.script-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  display: block;
  position: relative;
  transition: border-color 0.2s, transform 0.2s;
}

.script-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.script-thumb {
  width: 100%;
  height: 140px;
  background: var(--bg-hover);
  position: relative;
}

.script-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.script-thumb.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
}

.script-thumb.placeholder svg {
  width: 2.5rem;
  height: 2.5rem;
  color: var(--text-dim);
}

.script-body {
  padding: 1rem;
}

.game-tag {
  display: inline-block;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.7rem;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  margin-bottom: 0.5rem;
}

.script-card h4 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-bright);
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.script-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-dim);
}

.script-badges {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  display: flex;
  gap: 0.4rem;
}

.script-badges .badge {
  width: 1.75rem;
  height: 1.75rem;
  background: var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.script-badges .badge svg {
  width: 0.9rem;
  height: 0.9rem;
  color: #fff;
}

.loading,
.empty {
  text-align: center;
  padding: 3rem;
  color: var(--text-dim);
  grid-column: 1 / -1;
}