header {
    margin-bottom: 20px;
}

.app-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5em;
    margin: 10px 0 15px 0;
    color: #2c3e50;
}

.main-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    justify-content: space-between;
    background: #fff;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #e1e6ef;
    box-shadow: 0 2px 5px rgba(0,0,0,0.03);
}

.nav-zone {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.nav-left {
    flex: 1;
}

.nav-right {
    margin-left: auto;
}

.nav-link {
    text-decoration: none;
    color: #555;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.95em;
    font-weight: 500;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.nav-link:hover {
    background-color: #f0f8ff;
    color: #0077cc;
}

.nav-link.active {
    background-color: #eef6ff;
    color: #0077cc;
    font-weight: bold;
}

.nav-dropdown {
    position: relative;
    display: inline-flex;
}

.nav-dropbtn {
    border: 0;
    background: transparent;
    cursor: pointer;
    font-family: inherit;
}

.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 245px;
    background: #fff;
    border: 1px solid #e1e6ef;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.10);
    padding: 8px;
    z-index: 2000;
}

.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown.open .nav-dropdown-menu {
    display: block;
}

.nav-dropdown-menu a {
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 9px 10px;
    color: #444;
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.92em;
    white-space: nowrap;
}

.nav-dropdown-menu a:hover {
    background: #f0f8ff;
    color: #0077cc;
}

.nav-dropdown-menu a.active {
    background: #eef6ff;
    color: #0077cc;
    font-weight: bold;
}

.nav-subdropdown {
    position: relative;
}

.nav-subdrop-link {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: space-between;
    padding: 9px 10px;
    color: #444;
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.92em;
    white-space: nowrap;
}

.nav-subdrop-link:hover {
    background: #f0f8ff;
    color: #0077cc;
}

.nav-sub-arrow {
    margin-left: auto;
    color: #a0aec0;
    font-weight: bold;
}

.nav-subdropdown-menu {
    display: none;
    position: absolute;
    top: -8px;
    left: calc(100% - 1px);
    min-width: 255px;
    background: #fff;
    border: 1px solid #e1e6ef;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    padding: 8px;
    z-index: 3000;
}

.nav-subdropdown:hover .nav-subdropdown-menu,
.nav-subdropdown.open .nav-subdropdown-menu {
    display: block;
}

.nav-subdropdown-menu a {
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 9px 10px;
    color: #444;
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.92em;
    white-space: nowrap;
}

.nav-subdropdown-menu a:hover {
    background: #f0f8ff;
    color: #0077cc;
}

.nav-subdropdown-menu a.active {
    background: #eef6ff;
    color: #0077cc;
    font-weight: bold;
}

.nav-link.logout {
    color: #dc3545;
}

.nav-link.logout:hover {
    background-color: #fff5f5;
}

.nav-link.profile {
    color: #222;
    font-weight: bold;
}

.nav-link.profile:hover {
    background-color: #f9f9f9;
}

.admin-badge {
    background: #333;
    color: #fff;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75em;
    margin-left: 5px;
}

.admin-mini-bar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex: 1 1 100%;
    color: #4a5568;
    font-size: 0.88em;
}

.nav-sep {
    width: 1px;
    height: 24px;
    background: #ddd;
    margin: 0 5px;
}

.desktop-only {
    display: inline;
}

