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

:root {
    --background: #150a12;
    --sidebar: #180b16;
    --panel: #1d0f1a;

    --border: #3a1a32;

    --text: #f5e9f2;
    --muted: #b98cae;
    --muted-2: #7a5570;

    --accent: #ff8fd6;
    --accent-dark: #d9569f;
}

body {
    min-height: 100vh;

    background: var(--background);
    color: var(--text);

    font-family:
        Inter,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Arial,
        sans-serif;

    font-size: 13px;

    line-height: 1.5;

    display: flex;

    padding: 24px;

    gap: 24px;
}


/* SIDEBAR */

.sidebar {
    width: 240px;
    min-width: 240px;

    height: calc(100vh - 48px);

    position: sticky;
    top: 24px;

    background: var(--sidebar);

    border: 1px solid var(--border);
    border-radius: 16px;

    display: flex;
    flex-direction: column;

    padding: 24px 16px;

    overflow-y: auto;
}

.brand {
    display: flex;
    flex-direction: column;
    align-items: center;

    gap: 12px;

    padding: 10px 8px 30px;
}

.brand-avatar {
    width: 96px;
    height: 96px;

    border-radius: 50%;

    object-fit: cover;

    border: 2px solid var(--accent-dark);
}

.brand-name {
    font-family: "Baloo 2", cursive;

    font-size: 24px;
    font-weight: 700;

    letter-spacing: 0.5px;

    color: var(--accent);

    white-space: nowrap;
}

.brand-name span {
    display: inline-block;

    animation: letter-pulse 7s infinite;
    animation-delay: calc(var(--i) * 0.12s);
}

@keyframes letter-pulse {
    0%, 92%, 100% {
        transform: scale(1) translateY(0);
    }
    95% {
        transform: scale(1.4) translateY(-5px);
    }
}


/* ACCOUNT CONNECT */

.account-connect {
    padding: 0 8px 18px;

    margin-bottom: 10px;

    border-bottom: 1px solid var(--border);
}

.connect-buttons {
    display: flex;
    flex-direction: column;

    gap: 8px;
}

.connect-btn {
    width: 100%;

    display: flex;
    align-items: center;

    gap: 9px;

    border: 1px solid var(--border);
    background: #241021;

    color: var(--text);

    font-size: 12px;
    font-weight: 600;

    padding: 9px 11px;

    border-radius: 8px;

    cursor: pointer;

    transition: background 0.15s ease, border-color 0.15s ease;
}

.connect-btn:hover {
    background: #2e1329;
    border-color: var(--accent-dark);
}

.connect-icon {
    font-size: 14px;
}

.connect-discord:hover {
    border-color: #5865f2;
}

.connect-twitch:hover {
    border-color: #9146ff;
}

.connect-profile {
    width: 100%;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
    display: none;

    align-items: center;

    gap: 10px;

    padding: 6px 3px;
}

.connect-profile-avatar {
    width: 36px;
    height: 36px;

    border-radius: 50%;

    object-fit: cover;

    border: 2px solid var(--accent-dark);

    flex-shrink: 0;
}

.connect-profile-info {
    display: flex;
    flex-direction: column;

    min-width: 0;

    flex: 1;
}

