:root {
    --bg: #0c131b;
    --header-bg: rgba(9, 15, 23, 0.94);
    --surface: #151d27;
    --surface-strong: #18222d;
    --surface-hover: #1d2936;
    --border: rgba(255, 255, 255, 0.1);
    --border-hover: rgba(80, 142, 235, 0.38);
    --text: #f4f7fb;
    --text-secondary: #9da7b5;
    --text-muted: #6f7b8b;
    --blue: #257cf0;
    --blue-light: #4a96ff;
    --blue-soft: rgba(31, 104, 226, 0.16);
    --red: #ff3948;
    --red-soft: rgba(226, 45, 59, 0.15);
    --green: #3bd878;
    --radius: 10px;
    --page-gutter: clamp(24px, 4.2vw, 80px);
    --transition: 180ms cubic-bezier(0.2, 0.8, 0.2, 1);

    /* Einheitlicher Seiten-Rhythmus */
    --layout-gap: 12px;
    --section-gap: 18px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    color-scheme: dark;
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--text);
    background:
        radial-gradient(circle at 58% 5%, rgba(52, 88, 132, 0.13), transparent 37%),
        linear-gradient(135deg, #0e1620 0%, var(--bg) 48%, #0a1118 100%);
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

button,
select {
    font: inherit;
}

button {
    color: inherit;
}

button,
a,
select {
    -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
select:focus-visible {
    outline: 2px solid var(--blue-light);
    outline-offset: 3px;
}

svg {
    display: block;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.svg-defs {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

.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;
}

.shell {
    width: auto;
    margin-inline: auto;
    margin-left: var(--page-gutter);
    margin-right: var(--page-gutter);
}

.topbar {
    position: sticky;
    top: -19%;
    z-index: 100;
    height: 64px;
    border-bottom: 1px solid var(--border);
    background: var(--header-bg);
    backdrop-filter: blur(22px) saturate(125%);
    -webkit-backdrop-filter: blur(22px) saturate(125%);
}

.topbar-inner {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) auto minmax(260px, 1fr);
    align-items: center;
    height: 125%;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    width: fit-content;
    color: var(--text);
    text-decoration: none;
}

.brand-name {
    font-size: 17px;
    font-weight: 600;
    letter-spacing: -0.25px;
}

.brand-mark {
    position: relative;
    display: block;
    width: 31px;
    height: 31px;
}

.brand-ring {
    position: absolute;
    border-radius: 50%;
}

.brand-blue {
    top: 3px;
    left: 1px;
    width: 26px;
    height: 26px;
    border: 3px solid var(--blue-light);
}

.brand-red {
    top: 8px;
    left: 7px;
    width: 15px;
    height: 15px;
    border: 3px solid var(--red);
}

.brand-center {
    position: absolute;
    top: 13px;
    left: 12px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #fff;
}

.brand-dart {
    position: absolute;
    top: 3px;
    right: 0;
    width: 14px;
    height: 3px;
    border-radius: 10px;
    background: #fff;
    transform: rotate(-43deg);
}

.main-nav {
    display: flex;
    align-items: center;
    align-self: stretch;
    gap: 39px;
}

.nav-link {
    position: relative;
    display: flex;
    align-items: center;
    color: #aab3c0;
    text-decoration: none;
    font-size: 14px;
    transition: color var(--transition);
}

.nav-link:hover,
.nav-link:focus-visible {
    color: #fff;
}

.nav-link.active {
    color: var(--red);
}

.nav-link.active::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: -22px;
    left: 0;
    height: 2px;
    background: var(--red);
}

.account-actions {
    justify-self: end;
    display: flex;
    align-items: center;
    gap: 13px;
}

.icon-button,
.profile-button {
    border: 0;
    background: transparent;
    cursor: pointer;
}

.icon-button {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border-radius: 50%;
    color: #cbd1da;
    transition: color var(--transition), background var(--transition), transform var(--transition);
}

.icon-button:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.055);
}

.icon-button:active,
.profile-button:active {
    transform: scale(0.96);
}

.icon-button svg {
    width: 19px;
    height: 19px;
}

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

.profile-avatar {
    display: grid;
    place-items: center;
    width: 35px;
    height: 35px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    background: linear-gradient(145deg, #354457, #18212d);
    font-size: 12px;
    font-weight: 600;
}

.profile-button > svg {
    width: 14px;
    height: 14px;
    color: #7e8a99;
}

.page-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 420px;
    gap: var(--layout-gap);
    margin-top: 18px;
    margin-bottom: 36px;
}

.main-column {
    min-width: 0;
}

.page-heading {
    margin: 8px 0 17px;
}

.page-heading h1 {
    margin: 0 0 7px;
    font-size: 30px;
    line-height: 1.1;
    font-weight: 620;
    letter-spacing: -0.9px;
}

.page-heading p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 14px;
}

