@import url('https://fonts.googleapis.com/css2?family=Caveat:wght@700&display=swap');

:root {
    --background: oklch(0.2569 0.0169 352.4042);
    --foreground: oklch(0.9397 0.0119 51.3156);
    --card: oklch(0.3184 0.0176 341.4465);
    --primary: oklch(0.7357 0.1641 34.7091);
    --primary-foreground: oklch(1.0000 0 0);
    --secondary: oklch(0.3637 0.0203 342.2664);
    --muted: oklch(0.2848 0.0159 343.6554);
    --muted-foreground: oklch(0.8378 0.0237 52.6346);
    --accent: oklch(0.8278 0.1131 57.9984);
    --destructive: oklch(0.6122 0.2082 22.2410);
    --border: oklch(0.3637 0.0203 342.2664);
    --radius: 0.625rem;
    --font-sans: 'Montserrat', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Selection colors - default theme */
::selection {
    background: oklch(0.7357 0.1641 34.7091 / 0.4);
    color: white;
}

/* New Year theme selection */
body.newyear-theme ::selection {
    background: oklch(0.55 0.2 140 / 0.4);
    color: white;
}

/* Hide scrollbar globally */
* {
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE/Edge */
}

*::-webkit-scrollbar {
    display: none;
    /* Chrome, Safari, Opera */
}

body {
    font-family: var(--font-sans);
    background: var(--background);
    color: var(--foreground);
    min-height: 100vh;
    overflow-x: hidden;
}

/* ========== ANIMATED BACKGROUND ========== */
.animated-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.animated-bg::before {
    content: '';
    position: absolute;
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, oklch(0.7357 0.1641 34.7091 / 0.1) 0%, transparent 60%);
    top: -200px;
    right: -200px;
    animation: orbFloat 15s ease-in-out infinite;
}

.animated-bg::after {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, oklch(0.8278 0.1131 57.9984 / 0.08) 0%, transparent 60%);
    bottom: -150px;
    left: -150px;
    animation: orbFloat 20s ease-in-out infinite reverse;
}

@keyframes orbFloat {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    50% {
        transform: translate(30px, -30px) scale(1.1);
    }
}

.grid-lines {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(oklch(0.7357 0.1641 34.7091 / 0.03) 1px, transparent 1px),
        linear-gradient(90deg, oklch(0.7357 0.1641 34.7091 / 0.03) 1px, transparent 1px);
    background-size: 80px 80px;
    animation: gridMove 30s linear infinite;
}

@keyframes gridMove {
    to {
        transform: translate(80px, 80px);
    }
}

.floating-icons {
    position: absolute;
    inset: 0;
}

.float-icon {
    position: absolute;
    font-weight: 800;
    color: var(--primary);
    opacity: 0;
    animation: floatUp 20s linear infinite;
}

.float-icon:nth-child(1) {
    left: 5%;
    font-size: 1.5rem;
    animation-delay: 0s;
}

.float-icon:nth-child(2) {
    left: 15%;
    font-size: 2rem;
    animation-delay: 2.5s;
}

.float-icon:nth-child(3) {
    left: 30%;
    font-size: 1.2rem;
    animation-delay: 5s;
}

.float-icon:nth-child(4) {
    left: 45%;
    font-size: 1.8rem;
    animation-delay: 7.5s;
}

.float-icon:nth-child(5) {
    left: 60%;
    font-size: 1.4rem;
    animation-delay: 10s;
}

.float-icon:nth-child(6) {
    left: 75%;
    font-size: 1.6rem;
    animation-delay: 12.5s;
}

.float-icon:nth-child(7) {
    left: 85%;
    font-size: 2.2rem;
    animation-delay: 15s;
}

.float-icon:nth-child(8) {
    left: 95%;
    font-size: 1.3rem;
    animation-delay: 17.5s;
}

@keyframes floatUp {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }

    5% {
        opacity: 0.15;
    }

    95% {
        opacity: 0.15;
    }

    100% {
        transform: translateY(-50px) rotate(180deg);
        opacity: 0;
    }
}

.noise {
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    opacity: 0.02;
}

/* ========== BETA BADGE ========== */
.beta-badge {
    position: fixed;
    top: 12px;
    right: 12px;
    z-index: 9999;
    background: oklch(0.3 0.01 240 / 0.6);
    color: oklch(0.6 0.02 240);
    font-size: 0.6rem;
    font-weight: 600;
    padding: 5px 8px;
    border-radius: 4px;
    letter-spacing: 1px;
    border: 1px solid oklch(0.4 0.02 240 / 0.3);
    pointer-events: none;
}

/* ========== SCREENS ========== */
.screen {
    display: none;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

.screen.active {
    display: flex;
}

/* ========== LOBBY ========== */
.lobby-slider {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
}

.slide {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.5s ease, opacity 0.5s ease;
    opacity: 0;
    pointer-events: none;
}

.slide.active {
    opacity: 1;
    pointer-events: auto;
}

.slide-menu {
    transform: translateX(0);
}

.slide-menu.slide-left {
    transform: translateX(-100%);
    opacity: 0;
}

.slide-room {
    transform: translateX(100%);
}

.slide-room.active {
    transform: translateX(0);
}

.slide-join {
    transform: translateX(100%);
}

.slide-join.active {
    transform: translateX(0);
}

.slide-join.slide-left {
    transform: translateX(-100%);
    opacity: 0;
}

/* ========== MAIN MENU ========== */
.menu-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    max-width: 700px;
    width: 95%;
    padding: 30px 20px;
}

.menu-header {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
}

.menu-title {
    font-size: 2.2rem;
    font-weight: 800;
    text-align: center;
    line-height: 1.2;
    margin-bottom: 4px;
}

.title-accent {
    display: block;
    color: var(--primary);
    font-size: 2.6rem;
    text-shadow: 0 4px 20px oklch(0.7357 0.1641 34.7091 / 0.3);
}

.menu-desc {
    color: var(--muted-foreground);
    font-size: 0.95rem;
    text-align: center;
    line-height: 1.5;
    margin-top: 8px;
    margin-bottom: 24px;
    max-width: 400px;
}

/* Двухколоночный layout */
.menu-layout {
    display: flex;
    gap: 16px;
    width: auto;
    align-items: stretch;
    justify-content: center;
}

.menu-left {
    flex: 0 0 320px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 12px;
    width: 320px;
    max-width: 320px;
}

.menu-right {
    flex: 0 0 300px;
    width: 300px;
    display: flex;
    justify-content: flex-start;
    align-items: stretch;
}

/* Карточка профиля - NFT стиль */
.profile-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* Аватарка - кружок */
.profile-avatar-wrap {
    position: relative;
    width: 150px;
    height: 150px;
    cursor: pointer;
    margin: 24px auto 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile-avatar-wrap:hover .profile-avatar {
    transform: scale(1.05);
}

.profile-card .profile-avatar {
    width: 125px !important;
    height: 125px !important;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3.5rem;
    font-weight: 700;
    color: white;
    transition: transform 0.3s ease;
    z-index: 1;
}

/* XP кольцо */
.profile-xp-ring {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.profile-xp-ring svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.profile-xp-ring .ring-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.15);
    stroke-width: 4;
}

.profile-xp-ring .ring-fill {
    fill: none;
    stroke: var(--primary);
    stroke-width: 4;
    stroke-linecap: round;
    stroke-dasharray: 289;
    stroke-dashoffset: 289;
    transition: stroke-dashoffset 0.5s ease;
}

/* Уровень - бейдж в углу аватарки */
.profile-level {
    position: absolute;
    top: -5px;
    right: -5px;
    width: auto;
    height: auto;
    padding: 5px 10px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: #fff;
    z-index: 10;
}

.profile-level::before {
    content: 'LVL ';
    font-weight: 500;
    opacity: 0.7;
}

/* Контент карточки */
.profile-card-content {
    width: 100%;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Ник */
.profile-nick {
    background: transparent;
    border: none;
    padding: 16px 20px 0;
    color: #fff;
    font-size: 1.4rem;
    font-weight: 800;
    font-family: inherit;
    outline: none;
    width: 100%;
    text-align: center;
}

.profile-nick::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

/* Титул */
.profile-title {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary);
    padding: 6px 14px;
    margin: 0 auto;
    background: rgba(var(--primary), 0.1);
    background: linear-gradient(135deg, rgba(212, 105, 58, 0.15) 0%, rgba(212, 105, 58, 0.05) 100%);
    border: 1px solid rgba(212, 105, 58, 0.3);
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.profile-title:empty {
    display: none;
}

/* Значки */
.profile-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
    padding: 0 20px;
}

.profile-badges:empty {
    display: none;
}

.badge {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    transition: transform 0.2s, background 0.2s;
}

.badge:hover {
    transform: scale(1.15);
    background: var(--secondary);
}

.badge img {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

/* Статистика - тёмные блоки */
.profile-stats {
    display: flex;
    gap: 10px;
    width: 100%;
    padding: 12px 20px 20px;
}

.profile-stat {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 14px 12px;
    background: var(--muted);
    border-radius: 14px;
}

.stat-label {
    font-size: 0.65rem;
    color: var(--muted-foreground);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.stat-value {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--primary);
}

/* XP - под рамкой */
.profile-xp {
    width: 100%;
    padding: 0;
    text-align: center;
    margin-bottom: 8px;
}

.xp-text {
    font-size: 0.85rem;
    color: var(--muted-foreground);
    font-weight: 500;
}

.badge {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: var(--muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    transition: transform 0.2s;
}

.badge:hover {
    transform: scale(1.15);
    z-index: 10;
}

.badge img {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.badge-tooltip {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 8px 12px;
    white-space: nowrap;
    font-size: 0.75rem;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
    z-index: 100;
    pointer-events: none;
}

.badge-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: var(--border);
}

.badge:hover .badge-tooltip {
    opacity: 1;
    visibility: visible;
}

.badge-tooltip-title {
    font-weight: 600;
    color: var(--foreground);
}

.badge-tooltip-desc {
    color: var(--muted-foreground);
    margin-top: 2px;
}

.xp-current {
    font-size: 0.9rem;
    color: var(--muted-foreground);
    font-weight: 500;
}

/* Статистика */
.profile-stats {
    display: flex;
    width: 100%;
    gap: 8px;
}

.profile-stat {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 10px 8px;
    background: var(--muted);
    border-radius: var(--radius);
}

.stat-value {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
}

.stat-label {
    font-size: 0.6rem;
    color: var(--muted-foreground);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Кнопка авторизации в карточке */
.btn-auth-card {
    width: calc(100% - 40px);
    margin: 0 20px 20px;
    padding: 14px 20px;
    background: var(--primary);
    border: none;
    border-radius: 14px;
    color: white;
    font-size: 0.9rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-auth-card:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
}

.btn-auth-card.logout {
    background: var(--muted);
    color: var(--muted-foreground);
}

.btn-auth-card.logout:hover {
    background: var(--destructive);
    color: white;
}

/* Адаптив для мобильных */
@media (max-width: 800px) {
    .menu-layout {
        flex-direction: column;
    }

    .menu-left,
    .menu-right {
        max-width: 100%;
    }

    .menu-center {
        max-width: 450px;
    }
}

/* Profile Row - всё в одной строке */
.profile-row {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) + 4px);
    padding: 10px 14px;
    width: 100%;
}

.profile-row .profile-avatar-wrap {
    position: relative;
    cursor: pointer;
    flex-shrink: 0;
}

.profile-row .player-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-foreground);
    transition: transform 0.2s;
}

