:root {
    --bg-panel: rgba(14, 19, 24, 0.92);
    --bg-card: rgba(18, 24, 30, 0.82);
    --line: rgba(255, 255, 255, 0.08);
    --line-strong: rgba(255, 255, 255, 0.2);
    --text-main: #f2f5f7;
    --text-soft: rgba(242, 245, 247, 0.7);
    --accent: #ffc93d;
    --accent-dark: #d59e0e;
    --canvas-fill: #3d5563;
    --danger: #ff7f7f;
    --shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
    font-family: 'Exo 2', sans-serif;
    background: #263038;
    color: var(--text-main);
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(circle at top left, rgba(255, 201, 61, 0.08), transparent 28%),
        radial-gradient(circle at top right, rgba(87, 127, 155, 0.18), transparent 22%),
        linear-gradient(180deg, #2c3640 0%, #263038 100%);
    opacity: 0;
    transform: scale(1.02);
    transition: opacity 0.65s ease, transform 0.9s ease;
    pointer-events: none;
}

body.is-ready::before {
    opacity: 1;
    transform: scale(1);
}

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

button,
input {
    font: inherit;
}

textarea,
select {
    font: inherit;
}

.site-select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image:
        linear-gradient(45deg, transparent 50%, rgba(242, 245, 247, 0.9) 50%),
        linear-gradient(135deg, rgba(242, 245, 247, 0.9) 50%, transparent 50%);
    background-position:
        calc(100% - 18px) calc(50% - 3px),
        calc(100% - 12px) calc(50% - 3px);
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
    padding-right: 38px;
    cursor: pointer;
}

.site-select--native {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    pointer-events: none;
}

.custom-select {
    position: relative;
    width: 100%;
}

.custom-select.is-disabled {
    opacity: 0.62;
}

.custom-select__trigger {
    width: 100%;
    min-height: 54px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px 14px 18px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.025));
    color: var(--text-main);
    text-align: left;
    cursor: pointer;
    transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease, border-radius 0.2s ease;
}

.custom-select__trigger:hover {
    border-color: rgba(255, 201, 61, 0.32);
    background: linear-gradient(180deg, rgba(255, 201, 61, 0.08), rgba(255, 255, 255, 0.03));
}

.custom-select.is-open .custom-select__trigger {
    border-color: rgba(255, 201, 61, 0.55);
    border-radius: 18px 18px 12px 12px;
    box-shadow: 0 0 0 2px rgba(255, 201, 61, 0.12);
}

.custom-select__label {
    min-width: 0;
    flex: 1;
    font-weight: 600;
    color: var(--text-main);
}

.custom-select__arrow {
    width: 24px;
    height: 24px;
    display: inline-grid;
    place-items: center;
    flex-shrink: 0;
    color: var(--accent);
    transition: transform 0.22s ease, color 0.2s ease;
}

.custom-select__arrow svg {
    width: 18px;
    height: 18px;
    display: block;
}

.custom-select.is-open .custom-select__arrow {
    transform: rotate(180deg);
}

.custom-select__menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    z-index: 999;
    display: grid;
    gap: 4px;
    padding: 8px;
    border: 1px solid rgba(255, 201, 61, 0.22);
    border-radius: 16px;
    background: rgba(12, 17, 22, 0.98);
    box-shadow: 0 18px 34px rgba(0, 0, 0, 0.32);
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease;
    backdrop-filter: blur(16px);
}

.custom-select.is-open .custom-select__menu {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.custom-select__option {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid transparent;
    border-radius: 12px;
    background: transparent;
    color: var(--text-main);
    text-align: left;
    cursor: pointer;
    transition: background-color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.custom-select__option:hover,
.custom-select__option:focus-visible {
    border-color: rgba(255, 201, 61, 0.2);
    background: rgba(255, 255, 255, 0.05);
    transform: translateX(2px);
    outline: none;
}

.custom-select__option.is-selected {
    border-color: rgba(255, 201, 61, 0.3);
    background: linear-gradient(135deg, rgba(255, 201, 61, 0.16), rgba(255, 201, 61, 0.04));
    color: #fff3ca;
}

.custom-select__option.is-disabled,
.custom-select__option:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

.custom-select__preview {
    position: absolute;
    top: calc(100% + 8px);
    left: calc(100% + 14px);
    width: 154px;
    padding: 4px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    box-shadow: none;
    opacity: 0;
    transform: translateX(-8px) scale(0.98);
    pointer-events: none;
    transition: opacity 0.16s ease, transform 0.16s ease;
    z-index: 1001;
}

.custom-select__preview--floating {
    position: fixed;
    top: 0;
    left: 0;
}

.custom-select__preview.is-visible {
    opacity: 1;
    transform: translateX(0) scale(1);
    pointer-events: auto;
}

.custom-select__preview-title {
    margin: 0 0 4px;
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    color: rgba(255, 243, 202, 0.86);
}

.custom-select__preview-canvas {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: transparent;
}

.custom-select__preview-canvas-host {
    width: 100%;
    height: 100%;
}

.custom-select__preview-canvas-host canvas {
    width: 100% !important;
    height: 100% !important;
    display: block;
}

.site-select:focus {
    border-color: rgba(255, 201, 61, 0.52);
    box-shadow: 0 0 0 2px rgba(255, 201, 61, 0.18);
}

.site-select option {
    background: #0f151b;
    color: var(--text-main);
}

.site-select:disabled {
    opacity: 0.62;
    cursor: not-allowed;
}

.auth-body {
    min-height: 100vh;
}

.auth-layout {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.1fr minmax(320px, 460px);
    gap: 32px;
    padding: 32px;
}

.auth-brand,
.auth-card {
    border: 1px solid var(--line);
    backdrop-filter: blur(16px);
    box-shadow: var(--shadow);
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.55s ease, transform 0.55s ease;
}

body.is-ready .auth-brand,
body.is-ready .auth-card {
    opacity: 1;
    transform: translateY(0);
}

body.is-ready .auth-card {
    transition-delay: 0.12s;
}

.auth-brand {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 56px;
    border-radius: 28px;
    background:
        linear-gradient(140deg, rgba(255, 201, 61, 0.08), transparent 38%),
        rgba(11, 17, 22, 0.55);
}

.brand-kicker,
.auth-card-kicker {
    margin: 0 0 12px;
    font-size: 0.85rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--accent);
}

.auth-brand h1,
.auth-card h2 {
    margin: 0;
    line-height: 1.04;
}

.auth-brand h1 {
    max-width: 12ch;
    font-size: clamp(2.4rem, 5vw, 4.8rem);
}

.brand-copy {
    max-width: 54ch;
    margin: 20px 0 0;
    color: var(--text-soft);
    line-height: 1.6;
}

.brand-mark,
.menu-grid {
    display: grid;
    grid-template-columns: repeat(3, 12px);
    grid-template-rows: repeat(3, 12px);
    gap: 4px;
}

.brand-mark {
    width: 88px;
    margin-bottom: 28px;
}

.brand-mark span,
.menu-grid span {
    width: 12px;
    height: 12px;
    border: 2px solid rgba(255, 255, 255, 0.8);
    border-radius: 3px;
    box-sizing: border-box;
}

.auth-card-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-card {
    width: 100%;
    padding: 36px;
    border-radius: 28px;
    background: var(--bg-card);
}

.auth-card h2 {
    font-size: clamp(1.8rem, 2.5vw, 2.4rem);
}

.auth-form {
    margin-top: 28px;
}

.field-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.field-group label {
    color: var(--text-soft);
}

.auth-input {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-main);
    padding: 16px 18px;
    outline: none;
    transition: border-color 0.2s ease, transform 0.2s ease, background-color 0.2s ease;
}

.auth-input:focus {
    border-color: var(--accent);
    background: rgba(255, 201, 61, 0.05);
    transform: translateY(-1px);
}

.primary-button {
    width: 100%;
    border: 0;
    border-radius: 16px;
    padding: 16px 20px;
    background: linear-gradient(135deg, var(--accent) 0%, #ffe074 100%);
    color: #171a1e;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.primary-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 28px rgba(255, 201, 61, 0.24);
}

.auth-switch {
    margin: 22px 0 0;
    color: var(--text-soft);
}

.auth-switch a {
    color: var(--accent);
}

.form-errors,
.field-error {
    color: var(--danger);
    font-size: 0.95rem;
}

.form-errors p,
.field-error p {
    margin: 0;
}

.password-hints {
    margin-top: 6px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.025);
}

.password-hints p {
    margin: 0 0 10px;
    color: var(--text-soft);
    font-size: 0.92rem;
}

.password-hints ul {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 8px;
}

.password-hints li {
    position: relative;
    padding-left: 18px;
    color: var(--text-soft);
    transition: color 0.2s ease;
}

.password-hints li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 8px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.password-hints li.is-valid {
    color: #d8ffc0;
}

.password-hints li.is-valid::before {
    background: #b9ff74;
    transform: scale(1.15);
}

.dashboard-body {
    min-height: 100vh;
    overflow: hidden;
}

.rooms-body {
    min-height: 100vh;
    overflow-x: hidden;
}

.dashboard-shell {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
}

.scene-backdrop {
    position: fixed;
    inset: 0;
    z-index: 0;
    opacity: 0;
    transform: scale(1.04);
    transition: opacity 0.75s ease, transform 1s ease;
}

