/*
 * Dashboard (Tournaments / Teams / Profile tabs).
 * Loaded by dashboard/index.html. Same visual language as the auth pages (user/static/user/css/auth.css).
 * Note: oxygen.css forces `:is(li, div._important) { display: list-item }` (specificity 0,1,1), so list items
 * here are always targeted with two classes.
 */

/* Tokens are defined on .dash and on the page-modal backdrop, which renders outside .dash (base.html's modal block). */
.dash,
.dash-modal-backdrop {
    --d-bg-card: hsla(210, 18%, 7%, 1);
    --d-bg-raised: hsla(210, 16%, 10%, 1);
    --d-bg-field: hsla(0, 0%, 100%, 0.04);
    --d-border: hsla(0, 0%, 100%, 0.09);
    --d-border-strong: hsla(0, 0%, 100%, 0.18);
    --d-text: hsla(0, 0%, 100%, 0.92);
    --d-muted: hsla(0, 0%, 100%, 0.62);
    --d-faint: hsla(0, 0%, 100%, 0.42);
    --d-accent: var(--primary, #5AFF67);
    --d-accent-soft: hsla(125, 100%, 68%, 0.12);
    --d-accent-line: hsla(125, 100%, 68%, 0.35);
    --d-live: hsla(0, 90%, 64%, 1);
    --d-live-soft: hsla(0, 90%, 64%, 0.14);
    --d-warn: hsla(40, 95%, 60%, 1);
    --d-warn-soft: hsla(40, 95%, 60%, 0.13);
    --d-info: hsla(210, 95%, 68%, 1);
    --d-info-soft: hsla(210, 95%, 68%, 0.13);
    --d-violet: hsla(265, 85%, 75%, 1);
    --d-violet-soft: hsla(265, 85%, 75%, 0.14);
    --d-radius: 14px;
    --d-radius-sm: 9px;
}

.dash {
    max-width: 1200px;
    margin: 0 auto;
    padding: 28px 16px 72px;
    box-sizing: border-box;
    font-family: 'Roboto', system-ui, -apple-system, 'Segoe UI', Helvetica, Arial, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    color: var(--d-text);
}

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

.dash h1,
.dash h2,
.dash h3,
.dash h4 {
    margin: 0;
    font-family: 'Montserrat', 'Roboto', system-ui, sans-serif;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
}

.dash p {
    margin: 0;
}

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

/* Guard: navbar.css used to style every bare `nav` as the fixed header (now scoped to .site-nav). */
.dash nav {
    position: static;
    width: auto;
    height: auto;
    z-index: auto;
    background: none;
    font-size: inherit;
}

.dash [hidden] {
    display: none !important;
}

/* ---------- Header ---------- */

.dash-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 22px;
}

.dash-eyebrow {
    margin-bottom: 4px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--d-accent);
}

.dash-header h1 {
    font-size: clamp(1.5rem, 1.1rem + 1.4vw, 2rem);
}

.dash-header__sub {
    margin-top: 4px;
    color: var(--d-muted);
}

.dash-header__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* ---------- Buttons ---------- */

.dbtn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 16px;
    border: 1px solid transparent;
    border-radius: var(--d-radius-sm);
    background: var(--d-accent);
    color: #06080a;
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
    cursor: pointer;
    transition: filter .15s ease, background-color .15s ease, border-color .15s ease, color .15s ease;
}

.dash a.dbtn,
.dash-modal a.dbtn {
    color: #06080a;
}

.dbtn:hover {
    filter: brightness(1.08);
}

.dbtn:focus-visible,
.dicon-btn:focus-visible,
.dash-subnav__link:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.dbtn--ghost,
.dash a.dbtn--ghost,
.dash-modal a.dbtn--ghost {
    background: transparent;
    border-color: var(--d-border-strong);
    color: var(--d-text);
}

.dbtn--ghost:hover {
    background: hsla(0, 0%, 100%, 0.05);
    border-color: hsla(0, 0%, 100%, 0.3);
    filter: none;
}

.dbtn--danger,
.dash a.dbtn--danger {
    background: transparent;
    border-color: hsla(0, 90%, 64%, 0.45);
    color: var(--d-live);
}

.dbtn--danger:hover {
    background: var(--d-live-soft);
    filter: none;
}