.profile-row .player-avatar:hover {
    transform: scale(1.05);
}

.profile-row .profile-level-badge {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 20px;
    height: 20px;
    background: var(--accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 800;
    color: var(--background);
    border: 2px solid var(--card);
}

.profile-row .player-name-input {
    flex: 1;
    min-width: 80px;
    max-width: 140px;
    background: var(--muted);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 8px 10px;
    color: var(--foreground);
    font-size: 0.9rem;
    font-family: inherit;
    outline: none;
}

.profile-row .player-name-input:focus {
    border-color: var(--primary);
}

.profile-row .player-name-input::placeholder {
    color: var(--muted-foreground);
}

.profile-xp-section {
    flex: 1;
    min-width: 60px;
    max-width: 100px;
}

.profile-row .profile-xp-bar {
    height: 6px;
    background: var(--muted);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 2px;
}

.profile-row .profile-xp-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: 3px;
    transition: width 0.5s ease;
}

.profile-row .profile-xp-text {
    font-size: 0.6rem;
    color: var(--muted-foreground);
    text-align: center;
}

.profile-row .profile-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 8px;
    border-left: 1px solid var(--border);
}

.profile-row .profile-stat-value {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
}

.profile-row .profile-stat-label {
    font-size: 0.55rem;
    color: var(--muted-foreground);
    text-transform: uppercase;
}

/* Legacy player-card (для совместимости) */
.player-card {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) + 4px);
    padding: 16px 20px;
    width: 100%;
    max-width: 400px;
    margin: 0 auto 12px;
}

.player-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--primary-foreground);
    cursor: pointer;
    transition: transform 0.2s;
    flex-shrink: 0;
    background-size: cover;
    background-position: center;
    overflow: hidden;
}

.player-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.player-avatar:hover {
    transform: scale(1.1);
}

.player-name-input {
    flex: 1;
    min-width: 0;
    background: var(--muted);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 14px;
    color: var(--foreground);
    font-size: 1rem;
    font-family: inherit;
    outline: none;
}

.player-name-input:focus {
    border-color: var(--primary);
}

.player-name-input::placeholder {
    color: var(--muted-foreground);
}

/* Mode Card */
.mode-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) + 4px);
    padding: 14px 18px;
    width: 100%;
    max-width: 400px;
    margin: 0 auto 12px;
}

.mode-card.active {
    border-color: var(--destructive);
    background: linear-gradient(135deg, oklch(0.35 0.06 22 / 0.2), var(--card));
}



.mode-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mode-icon {
    font-size: 0.9rem;
    font-weight: 800;
    color: var(--destructive);
    background: oklch(0.6122 0.2082 22.2410 / 0.15);
    padding: 6px 10px;
    border-radius: var(--radius);
}

.mode-info {
    flex: 1;
}

.mode-title {
    font-weight: 600;
    font-size: 0.95rem;
}

.mode-title .danger {
    color: var(--destructive);
}

.mode-toggle {
    background: var(--muted);
    border: 2px solid var(--border);
    color: var(--muted-foreground);
    padding: 6px 16px;
    border-radius: 16px;
    font-weight: 700;
    font-size: 0.8rem;
    cursor: pointer;
    font-family: inherit;
}

.mode-toggle.active {
    background: var(--destructive);
    border-color: var(--destructive);
    color: white;
}

.modifiers-btn {
    display: none;
    width: 100%;
    margin-top: 12px;
    padding: 10px;
    background: oklch(0.6122 0.2082 22.2410 / 0.1);
    border: none;
    border-radius: var(--radius);
    color: var(--foreground);
    font-size: 0.85rem;
    font-family: inherit;
    cursor: pointer;
}

.mod-count {
    background: var(--destructive);
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 700;
    margin-left: 6px;
}

/* ========== BUTTONS ========== */
.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}

.btn-row {
    display: flex;
    gap: 12px;
    width: 100%;
}

.btn-row>.btn-play {
    flex: 1 1 0 !important;
    width: calc(50% - 6px) !important;
    min-width: 0 !important;
    max-width: calc(50% - 6px) !important;
}

.btn-row .btn-play .btn-text {
    white-space: nowrap;
}

.btn-play {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 16px;
    border: none;
    border-radius: calc(var(--radius) + 6px);
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    overflow: hidden;
    transition: all 0.2s;
    box-sizing: border-box;
}

.btn-play .btn-text {
    position: relative;
    z-index: 2;
}

.btn-play .btn-icon-main {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
}

.btn-play .btn-icon-main svg {
    width: 22px;
    height: 22px;
}

.btn-play .btn-pattern {
    position: absolute;
    inset: 0;
    z-index: 1;
    opacity: 0.2;
}

.btn-play:hover .btn-pattern {
    opacity: 0.35;
}

.btn-solo {
    background: linear-gradient(135deg, var(--primary), oklch(0.65 0.14 35));
    color: var(--primary-foreground);
}

.btn-solo .btn-pattern {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 150 80'%3E%3Ctext x='10' y='25' font-family='sans-serif' font-size='24' font-weight='800' fill='white' transform='rotate(-15 10 25)'%3E1%3C/text%3E%3Ctext x='50' y='20' font-family='sans-serif' font-size='16' font-weight='800' fill='white' transform='rotate(20 50 20)'%3E1%3C/text%3E%3Ctext x='90' y='30' font-family='sans-serif' font-size='32' font-weight='800' fill='white' transform='rotate(-8 90 30)'%3E1%3C/text%3E%3Ctext x='130' y='22' font-family='sans-serif' font-size='20' font-weight='800' fill='white' transform='rotate(12 130 22)'%3E1%3C/text%3E%3Ctext x='25' y='60' font-family='sans-serif' font-size='20' font-weight='800' fill='white' transform='rotate(10 25 60)'%3E1%3C/text%3E%3Ctext x='70' y='65' font-family='sans-serif' font-size='28' font-weight='800' fill='white' transform='rotate(-20 70 65)'%3E1%3C/text%3E%3Ctext x='115' y='58' font-family='sans-serif' font-size='18' font-weight='800' fill='white' transform='rotate(15 115 58)'%3E1%3C/text%3E%3C/svg%3E");
    background-size: 150px 80px;
    animation: drift 12s linear infinite;
}

.btn-solo:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px oklch(0.7357 0.1641 34.7091 / 0.4);
}

.btn-create,
.btn-join {
    background: var(--secondary);
    border: 1px solid var(--border);
    color: var(--foreground);
}

.btn-create .btn-pattern {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 60'%3E%3Ctext x='10' y='22' font-family='sans-serif' font-size='20' font-weight='800' fill='%23d4693a' transform='rotate(-12 10 22)'%3E+%3C/text%3E%3Ctext x='45' y='18' font-family='sans-serif' font-size='14' font-weight='800' fill='%23d4693a' transform='rotate(18 45 18)'%3E+%3C/text%3E%3Ctext x='75' y='28' font-family='sans-serif' font-size='26' font-weight='800' fill='%23d4693a' transform='rotate(-5 75 28)'%3E+%3C/text%3E%3Ctext x='20' y='48' font-family='sans-serif' font-size='16' font-weight='800' fill='%23d4693a' transform='rotate(15 20 48)'%3E+%3C/text%3E%3Ctext x='60' y='52' font-family='sans-serif' font-size='22' font-weight='800' fill='%23d4693a' transform='rotate(-18 60 52)'%3E+%3C/text%3E%3C/svg%3E");
    background-size: 100px 60px;
    animation: pulse-bg 6s ease-in-out infinite;
}

.btn-join .btn-pattern {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 60'%3E%3Ctext x='5' y='24' font-family='sans-serif' font-size='18' font-weight='800' fill='%23d4693a' transform='rotate(5 5 24)'%3E→%3C/text%3E%3Ctext x='35' y='18' font-family='sans-serif' font-size='12' font-weight='800' fill='%23d4693a' transform='rotate(-10 35 18)'%3E→%3C/text%3E%3Ctext x='65' y='28' font-family='sans-serif' font-size='24' font-weight='800' fill='%23d4693a' transform='rotate(12 65 28)'%3E→%3C/text%3E%3Ctext x='15' y='50' font-family='sans-serif' font-size='14' font-weight='800' fill='%23d4693a' transform='rotate(-8 15 50)'%3E→%3C/text%3E%3Ctext x='50' y='54' font-family='sans-serif' font-size='20' font-weight='800' fill='%23d4693a' transform='rotate(15 50 54)'%3E→%3C/text%3E%3Ctext x='85' y='45' font-family='sans-serif' font-size='16' font-weight='800' fill='%23d4693a' transform='rotate(-5 85 45)'%3E→%3C/text%3E%3C/svg%3E");
    background-size: 100px 60px;
    animation: slide-right 5s linear infinite;
}

.btn-create:hover,
.btn-join:hover {
    border-color: var(--primary);
    background: var(--card);
    transform: translateY(-2px);
}

/* Force equal width for create/join buttons */
#btnCreateRoom,
#btnJoinRoom {
    flex: 1 1 0 !important;
    width: 50% !important;
    min-width: 0 !important;
}

.btn-how {
    position: relative;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--muted-foreground);
    padding: 12px 20px;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: inherit;
    overflow: hidden;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-how .btn-icon-main {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-how .btn-icon-main svg {
    width: 18px;
    height: 18px;
}

.btn-how .btn-pattern {
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 150 50'%3E%3Ctext x='10' y='20' font-family='sans-serif' font-size='16' font-weight='800' fill='%23d4693a' transform='rotate(-12 10 20)'%3E?%3C/text%3E%3Ctext x='40' y='15' font-family='sans-serif' font-size='12' font-weight='800' fill='%23d4693a' transform='rotate(15 40 15)'%3E?%3C/text%3E%3Ctext x='70' y='25' font-family='sans-serif' font-size='20' font-weight='800' fill='%23d4693a' transform='rotate(-8 70 25)'%3E?%3C/text%3E%3Ctext x='100' y='18' font-family='sans-serif' font-size='14' font-weight='800' fill='%23d4693a' transform='rotate(10 100 18)'%3E?%3C/text%3E%3Ctext x='130' y='22' font-family='sans-serif' font-size='18' font-weight='800' fill='%23d4693a' transform='rotate(-15 130 22)'%3E?%3C/text%3E%3Ctext x='25' y='42' font-family='sans-serif' font-size='14' font-weight='800' fill='%23d4693a' transform='rotate(8 25 42)'%3E?%3C/text%3E%3Ctext x='60' y='40' font-family='sans-serif' font-size='10' font-weight='800' fill='%23d4693a' transform='rotate(-5 60 40)'%3E?%3C/text%3E%3Ctext x='95' y='45' font-family='sans-serif' font-size='16' font-weight='800' fill='%23d4693a' transform='rotate(12 95 45)'%3E?%3C/text%3E%3C/svg%3E");
    background-size: 150px 50px;
    opacity: 0.1;
    animation: wobble 8s ease-in-out infinite;
    z-index: 1;
}

.btn-how .btn-text {
    position: relative;
    z-index: 2;
}

.btn-how:hover {
    border-color: var(--primary);
    color: var(--foreground);
}

.btn-how:hover .btn-pattern {
    opacity: 0.25;
}

@keyframes drift {
    0% {
        background-position: 0 0;
    }

    100% {
        background-position: 150px 80px;
    }
}

@keyframes pulse-bg {

    0%,
    100% {
        background-position: 0 0;
    }

    50% {
        background-position: 20px 10px;
    }
}

@keyframes slide-right {
    0% {
        background-position: -50px 0;
    }

    100% {
        background-position: 50px 0;
    }
}

@keyframes wobble {

    0%,
    100% {
        background-position: 0 0;
    }

    25% {
        background-position: 5px -3px;
    }

    75% {
        background-position: -5px 3px;
    }
}


/* ========== ROOM & JOIN PANELS ========== */
.room-panel,
.join-panel {
    width: 100%;
    max-width: 450px;
    padding: 30px;
}

.back-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: none;
    color: var(--muted-foreground);
    font-size: 0.95rem;
    font-family: inherit;
    cursor: pointer;
    margin-bottom: 20px;
    padding: 8px 0;
}

