:root {
    color-scheme: light;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: #17221c;
    background: #f5f6f2;
    font-synthesis: none;
    text-rendering: optimizeLegibility;
    --ink: #17221c;
    --muted: #788078;
    --green: #226c48;
    --green-dark: #174d34;
    --line: #e6e9e2;
    --panel: #fff;
    --soft-green: #eff5ef;
    --radius: 18px;
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

body {
    min-width: 320px;
    min-height: 100vh;
    margin: 0;
    background:
        radial-gradient(ellipse at 50% 0, rgba(220, 233, 217, .56), transparent 36rem),
        #f5f6f2;
}

button,
input,
select {
    font: inherit;
}

button,
a,
input,
select {
    -webkit-tap-highlight-color: transparent;
}

button {
    cursor: pointer;
}

.page-shell {
    width: min(100% - 36px, 620px);
    margin: 0 auto;
    padding: 24px 0 42px;
}

.app-document,
.app-page {
    overflow: hidden;
}

.app-page {
    height: 100vh;
    height: 100dvh;
    min-height: 0;
}

.app-shell {
    display: flex;
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    flex-direction: column;
    overflow: hidden;
    padding-bottom: max(24px, env(safe-area-inset-bottom));
}

.app-page > .app-shell {
    height: calc(100vh - 68px);
    height: calc(100dvh - 60px - max(8px, env(safe-area-inset-bottom)));
}

.app-shell > .site-header,
.app-shell > .intro,
.app-shell > .steps {
    flex: 0 0 auto;
}

.app-shell > .site-header {
    margin-bottom: clamp(12px, 4vh, 34px);
}

.app-shell > .intro {
    margin-bottom: clamp(12px, 3vh, 24px);
}

.app-shell > .steps {
    margin-bottom: clamp(10px, 2vh, 18px);
}

.pool-app-shell > .page-title,
.pool-app-shell > .page-subtitle,
.pool-app-shell > .page-actions {
    flex: 0 0 auto;
}

.setup-panel,
.pool-card {
    min-height: 0;
    flex: 1 1 auto;
}

.setup-panel {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding-bottom: 0;
}

.setup-panel > .panel-heading {
    flex: 0 0 auto;
}

#draftSetupForm {
    display: flex;
    min-height: 0;
    flex: 1 1 auto;
    flex-direction: column;
}

.setup-form-scroll {
    min-height: 0;
    flex: 1 1 auto;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-right: 6px;
}

.setup-form-footer {
    flex: 0 0 auto;
    padding: 12px 0 18px;
    border-top: 1px solid var(--line);
    background: var(--panel);
}

.pool-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.pool-controls {
    flex: 0 0 auto;
}

.player-list-scroll {
    min-height: 0;
    flex: 1 1 auto;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.draft-app-shell > .draft-banner,
.draft-app-shell > .draft-actions {
    flex: 0 0 auto;
}

.draft-actions {
    align-items: center;
    margin-bottom: 12px;
}

.draft-actions-left {
    display: flex;
    min-width: 0;
    flex-wrap: wrap;
    gap: 12px;
}

.draft-actions .button-primary {
    margin-left: auto;
}

.draft-content-scroll {
    display: flex;
    min-height: 0;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 16px;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-bottom: 4px;
}

.draft-content-scroll > .panel {
    flex: 0 0 auto;
}

#teamBudgetList {
    grid-template-columns: minmax(0, 1fr);
}

.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 48px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--ink);
    font-family: 'Segoe UI', sans-serif;
    font-size: 19px;
    font-weight: 700;
    letter-spacing: -.7px;
    text-decoration: none;
}

.brand-wordmark {
    display: block;
    width: auto;
    height: 32px;
}

.header-note {
    color: var(--muted);
    font-size: 12px;
}

.intro {
    margin-bottom: 28px;
}

