body {
    background-color: black;
    color: limegreen;
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
}

.login-page {
    position: relative;
    overflow: hidden;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.matrix-bg {
    position: fixed;
    inset: 0;
    background-image:
        repeating-linear-gradient(180deg, rgba(0, 255, 102, 0.18) 0px, rgba(0, 255, 102, 0.18) 1px, rgba(0, 0, 0, 0) 1px, rgba(0, 0, 0, 0) 6px),
        repeating-linear-gradient(90deg, rgba(0, 255, 102, 0.08) 0px, rgba(0, 255, 102, 0.08) 1px, rgba(0, 0, 0, 0) 1px, rgba(0, 0, 0, 0) 20px);
    opacity: 0.35;
    z-index: 0;
    pointer-events: none;
}

.login-page .chat-container {
    position: relative;
    z-index: 1;
    width: min(420px, 92vw);
    margin: 0;
    height: auto;
}

body.logged-in:not(.admin-page) .chat-container {
    position: relative;
    z-index: 2;
}

body.admin-page {
    position: relative;
}

body.admin-page .matrix-bg {
    display: block;
}

body.admin-page {
    height: auto;
    min-height: 100vh;
    overflow-y: auto;
}


.chat-container {
    max-width: 600px;
    margin: 50px auto;
    padding: 20px;
    background-color: #1a1a1a;
    border-radius: 10px;
    box-shadow: 0 0 10px #00ff00;
    border: 1px solid limegreen;
}




h1 {
    text-align: center;
}

.chat-title {
    font-family: "Orbitron", "Segoe UI", sans-serif;
    font-size: 28px;
    letter-spacing: 1.5px;
    color: #b8ffd9;
    text-transform: uppercase;
    text-shadow: 0 0 10px rgba(0, 255, 153, 0.6), 0 0 20px rgba(0, 255, 153, 0.35);
    width: 100%;
    text-align: center;
}

.login-page .chat-title {
    white-space: nowrap;
    padding: 0;
    margin: 0 auto;
}

.secret-page {
    background-color: #050707;
    min-height: 100vh;
    height: 100vh;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.secret-page .matrix-bg {
    display: block;
    opacity: 0.3;
}

.secret-container {
    max-width: 720px;
    margin: 0 auto;
    padding: 20px 22px 22px;
    background: #0c1313;
    border-radius: 14px;
    border: 1px solid #00ff66;
    box-shadow: 0 0 18px rgba(0, 255, 153, 0.45), inset 0 0 16px rgba(0, 0, 0, 0.55);
    position: relative;
    z-index: 2;
    text-align: center;
    height: auto;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    box-sizing: border-box;
}

.secret-header {
    position: relative;
    margin-bottom: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.secret-title {
    font-family: "Orbitron", "Segoe UI", sans-serif;
    font-size: 24px;
    letter-spacing: 2px;
    color: #b8ffd9;
    text-transform: uppercase;
    text-shadow: 0 0 10px rgba(0, 255, 153, 0.6), 0 0 20px rgba(0, 255, 153, 0.35);
    margin: 0;
}


.secret-stage {
    margin: 16px auto 12px;
    perspective: 900px;
}

.mode-3d {
    position: relative;
    display: inline-block;
    font-family: "Orbitron", "Segoe UI", sans-serif;
    font-size: 48px;
    font-weight: 700;
    letter-spacing: 6px;
    background: linear-gradient(120deg, #00ffcc, #b8ffd9, #66c7ff, #00ffcc);
    background-size: 220% 220%;
    color: transparent;
    -webkit-background-clip: text;
    background-clip: text;
    text-shadow:
        0 0 12px rgba(0, 255, 204, 0.8),
        0 0 26px rgba(0, 255, 204, 0.6),
        0 0 38px rgba(102, 199, 255, 0.5);
    transform-style: preserve-3d;
    animation: spin-3d 9s linear infinite, shimmer 2.6s linear infinite;
}

.mode-3d::after {
    content: "1337 Mode";
    position: absolute;
    left: 0;
    top: 0;
    transform: translateZ(-18px) translate(6px, 6px);
    color: rgba(2, 7, 6, 0.7);
    text-shadow: 0 0 6px rgba(0, 0, 0, 0.8);
    filter: blur(1px);
    z-index: -1;
}

.secret-subtitle {
    color: #66ffcc;
    letter-spacing: 1px;
    text-transform: uppercase;
    font-size: 12px;
}

.secret-ascii-logo {
    margin: 2px auto 10px;
    padding: 8px 10px;
    display: inline-block;
    text-align: left;
    font-family: "Courier New", monospace;
    font-size: 12px;
    line-height: 1.12;
    color: #9dffd2;
    background: rgba(6, 12, 10, 0.8);
    border: 1px solid rgba(102, 255, 204, 0.4);
    border-radius: 10px;
    box-shadow: 0 0 14px rgba(0, 255, 204, 0.25);
}

.pgp-block {
    margin: 12px auto 8px;
    text-align: left;
    border: 1px solid rgba(0, 255, 153, 0.25);
    background: rgba(6, 12, 10, 0.85);
    border-radius: 12px;
    padding: 10px 12px;
    box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.6);
    flex: 0 1 auto;
    min-height: 0;
    max-height: 40vh;
    overflow: hidden;
}

.pgp-title {
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 11px;
    color: #7cffb3;
    margin-bottom: 8px;
}

.pgp-key {
    margin: 0;
    font-family: "Courier New", monospace;
    font-size: 11px;
    line-height: 1.35;
    color: #c8ffe1;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 32vh;
    overflow: auto;
}

.pgp-copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 2px 0 10px;
    background: #0f1a12;
    color: #b8ffd9;
    border: 1px solid rgba(0, 255, 153, 0.55);
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    box-shadow: 0 0 8px rgba(0, 255, 153, 0.25);
}

.pgp-copy-btn:hover {
    background: #66ffcc;
    color: #04120b;
}

.pgp-copy-status {
    font-size: 11px;
    color: #7cffb3;
    margin-top: 6px;
    min-height: 14px;
}

.secret-exit {
    margin-top: 18px;
}

.secret-exit button {
    background: transparent;
    color: #66ffcc;
    border: 1px solid #66ffcc;
    padding: 8px 14px;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    box-shadow: 0 0 8px rgba(102, 255, 204, 0.4);
}

.secret-exit button:hover {
    background: #66ffcc;
    color: #03120c;
}

.chat-header {
    position: relative;
    margin-bottom: 4px;
}

.chat-header h1 {
    margin: 0;
    text-align: center;
}

.admin-link {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #ffb347;
    border: 1px solid #ffb347;
    padding: 6px 10px;
    border-radius: 999px;
    text-decoration: none;
    box-shadow:
        0 0 6px rgba(255, 179, 71, 0.5),
        0 0 14px rgba(255, 214, 102, 0.75);
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
}

.admin-panel-title {
    display: flex;
    justify-content: center;
    margin-bottom: 8px;
}

.admin-panel-chip {
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #ffb347;
    border: 1px solid #ffb347;
    padding: 10px 18px;
    border-radius: 999px;
    box-shadow:
        0 0 6px rgba(255, 179, 71, 0.5),
        0 0 14px rgba(255, 214, 102, 0.75);
}

.chat-title {
    padding: 0 120px;
}

.admin-link:hover {
    color: #1a0f00;
    background: #ffb347;
}

.clock-wrap {
    margin: 6px auto 10px;
    text-align: center;
    width: 100%;
}

.clock-title {
    font-size: 14px;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 8px;
    color: #66ff99;
}

.flip-clock {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.clock-meta {
    font-family: "Courier New", monospace;
    font-size: 16px;
    color: #9bffcb;
    letter-spacing: 1.5px;
    background: linear-gradient(180deg, #0b120e, #060b08);
    border: 1px solid #00ff66;
    padding: 8px 14px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 255, 102, 0.35), inset 0 0 12px rgba(0, 0, 0, 0.7);
    text-shadow: 0 0 6px rgba(0, 255, 153, 0.6);
    position: relative;
    overflow: hidden;
}

.clock-meta::after {
    content: "";
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        180deg,
        rgba(0, 0, 0, 0.0) 0px,
        rgba(0, 0, 0, 0.0) 6px,
        rgba(0, 0, 0, 0.25) 7px
    );
    pointer-events: none;
    mix-blend-mode: soft-light;
}

form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.user-id-form {
    margin: 10px 0 15px;
}

input, textarea, button {
    font-size: 16px;
    padding: 10px;
    border: 1px solid limegreen;
    border-radius: 5px;
    background-color: #333;
    color: limegreen;
    box-sizing: border-box;
}

textarea {
    resize: none;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

input[type="password"], input[type="email"] {
    font-size: 16px;
}

input[type="file"] {
    font-size: 14px;
    background: #0f1a12;
}

button {
    cursor: pointer;
}

button:hover {
    background-color: limegreen;
    color: black;
}

.post-comment-btn {
    position: relative;
    background: linear-gradient(160deg, #e5e5e5 0%, #b5b5b5 45%, #7a7a7a 100%);
    color: #1a1a1a;
    border: 1px solid #f0f0f0;
    border-radius: 999px;
    font-weight: 700;
    font-family: "Orbitron", "Segoe UI", sans-serif;
    letter-spacing: 1px;
    text-transform: uppercase;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.7),
        inset 0 -2px 4px rgba(0, 0, 0, 0.25),
        0 6px 14px rgba(0, 0, 0, 0.4);
    transition: transform 0.08s ease, box-shadow 0.08s ease, background 0.2s ease;
}

.post-comment-btn:hover {
    background: linear-gradient(160deg, #f5f5f5 0%, #c7c7c7 45%, #8a8a8a 100%);
    color: #0f0f0f;
}

.post-comment-btn:active {
    transform: translateY(2px);
    box-shadow:
        inset 0 2px 4px rgba(0, 0, 0, 0.35),
        0 2px 6px rgba(0, 0, 0, 0.35);
}

.post-comment-btn:disabled {
    background: linear-gradient(160deg, #3c3c3c 0%, #2c2c2c 100%);
    color: #9a9a9a;
    border-color: #4a4a4a;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

.post-comment-btn.post-comment-active {
    background: radial-gradient(circle at 25% 20%, rgba(140, 230, 255, 0.9), rgba(6, 14, 30, 0.95) 50%),
                linear-gradient(160deg, #0a1224 0%, #101a34 60%, #07101f 100%);
    color: #e9f6ff;
    border-color: rgba(160, 235, 255, 0.9);
    text-shadow: 0 0 14px rgba(130, 220, 255, 0.95);
    box-shadow:
        0 0 22px rgba(90, 200, 255, 0.7),
        0 0 38px rgba(20, 140, 255, 0.7),
        inset 0 0 16px rgba(160, 235, 255, 0.25);
    animation: none;
}

.post-comment-btn.post-comment-active::before,
.post-comment-btn.post-comment-active::after {
    content: "";
    position: absolute;
    inset: -6px;
    border-radius: inherit;
    pointer-events: none;
    opacity: 0.7;
    mix-blend-mode: screen;
    background:
        linear-gradient(115deg, transparent 18%, rgba(140, 235, 255, 0.9) 46%, transparent 74%),
        linear-gradient(305deg, transparent 28%, rgba(40, 170, 255, 0.85) 56%, transparent 82%);
    filter: blur(2px);
    animation: none;
}

.post-comment-btn.post-comment-active::after {
    inset: -2px;
    opacity: 0.4;
    filter: blur(1px);
    animation-duration: 0s;
}

.post-comment-btn.post-comment-active:hover {
    transform: translateY(-1px) scale(1.01);
    box-shadow:
        0 0 30px rgba(160, 235, 255, 0.9),
        0 0 48px rgba(30, 170, 255, 0.8),
        inset 0 0 20px rgba(200, 245, 255, 0.4);
    animation: none;
}

.post-comment-btn.post-comment-active:active {
    transform: translateY(2px) scale(0.99);
    box-shadow:
        0 0 14px rgba(140, 220, 255, 0.7),
        inset 0 0 12px rgba(0, 0, 0, 0.45);
    animation: none;
}

@keyframes lightning-pulse {
    0% {
        filter: brightness(1) saturate(1.1);
    }
    50% {
        filter: brightness(1.35) saturate(1.45);
    }
    100% {
        filter: brightness(1.1) saturate(1.2);
    }
}

@keyframes lightning-crackle {
    0% {
        opacity: 0.2;
        transform: translateY(0) rotate(0deg);
    }
    40% {
        opacity: 0.8;
        transform: translateY(-1px) rotate(0.5deg);
    }
    70% {
        opacity: 0.4;
        transform: translateY(1px) rotate(-0.5deg);
    }
    100% {
        opacity: 0.6;
        transform: translateY(0) rotate(0deg);
    }
}

@keyframes lightning-strike {
    0% {
        filter: brightness(1);
    }
    30% {
        filter: brightness(1.8);
    }
    100% {
        filter: brightness(1.1);
    }
}


.comment {
    border-bottom: 1px solid limegreen;
    padding: 10px 0;
    overflow-wrap: anywhere;
    word-break: break-word;
    position: relative;
    padding-right: 68px;
}

.comment.reply {
    margin-left: 28px;
    padding-left: 14px;
    border-left: 2px solid rgba(124, 255, 179, 0.5);
    background: rgba(8, 16, 12, 0.6);
    border-radius: 10px;
}

.comment p {
    margin: 5px 0;
}

.comment-content {
    margin-top: 2px;
}

.pgp-message {
    margin: 6px 0 4px;
    padding: 10px 12px;
    background: #0b120e;
    border: 1px solid rgba(0, 255, 102, 0.4);
    border-radius: 8px;
    font-family: "Courier New", monospace;
    font-size: 12px;
    line-height: 1.35;
    color: #c8ffe1;
    white-space: pre;
    overflow-x: auto;
}

.pgp-actions {
    display: flex;
    justify-content: flex-end;
    margin: 6px 0 6px;
}

.pgp-decrypt-btn {
    background: #0f1a12;
    color: #b8ffd9;
    border: 1px solid rgba(0, 255, 153, 0.55);
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    box-shadow: 0 0 8px rgba(0, 255, 153, 0.25);
}

.pgp-decrypt-btn:hover {
    background: #66ffcc;
    color: #04120b;
}

.pgp-decrypt-btn.decrypting {
    opacity: 0.7;
    cursor: wait;
}

.pgp-decrypted {
    margin: 6px 0 4px;
    padding: 10px 12px;
    background: #0b120e;
    border: 1px solid rgba(0, 255, 102, 0.4);
    border-radius: 8px;
    font-family: "Courier New", monospace;
    font-size: 12px;
    line-height: 1.35;
    color: #c8ffe1;
    white-space: pre-wrap;
    word-break: break-word;
    min-height: 18px;
}

.pgp-decrypted.error {
    color: #ff8a66;
    border-color: rgba(255, 138, 102, 0.6);
}

.comment .timestamp {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #7cffb3;
    text-shadow: 0 0 6px rgba(0, 255, 179, 0.4);
    margin-bottom: 4px;
}

.attachment {
    margin-top: 8px;
    display: flex;
    justify-content: flex-start;
}

.attachment img,
.attachment video {
    max-width: 100%;
    width: auto;
    height: auto;
    max-height: min(72vh, 980px);
    display: block;
    border-radius: 6px;
    border: 1px solid #00ff66;
    box-shadow: 0 0 10px rgba(0, 255, 102, 0.3);
    background: #060b08;
    object-fit: contain;
}

.attachment img {
    image-rendering: auto;
}


.comment .author {
    color: limegreen;
}

.comment .author.admin {
    color: #ff9f1a;
    text-shadow: 0 0 8px rgba(255, 159, 26, 0.6);
}

.mention {
    color: #7cffb3;
    font-weight: 700;
    text-shadow: 0 0 6px rgba(124, 255, 179, 0.55);
}

.admin-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 2px 6px;
    border-radius: 999px;
    font-size: 10px;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: #1a0f00;
    background: #ffb347;
    box-shadow: 0 0 10px rgba(255, 198, 90, 0.75);
    animation: admin-badge-glow 2.4s ease-in-out infinite;
}

.comment .actions button {
    background: #0f1a12;
    border: 1px solid #00ff66;
    color: #a8ffcc;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 10px;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.1s ease, box-shadow 0.1s ease, color 0.1s ease;
}

.comment .actions {
    position: absolute;
    top: 8px;
    right: 8px;
    display: inline-flex;
    gap: 6px;
}

.comment .actions button:hover {
    transform: translateY(-1px);
    box-shadow: 0 0 6px rgba(0, 255, 102, 0.5);
    color: #a8ffcc;
}

.comment-footer {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.reaction-bar {
    display: inline-flex;
    gap: 6px;
    flex-wrap: wrap;
}

.reaction-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 999px;
    border: 1px solid rgba(0, 255, 153, 0.35);
    background: rgba(8, 18, 15, 0.75);
    color: #b8ffd9;
    font-size: 12px;
    cursor: pointer;
    transition: transform 0.08s ease, box-shadow 0.1s ease;
}

.reaction-chip.reacted {
    border-color: rgba(124, 255, 179, 0.8);
    box-shadow: 0 0 8px rgba(124, 255, 179, 0.35);
}

.reaction-chip:hover {
    transform: translateY(-1px);
    box-shadow: 0 0 8px rgba(124, 255, 179, 0.35);
}

.reaction-count {
    font-variant-numeric: tabular-nums;
    color: #7cffb3;
}

.reaction-add {
    background: #0f1a12;
    color: #a8ffcc;
    border: 1px dashed rgba(124, 255, 179, 0.5);
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 12px;
    cursor: pointer;
}

.reaction-picker {
    position: absolute;
    display: inline-flex;
    gap: 6px;
    background: rgba(8, 18, 15, 0.96);
    border: 1px solid rgba(124, 255, 179, 0.45);
    border-radius: 999px;
    padding: 6px 8px;
    z-index: 999;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.45), 0 0 10px rgba(124, 255, 179, 0.25);
}

.reaction-picker button {
    background: transparent;
    border: none;
    font-size: 16px;
    cursor: pointer;
}

.reply-btn {
    background: transparent;
    border: 1px solid rgba(124, 255, 179, 0.4);
    color: #a8ffcc;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    cursor: pointer;
}

.reply-btn:hover {
    box-shadow: 0 0 6px rgba(124, 255, 179, 0.35);
}

.inline-edit {
    display: none;
    margin-top: 8px;
}

.comment.editing .inline-edit {
    display: block;
}

.comment.editing .comment-content {
    display: none;
}

.inline-edit-input {
    width: 100%;
    min-height: 80px;
    resize: vertical;
}

.inline-edit-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    justify-content: flex-end;
}

.inline-edit-actions button {
    background: #0f1a12;
    border: 1px solid #00ff66;
    color: #a8ffcc;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 10px;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.1s ease, box-shadow 0.1s ease, color 0.1s ease;
}

.inline-edit-actions button:hover {
    transform: translateY(-1px);
    box-shadow: 0 0 6px rgba(0, 255, 102, 0.5);
    color: #a8ffcc;
}

.comment .actions .delete-btn.deleting {
    color: #66ffcc;
    cursor: wait;
    opacity: 0.85;
    animation: delete-pulse 1s ease-in-out infinite;
    box-shadow: 0 0 8px rgba(102, 255, 204, 0.45);
}

.comment .actions .edit-btn {
    margin-right: 8px;
}

.edited-tag {
    color: #7cffb3;
    font-size: 11px;
    margin-left: 6px;
}

.chat-links {
    margin-top: 15px;
    display: flex;
    gap: 15px;
    justify-content: center;
}

.chat-links a {
    color: limegreen;
}

.chat-links a:hover {
    color: #00ff00;
}

.admin-table {
    margin-top: 15px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    animation: admin-pulse 3s ease-in-out infinite;
}

.admin-row {
    display: grid;
    grid-template-columns: 1.6fr 0.7fr 1.7fr;
    gap: 12px;
    border: 1px solid #ff6b35;
    border-radius: 8px;
    padding: 12px;
    background: #1a0b0b;
    box-shadow: 0 0 12px rgba(255, 107, 53, 0.35);
}

.admin-head {
    font-weight: 700;
    background: #2a0f0f;
}

.admin-actions form {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.admin-actions input[type="password"] {
    min-width: 160px;
}

.admin-sub {
    font-size: 12px;
    color: #ffb347;
}

.admin-row button {
    background: #2a0f0f;
    border: 1px solid #ff6b35;
    color: #ffb347;
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 12px;
    cursor: pointer;
    box-shadow: 0 0 8px rgba(255, 107, 53, 0.35);
}

.admin-row button:hover {
    background: #ff6b35;
    color: #1a0b0b;
}

@keyframes admin-pulse {
    0% {
        box-shadow: 0 0 10px rgba(255, 107, 53, 0.35), 0 0 18px rgba(255, 179, 71, 0.25);
    }
    50% {
        box-shadow: 0 0 16px rgba(255, 107, 53, 0.55), 0 0 28px rgba(255, 179, 71, 0.45);
    }
    100% {
        box-shadow: 0 0 10px rgba(255, 107, 53, 0.35), 0 0 18px rgba(255, 179, 71, 0.25);
    }
}

@keyframes admin-badge-glow {
    0% {
        box-shadow: 0 0 6px rgba(255, 190, 90, 0.55);
        opacity: 0.85;
    }
    50% {
        box-shadow: 0 0 12px rgba(255, 214, 102, 0.9);
        opacity: 1;
    }
    100% {
        box-shadow: 0 0 6px rgba(255, 190, 90, 0.55);
        opacity: 0.85;
    }
}

.top-rail {
    display: grid;
    grid-template-columns: auto minmax(320px, 1fr) auto;
    align-items: center;
    gap: 12px;
    margin: 6px 0 6px;
}

.chat-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    font-size: 12px;
}

.meta-card {
    padding: 6px 10px;
    border: 1px solid rgba(0, 255, 153, 0.35);
    border-radius: 10px;
    background: #0b1210;
    box-shadow: inset 0 0 16px rgba(0, 0, 0, 0.6);
}

.chat-meta a {
    color: limegreen;
}

.logout-btn {
    background: #0f1a12;
    border: 1px solid #00ff66;
    color: #a8ffcc;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.logout-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 0 6px rgba(0, 255, 102, 0.5);
    color: #a8ffcc;
}

.meta-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.meta-user {
    font-weight: 600;
    color: #c8ffe1;
}

.meta-online {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: #7cffb3;
}

.online-label {
    opacity: 0.75;
}

.online-count {
    display: inline-flex;
    min-width: 28px;
    justify-content: center;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(0, 255, 102, 0.12);
    border: 1px solid rgba(0, 255, 102, 0.4);
    color: #c8ffe1;
    font-weight: 700;
    cursor: pointer;
}

.online-count-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.online-tooltip {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 220px;
    max-width: min(280px, calc(100vw - 16px));
    background: rgba(8, 18, 15, 0.95);
    border: 1px solid rgba(0, 255, 153, 0.35);
    border-radius: 10px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.4), 0 0 12px rgba(0, 255, 153, 0.2);
    padding: 10px 12px;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-6px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 5;
}

.online-count-wrap:hover .online-tooltip,
.online-count-wrap:focus-within .online-tooltip {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.online-user {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 6px 0;
    border-bottom: 1px solid rgba(0, 255, 102, 0.12);
    font-size: 12px;
    text-transform: none;
    letter-spacing: 0.2px;
    color: #c8ffe1;
}

.online-user:last-child {
    border-bottom: none;
}

.online-name {
    font-weight: 700;
    color: #7cffb3;
}

.online-time {
    color: #b0ffe0;
    font-variant-numeric: tabular-nums;
}

.online-empty {
    font-size: 12px;
    color: #b0ffe0;
}

.audio-controls {
    display: flex;
    justify-content: center;
    margin: 0;
}

.audio-player {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 12px;
    align-items: center;
    padding: 10px 14px;
    border-radius: 14px;
    border: 1px solid rgba(124, 255, 179, 0.35);
    background: linear-gradient(140deg, rgba(8, 18, 15, 0.95), rgba(6, 12, 10, 0.85));
    box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.5), 0 0 18px rgba(0, 255, 153, 0.18);
    width: min(480px, 100%);
}

.audio-meta {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.audio-title {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #7cffb3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    position: relative;
    line-height: 1;
}

.audio-marquee {
    display: block;
    overflow: hidden;
    white-space: nowrap;
}

.audio-marquee-track {
    display: inline-flex;
    white-space: nowrap;
    animation: audio-marquee 16s linear infinite;
}

.audio-marquee-item {
    display: inline-block;
    padding-right: 28px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

@keyframes audio-marquee {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}


.audio-progress {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 10px;
}

.audio-wave {
    width: 100%;
    height: 26px;
    border-radius: 10px;
    background: rgba(8, 16, 12, 0.65);
    border: 1px solid rgba(124, 255, 179, 0.2);
}

.audio-time {
    font-size: 11px;
    color: #b8ffd9;
    font-variant-numeric: tabular-nums;
}

#audioSeek {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(124, 255, 179, 0.6), rgba(0, 255, 102, 0.2));
    outline: none;
    cursor: pointer;
}

#audioSeek::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #7cffb3;
    box-shadow: 0 0 8px rgba(124, 255, 179, 0.6);
    border: 2px solid #0b120e;
}

#audioSeek::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #7cffb3;
    border: 2px solid #0b120e;
}

.audio-toggle {
    background: #0f1a12;
    border: 1px solid #00ff66;
    color: #a8ffcc;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 12px;
    cursor: pointer;
    transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.audio-toggle:hover {
    transform: translateY(-1px);
    box-shadow: 0 0 6px rgba(0, 255, 102, 0.5);
}

.back-chat-btn {
    background: #0f1a12;
    border: 1px solid #00ff66;
    color: #a8ffcc;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.1s ease, box-shadow 0.1s ease;
    display: inline-block;
}

.back-chat-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 0 6px rgba(0, 255, 102, 0.5);
    color: #a8ffcc;
}

.encrypt-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 6px 0 2px;
    font-size: 12px;
    color: #7cffb3;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.encrypt-toggle input {
    accent-color: #00ff66;
}

.encrypt-tooltip {
    position: relative;
    cursor: help;
}

.encrypt-tooltip[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 0;
    top: calc(100% + 6px);
    background: rgba(8, 18, 15, 0.95);
    border: 1px solid rgba(0, 255, 153, 0.35);
    color: #c8ffe1;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 11px;
    text-transform: none;
    letter-spacing: 0.2px;
    white-space: nowrap;
    box-shadow: 0 10px 18px rgba(0, 0, 0, 0.35), 0 0 10px rgba(0, 255, 153, 0.2);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-4px);
    transition: opacity 0.15s ease, transform 0.15s ease;
    z-index: 6;
}

