/* вход по коду комнаты */

/* убрать серую «коробку» #content */
body:has(.enter-room) #content {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    max-width: none !important;
    width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding: 8px 12px 28px !important;
    animation: none;
}

body:has(.enter-room).has-sidebar #content {
    margin-left: 0 !important;
}

body:has(.enter-room) #content a {
    color: inherit;
}

body:has(.enter-room) #content a:hover {
    color: inherit;
}

.enter-room {
    --er-orange: #ff7a1a;
    --er-orange-deep: #ff5a00;
    --er-ink: #2b3038;
    --er-muted: #8b919a;

    width: min(460px, 100%);
    margin: 6px auto 36px;
    padding: 0 10px 20px;
    animation: er-page-in 0.5s cubic-bezier(0.22, 0.9, 0.3, 1) both;
}

@keyframes er-page-in {
    from { opacity: 0; transform: translate3d(0, 14px, 0); }
    to { opacity: 1; transform: translate3d(0, 0, 0); }
}

@keyframes er-fade-up {
    from { opacity: 0; transform: translate3d(0, 10px, 0); }
    to { opacity: 1; transform: translate3d(0, 0, 0); }
}

.enter-room__news {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin: 0 0 14px;
    padding: 12px 14px;
    border-radius: 16px;
    background: #fff7f0;
    border: 1px solid rgba(255, 122, 26, 0.18);
    color: #7a4a22 !important;
    text-decoration: none !important;
    font-size: 0.88rem;
    animation: er-fade-up 0.45s ease both;
}

.enter-room__news strong {
    font-size: 0.95rem;
    color: var(--er-orange-deep);
}

.enter-room__card {
    position: relative;
    background: transparent;
    border-radius: 0;
    border: none;
    box-shadow: none;
    padding: 12px 4px 8px;
    overflow: visible;
}

.enter-room__mascot {
    position: relative;
    width: min(210px, 62%);
    margin: 0 auto 8px;
    display: grid;
    place-items: center;
    animation: er-fade-up 0.55s ease both;
    animation-delay: 0.06s;
}

.enter-room__mascot img {
    position: relative;
    z-index: 1;
    width: 100%;
    height: auto;
    display: block;
    filter: drop-shadow(0 14px 24px rgba(120, 70, 30, 0.16));
    animation: er-float 4.8s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite;
    transform: translate3d(0, 0, 0);
    backface-visibility: hidden;
    user-select: none;
    pointer-events: none;
}

@keyframes er-float {
    0%, 100% { transform: translate3d(0, 0, 0); }
    50% { transform: translate3d(0, -10px, 0); }
}

.enter-room__spark,
.enter-room__paw {
    position: absolute;
    pointer-events: none;
    z-index: 0;
}

.enter-room__spark {
    width: 10px;
    height: 10px;
    background:
        linear-gradient(currentColor, currentColor) center / 100% 2px no-repeat,
        linear-gradient(currentColor, currentColor) center / 2px 100% no-repeat;
    color: rgba(255, 122, 26, 0.45);
    animation: er-twinkle 2.4s ease-in-out infinite;
}

.enter-room__spark--1 { top: 12%; left: 8%; }
.enter-room__spark--2 { top: 18%; right: 6%; width: 8px; height: 8px; animation-delay: 0.5s; }
.enter-room__spark--3 { bottom: 22%; left: 4%; width: 7px; height: 7px; animation-delay: 1s; }

@keyframes er-twinkle {
    0%, 100% { opacity: 0.35; transform: scale(0.85); }
    50% { opacity: 1; transform: scale(1.15); }
}

.enter-room__paw {
    width: 18px;
    height: 18px;
    opacity: 0.22;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg fill='%23ff7a1a'%3E%3Cellipse cx='7.2' cy='8.2' rx='2' ry='2.5' transform='rotate(-18 7.2 8.2)'/%3E%3Cellipse cx='12' cy='5.8' rx='2' ry='2.5'/%3E%3Cellipse cx='16.8' cy='8.2' rx='2' ry='2.5' transform='rotate(18 16.8 8.2)'/%3E%3Cpath d='M8 13.2c0 2.2 1.5 4 4 4s4-1.8 4-4c0-1.3-.9-2-2.2-2.3-1-.2-1.8.1-2.4.7-.6-.6-1.4-.9-2.3-.7-1.3.3-2.1 1-1.1 2.3z'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat;
    animation: er-paw-drift 6s ease-in-out infinite;
}

.enter-room__paw--1 { top: 28%; right: 2%; }
.enter-room__paw--2 { bottom: 16%; right: 12%; animation-delay: 1.2s; }

@keyframes er-paw-drift {
    0%, 100% { transform: translate3d(0, 0, 0); }
    50% { transform: translate3d(0, -6px, 0); }
}

.enter-room__head {
    text-align: center;
    margin: 4px 0 22px;
    animation: er-fade-up 0.5s ease both;
    animation-delay: 0.12s;
}

.enter-room__head h1 {
    margin: 0 0 8px;
    font-size: clamp(1.35rem, 3.4vw, 1.7rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--er-ink);
    line-height: 1.2;
}