.dbtn--danger-solid {
    background: var(--d-live);
    color: #fff;
}

.dbtn--sm {
    padding: 6px 11px;
    font-size: 13px;
}

.dbtn--block {
    width: 100%;
}

.dicon-btn {
    display: inline-grid;
    place-items: center;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: var(--d-faint);
    cursor: pointer;
    transition: background-color .15s ease, color .15s ease;
}

.dicon-btn:hover {
    background: hsla(0, 0%, 100%, 0.07);
    color: #fff;
}

.dicon-btn--danger:hover {
    background: var(--d-live-soft);
    color: var(--d-live);
}

/* ---------- Summary stats ---------- */

.dash-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.dash-stat {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    border: 1px solid var(--d-border);
    border-radius: var(--d-radius);
    background: var(--d-bg-card);
    transition: border-color .15s ease;
}

a.dash-stat:hover {
    border-color: var(--d-border-strong);
}

.dash-stat__icon {
    display: grid;
    place-items: center;
    flex: none;
    width: 40px;
    height: 40px;
    border-radius: 11px;
    background: var(--d-accent-soft);
    color: var(--d-accent);
    font-size: 16px;
}

.dash-stat__icon--info { background: var(--d-info-soft); color: var(--d-info); }
.dash-stat__icon--warn { background: var(--d-warn-soft); color: var(--d-warn); }
.dash-stat__icon--violet { background: var(--d-violet-soft); color: var(--d-violet); }

.dash-stat__text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.dash-stat__value {
    font-family: 'Montserrat', 'Roboto', sans-serif;
    font-size: 22px;
    font-weight: 700;
    line-height: 1.1;
    color: #fff;
}

.dash-stat__label {
    font-size: 12.5px;
    color: var(--d-muted);
}

@media (max-width: 860px) {
    .dash-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 420px) {
    .dash-stat { padding: 12px; gap: 10px; }
    .dash-stat__icon { width: 34px; height: 34px; font-size: 14px; }
    .dash-stat__value { font-size: 18px; }
}

/* ---------- Next match banner ---------- */

/* Unclaimed prize banner (pending payout, no PayPal saved) */
.dash-claim {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px 20px;
    margin-bottom: 22px;
    padding: 18px 20px;
    border: 1px solid hsla(40, 95%, 60%, 0.45);
    border-radius: var(--d-radius);
    background:
        radial-gradient(120% 160% at 0% 0%, hsla(40, 95%, 60%, 0.16), transparent 60%),
        var(--d-bg-card);
}

.dash-claim__icon {
    display: grid;
    place-items: center;
    flex: none;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--d-warn-soft);
    color: var(--d-warn);
    font-size: 20px;
}

.dash-claim__main {
    flex: 1 1 320px;
    min-width: 0;
}

.dash-claim__label {
    margin-bottom: 4px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--d-warn);
}

.dash .dash-claim h2 {
    font-size: 18px;
}

.dash-claim p {
    margin-top: 4px;
    font-size: 14px;
    color: var(--d-muted);
}

.dash-claim p strong {
    color: #fff;
}

.dash-next {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px 24px;
    margin-bottom: 22px;
    padding: 18px 20px;
    border: 1px solid var(--d-accent-line);
    border-radius: var(--d-radius);
    background:
        radial-gradient(120% 140% at 0% 0%, hsla(125, 100%, 68%, 0.13), transparent 55%),
        var(--d-bg-card);
    overflow: hidden;
}

.dash-next__label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--d-accent);
}

.dash-next__teams {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    font-family: 'Montserrat', 'Roboto', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: #fff;
}

.dash-next__team {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.dash-next__teams img {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    object-fit: cover;
}

.dash-next__vs {
    font-family: 'Roboto', sans-serif;
    font-size: 13px;
    font-weight: 500;
    color: var(--d-faint);
}

.dash-next__meta {
    margin-top: 6px;
    font-size: 13.5px;
    color: var(--d-muted);
}

.dash-next__main {
    flex: 1 1 320px;
    min-width: 0;
}

/* ---------- Count badges ---------- */

.dash-count {
    display: inline-grid;
    place-items: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: hsla(0, 0%, 100%, 0.1);
    font-size: 11.5px;
    font-weight: 700;
    color: var(--d-text);
}

.dash-count--alert {
    background: var(--d-live);
    color: #fff;
}

/* ---------- Sections & cards ---------- */

.dash-section + .dash-section {
    margin-top: 36px;
}

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

.dash-section__title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.dash-section__title h2 {
    font-size: 19px;
}

.dash-section__hint {
    margin-top: 2px;
    font-size: 13.5px;
    color: var(--d-muted);
}

.dash-card {
    border: 1px solid var(--d-border);
    border-radius: var(--d-radius);
    background: var(--d-bg-card);
}

.dash-card__head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--d-border);
}