.back-btn:hover {
    color: var(--foreground);
}

.back-arrow {
    font-size: 1.2rem;
}

.room-main {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Room Code Card */
.room-code-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) + 6px);
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.3s, box-shadow 0.3s;
    position: relative;
    overflow: hidden;
}

.room-code-card.copied {
    border-color: oklch(0.5 0.12 145);
    box-shadow: 0 0 12px oklch(0.5 0.12 145 / 0.2);
}

.room-code-card:hover {
    border-color: var(--primary);
}

.room-code-card.copied:hover {
    border-color: oklch(0.5 0.12 145);
}

.room-code-label {
    display: block;
    font-size: 0.75rem;
    color: var(--muted-foreground);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
    transition: color 0.3s;
}

.room-code-value {
    display: block;
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: 6px;
    cursor: pointer;
    transition: color 0.3s;
    min-height: 1.2em;
}

.room-code-card.copied .room-code-value {
    color: oklch(0.5 0.12 145);
}

.room-code-value:hover {
    text-shadow: 0 0 20px oklch(0.7357 0.1641 34.7091 / 0.5);
}

.room-code-hint {
    display: block;
    font-size: 0.7rem;
    color: var(--muted-foreground);
    margin-top: 6px;
    transition: color 0.3s;
}

.room-code-card.copied .room-code-hint {
    color: oklch(0.5 0.12 145);
}

/* Copy checkmark icon */
.copy-check-icon {
    display: inline-block;
    width: 18px;
    height: 18px;
    margin-right: 4px;
    vertical-align: middle;
}

.room-code-card.copied .room-code-hint {
    color: oklch(0.55 0.15 145);
}

/* Copy checkmark icon */
.copy-check-icon {
    display: inline-block;
    width: 20px;
    height: 20px;
    margin-right: 6px;
    vertical-align: middle;
    opacity: 0;
    transform: scale(0) rotate(-45deg);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.room-code-card.copied .copy-check-icon {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}

/* Room Settings */
.room-settings {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) + 4px);
    padding: 16px;
}

.settings-title {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--muted-foreground);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
}

.setting-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: var(--muted);
    border-radius: var(--radius);
    margin-bottom: 10px;
}

.setting-icon {
    font-size: 0.8rem;
    font-weight: 800;
    color: var(--destructive);
    background: oklch(0.6122 0.2082 22.2410 / 0.15);
    padding: 4px 8px;
    border-radius: 6px;
}

.setting-name {
    flex: 1;
    font-size: 0.9rem;
    font-weight: 500;
}

.setting-toggle {
    background: var(--secondary);
    border: 2px solid var(--border);
    color: var(--muted-foreground);
    padding: 5px 14px;
    border-radius: 14px;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
}

.setting-toggle.active {
    background: var(--destructive);
    border-color: var(--destructive);
    color: white;
}

.setting-modifiers-btn {
    width: 100%;
    padding: 10px;
    background: oklch(0.6122 0.2082 22.2410 / 0.1);
    border: 1px solid oklch(0.6122 0.2082 22.2410 / 0.2);
    border-radius: var(--radius);
    color: var(--foreground);
    font-size: 0.85rem;
    font-family: inherit;
    cursor: pointer;
    display: none;
}

.setting-modifiers-btn.show {
    display: block;
}

/* Players Section */
.room-players-section {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) + 4px);
    overflow: hidden;
}

.players-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--secondary);
    border-bottom: 1px solid var(--border);
}

.players-title {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.players-count-btn {
    display: flex;
    align-items: center;
    gap: 2px;
    background: var(--muted);
    border: 1px solid var(--border);
    color: var(--muted-foreground);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
}

.players-count-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* Max Players Popup - Simple Grid Design */
.max-players-overlay {
    position: fixed;
    inset: 0;
    background: oklch(0 0 0 / 0.8);
    backdrop-filter: blur(8px);
    z-index: 2500;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.max-players-overlay.show {
    opacity: 1;
    visibility: visible;
}

.max-players-modal {
    position: relative;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) + 8px);
    padding: 24px;
    width: 280px;
    transform: scale(0.9);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.max-players-overlay.show .max-players-modal {
    transform: scale(1);
}

.max-players-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 28px;
    height: 28px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--muted-foreground);
    transition: all 0.2s;
}

.max-players-close:hover {
    border-color: var(--destructive);
    color: var(--destructive);
}

.max-players-header {
    margin-bottom: 20px;
    text-align: center;
}

.max-players-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--foreground);
}

.max-players-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.max-players-btn {
    aspect-ratio: 1;
    background: var(--muted);
    border: 2px solid transparent;
    border-radius: var(--radius);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--foreground);
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.max-players-btn:hover {
    background: var(--secondary);
    border-color: var(--primary);
}

.max-players-btn.selected {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.players-wheel {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-bottom: 20px;
}

.wheel-option {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--muted);
    border: 2px solid var(--border);
    border-radius: 50%;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.wheel-option:hover {
    border-color: var(--primary);
    transform: scale(1.1);
}

.wheel-option.selected {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    box-shadow: 0 0 20px oklch(0.7357 0.1641 34.7091 / 0.4);
}

.max-players-confirm {
    background: linear-gradient(135deg, var(--primary), oklch(0.65 0.14 35));
    border: none;
    color: white;
    padding: 14px 32px;
    border-radius: calc(var(--radius) + 4px);
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 16px oklch(0.7357 0.1641 34.7091 / 0.3);
}

.max-players-confirm:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px oklch(0.7357 0.1641 34.7091 / 0.4);
}

/* Wheel Picker */
.wheel-picker-container {
    position: relative;
    height: 180px;
    overflow: hidden;
    margin-bottom: 20px;
    z-index: 1;
}

.wheel-picker-highlight {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    height: 50px;
    background: var(--primary);
    opacity: 0.15;
    border-radius: var(--radius);
    pointer-events: none;
    z-index: 1;
}

.wheel-picker {
    height: 100%;
    overflow-y: auto;
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
    padding: 65px 0;
    cursor: grab;
    position: relative;
    z-index: 2;
}

.wheel-picker::-webkit-scrollbar {
    display: none;
}

.wheel-item {
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--muted-foreground);
    scroll-snap-align: center;
    transition: all 0.2s;
    cursor: pointer;
}

.wheel-item.selected {
    color: var(--foreground);
    font-size: 1.6rem;
}

.players-list {
    padding: 12px;
    max-height: 200px;
    overflow-y: auto;
    scroll-behavior: smooth;
    scroll-snap-type: y mandatory;
}

.player-item {
    scroll-snap-align: start;
}

/* Player Item - Redesigned with integrated ready status */
.player-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: var(--muted);
    border-radius: calc(var(--radius) + 2px);
    margin-bottom: 8px;
    border: 2px solid transparent;
    transition: all 0.2s ease;
    position: relative;
}

.player-item:last-child {
    margin-bottom: 0;
}

.player-item.is-host {
    background: linear-gradient(135deg, oklch(0.7357 0.1641 34.7091 / 0.12), var(--muted));
    border-color: oklch(0.7357 0.1641 34.7091 / 0.25);
}

.player-item.is-ready {
    background: linear-gradient(135deg, oklch(0.55 0.15 145 / 0.1), var(--muted));
    border-color: oklch(0.55 0.15 145 / 0.3);
}

.player-item-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    color: white;
    position: relative;
    flex-shrink: 0;
}

.player-item-info {
    flex: 1;
    min-width: 0;
}

.player-item-name {
    font-size: 0.95rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--foreground);
}

.player-item-role {
    font-size: 0.7rem;
    color: var(--primary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.player-item-status {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--border);
    color: var(--muted-foreground);
    flex-shrink: 0;
    transition: all 0.2s;
}

.player-item-status svg {
    width: 16px;
    height: 16px;
}

.player-item-status.ready {
    background: oklch(0.55 0.15 145);
    color: white;
}

.player-item-status.host {
    background: var(--primary);
    color: white;
}

/* Ready Status Bar */
.ready-status-bar {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
}

.ready-progress {
    height: 6px;
    background: var(--muted);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 8px;
}

.ready-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, oklch(0.55 0.15 145), oklch(0.6 0.18 145));
    border-radius: 3px;
    width: 0%;
    transition: width 0.3s ease;
}

.ready-text {
    font-size: 0.8rem;
    color: var(--muted-foreground);
    text-align: center;
    display: block;
}

/* Room Buttons */
.room-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn-ready-room,
.btn-start-room {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
}

.btn-icon {
    font-size: 1.1rem;
}

.btn-ready-room {
    background: oklch(0.55 0.15 145);
    color: white;
}

.btn-ready-room:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px oklch(0.55 0.15 145 / 0.4);
}

.btn-ready-room.is-ready {
    background: oklch(0.45 0.12 145);
}

.btn-start-room {
    background: linear-gradient(135deg, var(--primary), oklch(0.65 0.14 35));
    color: var(--primary-foreground);
}

.btn-start-room:hover:not(:disabled) {
    filter: brightness(1.1);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px oklch(0.7357 0.1641 34.7091 / 0.4);
}

.btn-start-room:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.join-card {
    text-align: center;
}

.join-card h2 {
    font-size: 1.4rem;
    margin-bottom: 8px;
}

.join-card p {
    color: var(--muted-foreground);
    margin-bottom: 20px;
}

.code-input {
    width: 100%;
    background: var(--muted);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    color: var(--foreground);
    font-size: 1.8rem;
    font-weight: 700;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 6px;
    font-family: inherit;
    outline: none;
    margin-bottom: 16px;
}

.code-input:focus {
    border-color: var(--primary);
}

.btn-join-confirm {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background:
        url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.06'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E"),
        linear-gradient(135deg, var(--primary), oklch(0.65 0.14 35));
    border: 2px solid oklch(0.8 0.15 35 / 0.3);
    color: var(--primary-foreground);
    padding: 18px;
    border-radius: calc(var(--radius) + 2px);
    font-size: 1.15rem;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow:
        0 4px 20px oklch(0.7357 0.1641 34.7091 / 0.35),
        inset 0 1px 0 oklch(1 0 0 / 0.15);
}

.btn-join-confirm::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg,
            transparent 30%,
            oklch(1 0 0 / 0.12) 50%,
            transparent 70%);
    transform: translateX(-100%);
    transition: transform 0.6s;
}

.btn-join-confirm:hover::after {
    transform: translateX(100%);
}

.btn-join-confirm:hover {
    transform: translateY(-2px);
    box-shadow:
        0 12px 35px oklch(0.7357 0.1641 34.7091 / 0.45),
        0 0 20px oklch(0.7357 0.1641 34.7091 / 0.2),
        inset 0 1px 0 oklch(1 0 0 / 0.2);
}

/* Player items */
.player-item-panel {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: var(--radius);
    margin-bottom: 6px;
    background: oklch(0 0 0 / 0.15);
}

.player-avatar-small {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
}

