:root {
  --bg: #10131c;
  --panel: #191e2a;
  --surface: #202635;
  --line: #353c4c;
  --ink: #f7f5f0;
  --muted: #bdc3d1;
  --accent: #ff8473;
  --accent-ink: #261416;
  --soft-accent: #ffb29e;
}

body {
  background: radial-gradient(ellipse at 65% -18%, #34304a 0, transparent 43rem), var(--bg);
}

main, .bar, footer { width: min(1280px, calc(100% - 3rem)); }
main { padding-block: 32px 42px; }
main:focus { outline: none; }
header { background: #151923; }
.bar { height: 70px; }
header nav { gap: clamp(12px, 2.4vw, 32px); }
header nav button, .find { background: #202635; border-color: var(--line); }
footer { color: var(--muted); }
.kicker {
  display: flex; align-items: center; gap: 9px; margin-bottom: 7px;
  font-size: 12px; letter-spacing: .14em; color: #d7bdc5;
}
.kicker::before { content: ""; width: 17px; height: 2px; background: var(--accent); transform: skewX(-24deg); }
.kicker i { display: none; }
h1 { font-size: clamp(50px, 6vw, 84px); letter-spacing: -.025em; }
h1 em { color: var(--accent); }
.page-h { font-size: clamp(45px, 5.1vw, 73px); }
.button, .link { min-height: 40px; }
.button { display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; background: var(--accent); color: var(--accent-ink); }
.button:hover { border-color: #ffc3b4; background: #ffc3b4; }
.link { color: var(--soft-accent); }
a.link { min-height: 0; }
.back { font-size: 14px; color: var(--soft-accent); }
input, textarea, select { background: #161b26; }
select { text-overflow: ellipsis; }
dialog { border-color: #515a70; background: #1b202d; box-shadow: 0 16px 65px #03040a90; }
dialog::backdrop { background: #080a12df; }
dialog .close { background: #2a3141; border-color: #515a70; }
dialog h2 { font-size: clamp(24px, 4.3vw, 32px); overflow-wrap: anywhere; }

.selection-steps {
  display: flex; gap: 8px; flex-wrap: wrap; list-style: none; margin: 0; padding: 0;
  font-size: 14px; color: var(--muted);
}
.selection-steps li {
  border: 1px solid var(--line); border-radius: 100px; padding: 6px 13px;
  align-self: center; white-space: nowrap;
}
.selection-steps [aria-current] { color: #ffd6cb; border-color: #bc746e; background: #482d3a; }
.selection-steps a { text-decoration: underline; text-underline-offset: 3px; }
.select-heading { margin-bottom: 22px; align-items: end; }
.selection-intro { margin: 9px 0 0; max-width: 60ch; color: var(--muted); }
.selection-page { padding-top: 23px; }
.select-layout { grid-template-columns: minmax(240px, .97fr) minmax(0, 2.2fr); gap: 18px; }
.stage {
  min-height: 428px; border: 1px solid #81606d; border-radius: 16px;
  background: radial-gradient(ellipse at 38% 20%, #b36f73, transparent 76%), linear-gradient(140deg, #59415a, #2e2d47 70%);
}
.stage-grid {
  opacity: .53;
  background: repeating-linear-gradient(132deg, transparent 0 31px, #ffe5d526 32px 33px), linear-gradient(158deg, transparent 43%, #ffbeaa40 44% 50%, transparent 51%);
}
.stage-art { object-position: center 14%; }
.stage::after { inset: 30% 0 0; background: linear-gradient(transparent 26%, #14142092 67%, #11131ef5 100%); }
.stage-label {
  background: #19202be8; border: 1px solid #af8190; border-radius: 7px;
  margin: 16px; padding: 7px 11px; font-size: 11px; color: #ffe4df;
}
.stage-name { left: 23px; bottom: 24px; }
.stage-name strong { font-size: clamp(41px, 4.9vw, 76px); }
.stage-name .long-name { font-size: clamp(31px, 3.7vw, 59px); }
.stage-coverage { background: #1e273ad9; color: #f8dfde; border-color: #8b7e96; }
.board { border-radius: 16px; padding: 16px; background: linear-gradient(150deg, #1e2432, #161a24 75%); }
.board-top { margin-bottom: 12px; }
.board-top h2 { font-size: 28px; }
.board-top small { background: #30394d; color: #dee5f5; }
.find { border-radius: 8px; padding: 4px 10px; }
.find input { width: min(17vw, 185px); font-size: 14px; }
.tiles { grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 7px; }
.tile {
  aspect-ratio: 1.12; border-radius: 7px; border-color: #444e62;
  background: linear-gradient(145deg, #50566d, #272b3c);
}
.tile::after { background: linear-gradient(transparent 39%, #111623d9 84%, #11151ffc); }
.tile span { bottom: 5px; font-size: clamp(11px, 1vw, 15px); }
.tile.lit { border-color: #ffd4c6; box-shadow: 0 0 0 1px #e88279 inset; }
.tile:hover:enabled { border-color: var(--accent); }
.roster-empty { grid-column: 1 / -1; }
.roster-controls { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.roster-controls small { color: #ffbfaa; font-size: 12px; }
.segmented { display: flex; border: 1px solid var(--line); border-radius: 8px; padding: 3px; gap: 3px; background: #151923; }
.segmented button { min-height: 34px; border-radius: 5px; padding: 4px 10px; font-size: 13px; color: var(--muted); }
.segmented [aria-pressed="true"] { background: #343d51; color: var(--ink); }
.recent-matchups { display: flex; align-items: center; gap: 13px; flex-wrap: wrap; margin: 18px 0 15px; }
.recent-matchups h2 { font-size: 15px; }
.recent-matchups>div { display: flex; flex-wrap: wrap; gap: 7px; }
.recent-matchups a {
  display: flex; align-items: center; gap: 7px; padding: 5px 9px;
  min-height: 40px; border-radius: 7px; border: 1px solid var(--line); background: #202634; font-size: 13px;
}
.recent-matchups a:hover { border-color: var(--accent); }
.recent-matchups .fighter-badge { gap: 5px; }
.recent-matchups img { width: 24px; }
.recent-matchups a>span:nth-child(2) { color: var(--accent); }
.featured-matchups { margin-top: 32px; }
.featured-matchups h2 { font-size: 22px; margin-bottom: 12px; }
.featured-grid>a { min-height: 48px; background: var(--panel); border-radius: 8px; padding: 9px 11px; }
.featured-grid>a:hover { background: var(--surface); }
@media(min-width: 691px) {
  .select-layout:has([data-roster="guides"][aria-pressed="true"]) .stage { min-height: 325px; }
  .select-layout:has([data-roster="guides"][aria-pressed="true"]) .board { align-self: start; }
  .select-layout:has([data-roster="guides"][aria-pressed="true"]) .tiles { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

.duel-hero {
  height: clamp(214px, 23vw, 297px); border-color: #525970; border-radius: 16px;
  background: radial-gradient(ellipse at 25% 16%, #4a4261, transparent 57%), radial-gradient(ellipse at 78% 20%, #7d4652, transparent 66%), #1a2130;
}
.duel-hero::after { background: linear-gradient(90deg, #10131c16 0, #111826b0 39%, #111826b0 61%, #10131c16 100%), linear-gradient(0deg, #131622ab, transparent 53%); }
.duel-title h1 { font-size: clamp(53px, 7.5vw, 106px); }
.duel-title>span { background: #272431; border: 1px solid #8a6d79; padding: 4px 10px; border-radius: 20px; color: #ffe4de; }
.duel-tabs { padding: 5px; margin-top: 12px; gap: 6px; border: 1px solid var(--line); border-radius: 11px; background: #181d2a; }
.duel-tabs a {
  padding: 9px 14px; border: 0; border-radius: 6px; font-size: 15px; font-weight: 700;
}
.duel-tabs a[aria-current] { color: #ffcec1; background: #472d3b; }
.duel-tabs a:hover { background: #252c3b; }
.matchup-nav { display: flex; align-items: stretch; }
.matchup-nav a { flex: 1; display: grid; align-content: center; gap: 2px; min-height: 60px; }
.matchup-nav a strong { line-height: 1.2; }
.matchup-nav a small { font-size: .8125rem; font-weight: 500; color: var(--muted); }
.matchup-nav a[aria-current] small { color: #f1c4bd; }
.matchup-jump-target { scroll-margin-top: 18px; }
.matchup-jump-target .featured-plan { margin-bottom: 12px; }
.training-intro { margin: 0 0 12px; color: var(--muted); }
.matchup-content { gap: clamp(20px, 3.2vw, 43px); }
.duel-tools { flex-wrap: wrap; justify-content: center; gap: 6px; }
.note-field { margin: 12px 0; }
.note-field .field { gap: 5px; }
.note-field textarea { width: 100%; min-height: 6rem; resize: vertical; }
.note-status { display: block; color: var(--muted); margin-top: 5px; font-size: .8125rem; }
.note-panel { margin: 10px 0; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.note-panel summary { color: var(--soft-accent); font-size: .875rem; font-weight: 700; }
.note-panel .tools { margin-bottom: 0; }
.saved-notes { margin-top: 18px; }
.saved-notes h3 { margin: 0; }
.overview-heading {
  padding: clamp(16px, 2.6vw, 29px); border-radius: 12px; border: 1px solid #515870;
  background: radial-gradient(ellipse at 100% 8%, #42354a, transparent 70%), #202735;
}
.overview-heading h2 { font-size: clamp(25px, 3vw, 37px); }
.overview-heading p { font-size: 16px; max-width: 63ch; margin: 9px 0; }
.overview-heading .link { display: inline-block; margin-top: 4px; }
.profile-outline, .profile-references, .single-throws {
  margin-top: 12px; padding: 11px 14px; border: 1px solid var(--line);
  border-radius: 9px; background: var(--panel); font-size: 14px;
}
.profile-outline summary, .profile-references summary, .single-throws summary { font-weight: 700; }
.profile-outline ul { margin: 8px 0 0; padding-left: 17px; }
.profile-outline button { text-align: left; color: var(--soft-accent); min-height: 32px; }
.profile-outline button:hover { text-decoration: underline; }
.profile-references .overview-footer { margin-top: 8px; }
.basics-link { display: inline-block; margin-top: 10px; }
.overview-card { border-radius: 11px; background: var(--panel); }
.profile-card { border-left: 3px solid #a77485; padding: clamp(16px, 2vw, 23px); scroll-margin-top: 18px; }
.profile-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.profile-card .profile-kind { color: #ffbaa7; }
.profile-card>p:not(.profile-kind) { font-size: 16px; margin-top: 7px; color: #d4d8e4; }
.profile-card-footer { margin-top: 14px; }
.rep-strip .rep { background: #202838; border-color: #4d5970; min-height: 41px; }
.rep-strip .rep:hover { background: #343246; border-color: #e5a08e; }
.matchup-moves .rep { min-height: 44px; }
.matchup-moves h2 { margin-bottom: 9px; }
.matchup-moves>a { display: inline-block; margin-top: 12px; }
.profile-drill, .featured-plan { background: #302a3e; border-color: #725a72; }

.utility-heading { display: flex; justify-content: space-between; gap: 11px; align-items: end; }
.library-filters {
  display: grid; grid-template-columns: minmax(155px, 1.55fr) repeat(4, minmax(110px, 1fr)) auto;
  padding: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 11px;
}
.library-filters input, .library-filters select { width: 100%; min-width: 0; height: 44px; font-size: 14px; }
.library-filters .link { padding-inline: 8px; }
.filter-hint { color: var(--muted); font-size: 14px; margin: -10px 0 14px; }
.library-results { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.library-results .count { padding: 13px 15px; background: #242b3a; color: var(--ink); }
.library-row {
  grid-template-columns: 1.05fr 1.13fr 1.9fr 1.28fr;
  gap: 10px; padding: 10px 15px; min-height: 60px; border-color: var(--line); overflow-wrap: anywhere;
}
.library-row:hover { background: #262d3c; }
.library-row .library-name { display: flex; align-items: center; gap: 7px; font-weight: 600; color: var(--ink); }
.library-row img { width: 32px; height: 32px; border-radius: 5px; background: #424a60; }
.library-frames { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.library-frames small { display: block; font: 600 13px/1.25 ui-monospace, monospace; color: #f6eadf; }
.library-frames small span { display: block; font: 400 12px/1.3 var(--body); color: var(--muted); }
.pagination { display: flex; align-items: center; justify-content: space-between; padding: 7px 15px; gap: 8px; font-size: 14px; }
.pagination button:disabled { opacity: .46; }

.reader .outline {
  border: 1px solid var(--line); border-radius: 10px; background: var(--panel); padding: 13px;
}
.reader .outline button[aria-current] { background: #472e40; }
.reading { border: 1px solid var(--line); border-radius: 12px; background: #161b26; padding: clamp(14px, 2.3vw, 28px); }
.move-facts, .metrics div { background: #222a3a; }
.metrics div { border: 1px solid #384459; }
.player { border-color: #3d465a; }

.training-group h3 { font-size: 20px; }
.training-group > p { max-width: 62ch; margin-bottom: 12px; }
.training-shared { padding: 14px; border: 1px solid #57617a; border-radius: 11px; background: #1c2332; }
.training-shared .drill:last-child { margin-bottom: 0; }
.drill-reference { display: inline-block; margin-top: 10px; font-size: .875rem; }
.drill-inside h4:first-child { margin-top: 0; }
.training-meter { display: flex; align-items: center; gap: 13px; }
.training-meter p { margin: 0; white-space: nowrap; }
.training-meter progress { width: min(280px, 54%); accent-color: var(--accent); }
#clock:not([hidden]) {
  position: fixed; right: 16px; bottom: 14px; z-index: 7; margin: 0;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  max-width: min(520px, calc(100vw - 32px)); border: 1px solid #a88389; border-radius: 10px; background: #262c3e;
  box-shadow: 0 8px 24px #04060b80; padding: 8px 12px; font-size: 14px;
}
#clock b { min-width: 0; overflow-wrap: anywhere; }
#notice { bottom: 76px; }

.throw-fighter, .chain-card { background: var(--panel); border-color: var(--line); }
.throw-fighter:hover { background: var(--surface); }
.chain-tree>.chain-card { background: #302a40; border-color: #8b6f89; }
.chain-card p { color: var(--muted); font-size: 14px; }
.chain-card code { font-size: 13px; }
.chain-caption { align-items: center; }
.quiz-entry { border-color: #876d8c; background: #352e47; border-radius: 10px; }
.single-throws>div { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.quiz-break { display: inline-block; padding: 1px 7px; margin-left: 6px; color: #ffcee2; background: #483b54; border-radius: 5px; font-size: 12px; }

@media(max-width: 1030px) {
  .tiles { grid-template-columns: repeat(8, minmax(0, 1fr)); }
  .select-layout { grid-template-columns: minmax(208px, .87fr) minmax(0, 2fr); }
  .library-filters { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media(max-width: 690px) {
  main, .bar, footer { width: calc(100% - 26px); }
  main { padding-top: 18px; }
  .selection-page { padding-top: 18px; }
  .bar { height: 58px; }
  header nav { gap: 10px; font-size: 13px; }
  header nav button { min-height: 35px; }
  .select-heading { align-items: start; gap: 10px; margin-bottom: 13px; }
  .selection-steps { gap: 6px; font-size: 12px; }
  .selection-steps li { padding: 4px 9px; }
  .select-layout { display: block; }
  .stage { height: 126px; min-height: 0; border-radius: 10px; margin-bottom: 10px; }
  .stage::after { inset: 0; background: linear-gradient(90deg, #171523c4, transparent 76%); }
  .stage-label { margin: 9px 12px; padding: 3px 7px; font-size: 9px; }
  .stage-name { left: 12px; bottom: 9px; max-width: 59%; }
  .stage-name strong { font-size: 33px; }
  .stage-name .long-name { font-size: 23px; }
  .stage-name .stage-coverage { margin-top: 4px; }
  .board { padding: 10px; border-radius: 11px; }
  .board-top h2 { font-size: 23px; }
  .board-top .find input { width: 100px; font-size: 13px; }
  .tiles { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 5px; }
  .tile { aspect-ratio: 1; }
  .tile span { font-size: clamp(10px, 2.6vw, 14px); bottom: 3px; }
  .featured-grid { gap: 6px; }
  .duel-hero { height: 177px; border-radius: 11px; }
  .duel-title h1 { font-size: clamp(41px, 9vw, 60px); }
  .duel-title>span { font-size: 9px; }
  .duel-tabs { display: grid; grid-auto-columns: 1fr; grid-auto-flow: column; gap: 3px; margin-top: 9px; }
  .duel-tabs a { min-width: 0; text-align: center; align-content: center; font-size: 13px; padding: 8px 4px; overflow-wrap: anywhere; }
  .matchup-nav { display: grid; grid-auto-columns: 1fr; }
  .matchup-nav a { min-height: 58px; font-size: .875rem; }
  .matchup-nav a small { font-size: .75rem; }
  .matchup-nav:has(a:nth-child(4)) { grid-auto-flow: row; grid-template-columns: repeat(2,minmax(0,1fr)); }
  .profile-card-footer .rep { min-height: 44px; }
  .library-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
  .library-filters #lib-query { grid-column: 1 / -1; }
  .library-row {
    grid-template-columns: 1.08fr 1.17fr minmax(96px, 1.24fr);
    grid-template-areas: "char cmd frames" "title title frames"; gap: 4px 7px; padding: 9px 10px;
  }
  .library-name { grid-area: char; }.library-command { grid-area: cmd; }.library-title { grid-area: title; }.library-frames { grid-area: frames; }
  .library-row .library-frames small { font-size: 12px; }.library-row img { width: 23px; height: 23px; }
  .library-row .library-frames small span { font-size: 11px; }
  .utility-heading { flex-wrap: wrap; }
  .reader .outline { gap: 7px; }
}
@media(max-width: 410px) {
  .tiles { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .single-throws>div { grid-template-columns: 1fr; }
  .chain-branches { margin-left: 1px; padding-left: 10px; }
  .chain-branches>li::before { left: -10px; width: 9px; }
  .chain-branches>li:not(:last-child)::after { left: -10px; }
  .chain-caption { flex-wrap: wrap; }
}
@media(max-width: 350px) {
  .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* Carnet compétitif */
.lab-toolbar { display:flex; flex-wrap:wrap; gap:8px 14px; align-items:end; }
.lab-toolbar .link { padding:0; }
.lab-toolbar .field { min-width:0; }
.lab-form-fields { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
.lab-form-fields input, .lab-form-fields select { width:100%; min-width:0; }
.lab-matrix { margin:12px 0; }
.lab-matrix summary { font-weight:700; }
.lab-matrix summary small { color:var(--muted); font-weight:400; margin-left:8px; }
.lab-matrix .lab-toolbar { margin:7px 0; }
.lab-scroll { max-width:100%; overflow-x:auto; margin:9px 0; }
.lab-table { border-collapse:collapse; width:100%; min-width:515px; text-align:left; font-size:.875rem; }
.lab-table caption { text-align:left; color:var(--muted); margin-bottom:5px; }
.lab-table th, .lab-table td { padding:9px 10px; border-bottom:1px solid var(--line); vertical-align:top; }
.lab-table thead { background:#252d40; }
.lab-table small { display:block; color:var(--muted); margin-top:3px; }
.lab-table .link { font-size:.8125rem; }
.lab-table caption.sr-only { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
.lab-status { font-weight:700; }
.lab-status-frames, .lab-status-documented { color:#b8d1fc; }
.lab-status-lab { color:#a9dfc0; }
.lab-status-hypothesis { color:#edc99d; }
.dex-conditions { margin-top:8px; color:var(--muted); font-size:.875rem; }
.dex-conditions p { white-space:pre-line; }
.dex-conditions summary { color:var(--soft-accent); }
.punish-list>li .punish-compare { grid-column:1/-1; }
.punish-inline .punish-compare { flex-basis:100%; }
.punish-compare { padding:4px 0 8px; font-size:.875rem; min-width:0; }
.punish-compare[open] { margin-top:6px; padding:10px; border:1px solid var(--line); border-radius:7px; }
.punish-compare summary { color:var(--soft-accent); }
.punish-compare .field { max-width:260px; margin-top:7px; }
.drill-followup { padding:10px; background:var(--panel); border-radius:7px; }
.training-meter { flex-wrap:wrap; }
.training-meter p { white-space:normal; }
.duel-tools [aria-pressed="true"] { background:#613c49; border-color:#ffaf96; }
.tournament-link { margin-top:12px; }
.tournament-list { display:grid; gap:10px; margin-top:14px; }
.tournament-list p { white-space:pre-wrap; }
.matchup-punish { margin-top:18px; }
@media(max-width:600px) {
  .matchup-nav:has(a:nth-child(5)) { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .lab-form-fields { grid-template-columns:minmax(0,1fr); }
}
.throw-clip { display:block; width:100%; max-height:56vh; background:#111723; border-radius:8px; }
.matrix-table { min-width:670px; }