.dash-card__head h3 {
    font-size: 16px;
}

.dash-card__body {
    padding: 18px;
}

.dash-card__body--flush {
    padding: 0;
}

/* ---------- Pills ---------- */

.pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 9px;
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
    line-height: 1.4;
    background: hsla(0, 0%, 100%, 0.08);
    color: var(--d-text);
}

.pill--live { background: var(--d-live-soft); color: var(--d-live); }
.pill--upcoming { background: var(--d-info-soft); color: var(--d-info); }
.pill--full { background: var(--d-warn-soft); color: var(--d-warn); }
.pill--staff { background: var(--d-violet-soft); color: var(--d-violet); }
.pill--waitlist { background: var(--d-warn-soft); color: var(--d-warn); }
.pill--accent,
.pill--captain,
.pill--paid,
.pill--win { background: var(--d-accent-soft); color: var(--d-accent); }
.pill--member { background: var(--d-info-soft); color: var(--d-info); }
.pill--pending { background: var(--d-warn-soft); color: var(--d-warn); }
.pill--void,
.pill--loss { background: var(--d-live-soft); color: var(--d-live); }
.pill--muted { background: hsla(0, 0%, 100%, 0.07); color: var(--d-muted); }
.pill--sponsor { background: hsla(42, 60%, 58%, 0.13); color: hsla(42, 75%, 68%, 1); }
.pill--glass {
    background: hsla(210, 30%, 6%, 0.72);
    border-color: hsla(0, 0%, 100%, 0.14);
    color: #fff;
    backdrop-filter: blur(6px);
}

.live-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 0 0 currentColor;
    animation: dash-pulse 1.6s ease-out infinite;
}

@keyframes dash-pulse {
    0% { box-shadow: 0 0 0 0 hsla(0, 90%, 64%, 0.6); }
    100% { box-shadow: 0 0 0 7px hsla(0, 90%, 64%, 0); }
}

@media (prefers-reduced-motion: reduce) {
    .live-dot { animation: none; }
}

/* ---------- Filter chips ---------- */

.dash-chips {
    display: inline-flex;
    gap: 4px;
    padding: 3px;
    border: 1px solid var(--d-border);
    border-radius: 10px;
    background: var(--d-bg-card);
}

.dash-chip {
    padding: 6px 12px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--d-muted);
    font: inherit;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
}

.dash-chip:hover {
    color: #fff;
}

.dash-chip.is-active {
    background: hsla(0, 0%, 100%, 0.09);
    color: #fff;
}

/* ---------- Tournament cards ---------- */

.t-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(268px, 1fr));
    gap: 16px;
}

.t-card {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--d-border);
    border-radius: var(--d-radius);
    background: var(--d-bg-card);
    overflow: hidden;
    transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}

.t-card:hover {
    border-color: var(--d-border-strong);
    transform: translateY(-2px);
    box-shadow: 0 14px 30px -18px hsla(0, 0%, 0%, 0.9);
}

.t-card__cover {
    position: relative;
    height: 116px;
    background-size: cover;
    background-position: center 35%;
}

.t-card__cover::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, hsla(210, 30%, 5%, 0.15) 0%, hsla(210, 18%, 7%, 0.95) 100%);
}

.t-card__pills {
    position: absolute;
    z-index: 1;
    top: 10px;
    left: 10px;
    right: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.t-card__prize {
    position: absolute;
    z-index: 1;
    right: 12px;
    bottom: 8px;
    font-family: 'Montserrat', 'Roboto', sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: var(--d-accent);
    text-shadow: 0 2px 10px hsla(0, 0%, 0%, 0.6);
}

.t-card__prize--text {
    left: 40%;
    text-align: right;
}

.t-card__prize--text .prize-text {
    font-size: 14px;
    font-weight: 600;
}

.t-card__prize small {
    display: block;
    font-family: 'Roboto', sans-serif;
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-align: right;
    color: var(--d-muted);
}

.t-card__body {
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 12px;
    padding: 4px 16px 16px;
}

.t-card__game {
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--d-faint);
}