.player-name-text {
    flex: 1;
    font-size: 0.9rem;
}

.ready-indicator {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
}

.ready-indicator.ready {
    background: oklch(0.55 0.15 145);
}

.hidden {
    display: none !important;
}

/* ========== AVATAR SETTINGS POPUP ========== */
.avatar-settings-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) + 8px);
    width: 320px;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    box-shadow: 0 20px 60px oklch(0 0 0 / 0.4);
    overflow: hidden;
}

.avatar-settings-popup.show {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.avatar-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: var(--secondary);
    border-bottom: 1px solid var(--border);
}

.avatar-popup-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--foreground);
}

.avatar-popup-title svg {
    color: var(--primary);
}

.avatar-popup-close {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--muted-foreground);
    width: 32px;
    height: 32px;
    border-radius: var(--radius);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.avatar-popup-close:hover {
    border-color: var(--destructive);
    color: var(--destructive);
}

.avatar-popup-content {
    padding: 20px;
}

/* Avatar Preview */
.avatar-preview-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
}

.avatar-preview-large {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 700;
    color: white;
    margin-bottom: 8px;
    background-size: cover;
    background-position: center;
    overflow: hidden;
}

.avatar-preview-large img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-preview-hint {
    font-size: 0.75rem;
    color: var(--muted-foreground);
}

/* Tabs */
.avatar-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.avatar-tab {
    flex: 1;
    padding: 10px;
    background: var(--muted);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--muted-foreground);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.avatar-tab:hover {
    background: var(--secondary);
}

.avatar-tab.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.avatar-tab-content {
    display: none;
}

.avatar-tab-content.active {
    display: block;
}

/* Color Wheel Section */
.color-wheel-section {
    display: flex;
    justify-content: center;
    margin-bottom: 16px;
}

#colorWheel {
    border-radius: 50%;
    cursor: crosshair;
    box-shadow: 0 4px 20px oklch(0 0 0 / 0.2);
}

/* Color Presets */
.color-presets-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.presets-label {
    font-size: 0.75rem;
    color: var(--muted-foreground);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.color-presets-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 8px;
}

.color-preset {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
}

.color-preset:hover {
    transform: scale(1.15);
    border-color: white;
}

/* Image URL Section */
.avatar-url-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.avatar-url-label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--foreground);
}

.avatar-url-input-wrap {
    display: flex;
    gap: 8px;
}

.avatar-url-input {
    flex: 1;
    padding: 12px 14px;
    background: var(--muted);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--foreground);
    font-size: 0.85rem;
    font-family: inherit;
    outline: none;
}

.avatar-url-input:focus {
    border-color: var(--primary);
}

.avatar-url-input::placeholder {
    color: var(--muted-foreground);
}

.avatar-url-apply {
    width: 44px;
    background: var(--primary);
    border: none;
    border-radius: var(--radius);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.avatar-url-apply:hover {
    filter: brightness(1.1);
}

.avatar-url-hint {
    font-size: 0.7rem;
    color: var(--muted-foreground);
}

.avatar-url-actions {
    margin-top: 16px;
}

.avatar-clear-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 10px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--muted-foreground);
    font-size: 0.85rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
}

.avatar-clear-btn:hover {
    border-color: var(--destructive);
    color: var(--destructive);
}

/* ========== MODALS ========== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: oklch(0 0 0 / 0.85);
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    backdrop-filter: blur(6px);
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.modal-box {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) + 8px);
    width: 90%;
    max-width: 550px;
    max-height: 80vh;
    overflow: hidden;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s;
}

.modal-overlay.show .modal-box {
    transform: scale(1) translateY(0);
}

.modal-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 20px;
    border-bottom: 1px solid var(--border);
}

.modal-head h2 {
    font-size: 1.2rem;
}

.modal-x {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--muted-foreground);
    width: 32px;
    height: 32px;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 1.1rem;
}

.modal-x:hover {
    border-color: var(--destructive);
    color: var(--destructive);
}

.modal-content {
    padding: 18px 20px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    max-height: 50vh;
    overflow-y: auto;
}

.modal-foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    border-top: 1px solid var(--border);
}

.mod-active {
    color: var(--muted-foreground);
    font-size: 0.85rem;
}

.mod-active b {
    color: var(--destructive);
}

.btn-done {
    background: var(--primary);
    border: none;
    color: var(--primary-foreground);
    padding: 12px 24px;
    border-radius: var(--radius);
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
}

/* ========== MODIFIERS MODAL - ENHANCED ========== */
.modifiers-modal {
    max-width: 700px;
}

.modifiers-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    padding: 20px;
}

.mod-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.mod-group {
    background: var(--muted);
    border-radius: calc(var(--radius) + 4px);
    padding: 14px;
    border: 1px solid var(--border);
    transition: all 0.3s;
}

.mod-group:hover {
    border-color: oklch(0.6122 0.2082 22.2410 / 0.3);
}

.mod-group.meme-group:hover {
    border-color: oklch(0.8278 0.1131 57.9984 / 0.3);
}

/* Meme group - in development */
.mod-group.meme-group {
    position: relative;
    pointer-events: none;
}

.mod-group.meme-group::before {
    content: '';
    position: absolute;
    inset: 0;
    background: oklch(0.15 0.01 240 / 0.7);
    backdrop-filter: blur(4px);
    border-radius: inherit;
    z-index: 10;
}

.mod-group.meme-group::after {
    content: '🚧 В разработке';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--card);
    border: 1px solid var(--border);
    padding: 10px 20px;
    border-radius: var(--radius);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--muted-foreground);
    z-index: 11;
    white-space: nowrap;
}

.mod-group-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

.mod-group-icon {
    font-size: 1.2rem;
    animation: iconBounce 2s ease-in-out infinite;
}

@keyframes iconBounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-3px);
    }
}

.mod-group-title {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--destructive);
}

.meme-group .mod-group-title {
    color: var(--accent);
}

.mod-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mod-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: var(--card);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.mod-item:hover {
    background: var(--secondary);
    transform: translateX(4px);
}

.mod-item.active {
    background: oklch(0.6122 0.2082 22.2410 / 0.12);
    border-color: oklch(0.6122 0.2082 22.2410 / 0.3);
}

.mod-item.active .mod-item-icon {
    animation: iconPulse 1s ease-in-out infinite;
}

.mod-item-icon {
    font-size: 1.3rem;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--muted);
    border-radius: 10px;
    transition: all 0.2s;
}

.mod-item.active .mod-item-icon {
    background: oklch(0.6122 0.2082 22.2410 / 0.2);
}

.mod-item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.mod-item-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--foreground);
}

.mod-item-desc {
    font-size: 0.7rem;
    color: var(--muted-foreground);
}

/* Toggle switch */
.mod-toggle {
    position: relative;
    width: 44px;
    height: 24px;
    background: var(--border);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
    padding: 0;
}

.mod-toggle .toggle-slider {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    background: var(--muted-foreground);
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.mod-toggle.active {
    background: var(--destructive);
}

.mod-toggle.active .toggle-slider {
    left: 23px;
    background: white;
}

/* Target selector */
.target-selector {
    background: var(--muted);
    border-radius: calc(var(--radius) + 4px);
    padding: 16px;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.target-selector-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.target-selector-icon {
    font-size: 1.2rem;
}

.target-selector-title {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--primary);
}

.target-search-wrap {
    position: relative;
}

.target-search-input {
    width: 100%;
    padding: 12px 14px 12px 40px;
    background: var(--card);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    color: var(--foreground);
    font-size: 0.9rem;
    font-family: inherit;
    outline: none;
    transition: all 0.2s;
}

.target-search-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px oklch(0.7357 0.1641 34.7091 / 0.15);
}

.target-search-input::placeholder {
    color: var(--muted-foreground);
}

.target-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1rem;
    opacity: 0.5;
}

.target-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-top: 4px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 100;
    display: none;
    box-shadow: 0 8px 24px oklch(0 0 0 / 0.3);
}

.target-suggestions.show {
    display: block;
    animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.suggestion-item {
    padding: 10px 14px;
    cursor: pointer;
    transition: all 0.15s;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 10px;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item:hover {
    background: var(--primary);
    color: white;
}

.suggestion-item .suggestion-icon {
    font-size: 1rem;
    opacity: 0.7;
}

.suggestion-item .suggestion-text {
    flex: 1;
    font-size: 0.85rem;
}

.suggestion-loading {
    padding: 14px;
    text-align: center;
    color: var(--muted-foreground);
    font-size: 0.85rem;
}

.target-selected {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: oklch(0.7357 0.1641 34.7091 / 0.1);
    border: 1px solid oklch(0.7357 0.1641 34.7091 / 0.3);
    border-radius: var(--radius);
}

.target-selected-label {
    font-size: 0.75rem;
    color: var(--muted-foreground);
    text-transform: uppercase;
}

.target-selected-value {
    flex: 1;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--primary);
}

.target-clear-btn {
    width: 24px;
    height: 24px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--muted-foreground);
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.target-clear-btn:hover {
    border-color: var(--destructive);
    color: var(--destructive);
}

.target-random-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    background: var(--card);
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    color: var(--muted-foreground);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.target-random-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: oklch(0.7357 0.1641 34.7091 / 0.05);
}

.target-random-btn .random-icon {
    font-size: 1.2rem;
    animation: shake 2s ease-in-out infinite;
}

@keyframes shake {

    0%,
    100% {
        transform: rotate(0deg);
    }

    25% {
        transform: rotate(-10deg);
    }

    75% {
        transform: rotate(10deg);
    }
}

.target-selected-value.has-target {
    color: oklch(0.55 0.15 145);
}

/* Footer */
.modifiers-foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: var(--secondary);
}

.mod-active-count {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mod-active-label {
    font-size: 0.85rem;
    color: var(--muted-foreground);
}

.mod-active-num {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--destructive);
    min-width: 24px;
    text-align: center;
}

.btn-apply-mods {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    background: linear-gradient(135deg, var(--primary), oklch(0.65 0.14 35));
    border: none;
    border-radius: var(--radius);
    color: white;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-apply-mods:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px oklch(0.7357 0.1641 34.7091 / 0.4);
}

/* Hardcore mode activation animation */
.hardcore-flash {
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at center, oklch(0.6122 0.2082 22.2410 / 0.3), transparent);
    z-index: 9999;
    pointer-events: none;
    opacity: 0;
    animation: hardcoreFlash 0.6s ease-out forwards;
}

@keyframes hardcoreFlash {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }

    30% {
        opacity: 1;
    }

    100% {
        opacity: 0;
        transform: scale(2);
    }
}

.mod-item.activating {
    animation: modActivate 0.4s ease-out;
}

@keyframes modActivate {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
        background: oklch(0.6122 0.2082 22.2410 / 0.3);
    }

    100% {
        transform: scale(1);
    }
}

.help-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.help-tab {
    padding: 12px 14px;
    background: var(--muted);
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--muted-foreground);
}

.help-tab:hover {
    background: var(--secondary);
}

.help-tab.active {
    background: oklch(0.7357 0.1641 34.7091 / 0.2);
    color: var(--primary);
}

/* Help Modal - Minimal Design */
.help-modal {
    max-width: 700px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.help-modal .modal-head {
    background: transparent;
    border-bottom: 1px solid var(--border);
    padding: 16px 20px;
}

.help-modal .modal-head h2 {
    color: var(--foreground);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1rem;
    font-weight: 600;
}

.help-modal .modal-head h2 svg {
    color: var(--primary);
}

.help-modal .modal-x {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--muted-foreground);
}

