:root {
    --primary: #e50914;
    --primary-dark: #b20710;
    --bg-dark: #141414;
    --bg-card: #1f1f1f;
    --bg-hover: #2a2a2a;
    --text: #ffffff;
    --text-muted: #b3b3b3;
    --success: #46d369;
    --warning: #f5c518;
    --border: #333;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--bg-dark);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.5;
    overscroll-behavior-y: contain;
}

#ptr-indicator {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--text-muted);
    font-size: 0.85rem;
    pointer-events: none;
    transform: translateY(-100%);
    z-index: 999;
    transition: transform 0s;
}

#ptr-indicator.ptr-animating {
    transition: transform 0.25s ease-out;
}

.ptr-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid var(--text-muted);
    border-top-color: var(--primary);
    border-radius: 50%;
    opacity: 0.4;
    transition: opacity 0.15s, transform 0.15s;
}

#ptr-indicator.ptr-ready .ptr-spinner {
    opacity: 1;
    transform: rotate(180deg);
}

#ptr-indicator.ptr-refreshing .ptr-spinner {
    opacity: 1;
    animation: ptr-spin 0.8s linear infinite;
}

@keyframes ptr-spin {
    to { transform: rotate(360deg); }
}

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

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: rgba(20, 20, 20, 0.95);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--border);
}

.logo {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--primary);
    text-decoration: none;
}

.logo span {
    color: var(--text);
    font-weight: normal;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.2s;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
}

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

.btn-secondary:hover {
    background: var(--bg-hover);
}

.btn-small {
    padding: 8px 14px;
    font-size: 0.875rem;
}

.btn:active:not(:disabled) {
    transform: scale(0.97);
}

.btn-success {
    background: var(--success);
    color: black;
}

.btn-warning {
    background: var(--warning);
    color: black;
}

/* Login Page */
.login-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 80vh;
    padding: 20px;
}

.login-box {
    background: var(--bg-card);
    padding: 40px;
    border-radius: 8px;
    width: 100%;
    max-width: 400px;
}

.login-box h1 {
    text-align: center;
    margin-bottom: 30px;
    color: var(--primary);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-muted);
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--bg-dark);
    color: var(--text);
    font-size: 1rem;
}

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

.message {
    padding: 12px;
    border-radius: 4px;
    margin-bottom: 20px;
    text-align: center;
}

.message-success {
    background: rgba(70, 211, 105, 0.2);
    color: var(--success);
}

.message-error {
    background: rgba(229, 9, 20, 0.2);
    color: var(--primary);
}

/* Navigation Tabs */
.nav-tabs {
    display: flex;
    gap: 5px;
    padding: 20px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
}

.nav-tab {
    padding: 10px 20px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
    white-space: nowrap;
    border-radius: 4px;
    transition: all 0.2s;
}

.nav-tab:hover {
    color: var(--text);
    background: var(--bg-hover);
}

.nav-tab.active {
    color: var(--text);
    background: var(--primary);
}

/* Movie Grid */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 600;
}

.movie-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

@media (min-width: 768px) {
    .movie-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 20px;
    }
}

.movie-card {
    background: var(--bg-card);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s;
    cursor: pointer;
}

.movie-card:hover {
    transform: scale(1.03);
}

.movie-poster {
    width: 100%;
    aspect-ratio: 2/3;
    object-fit: cover;
    background: var(--bg-hover);
}

.movie-poster-placeholder {
    width: 100%;
    aspect-ratio: 2/3;
    background: var(--bg-hover);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 3rem;
}

.movie-info {
    padding: 12px;
}

.movie-title {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.movie-pick-by {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-bottom: 4px;
}

.movie-meta {
    color: var(--text-muted);
    font-size: 0.85rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.movie-rating {
    color: var(--warning);
    display: flex;
    align-items: center;
    gap: 4px;
}

.history-date-header {
    grid-column: 1 / -1;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
    padding: 12px 0 4px;
    border-bottom: 2px solid var(--border);
    margin-bottom: 4px;
}

.history-date-header:first-child {
    padding-top: 0;
}

/* Compact history grid — more movies per row, smaller posters */
#history-movies {
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

#history-movies .movie-card {
    font-size: 0.85rem;
}

#history-movies .movie-poster,
#history-movies .movie-poster-placeholder {
    aspect-ratio: 2/3;
}