.eyebrow {
    margin: 0 0 10px;
    color: var(--green);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.3px;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1,
h2,
h3 {
    font-family: 'Segoe UI', sans-serif;
}

h1 {
    margin-bottom: 8px;
    font-size: clamp(34px, 8vw, 46px);
    letter-spacing: -2px;
    line-height: 1.08;
}

.intro-copy {
    max-width: 420px;
    margin-bottom: 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.6;
}

.steps {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 20px;
    color: #a2a9a1;
    font-size: 11px;
    font-weight: 600;
}

.step {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.step.is-current,
.step.is-complete {
    color: var(--green);
}

.step-number {
    display: grid;
    width: 23px;
    height: 23px;
    place-items: center;
    border: 1px solid #dfe4dc;
    border-radius: 50%;
    background: #fff;
    font-size: 10px;
}

.is-current .step-number,
.is-complete .step-number {
    border-color: var(--green);
    background: var(--green);
    color: white;
}

.step-line {
    height: 1px;
    min-width: 8px;
    flex: 1;
    background: #dfe4dc;
}

.panel {
    padding: 26px;
    border: 1px solid rgba(230, 233, 226, .9);
    border-radius: var(--radius);
    background: var(--panel);
    box-shadow: 0 12px 32px rgba(26, 43, 32, .055);
}

.panel-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 23px;
}

.panel-heading .eyebrow {
    margin-bottom: 6px;
}

h2 {
    margin-bottom: 0;
    font-size: 21px;
    letter-spacing: -.7px;
}

.field {
    min-width: 0;
    margin-bottom: 19px;
}

.setup-section + .setup-section {
    margin-top: 80px;
}

.setup-section-heading {
    margin: 0 0 18px;
    color: var(--green);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1.3px;
    text-transform: uppercase;
}

.setup-section > .field,
.setup-section > .choice-fieldset {
    margin-bottom: 12px;
}

.setup-section > :last-child {
    margin-bottom: 0;
}

.setup-section .field-grid {
    row-gap: 10px;
}

.setup-section .field-grid .field {
    margin-bottom: 0;
}

.field-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.field-grid.single-field {
    grid-template-columns: 1fr;
}

label {
    display: block;
    margin-bottom: 8px;
    font-size: 12px;
    font-weight: 700;
}

input,
select {
    width: 100%;
    min-height: 48px;
    padding: 0 13px;
    border: 1px solid #dfe4dc;
    border-radius: 10px;
    outline: none;
    background: #fff;
    color: var(--ink);
    font-size: 14px;
    transition: border-color .15s ease, box-shadow .15s ease;
}

input::placeholder {
    color: #a5aba4;
}

input:focus,
select:focus {
    border-color: #559270;
    box-shadow: 0 0 0 3px rgba(34, 108, 72, .12);
}

.field-hint {
    display: block;
    margin-top: 6px;
    color: var(--muted);
    font-size: 10px;
}

.draft-order-description {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.55;
}

.choice-fieldset {
    min-width: 0;
    padding: 0;
    border: 0;
}

.choice-fieldset legend {
    margin-bottom: 8px;
    padding: 0;
    font-size: 12px;
    font-weight: 700;
}

.choice-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.choice-options-three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

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

.choice-option input {
    position: absolute;
    width: 1px;
    height: 1px;
    min-height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    clip-path: inset(50%);
}

.choice-option > span {
    display: flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    padding: 8px 10px;
    border: 1px solid #dfe4dc;
    border-radius: 10px;
    background: #fff;
    color: var(--ink);
    font-size: 12px;
    line-height: 1.3;
    text-align: center;
    transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease;
}

.choice-option input:checked + span {
    border-color: var(--green);
    background: var(--soft-green);
    color: var(--green-dark);
    box-shadow: inset 0 0 0 1px var(--green);
    font-weight: 700;
}

.choice-option input:focus-visible + span {
    outline: 3px solid rgba(34, 108, 72, .22);
    outline-offset: 2px;
}

.choice-options-three .choice-option > span {
    min-height: 42px;
    padding-right: 5px;
    padding-left: 5px;
}

.participant-preview {
    margin: -2px 0 18px;
    padding: 12px 13px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fbfcfa;
}

.participant-preview .field-hint {
    margin: 0 0 6px;
}

.participant-preview p {
    margin: 0;
    color: #43564a;
    font-size: 11px;
    line-height: 1.7;
}

.position-settings {
    margin: 0 0 19px;
    padding: 15px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fbfcfa;
}

.participant-settings {
    margin: 0 0 19px;
    padding: 15px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fbfcfa;
}

.participant-settings .position-settings-heading h3 {
    margin: 0 0 5px;
    font-size: 14px;
}

.participant-settings .position-settings-heading p {
    margin: 0 0 14px;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.5;
}

.participant-fields {
    display: grid;
    gap: 8px;
}

.participant-fields.is-random .participant-row {
    grid-template-columns: 1fr;
}

.participant-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 110px;
    gap: 9px;
}

.participant-name-input,
.participant-pick-number {
    min-height: 42px;
    font-size: 12px;
}

.participant-pick-number {
    width: 100%;
    padding: 0 9px;
}

.individual-lineup-label {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 0;
    font-size: 12px;
    font-weight: 600;
}

.individual-lineup-label input {
    width: 18px;
    min-height: 18px;
    margin: 0;
    accent-color: var(--green);
}

.individual-lineup-label .field-hint {
    display: inline;
    margin: 0;
    font-weight: 400;
}

.individual-lineup-settings {
    display: grid;
    gap: 14px;
}

.individual-lineup-card {
    padding: 13px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
}

