:root {
    --ink: #132033;
    --ink-soft: #536174;
    --navy: #0e1726;
    --navy-2: #152236;
    --paper: #f3f5f2;
    --surface: #ffffff;
    --line: #dce2df;
    --line-strong: #c5cfca;
    --teal: #0c8f83;
    --teal-dark: #087168;
    --teal-soft: #e1f4f0;
    --lime: #d7f36a;
    --amber: #f2c14e;
    --danger: #ba3b46;
    --danger-soft: #fae9ea;
    --shadow-sm: 0 8px 24px rgba(13, 28, 47, .07);
    --shadow-lg: 0 24px 70px rgba(5, 16, 31, .18);
    --radius-sm: 10px;
    --radius: 16px;
    --radius-lg: 24px;
    --sidebar-width: 292px;
}

* {
    box-sizing: border-box;
}

html {
    min-width: 320px;
    color-scheme: light;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--ink);
    background: var(--paper);
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
    font: inherit;
}

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

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid rgba(12, 143, 131, .28);
    outline-offset: 2px;
}

button:disabled {
    cursor: not-allowed;
    opacity: .55;
}

.is-hidden {
    display: none !important;
}

.boot-screen {
    min-height: 100vh;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 14px;
    color: #dce5ef;
    background: var(--navy);
}

.boot-screen p {
    margin: 0;
    color: #9eabba;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--ink);
    text-decoration: none;
    font-weight: 800;
    letter-spacing: -.025em;
}

.brand-light {
    color: #f7f9fc;
}

.brand-mark {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 11px 4px 11px 4px;
    color: var(--navy);
    background: var(--lime);
    font-family: Georgia, serif;
    font-size: 23px;
    font-weight: 800;
    box-shadow: inset 0 0 0 1px rgba(19, 32, 51, .12);
}

.button {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    border: 1px solid transparent;
    border-radius: 11px;
    padding: 9px 16px;
    color: var(--ink);
    background: transparent;
    cursor: pointer;
    font-weight: 750;
    text-decoration: none;
    transition: transform .16s ease, background .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.button:not(:disabled):active {
    transform: translateY(1px);
}

.button-primary {
    color: #fff;
    background: var(--teal);
    box-shadow: 0 8px 20px rgba(12, 143, 131, .2);
}

.button-primary:hover:not(:disabled) {
    background: var(--teal-dark);
}

.button:disabled {
    cursor: wait;
    opacity: .78;
}

.button-spinner {
    width: 15px;
    height: 15px;
    display: none;
    border: 2px solid rgba(255, 255, 255, .4);
    border-top-color: #fff;
    border-radius: 50%;
}

.button.is-loading .button-spinner {
    display: block;
    animation: button-spin .7s linear infinite;
}

.button.is-loading .button-label {
    font-size: 0;
}

.button.is-loading .button-label::after {
    content: "Wird entsperrt …";
    font-size: 13px;
}

@keyframes button-spin {
    to { transform: rotate(360deg); }
}

.button-ghost {
    border-color: var(--line);
    background: var(--surface);
}

.button-ghost:hover:not(:disabled) {
    border-color: var(--line-strong);
    background: #f8faf9;
}

.button-danger {
    color: var(--danger);
    border-color: #ecc8cb;
    background: var(--danger-soft);
}

.button-edit {
    color: #14321e;
    border-color: #bdd454;
    background: var(--lime);
}

.button-edit span {
    color: var(--teal-dark);
}

.button-large {
    width: 100%;
    min-height: 50px;
    border-radius: 13px;
    font-size: 15px;
}

.compact-button {
    min-height: 38px;
    padding: 7px 13px;
    font-size: 13px;
}

.icon-button {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border: 1px solid var(--line);
    border-radius: 10px;
    color: var(--ink);
    background: var(--surface);
    cursor: pointer;
    font-size: 20px;
}

.danger-icon {
    color: var(--danger);
}

.danger-text {
    color: var(--danger);
}

.eyebrow,
.hero-kicker {
    display: block;
    margin-bottom: 7px;
    color: var(--teal);
    font-size: 11px;
    font-weight: 850;
    letter-spacing: .13em;
    text-transform: uppercase;
}

.field {
    display: grid;
    gap: 7px;
}

.field > span:first-child,
.format-fieldset legend,
.draw-mode-fieldset legend {
    color: var(--ink);
    font-size: 13px;
    font-weight: 750;
}

.field small {
    margin-left: 4px;
    color: var(--ink-soft);
    font-weight: 500;
}

.field input,
.field select,
.field textarea {
    width: 100%;
    border: 1px solid var(--line-strong);
    border-radius: 11px;
    padding: 11px 12px;
    color: var(--ink);
    background: #fff;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.field input,
.field select {
    min-height: 44px;
}

.field textarea {
    resize: vertical;
    line-height: 1.55;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    border-color: var(--teal);
    box-shadow: 0 0 0 3px rgba(12, 143, 131, .1);
    outline: none;
}

.field-hint,
.privacy-note {
    color: var(--ink-soft);
    font-size: 12px;
}

.form-error {
    min-height: 18px;
    margin: 0;
    color: var(--danger);
    font-size: 13px;
    font-weight: 650;
}

/* Landing */

.start-shell {
    min-height: 100vh;
    background: #f4f6f5;
}

.start-nav {
    width: min(1080px, calc(100% - 40px));
    height: 74px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0 auto;
    border-bottom: 1px solid var(--line);
}

.start-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--ink-soft);
    font-size: 11px;
    font-weight: 750;
}

.start-status i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--teal);
    box-shadow: 0 0 0 4px rgba(12, 143, 131, .1);
}

.start-page {
    width: min(1080px, calc(100% - 40px));
    margin: 0 auto;
    padding: 52px 0 80px;
}