body.is-ready .scene-backdrop {
    opacity: 1;
    transform: scale(1);
}

.dashboard-topbar {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 20;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    min-width: 96px;
    opacity: 0;
    transform: translateY(-20px);
    transition: opacity 0.55s ease 0.2s, transform 0.55s ease 0.2s;
}

body.is-ready .dashboard-topbar {
    opacity: 1;
    transform: translateY(0);
}

.profile-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    padding: 0;
    border: 2px solid rgba(255, 255, 255, 0.28);
    border-radius: 50%;
    background: rgba(16, 22, 28, 0.68);
    color: var(--text-main);
    font-size: 1.2rem;
    font-weight: 700;
    backdrop-filter: blur(12px);
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.profile-button:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 201, 61, 0.55);
    background: rgba(255, 201, 61, 0.12);
}

.profile-button__avatar,
.profile-button__initials {
    width: 100%;
    height: 100%;
    border-radius: 50%;
}

.profile-button__avatar {
    display: block;
    object-fit: cover;
}

.profile-button__initials {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.profile-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 34;
    background: rgba(3, 5, 7, 0.62);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.24s ease;
}

.profile-modal-backdrop.is-open {
    opacity: 1;
    pointer-events: auto;
}

.profile-modal {
    position: fixed;
    inset: 0;
    z-index: 35;
    display: grid;
    place-items: center;
    padding: 32px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.24s ease;
}

.profile-modal.is-open {
    opacity: 1;
    pointer-events: auto;
}

.profile-modal--public {
    position: static;
    inset: auto;
    display: block;
    padding: 0;
    opacity: 1;
    pointer-events: auto;
    width: min(1120px, 100%);
}

.profile-modal--public .profile-modal__dialog {
    width: 100%;
    max-height: none;
}

.profile-modal__dialog {
    width: min(1120px, 100%);
    max-height: calc(100vh - 64px);
    overflow: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    border: 1px solid var(--line-strong);
    border-radius: 28px;
    background:
        radial-gradient(circle at top right, rgba(255, 201, 61, 0.14), transparent 24%),
        rgba(11, 16, 21, 0.95);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.42);
    backdrop-filter: blur(18px);
}

.profile-modal__dialog::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}

.profile-modal__header {
    padding: 28px 28px 20px;
    border-bottom: 1px solid var(--line);
}

.profile-modal__header-top {
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    gap: 24px;
}

.profile-modal__identity {
    display: flex;
    align-items: center;
    gap: 18px;
}

.profile-modal__avatar-wrap {
    flex-shrink: 0;
}

.profile-modal__avatar-action {
    position: relative;
    display: inline-flex;
    cursor: pointer;
}

.profile-modal__avatar-action::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: rgba(7, 9, 11, 0.42);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.profile-modal__avatar-action:hover::after {
    opacity: 1;
}

.profile-modal__avatar-plus {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 600;
    color: #fff;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.profile-modal__avatar-action:hover .profile-modal__avatar-plus {
    opacity: 1;
}

.profile-modal__avatar {
    width: 88px;
    height: 88px;
    border-radius: 50%;
}

.profile-modal__avatar {
    display: block;
    object-fit: cover;
    background: rgba(255, 255, 255, 0.06);
}

.profile-modal__avatar--placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(255, 201, 61, 0.18), rgba(255, 255, 255, 0.06));
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text-main);
    font-size: 1.5rem;
    font-weight: 700;
}

.profile-modal__avatar--preview.is-hidden,
.is-hidden {
    display: none;
}

.profile-modal__eyebrow,
.profile-panel__kicker {
    margin: 0 0 8px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    font-size: 0.78rem;
    color: var(--accent);
}

.profile-modal__title,
.profile-panel__intro h3,
.achievement-card h4 {
    margin: 0;
}

.profile-modal__subtitle,
.profile-panel__intro p,
.achievement-card p {
    margin: 8px 0 0;
    color: var(--text-soft);
    line-height: 1.55;
}

.profile-modal__subtitle-row {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.icon-square-btn {
    display: inline-grid;
    place-items: center;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-main);
    line-height: 1;
    font-family: "Exo 2", sans-serif;
    text-decoration: none;
    cursor: pointer;
}

.icon-square-btn--sm {
    width: 34px;
    height: 34px;
    border-radius: 10px;
}

.icon-square-btn--md {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    font-size: 1.75rem;
}

.icon-square-btn--lg {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    font-size: 1.85rem;
}

.icon-square-btn > svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
}

.icon-square-btn--accent {
    border-color: rgba(255, 201, 61, 0.24);
    background: rgba(255, 201, 61, 0.08);
    color: #ffffff;
}

.icon-square-btn--accent:hover {
    border-color: rgba(255, 201, 61, 0.4);
    background: rgba(255, 201, 61, 0.14);
}

.profile-share-icon {
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.profile-share-icon.is-copied {
    border-color: rgba(118, 224, 127, 0.28);
    background: rgba(118, 224, 127, 0.1);
}

.profile-modal__close {
    font-size: inherit;
}

.profile-summary-cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.profile-summary-cards--header {
    margin: 0;
    flex: 1;
    min-width: 0;
}

.profile-summary-card {
    padding: 18px 20px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.03);
}

.profile-summary-card--accent {
    border-color: rgba(255, 201, 61, 0.2);
    background: linear-gradient(135deg, rgba(255, 201, 61, 0.16), rgba(255, 201, 61, 0.03));
}

.profile-summary-card--gold {
    border-color: rgba(255, 204, 74, 0.45);
    box-shadow: inset 0 0 0 1px rgba(255, 204, 74, 0.14), 0 0 20px rgba(255, 204, 74, 0.12);
    background: linear-gradient(95deg, rgba(255, 204, 74, 0.12), rgba(255, 255, 255, 0.03) 44%, rgba(255, 204, 74, 0.06));
}

.profile-summary-card--silver {
    border-color: rgba(202, 212, 230, 0.42);
    box-shadow: inset 0 0 0 1px rgba(202, 212, 230, 0.14), 0 0 18px rgba(202, 212, 230, 0.1);
    background: linear-gradient(95deg, rgba(202, 212, 230, 0.12), rgba(255, 255, 255, 0.03) 44%, rgba(202, 212, 230, 0.06));
}

.profile-summary-card--bronze {
    border-color: rgba(205, 127, 79, 0.45);
    box-shadow: inset 0 0 0 1px rgba(205, 127, 79, 0.14), 0 0 18px rgba(205, 127, 79, 0.1);
    background: linear-gradient(95deg, rgba(205, 127, 79, 0.12), rgba(255, 255, 255, 0.03) 44%, rgba(205, 127, 79, 0.06));
}

.profile-summary-card__label {
    margin: 0 0 8px;
    color: var(--text-soft);
}

.profile-summary-card__value {
    margin: 0;
    font-size: clamp(1.4rem, 2vw, 2rem);
    font-weight: 700;
}

.profile-modal__layout {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 0;
}

.profile-tabs {
    display: grid;
    align-content: start;
    gap: 10px;
    padding: 24px;
    border-right: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.02);
}

.profile-tabs__button {
    padding: 14px 16px;
    border: 1px solid transparent;
    border-radius: 16px;
    background: transparent;
    color: var(--text-soft);
    text-align: left;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.profile-tabs__button:hover,
.profile-tabs__button.is-active {
    transform: translateX(2px);
    background: rgba(255, 201, 61, 0.08);
    border-color: rgba(255, 201, 61, 0.18);
    color: var(--text-main);
}

.profile-content {
    padding: 24px 28px 28px;
}

.profile-panel {
    display: none;
}

.profile-panel.is-active {
    display: block;
}

.profile-panel__intro {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 24px;
}

.profile-form {
    display: grid;
    gap: 22px;
}

.avatar-editor {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 20px;
    align-items: center;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.03);
}

.avatar-cropper-backdrop {
    position: fixed;
    inset: 0;
    z-index: 39;
    background: rgba(3, 5, 7, 0.72);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.avatar-cropper-backdrop.is-open {
    opacity: 1;
    pointer-events: auto;
}

.avatar-cropper-modal {
    position: fixed;
    inset: 0;
    z-index: 40;
    display: grid;
    place-items: center;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.avatar-cropper-modal.is-open {
    opacity: 1;
    pointer-events: auto;
}

.avatar-cropper-modal__dialog {
    width: min(860px, 100%);
    border: 1px solid var(--line-strong);
    border-radius: 26px;
    background: rgba(11, 16, 21, 0.98);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.42);
    padding: 22px;
}

.avatar-cropper-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.avatar-cropper-modal__header h3 {
    margin: 0;
}

.avatar-cropper-modal__close {
    font-size: inherit;
}

.avatar-cropper-modal__actions {
    margin-top: 16px;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.avatar-cropper-modal__apply {
    width: auto;
    min-width: 160px;
}

.public-profile-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 28px;
}

.avatar-editor__viewport {
    position: relative;
    width: 280px;
    height: 280px;
    overflow: hidden;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.03);
    cursor: grab;
}

.avatar-editor__viewport:active {
    cursor: grabbing;
}

