Compare commits

...

2 Commits

Author SHA1 Message Date
EJClaw
9ec756bf38 섯다 화면 꾸밈을 사이트 디자인으로: 흰 카드 자리·아래 판, 담요 무늬 펠트, 낙관(도장) 족보 이름, 파란 '내 차례' 띠, 다크 모드
- 사이트 공용 색 변수(--felt/--wood/--surface/--primary)를 써서 다크 모드에서도 맞음
- 족보판은 사이트 칩 모양, 내 족보 칸은 파란 강조
- 베팅 버튼은 흰 버튼, 누를 수 있을 때만 행동 색 테두리와 숫자 키 배지
- font 단축 속성에 inherit를 넣어 무효가 되던 글꼴(족보 칩·조합·키 배지)을 고침

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 01:03:22 +09:00
EJClaw
81b257df74 섯다: 3장 섯다 방의 재경기(구사·멍텅구리구사·같은 족보)는 2장 섯다로(2장 한 번에, 공개패 없이 베팅 1번)
hand.three를 (재)경기마다 두고 view.threeCard로 알림. 값이 없는 예전 상태는 방의 cardMode를 따름.
컴퓨터 판단·도움말·규칙 화면·문서도 맞춤, 엔진 테스트 2개 추가.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 00:58:50 +09:00
7 changed files with 157 additions and 82 deletions

View File