.help-modal .modal-x:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.help-content {
    display: grid;
    grid-template-columns: 180px 1fr;
    min-height: 320px;
}

.help-sidebar {
    background: transparent;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    border-right: 1px solid var(--border);
}

.help-topic-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
}

.help-topic-item:hover {
    background: var(--muted);
}

.help-topic-item.active {
    background: var(--muted);
    border-color: var(--border);
}

.help-topic-item .topic-icon {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted-foreground);
    transition: all 0.2s;
}

.help-topic-item.active .topic-icon {
    color: var(--primary);
}

.help-topic-item .topic-icon svg {
    width: 18px;
    height: 18px;
}

.help-topic-item .topic-name {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--muted-foreground);
    transition: color 0.2s;
}

.help-topic-item.active .topic-name {
    color: var(--foreground);
}

.help-body {
    padding: 20px;
    overflow-y: auto;
}

.help-page {
    display: none;
    animation: helpFadeIn 0.2s ease;
}

.help-page.active {
    display: block;
}

@keyframes helpFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.help-page h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--foreground);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.help-page p {
    color: var(--muted-foreground);
    margin-bottom: 12px;
    line-height: 1.6;
    font-size: 0.85rem;
}

.help-page ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.help-page li {
    position: relative;
    padding: 10px 12px;
    margin-bottom: 6px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--muted-foreground);
    font-size: 0.85rem;
    line-height: 1.5;
}

.help-page li:hover {
    background: var(--muted);
}

.help-page li b,
.help-page li strong {
    color: var(--foreground);
    font-weight: 600;
}

/* Mobile responsive */
@media (max-width: 600px) {
    .help-content {
        grid-template-columns: 1fr;
    }
    
    .help-sidebar {
        flex-direction: row;
        overflow-x: auto;
        border-right: none;
        border-bottom: 1px solid var(--border);
        padding: 12px;
    }
    
    .help-topic-item {
        flex-direction: column;
        padding: 10px 14px;
        gap: 6px;
    }
    
    .help-topic-item .topic-name {
        font-size: 0.75rem;
    }
}

/* ========== COUNTDOWN ========== */
#countdown {
    align-items: center;
    justify-content: center;
}

.countdown-box {
    text-align: center;
}

.countdown-box h2 {
    font-size: 1.8rem;
    margin-bottom: 24px;
}

.countdown-target {
    background: var(--card);
    padding: 24px 40px;
    border-radius: calc(var(--radius) + 6px);
    margin-bottom: 30px;
}

.countdown-target p {
    font-size: 1.1rem;
    margin: 10px 0;
}

.countdown-target b {
    color: var(--primary);
}

.countdown-num {
    font-size: 10rem;
    font-weight: 900;
    color: var(--primary);
    text-shadow:
        0 0 20px currentColor,
        0 0 40px currentColor,
        0 0 60px currentColor,
        0 0 80px oklch(0.7357 0.1641 34.7091 / 0.5);
    animation: countdownPulse 1s ease-in-out infinite;
}

/* New Year theme countdown glow - green */
body.newyear-theme .countdown-num {
    color: oklch(0.55 0.2 140);
    text-shadow:
        0 0 20px oklch(0.55 0.2 140),
        0 0 40px oklch(0.55 0.2 140),
        0 0 60px oklch(0.5 0.18 140),
        0 0 80px oklch(0.5 0.18 140 / 0.5);
}

@keyframes countdownPulse {

    0%,
    100% {
        transform: scale(1);
        filter: brightness(1);
    }

    50% {
        transform: scale(1.05);
        filter: brightness(1.2);
    }
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}


/* ========== GAME SCREEN ========== */
#game {
    flex-direction: column;
    height: 100vh;
    background: var(--background);
}

.game-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background: var(--card);
    border-bottom: 2px solid var(--border);
    gap: 16px;
    position: relative;
}

.game-header-left {
    display: flex;
    align-items: center;
    z-index: 1;
}

.game-logo {
    font-size: 1.6rem;
    font-weight: 900;
    color: var(--primary);
    background: oklch(0.7357 0.1641 34.7091 / 0.15);
    padding: 8px 14px;
    border-radius: var(--radius);
}

/* New Year theme game logo - blue tint */
body.newyear-theme .game-logo {
    color: oklch(0.55 0.2 140);
    background: oklch(0.3 0.06 240);
    border: 1px solid oklch(0.4 0.08 240);
}

.game-header-center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    justify-content: center;
}

.target-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    background: var(--muted);
    padding: 8px 16px;
    border-radius: calc(var(--radius) + 4px);
    border: 1px solid var(--border);
    max-width: 45vw;
    overflow: hidden;
}

.target-label {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--muted-foreground);
    text-transform: uppercase;
    letter-spacing: 2px;
    flex-shrink: 0;
}

.target-name-wrapper {
    width: 100%;
    overflow: hidden;
    position: relative;
}

.target-name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary);
    white-space: nowrap;
    display: inline-block;
}

.target-name.marquee {
    animation: marquee 8s linear infinite;
}

@keyframes marquee {
    0% {
        transform: translateX(0%);
    }

    100% {
        transform: translateX(-100%);
    }
}

.game-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 1;
}

.timer-badge {
    background: var(--muted);
    padding: 10px 18px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.timer-value {
    font-size: 1.2rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--foreground);
}

.btn-found {
    background: linear-gradient(135deg, oklch(0.55 0.15 145), oklch(0.5 0.12 145));
    border: none;
    color: white;
    padding: 10px 20px;
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
}

.btn-found:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px oklch(0.55 0.15 145 / 0.4);
}

.btn-exit {
    background: var(--secondary);
    border: 1px solid var(--border);
    color: var(--muted-foreground);
    width: 40px;
    height: 40px;
    border-radius: var(--radius);
    font-size: 1.4rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-exit:hover {
    border-color: var(--destructive);
    color: var(--destructive);
}

.game-content {
    flex: 1;
    display: flex;
    position: relative;
    overflow: hidden;
}

.hint-panel {
    position: absolute;
    top: 16px;
    left: 16px;
    width: 280px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) + 4px);
    z-index: 100;
    overflow: hidden;
    box-shadow: 0 8px 30px oklch(0 0 0 / 0.3);
}

.hint-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--secondary);
    border-bottom: 1px solid var(--border);
}

.hint-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--foreground);
}

.hint-toggle-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--muted-foreground);
    width: 24px;
    height: 24px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
}

.hint-body {
    padding: 14px 16px;
    color: var(--muted-foreground);
    font-size: 0.85rem;
    line-height: 1.6;
    max-height: 180px;
    overflow-y: auto;
}

.hint-panel.collapsed .hint-body {
    display: none;
}

.wiki-container {
    flex: 1;
    background: white;
    border-radius: var(--radius);
    margin: 8px;
    overflow: hidden;
}

.wiki-frame {
    width: 100%;
    height: 100%;
    border: none;
}

/* ========== RESULTS SCREEN ========== */
#results {
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

/* Side decorations - beautiful panels */
.side-decor {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 100px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 24px;
    padding: 40px 0;
    user-select: none;
    pointer-events: none;
}

.side-decor.side-left {
    left: 0;
    background: linear-gradient(90deg, oklch(0.7357 0.1641 34.7091 / 0.06) 0%, transparent 100%);
    border-right: 1px solid oklch(0.7357 0.1641 34.7091 / 0.12);
}

.side-decor.side-right {
    right: 0;
    background: linear-gradient(-90deg, oklch(0.7357 0.1641 34.7091 / 0.06) 0%, transparent 100%);
    border-left: 1px solid oklch(0.7357 0.1641 34.7091 / 0.12);
}

.decor-line {
    width: 2px;
    height: 80px;
    background: linear-gradient(180deg, transparent, var(--primary), transparent);
    opacity: 0.3;
    border-radius: 2px;
}

.decor-shape {
    width: 40px;
    height: 40px;
    border: 2px solid oklch(0.7357 0.1641 34.7091 / 0.25);
    border-radius: 10px;
    transform: rotate(45deg);
    animation: shapeFloat 3s ease-in-out infinite;
}

.side-decor .decor-shape:nth-child(2) {
    animation-delay: 0s;
}

.side-decor .decor-shape:nth-child(4) {
    animation-delay: 1.5s;
}

@keyframes shapeFloat {

    0%,
    100% {
        transform: rotate(45deg) scale(1);
        opacity: 0.25;
    }

    50% {
        transform: rotate(45deg) scale(1.1);
        opacity: 0.4;
    }
}

.decor-icon {
    font-size: 2rem;
    opacity: 0.4;
    animation: iconPulse 2s ease-in-out infinite;
    filter: drop-shadow(0 0 10px oklch(0.7357 0.1641 34.7091 / 0.3));
}

@keyframes iconPulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.4;
    }

    50% {
        transform: scale(1.15);
        opacity: 0.6;
    }
}

/* Glow effect behind icons */
.decor-icon::before {
    content: '';
    position: absolute;
    width: 50px;
    height: 50px;
    background: radial-gradient(circle, oklch(0.7357 0.1641 34.7091 / 0.15) 0%, transparent 70%);
    border-radius: 50%;
    z-index: -1;
}

.results-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    max-width: 500px;
    width: 90%;
    padding: 40px 20px;
    position: relative;
    z-index: 1;
}

.results-header {
    text-align: center;
}

.trophy-icon {
    font-size: 4rem;
    margin-bottom: 12px;
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.results-title {
    font-size: 2rem;
    font-weight: 800;
    color: var(--foreground);
}

.winner-section {
    background: linear-gradient(135deg, var(--primary), oklch(0.65 0.14 35));
    padding: 28px 40px;
    border-radius: calc(var(--radius) + 8px);
    text-align: center;
    width: 100%;
    box-shadow: 0 12px 40px oklch(0.7357 0.1641 34.7091 / 0.3);
}

.winner-badge {
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 3px;
    color: oklch(1 0 0 / 0.7);
    margin-bottom: 8px;
}

.winner-name {
    font-size: 1.8rem;
    font-weight: 800;
    color: white;
    margin-bottom: 16px;
}

.winner-stats {
    display: flex;
    justify-content: center;
    gap: 30px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: white;
}

.stat-label {
    font-size: 0.75rem;
    color: oklch(1 0 0 / 0.7);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.target-result {
    background: var(--card);
    padding: 20px 28px;
    border-radius: calc(var(--radius) + 4px);
    text-align: center;
    width: 100%;
    border: 1px solid var(--border);
}

.target-result-label {
    display: block;
    font-size: 0.75rem;
    color: var(--muted-foreground);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 6px;
}

.target-result-name {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary);
}

.wiki-preview {
    width: 100%;
    border-radius: calc(var(--radius) + 4px);
    overflow: hidden;
    border: 1px solid var(--border);
}

.preview-frame {
    width: 100%;
    height: 250px;
    border: none;
}

.multiplayer-section {
    width: 100%;
}

.players-results {
    background: var(--card);
    border-radius: var(--radius);
    padding: 14px;
    margin-bottom: 14px;
}

.ready-section {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) + 4px);
    padding: 16px;
}

.ready-section-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--muted-foreground);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
}

/* Ready player items in results - use same style as lobby */
.ready-section .players-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.ready-status {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    transition: all 0.2s;
}

.ready-status.waiting {
    background: var(--border);
    color: var(--muted-foreground);
}

.ready-status.ready {
    background: oklch(0.55 0.15 145);
    color: white;
}

.results-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