.x01-card {
    position: relative;
    height: 315px;
    overflow: visible;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: var(--radius);
    background: #111923;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

.x01-content {
    position: relative;
    z-index: 2;
    width: 50%;
    padding: 20px 22px;
}

.recommended {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    width: fit-content;
    padding: 4px 7px;
    border-radius: 5px;
    color: #5b9dff;
    background: rgba(31, 101, 218, 0.17);
    font-size: 9px;
    font-weight: 650;
}

.recommended svg {
    width: 10px;
    height: 10px;
    fill: currentColor;
}

.x01-content h2 {
    margin: 13px 0 5px;
    font-size: 40px;
    line-height: 1;
    font-weight: 500;
    letter-spacing: -1.25px;
}

.x01-description {
    max-width: 330px;
    margin: 0;
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.48;
}

.match-options {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 15px;
}

.score-selector {
    display: flex;
    gap: 6px;
}

.score-button,
.select-wrapper select {
    height: 36px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    color: #eef2f7;
    background: rgba(8, 13, 21, 0.86);
    transition: color var(--transition), border-color var(--transition), background var(--transition);
}

.score-button {
    min-width: 51px;
    padding-inline: 10px;
    cursor: pointer;
}

.score-button:hover {
    background: rgba(34, 46, 64, 0.92);
}

.score-button.active {
    color: #65a3ff;
    border-color: rgba(49, 130, 255, 0.8);
    background: rgba(24, 103, 225, 0.19);
}

.select-wrapper {
    position: relative;
}

.select-wrapper select {
    min-width: 112px;
    padding: 0 31px 0 12px;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
}

.select-wrapper::after {
    content: "";
    position: absolute;
    top: 12px;
    right: 12px;
    width: 7px;
    height: 7px;
    border-right: 1.5px solid #cad1da;
    border-bottom: 1.5px solid #cad1da;
    transform: rotate(45deg);
    pointer-events: none;
}

/* =========================================================
   X01 MATCH MODE
========================================================= */

.x01-mode-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
    min-height: 36px;
    margin-top: 8px;
}

.x01-mode-selector {
    display: inline-flex;
    overflow: hidden;
    height: 36px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    background: rgba(8, 13, 21, 0.86);
}

.x01-mode-button {
    min-width: 58px;
    height: 100%;
    padding: 0 12px;
    border: 0;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    color: #cfd6df;
    background: transparent;
    cursor: pointer;
    font-size: 14px;
    transition: color var(--transition), background var(--transition);
}

.x01-mode-button:last-child {
    border-right: 0;
}

.x01-mode-button:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.055);
}

.x01-mode-button.active {
    color: #fff;
    background: rgba(109, 118, 132, 0.72);
}

.x01-mode-fields {
    display: flex;
    align-items: center;
    gap: 7px;
}

.x01-mode-fields[hidden] {
    display: none;
}

.x01-mode-fields .select-wrapper select {
    min-width: 145px;
}

.primary-button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 270px;
    height: 44px;
    margin-top: 14px;
    padding: 0 13px 0 18px;
    border: 0;
    border-radius: 7px;
    color: #fff;
    background: linear-gradient(100deg, #187af2, #2869c9);
    box-shadow: 0 8px 22px rgba(22, 109, 235, 0.16);
    cursor: pointer;
    font-size: 14px;
    font-weight: 520;
    transition: transform var(--transition), filter var(--transition), box-shadow var(--transition);
}

.primary-button:hover {
    filter: brightness(1.08);
    transform: translateY(-2px);
    box-shadow: 0 12px 29px rgba(22, 109, 235, 0.25);
}

.primary-button:active {
    transform: scale(0.99);
}

.primary-button svg {
    width: 17px;
    height: 17px;
}

/* =========================================================
   X01 ACTIONS
========================================================= */

.x01-actions {
    display: flex;
    align-items: stretch;
    gap: 8px;
    width: min(100%, 430px);
    margin-top: 14px;
}

.x01-actions > button {
    flex: 1 1 0;
    width: 0;
    height: 44px;
    min-height: 44px;
    margin-top: 0;
}

.x01-actions .x01-quick-start {
    width: 0;
    margin-top: 0;
}

.x01-actions .x01-customize {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 0;
    height: 44px;
    min-height: 44px;
    margin-top: 0;
    padding: 0 14px 0 16px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 7px;
    color: #e8edf4;
    background: rgba(20, 29, 40, 0.92);
    cursor: pointer;
    font-size: 14px;
    font-weight: 520;
    transition:
        transform var(--transition),
        background var(--transition),
        border-color var(--transition),
        box-shadow var(--transition);
}

.x01-actions .x01-customize:hover {
    border-color: rgba(74, 150, 255, 0.42);
    background: rgba(28, 40, 54, 0.96);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.18);
    transform: translateY(-2px);
}

.x01-actions .x01-customize:active {
    transform: scale(0.99);
}