#history-movies .movie-info {
    padding: 6px 8px;
}

#history-movies .movie-title {
    font-size: 0.8rem;
    margin-bottom: 2px;
}

#history-movies .movie-meta {
    display: none;
}

#history-movies .movie-watched-date {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 2px;
}

#history-movies .movie-group-rating {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--warning);
    margin-top: 2px;
}

.history-rate-row {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    margin-top: 4px;
}

.history-rate-btn {
    width: 22px;
    height: 22px;
    border-radius: 4px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text);
    font-size: 0.65rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    transition: all 0.15s;
}

.history-rate-btn:hover {
    border-color: var(--warning);
    background: var(--bg-hover);
}

.history-rate-btn.selected {
    border-color: var(--warning);
    background: var(--warning);
    color: #000;
}

.history-submit-btn {
    margin-top: 4px;
    width: 100%;
    padding: 4px;
    border-radius: 4px;
    border: none;
    background: var(--primary);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.15s;
}

.history-submit-btn:disabled {
    opacity: 0.5;
    cursor: default;
}

.history-my-rating {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text);
    margin-top: 4px;
}

@media (min-width: 768px) {
    #history-movies {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 12px;
    }
}

/* Modal rating section */
.modal-rating-section {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.modal-rating-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 8px;
    flex-wrap: wrap;
    gap: 4px 12px;
}

.modal-rating-label {
    font-weight: 600;
    font-size: 0.95rem;
}