@@ -86,29 +86,41 @@ function bannerOf(v: SeotdaView): string | null {
const isBig = (name: string) => /광땡|땡$|장땡/.test(name) && name !== '땡잡이';
const CSS = `
.sd-wrap { width: 100%; max-width: 1060px; display: flex; flex-direction: column; gap: 10px; align-self: center; container: sd / inline-size; }
.sd-table { position: relative; width: 100%; aspect-ratio: 16 / 7.4; min-height: 380px; border-radius: 44px; border: 12px solid #5b3a1e;
background: radial-gradient(ellipse at 50% 45%, #2f8a5c 0%, #1d6a44 55%, #134b30 100%); box-shadow: inset 0 0 0 3px rgba(255,255,255,.08), inset 0 0 60px rgba(0,0,0,.35), 0 8px 24px rgba(0,0,0,.3); }
.sd-table::before { content: ''; position: absolute; inset: 14px; border-radius: 30px; border: 2px dashed rgba(255,255,255,.12); pointer-events: none; }
.sd-seat { position: absolute; left: var(--x); top: var(--y); transform: translate(-50%, -50%); width: 156px; z-index: 2;
background: rgba(10, 22, 16, .78); color: #f8fafc; border-radius: 12px; padding: 6px 8px; display: flex; flex-direction: column; gap: 3px;
border: 2px solid rgba(255,255,255,.12); box-shadow: 0 3px 10px rgba(0,0,0,.35); font-size: .82rem; transition: border-color .2s, opacity .2s; }
.sd-seat.turn { border-color: #fbbf24; box-shadow: 0 0 0 3px rgba(251,191,36,.35), 0 3px 10px rgba(0,0,0,.35); }
.sd-seat.out { opacity: .55; }
.sd-seat.win { border-color: #fde047; box-shadow: 0 0 0 3px rgba(253,224,71,.5), 0 0 22px rgba(253,224,71,.45); }
.sd-wrap { width: 100%; max-width: 1060px; display: flex; flex-direction: column; gap: 12px; align-self: center; container: sd / inline-size; }
/* 테이블: 사이트 공용 펠트·나무 색(다크 모드 따라감) 위에 화투판 담요 같은 마름모 무늬. */
.sd-table { position: relative; width: 100%; aspect-ratio: 16 / 7.2; min-height: 370px; border-radius: 36px; border: 10px solid var(--wood);
background:
radial-gradient(ellipse at 50% 46%, rgba(255,255,255,.13) 0%, rgba(255,255,255,0) 58%),
repeating-linear-gradient(45deg, rgba(255,255,255,.045) 0 2px, transparent 2px 18px),
repeating-linear-gradient(-45deg, rgba(255,255,255,.045) 0 2px, transparent 2px 18px),
var(--felt);
box-shadow: inset 0 0 0 2px var(--wood-line), inset 0 0 50px rgba(0,0,0,.28), var(--shadow); }
.sd-table::before { content: ''; position: absolute; left: 50%; top: 48%; width: 300px; height: 190px; transform: translate(-50%, -50%); border-radius: 50%;
border: 2px dashed rgba(255,255,255,.16); background: rgba(0,0,0,.08); pointer-events: none; }
.sd-seat { position: absolute; left: var(--x); top: var(--y); transform: translate(-50%, -50%); width: 160px; z-index: 2;
background: var(--surface); color: var(--text); border-radius: var(--radius); padding: 7px 9px; display: flex; flex-direction: column; gap: 3px;
border: 2px solid transparent; box-shadow: var(--shadow), 0 4px 14px rgba(0,0,0,.18); font-size: .82rem; transition: border-color .2s, opacity .2s, box-shadow .2s; }
.sd-seat.turn { border-color: var(--focus); box-shadow: 0 0 0 4px color-mix(in srgb, var(--focus) 35%, transparent), 0 4px 14px rgba(0,0,0,.18); }
.sd-seat.out { opacity: .6; }
.sd-seat.win { border-color: #eab308; box-shadow: 0 0 0 4px rgba(234,179,8,.4), 0 0 22px rgba(234,179,8,.45); }
.sd-seat .nm { font-weight: 800; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sd-money { font-variant-numeric: tabular-nums; font-weight: 800; color: #fde68a; white-space: nowrap; }
.sd-cards { display: flex; justify-content: center; min-height: 52px; align-items: flex-end; }
.sd-seat .sub { color: var(--text-sub); }
.sd-money { font-variant-numeric: tabular-nums; font-weight: 800; color: var(--warning); white-space: nowrap; }
.sd-cards { display: flex; justify-content: center; min-height: 52px; align-items: flex-end; margin-top: -26px; }
.sd-tag { display: inline-block; border-radius: 999px; padding: 0 7px; font-weight: 800; font-size: .74rem; line-height: 1.5; white-space: nowrap; }
.sd-act { position: absolute; top: -14px; right: -8px; z-index: 3; border-radius: 10px; padding: 1px 9px; font-weight: 900; font-size: .85rem; color: #fff;
box-shadow: 0 2px 6px rgba(0,0,0,.35); pointer-events: none; }
.sd-hand { text-align: center; font-weight: 900; font-size: .92rem; border-radius: 8px; padding: 1px 4px; background: rgba(255,255,255,.12); color: #fff; }
.sd-hand.big { background: linear-gradient(180deg, #fde047, #f59e0b); color: #422006; }
.sd-act { position: absolute; top: -12px; right: -8px; z-index: 3; border-radius: 999px; padding: 1px 10px; font-weight: 900; font-size: .85rem; color: #fff;
box-shadow: 0 2px 6px rgba(0,0,0,.3); pointer-events: none; }
/* 족보 이름은 붉은 낙관(도장)처럼, 땡 이상은 금 도장. */
.sd-seal { display: inline-block; align-self: center; font-weight: 900; line-height: 1.2; border-radius: 7px; padding: 1px 10px; color: #fff; background: #c8102e;
box-shadow: inset 0 0 0 2px rgba(255,255,255,.55), 0 2px 4px rgba(0,0,0,.25); transform: rotate(-2deg); letter-spacing: .02em; white-space: nowrap; }
.sd-seal.big { background: linear-gradient(160deg, #fde047, #f59e0b); color: #5a2a00; box-shadow: inset 0 0 0 2px rgba(255,255,255,.7), 0 0 0 2px #b45309, 0 2px 6px rgba(0,0,0,.25); }
.sd-seal.die { background: #64748b; transform: none; }
.sd-seat .sd-seal { font-size: .9rem; }
.sd-delta { text-align: center; font-weight: 900; font-variant-numeric: tabular-nums; }
.sd-delta.plus { color: #86efac; } .sd-delta.minus { color: #fca5a5; }
.sd-center { position: absolute; left: 50%; top: 46%; transform: translate(-50%, -50%); text-align: center; color: #fff; z-index: 1; min-width: 220px; }
.sd-pot-label { display: inline-block; font-size: .9rem; font-weight: 800; letter-spacing: .1em; background: rgba(0,0,0,.35); border-radius: 999px; padding: 1px 12px; }
.sd-pot { font-size: 2.3rem; font-weight: 900; font-variant-numeric: tabular-nums; color: #fde68a; text-shadow: 0 2px 6px rgba(0,0,0,.55); line-height: 1.15; }
.sd-delta.plus { color: var(--success); } .sd-delta.minus { color: var(--danger); }
.sd-center { position: absolute; left: 50%; top: 48%; transform: translate(-50%, -50%); text-align: center; color: #fff; z-index: 1; min-width: 220px; }
.sd-pot-label { display: inline-block; font-size: .85rem; font-weight: 800; letter-spacing: .12em; background: rgba(255,255,255,.18); border-radius: 999px; padding: 1px 12px; }
.sd-pot { font-size: 2.3rem; font-weight: 900; font-variant-numeric: tabular-nums; color: #fde68a; text-shadow: 0 2px 6px rgba(0,0,0,.45); line-height: 1.15; }
.sd-pile { position: relative; height: 34px; width: 120px; margin: 0 auto 2px; }
.sd-pile i { position: absolute; bottom: 0; width: 26px; height: 26px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff7c2, #f5b301 55%, #b45309);
border: 2px solid #92400e; box-shadow: 0 2px 3px rgba(0,0,0,.4); }
@@ -119,56 +131,59 @@ const CSS = `
background: radial-gradient(circle at 35% 35%, #fff7c2, #f5b301 55%, #b45309); border: 2px solid #92400e;
animation: sd-fly .55s cubic-bezier(.3,.7,.4,1) both; animation-delay: var(--d, 0ms); }
@keyframes sd-fly { from { transform: translate(0, 0) scale(.9); opacity: 1; } 85% { opacity: 1; } to { transform: translate(var(--dx), var(--dy)) scale(.7); opacity: 0; } }
.sd-dock { position: relative; display: flex; gap: 12px; align-items: stretch; padding: 10px 12px; border-radius: 16px; color: #3b2306;
background: linear-gradient(180deg, #f8e3a3 0%, #ecc768 55%, #d9a744 100%); border: 3px solid #8a5a1c;
box-shadow: inset 0 0 0 2px rgba(255,255,255,.35), 0 6px 16px rgba(0,0,0,.25); transition: box-shadow .2s, border-color .2s; }
.sd-dock.turn { border-color: #f59e0b; box-shadow: inset 0 0 0 2px rgba(255,255,255,.35), 0 0 0 4px rgba(245,158,11,.45), 0 6px 16px rgba(0,0,0,.25); }
.sd-dock.win { border-color: #fde047; box-shadow: inset 0 0 0 2px rgba(255,255,255,.35), 0 0 0 4px rgba(253,224,71,.6), 0 0 24px rgba(253,224,71,.5); }
.sd-jokbo { flex: 0 0 262px; display: flex; flex-direction: column; gap: 5px; background: rgba(74,44,10,.88); color: #fdf6e3; border-radius: 10px; padding: 6px 8px; }
.sd-jokbo h3 { margin: 0; font-size: .95rem; font-weight: 900; color: #fde68a; letter-spacing: .2em; }
/* 아래 판: 사이트의 흰 카드(surface) 한 장에 족보·나·내 패·버튼. 내 차례면 파란 테두리와 "내 차례" 띠. */
.sd-dock { position: relative; display: flex; gap: 10px; align-items: stretch; padding: 10px; border-radius: var(--radius-lg); color: var(--text);
background: var(--surface); border: 2px solid var(--border); box-shadow: var(--shadow); transition: box-shadow .2s, border-color .2s; }
.sd-dock.turn { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft), var(--shadow); }
.sd-dock.turn::before { content: '내 차례'; position: absolute; top: -13px; left: 50%; transform: translateX(-50%); z-index: 2; background: var(--primary); color: var(--primary-text);
font-weight: 900; font-size: .8rem; padding: 1px 14px; border-radius: 999px; box-shadow: var(--shadow); }
.sd-dock.win { border-color: #eab308; box-shadow: 0 0 0 4px rgba(234,179,8,.35), 0 0 24px rgba(234,179,8,.35); }
.sd-jokbo { flex: 0 0 266px; display: flex; flex-direction: column; gap: 6px; background: var(--surface-2); border-radius: var(--radius); padding: 8px; }
.sd-jokbo h3 { margin: 0; font-size: .92rem; font-weight: 900; display: flex; align-items: center; gap: 6px; }
.sd-jokbo h3::before { content: ''; width: 14px; height: 18px; border-radius: 3px; background: #c8102e; box-shadow: inset 0 0 0 2px #fff7, 3px 2px 0 -1px #f6c453; }
.sd-jokbo ol { list-style: none; margin: 0; padding: 0; display: grid; grid-auto-flow: column; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3px; }
.sd-jokbo li button { width: 100%; text-align: left; border: 1px solid rgba(253,230,138,.25); border-radius: 4px; background: rgba(255,255,255,.08); color: inherit;
font: 700 .74rem/1.55 inherit; padding: 0 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.sd-jokbo li button.sel { border-color: #fde68a; }
.sd-jokbo li button.hit { background: #c4b5fd; color: #2e1065; border-color: #ede9fe; }
.sd-jokbo-desc { display: flex; gap: 6px; align-items: center; font-size: .78rem; line-height: 1.3; margin-top: auto; padding-top: 4px; border-top: 1px solid rgba(253,230,138,.25); }
.sd-jokbo li button { width: 100%; text-align: left; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text);
font-family: inherit; font-weight: 700; font-size: .78rem; line-height: 1.6; letter-spacing: -.01em; padding: 0 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.sd-jokbo li button:hover { border-color: var(--text-sub); }
.sd-jokbo li button.sel { border-color: var(--text-sub); box-shadow: inset 0 0 0 1px var(--text-sub); }
.sd-jokbo li button.hit { background: var(--primary-soft); color: var(--primary); border-color: var(--primary); font-weight: 900; }
.sd-jokbo-desc { display: flex; gap: 6px; align-items: center; font-size: .78rem; line-height: 1.35; margin-top: auto; padding: 6px 8px; border-radius: 10px; background: var(--surface); }
.sd-jokbo-desc .pics { display: flex; gap: 2px; flex: none; }
.sd-jokbo-desc strong { color: #fde68a; }
.sd-prof { position: relative; flex: 0 0 104px; display: flex; flex-direction: column; align-items: center; gap: 3px; text-align: center;
background: rgba(255,255,255,.35); border-radius: 10px; padding: 8px 6px; }
background: var(--surface-2); border-radius: var(--radius); padding: 10px 6px; }
.sd-prof .nm { font-size: .85rem; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sd-prof .sd-money { color: #7c2d12; font-size: .95rem; }
.sd-prof .sd-delta.plus { color: #15803d; } .sd-prof .sd-delta.minus { color: #b91c1c; }
.sd-play { flex: 1; min-width: 0; display: flex; gap: 12px; align-items: stretch; }
.sd-handarea { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
background: rgba(122,74,18,.18); border-radius: 10px; padding: 8px 6px; }
.sd-prof .sd-money { font-size: .95rem; }
.sd-play { flex: 1; min-width: 0; display: flex; gap: 10px; align-items: stretch; }
/* 내 패는 작은 담요(펠트) 위에. */
.sd-handarea { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: #fff;
background: repeating-linear-gradient(45deg, rgba(255,255,255,.045) 0 2px, transparent 2px 14px), repeating-linear-gradient(-45deg, rgba(255,255,255,.045) 0 2px, transparent 2px 14px), var(--felt);
border-radius: var(--radius); padding: 10px 6px; box-shadow: inset 0 0 0 2px rgba(0,0,0,.12), inset 0 0 24px rgba(0,0,0,.22); }
.sd-handarea .mine { display: flex; gap: 8px; align-items: flex-end; justify-content: center; }
.sd-handarea .under { display: flex; justify-content: center; }
.sd-handarea .hint { font-size: .8rem; text-align: center; opacity: .9; }
.sd-myhand { display: inline-block; font-size: 1.3rem; font-weight: 900; line-height: 1.2; padding: 1px 14px; border-radius: 999px; background: #3b2306; color: #fde047; }
.sd-myhand.big { background: linear-gradient(180deg, #fde047, #f59e0b); color: #422006; box-shadow: 0 0 0 2px #7c2d12; }
.sd-myhand.die { background: #7f1d1d; color: #fecaca; }
.sd-handarea .hint { font-size: .8rem; text-align: center; opacity: .92; }
.sd-handarea .sd-seal { font-size: 1.25rem; padding: 2px 16px; }
.sd-combos { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.sd-combo { border: 0; border-radius: 999px; padding: 2px 10px; font: 800 .9rem/1.4 inherit; background: #3b2306; color: #fde68a; }
.sd-combo.best { background: linear-gradient(180deg, #fde047, #f59e0b); color: #422006; box-shadow: 0 0 0 2px #7c2d12; }
.sd-combo { border: 0; border-radius: 7px; padding: 2px 10px; font-family: inherit; font-weight: 800; font-size: .88rem; line-height: 1.4; background: rgba(255,255,255,.92); color: #1c1e21; }
.sd-combo.best { background: linear-gradient(160deg, #fde047, #f59e0b); color: #5a2a00; box-shadow: 0 0 0 2px #b45309; }
button.sd-combo { cursor: pointer; }
button.sd-combo[aria-pressed='true'] { outline: 3px solid #2563eb; outline-offset: 1px; }
button.sd-combo[aria-pressed='true'] { outline: 3px solid #93c5fd; outline-offset: 1px; }
.sd-actions { flex: 0 0 236px; display: flex; flex-direction: column; justify-content: center; gap: 6px; }
.sd-actions p { margin: 0; font-size: .86rem; line-height: 1.4; }
.sd-result { display: flex; flex-direction: column; gap: 2px; font-size: .86rem; line-height: 1.4; background: rgba(255,255,255,.55); border-radius: 10px; padding: 8px 10px; }
.sd-bets { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: minmax(38px, 1fr); gap: 6px; }
.sd-bet { position: relative; border: 1px solid #a07a3c; border-radius: 8px; padding: 0 8px 0 30px; cursor: pointer; display: flex; align-items: center; gap: 4px;
background: linear-gradient(180deg, #fffbeb, #f3dfa8); color: #3b2306; font-weight: 900; font-size: 1.05rem; line-height: 1.1;
box-shadow: inset 0 -2px 0 rgba(0,0,0,.12), 0 1px 2px rgba(0,0,0,.2); }
.sd-actions p { margin: 0; font-size: .86rem; line-height: 1.45; }
.sd-result { display: flex; flex-direction: column; gap: 2px; font-size: .86rem; line-height: 1.4; background: var(--surface-2); border-radius: var(--radius); padding: 8px 10px; }
.sd-bets { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: minmax(40px, 1fr); gap: 6px; }
.sd-bet { position: relative; border: 2px solid var(--border); border-radius: var(--radius); padding: 0 8px 0 32px; cursor: pointer; display: flex; align-items: center; gap: 4px;
background: var(--surface); color: var(--text); font-weight: 900; font-size: 1.05rem; line-height: 1.1; transition: background .12s, border-color .12s, transform .08s; }
.sd-bet .lb { flex: 1; text-align: center; }
.sd-bet small { font-size: .72rem; font-weight: 800; color: var(--c); font-variant-numeric: tabular-nums; white-space: nowrap; }
.sd-bet kbd { position: absolute; left: 5px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; border-radius: 4px; display: flex; align-items: center; justify-content: center;
font: 800 .78rem/1 inherit; background: #e9d29a; color: #7a5520; border: 1px solid #c9a35a; }
.sd-bet.on { border-color: var(--c); box-shadow: inset 4px 0 0 var(--c), 0 0 0 1px var(--c), 0 2px 4px rgba(0,0,0,.25); }
.sd-bet small { font-size: .72rem; font-weight: 800; color: var(--text-sub); font-variant-numeric: tabular-nums; white-space: nowrap; }
.sd-bet kbd { position: absolute; left: 6px; top: 50%; transform: translateY(-50%); width: 21px; height: 21px; border-radius: 6px; display: flex; align-items: center; justify-content: center;
font-family: inherit; font-weight: 800; font-size: .76rem; line-height: 1; background: var(--surface-2); color: var(--text-sub); }
.sd-bet.on { border-color: var(--c); background: color-mix(in srgb, var(--c) 9%, var(--surface)); }
.sd-bet.on .lb { color: var(--c); }
.sd-bet:disabled { opacity: .5; cursor: default; box-shadow: none; }
.sd-bet.on:hover { filter: brightness(1.06); }
.sd-bet.on kbd { background: var(--c); color: #fff; }
.sd-bet:disabled { opacity: .45; cursor: default; }
.sd-bet.on:hover { background: color-mix(in srgb, var(--c) 18%, var(--surface)); }
.sd-bet.on:active { transform: translateY(1px); }
:root[data-theme='dark'] .sd-bet.on .lb { color: color-mix(in srgb, var(--c) 55%, #fff); }
.sd-help { margin: 0; text-align: center; min-height: 1.4em; }
@container sd (max-width: 899px) {
.sd-dock { flex-wrap: wrap; }
@@ -176,11 +191,11 @@ button.sd-combo[aria-pressed='true'] { outline: 3px solid #2563eb; outline-offse
.sd-jokbo ol { grid-auto-flow: row; grid-template-columns: repeat(6, minmax(0, 1fr)); grid-template-rows: none !important; }
}
@media (max-width: 719px) {
.sd-table { aspect-ratio: auto; min-height: 0; border-width: 7px; border-radius: 22px; padding: 10px 8px; display: flex; flex-direction: column; gap: 8px; }
.sd-table::before { inset: 6px; border-radius: 16px; }
.sd-others { display: grid; grid-template-columns: repeat(var(--cols, 2), minmax(0, 1fr)); gap: 6px; }
.sd-table { aspect-ratio: auto; min-height: 0; border-width: 7px; border-radius: 22px; padding: 18px 8px 10px; display: flex; flex-direction: column; gap: 8px; }
.sd-table::before { display: none; }
.sd-others { display: grid; grid-template-columns: repeat(var(--cols, 2), minmax(0, 1fr)); gap: 8px 6px; }
.sd-seat { position: relative; left: auto; top: auto; transform: none; width: auto; padding: 5px 6px; font-size: .76rem; }
.sd-cards { min-height: 40px; }
.sd-cards { min-height: 40px; margin-top: -16px; }
.sd-act { top: -9px; right: auto; left: -4px; font-size: .74rem; padding: 0 7px; }
.sd-center { position: relative; left: auto; top: auto; transform: none; min-width: 0; padding: 2px 0; }
.sd-pot { font-size: 1.8rem; }
@@ -192,7 +207,7 @@ button.sd-combo[aria-pressed='true'] { outline: 3px solid #2563eb; outline-offse
.sd-prof .row { min-height: 0 !important; }
.sd-play { flex: 1 1 100%; flex-direction: column; gap: 8px; }
.sd-actions { flex: none; }
.sd-myhand { font-size: 1.1rem; }
.sd-handarea .sd-seal { font-size: 1.1rem; }
.sd-bets { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: 48px; }
.sd-bets .sd-gap { display: none; }
.sd-bet { justify-content: center; padding: 0 4px; flex-direction: column; gap: 0; }
@@ -305,12 +320,12 @@ function Seat({ seat, view: v, players, me, deadline, pos, cardW, winner, setRef
{formatWonShort(seat.stack)}원
</span>
{seat.matchBet > 0 && (
<span className="small" style={{ opacity: 0.85, whiteSpace: 'nowrap' }} title="이번 판에 건 돈">
<span className="small sub" style={{ whiteSpace: 'nowrap' }} title="이번 판에 건 돈">
건 돈 {formatWonShort(seat.matchBet)}
</span>
)}
</div>
{seat.handName && <div className={`sd-hand${isBig(seat.handName) ? ' big' : ''} anim-pop`}>{seat.handName}</div>}
{seat.handName && <div className={`sd-seal${isBig(seat.handName) ? ' big' : ''} anim-pop`}>{seat.handName}</div>}
{seat.handDelta !== null && seat.handDelta !== 0 && (
<div className={`sd-delta anim-slide-up ${seat.handDelta > 0 ? 'plus' : 'minus'}`}>{formatWonDelta(seat.handDelta)}</div>
)}
@@ -564,8 +579,8 @@ function Dock({ view: v, seat, players, act, pending, deadline, winner, setRef,
// Under my cards: the 족보 (or, with 3 cards, every pair's 족보 like 한게임; clickable while choosing).
let under: ReactNode = null;
if (seat?.handName) under = <span className={`sd-myhand anim-pop${isBig(seat.handName) ? ' big' : ''}`}>{seat.handName}</span>;
else if (seat?.folded) under = <span className="sd-myhand die">다이</span>;
if (seat?.handName) under = <span className={`sd-seal anim-pop${isBig(seat.handName) ? ' big' : ''}`}>{seat.handName}</span>;
else if (seat?.folded) under = <span className="sd-seal die">다이</span>;
else if (playing && hints && v.myCombos && !v.myChosen)
under = (
<span className="sd-combos">
@@ -583,7 +598,7 @@ function Dock({ view: v, seat, players, act, pending, deadline, winner, setRef,
)}
</span>
);
else if (playing && h) under = <span className={`sd-myhand${h.value !== null && isBig(h.name) ? ' big' : ''}`} aria-live="polite">{h.name}</span>;
else if (playing && h) under = <span className={`sd-seal${h.value !== null && isBig(h.name) ? ' big' : ''}`} aria-live="polite">{h.name}</span>;
let actions: ReactNode;
if (opening)
@@ -799,7 +814,7 @@ export function SeotdaBoard({ view: v, me, players, act, pending, deadline }: Bo
if (v.foldWin) winners.add(v.foldWin.winner);
for (const p of v.showdown?.pots ?? []) if (p.type !== 'rematch') for (const w of p.winners) winners.add(w);
}
const cardW = phone ? (v.options.cardMode === 'three' ? 24 : 28) : v.options.cardMode === 'three' ? 38 : 46;
const cardW = phone ? (v.threeCard ? 24 : 28) : v.threeCard ? 38 : 46;
const cols = phone ? (others.length > 4 ? 3 : 2) : 0;
const othersEls: ReactNode = others.map(({ s, rel }) => (
<Seat

View File

@@ -21,6 +21,7 @@ function who(players: Record<string, PublicUser>, id: string): string {
/** Which betting round this is, in plain words. */
function roundText(v: SeotdaView): string {
const o = v.options;
if (o.cardMode === 'three' && !v.threeCard) return '재경기는 2장 섯다로 해요. 2장을 한 번에 받고 한 번만 베팅한 뒤 남은 사람끼리 패를 공개해요.';
if (o.cardMode === 'three')
return v.street === 0
? '2장을 받고 하는 첫 베팅이에요. 끝나면 1장을 더 받아 3장 중 쓸 2장을 골라요.'
@@ -42,7 +43,7 @@ function handLine(v: SeotdaView, seat: SeotdaSeatView): string {
function rematchLine(v: SeotdaView): string {
if (v.rematchNo === 0 || !v.rematchReason) return '';
return `재경기 ${v.rematchNo}회차(${REMATCH_KO[v.rematchReason]})예요. 판돈은 그대로 두고, 기본금은 다시 내지 않아요.`;
return `재경기 ${v.rematchNo}회차(${REMATCH_KO[v.rematchReason]})예요. 판돈은 그대로 두고, 기본금은 다시 내지 않아요.${v.options.cardMode === 'three' ? ' 재경기는 2장 섯다로 해요(공개패 없음).' : ''}`;
}
function resultLine(v: SeotdaView, players: Record<string, PublicUser>): string {
@@ -65,7 +66,7 @@ function resultLine(v: SeotdaView, players: Record<string, PublicUser>): string
function waitingLine(v: SeotdaView, players: Record<string, PublicUser>): string {
if (v.handPhase === 'betting') {
const oneRound = v.options.cardMode === 'two' && v.options.dealMode === 'oneRound';
const oneRound = !v.threeCard && (v.options.cardMode === 'three' || v.options.dealMode === 'oneRound');
const round = oneRound ? '베팅' : v.street === 0 ? '첫 베팅' : '마지막 베팅';
return v.toAct ? `${who(players, v.toAct)} 차례예요(${round}).` : '카드를 나눠 주는 중이에요.';
}

View File

@@ -362,6 +362,7 @@ function Rules({ options }: { options?: SeotdaOptions }) {
<JokboTable options={o ?? ({ gwangTtaeng: 'all', ttaengjabi: 'loose', amhaeng: true, gusa: true, mungGusa: 'upTo9', hints: false } as SeotdaOptions)} />
<p>
<strong>재경기</strong>: 구사나 같은 족보{o?.tieRule === 'split' ? '(이 방은 같은 족보면 나눠 가져요)' : ''}로 재경기가 되면 판돈은 그대로 두고 남은 사람끼리 새로 패를 받아요. 기본금은 다시 내지 않아요.
{o?.cardMode === 'three' ? ' 3장 섯다 방이어도 재경기는 2장 섯다로 해요: 2장을 한 번에 받고(공개패 없음) 한 번만 베팅한 뒤 공개해요.' : ''}
{o && o.rejoinCost !== 'none' ? ` 구사 재경기 때 다이한 사람은 판돈의 ${o.rejoinCost === 'half' ? '절반' : '전부'}만큼 내고 다시 들어올 수 있어요.` : ''} 한 판에서 재경기가{' '}
{o?.maxRematches ?? 3}번을 넘으면 나눠 가져요.
</p>

View File

@@ -103,6 +103,8 @@
6. 2명 이상 남으면 최종 패 고르기(동시 진행): 각자 3장 중 2장을 고른다. 시간이 지나면 가장 센 조합. 2구 베팅에서 한 사람만 남으면 고르지 않고 끝난다(카드 공개를 고르면 손패 3장을 모두 보여 준다).
7. 쇼다운(고른 2장으로 판정). 버린 1장은 공개패가 아니면 끝까지 아무에게도 보이지 않는다(공개패를 버리면 다른 사람 화면에서 그 패가 빠진다).
재경기(구사·멍텅구리구사·같은 족보)는 3장 섯다 방이어도 **2장 섯다**로 한다(2026-10-17): 2장을 한 번에 받고 공개패 없이 베팅 1번 → 쇼다운. 재경기가 끝나면 다음 판은 다시 3장 섯다. 엔진은 (재)경기마다 `hand.three`를 두고(본 판 = `cardMode=three`, 재경기 = false), 화면에는 `view.threeCard`로 알린다. 이 값이 없는 예전 상태(배포 전에 시작한 재경기)는 방의 `cardMode`를 따른다.
옵션: `threeOpen=끔`이면 2단계가 없다. `threePick=beforeBet`이면 4단계 직후에 2장을 고르고(뒷면 2장만 남김) 그다음 마지막 베팅 → 쇼다운(2026-10-13 이전의 3장 섯다 흐름). 진행 중이던 방(상태 버전 2)은 버전 3으로 옮길 때 예전 흐름(공개패 없음, 베팅 전 고르기)을 그대로 쓴다.
근거: 한게임 섯다 안내 "3장 섯다: 2장을 먼저 받고 베팅 한 후 패 1장을 더 받고 베팅을 한 번 더 하는 게임방식", "2장 섯다: 전통적인 섯다 방식으로 화투패 2장을 모두 받은 다음 베팅하여 승부"(hangame-images.toastoven.net/hangame/pc/gostop/introduce/html/gssudda/guide_gssudda01_02.html). 한게임 앱 안내(블루스택 공략): "패를 2장 받고, 2장의 패 중 모두에게 공개할 패를 1장 선택 → 1구 베팅 → 추가 패 → 3장의 패 중 최종 패 선택". 나무위키 '섰다': 인터넷 3장 섯다(한게임/피망)는 2장 받고 1장 공개 → 첫 베팅 → 1장 더 → 두 번째 베팅 → 가장 좋은 2장으로 승부.
@@ -484,7 +486,8 @@ interface SeotdaResult /* extends GameResult */ {
한게임 섯다 화면을 본떴다(`apps/web/src/games/seotda/board.tsx`).
화면 배치 (2026-10-17 한게임 섯다 화면 사진대로 다시 짬):
화면 배치 (2026-10-17 한게임 섯다 화면 사진대로 다시 짬, 같은 날 사이트 디자인에 맞춰 다시 꾸밈):
- 꾸밈: 사이트 공용 색(`--felt`·`--wood`·`--surface`·`--primary`, 다크 모드 따라감)을 쓴다. 테이블과 내 패 자리는 화투판 담요처럼 마름모 무늬 펠트, 다른 사람 자리와 아래 판은 사이트의 흰 카드(둥근 모서리·옅은 그림자), 족보 이름은 붉은 낙관(도장)처럼(땡 이상은 금 도장), 내 차례면 아래 판에 파란 테두리와 "내 차례" 띠, 베팅 버튼은 흰 버튼에 누를 수 있을 때만 행동 색 테두리와 숫자 키 배지.
- 테이블(위): 나무 테두리의 초록 테이블. 다른 사람 자리는 왼쪽 아래에서 위를 돌아 오른쪽 아래까지 둥글게, 자리마다 패가 위·이름과 돈이 아래. 가운데에 동전 더미와 **판돈** 큰 숫자, 그 밑에 판 수·기본금·현재 콜 금액. 재경기면 "재경기 2회차 · 구사" 띠. 내 자리는 테이블 안에 두지 않는다.
- 자리 상자: 패(공개패·쇼다운 패는 앞면, 왼쪽 아래 큰 월 숫자), 아바타, 닉네임, 선 표시, 남은 시간 고리, 보유 금액(만 단위로 줄임), 이번 판에 건 돈, 마지막 행동 말풍선(콜·하프·다이 … 색 구분), 쇼다운 뒤 족보 이름(땡 이상은 금색)과 딴/잃은 금액, 이긴 자리는 금빛 테두리.
- 아래 금색 판(PC, 왼쪽부터): **족보판**(3열 목록 `1.38광땡 … 14.망통`, 특수패는 `*땡잡이`처럼 켜진 것만, 내 지금 족보 칸을 보라색으로 강조, 칸을 누르면 아래 줄에 그 족보의 그림 2장과 설명, 기본은 내 족보) · 내 얼굴(아바타·닉네임·보유 금액·선·남은 시간, 쇼다운 뒤 딴/잃은 금액) · **내 패**(2~3장 크게, 그 밑에 지금 족보 이름, 3장일 때는 세 조합의 족보를 나란히 적고 가장 센 것을 금색으로, 그 밑에 한 줄 도움말) · **베팅 버튼** 두 줄(왼쪽 콜7·삥4·따당1·하프0, 오른쪽 다이8·체크5, 쿼터2·풀9를 켜면 오른쪽 빈칸). 버튼마다 숫자 키를 왼쪽에 적고, 내 차례일 때만 낼 금액이 나온다. 못 누르는 버튼은 흐리게 두고 자리를 바꾸지 않는다(오조작 방지). 마우스를 올리면 판 아래 줄에 "걸고 나면 내 돈 … 판돈 …"을 미리 보여 준다.

View File

@@ -35,7 +35,7 @@ const sigmoid = (x: number) => 1 / (1 + Math.exp(-x));
const myCardsOf = (v: SeotdaView, me: string): number[] =>
(v.seats.find((s) => s.id === me)?.cards ?? []).flatMap((c) => ('id' in c ? [c.id] : []));
const finalSizeOf = (v: SeotdaView): 2 | 3 => (v.options.cardMode === 'three' ? 3 : 2);
const finalSizeOf = (v: SeotdaView): 2 | 3 => (v.threeCard ? 3 : 2);
/** Opponents still in the hand, each with a range built from the public bets of this (re)match. */
export function rangesOf(v: SeotdaView, me: string): { id: string; weight: RangeWeight }[] {
@@ -51,7 +51,7 @@ export function rangesOf(v: SeotdaView, me: string): { id: string; weight: Range
return { ...e, forced: isForced };
});
// Cards held when the bet was made: 2장 섯다 1장씩 → 1 card on street 0; 3장 섯다 → 2 of 3 on street 0.
const partialStreet0 = v.options.cardMode === 'three' || v.options.dealMode === 'twoRounds';
const partialStreet0 = finalSize === 3 || (v.options.cardMode === 'two' && v.options.dealMode === 'twoRounds');
return live.map((s) => {
const mine = entries.filter((e) => e.p === s.id && !e.forced);
// 3장 섯다 공개패: every hand they may hold contains the card they showed.

View File

@@ -227,6 +227,11 @@ export interface SeotdaHand {
/** Pots carried from earlier matches of the same hand (eligibility fixed). */
carried: PotState[];
rematchReason: 'gusa' | 'mungGusa' | 'tie' | null;
/**
* This (re)match uses the 3장 섯다 flow. A 3장 섯다 room's rematch is played as 2장 섯다 (2장 한 번에, 베팅 1번,
* 공개패 없음; 2026-10-17). Absent in hands started before that → the room's `cardMode`.
*/
three?: boolean;
/** Upcoming rematch participants (handEnd → rejoin → rematch). */
rematchSet: PlayerId[];
rejoinPending: PlayerId[];
@@ -340,6 +345,8 @@ export interface SeotdaView {
handsPlayed: number;
rematchNo: number;
rematchReason: SeotdaHand['rematchReason'];
/** This (re)match is played with 3장 섯다 rules (false for 2장 rooms and for a 3장 room's rematch). */
threeCard: boolean;
baseUnit: number;
seats: SeotdaSeatView[];
dealer: PlayerId | null;
@@ -522,6 +529,7 @@ function startHand(s: SeotdaState, rng: Rng, events: GameEvent[]): void {
betSeq: 0,
carried: [],
rematchReason: null,
three: o.cardMode === 'three',
rematchSet: [],
rejoinPending: [],
rejoinCost: 0,
@@ -545,6 +553,9 @@ function startHand(s: SeotdaState, rng: Rng, events: GameEvent[]): void {
/** 3장 섯다 (한게임): 2장을 받으면 먼저 1장을 골라 모두에게 보여 준 뒤 첫 베팅. */
const opensFirst = (o: SeotdaOptions) => o.cardMode === 'three' && o.threeOpen;
/** The current (re)match follows the 3장 섯다 flow (a 3장 room's rematch is 2장 섯다). */
const threeHand = (s: SeotdaState, h: SeotdaHand): boolean => h.three ?? s.options.cardMode === 'three';
/** Card shown when the player does not pick one (timeout, left, computer default): the lower month — the higher one stays hidden. */
export function autoOpen(cards: number[]): number {
return [...cards].sort((a, b) => HWATU[a]!.month - HWATU[b]!.month || a - b)[0]!;
@@ -561,6 +572,8 @@ function startRematch(s: SeotdaState, rng: Rng, events: GameEvent[]): void {
h.order = order;
h.phase = 'betting';
h.street = 0;
// 재경기는 2장 섯다로: 3장 섯다 방도 2장을 한 번에 받고 베팅 1번, 공개패·최종 선택 없음.
h.three = false;
h.deck = rng.shuffle(deckOf(s.options));
h.cards = Object.fromEntries(order.map((id) => [id, []]));
h.chosen = Object.fromEntries(order.map((id) => [id, null]));
@@ -582,9 +595,8 @@ function startRematch(s: SeotdaState, rng: Rng, events: GameEvent[]): void {
for (const p of b.players) if (p.stack === 0) p.status = 'allIn';
b.players.push({ id: CARRY, stack: 0, round: 0, total: carriedTotal(h), status: 'out', acted: true, raised: true, mayRaise: false });
events.push({ type: 'handStart', handNo: h.handNo, rematchNo: h.rematchNo, dealer, ante: 0, reason: h.rematchReason });
deal(h, order, firstDealCount(s.options), events);
deal(h, order, s.options.cardMode === 'three' ? 2 : firstDealCount(s.options), events);
h.betting = startRound(b, 0);
if (opensFirst(s.options)) h.phase = 'open';
}
/** Pots of the current match: carried (re-filtered by who is still in) + this match's bets. */
@@ -674,7 +686,7 @@ function settleShowdown(s: SeotdaState, events: GameEvent[]): void {
const evals: Record<PlayerId, HandEval> = {};
const hands: ShowdownHand[] = [];
for (const id of live) {
const pair = (o.cardMode === 'three' ? h.chosen[id] : h.cards[id]) as [number, number];
const pair = (threeHand(s, h) ? h.chosen[id] : h.cards[id]) as [number, number];
const e = evalSeotda(pair[0], pair[1], rules);
evals[id] = e;
hands.push({ id, cards: pair, name: e.name, baseName: e.baseName, value: e.value, special: e.special });
@@ -937,7 +949,7 @@ function progress(s: SeotdaState, rng: Rng, events: GameEvent[]): void {
}
// 3장 섯다(한게임): 2장 → 공개패 1장 → 1구 베팅 → 1장 더 → 2구 베팅 → 3장 중 2장 고르기 → 공개.
// threePick=beforeBet: 1장 더 → 2장 고르기 → 마지막 베팅 → 공개.
if (h.street === 0 && s.options.cardMode === 'three') {
if (h.street === 0 && threeHand(s, h)) {
deal(h, h.order.filter((id) => contendersOf(h).includes(id)), 1, events);
if (s.options.threePick === 'beforeBet') h.phase = 'choose';
else {
@@ -947,11 +959,11 @@ function progress(s: SeotdaState, rng: Rng, events: GameEvent[]): void {
}
continue;
}
if (s.options.cardMode === 'three' && contendersOf(h).some((id) => !h.chosen[id])) {
if (threeHand(s, h) && contendersOf(h).some((id) => !h.chosen[id])) {
h.phase = 'choose';
continue;
}
if (h.street === 0 && s.options.dealMode === 'twoRounds') {
if (h.street === 0 && s.options.cardMode === 'two' && s.options.dealMode === 'twoRounds') {
deal(h, h.order.filter((id) => contendersOf(h).includes(id)), 1, events);
h.street = 1;
h.lastAction = {};
@@ -1353,7 +1365,7 @@ export const seotda: GameDefinition<SeotdaState, SeotdaAction, SeotdaView, Seotd
// 3장 섯다: the 공개패 is face up for everyone; after choosing, others see the two kept cards (the discard stays
// secret, so a 공개패 that was thrown away is no longer shown).
const shown = h?.opened[x.id] ?? null;
const chosen = o.cardMode === 'three' ? (h?.chosen[x.id] ?? null) : null;
const chosen = h && threeHand(s, h) ? (h.chosen[x.id] ?? null) : null;
const kept = chosen ? [...chosen] : cards;
slots = kept.map((c) => (c === shown ? cardView(h!, c) : { hidden: true as const }));
}
@@ -1390,7 +1402,7 @@ export const seotda: GameDefinition<SeotdaState, SeotdaAction, SeotdaView, Seotd
const myCards = h && me ? (h.cards[me] ?? []) : [];
const myChosen = h && me ? (h.chosen[me] ?? null) : null;
if (h && me && myCards.length) {
if (o.cardMode === 'three' && myCards.length === 3) {
if (threeHand(s, h) && myCards.length === 3) {
const best = bestChoice(myCards, rules);
myCombos = combos(myCards).map((c) => {
const e = evalSeotda(c[0], c[1], rules);
@@ -1421,6 +1433,7 @@ export const seotda: GameDefinition<SeotdaState, SeotdaAction, SeotdaView, Seotd
handsPlayed: s.handsPlayed,
rematchNo: h?.rematchNo ?? 0,
rematchReason: h && h.rematchNo > 0 ? h.rematchReason : null,
threeCard: h ? threeHand(s, h) : o.cardMode === 'three',
baseUnit: s.baseUnit,
seats,
dealer: h?.dealer ?? null,

View File

@@ -685,6 +685,48 @@ describe('3장 섯다 (한게임 기본: 2장 → 공개패 1장 → 1구 베팅
expect(c.handName).toBe('18광땡');
});
test('3장 섯다 방의 재경기(구사)는 2장 섯다로: 2장 한 번에, 공개패 없이 베팅 1번 → 바로 공개', () => {
let s = make({ cardMode: 'three' });
s = rig(s, { A: [P(4), S(9)], B: [S(1), P(2)], C: [P(5), P(6)] }, [P(7), P(8)]);
for (const [p, c] of [['A', S(9)], ['B', P(2)], ['C', P(5)]] as const) s = act(s, p, { type: 'open', cardId: c });
s = act(s, 'A', { type: 'check' });
s = act(s, 'B', { type: 'check' });
s = act(s, 'C', { type: 'die' });
s = act(s, 'A', { type: 'check' });
s = act(s, 'B', { type: 'check' });
s = act(s, 'A', { type: 'choose', cardIds: [P(4), S(9)] });
s = act(s, 'B', { type: 'choose', cardIds: [S(1), P(2)] });
expect(s.hand!.showdown!.pots[0]).toMatchObject({ type: 'rematch', reason: 'gusa', winners: ['A', 'B'] });
s = readyAll(s);
const h = s.hand!;
expect([h.rematchNo, h.phase, h.street, h.three]).toEqual([1, 'betting', 0, false]);
expect([h.cards.A!.length, h.cards.B!.length]).toEqual([2, 2]);
const v = seotda.view(s, 'A');
expect(v.threeCard).toBe(false);
expect(v.myCombos).toBeNull();
expect(v.seats.every((x) => x.opening === null)).toBe(true);
// Nothing is face up for the others (no 공개패).
expect(seotda.view(s, 'B').seats.find((x) => x.id === 'A')!.cards).toEqual([{ hidden: true }, { hidden: true }]);
s = rig(s, { A: [S(10), P(10)], B: [P(2), P(3)] }, [S(4)]);
s = act(s, 'A', { type: 'ping' });
s = act(s, 'B', { type: 'call' });
// One betting round, no third card, no choosing: straight to the showdown.
expect(s.hand!.phase).toBe('handEnd');
expect(s.hand!.cards.A).toEqual([S(10), P(10)]);
expect(s.hand!.showdown!.hands.find((x) => x.id === 'A')!.name).toBe('장땡');
expect(s.hand!.showdown!.pots[0]).toMatchObject({ type: 'win', winners: ['A'] });
// The next hand is 3장 섯다 again.
s = readyAll(s);
expect([s.hand!.rematchNo, s.hand!.phase, s.hand!.three]).toEqual([0, 'open', true]);
expect(seotda.view(s, 'A').threeCard).toBe(true);
});
test('이 변경 전에 시작한 3장 재경기(three 없음)는 예전처럼 3장 흐름을 이어 가요', () => {
let s = make({ cardMode: 'three' });
delete s.hand!.three;
expect(seotda.view(s, 'A').threeCard).toBe(true);
});
test('시간 무제한이면 공개패 고르기에도 마감이 없어요', () => {
const s = make({ turnSeconds: null, cardMode: 'three' });
expect(s.hand!.phase).toBe('open');