/* ========== UNIVERSAL ACTION BUTTONS ========== */
.btn-action {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 24px;
    border-radius: calc(var(--radius) + 4px);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.btn-action .btn-icon {
    font-size: 1.2rem;
    transition: transform 0.3s;
}

.btn-action .btn-label {
    position: relative;
    z-index: 1;
}

.btn-action:hover .btn-icon {
    transform: scale(1.2);
}

.btn-action::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent 0%, oklch(1 0 0 / 0.1) 100%);
    opacity: 0;
    transition: opacity 0.3s;
}

.btn-action:hover::before {
    opacity: 1;
}

.btn-play-again {
    background:
        url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E"),
        linear-gradient(135deg, oklch(0.55 0.2 140) 0%, oklch(0.45 0.18 160) 50%, oklch(0.5 0.2 140) 100%);
    border: 2px solid oklch(0.6 0.2 140 / 0.4);
    color: white;
    box-shadow:
        0 4px 20px oklch(0.55 0.2 140 / 0.4),
        inset 0 1px 0 oklch(1 0 0 / 0.15);
    text-shadow: 0 2px 4px oklch(0 0 0 / 0.4);
    padding: 20px 32px;
    font-size: 1.3rem;
    letter-spacing: 1px;
}

.btn-play-again .btn-label {
    font-weight: 800;
    text-transform: uppercase;
}

.btn-play-again::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, oklch(1 0 0 / 0.1) 0%, transparent 50%, oklch(0 0 0 / 0.1) 100%);
    opacity: 1;
    transition: opacity 0.3s;
}

.btn-play-again::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg,
            transparent 30%,
            oklch(1 0 0 / 0.1) 50%,
            transparent 70%);
    transform: translateX(-100%);
    transition: transform 0.6s;
}

.btn-play-again:hover::after {
    transform: translateX(100%);
}

.btn-play-again:hover {
    transform: translateY(-3px);
    box-shadow:
        0 12px 40px oklch(0.55 0.2 140 / 0.5),
        0 0 20px oklch(0.55 0.2 140 / 0.3),
        inset 0 1px 0 oklch(1 0 0 / 0.2);
    border-color: oklch(0.65 0.2 140 / 0.6);
}

.btn-play-again:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px oklch(0.55 0.2 140 / 0.4);
}

.btn-play-again:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-ready-result {
    background: linear-gradient(135deg, oklch(0.55 0.15 145), oklch(0.5 0.12 145));
    border: none;
    color: white;
    box-shadow: 0 4px 15px oklch(0.55 0.15 145 / 0.3);
}

.btn-ready-result:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px oklch(0.55 0.15 145 / 0.4);
}

.btn-to-menu {
    background: var(--card);
    border: 2px solid var(--border);
    color: var(--muted-foreground);
}

.btn-to-menu:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-2px);
}

.btn-to-menu:hover .btn-icon {
    transform: translateX(-3px);
}

/* Room buttons */
.btn-ready-room {
    background: linear-gradient(135deg, oklch(0.55 0.15 145), oklch(0.5 0.12 145));
    border: none;
    color: white;
    box-shadow: 0 4px 15px oklch(0.55 0.15 145 / 0.3);
}

.btn-ready-room:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px oklch(0.55 0.15 145 / 0.4);
}

.btn-start-room {
    background: linear-gradient(135deg, var(--primary), oklch(0.65 0.14 35));
    border: none;
    color: var(--primary-foreground);
    box-shadow: 0 4px 15px oklch(0.7357 0.1641 34.7091 / 0.3);
}

.btn-start-room:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px oklch(0.7357 0.1641 34.7091 / 0.4);
}

.btn-start-room:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-join-confirm {
    background: linear-gradient(135deg, var(--primary), oklch(0.65 0.14 35));
    border: none;
    color: var(--primary-foreground);
    width: 100%;
    box-shadow: 0 4px 15px oklch(0.7357 0.1641 34.7091 / 0.3);
}

.btn-join-confirm:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px oklch(0.7357 0.1641 34.7091 / 0.4);
}

/* Menu buttons with icons */
.btn-play .btn-icon-main {
    font-size: 1.3rem;
    margin-right: 4px;
    position: relative;
    z-index: 2;
    transition: transform 0.3s;
}

.btn-play:hover .btn-icon-main {
    transform: scale(1.2) rotate(-5deg);
}

.btn-how .btn-icon-main {
    font-size: 1.1rem;
    margin-right: 4px;
    position: relative;
    z-index: 2;
}

/* ========== DEATH MODE ANIMATIONS ========== */
body.death-mode {
    --primary: var(--destructive);
}

/* Activation animation */
body.death-mode-activating {
    animation: deathActivate 0.8s ease-out;
}

@keyframes deathActivate {
    0% {
        filter: brightness(1);
    }

    15% {
        filter: brightness(2) saturate(0);
    }

    30% {
        filter: brightness(0.3) saturate(2) hue-rotate(-10deg);
    }

    50% {
        filter: brightness(1.5) saturate(1.5);
    }

    100% {
        filter: brightness(1) saturate(1);
    }
}

/* Deactivation animation */
body.death-mode-deactivating {
    animation: deathDeactivate 0.4s ease-out;
}

@keyframes deathDeactivate {
    0% {
        filter: brightness(1);
    }

    50% {
        filter: brightness(1.5) saturate(0.5);
    }

    100% {
        filter: brightness(1) saturate(1);
    }
}

/* Screen shake */
body.screen-shake {
    animation: screenShake 0.5s ease-out;
}

@keyframes screenShake {

    0%,
    100% {
        transform: translateX(0);
    }

    10% {
        transform: translateX(-8px) rotate(-0.5deg);
    }

    20% {
        transform: translateX(8px) rotate(0.5deg);
    }

    30% {
        transform: translateX(-6px) rotate(-0.3deg);
    }

    40% {
        transform: translateX(6px) rotate(0.3deg);
    }

    50% {
        transform: translateX(-4px);
    }

    60% {
        transform: translateX(4px);
    }

    70% {
        transform: translateX(-2px);
    }

    80% {
        transform: translateX(2px);
    }
}

/* Death mode flash overlay */
.death-flash {
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at center, oklch(0.3 0.15 22 / 0.95), oklch(0.15 0.1 22 / 0.98));
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    pointer-events: none;
}

.death-flash.show {
    opacity: 1;
    visibility: visible;
    animation: flashPulse 1.5s ease-out;
}

@keyframes flashPulse {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }

    20% {
        opacity: 1;
        transform: scale(1.1);
    }

    40% {
        opacity: 1;
        transform: scale(1);
    }

    100% {
        opacity: 0;
        transform: scale(1);
    }
}

.flash-skull {
    font-size: 8rem;
    animation: skullBounce 0.6s ease-out;
    filter: drop-shadow(0 0 30px oklch(0.6122 0.2082 22.2410));
}

@keyframes skullBounce {
    0% {
        transform: scale(0) rotate(-180deg);
    }

    50% {
        transform: scale(1.3) rotate(10deg);
    }

    70% {
        transform: scale(0.9) rotate(-5deg);
    }

    100% {
        transform: scale(1) rotate(0deg);
    }
}

.flash-text {
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--destructive);
    text-shadow: 0 0 20px oklch(0.6122 0.2082 22.2410 / 0.8);
    letter-spacing: 8px;
    animation: textGlitch 0.8s ease-out;
}

@keyframes textGlitch {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }

    20% {
        opacity: 1;
        transform: translateY(-5px);
    }

    40% {
        opacity: 0.8;
        transform: translateX(-3px);
    }

    60% {
        opacity: 1;
        transform: translateX(3px);
    }

    80% {
        opacity: 0.9;
        transform: translateX(-1px);
    }

    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Death mode background effects */
body.death-mode .animated-bg::before {
    background: radial-gradient(circle, oklch(0.6122 0.2082 22.2410 / 0.15) 0%, transparent 60%);
    animation: orbFloat 10s ease-in-out infinite, deathPulse 2s ease-in-out infinite;
}

body.death-mode .animated-bg::after {
    background: radial-gradient(circle, oklch(0.5 0.15 22 / 0.1) 0%, transparent 60%);
}

@keyframes deathPulse {

    0%,
    100% {
        opacity: 1;
        transform: translate(0, 0) scale(1);
    }

    50% {
        opacity: 0.7;
        transform: translate(20px, -20px) scale(1.1);
    }
}

body.death-mode .grid-lines {
    background-image:
        linear-gradient(oklch(0.6122 0.2082 22.2410 / 0.05) 1px, transparent 1px),
        linear-gradient(90deg, oklch(0.6122 0.2082 22.2410 / 0.05) 1px, transparent 1px);
    animation: gridMove 20s linear infinite;
}

body.death-mode .float-icon {
    color: var(--destructive);
}

/* Death mode card glow */
body.death-mode .mode-card.active {
    animation: cardGlow 2s ease-in-out infinite;
}

@keyframes cardGlow {

    0%,
    100% {
        box-shadow: 0 0 20px oklch(0.6122 0.2082 22.2410 / 0.3);
    }

    50% {
        box-shadow: 0 0 40px oklch(0.6122 0.2082 22.2410 / 0.5);
    }
}

/* Death mode button pulse */
body.death-mode .mode-toggle.active,
body.death-mode .setting-toggle.active {
    animation: btnPulse 1.5s ease-in-out infinite;
}

@keyframes btnPulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 oklch(0.6122 0.2082 22.2410 / 0.4);
    }

    50% {
        box-shadow: 0 0 0 8px oklch(0.6122 0.2082 22.2410 / 0);
    }
}

/* Time Warning */
.time-warning {
    color: var(--destructive) !important;
    animation: flash 0.5s ease-in-out infinite;
}

@keyframes flash {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.4;
    }
}