.encrypt-tooltip:hover::after,
.encrypt-tooltip:focus::after {
    opacity: 1;
    transform: translateY(0);
}

.typing-indicator {
    min-height: 18px;
    margin: 6px 0 8px;
    font-size: 12px;
    color: #7cffb3;
    letter-spacing: 0.4px;
}

.error {
    border: 1px solid #ff4d4d;
    color: #ff4d4d;
    background: #2a0000;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 10px;
}

.notice {
    border: 1px solid #00ff00;
    color: #00ff00;
    background: #0b1a0b;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 10px;
}

.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 999;
}

.toast {
    background: #0f1a12;
    border: 1px solid #00ff66;
    color: #a8ffcc;
    padding: 8px 12px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 255, 102, 0.3);
    font-size: 12px;
    opacity: 0;
    animation: toast-in 0.35s ease forwards;
}

.toast.toast-hide {
    animation: toast-out 0.35s ease forwards;
}

.profile-card {
    position: absolute;
    min-width: 180px;
    max-width: 260px;
    padding: 10px 12px;
    background: rgba(8, 18, 15, 0.96);
    border: 1px solid rgba(124, 255, 179, 0.45);
    border-radius: 12px;
    color: #b8ffd9;
    font-size: 12px;
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.45), 0 0 12px rgba(124, 255, 179, 0.25);
    opacity: 0;
    transform: translateY(-6px);
    pointer-events: none;
    transition: opacity 0.15s ease, transform 0.15s ease;
    z-index: 998;
}