.connect-profile-name {
    font-size: 12.5px;
    font-weight: 650;

    color: var(--text);

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.connect-profile-provider {
    font-size: 10.5px;

    color: var(--muted-2);

    margin-top: 1px;
}

.connect-logout {
    width: 28px;
    height: 28px;

    flex-shrink: 0;

    border: 1px solid var(--border);
    background: #241021;

    color: var(--muted);

    border-radius: 7px;

    font-size: 13px;

    cursor: pointer;

    display: flex;
    align-items: center;
    justify-content: center;

    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.connect-logout:hover {
    background: #3a1a32;
    color: #ff9d9d;
    border-color: #ff9d9d;
}

.account-connect.is-connected .connect-buttons {
    display: none;
}

.account-connect.is-connected .connect-profile {
    display: flex;
}


/* NAVIGATION */

.navigation {
    display: flex;
    flex-direction: column;

    gap: 5px;
}

.nav-item {
    width: 100%;

    border: 0;

    background: transparent;

    color: var(--muted);

    border-radius: 8px;

    padding: 10px 11px;

    display: flex;
    align-items: center;

    gap: 11px;

    font-size: 13px;

    text-align: left;

    cursor: pointer;

    transition:
        background 0.15s ease,
        color 0.15s ease;
}

.nav-item:hover {
    background: #24122070;
    color: #f0d9ec;
}

.nav-item.active {
    background: #2c1327;
    color: #ffffff;
}

.nav-icon {
    width: 18px;

    color: var(--muted-2);

    text-align: center;

    font-size: 16px;
}

.nav-item.active .nav-icon {
    color: var(--accent);
}


/* SIDEBAR BOTTOM */

.sidebar-bottom {
    margin-top: auto;

    padding: 10px 8px;

    color: var(--muted-2);

    font-size: 11px;
}


/* CONTENT */

.content {
    flex: 1;

    min-width: 0;

    padding: 36px 0;

    max-width: 1200px;
}


/* PANELS - alles in EINEM Kasten pro Bereich */

.main-panel,
.commands-panel {
    background: var(--panel);

    border: 1px solid var(--border);

    border-radius: 14px;

    padding: 30px;

    min-height: 320px;
}

/* Commands-Panel ist eigenstaendig, nicht mit dem Hauptpanel verbunden */
.commands-panel {
    display: none;

    border-color: var(--accent-dark);
}


/* PAGES */

.page {
    display: none;
}

.active-page {
    display: block;
}


/* CHAT FLOATING BUTTON */

.chat-fab {
    position: fixed;

    right: 28px;
    bottom: 28px;

    height: 44px;

    padding: 0 18px 0 12px;

    border-radius: 22px;

    border: 1px solid var(--accent-dark);
    background: #241021;

    color: var(--text);

    font-size: 13px;
    font-weight: 600;

    display: flex;
    align-items: center;

    gap: 8px;

    cursor: pointer;

    box-shadow: 0 0 0 0 rgba(255, 143, 214, 0.45);

    animation: chat-fab-pulse 2.4s infinite;

    z-index: 50;
}

.chat-fab:hover {
    background: #2e1329;
}

.chat-fab-icon {
    font-size: 18px;
}

@keyframes chat-fab-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 143, 214, 0.45);
    }
    70% {
        box-shadow: 0 0 0 14px rgba(255, 143, 214, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 143, 214, 0);
    }
}


/* CHAT PANEL */

.chat-panel {
    position: fixed;

    right: 28px;
    bottom: 88px;

    left: 312px;

    width: auto;
    max-width: none;

    height: 560px;
    max-height: calc(100vh - 140px);

    background: var(--panel);

    border: 1px solid var(--border);
    border-radius: 16px;

    display: none;

    overflow: hidden;

    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);

    z-index: 49;
}

.chat-panel.open {
    display: flex;
}

.chat-people {
    width: 230px;
    min-width: 230px;

    border-right: 1px solid var(--border);

    display: flex;
    flex-direction: column;

    background: var(--sidebar);
}

.chat-people-header {
    padding: 16px 16px 10px;
}

.chat-title {
    font-size: 15px;
    font-weight: 700;
}

.chat-tabs {
    display: flex;

    margin: 0 16px 10px;

    background: #241021;

    border-radius: 8px;

    padding: 3px;

    gap: 3px;
}

.chat-tab {
    flex: 1;

    border: 0;
    background: transparent;

    color: var(--muted);

    font-size: 11.5px;
    font-weight: 600;

    padding: 6px 0;

    border-radius: 6px;

    cursor: pointer;
}

.chat-tab.active {
    background: #33162c;
    color: var(--text);
}

.chat-search {
    padding: 0 16px 10px;
}

.chat-search input {
    width: 100%;

    background: #241021;
    border: 1px solid var(--border);

    border-radius: 8px;

    padding: 7px 10px;

    color: var(--text);

    font-size: 11.5px;

    outline: none;
}

.chat-search input::placeholder {
    color: var(--muted-2);
}

.chat-people-label {
    padding: 4px 16px 6px;

    font-size: 10px;
    font-weight: 700;

    letter-spacing: 1px;

    color: var(--muted-2);
}

.chat-people-list {
    flex: 1;

    overflow-y: auto;

    padding: 0 8px 8px;
}

.chat-people-list:empty::after {
    content: "No players found";

    display: block;

    padding: 20px 8px;

    color: var(--muted-2);

    font-size: 11.5px;
}

.chat-person {
    width: 100%;

    display: flex;
    align-items: center;

    gap: 10px;

    padding: 8px;

    border: 0;
    background: transparent;

    border-radius: 8px;

    cursor: pointer;

    text-align: left;
}

.chat-person:hover {
    background: #24122070;
}

