:root {
    --navy: #0a2942;
    --navy-2: #103b5d;
    --blue: #176aa0;
    --red: #d62835;
    --red-dark: #ad1c27;
    --gold: #e6a82c;
    --green: #19875b;
    --ink: #17232d;
    --muted: #667684;
    --line: #dce4ea;
    --surface: #ffffff;
    --background: #f2f5f7;
    --soft: #eaf0f4;
    --shadow: 0 10px 30px rgba(10, 41, 66, .09);
    --radius: 16px;
    --radius-sm: 10px;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--ink);
    background: var(--background);
    font-synthesis: none;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-height: 100%; }
body { margin: 0; min-height: 100vh; background: var(--background); }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .48; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: .35rem; font-size: clamp(1.75rem, 3vw, 2.55rem); letter-spacing: -.035em; }
h2 { margin-bottom: 0; font-size: 1.25rem; letter-spacing: -.02em; }

.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.mobile-only { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.eyebrow {
    margin-bottom: .35rem; color: var(--blue); font-size: .72rem; font-weight: 800;
    letter-spacing: .12em; text-transform: uppercase;
}

.button {
    display: inline-flex; align-items: center; justify-content: center; min-height: 40px;
    padding: .65rem 1rem; border: 1px solid transparent; border-radius: 9px;
    font-size: .86rem; font-weight: 750; line-height: 1; transition: .18s ease;
}
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button.primary { color: #fff; background: var(--red); box-shadow: 0 7px 18px rgba(214, 40, 53, .19); }
.button.primary:hover:not(:disabled) { background: var(--red-dark); }
.button.secondary { color: #fff; background: var(--navy-2); }
.button.secondary:hover:not(:disabled) { background: var(--navy); }
.button.danger { color: #fff; background: var(--red); }
.button.ghost { color: var(--navy); background: #fff; border-color: var(--line); }
.button.danger-outline { color: var(--red); background: #fff; border-color: #efbdc2; }
.button.wide { width: 100%; }
.icon-button, .mini-button {
    display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line);
    color: var(--navy); background: #fff; border-radius: 8px; font-weight: 750;
}
.icon-button { width: 40px; height: 40px; font-size: 1.35rem; }
.mini-button { min-height: 30px; padding: .35rem .55rem; font-size: .75rem; }
.danger-text { color: var(--red) !important; }

.brand-mark {
    position: relative; display: grid; place-items: center; width: 44px; height: 44px;
    flex: 0 0 auto; overflow: hidden; color: #fff; background: var(--red); border-radius: 50% 50% 45% 45%;
    box-shadow: inset 0 -4px 0 rgba(0,0,0,.12), 0 4px 12px rgba(0,0,0,.13);
}
.brand-mark::before, .brand-mark::after {
    content: ''; position: absolute; top: 5px; width: 5px; height: 11px; border-radius: 4px; background: #fff;
}
.brand-mark::before { left: 11px; transform: rotate(-12deg); }
.brand-mark::after { right: 11px; transform: rotate(12deg); }
.brand-mark span { position: relative; z-index: 1; margin-top: 10px; font-size: .67rem; font-weight: 900; letter-spacing: .04em; }
.brand-mark.large { width: 76px; height: 76px; margin: 0 auto 1.1rem; }
.brand-mark.large::before, .brand-mark.large::after { top: 8px; width: 7px; height: 18px; }
.brand-mark.large::before { left: 20px; }
.brand-mark.large::after { right: 20px; }
.brand-mark.large span { margin-top: 15px; font-size: 1.1rem; }

/* Login */
.login-page {
    display: grid; place-items: center; padding: 2rem;
    background: radial-gradient(circle at 20% 10%, #1d5275 0, transparent 35%), linear-gradient(145deg, #071f33, #0b3452 62%, #10273a);
}
.login-shell { width: min(100%, 430px); }
.login-card {
    padding: clamp(2rem, 7vw, 3.5rem); text-align: center; background: rgba(255,255,255,.98);
    border: 1px solid rgba(255,255,255,.45); border-radius: 24px; box-shadow: 0 28px 70px rgba(0,0,0,.3);
}
.login-card h1 { color: var(--navy); }
.login-intro { margin-bottom: 1.8rem; color: var(--muted); }
.stack-form { display: grid; gap: .7rem; text-align: left; }
.stack-form label, .modal > form > label { color: var(--navy); font-size: .84rem; font-weight: 750; }
.stack-form label input, .stack-form label select { margin-top: .42rem; }
input, select {
    width: 100%; min-height: 44px; padding: .65rem .75rem; color: var(--ink); background: #fff;
    border: 1px solid #cbd6de; border-radius: 9px; outline: none; transition: border .15s, box-shadow .15s;
}
input:focus, select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(23,106,160,.13); }
input[type="number"] { appearance: textfield; -moz-appearance: textfield; }
input[type="number"]::-webkit-inner-spin-button, input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.alert { padding: .8rem 1rem; margin-bottom: 1rem; border-radius: 9px; font-size: .84rem; line-height: 1.4; }
.alert.error { color: #8d1822; background: #ffeaec; border: 1px solid #f3c3c8; }
.alert.info { color: #114d72; background: #e7f4fb; border: 1px solid #c0dfef; }

/* Topbar and archive */
.topbar {
    position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between;
    min-height: 70px; padding: .7rem 1.35rem; color: #fff; background: var(--navy);
    border-bottom: 3px solid var(--red); box-shadow: 0 5px 18px rgba(10,41,66,.18);
}
.brand-group { display: flex; align-items: center; gap: .75rem; }
.brand-visual { display: grid; place-items: center; width: 52px; height: 48px; flex: 0 0 auto; }
.navbar-logo { display: block; max-width: 52px; max-height: 46px; object-fit: contain; filter: drop-shadow(0 3px 5px rgba(0,0,0,.2)); }
.brand-group strong, .brand-group small { display: block; }
.brand-group strong { font-size: 1.05rem; }
.brand-group small { margin-top: .12rem; color: #b9cfdd; font-size: .72rem; }
.top-actions { display: flex; align-items: center; gap: .6rem; }
.topbar .topbar-ghost { color: #dce9f1; background: rgba(255,255,255,.07); border-color: rgba(255,255,255,.22); }
.topbar .topbar-ghost:hover { background: rgba(255,255,255,.13); }
.save-state { display: inline-flex; align-items: center; gap: .45rem; margin-right: .4rem; color: #c8d8e3; font-size: .76rem; }
.save-state i { width: 8px; height: 8px; background: #91a7b5; border-radius: 50%; }
.save-state.saved i { background: #57d29b; }
.save-state.loading i { background: var(--gold); animation: pulse 1s infinite; }
.save-state.error { color: #ffc4c9; }
.save-state.error i { background: #ff7180; }
@keyframes pulse { 50% { opacity: .35; transform: scale(.8); } }

.admin-layout { display: grid; grid-template-columns: 320px minmax(0, 1fr); min-height: calc(100vh - 70px); }
.archive-panel {
    position: sticky; top: 70px; align-self: start; height: calc(100vh - 70px); padding: 1.25rem;
    overflow-y: auto; background: #e9eff3; border-right: 1px solid #d2dde5;
}
.archive-head { display: flex; align-items: center; justify-content: space-between; gap: .6rem; margin-bottom: 1rem; }
.archive-buttons{display:flex;gap:.35rem}.archive-buttons .button{padding:.55rem .65rem}
.search-field { display: block; margin-bottom: .85rem; }
.search-field input { min-height: 40px; background: rgba(255,255,255,.85); }
.tournament-list { display: grid; gap: .55rem; }
.tournament-card {
    position: relative; display: flex; align-items: stretch; overflow: hidden; background: rgba(255,255,255,.83);
    border: 1px solid #d5e0e6; border-radius: 11px; transition: .15s;
}
.tournament-card:hover { border-color: #b4c8d5; background: #fff; }
.tournament-card.active { background: #fff; border-color: var(--blue); box-shadow: 0 5px 16px rgba(17,75,112,.12); }
.tournament-card.active::before { content: ''; width: 4px; flex: 0 0 4px; background: var(--red); }
.tournament-open {
    display: grid; flex: 1; gap: .3rem; min-width: 0; padding: .8rem; text-align: left; color: inherit;
    background: transparent; border: 0;
}
.tournament-open strong { overflow: hidden; font-size: .88rem; text-overflow: ellipsis; white-space: nowrap; }
.tournament-open small { color: var(--muted); font-size: .7rem; }
.card-menu { display: flex; align-items: center; gap: .25rem; padding-right: .5rem; }
.card-menu .mini-button { width: 29px; padding: 0; }
.type-badge {
    display: inline-flex; align-items: center; width: fit-content; min-height: 22px; padding: .2rem .5rem;
    color: #145378; background: #dceef8; border-radius: 999px; font-size: .65rem; font-weight: 850;
    letter-spacing: .04em; text-transform: uppercase;
}
.type-badge.ko { color: #9a1b27; background: #fde1e4; }
.type-badge.groups { color: #5b3c00; background: #fff0bd; }
.type-badge.championship { color: #54336f; background: #efe2fa; }
.list-empty, .panel-empty { padding: 1.6rem 1rem; color: var(--muted); text-align: center; font-size: .84rem; }
.storage-note { display: grid; gap: .2rem; padding: .9rem; margin-top: 1rem; color: #506776; border: 1px dashed #b9c8d1; border-radius: 10px; }
.storage-note strong { color: var(--navy); font-size: .75rem; }
.storage-note span { font-size: .7rem; line-height: 1.4; }
.skeleton-card { height: 83px; border-radius: 11px; background: linear-gradient(100deg,#dce5eb 30%,#edf2f5 50%,#dce5eb 70%); background-size: 300% 100%; animation: shimmer 1.4s infinite; }
@keyframes shimmer { to { background-position: -150% 0; } }

/* Main workspace */
.workspace { min-width: 0; padding: clamp(1rem, 2.5vw, 2rem); }
.empty-state {
    display: grid; place-items: center; align-content: center; min-height: calc(100vh - 140px); max-width: 660px;
    margin: auto; text-align: center;
}
.empty-state .empty-icon { display: grid; place-items: center; width: 80px; height: 80px; margin-bottom: 1.4rem; color: #fff; background: var(--navy); border-radius: 24px; transform: rotate(45deg); box-shadow: var(--shadow); }
.empty-state .empty-icon::first-letter { transform: rotate(-45deg); }
.empty-state p:not(.eyebrow) { max-width: 520px; margin-bottom: 1.5rem; color: var(--muted); line-height: 1.6; }
.tournament-header {
    display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem;
}
.header-meta { display: flex; align-items: center; flex-wrap: wrap; gap: .65rem; margin-bottom: .55rem; color: var(--muted); font-size: .73rem; }
.header-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .5rem; }
.panel {
    min-width: 0; padding: 1.15rem; background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius); box-shadow: 0 5px 20px rgba(10,41,66,.045);
}
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.count-pill { padding: .3rem .55rem; color: var(--navy); background: var(--soft); border-radius: 999px; font-size: .7rem; font-weight: 800; white-space: nowrap; }
.dashboard-grid { display: grid; gap: 1rem; align-items: start; }
.classic-grid { grid-template-columns: minmax(250px, .68fr) minmax(420px, 1.6fr); }
.ko-grid { grid-template-columns: minmax(440px, 1.45fr) minmax(270px, .75fr); }
.entry-panel { position: sticky; top: 90px; }
.form-hint { margin: .85rem 0 0; color: var(--muted); font-size: .72rem; line-height: 1.45; }
.classic-create-options { grid-template-columns: repeat(3,minmax(180px,1fr)); margin-bottom: .5rem; }
.toggle-option { display: flex; align-items: center; gap: .45rem; width: fit-content; padding: .5rem .65rem; color: var(--navy); background: #f2f6f8; border-radius: 8px; font-size: .76rem; font-weight: 750; }
.toggle-option input { width: 18px; min-height: 18px; accent-color: var(--red); }
.category-rule-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .45rem; }
.category-rule-grid > div { display: grid; grid-template-columns: minmax(0,1fr) 150px; align-items: center; gap: .4rem; padding: .45rem .55rem; background: #f5f7f8; border-radius: 8px; }
.category-rule-grid label { display: flex; align-items: center; gap: .4rem; font-size: .72rem; }
.category-rule-grid input { width: 17px; min-height: 17px; accent-color: var(--red); }
.category-rule-grid select { min-height: 34px; padding: .3rem .45rem; font-size: .68rem; }
.entry-mode-tabs { display: grid; grid-template-columns: repeat(2,1fr); gap: .35rem; padding: .3rem; margin-bottom: .75rem; background: #e8eef2; border-radius: 9px; }
.entry-mode-tabs button { min-height: 36px; color: #526976; background: transparent; border: 0; border-radius: 7px; font-size: .74rem; font-weight: 800; }
.entry-mode-tabs button.active { color: #fff; background: var(--navy-2); }
.classic-valuations { padding: .6rem; margin: .25rem 0; background: #f5f8fa; border: 1px solid var(--line); border-radius: 9px; }
.classic-valuations legend { padding: 0 .25rem; color: var(--navy); font-size: .7rem; font-weight: 800; }
.classic-category-checks { display: grid; grid-template-columns: repeat(auto-fit,minmax(150px,1fr)); gap: .3rem; }
.classic-category-checks label { display: flex; align-items: center; gap: .35rem; color: #455d6b; font-size: .68rem; }
.classic-category-checks input { width: 16px; min-height: 16px; accent-color: var(--red); }
.classic-grid.team-entry-active { grid-template-columns: minmax(620px,1.3fr) minmax(420px,.9fr); }
.team-definition-list { margin-bottom: .7rem; }
.team-definition-list-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .4rem; color: var(--navy); font-size: .76rem; }
.team-definition-cards { display: grid; gap: .4rem; }
.team-definition-cards article { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; overflow: hidden; background: #f5f8fa; border: 1px solid var(--line); border-radius: 9px; }
.team-definition-cards article.active { border-color: var(--blue); box-shadow: inset 4px 0 0 var(--red); }
.team-definition-cards article > button { display: grid; gap: .15rem; padding: .55rem .7rem; text-align: left; background: transparent; border: 0; }
.team-definition-cards article > button strong { color: var(--navy); }
.team-definition-cards article > button small { overflow: hidden; color: #526b79; text-overflow: ellipsis; white-space: nowrap; }
.team-definition-cards article > button span { color: var(--blue); font-size: .62rem; }
.team-definition-cards article > div { display: flex; gap: .25rem; padding-right: .45rem; }
.team-roster-editor { display: grid; gap: .4rem; padding: .65rem; background: #f5f8fa; border: 1px solid var(--line); border-radius: 9px; }
.team-roster-editor h3 { margin: 0 0 .2rem; color: var(--navy); font-size: .82rem; }
.team-roster-editor label { display: grid; grid-template-columns: 75px minmax(0,1fr); align-items: center; gap: .45rem; color: #526976; font-size: .7rem; }
.team-roster-editor label small { grid-column: 2; }
.auto-overall-badge { padding: .45rem .55rem; margin-bottom: .4rem; color: #0e6945; background: #e4f5ec; border-radius: 7px; font-size: .68rem; font-weight: 850; }
.selected-team-valuations { display: flex; flex-wrap: wrap; gap: .35rem; }
.selected-team-valuations span { padding: .3rem .5rem; color: #fff; background: var(--navy-2); border-radius: 999px; font-size: .65rem; font-weight: 800; }
.fixed-player-name { padding: .55rem .65rem; color: var(--navy); background: #e8eef2; border-radius: 8px; font-weight: 850; }
.quick-total-field{display:grid;grid-template-columns:1fr 130px;align-items:center;gap:.5rem;padding:.55rem .65rem;color:var(--navy);background:#e7f2f7;border-radius:8px;font-size:.72rem;font-weight:850}.quick-total-field input{min-height:38px;text-align:center;font-weight:900}.team-set-details{margin-top:.5rem;border:1px solid var(--line);border-radius:8px;background:#fff}.team-set-details summary{padding:.5rem .6rem;color:var(--blue);cursor:pointer;font-size:.68rem;font-weight:850}.team-set-details>p{padding:.35rem .55rem;margin:0;color:#805400;background:#fff6da;font-size:.6rem}.team-set-table{border-top:1px solid var(--line)}.team-set-head,.team-set-row{display:grid;grid-template-columns:36px repeat(4,minmax(0,1fr));align-items:center;gap:.25rem;padding:.3rem}.team-set-head{color:#5f7481;background:#e8eef2;font-size:.58rem;font-weight:850;text-align:center}.team-set-row{border-top:1px solid #e5ebef}.team-set-row strong{text-align:center}.team-set-row input{min-height:32px;padding:.2rem;text-align:center;font-size:.7rem}.substitute-roster{margin-top:.55rem;border-color:#e0bd62;background:#fff9e9}.substitution-box{padding:.65rem;margin-top:.7rem;background:#fff9e9;border:1px solid #e0bd62;border-radius:10px}.substitution-box legend{padding:0 .3rem;color:#725000;font-size:.72rem;font-weight:850}.substitution-row{display:grid;grid-template-columns:140px minmax(150px,1fr) minmax(180px,1fr) 100px;align-items:end;gap:.4rem}.substitution-row+.substitution-row{padding-top:.5rem;margin-top:.5rem;border-top:1px solid #ead69d}.substitution-row label{color:#5d6570;font-size:.65rem;font-weight:750}.substitution-row select,.substitution-row input{min-height:36px;margin-top:.2rem;padding:.3rem}.substitution-check{display:flex!important;align-items:center;gap:.35rem;min-height:36px}.substitution-check input{width:17px;min-height:17px;margin:0;accent-color:var(--red)}.substitution-summary{display:grid;gap:.15rem;margin-top:.4rem;padding:.35rem;color:#765000;background:#fff3cb;border-radius:6px}.substitution-summary span{font-size:.62rem}.team-player-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .65rem; }
.team-player-card { min-width: 0; overflow: hidden; padding: .65rem; background: #f7fafb; border: 1px solid var(--line); border-radius: 10px; }
.team-player-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .4rem; color: var(--navy); font-size: .72rem; font-weight: 850; }
.team-player-head strong { color: var(--blue); }
.player-autocomplete { position: relative; }
.player-suggestion-menu { position: absolute; z-index: 80; top: calc(100% + 3px); left: 0; right: 0; max-height: 260px; overflow-y: auto; padding: .3rem; background: #fff; border: 1px solid #9fb7c7; border-radius: 9px; box-shadow: 0 12px 30px rgba(10,41,66,.22); }
.player-suggestion-menu button { display: grid; gap: .12rem; width: 100%; padding: .5rem .6rem; text-align: left; color: var(--ink); background: transparent; border: 0; border-radius: 6px; }
.player-suggestion-menu button:hover, .player-suggestion-menu button:focus { background: #eaf3f8; outline: none; }
.player-suggestion-menu strong { color: var(--navy); font-size: .76rem; }
.player-suggestion-menu small { color: var(--muted); font-size: .61rem; line-height: 1.25; }
.player-name-hint { display: block; min-height: 16px; margin-top: .2rem; color: var(--muted); font-size: .62rem; line-height: 1.3; }
.player-name-hint.existing { color: #8b5200; font-weight: 800; }
.player-name-hint.similar { color: var(--blue); }
.player-name-hint.new { color: var(--green); }
.team-reuse-rule { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .45rem; padding: .55rem .65rem; margin: .4rem 0 .7rem; color: #674500; background: #fff2c8; border: 1px solid #efd27c; border-radius: 8px; font-size: .7rem; line-height: 1.4; }
.team-reuse-counter { padding: .25rem .45rem; border-radius: 999px; font-weight: 850; white-space: nowrap; }
.team-reuse-counter.ok { color: #0e6945; background: #e4f5ec; }
.team-reuse-counter.limit { color: #765000; background: #ffe49a; }
.team-reuse-counter.over { color: #9b1723; background: #ffdce0; }
.classic-valuations.compact { padding: .45rem; }
.classic-valuations.compact .classic-category-checks { grid-template-columns: repeat(2,minmax(0,1fr)); }
.team-total { margin-top: .7rem; color: #fff; background: var(--navy); }
.ranking-meta { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: .35rem; }
.rule-pill { padding: .3rem .55rem; color: #725000; background: #fff0bd; border-radius: 999px; font-size: .66rem; font-weight: 800; }
.team-start-log td > div + div { margin-top: .35rem; padding-top: .35rem; border-top: 1px solid #e6ecef; }
.classic-schedule-panel{margin-top:1rem}.schedule-actions{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:.4rem}.active-mode{color:#0e6945!important;background:#e4f5ec!important;border-color:#9bcdb2!important}.schedule-config-summary{display:flex;flex-wrap:wrap;gap:.4rem;margin-bottom:.75rem}.schedule-config-summary span{padding:.35rem .55rem;color:#345266;background:#e8eef2;border-radius:999px;font-size:.66rem;font-weight:800}.classic-schedule-days{display:grid;gap:1rem}.classic-schedule-days>section>h3{margin:0 0 .5rem;color:var(--navy);font-size:.9rem}.classic-slot-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(330px,1fr));gap:.6rem}.classic-slot{overflow:hidden;background:#f8fafb;border:1px solid var(--line);border-radius:10px}.classic-slot.active{border-color:var(--red);box-shadow:inset 4px 0 0 var(--red)}.classic-slot>header{display:flex;align-items:center;justify-content:space-between;padding:.55rem .65rem;color:#fff;background:var(--navy-2)}.slot-time-editor{display:flex;align-items:end;gap:.35rem}.slot-time-editor label{color:#a8c6d9;font-size:.55rem;text-transform:uppercase}.slot-time-editor input{min-height:32px;margin-top:.15rem;padding:.25rem;color:#fff;background:rgba(255,255,255,.1);border-color:rgba(255,255,255,.3)}.slot-header-actions{display:flex;gap:.25rem}.slot-kind{display:grid;grid-template-columns:180px minmax(0,1fr);gap:.45rem;padding:.5rem .55rem;background:#eef3f6}.slot-kind label{color:#526976;font-size:.65rem;font-weight:750}.slot-kind select,.slot-kind input{min-height:34px;margin-top:.2rem;padding:.3rem}.schedule-event-preview{display:flex;align-items:center;justify-content:space-between;gap:.5rem;padding:1rem;color:#fff;background:linear-gradient(135deg,var(--blue),var(--navy))}.schedule-event-preview strong{font-size:1rem}.schedule-day-head{display:flex;align-items:center;justify-content:space-between;gap:.5rem;margin-bottom:.45rem}.schedule-day-head h3{margin:0!important}.slot-team-selects{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:.4rem;padding:.55rem}.slot-team-selects label{color:#526976;font-size:.65rem;font-weight:750}.slot-team-selects select{min-height:35px;margin-top:.2rem;padding:.3rem}.lane-start-list{display:grid;grid-template-columns:repeat(auto-fit,minmax(135px,1fr));gap:1px;background:#dce5ea;border-top:1px solid #dce5ea}.lane-start-list>div{display:grid;gap:.1rem;padding:.45rem .55rem;background:#fff}.lane-start-list span{color:var(--red);font-size:.58rem;font-weight:850;text-transform:uppercase}.lane-start-list strong{color:var(--navy);font-size:.75rem}.lane-start-list small{color:var(--muted);font-size:.6rem}.classic-live-panel{margin-top:1rem}.live-panel-actions{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:.4rem}.live-panel-actions select{min-width:300px}.live-pairing-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(520px,1fr));gap:.7rem}.live-pairing{overflow:hidden;background:#f8fafb;border:1px solid var(--line);border-radius:10px}.live-pairing>header{display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:.45rem;padding:.55rem .65rem;color:#fff;background:linear-gradient(135deg,var(--navy),var(--blue))}.live-pairing>header>div:last-child{text-align:right}.live-pairing header strong,.live-pairing header small{display:block}.live-pairing header small{color:#c5d9e5;font-size:.6rem}.live-pairing header>b{font-size:.58rem;text-transform:uppercase}.live-score-head,.live-score-row{display:grid;grid-template-columns:38px repeat(4,1fr) 16px repeat(4,1fr);align-items:center;gap:.2rem;padding:.3rem}.live-score-head{color:#5e7481;background:#e6edf1;font-size:.55rem;font-weight:850;text-align:center}.live-score-row{border-top:1px solid #e0e7eb}.live-score-row>strong,.live-score-row>i{text-align:center}.live-score-row input{min-width:0;min-height:31px;padding:.2rem;text-align:center}.live-pairing>footer{display:grid;grid-template-columns:1fr 1fr;gap:.5rem;padding:.5rem .65rem;color:#fff;background:#183e56}.live-pairing footer>div{display:flex;justify-content:space-between}.live-pairing footer span{font-size:.6rem;text-transform:uppercase}@media(max-width:800px){.live-pairing-grid{grid-template-columns:1fr}.live-panel-actions select{min-width:0;width:100%}}
.classic-set-entry { overflow: hidden; margin-top: .3rem; border: 1px solid var(--line); border-radius: 10px; }
.classic-set-head, .classic-set-row { display: grid; grid-template-columns: 45px repeat(3,minmax(0,1fr)); align-items: center; gap: .4rem; padding: .4rem .5rem; }
.classic-set-head { color: #607480; background: #e7eef2; font-size: .6rem; font-weight: 850; text-align: center; text-transform: uppercase; }
.classic-set-row { border-top: 1px solid #e2e9ed; }
.classic-set-row strong { color: var(--navy); text-align: center; }
.classic-set-row input { min-height: 36px; padding: .35rem; text-align: center; font-weight: 800; }
.classic-grand-total { display: flex; align-items: center; justify-content: space-between; gap: .6rem; padding: .55rem .7rem; color: var(--navy); background: #eef5f8; border-top: 1px solid var(--line); font-size: .72rem; }
.classic-grand-total strong { font-size: 1rem; }
.set-breakdown { display: block; max-width: 430px; margin-top: .18rem; color: var(--muted); font-size: .62rem; line-height: 1.35; }
.tabs { display: flex; gap: .4rem; padding-bottom: .7rem; margin-bottom: .4rem; overflow-x: auto; scrollbar-width: thin; }
.tab { flex: 0 0 auto; padding: .48rem .7rem; color: #49606f; background: #edf2f5; border: 0; border-radius: 8px; font-size: .72rem; font-weight: 750; }
.tab.active { color: #fff; background: var(--navy-2); }
.ranking-list { display: grid; }
.ranking-row { display: grid; grid-template-columns: 38px minmax(0,1fr) auto; align-items: center; gap: .7rem; padding: .72rem .35rem; border-top: 1px solid #e8edf0; }
.ranking-row:first-child { border-top: 0; }
.ranking-row .place { display: grid; place-items: center; width: 30px; height: 30px; color: #5c6f7b; background: var(--soft); border-radius: 50%; font-size: .78rem; font-weight: 850; }
.ranking-row > div { min-width: 0; }
.ranking-row strong, .ranking-row small { display: block; }
.ranking-row strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ranking-row small { margin-top: .16rem; color: var(--muted); font-size: .68rem; }
.ranking-row > b { color: var(--navy); font-size: 1.15rem; white-space: nowrap; }
.ranking-row > b small { display: inline; font-size: .62rem; }
.ranking-row.place-1 .place { color: #6e4c00; background: #ffe19b; }
.ranking-row.place-2 .place { color: #4e5d67; background: #dce3e7; }
.ranking-row.place-3 .place { color: #764013; background: #edc09a; }
.entries-panel { margin-top: 1rem; }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .8rem; }
th { padding: .6rem .7rem; color: #60727f; text-align: left; background: #f4f7f9; font-size: .67rem; letter-spacing: .04em; text-transform: uppercase; }
td { padding: .65rem .7rem; border-top: 1px solid #e8edf0; vertical-align: middle; }
.table-actions { display: flex; justify-content: flex-end; gap: .3rem; white-space: nowrap; }

/* KO mode */
.ko-create-options{grid-template-columns:repeat(4,minmax(0,1fr))}.ko-name-form{grid-template-columns:minmax(220px,1fr) auto}.ko-participant-form{display:grid;grid-template-columns:minmax(220px,1fr) auto;gap:.5rem;margin-bottom:.7rem}.ko-participant-form.team-mode{grid-template-columns:1fr}.ko-participant-form>label{color:var(--navy);font-size:.7rem;font-weight:750}.ko-participant-form-actions{display:flex;justify-content:flex-end;gap:.4rem}.ko-roster-inputs{display:grid;grid-template-columns:repeat(var(--ko-player-count),minmax(180px,1fr));align-items:start;gap:.45rem}.ko-roster-inputs label{display:grid;grid-template-rows:auto 44px minmax(20px,auto);gap:.2rem;padding:.5rem;background:#f5f8fa;border:1px solid var(--line);border-radius:8px;color:#526976;font-size:.68rem;font-weight:750}.ko-roster-inputs label>input[type="text"]{height:44px}.ko-roster-inputs small{display:flex;align-items:center;gap:.3rem;color:#785000;font-weight:700}.ko-roster-inputs small input{width:16px;min-height:16px;accent-color:var(--red)}.ko-player-names{display:block;margin-top:.18rem;color:var(--muted);font-size:.62rem}.ko-player-names b{color:var(--navy)}.ko-player-names em{color:#8a5a00;font-style:normal;font-weight:750}.ko-bulk-entry{margin-bottom:.75rem;padding:.55rem;background:#f5f8fa;border:1px solid var(--line);border-radius:8px}.ko-bulk-entry summary{cursor:pointer;color:var(--blue);font-size:.72rem;font-weight:850}.ko-bulk-entry form{display:grid;grid-template-columns:1fr auto;gap:.45rem;margin-top:.5rem}.ko-bulk-entry textarea{width:100%;padding:.5rem;border:1px solid #cbd6de;border-radius:8px}.ko-pair-repair{background:#fff8e8;border-color:#ead49b}.ko-pair-repair summary{color:#785000}.ko-pair-repair p{margin:.45rem 0 0;color:#67562d;font-size:.68rem;line-height:1.45}.ko-qualification-inputs{display:flex;flex-wrap:wrap;gap:.3rem}.ko-qualification-inputs label{display:grid;gap:.15rem;min-width:75px}.ko-qualification-inputs small{color:var(--muted);font-size:.58rem}.ko-qualification-inputs input{min-height:33px}.ko-qualification-inputs span{padding:.25rem .4rem;background:#eef3f6;border-radius:6px;font-size:.68rem}.ko-manual-total{display:grid;grid-template-columns:1fr 110px;align-items:center;gap:.35rem;margin-top:.35rem;color:#725000;font-size:.65rem;font-weight:750}.ko-manual-total input{min-height:33px;padding:.3rem;text-align:center}.ko-qualification-total{margin-top:.35rem;color:var(--navy);font-size:.68rem}.ko-prestart-actions{display:flex;gap:.4rem;margin:.75rem 0}.ko-start-order{margin:.75rem 0;padding:.65rem;background:#f5f8fa;border:1px solid var(--line);border-radius:9px}.ko-start-order h3{margin:0}.ko-match-games{background:#fff}.ko-match-games>header{display:grid;grid-template-columns:1fr auto 1fr;gap:.4rem;padding:.5rem .6rem;color:#fff;background:var(--navy-2)}.ko-match-games>header strong:last-child{text-align:right}.ko-match-games>div{display:grid;grid-template-columns:1fr 18px 1fr;align-items:end;gap:.35rem;padding:.35rem .55rem;border-top:1px solid #e2e8ec}.ko-match-games label{display:grid;grid-template-columns:auto 80px;align-items:center;justify-content:space-between;gap:.35rem;color:#607582;font-size:.62rem}.ko-match-games input{min-height:33px;text-align:center;font-weight:850}.ko-manual-match-total{display:grid;grid-template-columns:1fr auto 1fr;align-items:end;gap:.35rem;padding:.45rem .55rem;background:#fff7df;border-top:1px solid #ecdcae}.ko-manual-match-total label{display:grid;grid-template-columns:1fr 90px;align-items:center;gap:.35rem;color:#725000;font-size:.6rem;font-weight:750}.ko-manual-match-total input{min-height:32px;text-align:center}.ko-manual-match-total span{color:#8a7950;font-size:.58rem}.ko-lineup-editor{display:grid;grid-template-columns:1fr 1fr;gap:.45rem;padding:.45rem .55rem;background:#f5f8fa}.ko-lineup-editor>div{display:grid;gap:.25rem}.ko-lineup-editor>div>strong{color:var(--navy);font-size:.7rem}.ko-lineup-editor span,.ko-lineup-editor label{font-size:.62rem;color:#526976}.ko-lineup-editor label{display:grid;grid-template-columns:20px 1fr;align-items:center}.ko-lineup-editor select{min-height:32px;padding:.25rem}.ko-player-game{border-top:1px solid #dce5ea}.ko-player-game>header{padding:.3rem .55rem;color:#fff;background:var(--blue);font-size:.62rem;font-weight:850}.ko-player-game>div{display:grid;grid-template-columns:1fr 18px 1fr;align-items:center;gap:.35rem;padding:.4rem .55rem}.ko-player-game fieldset{display:grid;gap:.25rem;padding:.4rem;border:1px solid var(--line);border-radius:7px}.ko-player-game legend{color:var(--navy);font-size:.62rem;font-weight:850}.ko-player-game label{display:grid;grid-template-columns:1fr 75px;align-items:center;gap:.3rem;color:#526976;font-size:.6rem}.ko-player-game input{min-height:31px;text-align:center}.ko-player-game fieldset>strong{text-align:right;color:var(--blue);font-size:.7rem}.ko-match-games>footer{display:grid;grid-template-columns:1fr 1fr;gap:.5rem;padding:.45rem .6rem;color:var(--navy);background:#e8f0f4}.ko-match-games>footer strong:last-child{text-align:right}
.ko-summary { display: grid; grid-template-columns: .6fr 1.4fr 1fr; gap: 1px; overflow: hidden; margin-bottom: 1rem; background: #cbd7df; border: 1px solid #cbd7df; border-radius: 13px; }
.ko-rules-summary { grid-template-columns: repeat(8,minmax(0,1fr)); }
.ko-summary > div { display: grid; gap: .25rem; padding: .8rem 1rem; background: #fff; }
.ko-summary span { color: var(--muted); font-size: .67rem; font-weight: 750; text-transform: uppercase; }
.ko-summary strong { color: var(--navy); font-size: .88rem; }
.inline-form { display: grid; grid-template-columns: minmax(150px,1fr) 150px auto; gap: .45rem; margin-bottom: .8rem; }
.table-input { min-height: 36px; padding: .42rem .55rem; }
.table-input.score { max-width: 130px; }
.compact-table td { padding: .5rem; }
.rank-chip { display: grid; place-items: center; width: 27px; height: 27px; color: var(--navy); background: var(--soft); border-radius: 50%; font-weight: 850; }
.qualification-list { display: grid; }
.qualification-list > div { display: grid; grid-template-columns: 30px minmax(0,1fr) auto; align-items: center; gap: .5rem; padding: .65rem .2rem; border-top: 1px solid #e8edf0; font-size: .8rem; }
.qualification-list > div:first-child { border-top: 0; }
.qualification-list span { color: var(--muted); font-weight: 800; }
.qualification-list b { color: var(--navy); }
.bracket-section { margin-top: 1.4rem; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: .8rem; }
.live-badge { display: inline-flex; align-items: center; gap: .4rem; color: var(--green); font-size: .72rem; font-weight: 800; }
.live-badge i { width: 8px; height: 8px; background: var(--green); border-radius: 50%; animation: pulse 1.4s infinite; }
.round-stack { display: grid; gap: 1rem; }
.round-panel { border-left: 4px solid #9eb3c0; }
.round-panel.current-round { border-left-color: var(--red); box-shadow: var(--shadow); }
.round-actions { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: .5rem; }
.lucky-badge { padding: .35rem .6rem; color: #774c00; background: #fff0bf; border-radius: 999px; font-size: .69rem; font-weight: 800; }
.matches-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(245px, 1fr)); gap: .75rem; margin-bottom: .9rem; }
.match-card { overflow: hidden; background: #f8fafb; border: 1px solid #dce5ea; border-radius: 11px; }
.match-card.complete { border-color: #b9dbc9; }
.match-label { padding: .42rem .65rem; color: #60727f; background: #eaf0f3; font-size: .66rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.competitor { display: grid; grid-template-columns: minmax(0,1fr) 78px; align-items: center; min-height: 48px; padding: .45rem .6rem; border-top: 1px solid #e1e8ec; }
.competitor span { overflow: hidden; padding-right: .5rem; font-size: .82rem; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.competitor input { min-height: 35px; padding: .35rem; text-align: center; font-weight: 850; }
.competitor.winner { color: #0e6945; background: #ecf8f2; }
.competitor.winner span::after { content: ' ✓'; }
.competitor b { color: var(--muted); font-size: .7rem; text-align: right; }
.tiebreak-area { padding: .55rem .65rem; color: #7c4f00; background: #fff8e5; border-top: 1px solid #f0deb1; }
.tiebreak-area > strong { display: block; margin-bottom: .4rem; font-size: .68rem; text-transform: uppercase; }
.tiebreak-row { display: grid; grid-template-columns: 20px 1fr 12px 1fr; align-items: center; gap: .35rem; }
.tiebreak-row + .tiebreak-row { margin-top: .35rem; }
.tiebreak-row input { min-height: 34px; text-align: center; }
.winner-line { padding: .48rem .65rem; color: #0e6945; background: #e3f4eb; border-top: 1px solid #b9dbc9; font-size: .72rem; }
.podium-panel { padding: 2rem 1.2rem 1.2rem; margin-top: 1rem; text-align: center; color: #fff; background: linear-gradient(140deg, #0a2942, #15496c); border-radius: 18px; box-shadow: var(--shadow); }
.podium-panel .eyebrow { color: #8fc3e3; }
.podium { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); align-items: end; gap: .65rem; max-width: 780px; margin: 1.8rem auto 0; }
.podium > div { display: grid; place-items: center; gap: .45rem; min-height: 110px; padding: 1rem; color: var(--navy); background: #fff; border-radius: 11px 11px 4px 4px; }
.podium .first { min-height: 155px; background: linear-gradient(#fff8da,#ffe292); }
.podium .second { min-height: 125px; background: linear-gradient(#fff,#dfe8ed); }
.podium .third { min-height: 105px; background: linear-gradient(#fff3e8,#e7bb95); }
.podium span { display: grid; place-items: center; width: 42px; height: 42px; color: #fff; background: var(--navy); border-radius: 50%; font-size: 1.25rem; font-weight: 900; }
.podium .first span { color: #684600; background: var(--gold); }

/* Gruppenphase */
.group-summary { grid-template-columns: repeat(6,minmax(0,1fr)); }
.group-team-form { grid-template-columns: minmax(220px,1fr) 190px auto; }
.group-capacity-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(120px,1fr)); gap: .45rem; margin: .75rem 0; }
.group-capacity-grid > div { display: flex; justify-content: space-between; gap: .5rem; padding: .55rem .65rem; color: #4f6674; background: #edf2f5; border: 1px solid #dce5ea; border-radius: 8px; font-size: .74rem; }
.group-capacity-grid > div.full { color: #0e6945; background: #e5f5ed; border-color: #b9dbc9; }
.group-team-actions { display: flex; flex-wrap: wrap; gap: .55rem; margin-top: .85rem; }
.group-phase-section { margin-top: 1.4rem; }
.group-tables-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(430px,1fr)); gap: 1rem; }
.group-table-panel { padding: .9rem; }
.group-table { font-size: .74rem; }
.group-table th, .group-table td { padding: .48rem .42rem; text-align: center; }
.group-table th:nth-child(2), .group-table td:nth-child(2) { text-align: left; }
.group-table .qualifying-row { background: #edf8f2; }
.group-table .qualifying-row .rank-chip { color: #fff; background: var(--green); }
.group-match-sections { display: grid; gap: 1rem; margin-top: 1rem; }
.group-fixtures { padding: 1rem; }
.matchday + .matchday { padding-top: 1rem; margin-top: 1rem; border-top: 1px solid var(--line); }
.matchday > h3 { margin: 0 0 .55rem; color: var(--navy); font-size: .82rem; }
.series-grid { grid-template-columns: repeat(auto-fit,minmax(310px,1fr)); }
.series-match-card { overflow: hidden; background: #f8fafb; border: 1px solid #dce5ea; border-radius: 11px; }
.series-match-card.complete { border-color: #a9d4bd; }
.series-team-head { display: grid; grid-template-columns: minmax(0,1fr) 42px minmax(0,1fr); align-items: center; gap: .35rem; padding: .65rem; color: var(--navy); background: #fff; }
.series-team-head span { overflow: hidden; font-size: .82rem; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.series-team-head span:last-child { text-align: right; }
.series-team-head b { color: var(--muted); font-size: .58rem; text-align: center; text-transform: uppercase; }
.series-sets { display: grid; gap: .35rem; padding: .55rem .65rem; border-top: 1px solid #e1e8ec; }
.series-score-row { display: grid; grid-template-columns: 1fr 66px 1fr; align-items: center; gap: .4rem; }
.series-score-row span { color: var(--muted); font-size: .65rem; font-weight: 750; text-align: center; }
.series-score-row input { min-height: 34px; padding: .3rem; text-align: center; font-weight: 850; }
.series-total { display: grid; grid-template-columns: 1fr auto 1fr; gap: .35rem; padding: .45rem .65rem; color: #365264; background: #eaf0f3; font-size: .65rem; }
.series-total span:last-child { text-align: right; }
.series-total strong { color: var(--navy); text-transform: uppercase; }
.series-bye { padding: 1rem; color: var(--muted); text-align: center; font-size: .76rem; }
.sudden-area { padding: .6rem .65rem; color: #744b00; background: #fff7df; border-top: 1px solid #efdaaa; }
.sudden-area > strong { display: block; margin-bottom: .5rem; font-size: .66rem; text-transform: uppercase; }
.sudden-series { display: grid; grid-template-columns: 48px 1fr auto 1fr; align-items: center; gap: .4rem; }
.sudden-series + .sudden-series { margin-top: .4rem; }
.sudden-series > span { font-size: .62rem; font-weight: 800; }
.sudden-series > div { display: grid; grid-template-columns: repeat(3,1fr); gap: .25rem; }
.sudden-series input { min-height: 31px; padding: .2rem; text-align: center; font-weight: 850; }
.sudden-series > b { min-width: 38px; font-size: .7rem; text-align: center; }
.start-ko-panel { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem; margin-top: 1rem; color: #fff; background: linear-gradient(135deg,var(--navy),var(--navy-2)); border-radius: 13px; }
.start-ko-panel p { margin: 0; font-size: .8rem; line-height: 1.45; }
.lucky-info { color: #714900; background: #fff2c8; border: 1px solid #efd27c; }

/* Teilnehmerstatus, Historie und Meisterschaft */
.status-badge { display: inline-flex; align-items: center; padding: .25rem .45rem; color: #9b1723; background: #ffe0e3; border: 1px solid #efb9bf; border-radius: 999px; font-size: .62rem; font-weight: 850; white-space: nowrap; }
.status-active { color: var(--green); font-size: .68rem; font-weight: 750; }
.inactive-row { color: #8b1c25; background: #fff0f1 !important; }
.name-with-status { display: flex; align-items: center; flex-wrap: wrap; gap: .35rem; }
.name-with-status .table-input { flex: 1; min-width: 150px; }
.series-history-actions, .champ-entry-actions { display: flex; flex-wrap: wrap; gap: .35rem; padding: .45rem .6rem; background: #eef3f6; border-top: 1px solid #dce5ea; }
.match-history, .champ-entry-card details { padding: .45rem .6rem; color: var(--muted); background: #fff; border-top: 1px solid #e1e8ec; font-size: .68rem; }
.match-history summary, .champ-entry-card summary { cursor: pointer; font-weight: 800; }
.history-item { padding: .3rem 0; border-top: 1px solid #edf1f3; }
.winner-line.cancelled { color: #7a4c00; background: #fff1c5; }
.choice-grid.four { grid-template-columns: repeat(2,minmax(0,1fr)); }
.championship-round-config { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .75rem; margin-top: .75rem; }
.championship-round-config > div { padding: .75rem; background: #f4f7f9; border: 1px solid var(--line); border-radius: 10px; }
.championship-round-config h3 { margin: 0 0 .55rem; color: var(--navy); font-size: .82rem; }
.championship-main-options { grid-template-columns: repeat(3,minmax(0,1fr)); }
.championship-summary { grid-template-columns: repeat(5,minmax(0,1fr)); }
.champ-add-form { grid-template-columns: minmax(220px,1fr) 210px auto; }
.champ-add-form label { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: .4rem; color: var(--muted); font-size: .7rem; }
.championship-schedule, .championship-entry-section, .championship-ranking { margin-top: 1rem; }
.schedule-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(250px,1fr)); gap: .65rem; }
.schedule-grid article { overflow: hidden; background: #f7fafb; border: 1px solid var(--line); border-radius: 9px; }
.schedule-grid h3 { padding: .5rem .65rem; margin: 0; color: #fff; background: var(--navy-2); font-size: .82rem; }
.schedule-grid article > div { display: grid; grid-template-columns: 60px minmax(0,1fr) auto; align-items: center; gap: .4rem; padding: .45rem .6rem; border-top: 1px solid #e3e9ed; font-size: .72rem; }
.schedule-grid article > div span { color: var(--muted); }
.schedule-grid article > div em { color: #795000; font-size: .58rem; font-style: normal; font-weight: 800; }
.champ-entry-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(320px,1fr)); gap: .75rem; }
.champ-entry-card { overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: 11px; }
.champ-entry-card.complete { border-color: #a9d4bd; }
.champ-entry-card.inactive { border-color: #e6aeb4; opacity: .75; }
.champ-entry-card > header { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .6rem .7rem; color: var(--navy); background: #eef3f6; }
.champ-entry-card > header strong, .champ-entry-card > header small { display: block; }
.champ-entry-card > header small { margin-top: .15rem; color: var(--muted); font-size: .62rem; }
.champ-set-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(95px,1fr)); gap: .4rem; padding: .65rem; }
.champ-set-grid label, .champ-tiebreak-fields label { color: var(--muted); font-size: .64rem; font-weight: 750; }
.champ-set-grid input, .champ-tiebreak-fields input { min-height: 35px; margin-top: .25rem; text-align: center; }
.champ-tiebreak-fields { display: grid; grid-template-columns: 1fr 1fr 100px; align-items: end; gap: .45rem; padding: .6rem .65rem; background: #f8fafb; border-top: 1px solid #e3e9ed; }
.champ-tiebreak-fields > div { display: grid; place-items: center; min-height: 55px; color: var(--navy); background: #e4edf2; border-radius: 8px; }
.champ-tiebreak-fields > div span { font-size: .58rem; text-transform: uppercase; }
.champ-tiebreak-fields > div strong { font-size: 1.3rem; }
.final-qualified-panel { margin-top: 1rem; border-left: 4px solid var(--green); }
.final-qualified-list { display: grid; grid-template-columns: repeat(auto-fit,minmax(220px,1fr)); gap: .5rem; }
.final-qualified-list > div { display: grid; grid-template-columns: 34px minmax(0,1fr) auto; align-items: center; gap: .5rem; padding: .6rem; background: #eaf7f0; border: 1px solid #b9dbc9; border-radius: 9px; }
.final-qualified-list > div > span { display: grid; place-items: center; width: 28px; height: 28px; color: #fff; background: var(--green); border-radius: 50%; font-weight: 850; }
.final-qualified-list > div > b { color: var(--green); font-size: .65rem; text-transform: uppercase; }
.past-round { margin-top: 1rem; }
.past-round > details > summary { padding: .8rem 1rem; color: var(--navy); background: #e4ebef; border-radius: 9px; cursor: pointer; font-weight: 800; }
.past-round .panel { margin-top: .75rem; }
.status-modal { width: min(560px,calc(100% - 2rem)); }
.audit-panel { margin-top: 1rem; }
.audit-panel summary { color: var(--navy); cursor: pointer; font-size: .82rem; font-weight: 850; }
.audit-list { display: grid; margin-top: .7rem; }
.audit-list > div { display: grid; grid-template-columns: 145px minmax(0,1fr) auto; gap: .5rem; padding: .45rem 0; border-top: 1px solid var(--line); font-size: .7rem; }
.audit-list time, .audit-list span { color: var(--muted); }

/* Dialog and notifications */
.modal { width: min(760px, calc(100% - 2rem)); max-height: calc(100vh - 2rem); padding: 0; color: var(--ink); background: #fff; border: 0; border-radius: 18px; box-shadow: 0 25px 80px rgba(0,0,0,.32); }
.modal::backdrop { background: rgba(5,25,39,.68); backdrop-filter: blur(3px); }
.modal form { display: grid; gap: 1rem; padding: 1.35rem; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; }
.create-stepper { display: grid; grid-template-columns: repeat(3,1fr); gap: .35rem; padding: .35rem; background: #e8eef2; border-radius: 11px; }
.create-stepper button { display: flex; align-items: center; justify-content: center; gap: .45rem; min-height: 42px; color: #607582; background: transparent; border: 0; border-radius: 8px; font-size: .72rem; font-weight: 800; }
.create-stepper button span { display: grid; place-items: center; width: 24px; height: 24px; color: #fff; background: #8ca0ad; border-radius: 50%; }
.create-stepper button.active { color: #fff; background: var(--navy-2); }
.create-stepper button.active span { background: var(--red); }
.create-stepper button.done { color: var(--green); }
.create-stepper button.done span { background: var(--green); }
.create-step { display: grid; gap: 1rem; animation: step-in .18s ease; }
@keyframes step-in { from { opacity: 0; transform: translateX(8px); } }
.wizard-spacer { flex: 1; }
.create-summary-head { display: flex; align-items: center; gap: 1rem; padding: .9rem; color: var(--navy); background: #eaf7f0; border: 1px solid #b9dbc9; border-radius: 11px; }
.create-summary-head h3, .create-summary-head p { margin: 0; }
.create-summary-head p:not(.eyebrow) { margin-top: .2rem; color: var(--muted); font-size: .72rem; }
.summary-check { display: grid; place-items: center; width: 48px; height: 48px; flex: 0 0 auto; color: #fff; background: var(--green); border-radius: 50%; font-size: 1.4rem; font-weight: 900; }
.create-summary { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .5rem; }
.create-summary > div { display: grid; gap: .2rem; padding: .65rem .75rem; background: #f5f8fa; border: 1px solid var(--line); border-radius: 9px; }
.create-summary span { color: var(--muted); font-size: .62rem; font-weight: 800; text-transform: uppercase; }
.create-summary strong { color: var(--navy); font-size: .82rem; }
.auto-category { border: 1px solid #9bcdb2; background: #e8f6ee !important; }
.common-tournament-options{padding:.7rem;background:#f5f8fa!important;border:1px solid var(--line)!important;border-radius:10px}.entry-fee-option{display:grid;grid-template-columns:minmax(220px,1fr) minmax(240px,1fr);align-items:end;gap:.55rem}.entry-fee-option>label:last-child{color:var(--navy);font-size:.74rem;font-weight:750}.entry-fee-option input[type=number]{margin-top:.3rem}.entry-fee-badge{padding:.25rem .5rem;color:#725000;background:#fff0bd;border-radius:999px;font-weight:800}
.toggle-grid { display: flex; flex-wrap: wrap; gap: .45rem; }
.schedule-create-box{display:grid;gap:.65rem;padding:.75rem;background:#f5f8fa;border:1px solid var(--line);border-radius:10px}.classic-schedule-main{grid-template-columns:repeat(3,minmax(0,1fr))}.schedule-rule-note{padding:.55rem .65rem;color:#5d4800;background:#fff3cb;border-left:4px solid var(--gold);border-radius:7px;font-size:.7rem}.schedule-day-fields{display:grid;gap:.45rem}.schedule-day-fields>section{display:grid;grid-template-columns:110px repeat(4,minmax(0,1fr));align-items:end;gap:.45rem;padding:.55rem;background:#fff;border:1px solid var(--line);border-radius:8px}.schedule-day-fields>section>div{align-self:center;color:var(--navy);font-weight:850}.schedule-day-fields label{color:#526976;font-size:.68rem;font-weight:750}.schedule-day-fields input,.schedule-day-fields select{margin-top:.25rem}
.modal fieldset { padding: 0; margin: 0; border: 0; }
.modal legend { margin-bottom: .55rem; color: var(--navy); font-size: .84rem; font-weight: 800; }
.choice-grid { display: grid; gap: .55rem; }
.choice-grid.two { grid-template-columns: repeat(2,minmax(0,1fr)); }
.choice-grid.three { grid-template-columns: repeat(3,minmax(0,1fr)); }
.number-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: .55rem; }
.number-grid label { color: var(--navy); font-size: .75rem; font-weight: 750; }
.number-grid input { margin-top: .35rem; }
.sublegend { margin-top: 1rem !important; }
.choice-card { position: relative; display: flex; gap: .65rem; padding: .8rem; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.choice-card:has(input:checked) { background: #eef7fc; border-color: var(--blue); box-shadow: inset 0 0 0 1px var(--blue); }
.choice-card input { width: 18px; min-height: 18px; margin: .1rem 0 0; accent-color: var(--red); }
.choice-card span, .choice-card strong, .choice-card small { display: block; }
.choice-card strong { color: var(--navy); font-size: .83rem; }
.choice-card small { margin-top: .2rem; color: var(--muted); font-size: .7rem; }
.check-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .4rem; }
.check-grid label { display: flex; align-items: center; gap: .45rem; padding: .5rem; background: #f5f7f8; border-radius: 8px; font-size: .76rem; }
.check-grid input { width: 17px; min-height: 17px; accent-color: var(--red); }
.modal-actions { display: flex; justify-content: flex-end; gap: .55rem; padding-top: .4rem; }
.sheet-mode-options{display:grid;gap:.5rem}.sheet-mode-options label{display:grid;grid-template-columns:24px 1fr;align-items:start;gap:.55rem;padding:.7rem;background:#f5f8fa;border:1px solid var(--line);border-radius:9px;cursor:pointer}.sheet-mode-options input{width:18px;min-height:18px;accent-color:var(--red)}.sheet-mode-options strong,.sheet-mode-options small{display:block}.sheet-mode-options strong{color:var(--navy)}.sheet-mode-options small{margin-top:.15rem;color:var(--muted);font-size:.68rem}
.logo-modal { width: min(900px, calc(100% - 2rem)); }
.logo-dialog-body { display: grid; gap: 1rem; padding: 1.35rem; }
.logo-intro { margin: -.4rem 0 .2rem; }
.logo-setting-card { display: grid; grid-template-columns: 210px minmax(0,1fr); gap: 1rem; padding: 1rem; background: #f5f8fa; border: 1px solid var(--line); border-radius: 13px; }
.logo-preview-shell { display: grid; place-items: center; min-height: 150px; overflow: hidden; background: #fff; border: 1px dashed #b9c9d3; border-radius: 11px; }
.logo-preview-shell img { display: block; max-width: 100%; max-height: 145px; padding: .5rem; object-fit: contain; }
.logo-placeholder { display: grid; place-items: center; gap: .35rem; padding: 1rem; color: #6a7f8c; text-align: center; }
.logo-placeholder strong { display: grid; place-items: center; min-width: 62px; min-height: 62px; padding: .5rem; color: #fff; background: var(--navy); border-radius: 50%; font-size: .8rem; letter-spacing: .05em; }
.logo-placeholder span { font-size: .68rem; }
.logo-setting-content h3 { margin: 0 0 .35rem; color: var(--navy); font-size: 1.05rem; }
.logo-setting-content > p:not(.eyebrow) { margin-bottom: .75rem; color: var(--muted); font-size: .76rem; line-height: 1.45; }
.logo-upload-form { display: grid; grid-template-columns: minmax(170px,1fr) auto auto; gap: .45rem; align-items: center; }
.logo-upload-form input[type="file"] { min-width: 0; padding: .45rem; font-size: .72rem; }
.logo-setting-card.disabled, [data-requires-tournament].disabled { opacity: .58; pointer-events: none; }
.design-setting-card { padding: 1rem; background: #f5f8fa; border: 1px solid var(--line); border-radius: 13px; }
.design-setting-card h3 { margin: 0; color: var(--navy); font-size: 1.05rem; }
.logo-size-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .55rem; margin-top: .75rem; }
.logo-size-grid label { color: var(--navy); font-size: .74rem; font-weight: 750; }
.logo-size-grid select { margin-top: .35rem; }
.text-logo-placeholder strong { width: 100%; min-width: 0; min-height: 70px; padding: .75rem; border-radius: 10px; line-height: 1.1; overflow-wrap: anywhere; }
.color-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: .5rem; margin-top: .75rem; }
.color-grid label { display: grid; grid-template-columns: minmax(0,1fr) 54px; align-items: center; gap: .45rem; padding: .45rem .55rem; color: #4d6574; background: #fff; border: 1px solid var(--line); border-radius: 8px; font-size: .7rem; font-weight: 750; }
.color-grid input { min-height: 34px; padding: .15rem; }
.color-grid input[type="number"] { width: 54px; text-align: center; }
.background-preview { background: repeating-linear-gradient(45deg,#edf2f5,#edf2f5 10px,#fff 10px,#fff 20px); }
.background-preview img { width: 100%; height: 145px; object-fit: cover; }
.sponsor-admin-list { display: grid; grid-template-columns: repeat(auto-fill,minmax(130px,1fr)); gap: .55rem; margin-top: .75rem; }
.sponsor-admin-item { position: relative; display: grid; place-items: center; min-height: 95px; padding: .5rem; background: #fff; border: 1px solid var(--line); border-radius: 9px; }
.sponsor-admin-item img { max-width: 100%; max-height: 75px; object-fit: contain; }
.sponsor-admin-item button { position: absolute; top: .25rem; right: .25rem; width: 25px; min-height: 25px; padding: 0; color: var(--red); background: rgba(255,255,255,.92); }
.toast-region { position: fixed; right: 1rem; bottom: 1rem; z-index: 100; display: grid; gap: .5rem; width: min(390px, calc(100% - 2rem)); pointer-events: none; }
.toast { padding: .85rem 1rem; color: #fff; background: var(--navy); border-left: 4px solid #4fd095; border-radius: 9px; box-shadow: 0 10px 30px rgba(0,0,0,.2); opacity: 0; transform: translateY(8px); transition: .22s; font-size: .82rem; }
.toast.error { border-left-color: #ff6b77; }
.toast.show { opacity: 1; transform: translateY(0); }

@media (max-width: 1080px) {
    .admin-layout { grid-template-columns: 270px minmax(0,1fr); }
    .classic-grid, .ko-grid { grid-template-columns: 1fr; }
    .entry-panel { position: static; }
}

@media (max-width: 760px) {
    .mobile-only { display: inline-flex !important; }
    .topbar { min-height: 64px; padding: .55rem .7rem; }
    .brand-mark { width: 38px; height: 38px; }
    .brand-group small { display: none; }
    .brand-group strong { font-size: .88rem; }
    .top-actions .save-state { display: none; }
    .top-actions .button { min-height: 36px; padding: .55rem .65rem; font-size: .72rem; }
    .admin-layout { display: block; min-height: calc(100vh - 64px); }
    .archive-panel {
        position: fixed; inset: 64px auto 0 0; z-index: 25; width: min(330px, 88vw); height: auto;
        transform: translateX(-102%); transition: transform .22s ease; box-shadow: 14px 0 30px rgba(0,0,0,.18);
    }
    .archive-panel.open { transform: translateX(0); }
    .workspace { padding: 1rem .7rem; }
    .tournament-header { align-items: flex-start; flex-direction: column; }
    .header-actions { justify-content: flex-start; }
    .ko-summary { grid-template-columns: 1fr; }
    .inline-form { grid-template-columns: 1fr 1fr; }
    .inline-form .button { grid-column: 1 / -1; }
    .choice-grid.two, .choice-grid.three, .choice-grid.four, .check-grid, .number-grid, .championship-main-options, .championship-round-config, .category-rule-grid, .classic-create-options, .team-player-grid, .create-summary { grid-template-columns: 1fr; }
    .category-rule-grid > div, .entry-fee-option { grid-template-columns: 1fr; }
    .ko-roster-inputs{grid-template-columns:1fr}
    .schedule-day-fields>section{grid-template-columns:1fr 1fr}.schedule-day-fields>section>div{grid-column:1/-1}.classic-slot-grid{grid-template-columns:1fr}.substitution-row{grid-template-columns:1fr 1fr}
    .logo-setting-card { grid-template-columns: 1fr; }
    .logo-upload-form, .color-grid, .logo-size-grid { grid-template-columns: 1fr; }
    .group-summary, .championship-summary { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .champ-add-form { grid-template-columns: 1fr; }
    .champ-tiebreak-fields { grid-template-columns: 1fr 1fr; }
    .champ-tiebreak-fields > div { grid-column: 1 / -1; }
    .group-team-form { grid-template-columns: 1fr; }
    .group-tables-grid { grid-template-columns: 1fr; }
    .start-ko-panel { align-items: stretch; flex-direction: column; }
    .topbar .topbar-ghost { font-size: 0; }
    #logoSettingsButton::after { content: 'Design'; font-size: .72rem; }
    #printButton::after { content: 'Druck'; font-size: .72rem; }
    .modal { width: calc(100% - 1rem); max-height: calc(100vh - 1rem); }
    .modal form { padding: 1rem; }
    .podium { gap: .3rem; }
    .podium > div { padding: .65rem .25rem; }
    .podium strong { font-size: .72rem; }
    .matches-grid { grid-template-columns: 1fr; }
    .round-actions { justify-content: flex-start; }
    .panel-head { flex-wrap: wrap; }
}

@media (max-width: 430px) {
    .brand-group .brand-visual { display: none; }
    .top-actions .button.secondary { font-size: 0; }
    .top-actions .button.secondary::after { content: 'Beamer'; font-size: .72rem; }
    .ranking-row { grid-template-columns: 34px minmax(0,1fr) auto; gap: .4rem; }
    .table-actions { flex-direction: column; }
}