.individual-lineup-card h4 {
    margin: 0 0 10px;
    font-size: 12px;
}

.individual-position-fields {
    gap: 4px 12px;
}

.individual-lineup-total {
    margin-bottom: 0;
}

.participant-preview {
    min-height: 16px;
    margin: 12px 0 0;
    color: var(--muted);
    line-height: 1.5;
}

.position-settings-heading h3 {
    margin: 0 0 5px;
    font-size: 14px;
}

.position-settings-heading p {
    margin: 0 0 14px;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.5;
}

.position-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 12px;
}

.position-field {
    display: flex;
    min-height: 42px;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin: 0;
    font-size: 11px;
    font-weight: 600;
}

.position-field input {
    width: 58px;
    min-height: 38px;
    padding: 0 8px;
    text-align: center;
}

.position-settings > .field-hint {
    margin-top: 13px;
    line-height: 1.5;
}

.validation-message {
    color: #9b3b2d;
}

.setup-summary,
.notice {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 4px 0 20px;
    padding: 13px;
    border-radius: 11px;
    background: var(--soft-green);
    color: #526658;
    font-size: 12px;
    line-height: 1.5;
}

.setup-summary strong {
    color: var(--green-dark);
}

.summary-icon {
    color: var(--green);
    font-size: 18px;
}

.button {
    display: inline-flex;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 0 17px;
    border: 0;
    border-radius: 11px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    transition: background .15s ease, transform .15s ease;
}

.button:active {
    transform: scale(.985);
}

.button-primary {
    background: var(--green);
    color: #fff;
}

.button-primary:hover {
    background: var(--green-dark);
}

.button-secondary {
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink);
}

.button-secondary:hover {
    background: #f7f8f5;
}

.button-danger {
    background: #fff1ee;
    color: #9b3b2d;
}

.button:disabled {
    cursor: not-allowed;
    opacity: .45;
}

.button-full {
    width: 100%;
}

.privacy-note {
    margin: 18px 0 0;
    color: var(--muted);
    font-size: 11px;
    text-align: center;
}

.privacy-note span {
    margin-right: 5px;
}

.page-actions {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
}

.page-actions .button {
    min-width: 110px;
}

.page-actions .button-primary {
    margin-left: auto;
}

.page-title {
    margin-bottom: 7px;
    font-size: clamp(28px, 7vw, 38px);
    letter-spacing: -1.5px;
}

.page-subtitle {
    margin-bottom: 20px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
}

.player-form {
    display: flex;
    gap: 9px;
}

.player-form input {
    flex: 1;
}

.player-form #playerCost {
    flex: 0 0 110px;
}

.player-form select {
    width: 170px;
    flex: 0 0 170px;
}

.player-form .button {
    flex-shrink: 0;
}

.paste-import {
    margin-top: 18px;
    border-top: 1px solid var(--line);
    padding-top: 16px;
}

.paste-import summary {
    color: var(--green);
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
}

.paste-help {
    margin: 11px 0 9px;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.5;
}

.paste-import textarea {
    display: block;
    width: 100%;
    min-height: 130px;
    padding: 11px 12px;
    resize: vertical;
    border: 1px solid #dfe4dc;
    border-radius: 10px;
    outline: none;
    background: #fff;
    color: var(--ink);
    font: 12px/1.5 ui-monospace, SFMono-Regular, Consolas, monospace;
}

.paste-import textarea:focus {
    border-color: #559270;
    box-shadow: 0 0 0 3px rgba(34, 108, 72, .12);
}

.paste-import textarea.paste-example {
    min-height: 0;
    max-height: 170px;
    margin-bottom: 12px;
    resize: vertical;
    background: #f7f9f6;
}

.paste-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.paste-actions .button {
    min-height: 42px;
    padding: 0 12px;
    font-size: 11px;
}

.paste-preview {
    margin-top: 13px;
}

.paste-summary {
    margin: 0 0 9px;
    color: #526658;
    font-size: 11px;
    font-weight: 600;
}

.paste-table-wrap {
    max-height: 260px;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 10px;
}

.paste-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
    text-align: left;
}

.paste-table th,
.paste-table td {
    padding: 9px 10px;
    border-bottom: 1px solid #eff1ed;
    text-align: left;
    vertical-align: top;
}

.paste-table th {
    position: sticky;
    top: 0;
    background: #f7f9f6;
    color: #526658;
}

.paste-row-invalid td:last-child {
    color: #9b3b2d;
}

.list-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin: 22px 0 12px;
}

.list-heading h2 {
    font-size: 16px;
}

.count-label {
    color: var(--muted);
    font-size: 11px;
}