.start-heading {
    margin-bottom: 26px;
}

.start-heading h1 {
    margin: 5px 0 7px;
    font-size: clamp(30px, 4vw, 44px);
    letter-spacing: -.045em;
}

.start-heading p {
    margin: 0;
    color: var(--ink-soft);
    font-size: 14px;
}

.start-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr);
    gap: 18px;
    align-items: start;
}

.start-card {
    display: grid;
    gap: 16px;
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 22px;
    background: #fff;
    box-shadow: 0 8px 28px rgba(20, 39, 59, .05);
}

.start-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.start-card-head > div {
    display: flex;
    align-items: center;
    gap: 10px;
}

.start-card-head h2 {
    margin: 0;
    font-size: 17px;
    letter-spacing: -.02em;
}

.start-card-head > span {
    border-radius: 999px;
    padding: 5px 8px;
    color: var(--ink-soft);
    background: #eef2f0;
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
}

.card-symbol {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border-radius: 9px;
    color: #fff;
    background: var(--teal);
    font-weight: 900;
}

.card-symbol-lime {
    color: #3f4b16;
    background: var(--lime);
}

.start-card-copy {
    margin: -5px 0 0;
    color: var(--ink-soft);
    font-size: 11px;
    line-height: 1.5;
}

.start-empty {
    min-height: 136px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 8px;
    border: 1px dashed #cbd4d0;
    border-radius: 12px;
    color: var(--ink-soft);
    text-align: center;
}

.start-empty span {
    font-size: 22px;
}

.start-empty p {
    margin: 0;
    font-size: 11px;
}

.start-card .recent-room-link {
    border: 1px solid var(--line);
    background: #f8faf9;
}

.start-open-form {
    margin-top: auto;
    padding-top: 3px;
}

.settings-section {
    display: grid;
    gap: 12px;
    border-top: 1px solid var(--line);
    padding-top: 16px;
}

.settings-section h3,
.settings-section p {
    margin: 0;
}

.settings-section h3 {
    font-size: 13px;
}

.settings-inline {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 9px;
}

.danger-zone {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    border: 1px solid #efc9cc;
    border-radius: 12px;
    padding: 13px;
    background: #fff8f8;
}

.danger-zone p {
    margin-top: 4px;
    color: var(--ink-soft);
    font-size: 10px;
}

.landing-shell {
    min-height: 100vh;
    color: #f4f7fb;
    background:
        radial-gradient(circle at 86% 13%, rgba(12, 143, 131, .25), transparent 28%),
        radial-gradient(circle at 7% 52%, rgba(215, 243, 106, .08), transparent 25%),
        var(--navy);
}

.landing-nav {
    width: min(1240px, calc(100% - 40px));
    height: 82px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0 auto;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.landing-nav .brand {
    color: #fff;
}

.public-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 999px;
    padding: 8px 12px;
    color: #c5d0dc;
    background: rgba(255, 255, 255, .04);
    font-size: 12px;
    font-weight: 700;
}

.public-pill i,
.visual-topbar i,
.room-status i {
    width: 7px;
    height: 7px;
    display: inline-block;
    border-radius: 50%;
    background: var(--lime);
    box-shadow: 0 0 0 4px rgba(215, 243, 106, .1);
}

.hero-section {
    width: min(1240px, calc(100% - 40px));
    display: grid;
    grid-template-columns: minmax(0, 720px);
    justify-content: center;
    margin: 0 auto;
    padding: 48px 0 72px;
}

.hero-copy {
    display: flex;
    flex-direction: column;
}

.hero-copy h1 {
    max-width: 660px;
    margin: 0;
    color: #fff;
    font-size: clamp(36px, 5vw, 52px);
    line-height: .99;
    letter-spacing: -.055em;
}

.hero-copy > p {
    max-width: 610px;
    margin: 24px 0 30px;
    color: #aebbc9;
    font-size: 17px;
    line-height: 1.65;
}

.hero-kicker {
    margin-bottom: 15px;
    color: var(--lime);
}

.create-room-card {
    max-width: 520px;
    display: grid;
    gap: 15px;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 20px;
    padding: 22px;
    color: var(--ink);
    background: rgba(255, 255, 255, .98);
    box-shadow: var(--shadow-lg);
    order: 5;
}

.return-room-card {
    max-width: 520px;
    display: grid;
    gap: 14px;
    margin-top: 14px;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 20px;
    padding: 20px 22px;
    color: var(--ink);
    background: rgba(255, 255, 255, .08);
    text-align: left;
    order: 4;
}

.return-room-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    color: #fff;
}

.return-room-head h2 {
    margin: 0;
    font-size: 18px;
}

.return-room-icon {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    color: var(--navy);
    background: var(--lime);
    font-weight: 900;
}

.return-room-copy {
    margin: 0;
    color: #b8c5d1;
    font-size: 12px;
}

.recent-room-list {
    display: grid;
    gap: 7px;
}

.recent-room-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-radius: 11px;
    padding: 10px 12px;
    color: var(--ink);
    background: #fff;
}

