:root { --cw: 34px; --cwb: 58px; --felt: #0f5d3a; --felt2: #0a4029; --gold: #f2c14e; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--page, #10161d); color: #eef; font-family: -apple-system, "Hiragino Sans", "Noto Sans JP", sans-serif; -webkit-tap-highlight-color: transparent; }
.hidden { display: none !important; }
button { font: inherit; border: 0; border-radius: 10px; padding: 10px 14px; background: #2d3a48; color: #fff; cursor: pointer; }
button.primary { background: #2f8f5b; } button.danger { background: #a33; } button:disabled { opacity: .4; }
input, select { font: inherit; padding: 8px; border-radius: 8px; border: 1px solid #456; background: #1b2530; color: #fff; width: 100%; }
input.tiny { width: 56px; display: inline-block; padding: 4px; }
label { display: block; margin: 8px 0; font-size: 14px; } label.row { display: flex; align-items: center; gap: 6px; } label.row input[type=checkbox] { width: auto; }
#lobby { max-width: 480px; margin: 0 auto; padding: 16px; }
#lobby h1 { font-size: 24px; margin: 8px 0; } #lobby h1 small { font-size: 12px; background: #c84; padding: 2px 6px; border-radius: 6px; vertical-align: middle; }
.sub { color: #9ab; font-size: 13px; }
.box { background: #18212b; border-radius: 12px; padding: 12px; margin: 12px 0; } .box h2 { font-size: 16px; margin: 0 0 6px; }
.box button { width: 100%; margin-top: 6px; }
.rules p, .rules li { font-size: 13px; line-height: 1.6; color: #cde; }

#table { display: flex; flex-direction: column; height: 100%; max-width: 760px; margin: 0 auto; }
header { display: flex; justify-content: space-between; align-items: center; padding: 6px 8px; gap: 6px; }
.hl, .hr { display: flex; align-items: center; gap: 6px; min-width: 0; }
.chip { padding: 6px 10px; font-size: 13px; }
.game { font-weight: bold; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#handInfo { font-size: 12px; color: #9ab; white-space: nowrap; }
#ruleBar { font-size: 11px; color: #bcd; padding: 0 10px 4px; }
#felt { position: relative; flex: 1; min-height: 300px; margin: 4px 8px; }
#tablebg { position: absolute; inset: 0; pointer-events: none; } #tablebg svg { display: block; }
#seats, #center { z-index: 1; } #seats { position: absolute; inset: 0; }
body.light-felt #pot { text-shadow: none; } body.light-felt #street { color: var(--ink); } body.light-felt .card.slot { background: #0000000f; border-color: #0003; }
#center { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); text-align: center; }
#pot { font-weight: bold; color: var(--gold); margin-top: 4px; font-size: 15px; }
#street { font-size: 12px; color: #cfe; }
.cards { display: flex; gap: 3px; justify-content: center; }
.card { width: var(--cw); aspect-ratio: 200/280; border-radius: 4px; background: #fff center/cover no-repeat; box-shadow: 0 1px 3px #0007; position: relative; transition: transform .12s; }
#board .card { --cw: 44px; }
.cards.big .card { width: var(--cwb); cursor: pointer; }
.card.sel { transform: translateY(-14px); outline: 3px solid #f55; }
.card.win { outline: 3px solid var(--gold); }
.card.slot { background: #ffffff14; box-shadow: none; border: 1px dashed #ffffff33; }
.seat { position: absolute; transform: translate(-50%, -50%); width: 108px; text-align: center; font-size: 12px; }
.seat .plate { background: #000a; border-radius: 10px; padding: 3px 4px; border: 2px solid transparent; }
.seat.turn .plate { border-color: var(--gold); box-shadow: 0 0 10px var(--gold); }
.seat.folded { opacity: .45; } .seat.out { opacity: .5; }
.seat .nm { font-weight: bold; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seat .st { color: #9fd; } .seat .tag { font-size: 10px; color: #fc8; }
.seat .bet { color: var(--gold); font-weight: bold; min-height: 15px; }
.seat .cards .card { --cw: 20px; } .seat.showdown .cards .card { --cw: 24px; }
.btn-d { display: inline-block; background: #fff; color: #000; border-radius: 50%; width: 17px; height: 17px; line-height: 17px; font-size: 10px; font-weight: bold; margin-left: 2px; }
.seat.empty .plate { opacity: .5; border: 1px dashed #fff5; }
.seat.empty button { padding: 2px 8px; font-size: 11px; }
#me { text-align: center; padding: 4px; }
#myInfo { font-size: 13px; color: #cde; min-height: 18px; } #myEval { font-size: 12px; color: #fd8; min-height: 16px; margin-top: 4px; }
#actions { padding: 6px 8px calc(8px + env(safe-area-inset-bottom)); display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; min-height: 54px; }
#actions button { flex: 1 1 28%; min-width: 90px; padding: 12px 6px; font-size: 15px; }
#actions .fold { background: #7a2b2b; } #actions .call { background: #2d5f8f; } #actions .raise { background: #2f8f5b; }
#actions .raiseRow { flex-basis: 100%; display: flex; gap: 4px; align-items: center; }
#actions .raiseRow input[type=range] { flex: 1; } #actions .raiseRow input[type=number] { width: 80px; }
#actions .raiseRow button { flex: 0 0 auto; min-width: 0; padding: 6px 8px; font-size: 12px; }
#actions .wait { color: #9ab; font-size: 13px; align-self: center; }
#result { margin: 0 8px; background: #000c; border: 1px solid var(--gold); border-radius: 10px; padding: 6px 10px; font-size: 12px; max-height: 30vh; overflow: auto; }
#result .pot { margin: 3px 0; } #result b { color: var(--gold); }
#menu { position: fixed; inset: 0; background: #000d; padding: 16px; overflow: auto; display: flex; flex-direction: column; gap: 8px; max-width: 520px; margin: 0 auto; z-index: 10; }
#menu .settings { background: #18212b; padding: 10px; border-radius: 10px; display: flex; flex-direction: column; gap: 6px; } #menu h3 { margin: 0; font-size: 14px; }
#log { background: #0b1016; border-radius: 8px; padding: 8px; font-size: 12px; max-height: 220px; overflow: auto; white-space: pre-wrap; color: #bcd; }
#toast { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); background: #c33; color: #fff; padding: 8px 14px; border-radius: 10px; z-index: 20; font-size: 14px; }
.timer { font-size: 11px; color: #fc8; }
@media (min-width: 600px) { :root { --cw: 40px; --cwb: 76px; } #board .card { --cw: 60px; } .seat { width: 140px; font-size: 13px; } .seat .cards .card { --cw: 28px; } }
.seat .cat { display: block; width: 40px; height: 40px; margin: -24px auto 1px; border-radius: 50%; object-fit: cover; background: #0006; }
.seat .cat-fb { font-size: 26px; line-height: 40px; }
.seat.turn .cat { box-shadow: 0 0 10px var(--gold); }
.mycat { width: 28px; height: 28px; border-radius: 50%; vertical-align: middle; margin-right: 4px; object-fit: cover; }
/* mobile fit: overlap opponents' cards so 5 fit inside the seat; avatar below cards */
.seat { width: 96px; }
.seat .cards { gap: 0; margin-bottom: 2px; }
.seat .cards .card + .card { margin-left: -6px; }
.seat.showdown .cards .card + .card { margin-left: -4px; }
.seat .cat { margin: -16px auto 0; width: 36px; height: 36px; }
#codeBtn { white-space: nowrap; }
@media (min-width: 600px) { .seat { width: 140px; } .seat .cards .card + .card { margin-left: 0; } .seat .cards { gap: 3px; } .seat .cat { width: 44px; height: 44px; } }
.rot { display: flex; align-items: center; gap: 6px; white-space: nowrap; } .rot.sub { padding-left: 28px; font-size: 13px; opacity: .85; }

/* CF build: mode select (AI対戦 / 対人戦) */
.modeTabs { display: flex; gap: 8px; margin: 10px 0 4px; }
.modeTab { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 8px; background: #18212b; border: 2px solid #2d3a48; }
.modeTab b { font-size: 17px; } .modeTab span { font-size: 12px; color: #9ab; }
.modeTab.on { border-color: #2f8f5b; background: #1d3328; } .modeTab.on span { color: #cfe; }
body[data-mode="ai"] .pvpOnly, body[data-mode="pvp"] .aiOnly { display: none !important; }
