.ct-layout--top {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.ct-layout--top .ct-side {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    width: max-content;
    max-width: 100%;
    gap: 0.65rem;
}

.ct-layout--top .ct-side .title-prize-card {
    flex: 0 1 auto;
    max-width: 470px;
    min-width: 310px;
    flex-direction: row;
    align-items: center;
    padding: 0.65rem var(--space-md) 2.75rem;
}

.ct-layout--top .ct-side .title-prize-card-main {
    flex: 1;
    min-width: 0;
    width: auto;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    text-align: center;
}

.ct-layout--top .ct-side .title-prize-card-title {
    width: 100%;
    min-width: 0;
    text-align: center;
    font-size: 1.02rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ct-layout--top .title-prize-card-prize {
    flex-direction: row;
    align-items: baseline;
    justify-content: center;
    gap: 8px;
}

.ct-layout--top .ct-side .title-prize-card-actions {
    top: auto;
    right: var(--space-sm);
    bottom: var(--space-sm);
    left: var(--space-sm);
    justify-content: flex-start;
}

.ct-layout--top .ct-side .title-prize-card-actions .btn-icon-delete {
    margin-left: auto;
}

.ct-layout--top .title-prize-card-amount {
    font-size: 1.35rem;
    white-space: nowrap;
}

.ct-layout--top .title-prize-card-label {
    margin-top: 0;
    white-space: nowrap;
}

.ct-layout--top .ct-summary {
    flex: 0 0 132px;
    width: 132px;
    grid-template-columns: 1fr;
}

.ct-layout--top .ct-description {
    flex: 0 1 auto;
    align-self: flex-start;
    width: max-content;
    min-width: 160px;
    max-width: 420px;
    max-height: none;
    overflow: visible;
}

.ct-layout--top .ct-summary-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 0.55rem 0.5rem 0.6rem;
    text-align: center;
}

.ct-layout--top .ct-summary-card .lbl {
    font-size: 0.72rem;
}

.ct-layout--top .ct-summary-card .val {
    font-size: 1.55rem;
    margin-top: 0.25rem;
}

.ct-layout--top .ct-arena-wrap {
    width: 100%;
}

.ct-layout--top .ct-arena-scroll {
    overflow-x: auto;
    overflow-y: hidden;
}

@media (max-width: 800px) {
    .ct-layout--top {
        padding: 0.75rem 0.5rem;
    }

    .ct-layout--top .ct-side {
        flex-wrap: wrap;
        width: 100%;
    }

    .ct-layout--top .ct-side .title-prize-card,
    .ct-layout--top .ct-summary,
    .ct-layout--top .ct-description {
        flex: 1 1 100%;
        max-width: none;
        min-width: 0;
        width: auto;
    }

    .ct-layout--top .ct-side .title-prize-card {
        padding: 0.7rem 0.85rem 2.75rem;
    }

    .ct-layout--top .ct-side .title-prize-card-main {
        padding-right: 0;
    }

    .ct-layout--top .ct-arena-scroll {
        -webkit-overflow-scrolling: touch;
    }

    .de-bracket {
        --de-gap: 20px;
    }
}

.de-bracket {
    --de-card-width: 296px;
    --de-result-width: 26px;
    --de-row-height: 50px;
    --de-gap: 32px;
    position: relative;
    display: flex;
    align-items: center;
    gap: var(--de-gap);
    width: max-content;
    flex-shrink: 0;
    transform-origin: top left;
}

.de-main {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.de-section {
    position: relative;
    z-index: 1;
}

.de-section--lower {
    padding-top: var(--space-lg);
    border-top: 1px dashed rgba(255, 255, 255, 0.08);
}

.de-rounds {
    display: flex;
    gap: var(--de-gap);
    align-items: stretch;
}

.de-round {
    display: flex;
    flex-direction: column;
    width: calc(var(--de-card-width) + 6px + var(--de-result-width));
}

.de-round-title {
    margin-bottom: 4px;
    padding-bottom: 5px;
    border-bottom: 1px solid rgba(201, 170, 88, 0.3);
    font-family: var(--font-heading);
    font-size: 0.66rem;
    color: var(--accent-gold);
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    white-space: nowrap;
}

.de-section--lower .de-round-title {
    color: rgba(239, 140, 120, 0.9);
    border-bottom-color: rgba(244, 67, 54, 0.3);
}

.de-round-matches {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
}

.de-node {
    margin: 8px 0;
    cursor: default;
}

.de-node-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    height: 20px;
    margin-bottom: 2px;
    margin-right: calc(var(--de-result-width) + 6px);
    padding: 0 2px;
}

.de-node-num {
    font-size: 0.66rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.04em;
}

.de-node.is-ready .de-node-num {
    color: var(--accent-gold);
}

.de-node-head-right {
    display: flex;
    align-items: center;
    gap: 6px;
}

.de-node-drop {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 18px;
    padding: 0 7px 0 5px;
    border: 1px solid rgba(244, 67, 54, 0.28);
    border-radius: 999px;
    background: rgba(244, 67, 54, 0.08);
    color: rgba(239, 140, 120, 0.95);
    font-size: 0.62rem;
    font-weight: 600;
    white-space: nowrap;
}

.de-node-drop svg {
    flex-shrink: 0;
    opacity: 0.85;
}

.de-reset-btn {
    width: 18px;
    height: 18px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger);
    font-size: 0.7rem;
    line-height: 1;
    cursor: pointer;
    transition: background 0.15s;
}

