/* Faction Card Wars (public-site/faction-war.js), inside the ⚔️ Duels tab. Prefix .fw-*. Same dark panel + gold family as
   Card Missions (.cms-*). The faction's own colour comes in as --fc (falls back to amber). */
.fw { --fw-gold: #f0cd7c; --fw-dim: #8d95a5; display: grid; gap: 10px; margin: 0 0 18px; padding: 14px; border-radius: 18px; min-width: 0; color: #fff;
    font-family: "Barlow Condensed", system-ui, sans-serif;
    background: radial-gradient(120% 140% at 0% 0%, rgba(228,174,57,.10), transparent 55%), linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.012)), #101217;
    border: 1px solid rgba(246,215,122,.16); }
.fw-loading { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 22px 10px; font: 500 16px/1 "Barlow Condensed", sans-serif; color: var(--fw-dim); }
.fw-loading span { width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(240,205,124,.25); border-top-color: #f0cd7c; animation: fwSpin .8s linear infinite; }
@keyframes fwSpin { to { transform: rotate(360deg); } }
.fw-empty { margin: 0; padding: 12px 10px; text-align: center; font: 500 16px/1.3 "Barlow Condensed", sans-serif; color: var(--fw-dim); }

/* header strip */
.fw-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.fw-title { display: grid; gap: 3px; min-width: 0; }
.fw-title em { font: 700 11px/1 "Barlow Condensed", sans-serif; font-style: normal; letter-spacing: .2em; text-transform: uppercase; color: #c9a24a; }
.fw-title b { font: 900 26px/1 "Barlow Condensed", sans-serif; letter-spacing: .03em; text-transform: uppercase; }
.fw-clock { display: grid; justify-items: end; gap: 3px; flex: 0 0 auto; }
.fw-clock small { font: 700 11px/1 "Barlow Condensed", sans-serif; letter-spacing: .18em; text-transform: uppercase; color: var(--fw-dim); }
.fw-clock time { font: 800 22px/1 "Barlow Condensed", sans-serif; color: var(--fw-gold); font-variant-numeric: tabular-nums; }

/* flags: the faction's DayZ flag (or armband) on its own colour */
.fw-flag { --fcx: color-mix(in srgb, var(--fc, #e4ae39) 70%, #8a93a3); position: relative; flex: 0 0 auto; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; overflow: hidden; font-size: 20px;
    background: radial-gradient(70% 70% at 50% 50%, color-mix(in srgb, var(--fcx) 55%, transparent), transparent 75%), #0b0c10; border: 1px solid color-mix(in srgb, var(--fcx) 50%, transparent); }
.fw-flag img { width: 92%; height: 92%; object-fit: contain; filter: drop-shadow(0 3px 5px rgba(0,0,0,.6)); }
.fw-flag.big { width: 64px; height: 64px; border-radius: 14px; }

/* your faction */
.fw-mine { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px 14px; padding: 10px 12px; border-radius: 14px;
    background: radial-gradient(100% 160% at 0% 50%, color-mix(in srgb, var(--fc, #e4ae39) 16%, transparent), transparent 60%), rgba(0,0,0,.28); border: 1px solid color-mix(in srgb, var(--fc, #e4ae39) 35%, rgba(255,255,255,.08)); }
.fw-mine.none { grid-template-columns: auto minmax(0, 1fr) auto; }
.fw-mine-t { display: grid; gap: 3px; min-width: 0; }
.fw-mine-t small { font: 700 11px/1 "Barlow Condensed", sans-serif; letter-spacing: .18em; text-transform: uppercase; color: var(--fw-dim); }
.fw-mine-t b { font: 800 22px/1.05 "Barlow Condensed", sans-serif; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fw-mine-t b em, .fw-nm-t em { font-style: normal; font-weight: 700; font-size: .7em; letter-spacing: .08em; padding: 2px 6px; border-radius: 6px; vertical-align: middle; color: #e6e9ee; background: rgba(255,255,255,.08); }
.fw-mine-t span { font: 600 15px/1.1 "Barlow Condensed", sans-serif; color: var(--fw-gold); }
.fw-mine.none .fw-mine-t span { color: var(--fw-dim); font-weight: 500; }
.fw-mine-act { display: grid; justify-items: end; gap: 6px; }
.fw-slots { display: flex; gap: 6px; }
.fw-slot { --rc: #9ea4ac; position: relative; width: 40px; height: 54px; padding: 0 !important; border-radius: 7px; overflow: hidden; cursor: pointer;
    background: radial-gradient(80% 60% at 50% 40%, color-mix(in srgb, var(--rc) 35%, transparent), transparent 75%), #0c0d11; border: 2px solid var(--rc); }
.fw-slot img { width: 100%; height: 100%; object-fit: cover; }
.fw-slot b { position: absolute; left: 0; right: 0; bottom: 0; padding: 1px 0; font: 800 12px/1.1 "Barlow Condensed", sans-serif; color: #1c1405; background: linear-gradient(135deg, #f6d77a, #cf961f); }
.fw-slot.empty { border: 2px dashed rgba(255,255,255,.18); color: rgba(255,255,255,.4); font-size: 18px; background: rgba(255,255,255,.02); }
.fw-slot.empty:not(:disabled):hover { border-color: var(--fw-gold); color: var(--fw-gold); }
.fw-slot.empty:disabled { cursor: default; opacity: .5; }
.fw-mine-sub { display: flex; align-items: center; gap: 10px; font: 500 14px/1.1 "Barlow Condensed", sans-serif; color: var(--fw-dim); }
.fw-mine-sub b { color: #fff; }
.fw-why { max-width: 260px; text-align: right; font: 500 13px/1.15 "Barlow Condensed", sans-serif; color: #c7a76a; }
.cx-btn.fw-enter, .cx-btn.fw-go { height: 36px; padding: 0 16px !important; font-size: 16px; white-space: nowrap; }

/* standings */
.fw-board { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; }
.fw-row { display: grid; grid-template-columns: 34px 40px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 6px 12px 6px 8px; border-radius: 12px;
    background: rgba(255,255,255,.025); border: 1px solid rgba(255,255,255,.05); }
.fw-row.p1 { background: radial-gradient(80% 160% at 0% 50%, rgba(228,174,57,.14), transparent 65%), rgba(255,255,255,.03); border-color: rgba(240,205,124,.35); }
.fw-row.me { border-color: color-mix(in srgb, var(--fw-gold) 70%, transparent); box-shadow: inset 3px 0 0 var(--fw-gold); }
.fw-pl { text-align: center; font: 800 18px/1 "Barlow Condensed", sans-serif; color: var(--fw-dim); }
.fw-nm { display: grid; gap: 3px; min-width: 0; }
.fw-nm-t { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.fw-nm-t b { font: 700 18px/1.05 "Barlow Condensed", sans-serif; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fw-nm small { font: 500 13px/1 "Barlow Condensed", sans-serif; color: var(--fw-dim); }
.fw-bar { height: 5px; border-radius: 3px; background: rgba(255,255,255,.07); overflow: hidden; }
.fw-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #cf961f, #f6d77a); transition: width .5s cubic-bezier(.2,.8,.3,1); }
.fw-row:not(.p1):not(.me) .fw-bar i { background: linear-gradient(90deg, #6c7480, #aab2bf); }
.fw-pts { display: grid; justify-items: end; gap: 1px; }
.fw-pts b { font: 800 20px/1 "Barlow Condensed", sans-serif; font-variant-numeric: tabular-nums; }
.fw-pts small { font: 700 10px/1 "Barlow Condensed", sans-serif; letter-spacing: .16em; text-transform: uppercase; color: var(--fw-dim); }
.fw-gap { text-align: center; color: var(--fw-dim); line-height: .6; letter-spacing: .3em; }
.fw-more { justify-self: center; height: 30px; padding: 0 14px !important; border-radius: 999px; border: 1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.04); color: #cfd5de; cursor: pointer;
    font: 600 14px/1 "Barlow Condensed", sans-serif; }
.fw-more:hover { border-color: rgba(240,205,124,.5); color: #fff; }

/* rewards, last week, rules */
.fw-rw { display: flex; flex-wrap: wrap; gap: 6px; }
.fw-rw span { padding: 5px 10px; border-radius: 999px; font: 500 14px/1.1 "Barlow Condensed", sans-serif; color: #cfd5de; background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.06); }
.fw-rw b { color: #fff; }
.fw-rw .fw-safe { color: #8fe0a0; border-color: rgba(111,207,115,.25); background: rgba(111,207,115,.07); }
.fw-last { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; font: 500 14px/1.1 "Barlow Condensed", sans-serif; color: #cfd5de; }
.fw-last small { font: 700 11px/1 "Barlow Condensed", sans-serif; letter-spacing: .18em; text-transform: uppercase; color: var(--fw-dim); }
.fw-last b { color: var(--fw-gold); }
.fw-how summary { cursor: pointer; font: 600 14px/1.2 "Barlow Condensed", sans-serif; color: var(--fw-dim); }
.fw-how summary:hover { color: #fff; }
.fw-how p { margin: 6px 0 0; font: 500 14px/1.35 "Barlow Condensed", sans-serif; color: #aab2bf; }

/* card picker sheet */
html.fw-lock { overflow: hidden; }
.fw-ov { position: fixed; inset: 0; z-index: 1250; display: grid; place-items: center; padding: calc(16px + var(--safe-top, 0px)) 16px 16px; background: rgba(4,5,7,.82);
    font-family: "Barlow Condensed", system-ui, sans-serif; opacity: 0; transition: opacity .18s ease; }
.fw-ov.in { opacity: 1; }
.fw-sheet { position: relative; display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto; width: min(820px, 100%); max-height: calc(100dvh - 32px - var(--safe-top, 0px)); padding: 22px 22px 0; border-radius: 24px; color: #d3d8e1;
    background: radial-gradient(120% 70% at 20% 0%, rgba(228,174,57,.1), transparent 60%), linear-gradient(165deg, #1b1d23, #0f1115); border: 1px solid rgba(246,215,122,.18); box-shadow: 0 40px 90px -20px rgba(0,0,0,.9); }
.fw-sheet h3 { margin: 0 44px 4px 0; font: 900 26px/1.05 "Barlow Condensed", sans-serif; color: #fff; }
.fw-sub { margin: 0 0 12px; font-size: 15px; color: var(--fw-dim); }
.fw-x { position: absolute; top: 12px; right: 12px; z-index: 2; width: 40px; height: 40px; padding: 0 !important; border-radius: 50%; border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.06); color: #fff; font-size: 16px; cursor: pointer; }
.fw-pbody { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 14px 12px 12px; display: grid; gap: 12px; }
.fw-grid { margin: 0; }
.fw-pk { position: relative; display: block; padding: 0 !important; border: 0; background: none; cursor: pointer; border-radius: 16px; }
.fw-pk .tc-card { pointer-events: none; }
.fw-pk.on { outline: 3px solid var(--fw-gold); outline-offset: 3px; }
.fw-pk.on::after { content: "✓"; position: absolute; top: -10px; left: -8px; z-index: 7; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
    font: 900 17px/1 "Barlow Condensed", sans-serif; color: #1c1405; background: linear-gradient(135deg, #f6d77a, #cf961f); box-shadow: 0 4px 10px rgba(0,0,0,.55); }
.fw-pk-pts { position: absolute; top: -8px; right: -6px; z-index: 7; padding: 4px 8px; border-radius: 999px; font: 800 14px/1 "Barlow Condensed", sans-serif; color: #1c1405;
    background: linear-gradient(135deg, #f6d77a, #cf961f); box-shadow: 0 4px 10px rgba(0,0,0,.5); }
.fw-pfoot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 -22px; padding: 12px 22px calc(14px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid rgba(255,255,255,.08); background: rgba(10,11,14,.9); border-radius: 0 0 24px 24px; }
.fw-sum { font: 500 16px/1.2 "Barlow Condensed", sans-serif; color: var(--fw-dim); }
.fw-sum b { color: #fff; }

/* ── Factions set cards (cardHtml adds .faction + --fc): the flag big on the faction's colour, banner stripes ── */
.tc-card.faction .tc-art { --fcx: color-mix(in srgb, var(--fc, var(--rc)) 65%, #8a93a3);
    background: radial-gradient(72% 66% at 50% 52%, color-mix(in srgb, var(--fcx) 60%, transparent), transparent 72%),
        repeating-linear-gradient(135deg, rgba(255,255,255,.035) 0 7px, transparent 7px 14px), linear-gradient(180deg, #0c0d11, #17191f);
    border-color: color-mix(in srgb, var(--fcx) 40%, rgba(255,255,255,.06)); }
.tc-card.faction .tc-art img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 8px 12px rgba(0,0,0,.65)) drop-shadow(0 0 1px rgba(255,255,255,.6)) saturate(1.15) brightness(1.08); }
.tc-card.faction .tc-name { color: var(--rc); }

/* ── phones: slim rows, your faction stacked, picker as a bottom sheet ── */
@media (max-width: 640px) {
    .fw { padding: 10px; gap: 8px; border-radius: 16px; }
    .fw-title b { font-size: 21px; }
    .fw-clock time { font-size: 18px; }
    .fw-mine { grid-template-columns: auto minmax(0, 1fr); padding: 8px 10px; gap: 8px 10px; }
    .fw-mine.none { grid-template-columns: auto minmax(0, 1fr) auto; }
    .fw-flag.big { width: 48px; height: 48px; border-radius: 12px; }
    .fw-mine-t b { font-size: 19px; }
    .fw-mine-t span { font-size: 14px; }
    .fw-mine-act { grid-column: 1 / -1; justify-items: stretch; }
    .fw-slots { justify-content: space-between; }
    .fw-slot { flex: 1 1 0; height: 50px; width: auto; max-width: 64px; }
    .fw-mine-sub { justify-content: space-between; flex-wrap: wrap; }
    .fw-why { max-width: none; text-align: left; }
    .fw-row { grid-template-columns: 26px 32px minmax(0, 1fr) auto; gap: 8px; padding: 5px 10px 5px 6px; }
    .fw-row .fw-flag { width: 32px; height: 32px; border-radius: 8px; }
    .fw-pl { font-size: 15px; }
    .fw-nm-t b { font-size: 16px; }
    .fw-nm small { font-size: 12px; }
    .fw-pts b { font-size: 17px; }
    .fw-rw span { font-size: 13px; padding: 4px 8px; }
    .fw-ov { place-items: end stretch; padding: calc(10px + var(--safe-top, 0px)) 0 0; }
    .fw-sheet { width: 100%; max-height: calc(92dvh - var(--safe-top, 0px)); padding: 18px 14px 0; border-radius: 22px 22px 0 0; border-bottom: 0; }
    .fw-sheet h3 { font-size: 22px; }
    .fw-pfoot { margin: 0 -14px; padding: 10px 14px calc(12px + env(safe-area-inset-bottom, 0px)); border-radius: 0; }
    .fw-sum { font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) { .fw-bar i { transition: none; } .fw-loading span { animation: none; } }
