:root {
    --bg: #101216;
    --card: #14161a;
    --input: #1b1e22;
    --border: #1e2127;
    --text: #e6eef9;
    --muted: #7b818d;
    --muted-2: #6d747e;
    --accent: #5a9cff;
    --accent-2: #2d7dff;
    --accent-soft: #7fb3ff;
    --success: #2ed573;
    --error: #ff5d7a;
    --radius-card: 1.6rem;
    --font: "Plus Jakarta Sans", Arial, sans-serif;
}

* {
    box-sizing: border-box;
    font-family: var(--font);
}

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

.dev-hidden {
    display: none !important;
}

.flexContainer {
    display: flex;
    flex-flow: column;
    justify-content: center;
    align-items: center;
}

.flexRowContainer {
    display: flex;
    flex-flow: row;
    justify-content: center;
    align-items: center;
}

.flexSpacer {
    flex-grow: 1;
}

.flexDivider {
    height: 0.7rem;
    width: 0.7rem;
}

.fullWidth {
    width: 100%;
}

.textAlignLeft {
    text-align: left;
}

.mcDirtBackground {
    background: var(--bg) !important;
}

.mcTextStyle1 {
    color: var(--muted);
}

.mcTextStyle2 {
    color: var(--text);
    text-shadow: none;
}

/* Left rail — like netlos NTLS bar */
.siteRail {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 4.5rem;
    z-index: 40;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 0.55rem 1.1rem;
    background: var(--card);
    border-right: 1px solid var(--border);
}

.logoMain {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    text-decoration: none;
}

.logoText {
    color: #fff;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    line-height: 1;
}