.chat-person.active {
    background: #2c1327;
}

.chat-person-avatar {
    width: 34px;
    height: 34px;

    border-radius: 50%;

    object-fit: cover;

    flex-shrink: 0;
}

.chat-person-info {
    display: flex;
    flex-direction: column;

    min-width: 0;
}

.chat-person-name {
    font-size: 12.5px;
    font-weight: 600;

    color: var(--text);
}

.chat-person-status {
    font-size: 10.5px;

    color: var(--muted-2);

    margin-top: 1px;
}


/* CHAT BUBBLES */

.chat-bubble-row {
    display: flex;

    gap: 10px;

    margin-bottom: 14px;
}

.chat-bubble-avatar {
    width: 28px;
    height: 28px;

    border-radius: 50%;

    object-fit: cover;

    flex-shrink: 0;
}

.chat-bubble-content {
    display: flex;
    flex-direction: column;
}

.chat-bubble-name {
    font-size: 11.5px;
    font-weight: 650;

    color: var(--accent);

    margin-bottom: 3px;
}

.chat-bubble-text {
    background: #241021;

    border: 1px solid var(--border);

    border-radius: 10px;

    padding: 8px 12px;

    font-size: 12.5px;

    max-width: 380px;
}

.message-emoji {
    width: 22px;
    height: 22px;

    object-fit: contain;

    vertical-align: middle;

    margin: -2px 1px;
}

.chat-bubble-row.own {
    flex-direction: row-reverse;
}

.chat-bubble-row.own .chat-bubble-content {
    align-items: flex-end;
}

.chat-bubble-row.own .chat-bubble-avatar {
    display: none;
}

.chat-bubble-row.own .chat-bubble-text {
    background: #3a1a32;
}

.chat-messages {
    flex: 1;

    min-width: 0;

    display: flex;
    flex-direction: column;
}

.chat-messages-header {
    padding: 16px 18px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    border-bottom: 1px solid var(--border);
}

.chat-messages-title {
    font-size: 13px;
    font-weight: 650;

    color: var(--muted);
}

.chat-close {
    border: 0;
    background: transparent;

    color: var(--muted);

    font-size: 14px;

    cursor: pointer;
}

.chat-close:hover {
    color: var(--text);
}

.chat-messages-body {
    flex: 1;

    overflow-y: auto;

    padding: 18px;
}

.chat-messages-body:empty::after {
    content: "No messages";

    display: block;

    padding: 40px 0;

    text-align: center;

    color: var(--muted-2);

    font-size: 12px;
}

.chat-input-row {
    position: relative;

    display: flex;

    gap: 10px;

    padding: 14px 18px;

    border-top: 1px solid var(--border);
}

.chat-input {
    flex: 1;

    background: #241021;
    border: 1px solid var(--border);

    border-radius: 8px;

    padding: 9px 12px;

    color: var(--text);

    font-size: 12.5px;

    outline: none;
}

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

.chat-send {
    border: 0;

    background: var(--accent);

    color: #2b0a22;

    font-size: 12px;
    font-weight: 650;

    padding: 0 18px;

    border-radius: 8px;

    cursor: pointer;
}

.chat-send:disabled {
    background: #3a2334;
    color: var(--muted-2);

    cursor: not-allowed;
}


/* EMOJI BUTTON + PANEL */

.emoji-fab {
    width: 38px;
    height: 38px;

    border-radius: 8px;

    border: 1px solid var(--border);
    background: #241021;

    font-size: 17px;

    cursor: pointer;

    flex-shrink: 0;
}

.emoji-fab:hover {
    background: #2e1329;
}

.emoji-panel {
    position: absolute;

    right: 18px;
    bottom: 68px;

    width: 300px;
    height: 320px;

    background: var(--sidebar);

    border: 1px solid var(--border);
    border-radius: 14px;

    display: none;
    flex-direction: column;

    overflow: hidden;

    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);

    z-index: 60;
}

.emoji-panel.open {
    display: flex;
}

.emoji-panel-search {
    padding: 12px 12px 8px;
}

.emoji-search-input {
    width: 100%;

    background: #241021;
    border: 1px solid var(--border);

    border-radius: 8px;

    padding: 7px 10px;

    color: var(--text);

    font-size: 11.5px;

    outline: none;
}

.emoji-search-input::placeholder {
    color: var(--muted-2);
}

.emoji-panel-tabs {
    display: flex;

    gap: 6px;

    padding: 0 12px 10px;

    border-bottom: 1px solid var(--border);
}

