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

:root {
  --theme-bg: #0a0015;
  --theme-accent: #8B0000;
  --theme-text: #e0e0e0;
  --theme-crimson: #DC143C;
  --card-background: #0d0020;
  --dark-gray: #0a0015;
  --border-color: #2a0040;
  --primary-color: #9933ff;

  /* Alias */
  --background: var(--theme-bg);
  --text-color: var(--theme-text);
  --blood-red: var(--theme-accent);
  --crimson: var(--theme-crimson);
}

[data-theme='blood'] {
  --theme-bg: #1a0008;
  --theme-accent: #DC143C;
  --theme-text: #ffe0e0;
  --theme-crimson: #ff6b6b;
  --background: #1a0008;
  --text-color: #ffe0e0;
  --blood-red: #DC143C;
  --crimson: #ff6b6b;
  --card-background: #1a000d;
  --dark-gray: #120008;
  --border-color: #5a0020;
}

[data-theme='void'] {
  --theme-bg: #000000;
  --theme-accent: #9d4edd;
  --theme-text: #e0e0ff;
  --theme-crimson: #9d4edd;
  --background: #000000;
  --text-color: #e0e0ff;
  --blood-red: #9d4edd;
  --crimson: #9d4edd;
  --card-background: #0a0a0a;
  --dark-gray: #050505;
  --border-color: #3a0070;
}

[data-theme='shadow'] {
  --theme-bg: #0d0622;
  --theme-accent: #5a189a;
  --theme-text: #ddd6fe;
  --theme-crimson: #c77dff;
  --background: #0d0622;
  --text-color: #ddd6fe;
  --blood-red: #5a189a;
  --crimson: #c77dff;
  --card-background: #0a0a0a;
  --dark-gray: #050505;
  --border-color: #3a0070;
}

body {
    font-family: 'Courier New', 'Segoe UI', Roboto, monospace;
    background-color: var(--theme-bg);
    color: var(--theme-text);
    line-height: 1.6;
}

/* Sticky footer: page-content fills at least the full viewport */
#page-content {
    min-height: calc(100vh - 60px); /* 60px ≈ nav bar height */
}

.container {
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    padding: 20px;
}

/* Navigation */
nav {
    background: var(--card-background);
    border-bottom: 2px solid var(--blood-red);
    padding: 10px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(139, 0, 0, 0.3);
}

nav .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 20px;
}

nav a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    transition: color 0.3s ease;
}

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

/* Site footer — static, sits naturally at bottom of content */
.site-footer {
    width: 100%;
    background: var(--card-background);
    border-top: 2px solid var(--blood-red);
    padding: 25px 0;
    text-align: center;
    box-shadow: 0 -4px 20px rgba(139, 0, 0, 0.3);
    color: #888;
    font-size: 14px;
}

.footer-content {
    color: #888;
    font-size: 14px;
}

.footer-content p {
    margin: 0;
}

/* Dropdowns */
.dropdown-toggle {
    cursor: pointer;
    padding: 8px 16px;
    border-radius: 4px;
    background: rgba(139, 0, 0, 0.1);
    border: 1px solid var(--blood-red);
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-color);
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
}

.dropdown-toggle:hover {
    background: rgba(139, 0, 0, 0.2);
    border-color: var(--crimson);
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    min-width: 180px;
    background: var(--card-background);
    border: 1px solid var(--blood-red);
    border-radius: 4px;
    box-shadow: 0 8px 32px rgba(139, 0, 0, 0.5);
    z-index: 1000;
    margin-top: 8px;
    overflow: hidden;
}

.dropdown-content.show {
    display: block;
}

.dropdown-content a {
    display: block;
    padding: 12px 20px;
    color: var(--text-color);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s ease;
    border-bottom: 1px solid var(--border-color);
}

.dropdown-content a:last-child {
    border-bottom: none;
}

.dropdown-content a:hover {
    background: rgba(139, 0, 0, 0.2);
    color: var(--crimson);
}

/* Cards */
.card {
    background: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

.post-card {
    display: flex;
    gap: 15px;
}

.vote-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.vote-button {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 20px;
    color: #666;
    padding: 5px;
    transition: color 0.3s ease;
}

.vote-button:hover { color: var(--crimson); }
.vote-button.upvoted { color: var(--crimson); }
.vote-button.downvoted { color: #444; }

.post-content { flex: 1; }

.post-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 5px;
}

.post-title a {
    color: var(--crimson);
    text-decoration: none;
    transition: color 0.3s ease;
}

.post-title a:hover { color: #ff4444; }

.post-meta {
    font-size: 12px;
    color: #888;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--crimson);
    text-transform: uppercase;
    font-size: 13px;
    letter-spacing: 1px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
    background: var(--dark-gray);
    color: var(--text-color);
    font-family: 'Courier New', monospace;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--blood-red);
    box-shadow: 0 0 10px rgba(139, 0, 0, 0.3);
}

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

button, .button {
    background: linear-gradient(135deg, var(--blood-red), var(--crimson));
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

button:hover, .button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 0, 0, 0.5);
}

/* Alerts */
.alert {
    padding: 15px 20px;
    border-radius: 4px;
    margin-bottom: 20px;
    border-left: 4px solid;
}

.alert-success {
    background: rgba(0, 100, 0, 0.2);
    color: #4ade80;
    border-left-color: #4ade80;
}

.alert-error {
    background: rgba(139, 0, 0, 0.2);
    color: #ff6b6b;
    border-left-color: var(--crimson);
}

/* Responsive */
@media (max-width: 768px) {
    .container { padding: 15px; }
    nav ul { gap: 10px; }

    .dropdown-toggle {
        padding: 6px 12px;
        font-size: 13px;
    }

    .dropdown-content {
        position: fixed;
        right: 20px;
        top: 70px;
        width: 180px;
    }

    .site-footer {
        padding: 12px 0;
        font-size: 13px;
    }
}

/* Selection styling */
::selection {
    background: var(--blood-red);
    color: #fff;
}

/* Text selection */
body, div, p, span, h1, h2, h3, h4, h5, h6, label, a, button, li, ul, ol, section, article, header, footer, nav, main {
    user-select: text;
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    cursor: default;
}

input, textarea, [contenteditable="true"], [contenteditable]:focus, .editable {
    user-select: text !important;
    -webkit-user-select: text !important;
    -moz-user-select: text !important;
    -ms-user-select: text !important;
    cursor: text !important;
    caret-color: var(--crimson) !important;
}

/* Scrollbar */
::-webkit-scrollbar { width: 12px; }
::-webkit-scrollbar-track { background: var(--background); }
::-webkit-scrollbar-thumb { background: var(--blood-red); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: var(--crimson); }