.t-card__title {
    margin-top: 2px;
    font-family: 'Montserrat', 'Roboto', sans-serif;
    font-size: 17px;
    font-weight: 700;
    color: #fff;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.t-meta {
    display: grid;
    gap: 6px;
    font-size: 13.5px;
    color: var(--d-muted);
}

.t-meta__row {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
}

.t-meta__row i {
    width: 15px;
    text-align: center;
    color: var(--d-faint);
}

.t-meta__row strong {
    font-weight: 500;
    color: var(--d-text);
}

.t-progress {
    height: 5px;
    border-radius: 99px;
    background: hsla(0, 0%, 100%, 0.08);
    overflow: hidden;
}

.t-progress__bar {
    height: 100%;
    border-radius: inherit;
    background: var(--d-accent);
}

.t-progress__bar.is-full {
    background: var(--d-warn);
}

.t-card__foot {
    margin-top: auto;
    padding-top: 2px;
}

/* "Your tournaments" rows */
.mine-list {
    display: grid;
    gap: 10px;
}

.mine-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 16px;
    padding: 14px 16px;
    border: 1px solid var(--d-border);
    border-radius: var(--d-radius);
    background: var(--d-bg-card);
    transition: border-color .15s ease;
}

.mine-row:hover {
    border-color: var(--d-border-strong);
}

.mine-row.is-live {
    border-color: hsla(0, 90%, 64%, 0.4);
    background: linear-gradient(90deg, hsla(0, 90%, 64%, 0.07), transparent 40%), var(--d-bg-card);
}

.mine-row__date {
    display: grid;
    place-items: center;
    width: 52px;
    height: 54px;
    border-radius: 11px;
    background: var(--d-bg-raised);
    border: 1px solid var(--d-border);
    line-height: 1.1;
}

.mine-row__date b {
    font-family: 'Montserrat', 'Roboto', sans-serif;
    font-size: 19px;
    color: #fff;
}

.mine-row__date span {
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--d-accent);
}

.mine-row__name {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #fff;
}

.mine-row__meta {
    margin-top: 3px;
    font-size: 13px;
    color: var(--d-muted);
}

.mine-row__prize {
    max-width: 190px;
    font-family: 'Montserrat', 'Roboto', sans-serif;
    font-weight: 700;
    color: var(--d-accent);
    text-align: right;
}

@media (max-width: 720px) {
    .mine-row {
        grid-template-columns: auto minmax(0, 1fr);
        gap: 12px;
    }
    .mine-row__prize { text-align: left; grid-column: 2; }
    .mine-row .dbtn { grid-column: 1 / -1; }
}

/* ---------- Empty states ---------- */

.dash-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 34px 20px;
    border: 1px dashed var(--d-border-strong);
    border-radius: var(--d-radius);
    text-align: center;
    color: var(--d-muted);
}

.dash-empty__icon {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: hsla(0, 0%, 100%, 0.05);
    color: var(--d-faint);
    font-size: 20px;
}

.dash-empty h3 {
    font-size: 16px;
}

.dash-empty p {
    max-width: 420px;
    font-size: 14px;
}

.dash-empty .dbtn {
    margin-top: 6px;
}

/* ---------- Teams ---------- */

.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 16px;
}

@media (max-width: 400px) {
    .team-grid { grid-template-columns: 1fr; }
}

.team-card {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--d-border);
    border-radius: var(--d-radius);
    background: var(--d-bg-card);
    overflow: hidden;
}

.team-card__head {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px;
    background: linear-gradient(180deg, hsla(0, 0%, 100%, 0.03), transparent);
    border-bottom: 1px solid var(--d-border);
}

.team-card__logo {
    flex: none;
    width: 60px;
    height: 60px;
    border-radius: 14px;
    object-fit: cover;
    border: 1px solid var(--d-border-strong);
    background: #000;
}

.team-card__name {
    font-family: 'Montserrat', 'Roboto', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    overflow-wrap: anywhere;
}

