:root {
    --bg: #ccffcc;
    --panel: #99cc99;
    --panel-light: #ccffcc;
    --panel-hover: #bbffbb;
    --ink: #000000;
    --muted: #333333;
    --link: #000000;
    --link-hover-bg: #b8e0b8;
    --link-hover: #000000;
    --btn-hover-bg: #008000;
    --btn-hover-color: #ffffff;
    --danger-bg: #ff0000;
    --ok-bg: #00ff00;
    --selected: #ff0000;
    --btn-bg: #00ff00;
    --btn-border: #696 #363 #363 #696;
    --font-body: Verdana, sans-serif;
    --font-title: "Kristen ITC", "Comic Sans MS", Verdana, sans-serif;
    --page-max: 1100px;
    --page-gutter: 10px;
    /* Inner tile/panel spacing — match .dash-top padding/gap */
    --chrome-inset: 4px;
    --radius: 6px;
    --radius-sm: 4px;
    --ffb-tab-border: #7aaa7a;
    --ffb-tab-inactive-bg: #bbeebb;
    --ffb-tab-panel-bg: var(--bg);
    --ffb-tab-strip-bg: transparent;
}

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

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font-body);
    font-size: 12pt;
    color: var(--ink);
    background: var(--bg);
}

a {
    color: var(--link);
    text-decoration: underline;
}

a:hover {
    color: var(--link);
    background: transparent;
}

/* Shared table shells + row hover rounding */
.userscore-table-wrap,
.admin-squad-table-wrap,
.ffb-player-tables,
.help-points-wrap {
    border-radius: var(--radius);
}

.userscore-table,
.ffb-profile-table,
.ffb-player-rounds,
table.help-points,
.admin-squad-table {
    border-collapse: separate;
    border-spacing: 0;
}

.userscore-table thead tr:first-child th:first-child,
.ffb-profile-table tr:first-child th:first-child,
.ffb-player-rounds tr:first-child th:first-child,
table.help-points tr:first-child th:first-child,
.admin-squad-table thead tr:first-child th:first-child {
    border-top-left-radius: var(--radius);
}

.userscore-table thead tr:first-child th:last-child,
.ffb-profile-table tr:first-child th:last-child,
.ffb-player-rounds tr:first-child th:last-child,
table.help-points tr:first-child th:last-child,
.admin-squad-table thead tr:first-child th:last-child {
    border-top-right-radius: var(--radius);
}

.userscore-table tbody tr:last-child td:first-child,
.ffb-profile-table tbody tr:last-child td:first-child,
.ffb-player-rounds tbody tr:last-child td:first-child,
table.help-points tbody tr:last-child td:first-child,
.admin-squad-table tbody tr:last-child td:first-child {
    border-bottom-left-radius: var(--radius);
}

.userscore-table tbody tr:last-child td:last-child,
.ffb-profile-table tbody tr:last-child td:last-child,
.ffb-player-rounds tbody tr:last-child td:last-child,
table.help-points tbody tr:last-child td:last-child,
.admin-squad-table tbody tr:last-child td:last-child {
    border-bottom-right-radius: var(--radius);
}

.userscore-table tbody tr:hover td:first-child,
.ffb-profile-table tbody tr:hover td:first-child,
.ffb-player-rounds tbody tr:hover td:first-child,
table.help-points tbody tr:hover td:first-child,
.admin-squad-table tbody tr:hover td:first-child {
    border-top-left-radius: var(--radius-sm);
    border-bottom-left-radius: var(--radius-sm);
}

.userscore-table tbody tr:hover td:last-child,
.ffb-profile-table tbody tr:hover td:last-child,
.ffb-player-rounds tbody tr:hover td:last-child,
table.help-points tbody tr:hover td:last-child,
.admin-squad-table tbody tr:hover td:last-child {
    border-top-right-radius: var(--radius-sm);
    border-bottom-right-radius: var(--radius-sm);
}