@media (max-width: 600px) {
    body.is-user-logged,
    body.is-user-guest {
        padding-bottom: 75px !important;
    }

    body.is-user-logged .main-nav,
    body.is-user-guest .main-nav {
        display: none !important;
    }

    body.is-user-guest .nav-sep {
        display: none;
    }

    body.is-user-guest .nav-link {
        flex: 1 1 auto;
        justify-content: center;
        white-space: nowrap;
    }

    .desktop-only {
        display: none;
    }

    .bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        background: #fff;
        border-top: 1px solid #e2e8f0;
        box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
        z-index: 1000;
        align-items: stretch;
        justify-content: space-around;
        padding: 8px 0;
        padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
    }

    .bottom-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-decoration: none;
        color: #718096;
        font-size: 0.72rem;
        font-weight: 600;
        gap: 3px;
        flex: 1;
        min-width: 0;
        min-height: 52px;
        padding: 0 3px;
        line-height: 1.1;
        font-family: inherit;
        border: 0;
        background: transparent;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }

    .bottom-nav-item .icon {
        font-size: 1.35rem;
        line-height: 1;
    }

    .bottom-nav-item .label {
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .bottom-nav-item.active,
    .bottom-nav-item:active {
        color: #0077cc;
    }

    .bottom-nav-guest .bottom-nav-item {
        flex: 1 1 0;
        flex-basis: 0;
    }

    .bottom-nav-register {
        position: relative;
        flex: 1.35 1 0;
        min-height: 58px;
        margin: -15px 4px 0 4px;
        border-radius: 17px 17px 12px 12px;
        background: linear-gradient(135deg, #2f855a 0%, #38a169 55%, #2b6cb0 100%);
        color: #fff !important;
        box-shadow: 0 8px 18px rgba(47, 133, 90, 0.35);
        border: 1px solid rgba(255,255,255,0.35);
    }

    .bottom-nav-register .icon {
        font-size: 1.48rem;
        color: #fff;
    }

    .bottom-nav-register .label {
        color: #fff;
        font-size: 0.75rem;
        font-weight: 900;
        white-space: normal;
        line-height: 1.05;
        text-align: center;
    }

    .bottom-nav-register.active,
    .bottom-nav-register:active {
        color: #fff;
        transform: translateY(1px);
        box-shadow: 0 5px 12px rgba(47, 133, 90, 0.3);
    }

    .bottom-more-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.5);
        z-index: 1001;
        opacity: 0;
        transition: opacity 0.3s;
    }

    .bottom-more-overlay.active {
        display: block;
        opacity: 1;
    }

    .bottom-more-menu {
        position: fixed;
        bottom: -100%;
        left: 0;
        width: 100%;
        background: #fff;
        border-radius: 15px 15px 0 0;
        z-index: 1002;
        transition: bottom 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
        padding-bottom: env(safe-area-inset-bottom, 0);
        box-shadow: 0 -5px 15px rgba(0,0,0,0.1);
    }

    .bottom-more-menu.active {
        bottom: 0;
    }

    .bottom-more-content {
        padding: 20px;
        max-height: 75vh;
        overflow-y: auto;
    }

    .bottom-more-section {
        font-weight: 700;
        color: #a0aec0;
        font-size: 0.75rem;
        text-transform: uppercase;
        margin-top: 15px;
        margin-bottom: 5px;
        border-bottom: 1px solid #edf2f7;
        padding-bottom: 5px;
        letter-spacing: 0.5px;
    }

    .bottom-more-section:first-child {
        margin-top: 0;
    }

    .bottom-more-content a {
        display: flex;
        padding: 12px 10px;
        color: #2d3748;
        text-decoration: none;
        font-weight: 500;
        font-size: 1rem;
        align-items: center;
        gap: 12px;
        border-radius: 8px;
        transition: background 0.2s;
    }

    .bottom-more-content a:active {
        background: #edf2f7;
    }

    .bottom-more-content a.bottom-register-panel {
        justify-content: center;
        margin: 4px 0 8px 0;
        padding: 14px 12px;
        background: linear-gradient(135deg, #2f855a 0%, #38a169 55%, #2b6cb0 100%);
        color: #fff !important;
        font-weight: 900;
        box-shadow: 0 8px 18px rgba(47, 133, 90, 0.25);
    }

    .bottom-more-content a.bottom-register-panel:active {
        background: linear-gradient(135deg, #276749 0%, #2f855a 55%, #2c5282 100%);
    }

    .bottom-more-content a.bottom-login-panel {
        justify-content: center;
        border: 1px solid #bee3f8;
        background: #ebf8ff;
        color: #2b6cb0;
        font-weight: 800;
    }

    .bottom-facebook-link {
        align-items: center;
    }

    .bottom-facebook-icon {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 24px;
        height: 24px;
        border-radius: 50%;
        background: #1877f2;
        color: #fff;
        font-family: Arial, Helvetica, sans-serif;
        font-weight: 800;
        line-height: 1;
    }

    .bottom-admin-link {
        color: #2b6cb0 !important;
    }

    .bottom-logout-link {
        color: #c53030 !important;
    }

    .close-bottom-menu {
        position: absolute;
        top: 12px;
        right: 15px;
        background: #edf2f7;
        border: none;
        width: 30px;
        height: 30px;
        border-radius: 50%;
        font-size: 1.2rem;
        color: #4a5568;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

@media (max-width: 360px) {
    .bottom-nav-register .label {
        font-size: 0.68rem;
    }

    .bottom-nav-item .label {
        font-size: 0.68rem;
    }
}

@media (min-width: 601px) {
    .bottom-nav,
    .bottom-more-overlay,
    .bottom-more-menu {
        display: none !important;
    }
}

.facebook-logo-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 1.15rem;
    font-weight: 800;
    line-height: 1;
    transform: translateY(1px);
}
.nav-link-primary {
    background: #eef6ff;
    color: #006fbf;
    font-weight: 700;
}

.nav-link-primary:hover {
    background: #e0f0ff;
    color: #005fa3;
}
@media (min-width: 601px) {
    .nav-prediction-ball {
        display: inline-block;
        line-height: 1;
        transform-origin: center;
        animation: nav-prediction-ball-spin 3.6s linear infinite;
    }
}

@keyframes nav-prediction-ball-spin {
    to {
        transform: rotate(360deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    .nav-prediction-ball {
        animation: none;
    }
}

.nav-chat-link {
    color: #1f6feb;
    font-weight: 700;
}

.nav-chat-link:hover {
    background: #edf6ff;
    color: #0b5dc2;
}

.nav-register-cta {
    background: #1877f2;
    color: #fff !important;
    font-weight: 800;
    box-shadow: 0 3px 10px rgba(24, 119, 242, 0.18);
}

.nav-register-cta:hover {
    background: #166fe5 !important;
    color: #fff !important;
    transform: translateY(-1px);
    box-shadow: 0 5px 14px rgba(24, 119, 242, 0.24);
}

.nav-register-cta.active {
    background: #155ec4;
    color: #fff;
}

.nav-align-right {
    left: auto;
    right: 0;
}

.profile-dropdown .nav-dropdown-menu {
    min-width: 190px;
}

.profile-nav-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.profile-avatar-mini {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    overflow: hidden;
    background: #e2e8f0;
    font-size: 1.1em;
    flex: 0 0 auto;
}

.profile-avatar-mini img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.nav-dropdown-menu a.logout {
    color: #dc3545;
}

.nav-dropdown-menu a.logout:hover {
    background-color: #fff5f5;
    color: #dc3545;
}

.menu-facebook-inline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #1877f2;
    color: #fff;
    font-family: Arial, Helvetica, sans-serif;
    font-weight: 800;
    line-height: 1;
    font-size: 0.86rem;
}

/* Delikatne animacje najwazniejszych akcji w menu mobilnym */
.mobile-typy-icon,
.mobile-chat-icon {
    display: inline-block;
    will-change: transform;
}

.mobile-typy-icon {
    transform-origin: 50% 100%;
    animation: mobileTypyBall 2.8s ease-in-out infinite;
}

.mobile-chat-icon {
    transform-origin: 35% 90%;
    animation: mobileChatBubble 3.2s ease-in-out infinite;
}

@keyframes mobileTypyBall {
    0%, 66%, 100% { transform: translateY(0) rotate(0deg); }
    72% { transform: translateY(-5px) rotate(-12deg); }
    78% { transform: translateY(0) rotate(8deg); }
    84% { transform: translateY(-2px) rotate(-4deg); }
    90% { transform: translateY(0) rotate(0deg); }
}

@keyframes mobileChatBubble {
    0%, 68%, 100% { transform: scale(1) rotate(0deg); }
    75% { transform: scale(1.12) rotate(-4deg); }
    82% { transform: scale(1.04) rotate(3deg); }
    89% { transform: scale(1.1) rotate(-2deg); }
    95% { transform: scale(1) rotate(0deg); }
}

@media (prefers-reduced-motion: reduce) {
    .mobile-typy-icon,
    .mobile-chat-icon {
        animation: none;
    }
}

/* Desktop: logo i menu w jednym wierszu */
@media (min-width: 901px) {
    body > .container > header {
        display: grid;
        grid-template-columns: clamp(150px, 12vw, 205px) minmax(0, 1fr);
        align-items: center;
        gap: 14px;
        padding: 10px 0 12px;
    }

    body > .container > header .brand-strip {
        width: auto;
        min-width: 0;
        margin: 0;
        justify-content: flex-start;
    }

    body > .container > header .app-brand {
        display: block;
        max-width: 100%;
    }

    body > .container > header .logo-container img {
        display: block;
        width: auto;
        height: clamp(60px, 4.6vw, 76px);
        max-width: 100%;
        object-fit: contain;
    }

    body > .container > header .main-nav {
        width: 100%;
        min-width: 0;
        margin: 0;
        padding: 8px 10px;
        gap: 5px;
        border: 0;
        border-radius: 0;
        box-shadow: none;
        background: transparent;
    }

    body > .container > header .nav-zone {
        min-width: 0;
        gap: 4px;
    }

    body > .container > header .nav-link {
        padding: 7px 9px;
        font-size: 0.93em;
    }

    body > .container > header a.nav-link.nav-facebook-link {
        flex: 0 0 34px;
        width: 34px;
        height: 34px;
        padding: 0;
        box-sizing: border-box;
        font-size: 1.08em;
    }
}

@media (min-width: 901px) and (max-width: 1180px) {
    body > .container > header {
        grid-template-columns: 130px minmax(0, 1fr);
        gap: 10px;
    }

    body > .container > header .logo-container img {
        height: 58px;
    }

    body > .container > header .nav-link {
        padding: 6px 7px;
        font-size: 0.86em;
    }
}