:root {
    --bg: #0c0c0c;
    --panel: #171717;
    --border: #282828;
    --accent: #a3d41f;
    --accent-dim: #78a018;
    --text: #cfcfcf;
    --text-dim: #777;
    --error: #ff5555;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: Verdana, Geneva, Tahoma, sans-serif;
    background: var(--bg);
    color: var(--text);
}

.rainbow-bar {
    height: 4px;
    background: linear-gradient(90deg, #37b1da, #cc46cd, #cce435, #cc46cd, #37b1da);
}

.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 28px;
    border-bottom: 1px solid var(--border);
    background: #101010;
}

.brand {
    text-decoration: none;
    font-size: 1.35rem;
    letter-spacing: 0.02em;
}

.brand-accent {
    color: var(--accent);
}

nav a {
    color: var(--text-dim);
    text-decoration: none;
    margin-left: 18px;
    font-size: 0.92rem;
}

nav a:hover,
nav a.active {
    color: var(--accent);
}

.container {
    width: min(920px, calc(100% - 32px));
    margin: 36px auto 64px;
}

.hero,
.card {
    background: var(--panel);
    border: 1px solid var(--border);
    box-shadow: inset 0 0 0 1px #000;
    padding: 28px;
}

.hero h1,
.card h1 {
    margin: 0 0 10px;
    color: var(--accent);
    font-size: 1.8rem;
    font-weight: 600;
}

.hero p,
.card p {
    color: var(--text-dim);
    line-height: 1.6;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 18px;
    margin-top: 22px;
}

.feature {
    padding: 18px;
    border: 1px solid var(--border);
    background: #121212;
}

.feature h3 {
    margin: 0 0 8px;
    color: var(--text);
    font-size: 1rem;
}

.actions {
    display: flex;
    gap: 12px;
    margin-top: 22px;
    flex-wrap: wrap;
}

.btn {
    display: inline-block;
    padding: 11px 18px;
    border: 1px solid var(--border);
    background: #1d1d1d;
    color: var(--text);
    text-decoration: none;
    cursor: pointer;
    font: inherit;
}

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

.btn-primary {
    background: rgba(163, 212, 31, 0.18);
    border-color: rgba(163, 212, 31, 0.45);
    color: var(--accent);
}

.btn-primary:hover {
    background: rgba(163, 212, 31, 0.28);
}

.form-card {
    width: min(420px, 100%);
    margin: 0 auto;
}

label {
    display: block;
    margin: 14px 0 6px;
    color: var(--text-dim);
    font-size: 0.9rem;
}

input[type="text"],
input[type="password"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    background: #111;
    color: var(--text);
    font: inherit;
}

input:focus {
    outline: none;
    border-color: var(--accent-dim);
}

.alert {
    margin: 16px 0 0;
    padding: 10px 12px;
    border: 1px solid;
    font-size: 0.92rem;
}

.alert-error {
    color: var(--error);
    border-color: rgba(255, 85, 85, 0.35);
    background: rgba(255, 85, 85, 0.08);
}

.alert-success {
    color: var(--accent);
    border-color: rgba(163, 212, 31, 0.35);
    background: rgba(163, 212, 31, 0.08);
}

.meta {
    margin-top: 18px;
    color: var(--text-dim);
    font-size: 0.88rem;
}

.site-footer {
    padding: 18px 28px 28px;
    color: var(--text-dim);
    font-size: 0.85rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.site-footer a {
    color: var(--text-dim);
    text-decoration: none;
}

.site-footer a:hover {
    color: var(--accent);
}

.stat {
    margin: 10px 0;
}

.stat strong {
    color: var(--text);
}

.admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
    margin-top: 18px;
}

.inline-form {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: flex-end;
    margin-top: 10px;
}

.inline-form input[type="number"] {
    width: 88px;
    padding: 8px 10px;
    border: 1px solid var(--border);
    background: #111;
    color: var(--text);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 14px;
    font-size: 0.9rem;
}

.data-table th,
.data-table td {
    border: 1px solid var(--border);
    padding: 10px;
    text-align: left;
    vertical-align: top;
}

.data-table th {
    background: #121212;
    color: var(--text-dim);
}

.actions-cell form {
    margin-bottom: 6px;
}

.card h2 {
    margin: 0 0 8px;
    color: var(--text);
    font-size: 1.1rem;
}

.hwid-cell code {
    font-size: 0.82rem;
    color: var(--accent);
}

textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    background: #111;
    color: var(--text);
    font: inherit;
    resize: vertical;
    min-height: 100px;
}

textarea:focus {
    outline: none;
    border-color: var(--accent-dim);
}

.ticket-form {
    margin-top: 16px;
}

.ticket-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 16px;
}

.ticket-thread {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 18px 0;
}

.ticket-message {
    border: 1px solid var(--border);
    padding: 12px 14px;
    background: #121212;
}

.ticket-message.staff {
    border-color: rgba(163, 212, 31, 0.35);
    background: rgba(163, 212, 31, 0.06);
}

.ticket-message-meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
    font-size: 0.88rem;
    color: var(--text-dim);
}

.ticket-message-meta strong {
    color: var(--text);
}

.ticket-message-body {
    line-height: 1.55;
    white-space: normal;
}

.ticket-reply-form {
    margin-top: 18px;
}

.admin-ticket-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}

/* Shoutbox */
.shoutbox-card {
    position: relative;
}

.shoutbox-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 12px;
}

.shoutbox-panel {
    position: relative;
    min-height: 280px;
    border: 1px solid var(--border);
    background: #121212;
    margin: 16px 0;
}

.shoutbox-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 280px;
    padding: 24px;
}

.shoutbox-loading[hidden] {
    display: none;
}

.shoutbox-spinner {
    width: 40px;
    height: 40px;
}

.shoutbox-spinner-ring {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--accent);
    animation: shoutbox-spin 0.65s linear infinite;
}

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

.shoutbox-messages {
    max-height: 420px;
    overflow-y: auto;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.shoutbox-messages[hidden] {
    display: none;
}

.shoutbox-empty {
    text-align: center;
    margin: 40px 0;
}

.shoutbox-message {
    display: flex;
    gap: 12px;
    border: 1px solid var(--border);
    padding: 10px 12px;
    background: #0f0f0f;
}

.shoutbox-message.staff {
    border-color: rgba(163, 212, 31, 0.35);
    background: rgba(163, 212, 31, 0.06);
}

.shoutbox-avatar-link {
    flex-shrink: 0;
}

.shoutbox-avatar {
    width: 42px;
    height: 42px;
    border-radius: 6px;
    border: 1px solid var(--border);
    object-fit: cover;
    display: block;
    background: #1a1a1a;
}

.shoutbox-message-content {
    flex: 1;
    min-width: 0;
}

.shoutbox-message-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 8px 10px;
    margin-bottom: 6px;
    font-size: 0.86rem;
    color: var(--text-dim);
}

.shoutbox-username {
    color: var(--accent);
    text-decoration: none;
}

.shoutbox-username:hover strong {
    text-decoration: underline;
}

.shoutbox-username strong {
    color: var(--text);
}

.shoutbox-signature {
    flex-basis: 100%;
    font-size: 0.82rem;
    color: var(--text-dim);
    font-style: italic;
    line-height: 1.35;
}

.shoutbox-time {
    margin-left: auto;
}

.shoutbox-message-body {
    line-height: 1.5;
    font-size: 0.94rem;
}

.shoutbox-delete {
    border: none;
    background: transparent;
    color: var(--error);
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
}

.shoutbox-delete:hover {
    color: #ff8888;
}

.shoutbox-form {
    margin-top: 8px;
}

.shoutbox-form-inline {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.shoutbox-form-inline input[type="text"] {
    flex: 1;
    min-width: 0;
}

.shoutbox-form-inline .btn {
    flex-shrink: 0;
    white-space: nowrap;
}

.shoutbox-hint {
    margin: 8px 0 0;
}

#shoutbox-alert[hidden] {
    display: none;
}

/* Profile */
.profile-card h2 {
    margin: 0 0 10px;
    color: var(--text);
    font-size: 1.05rem;
}

.profile-header {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    margin-bottom: 20px;
}

.profile-avatar {
    width: 112px;
    height: 112px;
    border-radius: 10px;
    border: 1px solid var(--border);
    object-fit: cover;
    background: #121212;
    flex-shrink: 0;
}

