:root {
  --grass: #16513A;
  --grass-2: #1D6446;
  --chalk: #F6F7F2;
  --paper: #FFFFFF;
  --ink: #14213D;
  --ink-2: #4A5570;
  --sticker: #F2C230;
  --red: #D6342C;
  --line: rgba(20, 33, 61, .14);
  --ok: #1D7A4A;
  --display: 'Big Shoulders Display', Impact, 'Arial Narrow', sans-serif;
  --body: 'Rubik', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--chalk); color: var(--ink); font: 400 16px/1.5 var(--body); }
body.has-modal { overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--sticker); outline-offset: 2px; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--display); font-weight: 800; line-height: 1.05; margin: 0; letter-spacing: .01em; }
h2 { font-size: 2rem; }
h3 { font-size: 1.35rem; }
.muted { color: var(--ink-2); }
.small { font-size: .875rem; }

/* ---------------------------------------------------------- nagłówek-boisko */
.pitch {
  position: relative; overflow: hidden; color: #fff;
  background:
    repeating-linear-gradient(90deg, var(--grass) 0 56px, var(--grass-2) 56px 112px);
  padding: 18px 20px 0;
}
.pitch::before { /* linia środkowa i koło */
  content: ''; position: absolute; left: 50%; top: -60px; width: 220px; height: 220px; margin-left: -110px;
  border: 2px solid rgba(255, 255, 255, .22); border-radius: 50%; pointer-events: none;
}
.pitch::after { content: ''; position: absolute; left: 50%; top: 0; bottom: 0; border-left: 2px solid rgba(255, 255, 255, .22); pointer-events: none; }
.pitch-inner { position: relative; z-index: 1; max-width: 1080px; margin: 0 auto; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand svg { width: 44px; height: 44px; flex: none; }
.brand b { font: 900 2.6rem/0.9 var(--display); letter-spacing: .02em; text-transform: uppercase; }
.brand small { display: block; font-size: .85rem; opacity: .85; font-weight: 500; }
.me-chip { margin-left: auto; display: flex; align-items: center; gap: 10px; background: rgba(0, 0, 0, .22); padding: 6px 8px 6px 6px; border-radius: 6px; }
.me-chip .flag { width: 42px; height: 28px; border-radius: 2px; box-shadow: 0 0 0 1px rgba(255, 255, 255, .4); }
.me-chip button { background: none; border: 0; color: #fff; text-decoration: underline; cursor: pointer; padding: 2px 4px; font-size: .85rem; }

.tabs { position: relative; z-index: 1; max-width: 1080px; margin: 18px auto 0; display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.tabs a {
  flex: 1 0 auto; text-align: center; padding: 12px 16px 10px; text-decoration: none; color: rgba(255, 255, 255, .85);
  font: 700 1.15rem/1 var(--display); letter-spacing: .03em; border-radius: 6px 6px 0 0; white-space: nowrap;
}
.tabs a.on { background: var(--chalk); color: var(--ink); }
.tabs a .badge { display: inline-block; min-width: 20px; padding: 2px 6px; margin-left: 6px; border-radius: 10px; background: var(--red); color: #fff; font: 600 .75rem/1.2 var(--body); }

main { max-width: 1080px; margin: 0 auto; padding: 24px 16px 80px; }
main > * + *, main section > * + * { margin-top: 22px; }

/* ---------------------------------------------------------------- karty */
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 20px; }
.panel h2 + *, .panel h3 + * { margin-top: 10px; }
.cols { display: grid; gap: 22px; grid-template-columns: 1fr; }
@media (min-width: 860px) { .cols { grid-template-columns: 1fr 1fr; } }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 10px 18px;
  border: 0; border-radius: 8px; background: var(--ink); color: #fff; font-weight: 600; cursor: pointer; text-decoration: none;
}
.btn:hover { filter: brightness(1.15); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn.go { background: var(--grass); }
.btn.yellow { background: var(--sticker); color: var(--ink); }
.btn.red { background: var(--red); }
.btn.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 2px var(--line); }
.btn.block { width: 100%; }
.btn.sm { min-height: 36px; padding: 6px 12px; font-size: .9rem; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

label.field { display: block; font-weight: 600; font-size: .95rem; }
label.field input, label.field select { display: block; width: 100%; margin-top: 6px; padding: 12px 14px; border: 2px solid var(--line); border-radius: 8px; background: #fff; font-weight: 400; }
label.field input:focus { border-color: var(--grass); outline: none; }
.pin-input { letter-spacing: .6em; font-variant-numeric: tabular-nums; font-size: 1.3rem !important; text-align: center; }
.form-grid { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; }
.form-grid .full { grid-column: 1 / -1; }
.err { color: var(--red); font-weight: 600; min-height: 1.2em; margin: 8px 0 0; }
.linkbtn { background: none; border: 0; padding: 0; text-decoration: underline; cursor: pointer; color: var(--ink); font-weight: 600; }

/* ---------------------------------------------------------- edytor flagi */
.fe { display: grid; gap: 16px; }
@media (min-width: 700px) { .fe { grid-template-columns: 200px 1fr; align-items: start; } .fe-preview { position: sticky; top: 12px; } }
.fe-preview .flag-big { width: 100%; max-width: 200px; aspect-ratio: 3 / 2; height: auto; display: block; border-radius: 3px; box-shadow: 0 0 0 1px var(--line), 0 6px 14px rgba(20, 33, 61, .15); }
.fe-group + .fe-group { margin-top: 14px; }
.fe-lbl { font-weight: 600; font-size: .9rem; margin-bottom: 6px; }
.fe-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); gap: 6px; }
.fe-opt { padding: 3px; border: 2px solid transparent; border-radius: 6px; background: none; cursor: pointer; }
.fe-opt .flag { width: 100%; aspect-ratio: 3 / 2; height: auto; display: block; box-shadow: 0 0 0 1px var(--line); }
.fe-opt.on { border-color: var(--ink); }
.fe-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; margin-top: 8px; }
.seg { display: inline-flex; border: 2px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button { border: 0; background: #fff; padding: 7px 11px; cursor: pointer; font-size: .9rem; }
.seg button + button { border-left: 2px solid var(--line); }
.seg button.on { background: var(--ink); color: #fff; }
.fe-slots { display: flex; flex-wrap: wrap; gap: 6px; }
.fe-slot { display: inline-flex; gap: 6px; align-items: center; border: 2px solid var(--line); background: #fff; border-radius: 20px; padding: 4px 10px 4px 4px; cursor: pointer; font-size: .85rem; }
.fe-slot i { width: 20px; height: 20px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .2); }
.fe-slot.on { border-color: var(--ink); }
.fe-slot.dim { opacity: .45; }
.fe-pal { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; margin-top: 8px; max-width: 360px; }
.sw { aspect-ratio: 1; border: 0; border-radius: 6px; cursor: pointer; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .2); }
.sw.on { box-shadow: 0 0 0 3px var(--chalk), 0 0 0 5px var(--ink); }
.fe-text { display: flex; flex-direction: column; font-weight: 600; font-size: .9rem; gap: 6px; }
.fe-text input { width: 110px; padding: 9px 12px; border: 2px solid var(--line); border-radius: 8px; text-transform: uppercase; }

/* ---------------------------------------------------------------- naklejki */
.album { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 10px; }
.sticker { position: relative; background: #fff; border-radius: 6px; padding: 7px 7px 0; box-shadow: 0 1px 0 rgba(20, 33, 61, .12), 0 4px 10px rgba(20, 33, 61, .08); }
.sticker .flag { width: 100%; aspect-ratio: 3 / 2; height: auto; display: block; border-radius: 2px; box-shadow: 0 0 0 1px var(--line); }
.sticker .nm { font: 800 1.1rem/1.1 var(--display); padding: 7px 2px 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sticker .sub { font-size: .78rem; color: var(--ink-2); padding: 0 2px 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-height: 1.2em; }
.sticker .no { position: absolute; top: 12px; right: 12px; background: var(--sticker); color: var(--ink); font: 800 .8rem/1 var(--display); padding: 3px 5px; border-radius: 3px; }
.sticker.me { outline: 3px solid var(--sticker); }
.sticker.empty { background: transparent; border: 2px dashed var(--line); box-shadow: none; display: flex; align-items: center; justify-content: center; min-height: 128px; color: var(--ink-2); text-align: center; font-size: .9rem; padding: 10px; }
.sticker.new { animation: pop .5s ease-out; }
@keyframes pop { 0% { transform: scale(.6) rotate(-6deg); opacity: 0; } 70% { transform: scale(1.06) rotate(1deg); } 100% { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .sticker.new { animation: none; } }

.live { display: inline-flex; align-items: center; gap: 6px; font-size: .85rem; color: var(--ink-2); }
.live::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 rgba(29, 122, 74, .6); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(29, 122, 74, 0); } 100% { box-shadow: 0 0 0 0 rgba(29, 122, 74, 0); } }
.tag { display: inline-block; padding: 3px 9px; border-radius: 4px; font-size: .8rem; font-weight: 600; background: var(--chalk); border: 1px solid var(--line); }
.tag.signup { background: #E3F2E9; border-color: #B4DCC3; color: var(--ok); }
.tag.running { background: var(--sticker); border-color: var(--sticker); }
.tag.finished { background: var(--ink); color: #fff; border-color: var(--ink); }

.format-box { border-left: 4px solid var(--sticker); background: #FFFBEA; padding: 12px 14px; border-radius: 0 8px 8px 0; }
.format-box b { font-family: var(--display); font-size: 1.3rem; font-weight: 800; }

.head-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.count { font: 900 2.4rem/1 var(--display); }

/* ------------------------------------------------------------------- QR */
.qr-card { display: grid; grid-template-columns: 140px 1fr; gap: 18px; align-items: center; }
.qr-card .qr { width: 140px; height: 140px; background: #fff; border-radius: 6px; }
.url { font-weight: 700; word-break: break-all; }
@media (max-width: 520px) { .qr-card { grid-template-columns: 1fr; } .qr-card .qr { margin: 0 auto; width: 180px; height: 180px; } }

/* ---------------------------------------------------------------- mecze */
.match { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center; padding: 12px 0; }
.match + .match { border-top: 1px solid var(--line); }
.side { display: flex; align-items: center; gap: 10px; min-width: 0; }
.side.b { flex-direction: row-reverse; text-align: right; }
.side .flag { width: 42px; height: 28px; flex: none; border-radius: 2px; box-shadow: 0 0 0 1px var(--line); }
.side .n { font: 800 1.15rem/1.1 var(--display); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side.win .n { text-decoration: underline; text-decoration-thickness: 3px; text-decoration-color: var(--sticker); text-underline-offset: 3px; }
.score { font: 900 1.6rem/1 var(--display); min-width: 74px; text-align: center; font-variant-numeric: tabular-nums; }
.score .pens { display: block; font: 500 .72rem/1.3 var(--body); color: var(--ink-2); }
.score.pending { color: var(--ink-2); font-size: 1rem; font-weight: 700; }
@media (max-width: 560px) {
  .match { gap: 6px; }
  .side, .side.b { flex-direction: column; align-items: flex-start; gap: 5px; }
  .side.b { align-items: flex-end; }
  .side .n { white-space: normal; overflow-wrap: anywhere; font-size: 1.05rem; }
  .score { min-width: 58px; font-size: 1.4rem; }
}
.meta { grid-column: 1 / -1; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; font-size: .85rem; color: var(--ink-2); margin-top: -4px; }
.meta .btn { margin-left: auto; }
.card-next { border: 2px solid var(--ink); }
.card-next.alert { border-color: var(--red); }

/* ---------------------------------------------------------------- tabele */
.tbl { width: 100%; border-collapse: collapse; font-size: .95rem; }
.tbl th { text-align: right; font-weight: 600; color: var(--ink-2); font-size: .8rem; padding: 6px 4px; border-bottom: 2px solid var(--ink); }
.tbl td { text-align: right; padding: 7px 4px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.tbl th:nth-child(2), .tbl td:nth-child(2) { text-align: left; }
.tbl td.pos { width: 26px; text-align: center; font-weight: 700; }
.tbl tr.q td.pos { background: var(--sticker); }
.tbl .who { display: flex; gap: 8px; align-items: center; font-weight: 600; }
.tbl .who .flag { width: 30px; height: 20px; flex: none; box-shadow: 0 0 0 1px var(--line); }
.tbl td.pts { font-weight: 800; }
.tbl-wrap { overflow-x: auto; }
.bracket { display: flex; gap: 18px; overflow-x: auto; padding-bottom: 6px; }
.bracket .rnd { min-width: 220px; display: flex; flex-direction: column; justify-content: space-around; gap: 12px; }
.bracket .rnd h4 { margin: 0 0 4px; font: 800 1.05rem/1 var(--display); }
.bm { background: #fff; border: 1px solid var(--line); border-radius: 6px; }
.bm div { display: flex; align-items: center; gap: 8px; padding: 6px 8px; }
.bm div + div { border-top: 1px solid var(--line); }
.bm .flag { width: 26px; height: 17px; flex: none; }
.bm span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.bm b { font-family: var(--display); font-size: 1.1rem; }
.bm .w { background: #FFF6D6; }
.champion { background: var(--ink); color: #fff; border-radius: 10px; padding: 22px; display: flex; gap: 18px; align-items: center; }
.champion .flag { width: 120px; height: 80px; flex: none; border-radius: 3px; }
.champion b { font: 900 2.4rem/1 var(--display); display: block; }

/* ---------------------------------------------------------------- modal */
.modal-back { position: fixed; inset: 0; background: rgba(20, 33, 61, .55); display: flex; align-items: flex-end; justify-content: center; z-index: 50; padding: 0; }
.modal { background: var(--chalk); width: 100%; max-width: 560px; max-height: 94vh; overflow: auto; border-radius: 14px 14px 0 0; padding: 22px 18px 26px; animation: up .22s ease-out; }
.modal.wide { max-width: 820px; }
@media (min-width: 640px) { .modal-back { align-items: center; padding: 20px; } .modal { border-radius: 14px; } }
@keyframes up { from { transform: translateY(30px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .modal { animation: none; } }
.modal h2 { margin-bottom: 14px; }
.modal-actions { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.modal-actions .btn { flex: 1; }
.duel { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: start; text-align: center; }
.duel .flag { width: 72px; height: 48px; display: block; margin: 0 auto 6px; border-radius: 2px; box-shadow: 0 0 0 1px var(--line); }
.duel .n { font: 800 1.2rem/1.1 var(--display); word-break: break-word; }
.stepper { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 10px; }
.stepper button { width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--ink); background: #fff; font-size: 1.4rem; font-weight: 700; cursor: pointer; line-height: 1; }
.stepper output { font: 900 3rem/1 var(--display); min-width: 48px; font-variant-numeric: tabular-nums; }
.duel .vs { font: 900 1.4rem/1 var(--display); padding-top: 70px; color: var(--ink-2); }
.big-score { font: 900 3.2rem/1 var(--display); padding-top: 18px; white-space: nowrap; }
details.stats { margin-top: 18px; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; }
details.stats summary { cursor: pointer; font-weight: 600; }
.stat-grid { display: grid; grid-template-columns: 1fr 76px 76px; gap: 6px 10px; align-items: center; margin-top: 10px; }
.stat-grid input { width: 100%; padding: 8px; border: 2px solid var(--line); border-radius: 6px; text-align: center; }
.stat-grid .h { font-weight: 700; text-align: center; font-size: .85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pens-pick { margin-top: 14px; padding: 12px; border-radius: 8px; background: #FFFBEA; border-left: 4px solid var(--sticker); }
.stat-list { display: grid; grid-template-columns: 1fr auto 1fr; gap: 4px 12px; margin-top: 12px; font-variant-numeric: tabular-nums; }
.stat-list span:nth-child(3n+1) { text-align: right; font-weight: 700; }
.stat-list span:nth-child(3n+2) { text-align: center; color: var(--ink-2); font-size: .85rem; }
.stat-list span:nth-child(3n) { font-weight: 700; }

#toast { position: fixed; left: 50%; bottom: 20px; transform: translate(-50%, 120px); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 8px; z-index: 60; max-width: 92vw; transition: transform .25s; font-weight: 500; }
#toast.show { transform: translate(-50%, 0); }
#toast.bad { background: var(--red); }
#toast.good { background: var(--ok); }

.empty { text-align: center; padding: 30px 10px; color: var(--ink-2); }
.team-list { display: grid; gap: 8px; }
.team-opt { display: flex; align-items: center; gap: 12px; padding: 10px; border: 2px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; text-align: left; width: 100%; }
.team-opt:hover { border-color: var(--ink); }
.team-opt .flag { width: 48px; height: 32px; flex: none; }
.team-opt b { font-family: var(--display); font-size: 1.15rem; display: block; }
.choice { display: grid; gap: 10px; grid-template-columns: 1fr; }
@media (min-width: 560px) { .choice { grid-template-columns: repeat(3, 1fr); } }
.choice button { text-align: left; padding: 14px; border: 2px solid var(--line); background: #fff; border-radius: 10px; cursor: pointer; }
.choice button:hover { border-color: var(--ink); }
.choice button b { display: block; font: 800 1.2rem/1.1 var(--display); margin-bottom: 4px; }

.flag.badge { box-shadow: none !important; background: transparent; }
.fe-lib { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 8px; margin-top: 10px; max-height: 300px; overflow-y: auto; padding: 2px; }
.fe-libit { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 4px; border: 2px solid transparent; border-radius: 8px; background: #fff; cursor: pointer; font-size: .75rem; line-height: 1.15; text-align: center; }
.fe-libit:hover { border-color: var(--ink); }
.fe-libit .flag { width: 100%; aspect-ratio: 3 / 2; height: auto; box-shadow: 0 0 0 1px var(--line); }

/* ------------------------------------------------ lista i turniej */
.me-chip a, .me-chip .chip-login { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 600; background: none; border: 0; cursor: pointer; padding: 2px 6px; }
.me-chip .chip-login { text-decoration: underline; }
.tabs a:first-child:not(.on) { flex: 0 0 auto; }
.filter { display: flex; flex-wrap: wrap; width: fit-content; max-width: 100%; }
.filter button span { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 10px; background: var(--chalk); color: var(--ink); font-size: .8rem; margin-left: 4px; }
.filter button.on span { background: var(--sticker); }
.sec-h { font-size: 1.6rem; }
.t-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); margin-top: 12px; }
.t-grid.compact { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.t-card { display: block; text-decoration: none; background: var(--paper); border: 1px solid var(--line); border-left: 6px solid var(--line); border-radius: 10px; padding: 16px; color: var(--ink); }
.t-card:hover { border-color: var(--ink); }
.t-card.signup { border-left-color: var(--ok); }
.t-card.running { border-left-color: var(--sticker); }
.t-card.finished { border-left-color: var(--ink); }
.t-card h3 { font-size: 1.5rem; }
.t-top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.t-facts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.t-facts span { font-size: .85rem; padding: 3px 8px; background: var(--chalk); border-radius: 4px; }
.t-champ { display: flex; gap: 8px; align-items: center; margin-top: 10px; }
.t-champ .flag { width: 36px; height: 24px; }
.t-mine { margin-top: 10px; font-size: .85rem; font-weight: 600; color: var(--ok); }
.t-head h2 { font-size: 2.2rem; }
.t-head .desc { margin: 10px 0 0; max-width: 70ch; white-space: pre-line; }
.rules { margin-top: 12px; }
.rules summary { cursor: pointer; font-weight: 600; }
.rules dl { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; margin: 10px 0 0; font-size: .92rem; }
.rules dt { color: var(--ink-2); }
.rules dd { margin: 0; }
.count small { font-size: 1.2rem; color: var(--ink-2); }
button.sticker.empty { cursor: pointer; font: inherit; width: 100%; }
.podium { display: grid; gap: 12px; grid-template-columns: 1.2fr 1fr 1fr; align-items: end; }
.pod { background: var(--ink); color: #fff; border-radius: 10px; padding: 14px; display: flex; flex-direction: column; gap: 6px; }
.pod.p1 { background: var(--sticker); color: var(--ink); padding: 20px 14px; }
.pod .flag { width: 72px; height: 48px; }
.pod.p1 .flag { width: 96px; height: 64px; }
.pod span { font-size: .85rem; }
.pod b { font: 900 1.6rem/1 var(--display); overflow-wrap: anywhere; }
.pod.p1 b { font-size: 2.2rem; }
@media (max-width: 560px) { .podium { grid-template-columns: 1fr; } }
.bracket .rnd h4 + .bm { margin-top: 0; }

@media (max-width: 560px) {
  .filter { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
  .filter button + button { border-left: 0; }
  .filter button:nth-child(even) { border-left: 2px solid var(--line); }
  .filter button:nth-child(n+3) { border-top: 2px solid var(--line); }
  .tabs a { padding: 12px 11px 10px; font-size: 1.05rem; }
  .pod .flag { width: 54px; height: 36px; } .pod.p1 .flag { width: 72px; height: 48px; }
}

/* ------------------------------------------------ zarządzanie turniejem (wspólne) */

.fmt-opt { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border: 2px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; }
.fmt-opt + .fmt-opt { margin-top: 8px; }
.fmt-opt:has(input:checked) { border-color: var(--ink); background: #FFFBEA; }
.fmt-opt input { margin-top: 4px; }
.adm-list { display: grid; gap: 6px; }
.adm-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: #fff; border: 1px solid var(--line); border-radius: 8px; }
.adm-item .flag { width: 36px; height: 24px; flex: none; }
.adm-item span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adm-m { display: grid; grid-template-columns: 1fr auto 1fr auto; gap: 8px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); font-size: .92rem; }
.adm-m input { width: 48px; padding: 6px; text-align: center; border: 2px solid var(--line); border-radius: 6px; }
.adm-m .r { text-align: right; }
.adm-m small { grid-column: 1 / -1; color: var(--ink-2); margin-top: -4px; }
textarea { width: 100%; min-height: 120px; padding: 10px; border: 2px solid var(--line); border-radius: 8px; }
.adm-t-head { width: 100%; display: flex; align-items: center; gap: 12px; background: none; border: 0; padding: 0; cursor: pointer; text-align: left; }
.adm-t-head > span:first-child { flex: 1; min-width: 0; }
.adm-t-head b { font: 800 1.4rem/1.1 var(--display); }
.adm-t.open { border-color: var(--ink); }
.badge-r { background: var(--red); color: #fff; font-size: .8rem; font-weight: 600; padding: 3px 8px; border-radius: 10px; }
.adm-m.hl { background: #FFF6D6; }
form.settings fieldset { border: 1px solid var(--line); border-radius: 8px; margin: 14px 0 0; padding: 12px 14px 14px; }
form.settings legend { font-weight: 700; padding: 0 6px; }
.sgrid { display: grid; gap: 12px 14px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.sgrid .full { grid-column: 1 / -1; }
.sgrid textarea { min-height: 70px; margin-top: 6px; font-weight: 400; }
label.field select, label.field textarea { display: block; width: 100%; margin-top: 6px; padding: 11px 12px; border: 2px solid var(--line); border-radius: 8px; background: #fff; font-weight: 400; }
.chk { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; margin-top: 8px; cursor: pointer; }
.chk input { width: 20px; height: 20px; margin-top: 2px; flex: none; }
.chk small { display: block; color: var(--ink-2); font-weight: 400; }
details.panel > summary { cursor: pointer; }

/* ------------------------------------------------ edytor herbów */
.fe-warn { color: var(--red); font-weight: 600; font-size: .9rem; min-height: 1.2em; margin: 8px 0 0; max-width: 220px; }
.fe-icons { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 4px; max-height: 232px; overflow-y: auto; padding: 2px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.fe-ico { aspect-ratio: 1; border: 2px solid transparent; border-radius: 6px; background: none; cursor: pointer; color: var(--ink); padding: 6px; }
.fe-ico:hover { background: var(--chalk); }
.fe-ico.on { border-color: var(--ink); background: #FFF6D6; }
.fe-ico .ico { width: 100%; height: 100%; display: block; }
.fe-pal { grid-template-columns: repeat(9, 1fr); max-width: 420px; }
.sw.picker { position: relative; display: flex; align-items: center; justify-content: center; background: conic-gradient(red, yellow, lime, cyan, blue, magenta, red); overflow: hidden; }
.sw.picker input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; }
.sw.picker span { color: #fff; font-weight: 800; text-shadow: 0 0 3px #000; pointer-events: none; }
.fe-libit.taken { opacity: .5; }
.fe-libit small { display: block; color: var(--red); font-weight: 600; }
.fe-opt .flag, .fe-libit .flag { background: none; }
.t-owner { font-size: .88rem; color: var(--ink-2); margin-top: 6px; }

.fe-isearch { width: 100%; padding: 9px 12px; border: 2px solid var(--line); border-radius: 8px; margin-bottom: 6px; }
.fe-ico[hidden] { display: none; }

/* ------------------------------------------------ mecz na żywo, koszulki, kolejka, powiadomienia */
.kit { display: inline-flex; align-items: center; gap: 4px; font-size: .75rem; font-weight: 700; padding: 2px 7px; border-radius: 10px; color: #fff; vertical-align: middle; }
.kit::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #fff; opacity: .85; }
.kit.red { background: #D6342C; } .kit.blue { background: #1F5FBF; }
.kit:empty { padding: 0; width: 12px; height: 12px; border-radius: 50%; } .kit:empty::before { display: none; }
.live-dot { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; color: var(--red); font-variant-numeric: tabular-nums; }
.live-dot::before { content: ''; width: 9px; height: 9px; border-radius: 50%; background: var(--red); animation: pulse-r 1.4s infinite; }
@keyframes pulse-r { 50% { opacity: .25; } }
.score.lv { color: var(--red); }
.live-card { border: 3px solid var(--red); }
.live-board { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center; text-align: center; margin-top: 12px; }
.live-board .flag { width: 64px; height: 43px; display: block; margin: 0 auto 4px; }
.live-board .n { font: 800 1.1rem/1.1 var(--display); overflow-wrap: anywhere; }
.live-board .big { font: 900 3.4rem/1 var(--display); font-variant-numeric: tabular-nums; }
.live-board .clock { font: 800 1.4rem/1 var(--display); color: var(--red); font-variant-numeric: tabular-nums; margin-top: 6px; }
.goal-btn { margin-top: 8px; width: 100%; min-height: 58px; font-size: 1.1rem; border: 0; border-radius: 10px; font-weight: 800; color: #fff; cursor: pointer; }
.goal-btn.red { background: #D6342C; } .goal-btn.blue { background: #1F5FBF; } .goal-btn.neutral { background: var(--grass); }
.goal-log { margin-top: 10px; font-size: .85rem; color: var(--ink-2); display: flex; flex-wrap: wrap; gap: 4px 12px; justify-content: center; }
.queue-me { display: grid; gap: 8px; }
.qrow { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 10px 12px; background: #fff; border: 1px solid var(--line); border-radius: 8px; text-decoration: none; color: var(--ink); }
.qrow .pos { font: 900 1.8rem/1 var(--display); min-width: 44px; text-align: center; }
.qrow .pos.now { color: var(--red); }
.qrow small { display: block; color: var(--ink-2); }
.notif-banner { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; background: #FFFBEA; border: 1px solid #F0DC9A; border-left: 4px solid var(--sticker); border-radius: 8px; padding: 12px 14px; }

.acc-switch { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); flex-wrap: wrap; font-weight: 600; }
.similar-box { background: #FFFBEA; border-left: 4px solid var(--sticker); border-radius: 0 8px 8px 0; padding: 10px 12px; margin-top: 8px; }
