/* Roscripters.com - UI Components */

/* ============================
   BUTTONS (Consistent Heights)
   ============================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    height: var(--height-button);
    padding: 0 var(--space-4);
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    border-radius: var(--radius-input);
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    white-space: nowrap;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--accent);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover:not(:disabled) {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(139, 92, 246, 0.35);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover:not(:disabled) {
    background: var(--bg-card);
    color: var(--text-primary);
}

.btn-outline-light {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-light);
}

.btn-outline-light:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--border-hover);
    color: var(--text-primary);
}

.btn-danger {
    background: var(--error);
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background: #dc2626;
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-sm {
    height: var(--height-button-sm);
    padding: 0 var(--space-3);
    font-size: var(--text-xs);
}

.btn-lg {
    height: var(--height-button-lg);
    padding: 0 var(--space-5);
    font-size: var(--text-base);
}

.btn-icon {
    width: var(--height-button);
    height: var(--height-button);
    padding: 0;
}

/* ============================
   FORM ELEMENTS (Consistent Heights)
   ============================ */

.form-group {
    margin-bottom: var(--space-5);
}

.form-label {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: var(--space-2);
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    color: var(--text-primary);
}

.form-input,
.form-select {
    width: 100%;
    height: var(--height-input);
    padding: 0 var(--space-4);
    font-size: var(--text-base);
    color: var(--text-primary);
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-input);
    transition: all var(--transition-fast);
}

.form-textarea {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    font-size: var(--text-base);
    color: var(--text-primary);
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-input);
    transition: all var(--transition-fast);
    min-height: 120px;
    resize: vertical;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--text-muted);
}

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23a0a0b0' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

.form-checkbox {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    cursor: pointer;
}

.form-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
    cursor: pointer;
}

.form-error {
    color: var(--error);
    font-size: var(--text-sm);
    margin-top: var(--spacing-xs);
}

.form-hint {
    color: var(--text-muted);
    font-size: var(--text-sm);
    margin-top: var(--spacing-xs);
}

/* ============================
   CARDS
   ============================ */

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition-normal);
}

.card:hover {
    border-color: var(--border-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.card-body {
    padding: var(--spacing-lg);
}

.card-header {
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--border);
}

.card-footer {
    padding: var(--spacing-lg);
    border-top: 1px solid var(--border);
    background: var(--bg-secondary);
}

/* Script Card */
/* Script Card (Compact Rscripts Density) */
.script-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.2s ease;
    height: 100%;
}

.script-card:hover {
    transform: translateY(-2px);
    border-color: var(--border-hover);
    box-shadow: var(--shadow-card-hover);
}

.script-card-media {
    position: relative;
    aspect-ratio: 16/9;
    background: #000;
    overflow: hidden;
}

.script-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.script-card:hover .script-card-img {
    transform: scale(1.05);
}