/* Shared folder tabs (modals, account, myteam, admin) */
.ffb-tabs,
.ffb-modal-tabs,
.account-tabs,
.myteam-tabs,
.admin-squad-tabs {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 4px;
    margin: 0 0 10px;
    padding: 0;
    border-bottom: 1px solid var(--ffb-tab-border);
    background: var(--ffb-tab-strip-bg);
}

.ffb-tab,
.ffb-modal-tabs a,
.ffb-modal-tabs button,
.account-tab,
.myteam-tab,
.admin-squad-tab {
    appearance: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0 0 -1px;
    padding: 5px 12px;
    border: 1px solid var(--ffb-tab-border);
    border-radius: 4px 4px 0 0;
    background: var(--ffb-tab-inactive-bg);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 10pt;
    font-weight: normal;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
}

.ffb-tab:hover,
.ffb-modal-tabs a:hover,
.ffb-modal-tabs button:hover,
.account-tab:hover,
.myteam-tab:hover,
.admin-squad-tab:hover {
    color: var(--ink);
    background: var(--link-hover-bg);
    text-decoration: none;
}

.ffb-tab.is-active,
.ffb-modal-tabs .is-active,
.account-tab.is-active,
.myteam-tab.is-active,
.admin-squad-tab.is-active {
    background: var(--ffb-tab-panel-bg);
    border-bottom-color: var(--ffb-tab-panel-bg);
    color: var(--ink);
    font-weight: bold;
    text-decoration: none;
    z-index: 1;
}

.ffb-tab.is-active:hover,
.ffb-modal-tabs .is-active:hover,
.account-tab.is-active:hover,
.myteam-tab.is-active:hover,
.admin-squad-tab.is-active:hover {
    background: var(--ffb-tab-panel-bg);
    color: var(--ink);
}

.ffb-flag {
    display: inline-block;
    vertical-align: middle;
    line-height: 1;
}

.ffb-flag-img {
    width: 16px;
    height: 11px;
    object-fit: cover;
}

.ffb-flag-svg {
    width: 16px;
    height: 12px;
    background-image: var(--ffb-flag);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12);
}

.topbar,
.dash-top,
main,
.dash-main,
.foot {
    max-width: var(--page-max);
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
}

/* Align nav/footer chrome with panels inside padded main */
.dash-top,
.topbar {
    width: calc(100% - (2 * var(--page-gutter)));
    max-width: calc(var(--page-max) - (2 * var(--page-gutter)));
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--chrome-inset, 4px);
    background: var(--panel);
    border: 1px solid #7aaa7a;
    border-radius: var(--radius);
    margin-top: 6px;
    gap: var(--chrome-inset, 4px);
}

.brand {
    font-family: var(--font-title);
    font-weight: bold;
    font-size: 16pt;
    color: var(--ink);
    text-decoration: none;
    background: var(--panel-light);
    border: 1px solid #7aaa7a;
    border-radius: var(--radius);
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    line-height: 1.15;
    padding: 2px 4px;
}

.brand img {
    display: block;
    width: 40px;
    height: 40px;
    flex: 0 0 auto;
    object-fit: contain;
}

/* League icon = SoccerSportsfan (40px) + gap + league title (nav label line). */
.brand-icon {
    display: block;
    flex: 0 0 auto;
    line-height: 0;
}

.brand-icon img {
    width: auto;
    height: calc(40px + 2px + 1.15 * 8pt);
    aspect-ratio: 1;
    object-fit: contain;
}

/*
 * Text column mirrors a nav item: 40px “icon” slot + 8pt label.
 * That locks the brand tile to the same height as a nav tile.
 */
.brand-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 2px;
    min-width: 0;
}

.brand-name {
    box-sizing: border-box;
    height: 40px;
    display: flex;
    align-items: center;
    white-space: nowrap;
    line-height: 1;
}

.brand-league {
    display: block;
    font-family: var(--font-body);
    font-size: 8pt;
    font-weight: normal;
    line-height: 1.15;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 14rem;
    min-height: 1.15em;
}

.brand-stacked {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
}