.modal-rating-avg {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.modal-rating-buttons {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.rating-btn {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    border: 2px solid var(--border);
    background: var(--bg-card);
    color: var(--text);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.15s;
}

.rating-btn:hover {
    border-color: var(--warning);
    background: var(--bg-hover);
}

.rating-btn.selected {
    border-color: var(--warning);
    background: var(--warning);
    color: #000;
}

.modal-comment-section {
    margin-top: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.comment-input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-dark);
    color: var(--text);
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    min-height: 44px;
    line-height: 1.4;
    -webkit-appearance: none;
}

.comment-input:focus {
    outline: none;
    border-color: var(--primary);
}

.comment-save-btn {
    align-self: flex-end;
    min-height: 44px;
    min-width: 80px;
    font-size: 0.95rem;
}

.modal-comments-list {
    margin-top: 16px;
}

.comments-header {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 10px;
    color: var(--text-muted);
}

.comment-item {
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.comment-item:last-child {
    border-bottom: none;
}

.comment-author {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 3px;
}

.comment-rating {
    font-weight: 400;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.comment-text {
    font-size: 0.95rem;
    color: var(--text);
    line-height: 1.5;
}

.badge {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-active {
    background: var(--success);
    color: black;
}

.badge-chosen {
    background: var(--primary);
    color: white;
}

/* Movie Detail Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 20px;
}

.modal {
    background: var(--bg-card);
    border-radius: 8px;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 20px;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    background: var(--bg-card);
    z-index: 1;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-body {
    padding: 20px;
}

@media (max-width: 600px) {
    .modal-overlay {
        padding: 0;
        align-items: flex-end;
    }

    .modal {
        max-height: 95vh;
        border-radius: 12px 12px 0 0;
    }

    .modal-header {
        padding: 16px;
        border-radius: 12px 12px 0 0;
    }

    .modal-body {
        padding: 16px;
    }

    .modal-rating-avg {
        font-size: 0.8rem;
    }

    .rating-btn {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .modal-comment-section {
        margin-top: 16px;
    }

    .comment-input {
        min-height: 60px;
    }

    .comment-save-btn {
        width: 100%;
    }

    .comment-item {
        padding: 12px 0;
    }

    .comment-text {
        font-size: 1rem;
    }
}

.movie-detail {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 20px;
}

@media (max-width: 600px) {
    .movie-detail {
        grid-template-columns: 1fr;
    }
}

.movie-detail-poster {
    width: 100%;
    border-radius: 8px;
}

.movie-detail-info h2 {
    margin-bottom: 10px;
}

.movie-detail-meta {
    color: var(--text-muted);
    margin-bottom: 15px;
}

.movie-detail-plot {
    margin-bottom: 20px;
    line-height: 1.6;
}

.movie-detail-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Search Section */
.search-container {
    margin-bottom: 30px;
}

.search-form {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.search-form input {
    flex: 1;
    min-width: 200px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--bg-card);
    color: var(--text);
    font-size: 1rem;
}

.search-form input:focus {
    outline: none;
    border-color: var(--primary);
}

.search-result {
    background: var(--bg-card);
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
}

/* My Movies List */
.movie-list-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: var(--bg-card);
    border-radius: 8px;
    margin-bottom: 10px;
}

.movie-list-poster {
    width: 60px;
    height: 90px;
    object-fit: cover;
    border-radius: 4px;
    background: var(--bg-hover);
}

.movie-list-info {
    flex: 1;
}

.movie-list-actions {
    display: flex;
    gap: 10px;
}

/* Preferences */
.preferences-section {
    background: var(--bg-card);
    padding: 30px;
    border-radius: 8px;
}

.preference-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid var(--border);
}

.preference-item:last-child {
    border-bottom: none;
}

.toggle {
    width: 50px;
    height: 28px;
    background: var(--border);
    border-radius: 14px;
    position: relative;
    cursor: pointer;
    transition: background 0.2s;
}

.toggle.active {
    background: var(--success);
}

.toggle::after {
    content: '';
    position: absolute;
    width: 24px;
    height: 24px;
    background: white;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: left 0.2s;
}

.toggle.active::after {
    left: 24px;
}

/* Stats */
.stats-bar {
    display: flex;
    gap: 20px;
    padding: 15px 20px;
    background: var(--bg-card);
    border-radius: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.stat-item {
    text-align: center;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary);
}

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

/* Loading State */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: var(--text-muted);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

/* Toast notifications */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    padding: 12px 20px;
    border-radius: 4px;
    font-size: 0.9rem;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
    max-width: 90vw;
    word-wrap: break-word;
    text-align: center;
}

.toast.visible { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast-error { background: rgba(229, 9, 20, 0.15); color: var(--primary); border: 1px solid rgba(229, 9, 20, 0.3); }
.toast-success { background: rgba(70, 211, 105, 0.15); color: var(--success); border: 1px solid rgba(70, 211, 105, 0.3); }

/* Focus states */
.btn:focus-visible, .nav-tab:focus-visible, .admin-tab:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* Text overflow hardening */
.event-name, .theme-name, .upcoming-event-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.movie-detail-plot, .theme-description {
    overflow-wrap: break-word;
    word-break: break-word;
}

/* Button disabled state */
.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Hidden elements */
.hidden {
    display: none !important;
}

/* Admin Tab Styles */
.admin-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.admin-tab {
    padding: 10px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 4px;
}

.admin-tab.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.admin-content {
    display: none;
}

.admin-content.active {
    display: block;
}

.event-card, .theme-card {
    background: var(--bg-card);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.event-date, .theme-icon {
    font-size: 2rem;
    min-width: 60px;
    text-align: center;
}

.event-info, .theme-info {
    flex: 1;
}

.event-name, .theme-name {
    font-weight: bold;
    font-size: 1.1rem;
}

.event-meta, .theme-description {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.badge-theme {
    background: #7b1fa2;
    color: white;
    margin-left: 10px;
}

/* Upcoming Events Section (visible to all users) */
.upcoming-events {
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(229, 9, 20, 0.1) 100%);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 20px;
    margin: 20px;
}

.upcoming-events h3 {
    margin: 0 0 15px 0;
    font-size: 1.2rem;
    color: var(--text);
}

.upcoming-event-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px;
    background: var(--bg-card);
    border-radius: 6px;
    margin-bottom: 10px;
}

.upcoming-event-item:last-child {
    margin-bottom: 0;
}

.upcoming-event-icon {
    font-size: 2rem;
    min-width: 50px;
    text-align: center;
}

.upcoming-event-details {
    flex: 1;
}

.upcoming-event-name {
    font-weight: 600;
    font-size: 1rem;
}

.upcoming-event-datetime {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.no-upcoming-events {
    color: var(--text-muted);
    text-align: center;
    padding: 20px;
}

/* Callout Banners */
.callout-banners {
    padding: 0 20px;
    margin-bottom: 10px;
}

.callout-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-card);
    border: 1px solid var(--warning);
    border-radius: 8px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: background 0.2s;
}

.callout-banner:hover {
    background: var(--bg-hover);
}

.callout-banner:last-child {
    margin-bottom: 0;
}

.callout-banner-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.callout-banner-text {
    flex: 1;
    font-weight: 500;
}

.callout-banner-arrow {
    color: var(--text-muted);
    font-size: 1.2rem;
}

.callout-banner-dismiss {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 4px 8px;
    margin-left: 8px;
    border-radius: 4px;
    transition: all 0.2s;
}

.callout-banner-dismiss:hover {
    background: var(--bg-hover);
    color: var(--text);
}

/* Pool Assignment Dropdown */
.pool-dropdown-wrapper {
    position: relative;
    display: inline-block;
}

.pool-dropdown-btn {
    padding: 6px 12px;
    font-size: 0.875rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--bg-card);
    color: var(--text);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.pool-dropdown-btn:hover {
    background: var(--bg-hover);
    border-color: var(--primary);
}

.pool-dropdown-btn.has-pools {
    background: var(--success);
    color: black;
    border-color: var(--success);
}

.pool-dropdown-btn.has-pools:hover {
    background: #3bc05a;
}

.pool-dropdown-menu {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    min-width: 200px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 100;
    display: none;
}

.pool-dropdown-menu.open {
    display: block;
}

.pool-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.2s;
}