.profile-card.open {
    opacity: 1;
    transform: translateY(0);
}

.profile-name {
    font-weight: 700;
    color: #7cffb3;
    margin-bottom: 6px;
    letter-spacing: 0.5px;
}

.profile-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    color: #c8ffe1;
}

.reaction-tooltip {
    position: absolute;
    min-width: 140px;
    max-width: 220px;
    padding: 8px 10px;
    background: rgba(8, 18, 15, 0.96);
    border: 1px solid rgba(124, 255, 179, 0.45);
    border-radius: 10px;
    color: #b8ffd9;
    font-size: 11px;
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.45), 0 0 12px rgba(124, 255, 179, 0.25);
    opacity: 0;
    transform: translateY(-6px);
    pointer-events: none;
    transition: opacity 0.12s ease, transform 0.12s ease;
    z-index: 997;
}

.reaction-tooltip.open {
    opacity: 1;
    transform: translateY(0);
}

.reaction-tooltip-header {
    font-weight: 700;
    margin-bottom: 6px;
    color: #7cffb3;
    letter-spacing: 0.3px;
}

.reaction-tooltip-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes toast-out {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-6px);
    }
}

@keyframes electric-pulse {
    0% {
        box-shadow: 0 0 8px #00ff66, 0 0 16px rgba(0, 255, 102, 0.5);
        border-color: #00ff66;
    }
    45% {
        box-shadow: 0 0 14px #00ffcc, 0 0 28px rgba(0, 255, 204, 0.7);
        border-color: #00ffcc;
    }
    55% {
        box-shadow: 0 0 4px #00ff66, 0 0 10px rgba(0, 255, 102, 0.35);
        border-color: #00ff66;
    }
    100% {
        box-shadow: 0 0 10px #00ff66, 0 0 22px rgba(0, 255, 102, 0.6);
        border-color: #00ff66;
    }
}