/* Notifications */
.teleport-notification {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.5);
    background: var(--accent);
    color: var(--accent-foreground);
    padding: 30px 60px;
    border-radius: calc(var(--radius) + 8px);
    font-size: 2rem;
    font-weight: 800;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.teleport-notification.show {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.game-over-overlay {
    position: fixed;
    inset: 0;
    background: oklch(0 0 0 / 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 30px;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.game-over-overlay.show {
    opacity: 1;
    visibility: visible;
}

.game-over-text {
    font-size: 4rem;
    font-weight: 900;
    color: var(--destructive);
    text-shadow: 0 0 30px oklch(0.6122 0.2082 22.2410 / 0.5);
    animation: pulse 1s ease-in-out infinite;
}

.game-over-reason {
    font-size: 1.4rem;
    color: var(--muted-foreground);
}

/* Responsive */
@media (max-width: 768px) {
    .side-decor {
        display: none;
    }

    .game-header {
        flex-wrap: wrap;
        padding: 10px 14px;
    }

    .target-badge {
        padding: 8px 14px;
    }

    .target-name {
        max-width: 150px;
        font-size: 0.9rem;
    }

    .hint-panel {
        width: 240px;
        left: 10px;
        top: 10px;
    }
}

@media (max-width: 500px) {
    .menu-title {
        font-size: 1.8rem;
    }

    .title-accent {
        font-size: 2.2rem;
    }

    .btn-row {
        flex-direction: column;
    }

    .btn-row>.btn-play {
        width: 100% !important;
        max-width: 100% !important;
    }

    .modal-content {
        grid-template-columns: 1fr;
    }

    .countdown-num {
        font-size: 6rem;
    }

    .results-title {
        font-size: 1.6rem;
    }

    .menu-center {
        padding: 20px 15px;
    }

    .menu-buttons,
    .player-card,
    .mode-card {
        max-width: 100%;
    }

    .player-card {
        padding: 12px 14px;
        gap: 12px;
    }

    .player-avatar {
        width: 44px;
        height: 44px;
        font-size: 1.2rem;
    }

    .btn-play {
        padding: 16px 14px;
        font-size: 0.95rem;
    }

    .room-panel,
    .join-panel {
        padding: 20px 15px;
    }

    .room-code-value {
        font-size: 1.8rem;
        letter-spacing: 4px;
    }
}


/* ========== STREAMER MODE ========== */
.streamer-mode-widget {
    position: fixed;
    bottom: 15px;
    left: 15px;
    z-index: 9999;
    /* Use a container that is large enough to hold all elements */
    width: 250px;
    height: 150px;
    pointer-events: none;
    /* Pass clicks through the container */
}

.streamer-toggle-btn {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--card);
    border: 2px solid var(--border);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    opacity: 0.8;
    pointer-events: all;
    /* Make the button clickable */
}

.streamer-mode-text {
    font-family: 'Caveat', cursive;
    font-size: 1.4rem;
    color: var(--muted-foreground);
    /* Less bright color */
    text-shadow: 1px 1px 2px oklch(0 0 0 / 0.2);
    white-space: nowrap;
    transform: rotate(-8deg);
    position: absolute;
    bottom: 65px;
    /* Position above the button */
    left: 40px;
    z-index: 2;
}

.streamer-mode-arrow {
    position: absolute;
    bottom: 40px;
    /* Position between text and button */
    left: 30px;
    transform: rotate(15deg) scale(0.9);
    color: var(--primary);
    z-index: 1;
}

.streamer-toggle-btn:hover {
    opacity: 1;
    transform: scale(1.1);
    border-color: #9146FF;
    /* Twitch purple */
}

.streamer-toggle-btn.active {
    background: #9146FF;
    border-color: #9146FF;
    opacity: 1;
    box-shadow: 0 0 20px #9146FF;
}

.streamer-twitch-logo {
    width: 28px;
    height: 28px;
}

/* Pixelated censorship overlay */
body.streamer-mode .room-code-value {
    color: transparent !important;
    text-shadow: none !important;
    user-select: all;
    position: relative;
    cursor: pointer;
}

body.streamer-mode .room-code-value::after {
    content: '';
    position: absolute;
    inset: -4px -8px;
    border-radius: 6px;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='40'%3E%3Crect x='0' y='0' width='8' height='8' fill='%23666'/%3E%3Crect x='8' y='0' width='8' height='8' fill='%23888'/%3E%3Crect x='16' y='0' width='8' height='8' fill='%23555'/%3E%3Crect x='24' y='0' width='8' height='8' fill='%23777'/%3E%3Crect x='32' y='0' width='8' height='8' fill='%23999'/%3E%3Crect x='40' y='0' width='8' height='8' fill='%23666'/%3E%3Crect x='48' y='0' width='8' height='8' fill='%23888'/%3E%3Crect x='56' y='0' width='8' height='8' fill='%23555'/%3E%3Crect x='64' y='0' width='8' height='8' fill='%23777'/%3E%3Crect x='72' y='0' width='8' height='8' fill='%23999'/%3E%3Crect x='0' y='8' width='8' height='8' fill='%23888'/%3E%3Crect x='8' y='8' width='8' height='8' fill='%23555'/%3E%3Crect x='16' y='8' width='8' height='8' fill='%23999'/%3E%3Crect x='24' y='8' width='8' height='8' fill='%23666'/%3E%3Crect x='32' y='8' width='8' height='8' fill='%23777'/%3E%3Crect x='40' y='8' width='8' height='8' fill='%23555'/%3E%3Crect x='48' y='8' width='8' height='8' fill='%23999'/%3E%3Crect x='56' y='8' width='8' height='8' fill='%23666'/%3E%3Crect x='64' y='8' width='8' height='8' fill='%23888'/%3E%3Crect x='72' y='8' width='8' height='8' fill='%23777'/%3E%3Crect x='0' y='16' width='8' height='8' fill='%23777'/%3E%3Crect x='8' y='16' width='8' height='8' fill='%23999'/%3E%3Crect x='16' y='16' width='8' height='8' fill='%23666'/%3E%3Crect x='24' y='16' width='8' height='8' fill='%23888'/%3E%3Crect x='32' y='16' width='8' height='8' fill='%23555'/%3E%3Crect x='40' y='16' width='8' height='8' fill='%23777'/%3E%3Crect x='48' y='16' width='8' height='8' fill='%23666'/%3E%3Crect x='56' y='16' width='8' height='8' fill='%23999'/%3E%3Crect x='64' y='16' width='8' height='8' fill='%23555'/%3E%3Crect x='72' y='16' width='8' height='8' fill='%23888'/%3E%3Crect x='0' y='24' width='8' height='8' fill='%23555'/%3E%3Crect x='8' y='24' width='8' height='8' fill='%23777'/%3E%3Crect x='16' y='24' width='8' height='8' fill='%23888'/%3E%3Crect x='24' y='24' width='8' height='8' fill='%23555'/%3E%3Crect x='32' y='24' width='8' height='8' fill='%23999'/%3E%3Crect x='40' y='24' width='8' height='8' fill='%23888'/%3E%3Crect x='48' y='24' width='8' height='8' fill='%23777'/%3E%3Crect x='56' y='24' width='8' height='8' fill='%23555'/%3E%3Crect x='64' y='24' width='8' height='8' fill='%23999'/%3E%3Crect x='72' y='24' width='8' height='8' fill='%23666'/%3E%3Crect x='0' y='32' width='8' height='8' fill='%23999'/%3E%3Crect x='8' y='32' width='8' height='8' fill='%23666'/%3E%3Crect x='16' y='32' width='8' height='8' fill='%23777'/%3E%3Crect x='24' y='32' width='8' height='8' fill='%23999'/%3E%3Crect x='32' y='32' width='8' height='8' fill='%23666'/%3E%3Crect x='40' y='32' width='8' height='8' fill='%23999'/%3E%3Crect x='48' y='32' width='8' height='8' fill='%23555'/%3E%3Crect x='56' y='32' width='8' height='8' fill='%23888'/%3E%3Crect x='64' y='32' width='8' height='8' fill='%23666'/%3E%3Crect x='72' y='32' width='8' height='8' fill='%23777'/%3E%3C/svg%3E");
    background-size: 80px 40px;
    image-rendering: pixelated;
}

/* Streamer mode: show X's instead of actual code */
body.streamer-mode .code-input {
    -webkit-text-security: disc;
    text-security: disc;
}

body.streamer-mode .room-code-card {
    position: relative;
}

/* Wrapper for input */
.code-input-wrapper {
    position: relative;
    width: 100%;
}

/* Hide player ID/tag if shown */
body.streamer-mode [data-sensitive="true"] {
    color: transparent !important;
    background: var(--muted);
}


/* ========== NEW YEAR 2026 THEME ========== */

/* New Year color scheme - applied to body.newyear-theme */
body.newyear-theme {
    --background: oklch(0.18 0.02 240);
    --card: oklch(0.22 0.03 240);
    --primary: oklch(0.55 0.2 140);
    --secondary: oklch(0.25 0.03 240);
    --muted: oklch(0.2 0.02 240);
    --border: oklch(0.3 0.04 240);
    --accent: oklch(0.6 0.25 25);
}

/* Big 2026 background */
.year-background {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    gap: 20px;
    z-index: 0;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.5s ease;
}

body.newyear-theme .year-background {
    opacity: 1;
}

.year-digit {
    font-size: clamp(15rem, 28vw, 28rem);
    font-weight: 900;
    color: transparent;
    -webkit-text-stroke: 2px oklch(0.4 0.1 240);
    text-shadow: 0 0 60px oklch(0.5 0.2 140 / 0.2);
    opacity: 0.12;
    animation: digitFloat 6s ease-in-out infinite;
    font-family: var(--font-sans);
}

.year-digit:nth-child(1) {
    animation-delay: 0s;
}

.year-digit:nth-child(2) {
    animation-delay: 0.5s;
}

.year-digit:nth-child(3) {
    animation-delay: 1s;
}

.year-digit:nth-child(4) {
    animation-delay: 1.5s;
}

@keyframes digitFloat {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-15px);
    }
}

/* Snowflakes - only visible in newyear theme */
.snowflakes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9998;
    overflow: hidden;
    opacity: 0;
    transition: opacity 0.5s ease;
}

body.newyear-theme .snowflakes {
    opacity: 1;
}

.snowflake {
    position: absolute;
    top: -20px;
    color: white;
    font-size: 1.5rem;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.8);
    animation: snowfall linear infinite;
    opacity: 0.8;
}

.snowflake:nth-child(1) {
    left: 5%;
    animation-duration: 10s;
    animation-delay: 0s;
    font-size: 1.2rem;
}

.snowflake:nth-child(2) {
    left: 15%;
    animation-duration: 12s;
    animation-delay: 1s;
    font-size: 1.8rem;
}

.snowflake:nth-child(3) {
    left: 25%;
    animation-duration: 8s;
    animation-delay: 2s;
    font-size: 1rem;
}

.snowflake:nth-child(4) {
    left: 35%;
    animation-duration: 14s;
    animation-delay: 0.5s;
    font-size: 1.5rem;
}

.snowflake:nth-child(5) {
    left: 45%;
    animation-duration: 9s;
    animation-delay: 3s;
    font-size: 2rem;
}

.snowflake:nth-child(6) {
    left: 55%;
    animation-duration: 11s;
    animation-delay: 1.5s;
    font-size: 1.3rem;
}

.snowflake:nth-child(7) {
    left: 65%;
    animation-duration: 13s;
    animation-delay: 2.5s;
    font-size: 1.6rem;
}

.snowflake:nth-child(8) {
    left: 75%;
    animation-duration: 10s;
    animation-delay: 4s;
    font-size: 1.1rem;
}

.snowflake:nth-child(9) {
    left: 85%;
    animation-duration: 15s;
    animation-delay: 0.8s;
    font-size: 1.9rem;
}

.snowflake:nth-child(10) {
    left: 92%;
    animation-duration: 7s;
    animation-delay: 3.5s;
    font-size: 1.4rem;
}

.snowflake:nth-child(11) {
    left: 10%;
    animation-duration: 16s;
    animation-delay: 5s;
    font-size: 1.7rem;
}

.snowflake:nth-child(12) {
    left: 50%;
    animation-duration: 11s;
    animation-delay: 6s;
    font-size: 1rem;
}

@keyframes snowfall {
    0% {
        transform: translateY(-20px) rotate(0deg);
        opacity: 0;
    }

    10% {
        opacity: 0.8;
    }

    90% {
        opacity: 0.8;
    }

    100% {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0;
    }
}

/* Garland lights - only visible in newyear theme */
.garland {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 30px;
    display: flex;
    justify-content: space-around;
    align-items: flex-start;
    z-index: 9997;
    pointer-events: none;
    padding: 0 20px;
    opacity: 0;
    transition: opacity 0.5s ease;
}

body.newyear-theme .garland {
    opacity: 1;
}

.garland::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg,
            transparent 0%,
            rgba(0, 100, 0, 0.6) 10%,
            rgba(0, 100, 0, 0.6) 90%,
            transparent 100%);
    border-radius: 2px;
}

.light {
    width: 12px;
    height: 18px;
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    position: relative;
    top: 12px;
    animation: glow 1.5s ease-in-out infinite;
    box-shadow: 0 0 10px currentColor, 0 0 20px currentColor;
}