.emoji-tab {
    border: 0;
    background: transparent;

    color: var(--muted);

    font-size: 10.5px;
    font-weight: 650;

    padding: 5px 8px;

    border-radius: 6px;

    cursor: pointer;
}

.emoji-tab span {
    color: var(--muted-2);
}

.emoji-tab.active {
    background: #2c1327;
    color: var(--text);
}

.emoji-grid {
    flex: 1;

    overflow-y: auto;

    padding: 10px 12px;

    display: grid;
    grid-template-columns: repeat(auto-fill, 40px);

    justify-content: start;

    align-content: flex-start;

    gap: 6px;
}

.emoji-item {
    width: 40px;
    height: 40px;

    flex-shrink: 0;

    border: 0;
    background: transparent;

    border-radius: 6px;

    padding: 4px;

    cursor: pointer;

    display: flex;
    align-items: center;
    justify-content: center;

    overflow: hidden;
}

.emoji-item-img {
    display: block;

    width: 100%;
    height: 100%;

    max-width: 100%;
    max-height: 100%;

    object-fit: contain;
}

.emoji-item:hover {
    background: #24122070;
}

.emoji-item.is-animated:hover {
    animation: emoji-bob 0.6s ease-in-out;
}

@keyframes emoji-bob {
    0%, 100% {
        transform: translateY(0) scale(1);
    }
    50% {
        transform: translateY(-3px) scale(1.15);
    }
}

.emoji-grid:empty::after {
    content: "No emoji found";

    grid-column: 1 / -1;

    text-align: center;

    padding: 30px 0;

    color: var(--muted-2);

    font-size: 11.5px;
}


/* MOBILE */

@media (max-width: 700px) {

    .chat-panel {
        right: 12px;
        left: 12px;
    }

    .chat-people {
        width: 170px;
        min-width: 170px;
    }

}
/* PROFILE PANEL */

.profile-overlay {
    position: fixed;

    inset: 0;

    background: rgba(8, 3, 8, 0.72);

    display: none;

    align-items: center;
    justify-content: center;

    padding: 40px;

    z-index: 100;
}

.profile-overlay.open {
    display: flex;
}


.profile-panel {
    position: relative;

    width: 75vw;
    height: 75vh;

    max-width: 1100px;
    max-height: 800px;

    min-width: 650px;
    min-height: 450px;

    background: var(--panel);

    border: 1px solid var(--border);

    border-radius: 20px;

    overflow: hidden;

    box-shadow:
        0 30px 90px rgba(0, 0, 0, 0.65),
        0 0 40px rgba(255, 143, 214, 0.08);

    animation: profile-panel-open 0.18s ease-out;
}