.de-reset-btn:hover {
    background: rgba(239, 68, 68, 0.45);
}

.de-node-body {
    display: flex;
    align-items: flex-start;
    gap: 6px;
}

.de-node-results {
    display: flex;
    flex-direction: column;
    width: var(--de-result-width);
    padding: 1px 0;
    flex-shrink: 0;
}

.de-result-slot {
    display: flex;
    align-items: center;
    justify-content: center;
    height: var(--de-row-height);
}

.de-node-card {
    position: relative;
    flex: 1;
    min-width: 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    overflow: hidden;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.de-node.is-ready .de-node-card {
    border-color: rgba(201, 170, 88, 0.45);
    box-shadow: 0 0 12px rgba(201, 170, 88, 0.12);
}

.de-node.is-final .de-node-card {
    border-color: rgba(201, 170, 88, 0.6);
    box-shadow: 0 0 18px rgba(201, 170, 88, 0.22);
}

.de-row {
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
    height: var(--de-row-height);
    padding: 0 8px;
    transition: background 0.15s, opacity 0.15s;
}

.de-row + .de-row {
    border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.de-row[data-clickable="1"] {
    cursor: pointer;
}

.de-row[data-clickable="1"]:hover {
    background: rgba(201, 170, 88, 0.07);
}

.de-row.is-winner {
    background: linear-gradient(90deg, rgba(76, 175, 80, 0.22) 0%, rgba(76, 175, 80, 0.06) 100%);
}

.de-row.is-winner[data-clickable="1"]:hover {
    background: linear-gradient(90deg, rgba(76, 175, 80, 0.3) 0%, rgba(76, 175, 80, 0.1) 100%);
}

.de-row.is-winner .de-row-name {
    color: #fff;
    font-weight: 700;
}

.de-row.is-winner .de-row-avatar {
    border-color: rgba(76, 175, 80, 0.7);
}

.de-row.is-loser > :not(.de-row-avatar-wrap),
.de-row.is-loser .de-row-avatar {
    opacity: 0.4;
}

.de-row.is-loser .de-row-avatar,
.de-row.is-loser .de-row-hero img,
.de-row.is-loser .de-row-medal {
    filter: grayscale(0.8);
}

.de-row.is-loser .de-row-coin {
    border-color: #6b5a33;
    background: #2b261b;
    color: #8a7742;
    box-shadow: none;
}

.de-row.drag-source {
    opacity: 0.4;
}

.de-row.drag-target {
    box-shadow: inset 0 0 0 2px rgba(201, 170, 88, 0.7);
}

.de-row.is-paid {
    background: linear-gradient(90deg, rgba(201, 170, 88, 0.14) 0%, rgba(201, 170, 88, 0) 75%);
}

.de-row.is-paid .de-row-name {
    color: #e6c97a;
}

.de-row.is-paid .de-row-avatar {
    border-color: var(--accent-gold);
    box-shadow: 0 0 8px rgba(201, 170, 88, 0.45);
}

.de-row.is-winner.is-paid {
    background: linear-gradient(90deg, rgba(76, 175, 80, 0.22) 0%, rgba(201, 170, 88, 0.08) 100%);
}

.de-row-avatar-wrap {
    position: relative;
    display: inline-flex;
    flex-shrink: 0;
    margin-right: 6px;
    padding: 0;
    border: none;
    background: none;
}

.de-row-avatar-wrap.is-toggle {
    cursor: pointer;
}

.de-row-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.15);
}

