50bcb5533f
Tap-to-build hand recorder per docs/RECORDER.md. Correctness by construction: every
tap writes a known value into a known slot, emitting the canonical structured contract
(server normalize_structured() is the shape authority, so the client is best-effort).
- recorder.js: mount-agnostic module (mounts into any container -> overlay now,
standalone later, zero logic change). Pure buildStructured(state)->contract dict.
Card picker: sticky-suit-or-rank-first + x (unknown suit) + unknown-card; lock resets
per slot so it never bleeds between cards. Pre-fills from /session/data (stakes->blinds,
stack->hero, villains->seated). Per-street action entry, manual street advance.
- recorder.css: full-screen overlay using app theme tokens; floating launcher.
- index.html: overlay div + script + launcher (chat/session stays mounted underneath).
Validated end-to-end: JS core builds a hand (sticky/rainbow/unknown cards all correct)
-> POST /hands -> normalized -> /hand/{id} replay round-trips identically.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
135 lines
7.0 KiB
CSS
135 lines
7.0 KiB
CSS
/* Hand recorder overlay. Uses the app theme tokens (--accent, --bg-* etc.) from
|
|
style.css when mounted in index.html. For a standalone recorder.html, import those
|
|
tokens too (see :root in style.css). */
|
|
|
|
.rec-overlay {
|
|
position: fixed;
|
|
inset: 0;
|
|
z-index: 1000;
|
|
background: var(--bg-dark, #070707);
|
|
display: none;
|
|
flex-direction: column;
|
|
}
|
|
.rec-overlay.open { display: flex; }
|
|
|
|
.rec-root {
|
|
display: flex;
|
|
flex-direction: column;
|
|
height: 100%;
|
|
color: var(--text-main, #e8e8e8);
|
|
font-family: var(--font-console, ui-monospace, monospace);
|
|
}
|
|
|
|
.rec-head {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 10px;
|
|
padding: 12px 14px;
|
|
border-bottom: 1px solid var(--border, #2a1d12);
|
|
}
|
|
.rec-title { font-weight: 700; color: var(--accent, #ff7a00); }
|
|
.rec-meta { color: var(--text-fade, #8a8a8a); font-size: .82rem; flex: 1; }
|
|
.rec-x {
|
|
background: none; border: 1px solid var(--border, #2a1d12); color: var(--text-fade, #8a8a8a);
|
|
border-radius: 8px; width: 34px; height: 34px; font-size: 1rem;
|
|
}
|
|
|
|
.rec-body { flex: 1; overflow-y: auto; padding: 12px 14px 20px; -webkit-overflow-scrolling: touch; }
|
|
.rec-sec { margin-bottom: 18px; }
|
|
.rec-label { font-size: .7rem; text-transform: uppercase; letter-spacing: .6px; color: var(--text-fade, #8a8a8a); margin-bottom: 6px; }
|
|
.rec-dim { color: var(--text-fade, #8a8a8a); font-size: .85rem; }
|
|
|
|
.rec-pos-row { display: flex; flex-wrap: wrap; gap: 6px; }
|
|
.rec-pos {
|
|
min-width: 44px; padding: 9px 10px; border-radius: 9px;
|
|
background: var(--bg-elev, #0e0e0e); color: var(--text-main, #e8e8e8);
|
|
border: 1px solid var(--border, #2a1d12); font-size: .82rem; font-weight: 600;
|
|
}
|
|
.rec-pos.on { background: var(--accent, #ff7a00); color: #111; border-color: var(--accent, #ff7a00); }
|
|
.rec-pos.add { color: var(--text-fade, #8a8a8a); border-style: dashed; }
|
|
|
|
.rec-hero-cards { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
|
|
|
|
.rec-seats { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
|
|
.rec-seat { display: flex; align-items: center; gap: 8px; }
|
|
.rec-seat-pos { min-width: 42px; font-weight: 700; color: var(--gold, #ffb347); }
|
|
.rec-name {
|
|
flex: 1; min-width: 0; padding: 8px 9px; border-radius: 8px;
|
|
background: var(--bg-elev, #0e0e0e); border: 1px solid var(--border, #2a1d12);
|
|
color: var(--text-main, #e8e8e8); font-family: inherit; font-size: .85rem;
|
|
}
|
|
.rec-seat-cards { display: flex; gap: 5px; }
|
|
.rec-rm { background: none; border: none; color: var(--text-fade, #8a8a8a); font-size: .9rem; padding: 4px; }
|
|
|
|
/* cards */
|
|
.rec-card {
|
|
display: inline-flex; align-items: center; justify-content: center;
|
|
min-width: 30px; height: 40px; padding: 0 5px; border-radius: 6px;
|
|
background: #f4f4f4; color: #111; font-weight: 700; font-size: 1rem; line-height: 1;
|
|
}
|
|
.rec-card .rs { font-size: .8rem; margin-left: 1px; }
|
|
.rec-card.spade, .rec-card.club { color: #111; }
|
|
.rec-card.heart { color: #d11; }
|
|
.rec-card.diamond { color: #1463d1; }
|
|
.rec-card.empty { background: var(--bg-elev, #0e0e0e); color: var(--text-fade, #8a8a8a); border: 1px dashed var(--border-bright, #4a2f15); }
|
|
.rec-card.empty.active { border-color: var(--accent, #ff7a00); color: var(--accent, #ff7a00); }
|
|
.rec-card.unknown { background: #2a2a2a; color: #aaa; }
|
|
|
|
.rec-board { display: flex; gap: 6px; margin: 8px 0; }
|
|
|
|
.rec-street-tabs { display: flex; gap: 6px; margin-bottom: 8px; }
|
|
.rec-tab {
|
|
flex: 1; padding: 9px 6px; border-radius: 9px; font-size: .78rem; font-weight: 600;
|
|
background: var(--bg-elev, #0e0e0e); color: var(--text-main, #e8e8e8); border: 1px solid var(--border, #2a1d12);
|
|
}
|
|
.rec-tab.on { background: var(--accent, #ff7a00); color: #111; border-color: var(--accent, #ff7a00); }
|
|
|
|
.rec-act-add { display: flex; gap: 6px; margin: 8px 0; }
|
|
.rec-sel, .rec-num {
|
|
padding: 9px 8px; border-radius: 8px; background: var(--bg-elev, #0e0e0e);
|
|
border: 1px solid var(--border, #2a1d12); color: var(--text-main, #e8e8e8);
|
|
font-family: inherit; font-size: .85rem; min-width: 0;
|
|
}
|
|
.rec-sel { flex: 1; }
|
|
.rec-num { width: 70px; }
|
|
.rec-add-act { padding: 9px 12px; border-radius: 8px; background: var(--border-bright, #4a2f15); color: #fff; border: none; font-weight: 600; }
|
|
.rec-result { display: flex; gap: 12px; }
|
|
.rec-result label { display: flex; flex-direction: column; gap: 4px; font-size: .72rem; color: var(--text-fade, #8a8a8a); }
|
|
|
|
.rec-log { display: flex; flex-direction: column; gap: 3px; margin-top: 6px; }
|
|
.rec-ln { font-size: .82rem; color: var(--text-main, #e8e8e8); }
|
|
.rec-ln.brd { display: flex; gap: 4px; align-items: center; color: var(--text-fade, #8a8a8a); }
|
|
.rec-ln b { color: var(--accent, #ff7a00); font-weight: 700; }
|
|
|
|
.rec-foot { padding: 12px 14px; border-top: 1px solid var(--border, #2a1d12); }
|
|
.rec-save { width: 100%; padding: 14px; border-radius: 10px; background: var(--accent, #ff7a00); color: #111; border: none; font-weight: 700; font-size: 1rem; }
|
|
.rec-save:disabled { opacity: .6; }
|
|
|
|
/* card picker bottom sheet */
|
|
.rec-picker-wrap { position: fixed; inset: 0; background: rgba(0,0,0,.5); display: flex; align-items: flex-end; z-index: 1100; }
|
|
.rec-picker { width: 100%; background: var(--bg-elev, #0e0e0e); border-top: 1px solid var(--border-bright, #4a2f15); border-radius: 16px 16px 0 0; padding: 14px; }
|
|
.rec-picker-head { display: flex; align-items: center; justify-content: space-between; font-size: .85rem; color: var(--text-fade, #8a8a8a); margin-bottom: 12px; }
|
|
.rec-pk-x { background: var(--border-bright, #4a2f15); color: #fff; border: none; border-radius: 8px; padding: 6px 12px; font-weight: 600; }
|
|
.rec-suits { display: flex; gap: 8px; margin-bottom: 12px; }
|
|
.rec-suit { flex: 1; height: 52px; border-radius: 10px; font-size: 1.6rem; background: #f4f4f4; border: 2px solid transparent; }
|
|
.rec-suit.spade, .rec-suit.club { color: #111; }
|
|
.rec-suit.heart { color: #d11; }
|
|
.rec-suit.diamond { color: #1463d1; }
|
|
.rec-suit.x { background: #2a2a2a; color: #aaa; font-size: 1.1rem; font-weight: 700; }
|
|
.rec-suit.on { border-color: var(--accent, #ff7a00); box-shadow: 0 0 0 2px var(--accent, #ff7a00); }
|
|
.rec-ranks { display: grid; grid-template-columns: repeat(7, 1fr); gap: 7px; }
|
|
.rec-rank { height: 46px; border-radius: 9px; font-size: 1.05rem; font-weight: 700; background: var(--bg-dark, #070707); color: var(--text-main, #e8e8e8); border: 1px solid var(--border, #2a1d12); }
|
|
.rec-rank.on { background: var(--accent, #ff7a00); color: #111; border-color: var(--accent, #ff7a00); }
|
|
.rec-pk-foot { display: flex; justify-content: space-between; margin-top: 12px; }
|
|
.rec-pk-foot button { background: var(--bg-dark, #070707); color: var(--text-fade, #8a8a8a); border: 1px solid var(--border, #2a1d12); border-radius: 8px; padding: 9px 14px; font-size: .85rem; }
|
|
|
|
/* floating launcher (V1) */
|
|
#recLaunch {
|
|
position: fixed; right: 16px; bottom: 84px; z-index: 900;
|
|
background: var(--accent, #ff7a00); color: #111; border: none;
|
|
border-radius: 22px; padding: 11px 16px; font-weight: 700; font-size: .9rem;
|
|
font-family: var(--font-console, ui-monospace, monospace);
|
|
box-shadow: 0 3px 12px rgba(0,0,0,.4);
|
|
}
|
|
body.kb #recLaunch { display: none; } /* hide when the keyboard is up */
|