.x01-actions .x01-customize svg {
    width: 17px;
    height: 17px;
    color: var(--text-secondary);
}

.x01-actions .x01-customize:hover svg {
    color: var(--blue-light);
}

.board-scene {
    position: absolute;
    top: -37px;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 0;
    overflow: hidden;
    border-radius: var(--radius);
    pointer-events: none;
}

.board-background {
    position: absolute;
    top: 37px;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 0;
    width: 100%;
    height: calc(100% - 37px);
    object-fit: fill;
    opacity: 0.25;
    border-radius: var(--radius);
}

.board-art {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
    width: 131.6%;
    height: auto;
    transform: translate(-11.9%, -26.6077%);
    filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.28));
}

.section-heading {
    margin: var(--section-gap) 0 12px;
    color: #e4e8ee;
    font-size: 14px;
    font-weight: 530;
}

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

.game-card {
    display: grid;
    grid-template-columns: 45px minmax(0, 1fr) 16px;
    align-items: center;
    gap: 10px;
    min-height: 75px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    background: linear-gradient(140deg, #18222d, #131b24);
    text-align: left;
    cursor: pointer;
    transition: transform var(--transition), background var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.game-card:hover {
    border-color: var(--border-hover);
    background: linear-gradient(140deg, #1e2b39, #17212c);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    transform: translateY(-2px);
}

.game-card:active {
    transform: scale(0.995);
}

.game-icon {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
}

.game-icon svg {
    width: 23px;
    height: 23px;
}

.game-icon.blue {
    color: #3686ff;
    background: var(--blue-soft);
}

.game-icon.red {
    color: #ff3c49;
    background: var(--red-soft);
}

.game-number {
    font-size: 12px;
    font-weight: 650;
}

.game-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.game-copy strong {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    overflow: hidden;
    font-size: 14px;
    font-weight: 530;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.game-copy small {
    overflow: hidden;
    color: var(--text-secondary);
    font-size: 11px;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.badge-beta {
    flex: 0 0 auto;
    padding: 2px 5px;
    border-radius: 4px;
    color: #ff4f5b;
    background: var(--red-soft);
    font-size: 8px;
}

.game-chevron {
    width: 16px;
    height: 16px;
    color: #8995a5;
}

.sidebar {
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    align-self: stretch;
    gap: var(--layout-gap);
}

.side-card {
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: linear-gradient(145deg, rgba(24, 34, 45, 0.98), rgba(18, 26, 35, 0.98));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025), 0 9px 25px rgba(0, 0, 0, 0.07);
}

.side-title {
    margin: 0;
    font-size: 15px;
    font-weight: 570;
}

.side-heading {
    min-height: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.side-heading-icon {
    width: 17px;
    height: 17px;
    color: #c7ced7;
}

.status-list {
    margin-top: 6px;
}

.status-row {
    min-height: 51px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    border-bottom: 1px solid var(--border);
}

.status-name {
    display: flex;
    align-items: center;
    gap: 9px;
    color: #e8ebef;
    font-size: 12px;
}

.status-value {
    flex: 0 0 auto;
    color: var(--text-secondary);
    font-size: 10px;
}

.status-dot {
    width: 8px;
    height: 8px;
    flex: 0 0 auto;
    border-radius: 50%;
}

.status-dot.green {
    background: var(--green);
    box-shadow: 0 0 9px rgba(56, 217, 120, 0.53);
}

.status-dot.blue {
    background: var(--blue-light);
    box-shadow: 0 0 9px rgba(44, 140, 255, 0.45);
}

.secondary-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 40px;
    margin-top: 10px;
    padding-inline: 13px;
    border: 1px solid var(--border);
    border-radius: 7px;
    color: #cdd3dc;
    background: rgba(255, 255, 255, 0.035);
    cursor: pointer;
    font-size: 13px;
    transition: background var(--transition), border-color var(--transition), transform var(--transition);
}

.secondary-button:hover {
    border-color: rgba(255, 255, 255, 0.13);
    background: rgba(255, 255, 255, 0.065);
}

.secondary-button:active {
    transform: scale(0.995);
}

.button-leading-icon {
    width: 16px;
    height: 16px;
}

.button-chevron {
    width: 14px;
    height: 14px;
}

.last-match {
    min-height: 64px;
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 6px 0 8px;
}

.last-match-icon {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    color: #5097ff;
    background: rgba(31, 99, 224, 0.15);
    font-size: 9px;
    font-weight: 650;
}

.last-match-info,
.last-match-result {
    display: flex;
    flex-direction: column;
}

.last-match-info {
    min-width: 0;
    gap: 4px;
}

.last-match-info strong {
    font-size: 12px;
    font-weight: 530;
}

.last-match-info span {
    color: var(--text-secondary);
    font-size: 10px;
}

.last-match-result {
    align-items: flex-end;
    gap: 3px;
}

.last-match-result strong {
    font-size: 18px;
    font-weight: 510;
}

.last-match-result span {
    color: var(--green);
    font-size: 11px;
}

.text-button {
    padding: 0;
    border: 0;
    color: #438eff;
    background: transparent;
    font-size: 11px;
    cursor: pointer;
}

.friend-row {
    display: grid;
    grid-template-columns: 37px minmax(0, 1fr) auto 14px;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-height: 42px;
    padding: 0;
    border: 0;
    color: inherit;
    background: transparent;
    text-align: left;
    cursor: pointer;
}

.friend-avatar {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    color: #fff;
    font-size: 9px;
    font-weight: 650;
}

.friend-avatar.brown {
    background: #79583d;
}

.friend-avatar.blue-avatar {
    background: #3478dc;
}

.friend-avatar.gray {
    background: #606a78;
}

.friend-info {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.friend-info strong {
    overflow: hidden;
    font-size: 11px;
    font-weight: 530;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.friend-info small {
    font-size: 9px;
}

.friend-info .online {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--green);
}

.friend-info .online i {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--green);
}

.friend-info .offline,
.friend-average {
    color: var(--text-secondary);
}

.friend-average {
    font-size: 10px;
}

.friend-row > svg {
    width: 13px;
    height: 13px;
    color: #84909f;
}


/* =========================================================
   X01 CUSTOMIZE DIALOG
========================================================= */

.x01-customize-dialog {
    width: min(1120px, calc(100vw - 48px));
    max-height: calc(100vh - 48px);
    padding: 0;
    border: 0;
    border-radius: 18px;
    color: var(--text);
    background: transparent;
    overflow: visible;
}

.x01-customize-dialog::backdrop {
    background: rgba(1, 5, 10, 0.78);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.x01-customize-panel {
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 48px);
    overflow: hidden;
    border: 1px solid rgba(110, 138, 173, 0.3);
    border-radius: 18px;
    background:
        radial-gradient(
            circle at 78% 0%,
            rgba(37, 124, 240, 0.12),
            transparent 34%
        ),
        linear-gradient(
            145deg,
            rgba(18, 29, 42, 0.99),
            rgba(13, 22, 32, 0.99)
        );
    box-shadow:
        0 32px 90px rgba(0, 0, 0, 0.52),
        inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.x01-customize-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    padding: 26px 28px 22px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.09);
}

.x01-customize-eyebrow {
    display: inline-block;
    margin-bottom: 6px;
    color: var(--blue-light);
    font-size: 11px;
    font-weight: 750;
    letter-spacing: 1.55px;
    text-transform: uppercase;
}

.x01-customize-header h2 {
    margin: 0;
    font-size: 28px;
    line-height: 1.1;
    font-weight: 650;
    letter-spacing: -0.7px;
}

.x01-customize-header p {
    margin: 8px 0 0;
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.45;
}

.x01-customize-close {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    padding: 0;
    border: 1px solid rgba(74, 150, 255, 0.8);
    border-radius: 13px;
    color: #aeb8c6;
    background: rgba(14, 24, 35, 0.82);
    cursor: pointer;
    font-size: 31px;
    font-weight: 300;
    line-height: 1;
    transition:
        color var(--transition),
        border-color var(--transition),
        background var(--transition),
        transform var(--transition);
}

.x01-customize-close:hover {
    color: #fff;
    border-color: var(--blue-light);
    background: rgba(32, 58, 86, 0.82);
}

.x01-customize-close:active {
    transform: scale(0.96);
}

.x01-customize-body {
    display: grid;
    gap: 24px;
    padding: 24px 28px 28px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.x01-customize-section {
    display: grid;
    gap: 16px;
}

.x01-customize-section + .x01-customize-section {
    padding-top: 22px;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.x01-customize-section-heading {
    display: flex;
    align-items: center;
    gap: 12px;
}

.x01-customize-step {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 30px;
    height: 30px;
    border: 1px solid rgba(74, 150, 255, 0.26);
    border-radius: 9px;
    color: #73adff;
    background: rgba(37, 124, 240, 0.1);
    font-size: 12px;
    font-weight: 700;
}

.x01-customize-section-heading h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 620;
}

.x01-customize-section-heading p {
    margin: 3px 0 0;
    color: var(--text-muted);
    font-size: 11px;
}

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

.x01-customize-field {
    min-width: 0;
    display: grid;
    align-content: start;
    gap: 8px;
}

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

.x01-match-mode-field,
.x01-lobby-field {
    width: 100%;
}

.x01-match-mode-field .x01-customize-segment,
.x01-lobby-field .x01-customize-segment {
    width: 100%;
    min-width: 0;
}

.x01-match-mode-field .x01-customize-segment button,
.x01-lobby-field .x01-customize-segment button {
    flex: 1 1 0;
    min-width: 0;
}

.x01-customize-label {
    color: #cbd3de;
    font-size: 12px;
    font-weight: 600;
}

.x01-customize-segment {
    display: flex;
    align-items: stretch;
    width: 100%;
    min-height: 42px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 9px;
    background: rgba(7, 12, 19, 0.7);
}

.x01-customize-segment-compact {
    width: fit-content;
    min-width: 310px;
}

.x01-customize-segment button {
    flex: 1 1 0;
    min-width: 0;
    padding: 0 15px;
    border: 0;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    color: #bcc6d3;
    background: transparent;
    cursor: pointer;
    font-size: 13px;
    font-weight: 560;
    transition:
        color var(--transition),
        background var(--transition);
}

.x01-customize-segment button:last-child {
    border-right: 0;
}

.x01-customize-segment button:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

.x01-customize-segment button.active {
    color: #fff;
    background:
        linear-gradient(
            135deg,
            rgba(73, 86, 103, 0.98),
            rgba(88, 98, 113, 0.92)
        );
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.06),
        inset 0 -1px 0 rgba(0, 0, 0, 0.18);
}

.x01-customize-select {
    position: relative;
}

.x01-customize-select::after {
    content: "";
    position: absolute;
    top: 15px;
    right: 15px;
    width: 7px;
    height: 7px;
    border-right: 1.5px solid #cad1da;
    border-bottom: 1.5px solid #cad1da;
    transform: rotate(45deg);
    pointer-events: none;
}

.x01-customize-select select {
    width: 100%;
    height: 42px;
    padding: 0 38px 0 14px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 9px;
    color: #edf2f8;
    background: rgba(7, 12, 19, 0.7);
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
}

.x01-customize-select select:hover {
    border-color: rgba(74, 150, 255, 0.36);
}

.x01-customize-mode-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.x01-customize-mode-fields[hidden] {
    display: none;
}

#customLegsFields {
    grid-template-columns: minmax(0, 1fr);
}

.x01-customize-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
    padding: 18px 28px;
    border-top: 1px solid rgba(255, 255, 255, 0.09);
    background: rgba(8, 14, 22, 0.62);
}

.x01-customize-summary {
    min-width: 0;
    display: grid;
    gap: 4px;
}

.x01-customize-summary span {
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 650;
    letter-spacing: 0.7px;
    text-transform: uppercase;
}

.x01-customize-summary strong {
    overflow: hidden;
    color: #dce3ec;
    font-size: 12px;
    font-weight: 560;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.x01-customize-footer-actions {
    flex: 0 0 auto;
    display: flex;
    gap: 9px;
}

.x01-customize-secondary,
.x01-customize-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-width: 154px;
    height: 42px;
    padding: 0 17px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition:
        transform var(--transition),
        border-color var(--transition),
        background var(--transition),
        filter var(--transition);
}

.x01-customize-secondary {
    border: 1px solid rgba(255, 255, 255, 0.13);
    color: #d8dee7;
    background: rgba(255, 255, 255, 0.045);
}

.x01-customize-secondary:hover {
    border-color: rgba(74, 150, 255, 0.4);
    background: rgba(255, 255, 255, 0.075);
}

.x01-customize-primary {
    border: 0;
    color: #fff;
    background: linear-gradient(100deg, #187af2, #2869c9);
    box-shadow: 0 9px 24px rgba(22, 109, 235, 0.18);
}

.x01-customize-primary:hover {
    filter: brightness(1.08);
}

.x01-customize-secondary:active,
.x01-customize-primary:active {
    transform: scale(0.98);
}

.x01-customize-primary svg {
    width: 16px;
    height: 16px;
}


.sidebar > .side-card:last-child {
    height: 100%;
}

@media (max-width: 760px) {
    .x01-customize-dialog {
        width: calc(100vw - 24px);
        max-height: calc(100vh - 24px);
    }

    .x01-customize-panel {
        max-height: calc(100vh - 24px);
    }

    .x01-customize-header {
        padding: 21px 20px 18px;
    }

    .x01-customize-header h2 {
        font-size: 24px;
    }

    .x01-customize-body {
        padding: 20px;
    }

    .x01-customize-grid,
    .x01-customize-mode-fields {
        grid-template-columns: 1fr;
    }

    .x01-customize-segment {
        overflow-x: auto;
    }

    .x01-customize-segment button {
        flex: 0 0 auto;
        min-width: 82px;
        height: 42px;
    }

    .x01-customize-segment-compact {
        width: 100%;
        min-width: 0;
    }

    .x01-customize-segment-compact button {
        flex: 1 1 0;
        min-width: 0;
    }

    .x01-customize-footer {
        align-items: stretch;
        flex-direction: column;
        padding: 16px 20px 20px;
    }

    .x01-customize-summary strong {
        white-space: normal;
    }

    .x01-customize-footer-actions {
        width: 100%;
    }

    .x01-customize-secondary,
    .x01-customize-primary {
        flex: 1;
        min-width: 0;
    }
}

@media (max-width: 480px) {
    .x01-customize-footer-actions {
        flex-direction: column;
    }

    .x01-customize-secondary,
    .x01-customize-primary {
        width: 100%;
    }
}


.tournament-dialog {
    width: min(1120px, calc(100% - 32px));
    max-height: min(900px, calc(100% - 32px));
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 18px;
    color: var(--text);
    background: transparent;
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.62);
}

.tournament-dialog::backdrop {
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.tournament-panel {
    display: flex;
    flex-direction: column;
    max-height: min(900px, calc(100vh - 32px));
    border-radius: inherit;
    background:
        radial-gradient(circle at 75% 0%, rgba(43, 103, 180, 0.14), transparent 34%),
        rgba(15, 23, 33, 0.99);
}

.tournament-header {
    display: flex;
    flex: 0 0 auto;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    padding: 24px 26px 20px;
    border-bottom: 1px solid var(--border);
}

.tournament-eyebrow {
    display: block;
    margin-bottom: 5px;
    color: var(--blue-light);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.tournament-header h2 {
    margin: 0;
    font-size: 25px;
}

.tournament-close {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    width: 38px;
    height: 38px;
    padding: 0 0 3px;
    border: 1px solid var(--border);
    border-radius: 9px;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.04);
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
}

.tournament-close:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.08);
}

