diff --git a/web/src/App.tsx b/web/src/App.tsx index 1ea5b60..5a98c20 100644 --- a/web/src/App.tsx +++ b/web/src/App.tsx @@ -42,8 +42,8 @@ function loadMode(): Mode { } // Off by default: taking moves back is a training aid, not how the game is played, -// and the default should be the honest game. When on, it is limited to the current -// turn (see turnFloor) -- you can revise a misclick, not rewind the rival. +// and the default should be the honest game. When on, undo/redo walk the whole +// timeline -- across the rival's moves and earlier rounds, not just your turn. const UNDO_KEY = "lost-cities.undo"; function loadUndoEnabled(): boolean { @@ -154,17 +154,11 @@ function App() { const { state: match, selection } = frames[cursor]; // The board on screen is the round in play; the match is what decides the game. const state = match.round; - // The start of the current turn: the most recent committed move at or before the - // cursor (a rival move, or your own draw). Undo cannot cross it, so you can take - // back a card selection or placement within your turn but never rewind into the - // rival's move or an earlier turn. - const turnFloor = useMemo(() => { - for (let index = cursor; index > 0; index -= 1) { - if (frames[index].move) return index; - } - return 0; - }, [frames, cursor]); - const canUndo = undoEnabled && cursor > turnFloor; + // When enabled, undo/redo walk the whole timeline -- back through your committed + // moves, the rival's replies, and earlier rounds, not just the current turn. The + // rival is held whenever there are moves ahead to redo, so stepping back never + // makes it replay the move you are reviewing. + const canUndo = undoEnabled && cursor > 0; const canRedo = undoEnabled && cursor < frames.length - 1; const latestMatch = useRef(match); @@ -503,7 +497,7 @@ function App() { checked={undoEnabled} onChange={(event) => setUndoEnabled(event.target.checked)} /> - 되돌리기 / 다시 · 내 턴 안에서만 + 되돌리기 / 다시 · 전체 되감기 )} diff --git a/web/src/styles.css b/web/src/styles.css index 9b5bd67..9b771a2 100644 --- a/web/src/styles.css +++ b/web/src/styles.css @@ -692,22 +692,23 @@ button.card:disabled { cursor: default; } /* Match mode: which round is live, and what is already banked. The board only ever shows the round in play, so without this the score plaques would be the only hint that two more rounds are coming. */ +/* Tucked under the rival plaque on the left, clear of the opponent hand which + sits centered along the top and would otherwise cover it. */ .round-strip { position: absolute; - top: 16px; - left: 50%; - transform: translateX(-50%); + top: 88px; + left: 24px; display: flex; align-items: center; gap: 8px; - padding: 6px 12px; + padding: 6px 14px; border-radius: 999px; background: rgba(18, 14, 10, 0.72); border: 1px solid rgba(214, 188, 140, 0.22); font-size: 11px; letter-spacing: 0.12em; color: rgba(214, 188, 140, 0.55); - z-index: 4; + z-index: 9; pointer-events: none; }