.light:nth-child(1) {
    color: #ff4444;
    background: #ff4444;
    animation-delay: 0s;
}

.light:nth-child(2) {
    color: #ffdd44;
    background: #ffdd44;
    animation-delay: 0.1s;
}

.light:nth-child(3) {
    color: #44ff44;
    background: #44ff44;
    animation-delay: 0.2s;
}

.light:nth-child(4) {
    color: #44ddff;
    background: #44ddff;
    animation-delay: 0.3s;
}

.light:nth-child(5) {
    color: #ff44ff;
    background: #ff44ff;
    animation-delay: 0.4s;
}

.light:nth-child(6) {
    color: #ff4444;
    background: #ff4444;
    animation-delay: 0.5s;
}

.light:nth-child(7) {
    color: #ffdd44;
    background: #ffdd44;
    animation-delay: 0.6s;
}

.light:nth-child(8) {
    color: #44ff44;
    background: #44ff44;
    animation-delay: 0.7s;
}

.light:nth-child(9) {
    color: #44ddff;
    background: #44ddff;
    animation-delay: 0.8s;
}

.light:nth-child(10) {
    color: #ff44ff;
    background: #ff44ff;
    animation-delay: 0.9s;
}

.light:nth-child(11) {
    color: #ff4444;
    background: #ff4444;
    animation-delay: 1s;
}

.light:nth-child(12) {
    color: #ffdd44;
    background: #ffdd44;
    animation-delay: 1.1s;
}

.light:nth-child(13) {
    color: #44ff44;
    background: #44ff44;
    animation-delay: 1.2s;
}

.light:nth-child(14) {
    color: #44ddff;
    background: #44ddff;
    animation-delay: 1.3s;
}

.light:nth-child(15) {
    color: #ff44ff;
    background: #ff44ff;
    animation-delay: 1.4s;
}

@keyframes glow {

    0%,
    100% {
        opacity: 1;
        filter: brightness(1.2);
    }

    50% {
        opacity: 0.4;
        filter: brightness(0.6);
    }
}

/* New Year toggle button */
.newyear-toggle-btn {
    display: none;
}

/* ========== SETTINGS PANEL ========== */
.settings-panel {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 9999;
}

.settings-toggle-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--card);
    border: 2px solid var(--border);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    color: var(--muted-foreground);
}

.settings-toggle-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: rotate(45deg);
}

.settings-toggle-btn.active {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--secondary);
}

.settings-toggle-btn.active svg {
    animation: spinGear 4s linear infinite;
}

@keyframes spinGear {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.settings-menu {
    position: absolute;
    bottom: 60px;
    left: 0;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) + 4px);
    padding: 8px;
    min-width: 220px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px) scale(0.95);
    transition: all 0.2s ease;
    box-shadow: 0 10px 40px oklch(0 0 0 / 0.3);
}

.settings-panel.open .settings-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.settings-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.15s ease;
}

.settings-item:hover {
    background: var(--secondary);
}

.settings-item-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--muted);
    border-radius: 8px;
    color: var(--muted-foreground);
    transition: all 0.2s;
}

.settings-item.active .settings-item-icon {
    background: var(--primary);
    color: white;
}

.settings-item-label {
    flex: 1;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--foreground);
}

.settings-item-toggle {
    width: 40px;
    height: 22px;
    background: var(--border);
    border-radius: 11px;
    position: relative;
    transition: all 0.3s ease;
}

.settings-item.active .settings-item-toggle {
    background: var(--primary);
}

.settings-item-toggle .toggle-slider {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    background: white;
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.settings-item.active .settings-item-toggle .toggle-slider {
    left: 21px;
}

/* ========== THEME SELECTOR ========== */
.theme-selector {
    padding: 8px;
}

.theme-selector-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--muted-foreground);
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 8px 10px 12px;
}

.theme-option {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 12px;
    border-radius: calc(var(--radius) + 2px);
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
    margin-bottom: 8px;
}

.theme-option:last-child {
    margin-bottom: 0;
}

.theme-option:hover {
    background: var(--secondary);
}

.theme-option.active {
    border-color: var(--primary);
    background: oklch(0.7357 0.1641 34.7091 / 0.1);
}

.theme-option-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

.theme-option-icon svg {
    width: 28px;
    height: 28px;
    position: relative;
    z-index: 1;
}

/* Default theme icon */
.theme-option[data-theme="default"] .theme-option-icon {
    background: linear-gradient(135deg, oklch(0.3 0.02 352), oklch(0.25 0.017 352));
    border: 1px solid oklch(0.4 0.03 352);
    color: oklch(0.7357 0.1641 34.7091);
}

/* New Year theme icon */
.theme-option[data-theme="newyear"] .theme-option-icon {
    background: linear-gradient(135deg, oklch(0.22 0.03 240), oklch(0.18 0.02 240));
    border: 1px solid oklch(0.3 0.04 240);
    color: oklch(0.55 0.2 140);
}

.theme-option[data-theme="newyear"] .theme-option-icon::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 30%, oklch(0.6 0.25 25 / 0.3) 0%, transparent 30%),
        radial-gradient(circle at 80% 70%, oklch(0.55 0.2 140 / 0.3) 0%, transparent 30%);
}

.theme-option-info {
    flex: 1;
    min-width: 0;
}

.theme-option-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--foreground);
    margin-bottom: 4px;
}

.theme-option-desc {
    font-size: 0.8rem;
    color: var(--muted-foreground);
    line-height: 1.4;
}

.theme-option-check {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.theme-option.active .theme-option-check {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.theme-option-check svg {
    width: 14px;
    height: 14px;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.2s;
}

.theme-option.active .theme-option-check svg {
    opacity: 1;
    transform: scale(1);
}

/* New Year theme active state */
body.newyear-theme .theme-option.active {
    border-color: oklch(0.55 0.2 140);
    background: oklch(0.55 0.2 140 / 0.1);
}

body.newyear-theme .theme-option.active .theme-option-check {
    background: oklch(0.55 0.2 140);
    border-color: oklch(0.55 0.2 140);
}

/* Festive title accent - only in newyear theme */
body.newyear-theme .title-accent {
    background: linear-gradient(135deg, oklch(0.55 0.2 140), oklch(0.6 0.25 25), oklch(0.55 0.2 140));
    background-size: 200% 200%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: gradientShift 4s ease infinite;
}

@keyframes gradientShift {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

/* ========== TOAST NOTIFICATIONS ========== */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) + 4px);
    box-shadow: 0 10px 40px oklch(0 0 0 / 0.3);
    pointer-events: auto;
    animation: toastIn 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    max-width: 350px;
}

.toast.hiding {
    animation: toastOut 0.25s ease forwards;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(100px) scale(0.9);
    }

    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes toastOut {
    to {
        opacity: 0;
        transform: translateX(100px) scale(0.9);
    }
}

.toast-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.toast-icon svg {
    width: 20px;
    height: 20px;
}

.toast.toast-error .toast-icon {
    background: oklch(0.6122 0.2082 22.2410 / 0.15);
    color: var(--destructive);
}

.toast.toast-success .toast-icon {
    background: oklch(0.55 0.15 145 / 0.15);
    color: oklch(0.55 0.15 145);
}

.toast.toast-warning .toast-icon {
    background: oklch(0.75 0.15 85 / 0.15);
    color: oklch(0.75 0.15 85);
}

.toast.toast-info .toast-icon {
    background: oklch(0.6 0.15 240 / 0.15);
    color: oklch(0.6 0.15 240);
}

.toast-content {
    flex: 1;
    min-width: 0;
}

.toast-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--foreground);
    margin-bottom: 2px;
}

.toast-message {
    font-size: 0.8rem;
    color: var(--muted-foreground);
    line-height: 1.4;
}

.toast-close {
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    color: var(--muted-foreground);
    cursor: pointer;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    flex-shrink: 0;
}

.toast-close:hover {
    background: var(--muted);
    color: var(--foreground);
}

.toast-close svg {
    width: 16px;
    height: 16px;
}


/* ========== LOADING OVERLAY ========== */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: oklch(0 0 0 / 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(8px);
}

.loading-overlay.show {
    opacity: 1;
    visibility: visible;
}

.loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-text {
    font-size: 1rem;
    font-weight: 500;
    color: var(--muted-foreground);
}

/* ========== HOST LEFT OVERLAY ========== */
.host-left-overlay {
    position: fixed;
    inset: 0;
    background: oklch(0.1 0.02 240 / 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
    backdrop-filter: blur(12px);
}

.host-left-overlay.show {
    opacity: 1;
    visibility: visible;
}

.host-left-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    text-align: center;
    padding: 40px;
}

.host-left-icon {
    font-size: 5rem;
    animation: crownBounce 1s ease-in-out infinite;
}

@keyframes crownBounce {

    0%,
    100% {
        transform: translateY(0) rotate(-5deg);
    }

    50% {
        transform: translateY(-10px) rotate(5deg);
    }
}

.host-left-title {
    font-size: 2rem;
    font-weight: 800;
    color: var(--foreground);
    margin-top: 10px;
}

.host-left-subtitle {
    font-size: 1.1rem;
    color: var(--muted-foreground);
}

.host-left-countdown {
    font-size: 6rem;
    font-weight: 900;
    color: var(--primary);
    line-height: 1;
    text-shadow: 0 0 40px oklch(0.7357 0.1641 34.7091 / 0.5);
    animation: countdownPulse 1s ease-in-out infinite;
}

.host-left-progress {
    width: 200px;
    height: 6px;
    background: var(--muted);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 10px;
}

.host-left-progress-bar {
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: 3px;
}

/* ========== PLAYER POPUP ========== */
.player-popup {
    position: fixed;
    inset: 0;
    background: oklch(0 0 0 / 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    backdrop-filter: blur(8px);
}

.player-popup.show {
    opacity: 1;
    visibility: visible;
}

.player-popup-content {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) + 12px);
    padding: 40px 50px;
    text-align: center;
    position: relative;
    transform: scale(0.9) translateY(20px);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
    min-width: 280px;
}

.player-popup.show .player-popup-content {
    transform: scale(1) translateY(0);
}

/* Background decorations for player popup */
.player-popup-content::before {
    content: '';
    position: absolute;
    width: 180px;
    height: 180px;
    background: var(--primary);
    border-radius: 50%;
    top: -70px;
    right: -50px;
    opacity: 0.1;
    animation: floatCircle 8s ease-in-out infinite;
}

.player-popup-content::after {
    content: '';
    position: absolute;
    width: 120px;
    height: 120px;
    background: var(--accent);
    border-radius: 50%;
    bottom: -40px;
    left: -30px;
    opacity: 0.1;
    animation: floatCircle 10s ease-in-out infinite reverse;
}

.player-popup-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--muted-foreground);
    width: 32px;
    height: 32px;
    border-radius: var(--radius);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 1;
}

.player-popup-close:hover {
    border-color: var(--destructive);
    color: var(--destructive);
}

.player-popup-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    font-weight: 700;
    color: white;
    background-size: cover;
    background-position: center;
    box-shadow: 0 8px 30px oklch(0 0 0 / 0.3);
    position: relative;
    z-index: 1;
    border: 4px solid var(--card);
    outline: 2px solid var(--border);
}

.player-popup-name {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--foreground);
    position: relative;
    z-index: 1;
}

/* Player item clickable */
.player-item {
    cursor: pointer;
}

.player-item:hover {
    background: var(--secondary);
}

/* Player item avatar with image support */
.player-item-avatar {
    background-size: cover;
    background-position: center;
    overflow: hidden;
}