.tournament-body {
    min-height: 0;
    padding: 24px 26px 26px;
    overflow: auto;
}

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

.tournament-fieldset {
    min-width: 0;
    padding: 0;
    margin: 0;
    border: 0;
}

.tournament-fieldset legend {
    margin-bottom: 11px;
    color: #e7ebf1;
    font-size: 14px;
    font-weight: 650;
}

.tournament-choice-grid {
    display: grid;
    gap: 9px;
}

.tournament-format-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.tournament-system-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.tournament-choice {
    position: relative;
    min-width: 0;
    cursor: pointer;
}

.tournament-choice input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.tournament-choice-card {
    display: flex;
    min-height: 82px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.025);
    flex-direction: column;
    justify-content: center;
    transition: border-color var(--transition), background var(--transition), box-shadow var(--transition), transform var(--transition);
}

.tournament-choice-card strong {
    font-size: 14px;
    font-weight: 620;
}

.tournament-choice-card small {
    display: block;
    margin-top: 5px;
    color: var(--text-secondary);
    font-size: 11px;
    line-height: 1.35;
}

.tournament-choice:hover .tournament-choice-card {
    border-color: var(--border-hover);
    background: rgba(46, 113, 211, 0.07);
    transform: translateY(-1px);
}

.tournament-choice input:checked + .tournament-choice-card {
    border-color: rgba(66, 143, 255, 0.75);
    background: rgba(36, 113, 225, 0.14);
    box-shadow: inset 0 0 0 1px rgba(61, 136, 247, 0.18), 0 8px 24px rgba(0, 0, 0, 0.16);
}