.pool-dropdown-item:hover {
    background: var(--bg-hover);
}

.pool-dropdown-item:first-child {
    border-radius: 7px 7px 0 0;
}

.pool-dropdown-item:last-child {
    border-radius: 0 0 7px 7px;
}

.pool-dropdown-checkbox {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s;
}

.pool-dropdown-checkbox.checked {
    background: var(--success);
    border-color: var(--success);
}

.pool-dropdown-checkbox.checked::after {
    content: '\2713';
    color: black;
    font-size: 12px;
    font-weight: bold;
}

.pool-dropdown-label {
    flex: 1;
}

.pool-dropdown-divider {
    height: 1px;
    background: var(--border);
    margin: 4px 0;
}

/* Footer */
footer {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    padding: 40px 20px;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Rules Page */
.rules-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.rule-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px 18px;
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.rule-card.rule-official {
    border-left: 4px solid var(--primary);
}

.rule-badge {
    background: var(--primary);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 3px 8px;
    border-radius: 4px;
    flex-shrink: 0;
    margin-top: 2px;
}

.rule-text {
    flex: 1;
    line-height: 1.5;
}

.rule-suggest-form {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px;
    margin-bottom: 20px;
}

.rule-suggest-form textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--bg-dark);
    color: var(--text);
    font-size: 0.95rem;
    font-family: inherit;
    resize: vertical;
    min-height: 60px;
}

.rule-suggest-form textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.rule-suggest-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 10px;
}

.rule-suggest-counter {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.rule-suggest-counter.over {
    color: var(--primary);
}

#rule-suggestions-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.rule-suggestion {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 14px;
}

.rule-suggestion-text {
    flex: 1;
    line-height: 1.4;
}

.rule-suggestion-meta {
    color: var(--text-muted);
    font-size: 0.78rem;
    margin-top: 6px;
}

.rule-vote-controls {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.rule-vote-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    width: 36px;
    height: 36px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.rule-vote-btn:hover:not(:disabled) {
    background: var(--bg-hover);
    color: var(--text);
}

.rule-vote-btn.active.up {
    background: var(--success);
    border-color: var(--success);
    color: black;
}

.rule-vote-btn.active.down {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.rule-vote-score {
    min-width: 28px;
    text-align: center;
    font-weight: 600;
    font-size: 0.95rem;
}

.rule-vote-score.positive {
    color: var(--success);
}

.rule-vote-score.negative {
    color: var(--primary);
}

.rule-suggestion-delete {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 4px 8px;
    flex-shrink: 0;
}

.rule-suggestion-delete:hover {
    color: var(--primary);
}

.rules-empty {
    color: var(--text-muted);
    text-align: center;
    padding: 20px;
    font-style: italic;
}

.rules-proposed-header {
    margin-top: 36px;
}

.rules-intro {
    color: var(--text-muted);
    margin-bottom: 16px;
}