.de-row-coin {
    position: absolute;
    right: -6px;
    bottom: -4px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border: 1px solid var(--accent-gold);
    border-radius: 4px;
    background: #3b3322;
    color: var(--accent-gold);
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    box-shadow: 0 0 8px rgba(201, 170, 88, 0.3);
    opacity: 0;
}

.de-row-hero svg {
    display: block;
}

.de-row.is-paid .de-row-coin {
    opacity: 1;
}

.de-row:not(.is-paid) .de-row-avatar-wrap.is-toggle:hover .de-row-coin {
    opacity: 1;
    border-color: rgba(201, 170, 88, 0.5);
    background: #252838;
    color: rgba(201, 170, 88, 0.7);
    box-shadow: none;
}

.de-row-avatar.is-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    border-style: dashed;
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.03);
    color: rgba(201, 170, 88, 0.75);
}

.de-row.is-paid .de-row-avatar.is-placeholder {
    border-color: rgba(201, 170, 88, 0.7);
    background: rgba(201, 170, 88, 0.08);
}

.de-row-name.is-place {
    font-size: 0.8rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.5);
}

.de-row.is-paid .de-row-name.is-place {
    color: #e6c97a;
}

.de-slot-chip {
    flex-shrink: 0;
    padding: 4px 9px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-muted);
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    line-height: 1;
    white-space: nowrap;
}

.de-slot-chip.is-paid {
    border-color: var(--accent-gold);
    background: var(--accent-gold);
    color: #111;
}

button.de-slot-chip {
    cursor: pointer;
}

button.de-slot-chip:hover {
    border-color: var(--accent-gold);
    color: var(--accent-gold);
}

button.de-slot-chip.is-paid:hover {
    color: #111;
    background: #d8bb6c;
}

.de-row-copy {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.45);
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.de-row-copy:hover {
    border-color: rgba(201, 170, 88, 0.6);
    background: rgba(201, 170, 88, 0.12);
    color: var(--accent-gold);
}

.de-row-copy:active {
    transform: scale(0.92);
}

.de-row-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    text-overflow: ellipsis;
}

.de-row-name.is-muted {
    text-align: center;
    font-size: 0.68rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.35);
}

.de-row-name.is-add {
    text-align: center;
    font-size: 0.78rem;
    font-weight: 500;
    color: rgba(201, 170, 88, 0.75);
}

.de-row-medal {
    position: relative;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
}

.de-row-medal img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.de-row-hero {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 62px;
    height: 35px;
    flex-shrink: 0;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    background: rgba(0, 0, 0, 0.3);
    color: rgba(255, 255, 255, 0.3);
}

.de-row-hero[data-hero-pick] {
    cursor: pointer;
}

.de-row-hero[data-hero-pick]:hover {
    border-color: var(--accent-gold);
    color: var(--accent-gold);
}

.de-row-hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.de-row-result {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 5px;
    background: transparent;
    font-size: 0.68rem;
    font-weight: 700;
}

.de-row-result.is-win {
    border-color: rgba(76, 175, 80, 0.6);
    background: rgba(76, 175, 80, 0.25);
    color: var(--accent-green);
}

.de-row-result.is-lose {
    border-color: rgba(244, 67, 54, 0.3);
    background: rgba(244, 67, 54, 0.1);
    color: rgba(244, 67, 54, 0.7);
}

button.de-row-result {
    border-color: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.4);
    cursor: pointer;
}

button.de-row-result:hover {
    border-color: rgba(76, 175, 80, 0.6);
    background: rgba(76, 175, 80, 0.2);
    color: var(--accent-green);
}

.de-connectors {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: visible;
    pointer-events: none;
    z-index: 0;
}

.de-connectors path {
    fill: none;
    stroke: #4a4434;
    stroke-width: 1;
}