@keyframes delete-pulse {
    0% {
        opacity: 0.6;
    }
    50% {
        opacity: 1;
    }
    100% {
        opacity: 0.6;
    }
}

@keyframes spin-3d {
    0% {
        transform: rotateY(0deg) rotateX(12deg);
    }
    100% {
        transform: rotateY(-360deg) rotateX(12deg);
    }
}

@keyframes shimmer {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

body.logged-in:not(.admin-page) .chat-container {
    border-color: #00ff66;
    animation: none;
    width: 100%;
    max-width: none;
    margin: 0;
    height: 100vh;
    height: 100dvh;
    min-height: 100vh;
    min-height: 100dvh;
    padding-top: max(6px, env(safe-area-inset-top));
    padding-right: max(8px, env(safe-area-inset-right));
    padding-bottom: max(6px, env(safe-area-inset-bottom));
    padding-left: max(8px, env(safe-area-inset-left));
    border-radius: 0;
    box-shadow: inset 0 0 20px rgba(0, 255, 153, 0.08);
}


body.admin-page .admin-container {
    border-color: #ff6b35;
    box-shadow: 0 0 14px rgba(255, 107, 53, 0.55), 0 0 26px rgba(255, 179, 71, 0.35);
    animation: none;
    height: auto;
    min-height: calc(100vh - 16px);
}


/* --- Chat layout redesign --- */
body.logged-in {
    font-family: "Space Grotesk", "Segoe UI", sans-serif;
    color: #d7ffe9;
    min-height: 100vh;
    min-height: 100dvh;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    padding: 0;
}

body.logged-in.admin-page {
    height: auto;
    min-height: 100vh;
    min-height: 100dvh;
    overflow-y: auto;
}

.chat-container {
    max-width: 1100px;
    margin: 8px auto;
    padding: 22px;
    background: #0d1412;
    border-radius: 14px;
    box-shadow: 0 0 24px rgba(0, 255, 153, 0.25);
    height: calc(100vh - 16px);
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.chat-shell {
    display: grid;
    grid-template-columns: minmax(160px, 210px) 1fr;
    gap: 10px;
    align-items: stretch;
    flex: 1;
    min-height: 0;
}

.user-sidebar {
    background: #0a1110;
    border: 1px solid rgba(0, 255, 153, 0.35);
    border-radius: 12px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.6);
}

.sidebar-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #7cffb3;
    margin-bottom: 8px;
}