.enter-room__head p {
    margin: 0;
    color: var(--er-muted);
    font-size: 0.95rem;
    line-height: 1.45;
}

.enter-room__form {
    display: grid;
    gap: 16px;
    animation: er-fade-up 0.5s ease both;
    animation-delay: 0.18s;
}

.enter-room__sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.enter-room__label {
    display: block;
    margin: 0 0 8px;
    font-size: 0.9rem;
    font-weight: 700;
    color: #5c6470;
    text-align: left;
}

.enter-room__field--code {
    position: relative;
}

.enter-room__field--nick {
    text-align: left;
}

.enter-room .otp-hidden {
    position: absolute !important;
    opacity: 0 !important;
    pointer-events: none !important;
    width: 1px !important;
    height: 1px !important;
}

.enter-room .otp-wrap {
    width: 100%;
    display: flex;
    justify-content: center;
}

.enter-room .otp {
    display: flex;
    gap: 8px;
    justify-content: center;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.enter-room .otp__cell {
    flex: 1 1 0;
    min-width: 0;
    max-width: 48px;
    width: 100%;
    height: 52px;
    border-radius: 13px;
    border: 1.5px solid rgba(15, 23, 42, 0.12);
    background: #fff;
    text-align: center;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--er-ink);
    outline: none;
    box-sizing: border-box;
    padding: 0;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.enter-room .otp__cell:focus {
    border-color: var(--er-orange);
    box-shadow: 0 0 0 3px rgba(255, 122, 26, 0.14);
    transform: translateY(-1px);
}

.enter-room__nick {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 16px;
    min-height: 54px;
    border-radius: 999px;
    border: 1.5px solid rgba(15, 23, 42, 0.12);
    background: #fff;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.enter-room__nick:focus-within {
    border-color: var(--er-orange);
    box-shadow: 0 0 0 3px rgba(255, 122, 26, 0.12);
}

.enter-room__nick svg {
    width: 22px;
    height: 22px;
    flex: 0 0 auto;
    color: #a0a6b0;
}

.enter-room__nick input {
    flex: 1 1 auto;
    min-width: 0;
    border: 0 !important;
    outline: none !important;
    box-shadow: none !important;
    background: transparent !important;
    padding: 14px 0 !important;
    margin: 0 !important;
    font: inherit;
    font-size: 1rem;
    font-weight: 600;
    color: var(--er-ink);
    width: 100%;
    float: none !important;
    max-width: none !important;
}

.enter-room__nick input::placeholder {
    color: #b0b6c0;
    font-weight: 500;
}

.enter-room__submit {
    appearance: none;
    border: 0;
    width: 100%;
    min-height: 54px;
    margin-top: 4px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 20px;
    background: linear-gradient(90deg, #ff8a2b 0%, #ff5c12 100%);
    color: #fff;
    font: inherit;
    font-size: 1.05rem;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 12px 28px rgba(255, 100, 20, 0.32);
    transition: transform 0.18s ease, filter 0.18s ease, box-shadow 0.18s ease;
}

.enter-room__submit:hover {
    transform: translateY(-2px);
    filter: brightness(1.03);
    box-shadow: 0 16px 34px rgba(255, 100, 20, 0.38);
}

.enter-room__submit:active {
    transform: translateY(0);
}

.enter-room__paw-icon {
    width: 20px;
    height: 20px;
    fill: #fff;
    flex: 0 0 auto;
}

.enter-room__errors {
    margin-top: 8px;
    text-align: left;
}

.enter-room__errors p {
    margin: 0;
    color: #e11d48;
    font-size: 0.88rem;
    font-weight: 700;
}

.enter-room__divider {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 22px 0 16px;
    font-size: 0.88rem;
    font-weight: 600;
    animation: er-fade-up 0.5s ease both;
    animation-delay: 0.26s;
}

.enter-room__divider::before,
.enter-room__divider::after {
    content: "";
    flex: 1 1 auto;
    height: 1px;
    background: rgba(15, 23, 42, 0.1);
}

.enter-room__divider span {
    flex: 0 0 auto;
    color: #9aa0a8;
}

.enter-room__account {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 14px 14px 12px;
    border-radius: 18px;
    background: linear-gradient(135deg, #fff4ea 0%, #ffe8d4 100%);
    border: 1px solid rgba(255, 140, 60, 0.18);
    text-decoration: none !important;
    color: inherit !important;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
    animation: er-fade-up 0.5s ease both;
    animation-delay: 0.32s;
}

.enter-room__account:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(255, 122, 26, 0.16);
}

.enter-room__account-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 122, 26, 0.16);
    color: var(--er-orange);
    display: grid;
    place-items: center;
    flex: 0 0 auto;
}

.enter-room__account-icon svg {
    width: 22px;
    height: 22px;
}

.enter-room__account-text {
    flex: 1 1 auto;
    min-width: 0;
    display: grid;
    gap: 2px;
    text-align: left;
}

.enter-room__account-text strong {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--er-ink);
    line-height: 1.25;
}

.enter-room__account-text small {
    font-size: 0.78rem;
    color: var(--er-muted);
    font-weight: 500;
    line-height: 1.3;
}