.player-list,
.pick-list {
    display: grid;
    gap: 9px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.player-row,
.pick-row {
    display: flex;
    min-height: 58px;
    align-items: center;
    gap: 12px;
    padding: 9px 11px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: white;
}

.player-avatar {
    display: grid;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    place-items: center;
    border-radius: 11px;
    background: var(--soft-green);
    color: var(--green);
    font-size: 13px;
    font-weight: 700;
}

.player-name {
    min-width: 0;
    flex: 1;
    overflow-wrap: anywhere;
    font-size: 13px;
    font-weight: 600;
}

.remove-button {
    display: grid;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    place-items: center;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: #879088;
    font-size: 20px;
}

.remove-button:hover {
    background: #fff1ee;
    color: #9b3b2d;
}

.empty-state {
    padding: 24px 12px;
    border: 1px dashed #dce3da;
    border-radius: 12px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.6;
    text-align: center;
}

.draft-banner {
    margin-bottom: 16px;
    padding: 18px;
    border-radius: 15px;
    background: var(--green-dark);
    color: white;
    text-align: center;
}

.draft-banner .eyebrow {
    margin-bottom: 7px;
    color: #b5d7be;
}

.draft-banner h2 {
    margin-bottom: 4px;
    font-size: clamp(24px, 5vw, 30px);
    line-height: 1.2;
}

.turn-info {
    margin: 0;
    color: #d3e4d6;
    font-size: 13px;
    font-weight: 600;
}

.participant-tag {
    margin: 0 0 8px;
    color: #b5d7be;
    font-size: 11px;
    font-weight: 500;
}

.participant-tag:empty {
    display: none;
}

.draft-progress {
    height: 5px;
    margin-top: 16px;
    overflow: hidden;
    border-radius: 99px;
    background: rgba(255, 255, 255, .19);
}

.draft-progress-bar {
    height: 100%;
    border-radius: inherit;
    background: #a7d7b5;
    transition: width .2s ease;
}

.player-pick-button {
    display: flex;
    width: 100%;
    min-height: 58px;
    align-items: center;
    gap: 11px;
    padding: 8px 11px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    color: var(--ink);
    text-align: left;
}

.player-pick-button:hover {
    border-color: #a9c9b3;
    background: #fbfdfb;
}

.pick-action {
    margin-left: auto;
    color: var(--green);
    font-size: 11px;
    font-weight: 700;
}

.pick-row {
    min-height: 52px;
}

.pick-number {
    display: grid;
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    place-items: center;
    border-radius: 9px;
    background: #f0f2ee;
    color: #606d62;
    font-size: 10px;
    font-weight: 700;
}

.pick-meta {
    display: grid;
    gap: 3px;
}

.pick-meta strong {
    font-size: 12px;
}

.pick-meta span {
    color: var(--muted);
    font-size: 10px;
}

.pick-position {
    color: var(--green) !important;
}

.results-page {
    width: min(100% - 36px, 1100px);
}

.results-heading {
    margin: 0 0 20px;
}

.results-heading .eyebrow {
    margin-bottom: 7px;
}

.results-heading h1 {
    margin-bottom: 8px;
    font-size: clamp(30px, 6vw, 42px);
}

.results-heading p:last-child {
    margin-bottom: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.6;
}

.ready-card {
    max-width: 560px;
    margin: 48px auto;
    padding: clamp(26px, 6vw, 48px);
    border: 1px solid var(--line);
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 16px 44px rgba(26, 43, 32, .07);
    text-align: center;
}

.ready-card .eyebrow {
    margin-bottom: 10px;
    color: var(--green);
}

.ready-card h1 {
    margin-bottom: 12px;
    font-size: clamp(30px, 7vw, 44px);
    line-height: 1.1;
    transition: opacity .25s ease;
}

.ready-card h1.ready-title-changing {
    opacity: 0;
}

.ready-message {
    max-width: 380px;
    margin: 0 auto;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.65;
}

.ready-widget-space {
    width: min(100%, 380px);
    height: 88px;
    margin: 0 auto;
}

.ready-progress {
    width: min(100%, 380px);
    height: 7px;
    margin: 0 auto 22px;
    overflow: hidden;
    border-radius: 99px;
    background: #e8eee8;
}

.ready-progress[hidden] {
    display: none;
}

.ready-progress-bar {
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: var(--green);
}

.ready-continue[hidden] {
    display: none;
}

.team-grid {
    display: grid;
    grid-template-columns: repeat(var(--team-count), minmax(190px, 1fr));
    gap: 14px;
    overflow-x: auto;
    padding: 2px 2px 16px;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
}

.team-grid.is-lineup {
    grid-template-columns: repeat(var(--team-count), minmax(300px, 1fr));
}

@media (min-width: 700px) {
    #teamBudgetList {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.team-card {
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 15px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(26, 43, 32, .045);
    scroll-snap-align: start;
}

.team-card-heading {
    min-height: 83px;
    padding: 16px;
    background: var(--green-dark);
    color: #fff;
}

.team-card-heading .eyebrow {
    margin-bottom: 6px;
    color: #b5d7be;
}

.team-card-heading h2 {
    font-size: 16px;
    line-height: 1.35;
}

.team-card-tag {
    margin: 4px 0 0;
    color: #b5d7be;
    font-size: 11px;
    line-height: 1.4;
}

.team-budget-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 14px;
    margin: 12px 14px;
    padding: 10px;
    border-radius: 9px;
    background: var(--soft-green);
}