.team-card__sub {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 5px;
    font-size: 13px;
    color: var(--d-muted);
}

.team-card__roster {
    display: grid;
    gap: 2px;
    margin: 0;
    padding: 10px 10px;
    list-style: none;
}

.team-card .roster-row {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 7px 8px;
    border-radius: 9px;
}

.team-card .roster-row:hover {
    background: hsla(0, 0%, 100%, 0.03);
}

.roster-row__name {
    flex: 1;
    min-width: 0;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.roster-row__you {
    margin-left: 6px;
    font-size: 12px;
    font-weight: 400;
    color: var(--d-faint);
}

.roster-row__role {
    font-size: 12px;
    color: var(--d-accent);
}

.roster-row__role i {
    margin-right: 4px;
}

.roster-row form {
    margin: 0;
}

/* remove-member buttons only show in edit mode */
.team-card .remove-member {
    display: none;
}

.team-card.is-editing .remove-member {
    display: inline-grid;
}

.team-card__foot {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: auto;
    padding: 14px 18px;
    border-top: 1px solid var(--d-border);
}

.team-card__foot .dbtn--danger {
    margin-left: auto;
}

.avatar {
    display: inline-grid;
    place-items: center;
    flex: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: hsl(var(--hue, 125), 85%, 82%);
    background: hsla(var(--hue, 125), 60%, 45%, 0.22);
    border: 1px solid hsla(var(--hue, 125), 70%, 60%, 0.35);
}

.avatar--lg {
    width: 64px;
    height: 64px;
    font-size: 22px;
}

/* ---------- Dialogs ---------- */

.dash-dialog {
    width: min(440px, calc(100vw - 32px));
    margin: auto;               /* base.css resets every element's margin to 0, which un-centres <dialog> */
    padding: 0;
    border: 1px solid var(--d-border-strong, hsla(0, 0%, 100%, 0.18));
    border-radius: 16px;
    background: hsla(210, 18%, 8%, 1);
    color: hsla(0, 0%, 100%, 0.92);
    box-shadow: 0 30px 80px -20px hsla(0, 0%, 0%, 0.9);
    font-family: 'Roboto', system-ui, sans-serif;
}

.dash-dialog::backdrop {
    background: hsla(210, 30%, 3%, 0.72);
    backdrop-filter: blur(3px);
}

.dash-dialog form {
    margin: 0;
}

.dash-dialog__body {
    padding: 22px 22px 6px;
}

.dash-dialog__icon {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    margin-bottom: 14px;
    border-radius: 13px;
    background: hsla(125, 100%, 68%, 0.12);
    color: var(--primary, #5AFF67);
    font-size: 18px;
}

.dash-dialog__icon--danger {
    background: hsla(0, 90%, 64%, 0.14);
    color: hsla(0, 90%, 64%, 1);
}

.dash-dialog h3 {
    margin: 0 0 6px;
    font-family: 'Montserrat', 'Roboto', sans-serif;
    font-size: 18px;
    color: #fff;
}

.dash-dialog p {
    margin: 0 0 14px;
    font-size: 14px;
    line-height: 1.55;
    color: hsla(0, 0%, 100%, 0.65);
}

.dash-dialog__foot {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 14px 22px 20px;
}

/* ---------- Forms ---------- */

.dash-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.dash-field + .dash-field {
    margin-top: 14px;
}

.dash-field label,
.dash-label {
    font-size: 13.5px;
    font-weight: 500;
    color: hsla(0, 0%, 100%, 0.85);
}

.dash-field input[type="text"],
.dash-field input[type="number"],
.dash-field input[type="datetime-local"],
.dash-field input[type="email"],
.dash-field input[type="url"],
.dash-field select,
.dash-dialog input[type="text"] {
    width: 100%;
    margin: 0;
    padding: 10px 12px;
    border: 1px solid var(--d-border-strong, hsla(0, 0%, 100%, 0.18));
    border-radius: 9px;
    background: hsla(0, 0%, 100%, 0.04);
    color: #fff;
    font: inherit;
    font-size: 15px;
    outline: none;
    color-scheme: dark;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.dash-field select option {
    background: #11161b;
}

.dash-field input:focus,
.dash-field select:focus,
.dash-dialog input[type="text"]:focus {
    border-color: var(--primary, #5AFF67);
    box-shadow: 0 0 0 3px hsla(125, 100%, 68%, 0.14);
}

.dash-field__help {
    font-size: 12.5px;
    color: hsla(0, 0%, 100%, 0.45);
}

.dash-field .errorlist,
.dash-field__error {
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 12.5px;
    color: hsla(0, 90%, 70%, 1);
}

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

.dash-form-grid .dash-field + .dash-field {
    margin-top: 0;
}

@media (max-width: 560px) {
    .dash-form-grid { grid-template-columns: 1fr; }
}

.dash-toggle {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 11px 12px;
    border: 1px solid var(--d-border, hsla(0, 0%, 100%, 0.09));
    border-radius: 9px;
    background: hsla(0, 0%, 100%, 0.03);
    cursor: pointer;
    font-size: 14px;
}

.dash-toggle input {
    margin-top: 3px;
    accent-color: var(--primary, #5AFF67);
    width: 16px;
    height: 16px;
}

.dash-toggle small {
    display: block;
    font-size: 12.5px;
    color: hsla(0, 0%, 100%, 0.5);
}

/* ---------- Page modals (Add team / Add tournament) ---------- */

.dash-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: grid;
    place-items: center;
    padding: 76px 16px 16px;
    background: hsla(210, 30%, 3%, 0.72);
    backdrop-filter: blur(3px);
    overflow-y: auto;
}

.dash-modal {
    width: min(560px, 100%);
    border: 1px solid hsla(0, 0%, 100%, 0.18);
    border-radius: 16px;
    background: hsla(210, 18%, 8%, 1);
    box-shadow: 0 30px 80px -20px hsla(0, 0%, 0%, 0.9);
    color: hsla(0, 0%, 100%, 0.92);
    font-family: 'Roboto', system-ui, sans-serif;
}

.dash-modal form {
    margin: 0;
}

.dash-modal__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 20px 22px 16px;
    border-bottom: 1px solid hsla(0, 0%, 100%, 0.09);
}

.dash-modal__head h2 {
    margin: 0;
    font-family: 'Montserrat', 'Roboto', sans-serif;
    font-size: 19px;
    color: #fff;
}

.dash-modal__head p {
    margin: 4px 0 0;
    font-size: 13.5px;
    color: hsla(0, 0%, 100%, 0.55);
}

.dash-modal__body {
    padding: 20px 22px;
}

.dash-modal__foot {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 14px 22px 20px;
    border-top: 1px solid hsla(0, 0%, 100%, 0.09);
}

.logo-picker {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(58px, 1fr));
    gap: 8px;
    max-height: 210px;
    overflow-y: auto;
    padding: 2px;
}

.logo-picker label {
    position: relative;
    cursor: pointer;
}

.logo-picker input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.logo-picker img {
    display: block;
    width: 100%;
    aspect-ratio: 1;
    border-radius: 12px;
    object-fit: cover;
    border: 2px solid transparent;
    opacity: .7;
    transition: opacity .15s ease, border-color .15s ease, transform .15s ease;
}

.logo-picker label:hover img {
    opacity: 1;
}

.logo-picker input:checked + img {
    opacity: 1;
    border-color: var(--primary, #5AFF67);
    box-shadow: 0 0 0 3px hsla(125, 100%, 68%, 0.18);
}

.logo-picker input:focus-visible + img {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

/* ---------- Profile ---------- */

.profile-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
    padding: 20px;
    margin-bottom: 18px;
}

.profile-head__main {
    flex: 1;
    min-width: 200px;
}

.profile-head__name {
    font-family: 'Montserrat', 'Roboto', sans-serif;
    font-size: 22px;
    font-weight: 700;
    color: #fff;
}

.profile-head__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
    margin-top: 4px;
    font-size: 13.5px;
    color: var(--d-muted);
}

.profile-head__meta i {
    margin-right: 5px;
    color: var(--d-faint);
}

.profile-layout {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

@media (max-width: 820px) {
    .profile-layout { grid-template-columns: 1fr; }
}

.dash-subnav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px;
    border: 1px solid var(--d-border);
    border-radius: var(--d-radius);
    background: var(--d-bg-card);
}

@media (max-width: 820px) {
    .dash-subnav {
        flex-direction: row;
        overflow-x: auto;
        scrollbar-width: none;
    }
}

.dash-subnav__link {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 12px;
    border-radius: 9px;
    font-size: 14.5px;
    font-weight: 500;
    white-space: nowrap;
    color: var(--d-muted);
    transition: background-color .15s ease, color .15s ease;
}

.dash .dash-subnav__link:hover {
    color: #fff;
    background: hsla(0, 0%, 100%, 0.04);
}

.dash .dash-subnav__link.is-active {
    color: #fff;
    background: var(--d-accent-soft);
}

.dash-subnav__link i {
    width: 16px;
    text-align: center;
    color: var(--d-faint);
}

.dash-subnav__link.is-active i {
    color: var(--d-accent);
}

.dash-subnav__link .dash-count {
    margin-left: auto;
}

/* mini stat tiles inside a panel */
.mini-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1px;
    border-bottom: 1px solid var(--d-border);
    background: var(--d-border);
}

.mini-stat {
    padding: 16px 18px;
    background: var(--d-bg-card);
}

.mini-stat:first-child { border-top-left-radius: var(--d-radius); }
.mini-stat:last-child { border-top-right-radius: var(--d-radius); }

.mini-stat__value {
    font-family: 'Montserrat', 'Roboto', sans-serif;
    font-size: 22px;
    font-weight: 700;
    color: #fff;
}

.mini-stat__value--accent { color: var(--d-accent); }

.mini-stat__label {
    font-size: 12.5px;
    color: var(--d-muted);
}

@media (max-width: 560px) {
    .mini-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .mini-stat:first-child, .mini-stat:last-child { border-radius: 0; }
}

/* ---------- Tables ---------- */

.dash-table-wrap {
    overflow-x: auto;
}

.dash-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.dash-table th {
    padding: 11px 18px;
    border-bottom: 1px solid var(--d-border);
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-align: left;
    white-space: nowrap;
    color: var(--d-faint);
}

.dash-table td {
    padding: 12px 18px;
    border-bottom: 1px solid var(--d-border);
    vertical-align: middle;
}

.dash-table tbody tr:last-child td {
    border-bottom: 0;
}

.dash-table tbody tr:hover td {
    background: hsla(0, 0%, 100%, 0.02);
}

.dash-table .num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.dash-table__team {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
}

.dash-table__team img {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    object-fit: cover;
}

.dash-table__sub {
    font-size: 12.5px;
    color: var(--d-faint);
}

.result-badge {
    display: inline-grid;
    place-items: center;
    min-width: 34px;
    height: 26px;
    padding: 0 8px;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.03em;
}

.result-badge--W { background: var(--d-accent-soft); color: var(--d-accent); }
.result-badge--L { background: var(--d-live-soft); color: var(--d-live); }
.result-badge--TBD { background: var(--d-info-soft); color: var(--d-info); }
.result-badge--BYE { background: hsla(0, 0%, 100%, 0.07); color: var(--d-muted); }

/* ---------- People lists (friends) ---------- */

.people-list {
    display: grid;
}

.people-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    border-bottom: 1px solid var(--d-border);
}