.user-list {
    overflow-y: auto;
    padding-right: 4px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.user-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 6px;
    border-radius: 8px;
    background: rgba(8, 14, 12, 0.65);
}

.user-row.online {
    background: rgba(0, 255, 153, 0.12);
    border: 1px solid rgba(0, 255, 153, 0.25);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #55615d;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.4);
}

.user-row.online .status-dot {
    background: #44ff99;
    box-shadow: 0 0 8px rgba(68, 255, 153, 0.7);
}

.user-name {
    font-size: 12px;
    color: #d7ffe9;
}

.user-name.me {
    font-weight: 600;
    color: #b8ffd9;
}

.user-status {
    margin-left: auto;
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #7cffb3;
}

.user-row.offline .user-status {
    color: #6e7e78;
}

.user-empty {
    font-size: 12px;
    color: #6e7e78;
    padding: 10px 6px;
    text-align: center;
}

.chat-main {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
    min-height: 0;
}

.chat-stream {
    background: #0b1210;
    border: 1px solid rgba(0, 255, 153, 0.35);
    border-radius: 12px;
    padding: 10px;
    min-height: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.6);
}

.chat-display {
    margin-top: 0;
    overflow-y: auto;
    padding-right: 6px;
    flex: 1;
}

.chat-composer {
    background: #0b1210;
    border: 1px solid rgba(0, 255, 153, 0.35);
    border-radius: 12px;
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.6);
}

