ui-duel: even battlefield slots with few cards; keyword icons on two-keyword hand cards; game-over note wraps (#58)

Found by rendering duel-core's engine-wip mid-game locally.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-17 22:56:40 -05:00
co-authored by Claude Opus 5.5
parent 848cfbbaf1
commit 0f924b7732
3 changed files with 8 additions and 8 deletions
+1 -1
View File
@@ -81,7 +81,7 @@ export function DuelCardFace({ card, size = 'hand', state = {}, onClick, label,
{state.blocking && <span className="dface-flag block" aria-hidden="true"><Shield size={11} /></span>}
<span className="dface-title">{card.title}</span>
<span className="dface-bottom">
{size === 'board'
{size === 'board' || kwShown.length > 1
? kwShown.map(k => <span key={k} className="dface-kwicon" title={k}><KeywordIcon keyword={k} size={10} /></span>)
: kwShown.map(k => <span key={k} className="dface-chip">{k}</span>)}
<Stats card={card} />
+1 -1
View File
@@ -116,7 +116,7 @@ export function DuelTable({ view, legal, onAct, busy, error, onExit, onRecap }:
let secondary: { label: string; run: () => void } | null = null;
if (view.phase === 'over') {
// The engine's own game-over sentence (DUEL_DESIGN §8.2); the board never writes story text itself.
note = <><b>{view.winner === 'draw' ? 'Draw.' : view.winner === view.seat ? 'You won.' : 'You lost.'}</b> {view.log.at(-1)}</>;
note = <span><b>{view.winner === 'draw' ? 'Draw.' : view.winner === view.seat ? 'You won.' : 'You lost.'}</b> {view.log.at(-1)}</span>;
primary = onRecap ? { label: 'Battle recap', run: onRecap } : onExit ? { label: 'Done', run: onExit } : null;
if (onRecap && onExit) secondary = { label: 'Done', run: onExit };
} else if (busy) {
+6 -6
View File
@@ -25,12 +25,12 @@
.duel-stat.cites svg{color:var(--ctp-blue)}
/* Battlefields: one scrollable row per side; 5 cards fit 344 px without scrolling. */
.duel-row{display:grid;grid-auto-flow:column;grid-auto-columns:minmax(62px,1fr);gap:4px;overflow-x:auto;overscroll-behavior-x:contain;scrollbar-width:none;min-height:102px;padding:4px 0;align-items:start}
.duel-row{display:flex;gap:4px;overflow-x:auto;overscroll-behavior-x:contain;scrollbar-width:none;min-height:102px;padding:4px 0;align-items:flex-start}
.duel-zoomgrid .dface-zoom{align-self:start}
.duel-row::-webkit-scrollbar{display:none}
.duel-row.theirs{align-items:end}
.duel-slot{position:relative;display:flex;flex-direction:column;align-items:stretch;max-width:110px}
.duel-empty{grid-column:1/-1;align-self:center;text-align:center;font-size:12px;color:var(--ctp-overlay1);padding:8px}
.duel-row.theirs{align-items:flex-end}
.duel-slot{position:relative;display:flex;flex-direction:column;align-items:stretch;flex:1 1 0;min-width:62px;max-width:110px}
.duel-empty{flex:1;align-self:center;text-align:center;font-size:12px;color:var(--ctp-overlay1);padding:8px}
.duel-attach{position:absolute;top:-4px;right:-3px;z-index:3;font-size:10px;font-weight:800;padding:1px 5px;border-radius:8px;background:var(--ctp-mauve);color:var(--ctp-crust)}
.duel-pair{font-size:9px;line-height:1.2;color:var(--ctp-green);text-align:center;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin-top:2px}
@@ -136,8 +136,8 @@
.duel-log-aside h3{font-size:12px;letter-spacing:1px;text-transform:uppercase;color:var(--ctp-subtext0);margin:0 0 8px}
.duel-log-aside .duel-log{overflow:auto}
.duel-ticker{display:none}
.duel-row{grid-auto-columns:minmax(96px,120px);justify-content:center;min-height:150px;gap:8px}
.duel-slot{max-width:none}
.duel-row{justify-content:center;min-height:150px;gap:8px}
.duel-slot{min-width:96px;max-width:120px}
.dface-board{min-height:140px}
.dface-board .dface-art{height:62px}
.dface-board .dface-title{font-size:12.5px}