* {
    box-sizing: border-box
}

:root {
    --bg: #18191b;
    --panel: #3d3e41;
    --line: #505154;
    --text: #f2f2f2;
    --muted: #999b9f;
    --accent: #7d9cff
}

button,
input,
select {
    font: inherit
}

.topbar {
    min-height: 78px;
    padding: 14px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px
}

h1,
h2,
p {
    margin: 0
}

h1 {
    font-size: 25px
}


.actions,
.toolbar-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap
}

.btn {
    border: 1px solid #55565a;
    background: #222326;
    color: var(--text);
    border-radius: 9px;
    padding: 9px 14px;
    cursor: pointer;
    height: auto
}

.btn:hover {
    background: #47484c;
    color: white;
}

.btn.accent {
    
    color: white;
    border-color: var(--accent);
    font-weight: 700
}



main {
    
}

.panel {
    border: 1px solid #3d3e41;
    border-radius: 16px;
    background: var(--panel);
    box-shadow: 0 10px 35px rgba(0, 0, 0, .18)
    color:#fff;
}

.setup {
    
    margin: 0 auto;
    padding: 22px;
    color: #fff;
    overflow-x: auto
}

.setup-head,
.bracket-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap
}

.setup h2,
.bracket-toolbar h2 {
    
}

.setup p {
    color: var(--muted);
    margin-top: 6px;
    font-size: 13px
}

.fields {
    display: grid;
    
    gap: 12px;
    margin-top: 20px
}

.fields input,
.fields select {
    color: #fff;
}

label {
    color: #bfc0c3;
    font-size: 12px
}

input,
select {
    width: 100%;
    margin-top: 7px;
    background: #222326;
    border: 1px solid #4a4b4f;
    color: #fff;
    border-radius: 8px;
    padding: 10px;
    outline: 0
}

.participant-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-top: 16px
}

.participant-row {
    display: grid;
    grid-template-columns: 54px 1fr;
    gap: 8px;
    align-items: center;
    padding: 8px;
    border: 1px solid #444549;
    border-radius: 10px;
    background: #27282b;
    color: #fff !important
}

.image-picker {
    position: relative;
    width: 42px;
    height: 42px
}

.image-picker input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
    margin: 0
}

.image-preview {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 9px;
    border: 1px dashed #62646a;
    background: #3a3b3e;
    overflow: hidden;
    color: #a9abb0;
    font-size: 18px
}

.image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover
}

.participant-row input[type=text] {
    margin: 0;
    color: #fff;
    min-width: 70px
}

.hidden {
    display: none !important
}

.bracket-wrap {
    
    padding: 18px 14px 22px;
    overflow-x: auto;
    color: #fff;
}

.bracket-toolbar {
    padding: 0 8px 10px
}

.mode-label {
    display: inline-block;
    margin-top: 6px;
    padding: 4px 8px;
    border-radius: 999px;
    background: #404145;
    color: #bfc0c3;
    font-size: 11px
}

.hint {
    margin: 0 8px 15px;
    color: #8f9196
}

.bracket {
    display: flex;
    align-items: stretch;
    min-height: 600px;
    gap: 34px;
    padding: 0 4px
}

.round {
    flex: 0 0 205px;
    display: flex;
    flex-direction: column
}

.round-title {
    height: 38px;
    color: #c8c9cc;
    font-size: 15px;
    text-align: center
}

.round-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    gap: 10px
}

.match {
    position: relative;
    border: 1px solid #4b4c50;
    background: #303134;
    border-radius: 12px
}

.match:after {
    content: "";
    position: absolute;
    right: -35px;
    top: 50%;
    width: 34px;
    height: 1px;
    background: #57585c
}

.round:last-child .match:after {
    display: none
}

.slot {
    min-height: 50px;
    padding: 6px 8px;
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr) 45px;
    align-items: center;
    gap: 7px;
    cursor: pointer;
    border-bottom: 1px solid #48494d
}

.slot:last-child {
    border-bottom: 0
}

.slot:hover {
    background: #393a3e;
    border-radius: 10px
}

.slot.winner {
    background: #414246;
    font-weight: 700;
    border-radius: 10px;
    color: tan
}

.slot.empty {
    color: #707176;
    cursor: default;
    grid-template-columns: 1fr
}

.avatar {
    width: 28px;
    height: 28px;
    border-radius: 7px;
    display: grid;
    place-items: center;
    background: #46474b;
    overflow: hidden;
    font-size: 11px
}

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

.name {
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis
}

.score-input {
    width: 45px;
    height: 28px;
    margin: 0;
    padding: 3px 4px;
    text-align: center;
    border-radius: 6px;
    font-size: 12px;
    background: #252629;
    color: #fff
}

.round:not(:first-child) .match:before {
    content: "";
    position: absolute;
    left: -18px;
    top: 25%;
    width: 18px;
    height: 50%;
    border-top: 1px solid #57585c;
    border-bottom: 1px solid #57585c
}

.final-round {
    flex-basis: 255px
}

.final-round .match {
    margin-top: 30px
}

.final-round .match:before {
    display: none
}

.champion {
    padding: 18px;
    border: 1px solid #66686d;
    background: #38393c;
    border-radius: 14px;
    text-align: center;
    margin-right: 14px
}

.trophy {
    font-size: 28px
}

.champ-name {
    margin-top: 7px;
    font-size: 18px;
    font-weight: 700
}

.champ-img {
    width: 62px;
    height: 62px;
    margin: 0 auto;
    border-radius: 12px;
    overflow: hidden
}

.champ-img img {
    width: 100%;
    height: 100%;
    object-fit: contain
}

.toast {
    position: fixed;
    left: 50%;
    bottom: 22px;
    transform: translateX(-50%) translateY(15px);
    padding: 10px 16px;
    border: 1px solid #55565a;
    border-radius: 10px;
    background: #242528;
    opacity: 0;
    pointer-events: none;
    transition: .2s
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0)
}