.avatar-editor__image,
.avatar-editor__placeholder {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.avatar-editor__image {
    max-width: none;
    user-select: none;
    -webkit-user-drag: none;
}

.avatar-editor__placeholder {
    width: 100%;
    height: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    font-weight: 700;
    background: linear-gradient(135deg, rgba(255, 201, 61, 0.18), rgba(255, 255, 255, 0.06));
}

.avatar-editor__controls {
    display: grid;
    gap: 12px;
}

.avatar-editor__controls p,
.avatar-editor__label {
    margin: 0;
    color: var(--text-soft);
}

.avatar-editor__label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.profile-form__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.profile-field {
    display: grid;
    gap: 10px;
}

.profile-field--wide {
    grid-column: 1 / -1;
}

.profile-field label {
    color: var(--text-soft);
}

.profile-input {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-main);
    outline: none;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.profile-input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.02em;
}

.profile-input[type="number"]::-webkit-outer-spin-button,
.profile-input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.custom-number {
    position: relative;
    width: 100%;
}

.custom-number.is-disabled {
    opacity: 0.62;
}

.profile-input--number-enhanced {
    padding-right: 84px;
}

.custom-number__controls {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.custom-number__button {
    width: 24px;
    height: 24px;
    display: inline-grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: rgba(242, 245, 247, 0.78);
    font-family: "Exo 2", sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    transition: color 0.2s ease, transform 0.2s ease;
}

.custom-number__button:hover {
    color: var(--accent);
}

.custom-number__button:active {
    transform: scale(0.96);
}

.custom-number__button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
}

.profile-input:focus {
    border-color: rgba(255, 201, 61, 0.52);
    background: rgba(255, 201, 61, 0.06);
}

.profile-avatar-input-hidden {
    position: absolute;
    width: 0;
    height: 0;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
}

.profile-form__actions {
    display: flex;
    justify-content: flex-end;
}

.profile-form__submit {
    width: auto;
    min-width: 240px;
}

.profile-flashes,
.profile-form-errors {
    display: grid;
    gap: 10px;
    margin-bottom: 18px;
}

.profile-flash,
.profile-form-errors,
.profile-field__error {
    color: var(--text-main);
}

.profile-flash {
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid rgba(118, 224, 127, 0.25);
    background: rgba(118, 224, 127, 0.1);
}

.profile-flash--error,
.profile-form-errors {
    border: 1px solid rgba(255, 127, 127, 0.25);
    background: rgba(255, 127, 127, 0.1);
    padding: 14px 16px;
    border-radius: 16px;
}

.profile-field__error {
    font-size: 0.92rem;
    color: var(--danger);
}

.platform-pulse {
    margin: 18px 18px 0;
    padding: 22px;
    border-radius: 24px;
    border: 1px solid rgba(111, 168, 220, 0.22);
    background:
        radial-gradient(120% 130% at 80% -20%, rgba(130, 187, 255, 0.2) 0%, rgba(130, 187, 255, 0) 58%),
        linear-gradient(165deg, rgba(9, 23, 40, 0.95) 0%, rgba(10, 19, 33, 0.94) 100%);
    box-shadow: 0 18px 36px rgba(0, 0, 0, 0.3);
}

.platform-pulse__head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.platform-pulse__eyebrow {
    margin: 0;
    color: rgba(184, 211, 238, 0.72);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.75rem;
}

.platform-pulse__head h2 {
    margin: 6px 0 0;
    font-size: clamp(1.2rem, 2vw, 1.55rem);
}

.platform-pulse__stamp {
    margin: 2px 0 0;
    color: rgba(184, 211, 238, 0.78);
    font-size: 0.86rem;
}

.platform-pulse__kpis {
    margin-top: 16px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.platform-kpi {
    border-radius: 18px;
    padding: 14px 16px;
    border: 1px solid rgba(130, 187, 255, 0.2);
    background: linear-gradient(180deg, rgba(27, 47, 75, 0.48), rgba(14, 28, 45, 0.6));
}

.platform-kpi--online {
    border-color: rgba(168, 231, 96, 0.4);
    background: linear-gradient(180deg, rgba(46, 72, 50, 0.5), rgba(17, 33, 24, 0.58));
}

.platform-kpi__value {
    margin: 0;
    font-weight: 700;
    font-size: clamp(1.7rem, 3vw, 2.65rem);
    letter-spacing: 0.01em;
}

.platform-kpi__label {
    margin: 4px 0 0;
    color: rgba(184, 211, 238, 0.8);
    font-size: 0.92rem;
}

.platform-pulse__timeline {
    margin-top: 16px;
    border-radius: 18px;
    border: 1px solid rgba(111, 168, 220, 0.24);
    padding: 14px;
    background: linear-gradient(180deg, rgba(15, 31, 51, 0.85), rgba(10, 21, 38, 0.86));
}

.platform-pulse__range {
    display: inline-flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.platform-pulse__range-btn {
    min-width: 46px;
    padding: 6px 12px;
    border-radius: 11px;
    border: 1px solid rgba(132, 182, 231, 0.24);
    background: rgba(12, 22, 38, 0.88);
    color: rgba(188, 217, 244, 0.86);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.platform-pulse__range-btn:hover,
.platform-pulse__range-btn.is-active {
    border-color: rgba(166, 221, 100, 0.46);
    color: #e8f6d2;
    background: rgba(41, 68, 40, 0.75);
}

.platform-pulse__chart {
    min-height: 250px;
}

.platform-pulse__svg {
    width: 100%;
    height: auto;
    display: block;
}

.platform-pulse__grid {
    stroke: rgba(143, 177, 214, 0.2);
    stroke-width: 1;
}

.platform-pulse__axis {
    fill: rgba(186, 214, 243, 0.84);
    font-size: 12px;
}

.platform-pulse__line {
    fill: none;
    stroke-width: 3;
}

.platform-pulse__line--online {
    stroke: #b6f15d;
}

.platform-pulse__line--rooms {
    stroke: #4db8ff;
}

.platform-pulse__area {
    fill: rgba(182, 241, 93, 0.12);
}

.platform-pulse__legend {
    margin-top: 10px;
    display: flex;
    gap: 14px;
    color: rgba(188, 217, 244, 0.82);
    font-size: 0.86rem;
}

.platform-pulse__legend span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.platform-pulse__dot {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
}

.platform-pulse__dot--online {
    background: #b6f15d;
}

.platform-pulse__dot--rooms {
    background: #4db8ff;
}

@media (max-width: 900px) {
    .platform-pulse__kpis {
        grid-template-columns: 1fr;
    }

    .platform-pulse {
        margin: 14px 12px 0;
    }
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.stats-grid--rating {
    grid-template-columns: 1.2fr 0.8fr;
}

.stats-card {
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.03);
}

.stats-card--accent {
    background: linear-gradient(135deg, rgba(255, 201, 61, 0.16), rgba(255, 201, 61, 0.03));
    border-color: rgba(255, 201, 61, 0.2);
}

.stats-card__label {
    margin: 0 0 10px;
    color: var(--text-soft);
}

.stats-card__value {
    margin: 0;
    font-size: clamp(1.8rem, 3vw, 2.8rem);
    font-weight: 700;
}

.attempt-chart {
    margin-top: 20px;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.03);
}

.attempt-chart + .stats-grid {
    margin-top: 18px;
}

.attempt-chart__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.attempt-chart__header h4 {
    margin: 0;
}

.attempt-chart__controls {
    display: inline-flex;
    gap: 8px;
}

.attempt-chart__count-btn {
    min-width: 44px;
    height: 34px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-soft);
    font: inherit;
    cursor: pointer;
}

.attempt-chart__count-btn.is-active,
.attempt-chart__count-btn:hover {
    color: var(--text-main);
    border-color: rgba(255, 201, 61, 0.35);
    background: rgba(255, 201, 61, 0.12);
}

.attempt-chart__plot {
    min-height: 220px;
}

.attempt-chart__line-wrap {
    width: 100%;
    position: relative;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01));
    overflow: hidden;
}

.attempt-chart__svg {
    width: 100%;
    height: auto;
    display: block;
}

.attempt-chart__grid-line {
    stroke: rgba(255, 255, 255, 0.12);
    stroke-width: 1;
}

.attempt-chart__axis-label {
    font-size: 12px;
    color: var(--text-soft);
    fill: rgba(242, 245, 247, 0.72);
}

.attempt-chart__segment {
    stroke-width: 3;
    stroke-linecap: round;
}

.attempt-chart__area {
    fill: rgba(52, 211, 153, 0.18);
}

.attempt-chart__segment--improve {
    stroke: #34d399;
}

.attempt-chart__segment--regress {
    stroke: #f87171;
}

.attempt-chart__segment--stable {
    stroke: rgba(255, 201, 61, 0.85);
}

.attempt-chart__dot {
    fill: #ffd96a;
    stroke: rgba(17, 24, 32, 0.95);
    stroke-width: 2;
}

.attempt-chart__tooltip {
    position: absolute;
    z-index: 50;
    max-width: 280px;
    padding: 7px 10px;
    border: 1px solid rgba(255, 201, 61, 0.35);
    border-radius: 10px;
    background: rgba(10, 15, 20, 0.94);
    color: var(--text-main);
    font-size: 0.78rem;
    line-height: 1.35;
    pointer-events: none;
    white-space: normal;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.record-history {
    margin-top: 22px;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.03);
}

.record-history__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.record-history__header h4 {
    margin: 0;
}

.record-history__header span,
.record-history__item span,
.record-history__empty {
    color: var(--text-soft);
}