.brand-row {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.brand-row img {
    display: block;
    width: 40px;
    height: 40px;
    flex: 0 0 auto;
    object-fit: contain;
}

.start-page .dash-top,
.dash-top-guest {
    align-items: stretch;
}

.start-page .dash-top-main,
.dash-top-guest .dash-top-main {
    align-items: stretch;
}

.start-page .brand-stacked,
.dash-top-guest .brand-stacked {
    box-sizing: border-box;
    height: 100%;
    min-height: 100%;
    justify-content: center;
    gap: 8px;
    padding-top: 4px;
    padding-bottom: 4px;
}

.start-page .brand-stacked .brand-name,
.dash-top-guest .brand-stacked .brand-name {
    font-size: 18pt;
}

.start-page .brand-row img,
.dash-top-guest .brand-row img {
    width: 48px;
    height: 48px;
}

.start-page .brand-tagline,
.dash-top-guest .brand-tagline {
    white-space: nowrap;
    max-width: none;
    overflow: visible;
    text-overflow: unset;
    font-size: 11pt;
    line-height: 1.35;
}

.brand:hover {
    color: var(--link-hover);
    background: var(--link-hover-bg);
    text-decoration: none;
}

.top-link {
    color: var(--ink);
    font-size: 10pt;
}

main {
    padding: var(--chrome-inset, 4px) var(--page-gutter) 24px;
}

.start-page main {
    padding-top: var(--chrome-inset, 4px);
}

.start-layout {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: var(--chrome-inset, 4px);
    align-items: start;
    margin-top: var(--chrome-inset, 4px);
}

.start-page .start-layout {
    margin-top: 0;
}

.start-layout-solo {
    grid-template-columns: 1fr;
    width: 100%;
    max-width: none;
    margin-left: 0;
    margin-right: 0;
    gap: var(--chrome-inset, 4px);
}

.start-page .start-leagues .start-league-tile {
    cursor: default;
}

.start-page .start-leagues .start-league-tile:hover {
    background: var(--link-hover-bg);
}

.start-page .result-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 2.5rem;
    row-gap: 8px;
    align-items: stretch;
}

.start-page .result-card {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 1px solid #9cc09c;
    border-radius: var(--radius);
    background: var(--panel-light, #ccffcc);
    display: block;
    font-size: inherit;
    cursor: default;
}

.start-page .result-card:hover {
    background: #e0ffe0;
    cursor: default;
}

.start-page .result-card::before,
.start-page .result-card::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 48%;
    background-repeat: no-repeat;
    background-size: contain;
    pointer-events: none;
    z-index: 0;
}

.start-page .result-card::before {
    left: 0;
    background-image: var(--ffb-flag-home);
    background-position: left center;
    -webkit-mask-image: linear-gradient(
        to right,
        rgba(0, 0, 0, 0.5) 0%,
        rgba(0, 0, 0, 0.3) 42%,
        rgba(0, 0, 0, 0) 100%
    );
    mask-image: linear-gradient(
        to right,
        rgba(0, 0, 0, 0.5) 0%,
        rgba(0, 0, 0, 0.3) 42%,
        rgba(0, 0, 0, 0) 100%
    );
}

.start-page .result-card::after {
    right: 0;
    background-image: var(--ffb-flag-away);
    background-position: right center;
    -webkit-mask-image: linear-gradient(
        to left,
        rgba(0, 0, 0, 0.5) 0%,
        rgba(0, 0, 0, 0.3) 42%,
        rgba(0, 0, 0, 0) 100%
    );
    mask-image: linear-gradient(
        to left,
        rgba(0, 0, 0, 0.5) 0%,
        rgba(0, 0, 0, 0.3) 42%,
        rgba(0, 0, 0, 0) 100%
    );
}