/* Badges (Overlays) */
.badge-overlay {
    position: absolute;
    z-index: 10;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 3px 6px;
    border-radius: 4px;
    /* Compact padding */
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-top-left {
    top: 6px;
    left: 6px;
    display: flex;
    gap: 4px;
}

.badge-top-right {
    top: 6px;
    right: 6px;
}

.badge-bottom-right {
    bottom: 6px;
    right: 6px;
    display: flex;
    gap: 4px;
}

.badge-new {
    background: var(--accent);
    color: #fff;
}

.badge-bumped {
    background: #1DB614;
    color: #fff;
}

/* Green */

.badge-icon {
    width: 20px;
    height: 20px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}

/* Content Area */
.script-card-content {
    padding: 12px;
    /* 12px padding - Compact */
    display: flex;
    flex-direction: column;
    flex: 1;
    position: relative;
}

.game-tag-pill {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    background: rgba(0, 184, 255, 0.1);
    color: var(--accent);
    /* Cyan */
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: 100px;
    margin-bottom: 6px;
    align-self: flex-start;
    border: 1px solid rgba(0, 184, 255, 0.2);
}

.script-card-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.script-card-footer {
    margin-top: auto;
    padding-top: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid var(--border-subtle);
}

.author-info {
    display: flex;
    align-items: center;
    gap: 6px;
}

.author-avatar {
    width: 18px;
    height: 18px;
    border-radius: 50%;
}

.author-name {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* 12px */

.meta-info {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}



/* ============================
   BADGES
   ============================ */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 0.25rem 0.5rem;
    font-size: var(--text-xs);
    font-weight: var(--font-medium);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.badge-new {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.badge-bumped {
    background: var(--warning);
    color: #1a1a1a;
    border-color: var(--warning);
}

.badge-verified {
    background: var(--info);
    color: white;
    border-color: var(--info);
}


.badge-mobile {
    background: transparent;
    color: #22c55e;
    border: 1px solid #22c55e;
    /* Rscripts Outline Style */
}

.badge-nokey {
    background: var(--accent-light);
    color: var(--accent);
    border: 1px solid var(--accent);
}

.badge-key {
    background: rgba(249, 115, 22, 0.1);
    color: #f97316;
    /* Orange */
    border: 1px solid #f97316;
}

.badge-premium {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: #1a1a1a;
    border-color: transparent;
}

/* ============================
   HEADER / NAVIGATION
   ============================ */

/* ============================
   HEADER / NAVIGATION
   ============================ */

.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: rgba(13, 13, 16, 0.85);
    /* Darker, rscripts tone */
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-subtle);
    z-index: 9999;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    padding: 0 24px;
    max-width: var(--max-width);
    margin: 0 auto;
}

/* Online Stats Row (New) */
.header-stats-row {
    position: fixed;
    top: var(--header-height);
    left: 0;
    width: 100%;
    background: rgba(13, 13, 16, 0.95);
    border-bottom: 1px solid var(--border-subtle);
    padding: 6px 0;
    z-index: var(--z-dropdown) - 1;
    display: flex;
    justify-content: center;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0 10px;
}

.stat-dot {
    width: 6px;
    height: 6px;
    background-color: #22c55e;
    border-radius: 50%;
    box-shadow: 0 0 4px #22c55e;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
}

.header-logo img {
    height: 28px;
    width: auto;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: 20px;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    border-radius: 99px;
    /* Pill */
    transition: all 0.2s;
    text-decoration: none;
}

.nav-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

.nav-link.active {
    color: var(--accent);
    /* Cyan */
    background: rgba(255, 255, 255, 0.08);
}

/* Header Search (Consistent with design tokens) */
.header-search {
    position: relative;
}

.header-search-input {
    width: 240px;
    height: var(--height-input);
    padding: 0 var(--space-3) 0 40px;
    font-size: var(--text-sm);
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-input);
    color: #fff;
    transition: all var(--transition-fast);
}

.header-search-input:focus {
    width: 300px;
    background: var(--bg-card);
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-light);
    outline: none;
}

.header-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    width: 16px;
    height: 16px;
    pointer-events: none;
}

.shortcut-hint {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.7rem;
    color: var(--text-muted);
    border: 1px solid var(--border-light);
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.05);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Header Avatar */
.header-user-btn {
    padding: 2px;
    background: none;
    border: none;
    cursor: pointer;
    border-radius: 50%;
    transition: transform 0.2s;
}

.header-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid transparent;
}

.header-user-btn:hover .header-user-avatar {
    border-color: rgba(255, 255, 255, 0.2);
}

/* Premium Ring */
.is-premium .header-user-avatar {
    border-color: #fbbf24;
    box-shadow: 0 0 8px rgba(251, 191, 36, 0.3);
}

/* ============================
   DROPDOWN MENU (Rich)
   ============================ */

.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 240px;
    background: #18191c;
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    overflow: hidden;
    padding: 6px;
}

.dropdown.active .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* User Header inside Dropdown */
.dropdown-user-header {
    padding: 12px;
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.dropdown-user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.dropdown-user-info {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.dropdown-user-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 4px;
}

.dropdown-user-email {
    font-size: 0.75rem;
    color: #71717a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    font-size: 0.85rem;
    color: #d4d4d8;
    text-decoration: none;
    border-radius: 6px;
    transition: background 0.1s;
}

.dropdown-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
}

.dropdown-item i {
    width: 16px;
    height: 16px;
    color: #a1a1aa;
}