.record-history__list {
    display: grid;
    gap: 10px;
}

.record-history__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 16px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.03);
}

.record-history__item strong {
    font-size: 1.05rem;
}

.record-history__item--clickable {
    cursor: pointer;
    border: 1px solid transparent;
    transition: border-color 0.18s ease, background-color 0.18s ease, transform 0.18s ease;
}

.record-history__item--clickable:hover,
.record-history__item--clickable:focus-visible {
    border-color: rgba(255, 201, 61, 0.24);
    background: rgba(255, 201, 61, 0.08);
    transform: translateY(-1px);
    outline: none;
}

.record-history__item--clickable.is-expanded {
    border-color: rgba(255, 201, 61, 0.34);
    background: rgba(255, 201, 61, 0.14);
}

.record-history__empty {
    margin: 0;
    padding: 14px 16px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.03);
}

.attempt-history-inline {
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none !important;
    box-shadow: none !important;
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    gap: 16px;
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.attempt-history-inline[hidden] {
    display: none !important;
}

.attempt-history-inline.is-open {
    opacity: 1;
    transform: translateY(0);
}

.attempt-history-drawer__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.attempt-history-drawer__header h4,
.attempt-history-drawer__start p,
.attempt-history-drawer__moves p {
    margin: 0;
}

.attempt-history-drawer__kicker {
    margin: 0 0 6px;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-size: 0.72rem;
    color: var(--accent);
}

.attempt-history-drawer__start {
    display: grid;
    gap: 10px;
}

.attempt-history-drawer__start-canvas {
    width: min(260px, 100%);
    aspect-ratio: 1 / 1;
    border-radius: 16px;
    border: 1px solid transparent;
    background: transparent;
    overflow: hidden;
}

.attempt-history-drawer__start-canvas canvas {
    width: 100% !important;
    height: 100% !important;
    display: block;
}

.attempt-history-drawer__moves {
    min-height: 0;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 12px;
}

.attempt-history-drawer__grid {
    min-height: 0;
    max-height: 300px;
    margin-top: 10px;
    overflow: auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
    gap: 10px;
    padding-right: 4px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.attempt-history-drawer__grid::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}

.attempt-history-step {
    appearance: none;
    font: inherit;
    color: inherit;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.03);
    display: grid;
    gap: 6px;
    text-align: left;
    width: 100%;
    cursor: pointer;
    transition: border-color 0.18s ease, background-color 0.18s ease, transform 0.18s ease;
}

.attempt-history-step:hover,
.attempt-history-step:focus-visible {
    border-color: rgba(255, 201, 61, 0.28);
    background: rgba(255, 201, 61, 0.08);
    transform: translateY(-1px);
    outline: none;
}

.attempt-history-step.is-active {
    border-color: rgba(255, 201, 61, 0.42);
    background: rgba(255, 201, 61, 0.14);
}

.attempt-history-step__index {
    color: var(--text-soft);
    font-size: 0.76rem;
}

.attempt-history-step__notation {
    font-weight: 700;
}

.attempt-history-step__source {
    color: var(--text-soft);
    font-size: 0.74rem;
}

.achievements-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
    padding: 18px 20px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.03);
}

.achievements-summary strong {
    font-size: 1.6rem;
}

.achievements-list {
    display: grid;
    gap: 14px;
}

.achievement-card {
    display: grid;
    grid-template-columns: 14px minmax(0, 1fr);
    gap: 16px;
    padding: 18px 20px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.03);
}

.achievement-card__status {
    width: 14px;
    height: 14px;
    margin-top: 5px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.14);
}

.achievement-card.is-earned {
    border-color: rgba(255, 201, 61, 0.24);
    background: rgba(255, 201, 61, 0.08);
}

.achievement-card.is-earned .achievement-card__status {
    background: #6ee07f;
    box-shadow: 0 0 12px rgba(110, 224, 127, 0.42);
}

.is-hidden {
    display: none;
}

.dashboard-timer {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    color: var(--text-main);
    font-size: clamp(1rem, 1.3vw, 1.15rem);
    font-weight: 600;
}

.dashboard-timer.has-phase {
    gap: 10px;
}

.dashboard-timer__value {
    letter-spacing: 0.08em;
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum";
    width: 9ch;
    text-align: center;
    white-space: nowrap;
}

.dashboard-timer__phase {
    width: 9ch;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    display: none;
}

.timer-icon {
    width: 32px;
    height: 32px;
    border: 2px solid rgba(255, 255, 255, 0.88);
    border-radius: 50%;
    position: relative;
}

.timer-icon::before,
.timer-icon::after {
    content: '';
    position: absolute;
    background: rgba(255, 255, 255, 0.88);
    border-radius: 1px;
}

.timer-icon::before {
    width: 8px;
    height: 2px;
    top: -5px;
    left: 50%;
    transform: translateX(-50%);
}

.timer-icon::after {
    width: 9px;
    height: 2px;
    top: 8px;
    left: 14px;
    transform-origin: left center;
    transform: rotate(45deg);
}

.cube-canvas {
    display: block;
    width: 100vw;
    height: 100vh;
    border: 0;
    background:
        radial-gradient(circle at 50% 45%, rgba(255, 255, 255, 0.1), transparent 18%),
        radial-gradient(circle at 30% 20%, rgba(255, 201, 61, 0.12), transparent 24%),
        linear-gradient(180deg, #486577 0%, var(--canvas-fill) 100%);
}

.dashboard-footer {
    position: fixed;
    right: 22px;
    bottom: 18px;
    z-index: 20;
    color: var(--text-main);
    font-size: clamp(1rem, 1.5vw, 1.2rem);
    font-weight: 600;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.55s ease 0.28s, transform 0.55s ease 0.28s;
}

body.is-ready .dashboard-footer {
    opacity: 1;
    transform: translateY(0);
}

.dashboard-footer p {
    margin: 0;
}

.cube-status {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    cursor: pointer;
    transition: color 0.4s ease, opacity 0.2s ease;
    user-select: none;
}

.cube-status:hover {
    opacity: 0.75;
}

.cube-status::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    transition: background-color 0.4s ease, box-shadow 0.4s ease;
}

.cube-status.is-solved {
    color: var(--accent);
}

.cube-status.is-solved::before {
    background: #6ee07f;
    box-shadow: 0 0 6px rgba(110, 224, 127, 0.7);
}

.cube-status.is-unsolved {
    color: var(--text-soft);
}

.cube-status.is-unsolved::before {
    background: rgba(255, 255, 255, 0.2);
    box-shadow: none;
}

.cube-net-widget {
    position: fixed;
    left: 16px;
    bottom: 16px;
    z-index: 20;
    padding: 8px;
    border: 1px solid var(--line-strong);
    border-radius: 12px;
    background: rgba(12, 17, 22, 0.78);
    backdrop-filter: blur(8px);
}

.cube-net-widget.is-hidden {
    display: none;
}