.tournament-choice input:focus-visible + .tournament-choice-card {
    outline: 2px solid var(--blue-light);
    outline-offset: 3px;
}

.tournament-count-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 13px 15px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.025);
}

.tournament-count-row[hidden] {
    display: none;
}

.tournament-count-row label {
    color: #e4e8ee;
    font-size: 13px;
    font-weight: 600;
}

.tournament-count-row select {
    min-width: 92px;
    height: 38px;
    padding: 0 34px 0 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    background: #101822;
}

.participant-fieldset {
    padding-top: 2px;
}

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

.tournament-participant-field {
    display: grid;
    gap: 6px;
}

.tournament-participant-field span {
    color: var(--text-secondary);
    font-size: 11px;
}

.tournament-participant-field input {
    width: 100%;
    height: 42px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    background: rgba(5, 10, 16, 0.56);
    font: inherit;
    font-size: 13px;
}

.tournament-participant-field input::placeholder {
    color: #5f6b79;
}

.tournament-participant-field input:focus {
    border-color: rgba(71, 145, 255, 0.75);
    outline: 0;
    box-shadow: 0 0 0 3px rgba(37, 124, 240, 0.12);
}

.tournament-empty-state {
    grid-column: 1 / -1;
    margin: 0;
    padding: 18px;
    border: 1px dashed var(--border);
    border-radius: 9px;
    color: var(--text-muted);
    font-size: 13px;
    text-align: center;
}