.dropdown-item:hover i {
    color: #fff;
}

.dropdown-divider {
    height: 1px;
    background: var(--border-subtle);
    margin: 6px 0;
}

.dropdown-item.text-danger {
    color: #ef4444;
}

.dropdown-item.text-danger:hover {
    background: rgba(239, 68, 68, 0.1);
}

.dropdown-item.text-danger i {
    color: #ef4444;
}

/* ============================
   NOTIFICATIONS POPOVER
   ============================ */

.notifications-menu {
    width: 320px;
    padding: 0;
}

.dropdown-caret {
    position: absolute;
    top: -6px;
    right: 16px;
    width: 12px;
    height: 12px;
    background: #18191c;
    border-left: 1px solid var(--border-subtle);
    border-top: 1px solid var(--border-subtle);
    transform: rotate(45deg);
}

.notifications-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--border-subtle);
}

.notifications-title {
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--text-primary);
}

.notifications-viewall {
    font-size: var(--text-xs);
    color: var(--accent);
    text-decoration: none;
}

.notifications-viewall:hover {
    text-decoration: underline;
}

.notifications-body {
    max-height: 300px;
    overflow-y: auto;
}

.notifications-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
    padding: var(--space-6) var(--space-4);
    color: var(--text-muted);
    text-align: center;
}

.notifications-empty i {
    opacity: 0.5;
}

.notifications-empty span {
    font-size: var(--text-sm);
}

/* ============================
   MODAL
   ============================ */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-lg);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-fast);
    z-index: var(--z-modal);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    transform: scale(0.95);
    transition: transform var(--transition-fast);
}

.modal-overlay.active .modal {
    transform: scale(1);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--border);
}

.modal-title {
    font-size: var(--text-lg);
    font-weight: var(--font-semibold);
}

.modal-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.modal-body {
    padding: var(--spacing-lg);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--spacing-sm);
    padding: var(--spacing-lg);
    border-top: 1px solid var(--border);
}

/* ============================
   TOAST / ALERTS (Premium Redesign)
   ============================ */

/* Toast Container */
.toast-container {
    position: fixed;
    top: calc(var(--header-height) + var(--space-5));
    right: var(--space-5);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    z-index: var(--z-toast);
    pointer-events: none;
}

/* Base Toast */
.toast {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    width: var(--toast-width);
    max-width: var(--toast-max-width);
    padding: var(--space-3) var(--space-4);
    background: var(--bg-card);
    border: 1px solid var(--neutral);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-popover);
    pointer-events: auto;

    /* Animation */
    opacity: 0;
    transform: translateY(8px);
    animation: toastSlideIn var(--transition-toast) forwards;
}

.toast.hiding {
    animation: toastSlideOut var(--transition-toast) forwards;
}

@keyframes toastSlideIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes toastSlideOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }

    to {
        opacity: 0;
        transform: translateY(-8px);
    }
}

/* Toast Icon */
.toast-icon {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    margin-top: 1px;
}

/* Toast Content */
.toast-content {
    flex: 1;
    min-width: 0;
}

.toast-title {
    font-size: 14px;
    font-weight: var(--font-semibold);
    color: var(--text-primary);
    line-height: 1.3;
}

.toast-message {
    font-size: 12px;
    font-weight: var(--font-normal);
    color: var(--text-secondary);
    margin-top: 2px;
    line-height: 1.4;
}

/* Toast Close Button */
.toast-close {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    margin: -2px -4px -2px 0;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.toast-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.toast-close svg {
    width: 14px;
    height: 14px;
}

/* Toast Type: Neutral (Default) - For "Welcome back", info messages */
.toast-neutral,
.toast-info {
    border-color: var(--neutral);
}

.toast-neutral .toast-icon,
.toast-info .toast-icon {
    color: var(--accent);
}

/* Toast Type: Success - For "Saved", "Uploaded", etc. */
.toast-success {
    border-color: var(--success-subtle);
}

.toast-success .toast-icon {
    color: var(--success);
}

/* Toast Type: Error */
.toast-error {
    border-color: var(--error-subtle);
}

.toast-error .toast-icon {
    color: var(--error);
}

/* Toast Type: Warning */
.toast-warning {
    border-color: rgba(245, 158, 11, 0.35);
}

.toast-warning .toast-icon {
    color: var(--warning);
}

.alert {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-sm);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-lg);
}