@media (max-width: 980px) {
    .profile-modal {
        padding: 18px;
    }

    .profile-modal__layout {
        grid-template-columns: 1fr;
    }

    .profile-tabs {
        grid-template-columns: repeat(5, minmax(150px, 1fr));
        overflow: auto;
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .profile-panel__intro {
        flex-direction: column;
    }

    .profile-modal__header-top {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: stretch;
    }

    .profile-form__grid,
    .profile-summary-cards,
    .stats-grid,
    .stats-grid--rating {
        grid-template-columns: 1fr;
    }

    .avatar-editor {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .dashboard-topbar {
        right: 12px;
        top: 12px;
    }

    .profile-modal__identity,
    .record-history__item,
    .record-history__header {
        align-items: flex-start;
        flex-direction: column;
    }

    .profile-modal__header-top {
        flex-direction: column;
    }

    .profile-modal__subtitle-row {
        flex-wrap: wrap;
    }

    .public-profile-meta {
        grid-template-columns: 1fr;
    }

    .avatar-cropper-modal__actions {
        flex-direction: column-reverse;
    }

    .avatar-editor__viewport {
        width: min(280px, 100%);
        height: auto;
        aspect-ratio: 1;
    }

    .profile-content,
    .profile-modal__header,
    .profile-tabs {
        padding-left: 18px;
        padding-right: 18px;
    }

    .profile-tabs {
        grid-template-columns: 1fr;
    }
}

.cube-net-grid {
    display: grid;
    grid-template-columns: repeat(12, 11px);
    grid-template-rows: repeat(9, 11px);
    gap: 2px;
}

.cube-net-face {
    display: grid;
    grid-template-columns: repeat(3, 11px);
    grid-template-rows: repeat(3, 11px);
    gap: 2px;
}

.cube-net-face--u { grid-column: 4 / span 3; grid-row: 1 / span 3; }
.cube-net-face--l { grid-column: 1 / span 3; grid-row: 4 / span 3; }
.cube-net-face--f { grid-column: 4 / span 3; grid-row: 4 / span 3; }
.cube-net-face--r { grid-column: 7 / span 3; grid-row: 4 / span 3; }
.cube-net-face--b { grid-column: 10 / span 3; grid-row: 4 / span 3; }
.cube-net-face--d { grid-column: 4 / span 3; grid-row: 7 / span 3; }

.cube-net-sticker {
    width: 11px;
    height: 11px;
    border-radius: 2px;
    border: 1px solid rgba(0, 0, 0, 0.55);
    background: #222;
}

.menu-toggle {
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 30;
    border: 0;
    background: transparent;
    color: var(--text-main);
    padding: 6px;
    cursor: pointer;
    opacity: 0;
    transform: translateX(-16px);
    transition: opacity 0.45s ease 0.18s, transform 0.45s ease 0.18s;
}

body.is-ready .menu-toggle {
    opacity: 1;
    transform: translateX(0);
}

.menu-grid {
    transition: transform 0.25s ease;
}

.menu-grid span {
    transition: transform 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.menu-toggle:hover .menu-grid {
    transform: rotate(-6deg) scale(1.06);
}

.menu-toggle:hover .menu-grid span:nth-child(odd) {
    transform: translateY(-2px);
    border-color: var(--accent);
}

.menu-toggle:hover .menu-grid span:nth-child(even) {
    transform: translateY(2px);
}

.side-panel {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 40;
    width: min(360px, 88vw);
    height: 100vh;
    background: var(--bg-panel);
    border-right: 1px solid var(--line-strong);
    transform: translateX(-105%);
    transition: transform 0.28s ease;
    box-shadow: 20px 0 40px rgba(0, 0, 0, 0.24);
    overflow: hidden;
}

.side-panel.is-open {
    transform: translateX(0);
}

.side-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.side-panel__title {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 600;
}

.side-panel__close {
    font-size: inherit;
}

.side-panel__nav {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.side-panel__nav a,
.side-panel__logout,
.side-panel__bug {
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.03);
    transition: transform 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.side-panel__bug {
    width: 100%;
    text-align: left;
    color: var(--text-main);
}

.side-panel__nav a:hover,
.side-panel__logout:hover,
.side-panel__bug:hover {
    transform: translateX(4px);
    border-color: rgba(255, 201, 61, 0.45);
    background: rgba(255, 201, 61, 0.08);
}

.cube-status--readonly,
.cube-status--readonly:hover {
    cursor: default;
    border-color: rgba(255, 255, 255, 0.18);
}

.side-panel__logout {
    margin-top: auto;
}

.bug-report-backdrop {
    position: fixed;
    inset: 0;
    z-index: 57;
    background: rgba(3, 5, 8, 0.64);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease;
}

.bug-report-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.94);
    z-index: 58;
    width: min(420px, calc(100vw - 28px));
    border: 1px solid var(--line-strong);
    border-radius: 24px;
    background: rgba(11, 16, 21, 0.98);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.42);
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease, transform 0.22s ease;
}

.bug-report-backdrop.is-open {
    opacity: 1;
    pointer-events: auto;
}

.bug-report-modal.is-open {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, -50%) scale(1);
}

.bug-report-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.bug-report-modal__title {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
}

.bug-report-modal__text {
    margin: 12px 0 16px;
    color: var(--text-soft);
}

.bug-report-modal__link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid rgba(255, 201, 61, 0.34);
    background: rgba(255, 201, 61, 0.1);
    color: var(--accent);
    font-weight: 700;
}

/* ══════════════════════════════════════════
   Side panel sub-views
═══════════════════════════════════════════ */
.side-view {
    position: absolute;
    inset: 0;
    padding: 28px 24px 24px;
    display: flex;
    flex-direction: column;
    transition: transform 0.26s ease, opacity 0.22s ease;
}

.side-view--nav {
    gap: 28px;
}

.side-view--controls {
    gap: 0;
    transform: translateX(100%);
    opacity: 0;
    pointer-events: none;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.side-view--controls::-webkit-scrollbar {
    display: none;
}

.side-panel.showing-controls .side-view--nav {
    transform: translateX(-28%);
    opacity: 0;
    pointer-events: none;
}

.side-panel.showing-controls .side-view--controls {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
}

.side-view__back {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border: 0;
    background: transparent;
    color: var(--text-soft);
    font-size: 0.85rem;
    padding: 0;
    cursor: pointer;
    transition: color 0.2s ease;
}

.side-view__back:hover {
    color: var(--text-main);
}

.side-view__heading {
    margin: 18px 0 6px;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
}

.side-view__body {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ── Controls reference ─────────────────── */
.ctrl-section {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--line);
}

.ctrl-section:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.ctrl-section__title {
    margin: 0;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--accent);
}

.ctrl-group {
    display: flex;
    flex-direction: column;
}

.ctrl-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 7px 0;
    border-bottom: 1px solid var(--line);
}

.ctrl-row--stacked {
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
}

.ctrl-group .ctrl-row:last-child {
    border-bottom: none;
}

.ctrl-desc {
    font-size: 0.83rem;
    color: var(--text-soft);
    flex: 1;
}

.ctrl-keys {
    display: flex;
    align-items: center;
    gap: 3px;
    flex-shrink: 0;
}

.ctrl-keybind {
    min-width: 24px;
    height: 22px;
    padding: 0 5px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-bottom-width: 2px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.07);
    color: var(--text-main);
    font-size: 0.72rem;
    font-family: inherit;
    font-weight: 600;
    white-space: nowrap;
    letter-spacing: 0;
    cursor: pointer;
}

.ctrl-keybind:hover,
.ctrl-keybind.is-listening {
    border-color: var(--accent);
}

.ctrl-input-label {
    font-size: 0.83rem;
    color: var(--text-soft);
}

.ctrl-radio-group {
    display: flex;
    gap: 12px;
}

.ctrl-radio {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.83rem;
    color: var(--text-soft);
}

.ctrl-caption {
    font-size: 0.8rem;
    color: var(--text-soft);
    font-style: italic;
    flex-shrink: 0;
}

.ctrl-plus {
    font-size: 0.7rem;
    color: var(--text-soft);
    margin: 0 1px;
}

kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 22px;
    padding: 0 5px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-bottom-width: 2px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.07);
    color: var(--text-main);
    font-size: 0.72rem;
    font-family: inherit;
    font-weight: 600;
    white-space: nowrap;
    letter-spacing: 0;
}

.ctrl-note {
    margin: 0;
    font-size: 0.78rem;
    color: var(--text-soft);
    font-style: italic;
}

.ctrl-note--top {
    margin-bottom: 2px;
}

.cube-fps {
    position: fixed;
    top: 22px;
    right: 108px;
    z-index: 28;
    padding: 6px 10px;
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    background: rgba(14, 19, 24, 0.7);
    color: var(--text-main);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    font-variant-numeric: tabular-nums;
    pointer-events: none;
    user-select: none;
    backdrop-filter: blur(4px);
}

.cube-fps.is-hidden {
    display: none;
}

