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

:root {
    --bg-primary: #1a1a1a;
    --bg-secondary: #2d2d2d;
    --bg-tertiary: #3a3a3a;
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --accent: #4a9eff;
    --accent-hover: #5baaff;
    --border: #404040;
    --success: #4caf50;
    --error: #f44336;
    --message-bg: #2d2d2d;
    --message-own: #1e3a5f;
    /* Logo / przycisk Strona główna (ciemny łupkowy jak plakietka czatu) */
    --logo-surface: #2c3645;
    --logo-surface-deep: #242d3a;
    --logo-border: rgba(147, 197, 253, 0.35);
    --home-link-green: #39ff14;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
}

/* ---------- Seite: Anmeldung (PC + Mobil) ---------- */
.login-page {
    --login-glow: rgba(74, 158, 255, 0.12);
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right))
        max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
    background:
        radial-gradient(ellipse 120% 80% at 50% -20%, var(--login-glow), transparent 55%),
        radial-gradient(ellipse 80% 50% at 100% 100%, rgba(74, 158, 255, 0.06), transparent 45%),
        linear-gradient(160deg, #14161c 0%, var(--bg-primary) 38%, #1e2228 100%);
}

.login-container {
    width: 100%;
    max-width: 980px;
    margin: 0 auto;
}

.login-container--narrow {
    max-width: 440px;
}

.login-layout {
    display: grid;
    gap: clamp(16px, 3vw, 28px);
    align-items: stretch;
}

@media (min-width: 880px) {
    .login-layout:not(.login-layout--single) {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: 28px;
    }
}

.login-layout--single {
    grid-template-columns: 1fr;
    justify-items: center;
}

.login-layout--single .login-card--main {
    width: 100%;
    max-width: 440px;
}

