:root {
    --app-header-height: 4.5rem;
    --app-height: calc(var(--app-vh, 1vh) * 100);
    --app-bg: #101511;
    --app-bg-soft: #172019;
    --app-panel: rgba(248, 250, 247, 0.96);
    --app-panel-border: rgba(255, 255, 255, 0.22);
    --app-text: #172019;
    --app-muted: #667065;
    --dart-green: #1c7c4d;
    --dart-green-dark: #125c37;
    --dart-red: #b8323a;
    --dart-gold: #e2b846;
    --dart-cream: #f8faf7;
}

html {
    min-height: 100%;
}

.app-body {
    min-height: var(--app-height);
    margin: 0;
    color: var(--app-text);
    background:
        linear-gradient(135deg, rgba(16, 21, 17, 0.96), rgba(23, 32, 25, 0.9)),
        repeating-linear-gradient(
            90deg,
            rgba(255, 255, 255, 0.03) 0,
            rgba(255, 255, 255, 0.03) 1px,
            transparent 1px,
            transparent 84px
        ),
        var(--app-bg);
    overflow-x: hidden;
}

.app-body::before {
    position: fixed;
    inset: auto -8rem -14rem auto;
    width: 34rem;
    max-width: 90vw;
    aspect-ratio: 1;
    content: "";
    pointer-events: none;
    opacity: 0.26;
    background:
        radial-gradient(circle, #111 0 5%, transparent 5.2%),
        repeating-radial-gradient(circle, transparent 0 10%, rgba(248, 250, 247, 0.75) 10% 12%, transparent 12% 22%),
        conic-gradient(
            from -9deg,
            var(--dart-green) 0 18deg,
            #141914 18deg 36deg,
            var(--dart-red) 36deg 54deg,
            #f0dfbd 54deg 72deg,
            var(--dart-green) 72deg 90deg,
            #141914 90deg 108deg,
            var(--dart-red) 108deg 126deg,
            #f0dfbd 126deg 144deg,
            var(--dart-green) 144deg 162deg,
            #141914 162deg 180deg,
            var(--dart-red) 180deg 198deg,
            #f0dfbd 198deg 216deg,
            var(--dart-green) 216deg 234deg,
            #141914 234deg 252deg,
            var(--dart-red) 252deg 270deg,
            #f0dfbd 270deg 288deg,
            var(--dart-green) 288deg 306deg,
            #141914 306deg 324deg,
            var(--dart-red) 324deg 342deg,
            #f0dfbd 342deg 360deg
        );
    border: 10px solid rgba(8, 11, 9, 0.95);
    border-radius: 50%;
    box-shadow: 0 2rem 5rem rgba(0, 0, 0, 0.45);
}

.app-header {
    position: relative;
    z-index: 2;
    min-height: var(--app-header-height);
    color: var(--dart-cream);
    background: rgba(11, 15, 12, 0.82);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(16px);
}

.app-header-inner {
    min-height: var(--app-header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.app-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--dart-cream);
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: 0;
    text-decoration: none;
}

.app-brand:hover,
.app-brand:focus {
    color: #ffffff;
}

.app-brand-mark {
    width: 2.6rem;
    height: 2.6rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    background:
        radial-gradient(circle at center, var(--dart-red) 0 20%, #ffffff 21% 34%, var(--dart-green) 35% 54%, #111 55% 100%);
    border: 2px solid rgba(255, 255, 255, 0.72);
    border-radius: 50%;
    box-shadow: 0 0.5rem 1.2rem rgba(0, 0, 0, 0.24);
}

.app-brand-mark .bi {
    font-size: 1.15rem;
}

.app-content {
    position: relative;
    z-index: 1;
    min-height: calc(var(--app-height) - var(--app-header-height));
}

.login-page,
.logged-in-page,
.match-start-page,
.match-play-page,
.tournament-page,
.error-page {
    min-height: calc(var(--app-height) - var(--app-header-height));
    display: grid;
    align-items: center;
    padding: 2rem 0;
}

.login-layout,
.logged-in-layout {
    width: min(100%, 34rem);
    margin: 0 auto;
}

.dashboard-layout {
    width: min(100%, 62rem);
    margin: 0 auto;
}

.match-start-layout {
    width: min(100%, 64rem);
    margin: 0 auto;
}

.login-panel,
.logged-in-panel,
.match-list-panel,
.match-start-panel {
    position: relative;
    overflow: hidden;
    color: var(--app-text);
    background: var(--app-panel);
    border: 1px solid var(--app-panel-border);
    border-radius: 0.85rem;
    box-shadow: 0 1.5rem 4rem rgba(0, 0, 0, 0.32);
}

.btn-tournament {
    min-height: 3.35rem;
    width: 100%;
    color: var(--dart-green-dark);
    font-weight: 800;
    background: #fffaf0;
    border: 2px solid rgba(174, 126, 32, 0.55);
    border-radius: 0.75rem;
}

.btn-tournament:hover, .btn-tournament:focus { color: #63450d; background: #fff3d5; border-color: var(--dart-gold); }
.group-name-input { min-height: 3rem; border-color: #cbd5cc; }
.group-name-input[aria-invalid="true"] { border-color: var(--dart-red); }
.group-rules-grid { margin-top: 1rem; }

.tournament-page { align-items: start; padding: 2rem 0 3rem; }
.tournament-layout { width: min(100%, 72rem); display: grid; gap: 1rem; margin: 0 auto; }
.tournament-hero, .standings-panel, .fixtures-panel { color: var(--app-text); background: var(--app-panel); border: 1px solid var(--app-panel-border); border-radius: .9rem; box-shadow: 0 1rem 3rem rgba(0,0,0,.24); }
.tournament-hero { display: flex; align-items: center; justify-content: space-between; gap: 2rem; padding: clamp(1.35rem, 3vw, 2rem); border-top: .35rem solid var(--dart-gold); }
.tournament-kicker, .tournament-section-header > div > span { color: var(--dart-green); font-size: .76rem; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.tournament-hero h1 { margin: .25rem 0; font-size: clamp(1.65rem, 4vw, 2.45rem); font-weight: 850; }
.tournament-hero p { margin: 0; color: var(--app-muted); }
.tournament-progress { min-width: 12rem; display: grid; text-align: right; }
.tournament-progress strong { color: var(--dart-green-dark); font-size: 1.6rem; }
.tournament-progress span { color: var(--app-muted); font-size: .78rem; font-weight: 700; }
.tournament-progress div { height: .45rem; margin-top: .55rem; overflow: hidden; background: #dfe5df; border-radius: 1rem; }
.tournament-progress i { height: 100%; display: block; background: linear-gradient(90deg, var(--dart-green), var(--dart-gold)); }
.standings-panel, .fixtures-panel { padding: clamp(1.1rem, 3vw, 1.65rem); }
.tournament-section-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.tournament-section-header h2 { margin: .15rem 0 0; font-size: 1.35rem; font-weight: 850; }
.tournament-complete { color: #6b4a0d; padding: .45rem .7rem; font-size: .78rem; font-weight: 800; background: #fff1cc; border-radius: 2rem; }
.standings-scroll { overflow-x: auto; }
.standings-table { width: 100%; border-collapse: collapse; }
.standings-table th, .standings-table td { padding: .8rem .7rem; text-align: center; border-bottom: 1px solid rgba(24,55,38,.1); }
.standings-table thead th { color: var(--app-muted); font-size: .72rem; text-transform: uppercase; }
.standings-table th:nth-child(2) { text-align: left; }
.standings-table tbody th { min-width: 10rem; }
.standings-table tbody th .bi { margin-right: .45rem; color: var(--dart-gold); }
.standings-table tr.is-leading { background: linear-gradient(90deg, rgba(224,171,49,.13), transparent); }
.standing-rank { width: 1.8rem; height: 1.8rem; display: inline-flex; align-items: center; justify-content: center; font-weight: 850; background: rgba(28,124,77,.09); border-radius: 50%; }
.standings-note { margin: .8rem 0 0; color: var(--app-muted); font-size: .78rem; }
.fixture-count { color: var(--app-muted); font-size: .82rem; font-weight: 800; }
.fixture-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: .8rem; }
.fixture-card { display: grid; gap: .8rem; padding: 1rem; color: var(--app-text); text-decoration: none; background: #fff; border: 1px solid #d8dfd8; border-radius: .75rem; transition: transform 120ms ease, box-shadow 120ms ease; }
.fixture-card:hover, .fixture-card:focus-visible { color: var(--app-text); transform: translateY(-2px); box-shadow: 0 .7rem 1.5rem rgba(18,92,55,.13); outline: none; }
.fixture-card.is-finished { background: #fafbf9; }
.fixture-heading, .fixture-action { display: flex; align-items: center; justify-content: space-between; color: var(--app-muted); font-size: .76rem; font-weight: 800; }
.fixture-players { display: grid; grid-template-columns: minmax(0,1fr) auto minmax(0,1fr); gap: .6rem; align-items: center; }
.fixture-players strong:last-child { text-align: right; }
.fixture-players span { color: var(--app-muted); font-size: .72rem; text-transform: uppercase; }
.fixture-players .is-winner { color: var(--dart-green-dark); }
.fixture-players .bi { margin-left: .3rem; color: var(--dart-green); }
.fixture-action { color: var(--dart-green-dark); border-top: 1px solid rgba(24,55,38,.09); padding-top: .65rem; }
.match-leg-score { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .8rem; margin-bottom: 1rem; }
.match-leg-score article { display: flex; align-items: center; justify-content: space-between; padding: 1rem; background: rgba(28,124,77,.08); border-radius: .75rem; }
.match-leg-score span { font-weight: 800; }
.match-leg-score strong { color: var(--dart-green-dark); font-size: 2rem; }

.login-panel {
    padding: clamp(1.5rem, 4vw, 2.75rem);
}

.login-panel::before,
.logged-in-panel::before,
.match-start-panel::before {
    position: absolute;
    inset: 0 0 auto;
    height: 0.35rem;
    content: "";
    background: linear-gradient(90deg, var(--dart-green), var(--dart-gold), var(--dart-red));
}

.login-panel-header,
.logged-in-panel-header,
.match-start-panel-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.75rem;
}

.login-panel-icon,
.logged-in-panel-icon,
.match-start-panel-icon {
    width: 3.25rem;
    height: 3.25rem;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    background: var(--dart-green);
    border-radius: 0.75rem;
    box-shadow: inset 0 -0.25rem 0 rgba(0, 0, 0, 0.16);
}

.login-panel-icon .bi,
.logged-in-panel-icon .bi,
.match-start-panel-icon .bi {
    font-size: 1.65rem;
}

.login-panel h1,
.logged-in-panel h1,
.match-start-panel h1 {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 800;
    line-height: 1.12;
    letter-spacing: 0;
}

.login-panel p,
.logged-in-panel p,
.match-list-panel p,
.match-start-panel p {
    margin: 0.35rem 0 0;
    color: var(--app-muted);
}

.login-alert {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.85rem;
    align-items: start;
    margin-bottom: 1.25rem;
    padding: 1rem 1.1rem;
    color: #5b191d;
    background: #fff2f2;
    border: 1px solid rgba(184, 50, 58, 0.3);
    border-radius: 0.75rem;
}

.login-alert .bi {
    margin-top: 0.15rem;
    color: var(--dart-red);
}

.login-alert strong {
    display: block;
    margin-bottom: 0.25rem;
}

.login-alert-message {
    display: block;
    line-height: 1.45;
}

.login-form {
    display: grid;
    gap: 1.1rem;
}

.login-form .form-label {
    color: #303930;
    font-weight: 700;
}

.login-form .form-control {
    min-height: 3.35rem;
    color: var(--app-text);
    background-color: #ffffff;
    border: 1px solid #cfd8cf;
    border-radius: 0.7rem;
}

.login-form .form-control:focus {
    border-color: var(--dart-green);
    box-shadow: 0 0 0 0.25rem rgba(28, 124, 77, 0.18);
}

.btn-dart {
    min-height: 3.35rem;
    width: 100%;
    color: #ffffff;
    font-weight: 800;
    background: linear-gradient(180deg, #218b58, var(--dart-green-dark));
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 0.75rem;
    box-shadow: 0 0.75rem 1.4rem rgba(18, 92, 55, 0.28);
}

.btn-dart:hover,
.btn-dart:focus {
    color: #ffffff;
    background: linear-gradient(180deg, #269b64, #146b40);
}

.logged-in-panel {
    padding: clamp(1.5rem, 4vw, 2.25rem);
}

.dashboard-layout {
    display: grid;
    gap: 1rem;
}

.dashboard-actions {
    display: grid;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.match-list-panel {
    padding: clamp(1.25rem, 3vw, 1.6rem);
}

.match-list-panel h2 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 800;
    line-height: 1.2;
}

.match-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(24, 55, 38, 0.12);
}

.match-list-count {
    min-width: 2rem;
    height: 2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 0.82rem;
    font-weight: 800;
    background: var(--dart-green);
    border-radius: 999px;
}

.match-list {
    display: grid;
    margin: 0 -0.55rem -0.55rem;
    padding-top: 0.45rem;
}

.match-list-item {
    min-height: 5.5rem;
    display: grid;
    grid-template-columns: 4.25rem minmax(0, 1fr) auto;
    gap: 1rem;
    align-items: center;
    padding: 0.85rem 0.75rem;
    color: var(--app-text);
    text-decoration: none;
    border-radius: 0.75rem;
    transition: background-color 120ms ease, transform 120ms ease;
}

.match-list-item + .match-list-item {
    border-top: 1px solid rgba(24, 55, 38, 0.1);
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}

.match-list-item:hover,
.match-list-item:focus-visible {
    color: var(--app-text);
    background: rgba(28, 124, 77, 0.08);
    outline: none;
    transform: translateX(0.15rem);
}

.match-list-item:focus-visible {
    box-shadow: inset 0 0 0 2px var(--dart-green);
}

.match-list-date {
    display: grid;
    justify-items: center;
    padding: 0.55rem 0.4rem;
    color: var(--dart-green-dark);
    background: rgba(28, 124, 77, 0.09);
    border-radius: 0.65rem;
}

.match-list-date span {
    font-size: 0.92rem;
    font-weight: 850;
}

.match-list-date small {
    color: var(--app-muted);
    font-size: 0.72rem;
    font-weight: 700;
}

.match-list-details {
    min-width: 0;
    display: grid;
    gap: 0.4rem;
}

.match-list-title-row,
.match-list-players,
.match-list-rules {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
}

.match-list-title-row strong {
    font-size: 1rem;
    font-weight: 850;
}

.match-status {
    padding: 0.16rem 0.48rem;
    font-size: 0.68rem;
    font-weight: 850;
    line-height: 1.35;
    text-transform: uppercase;
    letter-spacing: 0.035em;
    border-radius: 999px;
}

.match-status.is-active {
    color: #ffffff;
    background: var(--dart-green);
}

.match-status.is-finished {
    color: #5e4811;
    background: rgba(208, 163, 51, 0.24);
}

.match-status.is-cancelled {
    color: #6b3539;
    background: rgba(184, 50, 58, 0.14);
}

.match-list-players span {
    max-width: 15rem;
    overflow: hidden;
    color: #344239;
    font-size: 0.9rem;
    font-weight: 750;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.match-list-players span + span::before {
    margin-right: 0.45rem;
    color: #a7b0a9;
    content: "vs";
}

.match-list-players .is-winner {
    color: #71560f;
}

.match-list-players .bi {
    margin-right: 0.2rem;
    color: #b58613;
    font-size: 0.75rem;
}

.match-list-rules {
    color: var(--app-muted);
    font-size: 0.76rem;
    font-weight: 700;
}

.match-list-rules span + span::before {
    margin-right: 0.45rem;
    content: "·";
}

.match-list-chevron {
    color: rgba(35, 62, 45, 0.45);
    font-size: 1.15rem;
}

.match-list-empty {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.85rem;
    align-items: center;
    padding: 1.5rem 0.35rem 0.35rem;
    color: var(--app-muted);
}

.match-list-empty > .bi {
    font-size: 1.65rem;
    color: var(--dart-green);
}

.match-list-empty strong,
.match-list-empty span {
    display: block;
}

.match-list-empty strong {
    color: var(--app-text);
}

.match-list-empty span {
    margin-top: 0.15rem;
    font-size: 0.88rem;
}

.match-start-layout {
    display: grid;
    gap: 1rem;
}

.page-back-link {
    width: fit-content;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: rgba(248, 250, 247, 0.72);
    font-weight: 700;
    text-decoration: none;
}

.page-back-link:hover,
.page-back-link:focus {
    color: #ffffff;
}

.match-start-panel {
    padding: clamp(1.5rem, 4vw, 2.5rem);
}

.match-start-form {
    display: grid;
    gap: 1.5rem;
}

.match-form-alert {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.8rem;
    margin-bottom: 1.5rem;
    padding: 0.9rem 1rem;
    color: #5b191d;
    background: #fff2f2;
    border: 1px solid rgba(184, 50, 58, 0.3);
    border-radius: 0.75rem;
}

.match-form-alert .bi {
    margin-top: 0.12rem;
    color: var(--dart-red);
}

.match-form-alert strong,
.match-form-alert span {
    display: block;
}

.match-form-section {
    min-width: 0;
    margin: 0;
    padding: 1.15rem;
    background: rgba(23, 32, 25, 0.045);
    border: 1px solid rgba(23, 32, 25, 0.12);
    border-radius: 0.85rem;
}

.match-form-section legend {
    width: auto;
    float: none;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin: 0 0 1rem;
    padding: 0;
    color: #253027;
    font-size: 1.05rem;
    font-weight: 800;
}

.match-form-step {
    width: 1.85rem;
    height: 1.85rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    background: var(--dart-green);
    border-radius: 50%;
    font-size: 0.88rem;
}

.match-rules-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.match-rule-label,
.match-participant .form-label {
    display: block;
    margin-bottom: 0.45rem;
    color: #39443b;
    font-size: 0.86rem;
    font-weight: 800;
}

.match-choice-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem;
}

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

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

.match-choice span {
    min-height: 4.25rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0.75rem 0.9rem;
    color: #334037;
    background: #ffffff;
    border: 2px solid #d7ded7;
    border-radius: 0.7rem;
    transition: border-color 120ms ease, box-shadow 120ms ease, background-color 120ms ease;
}

.match-choice strong {
    font-size: 1rem;
}

.match-choice small {
    margin-top: 0.1rem;
    color: var(--app-muted);
    font-size: 0.76rem;
}

.match-choice input:checked + span {
    color: var(--dart-green-dark);
    background: #f2faf5;
    border-color: var(--dart-green);
    box-shadow: inset 0 0 0 1px var(--dart-green);
}

.match-choice input:focus-visible + span {
    box-shadow: 0 0 0 0.25rem rgba(28, 124, 77, 0.2);
}

.match-choice input[aria-invalid="true"] + span {
    border-color: var(--dart-red);
}

.match-section-help {
    margin: -0.5rem 0 1rem !important;
    font-size: 0.88rem;
}

.match-participant-list {
    display: grid;
    gap: 0.75rem;
}

.match-participant {
    padding: 0.9rem;
    background: #ffffff;
    border: 1px solid #d8dfd8;
    border-radius: 0.75rem;
}

.match-participant-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.65rem;
}

.match-player-number {
    color: #263229;
    font-weight: 800;
}

.match-player-remove {
    min-height: 2.25rem;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.55rem;
    color: #7f252b;
    background: transparent;
    border: 0;
    border-radius: 0.45rem;
    font-size: 0.82rem;
    font-weight: 700;
}

.match-player-remove:hover,
.match-player-remove:focus-visible {
    color: #5b191d;
    background: #fff0f1;
}

.match-player-remove:disabled {
    visibility: hidden;
}

.match-participant-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.8rem;
    align-items: start;
}

.match-participant .form-control,
.match-participant .form-select {
    min-height: 3rem;
    color: var(--app-text);
    background-color: #ffffff;
    border-color: #cbd5cc;
    border-radius: 0.65rem;
}

.match-participant .form-control:focus,
.match-participant .form-select:focus {
    border-color: var(--dart-green);
    box-shadow: 0 0 0 0.22rem rgba(28, 124, 77, 0.16);
}

.match-participant [aria-invalid="true"] {
    border-color: var(--dart-red);
}

.match-save-player {
    margin-top: 0.5rem;
}

.match-save-player .form-check-input:checked {
    background-color: var(--dart-green);
    border-color: var(--dart-green);
}

.match-field-error {
    margin-top: 0.35rem;
    color: #8c252d;
    font-size: 0.82rem;
    font-weight: 700;
}

.match-add-player {
    min-height: 3rem;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
    color: var(--dart-green-dark);
    background: rgba(28, 124, 77, 0.06);
    border: 1px dashed rgba(28, 124, 77, 0.5);
    border-radius: 0.7rem;
    font-weight: 800;
}

.match-add-player:hover,
.match-add-player:focus-visible {
    background: rgba(28, 124, 77, 0.12);
    border-color: var(--dart-green);
}

.match-start-submit {
    justify-self: end;
    width: min(100%, 20rem);
}

.match-play-layout {
    display: grid;
    gap: 0.75rem;
}

.match-play-page {
    align-items: start;
    padding: 0.85rem 0 1.5rem;
}

.match-play-container {
    max-width: 92rem;
    padding-right: clamp(0.75rem, 2vw, 1.5rem);
    padding-left: clamp(0.75rem, 2vw, 1.5rem);
}

.match-play-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    min-height: 2.5rem;
}

.match-play-meta {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    color: rgba(248, 250, 247, 0.74);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.035em;
    text-transform: uppercase;
}

.match-play-meta span {
    padding: 0.32rem 0.55rem;
    background: rgba(255, 255, 255, 0.075);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 999px;
}

.live-scoreboard {
    position: sticky;
    z-index: 5;
    top: 0.5rem;
    padding: 0.55rem;
    background: rgba(10, 15, 11, 0.94);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 0.85rem;
    box-shadow: 0 0.9rem 2.2rem rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(14px);
}

.live-scoreboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
    gap: 0.5rem;
}

.live-score-card {
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
    gap: 0.1rem 0.65rem;
    align-items: center;
    padding: 0.65rem 0.75rem;
    color: #dce4dd;
    background: #18221a;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0.65rem;
}

.live-score-card.is-current {
    color: #ffffff;
    background: linear-gradient(145deg, #218b58, var(--dart-green-dark));
    border-color: rgba(255, 255, 255, 0.42);
    box-shadow: inset 0 -0.25rem 0 rgba(0, 0, 0, 0.13), 0 0 0 2px rgba(226, 184, 70, 0.35);
}

.live-score-card.is-winner {
    color: #332806;
    background: linear-gradient(145deg, #f4d777, var(--dart-gold));
    border-color: #ffeaa8;
}

.live-score-card-name {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-weight: 800;
}

.live-score-card-name > span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.live-score-position {
    width: 1.55rem;
    height: 1.55rem;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: inherit;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    font-size: 0.72rem;
}

.live-score-points {
    grid-row: 1 / 3;
    grid-column: 2;
    font-size: clamp(2rem, 4vw, 3.25rem);
    font-variant-numeric: tabular-nums;
    font-weight: 900;
    line-height: 0.95;
    letter-spacing: -0.05em;
}

.live-score-status {
    grid-column: 1;
    padding-left: 2rem;
    color: rgba(220, 228, 221, 0.6);
    font-size: 0.67rem;
    font-weight: 800;
    letter-spacing: 0.055em;
    text-transform: uppercase;
}

.is-current .live-score-status,
.is-winner .live-score-status {
    color: inherit;
    opacity: 0.78;
}

.turn-entry-panel,
.match-state-panel {
    color: var(--app-text);
    background: var(--app-panel);
    border: 1px solid var(--app-panel-border);
    border-radius: 0.85rem;
    box-shadow: 0 1.2rem 3rem rgba(0, 0, 0, 0.28);
}

.turn-entry-panel {
    padding: clamp(1rem, 2.2vw, 1.5rem);
}

.turn-entry-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.turn-entry-header > div:first-child {
    display: flex;
    flex-wrap: wrap;
    gap: 0.15rem 0.65rem;
    align-items: baseline;
}

.turn-entry-kicker {
    display: block;
    color: var(--dart-green-dark);
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.turn-entry-header h2,
.match-state-panel h2 {
    margin: 0;
    font-size: clamp(1.2rem, 2vw, 1.55rem);
    font-weight: 900;
    line-height: 1.05;
}

.turn-entry-round {
    color: var(--app-muted);
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.045em;
}

.score-mode-switch {
    display: inline-grid;
    grid-template-columns: repeat(2, 1fr);
    padding: 0.25rem;
    background: #e4eae4;
    border-radius: 0.65rem;
}

.score-mode-button {
    min-height: 2.7rem;
    padding: 0.45rem 0.9rem;
    color: #5e685f;
    background: transparent;
    border: 0;
    border-radius: 0.5rem;
    font-size: 0.82rem;
    font-weight: 800;
}

.score-mode-button.is-active {
    color: var(--dart-green-dark);
    background: #ffffff;
    box-shadow: 0 0.25rem 0.75rem rgba(23, 32, 25, 0.12);
}

.turn-entry-form {
    display: grid;
    grid-template-columns: minmax(10.5rem, 0.32fr) minmax(30rem, 1.68fr);
    gap: 0.9rem;
    align-items: stretch;
}

.turn-score-display {
    grid-row: 1;
    grid-column: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.85rem;
    color: #ffffff;
    text-align: center;
    background:
        radial-gradient(circle at top right, rgba(226, 184, 70, 0.16), transparent 42%),
        #172019;
    border-radius: 0.75rem;
}

.turn-score-input::placeholder {
    color: rgba(255, 255, 255, 0.22);
    opacity: 1;
}

.turn-score-label {
    color: rgba(255, 255, 255, 0.62);
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.turn-score-input {
    width: 100%;
    min-width: 0;
    margin: 0.15rem 0;
    padding: 0;
    color: #ffffff;
    background: transparent;
    border: 0;
    border-bottom: 2px solid rgba(255, 255, 255, 0.18);
    border-radius: 0;
    outline: none;
    font-size: clamp(3.5rem, 6vw, 5rem);
    font-variant-numeric: tabular-nums;
    font-weight: 900;
    line-height: 1;
    letter-spacing: -0.06em;
    text-align: center;
}

.turn-score-actions {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.35rem;
    margin-top: 0.35rem;
}

.turn-score-actions button {
    min-height: 2.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    color: rgba(255, 255, 255, 0.62);
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.11);
    border-radius: 0.45rem;
    font-size: 0.68rem;
    font-weight: 800;
}

.turn-score-actions button:hover,
.turn-score-actions button:focus-visible {
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.35);
}

.turn-score-input:focus {
    border-bottom-color: var(--dart-gold);
}

.turn-score-input[aria-invalid="true"] {
    border-bottom-color: var(--dart-red);
}

.turn-score-feedback {
    min-height: 2.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.76rem;
    line-height: 1.25;
}

.turn-score-feedback.is-checkout {
    color: #f6d978;
}

.turn-score-feedback.is-bust,
.turn-score-error {
    color: #ff9ca3;
}

.score-entry-mode {
    grid-row: 1;
    grid-column: 2;
    min-width: 0;
    padding: 0.65rem;
    background: #edf1ed;
    border: 1px solid #d8ded8;
    border-radius: 0.75rem;
}

.score-keypad {
    height: 100%;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.4rem;
}

.score-key {
    min-height: 3.25rem;
    color: #263229;
    background: #ffffff;
    border: 1px solid #cfd8cf;
    border-radius: 0.6rem;
    box-shadow: 0 0.18rem 0 rgba(23, 32, 25, 0.1);
    font-size: 1.15rem;
    font-weight: 900;
}

.score-key:hover,
.score-key:focus-visible,
.dart-number:hover,
.dart-number:focus-visible,
.dart-special:hover,
.dart-special:focus-visible {
    color: var(--dart-green-dark);
    background: #f2faf5;
    border-color: var(--dart-green);
}

.score-key:active,
.dart-number:active,
.dart-special:active {
    transform: translateY(1px);
    box-shadow: none;
}

.score-key-action {
    color: #667065;
    font-size: 0.78rem;
}

.score-key-confirm {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    color: #ffffff;
    background: linear-gradient(180deg, #24945e, var(--dart-green-dark));
    border-color: var(--dart-green-dark);
}

.score-key-confirm:hover,
.score-key-confirm:focus-visible {
    color: #ffffff;
    background: linear-gradient(180deg, #2aa56b, #146b40);
}

.score-key-confirm:disabled {
    cursor: not-allowed;
    filter: grayscale(0.45);
    opacity: 0.48;
}

.dart-entry-slots {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.4rem;
    margin-bottom: 0.5rem;
}

.dart-entry-slot {
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    min-height: 2.65rem;
    padding: 0.35rem 0.45rem;
    color: #6a746b;
    background: #ffffff;
    border: 1px dashed #bdc8be;
    border-radius: 0.55rem;
}

.dart-entry-slot small {
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
}

.dart-entry-slot strong {
    color: #263229;
    font-size: 1rem;
}

.dart-entry-slot.has-value {
    color: var(--dart-green-dark);
    background: #f3faf5;
    border-style: solid;
    border-color: rgba(28, 124, 77, 0.42);
}

.checkout-guide {
    grid-row: 2;
    grid-column: 1 / -1;
    min-height: 2.6rem;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 0.35rem 0.75rem;
    align-items: center;
    padding: 0.35rem 0.15rem 0;
    color: var(--app-muted);
    border-top: 1px solid rgba(24, 55, 38, 0.12);
}

.checkout-guide-label {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: #687269;
    font-size: 0.64rem;
    font-weight: 900;
    letter-spacing: 0.065em;
    text-transform: uppercase;
}

.checkout-guide strong {
    min-width: 0;
    overflow: hidden;
    color: #7a837b;
    font-size: 0.88rem;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.checkout-guide small {
    color: #7a837b;
    font-size: 0.64rem;
    font-weight: 700;
    white-space: nowrap;
}

.checkout-guide.has-route strong {
    color: var(--dart-green-dark);
}

.checkout-guide.has-route .checkout-guide-label {
    color: #765c19;
}

.dart-multiplier-switch {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.4rem;
    margin-bottom: 0.5rem;
}

.dart-multiplier {
    min-height: 2.65rem;
    color: #59635a;
    background: #dde4de;
    border: 1px solid transparent;
    border-radius: 0.55rem;
    font-size: 0.76rem;
    font-weight: 900;
    text-transform: uppercase;
}

.dart-multiplier.is-active {
    color: #ffffff;
    background: var(--dart-green);
    border-color: var(--dart-green-dark);
}

.dart-number-grid {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 0.32rem;
}

.dart-number,
.dart-special {
    min-height: 2.65rem;
    padding: 0.2rem;
    color: #263229;
    background: #ffffff;
    border: 1px solid #cdd6ce;
    border-radius: 0.5rem;
    box-shadow: 0 0.12rem 0 rgba(23, 32, 25, 0.1);
    font-size: 0.82rem;
    font-weight: 900;
}

.dart-special-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.35rem;
    margin-top: 0.5rem;
}

.dart-special-action {
    color: #6c2a30;
}

.dart-number:disabled,
.dart-special:disabled,
.dart-multiplier:disabled {
    cursor: not-allowed;
    opacity: 0.42;
}

.turn-confirm-button {
    min-height: 3.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    padding: 1rem;
    color: #ffffff;
    background: linear-gradient(180deg, #24945e, var(--dart-green-dark));
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 0.75rem;
    box-shadow: 0 0.7rem 1.3rem rgba(18, 92, 55, 0.25);
    font-size: 1rem;
    font-weight: 900;
}

.dart-confirm-button {
    width: 100%;
    margin-top: 0.5rem;
}

.turn-confirm-button:hover,
.turn-confirm-button:focus-visible {
    color: #ffffff;
    background: linear-gradient(180deg, #2aa56b, #146b40);
}

.turn-confirm-button:disabled {
    cursor: not-allowed;
    filter: grayscale(0.5);
    opacity: 0.58;
}

.match-state-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    min-height: 15rem;
    padding: 2rem;
    text-align: left;
}

.match-state-panel p {
    margin: 0.4rem 0 0;
    color: var(--app-muted);
}

.match-state-icon {
    width: 4rem;
    height: 4rem;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    background: var(--dart-green);
    border-radius: 0.85rem;
    font-size: 1.8rem;
}

.match-finished-panel .match-state-icon {
    color: #392d08;
    background: var(--dart-gold);
}

.error-panel {
    width: min(100%, 28rem);
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: clamp(1.5rem, 4vw, 2rem);
    color: var(--app-text);
    background: var(--app-panel);
    border: 1px solid var(--app-panel-border);
    border-radius: 0.85rem;
    box-shadow: 0 1.5rem 4rem rgba(0, 0, 0, 0.32);
}

.error-panel-icon {
    width: 3.25rem;
    height: 3.25rem;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    background: var(--dart-red);
    border-radius: 0.75rem;
}

.error-panel h1 {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 800;
    line-height: 1;
}

.error-panel p {
    margin: 0.35rem 0 0;
    color: var(--app-muted);
}

@media (orientation: landscape) and (min-width: 768px) {
    .login-page,
    .logged-in-page,
    .match-start-page,
    .match-play-page,
    .tournament-page,
    .error-page {
        padding: 2rem 0 3rem;
    }

    .match-play-page {
        padding: 0.75rem 0 1.25rem;
    }
}

@media (max-width: 991.98px) {
    .turn-entry-form {
        grid-template-columns: minmax(10rem, 0.4fr) minmax(22rem, 1.6fr);
    }

    .checkout-guide {
        grid-row: 2;
    }
}

@media (max-width: 575.98px) {
    :root {
        --app-header-height: 4rem;
    }

    .app-brand {
        font-size: 1.08rem;
    }

    .app-brand-mark {
        width: 2.35rem;
        height: 2.35rem;
    }

    .login-page,
    .logged-in-page,
    .match-start-page,
    .match-play-page,
    .tournament-page,
    .error-page {
        align-items: start;
        padding: 1.25rem 0;
    }

    .login-panel-header,
    .logged-in-panel-header,
    .match-start-panel-header {
        align-items: flex-start;
    }

    .match-rules-grid,
    .match-participant-fields {
        grid-template-columns: 1fr;
    }

    .tournament-hero { align-items: stretch; flex-direction: column; }
    .tournament-progress { text-align: left; }
    .fixture-grid { grid-template-columns: 1fr; }

    .match-form-section {
        padding: 0.9rem;
    }

    .match-player-remove span {
        display: none;
    }

    .match-start-submit {
        width: 100%;
    }

    .match-play-toolbar,
    .turn-entry-header {
        align-items: stretch;
        flex-direction: column;
    }

    .match-play-meta {
        flex-wrap: wrap;
    }

    .live-scoreboard-grid {
        grid-auto-columns: minmax(8.75rem, 1fr);
        grid-auto-flow: column;
        grid-template-columns: none;
        overflow-x: auto;
        scrollbar-width: thin;
    }

    .live-score-points {
        grid-row: 2;
        grid-column: 1;
        font-size: 2.35rem;
    }

    .live-score-card {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
        gap: 0.2rem;
        justify-items: center;
        text-align: center;
    }

    .live-score-card-name {
        justify-content: center;
        width: 100%;
    }

    .live-score-status {
        grid-column: 1;
        padding-left: 0;
    }

    .score-mode-switch,
    .turn-entry-form {
        grid-template-columns: 1fr;
    }

    .turn-score-display {
        grid-row: 1;
        grid-column: 1;
    }

    .score-entry-mode {
        grid-row: 2;
        grid-column: 1;
    }

    .turn-confirm-button {
        min-height: 3.6rem;
    }

    .dart-number-grid {
        grid-template-columns: repeat(5, 1fr);
    }

    .checkout-guide {
        grid-row: 3;
        grid-template-columns: 1fr;
        gap: 0.25rem;
    }

    .checkout-guide strong {
        white-space: normal;
    }

    .checkout-guide small {
        width: fit-content;
    }

    .dart-special-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .match-state-panel {
        align-items: flex-start;
        min-height: 12rem;
        padding: 1.25rem;
    }
}