.enter-room__account-chevron {
    width: 22px;
    height: 22px;
    color: var(--er-orange);
    flex: 0 0 auto;
    display: grid;
    place-items: center;
}

.enter-room__account-chevron svg {
    width: 18px;
    height: 18px;
}

.enter-room__back {
    display: inline-block;
    width: 100%;
    margin-top: 14px;
    text-align: center;
    font-size: 0.8rem;
    font-weight: 600;
    color: #9aa0a8 !important;
    text-decoration: none !important;
    transition: color 0.18s ease;
    animation: er-fade-up 0.5s ease both;
    animation-delay: 0.38s;
}

.enter-room__back:hover {
    color: var(--er-orange) !important;
    text-decoration: underline !important;
}

@media (max-width: 480px) {
    .enter-room {
        padding: 0 6px 20px;
    }

    .enter-room__card {
        padding: 20px 10px 18px;
        border-radius: 22px;
    }

    .enter-room .otp {
        gap: 6px;
    }

    .enter-room .otp__cell {
        min-width: 0;
        max-width: 44px;
        height: 46px;
        font-size: 1.1rem;
        border-radius: 11px;
    }

    .enter-room__account-text strong { font-size: 0.88rem; }
    .enter-room__account-text small { font-size: 0.72rem; }
}

@media (max-width: 360px) {
    .enter-room__card {
        padding: 16px 8px 16px;
    }

    .enter-room .otp {
        gap: 4px;
    }

    .enter-room .otp__cell {
        min-width: 0;
        max-width: 38px;
        height: 42px;
        font-size: 1rem;
        border-radius: 9px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .enter-room,
    .enter-room__mascot img,
    .enter-room__spark,
    .enter-room__paw,
    .enter-room__news,
    .enter-room__head,
    .enter-room__form,
    .enter-room__divider,
    .enter-room__account,
    .enter-room__back {
        animation: none !important;
    }
}

/* Блок быстрого возврата в комнату */
.enter-room__restore-card {
    margin-bottom: 20px;
    padding: 18px 20px;
    background: linear-gradient(135deg, #fffaf5 0%, #fff1e5 100%);
    border: 1.5px solid rgba(255, 122, 26, 0.35);
    border-radius: 20px;
    box-shadow: 0 8px 24px rgba(255, 122, 26, 0.08);
    animation: er-fade-up 0.4s ease both;
}

.enter-room__restore-tag {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    background: #ff7a1a;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 6px;
}

.enter-room__restore-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: #2b3038;
    margin: 0 0 4px;
}

.enter-room__restore-highlight {
    color: #ff5a00;
}

.enter-room__restore-desc {
    font-size: 0.85rem;
    color: #6a717b;
    margin: 0 0 12px;
}

.enter-room__restore-inputs {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.enter-room__submit--restore {
    margin-top: 4px;
    background: linear-gradient(135deg, #ff7a1a, #ff5a00) !important;
}

.enter-room__restore-tag--warning {
    background: #ff5200;
}

.enter-room__scenario-box {
    padding: 16px 16px 14px;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.enter-room__scenario-box--namesake {
    background: #f4f8fc;
    border: 1.5px solid #d5e4f3;
}

.enter-room__scenario-box--return {
    background: #fff8f2;
    border: 1.5px solid #ffd8be;
}

.enter-room__scenario-head {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.enter-room__scenario-num {
    display: inline-grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 800;
    flex-shrink: 0;
}

.enter-room__scenario-box--namesake .enter-room__scenario-num {
    background: #2a7ade;
    color: #fff;
}

.enter-room__scenario-box--return .enter-room__scenario-num {
    background: #ff6a00;
    color: #fff;
}

.enter-room__scenario-copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.enter-room__scenario-copy strong {
    font-size: 0.95rem;
    color: #1e242d;
    line-height: 1.25;
}

.enter-room__scenario-copy p {
    font-size: 0.82rem;
    color: #636b76;
    margin: 0;
    line-height: 1.35;
}

.enter-room__scenario-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 2px 0;
    color: #aab2bd;
    font-size: 0.74rem;
    font-weight: 700;
    text-transform: uppercase;
}

.enter-room__scenario-divider::before,
.enter-room__scenario-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px dashed rgba(0, 0, 0, 0.15);
}

.enter-room__scenario-divider span {
    padding: 0 12px;
}

.enter-room__restore-reset-btn {
    background: none;
    border: none;
    padding: 8px 0 2px;
    color: #9aa0a8;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color 0.15s ease;
    width: 100%;
    text-align: center;
}

.enter-room__restore-reset-btn:hover {
    color: #ff7a1a;
}

.enter-room__restore-reset-btn--alt {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 12px;
    background: #ffffff;
    border: 1.5px solid rgba(42, 122, 222, 0.3);
    color: #2067c2;
    text-decoration: none !important;
    font-size: 0.88rem;
    font-weight: 700;
    transition: all 0.15s ease;
}

.enter-room__restore-reset-btn--alt:hover {
    border-color: #2067c2;
    color: #174ea6;
    background: #edf5fe;
}