.tournament-shuffle {
    display: flex;
    align-items: center;
    gap: 9px;
    width: fit-content;
    color: var(--text-secondary);
    font-size: 12px;
    cursor: pointer;
}

.tournament-shuffle input {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--blue);
}

.tournament-error {
    min-height: 18px;
    margin: -7px 0 -8px;
    color: #ff6b76;
    font-size: 12px;
}

.tournament-primary-button,
.tournament-secondary-button,
.tournament-danger-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 20px;
    border-radius: 9px;
    font-weight: 600;
    cursor: pointer;
}

.tournament-primary-button {
    border: 0;
    background: linear-gradient(100deg, #1778f0, #286bc8);
}

.tournament-primary-button:hover {
    filter: brightness(1.08);
}

.tournament-secondary-button {
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.04);
}

.tournament-secondary-button:hover {
    background: rgba(255, 255, 255, 0.08);
}

.tournament-danger-button {
    margin-right: auto;
    border: 1px solid rgba(255, 82, 94, 0.48);
    color: #ff858e;
    background: rgba(214, 45, 57, 0.1);
}

.tournament-danger-button:hover {
    border-color: rgba(255, 103, 113, 0.72);
    color: #ffadb3;
    background: rgba(214, 45, 57, 0.18);
}

.tournament-board-view[hidden] {
    display: none;
}