@keyframes profile-panel-open {
    from {
        opacity: 0;
        transform: scale(0.96) translateY(8px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}


/* PROFILE HEADER */

.profile-panel-header {
    height: 150px;

    padding: 26px 30px;

    display: flex;

    align-items: center;

    justify-content: space-between;

    border-bottom: 1px solid var(--border);

    background:
        linear-gradient(
            135deg,
            #241021,
            #1d0f1a
        );
}


.profile-user {
    display: flex;

    align-items: center;

    gap: 22px;

    min-width: 0;
}


.profile-large-avatar {
    width: 92px;
    height: 92px;

    border-radius: 50%;

    object-fit: cover;

    border: 3px solid var(--accent-dark);

    box-shadow:
        0 0 25px rgba(255, 143, 214, 0.18);

    flex-shrink: 0;
}


.profile-user-info {
    display: flex;

    flex-direction: column;

    min-width: 0;
}


.profile-name-row {
    display: flex;

    align-items: center;

    gap: 8px;

    min-width: 0;
}


.profile-name {
    font-size: 25px;

    font-weight: 700;

    color: var(--text);

    white-space: nowrap;

    overflow: hidden;

    text-overflow: ellipsis;
}


.profile-name-edit-input {
    width: 260px;

    background: #241021;

    border: 1px solid var(--accent-dark);

    border-radius: 8px;

    padding: 7px 10px;

    color: var(--text);

    font-size: 20px;

    font-weight: 650;

    outline: none;
}


.profile-edit-name {
    width: 28px;
    height: 28px;

    border: 1px solid var(--border);

    background: #241021;

    color: var(--muted);

    border-radius: 7px;

    cursor: pointer;

    display: flex;

    align-items: center;
    justify-content: center;

    font-size: 13px;

    transition:
        background 0.15s ease,
        color 0.15s ease,
        border-color 0.15s ease;
}


.profile-edit-name:hover {
    background: #2e1329;

    color: var(--accent);

    border-color: var(--accent-dark);
}


.profile-provider {
    color: var(--muted);

    font-size: 12px;

    margin-top: 4px;
}


/* HEADER BUTTONS */

.profile-header-actions {
    display: flex;

    align-items: center;

    gap: 10px;
}


.connection-add-btn {
    border: 1px solid var(--accent-dark);

    background: #2c1327;

    color: var(--accent);

    border-radius: 9px;

    padding: 9px 14px;

    font-size: 12px;

    font-weight: 650;

    cursor: pointer;

    transition:
        background 0.15s ease,
        transform 0.15s ease;
}


.connection-add-btn:hover {
    background: #3a1a32;

    transform: translateY(-1px);
}


.profile-close {
    width: 34px;
    height: 34px;

    border: 1px solid var(--border);

    background: #241021;

    color: var(--muted);

    border-radius: 8px;

    cursor: pointer;

    font-size: 14px;

    display: flex;

    align-items: center;
    justify-content: center;
}


.profile-close:hover {
    background: #3a1a32;

    color: var(--text);

    border-color: var(--accent-dark);
}


/* PROFILE BODY */

.profile-panel-body {
    height: calc(100% - 150px);

    padding: 28px 30px;

    overflow-y: auto;
}


.connections-title {
    font-size: 14px;

    font-weight: 700;

    color: var(--text);

    margin-bottom: 16px;
}


.connections-list {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 12px;
}


.connection-card {
    min-height: 68px;

    display: flex;

    align-items: center;

    gap: 14px;

    padding: 13px 15px;

    background: #241021;

    border: 1px solid var(--border);

    border-radius: 11px;

    color: var(--text);

    text-decoration: none;

    transition:
        background 0.15s ease,
        border-color 0.15s ease,
        transform 0.15s ease;
}


.connection-card:hover {
    background: #2e1329;

    border-color: var(--accent-dark);

    transform: translateY(-2px);
}


.connection-icon {
    width: 38px;
    height: 38px;

    border-radius: 9px;

    background: #33162c;

    display: flex;

    align-items: center;
    justify-content: center;

    font-size: 18px;

    flex-shrink: 0;
}


.connection-info {
    min-width: 0;

    display: flex;

    flex-direction: column;
}


.connection-platform {
    font-size: 12px;

    font-weight: 700;

    color: var(--text);
}


.connection-username {
    font-size: 11px;

    color: var(--muted);

    margin-top: 2px;

    overflow: hidden;

    text-overflow: ellipsis;

    white-space: nowrap;
}


.connections-empty {
    grid-column: 1 / -1;

    padding: 50px 20px;

    text-align: center;

    color: var(--muted-2);

    border: 1px dashed var(--border);

    border-radius: 12px;

    font-size: 12px;
}


/* CONNECTION MODAL */

.connection-modal {
    position: absolute;

    inset: 0;

    display: none;

    align-items: center;
    justify-content: center;

    background: rgba(8, 3, 8, 0.65);

    z-index: 10;
}


.connection-modal.open {
    display: flex;
}


.connection-modal-card {
    width: 390px;

    background: #1d0f1a;

    border: 1px solid var(--border);

    border-radius: 14px;

    padding: 22px;

    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.6);
}


.connection-modal-header {
    display: flex;

    align-items: center;

    justify-content: space-between;

    margin-bottom: 20px;

    font-size: 15px;

    font-weight: 700;
}


.connection-modal-header button {
    border: 0;

    background: transparent;

    color: var(--muted);

    cursor: pointer;

    font-size: 14px;
}


.connection-modal-header button:hover {
    color: var(--text);
}


.connection-modal-card label {
    display: block;

    margin-bottom: 6px;

    color: var(--muted);

    font-size: 11px;

    font-weight: 650;
}


.connection-modal-card select,
.connection-modal-card input {
    width: 100%;

    margin-bottom: 15px;

    background: #241021;

    border: 1px solid var(--border);

    border-radius: 8px;

    padding: 9px 11px;

    color: var(--text);

    font-size: 12px;

    outline: none;
}


.connection-modal-card select:focus,
.connection-modal-card input:focus {
    border-color: var(--accent-dark);
}


.connection-modal-actions {
    display: flex;

    justify-content: flex-end;

    gap: 8px;

    margin-top: 4px;
}


.connection-modal-actions button {
    border: 1px solid var(--border);

    background: #241021;

    color: var(--muted);

    padding: 8px 14px;

    border-radius: 8px;

    cursor: pointer;

    font-size: 11.5px;

    font-weight: 650;
}


.connection-modal-actions button:hover {
    color: var(--text);

    background: #2e1329;
}


#connectionSave {
    background: var(--accent);

    border-color: var(--accent);

    color: #2b0a22;
}