.budget-row {
    flex-wrap: wrap;
}

.budget-row .budget-metrics {
    flex: 1 1 100%;
    padding-left: 48px;
}

.budget-metrics {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 14px;
}

.budget-metric {
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
    color: var(--ink);
    font-size: 11px;
    line-height: 1.4;
}

.budget-label {
    color: var(--muted);
}

.budget-value {
    font-size: 14px;
    font-weight: 700;
}

.budget-spent .budget-value {
    font-size: 15px;
}

.budget-status {
    padding: 4px 8px;
    border-radius: 7px;
    background: var(--soft-green);
    color: var(--green-dark);
    font-weight: 700;
}

.budget-status .budget-label,
.budget-status .budget-value {
    color: inherit;
}

.budget-status.is-over-budget {
    background: #fbefed;
    color: #9b3b2d;
}

.team-roster {
    display: grid;
    gap: 0;
    margin: 0;
    padding: 0 14px;
    list-style: none;
}

.team-roster li {
    display: flex;
    min-height: 53px;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid #eff1ed;
}

.team-roster li:last-child {
    border-bottom: 0;
}

.standard-roster > .lineup-player-pick {
    gap: 8px;
}

.standard-roster > .lineup-player-pick .roster-player {
    flex: 1;
}

.standard-roster > .lineup-player-pick .lineup-total-pick {
    color: var(--muted);
    font-size: 10px;
    opacity: 1;
    white-space: nowrap;
}

.roster-pick-number {
    display: grid;
    width: 29px;
    height: 29px;
    flex-shrink: 0;
    place-items: center;
    clip-path: polygon(25% 0, 40% 0, 45% 7%, 55% 7%, 60% 0, 75% 0, 100% 24%, 81% 44%, 72% 34%, 72% 100%, 28% 100%, 28% 34%, 19% 44%, 0 24%);
    background: var(--green);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
}

.roster-player {
    min-width: 0;
    overflow-wrap: anywhere;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
}

.team-position-group {
    padding: 10px 0 4px;
    border-bottom: 1px solid #eff1ed;
}

.team-position-group:last-child {
    border-bottom: 0;
}

.team-position-label {
    margin: 0 0 2px;
    color: var(--green);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .3px;
}

.team-position-group .team-roster {
    padding: 0;
}

.team-position-group .team-roster li {
    min-height: 44px;
    border-bottom: 0;
}

.lineup-pitch {
    position: relative;
    isolation: isolate;
    display: grid;
    gap: 0;
    margin: 14px 10px;
    padding: 8px 5px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .45);
    border-radius: 12px;
    background:
        linear-gradient(rgba(25, 104, 61, .88), rgba(25, 104, 61, .88)),
        repeating-linear-gradient(0deg, #318450 0, #318450 42px, #287646 42px, #287646 84px);
}

.lineup-standard {
    display: block;
}

.lineup-standard .team-roster {
    position: relative;
    padding: 0 10px;
}

.lineup-standard .team-roster li {
    border-bottom-color: var(--lineup-marking);
}

.lineup-pitch::before {
    position: absolute;
    z-index: -1;
    inset: 7px;
    border: 1px solid var(--lineup-marking, rgba(255, 255, 255, .55));
    border-radius: 8px;
    background-repeat: no-repeat;
    content: "";
    pointer-events: none;
}

.lineup-football::before {
    background-image:
        linear-gradient(var(--lineup-marking, rgba(255, 255, 255, .55)), var(--lineup-marking, rgba(255, 255, 255, .55))),
        radial-gradient(circle, transparent 0 17px, var(--lineup-marking, rgba(255, 255, 255, .55)) 18px 19px, transparent 20px);
    background-position: center;
    background-size: 100% 1px, 40px 40px;
}

.lineup-hockey {
    border-color: #a9cbd8;
    --lineup-marking: rgba(76, 142, 173, .48);
    background: #c9e9f3;
}