.menu-overlay {
    position: fixed;
    inset: 0;
    z-index: 35;
    background: rgba(6, 10, 14, 0.35);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.menu-overlay.is-visible {
    opacity: 1;
    pointer-events: auto;
}

@media (max-width: 920px) {
    .auth-layout {
        grid-template-columns: 1fr;
        padding: 20px;
    }

    .auth-brand {
        min-height: 300px;
        padding: 32px;
    }

    .auth-brand h1 {
        max-width: 100%;
    }

    .dashboard-topbar {
        top: 18px;
        right: 18px;
    }
}

@media (max-width: 640px) {
    .auth-layout {
        gap: 20px;
    }

    .dashboard-footer {
        left: 18px;
        right: auto;
        bottom: 18px;
        font-size: 1rem;
    }

    .dashboard-topbar {
        top: 18px;
        right: 18px;
        gap: 12px;
    }

    .profile-button {
        width: 52px;
        height: 52px;
    }
}

    /* ══════════════════════════════════════════
       Settings toggle button
    ═══════════════════════════════════════════ */
    .settings-toggle {
        position: fixed;
        top: 20px;
        left: 70px;
        z-index: 30;
        border: 0;
        background: transparent;
        color: var(--text-main);
        padding: 4px;
        line-height: 0;
        cursor: pointer;
        opacity: 0;
        transform: translateX(-16px);
        transition: opacity 0.45s ease 0.22s, transform 0.45s ease 0.22s, color 0.2s ease;
    }

    body.is-ready .settings-toggle {
        opacity: 1;
        transform: translateX(0);
    }

    .settings-toggle svg {
        transition: transform 0.45s ease;
    }

    .settings-toggle:hover {
        color: var(--accent);
    }

    .settings-toggle:hover svg {
        transform: rotate(70deg);
    }

    /* ══════════════════════════════════════════
       Settings panel
    ═══════════════════════════════════════════ */
    .settings-panel {
        position: fixed;
        top: 0;
        left: 0;
        z-index: 40;
        width: min(340px, 88vw);
        height: 100vh;
        padding: 28px 24px 0;
        background: var(--bg-panel);
        border-right: 1px solid var(--line-strong);
        box-shadow: 20px 0 40px rgba(0, 0, 0, 0.28);
        transform: translateX(-105%);
        transition: transform 0.28s ease;
        display: flex;
        flex-direction: column;
        gap: 0;
        overflow: hidden;
    }

    .settings-panel.is-open {
        transform: translateX(0);
    }

    .settings-panel.is-locked {
        pointer-events: none;
        opacity: 0.45;
    }

    .settings-panel__header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        flex-shrink: 0;
        padding-bottom: 18px;
        border-bottom: 1px solid var(--line);
    }

    .settings-panel__title {
        margin: 0;
        font-size: 1.1rem;
        font-weight: 600;
    }

    .settings-panel__close {
        transition: color 0.2s ease, background-color 0.2s ease;
    }

    .settings-panel__close:hover {
        background: rgba(255, 201, 61, 0.1);
        color: var(--accent);
    }

    .settings-panel__body {
        flex: 1;
        overflow-y: auto;
        overflow-x: hidden;
        padding: 20px 0 32px 0;
        display: flex;
        flex-direction: column;
        gap: 28px;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .settings-panel__body::-webkit-scrollbar {
        width: 0;
        height: 0;
        display: none;
    }

    /* ── Config sections ─────────────────────── */
    .cfg-section {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    .cfg-section__title {
        margin: 0 0 2px;
        font-size: 0.72rem;
        font-weight: 700;
        letter-spacing: 0.18em;
        text-transform: uppercase;
        color: var(--accent);
    }

    .cfg-row {
        display: flex;
        flex-direction: column;
        gap: 7px;
    }

    .cfg-row--inline {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }

    .cfg-label {
        display: flex;
        justify-content: space-between;
        font-size: 0.88rem;
        color: var(--text-soft);
    }

    .cfg-value {
        color: var(--text-main);
        font-variant-numeric: tabular-nums;
        min-width: 3ch;
        text-align: right;
    }

    .cfg-select {
        width: 100%;
        border: 1px solid var(--line-strong);
        border-radius: 8px;
        background: rgba(255, 255, 255, 0.06);
        color: var(--text-main);
        font: inherit;
        font-size: 0.86rem;
        font-weight: 600;
        padding: 8px 10px;
        outline: none;
        color-scheme: dark;
    }

    .cfg-select.site-select + .custom-select__trigger,
    .custom-select .cfg-select.site-select ~ .custom-select__trigger {
        min-height: 42px;
        padding: 8px 12px 8px 14px;
        border-radius: 10px;
        border-color: var(--line-strong);
        background: rgba(255, 255, 255, 0.06);
        font-size: 0.86rem;
        font-weight: 600;
    }

    .cfg-select.site-select ~ .custom-select__menu {
        border-radius: 12px;
        padding: 6px;
    }

    .cfg-select.site-select ~ .custom-select__menu .custom-select__option {
        padding: 10px 12px;
        border-radius: 10px;
        font-size: 0.86rem;
    }

    .cfg-select:focus {
        border-color: var(--accent);
        box-shadow: 0 0 0 2px rgba(255, 201, 61, 0.28);
    }

    .cfg-presets {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 8px;
    }

    .cfg-preset {
        width: 100%;
        aspect-ratio: 1;
        border: 2px solid var(--line-strong);
        border-radius: 9px;
        background: var(--preset);
        cursor: pointer;
        transition: transform 0.15s ease, border-color 0.18s ease;
    }

    .cfg-preset:hover {
        transform: translateY(-1px);
        border-color: rgba(255, 201, 61, 0.72);
    }

    .cfg-preset.is-active {
        border-color: var(--accent);
        box-shadow: 0 0 0 2px rgba(255, 201, 61, 0.35);
    }

    /* Range slider */
    .cfg-range {
        -webkit-appearance: none;
        appearance: none;
        width: 100%;
        height: 4px;
        border-radius: 2px;
        background: rgba(255, 255, 255, 0.12);
        outline: none;
        cursor: pointer;
        transition: background 0.2s ease;
    }

    .cfg-range:hover {
        background: rgba(255, 255, 255, 0.18);
    }

    .cfg-range::-webkit-slider-thumb {
        -webkit-appearance: none;
        width: 16px;
        height: 16px;
        border-radius: 50%;
        background: var(--accent);
        cursor: pointer;
        transition: transform 0.15s ease, box-shadow 0.15s ease;
    }

    .cfg-range::-webkit-slider-thumb:hover {
        transform: scale(1.25);
        box-shadow: 0 0 0 5px rgba(255, 201, 61, 0.2);
    }

    .cfg-range::-moz-range-thumb {
        width: 16px;
        height: 16px;
        border: 0;
        border-radius: 50%;
        background: var(--accent);
        cursor: pointer;
    }

    /* Color input */
    .cfg-color {
        -webkit-appearance: none;
        appearance: none;
        width: 36px;
        height: 36px;
        border: 2px solid var(--line-strong);
        border-radius: 8px;
        background: none;
        cursor: pointer;
        padding: 2px;
        flex-shrink: 0;
        transition: border-color 0.2s ease;
    }

    .cfg-color:hover {
        border-color: var(--accent);
    }

    .cfg-color::-webkit-color-swatch-wrapper {
        padding: 0;
    }

    .cfg-color::-webkit-color-swatch {
        border: none;
        border-radius: 5px;
    }

    /* Toggle checkbox */
    .cfg-toggle {
        position: relative;
        display: inline-block;
        width: 44px;
        height: 24px;
        flex-shrink: 0;
    }

    .cfg-toggle input {
        opacity: 0;
        width: 0;
        height: 0;
        position: absolute;
    }

    .cfg-toggle__track {
        position: absolute;
        inset: 0;
        border-radius: 12px;
        background: rgba(255, 255, 255, 0.12);
        cursor: pointer;
        transition: background 0.25s ease;
    }

    .cfg-toggle__track::after {
        content: '';
        position: absolute;
        top: 3px;
        left: 3px;
        width: 18px;
        height: 18px;
        border-radius: 50%;
        background: var(--text-soft);
        transition: transform 0.25s ease, background-color 0.25s ease;
    }

    .cfg-toggle input:checked + .cfg-toggle__track {
        background: rgba(255, 201, 61, 0.32);
    }

    .cfg-toggle input:checked + .cfg-toggle__track::after {
        transform: translateX(20px);
        background: var(--accent);
    }

    .settings-panel,
    .settings-panel * {
        user-select: none;
        -webkit-user-select: none;
    }

/* Page Loader */

@keyframes loader-spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

@keyframes loader-fade-out {
    0% {
        opacity: 1;
        pointer-events: auto;
    }
    90% {
        opacity: 1;
        pointer-events: auto;
    }
    100% {
        opacity: 0;
        pointer-events: none;
    }
}

.page-loader {
    position: fixed;
    inset: 0;
    z-index: 999;
    display: grid;
    place-items: center;
    background:
        radial-gradient(circle at top left, rgba(255, 201, 61, 0.08), transparent 28%),
        radial-gradient(circle at top right, rgba(87, 127, 155, 0.18), transparent 22%),
        linear-gradient(180deg, #2c3640 0%, #263038 100%);
    animation: loader-fade-out 1s ease-out 0.5s forwards;
}

.page-loader__content {
    display: grid;
    place-items: center;
}

.page-loader__grid {
    display: grid;
    grid-template-columns: repeat(3, 20px);
    grid-template-rows: repeat(3, 20px);
    gap: 8px;
    animation: loader-spin 2s linear infinite;
}

.page-loader__grid span {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 201, 61, 0.8);
    border-radius: 4px;
    background: rgba(255, 201, 61, 0.1);
    box-sizing: border-box;
}

/* ══════════════════════════════════════════
   Timer icon button
═══════════════════════════════════════════ */

.timer-icon-btn {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    line-height: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s ease;
}

.timer-icon-btn:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.55);
    outline-offset: 3px;
}

.timer-icon-btn:hover:not(:disabled) .timer-icon {
    border-color: rgba(255, 255, 255, 1);
}

.timer-icon-btn:hover:not(:disabled) .timer-icon::before,
.timer-icon-btn:hover:not(:disabled) .timer-icon::after {
    background: rgba(255, 255, 255, 1);
}

.timer-icon-btn:disabled {
    cursor: default;
    opacity: 0.3;
}

/* Rooms */

.rooms-nav-link {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.rooms-nav-badge {
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 700;
    color: #171a1e;
    background: #f29c38;
}

.profile-card-backdrop {
    position: fixed;
    inset: 0;
    z-index: 49;
    background: rgba(3, 5, 7, 0.60);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.profile-card-backdrop.is-open {
    opacity: 1;
    pointer-events: auto;
}

.profile-card-dialog {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.94);
    z-index: 50;
    width: min(420px, calc(100vw - 32px));
    border: 1px solid var(--line-strong);
    border-radius: 26px;
    background: rgba(11, 16, 21, 0.98);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.42);
    padding: 24px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease, transform 0.22s ease;
}

.profile-card-backdrop.is-open ~ .profile-card-dialog {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, -50%) scale(1);
}

.profile-card__header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--line);
}

.profile-card__avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.05);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

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

.profile-card__name {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 700;
}

.profile-card__username {
    margin: 0;
    color: var(--text-soft);
    font-size: 0.95rem;
}

.profile-card__stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

.profile-card__stat {
    padding: 14px 12px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.02);
    text-align: center;
}

.profile-card__stat-label {
    margin: 0 0 6px;
    color: var(--text-soft);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
}

.profile-card__stat-value {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-main);
}

.profile-card__stat-value.is-accent {
    color: var(--accent);
}

.profile-card__footer {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
    display: flex;
    gap: 10px;
}