.login-card {
    background: linear-gradient(145deg, rgba(45, 45, 45, 0.92) 0%, rgba(35, 38, 44, 0.96) 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: clamp(22px, 4vw, 36px);
    box-shadow:
        0 4px 24px rgba(0, 0, 0, 0.35),
        0 0 0 1px rgba(0, 0, 0, 0.2) inset;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.login-card--main {
    display: flex;
    flex-direction: column;
}

.login-card--aside {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

@media (max-width: 879px) {
    .login-card--aside {
        order: 2;
    }

    .login-card--main {
        order: 1;
    }
}

.login-brand {
    text-align: center;
    margin-bottom: clamp(20px, 4vw, 28px);
}

.login-brand-top {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.login-brand-icon {
    width: 72px;
    height: 72px;
    margin: 0;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    line-height: 1;
    border-radius: 20px;
    background: linear-gradient(145deg, var(--logo-surface) 0%, var(--logo-surface-deep) 100%);
    border: 1px solid var(--logo-border);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.login-brand-icon--admin {
    background: linear-gradient(145deg, rgba(244, 67, 54, 0.18), rgba(244, 67, 54, 0.05));
    border-color: rgba(244, 67, 54, 0.3);
}

/* Strona główna: ta sama powierzchnia co logo, neonowa zieleń bez poświaty */
.btn-home {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 10px 18px;
    box-sizing: border-box;
    background: linear-gradient(145deg, var(--logo-surface) 0%, var(--logo-surface-deep) 100%);
    border: 1px solid var(--logo-border);
    border-radius: 14px;
    color: var(--home-link-green);
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-decoration: none;
    text-shadow: none;
    box-shadow: none;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.btn-home:hover {
    color: #5dff3d;
    border-color: rgba(147, 197, 253, 0.5);
    background: linear-gradient(145deg, #354354 0%, var(--logo-surface) 100%);
}

.btn-home:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.login-brand .btn-home {
    min-height: 52px;
    padding: 12px 22px;
    border-radius: 18px;
    font-size: 1rem;
}

.login-brand-icon--admin + .btn-home {
    min-height: 72px;
    border-radius: 20px;
}

.login-brand h1 {
    font-size: clamp(1.65rem, 4.5vw, 2.1rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 8px;
    line-height: 1.2;
}

.subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin: 0;
    font-size: clamp(0.9rem, 2.4vw, 1rem);
    line-height: 1.5;
    max-width: 28em;
    margin-left: auto;
    margin-right: auto;
}

.brand-rainbow {
    background-image: linear-gradient(
        90deg,
        #ff0033 0%,
        #ff3300 5%,
        #ff6600 10%,
        #ff9900 15%,
        #ffcc00 20%,
        #ffff00 25%,
        #ccff00 30%,
        #99ff00 35%,
        #66ff00 40%,
        #33ff00 45%,
        #00ff33 50%,
        #00ff66 55%,
        #00ff99 60%,
        #00ffcc 65%,
        #00ffff 70%,
        #00ccff 75%,
        #0099ff 80%,
        #0066ff 85%,
        #3300ff 90%,
        #6600ff 95%,
        #9900ff 100%
    );
    background-size: 300% 100%;
    color: transparent;
    -webkit-background-clip: text;
    background-clip: text;
    animation: rainbow-flow 8s linear infinite;
}

@keyframes rainbow-flow {
    0% {
        background-position: 0% 50%;
    }
    100% {
        background-position: 100% 50%;
    }
}

.login-form {
    margin-top: 4px;
}

.login-page .form-group {
    margin-bottom: clamp(16px, 3vw, 20px);
}

.login-page .form-group:last-of-type {
    margin-bottom: clamp(20px, 3.5vw, 24px);
}

.login-page .form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: 0.01em;
}

.login-page .form-group input {
    width: 100%;
    min-height: 48px;
    padding: 12px 14px;
    background: rgba(26, 28, 32, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.login-page .form-group input::placeholder {
    color: rgba(176, 176, 176, 0.55);
}

.login-page .form-group input:hover {
    border-color: rgba(74, 158, 255, 0.35);
}

.login-page .form-group input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(74, 158, 255, 0.25);
}

.login-page .btn-primary {
    width: 100%;
    min-height: 50px;
    padding: 14px 20px;
    background: linear-gradient(180deg, #5ba3ff 0%, var(--accent) 50%, #3d8eef 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.02rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: filter 0.2s ease, transform 0.15s ease;
    box-shadow: 0 4px 16px rgba(74, 158, 255, 0.35);
}

.login-page .btn-primary:hover {
    filter: brightness(1.06);
    background: linear-gradient(180deg, var(--accent-hover) 0%, var(--accent) 55%, #3580d4 100%);
}

.login-page .btn-primary:active {
    transform: translateY(1px);
}

.btn-login-submit {
    margin-top: 4px;
}

@media (prefers-reduced-motion: reduce) {
    .login-page .btn-primary,
    .login-page .form-group input {
        transition: none;
    }

    .login-page .btn-primary:active {
        transform: none;
    }
}

.error-message {
    background: linear-gradient(180deg, #e85c52 0%, var(--error) 100%);
    color: white;
    padding: 14px 16px;
    border-radius: 12px;
    margin-bottom: 20px;
    text-align: center;
    font-size: 0.95rem;
    line-height: 1.45;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 4px 16px rgba(244, 67, 54, 0.25);
}

.registration-instructions {
    background: rgba(26, 28, 32, 0.65);
    padding: clamp(16px, 3vw, 22px);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    height: 100%;
    box-sizing: border-box;
}

.registration-instructions h3 {
    color: var(--accent);
    margin-bottom: 14px;
    font-size: clamp(1rem, 2.5vw, 1.15rem);
    font-weight: 600;
    letter-spacing: -0.01em;
}

.registration-instructions ol {
    margin: 0 0 14px 0;
    padding-left: 1.35em;
    color: var(--text-primary);
    line-height: 1.65;
    font-size: clamp(0.875rem, 2.2vw, 0.95rem);
}

.registration-instructions li {
    margin-bottom: 10px;
    padding-left: 4px;
}

.registration-instructions li strong {
    color: var(--accent);
    font-weight: 600;
}

.instruction-note {
    background: rgba(74, 158, 255, 0.08);
    border-left: 3px solid var(--accent);
    padding: 12px 14px;
    border-radius: 0 10px 10px 0;
    color: var(--text-secondary);
    font-size: clamp(0.82rem, 2vw, 0.9em);
    line-height: 1.55;
    margin-top: 12px;
}

.instruction-note strong {
    color: var(--accent);
}

.info-text {
    text-align: center;
    color: var(--text-secondary);
    font-size: clamp(0.82rem, 2.2vw, 0.88rem);
    margin-top: clamp(18px, 3vw, 24px);
    line-height: 1.5;
}

.info-text--footer {
    margin-top: clamp(22px, 4vw, 28px);
}

.login-back-link {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 8px;
    display: inline-block;
    transition: background 0.2s ease, color 0.2s ease;
}

.login-back-link:hover {
    background: rgba(74, 158, 255, 0.12);
    color: var(--accent-hover);
}

.login-back-link:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Primärschaltfläche auf Chat- / Admin-Seiten (nicht volle Breite) */
.chat-page .btn-primary {
    display: inline-block;
    width: auto;
    min-height: unset;
    padding: 12px 20px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1em;
    font-weight: 600;
    letter-spacing: normal;
    cursor: pointer;
    transition: background 0.3s;
    box-shadow: none;
}

.chat-page .btn-primary:hover {
    filter: none;
    background: var(--accent-hover);
}

.chat-page .btn-primary:active {
    transform: none;
}

/* Abwärtskompatibilität: alte .login-box */
.login-box {
    background: linear-gradient(145deg, rgba(45, 45, 45, 0.92) 0%, rgba(35, 38, 44, 0.96) 100%);
    padding: clamp(22px, 4vw, 36px);
    border-radius: 20px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.login-box h1 {
    text-align: center;
    margin-bottom: 10px;
    font-size: clamp(1.65rem, 4.5vw, 2em);
}

/* Strona czatu */
.chat-page {
    height: 100vh;
    overflow: hidden;
}

.chat-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.chat-header {
    background: var(--bg-secondary);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    position: relative;
}

.chat-header-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.chat-header-logo {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    line-height: 1;
    border-radius: 12px;
    background: linear-gradient(145deg, #3a4252 0%, #2c3442 100%);
    border: 1px solid rgba(147, 197, 253, 0.65);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.28);
    text-shadow: 0 0 8px rgba(147, 197, 253, 0.45);
}

.chat-header-brand .btn-home {
    flex-shrink: 0;
    min-height: 44px;
    padding: 9px 16px;
    border-radius: 12px;
    font-size: 0.88rem;
}

.chat-header-brand h1 {
    margin: 0;
    font-size: 1.5em;
    line-height: 1.2;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.btn-mobile-menu {
    display: none;
    background: linear-gradient(145deg, #3a4252 0%, #2c3442 100%);
    border: 1px solid rgba(147, 197, 253, 0.65);
    border-radius: 6px;
    padding: 8px 12px;
    color: #ffffff;
    cursor: pointer;
    font-size: 1.3em;
    text-shadow: 0 0 8px rgba(147, 197, 253, 0.45);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.28);
    transition: background 0.3s, border-color 0.3s;
}

.btn-mobile-menu:hover {
    background: linear-gradient(145deg, #44506a 0%, #344055 100%);
    border-color: rgba(147, 197, 253, 0.85);
}

.mobile-menu-wrap {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 3px;
    flex-shrink: 0;
    min-width: 44px;
}

.mobile-online-count {
    display: block;
    font-size: 0.65rem;
    font-weight: 600;
    color: #b388ff;
    letter-spacing: 0.02em;
    line-height: 1.15;
    text-align: center;
    max-width: 56px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-shrink: 0;
}

.username-display {
    color: var(--text-secondary);
}

.btn-logout {
    padding: 8px 16px;
    background: var(--error);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.9em;
    transition: background 0.3s;
}

.btn-logout:hover {
    background: #d32f2f;
}


.chat-main {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Lista użytkowników */
.users-sidebar {
    width: 250px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.radio-player-box {
    padding: 10px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-secondary);
}

.radio-player-title {
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.radio-player {
    width: 100%;
    height: 32px;
}

.radio-volume-wrap {
    margin-top: 6px;
}

.radio-volume-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.radio-volume-slider {
    width: 100%;
    height: 4px;
}

.users-sidebar h2 {
    padding: 15px;
    font-size: 1.1em;
    border-bottom: 1px solid var(--border);
    background: var(--bg-tertiary);
}

.users-list {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 10px;
    min-height: 0; /* Ważne dla flexbox - pozwala na przewijanie */
}

.user-item {
    padding: 10px;
    margin-bottom: 5px;
    background: var(--bg-tertiary);
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.user-item .status-dot {
    width: 10px;
    height: 10px;
    background: var(--success);
    border-radius: 50%;
    display: inline-block;
}

/* Przycisk banowania użytkownika (dla admina) */
.btn-ban-user {
    background: rgba(244, 67, 54, 0.2);
    border: 1px solid var(--error);
    color: var(--error);
    border-radius: 4px;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.3s;
    margin-left: auto;
}

.btn-ban-user:hover {
    background: var(--error);
    color: white;
}

/* Obszar czatu */
.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: var(--bg-primary);
}

.message {
    margin-bottom: 15px;
    padding-bottom: 5px;
    display: flex;
    flex-direction: column;
    animation: fadeIn 0.3s;
    overflow: visible;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}

.message-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
    position: relative;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

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

.message-username.admin-username {
    color: var(--error);
    font-weight: 700;
}

.message-time {
    font-size: 0.8em;
    color: var(--text-secondary);
    margin-left: auto;
}

/* Przycisk usuwania wiadomości (dla admina) */
.btn-delete-message {
    background: rgba(244, 67, 54, 0.2);
    border: 1px solid var(--error);
    color: var(--error);
    border-radius: 4px;
    padding: 2px 6px;
    cursor: pointer;
    font-size: 0.8em;
    transition: all 0.3s;
    margin-right: 5px;
    opacity: 0;
    transition: opacity 0.2s;
}

.message:hover .btn-delete-message {
    opacity: 1;
}

.btn-delete-message:hover {
    background: var(--error);
    color: white;
}

.message-content {
    background: var(--message-bg);
    padding: 12px 15px;
    border-radius: 8px;
    max-width: 70%;
    word-wrap: break-word;
    line-height: 1.5;
    overflow: visible;
    min-height: auto;
}

.message-text {
    margin-top: 5px;
}

/* Wiadomości systemowe */
.message.system {
    align-items: center;
    margin: 20px 0;
}

.message.system .message-content.system-message {
    background: rgba(244, 67, 54, 0.15);
    border: 1px solid rgba(244, 67, 54, 0.3);
    color: var(--error);
    text-align: center;
    padding: 10px 20px;
    border-radius: 8px;
    max-width: 90%;
    font-weight: 500;
    font-size: 0.95em;
}

/* Wiadomości systemowe o odbanowaniu (zielone) */
.message.system .message-content.system-message:has-text("✅") {
    background: rgba(76, 175, 80, 0.15);
    border: 1px solid rgba(76, 175, 80, 0.3);
    color: var(--success);
}

/* Alternatywny sposób dla wiadomości o odbanowaniu */
.message.system .message-content.system-message.unban-message {
    background: rgba(76, 175, 80, 0.15);
    border: 1px solid rgba(76, 175, 80, 0.3);
    color: var(--success);
}

.message.own .message-content {
    background: var(--message-own);
    margin-left: auto;
}

.message.own .message-header {
    flex-direction: row-reverse;
    justify-content: flex-start;
}

.image-wrapper {
    margin-top: 5px;
}

.message-image-thumb {
    max-width: 200px;
    max-height: 200px;
    width: auto;
    height: auto;
    border-radius: 8px;
    cursor: pointer;
    object-fit: cover;
    transition: transform 0.2s;
}

.message-image-thumb:hover {
    transform: scale(1.05);
    opacity: 0.9;
}

.gif-wrapper {
    margin-top: 5px;
}

.voice-wrapper {
    margin-top: 5px;
}

.voice-wrapper {
    margin-top: 5px;
    margin-bottom: 5px;
    width: 100%;
    max-width: 400px;
    display: block;
    position: relative;
    overflow: visible;
}

.voice-label {
    color: var(--text-secondary);
    font-size: 0.85em;
    margin-bottom: 8px;
    font-weight: 500;
}

/* Niestandardowy player audio */
.custom-audio-player {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-tertiary);
    padding: 12px 15px;
    border-radius: 8px;
    width: 100%;
    max-width: 400px;
}

.custom-audio-player audio {
    display: none;
}

.audio-play-btn {
    background: var(--accent);
    border: none;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    color: white;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.3s;
}

.audio-play-btn:hover {
    background: var(--accent-hover);
}

.audio-progress-container {
    flex: 1;
    display: flex;
    align-items: center;
    min-width: 0;
}

.audio-progress-bar {
    width: 100%;
    height: 6px;
    background: var(--bg-primary);
    border-radius: 3px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.audio-progress-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 3px;
    width: 0%;
    transition: width 0.1s;
}

.audio-time {
    color: var(--text-secondary);
    font-size: 0.85em;
    white-space: nowrap;
    flex-shrink: 0;
    min-width: 70px;
    text-align: right;
}

.audio-volume-container {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
}

.audio-volume-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 18px;
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s;
}

.audio-volume-btn:hover {
    color: var(--text-primary);
}

.audio-volume-slider {
    width: 60px;
    height: 4px;
    background: var(--bg-primary);
    border-radius: 2px;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.audio-volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    background: var(--accent);
    border-radius: 50%;
    cursor: pointer;
}

.audio-volume-slider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    background: var(--accent);
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

.voice-error {
    color: var(--error);
    padding: 10px;
    text-align: center;
    background: rgba(244, 67, 54, 0.1);
    border-radius: 6px;
    border: 1px solid var(--error);
}

/* Style dla mobile */
@media (max-width: 768px) {
    .messages-container {
        padding-bottom: 80px !important;
    }
    
    .message {
        margin-bottom: 20px !important;
        padding-bottom: 10px !important;
        overflow: visible !important;
    }
    
    .message-content {
        max-width: 90% !important;
        overflow: visible !important;
        padding-bottom: 15px !important;
    }
    
    .message.own .message-content {
        max-width: 90% !important;
    }
    
    .voice-wrapper {
        max-width: 100% !important;
        width: 100% !important;
        margin: 5px 0 10px 0 !important;
        overflow: visible !important;
    }
    
    .voice-label {
        font-size: 0.8em !important;
        margin-bottom: 6px !important;
    }
    
    .custom-audio-player {
        max-width: 100% !important;
        width: 100% !important;
        padding: 10px 12px !important;
        gap: 8px !important;
        overflow: visible !important;
    }
    
    .audio-play-btn {
        width: 40px !important;
        height: 40px !important;
        font-size: 16px !important;
        flex-shrink: 0 !important;
    }
    
    .audio-progress-container {
        flex: 1 !important;
        min-width: 0 !important;
        overflow: visible !important;
    }
    
    .audio-progress-bar {
        height: 6px !important;
        overflow: visible !important;
    }
    
    .audio-time {
        font-size: 0.8em !important;
        min-width: 65px !important;
        flex-shrink: 0 !important;
    }
    
    .audio-volume-container {
        gap: 4px !important;
        flex-shrink: 0 !important;
    }
    
    .audio-volume-btn {
        font-size: 16px !important;
        padding: 3px !important;
    }
    
    .audio-volume-slider {
        width: 50px !important;
        height: 4px !important;
    }
    
    .audio-volume-slider::-webkit-slider-thumb {
        width: 12px !important;
        height: 12px !important;
    }
    
    .audio-volume-slider::-moz-range-thumb {
        width: 12px !important;
        height: 12px !important;
    }
}

/* Nagrywanie głosu */
.voice-recorder {
    background: var(--bg-tertiary);
    padding: 15px;
    border-radius: 8px;
    margin-top: 10px;
    border: 2px solid var(--error);
}

.recording-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 15px;
}

.recording-dot {
    width: 12px;
    height: 12px;
    background: var(--error);
    border-radius: 50%;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(1.2);
    }
}

#recording-time {
    font-size: 1.2em;
    font-weight: 600;
    color: var(--error);
    font-family: 'Courier New', monospace;
}

.recording-controls {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.btn-start {
    background: var(--accent);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background 0.3s;
    font-weight: 600;
}

.btn-start:hover {
    background: var(--accent-hover);
}

.btn-stop {
    background: var(--error);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background 0.3s;
}

.btn-stop:hover {
    background: #d32f2f;
}

.btn-cancel {
    background: var(--bg-primary);
    color: var(--text-primary);
    border: 1px solid var(--border);
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background 0.3s;
}

.btn-cancel:hover {
    background: var(--bg-secondary);
}

.message-gif {
    max-width: 300px;
    max-height: 300px;
    width: auto;
    height: auto;
    border-radius: 8px;
    object-fit: contain;
}

.youtube-wrapper {
    margin-top: 5px;
    width: 100%;
    max-width: 560px;
}

.youtube-embed {
    width: 100%;
    height: 315px;
    max-width: 560px;
    border-radius: 8px;
    border: none;
}

.youtube-link {
    color: var(--accent);
    text-decoration: none;
    display: inline-block;
    padding: 10px;
    background: var(--bg-tertiary);
    border-radius: 6px;
    transition: background 0.3s;
}

.youtube-link:hover {
    background: var(--bg-primary);
    text-decoration: underline;
}

@media (max-width: 768px) {
    .youtube-embed {
        height: 200px;
    }
}

/* Panel wysyłania */
.message-input-container {
    background: var(--bg-secondary);
    padding: 15px;
    border-top: 1px solid var(--border);
    position: relative;
    z-index: 10;
}

.input-toolbar {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.btn-icon {
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-primary);
    cursor: pointer;
    font-size: 1.2em;
    transition: background 0.3s;
}

.btn-icon:hover {
    background: var(--bg-primary);
}

.input-wrapper {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

#message-input {
    flex: 1;
    padding: 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 1em;
    font-family: inherit;
    resize: none;
    max-height: 120px;
    min-height: 44px;
}

#message-input:focus {
    outline: none;
    border-color: var(--accent);
}

.btn-send {
    padding: 12px 24px;
    background: #39ff14; /* Neon zielony */
    color: #000000; /* Czarny tekst */
    border: none;
    border-radius: 6px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
    white-space: nowrap;
}

.btn-send:hover {
    background: #32e60f; /* Nieco ciemniejszy neon zielony przy hover */
}

.preview-container {
    margin-top: 10px;
}

.preview-image {
    position: relative;
    display: inline-block;
    max-width: 200px;
    margin-right: 10px;
}

.preview-image img {
    max-width: 100%;
    border-radius: 6px;
}

.preview-image .remove-preview {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--error);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 14px;
}

/* Emoji Picker */
.emoji-picker {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    display: none;
    z-index: 1000;
    max-width: 90%;
    width: 350px;
}

.emoji-picker.active {
    display: block;
}

.emoji-categories {
    display: flex;
    gap: 5px;
    margin-bottom: 10px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 10px;
}

.emoji-category {
    padding: 8px;
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.5em;
    transition: background 0.3s;
}

.emoji-category:hover,
.emoji-category.active {
    background: var(--bg-tertiary);
}

.emoji-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 5px;
    max-height: 200px;
    overflow-y: auto;
}

.emoji-item {
    padding: 8px;
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.5em;
    transition: background 0.2s;
    text-align: center;
}

.emoji-item:hover {
    background: var(--bg-tertiary);
}

/* GIF Picker */
.gif-picker {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    display: none;
    z-index: 1000;
    max-width: 90%;
    width: 400px;
    max-height: 400px;
    overflow-y: auto;
}

.gif-picker.active {
    display: block;
}

.gif-search {
    width: 100%;
    padding: 10px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-primary);
    margin-bottom: 15px;
}

.gif-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.gif-item {
    cursor: pointer;
    border-radius: 6px;
    overflow: hidden;
    transition: transform 0.2s;
}

.gif-item:hover {
    transform: scale(1.05);
}

.gif-item img {
    width: 100%;
    height: auto;
    display: block;
}

/* Responsywność */
@media (max-width: 768px) {
    .mobile-menu-wrap {
        display: flex;
    }

    .btn-mobile-menu {
        display: block;
        flex-shrink: 0;
    }
    
    .users-sidebar {
        position: fixed;
        right: -250px;
        top: 60px;
        height: calc(100vh - 60px);
        z-index: 100;
        transition: right 0.3s;
        box-shadow: -2px 0 8px rgba(0, 0, 0, 0.3);
    }
    
    .users-sidebar.active {
        right: 0;
    }
    
    .chat-header-brand {
        flex: 1;
        justify-content: center;
        flex-wrap: wrap;
        row-gap: 6px;
    }

    .chat-header-brand h1 {
        flex: 1 1 auto;
        text-align: center;
        font-size: 1.15em;
        white-space: normal;
    }

    .chat-header-logo {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }

    .chat-header-brand .btn-home {
        min-height: 40px;
        padding: 8px 14px;
        font-size: 0.82rem;
    }
    
    .message-content {
        max-width: 85%;
    }
    
    .emoji-picker,
    .gif-picker {
        width: 90%;
        left: 5%;
        transform: none;
        bottom: 100px;
    }
    
    .input-toolbar {
        flex-wrap: wrap;
    }
    
    .btn-icon {
        font-size: 1em;
        padding: 6px 10px;
    }
    
    /* Panel wysyłania na telefonie */
    .message-input-container {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        padding: 10px;
        z-index: 1000;
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3);
    }
    
    .chat-area {
        padding-bottom: 150px;
    }
    
    .messages-container {
        padding-bottom: 50px;
    }
    
    #message-input {
        font-size: 16px; /* Zapobiega zoomowaniu na iOS */
        min-height: 44px;
    }
    
    .btn-send {
        padding: 10px 16px;
        font-size: 0.9em;
        white-space: nowrap;
    }
    
    .input-wrapper {
        gap: 8px;
    }
}

/* Modal do powiększania zdjęć */
.image-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    cursor: pointer;
}

.modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    z-index: 10001;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-image {
    max-width: 100%;
    max-height: 90vh;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.modal-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
    z-index: 10002;
}

.modal-close:hover {
    background: var(--error);
}

/* Modal wyboru czasu bana */
.ban-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.ban-modal-content {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    z-index: 10001;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border);
}

.ban-modal-content h2 {
    margin-bottom: 15px;
    color: var(--error);
    font-size: 1.5em;
}

.ban-modal-username {
    font-size: 1.2em;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 10px;
    padding: 10px;
    background: var(--bg-tertiary);
    border-radius: 6px;
    text-align: center;
}

.ban-modal-subtitle {
    color: var(--text-secondary);
    margin-bottom: 20px;
    text-align: center;
}

.ban-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.color-options {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.color-option-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 3px solid var(--border);
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.color-option-btn:hover {
    transform: scale(1.15);
    border-color: var(--text-primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.ban-option-btn {
    background: var(--bg-tertiary);
    border: 2px solid var(--border);
    color: var(--text-primary);
    padding: 15px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    transition: all 0.3s;
    font-weight: 500;
}

.ban-option-btn:hover {
    background: var(--error);
    border-color: var(--error);
    color: white;
    transform: translateY(-2px);
}

.ban-cancel-btn {
    width: 100%;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    transition: all 0.3s;
}

.ban-cancel-btn:hover {
    background: var(--bg-primary);
    color: var(--text-primary);
}

@media (max-width: 768px) {
    .ban-options {
        grid-template-columns: 1fr;
    }
    
    .ban-modal-content {
        padding: 20px;
        width: 95%;
    }
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

/* Scrollbar dla listy użytkowników */
.users-list::-webkit-scrollbar {
    width: 6px;
}

.users-list::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 3px;
}

.users-list::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 3px;
}

.users-list::-webkit-scrollbar-thumb:hover {
    background: var(--border);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border);
}