.tournament-overview-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 18px;
    padding: 17px 18px;
    margin-bottom: 18px;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.035);
}

.tournament-overview-card h3 {
    margin: 0 0 5px;
    font-size: 18px;
}

.tournament-overview-card p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 12px;
}

.tournament-progress {
    color: var(--blue-light);
    font-size: 12px;
    font-weight: 650;
}

.tournament-champion {
    padding: 14px 16px;
    margin-bottom: 18px;
    border: 1px solid rgba(66, 214, 122, 0.35);
    border-radius: 10px;
    color: #aaf2c4;
    background: rgba(41, 185, 96, 0.1);
    font-size: 13px;
    font-weight: 650;
    text-align: center;
}

.tournament-rounds {
    display: grid;
    grid-auto-columns: minmax(230px, 1fr);
    grid-auto-flow: column;
    gap: 12px;
    padding-bottom: 8px;
    overflow-x: auto;
}

.tournament-round {
    min-width: 0;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: rgba(4, 9, 15, 0.28);
}

.tournament-round h4 {
    margin: 0 0 10px;
    color: #dfe4eb;
    font-size: 12px;
    font-weight: 650;
}

.tournament-match-list {
    display: grid;
    gap: 9px;
}

.tournament-match {
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.025);
}

.tournament-match-title {
    display: block;
    margin-bottom: 7px;
    color: var(--text-muted);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.tournament-competitors {
    display: grid;
    gap: 6px;
}

.tournament-competitor {
    min-width: 0;
    min-height: 35px;
    padding: 7px 9px;
    border: 1px solid var(--border);
    border-radius: 7px;
    color: #dfe4eb;
    background: rgba(255, 255, 255, 0.035);
    overflow: hidden;
    font-size: 11px;
    text-align: left;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
}

.tournament-competitor:hover:not(:disabled) {
    border-color: var(--border-hover);
    background: rgba(38, 113, 222, 0.1);
}

.tournament-competitor.winner {
    border-color: rgba(58, 213, 117, 0.5);
    color: #a7efc2;
    background: rgba(43, 190, 99, 0.11);
}

.tournament-competitor:disabled {
    color: var(--text-muted);
    cursor: default;
}

.tournament-match-note {
    display: block;
    margin-top: 7px;
    color: var(--text-muted);
    font-size: 10px;
}

.tournament-standings {
    margin-bottom: 18px;
    overflow-x: auto;
}

.tournament-standings h3 {
    margin: 0 0 10px;
    font-size: 14px;
}

.tournament-standings table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.tournament-standings th,
.tournament-standings td {
    padding: 9px 10px;
    border-bottom: 1px solid var(--border);
    text-align: left;
}

.tournament-standings th {
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 650;
    text-transform: uppercase;
}

.tournament-standings td:not(:nth-child(2)),
.tournament-standings th:not(:nth-child(2)) {
    width: 1%;
    text-align: center;
    white-space: nowrap;
}

.tournament-footer-actions {
    display: flex;
    justify-content: flex-end;
    gap: 9px;
    padding-top: 20px;
}

@media (max-width: 760px) {
    .tournament-dialog {
        width: calc(100% - 16px);
        max-height: calc(100% - 16px);
        border-radius: 14px;
    }

    .tournament-panel {
        max-height: calc(100vh - 16px);
    }

    .tournament-header {
        padding: 18px;
    }

    .tournament-header h2 {
        font-size: 21px;
    }

    .tournament-body {
        padding: 18px;
    }

    .tournament-format-grid,
    .tournament-system-grid,
    .tournament-participants {
        grid-template-columns: 1fr;
    }

    .tournament-choice-card {
        min-height: 68px;
    }

    .tournament-overview-card {
        grid-template-columns: 1fr;
    }

    .tournament-rounds {
        grid-auto-columns: 100%;
        grid-auto-flow: row;
        overflow-x: visible;
    }

    .tournament-footer-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .tournament-danger-button {
        margin-right: 0;
    }
}

.match-dialog {
    width: min(430px, calc(100% - 32px));
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 20px;
    color: var(--text);
    background: transparent;
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.58);
}

