:root {
    --bg-color: #050505;
    --text-main: #00ff00;
    --text-sec: #00ffff;
    --text-alert: #ffaa00;
    --error-color: #ff0000;
    --dim-color: #444;
    --font-retro: 'Courier New', Courier, monospace;
    --chat-avatar-size: 80px;
    --emoji-size: 80px;
    --font-size: 18px;
    /* Ethiopic Font Defaults */
    --ethiopic-chat-font-size: 22px;
    --ethiopic-input-font-size: 22px;
    --ethiopic-font-family: 'Noto Sans Ethiopic', sans-serif;
    
    /* Specific Chat Sizes */
    --chat-eng-size: 18px;
    --chat-eth-size: 22px;
}

body { 
    background-color: #050505;
    color: var(--text-main); 
    font-family: var(--font-retro); 
    font-size: var(--font-size); 
    margin: 0; 
    padding: 20px; 
    overflow-x: hidden; 
    min-height: 100vh;
    
    /* Graph Paper Grid Background - Adjusted for visibility */
    background-image: 
        linear-gradient(rgba(50, 50, 50, 0.3) 1px, transparent 1px),
        linear-gradient(90deg, rgba(50, 50, 50, 0.3) 1px, transparent 1px);
    background-size: 20px 20px;
}

h1, h2, h3 { text-shadow: 0 0 5px var(--text-main); }
a { color: var(--text-sec); text-decoration: none; }
a:hover { text-decoration: underline; text-shadow: 0 0 5px var(--text-sec); }

.container { 
    max-width: 900px; 
    margin: 0 auto; 
    border: 2px solid var(--text-main); 
    padding: 10px; 
    /* Dynamic glow matching selected theme */
    box-shadow: 0 0 20px var(--text-main); 
    position: relative; 
    /* Ensure container has solid background over the body grid */
    background-color: var(--bg-color);
}

.login-box { width: 350px; margin: 50px auto; text-align: center; border: 1px dashed var(--text-sec); padding: 20px; background: #000; }

#status-bar { font-weight: bold; margin-top: 0px; }
.status-online { color: #00ff00; text-shadow: 0 0 5px #00ff00; }
.status-offline { color: #ff0000; text-shadow: 0 0 5px #ff0000; }
.blurred { filter: blur(3px); pointer-events: none; opacity: 0.6; }
.container.blurred { filter: blur(5px) grayscale(50%); pointer-events: none; opacity: 0.6; }

#conn-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; display: none; align-items: center; justify-content: center; background: rgba(0,0,0,0.4); z-index: 20000; flex-direction: column; }
#conn-overlay h2 { background: #000; padding: 20px; border: 2px solid red; box-shadow: 0 0 20px red; color: red; text-shadow: 0 0 10px red; }

#chat-wrapper { 
    height: 450px; 
    border: 1px solid var(--text-sec); 
    margin-bottom: 10px; 
    background: #000; 
    position: relative; 
    overflow: hidden; 
}

/* CRT OVERLAY STYLES */
.crt-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    pointer-events: none;
    z-index: 10;
    opacity: 0; /* Hidden by default, fades in via JS class */
    transition: opacity 2s ease-in-out;
}

/* When the wrapper has the idle class, show the CRT effects */
#chat-wrapper.crt-idle-mode .crt-overlay {
    opacity: 1;
}

/* Force monochrome on content when idle */
#chat-wrapper.crt-idle-mode .chat-pane {
    filter: sepia(100%) hue-rotate(50deg) saturate(300%) contrast(1.2);
}

/* 1. Scanlines */
.crt-overlay .scanlines {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(
        to bottom,
        rgba(255,255,255,0),
        rgba(255,255,255,0) 50%,
        rgba(0,0,0,0.4) 50%,
        rgba(0,0,0,0.4)
    );
    background-size: 100% 4px;
    z-index: 12;
}