.chat-composer textarea {
    min-height: 68px;
    background: #0f1a12;
}

.reply-banner {
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 10px;
    background: rgba(10, 24, 18, 0.9);
    border: 1px solid rgba(124, 255, 179, 0.35);
    font-size: 12px;
    color: #b8ffd9;
}

.reply-banner.active {
    display: flex;
}

.reply-cancel {
    background: transparent;
    border: 1px solid rgba(255, 159, 26, 0.6);
    color: #ffb347;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    cursor: pointer;
}

.reply-cancel:hover {
    background: #ffb347;
    color: #1a0f00;
}

.composer-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.composer-actions .post-comment-btn {
    margin-left: auto;
}

@media (max-width: 900px) {
    body.logged-in {
        height: 100vh;
        height: 100dvh;
        min-height: 100vh;
        min-height: 100dvh;
        overflow: hidden;
    }
    body.logged-in:not(.admin-page) .chat-container {
        height: 100vh;
        height: 100dvh;
        min-height: 100vh;
        min-height: 100dvh;
        padding-top: max(5px, env(safe-area-inset-top));
        padding-right: max(6px, env(safe-area-inset-right));
        padding-bottom: max(5px, env(safe-area-inset-bottom));
        padding-left: max(6px, env(safe-area-inset-left));
    }
    .chat-shell {
        grid-template-columns: 1fr;
        flex: 1;
        min-height: 0;
    }
    .user-sidebar {
        min-height: 140px;
        max-height: min(220px, 24dvh);
    }
    .chat-stream {
        max-height: none;
    }
    .top-rail {
        grid-template-columns: 1fr;
    }
    .chat-meta {
        justify-content: center;
    }
    .logout-btn {
        justify-self: center;
    }
}