.alert-success {
    background: var(--success-bg);
    color: var(--success);
}

.alert-error {
    background: var(--error-bg);
    color: var(--error);
}

.alert-warning {
    background: var(--warning-bg);
    color: var(--warning);
}

.alert-info {
    background: var(--info-bg);
    color: var(--info);
}

/* ============================
   AVATAR
   ============================ */

.avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    object-fit: cover;
    border: 2px solid var(--border);
}

.avatar-sm {
    width: 32px;
    height: 32px;
}

.avatar-lg {
    width: 64px;
    height: 64px;
}

.avatar-xl {
    width: 96px;
    height: 96px;
}

/* ============================
   TABS
   ============================ */

.tabs {
    display: flex;
    gap: var(--spacing-xs);
    border-bottom: 1px solid var(--border);
    margin-bottom: var(--spacing-lg);
}

.tab {
    padding: 1rem 1.25rem;
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    color: var(--text-muted);
    background: none;
    border: none;
    cursor: pointer;
    position: relative;
    transition: color var(--transition-fast);
}

.tab:hover {
    color: var(--text-secondary);
}

.tab.active {
    color: var(--accent);
}

.tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent);
    border-radius: var(--radius-full);
}

/* ============================
   LOADING / SKELETON
   ============================ */

.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-2xl);
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: var(--radius-full);
    animation: spin 0.8s linear infinite;
}

.skeleton {
    background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--bg-card) 50%, var(--bg-secondary) 75%);
    background-size: 200% 100%;
    animation: skeleton 1.5s infinite;
    border-radius: var(--radius-md);
}

@keyframes skeleton {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* ============================
   CODE BLOCK
   ============================ */

.code-block {
    position: relative;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.code-block-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--bg-input);
    border-bottom: 1px solid var(--border);
}

.code-block-header span {
    font-size: var(--text-sm);
    color: var(--text-muted);
}

.code-block pre {
    padding: var(--spacing-lg);
    overflow-x: auto;
    font-family: 'Fira Code', 'Monaco', monospace;
    font-size: var(--text-sm);
    line-height: 1.6;
    color: var(--text-primary);
}

.code-block code {
    white-space: pre;
}

/* ============================
   EMPTY STATE
   ============================ */

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-3xl);
    text-align: center;
}

.empty-state-icon {
    width: 80px;
    height: 80px;
    margin-bottom: var(--spacing-lg);
    color: var(--text-muted);
}

.empty-state h3 {
    margin-bottom: var(--spacing-sm);
}

.empty-state p {
    color: var(--text-muted);
    max-width: 400px;
}

/* ============================
   PAGINATION
   ============================ */

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
    margin-top: var(--spacing-2xl);
}

.pagination-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    color: var(--text-secondary);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.pagination-btn:hover:not(:disabled) {
    border-color: var(--accent);
    color: var(--accent);
}

.pagination-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ============================
   FOOTER
   ============================ */

.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    padding: var(--spacing-2xl) 0;
    margin-top: auto;
}

.footer-inner {
    display: grid;
    grid-template-columns: 2fr repeat(3, 1fr);
    gap: var(--spacing-2xl);
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
}

.footer-brand p {
    color: var(--text-muted);
    font-size: var(--text-sm);
    margin-top: var(--spacing-sm);
}

.footer-links h4 {
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    margin-bottom: var(--spacing-md);
    color: var(--text-primary);
}

.footer-links ul {
    list-style: none;
}

.footer-links li {
    margin-bottom: var(--spacing-sm);
}

.footer-links a {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    transition: color var(--transition-fast);
}

.footer-links a:hover {
    color: var(--text-primary);
}

.footer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: var(--spacing-xl);
    margin-top: var(--spacing-xl);
    border-top: 1px solid var(--border);
}

.footer-bottom p {
    font-size: var(--text-sm);
    color: var(--text-muted);
    margin: 0;
}

.footer-social {
    display: flex;
    gap: var(--spacing-sm);
}