.profile-summary h1 {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.profile-badge {
    display: inline-block;
    padding: 3px 8px;
    border: 1px solid rgba(163, 212, 31, 0.45);
    background: rgba(163, 212, 31, 0.12);
    color: var(--accent);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.profile-signature-block {
    margin: 18px 0;
    padding: 14px 16px;
    border: 1px solid var(--border);
    background: #121212;
}

.profile-signature {
    line-height: 1.55;
    color: var(--text);
    font-style: italic;
}

.profile-edit-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
    margin-top: 18px;
}

.profile-edit-panel {
    padding: 16px;
    border: 1px solid var(--border);
    background: #121212;
}

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

input[type="file"] {
    width: 100%;
    padding: 8px 0;
    color: var(--text-dim);
    font: inherit;
}

/* Announcement bar */
.announcement-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 10px 20px;
    background: linear-gradient(90deg, rgba(120, 40, 140, 0.35), rgba(204, 70, 205, 0.28), rgba(120, 40, 140, 0.35));
    border-bottom: 1px solid rgba(204, 70, 205, 0.45);
    color: #f0d8ff;
    text-align: center;
}

.announcement-label {
    display: inline-block;
    padding: 2px 8px;
    border: 1px solid rgba(204, 70, 205, 0.55);
    background: rgba(204, 70, 205, 0.18);
    color: #e8b8ff;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.announcement-text {
    font-size: 0.92rem;
    line-height: 1.45;
}

.announcement-form label {
    display: block;
}

.announcement-form textarea {
    margin-top: 8px;
}

/* Members */
.members-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
    margin-top: 18px;
}

.member-card {
    display: flex;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--border);
    background: #121212;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s ease;
}

.member-card:hover {
    border-color: rgba(163, 212, 31, 0.45);
}

.member-avatar {
    width: 52px;
    height: 52px;
    border-radius: 8px;
    border: 1px solid var(--border);
    object-fit: cover;
    flex-shrink: 0;
    background: #0f0f0f;
}

.member-info {
    min-width: 0;
}

.member-name-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 4px;
}

.member-signature {
    margin: 0 0 6px;
    font-size: 0.88rem;
    line-height: 1.4;
    color: var(--text-dim);
    font-style: italic;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.member-access {
    margin: 0;
}

.member-online,
.online-dot {
    color: var(--accent);
}

.member-online {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.online-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 6px rgba(163, 212, 31, 0.65);
    vertical-align: middle;
}

/* Status page */
.status-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 18px;
}

.status-overall {
    padding: 10px 14px;
    border: 1px solid var(--border);
    font-size: 0.9rem;
    white-space: nowrap;
}

.status-overall--online {
    border-color: rgba(163, 212, 31, 0.45);
    background: rgba(163, 212, 31, 0.1);
    color: var(--accent);
}

.status-overall--offline {
    border-color: rgba(255, 85, 85, 0.45);
    background: rgba(255, 85, 85, 0.1);
    color: var(--error);
}

.status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px;
}

.status-item {
    padding: 14px;
    border: 1px solid var(--border);
    background: #121212;
}

.status-item-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.status-item-head .status-label {
    margin-left: auto;
    font-size: 0.82rem;
    color: var(--text-dim);
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--text-dim);
}

.status-item--online .status-dot {
    background: var(--accent);
    box-shadow: 0 0 6px rgba(163, 212, 31, 0.55);
}

.status-item--offline .status-dot {
    background: var(--error);
}

/* Shoutbox extras */
.shoutbox-mention {
    color: #d9a0ff;
    text-decoration: none;
    font-weight: 600;
}

.shoutbox-mention:hover {
    text-decoration: underline;
    color: #ecc8ff;
}

.shoutbox-cooldown {
    margin: 10px 0 0;
    padding: 8px 12px;
    border: 1px solid rgba(255, 85, 85, 0.35);
    background: rgba(255, 85, 85, 0.08);
    color: var(--error);
    font-size: 0.9rem;
}

.shoutbox-cooldown[hidden] {
    display: none;
}

#shoutbox-cooldown[hidden] {
    display: none;
}

/* Name colors */
.name-staff,
.name-staff strong,
.shoutbox-username.name-staff strong {
    color: #e8c547;
}

.name-subscriber,
.name-subscriber strong,
.shoutbox-username.name-subscriber strong {
    color: #ff5555;
}

.role-tag {
    display: inline-block;
    padding: 2px 7px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border: 1px solid var(--border);
}

.role-tag--staff {
    border-color: rgba(232, 197, 71, 0.45);
    background: rgba(232, 197, 71, 0.12);
    color: #e8c547;
}

.banned-notice {
    font-size: 0.95rem;
    line-height: 1.5;
}

.admin-grid .inline-form input[type="text"] {
    min-width: 160px;
    padding: 8px 10px;
    border: 1px solid var(--border);
    background: #111;
    color: var(--text);
    font: inherit;
}