/* 2. Noise */
.crt-overlay .noise {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    opacity: 0.08;
    z-index: 11;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* 3. Hum Bars */
.hum-bar {
    position: absolute;
    left: 0;
    width: 100%;
    z-index: 13;
    opacity: 0;
}

.hum-bar.light {
    height: 2px;
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 5px var(--text-main);
    animation: scan-move 6s linear infinite;
}

.hum-bar.dark {
    height: 100px;
    background: linear-gradient(to bottom, transparent, rgba(0,0,0,0.3) 50%, transparent);
    animation: scan-move 8s linear infinite;
    animation-delay: 1s;
}

.hum-bar.noisy {
    height: 40px;
    background: linear-gradient(to bottom, transparent, rgba(255,255,255,0.05) 50%, transparent);
    animation: scan-move 11s linear infinite;
    animation-delay: 3s;
}

@keyframes scan-move {
    0% { top: -20%; opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { top: 120%; opacity: 0; }
}

/* Tint Layer (Monochrome wash) */
.crt-tint {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: var(--text-main);
    mix-blend-mode: overlay;
    opacity: 0.2;
    z-index: 14;
}

.chat-pane { width: 100%; height: 100%; overflow-y: scroll; display: none; padding: 10px; box-sizing: border-box; }
.chat-pane.active { display: block; }

.message-line { margin-bottom: 5px; padding: 2px; border-bottom: 1px solid #111; }
.timestamp { color: #555; font-size: 0.8em; margin-right: 5px; }
.timestamp.hidden { display: none; }
.username { font-weight: bold; cursor: pointer; }
.username.admin { color: #ff3333; text-shadow: 0 0 3px red; }
.username.mod { color: #ffff33; text-shadow: 0 0 3px yellow; }
.sys-msg { color: #888; font-style: italic; font-size: 0.9em; border-left: 2px solid #555; padding-left: 5px; }
.msg-content { color: #ddd; word-wrap: break-word; }
.mention { background: #333; color: #fff; padding: 0 2px; border: 1px solid var(--text-alert); }

/* Message Type Specific Sizing */
.msg-type-eng .username, .msg-type-eng .msg-content { font-size: var(--chat-eng-size); }
.msg-type-eth .username, .msg-type-eth .msg-content { font-size: var(--chat-eth-size); }

input, textarea, select { background: #000; border: 1px solid var(--text-main); color: var(--text-main); font-family: var(--font-retro); padding: 5px; width: 100%; box-sizing: border-box; }
input:focus, textarea:focus { outline: none; box-shadow: 0 0 5px var(--text-sec); border-color: var(--text-sec); }
textarea { height: 30px; resize: none; overflow: hidden; line-height: 20px; } 

/* Range Slider Styling for Settings */
input[type=range] {
    -webkit-appearance: none;
    background: transparent;
    margin: 10px 0;
    width: 100%;
}
input[type=range]:focus { outline: none; }
input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 8px;
    cursor: pointer;
    background: #111;
    border: 1px solid var(--text-sec);
    box-shadow: 0 0 2px var(--text-sec);
}
input[type=range]::-webkit-slider-thumb {
    height: 18px;
    width: 12px;
    border: 1px solid #000;
    background: var(--text-main);
    cursor: pointer;
    -webkit-appearance: none;
    margin-top: -6px; /* align with track */
    box-shadow: 0 0 5px var(--text-main);
}
input[type=range]::-moz-range-track {
    width: 100%;
    height: 8px;
    cursor: pointer;
    background: #111;
    border: 1px solid var(--text-sec);
}
input[type=range]::-moz-range-thumb {
    height: 18px;
    width: 12px;
    border: 1px solid #000;
    background: var(--text-main);
    cursor: pointer;
    box-shadow: 0 0 5px var(--text-main);
}

button { background: #000; border: 2px solid var(--text-alert); color: var(--text-alert); font-family: var(--font-retro); padding: 5px 15px; cursor: pointer; text-transform: uppercase; font-weight: bold; margin-top: 5px; }
button:hover { background: var(--text-alert); color: #000; box-shadow: 0 0 10px var(--text-alert); }
button:disabled { border-color: #333; color: #555; cursor: not-allowed; background: #000; box-shadow: none; }

.btn-action { font-size: 0.7em; padding: 2px 5px; margin-left: 3px; border-width: 1px; }
.btn-pending { border-color: yellow; color: yellow; animation: pulse 1s infinite; }
.btn-done { border-color: #444; color: #444; pointer-events: none; }
.btn-mute.muted { text-decoration: line-through; border-color: red; color: red; }
.btn-kick { border-color: #ff6666; color: #ff6666; }
.btn-kick:hover { background: #ff6666; color: #000; }
.btn-kick-pending { border-color: #8b0000; color: #8b0000; animation: pulse 1s infinite; pointer-events: none; }
.btn-kick-success { border-color: #ff00ff; color: #ff00ff; pointer-events: none; }

.mentioned-msg { background: rgba(0, 255, 0, 0.1); border-left: 2px solid var(--text-main); }
.mention-highlight { color: #fff; background: rgba(150, 0, 150, 0.5); padding: 2px 5px; text-shadow: none; font-weight: bold; }

@keyframes pulse { 50% { opacity: 0.5; } }
@keyframes flash-unread { 0% { border-color: var(--text-sec); color: var(--text-main); } 50% { border-color: var(--text-alert); color: var(--text-alert); } 100% { border-color: var(--text-sec); color: var(--text-main); } }

.panels { display: flex; gap: 10px; margin-top: 10px; border-top: 1px solid #333; padding-top: 10px; }
.panel { flex: 1; display: none; }
.panel.active { display: block; }

.avatar-small { object-fit: cover; border: 1px solid #333; margin-right: 5px; vertical-align: middle; }
.message-line .avatar-small { width: var(--chat-avatar-size); height: var(--chat-avatar-size); }
.online-row .avatar-small { width: 40px; height: 40px; }

.emoji-icon {
    max-width: var(--emoji-size);
    max-height: var(--emoji-size);
    width: auto;
    height: auto;
    vertical-align: middle;
}
.grid-selector { display: flex; flex-wrap: wrap; gap: 5px; max-height: 200px; overflow-y: auto; border: 1px solid #333; padding: 5px; }
.grid-item {
    border: 2px solid transparent;
    cursor: pointer;
    padding: 2px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.grid-item:hover { border-color: var(--text-sec); }
.grid-item.selected { border-color: var(--text-main); background: #111; }
.grid-item img {
    max-width: 40px;
    max-height: 40px;
    width: auto;
    height: auto;
    object-fit: contain;
}

.online-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 5px; padding: 3px; border-bottom: 1px dotted #222; }
.user-status { font-size: 0.85em; color: #888; margin-left: 15px; font-style: italic; border-left: 1px solid #333; padding-left: 10px; }
.inviter-info { font-size: 0.8em; color: var(--text-alert); margin-left: 10px; }

table { width: 100%; border-collapse: collapse; margin-top: 10px; }
th, td { border: 1px solid var(--text-sec); padding: 5px; text-align: left; font-size: 0.9em; }
th { color: var(--text-sec); background: #111; }

.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.95); display: none; align-items: center; justify-content: center; z-index: 9000; }
.modal-box { background: #000; border: 2px solid var(--text-alert); box-shadow: 0 0 30px var(--text-alert); padding: 20px; width: 400px; text-align: center; color: var(--text-main); }
.modal-box.modal-mod { border-color: #ffaa00; box-shadow: 0 0 30px #ffaa00; color: #ffaa00; }
.modal-box.modal-mod h3 { color: #ffaa00; text-shadow: 0 0 10px #ffaa00; }
.modal-box.modal-mod button { border-color: #ffaa00; color: #ffaa00; }
.modal-box.modal-mod button:hover { background: #ffaa00; color: #000; }
.modal-box.modal-admin { border-color: #ff0000; box-shadow: 0 0 30px #ff0000; color: #ff0000; }
.modal-box.modal-admin h3 { color: #ff0000; text-shadow: 0 0 10px #ff0000; }
.modal-box.modal-admin button { border-color: #ff0000; color: #ff0000; }
.modal-box.modal-admin button:hover { background: #ff0000; color: #000; }

.hidden { display: none !important; }
.error-input { border-color: var(--error-color) !important; box-shadow: 0 0 5px var(--error-color) !important; }
.pass-msg { display: block; height: 20px; font-size: 0.9em; color: var(--error-color); margin-top: 2px; }

/* Syntax Highlighting */
.hl-caps { color: #ff79c6; font-weight: bold; } /* Pink */
.hl-num { color: #bd93f9; } /* Purple */
.hl-sep { color: #6272a4; font-weight: bold; } /* Grey/Blue */
.hl-str { color: #f1fa8c; } /* Yellowish */
.hl-brack { color: #50fa7b; } /* Green */
.hl-list { color: #8be9fd; font-weight: bold; } /* Cyan */
.hl-quote { color: #f1fa8c; } /* Yellow string/quote */

#tab-row {
    display: flex;
    overflow-x: auto;
    border-bottom: 1px solid var(--text-sec);
    margin-bottom: 5px;
    padding-bottom: 2px;
}
#tab-row::-webkit-scrollbar { height: 4px; }
#tab-row::-webkit-scrollbar-thumb { background: var(--text-sec); }
.tab-item {
    padding: 5px 10px;
    margin-right: 5px;
    border: 1px solid #333;
    border-bottom: none;
    cursor: pointer;
    white-space: nowrap;
    position: relative;
    color: #888;
}
.tab-item:hover { color: var(--text-sec); background: #111; }
.tab-item.active {
    border-color: var(--text-sec);
    color: var(--text-main);
    background: #000;
    font-weight: bold;
    border-bottom: 2px solid #000;
    margin-bottom: -3px; 
}
.tab-item.private-tab { border-color: #aaa; color: #ccc; }
.tab-item.private-tab.active { border-color: #fff; color: #fff; }
.tab-item.has-unread { 
    color: var(--text-alert); 
    border-color: var(--text-alert);
    animation: flash-unread 2s infinite;
}
.tab-item.has-unread::after { content: "!"; color: var(--text-alert); font-weight: bold; margin-left: 2px; }

/* Ethiopic Channel Tab Specific Styling */
.ethiopic-tab-marker {
    display: inline-block;
    color: #e0a000;
    font-weight: bold;
    margin-right: 2px;
    font-size: 1.1em;
    vertical-align: middle;
}
.ethiopic-channel-tab.tab-item {
    border-color: #e0a000; /* Amberish color for Ethiopic channels */
    color: #cc9900;
}
.ethiopic-channel-tab.tab-item:hover {
    color: #ffcc00;
}
.ethiopic-channel-tab.tab-item.active {
    border-color: #ffcc00;
    color: #ffcc00;
}
.ethiopic-topic-item, .ethiopic-topic-row {
    border-left: 3px solid #e0a000; /* Amberish border */
}

.tab-close { margin-left: 5px; font-size: 0.8em; color: #555; }
.tab-close:hover { color: red; }
.tab-add { font-size: 1.2em; font-weight: bold; cursor: pointer; padding: 2px 8px; border: 1px dashed #555; display: flex; align-items: center; }
.tab-add:hover { border-color: var(--text-sec); color: var(--text-sec); }

.pin-overlay {
    position: absolute;
    top: 5px;
    left: 5px;
    right: 25px; /* Leave space for scrollbar */
    background: #111;
    border: 1px dashed var(--text-alert);
    color: var(--text-alert);
    padding: 8px;
    font-size: 0.9em;
    z-index: 100;
    box-shadow: 0 0 10px #000;
    display: none;
    align-items: center;
    justify-content: space-between;
}
.pin-content { margin-right: 10px; font-weight: bold; font-style: italic; }
.pin-close {
    background: transparent;
    border: 1px solid var(--text-alert);
    color: var(--text-alert);
    cursor: pointer;
    font-size: 0.8em;
    padding: 0 5px;
    margin: 0;
}
.pin-close:hover { background: var(--text-alert); color: #000; }

/* Quote & Code Features */
.quote-box {
    border-left: 3px solid var(--text-sec);
    background: #111;
    padding: 5px 10px;
    margin: 5px 0;
    font-size: 0.9em;
}
.quote-author {
    font-weight: bold;
    color: var(--text-sec);
    display: block;
    margin-bottom: 2px;
}
.quote-content {
    font-style: italic;
    color: #aaa;
}
.quote-content::before { content: "“"; color: var(--text-sec); font-size: 1.2em; vertical-align: -2px; margin-right: 2px; }
.quote-content::after { content: "”"; color: var(--text-sec); font-size: 1.2em; vertical-align: -2px; margin-left: 2px; }

.quote-response {
    margin-top: 5px;
    color: var(--text-main);
    font-style: normal;
}
.code-block {
    background: #222;
    color: #fff;
    font-family: monospace;
    padding: 5px;
    border: 1px solid #555;
    overflow-x: auto;
    white-space: pre;
    margin: 5px 0;
    font-size: 0.9em;
}
.badge-count {
    background: #ff3333;
    color: white;
    font-size: 0.7em;
    font-weight: bold;
    padding: 1px 5px;
    border-radius: 4px;
    margin-left: 5px;
    vertical-align: middle;
    text-shadow: none;
}

/* Home Panel Layout */
.home-layout {
    display: grid;
    grid-template-columns: 7fr 3fr; /* 70% Online Users, 30% Active Topics */
    gap: 15px;
    height: 100%;
}
.home-col {
    border: 1px solid #333;
    padding: 10px;
    overflow-y: auto;
    max-height: 400px;
}
.topic-list-simple {
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.topic-item-simple {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px;
    border-bottom: 1px dotted #333;
}
.pages-grid {
    display: flex;
    flex-direction: column; /* Pages now take full width */
    gap: 10px;
}
.page-item {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid var(--text-sec);
    padding: 10px;
    cursor: pointer;
    background: #090909;
    transition: all 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.page-item:hover {
    background: #111;
    box-shadow: 0 0 5px var(--text-sec);
}
.page-title { 
    font-weight: bold; 
    display: block; 
    text-align: left;
    padding-left: 10px;
}
.page-role-tag { font-size: 0.7em; color: #888; margin-left: 10px; }

#char-counter {
    font-size: 0.8em;
    color: #555;
    text-align: right;
    margin-bottom: 2px;
}

/* SCREENSAVER */
#ss-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #000;
    z-index: 9999;
    display: none;
    cursor: pointer;
}

#main-header h1 {
    display: flex;
    align-items: center;
    gap: 15px;
}
#header-date-box {
    font-size: 0.5em;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: left;
    line-height: 1.2em;
    color: #888;
    text-shadow: none !important; /* Fix for glow */
}
#header-date-box span.eth-date {
    color: var(--text-alert);
}

/* LOGO STYLING */
#header-logo {
    max-height: 60px;
    width: auto;
    border: none; /* Removed border */
    padding: 0;   /* Removed padding */
    background: transparent; /* Transparent background */
    margin-left: auto;
    vertical-align: middle;
}

/* Geochron Container Styling - Updated: No border, 100% width */
#map-container {
    width: 100%;
    height: auto;
    position: relative;
    border: none;
    margin-left: 0;
    overflow: hidden;
    padding: 0;
    margin-bottom: 10px;
}

.geez-controls {
    display: none;
}

/* Ethiopic Styling */
#geez-input {
    font-size: var(--ethiopic-input-font-size);
    font-family: var(--ethiopic-font-family);
}
/* Placeholder fix for Ge'ez input to use standard retro font */
#geez-input::placeholder {
    font-family: var(--font-retro);
    font-size: var(--font-size);
    opacity: 0.7;
}
.eth-msg-content {
    font-size: var(--ethiopic-chat-font-size);
    font-family: var(--ethiopic-font-family);
    line-height: 1.4;
}

/* Ethiopic Virtual Keyboard */
.keyboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(30px, 1fr));
    gap: 2px;
    max-height: 200px;
    overflow-y: auto;
    background: #111;
    border: 1px solid #333;
    margin: 5px 0;
    padding: 5px;
}

.key-btn {
    background: #222;
    border: 1px solid #444;
    color: #fff;
    cursor: pointer;
    padding: 5px;
    font-size: 1.2em;
    text-align: center;
    font-family: var(--ethiopic-font-family);
}

.key-btn:hover {
    background: var(--text-sec);
    color: #000;
}

/* Custom Radio Buttons (Terminal Style) */
.radio-container {
    display: flex;
    gap: 20px;
    margin-bottom: 10px;
}

.custom-radio {
    display: inline-block;
    position: relative;
    padding-left: 25px;
    margin-right: 15px;
    cursor: pointer;
    user-select: none;
    color: var(--text-main);
}

.custom-radio input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: absolute;
    top: 0;
    left: 0;
    height: 16px;
    width: 16px;
    background-color: #000;
    border: 1px solid var(--text-main);
    border-radius: 50%;
}

.custom-radio:hover input ~ .checkmark {
    background-color: #111;
    box-shadow: 0 0 5px var(--text-sec);
}

.custom-radio input:checked ~ .checkmark {
    background-color: var(--text-main);
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.custom-radio input:checked ~ .checkmark:after {
    display: block;
}

.custom-radio .checkmark:after {
    top: 4px;
    left: 4px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #000;
}

/* --- CALENDAR STYLING --- */
.calendar-grid-view {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 20px;
}

.rc-month-box {
    color: #888;
    padding: 10px;
    border-radius: 4px;
    text-align: center;
    border: 1px solid #333;
    background-color: #080808;
}

.rc-month-box h2 {
    color: var(--text-sec);
    text-align: center;
    margin: 5px 0 10px 0;
    font-size: 1.2em;
    text-shadow: none;
}

.rc-month-box table {
    width: 100%;
    border-collapse: collapse;
}

.rc-month-box th {
    font-size: 0.9em;
    padding-bottom: 5px;
    color: var(--text-main);
    border-bottom: 1px solid #333;
}

.rc-month-box td {
    padding: 2px;
    vertical-align: top;
    height: 40px;
    border: 1px solid #222;
}

.rc-month-box .number {
    display: inline-block;
    width: 1.2em;
    text-align: right;
    color: #ccc;
    font-weight: bold;
}
.rc-month-box sup, .rc-month-box sub {
    color: #555;
    font-size: 0.7em;
}

/* Event Dots */
.event-dots { display: flex; justify-content: center; gap: 2px; margin-top: 2px; height: 5px; }
.dot { width: 5px; height: 5px; border-radius: 50%; display: inline-block; }
.dot.holiday-dot { background-color: var(--text-sec); box-shadow: 0 0 2px var(--text-sec); }
.dot.fasting-dot { background-color: var(--text-main); box-shadow: 0 0 2px var(--text-main); }
.dot.optional-dot { background-color: var(--text-alert); box-shadow: 0 0 2px var(--text-alert); }

/* Current Day */
.current-day-highlight {
    border: 1px solid var(--text-alert) !important;
    box-shadow: inset 0 0 5px var(--text-alert);
}

/* List */
.holiday-list {
    list-style: none;
    padding: 5px;
    margin: 5px 0 0 0;
    text-align: left;
    font-size: 0.75em;
    border-top: 1px solid #333;
}
.holiday-list li { margin-bottom: 2px; }
.holiday-list li.type-religious { color: var(--text-sec); }
.holiday-list li.type-fast { color: var(--text-main); }
.holiday-list li.type-civic { color: var(--text-alert); }

/* Mini Calendar Specifics */
#mini-calendar-container .rc-month-box {
    border: none;
    background: transparent;
    padding: 0;
}
#mini-calendar-container .calendar-grid-view {
    display: block; /* Single column */
}
#mini-calendar-container h2 { font-size: 1em; }
#mini-calendar-container td { height: 30px; font-size: 0.9em; }

/* Calendar Toggle Styling */
.cal-toggles input[type="checkbox"] {
    appearance: none;
    background-color: transparent;
    margin-right: 5px;
    width: 1em; height: 1em;
    border: 1px solid currentColor;
    display: inline-grid;
    place-content: center;
    vertical-align: middle;
}
.cal-toggles input[type="checkbox"]::before {
    content: "";
    width: 0.5em; height: 0.5em;
    transform: scale(0);
    transition: 100ms transform ease-in-out;
    box-shadow: inset 1em 1em currentColor;
    clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
}
.cal-toggles input[type="checkbox"]:checked::before { transform: scale(1); }

/* Input Number Spinners Theme */
input[type=number]::-webkit-inner-spin-button, 
input[type=number]::-webkit-outer-spin-button { 
    opacity: 1;
    filter: invert(1);
    cursor: pointer;
}

/* Scrollbar Theme */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #000; }
::-webkit-scrollbar-thumb { background: var(--text-sec); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-main); }

/* Geochron Map Markers (Moved from JS) */
.moon-marker { 
    position: absolute; 
    width: 10px; 
    height: 10px; 
    transform-origin: center center; 
    pointer-events: none; 
    z-index: 25; /* Z-INDEX FIX: Moon (25) is now higher than Sun (20) */
    filter: drop-shadow(0px 0px 2px rgba(0,0,0,0.8)); 
    transition: left 0.5s, top 0.5s, transform 0.5s; 
}
.sun-marker { 
    position: absolute;
    width: 12px;
    height: 12px;
    background: radial-gradient(circle, #ffff00 0%, rgba(255,165,0,0.8) 60%, transparent 100%);
    border-radius: 50%;
    z-index: 20;
    box-shadow: 0 0 10px #ffaa00;
    pointer-events: none;
    transition: left 0.5s, top 0.5s;
}
.city-marker {
    position: absolute;
    width: 4px;
    height: 4px;
    background: #00ff00;
    border-radius: 50%;
    z-index: 10;
    pointer-events: none;
}
.city-label {
    position: absolute;
    color: var(--text-main); /* Changed to use theme var */
    font-family: monospace;
    font-size: 9px;
    margin-left: 5px;
    margin-top: -5px;
    z-index: 10;
    text-shadow: 0 0 2px #000;
    pointer-events: none;
}

/* --- LINKS MENU STYLING --- */
.links-menu {
    position: absolute;
    bottom: 100%; /* Expands upwards from the button row */
    left: 0;
    background-color: #000;
    border: 1px solid var(--text-sec);
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.9);
    padding: 5px 0;
    min-width: 150px;
    z-index: 2000; /* Above chat artifacts, below modals */
    display: none;
    margin-bottom: 5px;
}

.links-item {
    display: block;
    padding: 8px 15px;
    color: var(--text-main);
    text-decoration: none;
    font-size: 0.9em;
    border-bottom: 1px dotted #333;
    transition: background 0.2s, color 0.2s;
}

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

.links-item:hover {
    background-color: #111;
    color: var(--text-sec);
    text-shadow: 0 0 5px var(--text-sec);
    text-decoration: none;
}

/* --- DANGER SECTION (DELETE ACCOUNT) --- */
.danger-section {
    margin-top: 25px;
    padding-top: 15px;
    border-top: 1px dashed #333;
    text-align: center;
}

#btn-delete-self {
    border-color: #ff3333;
    color: #ff3333;
    width: 100%;
    margin-top: 10px;
    background: transparent;
    transition: all 0.2s ease;
}

#btn-delete-self:hover {
    background: #ff3333;
    color: #000;
    box-shadow: 0 0 10px #ff3333;
}

/* --- MOBILE RESPONSIVENESS --- */
@media (max-width: 768px) {
    body {
        padding: 5px;
    }
    .container {
        padding: 5px;
        margin: 0;
        width: auto;
        box-shadow: none; /* Remove heavy shadow on mobile */
        border-width: 1px;
    }
    #main-header h1 {
        font-size: 1.2em;
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    #header-date-box {
        font-size: 0.8em;
    }
    #header-logo {
        height: 60px;
        margin-left: 0;
        margin-top: 0px;
    }
    .home-layout {
        grid-template-columns: 1fr; /* Stack columns */
        gap: 10px;
    }
    .home-col {
        max-height: 250px;
    }
    .panels {
        flex-direction: column;
    }
    /* Hide non-essential buttons in chat input row on very small screens */
    #msg-form button[type="button"] {
        padding: 5px 8px;
        font-size: 0.7em;
    }
    /* Stack settings grid */
    #font-settings-container > div:first-child {
        grid-template-columns: 1fr 1fr;
    }
    /* Calendar Modal Fullscreen */
    .modal-box {
        width: 95%;
    }
    .calendar-grid-view {
        grid-template-columns: 1fr;
    }
    
    /* Login Box */
    .login-box {
        width: 90%;
        margin: 20px auto;
    }
}