/* =========================================================
   STARDUST // COMMS SITE
   ========================================================= */

[hidden] { display: none !important; }

* { box-sizing: border-box; }

html, body { height: 100%; margin: 0; }

body {
    font-family: monospace;
    color: rgb(57,255,106);
    background: #02100a;
    overflow: hidden;
}

/* Scanlines removed */
.scan { display: none; }

.shell {
    position: relative; z-index: 1;
    height: 100%; display: flex; align-items: center; justify-content: center;
    padding: 24px;
}

/* ---------- Glass (now solid) ---------- */

.glass {
    position: relative;
    border-radius: 18px; overflow: hidden;
    background: rgba(2,10,6,.92);
    border: 1px solid rgba(57,255,106,.4);
    box-shadow: 0 10px 40px rgba(0,0,0,.45), 0 0 28px rgba(57,255,106,.18);
}

/* ---------- Sign in ---------- */

.auth-card {
    width: min(380px, 100%);
    padding: 28px 26px;
}
.sub {
    margin: 6px 0 18px; font-size: 10px; letter-spacing: .14em; opacity: .6;
}
#auth-form { display: flex; flex-direction: column; gap: 10px; }
.field {
    padding: 11px 12px; border-radius: 10px;
    background: rgba(0,0,0,.35); border: 1px solid rgba(57,255,106,.25); outline: none;
    color: rgb(57,255,106); font-family: monospace; font-size: 13px;
}
.field:focus { border-color: rgba(57,255,106,.7); box-shadow: 0 0 12px rgba(57,255,106,.15); }
.error { min-height: 16px; font-size: 11px; color: #ff6b6b; letter-spacing: .04em; }

.btn {
    padding: 10px 12px; border-radius: 10px; cursor: pointer;
    border: 1px solid rgba(57,255,106,.4); background: rgba(57,255,106,.06);
    color: rgb(57,255,106); font-family: monospace; font-size: 11px; font-weight: bold;
    letter-spacing: .1em;
}
.btn:hover { background: rgba(57,255,106,.14); box-shadow: 0 0 12px rgba(57,255,106,.2); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: rgba(57,255,106,.14); }
.btn.link { border-color: transparent; background: transparent; font-size: 10px; opacity: .7; }
.btn.small { min-width: 64px; align-self: stretch; }

/* ---------- Chat panel ---------- */

.panel {
    width: min(820px, 100%);
    height: min(860px, 100%);
    display: flex; flex-direction: column;
}

.header {
    position: relative; display: flex; align-items: center; gap: 10px;
    padding: 14px 14px;
    border-bottom: 1px solid rgba(57,255,106,.22);
    background: rgba(57,255,106,.035);
}
.header-text { flex: 1; min-width: 0; }
.title { font-size: 12px; font-weight: bold; letter-spacing: .12em; }
.status {
    margin-top: 3px; font-size: 9px; letter-spacing: .1em; opacity: .55;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.icon-btn {
    width: 34px; height: 34px; border-radius: 8px; cursor: pointer;
    border: 1px solid rgba(57,255,106,.3); background: rgba(57,255,106,.04);
    color: rgb(57,255,106); font-family: monospace; font-size: 18px; line-height: 1;
}
.icon-btn:hover { border-color: rgba(57,255,106,.7); background: rgba(57,255,106,.12); }

/* ---------- Menu ---------- */

.menu {
    position: absolute; top: 58px; right: 12px; z-index: 5; min-width: 230px; padding: 8px;
    border-radius: 12px; background: rgba(2,10,6,.96);
    border: 1px solid rgba(57,255,106,.45); box-shadow: 0 0 22px rgba(57,255,106,.2);
}
.menu-title { padding: 6px 8px 4px; font-size: 9px; letter-spacing: .12em; opacity: .55; }
.menu button {
    display: block; width: 100%; margin: 2px 0; padding: 8px 9px; text-align: left;
    border-radius: 6px; border: 1px solid transparent; background: transparent;
    color: rgb(57,255,106); font-family: monospace; font-size: 11px; letter-spacing: .05em;
    cursor: pointer;
}
.menu button:hover { border-color: rgba(57,255,106,.35); background: rgba(57,255,106,.06); }
.menu button.active { border-color: rgba(57,255,106,.7); background: rgba(57,255,106,.14); }

/* ---------- Messages ---------- */

.output { flex: 1; min-height: 0; overflow-y: auto; padding: 14px; scrollbar-width: thin; }

.empty { margin-top: 35%; text-align: center; font-size: 11px; letter-spacing: .12em; opacity: .4; }

.message {
    margin-bottom: 11px; padding: 9px 11px; border-radius: 10px; text-align: left;
    border-left: 2px solid rgba(57,255,106,.55);
    background: rgba(57,255,106,.04);
}
.message.self { border-left-color: rgba(130,180,255,.8); background: rgba(130,180,255,.05); }
.message.announce {
    border-left: 3px solid rgb(57,255,106);
    background: rgba(57,255,106,.1);
    box-shadow: 0 0 16px rgba(57,255,106,.18);
}
.message.announce .text { font-weight: bold; }

.meta {
    display: flex; justify-content: space-between; gap: 10px; margin-bottom: 5px;
    font-size: 10px; letter-spacing: .06em; opacity: .65;
}

.text {
    display: block; margin: 0; padding: 0;
    font-family: monospace; font-size: 13px; line-height: 1.5;
    color: #d7ffe2; white-space: pre-wrap; word-break: break-word; tab-size: 4;
}

.image {
    display: block; max-width: 100%; max-height: 300px; margin-top: 6px; border-radius: 8px;
    border: 1px solid rgba(57,255,106,.25); object-fit: contain; cursor: zoom-in;
}
.image:hover { border-color: rgba(57,255,106,.7); box-shadow: 0 0 12px rgba(57,255,106,.2); }

.seen { margin-top: 6px; text-align: right; font-size: 9px; letter-spacing: .08em; color: rgb(130,180,255); opacity: .7; }

/* ---------- Redaction (solid, no stripes) ---------- */

.redact {
    background: #000; color: #000; border-radius: 3px; padding: 0 2px;
    user-select: none; -webkit-user-select: none;
}
.redact-first { background: transparent; color: #d7ffe2; }

/* Glitched text is kept, but its background stripes are removed */
.glitch-wrap {
    color: rgb(57,255,106); padding: 0;
    background: none;
}

.glitch {
    position: relative; display: inline-block; color: rgb(57,255,106);
    text-shadow: 1px 0 rgba(255,0,64,.8), -1px 0 rgba(0,229,255,.8);
    animation: glitch-jitter 1.2s steps(8) infinite, glitch-flicker 2.7s steps(1) infinite;
}
.glitch::before, .glitch::after {
    content: attr(data-text); position: absolute; left: 0; top: 0; width: 100%; height: 100%;
    pointer-events: none; background: transparent;
}
.glitch::before {
    color: rgba(255,0,64,.9);
    animation: glitch-slice-a var(--gd, 1.4s) steps(1) infinite;
}
.glitch::after {
    color: rgba(0,229,255,.9);
    animation: glitch-slice-b calc(var(--gd, 1.4s) * 1.3) steps(1) infinite;
}

@keyframes glitch-jitter {
    0%, 100% { transform: translate(0, 0); }
    20% { transform: translate(-1px, 0) skewX(-6deg); }
    40% { transform: translate(1px, 0); }
    60% { transform: translate(0, -1px) skewX(4deg); }
    80% { transform: translate(1px, 1px); }
}
@keyframes glitch-flicker {
    0%, 88%, 100% { opacity: 1; }
    90% { opacity: .35; }
    93% { opacity: 1; }
    96% { opacity: .6; }
}
@keyframes glitch-slice-a {
    0%   { transform: translateX(0);    clip-path: inset(10% 0 60% 0); }
    18%  { transform: translateX(-4px); clip-path: inset(35% 0 40% 0); }
    36%  { transform: translateX(3px);  clip-path: inset(70% 0 5% 0); }
    54%  { transform: translateX(0);    clip-path: inset(5% 0 80% 0); }
    72%  { transform: translateX(5px);  clip-path: inset(50% 0 25% 0); }
    90%  { transform: translateX(-2px); clip-path: inset(20% 0 55% 0); }
}
@keyframes glitch-slice-b {
    0%   { transform: translateX(2px);  clip-path: inset(55% 0 5% 0); }
    25%  { transform: translateX(-5px); clip-path: inset(80% 0 2% 0); }
    50%  { transform: translateX(0);    clip-path: inset(15% 0 70% 0); }
    75%  { transform: translateX(4px);  clip-path: inset(40% 0 45% 0); }
}

/* ---------- Typing and input ---------- */

.help {
    padding: 6px 14px 0; font-size: 9px; letter-spacing: .06em; text-align: right; opacity: .35;
}
.typing { min-height: 16px; padding: 4px 14px 0; font-size: 10px; letter-spacing: .08em; font-style: italic; opacity: .75; }
.typing:empty { min-height: 0; padding: 0; }

.input-area {
    display: flex; gap: 8px; padding: 12px 14px 14px;
    border-top: 1px solid rgba(57,255,106,.22); background: rgba(57,255,106,.03);
}
.input {
    flex: 1; min-height: 44px; max-height: 140px; resize: none; padding: 10px;
    border-radius: 10px; outline: none;
    background: rgba(0,0,0,.35); border: 1px solid rgba(57,255,106,.25);
    color: rgb(57,255,106); font-family: monospace; font-size: 13px; tab-size: 4;
}
.input:focus { border-color: rgba(57,255,106,.65); box-shadow: 0 0 12px rgba(57,255,106,.1); }

/* ---------- Lightbox (solid) ---------- */

.lightbox {
    position: fixed; inset: 0; z-index: 100;
    display: flex; align-items: center; justify-content: center;
    background: rgba(0,0,0,.92);
    cursor: zoom-out;
}
.lightbox img {
    max-width: 94vw; max-height: 88vh; object-fit: contain; border-radius: 10px;
    border: 1px solid rgba(57,255,106,.6);
    box-shadow: 0 0 30px rgba(57,255,106,.25);
    cursor: default;
}
.lightbox-close {
    position: absolute; top: 14px; right: 14px; width: 34px; height: 34px; border-radius: 8px;
    border: 1px solid rgba(57,255,106,.4); background: rgba(2,10,6,.9);
    color: rgb(57,255,106); font-family: monospace; font-size: 20px; line-height: 1; cursor: pointer;
}

/* ---------- Phones and small screens: full-screen, no rounded frame ---------- */

@media (max-width: 700px) {
    .shell { padding: 0; }
    .panel { width: 100%; height: 100%; border-radius: 0; border: none; }
    .auth-card { border-radius: 18px; }
    .help { display: none; }
    .menu { right: 8px; left: 8px; min-width: 0; }
    .input { font-size: 16px; }   /* stops iOS from zooming the page on focus */
}