.footer-social a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    background: var(--bg-card);
    color: var(--text-muted);
    transition: all var(--transition-fast);
}

.footer-social a:hover {
    background: var(--accent);
    color: white;
}

@media (max-width: 768px) {
    .footer-inner {
        grid-template-columns: 1fr;
        text-align: center;
    }

}


/* ============================
   EXPLORE HERO (Phase 2)
   ============================ */

.explore-hero {
    padding: 60px 0 40px;
    position: relative;
}

.explore-hero-grid {
    display: grid;
    grid-template-columns: 100%;
    gap: 24px;
    max-width: 800px;
    /* Focus width */
}

.explore-title {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1.1;
    color: #fff;
    margin-bottom: 8px;
    text-align: left;
}

.explore-subtitle {
    font-size: 1.1rem;
    color: #a1a1aa;
    margin-bottom: 24px;
    text-align: left;
}

.explore-search-container {
    position: relative;
    width: 100%;
}

.explore-search-input {
    width: 100%;
    height: 56px;
    padding: 0 16px 0 52px;
    font-size: 1.1rem;
    background: #18191c;
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    color: #fff;
    transition: all 0.2s;
}

.explore-search-input:focus {
    outline: none;
    background: #27272a;
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.05);
}

.explore-search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    color: #71717a;
    pointer-events: none;
}

.explore-shortcut {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    border: 1px solid #3f3f46;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    color: #71717a;
    background: #27272a;
    font-family: monospace;
}

.hero-chips {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 16px;
}

.hero-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: #18191c;
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    /* Not full pill, slight rect */
    color: #a1a1aa;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
}

.hero-chip:hover {
    background: #27272a;
    border-color: #52525b;
    color: #fff;
    transform: translateY(-2px);
}

.hero-chip i {
    width: 16px;
    height: 16px;
}

/* ============================
   FEATURE CARDS (Phase 2)
   ============================ */

.features-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-bottom: 40px;
    margin-top: 32px;
    /* Gap from chips reduced breathing room issue */
}

.feature-grid-card {
    background: #18191c;
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    padding: 24px;
    position: relative;
    overflow: hidden;
    transition: all 0.2s;
}

.feature-grid-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(#27272a 1px, transparent 1px);
    background-size: 20px 20px;
    opacity: 0.1;
    z-index: 0;
}

.feature-grid-card:hover {
    border-color: #3f3f46;
    transform: translateY(-2px);
}

.feature-card-content {
    position: relative;
    z-index: 1;
}

.feature-card-icon {
    width: 40px;
    height: 40px;
    background: #27272a;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    margin-bottom: 16px;
}

.feature-card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 6px;
}

.feature-card-desc {
    font-size: 0.9rem;
    color: #a1a1aa;
    line-height: 1.5;
}

@media (max-width: 768px) {
    .features-grid-3 {
        grid-template-columns: 1fr;
    }

    .explore-hero-grid {
        max-width: 100%;
    }

    .explore-title {
        font-size: 2.2rem;
    }
}

/* ============================
   SECTION HEADERS (Phase 4)
   ============================ */

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-subtle);
}

.section-header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.section-header-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: rgba(139, 92, 246, 0.1);
    border-radius: 12px;
    color: var(--accent);
}

.section-header-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: #fff;
    margin: 0;
    line-height: 1.2;
}

.section-header-link {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #71717a;
    text-decoration: none;
    transition: all 0.2s;
    padding: 8px 16px;
    border-radius: 8px;
    background: transparent;
}

.section-header-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

/* ============================
   PHASE 5: POLISH (CTA & Footer)
   ============================ */

/* CTA Section */
.cta-section {
    padding-bottom: 40px;
}

.cta-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
    padding: 32px 40px;
    background: linear-gradient(135deg, var(--accent) 0%, #7c3aed 100%);
    border-radius: 24px;
    position: relative;
    overflow: hidden;
}

.cta-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, 0.2) 1px, transparent 1px);
    background-size: 20px 20px;
    opacity: 0.3;
    pointer-events: none;
}

.cta-content h2 {
    color: white;
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: 8px;
}