#connectionSave:hover {
    background: #ffa6df;
}


/* MOBILE */

@media (max-width: 800px) {

    html {
        width: 100%;
        min-width: 0;
        overflow-x: hidden;
        background: var(--background);
    }

    body {
        width: 100%;
        min-width: 0;
        min-height: 100dvh;

        display: block;

        padding: 0;
        padding-bottom: calc(76px + env(safe-area-inset-bottom));

        overflow-x: hidden;

        -webkit-text-size-adjust: 100%;
    }


    /* =====================================================
       MOBILE BOTTOM NAVIGATION
       ===================================================== */

    .sidebar {
        position: fixed;

        left: 0;
        right: 0;
        bottom: 0;
        top: auto;

        width: 100%;
        min-width: 0;

        height: calc(68px + env(safe-area-inset-bottom));

        z-index: 500;

        padding:
            5px
            8px
            calc(5px + env(safe-area-inset-bottom));

        margin: 0;

        border-radius: 16px 16px 0 0;

        border-left: 0;
        border-right: 0;
        border-bottom: 0;

        background: rgba(24, 11, 22, 0.97);

        backdrop-filter: blur(18px);
        -webkit-backdrop-filter: blur(18px);

        overflow: visible;

        display: flex;
        flex-direction: row;
        align-items: center;
    }


    /* =====================================================
       BRAND
       ===================================================== */

    .brand {
        display: none;
    }


    /* =====================================================
       ACCOUNT POPUP
       ===================================================== */

    .account-connect {
        position: absolute;

        left: 12px;
        right: 12px;
        bottom: calc(76px + env(safe-area-inset-bottom));

        width: auto;

        padding: 10px;

        margin: 0;

        background: rgba(24, 11, 22, 0.98);

        border: 1px solid var(--border);

        border-radius: 13px;

        box-shadow:
            0 15px 45px rgba(0, 0, 0, 0.55);

        z-index: 600;
    }

    .connect-buttons {
        width: 100%;

        display: flex;
        flex-direction: column;

        gap: 7px;
    }

    .connect-btn {
        width: 100%;
        min-height: 44px;

        padding: 10px 12px;

        border-radius: 9px;

        touch-action: manipulation;
    }

    .connect-profile {
        width: 100%;
        min-height: 44px;

        padding: 4px;
    }

    .connect-profile-avatar {
        width: 34px;
        height: 34px;
    }

    .connect-profile-info {
        min-width: 0;
    }

    .connect-profile-name {
        max-width: 100%;

        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .connect-profile-provider {
        white-space: nowrap;
    }

    .connect-logout {
        width: 34px;
        height: 34px;

        flex-shrink: 0;

        touch-action: manipulation;
    }


    /* =====================================================
       NAVIGATION
       ===================================================== */

    .navigation {
        width: 100%;
        height: 100%;

        display: grid;

        grid-template-columns:
            repeat(5, minmax(0, 1fr));

        gap: 3px;

        align-items: center;
    }

    .nav-item {
        width: 100%;
        height: 56px;

        min-width: 0;

        padding: 5px 2px;

        border-radius: 10px;

        display: flex;
        flex-direction: column;

        justify-content: center;
        align-items: center;

        gap: 3px;

        text-align: center;

        font-size: 9px;

        line-height: 1.1;

        touch-action: manipulation;
    }

    .nav-icon {
        width: auto;
        height: 22px;

        display: flex;

        align-items: center;
        justify-content: center;

        font-size: 18px;
    }

    .nav-item.active {
        background: #2c1327;
    }

    .nav-item:active {
        transform: scale(0.96);
    }


    /* =====================================================
       SIDEBAR FOOTER
       ===================================================== */

    .sidebar-bottom {
        display: none;
    }


    /* =====================================================
       CONTENT
       ===================================================== */

    .content {
        width: 100%;
        max-width: none;
        min-width: 0;

        padding: 10px;

        margin: 0;
    }

    .main-panel,
    .commands-panel {
        width: 100%;
        min-width: 0;

        padding: 16px;

        border-radius: 13px;

        min-height:
            calc(
                100dvh -
                86px -
                env(safe-area-inset-bottom)
            );
    }

    .commands-panel {
        width: 100%;
    }


    /* =====================================================
       PAGES
       ===================================================== */

    .page {
        width: 100%;
        min-width: 0;
        max-width: 100%;

        overflow-wrap: anywhere;
    }


    /* =====================================================
       TOUCH ELEMENTS
       ===================================================== */

    button {
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }

    input,
    select,
    textarea {
        width: 100%;
        max-width: 100%;

        font-size: 16px;

        -webkit-appearance: none;
    }

    button,
    input,
    select,
    textarea {
        max-width: 100%;
    }


    /* =====================================================
       PROFILE OVERLAY
       ===================================================== */

    .profile-overlay {
        position: fixed;

        inset: 0;

        width: 100%;
        height: 100dvh;

        padding: 0;

        align-items: stretch;
        justify-content: stretch;

        z-index: 1000;
    }

    .profile-panel {
        width: 100%;
        height: 100dvh;

        max-width: none;
        max-height: none;

        min-width: 0;
        min-height: 0;

        border-radius: 0;

        border: 0;

        display: flex;
        flex-direction: column;

        overflow: hidden;
    }


    /* =====================================================
       PROFILE HEADER
       ===================================================== */

    .profile-panel-header {
        flex-shrink: 0;

        width: 100%;

        height: auto;
        min-height: 92px;

        padding:
            14px
            14px
            12px;

        gap: 10px;
    }

    .profile-user {
        min-width: 0;

        gap: 10px;

        flex: 1;
    }

    .profile-large-avatar {
        width: 56px;
        height: 56px;

        flex-shrink: 0;
    }

    .profile-user-info {
        min-width: 0;
        max-width: 100%;
    }

    .profile-name-row {
        min-width: 0;
        max-width: 100%;
    }

    .profile-name {
        max-width: 130px;

        font-size: 18px;

        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .profile-name-edit-input {
        width: 130px;
        max-width: 100%;

        font-size: 16px;
    }

    .profile-provider {
        max-width: 140px;

        font-size: 10px;

        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .profile-header-actions {
        flex-shrink: 0;

        gap: 5px;
    }

    .connection-add-btn,
    .profile-close {
        width: 34px;
        height: 34px;

        flex-shrink: 0;

        touch-action: manipulation;
    }

    .connection-add-btn {
        padding: 0;

        font-size: 0;

        display: flex;

        align-items: center;
        justify-content: center;
    }

    .connection-add-btn::after {
        content: "+";

        font-size: 18px;
    }


    /* =====================================================
       PROFILE BODY
       ===================================================== */

    .profile-panel-body {
        flex: 1;

        width: 100%;

        height: auto;

        min-height: 0;

        padding:
            18px
            14px
            calc(24px + env(safe-area-inset-bottom));

        overflow-y: auto;
        overflow-x: hidden;

        -webkit-overflow-scrolling: touch;
    }


    /* =====================================================
       CONNECTIONS
       ===================================================== */

    .connections-title {
        margin-bottom: 12px;

        font-size: 13px;
    }

    .connections-list {
        width: 100%;
        min-width: 0;

        display: grid;

        grid-template-columns:
            repeat(2, minmax(0, 1fr));

        gap: 8px;
    }

    .connection-card {
        width: 100%;
        min-width: 0;

        min-height: 60px;

        padding: 9px;

        padding-right: 42px;

        gap: 8px;

        border-radius: 10px;

        overflow: hidden;
    }

    .connection-link {
        min-width: 0;

        gap: 8px;

        overflow: hidden;
    }

    .connection-icon {
        width: 34px;
        height: 34px;

        flex-shrink: 0;

        border-radius: 8px;
    }

    .connection-icon i {
        font-size: 16px;
    }

    .connection-info {
        min-width: 0;

        overflow: hidden;
    }

    .connection-platform,
    .connection-username {
        display: block;

        max-width: 100%;

        overflow: hidden;

        text-overflow: ellipsis;

        white-space: nowrap;
    }

    .connection-platform {
        font-size: 10px;
    }

    .connection-username {
        font-size: 9px;
    }

    .connection-disconnect {
        width: 27px;
        height: 27px;

        right: 7px;

        opacity: 1;

        font-size: 15px;

        touch-action: manipulation;
    }


    /* =====================================================
       CONNECTION MODAL
       ===================================================== */

    .connection-modal {
        position: absolute;

        inset: 0;

        width: 100%;
        height: 100%;

        padding: 14px;

        z-index: 1100;
    }

    .connection-modal-card {
        width: 100%;
        max-width: 390px;

        max-height: calc(
            100dvh -
            28px
        );

        padding: 18px;

        border-radius: 13px;

        overflow-y: auto;
    }

    .connection-modal-card select,
    .connection-modal-card input {
        width: 100%;

        min-height: 44px;

        font-size: 16px;
    }

    .connection-modal-actions {
        display: flex;

        gap: 8px;
    }

    .connection-modal-actions button {
        min-height: 44px;

        flex: 1;

        touch-action: manipulation;
    }


    /* =====================================================
       CHAT
       ===================================================== */

    .chat-panel {
        left: 10px;
        right: 10px;

        max-width: none;

        max-height:
            calc(
                100dvh -
                90px -
                env(safe-area-inset-bottom)
            );
    }

    .chat-people {
        width: 150px;
        min-width: 150px;
    }


    /* =====================================================
       TABLES / LONG CONTENT
       ===================================================== */

    table {
        width: 100%;
        max-width: 100%;

        display: block;

        overflow-x: auto;

        -webkit-overflow-scrolling: touch;
    }

    img,
    video,
    canvas {
        max-width: 100%;
        height: auto;
    }
}


/* =========================================================
   SMALL PHONES
   ========================================================= */

@media (max-width: 420px) {

    body {
        padding-bottom:
            calc(
                72px +
                env(safe-area-inset-bottom)
            );
    }

    .content {
        padding: 7px;
    }

    .main-panel,
    .commands-panel {
        padding: 12px;

        border-radius: 11px;
    }

    .nav-item {
        height: 55px;

        font-size: 8px;
    }

    .nav-icon {
        font-size: 17px;
    }

    .profile-panel-header {
        padding: 11px;
    }

    .profile-large-avatar {
        width: 50px;
        height: 50px;
    }

    .profile-name {
        max-width: 105px;

        font-size: 16px;
    }

    .profile-provider {
        max-width: 105px;

        font-size: 9px;
    }

    .connections-list {
        grid-template-columns: 1fr;
    }

    .connection-card {
        min-height: 58px;
    }

    .connection-icon {
        width: 32px;
        height: 32px;
    }

    .connection-icon i {
        font-size: 15px;
    }
}


/* =========================================================
   VERY SMALL PHONES
   ========================================================= */

@media (max-width: 360px) {

    .content {
        padding: 5px;
    }

    .main-panel,
    .commands-panel {
        padding: 10px;
    }

    .navigation {
        gap: 1px;
    }

    .nav-item {
        height: 54px;

        font-size: 7px;
    }

    .nav-icon {
        font-size: 16px;
    }

    .profile-panel-header {
        padding: 9px;
    }

    .profile-large-avatar {
        width: 46px;
        height: 46px;
    }

    .profile-name {
        max-width: 90px;

        font-size: 15px;
    }

    .profile-provider {
        max-width: 90px;

        font-size: 8px;
    }

    .profile-header-actions {
        gap: 3px;
    }

    .connection-add-btn,
    .profile-close {
        width: 30px;
        height: 30px;
    }

    .connection-card {
        min-height: 56px;

        padding: 8px;

        padding-right: 39px;
    }
}


/* =========================================================
   LANDSCAPE PHONES
   ========================================================= */

@media (max-width: 800px) and (orientation: landscape) {

    body {
        padding-bottom:
            calc(
                64px +
                env(safe-area-inset-bottom)
            );
    }

    .sidebar {
        height:
            calc(
                58px +
                env(safe-area-inset-bottom)
            );
    }

    .nav-item {
        height: 48px;

        flex-direction: row;

        gap: 5px;

        font-size: 8px;
    }

    .nav-icon {
        height: auto;

        font-size: 16px;
    }

    .profile-panel-header {
        min-height: 76px;

        padding: 9px 12px;
    }

    .profile-large-avatar {
        width: 48px;
        height: 48px;
    }

    .profile-panel-body {
        padding-top: 12px;
    }
}


@media (min-width: 801px) and (max-width: 1100px) {

    body {
        padding: 16px;

        gap: 16px;
    }

    .sidebar {
        width: 210px;
        min-width: 210px;

        height: calc(100vh - 32px);

        top: 16px;
    }

    .content {
        padding: 20px 0;
    }

    .main-panel,
    .commands-panel {
        padding: 22px;
    }

}
