Make Sokko TCG's Current Race fairer and explain each race afterwards
All checks were successful
Validate and deploy Sokko G / validate (push) Successful in 23m50s
Validate and deploy Sokko G / deploy (push) Successful in 18s

Players kept finishing third or fourth: opponents were played better than
their owners would (always the best runner, half of them with perfect
boosts and no reaction time), and the Watchers recruited knowing the day's
circuit, which players never see.

- A player who already ran today now comes back as a ghost with their real
  race; other teams play like an attentive player (best runner, each
  teammate given in a zone of its best stat after a reaction delay). The
  Watchers recruit blind; only the strong one plays attentively. The
  administration counts the ghosts.
- The rule that a boost keeps the value of the zone where it was given is
  now stated before and during the race.
- A boosting teammate is greyed at once with "Élan donné", a 1.5 s bar and
  its locked value; the others dim while the player has to wait.
- The result shows the place as a medal, the finish as lanes (with a gold
  silhouette at the best boosts), the three times, each boost placed on
  the circuit (dashed in the teammate's best stat when it was worth more
  elsewhere), a sentence per boost to place better and, when clearly
  faster, another runner. The best boosts are searched in the browser.
- A development-only "Recourir (dev)" button erases the race and keeps the
  team.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Shinuwa 2026-11-30 16:18:18 +01:00
parent 8253f74c90
commit 52df57f781
16 changed files with 603 additions and 102 deletions

View file