.cta-content p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1rem;
    margin: 0;
}

.cta-actions {
    display: flex;
    gap: 12px;
    z-index: 2;
}

.cta-actions .btn {
    border: none;
    font-weight: 600;
    padding: 12px 24px;
}

.cta-actions .btn-primary {
    background: white;
    color: var(--accent);
}

.cta-actions .btn-primary:hover {
    background: rgba(255, 255, 255, 0.9);
}

.cta-actions .btn-secondary {
    background: rgba(0, 0, 0, 0.2);
    color: white;
}

.cta-actions .btn-secondary:hover {
    background: rgba(0, 0, 0, 0.3);
}

@media (max-width: 768px) {
    .cta-card {
        flex-direction: column;
        text-align: center;
        padding: 24px;
    }

    .cta-actions {
        width: 100%;
        flex-direction: column;
    }

    .cta-actions .btn {
        width: 100%;
    }
}

/* Compact Footer Override */
.footer {
    padding: 32px 0;
}

.footer-inner {
    gap: 32px;
}

/* ============================
   COMMENTS SYSTEM (Phase G)
   ============================ */
.comments-section {
    margin-top: 32px;
    border-top: 1px solid var(--border-subtle);
    padding-top: 24px;
}

.comment-composer {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    background: var(--bg-card);
    padding: 16px;
    border-radius: 12px;
    border: 1px solid var(--border-subtle);
}

.comment-input-wrapper {
    flex: 1;
}

.comment-input {
    width: 100%;
    height: 44px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0 12px;
    color: #fff;
    transition: all 0.2s;
}

.comment-input:focus {
    border-color: var(--accent);
    outline: none;
}

.comment-submit-btn {
    height: 44px;
    padding: 0 24px;
    border-radius: 8px;
    font-weight: 600;
}

.comment-card {
    display: flex;
    gap: 16px;
    padding: 16px;
    background: var(--bg-card);
    border-radius: 12px;
    margin-bottom: 12px;
    border: 1px solid var(--border-subtle);
}

.comment-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.comment-body {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.comment-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}

.comment-author {
    font-weight: 600;
    color: #fff;
    font-size: 0.95rem;
}

.comment-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.comment-text {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* ============================
   SCRIPT DETAIL PAGE
   ============================ */
.script-page {
    padding-top: 24px;
    padding-bottom: 48px;
}

.script-main-card,
.description-card,
.game-info-card,
.comments-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-card);
    margin-bottom: var(--space-5);
    overflow: hidden;
}

/* Script Header - Row 1: Title + Views */
.script-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-5) var(--space-5) var(--space-3);
    gap: var(--space-4);
}

.header-left {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    flex: 1;
    min-width: 0;
}

.script-title {
    font-size: var(--text-2xl);
    font-weight: 700;
    color: #fff;
    margin: 0;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ============================
   VERIFIED BADGE (Pixel-Perfect)
   Specs: 14px, margin-left 6px, top +1px
   ============================ */

/* Wrapper for username + badge alignment */
.name-row {
    display: inline-flex;
    align-items: center;
}

/* The verified badge icon itself */
.verified-badge-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    margin-left: 6px;
    position: relative;
    top: 1px;
    color: var(--verified-blue);
    flex-shrink: 0;
    cursor: help;
}

.verified-badge-icon svg {
    width: 100%;
    height: 100%;
}

.verified-badge-icon:hover {
    opacity: 0.85;
}

/* Legacy style for text badges (script page header) */
.verified-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: rgba(29, 155, 240, 0.12);
    border: 1px solid rgba(29, 155, 240, 0.25);
    border-radius: var(--radius-pill);
    color: var(--verified-blue);
    font-size: var(--text-xs);
    font-weight: 600;
    flex-shrink: 0;
}

.verified-badge i,
.verified-badge svg {
    width: 12px;
    height: 12px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    flex-shrink: 0;
}

/* Header Icon Buttons (Share/Report) */
.header-icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-input);
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.header-icon-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--border-light);
    color: var(--text-primary);
}

.header-icon-btn i {
    width: 16px;
    height: 16px;
}

/* Report button - red only on hover */
.header-icon-btn--report:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: var(--error);
}