.start-page .result-meta {
    position: relative;
    z-index: 1;
    padding: 0 10px 4px;
    font-size: 8pt;
    line-height: 1.2;
    color: var(--muted, #333);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.start-page .result-row {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    gap: 2px 10px;
    align-items: center;
    padding: 2px 10px 4px;
    min-height: 0;
    box-sizing: border-box;
}

.start-page .result-row .home,
.start-page .result-row .away {
    display: flex;
    align-items: center;
    min-width: 0;
}

.start-page .result-row .home {
    justify-content: flex-end;
    text-align: right;
}

.start-page .result-row .away {
    justify-content: flex-start;
    text-align: left;
}

.start-page .result-row .match-team-name {
    font-size: 11pt;
    font-weight: normal;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.start-page .result-row .score {
    justify-self: center;
    min-width: 4.25rem;
    font-size: 12pt;
    font-weight: normal;
    font-variant-numeric: tabular-nums;
    line-height: 1.15;
    text-align: center;
    white-space: nowrap;
}

.start-page .result-row .score-final {
    display: block;
}

.start-page .result-row .score-reg {
    display: block;
    margin-left: 0;
    font-size: 9pt;
    font-weight: normal;
    color: #4a6a4a;
}

.start-page .result-row .score-hint {
    font-size: 9pt;
    font-weight: normal;
}

.start-col {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}

.hero-copy {
    background: var(--panel);
    border: 1px solid #7aaa7a;
    border-radius: var(--radius);
    padding: 12px;
}

.brand-mark {
    font-family: var(--font-title);
    font-size: 20pt;
    margin: 0 0 8px;
    text-align: center;
}

.hero-copy h1 {
    font-family: var(--font-body);
    font-size: 14pt;
    margin: 0 0 8px;
    text-align: center;
}

.lede {
    margin: 0 0 12px;
    font-size: 11pt;
    text-align: center;
    color: var(--muted);
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.btn {
    display: inline-block;
    border: 2px outset;
    border-color: var(--btn-border);
    border-radius: 0;
    padding: 4px 12px;
    font-family: var(--font-body);
    font-size: 10pt;
    font-weight: bold;
    text-decoration: none;
    cursor: pointer;
    background: var(--btn-bg);
    color: var(--ink);
}

.btn:hover {
    background: #66ff66;
    color: var(--ink);
}

.btn-ghost {
    background: var(--panel-light);
}

.btn-block {
    width: 100%;
}

.login-panel .btn {
    margin-top: 2px;
}

.login-panel {
    background: var(--panel);
    border: 1px solid #7aaa7a;
    border-radius: var(--radius);
    padding: 10px;
    color: var(--ink);
}

.login-panel h2 {
    margin: 0 0 8px;
    font-size: 16pt;
    text-align: center;
    font-family: var(--font-body);
}

.login-panel label {
    display: block;
    margin-bottom: 6px;
    font-size: 10pt;
    text-align: left;
}

.login-panel label[hidden] {
    display: none !important;
}

.login-panel label span {
    display: block;
    margin-bottom: 2px;
    font-weight: bold;
    text-align: left;
}

.login-panel input[type="text"],
.login-panel input[type="password"],
.login-panel input[type="email"] {
    display: block;
    width: 100%;
    max-width: 220px;
    padding: 2px 4px;
    border: 1px solid #666;
    font-family: var(--font-body);
    font-size: 10pt;
    background: #fff;
    color: var(--ink);
}

.login-panel input:focus {
    outline: 1px solid #008000;
}

.login-links {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin: 8px 0 0;
    font-size: 9pt;
}

.login-links a,
.linkish {
    color: var(--ink);
    background: none;
    border: 0;
    padding: 0;
    font: inherit;
    cursor: pointer;
    text-decoration: underline;
}

.login-links a:hover,
.linkish:hover {
    color: var(--link);
    background: transparent;
}

.feedback {
    margin-bottom: 8px;
    padding: 5px;
    font-size: 10pt;
    width: 90%;
    margin-left: auto;
    margin-right: auto;
    border-radius: var(--radius-sm);
}

.feedback-error {
    background: var(--danger-bg);
    color: var(--ink);
}

.feedback-ok {
    background: var(--ok-bg);
    color: var(--ink);
}

.below h2,
.stats h2 {
    margin: 0 0 8px;
    font-size: 12pt;
    font-family: var(--font-body);
}

.start-page .results .section-head {
    margin-bottom: 8px;
}

.results,
.stats {
    background: var(--panel);
    border: 1px solid #7aaa7a;
    border-radius: var(--radius);
    padding: 10px;
}

.result-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.result-list li {
    display: grid;
    grid-template-columns: 5.2rem 1fr auto 1fr;
    gap: 6px;
    align-items: center;
    padding: 4px 0;
    border-bottom: 1px solid #7aaa7a;
    font-size: 10pt;
}

.result-list time {
    color: var(--muted);
    font-size: 9pt;
}

.result-list .side {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
}

.result-list .side:last-child,
.result-list .side-guest {
    justify-content: flex-end;
    text-align: right;
}

.score {
    font-weight: bold;
    text-align: center;
    white-space: nowrap;
}

.score .score-final,
.score .score-reg {
    display: inline;
}

.score .score-reg {
    margin-left: 4px;
    font-weight: normal;
    font-size: 9pt;
}

.score .score-hint {
    font-weight: normal;
    font-size: 8pt;
}

/* Shared side-panel match list (Aufstellung / Mannschaft / Top&Flop / Rangliste) */
.match-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 3px;
}

.match-list > li {
    display: block;
    padding: 0;
    margin: 0;
    border: 1px solid #9cc09c;
    border-radius: var(--radius, 4px);
    background: #ccffcc;
    overflow: hidden;
    font-size: 9pt;
}

.match-list > li:hover {
    background: #e0ffe0;
}

.match-list .match-list-row {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 4px 6px;
    align-items: center;
    padding: 2px 4px;
    background: #ccffcc;
    width: 100%;
    box-sizing: border-box;
}

.match-list .match-list-row--clickable {
    appearance: none;
    border: 0;
    margin: 0;
    font: inherit;
    color: inherit;
    text-align: inherit;
    cursor: pointer;
}

.match-list .match-list-row--clickable:hover,
.match-list > li:hover > .match-list-row {
    background: #e0ffe0;
}

.match-list .match-list-row--clickable:focus-visible {
    outline: 2px solid #336633;
    outline-offset: -2px;
}

.match-list .home {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    text-align: right;
    min-width: 0;
}

.match-list .away {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 4px;
    text-align: left;
    min-width: 0;
}

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

.match-list .score {
    font-weight: normal;
    text-align: center;
    min-width: 4.5rem;
    line-height: 1.15;
}

.match-list .score a {
    color: inherit;
    text-decoration: underline;
}

.match-list .score-hint {
    font-size: 7pt;
    font-weight: normal;
}

.match-list .score-reg {
    display: block;
    font-size: 7pt;
    font-weight: normal;
    color: var(--muted);
}

.match-list .score-kickoff-date {
    display: block;
}

.match-list .score-kickoff-time {
    display: block;
    font-size: 7pt;
    font-weight: normal;
    color: var(--muted);
    text-align: center;
}

.match-list img {
    width: 16px;
    height: 11px;
    flex-shrink: 0;
}

.stats dl {
    margin: 0;
}

.stats dl > div {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 3px 0;
    border-bottom: 1px solid #7aaa7a;
    font-size: 10pt;
}

.stats dt {
    color: var(--muted);
}

.stats dd {
    margin: 0;
    font-weight: bold;
}

.leagues {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 9pt;
}

.muted {
    color: var(--muted);
    font-size: 10pt;
}

.foot {
    padding: 8px 10px 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    justify-content: space-between;
    align-items: center;
    font-size: 9pt;
    color: var(--muted);
}

.foot-copy,
.foot-links {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 10px;
    align-items: center;
}

.foot-sep {
    opacity: 0.6;
}

.foot a {
    color: var(--ink);
}

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

    .start-page .brand-tagline,
    .dash-top-guest .brand-tagline {
        white-space: normal;
        max-width: 22rem;
    }

    .start-page .result-list {
        grid-template-columns: 1fr;
        column-gap: 0;
    }

    .login-panel input[type="text"],
    .login-panel input[type="password"],
    .login-panel input[type="email"] {
        max-width: none;
    }
}