.logoVersion {
    color: var(--muted);
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.headerLink {
    color: var(--accent);
    font-size: 0.62rem;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    line-height: 1.2;
    padding: 0.45rem 0.35rem;
    border: 1px solid rgba(45, 125, 255, 0.3);
    background: rgba(45, 125, 255, 0.1);
    border-radius: 999px;
    transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.headerLink:hover {
    color: #fff;
    border-color: var(--accent);
    background: rgba(45, 125, 255, 0.2);
}

/* Card */
.mcContainerStyle {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    box-shadow:
        0 1rem 2.5rem rgba(0, 0, 0, 0.5),
        0 0 2rem rgba(45, 125, 255, 0.1);
    position: relative;
    overflow: hidden;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.mcContainerStyle:hover {
    border-color: var(--accent-2);
    box-shadow:
        0 1rem 3rem rgba(0, 0, 0, 0.5),
        0 0 2.5rem rgba(45, 125, 255, 0.18);
}

.mcContainerStyle::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 0%, rgba(90, 156, 255, 0.08), transparent 60%);
    pointer-events: none;
}

/* Buttons */
.mcButtonStyle {
    cursor: pointer;
    overflow: hidden;
    white-space: nowrap;
    user-select: none;
    min-height: 2.75rem;
    background: none;
    border: none;
    min-width: max-content;
}

.mcButtonStyle .mcButtonStyleInner {
    cursor: pointer;
    border: none;
    width: 100%;
    min-height: 2.75rem;
    padding: 0.7rem 1.2rem;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    color: #fff;
    font-size: 0.95rem;
    font-weight: 700;
    font-family: var(--font);
    box-shadow: 0 0.5rem 1.4rem rgba(45, 125, 255, 0.3);
    appearance: none;
    -webkit-appearance: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.mcButtonStyle:hover .mcButtonStyleInner {
    transform: scale(1.02);
    box-shadow: 0 0.7rem 1.8rem rgba(45, 125, 255, 0.45);
    filter: brightness(1.08);
    color: #fff;
    text-shadow: none;
}

.mcButtonStyle:active .mcButtonStyleInner {
    transform: scale(0.97);
    box-shadow: 0 0.3rem 0.8rem rgba(45, 125, 255, 0.3);
}

.micSelect.mcButtonStyle .mcButtonStyleInner,
.speakerSelect.mcButtonStyle .mcButtonStyleInner,
.connectedSec .mcButtonStyle .mcButtonStyleInner {
    background: var(--input);
    border: 1px solid var(--border);
    box-shadow: none;
    color: var(--text);
    font-weight: 500;
    text-align: left;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%236D747E' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.9rem center;
    padding-right: 2.4rem;
}

.connectedSec .mcButtonStyle:has(button) .mcButtonStyleInner {
    background: rgba(45, 125, 255, 0.06);
    border: 1px dashed var(--accent-2);
    background-image: none;
    padding-right: 1.2rem;
    text-align: center;
    color: var(--accent);
    font-weight: 600;
    box-shadow: none;
}

.connectedSec .mcButtonStyle:has(button):hover .mcButtonStyleInner {
    background: rgba(45, 125, 255, 0.12);
    border-style: solid;
    border-color: var(--accent);
    color: #fff;
    filter: none;
    transform: translateY(-1px);
}

.joinBtnContainer.mcButtonStyle .mcButtonStyleInner,
.messageBtnContainer.mcButtonStyle .mcButtonStyleInner {
    background-color: var(--accent-2);
    background-image: linear-gradient(90deg, var(--accent), var(--accent-2));
    border: none;
    text-align: center;
    font-weight: 700;
    color: #fff;
    padding-right: 1.2rem;
}

/* Icon buttons */
.mcIconButtonStyle {
    cursor: pointer;
    overflow: hidden;
    user-select: none;
    height: fit-content;
    background: rgba(45, 125, 255, 0.1);
    border: 1px solid rgba(45, 125, 255, 0.3);
    border-radius: 50%;
    min-width: unset;
}

.mcIconButtonStyle:hover .mcIconButtonStyleInner {
    background: transparent;
    color: var(--accent-soft);
    text-shadow: none;
}

.mcIconButtonStyle:active .mcIconButtonStyleInner {
    box-shadow: none;
}

.mcIconButtonStyle .mcIconButtonStyleInner {
    cursor: pointer;
    border: none;
    background: none;
    width: 2.5rem;
    height: 2.5rem;
    padding: 0.45rem;
    display: grid;
    place-items: center;
    box-shadow: none;
    border-radius: 50%;
}

.mcIconButtonStyle .mcIconButtonStyleInner img {
    width: 1.15rem;
    height: 1.15rem;
    filter: brightness(0) saturate(100%) invert(64%) sepia(62%) saturate(1400%) hue-rotate(187deg);
}

/* Inputs */
.mcTextboxStyle {
    height: 2.85rem;
    color: var(--text);
    background: var(--input);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.75rem 1.1rem;
    font-size: 1rem;
    font-family: var(--font);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.mcTextboxStyle::placeholder {
    color: var(--muted-2);
}

.mcTextboxStyle:hover {
    background: var(--input);
    color: var(--text);
}

.mcTextboxStyle:focus {
    outline: none;
    border-color: var(--accent);
    background: #1e2127;
    box-shadow: 0 0 0.8rem rgba(90, 156, 255, 0.2);
    color: var(--text);
}

.mcTextviewStyle {
    height: 10rem;
    width: 100%;
    color: var(--text);
    background: var(--input);
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 0.9rem 1rem;
    overflow-x: hidden;
    overflow-y: auto;
    white-space: pre-wrap;
    font-family: var(--font);
    font-size: 0.9rem;
}

/* Checkbox */
.mcCheckboxStyle {
    cursor: pointer;
    position: relative;
    height: 1.6rem;
    width: 1.6rem;
    background: var(--input);
    border: 1px solid var(--border);
    border-radius: 0.45rem;
    min-width: 1.6rem;
}

.mcCheckboxStyle input:checked + .mcCheckboxStyleInner {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

.mcCheckboxStyle:hover .mcCheckboxStyleInner {
    border-color: var(--accent);
}

.mcCheckboxStyle .mcCheckboxStyleInner {
    height: 100%;
    width: 100%;
    border-radius: 0.35rem;
}

.mcCheckboxStyle input {
    appearance: none;
    -webkit-appearance: none;
    position: absolute;
    inset: 0;
    margin: 0;
    cursor: pointer;
}

footer {
    width: min(28rem, 92vw);
    padding: 0.85rem 0 0;
    gap: 1.1rem;
    flex-wrap: wrap;
    justify-content: center;
}

footer,
.footerLink {
    gap: 0.6rem;
}

.footerLink {
    color: var(--muted);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: color 0.2s ease;
}

.footerLink:hover {
    color: var(--accent);
}

.footerLinkMain {
    color: var(--accent);
    font-weight: 600;
}

main {
    width: 100%;
    flex: 1 1 auto;
    padding: 2rem 1rem 2rem 5.5rem;
}

.mainContainer {
    width: min(28rem, 92vw);
    padding: clamp(1.25rem, 3vw, 2rem);
    z-index: 1;
}

body.connected .mainContainer,
body.connected footer {
    width: min(42rem, 94vw);
}

.micActivityIndicator.active {
    filter: brightness(1.2) drop-shadow(0 0 8px rgba(90, 156, 255, 0.7));
}

.micActivityIndicator {
    width: 1.2rem;
    height: 1.2rem;
    padding: 0;
    box-shadow: none;
    cursor: default;
    filter: brightness(0) saturate(100%) invert(64%) sepia(62%) saturate(1400%) hue-rotate(187deg);
    margin: 0 0.4rem 0 0.8rem;
}

.statusLabel.disconnected {
    color: var(--error);
}

.statusLabel.connected {
    color: var(--success);
}

.statusLabel {
    color: var(--muted);
    font-size: 0.85rem;
    text-align: center;
}

.joinSec {
    text-align: center;
    padding: 0;
    width: 100%;
    position: relative;
    z-index: 2;
}

.joinLabel {
    margin: 0 0 0.4rem;
    color: #fff;
    font-size: clamp(1.4rem, 3vw, 1.7rem);
    font-weight: 700;
    letter-spacing: 0.02em;
}

.joinSubtitle {
    margin: 0 0 1.4rem;
    color: var(--muted);
    font-size: 0.92rem;
    font-weight: 400;
}

.joinForm {
    color: var(--text);
    width: 100%;
    margin: 0;
    gap: 0.9rem;
}

.joinFormLabel {
    text-align: left;
    padding: 0 0.2rem 0.35rem;
    display: flex;
    align-items: center;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--muted);
}

.usernameContainer,
.passwordContainer,
.micContainer,
.speakerContainer {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
}

.usernameInput,
.passwordInput,
.micSelect,
.speakerSelect {
    width: 100%;
}

.joinContainer {
    flex-direction: column;
    gap: 0.7rem;
    margin-top: 0.35rem;
}

.connectedSec {
    padding: 0.4rem 0 0;
    width: 100%;
    gap: 0.4rem;
    position: relative;
    z-index: 2;
}

.pttBindBtnContainer {
    width: 100%;
}

.chatRow {
    gap: 0.6rem;
    margin-top: 0.6rem;
}

body {
    min-height: 100vh;
    width: 100%;
    background: var(--bg);
    color: var(--text);
}

body.connected .hiddenWhenConnected,
body:not(.connected) .connectedSec,
body:not(.connected) .statusLabel {
    display: none;
}

body.connected .joinBtnContainer {
    width: fit-content;
}

body.connected .joinSec {
    padding: 0;
}

.floatingWidgetsOverlay {
    position: fixed;
    bottom: 1.4rem;
    left: 1rem;
    right: auto;
    width: auto;
    z-index: 30;
}

.alertOverlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 67;
    background: rgba(10, 12, 16, 0.92);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    padding: 0.9rem 1rem;
}

.alertOverlayInner {
    margin: 0 0.5rem;
    max-width: 52rem;
}

#alertMessage {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
}

@media (max-width: 600px) {
    body {
        display: flex;
        height: auto;
        width: auto;
    }

    .flexSpacerWhenMobile {
        flex-grow: 1;
    }

    .fullWidthWhenMobile {
        width: 100%;
    }

    .flexColumnWhenMobile {
        flex-flow: column;
    }

    .usernameInput,
    .passwordInput,
    .micSelect,
    .speakerSelect,
    .pttClearBtnContainer {
        width: 100%;
    }

    .micContainer {
        width: 100%;
    }

    .floatingWidgetsOverlay {
        position: fixed;
        bottom: 0.8rem;
    }

    .siteRail {
        right: 0;
        bottom: auto;
        width: auto;
        height: auto;
        flex-direction: row;
        justify-content: space-between;
        padding: 0.85rem 1rem;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }

    .logoMain {
        align-items: flex-start;
        flex-direction: column;
    }

    .logoText {
        font-size: 1.2rem;
        letter-spacing: 0.14em;
    }

    .headerLink {
        font-size: 0.8rem;
        padding: 0.45rem 0.9rem;
    }

    main {
        padding: 5.2rem 1rem 2rem;
    }
}

body.fullscreen-ptt-active {
    overflow: hidden;
}

.pttFullscreenSec {
    position: fixed;
    inset: 0;
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 1.1rem;
    z-index: 1000;
    background: rgba(10, 12, 16, 0.92) !important;
    backdrop-filter: blur(12px);
}

.pttFullscreenSec.visible {
    display: flex;
}

.pttFullscreenBtn {
    width: min(82vw, 34rem) !important;
    height: min(42vh, 18rem) !important;
}

.pttFullscreenBtn .mcButtonStyleInner {
    font-size: clamp(1.4rem, 4vw, 2.2rem) !important;
    height: 100%;
    border-radius: 1.4rem;
}