@media (max-width: 640px) {
    .chat-title {
        padding: 0;
        font-size: 22px;
    }
    body.logged-in:not(.admin-page) .chat-container {
        padding-top: max(4px, env(safe-area-inset-top));
        padding-right: max(4px, env(safe-area-inset-right));
        padding-bottom: max(4px, env(safe-area-inset-bottom));
        padding-left: max(4px, env(safe-area-inset-left));
    }
    .admin-link {
        position: static;
        transform: none;
    }
    .chat-header-right {
        margin-left: 0;
    }
    .audio-player {
        grid-template-columns: 1fr;
        width: 100%;
    }
    .audio-toggle {
        justify-self: center;
    }
    .chat-composer {
        padding: 8px;
    }
    .composer-actions .post-comment-btn {
        margin-left: 0;
        width: 100%;
    }
}


.comment.unread {
    border-left: 3px solid #7cffb3;
    background: rgba(124, 255, 179, 0.08);
    box-shadow: 0 0 14px rgba(124, 255, 179, 0.25);
    animation: none;
}

@keyframes unread-pulse {
    0% {
        box-shadow: 0 0 10px rgba(124, 255, 179, 0.2);
    }
    50% {
        box-shadow: 0 0 20px rgba(124, 255, 179, 0.45);
    }
    100% {
        box-shadow: 0 0 10px rgba(124, 255, 179, 0.2);
    }
}


.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.chat-header-left {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-align: center;
}

.chat-header-right {
    margin-left: auto;
}

.chat-title {
    text-align: center;
}

body.animations-paused * {
    animation-play-state: paused !important;
}
