/* Challenge Me — "Lamé" theme.
   Built from fencing gear: the silver conductive lamé (metallic shimmer on cards, digits, badges),
   the mask mesh (crosshatch texture), and the scoring box (red lamp left, green lamp right). */
:root {
  --bg: #07080a; --panel: #101216; --panel2: #161920; --line: rgba(255,255,255,.09); --line2: rgba(255,255,255,.16);
  --ink: #e9edf2; --mut: #8a939d; --dim: #5d646d;
  --red: #ff2a3d; --green: #19e57c; --yellow: #ffd23f;
  --display: 'Michroma', 'Eurostile', system-ui, sans-serif; --body: 'Manrope', system-ui, sans-serif;
  --r: 16px; color-scheme: dark;
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { height: calc(100% + var(--gapfix, 0px)); overflow: hidden; }
/* the visible screen exactly: in Safari 100% is the screen WITHOUT toolbars, so the page could scroll ~48pt.
   --gapfix: iOS 26 home-screen bug, the app is laid out 62pt shorter than the screen it's drawn on (app.js fitShell) */
@supports (height: 100dvh) { html, body { height: calc(100dvh + var(--gapfix, 0px)); } }
/* App shell. Nothing here uses position:fixed: iOS 26 home-screen apps pin "fixed" things to the page instead of
   the screen (the tab bar rode up on short screens and scrolled away on long ones). The body is exactly the screen
   and never scrolls; #scroll is the only thing that moves; the tab bar and backdrop are placed inside the body. */
body { position: relative; }
#scroll { position: absolute; inset: 0; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; overscroll-behavior-y: contain; z-index: 1; }
body { background: var(--bg); color: var(--ink); font: 500 15px/1.45 var(--body); font-variant-numeric: tabular-nums; overscroll-behavior-y: none; }
body::before { content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(90% 45% at 90% -8%, rgba(214,222,235,.22), transparent 60%),
    radial-gradient(60% 35% at -15% 28%, rgba(255,42,61,.13), transparent 65%),
    radial-gradient(60% 35% at 115% 72%, rgba(25,229,124,.09), transparent 65%),
    linear-gradient(180deg, #11141a 0%, #0a0c0f 45%, #07080a 100%); }
body::after { content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 0;
  background:
    repeating-linear-gradient(45deg, rgba(220,228,238,.075) 0 1px, transparent 1px 8px),
    repeating-linear-gradient(-45deg, rgba(220,228,238,.075) 0 1px, transparent 1px 8px),
    linear-gradient(115deg, transparent 35%, rgba(255,255,255,.07) 47%, rgba(255,255,255,.0) 58%);
  background-size: auto, auto, 300% 100%;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, rgba(0,0,0,.55) 45%, rgba(0,0,0,.25) 100%); mask-image: linear-gradient(180deg, #000 0%, rgba(0,0,0,.55) 45%, rgba(0,0,0,.25) 100%);
  animation: sheen 14s linear infinite; }
@keyframes sheen { from { background-position: 0 0, 0 0, 150% 0; } to { background-position: 0 0, 0 0, -150% 0; } }
#app { position: relative; z-index: 1; max-width: 520px; margin: 0 auto; min-height: 100%; box-sizing: border-box; padding: calc(env(safe-area-inset-top, 0px) + 14px) max(16px, env(safe-area-inset-right, 0px)) calc(env(safe-area-inset-bottom, 0px) + 96px) max(16px, env(safe-area-inset-left, 0px)); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
h1, h2, h3 { font-weight: 400; font-family: var(--display); letter-spacing: 1px; text-wrap: balance; }
h1 { font-size: 20px; }
h2 { font-size: 12px; letter-spacing: 2.5px; text-transform: uppercase; margin: 28px 0 12px; display: flex; align-items: center; gap: 10px; color: #c9d0d8; }
h2::before { content: ""; width: 10px; height: 10px; flex: 0 0 auto; border-radius: 2px; transform: rotate(45deg); background: linear-gradient(135deg, #fff, #8b949e); box-shadow: 0 0 10px rgba(255,255,255,.35); }
h2::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, rgba(233,237,242,.5), rgba(233,237,242,0)); }
small, .mut { color: var(--mut); }
.row { display: flex; align-items: center; gap: 10px; } .sp { flex: 1; min-width: 0; } .col { display: flex; flex-direction: column; gap: 10px; }
.ell { display: inline-block; max-width: 100%; vertical-align: bottom; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---- lamé ---- */
.lame { background: linear-gradient(110deg, #9aa3ad 0%, #c6cdd5 38%, #ffffff 50%, #c6cdd5 62%, #9aa3ad 100%);
  background-size: 300% 100%; background-position: 100% 0; -webkit-background-clip: text; background-clip: text; color: transparent; animation: shim 15s ease-in-out infinite; }
/* one quick sweep of light, then rest: the shine plays once every 15 seconds */
@keyframes shim { 0% { background-position: 100% 0; } 10% { background-position: 0% 0; } 100% { background-position: 0% 0; } }
.finish-0 { --f1: #b0704a; --f2: #f1c3a1; --f3: #6e3f24; }  /* Bronze */
.finish-1 { --f1: #8f98a3; --f2: #f3f6fa; --f3: #59616b; }  /* Silver */
.finish-2 { --f1: #b08a2e; --f2: #fff0b8; --f3: #6c5214; }  /* Gold */
.finish-3 { --f1: #7f9bb4; --f2: #eef7ff; --f3: #3f5970; }  /* Platinum */
.finish-4 { --f1: #9aa3ad; --f2: #ffffff; --f3: #5c6570; }  /* Lamé: adds the holo sweep */
.card { position: relative; overflow: hidden; border-radius: 20px; padding: 16px; color: #0a0c0f;
  background: linear-gradient(120deg, rgba(255,255,255,0) 30%, rgba(255,255,255,.45) 45%, rgba(255,255,255,0) 60%), linear-gradient(155deg, var(--f1), var(--f2) 40%, var(--f1) 70%, var(--f3));
  background-size: 300% 100%, 100% 100%; background-position: 150% 0, 0 0; animation: holo 15s ease-in-out infinite; box-shadow: 0 18px 50px rgba(0,0,0,.5), inset 0 0 0 1px rgba(255,255,255,.35); }
.card.finish-4::after { content: ""; position: absolute; inset: 0; pointer-events: none; mix-blend-mode: overlay; opacity: .55;
  background: linear-gradient(115deg, #ff9ad5, #9ad7ff, #b4ffcf, #fff2a6, #ff9ad5); background-size: 300% 100%; animation: holo 15s ease-in-out infinite; }
@keyframes holo { 0% { background-position: 150% 0, 0 0; } 12% { background-position: -150% 0, 0 0; } 100% { background-position: -150% 0, 0 0; } }
.card .mesh { position: absolute; right: -36px; top: -36px; width: 150px; height: 150px; border-radius: 50%; opacity: .5;
  background: repeating-linear-gradient(45deg, rgba(10,12,15,.55) 0 1.5px, transparent 1.5px 7px), repeating-linear-gradient(-45deg, rgba(10,12,15,.55) 0 1.5px, transparent 1.5px 7px); }
.card .k { font: 800 10px var(--body); letter-spacing: 2px; text-transform: uppercase; opacity: .75; }
.card .nm { font: 400 21px/1.35 var(--display); margin-top: 20px; position: relative; padding-right: 92px; padding-bottom: .12em; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card .un { font: 700 12px var(--body); letter-spacing: .5px; opacity: .7; margin-top: 3px; position: relative; padding-right: 92px; }
.card .rt { font: 800 46px/1 var(--body); letter-spacing: -2px; margin-top: 6px; }
.card .rt em { font: 800 10px var(--body); font-style: normal; letter-spacing: 2px; margin-left: 6px; }
.card .torank { display: inline-block; margin-top: 6px; font: 700 12px var(--body); color: inherit; opacity: .85; text-decoration: none; border-bottom: 1px dashed currentColor; position: relative; }
.card .chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; position: relative; }
.card .chip { font: 800 11px var(--body); padding: 4px 9px; border-radius: 999px; background: rgba(10,12,15,.12); box-shadow: inset 0 0 0 1px rgba(10,12,15,.25); }
.rel { height: 6px; border-radius: 6px; background: rgba(10,12,15,.18); margin-top: 6px; overflow: hidden; }
.rel i { display: block; height: 100%; background: #0a0c0f; border-radius: 6px; }

/* ---- surfaces ---- */
.panel { background: linear-gradient(165deg, rgba(44,49,58,.78), rgba(18,20,25,.9) 55%); border-radius: var(--r); box-shadow: inset 0 1px 0 rgba(255,255,255,.12), inset 0 0 0 1px var(--line); padding: 14px; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.list { display: flex; flex-direction: column; gap: 6px; }
.item { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 14px; background: linear-gradient(165deg, rgba(40,45,53,.75), rgba(16,18,22,.9) 60%); box-shadow: inset 0 1px 0 rgba(255,255,255,.1), inset 0 0 0 1px var(--line); min-width: 0; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.item.me { box-shadow: inset 0 0 0 1.5px var(--ink); }
.item b { font-weight: 800; }
.pos { font: 800 15px var(--body); width: 30px; text-align: center; color: var(--mut); }
.pos.top { color: var(--ink); }
.av { width: 40px; height: 40px; flex: 0 0 auto; border-radius: 50%; display: grid; place-items: center; font: 400 12px var(--display); color: #0a0c0f; position: relative;
  background: repeating-linear-gradient(45deg, rgba(10,12,15,.35) 0 1px, transparent 1px 5px), repeating-linear-gradient(-45deg, rgba(10,12,15,.35) 0 1px, transparent 1px 5px), linear-gradient(150deg, var(--f1), var(--f2) 50%, var(--f3)); }
.av.lg { width: 56px; height: 56px; font-size: 15px; }
.num { font: 800 17px var(--body); }
.up { color: var(--green); } .dn { color: var(--red); }
.pill { display: inline-flex; align-items: center; gap: 5px; font: 800 10px var(--body); letter-spacing: 1.5px; text-transform: uppercase; padding: 4px 9px; border-radius: 999px; box-shadow: inset 0 0 0 1px var(--line2); color: var(--mut); white-space: nowrap; }
.pill.ok { color: var(--green); box-shadow: inset 0 0 0 1px rgba(25,229,124,.5); }
.pill.warn { color: var(--yellow); box-shadow: inset 0 0 0 1px rgba(255,210,63,.5); }
.pill.bad { color: var(--red); box-shadow: inset 0 0 0 1px rgba(255,42,61,.5); }
.pill.live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--red); box-shadow: 0 0 8px var(--red); animation: blink 1.2s infinite; }
@keyframes blink { 50% { opacity: .25; } }

/* ---- controls ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 14px 18px; border-radius: 14px; font: 400 12px var(--display); letter-spacing: 3px; text-transform: uppercase; background: var(--ink); color: #07080a; width: 100%; }
.btn.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line2); }
.btn.red { background: var(--red); color: #fff; } .btn.green { background: var(--green); color: #04150b; }
.btn.sm { width: auto; padding: 9px 13px; font-size: 10px; letter-spacing: 2px; border-radius: 11px; }
.btn:disabled { opacity: .4; }
.seg { display: flex; gap: 5px; padding: 4px; border-radius: 13px; background: rgba(16,18,22,.9); box-shadow: inset 0 0 0 1px var(--line); overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button { flex: 1 0 auto; padding: 9px 10px; border-radius: 10px; font: 400 10px var(--display); letter-spacing: 1.5px; text-transform: uppercase; color: var(--mut); white-space: nowrap; }
.seg button.on { background: var(--ink); color: #07080a; }
label.f { display: flex; flex-direction: column; gap: 6px; font: 800 10px var(--body); letter-spacing: 1.5px; text-transform: uppercase; color: var(--mut); }
input.t, select.t, textarea.t { width: 100%; padding: 12px 13px; border-radius: 12px; border: none; background: var(--panel2); box-shadow: inset 0 0 0 1px var(--line2); font: 600 16px var(--body); color: var(--ink); text-transform: none; letter-spacing: 0; }
textarea.t { min-height: 96px; resize: vertical; line-height: 1.45; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.err { color: var(--red); font-weight: 700; font-size: 13px; min-height: 18px; }

/* ---- header + tab bar ---- */
.top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.logo { font: 400 13px var(--display); letter-spacing: 4px; }
.back { font: 400 11px var(--display); letter-spacing: 2px; color: var(--mut); padding: 6px 0; }
nav.tabs { position: absolute; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; justify-content: center; padding: 8px max(10px, env(safe-area-inset-right, 0px)) calc(env(safe-area-inset-bottom, 0px) + 8px) max(10px, env(safe-area-inset-left, 0px));
  background: linear-gradient(180deg, rgba(7,8,10,0), rgba(7,8,10,.96) 35%); }
nav.tabs[hidden] { display: none; }
nav.tabs .in { display: flex; width: 100%; max-width: 500px; background: linear-gradient(180deg, rgba(52,57,66,.95), rgba(20,22,27,.97)); border-radius: 20px; box-shadow: inset 0 0 0 1px var(--line2), 0 10px 30px rgba(0,0,0,.5); padding: 6px; }
nav.tabs a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 7px 0; border-radius: 14px; font: 800 9px var(--body); letter-spacing: 1.2px; text-transform: uppercase; color: var(--dim); position: relative; }
nav.tabs a svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.8; }
nav.tabs a.on { color: var(--ink); background: rgba(255,255,255,.07); }
nav.tabs a.fence { color: #07080a; background: var(--ink); margin: 0 4px; }
nav.tabs a .dot { position: absolute; top: 4px; right: 26%; min-width: 16px; height: 16px; border-radius: 8px; background: var(--red); color: #fff; font-size: 9px; display: grid; place-items: center; padding: 0 4px; }

/* ---- stakes (Chess.com-style preview) ---- */
.stakes { display: grid; grid-template-columns: repeat(3, 1fr); text-align: center; gap: 6px; }
.stakes div { padding: 10px 4px; border-radius: 12px; background: var(--panel2); }
.stakes b { display: block; font: 800 22px var(--body); }
.stakes small { font: 800 9px var(--body); letter-spacing: 1.5px; text-transform: uppercase; }

/* ---- profile facts ---- */
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.facts > div, .facts > a { padding: 10px; border-radius: 12px; background: linear-gradient(165deg, rgba(40,45,53,.7), rgba(16,18,22,.88) 60%); box-shadow: inset 0 1px 0 rgba(255,255,255,.1), inset 0 0 0 1px var(--line); min-width: 0; }
.facts small { display: block; font: 800 9px var(--body); letter-spacing: 1.5px; text-transform: uppercase; }
.facts b { font: 800 14px var(--body); display: block; overflow-wrap: anywhere; }
.bio { font-size: 15px; color: #cdd3da; margin-top: 12px; font-style: italic; }

/* ---- charts ---- */
svg.chart { width: 100%; height: auto; display: block; overflow: visible; }
svg.chart text { fill: var(--mut); font: 700 10px var(--body); }

/* ---- league zones ---- */
.zone { font: 800 10px var(--body); letter-spacing: 2px; text-transform: uppercase; padding: 6px 2px; }
.zone.upz { color: var(--green); border-bottom: 1.5px dashed rgba(25,229,124,.6); }
.zone.dnz { color: var(--red); border-top: 1.5px dashed rgba(255,42,61,.6); }
.tierbadge { display: inline-grid; place-items: center; width: 60px; height: 60px; border-radius: 16px; transform: rotate(45deg); background: linear-gradient(150deg, var(--f1), var(--f2) 50%, var(--f3)); box-shadow: 0 10px 30px rgba(0,0,0,.5); }
.tierbadge span { transform: rotate(-45deg); font: 400 16px var(--display); color: #0a0c0f; }

/* ---- live bout ---- */
.bout { display: flex; flex-direction: column; min-height: calc(100vh - 130px); min-height: calc(100dvh - 130px); }
.lamps { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.lamp { height: 14px; border-radius: 8px; background: #1a1d23; transition: background .08s, box-shadow .08s; }
.lamp.L.lit { background: var(--red); box-shadow: 0 0 50px 14px rgba(255,42,61,.6); }
.lamp.R.lit { background: var(--green); box-shadow: 0 0 50px 14px rgba(25,229,124,.55); }
.board { display: grid; grid-template-columns: 1fr 1fr; margin-top: 14px; }
.board .s { text-align: center; }
.board .n { font: 800 112px/0.95 var(--body); letter-spacing: -6px; }
.board .who { font: 400 10px var(--display); letter-spacing: 2px; color: var(--mut); margin-top: 6px; }
.board .who i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin: 0 6px; vertical-align: 1px; }
.board .cards { height: 18px; display: flex; gap: 3px; justify-content: center; margin-top: 6px; }
.clock { text-align: center; margin-top: 14px; cursor: pointer; user-select: none; }
.clock b { font: 400 40px var(--display); letter-spacing: 2px; }
.clock small { display: block; font: 800 10px var(--body); letter-spacing: 2.5px; text-transform: uppercase; margin-top: 2px; }
.clock.run b { color: var(--ink); text-shadow: 0 0 20px rgba(255,255,255,.35); }
.passive { text-align: center; font: 700 11px var(--body); color: var(--dim); margin-top: 4px; }
.passive.hot { color: var(--yellow); }
.hits { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: auto; padding-top: 16px; }
.hits button { padding: 22px 0; border-radius: 16px; font: 400 12px var(--display); letter-spacing: 2px; }
.hits .L { background: var(--red); color: #fff; } .hits .R { background: var(--green); color: #04150b; }
.hits .D { grid-column: span 2; padding: 14px 0; box-shadow: inset 0 0 0 1px var(--line2); }
.pens { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; margin-top: 10px; align-items: center; }
.pens .g { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.pens button { height: 34px; border-radius: 7px; font: 800 10px var(--body); color: #07080a; }
.pens .y { background: var(--yellow); } .pens .r { background: var(--red); color: #fff; } .pens .b { background: #000; color: #fff; box-shadow: inset 0 0 0 1px #555; }
.pens .mid { display: flex; flex-direction: column; gap: 4px; }
.cardchip { width: 12px; height: 17px; border-radius: 2px; display: inline-block; position: relative; }
.cardchip.y { background: var(--yellow); } .cardchip.r { background: var(--red); } .cardchip.b { background: #000; box-shadow: 0 0 0 1px #777; }
.cardchip.p::after { content: "P"; position: absolute; inset: 0; font: 800 9px/17px var(--body); text-align: center; color: #000; } .cardchip.b.p::after, .cardchip.r.p::after { color: #fff; }
.flash { position: absolute; inset: 0; pointer-events: none; z-index: 30; opacity: 0; }
.flash.L { background: radial-gradient(80% 60% at 0% 50%, rgba(255,42,61,.55), transparent 70%); }
.flash.R { background: radial-gradient(80% 60% at 100% 50%, rgba(25,229,124,.5), transparent 70%); }
.flash.D { background: radial-gradient(60% 50% at 0% 50%, rgba(255,42,61,.5), transparent 70%), radial-gradient(60% 50% at 100% 50%, rgba(25,229,124,.45), transparent 70%); }
.flash.go { animation: fl .7s ease-out; } @keyframes fl { 0% { opacity: 1; } 100% { opacity: 0; } }
.overlay { position: absolute; inset: 0; z-index: 40; display: grid; place-items: center; pointer-events: none; opacity: 0;
  background: repeating-linear-gradient(45deg, rgba(220,226,232,.5) 0 1.5px, transparent 1.5px 9px), repeating-linear-gradient(-45deg, rgba(220,226,232,.5) 0 1.5px, transparent 1.5px 9px), rgba(7,8,10,.82); }
.overlay b { font: 400 44px var(--display); letter-spacing: 4px; text-align: center; padding: 0 20px; }
.overlay.go { animation: ov 1.05s ease forwards; } @keyframes ov { 0% { opacity: 0; transform: scale(1.3); } 18% { opacity: 1; transform: scale(1); } 78% { opacity: 1; } 100% { opacity: 0; } }
.toast { position: absolute; left: 50%; bottom: calc(env(safe-area-inset-bottom, 0px) + 96px); transform: translate(-50%, 10px); z-index: 50; max-width: 92vw; padding: 11px 15px; border-radius: 12px; background: #f1f4f7; color: #07080a; font: 700 13px var(--body); opacity: 0; transition: .25s; pointer-events: none; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ---- body map (notes) ---- */
.bodymap { display: grid; grid-template-columns: 160px 1fr; gap: 14px; align-items: center; }
.bodymap svg { width: 160px; height: auto; }
.bodymap .z { fill: rgba(233,237,242,.1); stroke: rgba(233,237,242,.45); stroke-width: 1; stroke-linejoin: round; cursor: pointer; transition: .12s; }
.bodymap .deco { fill: none; stroke: rgba(233,237,242,.35); stroke-width: 1; pointer-events: none; }
.bodymap .z:hover { fill: rgba(255,255,255,.14); }
.dotmark { pointer-events: none; }
.welcome { min-height: calc(100vh - 40px); min-height: calc(100dvh - 40px - env(safe-area-inset-top, 0px)); display: flex; flex-direction: column; justify-content: flex-end; gap: 12px; padding-top: 34vh; }
body.welcome-bg #app { padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 18px); }
.welcome .madeby { margin: 18px 0 0; }
.welcome .mut { color: #c3cad2; }
.welcome .hero, .welcome .mut, .welcome .logo { text-shadow: 0 2px 18px rgba(0,0,0,.65); }
.welcome .hero { font: 400 34px/1.08 var(--display); letter-spacing: 1px; }
.empty { text-align: center; color: var(--mut); padding: 22px 10px; font-size: 14px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---- photographic stages (real fencing materials) ---- */
.stage { position: relative; margin: 0 -16px; padding: 4px 16px 6px; }
.stage::before { content: ""; position: absolute; inset: -80px 0 -40px; z-index: -1; background: none; opacity: 0;
  -webkit-mask-image: radial-gradient(90% 70% at 50% 35%, #000 30%, transparent 75%); mask-image: radial-gradient(90% 70% at 50% 35%, #000 30%, transparent 75%); filter: saturate(.6) contrast(1.15); }
body.welcome-bg::before { background: linear-gradient(180deg, rgba(7,8,10,0) 0%, rgba(7,8,10,.15) 30%, rgba(7,8,10,.75) 52%, rgba(7,8,10,.94) 66%, #07080a 80%), url(/fencer-bw.jpg) 70% 0/cover; }
body.welcome-bg::after { opacity: .4; }
/* ---- piste strip under the scoreboard (centre line, en-garde lines, warning zones) ---- */
.piste { position: relative; height: 26px; margin: 16px 2px 0; border-radius: 4px; background: linear-gradient(180deg, #5b636e, #2b3038 60%, #1d2127); box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 8px 24px rgba(0,0,0,.5); overflow: hidden; }
.piste::before { content: ""; position: absolute; inset: 0; background:
  linear-gradient(90deg, transparent calc(50% - 1px), rgba(255,255,255,.85) calc(50% - 1px) calc(50% + 1px), transparent calc(50% + 1px)),
  linear-gradient(90deg, transparent calc(35% - 1px), rgba(255,255,255,.6) calc(35% - 1px) calc(35% + 1px), transparent calc(35% + 1px)),
  linear-gradient(90deg, transparent calc(65% - 1px), rgba(255,255,255,.6) calc(65% - 1px) calc(65% + 1px), transparent calc(65% + 1px)); }
.piste::after { content: ""; position: absolute; inset: 0; background:
  repeating-linear-gradient(45deg, rgba(255,255,255,.35) 0 2px, transparent 2px 6px) left / 12% 100% no-repeat,
  repeating-linear-gradient(-45deg, rgba(255,255,255,.35) 0 2px, transparent 2px 6px) right / 12% 100% no-repeat; }
.bout { position: relative; }
.bout::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(60% 45% at 0% 35%, rgba(255,42,61,.16), transparent 70%), radial-gradient(60% 45% at 100% 35%, rgba(25,229,124,.13), transparent 70%); }
.board .n { text-shadow: 0 10px 40px rgba(0,0,0,.6); }

/* ---- photos + grips ---- */
.av.photo { background-size: cover; background-position: center; box-shadow: 0 0 0 2px rgba(196,202,210,.7), 0 0 0 3px rgba(0,0,0,.35); }
.card .cardphoto { position: absolute; right: 14px; top: 14px; width: 74px; height: 74px; border-radius: 50%; background-size: cover; background-position: center; box-shadow: 0 0 0 3px #b9c0c8, 0 8px 20px rgba(0,0,0,.35); }
.gchips { display: flex; flex-wrap: wrap; gap: 6px; }
.gchip { padding: 8px 12px; border-radius: 999px; font: 700 13px var(--body); box-shadow: inset 0 0 0 1px var(--line2); color: var(--mut); }
.gchip.on { background: var(--ink); color: #07080a; box-shadow: none; }

/* ---- coach marks ---- */
#cm-spot { position: absolute; z-index: 60; border-radius: 16px; pointer-events: none; opacity: 0; transition: all .35s cubic-bezier(.2,.8,.2,1), opacity .2s;
  box-shadow: 0 0 0 9999px rgba(4,5,7,.78), 0 0 0 2px rgba(255,255,255,.9), 0 0 30px 6px rgba(255,255,255,.35); }
#cm-tip { position: absolute; z-index: 61; left: max(16px, env(safe-area-inset-left, 0px)); right: max(16px, env(safe-area-inset-right, 0px)); max-width: 420px; margin: 0 auto;
  padding: 14px 16px 14px; border-radius: 16px; background: #f1f4f7; color: #0a0c0f; box-shadow: 0 20px 50px rgba(0,0,0,.6); display: none; flex-direction: column; gap: 6px; transition: top .35s cubic-bezier(.2,.8,.2,1); }
#cm-tip::before { content: ""; position: absolute; top: -8px; left: var(--ax, 50%); width: 16px; height: 16px; background: #f1f4f7; transform: translateX(-50%) rotate(45deg); border-radius: 3px; }
#cm-tip.above::before { top: auto; bottom: -8px; }
#cm-tip.in { animation: tipin .35s cubic-bezier(.2,.8,.2,1); } @keyframes tipin { from { opacity: 0; transform: translateY(8px) scale(.97); } }
body.coaching #cm-spot { opacity: 1; } body.coaching #cm-tip { display: flex; }
#cm-tip .cm-k { font: 800 10px var(--body); letter-spacing: 1.5px; text-transform: uppercase; color: #5d646d; }
#cm-tip .cm-skip { font: 800 11px var(--body); color: #5d646d; padding: 2px 4px; }
#cm-tip .cm-t { font: 400 15px var(--display); letter-spacing: .5px; }
#cm-tip .cm-b { font: 600 14px/1.45 var(--body); color: #2b3038; } #cm-tip .cm-b b { color: #0a0c0f; }
#cm-tip .cm-b .up { color: #0f9d55; } #cm-tip .cm-b .dn { color: #d4283a; }
#cm-tip .cm-next { align-self: flex-end; background: #0a0c0f; color: #f1f4f7; margin-top: 4px; }
.btn.soon { opacity: .7; letter-spacing: 1.5px; }
.btn.soon i { font: 800 8px var(--body); font-style: normal; letter-spacing: 1px; padding: 2px 5px; border-radius: 4px; background: rgba(255,255,255,.14); }

/* ---- guide + watermark ---- */
.gsec { border-radius: 14px; background: linear-gradient(165deg, rgba(40,45,53,.75), rgba(16,18,22,.9) 60%); box-shadow: inset 0 1px 0 rgba(255,255,255,.1), inset 0 0 0 1px var(--line); }
.gsec summary { list-style: none; cursor: pointer; padding: 14px 16px; font: 800 15px var(--body); display: flex; align-items: center; gap: 10px; }
.gsec summary::-webkit-details-marker { display: none; }
.gsec summary::after { content: "+"; margin-left: auto; font: 400 20px var(--body); color: var(--mut); }
.gsec[open] summary::after { content: "–"; }
.gbody { padding: 0 16px 16px; display: flex; flex-direction: column; gap: 10px; color: #d5dbe2; font-size: 15px; }
.gbody b { color: var(--ink); } .gbody ol, .gbody ul { padding-left: 18px; display: flex; flex-direction: column; gap: 8px; }
.gbody .tut-table div { grid-template-columns: 1.3fr repeat(3, 1fr); }
.madeby { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 28px 0 6px; font: 700 11px var(--body); letter-spacing: 1.5px; text-transform: uppercase; color: var(--dim); }
.madeby img { width: 30px; height: 30px; opacity: .4; }
.tut-table { display: grid; gap: 6px; }
.tut-table div { display: grid; grid-template-columns: 1.6fr 1fr 1fr; align-items: center; padding: 9px 10px; border-radius: 10px; background: rgba(255,255,255,.05); }
.tut-table div:first-child { background: none; padding-bottom: 0; }
.tut-table span { font: 800 17px var(--body); text-align: center; } .tut-table small { text-align: center; font: 800 9px var(--body); letter-spacing: 1.5px; text-transform: uppercase; }
.gbody .tut-table div { grid-template-columns: 1.3fr repeat(3, 1fr); }

/* ---- sign-in extras ---- */
.check { display: inline-flex; align-items: center; gap: 9px; font: 600 14px var(--body); color: #cdd3da; cursor: pointer; }
.check input { position: absolute; opacity: 0; }
.check span { width: 20px; height: 20px; border-radius: 6px; box-shadow: inset 0 0 0 1.5px var(--line2); display: grid; place-items: center; flex: 0 0 auto; }
.check input:checked + span { background: var(--ink); box-shadow: none; }
.check input:checked + span::after { content: ""; width: 10px; height: 5px; border: 2px solid #07080a; border-top: 0; border-right: 0; transform: translateY(-1px) rotate(-45deg); }
.check input:focus-visible + span { outline: 2px solid var(--green); outline-offset: 2px; }
.linkbtn { font: 700 13px var(--body); color: var(--ink); text-decoration: underline; text-underline-offset: 3px; padding: 4px 0; }
/* On the photo the shimmer text was see-through; make the wordmark solid and readable there. */
.welcome .logo.lame { background: none; -webkit-background-clip: border-box; background-clip: border-box; color: var(--ink); -webkit-text-fill-color: var(--ink); animation: none; font-size: 14px; letter-spacing: 5px; }

/* ---- install steps ---- */
.istep { display: flex; align-items: center; gap: 12px; padding: 13px 14px; border-radius: 14px; background: linear-gradient(165deg, rgba(40,45,53,.75), rgba(16,18,22,.9) 60%); box-shadow: inset 0 1px 0 rgba(255,255,255,.1), inset 0 0 0 1px var(--line); font-size: 15px; color: #d5dbe2; }
.istep b { color: var(--ink); }
.inum { width: 28px; height: 28px; flex: 0 0 auto; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: #07080a; font: 800 13px var(--body); }
.iicon { width: 38px; height: 38px; flex: 0 0 auto; border-radius: 10px; display: grid; place-items: center; background: rgba(255,255,255,.08); color: #6aa8ff; }

/* ---- competitions ---- */
.tbadge { width: 40px; height: 40px; flex: 0 0 auto; border-radius: 12px; display: grid; place-items: center; color: #0a0c0f; background: linear-gradient(150deg, #f4f7fb, #b9c1ca 45%, #6f7883); box-shadow: inset 0 1px 0 rgba(255,255,255,.6), 0 6px 16px rgba(0,0,0,.35); }
.tbadge.big { width: 56px; height: 56px; font-size: 28px; border-radius: 16px; }
.item.tb { padding: 9px 12px; } .item.tb .w { font-weight: 800; color: var(--ink); } .item.tb .sp div:not(.w) { color: var(--mut); }
.ptable { margin-top: 8px; display: flex; flex-direction: column; font-size: 13px; }
.ptable > div { display: grid; grid-template-columns: 22px 1fr 40px 40px 32px; gap: 6px; padding: 6px 0; border-bottom: 1px solid var(--line); align-items: center; }
.ptable > div span:not(.sp) { text-align: center; } .ptable .ph { font: 800 9px var(--body); letter-spacing: 1.5px; text-transform: uppercase; color: var(--mut); }
.ptable .me { color: var(--ink); font-weight: 800; }
.champ { display: flex; align-items: center; gap: 14px; margin-top: 12px; background: linear-gradient(150deg, rgba(241,200,107,.25), rgba(16,18,22,.9) 60%); }
.champ .tbadge { background: linear-gradient(150deg, #fff3cc, #d9b45a 50%, #8a6514); } .champ b { display: block; font: 400 18px var(--display); }
.seg.wrap3 { display: grid; grid-template-columns: repeat(3, 1fr); } .seg.wrap3 button { white-space: normal; line-height: 1.3; padding: 9px 4px; }
.inl { display: inline-flex; align-items: center; gap: 5px; } .ic { flex: 0 0 auto; } .pos .ic { color: var(--ink); }
/* ---- default avatar (no photo): plain lamé disc + head-and-shoulders silhouette clipped inside the SVG ---- */
.av.blank { display: block; overflow: hidden; padding: 0; background: linear-gradient(150deg, var(--f2), var(--f1) 60%, var(--f3)); box-shadow: inset 0 0 0 1px rgba(255,255,255,.25); }
.av.blank svg, .cardphoto.blank svg { width: 100%; height: 100%; display: block; }
.card .cardphoto.blank { overflow: hidden; background: linear-gradient(160deg, rgba(255,255,255,.6), rgba(255,255,255,.18)); }
.card > .k { position: relative; padding-right: 92px; }

/* The club photo of a fencer (black and white) is the app's backdrop: full strength on the start screen, dimmed behind everything else. */
body:not(.welcome-bg)::before { background: linear-gradient(180deg, rgba(7,8,10,.55) 0%, rgba(7,8,10,.82) 40%, #07080a 75%), url(/fencer-bw.jpg) 70% 0/cover; }
body:not(.welcome-bg)::after { opacity: .35; }
.stage::before { filter: none; }

/* page transitions */
#app.pre { opacity: 0; transition: opacity .1s ease-out; }
#app.enter { animation: page-in .24s cubic-bezier(.2,.7,.2,1); }
@keyframes page-in { from { opacity: 0; } to { opacity: 1; } }

/* ---- photo cropper ---- */
.cropper { position: absolute; inset: 0; z-index: 70; background: #050608; display: flex; flex-direction: column; align-items: center; gap: 18px;
  padding: calc(env(safe-area-inset-top, 0px) + 14px) max(16px, env(safe-area-inset-right, 0px)) calc(env(safe-area-inset-bottom, 0px) + 20px) max(16px, env(safe-area-inset-left, 0px)); }
.crop-top { width: 100%; max-width: 480px; display: flex; align-items: center; justify-content: space-between; }
.crop-top b { font: 400 13px var(--display); letter-spacing: 2px; text-transform: uppercase; }
.crop-stage { position: relative; width: min(100%, 360px); aspect-ratio: 1; margin-top: 8vh; touch-action: none; cursor: grab; user-select: none; }
.crop-stage img { position: absolute; left: 50%; top: 50%; max-width: none; pointer-events: none; }
.crop-ring { position: absolute; inset: 0; z-index: 1; border-radius: 50%; pointer-events: none; box-shadow: 0 0 0 9999px rgba(5,6,8,.8), inset 0 0 0 2px rgba(255,255,255,.85); }
.crop-top, .crop-zoom, .crop-hint { position: relative; z-index: 2; }
.crop-zoom { width: min(100%, 360px); display: flex; align-items: center; gap: 12px; font: 400 18px var(--body); color: var(--mut); }
.crop-zoom input { flex: 1; accent-color: var(--ink); }
.crop-hint { color: var(--mut); }

/* ---- settings ---- */
.gear { color: var(--mut); padding: 6px; margin: -6px; display: grid; place-items: center; } .gear:active { color: var(--ink); }
.sgroup { border-radius: var(--r); overflow: hidden; background: linear-gradient(165deg, rgba(40,45,53,.75), rgba(16,18,22,.9) 60%); box-shadow: inset 0 1px 0 rgba(255,255,255,.1), inset 0 0 0 1px var(--line); }
.srow { display: flex; align-items: center; gap: 12px; width: 100%; padding: 13px 14px; text-align: left; font: 600 15px var(--body); color: var(--ink); }
.srow + .srow, .sgroup > div + .srow { border-top: 1px solid var(--line); }
.sic { width: 32px; height: 32px; flex: 0 0 auto; border-radius: 9px; display: grid; place-items: center; color: #0a0c0f; background: linear-gradient(150deg, #f4f7fb, #b9c1ca 45%, #6f7883); }
.chev { color: var(--dim); font-size: 20px; line-height: 1; }
.srow small { color: var(--mut); max-width: 45%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- QA fixes: things in a row or a 2-column grid may shrink; nothing pushes past its column (iPhone date pickers did) ---- */
.grid2 > *, .row > *, .item > .sp, label.f { min-width: 0; }
input.t, select.t, textarea.t { min-width: 0; max-width: 100%; }
input.t[type="date"], input.t[type="datetime-local"], input.t[type="time"] { -webkit-appearance: none; appearance: none; display: block; min-height: 46px; text-align: left; }
input.t::-webkit-date-and-time-value { text-align: left; }
.btn { min-width: 0; }
.btn.soon { position: relative; overflow: visible; letter-spacing: 1.5px; }
.btn.soon .soonb { position: absolute; top: -7px; right: 8px; font: 800 8px var(--body); font-style: normal; letter-spacing: 1px; text-transform: uppercase; padding: 2px 6px; border-radius: 5px; background: #2a2f37; color: var(--mut); box-shadow: inset 0 0 0 1px var(--line2); }
.item .sub { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 2px; }
.item .sub .pill { padding: 2px 7px; font-size: 9px; }

/* ===================== LIGHT THEME (cream + navy, from the light fencer artwork and icon) ===================== */
html[data-theme="light"] { color-scheme: light;
  --bg: #fbf6f2; --panel: #ffffff; --panel2: #f3ece6; --line: rgba(11,36,82,.12); --line2: rgba(11,36,82,.22);
  --ink: #0b2452; --mut: #5b6780; --dim: #8b93a6; --red: #e0283a; --green: #0e9f55; --yellow: #c79400; --sheet: #ffffff; }
html[data-theme="light"] body { background: var(--bg); }
html[data-theme="light"] body::before { background: linear-gradient(180deg, #fbf6f2, #f6efe9 60%, #fbf6f2); }
html[data-theme="light"] body:not(.welcome-bg)::before { background: linear-gradient(180deg, rgba(251,246,242,.55) 0%, rgba(251,246,242,.85) 40%, #fbf6f2 75%), url(/fencer-light.jpg) 70% 0/cover; }
html[data-theme="light"] body.welcome-bg::before { background: linear-gradient(180deg, rgba(251,246,242,0) 0%, rgba(251,246,242,.1) 32%, rgba(251,246,242,.78) 54%, rgba(251,246,242,.95) 68%, #fbf6f2 82%), url(/fencer-light.jpg) 70% 0/cover; }
html[data-theme="light"] body::after { background: repeating-linear-gradient(45deg, rgba(11,36,82,.05) 0 1px, transparent 1px 8px), repeating-linear-gradient(-45deg, rgba(11,36,82,.05) 0 1px, transparent 1px 8px); opacity: .5; animation: none; }
/* type */
html[data-theme="light"] .lame { background: linear-gradient(110deg, #0b2452 0%, #2c4a86 38%, #6f86b8 50%, #2c4a86 62%, #0b2452 100%); background-size: 300% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; }
html[data-theme="light"] h2 { color: var(--ink); }
html[data-theme="light"] h2::before { background: linear-gradient(135deg, #2c4a86, #0b2452); box-shadow: none; }
html[data-theme="light"] h2::after { background: linear-gradient(90deg, rgba(11,36,82,.35), rgba(11,36,82,0)); }
html[data-theme="light"] .bio, html[data-theme="light"] .check, html[data-theme="light"] .gbody, html[data-theme="light"] .tut-body, html[data-theme="light"] .istep { color: #33405e; }
html[data-theme="light"] .welcome .mut { color: #33405e; }
html[data-theme="light"] .welcome .hero, html[data-theme="light"] .welcome .mut, html[data-theme="light"] .welcome .logo { text-shadow: 0 1px 14px rgba(251,246,242,.9), 0 0 2px rgba(251,246,242,.6); }
/* surfaces */
html[data-theme="light"] .panel, html[data-theme="light"] .item, html[data-theme="light"] .facts > div, html[data-theme="light"] .facts > a, html[data-theme="light"] .gsec,
html[data-theme="light"] .sgroup, html[data-theme="light"] .istep, html[data-theme="light"] .champ {
  background: rgba(255,255,255,.82); box-shadow: inset 0 0 0 1px var(--line), 0 6px 18px rgba(11,36,82,.06); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
html[data-theme="light"] .item.me { box-shadow: inset 0 0 0 1.5px var(--ink); }
html[data-theme="light"] .seg { background: rgba(255,255,255,.8); }
html[data-theme="light"] .seg button.on, html[data-theme="light"] .gchip.on { background: var(--ink); color: #fbf6f2; }
html[data-theme="light"] input.t, html[data-theme="light"] select.t, html[data-theme="light"] textarea.t { background: #fff; color: var(--ink); }
html[data-theme="light"] .btn { background: var(--ink); color: #fbf6f2; }
html[data-theme="light"] .btn.ghost { background: rgba(255,255,255,.7); color: var(--ink); }
html[data-theme="light"] .btn.green { background: var(--green); color: #fff; } html[data-theme="light"] .btn.red { background: var(--red); color: #fff; }
html[data-theme="light"] .btn.soon .soonb { background: #fff; }
html[data-theme="light"] .check input:checked + span::after { border-color: #fbf6f2; }
html[data-theme="light"] .tut-table div { background: rgba(11,36,82,.05); }
html[data-theme="light"] .iicon { background: rgba(11,36,82,.06); color: #2c4a86; }
html[data-theme="light"] .ptable .me { color: var(--ink); }
/* tab bar */
html[data-theme="light"] nav.tabs { background: linear-gradient(180deg, rgba(251,246,242,0), rgba(251,246,242,.96) 35%); }
html[data-theme="light"] nav.tabs .in { background: rgba(255,255,255,.95); box-shadow: inset 0 0 0 1px var(--line), 0 10px 30px rgba(11,36,82,.12); }
html[data-theme="light"] nav.tabs a.on { background: rgba(11,36,82,.07); }
html[data-theme="light"] nav.tabs a.fence { background: var(--ink); color: #fbf6f2; }
/* feedback */
html[data-theme="light"] .toast { background: var(--ink); color: #fbf6f2; }
html[data-theme="light"] .overlay { background: repeating-linear-gradient(45deg, rgba(11,36,82,.25) 0 1.5px, transparent 1.5px 9px), repeating-linear-gradient(-45deg, rgba(11,36,82,.25) 0 1.5px, transparent 1.5px 9px), rgba(251,246,242,.86); }
html[data-theme="light"] .overlay b { color: var(--ink); }
/* scoreboard */
html[data-theme="light"] .lamp { background: #e7ded6; }
html[data-theme="light"] .bout::before { background: radial-gradient(60% 45% at 0% 35%, rgba(224,40,58,.12), transparent 70%), radial-gradient(60% 45% at 100% 35%, rgba(14,159,85,.10), transparent 70%); }
html[data-theme="light"] .board .n { text-shadow: none; }
html[data-theme="light"] .clock.run b { text-shadow: none; }
html[data-theme="light"] .passive.hot { color: #b07d00; }
/* misc */
html[data-theme="light"] .madeby img { opacity: .45; }
html[data-theme="light"] .welcome .logo.lame { color: var(--ink); -webkit-text-fill-color: var(--ink); }
html[data-theme="light"] #cm-tip { background: #0b2452; color: #fbf6f2; box-shadow: 0 20px 50px rgba(11,36,82,.35); }
html[data-theme="light"] #cm-tip::before { background: #0b2452; }
html[data-theme="light"] #cm-tip .cm-k, html[data-theme="light"] #cm-tip .cm-skip { color: #aab4cc; }
html[data-theme="light"] #cm-tip .cm-b { color: #dfe5f2; } html[data-theme="light"] #cm-tip .cm-b b { color: #fff; }
html[data-theme="light"] #cm-tip .cm-b .up { color: #5fe39c; } html[data-theme="light"] #cm-tip .cm-b .dn { color: #ff8a95; }
html[data-theme="light"] #cm-tip .cm-next { background: #fbf6f2; color: #0b2452; }
html[data-theme="light"] #cm-spot { box-shadow: 0 0 0 9999px rgba(11,20,40,.55), 0 0 0 2px #0b2452, 0 0 30px 6px rgba(11,36,82,.3); }
/* sheets that used a fixed dark background */
.sheet { background: var(--sheet, #14171c) !important; }
/* ---- other languages: longer words must never wrap the header or tab bar ---- */
.top > :first-child { flex: none; }
.top > .logo:last-child { min-width: 0; margin-left: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: right; }
nav.tabs a { min-width: 0; white-space: nowrap; overflow: hidden; }
html:not([lang="en"]) nav.tabs a { letter-spacing: .5px; }
.srow .pill { max-width: 58%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: none; }
/* "Servers are down" bar (app.js serverDown) */
#downbar { position: absolute; left: 12px; right: 12px; top: calc(env(safe-area-inset-top, 0px) + 10px); z-index: 9999; display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 16px; background: rgba(255,255,255,.97); color: #4a5568; font-size: 13px; line-height: 1.4; box-shadow: inset 0 0 0 1px rgba(11,36,82,.12), 0 12px 32px rgba(11,36,82,.18); max-width: 500px; margin: 0 auto; }
#downbar img { width: 34px; height: 34px; flex: none; }
#downbar b { color: #0b2452; display: block; }
html[data-theme="dark"] #downbar { background: rgba(22,25,31,.97); color: #aab2bc; box-shadow: inset 0 0 0 1px rgba(255,255,255,.14), 0 12px 32px rgba(0,0,0,.5); }
html[data-theme="dark"] #downbar b { color: #fff; }
/* "Finish setting up" rows (home card + reminder sheet) */
.setrow { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.setrow:first-of-type { border-top: 0; }
.setrow .sp { flex: 1; min-width: 0; } .setrow small { color: var(--mut); white-space: normal; }
.setrow .btn { flex: none; }
.panel.setup { box-shadow: inset 0 0 0 1.5px var(--ink); }
/* Club picker */
.clubpick { position: relative; }
.clublist { display: none; position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 30; max-height: 290px; overflow-y: auto; border-radius: 14px; background: var(--panel); box-shadow: inset 0 0 0 1px var(--line2), 0 16px 40px rgba(0,0,0,.35); padding: 4px; }
.clublist.on { display: block; }
.clublist button { display: block; width: 100%; text-align: left; padding: 10px 12px; border: 0; border-radius: 10px; background: transparent; color: var(--ink); font: 700 14px var(--body); }
.clublist button:active, .clublist button:hover { background: rgba(127,127,127,.12); }
.clublist button small { display: block; font-weight: 500; font-size: 12px; color: var(--mut); margin-top: 2px; }
.clublist .cs { font-size: 11px; letter-spacing: 1px; color: var(--mut); margin-left: 4px; }
.clublist .new { border-top: 1px solid var(--line); border-radius: 0 0 10px 10px; }
html[data-theme="light"] .clublist { background: #fff; box-shadow: inset 0 0 0 1px rgba(11,36,82,.14), 0 16px 40px rgba(11,36,82,.16); }
/* Settings → App icon */
.iconpick { display: flex; gap: 14px; }
.iconpick button { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 10px; border: 0; border-radius: 18px; background: transparent; color: var(--mut); font: 700 12px var(--body); letter-spacing: 1px; text-transform: uppercase; }
.iconpick img { width: 72px; height: 72px; border-radius: 17px; box-shadow: 0 6px 18px rgba(0,0,0,.18), 0 0 0 1px var(--line2); }
.iconpick button.on { color: var(--ink); box-shadow: inset 0 0 0 2px var(--ink); }
/* Feels like an app, not a web page: no pinch zoom, no double-tap zoom, no zoom when a text box is tapped
   (iPhone zooms into any box with text under 16px, so every input is 16px). app.js blocks the pinch gesture. */
html, body { touch-action: pan-x pan-y; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
#scroll, nav.tabs, button, a, .seg { touch-action: manipulation; }
input, select, textarea { font-size: 16px !important; }
/* Non-combativity button: lights up after a minute without a touch */
.ncbtn { width: 100%; margin-top: 8px; }
.ncbtn.hot { box-shadow: inset 0 0 0 2px var(--yellow); color: var(--ink); animation: blink 1.2s infinite; }
.testctl { margin-top: 10px; gap: 8px; box-shadow: inset 0 0 0 1px var(--yellow); }
/* Live watch: touch-by-touch feed */
.evlog { gap: 0; padding: 4px 14px; max-height: 320px; overflow-y: auto; }
.evrow { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); font-weight: 700; font-size: 14px; }
.evrow:first-child { border-top: 0; }
.evrow i { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.evrow small { color: var(--mut); font-weight: 600; white-space: nowrap; }
/* Referee call written on the piste (Allez / Halt) instead of a full-screen animation */
.piste .call { position: absolute; z-index: 2; top: 50%; left: 50%; transform: translate(-50%, -50%); padding: 3px 12px 3px 16px; border-radius: 4px; background: #23272e; box-shadow: 0 0 0 1px rgba(255,255,255,.12); font: 400 11px var(--display); letter-spacing: 4px; text-transform: uppercase; white-space: nowrap; color: rgba(255,255,255,.8); }
.piste .call:empty { display: none; }
.piste .call.run { color: #8ff0b0; }
/* under each name: higher rank / priority */
.board .tags { display: flex; justify-content: center; gap: 4px; min-height: 18px; margin-top: 4px; }
.board .tag { font: 800 9px var(--body); letter-spacing: 1px; text-transform: uppercase; padding: 3px 7px; border-radius: 999px; box-shadow: inset 0 0 0 1px var(--line2); color: var(--mut); }
.board .tag.pri { background: var(--ink); color: var(--bg); box-shadow: none; }
/* referee tools */
.refrow { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.refrow > span { font-weight: 700; font-size: 14px; } .refrow > span b { margin-left: 6px; font-variant-numeric: tabular-nums; }
.refrow > div { display: flex; gap: 6px; }
.refrow button { min-width: 44px; height: 36px; padding: 0 10px; border-radius: 10px; border: 0; background: var(--panel2); box-shadow: inset 0 0 0 1px var(--line2); color: var(--ink); font: 700 13px var(--body); }
.refbar { display: flex; gap: 8px; margin-top: 8px; } .refbar .ncbtn { flex: 1; margin-top: 0; } .refbar #reftools { flex: none; padding: 0 16px; }
.refbar #reftools:only-child { flex: 1; }
#downbar svg { flex: none; color: #0b2452; } html[data-theme="dark"] #downbar svg { color: #fff; }
/* hundredths under the main clock: small and grey so the big clock stays clean */
.clock .cs { display: block; margin-top: -2px; font: 600 14px var(--body); letter-spacing: 1px; color: var(--mut); font-variant-numeric: tabular-nums; }
/* body map: marks in the right colour per side, zones tint as they collect marks */
.bodymap .dotmark { stroke: rgba(0,0,0,.35); stroke-width: .8; }
.bodymap .dotmark.me { fill: #19e57c; } .bodymap .dotmark.opp { fill: #ff2a3d; }
.bodymap .z.hit { fill: rgba(233,237,242, calc(.1 + var(--n, 0) * .18)); }
/* light theme: the dummy in navy so it reads on cream */
html[data-theme="light"] .bodymap .z { fill: rgba(11,36,82,.06); stroke: rgba(11,36,82,.55); stroke-width: 1.2; }
html[data-theme="light"] .bodymap .z:hover { fill: rgba(11,36,82,.12); }
html[data-theme="light"] .bodymap .z.hit { fill: rgba(11,36,82, calc(.08 + var(--n, 0) * .16)); }
html[data-theme="light"] .bodymap .deco { stroke: rgba(11,36,82,.45); }
html[data-theme="light"] .bodymap .dotmark { stroke: #fff; stroke-width: 1.2; }
html[data-theme="light"] .bodymap .dotmark.me { fill: #0f9d50; } html[data-theme="light"] .bodymap .dotmark.opp { fill: #dc2639; }
/* 3D fencer for notes (body3d.js); the flat dummy stays as the fallback */
.body3d { display: none; position: relative; border-radius: 16px; overflow: hidden; background: radial-gradient(ellipse at 50% 40%, rgba(255,255,255,.06), transparent 70%); box-shadow: inset 0 0 0 1px var(--line); }
.body3d.on { display: block; }
.b3dbar { position: absolute; left: 10px; right: 10px; top: 8px; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 8px; pointer-events: none; }
.b3dbar small { color: var(--mut); font-size: 11px; }
.b3dbar span { display: flex; gap: 4px; pointer-events: auto; }
.b3dbar button { padding: 6px 10px; border-radius: 9px; border: 0; background: var(--panel2); box-shadow: inset 0 0 0 1px var(--line2); color: var(--ink); font: 700 11px var(--body); }
.bodymap.wait svg { visibility: hidden; }
.bodymap.flat-off { grid-template-columns: 1fr; } .bodymap.flat-off svg { display: none; }
html[data-theme="light"] .body3d { background: radial-gradient(ellipse at 50% 40%, rgba(11,36,82,.05), transparent 70%); }
.facts > a { display: block; color: inherit; text-decoration: none; }
/* national teams: club name in gold */
.natclub { background: linear-gradient(100deg, #8a6a1c, #d8b04a 35%, #f6e08a 50%, #c99a2e 70%, #8a6a1c); -webkit-background-clip: text; background-clip: text; color: transparent; font-weight: 800; }
html[data-theme="dark"] .natclub { background: linear-gradient(100deg, #c99a2e, #f6e08a 45%, #d8b04a 70%, #b8892a); -webkit-background-clip: text; background-clip: text; }
.card .chip:has(.natclub) { background: #0b2452; box-shadow: inset 0 0 0 1px rgba(246,224,138,.6); } /* navy chip so the gold reads on any league card */
.card .chip .natclub { background: linear-gradient(100deg, #d8b04a, #fff1b0 50%, #e2bb55); -webkit-background-clip: text; background-clip: text; }
.clublist .dym { display: block; padding: 8px 12px 4px; color: var(--mut); font-size: 12px; }
.facts > a.cardnudge { box-shadow: inset 0 0 0 1.5px var(--ink); }
/* club photos / initials */
.clubpic { flex: none; display: inline-grid; place-items: center; border-radius: 14px; background: center/cover no-repeat; box-shadow: 0 0 0 1px var(--line2); }
.clubpic.ini { background: linear-gradient(160deg, #1b3a73, #0b2452); color: #fff; font-weight: 800; letter-spacing: 1px; }
.clubpic.ini.nat { color: #f6e08a; box-shadow: 0 0 0 1.5px rgba(246,224,138,.7); }
.list .item .clubpic { margin-right: 10px; }
.clubhead h1 { margin: 0; }
.clubadmin { margin-top: 12px; gap: 8px; } .clubadmin select.t { flex: 1; }
.item.unseen { box-shadow: inset 3px 0 0 var(--ink), inset 0 0 0 1px var(--line2); }
/* competition day */
.job.hot { box-shadow: inset 0 0 0 2px var(--ink); } .job b { font-size: 17px; }
.pnum { flex: none; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--ink); color: var(--bg); font: 800 15px var(--body); margin-right: 10px; }
/* confirm prompts show at the top so they never cover the button you tap again */
.toast.top { top: calc(env(safe-area-inset-top, 0px) + 14px); bottom: auto; }
/* photo crop header readable on the black stage */
.cropper .crop-top b, .cropper .crop-top .linkbtn { color: #fff; }
.cropper .crop-top [data-ok] { color: #19e57c !important; }
.pendnote { display: block; margin-top: -4px; color: var(--mut); }
/* Home: one line for everything waiting in the Inbox */
.todo { box-shadow: inset 0 0 0 1.5px var(--ink); }
.tcount { flex: none; min-width: 34px; height: 34px; padding: 0 8px; border-radius: 17px; display: grid; place-items: center; background: var(--red); color: #fff; font: 800 15px var(--body); margin-right: 10px; }
/* setup card collapsed to one line */
details.setup > summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 10px; cursor: pointer; }
details.setup > summary::-webkit-details-marker { display: none; }
details.setup > summary::after { content: '›'; font-size: 22px; color: var(--mut); transition: transform .15s; }
details.setup[open] > summary::after { transform: rotate(90deg); }
details.setup > summary small { margin-left: auto; color: var(--mut); }

/* Tab bar: the tab you're on is the solid one. Fence stays recognisable (outlined) when you're elsewhere. */
nav.tabs a.on, nav.tabs a.fence.on { background: var(--ink); color: var(--bg); }
nav.tabs a.fence:not(.on) { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line2); margin: 0 4px; }
html[data-theme="light"] nav.tabs a.on, html[data-theme="light"] nav.tabs a.fence.on { background: var(--ink); color: #fbf6f2; }
html[data-theme="light"] nav.tabs a.fence:not(.on) { background: transparent; color: var(--ink); }
/* Me tab: your profile photo */
nav.tabs a .tabpic { width: 24px; height: 24px; border-radius: 50%; background: center/cover no-repeat; box-shadow: 0 0 0 1.5px currentColor; }
/* competition planning + organiser steps */
.planrow { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.planrow:first-child { border-top: 0; } .planrow.best b:first-child { color: var(--ink); } .planrow.cur { background: rgba(127,127,127,.06); border-radius: 8px; padding: 8px; }
.orgsteps { box-shadow: inset 0 0 0 1.5px var(--ink); gap: 4px; } .orgsteps b { font-size: 17px; }
details.howday > summary { list-style: none; cursor: pointer; } details.howday > summary::-webkit-details-marker { display: none; }
/* Home: slim identity line + quick actions (the full card lives on the profile) */
.mebar { gap: 10px; }
.mebar .av { width: 40px; height: 40px; }
.quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.quick a.item { flex-direction: column; justify-content: center; gap: 5px; padding: 12px 6px; color: inherit; font-size: 13px; font-weight: 700; }
.quick a.item svg { color: var(--ink); }
/* Fence: centered Challenge! heading */
.chhead { text-align: center; margin: 22px 0 18px; color: var(--ink); }
.chtitle { font: 400 26px var(--display); letter-spacing: 4px; text-transform: uppercase; margin-top: 8px; }
.chhead p { margin: 10px auto 0; max-width: 300px; font-size: 15px; }
/* Rankings: boxed scope tabs, then two small picker buttons (weapon, men/women) */
.rkf { display: flex; gap: 8px; margin-top: 10px; }
.rchip { display: inline-flex; align-items: center; gap: 7px; padding: 9px 14px; border-radius: 999px; border: 0; background: none; font: 800 12px var(--body); letter-spacing: 1.4px; text-transform: uppercase; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line2); cursor: pointer; }
.rchip.on { background: var(--ink); color: var(--bg); box-shadow: none; }
#picksheet .pickbg { position: fixed; inset: 0; z-index: 59; background: rgba(0,0,0,.25); }
#picksheet .pick { position: fixed; left: 12px; right: 12px; bottom: calc(env(safe-area-inset-bottom,0px) + 100px); z-index: 60; max-width: 500px; margin: auto; gap: 10px; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
#picksheet .picktitle { font-family: var(--display); font-weight: 400; letter-spacing: 2px; text-transform: uppercase; }
/* Badges: round medallions with a metal finish */
.bdg { display: inline-grid; place-items: center; flex: 0 0 auto; border-radius: 50%; overflow: hidden; color: #2a2108; box-shadow: inset 0 1px 0 rgba(255,255,255,.6), inset 0 -2px 3px rgba(0,0,0,.25), 0 2px 6px rgba(0,0,0,.25); }
.bdg img { width: 100%; height: 100%; object-fit: cover; }
.bdg.f-gold { background: radial-gradient(circle at 35% 30%, #fff6c9, #e5c25a 45%, #a9801f 100%); }
.bdg.f-silver { background: radial-gradient(circle at 35% 30%, #ffffff, #c9ced6 45%, #8a919c 100%); color: #20242b; }
.bdg.f-bronze { background: radial-gradient(circle at 35% 30%, #ffe1c4, #c98b55 45%, #8a5428 100%); color: #2c1708; }
.bdg.f-navy { background: radial-gradient(circle at 35% 30%, #4a64a8, #1a2c5c 55%, #0b1430 100%); color: #f3e2a6; }
.bdg.f-black { background: radial-gradient(circle at 35% 30%, #5a5f68, #23262c 55%, #0b0c0f 100%); color: #e5c25a; }
.cbadges { display: flex; gap: 6px; margin-top: 10px; position: relative; }
.bgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.bcell { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 6px; border-radius: 14px; border: 0; background: var(--panel2); color: inherit; font: inherit; text-align: center; cursor: pointer; }
.bcell b { font-size: 12px; line-height: 1.2; }
.bcell.on { box-shadow: inset 0 0 0 2px var(--ink); }
#updbar { position: fixed; left: 12px; right: 12px; top: calc(env(safe-area-inset-top,0px) + 10px); z-index: 80; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px 10px 16px; border-radius: 14px; background: var(--ink); color: var(--bg); font-weight: 700; box-shadow: 0 10px 30px rgba(0,0,0,.3); max-width: 500px; margin: auto; }
#updbar .btn { background: var(--bg); color: var(--ink); }
html[data-theme="light"] .bcell { background: rgba(255,255,255,.7); box-shadow: inset 0 0 0 1px var(--line); }
html[data-theme="light"] .bcell.on { box-shadow: inset 0 0 0 2px var(--ink); }
.bicons { display: flex; flex-wrap: wrap; gap: 6px; }
.bicons button { width: 44px; height: 44px; display: grid; place-items: center; border: 0; border-radius: 12px; background: var(--panel2); color: var(--mut); }
.bicons button.on { background: var(--ink); color: var(--bg); }
html[data-theme="light"] .bicons button { background: rgba(255,255,255,.7); box-shadow: inset 0 0 0 1px var(--line); }
html[data-theme="light"] .bicons button.on { background: var(--ink); }
/* badges: club mark, shining crowns (#1), glowing 1000 wins */
.bdgw { position: relative; display: inline-block; flex: 0 0 auto; }
.bclub { position: absolute; right: -3px; bottom: -3px; width: 42%; height: 42%; border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: var(--ink); color: var(--bg); font: 800 10px var(--body); box-shadow: 0 0 0 2px var(--bg); }
.bclub img { width: 100%; height: 100%; object-fit: cover; }
.bdg.a-shine, .bdg.a-glow { position: relative; }
.bdg.a-shine::after, .bdg.a-glow::after { content: ""; position: absolute; inset: -40%; background: linear-gradient(115deg, transparent 40%, rgba(255,255,255,.85) 50%, transparent 60%); transform: translateX(-100%); animation: bshine 2.8s ease-in-out infinite; pointer-events: none; }
.bdg.a-glow { animation: bglow 2s ease-in-out infinite; }
@keyframes bshine { 0%, 55% { transform: translateX(-100%); } 85%, 100% { transform: translateX(100%); } }
@keyframes bglow { 0%, 100% { box-shadow: 0 0 6px 1px rgba(229,194,90,.55), inset 0 1px 0 rgba(255,255,255,.6); } 50% { box-shadow: 0 0 18px 6px rgba(229,194,90,.9), inset 0 1px 0 rgba(255,255,255,.6); } }
@media (prefers-reduced-motion: reduce) { .bdg.a-shine::after, .bdg.a-glow::after, .bdg.a-glow { animation: none; } }
/* trophy room: badges still to win are greyed, with a progress bar */
.locked .bdg { filter: grayscale(1); opacity: .45; }
.locked .bdg::after { display: none; }
.tprog { height: 5px; border-radius: 3px; background: var(--line2); margin: 6px 0 2px; overflow: hidden; }
.tprog i { display: block; height: 100%; background: var(--ink); border-radius: 3px; }
/* card badges are buttons; trophy room "On card" state; compact badge holders */
.cbtn { border: 0; background: none; padding: 0; cursor: pointer; }
.trbtn { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 10px; }
.bcell .oncard { display: none; font: 800 9px var(--body); letter-spacing: 1.2px; text-transform: uppercase; padding: 3px 7px; border-radius: 999px; background: var(--ink); color: var(--bg); }
.bcell.on .oncard { display: inline-block; }
.hstack { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 4px; }
.hstack .av { width: 32px; height: 32px; }
.hlist { max-height: 38vh; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; -webkit-overflow-scrolling: touch; }
#picksheet .pick { max-height: 78vh; overflow-y: auto; }
/* official badge art (badgeart.js): cut-out pictures, numbers in the app font, shine / glow */
.bart { position: relative; display: inline-block; flex: 0 0 auto; filter: drop-shadow(0 2px 3px rgba(0,0,0,.25)); }
.bart img { width: 100%; height: 100%; object-fit: contain; display: block; }
.bart svg { display: block; overflow: visible; }
.bart .bnum { position: absolute; left: 50%; transform: translate(-50%, -50%); font-family: var(--display); font-weight: 400; color: #2e1d05; text-shadow: 0 1px 0 rgba(255,255,255,.6); line-height: 1; white-space: nowrap; }
.bart .bnum.dk { color: #f3cf63; text-shadow: 0 1px 2px rgba(0,0,0,.7); }
.bart.appicon { border-radius: 22%; overflow: hidden; box-shadow: 0 0 0 2px #e4b84a, 0 2px 6px rgba(0,0,0,.3); filter: none; }
.bart.shimmer::after { content: ""; position: absolute; inset: 0; -webkit-mask: var(--m) center/contain no-repeat; mask: var(--m) center/contain no-repeat; background: linear-gradient(115deg, transparent 38%, rgba(255,255,255,.95) 50%, transparent 62%) -150% 0/250% 100% no-repeat; animation: bsh 2.2s ease-in-out infinite; pointer-events: none; }
@keyframes bsh { 0%, 45% { background-position: -150% 0; } 80%, 100% { background-position: 150% 0; } }
.bart.glow { animation: bglow2 2s ease-in-out infinite; }
@keyframes bglow2 { 50% { filter: drop-shadow(0 0 10px rgba(243,207,99,.95)); } }
.locked .bart { filter: grayscale(1); opacity: .45; }
.locked .bart::after, .locked .bart .bnum { display: none; }
@media (prefers-reduced-motion: reduce) { .bart.shimmer::after, .bart.glow { animation: none; } }
/* someone else's profile: challenge them straight under their card */
.chq { margin-top: 10px; gap: 10px; }
.chstakes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; font-size: 12px; color: var(--mut); text-align: center; }
.chstakes span { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.chstakes b { font-size: 19px; }
.chq .btn { display: flex; align-items: center; justify-content: center; text-align: center; }

/* someone else's bout row: name … score, one line per fencer */
.item .vs { display: flex; align-items: baseline; gap: 10px; font-weight: 800; }
.item .vs .ell { flex: 1; min-width: 0; }
.item .vs .num { font-size: 20px; min-width: 26px; text-align: right; }
.item .vs.trail { font-weight: 500; color: var(--mut); }

/* feed layer: Touché / Allez! / Ripostes */
.item.wsoc, .item:has(.sstrip) { flex-wrap: wrap; }
.sstrip { flex-basis: 100%; display: flex; gap: 6px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.sbtn { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--line); background: transparent; color: var(--mut); border-radius: 999px; padding: 5px 11px; font: 700 12px var(--body); cursor: pointer; }
.sbtn.on { background: var(--ink); border-color: transparent; color: var(--bg); }
.sbtn:disabled { opacity: .55; cursor: default; }
.sbtn.ghosty { border-color: transparent; padding-left: 4px; }
.sbtn.allez { color: #c2410c; border-color: rgba(194,65,12,.35); }
.sbtn.pop { animation: allezpop .35s ease; }
@keyframes allezpop { 40% { transform: scale(1.18); } }
.social .sstrip { border-top: 0; margin-top: 0; padding-top: 0; }
.rlist { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }
.rp { display: flex; gap: 10px; align-items: flex-start; }
.rp .av { width: 32px; height: 32px; flex: none; }
.rp a { color: inherit; text-decoration: none; }
.rpb { margin-top: 2px; white-space: pre-wrap; word-break: break-word; }
.rpin { gap: 8px; margin-top: 4px; }
.rpin .t { flex: 1; min-width: 0; }
/* scoreboards: each name stays under its own score and wraps instead of running into the other one */
.board { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 14px; }
.board .who { white-space: normal; overflow-wrap: anywhere; line-height: 1.5; }

#inappgate { position: fixed; inset: 0; z-index: 9999; background: var(--bg); overflow: auto; padding: max(48px, env(safe-area-inset-top)) 20px 32px; display: flex; }
.cprev { flex-basis: 100%; display: flex; flex-direction: column; gap: 4px; margin-top: 8px; font-size: 14px; line-height: 1.35; color: var(--ink); }
.cprev:empty { display: none; }
.cprev .cl { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.cprev .cmore { color: var(--mut, #6b7280); font-size: 13px; }
.logbig { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 12px; padding: 15px; font-size: 16px; }
.logsub { display: block; text-align: center; margin: 6px 0 4px; }
.logpick { width: 100%; text-align: left; background: none; border: 0; font: inherit; color: inherit; cursor: pointer; }
.logsc { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; text-align: center; margin-top: 12px; padding: 18px 8px; }
.logsc .num { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.logsc .num b { font-size: 52px; line-height: 1; font-variant-numeric: tabular-nums; }
.logsc .pm { display: flex; gap: 8px; }
.logsc .pm button { width: 46px; height: 40px; border-radius: 12px; border: 1px solid var(--line2); background: var(--panel); color: var(--ink); font-size: 22px; }
/* Social tab: posts (thoughts + app forum suggestions) */
.item.post { flex-direction: column; align-items: stretch; gap: 8px; color: inherit; }
.item.post .pch { gap: 10px; }
.ptitle { font-size: 16px; line-height: 1.3; }
.pbody { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.45; font-size: 14px; }
.pbody.clamp { display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.item.post .sstrip { margin-top: 2px; }
.vote { display: inline-flex; align-items: center; gap: 2px; border: 1px solid var(--line); border-radius: 999px; padding: 1px 3px; }
.vbtn { display: grid; place-items: center; width: 30px; height: 26px; border-radius: 999px; color: var(--mut); background: transparent; cursor: pointer; }
.vbtn.on { background: var(--ink); color: var(--bg); }
.vbtn.on.dn { background: var(--red); color: #fff; }
.vsc { min-width: 22px; text-align: center; font: 800 13px var(--body); }
#socf { gap: 2px; } #socf button { flex: 1 0 auto; padding: 9px 5px; letter-spacing: .5px; font-size: 9.5px; }
html:not([lang="en"]) #socf button { letter-spacing: .3px; padding: 9px 5px; }

html[data-theme="light"] .vbtn.on { color: #fbf6f2; }
/* the post box at the top of Social (tap, type, Post) */
.composer { margin-top: 12px; padding: 12px; }
.composer .cbox { flex: 1; min-width: 0; resize: none; min-height: 40px; padding: 10px 12px; font-size: 15px; line-height: 1.4; }
.cact { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.cact[hidden] { display: none; }
.cact .btn { width: auto; padding: 10px 22px; }
/* Continue with Google: Google's standard light button (white, #747775 border, #1F1F1F text, the four-colour G) */
.gbtn { display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; height: 48px; padding: 0 16px; border-radius: 24px; background: #fff; border: 1px solid #747775; color: #1f1f1f; font: 500 15px Roboto, -apple-system, 'Segoe UI', Arial, sans-serif; letter-spacing: .25px; text-decoration: none; }
.gbtn:active { background: #f2f2f2; }
.gbtn svg { flex: none; }
.ordiv { display: flex; align-items: center; gap: 12px; margin: 4px 0; color: var(--mut); font: 700 11px var(--body); letter-spacing: 1.5px; text-transform: uppercase; }
.ordiv::before, .ordiv::after { content: ""; flex: 1; height: 1px; background: var(--line2, rgba(128,128,128,.35)); }
.err.gerr { text-align: center; }
/* bout cards in the feed: a small scoreboard. Left fencer | score | right fencer, then one line of facts,
   then Salute · Comment · Analysis (live-recorded) or Details (logged) */
.item.bcard { flex-direction: column; align-items: stretch; gap: 8px; padding: 10px; }
.bcard .sb { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 6px; }
.bcard .fz { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; padding: 8px 4px; border-radius: 12px; color: inherit; min-width: 0; }
.bcard .fz .av { width: 38px; height: 38px; margin-bottom: 2px; }
.bcard .fz .nm { font-size: 13px; line-height: 1.2; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.bcard .fz small { font-size: 11px; color: var(--mut); max-width: 100%; }
.bcard .fz .rt { font-variant-numeric: tabular-nums; }
.bcard .fz.trail .nm { font-weight: 500; opacity: .75; }
.bcard .sc { display: flex; align-items: baseline; gap: 4px; font: 400 30px var(--display); font-variant-numeric: tabular-nums; padding: 0 2px; }
.bcard .sc .n { opacity: .45; } .bcard .sc .n.w { opacity: 1; font-weight: 700; }
.bcard .sc .dash { font-size: 18px; opacity: .4; }
.bcard .bmeta { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; min-width: 0; padding: 0 2px; }
.bcard .bmeta small { color: var(--mut); font-size: 12px; min-width: 0; }
.bcard .sstrip { align-items: center; margin-top: 0; flex-wrap: wrap; row-gap: 6px; }
.bcard .sstrip .vbout { margin-left: auto; flex: none; padding: 7px 12px; }
.panel.opp { gap: 2px; } .panel.opp .num { color: var(--mut); }