.views-pill {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    height: var(--height-chip);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-pill);
    color: var(--text-muted);
    font-size: var(--text-sm);
    font-weight: 500;
}

.views-pill i {
    width: 14px;
    height: 14px;
}

/* Script Header - Row 2: Game + Time + Actions */
.script-meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 var(--space-5) var(--space-4);
    border-bottom: 1px solid var(--border-subtle);
}

.meta-left {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    color: var(--text-muted);
    font-size: var(--text-sm);
}

.game-tag {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--accent);
    font-weight: 500;
}

.game-tag i {
    width: 14px;
    height: 14px;
}

.meta-separator {
    color: var(--text-muted);
    opacity: 0.5;
}

.meta-actions {
    position: relative;
}

.actions-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-input);
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.actions-btn:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
    color: var(--text-primary);
}

.actions-btn i {
    width: 18px;
    height: 18px;
}

/* Script Content Grid - 70/30 */
.script-content-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 0;
}

.script-media-column {
    padding: var(--space-5);
    border-right: 1px solid var(--border-subtle);
}

/* Media Wrapper with proper empty state */
.media-wrapper {
    background: var(--bg-card);
    border-radius: var(--radius-input);
    overflow: hidden;
    position: relative;
    border: 1px solid var(--border-subtle);
    aspect-ratio: 16 / 9;
}

.script-thumbnail-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Premium Media Empty State */
.media-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 280px;
    padding: var(--space-6);
    text-align: center;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.05) 0%, rgba(30, 30, 35, 1) 100%);
}

.media-empty-state i {
    width: 48px;
    height: 48px;
    color: var(--text-muted);
    opacity: 0.4;
    margin-bottom: var(--space-4);
}

.media-empty-state h3 {
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 var(--space-2);
}

.media-empty-state p {
    font-size: var(--text-sm);
    color: var(--text-muted);
    margin: 0 0 var(--space-5);
}

.empty-state-actions {
    display: flex;
    gap: var(--space-3);
}

.empty-state-actions .btn {
    height: var(--height-button);
}

.script-actions-column {
    padding: var(--space-5);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.author-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-3);
    background: var(--bg-card-hover);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-input);
}

.author-info-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.author-avatar-wrapper {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}

.author-avatar-wrapper img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.author-name {
    font-weight: 600;
    color: #fff;
    font-size: 0.95rem;
    display: flex;
    gap: 4px;
}

.author-stats {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* CTA Buttons Row (View + Copy) */
.cta-buttons-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-2);
}

.view-btn,
.copy-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    height: 44px;
    padding: 0 var(--space-3);
    border-radius: 10px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.view-btn {
    background: var(--bg-card-hover);
    border: 1px solid var(--border);
    color: var(--text-primary);
}

.view-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--border-light);
}

.copy-btn {
    background: var(--accent);
    border: none;
    color: white;
}

.copy-btn:hover {
    background: var(--accent-hover);
}

.view-btn i,
.copy-btn i {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.description-card {
    padding: 24px;
}

.description-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-subtle);
}

.description-header h2 {
    font-size: 1.2rem;
    color: #fff;
    margin: 0;
}

.description-content {
    color: #d4d4d8;
    line-height: 1.7;
    font-size: 0.95rem;
}

.game-info-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--bg-card);
    text-decoration: none;
    color: inherit;
    transition: border-color 0.2s;
}

.game-info-card:hover {
    border-color: rgba(255, 255, 255, 0.2);
}

.game-info-thumb {
    width: 60px;
    height: 60px;
    border-radius: 10px;
    object-fit: cover;
}

.game-info-text h4 {
    font-size: 0.95rem;
    font-weight: 600;
    color: #fff;
    margin: 0 0 4px 0;
}

.game-info-text p {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    margin: 0;
}

@media (max-width: 1024px) {
    .script-content-grid {
        grid-template-columns: 1fr;
    }

    .script-media-column {
        border-right: none;
        border-bottom: 1px solid var(--border-subtle);
    }
}

/* ============================
   SCRIPT PAGE ACTION BUTTONS (Dark Theme)
   ============================ */
