/* Bong Poker — 화면 모양 (무대 1600×900을 창 크기에 맞춰 통째로 줄이고 늘림 — app.js fit())
   층: 배경 #scene < 캐릭터 #actors < 테이블 #table < 자리 표시 #spots < 팟·보드 < 이름표 #plates < 내 자리 #mine < 효과 #fx < 단추 #hud·#acts < 화면 #screen < 창 #modal
   움직임은 transform·opacity만 (배경색을 움직이는 효과는 만들지 말 것 — 터미널 옆에서 돌 때 그래픽 부담). body.calm = 창이 뒤로 갔을 때 끝없는 효과 멈춤 */
:root {
  --pink: #ff2e88; --pink2: #f25f9a; --orange: #ff8a3c; --gold: #ffd166; --teal: #19e3d0; --mint: #81d8d0;
  --night: #0b0714; --ink: #140b22; --line: rgba(255, 255, 255, .13); --fg: #fff5ec; --muted: #bfb0cf; --faint: #8b7c9c;
  --felt1: #1fa392; --felt2: #0e6a60; --felt3: #06302c;
  --disp: 'Anton', 'Black Han Sans', 'Noto Sans KR', sans-serif; --body: 'Inter', 'Noto Sans KR', sans-serif; --mono: 'DM Mono', ui-monospace, monospace;
  --ease: cubic-bezier(.2, .8, .2, 1);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #07040d; color: var(--fg); font-family: var(--body); font-size: 15px; overflow: hidden; -webkit-font-smoothing: antialiased; user-select: none; }
button, input, select { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
#fit { position: fixed; inset: 0; overflow: hidden; background: #07040d; }
#stage { position: absolute; left: 0; top: 0; width: 1600px; height: 900px; transform-origin: 0 0; overflow: hidden; background: var(--night); }
#stage > * { position: absolute; }
#rotate { display: none; position: fixed; inset: 0; z-index: 99; background: #07040d; align-items: center; justify-content: center; font-size: 64px; }
@media (orientation: portrait) and (max-width: 700px) { #rotate { display: flex; } }

/* ── 배경 ── */
#scene { inset: 0; z-index: 0; }
#scene svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.sc-palm { animation: sway 9s ease-in-out infinite alternate; }
.sc-neon { animation: flick 7s steps(1) infinite; }
.sc-sun, .sc-lamp { animation: glowp 6s ease-in-out infinite alternate; }
.sc-cloud { animation: drift 60s linear infinite alternate; }
.sc-glint { animation: glowp 2.6s ease-in-out infinite alternate; }
.sc-stars { animation: glowp 4s ease-in-out infinite alternate; }
@keyframes sway { from { transform: rotate(-1.4deg); } to { transform: rotate(1.6deg); } }
@keyframes flick { 0%, 100% { opacity: 1; } 41% { opacity: 1; } 42% { opacity: .55; } 43% { opacity: 1; } 77% { opacity: .7; } 78% { opacity: 1; } }
@keyframes glowp { from { opacity: .72; } to { opacity: 1; } }
@keyframes drift { from { transform: translateX(-40px); } to { transform: translateX(60px); } }
body.calm .sc-palm, body.calm .sc-neon, body.calm .sc-sun, body.calm .sc-lamp, body.calm .sc-cloud, body.calm .sc-glint, body.calm .sc-stars, body.calm .actor img, body.calm .logo-glow { animation-play-state: paused; }

/* ── 캐릭터 ── */
#actors { inset: 0; z-index: 1; pointer-events: none; }
.actor { position: absolute; transform: var(--tf, none); transform-origin: 50% 100%; transition: transform .5s var(--ease), filter .4s, opacity .4s; filter: drop-shadow(0 10px 16px rgba(0, 0, 0, .55)); }
.actor img { display: block; height: 100%; width: auto; transform-origin: 50% 100%; animation: breathe 5.2s ease-in-out infinite alternate; }
.actor:nth-child(2n) img { animation-duration: 6.1s; animation-delay: -2s; }
.actor:nth-child(3n) img { animation-duration: 4.6s; animation-delay: -1s; }
@keyframes breathe { from { transform: scale(1, 1); } to { transform: scale(1.006, 1.016); } }
.actor.folded { filter: grayscale(.85) brightness(.38) drop-shadow(0 10px 16px rgba(0, 0, 0, .55)); transform: var(--tf) translateY(14px) scale(.985); }
.actor.turn { filter: brightness(1.12) drop-shadow(0 0 22px rgba(255, 46, 136, .75)); transform: var(--tf) scale(1.035); }
.actor.allin { filter: brightness(1.08) drop-shadow(0 0 26px rgba(255, 138, 60, .9)); }
.actor.win { filter: brightness(1.18) drop-shadow(0 0 30px rgba(255, 209, 102, .95)); animation: hop .5s var(--ease) 2; }
.actor.away { opacity: .45; }
.actor.shake { animation: shake .45s linear; }
@keyframes hop { 50% { transform: var(--tf) translateY(-16px) scale(1.04); } }
@keyframes shake { 20% { transform: var(--tf) translateX(-7px); } 40% { transform: var(--tf) translateX(6px); } 60% { transform: var(--tf) translateX(-4px); } 80% { transform: var(--tf) translateX(3px); } }
.bubble { position: absolute; z-index: 6; min-width: 60px; max-width: 250px; padding: 9px 14px; background: #fff5ec; color: #1a0f26; border-radius: 16px 16px 16px 4px; font: 700 15px/1.3 var(--body); box-shadow: 0 8px 22px rgba(0, 0, 0, .45); transform-origin: 0 100%; animation: pop .28s var(--ease), fadeout .4s 2.4s forwards; pointer-events: none; white-space: nowrap; }
.bubble b { font-size: 22px; margin-right: 6px; vertical-align: -3px; }
@keyframes pop { from { transform: scale(.4); opacity: 0; } }
@keyframes fadeout { to { opacity: 0; transform: translateY(-8px); } }

/* ── 테이블 ── */
#table { left: -300px; top: 440px; width: 2200px; height: 660px; z-index: 2; pointer-events: none; }
#table > * { position: absolute; border-radius: 50%; }
#table .rail { inset: 0; background: radial-gradient(ellipse 70% 60% at 50% 0%, #5a3c4e 0%, #2a1a2c 22%, #120a18 60%, #07040d 100%); box-shadow: inset 0 3px 0 rgba(255, 255, 255, .2), 0 -18px 60px rgba(0, 0, 0, .55); }
#table .neon { left: 28px; right: 28px; top: 13px; height: 640px; border: 3px solid var(--neon, var(--pink)); box-shadow: 0 0 14px var(--neon, var(--pink)), 0 0 44px color-mix(in srgb, var(--neon, var(--pink)) 55%, transparent), inset 0 0 22px color-mix(in srgb, var(--neon, var(--pink)) 50%, transparent); opacity: .95; }
#table .felt { left: 40px; right: 40px; top: 20px; height: 624px; overflow: hidden; background: radial-gradient(ellipse 46% 60% at 50% 34%, var(--felt1) 0%, var(--felt2) 52%, var(--felt3) 100%); box-shadow: inset 0 22px 44px rgba(0, 0, 0, .6), inset 0 0 0 2px rgba(0, 0, 0, .35); }
#table .felt::before { content: ''; position: absolute; inset: 0; opacity: .5; mix-blend-mode: overlay; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .5 0 0 0 0 .5 0 0 0 0 .5 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url(%23n)'/%3E%3C/svg%3E"); }
#table .felt::after { content: ''; position: absolute; left: 20%; right: 20%; top: 6%; height: 62%; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .13); }
.felt-logo { position: absolute; left: 0; right: 0; top: 150px; text-align: center; font: 400 92px/1 var(--disp); font-style: italic; letter-spacing: 6px; color: rgba(255, 255, 255, .11); transform: scaleY(.62); }
.felt-logo i { color: transparent; -webkit-text-stroke: 2px rgba(255, 255, 255, .13); margin-left: 16px; }

/* ── 카드 ── (무대 좌표로 날아다님: --x --y 가운데 자리, --r 기울기, --s 크기) */
#spots { inset: 0; z-index: 3; pointer-events: none; }
#board { inset: 0; z-index: 4; pointer-events: none; }
.card { position: absolute; left: 0; top: 0; width: 96px; height: 134px; margin: -67px 0 0 -48px; transform: translate(var(--x, 800px), var(--y, 380px)) rotate(var(--r, 0deg)) scale(var(--s, 1)); transition: transform .46s var(--ease), opacity .3s, filter .3s; perspective: 600px; }
.card .in { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform .42s var(--ease); }
.card.up .in { transform: rotateY(180deg); }
.card .f, .card .b { position: absolute; inset: 0; border-radius: 9px; backface-visibility: hidden; -webkit-backface-visibility: hidden; box-shadow: 0 6px 14px rgba(0, 0, 0, .5), 0 1px 0 rgba(255, 255, 255, .25) inset; }
.card .b { background: repeating-linear-gradient(45deg, rgba(255, 46, 136, .0) 0 7px, rgba(255, 46, 136, .5) 7px 9px), repeating-linear-gradient(-45deg, rgba(25, 227, 208, 0) 0 7px, rgba(25, 227, 208, .45) 7px 9px), linear-gradient(160deg, #2a1147, #120a22); border: 4px solid #fff5ec; }
.card .b::after { content: 'B'; position: absolute; left: 50%; top: 50%; width: 40px; height: 40px; margin: -20px; border-radius: 50%; background: #120a22; border: 2px solid var(--pink); color: #fff; font: 400 24px/36px var(--disp); font-style: italic; text-align: center; }
.card .f { transform: rotateY(180deg); background: linear-gradient(165deg, #fffdf8, #f1e9dc); color: #17131f; overflow: hidden; }
.card .f.red { color: #e8224f; }
.card .f .rk { position: absolute; left: 8px; top: 3px; font: 400 40px/1 var(--disp); letter-spacing: -1px; }
.card .f .su { position: absolute; left: 9px; top: 44px; font: 400 24px/1 'Segoe UI Symbol', 'Arial Unicode MS', sans-serif; }
.card .f .big { position: absolute; right: 6px; bottom: 0; font: 400 74px/1 'Segoe UI Symbol', 'Arial Unicode MS', sans-serif; opacity: .92; }
.card.dim { filter: brightness(.45) saturate(.6); }
.card.hi { filter: none; }
.card.hi .f { box-shadow: 0 0 0 3px var(--gold), 0 0 26px rgba(255, 209, 102, .9), 0 8px 18px rgba(0, 0, 0, .5); }
.card.gone { opacity: 0; }
.card.mine { z-index: 2; }

/* ── 칩 ── */
.chip { position: absolute; left: 0; width: 24px; height: 24px; border-radius: 50%; background: radial-gradient(circle, var(--c) 0 44%, rgba(255, 255, 255, .85) 45% 52%, transparent 53%), repeating-conic-gradient(#fff 0 14deg, var(--c) 14deg 36deg); box-shadow: 0 3px 0 rgba(0, 0, 0, .5), inset 0 0 0 1.5px rgba(0, 0, 0, .25); }
.bet { position: absolute; left: 0; top: 0; transform: translate(var(--x), var(--y)); transition: transform .5s var(--ease), opacity .3s; }
.bet .stk { position: absolute; left: -12px; top: -12px; width: 24px; height: 24px; }
.bet b { position: absolute; left: 18px; top: -11px; padding: 2px 8px; border-radius: 10px; background: rgba(8, 4, 14, .78); font: 500 14px/18px var(--mono); color: var(--gold); white-space: nowrap; }
.bet.gone { opacity: 0; }
.dbtn { position: absolute; left: 0; top: 0; width: 30px; height: 30px; margin: -15px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff, #e9dcc3); color: #1a0f26; font: 800 14px/30px var(--body); text-align: center; box-shadow: 0 3px 0 #8d7f6a, 0 6px 10px rgba(0, 0, 0, .5); transform: translate(var(--x, 800px), var(--y, 600px)); transition: transform .7s var(--ease); }

/* ── 이름표 ── */

/* ── 내 자리 ── */

/* ── 띠 글자 (FLOP·승자 등) ── */
@keyframes bnin { from { transform: translateX(-50%) skewX(-10deg) scaleX(1.6); opacity: 0; letter-spacing: 26px; } }
#fx { inset: 0; z-index: 8; pointer-events: none; }
.ring { position: absolute; z-index: 7; width: 40px; height: 40px; margin: -20px; border-radius: 50%; border: 6px solid var(--orange); pointer-events: none; animation: ring .8s ease-out forwards; }
@keyframes ring { to { transform: scale(16); opacity: 0; border-width: 1px; } }

/* ── 위 줄·단추 ── */


/* ── 기다리는 방(로비) 창 ── */

/* ── 공통 단추·입력 ── */
select.inp option { background: #1a0f26; color: #fff; }

/* ── 화면 (홈·혼자·같이·캐릭터) ── */
@keyframes heroin { from { transform: translateX(60px); opacity: 0; } }

/* 혼자 하기 — 장소 카드 */
.face { width: 46px; height: 46px; margin-right: -8px; border-radius: 50%; background: #2a1a3c center 12% / 190% no-repeat; border: 2px solid var(--c, #fff); }

/* 같이 하기 */

/* 캐릭터 고르기 */

/* ── 창 ── */
@media (prefers-reduced-motion: reduce) { .sc-palm, .sc-neon, .sc-sun, .sc-lamp, .sc-cloud, .sc-glint, .sc-stars, .actor img, .logo-glow { animation: none; } }

/* ── 3D 판 (2026-11-18): 맨 아래 3D 캔버스 #g3 위에 글자를 얹음. 이름표·금액은 app.js layout()이 --px·--py / transform으로 캐릭터·칩 자리에 맞춤 ── */
#g3 { position: absolute; left: 0; top: 0; z-index: 0; display: block; }
#board .card .f, #board .card .b { box-shadow: 0 8px 18px rgba(0, 0, 0, .6); }

/* 이름표의 캐릭터 색은 이름 앞 작은 점으로 (한쪽 두꺼운 색 테두리 대신) */

/* 11-19 캐릭터 14명: 고르기 칸을 다섯 줄로(세 단), 얼굴은 미리 찍어 둔 정사각 그림(img/face/<열쇠>.webp)이라 칸 위쪽을 꽉 채움 */
.face { background-position: center 20%; background-size: cover; }

/* 11-19 혼자 하기: 방과 판돈을 따로 고름 — 제목 아래 판돈 줄, 그 아래 방 카드 네 장(잠금 없음) */
