/* ==== Calling cards: wide waving-flag banners ====
   .bn is a banner: the flag's edge colors fill left (.bn-l) and right (.bn-r) of --fx, the real flag (.bn-flag, true
   proportions, full height) sits at --fx over the seam, then the cloth (ripple + sheen + vignette) covers it all.
   NFL: the team banner (.bn-team) and the crisp logo (.bn-logo) at --fx. */
.bn { position: relative; isolation: isolate; overflow: hidden; --fx: 60%; --s1: 71%; --s2: 77%; background: #0b1120; border: 1px solid #000; box-shadow: inset 0 0 0 1px #ffffff2e, 0 3px 10px #0009; }
.bn > i, .bn > img { position: absolute; pointer-events: none; font-style: normal; }
.bn-l { top: 0; bottom: 0; left: 0; width: var(--fx); z-index: -4; }
.bn-r { top: 0; bottom: 0; right: 0; width: calc(100% - var(--fx)); z-index: -4; }
.bn-flag { top: 0; height: 100%; width: auto; left: var(--fx); transform: translateX(-50%); z-index: -3; -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 16%, #000 84%, transparent 100%); mask-image: linear-gradient(90deg, transparent 0, #000 16%, #000 84%, transparent 100%); }
/* (The flag's own left / right edges feather into the side fills, so the two always meet without a seam.) */
.bn-team { inset: 0; z-index: -4; }
.bn-logo { top: 50%; left: var(--fx); height: 80%; width: auto; aspect-ratio: 1; transform: translate(-50%, -50%); z-index: -3; filter: drop-shadow(0 2px 6px #000b); }
/* The cloth: soft diagonal light / shadow bands (a fixed rhythm, so every banner waves the same way), a sheen from the
   top, a shadow at the bottom, and a vignette at the edges. */
.bn-cloth { inset: 0; z-index: -2; background:
  repeating-linear-gradient(103deg, #ffffff00 0px, #ffffff24 22px, #ffffff00 44px, #00000030 66px, #ffffff00 88px),
  linear-gradient(180deg, #ffffff2e 0%, #ffffff00 36%, #00000000 58%, #00000047 100%),
  radial-gradient(130% 150% at 50% 42%, #0000 52%, #0000008c 100%); }

/* ---- The full card (your card, standings rows) ---- */
.cc { display: flex; align-items: center; gap: 10px; width: 100%; min-width: 0; height: 62px; padding: 0 14px; border-radius: 6px; text-align: left; }
.cc-none { background: linear-gradient(120deg, #111a2e, #0a0f1d); border: 1px solid #ffffff24; }
/* Dark only where the text sits: behind the name (left) and the record (right). */
.bn-scrim { inset: 0; z-index: -1; background: linear-gradient(90deg, #000000c7 0%, #00000094 22%, #0000 42%), linear-gradient(270deg, #000000c7 0%, #00000085 15%, #0000 27%); }
.cc-body { display: flex; flex-direction: column; flex: 1; min-width: 0; max-width: calc(var(--fx) - 64px); margin-right: auto; }
.cc-none .cc-body { max-width: none; }
.cc-name { display: flex; align-items: center; gap: 4px; min-width: 0; font-family: Oswald, sans-serif; font-weight: 700; font-size: 21px; letter-spacing: .6px; text-transform: uppercase; line-height: 1.05; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #fff; text-shadow: 0 1px 0 #000, 0 2px 4px #000, 0 0 10px #000c; }
.cc-sub { font-size: 11.5px; color: #e5e9f0; font-weight: 700; letter-spacing: .2px; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 1px 2px #000, 0 0 6px #000; }
.cc-side { flex: none; text-align: right; text-shadow: 0 1px 0 #000, 0 2px 4px #000, 0 0 8px #000; }
.cc .sgreen, .cc .cn { text-shadow: none; filter: drop-shadow(0 1px 0 #000) drop-shadow(0 2px 4px #000); }
/* Champ: gold frame + slow shine. Last place: slimed. */
.cc-champ { border: 2px solid #fbbf24; box-shadow: 0 0 0 1px #78350f, 0 0 16px #fbbf2459, 0 3px 10px #0009; }
.cc-champ::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(105deg, transparent 35%, #fff3 48%, transparent 60%); transform: translateX(-100%); animation: cc-shine 3.2s ease-in-out infinite; }
@keyframes cc-shine { 0%, 55% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }
.cc-chump { border: 2px solid #65a30d; box-shadow: 0 0 14px #84cc1640, 0 3px 10px #0009; }
.cc-chump > .bn-l, .cc-chump > .bn-r, .cc-chump > .bn-flag, .cc-chump > .bn-team, .cc-chump > .bn-logo { filter: grayscale(.85) sepia(.55) hue-rotate(40deg) brightness(.7); }
@media (prefers-reduced-motion: reduce) { .cc-champ::after { animation: none; display: none; } }

/* ---- Picker tiles: a mini waving-flag banner, the name under it ---- */
.cct { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.bn-sm { --fx: 50%; --s1: 68%; --s2: 77%; display: block; height: 46px; border-radius: 4px; }
.cct-none .bn-sm { background: repeating-linear-gradient(135deg, #1a2440 0 8px, #121a30 8px 16px); }
.cct-name { display: block; font-family: Oswald, sans-serif; font-weight: 600; font-size: 12.5px; letter-spacing: .5px; text-transform: uppercase; text-align: center; color: #dbe2ee; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---- The small badge before a name (Who's in, the board's flip view) ---- */
.ccb { flex: none; display: inline-flex; align-items: center; justify-content: center; overflow: hidden; background: #0b1120; border: 1px solid #ffffff2b; vertical-align: middle; }
.ccb img { display: block; }
.ccb-flag img { width: 100%; height: 100%; object-fit: cover; }
.ccb-xs { width: 24px; height: 17px; border-radius: 3px; box-shadow: 0 1px 3px #0009; }
.ccb-xs.ccb-nfl img { width: 15px; height: 15px; object-fit: contain; }

/* ---- Season standings ---- */
.panel.ss-you { display: flex; flex-direction: column; align-items: stretch; gap: 10px; margin: 0 0 10px; padding: 12px; }
.panel.ss-you .ss-row { display: block; }
.panel.ss-you .ss-row.me .cc { outline: 2px solid #3b82f6; outline-offset: 2px; }
.ss-list { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.ss-row { display: grid; grid-template-columns: 30px minmax(0, 1fr); align-items: center; gap: 8px; }
.ss-rk { font-family: Oswald, sans-serif; font-size: 18px; color: var(--mute); text-align: center; line-height: 1; }
.ss-rk.med { font-size: 24px; }
.ss-row .snn { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ss-row .sgreen { background: linear-gradient(180deg, #ecfccb 0%, #a3e635 48%, #65a30d 100%); -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent; }
.ss-row .poop { font-style: normal; flex: none; font-size: 17px; filter: drop-shadow(0 0 3px #84cc1673); }
.ss-row.me .cc { outline: 2px solid #3b82f6; outline-offset: 2px; }
.ss-rec { display: block; font-family: Oswald, sans-serif; font-size: 20px; font-weight: 700; line-height: 1; letter-spacing: .3px; font-variant-numeric: tabular-nums; }
.ss-pct { display: block; font-size: 11.5px; font-weight: 700; color: #f1f5f9; margin-top: 3px; font-variant-numeric: tabular-nums; }
.ss-marks { letter-spacing: 1px; }
@media (max-width: 400px) {
  .ss-row { grid-template-columns: 24px minmax(0, 1fr); gap: 6px; }
  .ss-row .cc { height: 58px; padding: 0 11px; }
  .ss-row .cc-name { font-size: 18px; }
  .ss-rec { font-size: 17px; }
}

/* ---- The calling card menu ---- */
.ccm-wrap { position: fixed; inset: 0; z-index: 60; background: #000b; display: flex; align-items: flex-end; justify-content: center; animation: ccm-in .15s ease-out; }
@media (min-width: 700px) { .ccm-wrap { align-items: center; } }
@keyframes ccm-in { from { opacity: 0; } }
.ccm { width: min(720px, 100%); max-height: 92vh; display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: 18px 18px 0 0; padding: 14px 16px calc(14px + env(safe-area-inset-bottom)); box-shadow: 0 -10px 40px #000a; }
@media (min-width: 700px) { .ccm { border-radius: 18px; } }
.ccm-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.ccm-head b { font-family: Oswald, sans-serif; font-size: 20px; text-transform: uppercase; letter-spacing: .5px; }
.ccm-x { appearance: none; background: var(--panel2); border: 1px solid var(--line); color: var(--text); width: 36px; height: 36px; border-radius: 50%; font-size: 15px; cursor: pointer; }
.ccm-prev { margin-bottom: 12px; }
.ccm-tabs { display: flex; gap: 8px; margin-bottom: 10px; }
.ccm-tabs button { appearance: none; flex: 1; background: var(--panel2); color: var(--text); border: 1px solid var(--line); border-radius: 999px; padding: 9px 12px; font: inherit; font-weight: 700; font-size: 14px; cursor: pointer; }
.ccm-tabs button.on { background: #1d4ed8; border-color: #3b82f6; }
.ccm-grid { flex: 1; min-height: 0; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px 10px; padding: 4px; margin: 0 -4px; overscroll-behavior: contain; }
.ccm-it { appearance: none; background: none; border: 0; padding: 0; border-radius: 6px; cursor: pointer; display: block; min-width: 0; color: inherit; }
.ccm-it.on .bn-sm { outline: 3px solid #f59e0b; outline-offset: 1px; }
.ccm-it.on .cct-name { color: #fbbf24; }
.ccm-it:focus-visible { outline: 3px solid #93c5fd; }
.ccm-foot { display: flex; gap: 10px; justify-content: space-between; margin-top: 12px; }
.ccm-foot .ccm-save { flex: 1; background: linear-gradient(135deg, #2563eb, #1d4ed8); border-color: #3b82f6; color: #fff; }
@media (max-width: 420px) { .ccm-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---- A name cell on the sheet / board: a compact waving-flag tab down the left edge, the name + W-L centered beside
   it. Same cell size as before; the name column still sticks while the picks scroll. ---- */
.grid th.pl.hascc { isolation: isolate; overflow: hidden; background: #0b1120; padding-left: 41px; padding-right: 4px; text-align: center; }
.grid th.pl.hascc > .plcc-art { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.grid th.pl.hascc > .plcc-tab { position: absolute; left: 0; top: 0; bottom: 0; width: 35px; --fx: 50%; --s1: 150%; --s2: 160%; border: 0; border-right: 1px solid #000; box-shadow: inset 0 0 0 1px #ffffff1f; }
.grid th.pl.hascc > .plcc-tab .bn-logo { height: 26px; }
.grid th.pl.hascc .pl-top { justify-content: center; }
.grid th.pl.hascc .rk:empty { display: none; }
.grid th.pl.hascc .pl-sub { text-align: center; padding-left: 0; }
.grid th.pl.hascc .pl-name { color: #fff; text-shadow: 0 1px 3px #000c; }
.grid tr.me th.pl.hascc .pl-name { color: var(--gold); }
.grid th.pl.hascc .cn, .grid th.pl.hascc .chn { text-shadow: none; filter: drop-shadow(0 1px 2px #000c); }
.grid tbody tr.me > th.pl.hascc::after, .grid tbody tr.champ > th.pl.hascc::after, .grid tbody tr.top > th.pl.hascc::after { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--gold); z-index: 1; }
.grid tbody tr.smelly th.pl.hascc > .plcc-art, .grid tbody tr.smelly th.pl.hascc > .plcc-tab { filter: grayscale(.85) sepia(.6) hue-rotate(40deg) brightness(.75); }
.grid tbody tr.out th.pl.hascc > .plcc-art, .grid tbody tr.out th.pl.hascc > .plcc-tab { opacity: .45; }

/* ---- Who's in: a chip with a card wears the card's colors, with the small badge before the name ---- */
.chip.ccw:not(.champ):not(.chump) { background: var(--cca, var(--panel2)); border-color: #ffffff30; color: #fff; }
.chip.ccw.gold:not(.champ):not(.chump) { color: var(--gold); border-color: #fbbf24; box-shadow: 0 0 0 1px #fbbf2466; }
.chip .ccb-xs { margin: -2px 2px -2px -5px; }
.pmark .ccb-xs { display: block; margin: 0 auto 2px; }
/* NFL banners: logo a touch left of the flag position, slash just right of it, clear of the record. */
.cc.bk-nfl { --fx: 56%; --s1: 67%; --s2: 72%; }

/* Admin: the calling card button on each player's row (their card's badge, or 🎴 when they have none). */
.person .ccbtn { min-width: 40px; padding-left: 8px; padding-right: 8px; }
.person .ccbtn .ccb-xs { margin: 0; }

/* Wide screens: banners stay banner-shaped (a flag or logo lost in a 1,100px strip looks wrong), centered. */
.ss-list { max-width: 640px; margin-left: auto; margin-right: auto; }
.panel.ss-you > * { width: 100%; max-width: 640px; margin-left: auto; margin-right: auto; }

/* Vertical-band flags (Mexico, Italy...): the middle band drawn wider, the real flag's middle (with the crest) over it. */
.bn-mid { top: 0; bottom: 0; left: var(--fx); width: var(--mw, 28%); transform: translateX(-50%); z-index: -4; }
.bn-sm { --mw: 32%; }
.bn-flag.mid { -webkit-mask-image: none; mask-image: none; }
/* Sheet cells once ranks show: a slightly narrower strip and a compact rank, so "1 ⭐ Name" stays on one line. */
.grid th.pl.hascc { padding-left: 35px; }
.grid th.pl.hascc > .plcc-tab { width: 30px; }
.grid th.pl.hascc > .plcc-tab .bn-logo { height: 23px; }
.grid th.pl.hascc .pl-top { gap: 3px; }
.grid th.pl.hascc .rk { font-size: 11px; width: auto; min-width: 0; }