.people-row:last-child {
    border-bottom: 0;
}

.people-row__name {
    flex: 1;
    min-width: 0;
    font-weight: 500;
}

.people-row form {
    margin: 0;
}

.people-row__actions {
    display: flex;
    gap: 6px;
}

.dash-card__empty {
    padding: 22px 18px;
    font-size: 14px;
    color: var(--d-muted);
}

/* ---------- Notifications ---------- */

.noti-list {
    display: grid;
}

.dash .notification {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--d-border);
}

.dash .notification:last-child {
    border-bottom: 0;
}

.dash .notification.is-unread {
    background: linear-gradient(90deg, hsla(125, 100%, 68%, 0.05), transparent 60%);
}

.noti-icon {
    display: grid;
    place-items: center;
    flex: none;
    width: 38px;
    height: 38px;
    border-radius: 11px;
    background: hsla(0, 0%, 100%, 0.06);
    color: var(--d-muted);
    font-size: 15px;
}

.noti-icon--team { background: var(--d-info-soft); color: var(--d-info); }
.noti-icon--friend { background: var(--d-violet-soft); color: var(--d-violet); }

.noti-main {
    flex: 1;
    min-width: 0;
}

.dash .notification .message {
    font-size: 14.5px;
    color: var(--d-text);
}

.noti-time {
    margin-top: 3px;
    font-size: 12.5px;
    color: var(--d-faint);
}