.recent-room-link > span {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.recent-room-link b {
    overflow: hidden;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.recent-room-link small {
    color: var(--ink-soft);
    font-size: 9px;
}

.recent-room-link i {
    flex: 0 0 auto;
    color: var(--teal-dark);
    font-size: 10px;
    font-style: normal;
    font-weight: 800;
}

.recent-room-link:hover {
    box-shadow: 0 5px 18px rgba(0, 0, 0, .12);
}

.open-room-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 9px;
}

.return-room-card .field > span:first-child {
    color: #e7edf2;
}

.return-room-card .form-error {
    min-height: 0;
}

.create-room-head,
.dialog-head,
.overview-head,
.section-title-row,
.tournament-headbar,
.stage-heading,
.visual-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.create-room-head h2,
.dialog-head h2 {
    margin: 0;
    font-size: 20px;
    letter-spacing: -.025em;
}

.step-badge {
    border-radius: 999px;
    padding: 7px 10px;
    color: #50611f;
    background: #f0f8cf;
    font-size: 11px;
    font-weight: 800;
}

.privacy-note {
    margin: -3px 0 0;
    text-align: center;
    line-height: 1.45;
}

.hero-visual {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 28px;
    padding: 18px;
    color: var(--ink);
    background: #eef1ed;
    box-shadow: 0 42px 100px rgba(0, 0, 0, .28);
    transform: perspective(1200px) rotateY(-3deg) rotateX(1deg);
}

.hero-visual::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(120deg, rgba(255,255,255,.35), transparent 32%);
}

.visual-topbar {
    position: relative;
    z-index: 1;
    margin-bottom: 14px;
    border-radius: 13px;
    padding: 11px 14px;
    background: #fff;
    box-shadow: var(--shadow-sm);
    font-size: 13px;
    font-weight: 800;
}

.visual-topbar > span:first-child {
    display: inline-flex;
    align-items: center;
    gap: 9px;
}

.visual-live {
    border-radius: 6px;
    padding: 4px 6px;
    color: #fff;
    background: var(--teal);
    font-size: 9px;
    letter-spacing: .1em;
}

.mini-bracket {
    position: relative;
    min-height: 480px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 52px;
    align-items: stretch;
    padding: 12px 0;
}

.mini-round {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    gap: 18px;
}

.mini-match {
    position: relative;
    z-index: 2;
    overflow: hidden;
    border: 1px solid #d8dfdc;
    border-left: 3px solid var(--teal);
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 7px 18px rgba(20, 39, 59, .08);
}

.mini-match::after {
    content: "";
    position: absolute;
    left: 100%;
    top: 50%;
    width: 54px;
    border-top: 1px solid #aebbb6;
}

.mini-round-final .mini-match::after {
    display: none;
}

.mini-match span {
    display: flex;
    justify-content: space-between;
    gap: 6px;
    padding: 8px 9px;
    font-size: 11px;
}

.mini-match span + span {
    border-top: 1px solid #edf0ee;
}

.mini-match b {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mini-match em {
    color: var(--ink-soft);
    font-style: normal;
    font-variant-numeric: tabular-nums;
}

.mini-match.is-final {
    border-left-color: var(--lime);
    box-shadow: 0 10px 22px rgba(12, 143, 131, .15);
}

.visual-caption {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.visual-caption span {
    border-radius: 999px;
    padding: 6px 9px;
    color: #667268;
    background: #dfe5df;
    font-size: 10px;
    font-weight: 750;
}

.feature-strip {
    width: min(1240px, calc(100% - 40px));
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    margin: 0 auto;
    border-top: 1px solid rgba(255, 255, 255, .08);
}

.feature-strip article {
    display: flex;
    gap: 16px;
    padding: 30px 28px 38px;
}

.feature-strip article + article {
    border-left: 1px solid rgba(255, 255, 255, .08);
}

.feature-strip article > span {
    color: var(--lime);
    font-family: ui-monospace, monospace;
    font-size: 11px;
}

.feature-strip h3 {
    margin: 0 0 7px;
    color: #f7f9fc;
    font-size: 15px;
}

.feature-strip p {
    margin: 0;
    color: #909eae;
    font-size: 13px;
    line-height: 1.55;
}

/* Workspace */

.workspace-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
}

.workspace-sidebar {
    position: sticky;
    z-index: 20;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    color: #dfe7f0;
    background: var(--navy);
}

.sidebar-brand-row {
    min-height: 76px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    border-bottom: 1px solid rgba(255, 255, 255, .07);
}

.sidebar-close {
    display: none;
    color: #fff;
    border-color: rgba(255,255,255,.1);
    background: rgba(255,255,255,.05);
}

.room-identity {
    padding: 25px 22px 18px;
}

.room-identity h1 {
    margin: 0 0 11px;
    color: #fff;
    font-size: 19px;
    line-height: 1.16;
    letter-spacing: -.025em;
    overflow-wrap: anywhere;
    text-wrap: balance;
}

.room-identity .eyebrow {
    color: #7e91a7;
}

.room-status {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: #9cabbc;
    font-size: 11px;
    font-weight: 700;
}

.is-viewing .room-status i {
    background: #77879a;
    box-shadow: 0 0 0 4px rgba(119, 135, 154, .1);
}

.tree-nav {
    flex: 1;
    overflow-y: auto;
    padding: 5px 12px 20px;
    scrollbar-width: thin;
    scrollbar-color: #314056 transparent;
}

.tree-nav button {
    width: 100%;
    min-height: 38px;
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr) auto;
    align-items: center;
    gap: 7px;
    border: 0;
    border-radius: 9px;
    padding: 8px 9px;
    color: #aab7c6;
    background: transparent;
    cursor: pointer;
    text-align: left;
    font-size: 12px;
}

.tree-nav button:hover {
    color: #fff;
    background: rgba(255, 255, 255, .055);
}

.tree-nav button.is-active {
    color: #fff;
    background: rgba(215, 243, 106, .1);
}

.tree-nav button.is-active::before {
    content: "";
    position: absolute;
    left: 0;
    width: 3px;
    height: 20px;
    border-radius: 0 3px 3px 0;
    background: var(--lime);
}

.tree-root,
.tree-folder,
.tree-tournament {
    position: relative;
}

.tree-folder {
    grid-template-columns: 24px minmax(0, 1fr) auto !important;
    padding-left: calc(9px + var(--depth) * 12px) !important;
}

.tree-tournament {
    grid-template-columns: 20px minmax(0, 1fr) !important;
    padding-left: calc(18px + var(--depth) * 12px) !important;
}