.profile-card__link {
    flex: 1;
    padding: 12px 16px;
    border-radius: 12px;
    background: rgba(255, 201, 61, 0.1);
    color: var(--accent);
    text-align: center;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.profile-card__link:hover {
    transform: translateY(-1px);
    background: rgba(255, 201, 61, 0.16);
}

.rooms-page,
.room-detail-page {

    position: relative;
    z-index: 2;
    width: min(1200px, 100%);
    margin: 0 auto;
    padding: 28px;
    display: grid;
    gap: 18px;
}

.rooms-page__header,
.room-detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.rooms-page__header h1,
.room-detail-header h1 {
    margin: 0;
}

.rooms-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.rooms-grid--hub {
    align-items: start;
}

.rooms-grid--lists {
    align-items: start;
}

.rooms-card {
    border: 1px solid var(--line-strong);
    border-radius: 22px;
    background: rgba(11, 16, 21, 0.94);
    padding: 20px;
    display: grid;
    gap: 14px;
}

.rooms-card h2 {
    margin: 0;
}

.rooms-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.rooms-card__header--spread {
    align-items: center;
}

.rooms-card__subtitle {
    margin: 8px 0 0;
    color: var(--text-soft);
    max-width: 520px;
}

.rooms-create-launch {
    flex-shrink: 0;
    min-width: 164px;
    min-height: 118px;
    padding: 18px 20px;
    border: 1px solid rgba(255, 201, 61, 0.22);
    border-radius: 22px;
    background:
        radial-gradient(circle at top left, rgba(255, 201, 61, 0.18), transparent 54%),
        linear-gradient(180deg, rgba(255, 201, 61, 0.12), rgba(255, 201, 61, 0.04));
    color: var(--text-main);
    display: grid;
    place-items: center;
    gap: 6px;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.rooms-create-launch:hover,
.rooms-create-launch[aria-expanded='true'] {
    transform: translateY(-1px);
    border-color: rgba(255, 201, 61, 0.38);
    box-shadow: 0 16px 36px rgba(255, 201, 61, 0.1);
}

.rooms-create-launch__plus {
    font-size: 2.8rem;
    line-height: 1;
    font-weight: 300;
    color: var(--accent);
}

.rooms-create-launch__text {
    font-size: 0.96rem;
    font-weight: 700;
}

.rooms-create-panel {
    display: grid;
    gap: 18px;
    overflow: visible;
    max-height: 0;
    opacity: 0;
    padding: 0 22px;
    margin: -2px 0 2px;
    border-radius: 22px;
    border: 1px solid transparent;
    background: rgba(255, 255, 255, 0.02);
    pointer-events: none;
    transition: max-height 0.28s ease, opacity 0.22s ease, padding 0.22s ease, border-color 0.22s ease, margin 0.22s ease;
}

.rooms-create-panel.is-open {
    max-height: 1600px;
    opacity: 1;
    padding: 22px;
    margin: 6px 0 2px;
    border-color: var(--line);
    pointer-events: auto;
}

.rooms-create-panel__intro {
    display: grid;
    gap: 4px;
}

.rooms-create-panel__intro span {
    color: var(--text-soft);
}

.rooms-create-form {
    display: grid;
    gap: 16px;
}

.rooms-create-submit {
    width: auto;
    min-width: 220px;
}

.rooms-search-results {
    margin-top: 10px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.02);
    max-height: 220px;
    overflow: auto;
    display: none;
}

.rooms-search-results.is-open {
    display: grid;
}

.rooms-search-item {
    width: 100%;
    border: 0;
    background: transparent;
    color: var(--text-main);
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.rooms-search-item:hover {
    background: rgba(255, 201, 61, 0.08);
}

.rooms-search-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.05);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.rooms-search-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.rooms-selected-invites {
    display: grid;
    gap: 8px;
    overflow: visible;
}

.rooms-selected-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.03);
}

.rooms-selected-item__main {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.rooms-selected-item__avatar {
    width: 42px;
    height: 42px;
}

.rooms-selected-item__identity {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.rooms-selected-item__identity strong,
.rooms-selected-item__identity span {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rooms-selected-item__identity span {
    color: var(--text-soft);
}

.rooms-selected-item__actions {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
    z-index: 46;
}

.rooms-selected-item__actions .custom-select {
    position: relative;
    width: 140px;
}

.rooms-selected-item__actions select {
    width: 140px;
}

.rooms-selected-item__actions .custom-select__menu {
    min-width: 160px;
    left: auto;
    right: 0;
}

@media (max-width: 640px) {
    .rooms-selected-item {
        flex-direction: column;
        align-items: stretch;
    }

    .rooms-selected-item__actions {
        width: 100%;
        justify-content: space-between;
    }

    .rooms-selected-item__actions .custom-select {
        width: auto;
        flex: 1;
        min-width: 120px;
    }

    .rooms-selected-item__actions select {
        width: auto;
        flex: 1;
        min-width: 120px;
    }

    .rooms-selected-item__actions .custom-select__menu {
        min-width: 140px;
    }
}

.rooms-room-link {
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 12px 14px;
    display: grid;
    gap: 6px;
    background: rgba(255, 255, 255, 0.03);
}

.rooms-room-link span {
    color: var(--text-soft);
}

.rooms-room-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
}

.rooms-room-item__leave-form {
    margin: 0;
}

.rooms-room-remove-btn {
    width: 42px;
    height: 42px;
    border: 1px solid rgba(255, 127, 127, 0.35);
    border-radius: 12px;
    background: rgba(255, 127, 127, 0.08);
    color: #ff9f9f;
    display: inline-grid;
    place-items: center;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.rooms-room-remove-btn svg {
    width: 18px;
    height: 18px;
}

.rooms-room-remove-btn:hover {
    transform: translateY(-1px);
    border-color: rgba(255, 127, 127, 0.62);
    background: rgba(255, 127, 127, 0.16);
}

.rooms-room-remove-btn:focus-visible {
    outline: 2px solid rgba(255, 127, 127, 0.7);
    outline-offset: 2px;
}

.rooms-stack {
    display: grid;
    gap: 18px;
}

.rooms-section {
    display: grid;
    gap: 12px;
}

.rooms-section__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.rooms-section__header h3 {
    margin: 0;
    font-size: 1rem;
}

.rooms-section__badge {
    min-width: 28px;
    height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 201, 61, 0.12);
    border: 1px solid rgba(255, 201, 61, 0.24);
    color: var(--accent);
    font-size: 0.84rem;
    font-weight: 700;
}

.rooms-invitation-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    padding: 12px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.03);
}

.rooms-invitation-item p {
    margin: 6px 0 0;
    color: var(--text-soft);
}

.ranked-leaderboard__item {
    align-items: center;
}

.ranked-leaderboard__main {
    display: flex !important;
    align-items: center !important;
    gap: 14px !important;
    min-width: 0;
}

.ranked-leaderboard__place {
    min-width: 56px;
    flex: 0 0 56px;
    font-size: clamp(1.45rem, 2.2vw, 1.95rem) !important;
    font-weight: 900 !important;
    line-height: 0.95;
    color: #e9edf7;
    text-align: center;
}

.ranked-leaderboard__item--gold,
.ranked-leaderboard__item--silver,
.ranked-leaderboard__item--bronze {
    position: relative;
    overflow: hidden;
}

.ranked-leaderboard__item--gold {
    border-color: rgba(255, 204, 74, 0.45);
    box-shadow: inset 0 0 0 1px rgba(255, 204, 74, 0.14), 0 0 20px rgba(255, 204, 74, 0.12);
    background: linear-gradient(95deg, rgba(255, 204, 74, 0.08), rgba(255, 255, 255, 0.03) 44%, rgba(255, 204, 74, 0.05));
    animation: rankedGlowGold 2.6s ease-in-out infinite;
}

.ranked-leaderboard__item--silver {
    border-color: rgba(202, 212, 230, 0.42);
    box-shadow: inset 0 0 0 1px rgba(202, 212, 230, 0.14), 0 0 18px rgba(202, 212, 230, 0.1);
    background: linear-gradient(95deg, rgba(202, 212, 230, 0.08), rgba(255, 255, 255, 0.03) 44%, rgba(202, 212, 230, 0.05));
    animation: rankedGlowSilver 2.8s ease-in-out infinite;
}

.ranked-leaderboard__item--bronze {
    border-color: rgba(205, 137, 96, 0.4);
    box-shadow: inset 0 0 0 1px rgba(205, 137, 96, 0.14), 0 0 18px rgba(205, 137, 96, 0.1);
    background: linear-gradient(95deg, rgba(205, 137, 96, 0.08), rgba(255, 255, 255, 0.03) 44%, rgba(205, 137, 96, 0.05));
    animation: rankedGlowBronze 3s ease-in-out infinite;
}

.ranked-leaderboard__place--gold {
    color: #ffcc4a;
    text-shadow: 0 0 14px rgba(255, 204, 74, 0.38);
}

.ranked-leaderboard__place--silver {
    color: #d9e4f5;
    text-shadow: 0 0 14px rgba(217, 228, 245, 0.35);
}

.ranked-leaderboard__place--bronze {
    color: #d58d64;
    text-shadow: 0 0 14px rgba(213, 141, 100, 0.35);
}

@keyframes rankedGlowGold {
    0%,
    100% {
        box-shadow: inset 0 0 0 1px rgba(255, 204, 74, 0.12), 0 0 14px rgba(255, 204, 74, 0.09);
    }
    50% {
        box-shadow: inset 0 0 0 1px rgba(255, 204, 74, 0.2), 0 0 28px rgba(255, 204, 74, 0.22);
    }
}

