* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    display: block;
    max-width: 100%;
    height: auto;
}

button,
input,
select,
textarea {
    font: inherit;
    touch-action: manipulation;
}

.container {
    width: min(94%, 1440px);
    margin: 0 auto;
}

.site-header {
    position: relative;
    z-index: 10;
}

.site-header__inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 18px;
    padding: 24px 0 20px;
}

.site-header__left,
.site-header__right {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.site-header__left {
    justify-self: start;
}

.site-header__left--empty {
    min-width: 108px;
}

.site-header__right {
    justify-self: end;
}

.site-header__brand {
    justify-self: center;
    color: #1b49d5;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.01em;
    white-space: nowrap;
}

.site-header__spacer {
    display: block;
    width: 108px;
    height: 44px;
    visibility: hidden;
}

.lang-switch {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 44px;
    padding: 4px;
    border: 1px solid rgba(27, 73, 213, 0.12);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 14px 34px rgba(25, 59, 146, 0.08);
}

.lang-switch__option {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 52px;
    min-height: 36px;
    padding: 8px 14px;
    border-radius: 12px;
    color: #68708f;
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.lang-switch__option:hover {
    color: #1b49d5;
}

.lang-switch__option:focus-visible {
    outline: 2px solid rgba(27, 73, 213, 0.28);
    outline-offset: 2px;
}

.lang-switch__option.is-active {
    background: linear-gradient(135deg, #1b49d5 0%, #3d74ff 100%);
    color: #ffffff;
    box-shadow: 0 10px 24px rgba(27, 73, 213, 0.28);
}

@media (max-width: 760px) {
    .container {
        width: min(100% - 32px, 1440px);
    }

    .site-header__inner {
        grid-template-columns: auto minmax(0, 1fr) auto;
        gap: 12px;
        padding: 18px 0 12px;
    }

    .site-header__brand {
        grid-column: auto;
        justify-self: start;
    }

    .site-header__left--empty {
        display: none;
    }

    .site-header__left {
        justify-content: flex-start;
    }

    .site-header__right {
        grid-column: -1;
        justify-self: end;
        justify-content: flex-end;
    }

    .site-header__spacer {
        display: none;
    }

    .lang-switch {
        width: fit-content;
    }

    .lang-switch__option {
        min-width: 46px;
    }
}

@media (max-width: 520px) {
    .container {
        width: min(100% - 24px, 1440px);
    }

    .site-header__inner {
        gap: 10px;
        padding: 16px 0 10px;
    }

    .site-header__left,
    .site-header__right {
        gap: 8px;
    }

    .site-header__brand {
        font-size: 18px;
    }

    .lang-switch {
        min-height: 40px;
        padding: 3px;
        border-radius: 12px;
    }

    .lang-switch__option {
        min-width: 42px;
        min-height: 34px;
        padding: 8px 12px;
        border-radius: 10px;
        font-size: 13px;
    }
}

/* Activity feed toasts (live participant activity) */
.activity-feed {
    position: fixed;
    left: 24px;
    bottom: 24px;
    z-index: 1000;
    width: 320px;
    max-width: calc(100vw - 48px);
    pointer-events: none;
    font-family: 'Inter', system-ui, sans-serif;
}

.activity-toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: #fff;
    border-radius: 16px;
    border: 1px solid rgba(43, 95, 237, 0.08);
    box-shadow:
        0 12px 28px rgba(34, 51, 105, 0.10),
        0 2px 6px rgba(34, 51, 105, 0.06);
    pointer-events: auto;
    opacity: 0;
    transform: translateY(16px) scale(0.96);
    transition:
        opacity 0.32s ease,
        transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

.activity-toast.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.activity-toast.is-leaving {
    opacity: 0;
    transform: translateY(8px) scale(0.97);
    transition-duration: 0.24s;
}

.activity-toast__level {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, #2b5fed 0%, #5a85ff 100%);
    box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.activity-toast__level-img {
    width: 30px;
    height: 30px;
    object-fit: contain;
    display: block;
}

.activity-toast__level-fallback {
    color: #fff;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0.02em;
}

.activity-toast__body {
    flex: 1;
    min-width: 0;
}

.activity-toast__text {
    font-size: 13px;
    line-height: 1.4;
    color: #1c1c28;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.activity-toast__meta {
    font-size: 11px;
    color: #8a8da3;
    margin-top: 2px;
    letter-spacing: 0.02em;
}

.activity-toast__close {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #8a8da3;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    border-radius: 8px;
    transition: background 0.2s ease, color 0.2s ease;
}

.activity-toast__close:hover {
    background: rgba(34, 51, 105, 0.06);
    color: #1c1c28;
}

@media (max-width: 600px) {
    .activity-feed {
        left: 16px;
        right: 16px;
        bottom: 16px;
        width: auto;
        max-width: none;
    }

    .activity-toast {
        padding: 10px 12px;
        border-radius: 14px;
        transform: translateY(140%);
    }

    .activity-toast.is-visible {
        transform: translateY(0);
    }

    .activity-toast.is-leaving {
        opacity: 0;
        transform: translateY(140%);
    }

    .activity-toast__text { font-size: 12.5px; }
    .activity-toast__level { width: 40px; height: 40px; }
    .activity-toast__level-img { width: 28px; height: 28px; }
}

@media (prefers-reduced-motion: reduce) {
    .activity-toast,
    .activity-toast.is-visible,
    .activity-toast.is-leaving {
        transform: none;
        transition: opacity 0.2s ease;
    }
}