.tree-nav button span:nth-child(2),
.tree-nav button b {
    overflow: hidden;
    font-weight: 650;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tree-nav button em {
    color: #64758a;
    font-size: 10px;
    font-style: normal;
}

.tree-icon {
    width: 22px;
    height: 22px;
    display: grid;
    place-items: center;
    border: 1px solid #506078;
    border-radius: 6px;
    color: #d7f36a;
    background: rgba(255, 255, 255, .06);
    cursor: pointer;
    font-size: 15px;
    font-weight: 850;
    line-height: 1;
}

.tree-icon:hover,
.tree-icon:focus-visible {
    color: var(--navy);
    border-color: var(--lime);
    background: var(--lime);
    outline: none;
}

.tree-children.is-collapsed {
    display: none;
}

.format-dot {
    width: 19px;
    height: 19px;
    display: grid;
    place-items: center;
    border-radius: 6px;
    color: var(--lime);
    background: rgba(255,255,255,.06);
    font-size: 10px;
}

.sidebar-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 14px 12px;
    border-top: 1px solid rgba(255,255,255,.07);
}

.button-sidebar {
    min-height: 42px;
    border-color: rgba(255,255,255,.09);
    padding: 8px;
    color: #d4deea;
    background: rgba(255,255,255,.04);
    font-size: 11px;
}

.button-sidebar-primary {
    color: var(--navy);
    border-color: var(--lime);
    background: var(--lime);
}

.sidebar-footer {
    padding: 12px 18px 16px;
    color: #5f7084;
    font-size: 10px;
    text-align: center;
}

.sidebar-backdrop {
    display: none;
}

.workspace-main {
    min-width: 0;
    min-height: 100vh;
    background: var(--paper);
}

.workspace-topbar {
    position: sticky;
    z-index: 12;
    top: 0;
    min-height: 68px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 11px clamp(18px, 3vw, 38px);
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, .92);
    backdrop-filter: blur(14px);
}

.topbar-left,
.topbar-actions,
.breadcrumbs {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.menu-button {
    display: none;
}

.breadcrumbs {
    overflow: hidden;
    font-size: 12px;
}

.breadcrumb {
    overflow: hidden;
    max-width: 170px;
    color: #7d8997;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.breadcrumb.is-active {
    color: var(--ink);
    font-weight: 750;
}

.breadcrumb-separator {
    color: #b2bcb8;
}

.workspace-content {
    min-width: 0;
}

.overview-page {
    width: min(1180px, calc(100% - 48px));
    margin: 0 auto;
    padding: 42px 0 70px;
}

.overview-head {
    margin-bottom: 38px;
}

.overview-head h2,
.tournament-title-block h2 {
    margin: 0;
    font-size: clamp(27px, 3vw, 38px);
    letter-spacing: -.045em;
}

.overview-head p,
.tournament-title-block p {
    margin: 8px 0 0;
    color: var(--ink-soft);
    font-size: 13px;
}

.overview-section + .overview-section {
    margin-top: 38px;
}

.overview-section > h3,
.section-title-row h3 {
    margin: 0 0 14px;
    font-size: 14px;
    letter-spacing: -.01em;
}

.section-title-row h3 {
    margin: 0;
}

.section-title-row {
    margin-bottom: 14px;
}

.section-title-row > span {
    color: var(--ink-soft);
    font-size: 12px;
}

.folder-card-grid,
.tournament-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 14px;
}

.sortable-card-wrap {
    position: relative;
    min-width: 0;
}

.sortable-card-wrap > .folder-card,
.sortable-card-wrap > .tournament-card {
    width: 100%;
}

.drag-handle {
    position: absolute;
    z-index: 2;
    right: 10px;
    bottom: 10px;
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--ink-soft);
    background: #fff;
    cursor: grab;
    font-size: 17px;
    box-shadow: 0 2px 8px rgba(20, 39, 59, .08);
}

.sortable-card-wrap[draggable="true"] {
    cursor: grab;
}

.sortable-card-wrap[draggable="true"]:hover .drag-handle {
    color: #fff;
    border-color: var(--teal);
    background: var(--teal);
}

.sortable-card-wrap.is-dragging {
    opacity: .38;
}

.sortable-card-wrap.drop-before::before,
.sortable-card-wrap.drop-after::after {
    content: "";
    position: absolute;
    z-index: 5;
    right: 0;
    left: 0;
    height: 4px;
    border-radius: 99px;
    background: var(--teal);
}

.sortable-card-wrap.drop-before::before {
    top: -8px;
}

.sortable-card-wrap.drop-after::after {
    bottom: -8px;
}

.folder-card,
.tournament-card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--ink);
    background: var(--surface);
    cursor: pointer;
    text-align: left;
    transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.folder-card:hover,
.tournament-card:hover {
    transform: translateY(-2px);
    border-color: #b9c8c3;
    box-shadow: var(--shadow-sm);
}

.folder-card {
    min-height: 78px;
    display: grid;
    grid-template-columns: 38px 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 14px;
}

.folder-card-icon,
.tournament-format-icon,
.empty-icon {
    display: grid;
    place-items: center;
    border-radius: 11px;
    color: var(--teal-dark);
    background: var(--teal-soft);
}

.folder-card-icon {
    width: 38px;
    height: 38px;
    font-size: 15px;
}

.folder-card span:nth-child(2) {
    display: grid;
    gap: 4px;
}

.folder-card b {
    font-size: 13px;
}

.folder-card em {
    color: var(--ink-soft);
    font-size: 11px;
    font-style: normal;
}

.folder-card > i {
    color: #9ba6a1;
    font-style: normal;
}

.tournament-card {
    min-height: 216px;
    padding: 18px;
}