.lineup-hockey::before {
    background-image:
        linear-gradient(var(--lineup-marking), var(--lineup-marking)),
        linear-gradient(var(--lineup-marking), var(--lineup-marking)),
        linear-gradient(var(--lineup-marking), var(--lineup-marking)),
        radial-gradient(circle, transparent 0 13px, var(--lineup-marking) 14px 15px, transparent 16px),
        radial-gradient(circle, transparent 0 13px, var(--lineup-marking) 14px 15px, transparent 16px);
    background-position: center, center 30%, center 70%, 12% 50%, 88% 50%;
    background-size: 100% 1px, 100% 2px, 100% 2px, 32px 32px, 32px 32px;
}

.lineup-basketball {
    border-color: #e6cc86;
    --lineup-marking: rgba(151, 105, 40, .42);
    background: #f4e4b2;
}

.lineup-basketball::before {
    background-image:
        radial-gradient(ellipse 32% 22% at 50% 0%, transparent 97%, var(--lineup-marking) 98% 100%, transparent 101%),
        radial-gradient(ellipse 32% 22% at 50% 100%, transparent 97%, var(--lineup-marking) 98% 100%, transparent 101%),
        linear-gradient(var(--lineup-marking), var(--lineup-marking)),
        radial-gradient(circle, transparent 0 16px, var(--lineup-marking) 17px 18px, transparent 19px),
        linear-gradient(var(--lineup-marking), var(--lineup-marking)),
        linear-gradient(var(--lineup-marking), var(--lineup-marking)),
        linear-gradient(var(--lineup-marking), var(--lineup-marking)),
        linear-gradient(var(--lineup-marking), var(--lineup-marking)),
        linear-gradient(var(--lineup-marking), var(--lineup-marking)),
        linear-gradient(var(--lineup-marking), var(--lineup-marking));
    background-position:
        center,
        center,
        center,
        center,
        40% 0,
        60% 0,
        50% 18%,
        40% 100%,
        60% 100%,
        50% 82%;
    background-size:
        100% 100%,
        100% 100%,
        100% 1px,
        38px 38px,
        1px 18%,
        1px 18%,
        20% 1px,
        1px 18%,
        1px 18%,
        20% 1px;
}

.lineup-extra-position {
    margin-left: 14px;
}

.lineup-extra-position .lineup-player-pick {
    gap: 8px;
}

.lineup-extra-position .roster-pick-number {
    width: 28px;
    height: 28px;
    background: #fff;
    color: var(--green);
    font-size: 12px;
}

.lineup-extra-position .lineup-total-pick {
    color: var(--muted);
}

.lineup-row {
    display: grid;
    min-height: 72px;
    align-items: center;
}

.lineup-position {
    min-width: 0;
    padding: 4px 1px;
    border-bottom: 0;
    text-align: center;
}

.lineup-position .team-position-label {
    display: none;
}

.lineup-position .team-roster {
    padding: 0;
}

.lineup-center-position .team-roster {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
}

.lineup-position .team-roster li {
    min-height: 0;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    border: 0;
    text-align: center;
}

.lineup-center-position .team-roster li {
    flex: 0 0 33.333%;
}

.lineup-position .lineup-player-pick {
    padding: 3px 0;
}

.lineup-position .roster-player {
    order: 0;
    font-size: 13px;
    font-weight: 700;
}

.lineup-position .roster-pick-number {
    order: 1;
    width: 28px;
    height: 28px;
    background: #fff;
    color: var(--green);
    font-size: 12px;
}

.lineup-player-position {
    order: 2;
    font-size: 9px;
    line-height: 1.2;
}

.lineup-total-pick {
    order: 3;
    font-size: 8px;
    line-height: 1.25;
    opacity: .75;
}

.lineup-pitch .team-position-label,
.lineup-pitch .roster-player,
.lineup-pitch .lineup-player-position,
.lineup-pitch .lineup-total-pick {
    color: #fff;
}

.lineup-hockey .team-position-label,
.lineup-hockey .roster-player,
.lineup-hockey .lineup-player-position,
.lineup-hockey .lineup-total-pick,
.lineup-basketball .team-position-label,
.lineup-basketball .roster-player,
.lineup-basketball .lineup-player-position,
.lineup-basketball .lineup-total-pick {
    color: #173b36;
}

