/* v2 palette, after Enki Bilal (cold slate, bone, ochre gold, rust red,
   ice blue, verdigris) with Iepe Rubingh's tape for the ring corners. */
:root {
  --bg-deep:   #111519;
  --bg-panel:  #192026;
  --bg-alt:    #222a31;
  --border:    #313b44;
  --gold:      #e4be5f;
  --gold-mid:  #a9873c;
  --gold-soft: #2a2517;
  --text:      #ebe5d6;
  --text-2:    #96a1aa;
  --blue:      #86bcd2;
  --green:     #62b394;
  --green-bg:  #13281f;
  --orange:    #e8923a;
  --orange-bg: #3d2410;
  --red:       #d9483b;
  --red-bg:    #3f1311;
  --box-bg:    #2b1714;
  --break-bg:  #13222d;
  --tape-red:  rgba(204, 64, 52, .92);
  --tape-blue: rgba(74, 120, 160, .92);
  --font-display: 'Barlow Condensed', 'Arial Narrow', system-ui, sans-serif;
  --font-body: system-ui, -apple-system, sans-serif;
  --font-clock: 'Oxanium', 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --clock-weight: 600;
  --clock-scale: .82;   /* wider faces get a smaller size so 10:00 fits */
}
:root[data-digits="dgt"] { --clock-scale: .92; }
:root[data-digits="saira"] { --font-clock: 'Saira', 'Oxanium', 'Barlow Condensed', sans-serif; --clock-weight: 600; --clock-scale: .86; }

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; -webkit-text-size-adjust: 100%; }
[hidden] { display: none !important; }
body {
  background: var(--bg-deep) radial-gradient(120% 80% at 50% 0%, #1d252c 0%, transparent 60%);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}
.gold { color: var(--gold); }
.muted { color: var(--text-2); }
.small { font-size: 13px; line-height: 1.5; }

/* ── BUTTONS ── */
.btn {
  font: 600 18px/1.1 var(--font-display);
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text);
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  cursor: pointer;
  touch-action: manipulation;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .4; }
.btn.wide { display: block; width: 100%; margin: 10px 0; }
.btn.big { font-size: 24px; padding: 18px; }
.btn-gold { background: var(--gold); color: #1a1405; border-color: var(--gold); }
.btn-blue { background: var(--blue); color: #04101f; border-color: var(--blue); }
.btn-ghost { background: transparent; }
.btn.sel { background: var(--gold-soft); border-color: var(--gold); color: var(--gold); }

/* ── SETUP ── */
#setup { max-width: 560px; margin: 0 auto; padding: max(16px, env(safe-area-inset-top)) 16px 32px; }
.setup-head { text-align: center; font: 700 28px/1 var(--font-display); letter-spacing: .06em; margin: 8px 0 18px; }
.presets { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.preset { padding: 22px 8px; text-align: center; border-color: var(--gold-mid);
  min-height: 168px; display: flex; flex-direction: column; align-items: center; justify-content: center; }  /* same size in both modes */
.preset b { display: block; font-size: 64px; line-height: .9; color: var(--gold); }
.preset.classic b { font-size: 50px; }
.preset small { display: block; font-size: 18px; margin-top: 2px; }
.preset em { display: block; font-style: normal; font-size: 30px; margin-top: 8px; }
.durations { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.dur { background: var(--bg-panel); border: 1px solid var(--border); border-radius: 12px; color: var(--text); padding: 10px 4px 8px; text-align: center;
  font-family: var(--font-display); touch-action: manipulation; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.dur { position: relative; cursor: pointer; display: grid; grid-template-columns: minmax(0, 1fr) auto; padding: 0 !important; }
.dur .strip { border-radius: 0 11px 11px 0; }
.dur.small .strip { border-radius: 0 9px 9px 0; }
/* The warning hangs under the count: a short gold link between them. */
.dur.linked::before { content: ''; position: absolute; left: calc(50% - 30px); top: -8px; width: 3px; height: 8px; background: var(--gold-mid); }
.dur.linked .strip { cursor: default; }
.dur-body { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 10px 2px 8px; min-width: 0; }
.strip { width: 50px; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 2px;
  border-left: 1px solid var(--border); background: rgba(0,0,0,.28); touch-action: none; cursor: ns-resize; user-select: none; -webkit-user-select: none;
  -webkit-mask-image: linear-gradient(transparent, #000 30%, #000 70%, transparent); mask-image: linear-gradient(transparent, #000 30%, #000 70%, transparent); }
.dur.on .strip { border-left-color: var(--gold-mid); }
.strip.drag { background: rgba(245,200,66,.12); }
.sv { font: 600 14px/1 var(--font-display); color: var(--text-2); min-height: 14px; white-space: nowrap; }
.sv.cur { font: 700 21px/1.1 var(--font-display); color: var(--text); }
.dur.on .sv.cur { color: var(--gold); }
.dur.small .strip { width: 56px; }
.chess-set { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin-top: 6px; position: relative; }
.limits { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 4px; padding: 0 2px; font-family: var(--font-display); }
.lim-t { white-space: nowrap; font-size: 13px; color: var(--text-2); }
.lim { display: inline-flex; align-items: center; }
.lim button { width: 30px; height: 34px; background: none; border: 0; color: var(--gold); font: 700 22px var(--font-display); padding: 0; touch-action: manipulation; }
.lim button:disabled { color: var(--border); }
.lim b { font-size: 20px; min-width: 16px; text-align: center; }
.lim small { font-size: 14px; color: var(--text-2); margin-left: 2px; white-space: nowrap; }
.chess-set.dim, .opt.dim { opacity: .3; pointer-events: none; }
.chess-set::before { content: ''; position: absolute; left: 16%; top: -6px; width: 2px; height: 6px; background: var(--gold-mid); }
.dur.small { padding: 8px 2px 6px; border-radius: 10px; }
.dur.small i { height: 30px; display: flex; align-items: center; justify-content: center; }
.dur.small b { font-size: 22px; }
.dur.small small { font-size: 13px; }
.ico { width: 28px; height: 28px; }
.dur .hands { display: inline-flex; gap: 0; margin: 0; }
.dur .hands svg.hand { height: 28px; }
.dur svg.hand { height: 32px; width: auto; }
.ico-dots { display: inline-flex; gap: 3px; }
.ico-dots span { width: 10px; height: 10px; border-radius: 50%; background: var(--red); }
.dur.on { border-color: var(--gold-mid); background: var(--gold-soft); }
.dur:not(.on) { opacity: .55; }
.reset-link { display: block; margin: 8px auto 0; background: none; border: 0; color: var(--text-2); font: 600 17px var(--font-display); letter-spacing: .04em; padding: 6px 12px; }
.dur i { display: block; font-style: normal; font-size: 26px; line-height: 1; }
.dur b { display: block; font-size: 28px; line-height: 1.1; margin-top: 4px; }
.dur small { display: block; font-size: 15px; color: var(--text-2); letter-spacing: .04em; margin-top: 6px; }
.dur { min-height: 70px; }
.options { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; margin-top: 18px; }
.opt { display: flex; background: var(--bg-panel); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.opt.on { border-color: var(--gold-mid); background: var(--gold-soft); }
.opt button { background: none; border: 0; color: var(--text); font: 600 18px var(--font-display); letter-spacing: .03em; touch-action: manipulation; }
.opt-toggle { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 14px 10px; text-align: left; }
.opt .box { width: 24px; height: 24px; flex: none; border: 2px solid var(--text-2); border-radius: 6px; display: grid; place-items: center; font-size: 16px; color: #1a1405; }
.opt.on .box { background: var(--gold); border-color: var(--gold); }
.opt-q { width: 40px; flex: none; border-left: 1px solid var(--border) !important; color: var(--text-2) !important; font-size: 20px !important; }
.opt-q.sel { color: var(--gold) !important; }
.opt-icon { background: var(--bg-panel); border: 1px solid var(--border); border-radius: 12px; font-size: 30px; line-height: 1;
  padding: 12px 0; min-height: 58px; touch-action: manipulation; filter: grayscale(1); opacity: .45; }
.opt-icon small { font: 600 15px var(--font-display); letter-spacing: .06em; color: var(--text-2); margin-left: 6px; vertical-align: .35em; }
.opt-icon.on small { color: var(--gold); }
.opt-icon.on { border-color: var(--gold-mid); background: var(--gold-soft); filter: none; opacity: 1; }
.opt-help { background: var(--bg-panel); border-left: 3px solid var(--gold); border-radius: 8px; padding: 10px 12px; margin: 10px 0 0; line-height: 1.45; font-size: 15px; }
.advanced { margin: 18px 0 12px; background: var(--bg-panel); border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; }
.advanced summary { cursor: pointer; font-weight: 600; color: var(--text-2); }
.sum-ico { width: 1em; height: 1em; vertical-align: -.12em; }
.advanced + .advanced { margin-top: 8px; }
.advanced .options { margin-top: 12px; }
.advanced .names { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; margin-top: 12px; }
.advanced .names label { min-width: 0; display: flex; align-items: center; gap: 6px; color: var(--text-2); }
.advanced .names input { flex: 1; min-width: 0; font: 500 18px var(--font-body); color: var(--text); background: var(--bg-alt); border: 1px solid var(--border); border-radius: 10px; padding: 12px; }
.steppers { margin-top: 10px; }
.stepper { display: grid; grid-template-columns: 1fr 48px 76px 48px; align-items: center; gap: 6px; padding: 6px 0; border-top: 1px solid var(--border); }
.stepper:first-child { border-top: 0; }
.st-label { font: 600 18px var(--font-display); letter-spacing: .03em; }
.st-label i { font-style: normal; display: inline-block; width: 30px; }
.stepper b { text-align: center; font: 700 22px var(--font-display); font-variant-numeric: tabular-nums; }
.stepper button { height: 44px; font: 700 26px/1 var(--font-display); color: var(--text); background: var(--bg-alt); border: 1px solid var(--border); border-radius: 10px; touch-action: manipulation; }
.stepper button:disabled { opacity: .3; }
.set-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.set-actions .btn { margin: 0; font-size: 16px; }
.set-actions { grid-template-columns: 1fr; }
.set-std { width: 100%; margin: 4px 0 0; font-size: 16px; }
.version { text-align: center; margin-top: 12px; }

/* ── CHESSBOXING PARIS: logo in clear, and as a faint watermark everywhere ── */
.setup-head:has(.head-logo) { display: grid; justify-items: center; gap: 10px; }
.head-logo { width: min(300px, 80%); height: auto; display: block; }
.credits { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--border); text-align: center; display: grid; justify-items: center; gap: 4px; }
.credits p { margin: 0; }
.credits a:not(.btn) { color: var(--text-2); }
.credits-logo { width: min(200px, 60%); height: auto; opacity: .8; margin-bottom: 6px; }
.credits-line { font-size: 13px; line-height: 1.35; color: var(--text-2); max-width: 100%; }
.insta { display: inline-flex; align-items: center; gap: 6px; margin: 6px 0 2px; padding: 6px 14px; border: 1px solid var(--border); border-radius: 999px;
  color: var(--gold) !important; text-decoration: none; font: 600 17px var(--font-display); letter-spacing: .04em; }
.insta svg { width: 18px; height: 18px; }
.credits-line.dim { opacity: .7; margin-top: 4px; }
#btn-donate { text-decoration: none; display: block; text-align: center; max-width: 320px; }
#setup::before { content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: url(logo.png) center 45% / auto min(80vh, 640px) no-repeat; opacity: .05; }
.half::before { content: ''; position: absolute; inset: 0; pointer-events: none;
  background: url(logo-glove.png) center / auto 76cqh no-repeat; opacity: .05; }
/* The two watermark gloves always face each other, fists toward the bar, in every orientation. */
#fight:not([data-orient="normal"]) .half.top::before { transform: rotate(180deg); }


/* ── FIGHT LAYOUT ── */
#fight {
  position: fixed; inset: 0;
  display: flex; flex-direction: column;
  user-select: none; -webkit-user-select: none;
  touch-action: none;
}
.half {
  flex: 1 1 0;
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px;
  background: var(--bg-panel);
  transition: background-color .2s;
  overflow: hidden;
  container-type: size;
}
/* Content layer: face to face by default, or both turned right / left by the compass */
.h-in {
  position: absolute; left: 50%; top: 50%; width: 100%; height: 100%;
  transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; padding: 12px 16px;
}
.half.top { transform: rotate(180deg); }
.half.top .h-in { padding-top: max(12px, env(safe-area-inset-bottom)); }
.half.bottom .h-in { padding-bottom: max(12px, env(safe-area-inset-bottom)); }
#fight:not([data-orient="normal"]) .half.top { transform: none; }
#fight:not([data-orient="normal"]) .h-in { width: 100cqh; height: 100cqw; padding: 12px; }
#fight[data-orient="right"] .h-in { transform: translate(-50%, -50%) rotate(-90deg); }
#fight[data-orient="left"] .h-in { transform: translate(-50%, -50%) rotate(90deg); }
/* Turned: both flags in mirror, against the centre bar */
#fight[data-orient="right"] .half.bottom .illegal-wrap,
#fight[data-orient="left"] .half.top .illegal-wrap { left: auto; right: 12px; flex-direction: row-reverse; }
#fight:not([data-orient="normal"]) .h-clock { font-size: calc(var(--clock-scale) * min(40cqh, 46cqw, 240px)); }
.bar-compass { width: 48px; height: 48px; padding: 6px; color: var(--text-2); background: var(--bg-alt);
  border: 1px solid var(--border); border-radius: 12px; touch-action: none; }
.bar-compass svg { width: 100%; height: 100%; display: block; }
.bar-compass .needle { transform-origin: 20px 20px; transition: transform .2s; }
#fight[data-orient="right"] .bar-compass .needle { transform: rotate(90deg); }
#fight[data-orient="left"] .bar-compass .needle { transform: rotate(-90deg); }
/* Colour: small, at the player's own edge, away from the digits */
.h-name { position: absolute; bottom: 12px; left: 0; right: 0; text-align: center;
  font: 600 18px/1 var(--font-display); letter-spacing: .14em; text-transform: uppercase; color: var(--text-2); }
.half.top .h-name { bottom: max(12px, env(safe-area-inset-bottom)); }
.flag .h-name { position: static; }
.h-clock {
  font: var(--clock-weight) calc(var(--clock-scale) * min(34cqw, 62cqh, 240px))/0.9 var(--font-clock);
  font-variant-numeric: tabular-nums;
  letter-spacing: .01em;
}
.h-move { font: 600 24px var(--font-display); color: var(--text-2); font-variant-numeric: tabular-nums; min-height: 1.2em; }
.h-phase { display: none; text-align: center; }
.h-phase small { display: block; font: 700 24px/1 var(--font-display); letter-spacing: .16em; color: var(--text-2); margin-bottom: 6px; }
.h-phase b { display: block; font: var(--clock-weight) calc(var(--clock-scale) * min(34cqw, 50cqh, 240px))/0.9 var(--font-clock); font-variant-numeric: tabular-nums; color: var(--text); }
.h-counts { display: flex; gap: 8px; min-height: 18px; align-items: center; }
.dot.old { opacity: .45; }
.dots { display: inline-flex; gap: 4px; margin-left: 6px; vertical-align: middle; }
.dot { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--text-2); }
.dot.on { background: var(--red); border-color: var(--red); }
/* Illegal move: red flag button in the corner nearest the centre bar
   (the top half is rotated, so its top corner also faces the centre) */
.illegal-wrap { position: absolute; top: 12px; left: 12px; display: flex; align-items: center; gap: 10px; }
.illegal-wrap[hidden], .illegal-minus[hidden] { display: none; }
.illegal-minus { width: 38px; height: 38px; border-radius: 50%; border: 2px solid var(--red); background: rgba(0,0,0,.5);
  color: #fff; font: 700 26px/1 var(--font-display); display: grid; place-items: center; padding: 0 0 3px; touch-action: manipulation; }
.illegal-minus:active { transform: scale(.9); }
.illegal-btn {
  position: relative;
  display: flex; align-items: center; gap: 6px;
  background: rgba(90,12,12,.9); border: 2px solid var(--red); border-radius: 10px;
  color: #fff; font: 700 17px var(--font-display); letter-spacing: .03em; text-transform: uppercase;
  padding: 6px 10px 6px 6px; box-shadow: 0 3px 10px rgba(0,0,0,.5); touch-action: manipulation;
}
.illegal-btn .ico { width: 26px; height: 26px; }
.illegal-btn::after { content: ''; position: absolute; inset: -12px; }  /* bigger touch area */
.illegal-btn:active { transform: scale(.94); }

/* Illegal move notice, big, on the offender's half */
.h-notice {
  position: absolute; inset: 0; z-index: 4; pointer-events: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  background: rgba(60,6,6,.9); color: #fff; text-align: center;
  font-family: var(--font-display); animation: notice-in .25s ease-out;
}
.h-notice[hidden] { display: none; }
.h-notice .ico { width: clamp(56px, 16vw, 96px); height: auto; }
/* Annuler sits exactly where the illegal-move button is, away from the centre */
.notice-undo { pointer-events: auto; position: absolute; top: 12px; left: 12px; font: 700 17px var(--font-display); letter-spacing: .03em; text-transform: uppercase;
  background: #fff; color: #000; border: 2px solid #fff; border-radius: 10px; padding: 9px 14px; box-shadow: 0 3px 10px rgba(0,0,0,.5); }
#fight[data-orient="right"] .half.bottom .notice-undo,
#fight[data-orient="left"] .half.top .notice-undo { left: auto; right: 12px; }
.h-notice b { font-size: clamp(36px, 11vw, 64px); letter-spacing: .04em; line-height: 1; }
.h-notice span { font-size: clamp(20px, 6vw, 30px); color: #ffb3b3; }
@keyframes notice-in { from { transform: scale(.85); opacity: 0; } to { transform: none; opacity: 1; } }
.eco .h-notice { animation: none; }

/* Player whose clock is running */
.phase-chess .half.active { background: var(--green-bg); box-shadow: inset 0 0 0 4px var(--green); }
.phase-chess .half.active .h-name { color: var(--green); }
.phase-chess .half:not(.active) .h-clock { color: var(--text-2); }
.half.warn { background: var(--orange-bg) !important; box-shadow: inset 0 0 0 6px var(--orange) !important; }
.half.warn .h-move { color: var(--orange); font-size: 34px; }
.half.countdown { background: var(--red-bg) !important; box-shadow: inset 0 0 0 8px var(--red) !important; animation: pulse 1s infinite; }
.half.countdown .h-move { color: #fff; line-height: 1; }
.hands { display: inline-flex; gap: 4px; }
.hand { width: clamp(80px, 26vw, 130px); height: auto; }
.half.countdown .h-clock { font-size: clamp(40px, 12vw, 72px); }
.half.low .h-clock { color: var(--red) !important; }
@keyframes pulse { 50% { filter: brightness(1.5); } }

/* Boxing and breaks: show the round timer in each half */
.phase-boxing .half { background: var(--box-bg); }
.phase-break .half { background: var(--break-bg); }
.phase-boxing .h-phase, .phase-break .h-phase { display: block; }
.phase-boxing .h-clock, .phase-break .h-clock { color: var(--text-2); }
/* Any orientation: the round timer big, the chess clock small */
.phase-boxing #fight .h-clock, .phase-break #fight .h-clock { font-size: calc(var(--clock-scale) * min(12cqw, 16cqh, 64px)); }
.phase-boxing #fight:not([data-orient="normal"]) .h-phase b, .phase-break #fight:not([data-orient="normal"]) .h-phase b { font-size: calc(var(--clock-scale) * min(36cqh, 40cqw, 240px)); }
.phase-boxing .h-move, .phase-break .h-move { display: none; }
.paused .h-in > :not(.h-avg) { opacity: .35; }
.h-avg { position: absolute; bottom: 40px; left: 0; right: 0; text-align: center; font: 700 30px var(--font-display); color: var(--gold); letter-spacing: .04em; font-variant-numeric: tabular-nums; }
.half.top .h-avg { bottom: max(40px, calc(env(safe-area-inset-bottom) + 28px)); }

/* ── CENTRE BAR ── */
.bar {
  flex: none;
  display: grid; grid-template-columns: auto auto 1fr auto minmax(130px, 1.2fr);
  align-items: center; gap: 10px;
  padding: 8px 12px;
  background: #000;
  border-block: 2px solid var(--gold-mid);
  transition: background-color .2s;
}
.bar-home {
  width: 48px; height: 48px;
  font-size: 26px; line-height: 1;
  color: var(--text-2); background: var(--bg-alt);
  border: 1px solid var(--border); border-radius: 12px;
  touch-action: manipulation;
}
.phase-ready .half { box-shadow: inset 0 0 0 3px var(--gold-mid); }
.phase-ready .h-move { color: var(--gold); }
.bar-round, .bar-phase { white-space: nowrap; }
.bar-round { font: 700 20px var(--font-display); letter-spacing: .06em; }
.bar-phase { font: 600 15px var(--font-display); letter-spacing: .1em; text-transform: uppercase; color: var(--gold); }
.bar-timer { font: var(--clock-weight) 34px var(--font-clock); font-variant-numeric: tabular-nums; }
.bar-replay { grid-column: 3 / -1; grid-row: 1; justify-self: center; background: var(--gold); color: #1a1405; border: 0; border-radius: 12px; font: 700 24px var(--font-display); text-transform: uppercase; padding: 12px 18px; white-space: nowrap; touch-action: manipulation; }
.bar-replay.with-btn { grid-column: 3 / 5; justify-self: stretch; min-width: 0; font-size: 19px; padding: 12px 6px; overflow: hidden; }
@media (max-width: 400px) { .bar-replay.with-btn { font-size: 26px; } .bar-replay.with-btn span { display: none; } }
.bar-replay[hidden], .bar-timer[hidden], .bar-info[hidden] { display: none; }
.bar-btn {
  height: 72px;
  font: 700 28px var(--font-display); letter-spacing: .08em;
  border: none; border-radius: 14px;
  background: var(--gold); color: #1a1405;
  touch-action: manipulation;
}
.bar-btn.long { font-size: 22px; letter-spacing: .02em; }
.bar-btn:active { transform: scale(.97); }
.paused .bar-btn, .phase-ready .bar-btn, .bar-btn.go { background: var(--green); color: #04140b; }
.phase-boxing .bar { background: #3a0a12; }
.phase-boxing .bar-phase { color: #ff8a8a; }
.phase-break .bar { background: #0c1830; }
.phase-break .bar-phase { color: var(--blue); }
.bar.alert { animation: barAlert .5s infinite alternate; }
@keyframes barAlert { to { background: var(--red); } }
.bar.alert .bar-phase { color: #fff; }

/* ── OVERLAYS ── */
.overlay {
  position: fixed; inset: 0; z-index: 20;
  background: rgba(0,0,0,.78);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.panel {
  width: 100%; max-width: 440px; max-height: 100%; overflow: auto;
  background: var(--bg-panel);
  border: 1px solid var(--gold-mid);
  border-radius: 18px;
  padding: 18px;
  text-align: center;
}
.panel h2 { font: 700 30px var(--font-display); letter-spacing: .08em; margin: 0 0 8px; }
.pm-go { font-size: 34px !important; padding: 34px 16px !important; }
.pm-next { font-size: 26px !important; padding: 20px 12px !important; }
.pm-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pm-row .btn { font-size: 22px; padding: 18px 6px; white-space: nowrap; }
.adjust { display: grid; grid-template-columns: 1fr auto auto; gap: 6px 8px; align-items: center; margin: 10px 0; text-align: left; }
.adjust .btn { padding: 10px 12px; font-size: 16px; }
.choice { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 8px; }
.choice .btn { flex: 1 1 40%; font-size: 16px; padding: 12px 8px; }
.result-kicker { font: 700 18px var(--font-display); letter-spacing: .2em; color: var(--gold); margin: 0; }
.result-name { font-size: 44px !important; }
.result-method { font: 600 22px var(--font-display); text-transform: uppercase; letter-spacing: .06em; margin: 0 0 6px; }
#result .panel { border-width: 3px; border-color: var(--gold); }
#result.loss-flash .panel { animation: resultIn .6s 3; }
@keyframes resultIn { 50% { border-color: var(--red); box-shadow: 0 0 40px var(--red); } }


#flash { position: fixed; inset: 0; z-index: 30; pointer-events: none; opacity: 0; }
#flash.on { animation: flash .7s ease-out; }
@keyframes flash { 0% { opacity: .85; } 100% { opacity: 0; } }

.install { margin-top: 8px; }

/* ── FLAG SCREEN: dark, winner's side in gold ── */
.flag .half { background: #050507 !important; box-shadow: none !important; animation: none !important; filter: none !important; }
.flag .half .h-counts, .flag .illegal-wrap { display: none; }
.over-undo { z-index: 5; }
.over-undo[hidden] { display: none; }
.flag .half.winner { box-shadow: inset 0 0 0 4px var(--gold) !important; }
.flag .half.winner .h-name { color: var(--gold) !important; font-size: clamp(40px, 12vw, 64px); }
.flag .half.winner .h-move { color: var(--gold); font: 700 clamp(28px, 8vw, 40px) var(--font-display); letter-spacing: .2em; }
.flag .half.winner .h-clock { color: var(--gold-mid) !important; font-size: clamp(36px, 10vw, 56px); }
.flag .half.loser .h-name { color: #55556a; }
.flag .half.loser .h-move { font: 700 clamp(32px, 9vw, 48px) var(--font-display); color: var(--text-2); }
.flag .half.loser .h-clock { font-size: clamp(36px, 10vw, 56px); color: var(--text-2) !important; }
.flag .bar { background: #000; }

/* ── ECO: no sound (set in JS), darker, no animations ── */
/* Éco: pure black (OLED pixels off), dim colours instead of a filter,
   no watermark, nothing that moves. */
body.eco {
  --bg-deep: #000; --bg-panel: #000; --bg-alt: #080808; --border: #1c1c24;
  --text: #8f8b80; --text-2: #55555f; --gold: #a8892d; --gold-mid: #6e5a1e; --gold-soft: #0d0b05;
  --green: #1e7a48; --green-bg: #000; --orange: #a5640f; --orange-bg: #000;
  --red: #a82626; --red-bg: #000; --box-bg: #000; --break-bg: #000;
  background: #000;
}
.eco .half, .eco .bar, .eco .pm-strip { background: #000 !important; }
.eco .half::before, .eco #setup::before { display: none; }
.eco *, .eco *::before, .eco *::after { animation: none !important; transition: none !important; }
.eco .btn-gold, .eco .bar-btn, .eco .bar-replay { filter: none; background: var(--gold-mid); color: #000; border-color: var(--gold-mid); }
.eco .illegal-btn { background: #000; }
.eco #setup img { opacity: .6; }


.resume-live { display: grid !important; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 8px; padding: 14px 12px !important; }
.resume-live span { font: 700 26px/1 var(--font-display); font-variant-numeric: tabular-nums; }
.resume-live span { padding: 8px 10px; border-radius: 8px; }
.resume-live .tw { background: #fff; color: #000; }
.resume-live .tb { background: #000; color: #fff; }
.resume-live b { font-size: 22px; white-space: nowrap; }
.resume-wrap { position: relative; }
.resume-x { position: absolute; top: -6px; right: -10px; width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--gold-mid);
  background: var(--bg-panel); color: var(--text); font-size: 17px; line-height: 1; padding: 0; touch-action: manipulation; }
/* Pause: the clocks are only greyed; the options sit in the middle strip,
   over the centre bar. A tap anywhere else carries on. */
#pause-menu { background: transparent; padding: 0; }
.pm-strip { max-width: none; border-radius: 0; border: 0; border-block: 2px solid var(--gold-mid); background: #000;
  display: grid; grid-template-columns: auto auto minmax(0, 1fr) minmax(0, 1.2fr); gap: 8px; align-items: stretch;
  padding: 10px max(12px, env(safe-area-inset-left)); overflow: visible; }
.pm-strip .btn { margin: 0; min-height: 64px; }
.pm-ico { width: 50px; font-size: 28px !important; padding: 0 !important; }
.pm-strip .pm-next { font-size: 21px !important; padding: 0 4px !important; white-space: nowrap; overflow: hidden; }
.pm-strip .pm-go { font-size: 25px !important; padding: 0 8px !important; white-space: nowrap; }

/* Small phones (iPhone SE…): keep the whole centre bar on screen */
@media (max-width: 380px) {
  .lim-t { display: none; }
  .illegal-wrap { top: 6px; left: 6px; gap: 8px; }
  .notice-undo { top: 6px; left: 6px; font-size: 13px; padding: 6px 10px; }
  #fight[data-orient="right"] .half.bottom .notice-undo,
  #fight[data-orient="left"] .half.top .notice-undo { left: auto; right: 6px; }
  #fight[data-orient="right"] .half.bottom .illegal-wrap,
  #fight[data-orient="left"] .half.top .illegal-wrap { left: auto; right: 6px; }
  .illegal-minus { width: 30px; height: 30px; font-size: 22px; }
  .illegal-btn { font-size: 13px; padding: 3px 8px 3px 3px; gap: 4px; }
  .illegal-btn .ico { width: 20px; height: 20px; }
  .dur:not(.small) .strip { width: 44px; }
  .dur:not(.small) small { font-size: 13px; letter-spacing: 0; }
  .dur:not(.small) .sv.cur { font-size: 19px; }
  .resume-live { gap: 6px; padding: 12px 8px !important; }
  .resume-live span { font-size: 22px; padding: 6px 6px; }
  .resume-live b { font-size: 18px; }
  .opt button { font-size: 16px; }
  .opt-toggle { gap: 8px; padding: 12px 8px; }
  .opt-q { width: 34px; }
  .bar { gap: 6px; padding: 6px 8px; grid-template-columns: auto auto auto 1fr minmax(88px, 1fr); }
  .bar-home, .bar-compass { width: 40px; height: 40px; font-size: 22px; }
  .bar-compass { padding: 5px; }
  .bar-round { font-size: 17px; }
  .bar-timer { font-size: 28px; text-align: center; }
  .bar-btn { height: 60px; font-size: 22px; }
  .bar-btn.long { font-size: 18px; }
}
/* Tablets: bigger centre bar */
@media (min-width: 700px) {
  .bar { padding: 12px 20px; }
  .bar-round { font-size: 26px; }
  .bar-timer { font-size: 46px; }
  .bar-btn { height: 88px; font-size: 36px; }
  .bar-home, .bar-compass { width: 60px; height: 60px; font-size: 32px; }
  .h-name { font-size: 24px; }
}

/* Clock digits: DGT seven-segment SVG sized like the text it replaces */
svg.seg { height: .8em; width: auto; vertical-align: -.02em; overflow: visible; }
svg.seg .lit { fill: currentColor; }
svg.seg .ghost { fill: currentColor; opacity: .07; }
.bar-timer svg.seg { height: .7em; }
.digit-pick { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.digit-opt { background: var(--bg-panel); border: 1px solid var(--border); border-radius: 12px; color: var(--text-2); padding: 10px 4px;
  font: 30px/1 var(--font-clock); touch-action: manipulation; display: grid; place-items: center; min-height: 54px; }
.digit-opt[data-digits="saira"] { font-family: 'Saira', var(--font-display); font-weight: 600; font-size: 26px; }
.digit-opt[data-digits="oxanium"] { font-family: 'Oxanium', var(--font-display); font-weight: 600; font-size: 26px; }
.digit-opt.on { border-color: var(--gold-mid); background: var(--gold-soft); color: var(--gold); }

/* ── v2: Bilal grain over everything (off in Éco) ── */
body::after { content: ''; position: fixed; inset: 0; z-index: 40; pointer-events: none; opacity: .09; mix-blend-mode: overlay;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
.eco::after { display: none; }

/* ── v2 home: one big COMBAT button, everything else in Réglages ── */
.fight-go { position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  width: 100%; min-height: min(46vh, 380px); margin: 6px 0 18px; padding: 24px 12px; border: 0; border-radius: 4px; cursor: pointer;
  color: #17130a; touch-action: manipulation;
  background: linear-gradient(160deg, #ecc96c 0%, var(--gold) 45%, #c9a14a 100%);
  box-shadow: 0 1px 0 rgba(255,255,255,.35) inset, 0 22px 50px -18px rgba(0,0,0,.8); }
.fight-go:active { transform: scale(.985); }
.fight-go b { font: 700 clamp(54px, 17vw, 120px)/.85 var(--font-display); letter-spacing: .08em; padding-left: .08em; }
.fight-sum { font: 600 clamp(17px, 5vw, 22px)/1.2 var(--font-display); letter-spacing: .05em; opacity: .82; }
/* Ring corners in tape: red and blue, laid across two corners */
.tape { position: absolute; width: 150px; height: 26px; pointer-events: none;
  clip-path: polygon(0 8%, 4% 0, 8% 10%, 12% 0, 100% 0, 96% 100%, 92% 88%, 88% 100%, 0 100%, 3% 50%); }
.tape-a { top: 18px; left: -36px; transform: rotate(-38deg); background: var(--tape-red); }
.tape-b { bottom: 18px; right: -36px; transform: rotate(-38deg); background: var(--tape-blue); }
.eco .fight-go { background: var(--gold-mid); box-shadow: none; }
.eco .tape { opacity: .4; }

.settings summary { font: 600 19px var(--font-display); letter-spacing: .06em; text-transform: uppercase; padding: 4px 0; list-style: none; text-align: center; }
.settings summary::-webkit-details-marker { display: none; }
.settings[open] summary { color: var(--gold); margin-bottom: 4px; }
.set-title { margin: 16px 0 8px; font: 600 13px var(--font-display); letter-spacing: .16em; text-transform: uppercase; color: var(--text-2); }
.presets { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.preset { background: var(--bg-alt); border: 1px solid var(--border); border-radius: 10px; color: var(--text); padding: 8px 2px; min-height: 0; font-family: var(--font-display); touch-action: manipulation; }
.preset b { font-size: 30px; line-height: 1; color: var(--text); }
.preset small { font-size: 14px; color: var(--text-2); margin-top: 2px; }
.preset.on { border-color: var(--gold); background: var(--gold-soft); }
.preset.on b { color: var(--gold); }
.settings .options#options { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 14px; }
.orient-pick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.orient-opt { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 2px; background: var(--bg-panel); border: 1px solid var(--border);
  border-radius: 12px; color: var(--text-2); touch-action: manipulation; }
.orient-opt svg { width: 26px; height: 26px; }
.orient-opt small { font: 600 14px var(--font-display); letter-spacing: .04em; }
.orient-opt.on { border-color: var(--gold-mid); background: var(--gold-soft); color: var(--gold); }
.homage { font-style: italic; }

/* ── v2 fight: the bar keeps only the round and the pause ── */
.bar { grid-template-columns: auto minmax(0, 1fr) auto minmax(130px, 1.2fr); border-block: 3px solid var(--gold-mid); }
.bar-home { grid-column: 1; }
.bar-info { grid-column: 2; }
.bar-timer { grid-column: 3; }
.bar-btn { grid-column: 4; }
.bar-replay { grid-column: 2 / -1; }
.bar-replay.with-btn { grid-column: 2 / 4; }
@media (max-width: 380px) { .bar { grid-template-columns: auto minmax(0, 1fr) auto minmax(96px, 1fr); } }
/* "Prêt ?": clocks still, the next round named on each side, one big button */
.await .h-phase { display: block; opacity: 1 !important; }
.await .h-phase b { display: none; }
.await .h-phase small { color: var(--gold); font-size: clamp(26px, 8cqw, 40px); letter-spacing: .2em; }
#pause-menu.ready .pm-strip { grid-template-columns: auto minmax(0, 1fr); }
#pause-menu.ready .pm-go { font-size: 34px !important; letter-spacing: .12em; }
.setup-head { font-size: 20px; letter-spacing: .3em; margin: 6px 0 12px; }
.setup-head .head-logo { width: min(260px, 72%); }

/* ════ v2.1: one style everywhere ════
   Line icons in the text colour, Cormorant for numerals and titles,
   Barlow Condensed in spaced capitals for labels, bone on slate,
   gold only for what is happening now. */
:root { --font-serif: 'Cormorant Garamond', 'Times New Roman', serif; --bone: #ebe5d6; --hair: rgba(235, 229, 214, .14); }
.ic { width: 1.15em; height: 1.15em; flex: none; vertical-align: -.2em; }
.btn .ic { margin-right: .4em; }
.btn[data-icon] { display: inline-flex; align-items: center; justify-content: center; }
.btn.wide[data-icon] { display: flex; }

/* Home */
.fight-sum { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; justify-content: center; font-size: clamp(18px, 5.4vw, 23px); }
.si { display: inline-flex; align-items: center; gap: 4px; }
.si .ic { width: 1.05em; height: 1.05em; stroke-width: 1.8; }
.si-n { font: italic 500 1.5em/1 var(--font-serif); letter-spacing: .02em; }
.dur i .ic { width: 30px; height: 30px; vertical-align: 0; }
.dur.on i { color: var(--gold); }
.opt-icon { filter: none; color: var(--text-2); font-size: 16px; display: flex; align-items: center; justify-content: center; gap: 6px; }
.opt-icon .ic { width: 30px; height: 30px; }
.opt-icon small { margin: 0; vertical-align: 0; }
.opt-icon.on { color: var(--gold); }
.resume-live b { display: inline-flex; align-items: center; gap: 6px; }
.resume-x { display: grid; place-items: center; }
.resume-x .ic { width: 16px; height: 16px; }

/* Centre bar: quiet. Hairlines, the frieze of rounds, the timer, a ring button. */
.bar { background: #0d1114; border-block: 1px solid var(--hair); padding: 6px 12px; gap: 12px; min-height: 64px;
  grid-template-columns: auto minmax(0, 1fr) auto auto; }
.phase-boxing .bar { background: #1a0f0d; border-color: rgba(217, 72, 59, .35); }
.phase-break .bar { background: #0d161c; border-color: rgba(134, 188, 210, .3); }
.bar-home { width: 46px; height: 46px; border-radius: 50%; background: transparent; border: 1px solid var(--hair); color: var(--text-2); display: grid; place-items: center; }
.bar-home .ic { width: 22px; height: 22px; }
.bar-info { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.bar-round { display: flex; align-items: center; gap: 3px; min-width: 0; overflow: hidden; }
.bar-phase { font: 600 13px var(--font-display); letter-spacing: .18em; color: var(--text-2); }
.bar-phase:empty { display: none; }
.tk { display: block; flex: none; width: 9px; height: 9px; border: 1.4px solid rgba(235, 229, 214, .45); }
.tk.ci { border-radius: 50%; }
.tk.sq { transform: rotate(45deg) scale(.86); }
.tk.done { background: rgba(235, 229, 214, .35); border-color: transparent; }
.tk.now { width: 13px; height: 13px; background: var(--gold); border-color: var(--gold); box-shadow: 0 0 10px rgba(228, 190, 95, .55); }
.phase-boxing .tk.now { background: var(--red); border-color: var(--red); box-shadow: 0 0 10px rgba(217, 72, 59, .6); }
.tk-dash { display: block; flex: none; width: 7px; height: 1.4px; background: rgba(235, 229, 214, .3); }
.tk-dash.done { background: rgba(235, 229, 214, .35); }
.tk-dash.now { width: 14px; height: 2px; background: var(--blue); box-shadow: 0 0 8px rgba(134, 188, 210, .7); }
.bar-timer { color: var(--bone); font-size: 30px; letter-spacing: .02em; }
.bar-btn { grid-column: 4; width: 58px; height: 58px; border-radius: 50%; padding: 0; display: grid; place-items: center;
  background: transparent; color: var(--bone); border: 1.5px solid rgba(235, 229, 214, .55); letter-spacing: 0; }
.bar-btn .ic { width: 26px; height: 26px; }
.bar-btn.long { width: auto; min-width: 104px; border-radius: 999px; padding: 0 18px; font: 600 19px var(--font-display); letter-spacing: .12em; text-transform: uppercase; }
.paused .bar-btn, .phase-ready .bar-btn, .bar-btn.go { background: transparent; color: var(--green); border-color: var(--green); }
.bar.alert { animation: none; border-color: var(--red); }
.bar.alert .bar-btn { color: var(--red); border-color: var(--red); }
.bar-replay { grid-column: 2 / -1; display: inline-flex; align-items: center; gap: 8px; background: transparent; color: var(--bone);
  border: 1.5px solid rgba(235, 229, 214, .6); border-radius: 999px; font: 600 20px var(--font-display); letter-spacing: .12em; padding: 10px 22px; }
.bar-replay .ic { width: 22px; height: 22px; }
.bar-replay.with-btn { grid-column: 2 / 4; justify-self: end; padding: 10px 16px; font-size: 18px; }
@media (max-width: 400px) { .bar-replay.with-btn { font-size: 18px; } .bar-replay.with-btn span { display: none; } }
@media (max-width: 380px) { .bar { grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 8px; padding: 6px 8px; } .bar-timer { font-size: 26px; } .bar-btn { width: 52px; height: 52px; } .bar-btn.long { min-width: 92px; padding: 0 12px; font-size: 17px; } }
@media (min-width: 700px) { .bar-btn { width: 76px; height: 76px; } .bar-timer { font-size: 42px; } .tk { width: 12px; height: 12px; } .tk.now { width: 17px; height: 17px; } }
.eco .bar, .eco .pm-strip { border-color: #1a1a1a; }

/* Labels in the halves during boxing and pauses: small spaced capitals,
   the round as a serif numeral. */
.h-phase small { display: inline-flex; align-items: center; gap: 10px; font: 600 20px/1 var(--font-display); letter-spacing: .32em; text-transform: uppercase; color: var(--text-2); margin-bottom: 10px; }
.h-phase small em { font: italic 500 30px/1 var(--font-serif); letter-spacing: .02em; color: var(--gold); text-transform: none; }
.phase-boxing .h-phase small em { color: #e98a7f; }
.h-phase small .ic { width: 22px; height: 22px; color: var(--blue); }
.h-phase small::before, .h-phase small::after { content: ''; width: 22px; height: 1px; background: currentColor; opacity: .5; }

/* Title card: each new step is announced in both halves, then fades. */
.h-card { position: absolute; inset: 0; z-index: 3; pointer-events: none; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; background: rgba(13, 17, 20, .9); opacity: 0; transition: opacity .35s ease; }
.hc-num { font: italic 500 calc(min(46cqw, 52cqh, 260px)) / .8 var(--font-serif); color: var(--gold); }
.hc-num .ic { width: min(30cqw, 36cqh, 160px); height: auto; stroke-width: 1; color: var(--blue); }
.hc-rule { width: min(38cqw, 180px); height: 1px; background: linear-gradient(90deg, transparent, var(--bone), transparent); opacity: .6; }
.hc-label { font: 600 clamp(20px, 7cqw, 34px)/1 var(--font-display); letter-spacing: .5em; padding-left: .5em; text-transform: uppercase; color: var(--bone); }
.hc-ready { display: none; font: italic 500 clamp(22px, 8cqw, 40px)/1 var(--font-serif); color: var(--text-2); margin-top: 6px; }
.carding .h-card { opacity: 1; transition-duration: .15s; }
.phase-boxing .hc-num { color: #e98a7f; }
.await .h-card { opacity: 1; }
.await .hc-ready { display: block; }
.await .h-phase { display: none !important; }
.flag .h-card { display: none; }
.eco .h-card { background: #000; }

/* Pause strip: same hairlines; one light button to carry on. */
.pm-strip { background: #0d1114; border-block: 1px solid var(--hair); gap: 10px; }
.pm-strip .btn { min-height: 60px; }
.pm-ico { width: 54px; border-radius: 50%; background: transparent; border: 1px solid var(--hair); color: var(--text-2); display: grid !important; place-items: center; }
.pm-ico .ic { width: 24px; height: 24px; margin: 0; }
.pm-strip .pm-next { display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: transparent; border: 1px solid var(--hair); border-radius: 999px; color: var(--bone); }
.pm-next .ic { width: 24px; height: 24px; margin: 0; }
.pm-next .ic:first-child { width: 20px; color: var(--text-2); }
.pm-strip .pm-go { display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: var(--bone); color: #101316; border: 0; border-radius: 999px; font: 700 24px var(--font-display) !important; letter-spacing: .14em; }
.pm-go .ic { width: 22px; height: 22px; margin: 0; fill: currentColor; }
.ready-txt { font: italic 500 34px/1 var(--font-serif); letter-spacing: .01em; text-transform: none; }
.eco .pm-strip .pm-go { background: #6d6a62; }
.phase-ready .h-move { display: inline-flex; align-items: center; gap: 8px; }
.pm-ico[hidden], .pm-next[hidden] { display: none !important; }
.paused .h-in > .h-card { opacity: 0; }
.paused.await .h-in > .h-card, .paused.carding .h-in > .h-card { opacity: 1; }
.h-card { background: rgba(13, 17, 20, .97); }
@keyframes flash { 0% { opacity: .4; } 100% { opacity: 0; } }
.si-n small { font: 600 .55em var(--font-display); font-style: normal; letter-spacing: .12em; text-transform: uppercase; margin-left: 5px; }
#pause-menu.ready .pm-go { min-width: 0; }
/* The next round, announced before it starts (never over a running clock) */
.phase-ready .h-phase { display: block; }
.phase-ready .h-phase b { display: none; }
.h-phase.soon small { color: var(--bone); font-size: clamp(22px, 7cqw, 30px); }
.h-phase.soon small em { font-size: clamp(40px, 13cqw, 60px); }
.phase-break .h-phase.soon b { color: var(--gold); }
.ic-mask { display: inline-block; background: currentColor; -webkit-mask: var(--m) center / contain no-repeat; mask: var(--m) center / contain no-repeat; }
.ic-knight { --m: url(knight.png); }
.ic-glove { --m: url(glove.png); }
.ic-hourglass { --m: url(hourglass.png); }
.hc-num .ic-mask { height: min(30cqw, 36cqh, 160px); }
/* The hourglass lies on its side: wider than tall */
.ic.ic-hourglass { width: auto !important; aspect-ratio: 1.7; }
@media (max-width: 380px) { .fight-sum { gap: 8px; font-size: 17px; } .si-n small { margin-left: 3px; } }
.dur i .ic.ic-hourglass { height: 20px; margin: 5px 0; }

/* Numbers: counts (rounds, limits, round numerals) always in the serif
   italic; durations (3:00, 1:30, 4:30…) always in the clock's own font. */
.si-n, .preset b, .lim b, .h-phase small em, .hc-num { font-family: var(--font-serif) !important; font-style: italic !important; font-weight: 500 !important; }
.preset b { font-size: 36px; }
.lim b { font-size: 24px; }
.si:not(.si-n), .preset small, .sv, .sv.cur, .resume-live span, .h-avg, .dur b { font-family: var(--font-clock) !important; font-weight: var(--clock-weight) !important; font-variant-numeric: tabular-nums; }
/* COMBAT: the number of rounds on its own line, above the durations */
.fight-sum .si-n { flex-basis: 100%; justify-content: center; font-size: 1.7em; margin-bottom: -2px; }
/* Prêt ?: the average per move sits over the title card; the card's small
   "Prêt ?" gives way to it (the button already says it). */
.await .h-avg { z-index: 4; }
.await .h-in:has(.h-avg:not(:empty)) .hc-ready { display: none; }
/* Between rounds the small chess clock sits by the edge: the average goes to the bar side. */
.await .h-clock, .await .h-name { visibility: hidden; }  /* nothing shows through the Prêt ? card */
.preset b.dur-only { font-family: var(--font-clock) !important; font-weight: var(--clock-weight) !important; font-style: normal !important; font-size: 28px; font-variant-numeric: tabular-nums; }  /* a duration: the clock's font */
/* Average per move: in the outer corner, by the player's edge, never near the bar.
   Cormorant italic like the round numerals, with ordinary figures. */
.h-avg { left: 14px !important; right: auto !important; bottom: 10px !important; top: auto !important; text-align: left;
  font: italic 500 clamp(18px, 6.2cqw, 26px)/1 var(--font-serif) !important; font-variant-numeric: lining-nums tabular-nums; letter-spacing: 0; color: var(--gold); }
.h-avg small { font-size: .7em; color: var(--text-2); }
/* Sideways, the average stays at the far end of each half, so the two mirror each other across the bar. */
#fight[data-orient="right"] .half.top .h-avg, #fight[data-orient="left"] .half.bottom .h-avg { left: auto !important; right: 14px !important; text-align: right; }
/* Durées in Réglages: the bar's frieze, each step with its time under it */
/* Durées: a thin, proportional time line, numerals above, the durations once below */
.frieze { padding: 2px 0 4px; }
.tl { display: flex; align-items: flex-end; gap: 2px; }
.tl-r.tl-p { min-width: 3px; }
.tl .tl-r.tl-p i { background: color-mix(in srgb, var(--blue) 80%, transparent); }
.tl-r { flex-basis: 0; min-width: 6px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.tl-r em { font: italic 500 13px/1 var(--font-serif); color: var(--text-2); white-space: nowrap; }
.tl-r i { display: block; align-self: stretch; height: 3px; border-radius: 2px; background: color-mix(in srgb, var(--text) 75%, transparent); }
.tl-box i { background: color-mix(in srgb, var(--red) 85%, transparent); }
.tl-box em { color: color-mix(in srgb, var(--red) 75%, var(--text)); }
.tl-last i { background: linear-gradient(90deg, color-mix(in srgb, var(--text) 75%, transparent), transparent); }
.tl-key { display: flex; justify-content: center; gap: 18px; margin-top: 12px; color: var(--text-2); }
.tl-key span { display: inline-flex; align-items: center; gap: 5px; font: var(--clock-weight) 14px var(--font-clock); font-variant-numeric: tabular-nums; }
.tl-key .ic { width: 16px; height: 16px; }
.tl-key .ic.ic-hourglass { height: 10px; }
.frieze-total { margin: 8px 0 4px; text-align: center; color: var(--text-2); font: 600 14px var(--font-display); letter-spacing: .16em; text-transform: uppercase; }
.frieze-total b { margin-left: 6px; color: var(--text); font: var(--clock-weight) 18px var(--font-clock); letter-spacing: 0; }
.frieze-total small { text-transform: none; letter-spacing: .02em; font-size: 13px; }
.rounds-pick { margin-top: 16px; }
.rounds-pick .set-title { margin-top: 0; }
.fight-sum .si-total { flex-basis: 100%; justify-content: center; font-size: .8em; letter-spacing: .14em; text-transform: uppercase; opacity: .8; margin-top: 2px; }

/* ════ Phone turned sideways (landscape) ════
   The system has already turned the page, so the app must not turn it again:
   the halves sit left | right, the bar runs along the bottom.
   Côté: digits upright for whoever watches. Face à face: each half turned
   towards its player at the short ends. Notch and home bar kept clear. */
@media (orientation: landscape) and (max-height: 560px) {
  #fight { display: grid; grid-template: "t b" minmax(0, 1fr) "bar bar" auto / minmax(0, 1fr) minmax(0, 1fr);
    padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); background: var(--bg-panel); }
  #fight .half.top { grid-area: t; transform: none; }
  #fight .half.bottom { grid-area: b; }
  #fight .half + .bar + .half { border-left: 1px solid var(--hair, #2a333b); }
  #fight .bar { grid-area: bar; padding-bottom: max(6px, env(safe-area-inset-bottom)); }
  /* Côté (right / left): upright, nothing turned */
  #fight:not([data-orient="normal"]) .h-in { width: 100%; height: 100%; transform: translate(-50%, -50%) !important; padding: 10px 14px; }
  #fight:not([data-orient="normal"]) .h-clock { font-size: calc(var(--clock-scale) * min(30cqw, 52cqh, 220px)); }
  .phase-boxing #fight:not([data-orient="normal"]) .h-phase b, .phase-break #fight:not([data-orient="normal"]) .h-phase b { font-size: calc(var(--clock-scale) * min(28cqw, 46cqh, 200px)); }
  /* Face à face: the left half reads from the left end, the right half from the right end */
  #fight[data-orient="normal"] .h-in { width: 100cqh; height: 100cqw; padding: 10px 12px; }
  #fight[data-orient="normal"] .half.top .h-in { transform: translate(-50%, -50%) rotate(90deg); }
  #fight[data-orient="normal"] .half.bottom .h-in { transform: translate(-50%, -50%) rotate(-90deg); }
  #fight[data-orient="normal"] .h-clock { font-size: calc(var(--clock-scale) * min(40cqh, 46cqw, 220px)); }
  /* Watermark gloves: fists towards the middle */
  #fight .half.top::before { transform: rotate(90deg) !important; }
  #fight .half.bottom::before { transform: rotate(-90deg) !important; }
  /* Upright: the speed in the outer corner of each half, mirrored */
  #fight:not([data-orient="normal"]) .half.top .h-avg { left: 14px !important; right: auto !important; text-align: left; }
  #fight:not([data-orient="normal"]) .half.bottom .h-avg { left: auto !important; right: 14px !important; text-align: right; }
  #fight:not([data-orient="normal"]) .half .h-name, #fight:not([data-orient="normal"]) .half .h-avg { bottom: 10px !important; }
  /* Between rounds and in boxing: the round timer big, the chess clock small, in both layouts */
  .phase-boxing #fight .h-clock, .phase-break #fight .h-clock { font-size: calc(var(--clock-scale) * min(10cqw, 14cqh, 56px)) !important; }
  .phase-boxing #fight[data-orient="normal"] .h-clock, .phase-break #fight[data-orient="normal"] .h-clock { font-size: calc(var(--clock-scale) * min(13cqh, 11cqw, 56px)) !important; }
  .phase-boxing #fight[data-orient="normal"] .h-phase b, .phase-break #fight[data-orient="normal"] .h-phase b { font-size: calc(var(--clock-scale) * min(34cqh, 36cqw, 200px)); }
  /* Turned halves are narrow: the speed stays small enough to clear BLANCS / NOIRS */
  #fight[data-orient="normal"] .h-avg { font-size: 18px !important; bottom: 40px !important; }
  #pause-menu { align-items: flex-end; }
  #pause-menu .pm-strip { padding-bottom: max(10px, env(safe-area-inset-bottom)); }
}
/* The speed never runs into BLANCS / NOIRS: it keeps clear of the home bar too */
.h-avg { bottom: max(10px, env(safe-area-inset-bottom)) !important; }
.h-name { bottom: max(12px, env(safe-area-inset-bottom)); }
/* COMBAT reads as a real button: rounded, a raised edge underneath, and it
   goes down when pressed. */
.fight-go { border-radius: 18px; margin-bottom: 24px;
  box-shadow: 0 1px 0 rgba(255,255,255,.45) inset, 0 -3px 0 rgba(0,0,0,.08) inset, 0 7px 0 #8a6a28, 0 26px 44px -16px rgba(0,0,0,.85);
  transition: transform .08s, box-shadow .08s; }
.fight-go:active { transform: translateY(5px); box-shadow: 0 1px 0 rgba(255,255,255,.35) inset, 0 2px 0 #8a6a28, 0 12px 24px -12px rgba(0,0,0,.8); }
.eco .fight-go { box-shadow: 0 5px 0 #4a3a16; }
/* Durées: an open pause is dotted, and the legend shows each colour */
.tl .tl-r.tl-inf i { background: repeating-linear-gradient(90deg, var(--blue) 0 3px, transparent 3px 6px); }
.tl-inf em { color: var(--blue); font-style: normal; font-size: 15px; }
.tl-key .tl-sw { display: block; width: 14px; height: 3px; border-radius: 2px; margin-right: 2px; background: color-mix(in srgb, var(--text) 75%, transparent); }
.tl-key .tl-k-box .tl-sw { background: color-mix(in srgb, var(--red) 85%, transparent); }
.tl-key .tl-k-pause .tl-sw { background: color-mix(in srgb, var(--blue) 80%, transparent); }
.tl-key .tl-k-inf .tl-sw { background: repeating-linear-gradient(90deg, var(--blue) 0 3px, transparent 3px 6px); }
@media (max-width: 360px) { .tl-key { gap: 12px; } }

/* ════ Durées: rulers (radio dial) ════ */
#durations.durations { display: flex; flex-direction: column; gap: 10px; }
.ruler { display: grid; grid-template-columns: 58px minmax(0, 1fr); align-items: center; gap: 8px; --c: var(--text); }
.rl-box { --c: var(--red); } .rl-pause { --c: var(--blue); }
.rl-ico { display: flex; flex-direction: column; align-items: center; gap: 3px; border: 0; background: none; padding: 4px 0; color: var(--c); touch-action: manipulation; }
.rl-ico .ic { width: 24px; height: 24px; }
.rl-ico .ic.ic-hourglass { height: 15px; margin: 4.5px 0; }
.rl-ico small { font: 600 11px var(--font-display); letter-spacing: .16em; text-transform: uppercase; }
.ruler:not(.on) .rl-ico { color: var(--text-2); opacity: .55; }
.ruler.dim { opacity: .4; }
.rl-scale { position: relative; height: 62px; border-radius: 10px; background: #12171b; border: 1px solid var(--hair, rgba(235,229,214,.14)); overflow: hidden; touch-action: none; cursor: ew-resize;
  -webkit-mask: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent); mask: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent); }
.rl-strip { position: absolute; left: 50%; bottom: 8px; height: 30px; transition: transform .12s ease-out;
  background: repeating-linear-gradient(90deg, rgba(235,229,214,.32) 0 1px, transparent 1px 10px) 0 100% / calc(100% + 1px) 10px no-repeat,
              repeating-linear-gradient(90deg, rgba(235,229,214,.55) 0 1.5px, transparent 1.5px 30px) 0 100% / calc(100% + 1.5px) 16px no-repeat; }
.rl-strip b { position: absolute; top: 0; transform: translateX(-50%); font: var(--clock-weight) 11px var(--font-clock); color: var(--text-2); white-space: nowrap; }
.rl-needle { position: absolute; left: 50%; top: 30px; bottom: 6px; width: 2px; margin-left: -1px; border-radius: 1px; background: var(--c); }
.rl-cur { position: absolute; left: 50%; top: 5px; transform: translateX(-50%); padding: 0 8px; background: #12171b; color: var(--c); font: var(--clock-weight) 21px/1 var(--font-clock); font-variant-numeric: tabular-nums; }
.ruler:not(.on) .rl-scale { opacity: .4; cursor: default; }
.ruler:not(.on) .rl-cur { color: var(--text-2); font-family: var(--font-display); font-size: 18px; letter-spacing: .1em; }

/* ════ COMBAT under the spotlight (Bilal): a dark hall, an ochre cone of light,
   the ring ropes across, a chessboard floor sinking into the shadow ════ */
.fight-go { color: var(--bone, #ebe5d6); justify-content: flex-start; padding-top: clamp(34px, 9vw, 52px);
  background: linear-gradient(180deg, #0d1114 0%, #182026 55%, #222b31 100%);
  box-shadow: 0 1px 0 rgba(235,229,214,.08) inset, 0 7px 0 #06080a, 0 26px 44px -16px rgba(0,0,0,.9); }
.fight-go:active { box-shadow: 0 1px 0 rgba(235,229,214,.08) inset, 0 2px 0 #06080a, 0 12px 24px -12px rgba(0,0,0,.8); }
.fight-go > * { position: relative; }
.fight-go > .fg-light, .fight-go > .fg-floor, .fight-go > .fg-ropes { position: absolute; pointer-events: none; }
.fg-light { top: -70px; left: 50%; width: 130%; height: 78%; transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(228,190,95,.30), rgba(228,190,95,.08) 60%, transparent); }
.fg-floor { left: -45%; right: -45%; bottom: -24px; height: 46%; transform: perspective(420px) rotateX(60deg); transform-origin: 50% 100%;
  background: conic-gradient(#b8924a 25%, #262c31 0 50%, #b8924a 0 75%, #262c31 0) 0 0 / 12.5% 25%; opacity: .55;
  -webkit-mask: linear-gradient(transparent, #000 45%); mask: linear-gradient(transparent, #000 45%); }
.fg-ropes { left: 0; right: 0; top: calc(clamp(34px, 9vw, 52px) + clamp(54px, 17vw, 120px) * .85 + 18px); height: 30px; }
.fg-ropes i { position: absolute; left: 0; right: 0; height: 3px; border-radius: 2px; box-shadow: 0 2px 3px rgba(0,0,0,.5); }
.fg-ropes i:nth-child(1) { top: 0; background: rgba(235,229,214,.6); }
.fg-ropes i:nth-child(2) { top: 11px; background: rgba(204,64,52,.85); }
.fg-ropes i:nth-child(3) { top: 22px; background: rgba(74,120,160,.85); }
.fight-go b { text-shadow: 0 2px 0 #000, 0 0 30px rgba(228,190,95,.25); }
.fight-go .fight-sum { margin-top: 52px; opacity: .92; }
.fight-go .si .ic { color: var(--bone, #ebe5d6); }
.eco .fight-go { background: #000; box-shadow: 0 5px 0 #111; }
.eco .fg-light, .eco .fg-floor { display: none; }
.rl-cur { padding: 0 10px 7px; }  /* hides the scale label under the needle */
.chess-set::before { display: none; }  /* no link line to the old tiles */
.tl-total { margin-top: 7px; text-align: right; color: var(--text-2); font: 600 11px var(--font-display); letter-spacing: .16em; text-transform: uppercase; }
.tl-total b { margin-left: 4px; color: var(--text); font: var(--clock-weight) 13px var(--font-clock); letter-spacing: 0; }
.rl-count { --c: var(--orange); }
.rl-ico svg { width: 30px; height: 26px; }
#chess-set.chess-set { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.chess-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.dur.off-plain { opacity: .3; pointer-events: none; }

/* Prêt ? / Son / Éco: same rows as the rulers, the note says what each does */
#options.options { display: flex; flex-direction: column; gap: 8px; margin-top: 18px; }
.rl-opt { --c: var(--gold); width: 100%; padding: 0; border: 0; background: none; text-align: left; color: inherit; touch-action: manipulation; cursor: pointer; }
.rl-opt .rl-ico .ic { width: 26px; height: 26px; }
.rl-note { display: flex; align-items: center; min-height: 62px; box-sizing: border-box; padding: 8px 14px; border-radius: 10px; background: #12171b;
  border: 1px solid var(--hair, rgba(235,229,214,.14)); font: 400 14px/1.3 var(--font-body, inherit); color: var(--text-2); }
.rl-opt.on .rl-note { color: var(--text); border-color: color-mix(in srgb, var(--c) 45%, transparent); }
.rl-opt:not(.on) .rl-note { opacity: .7; }
/* Rulers a little narrower, a reset button on the right */
.ruler { grid-template-columns: 58px minmax(0, 1fr) 40px; }
.rl-reset { display: flex; align-items: center; justify-content: center; height: 40px; width: 40px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--text-2); touch-action: manipulation; }
.rl-reset .ic { width: 20px; height: 20px; }
.rl-reset.same { opacity: .25; pointer-events: none; }
.rl-opt { grid-template-columns: 58px minmax(0, 1fr); }
.rl-note { min-height: 52px; font-size: 13.5px; }
.rl-reset:not(.same) { color: var(--c); }
.ruler:not(.on) .rl-cur { min-width: 64px; text-align: center; box-sizing: border-box; }
.rl-opt .rl-ico small { letter-spacing: .08em; }
/* The drawings on the rulers are buttons (on / off): a small frame says so */
.ruler:not(.rl-opt) .rl-ico { align-self: stretch; justify-content: center; border: 1px solid color-mix(in srgb, var(--c) 45%, transparent); border-radius: 10px;
  background: color-mix(in srgb, var(--c) 7%, transparent); cursor: pointer; }
.ruler:not(.rl-opt):not(.on) .rl-ico { border-color: var(--hair, rgba(235,229,214,.18)); background: none; }
.ruler:not(.rl-opt) .rl-ico:active { transform: scale(.96); }
.ruler { grid-template-columns: 64px minmax(0, 1fr) 40px; }
.ruler:not(.on) .rl-cur { height: 38px; line-height: 30px; }
/* Alerte, count limits and the illegal-move switch, in the ruler style */
.rl-n { --c: var(--text); }
.rl-n .rl-cur { font: italic 500 26px/1 var(--font-serif); padding-top: 0; }
.rl-n .rl-strip b { font: italic 500 13px var(--font-serif); }
.rl-lbl { align-self: stretch; justify-content: center; color: var(--text-2) !important; opacity: 1 !important; }
.rl-lbl em { font: italic 500 17px/1 var(--font-serif); color: var(--text); }
.rl-ill { --c: var(--red); grid-template-columns: 64px minmax(0, 1fr) !important; }
.rl-ill.dim { opacity: .4; pointer-events: none; }
.rl-ill .rl-ico svg { width: 26px; height: 24px; }
.rl-opt { grid-template-columns: 64px minmax(0, 1fr); }
.ruler .rl-ico.rl-lbl { border: 0; background: none; }
.rl-strip b { transition: opacity .12s; } .rl-strip b.hid { opacity: 0; }
.rl-cnt { --c: var(--orange); }
.rl-cnt .rl-ico svg { width: 30px; height: 26px; }

/* Boxing and breaks: the chess time kept aside, small and quiet, right by BLANCS / NOIRS */
.phase-boxing #fight .half .h-clock, .phase-break #fight .half .h-clock {
  position: absolute; left: 0; right: 0; bottom: 38px; text-align: center;
  font-size: calc(var(--clock-scale) * 22px) !important; line-height: 1; color: var(--text-2); opacity: .55; }
.phase-boxing #fight .half.top .h-clock, .phase-break #fight .half.top .h-clock { bottom: max(38px, calc(env(safe-area-inset-bottom) + 26px)); }
.rl-ready.dim { opacity: .4; pointer-events: none; }
#durations .rl-ready { margin-top: 2px; }

/* Arrival = the clock, ready: Réglages in each half, Son / Éco and the fight in the bar */
.h-set { display: inline-flex; align-items: center; gap: 8px; margin-top: 10px; padding: 9px 18px; border-radius: 999px;
  border: 1px solid var(--hair, rgba(235,229,214,.18)); background: rgba(12,15,18,.55); color: var(--text);
  font: 600 12px var(--font-display); letter-spacing: .2em; text-transform: uppercase; touch-action: manipulation; }
.h-set svg { width: 16px; height: 16px; }
.h-set[hidden], .bar-tg[hidden] { display: none; }
.bar-tg { grid-column: -2; justify-self: end; display: flex; gap: 8px; }
.bar-tg .tg { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; padding: 0;
  border: 1px solid var(--hair, rgba(235,229,214,.18)); background: none; color: var(--text-2); touch-action: manipulation; }
.bar-tg .tg.on { background: rgba(235,229,214,.1); color: var(--text); }
.bar-tg .tg .ic, .bar-tg .tg svg { width: 22px; height: 22px; }
.phase-ready .bar-round { display: flex; align-items: center; gap: 12px; white-space: nowrap; font: var(--clock-weight, 600) 17px var(--font-clock); color: var(--text); }
.ri { display: inline-flex; align-items: center; gap: 4px; }
.ri .ic { width: 17px; height: 17px; }
.ri .ic.ic-hourglass { width: 26px; height: 15px; }
.ri-n { font: italic 500 26px/1 var(--font-serif); }
.phase-ready .bar-phase:empty { display: none; }
/* Réglages opened from the far half: the page turns to face that player */
html.flip #setup { position: fixed; top: 0; bottom: 0; left: 50%; width: min(560px, 100%); max-width: none; margin: 0;
  overflow-y: auto; transform: translateX(-50%) rotate(180deg); -webkit-overflow-scrolling: touch; }
html.flip body { overflow: hidden; }
.phase-ready .bar-round { gap: 9px; font-size: 15px; }
.ri .ic { width: 15px; height: 15px; } .ri .ic.ic-hourglass { width: 22px; height: 13px; }
.ri-n { font-size: 23px; }
.bar-tg { gap: 6px; } .bar-tg .tg { width: 36px; height: 36px; }
.phase-ready .bar-timer { display: none; }
.phase-ready .bar-round { gap: 7px; font-size: 14px; }
.phase-ready .bar { gap: 8px; }
/* Bar progress: round numerals, chess gold, boxing red, the current one bold */
.trk { display: flex; align-items: baseline; gap: 9px; }
.tr { font: italic 400 21px/1 var(--font-serif); color: rgba(235, 229, 214, .32); }
.tr.now { font-weight: 700; font-size: 25px; }
.tr-chess.now { color: var(--gold); }
.tr-box.now { color: var(--red); }
/* Bar parts before the start are buttons; the quick panel opens over the waiting clock */
button.ri { border: 0; background: none; color: inherit; font: inherit; padding: 6px 2px; touch-action: manipulation; cursor: pointer; }
button.ri.off { opacity: .45; }
.quick { position: absolute; inset: 0; z-index: 30; display: flex; align-items: center; justify-content: center; padding: 16px;
  background: rgba(6, 8, 10, .62); }
.quick[hidden] { display: none; }
.quick-box { width: min(420px, 100%); background: #151a1f; border: 1px solid var(--hair, rgba(235,229,214,.16)); border-radius: 16px;
  padding: 16px; display: flex; flex-direction: column; gap: 14px; box-shadow: 0 20px 50px -10px #000; }
.q-t { margin: 0; text-align: center; font: 600 12px var(--font-display); letter-spacing: .26em; text-transform: uppercase; color: var(--text-2); }
.q-rounds { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.q-rounds button { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 0 10px; border-radius: 12px;
  border: 1px solid var(--hair, rgba(235,229,214,.16)); background: none; color: var(--text); }
.q-rounds button b { font: italic 500 30px/1 var(--font-serif); }
.q-rounds button small { font: var(--clock-weight, 600) 13px var(--font-clock); color: var(--text-2); }
.q-rounds button.on { border-color: var(--gold-mid, #b8913f); background: rgba(217,180,90,.1); }
.q-rounds button.on b { color: var(--gold); }
.q-act { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; }
.q-btn { display: flex; align-items: center; justify-content: center; gap: 6px; height: 42px; padding: 0 14px; border-radius: 21px;
  border: 1px solid var(--hair, rgba(235,229,214,.2)); background: none; color: var(--text);
  font: 600 12px var(--font-display); letter-spacing: .14em; text-transform: uppercase; touch-action: manipulation; }
.q-btn .ic { width: 16px; height: 16px; }
.q-btn:disabled { opacity: .35; }
.q-ok { background: var(--bone, #ebe5d6); color: #111519; border-color: transparent; }
.quick .ruler { grid-template-columns: 64px minmax(0, 1fr); }
.quick .rl-reset { display: none; }
.q-act { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, .8fr); }
.q-btn { padding: 0 8px; letter-spacing: .1em; min-width: 0; }
.tr.prev { font-weight: 700; font-size: 25px; color: rgba(235, 229, 214, .55); }
.tr.next { animation: tr-blink 1s steps(2, jump-none) infinite; }
@keyframes tr-blink { 50% { opacity: .25; } }
body.eco .tr.next { animation: none; }
.trk.more { gap: 6px; } .trk.more .tr { font-size: 17px; } .trk.more .tr.now, .trk.more .tr.prev { font-size: 20px; }
.trk.many { gap: 4px; letter-spacing: -.03em; } .trk.many .tr { font-size: 14px; } .trk.many .tr.now, .trk.many .tr.prev { font-size: 16px; }
/* The bar parts before the start are real buttons: outlined, lit when pressed or open */
.phase-ready .bar-round { gap: 6px; overflow: visible; }
button.ri { --c: var(--text); padding: 5px 8px; border: 1px solid rgba(235, 229, 214, .28); border-radius: 9px; background: rgba(235, 229, 214, .04);
  transition: background .12s, border-color .12s; }
button.ri-boxRoundMs { --c: var(--red); } button.ri-breakMs { --c: var(--blue); } button.ri-rounds { --c: var(--gold); padding: 3px 9px; }
button.ri:active, button.ri.open { border-color: var(--c); background: color-mix(in srgb, var(--c) 18%, transparent); color: var(--c); }
button.ri.off { border-style: dashed; }
/* Average per move in the app's own type (Val: the serif looked like letters) */
.h-avg { font-family: var(--font-display) !important; font-style: normal !important; font-weight: 600 !important; letter-spacing: .02em; }
.h-avg small { font-style: normal; }
/* Ready bar on narrow phones: tighter buttons so everything fits */
.phase-ready .bar-round { gap: 4px; font-size: 13px; }
.phase-ready .bar { gap: 6px; padding-inline: 8px; }
button.ri { padding: 5px 5px; gap: 3px; }
button.ri-rounds { padding: 2px 7px; }
.ri .ic { width: 13px; height: 13px; } .ri .ic.ic-hourglass { width: 19px; height: 11px; }
.ri-n { font-size: 20px; }
.bar-tg { gap: 4px; } .bar-tg .tg { width: 34px; height: 34px; }
.opt-avg { font: 600 22px/1 var(--font-display); }
/* Ready bar, bigger buttons: the fight on a full-width row, Son / Éco on the row below */
.phase-ready .bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; row-gap: 8px; padding: 10px 10px; }
.phase-ready .bar-info { flex: 1 1 100%; min-width: 0; }
.phase-ready .bar-round { display: flex; gap: 8px; width: 100%; font-size: 19px; }
.phase-ready button.ri { flex: 1 1 0; justify-content: center; height: 50px; padding: 0 6px; border-radius: 12px; gap: 5px; min-width: 0; }
.phase-ready button.ri-rounds { flex: 0 0 52px; }
.phase-ready .ri .ic { width: 18px; height: 18px; } .phase-ready .ri .ic.ic-hourglass { width: 26px; height: 15px; }
.phase-ready .ri-n { font-size: 28px; }
.phase-ready .bar-tg { flex: 1 1 100%; justify-content: center; gap: 10px; }
.phase-ready .bar-tg .tg { width: auto; height: 40px; padding: 0 16px; gap: 8px; border-radius: 20px;
  font: 600 11px var(--font-display); letter-spacing: .18em; text-transform: uppercase; }
@media (orientation: landscape) { .phase-ready .bar { flex-wrap: nowrap; } .phase-ready .bar-info { flex: 1 1 auto; } .phase-ready .bar-tg { flex: none; } }
@media (max-height: 620px) and (orientation: portrait) { .phase-ready button.ri { height: 42px; } .phase-ready .bar-tg .tg { height: 34px; } .phase-ready .bar { row-gap: 6px; padding: 6px 8px; } }
/* Ready bar buttons lightly tinted in their own colour */
.phase-ready button.ri { background: color-mix(in srgb, var(--c) 9%, transparent); border-color: color-mix(in srgb, var(--c) 42%, transparent); }
.phase-ready button.ri .ic { color: var(--c); }
.phase-ready button.ri-rounds .ri-n { color: var(--gold); }
.phase-ready button.ri.off { background: none; border-color: rgba(235, 229, 214, .25); }
.phase-ready button.ri.off .ic { color: var(--text-2); }
.phase-ready button.ri:active, .phase-ready button.ri.open { background: color-mix(in srgb, var(--c) 22%, transparent); border-color: var(--c); }
/* Before the start: red flag toggle in each player's top-right corner (illegal moves) */
.h-illtg { position: absolute; top: 12px; right: 12px; z-index: 3; width: 48px; height: 48px; border-radius: 12px; padding: 0;
  display: flex; align-items: center; justify-content: center; border: 1px dashed rgba(235, 229, 214, .28); background: none;
  color: var(--text-2); opacity: .7; touch-action: manipulation; }
.h-illtg svg { width: 26px; height: 26px; filter: grayscale(1); opacity: .6; }
.h-illtg.on { border: 1px solid color-mix(in srgb, var(--red) 70%, transparent); background: color-mix(in srgb, var(--red) 16%, transparent); opacity: 1; }
.h-illtg.on svg { filter: none; opacity: 1; }
.h-illtg[hidden] { display: none; }
.half.top .h-illtg { top: max(12px, env(safe-area-inset-bottom)); }
/* Bar numerals bigger (Val), still fitting XI rounds */
.trk { gap: 10px; } .tr { font-size: 27px; } .tr.now, .tr.prev { font-size: 32px; }
.trk.more { gap: 7px; } .trk.more .tr { font-size: min(22px, 5.6vw); } .trk.more .tr.now, .trk.more .tr.prev { font-size: min(26px, 6.6vw); }
.trk.many { gap: 5px; } .trk.many .tr { font-size: min(18px, 4.4vw); } .trk.many .tr.now, .trk.many .tr.prev { font-size: min(21px, 5.2vw); }
/* Played rounds: bold, same size (only the current one grows), so the row never overflows */
.tr.prev { font-size: 27px; } .trk.more .tr.prev { font-size: min(22px, 5.6vw); } .trk.many .tr.prev { font-size: min(18px, 4.4vw); }
/* v2.71: corner switches before the start: s/coup top-left; counts + illegal moves top-right */
.h-tgs { position: absolute; inset: 12px 12px auto 12px; z-index: 3; display: flex; justify-content: flex-end; gap: 8px; pointer-events: none; }
.h-tgs > * { pointer-events: auto; }
.h-tgs .h-avgtg { margin-right: auto; }
.half.top .h-tgs { top: max(12px, env(safe-area-inset-bottom)); }
.h-tgs[hidden] { display: none; }
.h-tgs .h-illtg { position: static; }
/* Short halves (small phones): the round name gives way to the corner switches */
@container (max-height: 300px) {
  .phase-ready .h-up > .h-phase { display: none !important; }
  /* and the switches move down beside Réglages, clear of the digits */
  .h-tgs { top: auto !important; bottom: 10px; inset-inline: 8px; gap: 6px; }
  .h-tg { width: 40px; height: 40px; }
  .h-avgtg { padding: 0 7px; font-size: 12px; }
}
.h-tg { width: 44px; height: 44px; border-radius: 12px; padding: 0; display: flex; align-items: center; justify-content: center;
  border: 1px dashed rgba(235, 229, 214, .28); background: none; color: var(--text-2); opacity: .7; touch-action: manipulation; }
.h-tg svg { width: 26px; height: 26px; filter: grayscale(1); opacity: .6; }
.h-tg.on { opacity: 1; }
.h-tg.on svg { filter: none; opacity: 1; }
.h-avgtg { width: auto; padding: 0 9px; font: 600 13px var(--font-display); letter-spacing: .04em; }
.h-avgtg b { font-weight: 700; font-size: 16px; }
.h-avgtg.on { border: 1px solid rgba(235, 229, 214, .55); background: rgba(235, 229, 214, .08); color: var(--bone); }
.h-cnttg.on { border: 1px solid color-mix(in srgb, #ff9a1f 70%, transparent); background: color-mix(in srgb, #ff9a1f 14%, transparent); }
.h-cnttg .hands { display: flex; height: 28px; } .h-cnttg .hands svg { width: 16px; height: 28px; }
.quick-box.qflip { transform: rotate(180deg); }
.quick-box .rl-opt { margin-top: 8px; }

/* Pause strip: the switches on a light first row, the three actions under them */
.pm-strip { display: flex !important; flex-direction: column; gap: 10px; padding: 10px max(12px, env(safe-area-inset-left)); }
.pm-tgs { display: flex; justify-content: center; gap: 8px; }
.pt { flex: 1 1 0; max-width: 78px; height: 54px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  padding: 0; border-radius: 12px; border: 1px dashed rgba(235, 229, 214, .25); background: none; color: var(--text-2); touch-action: manipulation; }
.pt svg, .pt .ic { width: 22px; height: 22px; margin: 0; }
.pt svg { filter: grayscale(1); opacity: .6; }
.pt small { font: 600 9px var(--font-display); letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
.pt.on { border: 1px solid rgba(235, 229, 214, .5); color: var(--bone); background: rgba(235, 229, 214, .06); }
.pt.on svg { filter: none; opacity: 1; }
.pt .hands { display: flex; height: 22px; } .pt .hands svg { width: 14px; height: 22px; }
.pt-set { border-style: solid; color: var(--bone); }
.pt-set svg { filter: none; opacity: 1; }
.pm-main { display: grid; grid-template-columns: 54px minmax(0, 1fr) minmax(0, 1.6fr); gap: 10px; }
#pause-menu.ready .pm-main { grid-template-columns: 54px minmax(0, 1fr); }
.pm-main .pm-go { letter-spacing: .1em !important; font-size: 20px !important; }
.pm-main .btn { min-height: 56px; }

/* Réglages page: only what is not on the clock */
.set-back { display: inline-flex; align-items: center; gap: 8px; flex-direction: row-reverse; align-self: flex-start; margin: 0 0 8px;
  padding: 10px 18px; border-radius: 999px; border: 1px solid var(--hair); background: none; color: var(--bone);
  font: 600 13px var(--font-display); letter-spacing: .2em; text-transform: uppercase; }
.set-back .ic { width: 18px; height: 18px; margin: 0; transform: scaleX(-1); }
.vols { display: grid; gap: 10px; margin-bottom: 12px; }
.vol { display: grid; grid-template-columns: 26px 92px minmax(0, 1fr) 34px; align-items: center; gap: 10px; padding: 10px 12px;
  border: 1px solid var(--hair); border-radius: 12px; }
.vol-ico .ic { width: 22px; height: 22px; margin: 0; color: var(--bone); }
.vol-l { font: 600 13px var(--font-display); letter-spacing: .14em; text-transform: uppercase; color: var(--bone); display: flex; flex-direction: column; }
.vol-l small { font-size: 10px; letter-spacing: .04em; text-transform: none; color: var(--text-2); font-weight: 500; }
.vol input { width: 100%; accent-color: var(--bone); height: 32px; }
.vol b { font: 600 14px var(--font-display); color: var(--text-2); text-align: right; }
.about { text-align: left; color: var(--text-2); font-size: 14px; line-height: 1.5; margin-bottom: 8px; }
.about p { margin: 0 0 8px; }

/* Slide down from the top to reload the app */
#ptr { position: fixed; left: 50%; top: 0; z-index: 99; width: 44px; height: 44px; margin-left: -22px; border-radius: 50%;
  display: grid; place-items: center; background: #0d1114; border: 1px solid var(--hair); color: var(--bone);
  transform: translateY(-60px); opacity: 0; pointer-events: none; }
#ptr .ic { width: 22px; height: 22px; margin: 0; }
#ptr.go { border-color: var(--bone); }
html.flip #ptr { top: auto; bottom: 0; }
.set-note { margin: -4px 0 10px; color: var(--text-2); font-size: 13px; }
#chess-set .rl-ico { pointer-events: none; }
/* ✋ off: bone outline hands, fully visible; on: skin hands in an orange frame */
.h-cnttg:not(.on) { opacity: 1; border-color: rgba(235, 229, 214, .45); }
.h-cnttg:not(.on) svg, .pt[data-pt="count"]:not(.on) svg { filter: none; opacity: .85; }
/* 0.2.74: ready bar = one row of round buttons, all the same size, like lichess: rounds, chess, boxing, pause | sound, Éco */
.phase-ready .bar { --rb: min(54px, 12.6vw); flex-wrap: nowrap !important; justify-content: center; gap: min(10px, 2.4vw) !important; padding: 10px 8px !important; }
.phase-ready .bar-info { flex: none !important; width: auto; }
.phase-ready .bar-round { width: auto !important; gap: min(10px, 2.4vw) !important; }
.phase-ready button.ri, .phase-ready .bar-tg .tg { flex: none !important; width: var(--rb) !important; height: var(--rb) !important; padding: 0 !important;
  border-radius: 50% !important; display: grid !important; place-items: center; gap: 0 !important; }
.phase-ready button.ri .ic, .phase-ready .bar-tg .tg .ic, .phase-ready .bar-tg .tg svg { width: calc(var(--rb) * .44) !important; height: calc(var(--rb) * .44) !important; margin: 0; }
.phase-ready button.ri .ic.ic-hourglass { width: calc(var(--rb) * .56) !important; height: calc(var(--rb) * .33) !important; }
.phase-ready .ri-n { font-size: calc(var(--rb) * .5) !important; line-height: 1; }
.phase-ready .bar-tg { flex: none !important; gap: min(10px, 2.4vw) !important; padding-left: min(10px, 2.4vw); border-left: 1px solid var(--hair); }
.phase-ready .bar-tg .tg { border: 1px solid rgba(235, 229, 214, .2); background: none; color: var(--text-2); }
.phase-ready .bar-tg .tg.on { border-color: rgba(235, 229, 214, .5); background: rgba(235, 229, 214, .08); color: var(--bone); }
.phase-ready button.ri.off { border-style: dashed; }
/* Prêt ? round switch in the ready bar */
.phase-ready .bar { --rb: min(54px, 11vw); }
.phase-ready button.ri-ready { --c: var(--gold); }
.ri-q { font: italic 500 calc(var(--rb) * .36)/1 var(--font-serif); color: var(--text-2); }
.phase-ready button.ri-ready.on { background: color-mix(in srgb, var(--gold) 12%, transparent); border-color: color-mix(in srgb, var(--gold) 55%, transparent); border-style: solid; }
.phase-ready button.ri-ready.on .ri-q { color: var(--gold); }
.phase-ready button.ri-ready.off { background: none; border-color: rgba(235, 229, 214, .25); }
.phase-ready button.ri.dim { opacity: .45; }
/* 0.2.77: bar = rounds, clock | sound, Éco, standard */
.phase-ready button.ri-times { --c: var(--bone); }
.phase-ready button.ri-times .ic { width: calc(var(--rb) * .5) !important; height: calc(var(--rb) * .5) !important; color: var(--bone); }
.phase-ready .bar { --rb: min(54px, 12.6vw); }
.quick-box .q-act-one { grid-template-columns: 1fr; justify-items: center; }
.quick-box .q-act-one .q-ok { min-width: 140px; }
.quick-box .ruler + .ruler { margin-top: 8px; }
#opt-ready .rl-opt { width: 100%; margin-bottom: 12px; }
/* No round names on the clock: the Prêt ? card keeps only Prêt ? */
.h-card .hc-num, .h-card .hc-label, .h-card .hc-rule { display: none !important; }
.phase-ready .h-up > .h-phase, .h-phase.empty { display: none !important; }
/* No dashes around the Boxe / Pause sign, nothing when empty */
.h-phase small::before, .h-phase small::after { display: none !important; }
.h-phase small:empty { display: none !important; }
/* Corner switches: a small word under the drawing */
.h-tgs .h-cnttg, .h-tgs .h-illtg { width: 58px; height: 52px; flex-direction: column; gap: 3px; }
.h-tgs .h-illtg svg { width: 20px; height: 20px; }
.h-tgs .h-cnttg .hands { height: 22px; } .h-tgs .h-cnttg .hands svg { width: 13px; height: 22px; }
.h-tg small { font: 600 8.5px var(--font-display); letter-spacing: .1em; text-transform: uppercase; color: var(--text-2); line-height: 1; }
.h-tg.on small { color: var(--bone); }
.h-tgs .h-avgtg { height: 52px; }
@container (max-height: 300px) { .h-tgs .h-cnttg, .h-tgs .h-illtg { width: 52px; height: 46px; } .h-tgs .h-avgtg { height: 46px; } }
@container (max-height: 300px) { .h-tgs { bottom: 4px !important; } .h-tgs .h-cnttg, .h-tgs .h-illtg, .h-tgs .h-avgtg { height: 42px; } .h-tgs .h-cnttg .hands { height: 18px; } .h-tgs .h-cnttg .hands svg { height: 18px; width: 11px; } .h-tgs .h-illtg svg { width: 17px; height: 17px; } }
/* Val's one-line chess clock drawing for the times button */
.ic-clock { --m: url(clock.png); }
.phase-ready button.ri-times .ic.ic-clock { width: calc(var(--rb) * .62) !important; height: calc(var(--rb) * .37) !important; }
/* Rounds button as a wheel: the other choices half hidden at the edges */
.phase-ready button.ri-rounds { position: relative; overflow: hidden; }
.ri-peek { position: absolute; top: 50%; transform: translateY(-50%); font: italic 500 calc(var(--rb) * .4)/1 var(--font-serif);
  color: var(--gold); opacity: .28; pointer-events: none; white-space: nowrap; }
.ri-prev { right: calc(50% + var(--rb) * .3); }
.ri-next { left: calc(50% + var(--rb) * .3); }
.phase-ready button.ri-rounds .ri-n { position: relative; z-index: 1; }
/* 0.2.83: no gold for "selected": a brighter bone outline, a light fill, a small dot under it */
.phase-ready button.ri-rounds { --c: var(--bone); background: rgba(235, 229, 214, .07) !important; border-color: rgba(235, 229, 214, .5) !important; }
.phase-ready button.ri-rounds .ri-n { color: var(--bone) !important; }
.phase-ready button.ri-rounds .ri-n.long { font-size: calc(var(--rb) * .4) !important; }
.ri-peek { color: var(--bone); opacity: .3; font-size: calc(var(--rb) * .34); }
.ri-prev { right: auto; left: 0; transform: translate(-55%, -50%); }
.ri-next { left: auto; right: 0; transform: translate(55%, -50%); }
.q-rounds button.on, .digit-opt.on, .orient-opt.on { border-color: rgba(235, 229, 214, .75) !important; background: rgba(235, 229, 214, .09) !important; color: var(--bone) !important;
  position: relative; }
.q-rounds button.on b { color: var(--bone) !important; }
.q-rounds button.on::after, .digit-opt.on::after, .orient-opt.on::after { content: ''; position: absolute; left: 50%; bottom: 5px; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; background: var(--bone); }
.digit-opt.on span, .orient-opt.on svg { color: var(--bone) !important; }
#opt-ready .rl-opt { --c: var(--bone); }
#opt-ready .rl-opt .rl-ico, #opt-ready .rl-opt small { color: var(--bone) !important; }
/* Count limits: label, then 1 to 5 as round buttons */
.cnt-pick { display: grid; grid-template-columns: 92px repeat(5, 1fr); align-items: center; gap: 8px; margin: 10px 0; }
.cp-l { display: flex; flex-direction: column; align-items: center; line-height: 1.1; }
.cp-l small { font: 600 11px var(--font-display); letter-spacing: .2em; text-transform: uppercase; color: var(--text-2); }
.cp-l em { font: italic 500 18px var(--font-serif); color: var(--bone); }
.cnt-pick button { aspect-ratio: 1; max-width: 48px; width: 100%; justify-self: center; border-radius: 50%; padding: 0;
  border: 1px solid rgba(235, 229, 214, .18); background: none; color: var(--text-2); font: italic 500 22px/1 var(--font-serif); touch-action: manipulation; }
.cnt-pick button.on { border-color: rgba(235, 229, 214, .75); background: rgba(235, 229, 214, .1); color: var(--bone); }
/* Rounds wheel, 0.2.85: the neighbours small, in the sans, low at the sides, almost whole */
.ri-peek { font: 600 calc(var(--rb) * .2)/1 var(--font-display) !important; font-style: normal !important; letter-spacing: .04em;
  opacity: .45; top: 66%; }
.ri-prev { left: 0; right: auto; transform: translate(-18%, -50%); }
.ri-next { right: 0; left: auto; transform: translate(18%, -50%); }
.phase-ready button.ri-rounds .ri-n { transform: translateY(-6%); }
.ri-peek { top: 70%; opacity: .5; }
.ri-prev { left: calc(var(--rb) * .06); transform: translate(0, -50%); }
.ri-next { right: calc(var(--rb) * .06); transform: translate(0, -50%); }
.phase-ready button.ri-rounds .ri-n { font-size: calc(var(--rb) * .42) !important; transform: translateY(-14%); }
.phase-ready button.ri-rounds .ri-n.long { font-size: calc(var(--rb) * .34) !important; }
/* Réglages pill: bigger, lower (towards the player's edge) */
.h-set { margin-top: 26px; padding: 14px 28px; gap: 10px; font-size: 15px; border-color: rgba(235, 229, 214, .3); }
.h-set svg { width: 20px; height: 20px; }
@container (max-height: 300px) { .h-set { margin-top: 8px; padding: 11px 22px; font-size: 13px; } }
.cnt-pick button:disabled { opacity: .2; border-style: dashed; }
/* 0.2.87: in play, the illegal move button is just a red flag, top right of each half; its − to the left; Annuler sits over it */
#fight .illegal-wrap { left: auto !important; right: 12px !important; top: 12px; flex-direction: row-reverse !important; gap: 8px; }
.illegal-btn { width: 48px; height: 48px; padding: 0 !important; justify-content: center; border-radius: 12px;
  background: rgba(10, 12, 14, .55); border: 1px solid color-mix(in srgb, var(--red) 70%, transparent); box-shadow: none; }
.illegal-btn span { display: none; }
.illegal-btn .ico { width: 26px !important; height: 26px !important; }
.illegal-minus { width: 34px; height: 34px; border-width: 1px; }
#fight .notice-undo { left: auto !important; right: 12px !important; }
.bar-tg .tg { -webkit-touch-callout: none; user-select: none; }
.quick-box .vols { margin: 4px 0 6px; } .quick-box .vol { grid-template-columns: 26px 80px minmax(0, 1fr) 34px; }
.q-rounds button.on::after, .digit-opt.on::after, .orient-opt.on::after { display: none !important; }
/* Average per move: grey only, like the old Coups line */
.h-avg, .h-avg small { color: var(--text-2) !important; }
/* 0.2.91: rounds dial: the other three choices small along the bottom arc */
.ri-peek { font-size: calc(var(--rb) * .16) !important; opacity: .42; transform: translate(-50%, -50%) !important; left: auto; right: auto; }
.ri-o0 { left: 24% !important; top: 72% !important; }
.ri-o1 { left: 50% !important; top: 83% !important; }
.ri-o2 { left: 76% !important; top: 72% !important; }
.phase-ready button.ri-rounds .ri-n { transform: translateY(-16%); font-size: calc(var(--rb) * .38) !important; }
.phase-ready button.ri-rounds .ri-n.long { font-size: calc(var(--rb) * .3) !important; }
/* Pause: III → ⧗ → IV above the timer; the next round bold in its colour */
.phase-break .h-phase small { display: inline-flex !important; align-items: center; gap: 10px; font-size: clamp(22px, 7cqw, 34px) !important; letter-spacing: 0 !important; }
.pv-prev { font: italic 600 1em/1 var(--font-serif); color: var(--text-2); opacity: .7; }
.pv-arr { font: 400 .8em/1 var(--font-display); color: var(--text-2); }
.phase-break .h-phase small .ic { width: auto; height: .75em; color: var(--blue); }
.rtag { font: italic 700 1.1em/1 var(--font-serif); }
.rt-chess { color: var(--bone); } .rt-box { color: var(--red); }
.pm-next .rtag { font-size: 30px; }
.bb-next { display: inline-flex; align-items: center; gap: 4px; } .bb-next .ic { width: 18px; height: 18px; } .bb-next .rtag { font-size: 24px; }

/* 0.2.93: the chess digits always at the centre of the half, whatever sits above or below */
.h-up, .h-down { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.phase-ready .h-in, .phase-chess .h-in, .phase-over .h-in { display: grid !important; grid-template-rows: minmax(0, 1fr) auto minmax(0, 1fr); grid-template-columns: 100%; justify-items: center; }
.phase-ready .h-up, .phase-chess .h-up, .phase-over .h-up { grid-row: 1; align-self: end; }
.phase-ready .h-in > .h-clock, .phase-chess .h-in > .h-clock, .phase-over .h-in > .h-clock { grid-row: 2; }
.phase-ready .h-down, .phase-chess .h-down, .phase-over .h-down { grid-row: 3; align-self: start; }
.h-up:empty, .h-down:empty { display: none; }
/* Short halves: the digits stay centred, so the switches go back to the top corners (free above the digits)
   and Touche sits beside Réglages below them */
@container (max-height: 300px) {
  .h-tgs { top: 8px !important; bottom: auto !important; }
  .phase-ready .h-down { flex-direction: row; gap: 14px; }
  .phase-ready .h-down .h-set { margin-top: 0; padding: 9px 16px; font-size: 12px; }
  .phase-ready .h-down .h-move { font-size: 20px; }
}
@container (max-height: 300px) {
  .phase-ready #fight:not([data-orient="normal"]) .h-down { flex-direction: column; gap: 4px; }
  .phase-ready #fight:not([data-orient="normal"]) .h-down .h-move { font-size: 17px; min-height: 0; }
  .phase-ready #fight:not([data-orient="normal"]) .h-down .h-set { padding: 7px 14px; font-size: 11px; }
}
@media (orientation: landscape) { @container (max-height: 300px) {
  .phase-ready .h-down { flex-direction: column !important; gap: 4px !important; }
  .phase-ready .h-down .h-move { font-size: 17px !important; min-height: 0; }
  .phase-ready .h-down .h-set { padding: 7px 14px !important; font-size: 11px !important; margin-top: 0; }
} }
/* 0.2.94: pause a little more blue */
:root:not(.x) { --break-bg: #14304a; }
.phase-break .bar { background: #0e2234 !important; }
.eco { --break-bg: #000; }
/* Prêt ?: the coming chess clocks in full view, the player to move lit; only Prêt ? in the middle */
.paused.await .h-in > *:not(.h-card) { opacity: 1 !important; }
.paused.await .h-in > .h-card { display: none !important; }
#pause-menu.ready .pm-main { grid-template-columns: 1fr !important; }
.pm-tgs[hidden] { display: none !important; }
.await .h-clock, .await .h-name { visibility: visible !important; }
.phase-ready .bar { --rb: min(54px, 11.4vw); }
/* 0.2.96: timed pause, → next round beside ⏸ instead of the timer; no ⏭ in the pause menu. */
.pm-main { grid-template-columns: 54px minmax(0, 1fr); }
.bar-next { grid-column: 3; justify-self: end; display: inline-flex; align-items: center; gap: 6px; height: 48px; padding: 0 16px;
  background: transparent; border: 1px solid var(--hair); border-radius: 999px; color: var(--bone); font-size: 24px; white-space: nowrap; touch-action: manipulation; }
.bar-next .ic { width: 20px; height: 20px; margin: 0; color: var(--text-2); }
.bar-next:active { transform: scale(.97); }
.bar-next[hidden] { display: none; }
@media (max-width: 380px) { .bar-next { height: 42px; padding: 0 10px; gap: 3px; font-size: 20px; } .bar-next .ic { width: 16px; height: 16px; } }
/* 0.2.97: chess round, timer and → next both beside ⏸. */
.bar.next-t { grid-template-columns: auto minmax(0, 1fr) auto auto auto; }
.bar.next-t .bar-next { grid-column: 4; }
.bar.next-t .bar-btn { grid-column: 5; }
@media (max-width: 380px) { .bar.next-t { gap: 6px; } .bar.next-t .bar-timer { font-size: 22px; } }
/* 0.2.99: → next compact so the frieze keeps its size. */
.bar-next { height: 44px; padding: 0 10px; gap: 2px; font-size: 21px; }
.bar-next .ic { width: 14px; height: 14px; }
.bar.next-t { gap: 8px; }
@media (max-width: 380px) { .bar-next { height: 40px; padding: 0 7px; gap: 1px; font-size: 19px; } .bar-next .ic { width: 12px; height: 12px; } .bar.next-t { gap: 5px; } .bar.next-t .bar-timer { font-size: 24px; } }
/* 0.2.100: the clock button shows its three settings: bone, red, blue. */
.phase-ready button.ri-times .ic { transform: translateY(-12%); }
.ri-marks { position: absolute; left: 50%; top: 77%; transform: translate(-50%, -50%); display: flex; align-items: center; gap: calc(var(--rb) * .07); pointer-events: none; }
.ri-marks i { display: block; width: calc(var(--rb) * .085); height: calc(var(--rb) * .085); }
.ri-marks .rm-chess { background: var(--bone); transform: rotate(45deg) scale(.86); }
.ri-marks .rm-box { background: var(--red); border-radius: 50%; }
.ri-marks .rm-pause { width: calc(var(--rb) * .14); height: 2px; background: var(--blue); }
.ri-marks .off { opacity: .3; }
.phase-ready button.ri-times { position: relative; }
.ri-marks { gap: 5px; } .ri-marks i { width: 6px; height: 6px; } .ri-marks .rm-pause { width: 9px; height: 2px; }
/* 0.2.101: side views, the flag of each half sits by the middle bar (symmetric). */
#fight[data-orient="right"] .half.top .illegal-wrap,
#fight[data-orient="left"] .half.bottom .illegal-wrap { right: auto !important; left: 12px !important; flex-direction: row !important; }
/* 0.2.102: clock button = thick ring in three arcs (bone chess, red boxing, blue pause), bigger clock. */
.ri-marks { display: none; }
.phase-ready button.ri-times { border-color: transparent !important; }
.phase-ready button.ri-times .ic { transform: none; width: calc(var(--rb) * .6) !important; height: calc(var(--rb) * .6) !important; position: relative; z-index: 1; }
.ri-ring { --cb: var(--red); --cp: var(--blue); position: absolute; inset: -1px; border-radius: 50%; pointer-events: none;
  background: conic-gradient(from -60deg, var(--bone) 0 112deg, transparent 112deg 120deg, var(--cb) 120deg 232deg, transparent 232deg 240deg, var(--cp) 240deg 352deg, transparent 352deg);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 4.5px)); mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 4.5px)); }
.ri-ring.no-box { --cb: rgba(217, 72, 59, .28); }
.ri-ring.no-pause { --cp: rgba(134, 188, 210, .28); }
#btn-feedback { text-decoration: none; display: flex; align-items: center; justify-content: center; margin-top: 14px; }
/* 0.2.106: the referee count looks the same in every orientation: small clock in the
   middle, the hands right beside it, sized to the half so they never leave it. */
.h-move .hand { width: min(130px, 26vw, 26cqh); }
#fight:not([data-orient="normal"]) .half.countdown .h-clock { font-size: clamp(40px, 12vw, 72px); }
#fight:not([data-orient="normal"]) .h-move .hand { width: min(130px, 26cqw); }
#fight:not([data-orient="normal"]) .half.countdown .h-in { grid-template-rows: minmax(0, 1fr) auto auto minmax(0, 1fr); }
#fight:not([data-orient="normal"]) .half.countdown .h-up { grid-row: 1; align-self: end; }
#fight:not([data-orient="normal"]) .half.countdown .h-clock { grid-row: 2; }
#fight:not([data-orient="normal"]) .half.countdown .h-down { grid-row: 3; }