.dash .notification .buttons {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    font-size: 13px;
    color: var(--d-muted);
}

.dash .notification .buttons:empty {
    display: none;
}

.noti-side {
    display: flex;
    align-items: center;
    gap: 4px;
}

.dash .notification .unread {
    display: none;
    width: 9px;
    height: 9px;
    margin-right: 6px;
    font-size: 9px;
    color: var(--d-accent);
}

.dash .notification .unread.active {
    display: inline-block;
}

/* ---------- Payout summary ---------- */

.money-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1px;
    background: var(--d-border);
    border-bottom: 1px solid var(--d-border);
}

.money-row > div {
    padding: 16px 18px;
    background: var(--d-bg-card);
}

@media (max-width: 560px) {
    .money-row { grid-template-columns: 1fr; }
}

.claim-steps {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid var(--d-border);
}

@media (max-width: 760px) {
    .claim-steps { grid-template-columns: minmax(0, 1fr); }
}

.claim-step {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.claim-step__num {
    display: grid;
    place-items: center;
    flex: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--d-accent-soft);
    color: var(--d-accent);
    font-size: 12px;
    font-weight: 700;
}

.claim-step strong {
    display: block;
    color: #fff;
    font-size: 14px;
}

.claim-step span:not(.claim-step__num) {
    display: block;
    margin-top: 2px;
    font-size: 13px;
    color: var(--d-muted);
}