.roster-pick-number.football-shirt-1 {
    --shorts-color: #111;
    background:
        linear-gradient(to bottom, transparent 0 68%, #111 68% 100%),
        linear-gradient(to bottom, #17191f 0 24%, transparent 24%),
        repeating-linear-gradient(135deg, transparent 0 5px, #17191f 5px 5.7px, transparent 5.7px 11px),
        repeating-linear-gradient(45deg, transparent 0 5px, #17191f 5px 5.7px, transparent 5.7px 11px),
        linear-gradient(90deg, #159cf2 0 20%, #8ade46 20% 40%, #ffe52f 40% 60%, #f34a9e 60% 80%, #883bce 80% 100%);
    color: #fff;
}

.roster-pick-number.football-shirt-2 {
    --shorts-color: #1769c2;
    background: linear-gradient(to bottom, #ffdf00 0 68%, #1769c2 68% 100%);
    color: #168235;
}

.roster-pick-number.football-shirt-3 {
    --shorts-color: #fff;
    background:
        linear-gradient(to bottom, transparent 0 66%, #111 66% 70%, #fff 70% 100%),
        linear-gradient(90deg, #111 0 20%, #c9162b 20% 40%, #111 40% 60%, #c9162b 60% 80%, #111 80% 100%);
    color: #fff;
}

.roster-pick-number.football-shirt-4 {
    --shorts-color: #fff;
    background:
        linear-gradient(to bottom, transparent 0 66%, #111 66% 70%, #fff 70% 100%),
        linear-gradient(90deg, #f5f5f2 0 24%, #d51d31 24% 76%, #f5f5f2 76% 100%);
    color: #fff;
}

.roster-pick-number.football-shirt-5 {
    --shorts-color: #111;
    background:
        linear-gradient(to bottom, transparent 0 68%, #111 68% 100%),
        linear-gradient(90deg, #76b9ec 0 20%, #fff 20% 40%, #76b9ec 40% 60%, #fff 60% 80%, #76b9ec 80% 100%);
    color: #153d68;
}

.roster-pick-number.football-shirt-6 {
    --shorts-color: #fff;
    background:
        linear-gradient(to bottom, transparent 0 66%, #111 66% 70%, #fff 70% 100%),
        linear-gradient(to bottom, #0877d9 0 68%, #fff 68% 100%);
    color: #fff;
}

.roster-pick-number.football-shirt-7 {
    --shorts-color: #fff;
    background:
        linear-gradient(to bottom, transparent 0 66%, #111 66% 70%, #fff 70% 100%),
        linear-gradient(90deg, #e5c65e 0 9%, #fff 9% 91%, #e5c65e 91% 100%);
    color: #174b8c;
}

.roster-pick-number.football-shirt-8 {
    --shorts-color: #fff;
    background:
        linear-gradient(to bottom, transparent 0 66%, #111 66% 70%, #fff 70% 100%),
        linear-gradient(to bottom, #754326 0 68%, #fff 68% 100%);
    color: #fff;
}

.roster-pick-number.football-shirt-9 {
    --shorts-color: #111;
    background: linear-gradient(to bottom, #ff7900 0 68%, #111 68% 100%);
    color: #fff;
}

.roster-pick-number.football-shirt-10 {
    --shorts-color: #fff;
    background:
        linear-gradient(to bottom, transparent 0 66%, #111 66% 70%, #fff 70% 100%),
        linear-gradient(to bottom, #79d5f2 0 68%, #fff 68% 100%);
    color: #174b8c;
}

.roster-pick-number.football-shirt-11 {
    --shorts-color: #fff;
    background:
        linear-gradient(to bottom, transparent 0 66%, #111 66% 70%, #fff 70% 100%),
        linear-gradient(90deg, #d71932 0 15%, #fff 15% 30%, #d71932 30% 70%, #fff 70% 85%, #d71932 85% 100%);
    color: #fff;
}

.roster-pick-number.football-shirt {
    position: relative;
    display: block;
    isolation: isolate;
    filter: drop-shadow(0 0 1px #111);
}

.roster-pick-number.football-shirt::before {
    position: absolute;
    z-index: 1;
    top: 67%;
    left: 23%;
    width: 54%;
    height: 33%;
    background-color: #111;
    background-image:
        linear-gradient(90deg, transparent calc(50% - .5px), #111 calc(50% - .5px) calc(50% + .5px), transparent calc(50% + .5px)),
        linear-gradient(var(--shorts-color), var(--shorts-color));
    background-position: center, center;
    background-repeat: no-repeat;
    background-size: 100% 100%, calc(100% - 2px) calc(100% - 2px);
    clip-path: polygon(0 0, 100% 0, 100% 100%, 57% 100%, 50% 58%, 43% 100%, 0 100%);
    content: "";
    pointer-events: none;
}

.football-shirt-number {
    position: absolute;
    top: 2px;
    left: 50%;
    z-index: 3;
    transform: translateX(-50%);
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    text-shadow: -1px -1px 0 #111, 1px -1px 0 #111, -1px 1px 0 #111, 1px 1px 0 #111;
}

.football-shirt-2 .football-shirt-number,
.football-shirt-5 .football-shirt-number,
.football-shirt-7 .football-shirt-number,
.football-shirt-10 .football-shirt-number {
    text-shadow: none;
}

.roster-empty {
    padding: 18px 14px;
    color: var(--muted);
    font-size: 12px;
}

.scroll-hint {
    margin: 0 0 18px;
    color: var(--muted);
    font-size: 11px;
}

.notice {
    margin: 14px 0 0;
}

.bmc-btn-container {
    margin: -20px auto 20px;
    text-align: center;
}

.app-page > .bmc-btn-container {
    position: fixed;
    z-index: 10;
    right: 0;
    bottom: max(8px, env(safe-area-inset-bottom));
    left: 0;
    margin: 0 auto;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    clip-path: inset(50%);
}

@media (max-width: 480px) {
    .page-shell {
        width: min(100% - 28px, 620px);
        padding-top: max(18px, env(safe-area-inset-top));
        padding-bottom: max(28px, env(safe-area-inset-bottom));
    }

    .app-shell {
        padding-bottom: max(18px, env(safe-area-inset-bottom));
    }

    .site-header {
        margin-bottom: 34px;
    }

    .panel {
        padding: 21px 17px;
    }

    .steps {
        gap: 6px;
        font-size: 10px;
    }

    .step {
        gap: 4px;
    }

    .step-number {
        width: 21px;
        height: 21px;
    }

    .player-form {
        align-items: stretch;
    }

    .player-form.is-budget-mode {
        flex-wrap: wrap;
    }

    .player-form .button {
        padding: 0 13px;
    }

    .player-form.is-position-mode {
        flex-wrap: wrap;
    }

    .player-form.is-budget-mode input[name="playerName"] {
        flex: 1 1 150px;
    }

    .player-form.is-budget-mode #playerCost {
        flex: 1 1 80px;
    }

    .player-form.is-position-mode input {
        flex-basis: calc(100% - 100px);
    }

    .player-form select {
        width: 100%;
        flex-basis: 100%;
        order: 1;
    }

    .player-form.is-position-mode .button {
        order: 0;
    }

    .player-form.is-position-mode.is-budget-mode {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 72px auto;
    }

    .player-form.is-position-mode.is-budget-mode input[name="playerName"] {
        grid-column: 1;
        min-width: 0;
        flex: none;
    }

    .player-form.is-position-mode.is-budget-mode #playerCost {
        grid-column: 2;
        grid-row: 1;
        min-width: 0;
        flex: none;
    }

    .player-form.is-position-mode.is-budget-mode select {
        grid-column: 1 / -1;
        flex: none;
        order: 0;
    }

    .player-form.is-position-mode.is-budget-mode .button {
        grid-column: 3;
        grid-row: 1;
        order: 0;
    }

    .position-fields {
        grid-template-columns: 1fr;
        gap: 5px;
    }

    .results-page {
        width: min(100% - 28px, 1100px);
    }

    .team-grid {
        grid-template-columns: repeat(var(--team-count), minmax(220px, 78vw));
        gap: 11px;
    }

    .team-grid.is-lineup {
        grid-template-columns: repeat(var(--team-count), minmax(300px, 84vw));
    }

    .draft-actions {
        gap: 8px;
    }

    .draft-actions-left {
        gap: 8px;
    }

    .draft-actions .button {
        min-width: 0;
        padding-right: 11px;
        padding-left: 11px;
    }
}

@media (max-height: 700px) {
    .app-shell > .site-header {
        margin-bottom: 10px;
    }

    .app-shell > .intro {
        margin-bottom: 10px;
    }

    .app-shell > .steps {
        margin-bottom: 8px;
    }

    .draft-banner {
        margin-bottom: 10px;
        padding: 12px;
    }
}

@media (max-height: 560px) {
    .app-shell {
        padding-top: max(8px, env(safe-area-inset-top));
        padding-bottom: max(8px, env(safe-area-inset-bottom));
    }

    .app-shell > .site-header {
        margin-bottom: 4px;
    }

    .app-shell > .steps {
        margin-bottom: 4px;
    }

    .pool-app-shell > .page-title {
        font-size: 26px;
        line-height: 1.15;
        margin-bottom: 4px;
    }

    .pool-app-shell > .page-subtitle {
        margin-bottom: 4px;
        font-size: 11px;
        line-height: 1.35;
    }

    .pool-app-shell > .page-actions {
        margin-bottom: 4px;
    }

    .pool-app-shell > .page-actions .button {
        min-height: 36px;
    }

    .pool-card {
        padding: 12px 14px;
    }

    .pool-card .panel-heading {
        margin-bottom: 6px;
    }

    .pool-card .player-form {
        gap: 6px;
    }

    .pool-card .player-form input,
    .pool-card .player-form select {
        min-height: 40px;
    }

    .pool-card .paste-import {
        margin-top: 6px;
        padding-top: 6px;
    }

    .pool-card .notice {
        margin: 4px 0;
        padding: 4px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
    }
}