.tournament-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.tournament-format-icon {
    width: 38px;
    height: 38px;
    font-size: 19px;
}

.tournament-format-label {
    border-radius: 999px;
    padding: 5px 8px;
    color: #66756f;
    background: #edf1ee;
    font-size: 9px;
    font-weight: 850;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.tournament-card h4 {
    margin: 22px 0 6px;
    font-size: 18px;
    letter-spacing: -.025em;
}

.tournament-card p {
    margin: 0;
    color: var(--ink-soft);
    font-size: 11px;
}

.progress-track {
    height: 5px;
    overflow: hidden;
    margin: 18px 0 16px;
    border-radius: 99px;
    background: #e9eeeb;
}

.progress-track i {
    height: 100%;
    display: block;
    border-radius: inherit;
    background: var(--teal);
}

.progress-track.is-closed i {
    background: var(--lime-dark);
}

.card-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--teal-dark);
    font-size: 11px;
    font-weight: 800;
}

.card-link i {
    font-style: normal;
}

.empty-state {
    min-height: 260px;
    display: grid;
    place-items: center;
    align-content: center;
    border: 1px dashed #c7d1cd;
    border-radius: var(--radius-lg);
    padding: 32px;
    text-align: center;
}

.empty-icon {
    width: 52px;
    height: 52px;
    margin-bottom: 14px;
    font-size: 24px;
}

.empty-state h4 {
    margin: 0 0 8px;
    font-size: 17px;
}

.empty-state p {
    max-width: 420px;
    margin: 0 0 18px;
    color: var(--ink-soft);
    font-size: 13px;
    line-height: 1.55;
}

/* Tournament */

.tournament-page {
    padding: 30px clamp(16px, 3vw, 38px) 70px;
}

.tournament-headbar {
    align-items: flex-end;
    margin-bottom: 20px;
}

.format-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 9px;
    border-radius: 999px;
    padding: 6px 9px;
    color: var(--teal-dark);
    background: var(--teal-soft);
    font-size: 10px;
    font-weight: 800;
}

.format-chip i {
    font-size: 12px;
    font-style: normal;
}

.tournament-tools {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.zoom-control {
    display: grid;
    grid-template-columns: 36px 52px 36px;
    align-items: center;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
}

.zoom-control button {
    height: 36px;
    border: 0;
    color: var(--ink);
    background: transparent;
    cursor: pointer;
    font-size: 17px;
}

.zoom-control button:hover {
    background: #f1f5f2;
}

.zoom-control span {
    color: var(--ink-soft);
    font-size: 10px;
    font-weight: 750;
    text-align: center;
}

.edit-hint {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    border: 1px solid #d9e6a7;
    border-radius: 10px;
    padding: 9px 12px;
    color: #53651e;
    background: #f2f8d9;
    font-size: 11px;
    font-weight: 700;
}

.tournament-host {
    min-height: 420px;
}

.tournament-render {
    transform-origin: top left;
}

.stage-section {
    min-width: 0;
    margin-bottom: 26px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #e9eeea;
    box-shadow: 0 6px 18px rgba(20, 39, 59, .04);
}

.stage-heading {
    justify-content: flex-start;
    min-height: 52px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--line-strong);
    background: rgba(255,255,255,.6);
}

.stage-heading h3 {
    margin: 0;
    font-size: 14px;
    letter-spacing: -.01em;
}

.stage-title-group {
    min-width: 0;
    display: grid;
    gap: 3px;
}

.stage-route {
    margin: 0;
    color: #68756f;
    font-size: 9px;
    font-weight: 650;
    line-height: 1.35;
}

.stage-badge {
    min-width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    color: #fff;
    background: var(--teal);
    font-size: 10px;
    font-weight: 850;
}

.stage-b .stage-badge {
    color: #3e4b15;
    background: var(--lime);
}

.stage-c .stage-badge {
    color: #5e4314;
    background: var(--amber);
}

.bracket-scroller {
    width: 100%;
    overflow-x: auto;
    padding: 8px 0 18px;
    scrollbar-color: #9eaaa5 transparent;
}

.bracket-canvas {
    position: relative;
    min-width: 100%;
}

.connector-layer {
    position: absolute;
    z-index: 0;
    inset: 0;
    overflow: visible;
    pointer-events: none;
}

.connector-path {
    fill: none;
    stroke: #98a69f;
    stroke-width: 1.35;
    vector-effect: non-scaling-stroke;
}

.round-column {
    position: absolute;
    z-index: 1;
    top: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
}