.follow-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--bg-card-hover);
    color: var(--text-primary);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.follow-btn:hover {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.reactions-row {
    display: flex;
    gap: 8px;
}

.reaction-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: var(--bg-card-hover);
    color: var(--text-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}

.reaction-btn:hover {
    background: var(--bg-card);
    border-color: var(--border-light);
}

.reaction-btn.like-btn:hover,
.reaction-btn.like-btn[data-active="true"] {
    color: #22c55e;
    border-color: #22c55e;
}

.reaction-btn.dislike-btn:hover,
.reaction-btn.dislike-btn[data-active="true"] {
    color: #ef4444;
    border-color: #ef4444;
}

.copy-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px 20px;
    background: var(--gradient-accent);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.copy-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--accent-glow);
}

.game-links-row {
    display: flex;
    gap: 8px;
}

.game-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: var(--bg-card-hover);
    color: var(--text-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.game-link-btn:hover {
    background: var(--bg-card);
    color: var(--text-primary);
    border-color: var(--border-light);
}

.game-link-btn.play:hover {
    color: #22c55e;
    border-color: #22c55e;
}

.game-link-btn.link:hover {
    color: var(--accent);
    border-color: var(--accent);
}

/* Action Icon Buttons (Share/Report) */
.action-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: transparent;
    color: var(--text-muted);
    border: 1px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.action-icon-btn:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
    border-color: var(--border-subtle);
}

.action-icon-btn i {
    width: 16px;
    height: 16px;
}

/* Avatar Placeholder */
.avatar-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent);
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    border-radius: 50%;
}

/* Reaction Active State */
.reaction-btn.active {
    border-color: var(--accent);
}

.reaction-btn.like-btn.active {
    color: #22c55e;
    border-color: #22c55e;
    background: rgba(34, 197, 94, 0.1);
}

.reaction-btn.dislike-btn.active {
    color: #ef4444;
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

/* Description Link Buttons (Key, Discord, YouTube) */
.description-links {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.desc-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--bg-card-hover);
    color: var(--text-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s;
}

.desc-link-btn:hover {
    color: var(--text-primary);
    border-color: var(--border-light);
}

.desc-link-btn.key {
    color: #f97316;
}

.desc-link-btn.key:hover {
    background: rgba(249, 115, 22, 0.1);
    border-color: #f97316;
}

.desc-link-btn.discord {
    color: #5865F2;
}

.desc-link-btn.discord:hover {
    background: rgba(88, 101, 242, 0.1);
    border-color: #5865F2;
}

.desc-link-btn.youtube {
    color: #ff0000;
}

.desc-link-btn.youtube:hover {
    background: rgba(255, 0, 0, 0.1);
    border-color: #ff0000;
}

.desc-link-btn svg,
.desc-link-btn i {
    width: 16px;
    height: 16px;
}

/* ============================
   SCRIPT VIEW MODAL
   ============================ */
.script-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
}

.script-modal.active {
    opacity: 1;
    visibility: visible;
}

.script-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
}

.script-modal-content {
    position: relative;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-popover);
    transform: translateY(20px);
    transition: transform 0.2s ease;
}

.script-modal.active .script-modal-content {
    transform: translateY(0);
}

.script-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-4) var(--space-5);
    border-bottom: 1px solid var(--border-subtle);
}

.script-modal-header h3 {
    margin: 0;
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--text-primary);
}

.modal-close-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.modal-close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.modal-close-btn i {
    width: 20px;
    height: 20px;
}

.script-modal-body {
    flex: 1;
    overflow: auto;
    padding: var(--space-4) var(--space-5);
}

.script-code {
    margin: 0;
    padding: var(--space-4);
    background: #0d0d10;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-input);
    font-family: 'JetBrains Mono', 'Fira Code', 'SF Mono', Consolas, monospace;
    font-size: 13px;
    line-height: 1.6;
    color: #e4e4e7;
    white-space: pre-wrap;
    word-break: break-word;
    overflow-x: auto;
}

.script-code code {
    font-family: inherit;
}

.script-modal-footer {
    display: flex;
    justify-content: flex-end;
    padding: var(--space-4) var(--space-5);
    border-top: 1px solid var(--border-subtle);
}