  * { box-sizing: border-box; }
  :root {
    --parchment: #F1E5C8;
    --card: #FBF4E2;
    --ink: #2A1810;
    --ink-soft: rgba(42,24,16,0.62);
    --ink-faint: rgba(42,24,16,0.4);
    --oxblood: #7A2418;
    --oxblood-soft: rgba(122,36,24,0.28);
    --mustard: #B9791A;
    --mustard-bright: #D9A441;
  }
  body {
    margin: 0;
    min-height: 100vh;
    background: var(--parchment);
    font-family: 'Helvetica Neue', Arial, sans-serif;
    color: var(--ink);
    padding-bottom: 4rem;
  }
  .display { font-family: Impact, 'Arial Narrow Bold', sans-serif; text-transform: uppercase; }
  .yardlines {
    background-image: repeating-linear-gradient(90deg, rgba(122,36,24,0.06) 0px, rgba(122,36,24,0.06) 1px, transparent 1px, transparent 64px);
    border-bottom: 2px solid var(--oxblood-soft);
    padding: 2.5rem 1.5rem 2rem;
  }
  .wrap { max-width: 780px; margin: 0 auto; }
  .eyebrow { font-size: 12px; letter-spacing: 0.16em; color: var(--mustard); font-weight: 700; margin-bottom: 10px; }
  h1 { font-weight: 400; font-size: clamp(2.2rem, 6vw, 3.4rem); letter-spacing: 0.01em; margin: 0; line-height: 0.95; color: var(--oxblood); }
  .sub { color: var(--ink-soft); font-size: 15px; margin-top: 10px; max-width: 520px; }
  .progressRow { display: flex; align-items: center; gap: 14px; margin-top: 22px; }
  .progressTrack { flex: 1; height: 6px; background: rgba(42,24,16,0.12); border-radius: 3px; overflow: hidden; }
  .progressFill { height: 100%; background: var(--mustard-bright); transition: width 0.3s ease; width: 0%; }
  .progressLabel { font-size: 13px; font-variant-numeric: tabular-nums; color: var(--ink-soft); white-space: nowrap; }

  .main { max-width: 780px; margin: 0 auto; padding: 2.5rem 1.5rem 0; }
  .compRow { display: flex; align-items: center; justify-content: center; gap: 14px; margin-bottom: 18px; position: relative; }
  .compLabel { text-align: center; font-size: 12px; letter-spacing: 0.14em; color: var(--ink-faint); font-weight: 700; margin-bottom: 0; }
  .undoBtn {
    position: absolute; right: 0;
    background: transparent; border: 1px solid var(--oxblood-soft); color: var(--oxblood);
    border-radius: 6px; padding: 5px 12px; font-size: 12px; font-weight: 700;
    cursor: pointer; font-family: inherit; transition: border-color 0.15s ease, color 0.15s ease;
  }
  .undoBtn:hover:not(:disabled) { border-color: var(--oxblood); }
  .undoBtn:disabled { opacity: 0.3; cursor: not-allowed; }
  @media (max-width: 480px) {
    .compRow { flex-direction: column; gap: 8px; }
    .undoBtn { position: static; }
  }
  .matchup { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; }
  .vs { font-size: 22px; color: var(--oxblood); text-align: center; }
  @media (max-width: 520px) {
    .matchup { grid-template-columns: 1fr; }
    .matchup .pcard:first-child { order: 1; }
    .vs { order: 2; }
    .matchup .pcard:last-child { order: 3; }
  }

  .pcard {
    background: var(--card);
    color: var(--ink);
    border-radius: 10px;
    border: 2px solid var(--oxblood-soft);
    padding: 0 1rem 1.4rem;
    text-align: center;
    min-height: 150px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    cursor: pointer;
    overflow: hidden;
    transition: transform 0.15s ease, border-color 0.15s ease;
    animation: cardIn 0.35s ease;
  }
  .pcard:hover { transform: translateY(-3px); border-color: var(--oxblood); }
  .pcard:active { transform: scale(0.98); }
  .pcard.won { animation: cardIn 0.35s ease, flash 0.5s ease-out; }
  .teamStripe { height: 10px; margin: 0 -1rem 12px; }
  .teamBadge {
    display: inline-block; align-self: center;
    font-size: 11px; letter-spacing: 0.1em; font-weight: 700;
    padding: 2px 10px; border-radius: 999px; margin-bottom: 4px;
  }
  .pcard .name { font-size: clamp(1.2rem, 4vw, 1.6rem); line-height: 1.05; }
  .pcard .pos { font-size: 11px; color: var(--ink-faint); margin-top: 6px; }
  .statsPanel {
    margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--oxblood-soft);
    font-size: 12px; line-height: 1.6; color: var(--ink-soft); text-align: left;
  }
  .statsPanel .ppg { font-weight: 700; color: var(--ink); font-size: 13px; display: block; margin-bottom: 2px; }
  .draftLine { display: block; margin-top: 4px; font-size: 11px; color: var(--ink-faint); font-style: italic; }
  .draftRange { color: var(--mustard); margin-top: 2px; }

  @keyframes cardIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
  @keyframes flash { 0% { box-shadow: 0 0 0 0 rgba(185,121,26,0.6); } 100% { box-shadow: 0 0 0 14px rgba(185,121,26,0); } }

  .doneBox { text-align: center; padding: 2rem 0 1rem; }
  .doneBox h2 { font-size: 2rem; margin: 12px 0 8px; color: var(--oxblood); }
  .doneBox p { color: var(--ink-soft); font-size: 15px; margin: 0; }

  .boardSection { margin-top: 40px; border-top: 2px solid var(--oxblood-soft); padding-top: 20px; }
  .boardToggle {
    display: flex; align-items: center; gap: 8px;
    background: none; border: none; color: var(--ink);
    font-size: 14px; font-weight: 700; letter-spacing: 0.04em;
    cursor: pointer; padding: 0; font-family: inherit;
  }
  .boardList { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
  .boardRow {
    display: flex; align-items: center; gap: 12px;
    background: var(--card); border: 1px solid var(--oxblood-soft);
    border-radius: 6px; padding: 8px 12px;
    animation: cardIn 0.25s ease;
  }
  .boardRow .rk { font-size: 18px; color: var(--oxblood); width: 32px; text-align: right; }
  .boardRow .nm { font-size: 14px; font-weight: 600; flex: 1; }
  .boardRow .posTag {
    font-size: 10px; font-weight: 700; color: var(--card); background: var(--mustard);
    border-radius: 4px; padding: 2px 6px; letter-spacing: 0.04em;
  }
  .boardRow .tm { font-size: 12px; color: var(--ink-faint); font-family: ui-monospace, monospace; }
  .boardRow .removeBtn {
    background: none; border: 1px solid var(--oxblood-soft); color: var(--ink-faint);
    border-radius: 50%; width: 26px; height: 26px; line-height: 1; font-size: 14px;
    cursor: pointer; font-family: inherit; flex-shrink: 0; padding: 0; margin-left: 6px;
  }
  .boardRow .removeBtn:hover { border-color: var(--oxblood); color: var(--oxblood); background: rgba(122,36,24,0.08); }
  .boardRow.draggableRow { cursor: grab; }
  .boardRow.dragging { opacity: 0.4; }
  .boardRow.dragOver { border-color: var(--mustard); border-width: 2px; background: rgba(185,121,26,0.08); }
  .dragHandle { color: var(--ink-faint); font-size: 14px; cursor: grab; flex-shrink: 0; user-select: none; padding: 4px; }
  .nudgeGroup { display: flex; gap: 4px; flex-shrink: 0; }
  .nudgeBtn {
    background: none; border: 1px solid var(--oxblood-soft); color: var(--ink-faint);
    border-radius: 5px; width: 28px; height: 26px; line-height: 1; font-size: 10px;
    cursor: pointer; font-family: inherit; flex-shrink: 0; padding: 0;
  }
  .nudgeBtn:hover:not(:disabled) { border-color: var(--oxblood); color: var(--oxblood); }
  .nudgeBtn:disabled { opacity: 0.25; cursor: not-allowed; }
  /* Native HTML5 drag-and-drop doesn't work on touch devices in most mobile
     browsers -- hide the (non-functional there) handle and rely on the
     up/down buttons, which work everywhere, below this width. */
  @media (max-width: 520px) {
    .dragHandle { display: none; }
  }
  .skipRow { text-align: center; margin-top: 14px; }
  .skipBtn {
    background: none; border: none; color: var(--ink-faint); font-size: 12px;
    font-family: inherit; cursor: pointer; text-decoration: underline; padding: 4px 8px;
  }
  .skipBtn:hover { color: var(--oxblood); }
  .tierHeaderRow { list-style: none; padding: 10px 2px 2px; }
  .tierHeaderLabel { font-size: 1.1rem; color: var(--oxblood); letter-spacing: 0.02em; }
  .tierDivider {
    list-style: none; display: flex; align-items: center; gap: 10px;
    padding: 10px 2px; margin: 2px 0;
  }
  .tierDividerLine { flex: 1; height: 2px; background: var(--oxblood); border-radius: 1px; }
  .tierDividerLabel { font-size: 1rem; color: var(--oxblood); white-space: nowrap; }
  .tierRemoveBtn {
    background: none; border: 1px solid var(--oxblood-soft); color: var(--oxblood);
    border-radius: 50%; width: 20px; height: 20px; line-height: 1; font-size: 14px;
    cursor: pointer; font-family: inherit; flex-shrink: 0; padding: 0;
  }
  .tierRemoveBtn:hover { border-color: var(--oxblood); background: rgba(122,36,24,0.08); }
  .addTierRow { list-style: none; padding: 0; margin: 0; }
  .addTierBtn {
    width: 100%; background: none; border: none; border-top: 1px dashed var(--oxblood-soft);
    color: var(--ink-faint); font-size: 11px; font-family: inherit; cursor: pointer;
    padding: 6px 0 2px; opacity: 0.4; transition: opacity 0.15s ease, color 0.15s ease;
  }
  .addTierRow:hover .addTierBtn, .addTierBtn:focus { opacity: 1; color: var(--oxblood); }
  .waitingNote { font-size: 12px; color: var(--ink-faint); margin-top: 10px; }
  .addPlayerSection { margin-top: 20px; padding-top: 16px; border-top: 1px dashed var(--oxblood-soft); }
  .addPlayerInput {
    width: 100%; background: var(--card); border: 2px solid var(--oxblood-soft);
    border-radius: 8px; padding: 10px 12px; font-size: 14px; color: var(--ink);
    font-family: inherit;
  }
  .addPlayerInput:focus { outline: none; border-color: var(--oxblood); }
  .addPlayerResults { margin-top: 8px; display: flex; flex-direction: column; gap: 4px; max-height: 260px; overflow-y: auto; }
  .addPlayerResult {
    display: flex; align-items: center; gap: 10px;
    background: var(--card); border: 1px solid var(--oxblood-soft); border-radius: 6px;
    padding: 8px 10px; cursor: pointer; transition: border-color 0.15s ease;
  }
  .addPlayerResult:hover { border-color: var(--oxblood); }
  .addPlayerResult .stripe { width: 6px; align-self: stretch; border-radius: 3px; flex-shrink: 0; }
  .addPlayerResult .nm { font-size: 14px; font-weight: 600; flex: 1; }
  .addPlayerResult .meta { font-size: 11px; color: var(--ink-faint); font-family: ui-monospace, monospace; }
  .addPlayerEmpty { font-size: 13px; color: var(--ink-faint); padding: 8px 2px; }

  .actions { margin-top: 32px; display: flex; gap: 12px; flex-wrap: wrap; }
  .btn {
    display: flex; align-items: center; gap: 8px;
    border-radius: 6px; padding: 10px 16px; font-size: 13px; font-weight: 700;
    cursor: pointer; font-family: inherit; border: none;
  }
  .btn.primary { background: var(--mustard-bright); color: var(--ink); }
  .btn.secondary { background: transparent; color: var(--oxblood); border: 1px solid var(--oxblood-soft); }
  .btn:disabled { opacity: 0.4; cursor: not-allowed; }

  .hidden { display: none !important; }
  .toast {
    margin-top: 14px; padding: 12px 16px; border-radius: 8px;
    background: rgba(122,36,24,0.1); border: 1px solid var(--oxblood);
    color: var(--oxblood); font-size: 13px; line-height: 1.5;
  }
  .siteFooter {
    max-width: 780px; margin: 48px auto 0; padding: 20px 1.5rem 32px;
    border-top: 1px solid var(--oxblood-soft); font-size: 11px; line-height: 1.6;
    color: var(--ink-faint);
  }
  .siteFooter a { color: var(--ink-faint); text-decoration: underline; }
  .siteFooter a:hover { color: var(--oxblood); }
  .resumeBanner {
    background: rgba(185,121,26,0.1); border: 1px solid var(--mustard); border-radius: 8px;
    padding: 14px 16px; margin-bottom: 24px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  }
  .resumeBanner p { margin: 0; font-size: 13px; color: var(--ink); flex: 1; min-width: 200px; }
  .resumeBanner .btnRow { display: flex; gap: 8px; }

  /* Start screen */
  .startScreen { max-width: 780px; margin: 0 auto; padding: 2.5rem 1.5rem 0; }
  .startLabel { font-size: 12px; letter-spacing: 0.14em; color: var(--ink-soft); font-weight: 700; margin: 0 0 14px; }
  .mergeWarning {
    background: rgba(122,36,24,0.08); border: 1px solid var(--oxblood-soft); border-radius: 8px;
    padding: 12px 16px; font-size: 13px; line-height: 1.5; color: var(--oxblood); margin-bottom: 24px;
  }
  .chipRow { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 20px; }
  .countChip {
    background: var(--card);
    border: 2px solid var(--oxblood-soft);
    border-radius: 999px;
    padding: 8px 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    color: var(--ink);
    transition: border-color 0.15s ease, background 0.15s ease;
  }
  .countChip:hover { border-color: var(--mustard); }
  .countChip.selected { border-color: var(--oxblood); background: rgba(122,36,24,0.08); color: var(--oxblood); }
  .weekRow { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
  .weekRow label { font-size: 13px; color: var(--ink-soft); font-weight: 600; }
  .weekSelect {
    background: var(--card); border: 2px solid var(--oxblood-soft); border-radius: 8px;
    padding: 8px 14px; font-size: 14px; font-weight: 600; color: var(--ink); font-family: inherit;
  }
  .weekSelect:focus { outline: none; border-color: var(--oxblood); }
  .posGrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; margin-bottom: 36px; }
  .posCard {
    background: var(--card);
    border: 2px solid var(--oxblood-soft);
    border-radius: 10px;
    padding: 1.4rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
  }
  .posCard:hover { border-color: var(--mustard); }
  .posCard.selected { border-color: var(--oxblood); background: rgba(122,36,24,0.06); }
  .posCard.locked { opacity: 0.45; cursor: not-allowed; }
  .posCard.locked:hover { border-color: var(--oxblood-soft); }
  .posCard.finished { border-color: rgba(122,36,24,0.5); }
  .posCard .posName { font-size: 1.6rem; color: var(--oxblood); }
  .posCard .posCount { font-size: 12px; color: var(--ink-soft); margin-top: 4px; }
  .posCard .posCheck { font-size: 11px; color: var(--mustard); margin-top: 4px; font-weight: 700; }

  .countControl { max-width: 420px; margin-bottom: 12px; }
  .countValueDisplay { font-family: Impact, 'Arial Narrow Bold', sans-serif; text-transform: uppercase; font-size: 1.7rem; color: var(--oxblood); margin-bottom: 10px; }
  .countSlider {
    -webkit-appearance: none; appearance: none;
    width: 100%; height: 6px; background: rgba(42,24,16,0.15);
    border-radius: 3px; outline: none; cursor: pointer;
  }
  .countSlider::-webkit-slider-thumb {
    -webkit-appearance: none; width: 22px; height: 22px; border-radius: 50%;
    background: var(--oxblood); border: 3px solid var(--card);
    box-shadow: 0 0 0 1px var(--oxblood); cursor: pointer;
  }
  .countSlider::-moz-range-thumb {
    width: 22px; height: 22px; border-radius: 50%;
    background: var(--oxblood); border: 3px solid var(--card);
    box-shadow: 0 0 0 1px var(--oxblood); cursor: pointer;
  }
  .sliderMinMax { display: flex; justify-content: space-between; font-size: 11px; color: var(--ink-faint); margin-top: 4px; }
  .countInputRow { display: flex; align-items: center; gap: 10px; margin-top: 16px; }
  .countInputRow label { font-size: 13px; color: var(--ink-soft); }
  .countNumInput {
    width: 90px; background: var(--card); border: 2px solid var(--oxblood-soft);
    border-radius: 8px; padding: 8px 10px; font-size: 15px; font-weight: 700;
    color: var(--ink); font-family: inherit; text-align: center;
  }
  .countNumInput:focus { outline: none; border-color: var(--oxblood); }
  .countNumInput.invalid { border-color: #B33; }

  .overallNote { font-size: 13px; color: var(--ink-soft); margin-bottom: 28px; line-height: 1.5; }
  .estimate { font-size: 13px; color: var(--ink-faint); margin-bottom: 28px; }
  .startBtn {
    background: var(--mustard-bright); color: var(--ink); border: none; border-radius: 6px;
    padding: 14px 28px; font-size: 15px; font-weight: 700; cursor: pointer; font-family: inherit;
  }
  .startBtn:disabled { opacity: 0.4; cursor: not-allowed; }

  /* ---------- Shared content-page styles (About, Stats, etc.) ---------- */
  .contentSection { margin-bottom: 40px; }
  .contentSection p { color: var(--ink); font-size: 15px; line-height: 1.7; margin: 0 0 14px; }
  .contentSection p:last-child { margin-bottom: 0; }
  .contentSection ul { margin: 0 0 14px; padding-left: 20px; }
  .contentSection li { color: var(--ink); font-size: 15px; line-height: 1.7; margin-bottom: 6px; }
  .navLink {
    display: inline-block; margin-top: 4px; font-size: 13px; font-weight: 700;
    color: var(--oxblood); text-decoration: none; letter-spacing: 0.02em;
  }
  .navLink:hover { text-decoration: underline; }
  .navRow { display: flex; gap: 20px; margin-top: 18px; }

  /* ---------- Site sidebar (persistent across pages) ---------- */
  .appLayout { display: flex; align-items: flex-start; min-height: 100vh; }
  .sidebar {
    width: 240px; flex-shrink: 0; background: var(--card);
    border-right: 2px solid var(--oxblood-soft);
    padding: 28px 20px; position: sticky; top: 0; height: 100vh;
    overflow-y: auto; box-sizing: border-box;
  }
  .sidebarLogo { text-align: center; margin-bottom: 24px; }
  .sidebarLogo img { max-width: 150px; width: 100%; height: auto; }
  .sidebarNav { display: flex; flex-direction: column; gap: 4px; margin-bottom: 28px; }
  .sidebarNavLink {
    display: block; padding: 10px 12px; border-radius: 6px;
    font-size: 14px; font-weight: 700; color: var(--ink); text-decoration: none;
    letter-spacing: 0.02em; transition: background 0.15s ease, color 0.15s ease;
  }
  .sidebarNavLink:hover { background: rgba(122,36,24,0.08); }
  .sidebarNavLink.active { background: var(--oxblood); color: var(--card); }
  .sidebarSection { border-top: 1px solid var(--oxblood-soft); padding-top: 20px; }
  .sidebarSection .startLabel { font-size: 11px; margin-bottom: 10px; }
  .sidebarSection .chipRow { flex-direction: column; margin-bottom: 16px; }
  .sidebarSection .countChip { text-align: center; padding: 8px 14px; font-size: 13px; }
  .pageContent { flex: 1; min-width: 0; }

  @media (max-width: 768px) {
    .appLayout { flex-direction: column; }
    .sidebar {
      width: 100%; height: auto; position: static; border-right: none;
      border-bottom: 2px solid var(--oxblood-soft); padding: 18px 1.5rem;
    }
    .sidebarLogo { margin-bottom: 16px; }
    .sidebarLogo img { max-width: 100px; }
    .sidebarNav { flex-direction: row; flex-wrap: wrap; margin-bottom: 16px; }
    .sidebarSection .chipRow { flex-direction: row; flex-wrap: wrap; }
  }
