feat(menu): in-progress game card replaces mode picker

When /api/state shows a live game, the home page now hides the mode
cards + setup form and shows an 'active-card' instead: ROUND IN
PROGRESS header with pulsing crimson dot, a diagonal 'LIVE' stamp,
white/black seat panels (agent / model / persona), VS divider with
'who's thinking' status, a gold WATCH LIVE button that routes to
/ai-vs-ai (or /play if either side is human), and a crimson ABORT
CURRENT ROUND escape hatch. menu.js polls every 3s so the meta strip
(move count, current thinker) stays fresh and the picker comes back as
soon as the game ends.

CSS housekeeping:
- Global [hidden] { display: none !important } — without it CSS rules
  like .modes { display: grid } override the HTML hidden attribute and
  the picker bled through the active-card.
- New tokens reuse the existing palette: gold for the watch CTA + meta,
  crimson for the LIVE stamp + abort, dashed rule + bone tones for
  seat borders. No new fonts or colors introduced — matches the
  Major Mono Display / JetBrains Mono tournament-bulletin style.
This commit is contained in:
ai-chess
2026-05-15 04:10:46 +03:00
parent 2038ec95c9
commit e23a07f07b
3 changed files with 249 additions and 3 deletions
+128
View File
@@ -26,6 +26,7 @@
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body {
margin: 0;
background: radial-gradient(ellipse at 50% -10%, #1e1e24 0%, var(--ink) 60%) fixed;
@@ -119,6 +120,133 @@ html, body {
font-style: italic;
}
/* ---------- ACTIVE GAME CARD (in-progress) ---------- */
.active-card {
position: relative;
background:
linear-gradient(180deg, rgba(192,160,96,0.08) 0%, rgba(15,15,18,0) 70%),
var(--paper);
border: 1px solid var(--gold-dim);
border-radius: 6px;
padding: 26px 28px 22px;
margin-bottom: 32px;
box-shadow: 0 30px 80px -40px rgba(192,160,96,0.45);
overflow: hidden;
animation: setup-in 0.35s ease both;
}
.active-card::after {
content: "LIVE";
position: absolute;
top: 14px; right: -36px;
background: var(--crimson); color: #fff;
font-size: 10px; font-weight: 800; letter-spacing: 0.4em;
padding: 3px 40px;
transform: rotate(35deg);
box-shadow: 0 6px 14px -6px var(--crimson);
}
.active-head {
display: flex; align-items: baseline; gap: 12px;
border-bottom: 1px dashed var(--rule);
padding-bottom: 14px; margin-bottom: 18px;
font-size: 11px; letter-spacing: 0.32em; text-transform: uppercase;
color: var(--gold);
}
.active-pulse {
display: inline-block; width: 8px; height: 8px;
background: var(--crimson); border-radius: 50%;
animation: pulse-dot 1.4s ease-in-out infinite;
align-self: center;
}
.active-meta { margin-left: auto; opacity: 0.55; letter-spacing: 0.16em; color: var(--bone-dim); font-size: 11px; }
.active-vs {
display: grid;
grid-template-columns: 1fr 96px 1fr;
gap: 18px; align-items: stretch;
margin-bottom: 22px;
}
.seat {
display: flex; flex-direction: column; gap: 4px;
padding: 14px 18px;
border: 1px solid var(--rule);
border-radius: 4px;
background: rgba(0,0,0,0.18);
position: relative;
}
.seat-white { border-left: 3px solid var(--bone); }
.seat-black { border-right: 3px solid var(--bone-dim); text-align: right; }
.seat-pip {
position: absolute; top: 14px; font-size: 14px; opacity: 0.7;
}
.seat-white .seat-pip { left: 18px; color: var(--bone); }
.seat-black .seat-pip { right: 18px; color: var(--bone-dim); }
.seat-name {
font-size: 22px; font-weight: 800; letter-spacing: 0.06em;
text-transform: uppercase;
margin-left: 20px; /* under the pip */
}
.seat-black .seat-name { margin-left: 0; margin-right: 20px; }
.seat-sub {
font-size: 11px; color: var(--gold); letter-spacing: 0.08em;
margin-left: 20px;
}
.seat-black .seat-sub { margin-left: 0; margin-right: 20px; }
.seat-persona {
font-size: 11px; color: var(--bone-dim); opacity: 0.7;
margin-top: 2px;
margin-left: 20px;
font-style: italic;
}
.seat-black .seat-persona { margin-left: 0; margin-right: 20px; }
.active-divider {
display: flex; flex-direction: column; align-items: center; justify-content: center;
gap: 8px;
}
.active-vs-label {
font-size: 28px; font-weight: 800; color: var(--crimson);
letter-spacing: 0.1em;
}
.active-turn {
font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase;
color: var(--bone-dim); text-align: center;
}
.active-actions {
display: flex; gap: 16px; align-items: center;
margin-top: 8px;
}
.watch-btn {
display: inline-flex; align-items: center; gap: 14px;
background: var(--gold); color: #1a1410;
text-decoration: none;
padding: 12px 32px;
font-size: 15px; font-weight: 800; letter-spacing: 0.2em;
border-radius: 3px;
transition: filter 0.15s, transform 0.1s;
box-shadow: 0 8px 28px -10px var(--gold);
}
.watch-btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.watch-btn .kbd {
font-size: 11px; opacity: 0.7;
border: 1px solid rgba(0,0,0,0.3); padding: 1px 6px; border-radius: 2px;
}
.active-abort {
background: transparent; border: 1px solid var(--crimson-dim);
color: var(--crimson); padding: 8px 16px;
font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase;
cursor: pointer; border-radius: 3px;
font-family: inherit;
transition: background 0.15s, color 0.15s;
}
.active-abort:hover { background: var(--crimson-dim); color: #ffe5e5; }
.active-foot {
margin: 18px 0 0; padding-top: 14px;
border-top: 1px dashed var(--rule);
font-size: 11px; color: var(--ash);
letter-spacing: 0.04em; font-style: italic;
}
/* ---------- MODE CARDS ---------- */
.modes {
display: grid;