.match-dialog::backdrop {
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.dialog-card {
    margin: 0;
    padding: 31px;
    border-radius: inherit;
    background: rgba(17, 24, 35, 0.985);
    text-align: center;
}

.dialog-icon {
    display: grid;
    place-items: center;
    width: 60px;
    height: 60px;
    margin: 0 auto 17px;
    border-radius: 50%;
    color: #4a93ff;
    background: rgba(31, 104, 230, 0.15);
}

.dialog-icon svg {
    width: 28px;
    height: 28px;
}

.dialog-card h2 {
    margin: 0 0 9px;
    font-size: 24px;
}

.dialog-card p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 14px;
}

.dialog-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 9px;
    margin-top: 26px;
}

.dialog-button {
    height: 44px;
    border-radius: 9px;
    cursor: pointer;
}

.dialog-cancel {
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.045);
}

.dialog-confirm {
    border: 0;
    background: linear-gradient(100deg, #1778f0, #286bc8);
}

.toast {
    position: fixed;
    bottom: 28px;
    left: 50%;
    z-index: 2000;
    max-width: min(460px, calc(100% - 32px));
    padding: 13px 19px;
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 11px;
    color: #f3f5f8;
    background: rgba(21, 29, 41, 0.97);
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.35);
    opacity: 0;
    visibility: hidden;
    transform: translate(-50%, 10px);
    transition: opacity var(--transition), transform var(--transition), visibility var(--transition);
    font-size: 13px;
    pointer-events: none;
}

.toast.visible {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
}

@media (max-width: 1350px) {
    .main-nav {
        gap: 25px;
    }

    .page-layout {
        grid-template-columns: minmax(0, 1fr) 365px;
    }

    .x01-content {
        width: 58%;
    }
}

@media (max-width: 1100px) {
    .topbar {
        height: 112px;
    }

    .topbar-inner {
        grid-template-columns: 1fr auto;
        grid-template-rows: 63px 48px;
    }

    .brand,
    .account-actions {
        grid-row: 1;
    }

    .main-nav {
        grid-row: 2;
        grid-column: 1 / -1;
        gap: 28px;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .main-nav::-webkit-scrollbar {
        display: none;
    }

    .nav-link {
        flex: 0 0 auto;
        height: 48px;
    }

    .nav-link.active::after {
        bottom: 0;
    }

    .page-layout {
        grid-template-columns: 1fr;
    }

    .sidebar {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-template-rows: auto;
        justify-content: normal;
        gap: var(--layout-gap);
    }

    .sidebar > .side-card:last-child {
        height: auto;
    }

    .sidebar .side-card:last-child {
        grid-column: 1 / -1;
    }
}

@media (max-width: 760px) {
    .shell {
        margin-left: 14px;
        margin-right: 14px;
    }

    .brand-name {
        font-size: 15px;
    }

    .page-layout {
        margin-top: 13px;
    }

    .page-heading h1 {
        font-size: 28px;
    }

    .x01-card {
        height: 410px;
        overflow: hidden;
    }

    .x01-content {
        width: 100%;
        padding: 22px;
    }

    .board-scene {
        top: 0;
        opacity: 0.35;
        overflow: hidden;
    }

    .board-background {
        top: 0;
        width: 100%;
        height: 100%;
        object-fit: fill;
        border-radius: 0;
    }

    .board-art {
        width: 200%;
        transform: translate(-40%, -26.6077%);
    }

    .board-scene::after {
        content: "";
        position: absolute;
        inset: 0;
        z-index: 2;
        background: rgba(9, 15, 23, 0.55);
    }

    .primary-button {
        width: 100%;
        max-width: 330px;
    }

    .game-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .sidebar {
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        gap: var(--layout-gap);
    }

    .sidebar > .side-card:last-child {
        height: auto;
    }
}

@media (max-width: 540px) {
    .account-actions .icon-button {
        display: none;
    }

    .brand-mark {
        width: 29px;
    }

    .x01-card {
        height: 455px;
    }

    .x01-content h2 {
        font-size: 36px;
    }

    .score-selector {
        width: 100%;
    }

    .score-button {
        flex: 1;
    }

    .x01-actions {
        flex-direction: column;
        width: 100%;
        max-width: 330px;
    }

    .x01-actions > button {
        width: 100%;
        flex-basis: 44px;
    }

    .select-wrapper {
        flex: 1;
    }

    .select-wrapper select {
        width: 100%;
        min-width: 0;
    }

    .x01-mode-row {
        align-items: stretch;
    }

    .x01-mode-selector {
        width: 100%;
    }

    .x01-mode-button {
        flex: 1;
    }

    .x01-mode-fields {
        width: 100%;
    }

    .x01-mode-fields .select-wrapper {
        flex: 1;
    }

    .game-grid {
        grid-template-columns: 1fr;
    }

    .friend-average {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}