.payout-current {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid var(--d-accent-line);
    background: var(--d-accent-soft);
    font-size: 14px;
}

.payout-current i {
    color: var(--d-accent);
}

.payout-current.is-missing {
    border-color: hsla(40, 95%, 60%, 0.4);
    background: var(--d-warn-soft);
}

.payout-current.is-missing i {
    color: var(--d-warn);
}

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

/* Hidden by the mode filter */
.is-filtered-out {
    display: none !important;
}

/* Profile > Notifications: email preference checkboxes */
.dash-prefs {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
}

.dash-pref {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    width: 100%;
    box-sizing: border-box;
    padding: 12px 14px;
    border: 1px solid var(--d-border);
    border-radius: var(--d-radius-sm);
    background: var(--d-bg-field);
    cursor: pointer;
    transition: border-color .15s ease;
}

.dash-pref:hover {
    border-color: var(--d-border-strong);
}

.dash-pref input[type="checkbox"] {
    flex: none;
    width: 18px;
    height: 18px;
    margin: 2px 0 0;
    accent-color: var(--d-accent);
    cursor: pointer;
}

.dash-pref__title {
    display: block;
    font-weight: 500;
    color: var(--d-text);
}

.dash-pref__desc {
    display: block;
    margin-top: 2px;
    font-size: 13.5px;
    color: var(--d-muted);
}

/* ---------- Sponsors (tournament page, lists, admin) ---------- */

/* A sponsor's logo at a fixed height; wide logos are capped so they can't push a layout apart.
   .is-light puts a dark logo on a white plate (Sponsor.logo_on_light). */
.sponsor-logo {
    --logo-h: 28px;
    --logo-max-w: 150px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    height: var(--logo-h);
}

.sponsor-logo img {
    display: block;
    height: 100%;
    width: auto;
    max-width: var(--logo-max-w);
    object-fit: contain;
}

.sponsor-logo img[hidden] {
    display: none;
}

.sponsor-logo.is-light {
    box-sizing: content-box;
    padding: 5px 9px;
    border-radius: 7px;
    background: #fff;
}

/* small "Presented by Acme" line in lists and cards */
.sponsor-line {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12.5px;
    color: var(--d-faint);
}

.sponsor-line b {
    font-weight: 500;
    color: hsla(42, 75%, 68%, 1);
}

/* a written prize ("$250 plus a headset for each player") where a cash amount would go: smaller, up to two lines */
.prize-text {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    font-family: 'Roboto', system-ui, sans-serif;
    font-size: 13.5px;
    font-weight: 500;
    line-height: 1.35;
    overflow-wrap: anywhere;
}