.round-title {
    height: 36px;
    display: grid;
    place-items: center;
    margin: 0;
    color: #6c7973;
    font-size: 10px;
    font-weight: 850;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.round-matches {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    gap: 18px;
    padding: 10px 0;
}

.match-card {
    width: 230px;
    min-height: 87px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #d5ddd9;
    border-left: 3px solid #aebbb5;
    border-radius: 10px;
    padding: 0;
    color: var(--ink);
    background: #fff;
    box-shadow: 0 5px 16px rgba(20, 39, 59, .07);
    text-align: left;
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.match-card:not(:disabled) {
    cursor: pointer;
}

.match-card:not(:disabled):hover {
    transform: translateY(-1px);
    border-color: var(--teal);
    border-left-color: var(--teal);
    box-shadow: 0 9px 22px rgba(12, 143, 131, .13);
}

.match-card:disabled {
    opacity: 1;
}

.match-card.is-complete {
    border-left-color: var(--teal);
}

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

.match-player + .match-player {
    border-top: 1px solid #edf0ee;
}

.match-player.is-winner {
    background: #eff9f6;
}

.match-player.is-winner .match-player-name {
    color: #075f57;
    font-weight: 850;
}

.match-player-name {
    overflow: hidden;
    font-size: 11px;
    font-weight: 650;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.match-player-name-line {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 5px;
}

.match-player-name-line .match-player-name {
    min-width: 0;
}

.match-seed-badge {
    width: 17px;
    height: 17px;
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    border: 1px solid #7cbdb3;
    border-radius: 5px;
    color: #08766b;
    background: #e5f6f2;
    font-size: 8px;
    font-weight: 900;
}

.match-player-identity {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.match-player-origin {
    overflow: hidden;
    color: #82908a;
    font-size: 7.5px;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.match-player-name.is-placeholder {
    color: #9aa59f;
    font-style: italic;
    font-weight: 500;
}

.match-player-score {
    color: var(--ink-soft);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 11px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    white-space: pre;
}

.match-card-footer {
    min-height: 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: auto;
    padding: 4px 8px;
    color: #8b9691;
    background: #f6f8f7;
    font-size: 8px;
}

.match-schedule {
    color: var(--teal-dark);
    font-weight: 800;
}

.champion-card {
    position: relative;
    min-height: 104px;
    justify-content: center;
    gap: 6px;
    border: 1px solid #b7d56c;
    border-left: 4px solid var(--lime);
    padding: 14px 44px 14px 14px;
    background: linear-gradient(135deg, #fff, #f5fadf);
}

.champion-kicker {
    color: #6a782e;
    font-size: 8px;
    font-weight: 850;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.champion-name {
    overflow: hidden;
    font-size: 15px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.champion-name-line {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 7px;
}

.champion-name-line .champion-name {
    min-width: 0;
}

.champion-seed-badge {
    width: 20px;
    height: 20px;
    font-size: 9px;
}

.champion-trophy {
    position: absolute;
    right: 14px;
    color: #8ca52e;
    font-size: 24px;
}

.champion-connector {
    stroke: #9db84a;
    stroke-width: 2;
}

.match-note {
    overflow: hidden;
    color: #5f6c66;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.groups-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(520px, 1fr));
    gap: 20px;
    padding: 20px;
}

.group-card {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
}

.group-title {
    margin: 0;
    padding: 16px 18px;
    border-bottom: 1px solid var(--line);
    font-size: 16px;
}

.standings-wrap {
    overflow-x: auto;
}

.standings-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 540px;
    font-size: 13px;
}

.standings-table th,
.standings-table td {
    padding: 12px 13px;
    border-bottom: 1px solid #edf0ee;
    color: var(--ink-soft);
    text-align: center;
    white-space: nowrap;
}

.standings-table th {
    color: #7b8781;
    background: #f7f9f8;
    font-size: 10px;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.standings-table .standing-name {
    color: var(--ink);
    font-size: 13px;
    font-weight: 700;
    text-align: left;
}

.group-games {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
    gap: 10px;
    padding: 14px;
    background: #f1f4f2;
}

.group-games .match-card {
    width: 100%;
}

/* Dialogs */

.app-dialog {
    width: min(480px, calc(100% - 28px));
    max-height: min(88vh, 760px);
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 0;
    color: var(--ink);
    background: #fff;
    box-shadow: var(--shadow-lg);
}

.app-dialog::backdrop {
    background: rgba(6, 16, 29, .62);
    backdrop-filter: blur(4px);
}

.app-dialog form {
    display: grid;
    gap: 17px;
    padding: 23px;
}

.dialog-copy {
    margin: -4px 0 0;
    color: var(--ink-soft);
    font-size: 13px;
    line-height: 1.55;
}

.dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 9px;
    padding-top: 3px;
}

.split-actions {
    justify-content: space-between;
}

.split-actions > div {
    display: flex;
    gap: 9px;
}

.tournament-dialog {
    width: min(980px, calc(100% - 28px));
}

.wizard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(250px, .65fr);
    gap: 22px;
}

.wizard-main {
    display: grid;
    gap: 17px;
}

.format-fieldset,
.draw-mode-fieldset {
    margin: 0;
    border: 0;
    padding: 0;
}

.format-fieldset legend,
.draw-mode-fieldset legend {
    margin-bottom: 8px;
}

.format-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.format-choice {
    position: relative;
    min-height: 76px;
    display: grid;
    grid-template-columns: 34px 1fr;
    align-items: center;
    gap: 10px;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 10px;
    cursor: pointer;
}

.format-choice:has(input:checked) {
    border-color: var(--teal);
    background: var(--teal-soft);
    box-shadow: inset 0 0 0 1px var(--teal);
}

.format-choice input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.format-choice-icon {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 9px;
    color: var(--teal-dark);
    background: #edf3f0;
    font-size: 17px;
}

.format-choice:has(input:checked) .format-choice-icon {
    color: #fff;
    background: var(--teal);
}

.format-choice > span:last-child {
    min-width: 0;
    display: grid;
    gap: 4px;
}

.format-choice b {
    font-size: 11px;
}

.format-choice em {
    color: var(--ink-soft);
    font-size: 9px;
    font-style: normal;
    line-height: 1.35;
}

.draw-mode-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.draw-mode-choice {
    position: relative;
    min-height: 72px;
    display: grid;
    grid-template-columns: 38px 1fr;
    align-items: center;
    gap: 10px;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 10px;
    cursor: pointer;
}

.draw-mode-choice:has(input:checked) {
    border-color: var(--teal);
    background: var(--teal-soft);
    box-shadow: inset 0 0 0 1px var(--teal);
}

.draw-mode-choice input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.draw-mode-icon {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 9px;
    color: var(--teal-dark);
    background: #edf3f0;
    font-size: 13px;
    font-weight: 850;
}

.draw-mode-choice:has(input:checked) .draw-mode-icon {
    color: #fff;
    background: var(--teal);
}

.draw-mode-choice > span:last-child {
    min-width: 0;
    display: grid;
    gap: 4px;
}

.draw-mode-choice b {
    font-size: 11px;
}

.draw-mode-choice em {
    color: var(--ink-soft);
    font-size: 9px;
    font-style: normal;
    line-height: 1.35;
}

.seeded-players-field {
    display: grid;
    gap: 10px;
    border: 1px solid #bfdad5;
    border-radius: 12px;
    padding: 12px;
    background: #f4fbf9;
}

.seeded-players-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

.seeded-players-head > span {
    font-size: 11px;
    font-weight: 800;
}

.seeded-players-head small,
.seeded-players-head em {
    color: var(--ink-soft);
    font-size: 9px;
    font-style: normal;
    font-weight: 500;
}

.seeded-player-choices {
    min-width: 0;
}

.seeded-player-choices > p {
    margin: 0;
    color: var(--ink-soft);
    font-size: 10px;
}

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

.seed-zone {
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
}

.seed-zone-title {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    border-bottom: 1px solid var(--line);
    padding: 8px 9px;
    background: #f7faf8;
}

.seed-zone-title b {
    font-size: 10px;
}

.seed-zone-title small {
    overflow: hidden;
    color: var(--ink-soft);
    font-size: 8px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.seed-pool-list,
.seeded-ranked-list {
    height: 148px;
    display: grid;
    align-content: start;
    gap: 6px;
    overflow-y: auto;
    padding: 7px;
    transition: background .14s ease, box-shadow .14s ease;
}

.seed-pool-item,
.seeded-ranked-item {
    min-width: 0;
    min-height: 34px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.seed-pool-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 7px;
    overflow: hidden;
    padding: 6px 8px;
    color: var(--ink);
    cursor: grab;
    font-size: 10px;
    font-weight: 700;
    text-align: left;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.seed-pool-item span {
    color: var(--teal);
    font-size: 13px;
    font-weight: 900;
}

.seeded-ranked-item {
    position: relative;
    display: grid;
    grid-template-columns: 28px 14px minmax(0, 1fr) 26px;
    align-items: center;
    gap: 5px;
    padding: 4px;
    cursor: grab;
}

.seed-rank {
    width: 27px;
    height: 27px;
    display: grid;
    place-items: center;
    border-radius: 7px;
    color: #fff;
    background: var(--teal);
    font-size: 12px;
    font-weight: 900;
}

.seed-drag-handle {
    color: #9aa6a1;
    font-size: 15px;
}

.seeded-ranked-item b {
    overflow: hidden;
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.seeded-ranked-item button {
    width: 24px;
    height: 24px;
    border: 0;
    border-radius: 6px;
    color: #8d9994;
    background: transparent;
    cursor: pointer;
    font-size: 15px;
}

.seeded-ranked-item button:hover {
    color: var(--danger);
    background: var(--danger-soft);
}

.seed-empty {
    padding: 10px 5px;
    color: var(--ink-soft);
    font-size: 9px;
    line-height: 1.4;
    text-align: center;
}

.seed-pool-list.is-drop-target,
.seeded-ranked-list.is-drop-target {
    background: #ecf8f5;
    box-shadow: inset 0 0 0 2px rgba(12, 143, 131, .28);
}

.seed-pool-item.is-dragging,
.seeded-ranked-item.is-dragging {
    opacity: .38;
}

.seeded-ranked-item.drop-before::before,
.seeded-ranked-item.drop-after::after {
    content: "";
    position: absolute;
    right: 3px;
    left: 3px;
    height: 3px;
    border-radius: 99px;
    background: var(--teal);
}

.seeded-ranked-item.drop-before::before {
    top: -5px;
}

.seeded-ranked-item.drop-after::after {
    bottom: -5px;
}

.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.participants-field textarea {
    min-height: 370px;
}

.participants-field {
    align-self: start;
    align-content: start;
}

.result-players {
    display: grid;
    gap: 8px;
}

.result-players div {
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 9px;
}

.result-players span {
    width: 25px;
    height: 25px;
    display: grid;
    place-items: center;
    border-radius: 7px;
    color: var(--teal-dark);
    background: var(--teal-soft);
    font-size: 10px;
    font-weight: 850;
}

.result-players b {
    font-size: 13px;
}

.result-dialog #matchScore {
    min-height: 54px;
    font-size: 18px;
    font-weight: 800;
    letter-spacing: .02em;
}

.winner-choices {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.winner-choice {
    min-height: 54px;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid var(--line-strong);
    border-radius: 12px;
    padding: 10px 12px;
    color: var(--ink);
    background: #fff;
    cursor: pointer;
    text-align: left;
}

.winner-choice span {
    width: 25px;
    height: 25px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: transparent;
    background: #edf1ef;
}

.winner-choice.is-selected {
    border-color: var(--teal);
    background: var(--teal-soft);
    box-shadow: inset 0 0 0 1px var(--teal);
}

.winner-choice.is-selected span {
    color: #fff;
    background: var(--teal);
}

.match-schedule-details {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #f8faf9;
}

.match-schedule-details summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 11px 13px;
    cursor: pointer;
    list-style: none;
    font-size: 11px;
    font-weight: 800;
}

.match-schedule-details summary::-webkit-details-marker {
    display: none;
}

.match-schedule-details summary::before {
    content: "▸";
    color: var(--teal);
}

.match-schedule-details[open] summary::before {
    content: "▾";
}

.match-schedule-details summary > span {
    margin-right: auto;
}

.match-schedule-details summary em {
    overflow: hidden;
    color: var(--ink-soft);
    font-size: 9px;
    font-style: normal;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.match-schedule-content {
    display: grid;
    gap: 12px;
    border-top: 1px solid var(--line);
    padding: 12px;
    background: #fff;
}

.participant-name-fields {
    max-height: min(52vh, 520px);
    display: grid;
    gap: 8px;
    overflow-y: auto;
    padding-right: 4px;
}

.participant-name-field {
    grid-template-columns: 28px 1fr;
    align-items: center;
}

.participant-name-field > span:first-child {
    color: var(--ink-soft);
    text-align: center;
}

.existing-seeding {
    display: grid;
    gap: 10px;
    border-top: 1px solid var(--line);
    padding-top: 15px;
}

/* Toast / error */

.toast-region {
    position: fixed;
    z-index: 100;
    right: 18px;
    bottom: 18px;
    display: grid;
    gap: 8px;
    pointer-events: none;
}

.toast {
    min-width: 250px;
    max-width: 380px;
    transform: translateY(10px);
    opacity: 0;
    border: 1px solid #b9ddd6;
    border-radius: 12px;
    padding: 12px 14px;
    color: #075f57;
    background: #edf9f6;
    box-shadow: var(--shadow-lg);
    font-size: 12px;
    font-weight: 750;
    transition: opacity .2s ease, transform .2s ease;
}

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

.toast-error {
    color: var(--danger);
    border-color: #e8b7bb;
    background: var(--danger-soft);
}

.toast-neutral {
    color: var(--ink);
    border-color: var(--line);
    background: #fff;
}

.not-found-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 70px;
    padding: 30px;
    color: #fff;
    background: var(--navy);
    text-align: center;
}

.not-found-page > div {
    display: grid;
    justify-items: center;
}

.not-found-page h1 {
    margin: 0;
}

.not-found-page p {
    margin: 10px 0 20px;
    color: #9eabba;
}

@media (max-width: 1050px) {
    .hero-section {
        grid-template-columns: 1fr;
    }

    .hero-copy {
        max-width: 760px;
        margin: 0 auto;
        text-align: center;
    }

    .hero-copy > p,
    .create-room-card,
    .return-room-card {
        margin-left: auto;
        margin-right: auto;
    }

    .hero-visual {
        max-width: 760px;
        margin: 0 auto;
        transform: none;
    }

    .workspace-shell {
        grid-template-columns: 1fr;
    }

    .workspace-sidebar {
        position: fixed;
        left: 0;
        transform: translateX(-102%);
        width: min(var(--sidebar-width), calc(100vw - 46px));
        transition: transform .2s ease;
    }

    .workspace-sidebar.is-open {
        transform: translateX(0);
    }

    .sidebar-close,
    .menu-button {
        display: grid;
    }

    .sidebar-backdrop {
        position: fixed;
        z-index: 19;
        inset: 0;
        display: block;
        opacity: 0;
        pointer-events: none;
        background: rgba(6, 16, 29, .5);
        transition: opacity .2s ease;
    }

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

@media (max-width: 760px) {
    .start-nav,
    .start-page {
        width: calc(100% - 24px);
    }

    .start-status {
        display: none;
    }

    .start-page {
        padding: 34px 0 54px;
    }

    .start-grid,
    .settings-inline,
    .danger-zone {
        grid-template-columns: 1fr;
    }

    .start-card {
        padding: 16px;
    }

    .landing-nav,
    .hero-section,
    .feature-strip {
        width: min(100% - 24px, 620px);
    }

    .landing-nav {
        height: 68px;
    }

    .public-pill {
        display: none;
    }

    .hero-section {
        gap: 44px;
        padding: 46px 0;
    }

    .hero-copy h1 {
        font-size: clamp(38px, 12vw, 56px);
    }

    .hero-copy > p {
        font-size: 15px;
    }

    .create-room-card {
        padding: 17px;
        text-align: left;
    }

    .return-room-card {
        padding: 17px;
    }

    .hero-visual {
        overflow-x: auto;
        padding: 12px;
    }

    .mini-bracket {
        width: 680px;
    }

    .visual-caption {
        width: 680px;
    }

    .feature-strip {
        grid-template-columns: 1fr;
    }

    .feature-strip article + article {
        border-top: 1px solid rgba(255,255,255,.08);
        border-left: 0;
    }

    .workspace-topbar {
        padding: 9px 12px;
    }

    .topbar-left {
        flex: 1 1 auto;
        overflow: hidden;
    }

    .topbar-actions {
        flex: 0 0 auto;
    }

    .topbar-actions .compact-button {
        width: 38px;
        padding: 0;
        font-size: 0;
    }

    .topbar-actions .compact-button span {
        display: inline;
        font-size: 13px;
    }

    .breadcrumb {
        max-width: 105px;
    }

    .breadcrumb:not(.is-active),
    .breadcrumb-separator {
        display: none;
    }

    .overview-page {
        width: calc(100% - 28px);
        padding-top: 28px;
    }

    .overview-head,
    .tournament-headbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .tournament-headbar {
        gap: 14px;
    }

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

    .tournament-page {
        padding: 22px 12px 50px;
    }

    .groups-grid {
        grid-template-columns: 1fr;
        padding: 10px;
    }

    .group-games {
        grid-template-columns: 1fr;
    }

    .wizard-grid,
    .format-grid,
    .draw-mode-grid,
    .winner-choices,
    .field-row {
        grid-template-columns: 1fr;
    }

    .open-room-form {
        grid-template-columns: 1fr;
    }

    .participants-field textarea {
        min-height: 220px;
    }

    .app-dialog form {
        padding: 18px;
    }

    .dialog-actions,
    .split-actions,
    .split-actions > div {
        width: 100%;
    }

    .dialog-actions {
        flex-direction: column-reverse;
    }

    .dialog-actions .button,
    .split-actions > div,
    .split-actions > div .button {
        width: 100%;
    }

    .split-actions {
        flex-direction: column;
    }

    .toast-region {
        right: 10px;
        bottom: 10px;
        left: 10px;
    }

    .toast {
        min-width: 0;
        max-width: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
    }
}