@keyframes rankedGlowSilver {
    0%,
    100% {
        box-shadow: inset 0 0 0 1px rgba(202, 212, 230, 0.12), 0 0 12px rgba(202, 212, 230, 0.08);
    }
    50% {
        box-shadow: inset 0 0 0 1px rgba(202, 212, 230, 0.2), 0 0 24px rgba(202, 212, 230, 0.2);
    }
}

@keyframes rankedGlowBronze {
    0%,
    100% {
        box-shadow: inset 0 0 0 1px rgba(205, 137, 96, 0.12), 0 0 12px rgba(205, 137, 96, 0.08);
    }
    50% {
        box-shadow: inset 0 0 0 1px rgba(205, 137, 96, 0.2), 0 0 24px rgba(205, 137, 96, 0.2);
    }
}

@media (prefers-reduced-motion: reduce) {
    .ranked-leaderboard__item--gold,
    .ranked-leaderboard__item--silver,
    .ranked-leaderboard__item--bronze {
        animation: none;
    }
}

.ranked-leaderboard__avatar {
    width: 42px;
    height: 42px;
    min-width: 42px;
    min-height: 42px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    color: #e9edf7;
    font-size: 0.86rem;
    font-weight: 700;
}

.ranked-leaderboard__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ranked-leaderboard__identity {
    min-width: 0;
    display: flex !important;
    align-items: baseline !important;
    gap: 8px !important;
    flex-wrap: nowrap !important;
}

.ranked-leaderboard__identity strong {
    display: inline !important;
    white-space: nowrap;
    font-size: 1rem;
    color: #eef2fb;
}

.ranked-leaderboard__identity span {
    margin: 0;
    color: var(--text-soft);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rooms-invitation-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

@media (max-width: 900px) {
    .rooms-grid,
    .rooms-grid--hub {
        grid-template-columns: 1fr;
    }

    .rooms-card__header,
    .rooms-card__header--spread {
        flex-direction: column;
        align-items: stretch;
    }

    .rooms-create-launch {
        width: 100%;
        min-height: 96px;
    }
}


.room-stage-body {
    background:
        radial-gradient(circle at top left, rgba(255, 201, 61, 0.08), transparent 26%),
        radial-gradient(circle at top right, rgba(87, 127, 155, 0.16), transparent 24%),
        linear-gradient(180deg, #2c3640 0%, #202933 100%);
}

.room-stage-shell {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
}

.room-stage-backdrop {
    position: fixed;
    inset: 0;
    z-index: 0;
}

.room-stage-backdrop canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.room-stage-topbar {
    position: fixed;
    top: 18px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 25;
    width: min(700px, calc(100vw - 420px));
    display: grid;
}

.room-stage-topbar__center {
    text-align: center;
    padding: 14px 20px;
    border: 1px solid var(--line-strong);
    border-radius: 24px;
    background: transparent;
    backdrop-filter: none;
}

.room-stage-topbar__center h1 {
    margin: 6px 0 0;
    font-size: clamp(1.6rem, 2.4vw, 2.4rem);
}

.room-stage-topbar__eyebrow,
.room-stage-topbar__subtitle,
.room-stage-topbar__hint {
    margin: 0;
}

.room-stage-topbar__eyebrow {
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-soft);
}

.room-stage-topbar__subtitle,
.room-stage-topbar__hint {
    margin-top: 8px;
    color: var(--text-soft);
}

.room-right-rail {
    position: fixed;
    right: 18px;
    top: 18px;
    bottom: 18px;
    z-index: 30;
    width: min(320px, calc(100vw - 36px));
    display: grid;
    grid-template-rows: auto auto auto minmax(0, 1fr) minmax(0, 1fr);
    gap: 14px;
}

.room-timer-card,
.room-rail-actions,
.room-side-panel__section {
    border: 1px solid var(--line-strong);
    border-radius: 22px;
    background: rgba(9, 14, 18, 0.78);
    backdrop-filter: blur(18px);
    padding: 12px;
}

.room-timer-card,
.room-rail-actions {
    display: grid;
    gap: 8px;
}

.room-side-panel__section {
    min-height: 0;
    display: grid;
    gap: 12px;
    transition: opacity 0.22s ease;
}

.room-right-rail.is-game-active .room-side-panel__section {
    display: none;
}

.room-stage-settings-toggle {
    top: 22px;
    left: 24px;
    z-index: 35;
}

.room-side-panel__leave,
.room-side-panel__rooms-link {
    width: 100%;
    min-height: 44px;
    border-radius: 14px;
    border: 1px solid var(--line-strong);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-main);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.room-side-panel__rooms-link:hover,
.room-side-panel__leave:hover {
    border-color: rgba(255, 201, 61, 0.45);
    background: rgba(255, 201, 61, 0.08);
}

.room-side-panel__eyebrow {
    margin: 0;
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-soft);
}

.room-side-panel__title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.room-side-panel__title-row h2 {
    margin: 0;
}

.room-side-panel__title-inline {
    display: inline-flex;
    align-items: baseline;
    gap: 8px;
    margin: 0;
}

.room-side-panel__title-inline span {
    color: var(--accent);
}

.room-side-panel__stats {
    display: grid;
    gap: 10px;
}

.room-side-panel__stat {
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.03);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.room-side-panel__stat span {
    color: var(--text-soft);
}

.room-roster {
    min-height: 0;
    display: grid;
    gap: 10px;
    overflow: auto;
    scrollbar-width: none;
}

.room-roster::-webkit-scrollbar {
    display: none;
}

.room-roster__item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.03);
}

.room-roster__item.is-self {
    border-color: rgba(255, 201, 61, 0.42);
    background: rgba(255, 201, 61, 0.08);
}

.room-roster__avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    overflow: hidden;
    border: 1px solid var(--line-strong);
    background: rgba(255, 255, 255, 0.05);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.room-roster__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.room-roster__meta {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.room-roster__meta strong,
.room-roster__meta span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.room-roster__meta span {
    color: var(--text-soft);
}

.room-roster__badge {
    min-width: 38px;
    padding: 5px 8px;
    border-radius: 999px;
    background: rgba(255, 201, 61, 0.18);
    color: var(--accent);
    font-size: 0.72rem;
    font-weight: 700;
    text-align: center;
}

.room-invite-panel {
    gap: 10px;
}

.room-invite-panel__controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 128px;
    gap: 8px;
}

.room-invite-panel__status {
    margin: 0;
    min-height: 1.2em;
    color: var(--text-soft);
    font-size: 0.82rem;
}

.room-invite-panel__status.is-success {
    color: #9fe0ad;
}

.room-invite-panel__status.is-error {
    color: #ffb4b4;
}

.room-invite-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 48;
    background: rgba(4, 8, 12, 0.62);
}

[data-room-invite-backdrop][hidden] {
    display: none !important;
}

.room-invite-modal {
    position: fixed;
    right: 22px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 49;
    width: min(340px, calc(100vw - 44px));
    padding: 14px;
    border-radius: 20px;
    border: 1px solid var(--line-strong);
    background: rgba(9, 14, 18, 0.96);
    backdrop-filter: blur(16px);
    display: grid;
    gap: 10px;
}

[data-room-invite-modal][hidden] {
    display: none !important;
}

@media (max-width: 960px) {
    .room-invite-modal {
        right: 12px;
        left: 12px;
        top: auto;
        bottom: 14px;
        transform: none;
        width: auto;
    }
}

.room-dashboard-timer {
    width: 100%;
    border: 0;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(14px);
    padding: 10px 12px;
}

.room-dashboard-timer__placeholder {
    width: 44px;
    height: 44px;
}

.room-dashboard-footer,
#cube-net-widget {
    z-index: 25;
}

@media (max-width: 960px) {
    .room-right-rail {
        left: 12px;
        right: 12px;
        top: auto;
        bottom: 12px;
        width: auto;
        height: min(52vh, 420px);
        grid-template-rows: auto auto minmax(0, 1fr) minmax(0, 1fr);
    }

    .room-right-rail .room-timer-card {
        display: none;
    }

    .room-stage-topbar {
        top: 12px;
        width: min(520px, calc(100vw - 24px));
    }

    .room-stage-settings-toggle {
        top: 12px;
        left: 12px;
    }
}
.dashboard-timer__phase {
    font-size: 0.65rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    opacity: 0.5;
    min-height: 0;
    text-align: center;
}

.dashboard-timer__phase.is-visible {
    display: block;
}

/* ══════════════════════════════════════════
   Game overlay (full-screen countdown)
═══════════════════════════════════════════ */

.game-overlay {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.74);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.38s ease;
}

.game-overlay.is-visible {
    opacity: 1;
    pointer-events: auto;
}

.game-overlay__body {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #fff;
    user-select: none;
}

.game-overlay__num {
    font-size: clamp(7rem, 18vw, 14rem);
    font-weight: 700;
    line-height: 1;
    opacity: 0;
    transform: scale(0.55);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.game-overlay__num.is-shown {
    opacity: 1;
    transform: scale(1);
}

.game-overlay__hint {
    margin: 0;
    margin-top: 1.1rem;
    font-size: clamp(0.9rem, 2.5vw, 1.4rem);
    opacity: 0.65;
    letter-spacing: 0.04em;
    text-align: center;
}