@ -64,7 +64,15 @@
.nebula-race-mate:focus-visible { outline: 2px solid var(--color-text-primary); outline-offset: 2px; }
.nebula-race-mate:hover:not([aria-disabled]) { box-shadow: 0 0 0 2px var(--color-text-primary); }
.nebula-race-mate[aria-disabled] { cursor: default; }
.nebula-race-mate[data-active] { box-shadow: 0 0 0 3px var(--color-text-primary), 0 0 18px rgba(255, 255, 255, 0.55); }
// Élan en cours : l'équipier est déjà « dépensé » (grisé), avec son étiquette et le temps qui reste ; les autres attendent.
.nebula-race-mate[data-active] { box-shadow: 0 0 0 3px var(--color-text-primary); }
.nebula-race-mate[data-active] .nebula-race-mate-art img { filter: grayscale(1) brightness(0.5); }
.nebula-race-mate[data-active] strong { color: var(--color-text-primary); }
.nebula-race-mate-boost { position: absolute; inset: auto 0 0; display: grid; gap: 4px; padding: var(--space-1) var(--space-2) 0; background: rgba(7, 9, 19, 0.8); color: var(--color-text-primary); font-size: var(--font-size-xs); font-weight: 800; }
.nebula-race-mate-boost i { display: block; height: 4px; background: var(--color-text-primary); transform-origin: left; animation: nebula-race-boost-left var(--boost-ms) linear forwards; }
@keyframes nebula-race-boost-left { to { transform: scaleX(0); } }
@media (prefers-reduced-motion: reduce) { .nebula-race-mate-boost i { animation: none; } }
.nebula-race-helpers[data-boosting] .nebula-race-mate:not([data-active], [data-used]) { opacity: 0.55; }
.nebula-race-mate[data-used] { filter: grayscale(1) brightness(0.45); }
.nebula-race-mate-art { position: relative; display: block; flex: none; overflow: hidden; background: var(--color-bg-deep); aspect-ratio: 1.5; }
.nebula-race-mate-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 35%; }
@ -76,20 +84,98 @@
.nebula-race-help { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); color: var(--color-text-muted); font-size: var(--font-size-sm); }
.nebula-race-arrived { font-size: var(--font-size-lg); font-weight: 700; }
.nds-panel.nebula-race-result, .nds-panel.nebula-race-interrupted { display: grid; gap: var(--space-3); justify-items: start; padding: var(--space-5); }
.nebula-race-result[data-place="1"] h3 { color: var(--color-success); }
.nds-panel.nebula-race-interrupted { display: grid; gap: var(--space-3); justify-items: start; padding: var(--space-5); }
// Résultat : la place en médaille et la récompense, puis l'arrivée en couloirs. Le bilan suit dans son propre panneau.
.nebula-race-outcome { display: grid; gap: var(--space-4); min-width: 0; }
.nebula-race-outcome :is(h4, h5) { margin: 0; }
.nds-panel.nebula-race-result { display: grid; gap: var(--space-4); padding: var(--space-5); border-color: rgba(246, 196, 83, 0.4); }
.nebula-race-result-head { display: flex; align-items: center; gap: var(--space-4); }
.nebula-race-result-head > div { display: grid; gap: var(--space-1); }
.nebula-race-result h3 { font-size: var(--font-size-2xl); }
.nebula-race-reward { color: var(--color-accent-gold); font-weight: 700; }
.nebula-race-ranking { display: grid; gap: var(--space-2); width: 100%; }
.nebula-race-ranking li { display: grid; grid-template-columns: 28px 44px minmax(0, 1fr) auto; gap: var(--space-3); align-items: center; padding: var(--space-2) var(--space-3); border: 1px solid var(--color-border); border-radius: var(--radius-md); }
.nebula-race-ranking li[data-player] { border-color: var(--color-text-primary); background: var(--color-bg-elevated); }
.nebula-race-ranking li > span:first-child { font-size: var(--font-size-lg); font-weight: 800; text-align: center; }
.nebula-race-ranking img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
.nebula-race-ranking li > span:nth-of-type(2) { display: grid; min-width: 0; }
.nebula-race-ranking small { overflow: hidden; color: var(--color-text-muted); text-overflow: ellipsis; white-space: nowrap; }
.nebula-race-ranking li > span:last-child { font-variant-numeric: tabular-nums; }
.nebula-race-result[data-place="1"] h3 { color: var(--color-accent-gold); }
.nebula-race-medal {
--medal: var(--color-text-muted);
display: grid; flex: none; grid-auto-flow: column; align-items: baseline; justify-content: center; width: 72px; height: 72px; padding-top: 16px; border: 3px solid var(--medal); border-radius: 50%;
background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--medal) 45%, transparent), color-mix(in srgb, var(--medal) 12%, var(--color-bg-deep)) 70%);
color: var(--color-text-primary); font-size: 2rem; font-weight: 800; line-height: 1;
box-shadow: 0 0 22px color-mix(in srgb, var(--medal) 35%, transparent);
}
.nebula-race-medal small { font-size: var(--font-size-sm); font-weight: 700; }
.nebula-race-result[data-place="1"] .nebula-race-medal { --medal: var(--color-accent-gold); }
.nebula-race-result[data-place="2"] .nebula-race-medal { --medal: #c9d1e3; }
.nebula-race-result[data-place="3"] .nebula-race-medal { --medal: #d08a52; }
.nebula-race-reward { display: flex; align-items: center; color: var(--color-accent-gold); font-weight: 700; }
.nebula-race-next { color: var(--color-text-muted); font-size: var(--font-size-sm); }
// Arrivée : un couloir par coureur, du premier au dernier, comme pendant la course. Chacun est placé selon son temps, le plus
// rapide contre la ligne d'arrivée en damier ; la silhouette dorée du joueur montre les meilleurs élans.
.nebula-race-finish { display: grid; overflow: hidden; border: 1px solid var(--color-border); border-radius: var(--radius-lg); background: var(--color-bg-deep); }
.nebula-race-finish li { --marker: 36px; display: grid; grid-template-areas: "place who track time"; grid-template-columns: 32px minmax(150px, 220px) minmax(0, 1fr) 84px; gap: var(--space-3); align-items: center; padding: var(--space-2) var(--space-3); }
.nebula-race-finish li + li { border-top: 1px solid var(--color-border); }
.nebula-race-finish li[data-player] { background: var(--color-bg-elevated); box-shadow: inset 4px 0 0 var(--color-text-primary); }
.nebula-race-finish-place { grid-area: place; font-size: var(--font-size-lg); font-weight: 800; text-align: center; }
.nebula-race-finish li:first-child .nebula-race-finish-place { color: var(--color-accent-gold); }
.nebula-race-finish-who { display: flex; grid-area: who; align-items: center; gap: var(--space-2); min-width: 0; }
.nebula-race-finish-who img { flex: none; width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.nebula-race-finish-who > span { display: grid; min-width: 0; }
.nebula-race-finish-who :is(strong, small) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nebula-race-finish-who small { color: var(--color-text-muted); font-size: var(--font-size-xs); }
.nebula-race-finish-track {
--span: calc(100% - var(--marker) - 12px);
position: relative; grid-area: track; height: 44px; border-radius: var(--radius-md);
background: repeating-conic-gradient(rgba(245, 247, 255, 0.3) 0 25%, transparent 0 50%) right / 12px 8px no-repeat, linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.05)), rgba(255, 255, 255, 0.02);
}
.nebula-race-finish-track::before { position: absolute; top: 50%; right: 12px; left: 0; border-top: 1px dashed rgba(255, 255, 255, 0.12); content: ""; }
.nebula-race-finish-track img { position: absolute; top: 4px; left: calc(var(--span) * var(--at)); width: var(--marker); height: var(--marker); border-radius: 50%; object-fit: cover; }
.nebula-race-finish-runner { border: 3px solid var(--color-text-muted); }
li[data-player] .nebula-race-finish-runner { border-color: var(--color-text-primary); }
.nebula-race-finish-ghost { border: 2px dashed var(--color-accent-gold); opacity: 0.5; filter: sepia(0.6); }
.nebula-race-finish-gap { position: absolute; top: 50%; left: calc(var(--span) * var(--from) + var(--marker) / 2); width: calc(var(--span) * (var(--to) - var(--from))); border-top: 2px dashed var(--color-accent-gold); }
.nebula-race-finish-time { display: grid; grid-area: time; font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.nebula-race-finish-time small { color: var(--color-accent-gold); font-size: var(--font-size-xs); font-weight: 600; white-space: normal; }
// Bilan : les trois temps, les élans posés sur le circuit, puis chaque équipier.
.nds-panel.nebula-race-review { display: grid; gap: var(--space-4); padding: var(--space-5); }
.nebula-race-review h4 { color: var(--color-text-secondary); font-size: var(--font-size-sm); letter-spacing: 0.04em; text-transform: uppercase; }
.nebula-race-review-times { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-4); }
.nebula-race-review-times li { position: relative; display: grid; gap: 2px; align-content: start; padding: var(--space-3) var(--space-4); border: 1px solid var(--color-border); border-radius: var(--radius-md); background: var(--color-bg-deep); }
// Une flèche relie chaque temps au suivant.
.nebula-race-review-times li + li::before { position: absolute; top: 50%; left: calc(-1 * var(--space-4)); width: var(--space-4); color: var(--color-text-muted); content: "→"; text-align: center; transform: translateY(-50%); }
.nebula-race-review-times span { color: var(--color-text-muted); font-size: var(--font-size-sm); }
.nebula-race-review-times strong { font-size: var(--font-size-xl); font-variant-numeric: tabular-nums; }
.nebula-race-review-times small { font-size: var(--font-size-xs); font-weight: 700; }
.nebula-race-review-times li[data-kind="plain"] strong { color: var(--color-text-secondary); }
.nebula-race-review-times li[data-kind="mine"] { border-color: var(--color-text-primary); }
.nebula-race-review-times li[data-kind="mine"] small { color: var(--color-success); }
.nebula-race-review-times li[data-kind="best"] { border: 1px dashed var(--color-accent-gold); }
.nebula-race-review-times li[data-kind="best"] :is(strong, small) { color: var(--color-accent-gold); }
.nebula-race-review-times li[data-perfect] { border-color: var(--color-success); }
.nebula-race-review-times li[data-perfect] :is(strong, small) { color: var(--color-success); }
// Circuit : les huit zones, et dans chacune les équipiers qui y ont donné leur élan.
.nebula-race-review-road { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 3px; }
.nebula-race-review-road li { display: grid; grid-template-rows: auto 1fr; min-width: 0; overflow: hidden; border-radius: var(--radius-md); background: color-mix(in srgb, var(--specialty) 10%, var(--color-bg-deep)); }
.nebula-race-review-zone { display: flex; align-items: center; justify-content: center; gap: 4px; min-width: 0; padding: var(--space-2) 4px; background: color-mix(in srgb, var(--specialty) 30%, var(--color-bg-deep)); color: var(--specialty); font-size: var(--font-size-xs); font-weight: 700; }
.nebula-race-review-zone > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nebula-race-review-given { display: flex; flex-wrap: wrap; align-content: flex-start; justify-content: center; gap: var(--space-2); min-height: 72px; padding: var(--space-2) 4px; }
.nebula-race-review-given > span { display: grid; justify-items: center; gap: 2px; }
.nebula-race-review-given img { width: 40px; height: 40px; border: 2px solid var(--specialty); border-radius: 50%; object-fit: cover; }
.nebula-race-review-given b { color: var(--specialty); font-size: var(--font-size-sm); }
.nebula-race-review-given [data-missed] img { border: 2px dashed var(--better); }
// Sous le circuit, une phrase par équipier dont l'élan valait plus ailleurs (ou n'a pas été donné) : où il aurait mieux servi.
.nebula-race-review-notes { display: grid; gap: var(--space-2); }
.nebula-race-review-notes li { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: var(--space-3); align-items: center; }
.nebula-race-review-notes p { color: var(--color-text-secondary); font-size: var(--font-size-sm); line-height: 1.5; }
.nebula-race-review-notes :is(strong, b) { color: var(--color-text-primary); }
.nebula-race-review-notes img { flex: none; width: 32px; height: 32px; border: 2px dashed var(--better); border-radius: 50%; object-fit: cover; }
.nebula-race-zone-name { display: inline-flex; align-items: center; gap: 3px; color: var(--specialty); font-weight: 700; white-space: nowrap; vertical-align: bottom; }
.nebula-race-zone-name .nebula-mask-icon { width: 15px; height: 15px; }
.nebula-race-review-runner { display: flex; align-items: center; gap: var(--space-4); padding: var(--space-3) var(--space-4); border: 1px dashed var(--color-border); border-radius: var(--radius-md); color: var(--color-text-secondary); line-height: 1.5; }
.nebula-race-review-runner img { flex: none; width: 64px; height: 64px; border: 2px solid var(--color-accent-gold); border-radius: var(--radius-md); object-fit: cover; object-position: 50% 35%; box-shadow: 0 0 14px rgba(246, 196, 83, 0.25); }
.nebula-race-review-runner strong { color: var(--color-text-primary); }
@container nebula-race (max-width: 760px) {
.nebula-race .nebula-team-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.nebula-race-circuit-road { grid-template-columns: minmax(0, 1fr); }
@ -103,6 +189,25 @@
.nebula-race-mate .nebula-team-band > span { font-size: var(--font-size-xs); }
}
// Les zones du bilan ne gardent que leur icône : le nom reste lu par les lecteurs d'écran.
@container nebula-race (max-width: 900px) {
.nebula-race-review-zone > span:last-child { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.nebula-race-review-zone .nebula-mask-icon { width: 18px; height: 18px; }
}
@container nebula-race (max-width: 640px) {
.nebula-race-finish li { grid-template-areas: "place who time" "track track track"; grid-template-columns: 28px minmax(0, 1fr) auto; row-gap: var(--space-1); }
.nebula-race-review-times { gap: var(--space-2); }
.nebula-race-review-times li { padding: var(--space-2) var(--space-3); }
.nebula-race-review-times li + li::before { content: none; }
.nebula-race-review-times strong { font-size: var(--font-size-lg); }
.nebula-race-review-given img { width: 30px; height: 30px; }
}
@container nebula-race (max-width: 440px) {
.nebula-race-review-times { grid-template-columns: minmax(0, 1fr); }
}
@container nebula-race (max-width: 520px) {
.nebula-race-zones li span { display: none; }
.nebula-race-helpers { grid-template-columns: repeat(2, minmax(0, 1fr)); }