:root {
    color-scheme: dark;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #090d18;
    color: #f7f9ff;
}

* {
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    margin: 0;
    display: grid;
    place-items: center;
    padding: 24px;
    background: radial-gradient(circle at top, #172448 0, #090d18 48%);
}

button,
input {
    font: inherit;
}

.chatShell {
    width: min(760px, 100%);
    min-height: 620px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #29365b;
    border-radius: 18px;
    background: rgba(14, 20, 37, 0.96);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.4);
}

.chatHeader,
.roomBar,
.messageForm {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.chatHeader {
    padding: 24px 28px;
    border-bottom: 1px solid #263250;
}

.eyebrow {
    margin: 0 0 4px;
    color: #7ca2ff;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.14em;
}

h1 {
    margin: 0;
    font-size: 26px;
}

.connectionStatus {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #aeb8d0;
    font-size: 14px;
}

.statusDot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #df6a75;
}

.connectionStatus[data-status="online"] .statusDot {
    background: #56d48d;
    box-shadow: 0 0 0 4px rgba(86, 212, 141, 0.12);
}

.joinPanel {
    width: min(430px, calc(100% - 48px));
    margin: auto;
    padding: 28px;
    border: 1px solid #29365b;
    border-radius: 14px;
    background: #11192d;
}

.joinPanel label {
    display: grid;
    gap: 8px;
    margin-bottom: 18px;
    color: #c6cee0;
    font-size: 14px;
}

input {
    width: 100%;
    border: 1px solid #354469;
    border-radius: 10px;
    outline: none;
    padding: 12px 14px;
    background: #0a1020;
    color: #fff;
}

input:focus {
    border-color: #668cf0;
    box-shadow: 0 0 0 3px rgba(102, 140, 240, 0.16);
}

button {
    border: 0;
    border-radius: 10px;
    padding: 12px 18px;
    cursor: pointer;
    background: #5d82e8;
    color: #fff;
    font-weight: 750;
}

button:hover {
    background: #7195f3;
}

button:disabled {
    cursor: wait;
    opacity: 0.55;
}

.joinNote {
    margin: 14px 0 0;
    color: #8e9ab7;
    font-size: 13px;
}

.roomPanel {
    min-height: 0;
    flex: 1;
    flex-direction: column;
}

.roomPanel:not([hidden]) {
    display: flex;
}

.roomBar {
    padding: 12px 28px;
    border-bottom: 1px solid #263250;
    color: #b7c1d9;
    font-size: 14px;
}

.messageList {
    min-height: 0;
    flex: 1;
    overflow-y: auto;
    margin: 0;
    padding: 22px 28px;
    list-style: none;
}

.messageList li {
    margin-bottom: 18px;
}

.messageList div {
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.messageList strong {
    color: #91adff;
}

.messageList time {
    color: #74819e;
    font-size: 12px;
}

.messageList p {
    margin: 5px 0 0;
    overflow-wrap: anywhere;
    color: #e2e7f3;
    line-height: 1.45;
}

.messageForm {
    padding: 18px 28px 8px;
    border-top: 1px solid #263250;
}

.messageField {
    flex: 1;
}

.formError {
    min-height: 20px;
    margin: 0;
    padding: 0 28px 14px;
    color: #ff929c;
    font-size: 13px;
}

.visuallyHidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

@media (max-width: 600px) {
    body {
        padding: 0;
    }

    .chatShell {
        min-height: 100vh;
        border: 0;
        border-radius: 0;
    }

    .chatHeader,
    .roomBar,
    .messageList {
        padding-left: 18px;
        padding-right: 18px;
    }

    .messageForm {
        padding-left: 18px;
        padding-right: 18px;
    }
}
