/* araray.org — dark theme */
:root {
    --bg: #000;
    --surface: rgba(10, 10, 10, 0.92);
    --surface-hover: rgba(20, 20, 20, 0.95);
    --border: #1a1a1a;
    --text: #e0e0e0;
    --text-muted: #777;
    --accent: #0f0;
    --accent-dim: #0a0;
    --danger: #f44;
    --link: #4cf;
}

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

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Courier New', Courier, monospace;
    min-height: 100vh;
    line-height: 1.6;
}

#gameOfLifeCanvas {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: -1;
    background: var(--bg);
}

.content-wrapper {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    padding-bottom: 60px;
}

.container { width: 100%; max-width: 700px; }

.card, .poem-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 30px;
    margin-bottom: 20px;
    backdrop-filter: blur(4px);
}

.poem-card p { margin-bottom: 12px; font-size: 0.95rem; }
.poem-title { font-family: 'Playfair Display', serif; font-size: 1.3rem; margin-bottom: 20px !important; }
.poem-author { font-size: 0.85rem; color: var(--text-muted); }
.poem-links { margin-top: 20px !important; }
.poem-links a { color: var(--link); text-decoration: none; font-size: 0.85rem; }
.poem-links a:hover { text-decoration: underline; }

h1 { font-size: 1.4rem; margin-bottom: 15px; color: var(--accent); }
h2 { font-size: 1.2rem; margin-bottom: 10px; }
h3 { font-size: 1rem; margin-bottom: 8px; }
p { margin-bottom: 10px; }
a { color: var(--link); }
code { background: rgba(255,255,255,0.05); padding: 2px 6px; border-radius: 3px; font-size: 0.85rem; }
.muted { color: var(--text-muted); font-size: 0.85rem; }
.warning { color: #fa0; font-weight: bold; }

/* Buttons */
.btn {
    display: inline-block;
    padding: 8px 16px;
    border: 1px solid var(--border);
    border-radius: 3px;
    background: var(--surface);
    color: var(--text);
    font-family: inherit;
    font-size: 0.85rem;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s;
}
.btn:hover { background: var(--surface-hover); }
.btn-primary { background: var(--accent-dim); color: #000; border-color: var(--accent); font-weight: bold; }
.btn-primary:hover { background: var(--accent); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-outline { background: transparent; border-color: var(--text-muted); }
.btn-danger { background: #400; border-color: var(--danger); color: var(--danger); }
.btn-danger:hover { background: #600; }
.btn-small { padding: 4px 10px; font-size: 0.8rem; }
.btn-full { width: 100%; text-align: center; }

/* Inputs */
.chat-input {
    width: 100%;
    padding: 10px 12px;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border);
    border-radius: 3px;
    color: var(--text);
    font-family: inherit;
    font-size: 0.9rem;
    margin-bottom: 8px;
}
.chat-input:focus { outline: none; border-color: var(--accent-dim); }
textarea.chat-input { resize: vertical; min-height: 60px; }
select.chat-input { cursor: pointer; }

label { display: block; margin-bottom: 4px; font-size: 0.85rem; color: var(--text-muted); }
.checkbox-label { display: flex; align-items: center; gap: 8px; cursor: pointer; margin: 8px 0; }
.checkbox-label input { cursor: pointer; }

/* Footer */
.site-footer {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    z-index: 10;
    background: rgba(0,0,0,0.85);
    padding: 8px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid var(--border);
    backdrop-filter: blur(4px);
}
.footer-center {
    display: flex;
    align-items: center;
    gap: 20px;
    flex: 1;
    justify-content: center;
}
.footer-link { color: var(--accent); text-decoration: none; font-size: 0.85rem; }
.footer-link:hover { text-decoration: underline; }
.footer-text { color: var(--text-muted); font-size: 0.85rem; }
.footer-door { font-size: 1.2rem; text-decoration: none; flex-shrink: 0; }

/* Chat */
.chat-container {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 4px;
    width: 100%;
    max-width: 700px;
    display: flex;
    flex-direction: column;
    height: 70vh;
}
.chat-header {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.chat-header h2 { font-size: 1rem; color: var(--accent); margin: 0; }
.chat-actions { display: flex; gap: 8px; }
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.chat-input-bar {
    padding: 12px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 8px;
}
.chat-input-bar .chat-input { margin-bottom: 0; flex: 1; }
.sender-input { max-width: 150px; }

.message-bubble {
    padding: 8px 12px;
    background: rgba(255,255,255,0.03);
    border-radius: 4px;
    border-left: 2px solid var(--border);
}
.message-bubble.admin-reply {
    border-left-color: var(--accent);
    background: rgba(0,255,0,0.03);
}
.message-meta { display: flex; gap: 10px; align-items: baseline; margin-bottom: 4px; }
.message-meta strong { color: var(--accent); font-size: 0.85rem; }
.message-time { color: var(--text-muted); font-size: 0.75rem; }
.message-content { font-size: 0.9rem; word-wrap: break-word; }

.anon-bar { padding: 8px 12px; border-bottom: 1px solid var(--border); display: flex; gap: 8px; }
.anon-bar .chat-input { margin-bottom: 0; max-width: 200px; }
.login-panel { padding: 12px; border-bottom: 1px solid var(--border); display: flex; gap: 8px; flex-wrap: wrap; }
.login-panel .chat-input { flex: 1; min-width: 150px; margin-bottom: 0; }

.alt-link { margin-top: 20px; text-align: center; }
.alt-link p { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 8px; }

/* Room chat */
.room-chat-container {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 4px;
    width: 100%;
    max-width: 700px;
    display: flex;
    flex-direction: column;
    height: 70vh;
}

/* Room list */
.room-list { display: flex; flex-direction: column; gap: 8px; margin: 15px 0; }
.room-link {
    padding: 12px 14px;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border);
    border-radius: 3px;
    text-decoration: none;
    color: var(--text);
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}
.room-link:hover { background: rgba(255,255,255,0.06); }
.room-name { font-weight: bold; }
.room-badges { display: flex; gap: 6px; }
.room-desc { width: 100%; font-size: 0.8rem; color: var(--text-muted); margin-top: 4px; }

.qr-img { max-width: 200px; margin: 15px 0; }

/* Admin */
.admin-body { background: #0a0a0a; }
.admin-nav {
    background: rgba(0,0,0,0.9);
    border-bottom: 1px solid var(--border);
    padding: 10px 20px;
    display: flex;
    gap: 15px;
    position: sticky;
    top: 0;
    z-index: 100;
}
.nav-link { color: var(--text-muted); text-decoration: none; font-size: 0.85rem; padding: 4px 8px; border-radius: 3px; }
.nav-link:hover, .nav-link.active { color: var(--accent); }
.nav-right { margin-left: auto; }
.admin-container { max-width: 1000px; margin: 20px auto; padding: 0 20px; }

.login-container {
    max-width: 350px;
    margin: 20vh auto;
    padding: 30px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 4px;
}
.login-container h1 { text-align: center; }
.login-container form { display: flex; flex-direction: column; gap: 4px; }

.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 30px; }
.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 16px;
    text-align: center;
}
.stat-value { display: block; font-size: 2rem; color: var(--accent); font-weight: bold; }
.stat-label { font-size: 0.8rem; color: var(--text-muted); }

.section { margin-bottom: 30px; }
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }

.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th, .admin-table td { padding: 8px 12px; text-align: left; border-bottom: 1px solid var(--border); font-size: 0.85rem; }
.admin-table th { color: var(--text-muted); font-weight: normal; }
.admin-table .actions { display: flex; gap: 6px; }

.badge { padding: 2px 8px; border-radius: 3px; font-size: 0.75rem; }
.badge-chat { background: #003; color: #48f; }
.badge-contact { background: #030; color: #4f4; }
.badge-listed { background: #003; color: #48f; }
.badge-hidden { background: #330; color: #ff4; }
.badge-active { background: #030; color: #4f4; }
.badge-inactive { background: #300; color: #f44; }

.inline-form { display: flex; gap: 8px; margin-bottom: 20px; }
.inline-form .chat-input { flex: 1; margin-bottom: 0; }

.form-actions { display: flex; gap: 8px; margin-top: 15px; }

.token-display {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(0,255,0,0.05);
    border: 1px solid var(--accent-dim);
    border-radius: 4px;
    padding: 12px;
    margin: 15px 0;
    word-break: break-all;
}
.token-display code { font-size: 0.9rem; color: var(--accent); }

.messages-thread { margin: 20px 0; display: flex; flex-direction: column; gap: 8px; max-height: 50vh; overflow-y: auto; }
.reply-section { margin-top: 20px; border-top: 1px solid var(--border); padding-top: 15px; }

.room-join-form { display: flex; flex-direction: column; gap: 8px; margin-top: 15px; }

@media (max-width: 600px) {
    .content-wrapper { padding: 10px; }
    .card, .poem-card { padding: 16px; }
    .admin-table { font-size: 0.75rem; }
    .admin-table th, .admin-table td { padding: 4px 6px; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
