/* 지하 도박장 (js/ui/CasinoView.js) — 초록 펠트는 쓰지 않는다. 포도주빛 바닥 + 황동 */
.casino { position: absolute; inset: 0; overflow-y: auto; padding: 58px 14px 16px; display: flex; flex-direction: column; gap: 10px; color: #f0e3cc;
  background: radial-gradient(ellipse at 50% 30%, #3a1420 0%, #1e0a10 60%, #0c0508 100%); font-family: var(--btn-font, 'Noto Sans KR', sans-serif); }
.cs-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; flex-wrap: wrap; border-bottom: 2px double rgba(227, 176, 78, .55); padding-bottom: 8px; }
.cs-head h2 { margin: 0; font-size: 24px; letter-spacing: .08em; color: #f0c766; text-shadow: 0 2px 0 #000; }
.cs-head h2 small { font-size: 13px; color: #cdb48a; letter-spacing: .04em; }
.cs-purse { display: flex; align-items: baseline; gap: 8px; }
.cs-purse span { color: #cdb48a; font-size: 13px; }
.cs-purse b { font-size: 22px; color: #ffe08a; }
.cs-purse em { font-style: normal; font-size: 12px; color: #cdb48a; }
.cs-purse em.bad { color: #ff9a86; }
.cs-tab { flex: 1 1 auto; min-width: 84px; padding: 9px 8px; border: 2px solid #5a2a34; border-radius: 4px; background: #2c1018; color: #e6d3ae; font: inherit; font-weight: 700; cursor: pointer; }
.cs-tab i { font-style: normal; margin-right: 5px; }
.cs-tab.on { background: #6a2434; border-color: #e3b04e; color: #fff0c8; }
.cs-tab:disabled:not(.on) { opacity: .45; cursor: default; }
.cs-hint { margin: 0; font-size: 13px; color: #cdb48a; }
.cs-table { min-height: 210px; border: 2px solid #7a5a2a; border-radius: 8px; padding: 14px 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  background: radial-gradient(ellipse at 50% 40%, #5a1a2c 0%, #3a0f1c 75%); box-shadow: inset 0 0 30px rgba(0, 0, 0, .55); }
.cs-row { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; align-items: center; }
.cs-row .pbtn, .cs-foot .pbtn { min-height: 44px; }
.cs-play small { display: block; font-size: 11px; opacity: .8; font-weight: 400; }
.cs-play.red { background: #8a2a2a; color: #fff; }
.cs-play.black { background: #1c1a1e; color: #fff; }
.cs-play.gold { background: #e3b04e; color: #23140a; }
.cs-note { margin: 0; font-size: 12.5px; color: #cdb48a; text-align: center; }
.cs-num label { font-size: 13px; color: #e6d3ae; }
.cs-num input { width: 64px; padding: 8px; font: inherit; text-align: center; border-radius: 3px; border: 2px solid #7a5a2a; background: #200c12; color: #fff0c8; }
.cs-stake { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: center; padding: 8px 10px; border-radius: 6px; background: rgba(0, 0, 0, .28); }
.cs-stake label { font-weight: 700; color: #f0c766; }
.cs-stake input { width: 110px; padding: 8px; font: inherit; font-size: 18px; text-align: right; border-radius: 3px; border: 2px solid #e3b04e; background: #200c12; color: #ffe9a8; }
.cs-chips { display: flex; gap: 5px; flex-wrap: wrap; }
.cs-broke { margin: 0; color: #ff9a86; font-size: 13px; }
.cs-result { margin: 0; text-align: center; font-size: 15px; padding: 6px 10px; border-radius: 4px; background: rgba(0, 0, 0, .3); }
.cs-result b { font-size: 20px; margin-right: 6px; }
.cs-result.w b { color: #ffe08a; }
.cs-result.l b { color: #ff9a86; }
.cs-log { list-style: none; margin: 0; padding: 0; font-size: 12.5px; color: #b89e78; display: flex; flex-direction: column; gap: 2px; }
.cs-log li.w { color: #e8cf8a; }
.cs-log li.l { color: #b57a70; }
.cs-foot { margin-top: auto; padding-top: 6px; }
.cs-foot .pbtn { max-width: 560px; margin-inline: auto; display: block; }

/* 동전 */
.cs-coin { width: 104px; height: 108px; font-size: 0; background: url(../assets/casino/coin_heads.png) center / contain no-repeat; filter: drop-shadow(0 8px 8px rgba(0, 0, 0, .55)); image-rendering: pixelated; }
.cs-coin.tails { background-image: url(../assets/casino/coin_tails.png); }
.cs-coin.idle { opacity: .75; }
.cs-coin.flip { animation: cs-flip .9s ease-out; }
@keyframes cs-flip { 0% { transform: translateY(0) rotateX(0); } 40% { transform: translateY(-70px) rotateX(720deg); } 100% { transform: translateY(0) rotateX(1440deg); } }
/* 주사위 */
.cs-dice { display: flex; align-items: center; gap: 12px; }
.cs-die { font-size: 84px; line-height: 1; color: #fff5dc; text-shadow: 0 4px 0 #000, 0 0 12px rgba(255, 224, 138, .35); }
.cs-die.roll { animation: cs-roll .8s ease-out; }
.cs-dice b { font-size: 34px; color: #ffe08a; margin-left: 6px; }
@keyframes cs-roll { 0% { transform: rotate(0) translateY(-40px); opacity: 0; } 60% { transform: rotate(540deg) translateY(4px); opacity: 1; } 100% { transform: rotate(720deg) translateY(0); } }
/* 룰렛 */
.cs-ball-num { width: 92px; height: 92px; border-radius: 50%; display: grid; place-items: center; font-size: 38px; font-weight: 900; color: #fff; border: 5px solid #e3b04e; box-shadow: 0 6px 16px rgba(0, 0, 0, .5); }
.cs-ball-num.red { background: #a22a2a; } .cs-ball-num.black { background: #1c1a1e; } .cs-ball-num.green { background: #2a5a5a; } .cs-ball-num.idle { background: #3a1a22; opacity: .6; }
.cs-ball-num.spin { animation: cs-spin 1s ease-out; }
@keyframes cs-spin { 0% { transform: rotate(-720deg) scale(.4); opacity: 0; } 100% { transform: none; opacity: 1; } }
/* 카드 */
/* 야바위 */
.cs-shell { position: relative; width: min(320px, 92%); height: 130px; }
.cs-slot { position: absolute; bottom: 0; left: calc(var(--slot) * 33.333% + 3%); width: 27%; height: 100%; transition: left .3s ease-in-out; }
.cs-cup { position: absolute; left: 0; right: 0; bottom: 0; height: 104px; transition: transform .35s ease;
  background: url(../assets/casino/cup.png) center bottom / contain no-repeat; filter: drop-shadow(0 6px 5px rgba(0, 0, 0, .5)); image-rendering: pixelated; }
.cs-slot.lift .cs-cup { transform: translateY(-58px); }
.cs-slot.pickable { cursor: pointer; }
.cs-slot.pickable:hover .cs-cup { filter: brightness(1.2) drop-shadow(0 6px 5px rgba(0, 0, 0, .5)); transform: translateY(-8px); }
.cs-slot.mine .cs-cup { outline: 0; filter: drop-shadow(0 0 8px #ffe08a); }
.cs-ball { position: absolute; left: 50%; bottom: 4px; width: 30px; height: 30px; margin-left: -15px; background: url(../assets/casino/ball.png) center / contain no-repeat; filter: drop-shadow(0 4px 4px rgba(0, 0, 0, .5)); image-rendering: pixelated; }
.cs-shell-msg { min-height: 1.4em; }
@media (prefers-reduced-motion: reduce) { .cs-coin.flip, .cs-die.roll, .cs-ball-num.spin { animation: none; } .cs-slot { transition: none; } }
.bottom-bar .pbtn[data-act="cs-open"] { white-space: nowrap; flex: 0 0 auto; }

/* 로비 · 테이블 고르기 */
.cs-ask { margin: 0; font-size: 16px; font-weight: 700; color: #f0c766; }
.cs-seat { display: flex; align-items: center; gap: 10px; }
.cs-seat b { color: #ffe08a; font-size: 16px; }
/* 해금 알림 */
.cs-notice { position: fixed; left: 50%; top: 14px; z-index: 9999; transform: translate(-50%, -140%); transition: transform .45s cubic-bezier(.2, 1.2, .4, 1); display: flex; align-items: center; gap: 12px; padding: 12px 18px; max-width: min(92vw, 420px);
  border: 2px solid #e3b04e; border-radius: 8px; background: linear-gradient(180deg, #4a1424, #2a0c14); color: #fff0c8; box-shadow: 0 8px 26px rgba(0, 0, 0, .6); cursor: pointer; }
.cs-notice.on { transform: translate(-50%, 0); }
.cs-notice i { font-style: normal; font-size: 30px; }
.cs-notice b { display: block; font-size: 16px; color: #ffe08a; }
.cs-notice small { display: block; font-size: 12.5px; color: #e6d3ae; margin-top: 2px; }
.casino > * { flex-shrink: 0; }

/* 단속 */
.cs-say { margin: 4px 2px 10px; font-size: 15.5px; line-height: 1.7; color: #fff0c8; padding: 10px 12px; border-left: 3px solid #e3b04e; background: rgba(0, 0, 0, .28); }
.cs-say b { display: block; color: #ffe08a; font-size: 13px; margin-bottom: 2px; }
@keyframes cs-shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

/* 큰 판 — 분위기가 다르다: 검붉은 어둠, 심장 뛰는 진동 */
.casino.cs-big { background: radial-gradient(ellipse at 50% 35%, #3a0810 0%, #14030a 65%, #050103 100%); align-items: center; }
.cs-sys { margin: 4px 0; padding: 12px 16px; text-align: center; font-size: 16px; font-weight: 700; color: #ffe08a; border: 2px solid #e3b04e; border-radius: 4px; background: rgba(0, 0, 0, .55); letter-spacing: .02em; animation: cs-pulse 1.4s ease-in-out infinite; }
@keyframes cs-pulse { 0%, 100% { box-shadow: 0 0 0 rgba(227, 176, 78, 0); } 50% { box-shadow: 0 0 18px rgba(227, 176, 78, .55); } }
.cs-coin.big { width: 132px; height: 138px; }
.cs-coin.big.air { animation: cs-air 2.3s cubic-bezier(.2, .7, .3, 1) forwards; }
.cs-coin.big.air.frozen { animation: none; transform: translateY(-110px) rotateX(35deg); }
@keyframes cs-air { 0% { transform: translateY(120px) rotateX(0); } 60% { transform: translateY(-110px) rotateX(1440deg); } 100% { transform: translateY(-110px) rotateX(2160deg); } }
.casino.cs-big.tossing { animation: cs-heart 0.9s ease-in-out infinite; }
@keyframes cs-heart { 0%, 100% { background-color: #050103; } 50% { background-color: #1a0308; } }
.casino.cs-big.burst { background: #fff; animation: cs-flash .5s ease-out forwards; }
@keyframes cs-flash { 0% { background: #fff; } 100% { background: #3a0810; } }

/* ── 홀 · 장면 (v2) — 도박장 안에 들어선 느낌: 홀 그림을 배경으로 깔고, 그림 속 테이블을 눌러 앉는다 ── */
.casino { background: linear-gradient(rgba(14, 5, 9, .88), rgba(10, 3, 6, .94)), url(../assets/casino/lobby.jpg) center / cover no-repeat, #0c0508; }
.cs-hallwrap { margin: 0 -14px; overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; }
.cs-hall { position: relative; width: max(100%, calc(56vh * 1.793)); aspect-ratio: 1280 / 714; border-block: 2px solid #7a5a2a; box-shadow: 0 8px 22px rgba(0, 0, 0, .6); }
.cs-hall-art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; pointer-events: none; }
.cs-spot { cursor: pointer; }
.cs-spot .spot-label { opacity: 1; transform: none; font-size: 12px; color: #fff0c8; border-color: #b8902c; background: rgba(20, 6, 10, .85); }
.cs-spot:hover { border-color: rgba(240, 199, 102, .95); background: rgba(240, 199, 102, .14); box-shadow: 0 0 22px rgba(240, 199, 102, .45) inset, 0 0 14px rgba(240, 199, 102, .35); }
.cs-bigspot { border-color: rgba(255, 140, 110, .7); }
.cs-bigspot .spot-label { background: rgba(120, 20, 30, .92); border-color: #ff9a86; }
.cs-lobby .cs-ask { text-align: center; }
.cs-seat img { height: 44px; image-rendering: pixelated; filter: drop-shadow(0 3px 3px rgba(0, 0, 0, .6)); }
/* 장면 그림 (단속 · 큰 판) — 엔딩 앨범 그림을 크게 */
.casino.cs-cine { align-items: stretch; }
.cs-scene { position: relative; margin: 0 -14px; height: clamp(240px, 50vh, 560px); overflow: hidden; border-block: 2px solid #7a5a2a; background: #000; }
.cs-scene img { width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; display: block; }
.cs-scene::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0, 0, 0, 0) 55%, rgba(8, 2, 4, .85)); pointer-events: none; }
.cs-scene.dim img { filter: brightness(.7) saturate(1.2); }
.cs-scene.heart img { animation: cs-heartimg .9s ease-in-out infinite; }
@keyframes cs-heartimg { 50% { filter: brightness(.45) saturate(1.4); transform: scale(1.02); } }
.cs-scene.shake { animation: cs-shake .35s 3; }
.cs-scene.flash::before { content: ''; position: absolute; inset: 0; z-index: 2; background: #fff; animation: cs-flashout .6s ease-out forwards; pointer-events: none; }
@keyframes cs-flashout { to { opacity: 0; } }
.cs-scene-title { position: absolute; left: 16px; bottom: 10px; z-index: 3; font-size: 30px; letter-spacing: .12em; color: #ff9a86; text-shadow: 0 3px 0 #000, 0 0 16px rgba(0, 0, 0, .9); }
.cs-scene .on-scene { position: absolute; left: 50%; top: 50%; z-index: 3; margin: -69px 0 0 -66px; }
.casino.cs-big.burst { background: #0c0508; animation: none; }

/* ── 입장 — 돌계단 → 문지기 (그림은 제미나이) ── */
.cs-scene.cs-dolly img { animation: cs-dolly 1.4s ease-out both; transform-origin: 50% 60%; }
@keyframes cs-dolly { from { transform: scale(1.1); filter: brightness(.4); } to { transform: scale(1); filter: none; } }
.cs-enter-descend.quick { cursor: pointer; }
.cs-enter-descend.quick .cs-scene { animation: cs-scene-quick .9s ease-in both; }
@keyframes cs-scene-quick { from { opacity: 0; } 20% { opacity: 1; } to { opacity: 1; } }
.cs-swipe { display: none; margin: -4px 0 0; text-align: center; font-size: 12px; color: #b89e78; }
@media (max-aspect-ratio: 1/1) { .cs-swipe { display: block; } }
.cs-scene .cs-coin.big.idle.on-scene { width: 80px; height: 84px; top: 70%; margin: -42px 0 0 -40px; opacity: 1; filter: drop-shadow(0 0 14px rgba(255, 224, 138, .7)); }
/* 넓은 화면: 다른 화면처럼 660px 가운데 칸에 가두지 않고 무대 전체를 도박장으로 */
#stage #ui > .casino { width: auto; align-self: stretch; }
.casino > * { width: 100%; max-width: 1000px; margin-inline: auto; flex-shrink: 0; }
@media (min-aspect-ratio: 1/1) {
  .cs-hallwrap { margin-inline: auto; overflow: visible; }
  .cs-hall { width: min(100%, calc((100vh - 250px) * 1.793)); margin: 0 auto; border: 2px solid #7a5a2a; border-radius: 6px; overflow: hidden; }
  .cs-scene { margin-inline: auto; border: 2px solid #7a5a2a; border-radius: 6px; height: clamp(260px, 56vh, 620px); }
}

/* 앉은 테이블 — 그 테이블 그림을 판 밑에 깔고, 홀 그림이 뒤에 비친다 */
.casino:not(.cs-cine) { background: linear-gradient(rgba(14, 5, 9, .72), rgba(10, 3, 6, .9)), url(../assets/casino/lobby.jpg) center / cover no-repeat, #0c0508; }
.cs-table { min-height: 260px; }

/* 카드 업다운 */
.ud { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.ud-main { display: flex; align-items: center; justify-content: center; gap: 18px; }
.ud-card { position: relative; width: 96px; height: 136px; border-radius: 10px; background: linear-gradient(160deg, #fffaf0, #efe2c4); color: #1c1a1e; border: 2px solid #3a2a1a;
  box-shadow: 0 8px 16px rgba(0, 0, 0, .55), inset 0 0 0 4px #fffaf0, inset 0 0 0 5px #c8a86a; font-family: Georgia, 'Nanum Myeongjo', serif; }
.ud-card.red { color: #b0242a; }
.ud-card > b { position: absolute; inset: 0; display: grid; place-items: center; font-size: 54px; line-height: 1; }
.ud-c1, .ud-c2 { position: absolute; display: flex; flex-direction: column; align-items: center; font-weight: 900; font-size: 20px; line-height: 1; }
.ud-c1 i, .ud-c2 i { font-style: normal; font-size: 15px; }
.ud-c1 { left: 8px; top: 8px; } .ud-c2 { right: 8px; bottom: 8px; transform: rotate(180deg); }
.ud-card.back { background: url(../assets/casino/card_back.png) center / 100% 100% no-repeat; box-shadow: 0 8px 16px rgba(0, 0, 0, .55); image-rendering: pixelated; border: 0; }
.ud-card.back.deck { box-shadow: 3px 3px 0 #2a0c14, 6px 6px 0 #4a1a26, 9px 9px 0 #2a0c14, 0 12px 20px rgba(0, 0, 0, .6); }
.ud-card.back.next { animation: ud-bob 1.6s ease-in-out infinite; }
@keyframes ud-bob { 50% { transform: translateY(-5px) rotate(1.5deg); } }
.ud-card.flip { animation: ud-flip .45s ease-out; }
@keyframes ud-flip { from { transform: rotateY(90deg) scale(.9); } to { transform: none; } }
.ud-card.hit { box-shadow: 0 0 0 3px #ffe08a, 0 0 26px rgba(255, 224, 138, .8), inset 0 0 0 4px #fffaf0, inset 0 0 0 5px #c8a86a; }
.ud-card.bust { box-shadow: 0 0 0 3px #ff5a44, 0 0 26px rgba(255, 90, 68, .7), inset 0 0 0 4px #fffaf0; filter: saturate(.8); }
.ud-card.mini { width: 40px; height: 56px; border-radius: 5px; box-shadow: 0 3px 6px rgba(0, 0, 0, .5), inset 0 0 0 2px #fffaf0; }
.ud-card.mini > b { font-size: 22px; } .ud-card.mini .ud-c1 { font-size: 11px; left: 4px; top: 3px; } .ud-card.mini .ud-c1 i { font-size: 9px; } .ud-card.mini .ud-c2 { display: none; }
.ud-vs { font-size: 32px; font-weight: 900; color: #f0c766; text-shadow: 0 2px 0 #000; }
.ud-vs.lose { color: #ff7a66; }
.ud-trail { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; justify-content: center; opacity: .9; }
.ud-step { font-style: normal; color: #ffe08a; font-weight: 900; }
.ud-more { font-size: 12px; color: #cdb48a; margin-right: 4px; }
.ud-meter { display: flex; align-items: baseline; gap: 14px; padding: 6px 14px; border-radius: 20px; background: rgba(0, 0, 0, .45); border: 1px solid #7a5a2a; font-size: 13px; color: #e6d3ae; }
.ud-meter b { font-size: 24px; color: #ffe08a; }
.ud-meter em { font-style: normal; font-weight: 700; color: #ffe08a; }
.ud-btns { display: flex; gap: 10px; width: min(100%, 420px); }
.ud-btn { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 6px; border-radius: 8px; cursor: pointer; font: inherit; color: #fff4dc;
  border: 2px solid #1a0a0e; box-shadow: 0 4px 0 #1a0a0e; transition: transform .08s; }
.ud-btn:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 #1a0a0e; }
.ud-btn.hi { background: linear-gradient(#3e6aa0, #274a78); }
.ud-btn.lo { background: linear-gradient(#a8443a, #7a2a24); }
.ud-btn:disabled { filter: grayscale(1) brightness(.6); cursor: default; }
.ud-arrow { font-size: 22px; line-height: 1; }
.ud-btn b { font-size: 17px; }
.ud-btn small { font-size: 11.5px; opacity: .9; }
.ud-cash { min-height: 44px; width: min(100%, 420px); }
.ud-cashed { margin: 0; font-size: 14px; color: #ffe08a; }
.ud-cash:not(:disabled) { background: linear-gradient(#f0c766, #c8902c); color: #23140a; border-color: #3d2508; }

/* 야바위 — 자리를 바꾸는 두 컵이 서로를 뚫고 지나가지 않게 앞뒤로 호를 그린다 */
.cs-slot { transition: left .32s ease-in-out; }
.cs-slot.arc-front { z-index: 3; }
.cs-slot.arc-back { z-index: 1; }
.cs-slot.arc-front .cs-cup { animation: cs-arc-front .32s ease-in-out; }
.cs-slot.arc-back .cs-cup { animation: cs-arc-back .32s ease-in-out; }
@keyframes cs-arc-front { 50% { transform: translateY(14px) scale(1.1); } }
@keyframes cs-arc-back { 50% { transform: translateY(-18px) scale(.86); filter: brightness(.7) drop-shadow(0 6px 5px rgba(0, 0, 0, .5)); } }
.cs-slot.arc-front .cs-ball, .cs-slot.arc-back .cs-ball { opacity: 0; }
.cs-table { background: radial-gradient(ellipse at 50% 40%, rgba(110, 30, 50, .92) 0%, rgba(58, 15, 28, .95) 70%), repeating-linear-gradient(45deg, rgba(0, 0, 0, .05) 0 2px, transparent 2px 5px); border-radius: 60px / 40px; border: 6px solid #5a3418; box-shadow: inset 0 0 0 2px #c8a86a, inset 0 0 40px rgba(0, 0, 0, .6), 0 10px 24px rgba(0, 0, 0, .6); }

/* ── 승패 연출 (CasinoView fxHtml) — 결과가 드러나는 순간(--fxd, 게임마다 다름)에 터진다 ── */
.cs-table { position: relative; }
.cs-fx { position: absolute; left: 50%; top: 45%; width: 0; height: 0; pointer-events: none; z-index: 5; }
.cs-fx i { position: absolute; left: -14px; top: -14px; width: 28px; height: 28px; opacity: 0; image-rendering: pixelated;
  background: url(../assets/casino/coin_heads.png) center / contain no-repeat; filter: drop-shadow(0 3px 2px rgba(0, 0, 0, .6));
  animation: cs-fx-burst 1.15s cubic-bezier(.2, .7, .4, 1) calc(var(--fxd, 0s) + var(--t, 0s)) forwards; }
@keyframes cs-fx-burst {
  0% { opacity: 0; transform: translate(0, 0) scale(.3) rotate(0); }
  12% { opacity: 1; }
  60% { opacity: 1; transform: translate(var(--x), var(--y)) scale(var(--s, 1)) rotate(var(--r)); }
  100% { opacity: 0; transform: translate(var(--x), calc(var(--y) + 90px)) scale(var(--s, 1)) rotate(var(--r)); } }
.cs-fx.jackpot i { width: 34px; height: 34px; left: -17px; top: -17px; animation-duration: 1.6s; }
.cs-fx.lose i { filter: brightness(.55) saturate(.6); animation: cs-fx-sweep .8s ease-in calc(var(--fxd, 0s) + var(--t, 0s)) forwards; }
@keyframes cs-fx-sweep { 0% { opacity: 0; transform: translate(0, 0); } 15% { opacity: .9; } 100% { opacity: 0; transform: translate(calc(var(--x) + 120px), 110px) rotate(var(--r)) scale(.7); } }
.casino.fx-win .cs-table { animation: cs-fx-glow 1s ease-out var(--fxd) both; }
.casino.fx-jackpot .cs-table { animation: cs-fx-glow 1.6s ease-out var(--fxd) both; }
@keyframes cs-fx-glow {
  0% { box-shadow: inset 0 0 30px rgba(0, 0, 0, .55); }
  25% { box-shadow: inset 0 0 30px rgba(0, 0, 0, .55), 0 0 0 3px #ffe08a, 0 0 46px rgba(255, 210, 110, .8); }
  100% { box-shadow: inset 0 0 30px rgba(0, 0, 0, .55); } }
.casino.fx-jackpot { animation: cs-shake .32s var(--fxd) 3; }
.casino.fx-jackpot::before { content: ''; position: fixed; inset: 0; z-index: 50; pointer-events: none; opacity: 0;
  background: radial-gradient(ellipse at 50% 45%, rgba(255, 224, 138, .55), rgba(255, 180, 60, .15) 45%, transparent 70%);
  animation: cs-fx-flash 1.4s ease-out var(--fxd) forwards; }
@keyframes cs-fx-flash { 0% { opacity: 0; } 15% { opacity: 1; } 100% { opacity: 0; } }
.casino.fx-lose .cs-table { animation: cs-fx-lose .7s ease-out var(--fxd) both; }
@keyframes cs-fx-lose {
  0% { box-shadow: inset 0 0 30px rgba(0, 0, 0, .55); transform: none; }
  20% { box-shadow: inset 0 0 60px rgba(160, 20, 30, .85); transform: translateX(-5px); }
  40% { transform: translateX(5px); } 60% { transform: translateX(-3px); }
  100% { box-shadow: inset 0 0 30px rgba(0, 0, 0, .55); transform: none; } }
.cs-result.pop { opacity: 0; animation: cs-pop .45s cubic-bezier(.2, 1.4, .4, 1) var(--fxd) forwards; }
.casino.fx-jackpot .cs-result.pop b { font-size: 26px; text-shadow: 0 0 14px rgba(255, 210, 110, .8); }
@keyframes cs-pop { from { opacity: 0; transform: scale(.7); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .cs-fx { display: none; }
  .casino.fx-jackpot, .casino.fx-lose .cs-table, .casino.fx-win .cs-table, .casino.fx-jackpot .cs-table { animation: none; }
  .cs-result.pop { opacity: 1; animation: none; }
}

/* ── 「도박의 끝」 흐름 — 말하는 사람 얼굴 · 차례로 떠오르는 대사 · 종 장면 ── */
.cs-say.has-face { display: flex; gap: 12px; align-items: flex-start; }
.cs-say.has-face > span { flex: 1; min-width: 0; }
.cs-face { flex: none; width: 64px; border-radius: 4px; background-repeat: no-repeat; image-rendering: pixelated; background-color: #1a0a10;
  box-shadow: 0 0 0 2px #7a5a2a, 0 3px 8px rgba(0, 0, 0, .6); }
.cs-stagger .cs-say { animation: cs-rise .5s ease-out 1.7s both; }
.cs-stagger .cs-foot { animation: cs-rise .4s ease-out 2.3s both; }
@keyframes cs-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.cs-scene.cs-bellshot img { object-position: 50% 24%; animation: cs-bell-pan 3.4s ease-out both; }
@keyframes cs-bell-pan { from { object-position: 50% 12%; filter: brightness(.35); } to { object-position: 50% 24%; filter: none; } }
.casino.cs-big.bell { cursor: pointer; }
@media (prefers-reduced-motion: reduce) { .cs-stagger .cs-say, .cs-stagger .cs-foot, .cs-scene.cs-bellshot img { animation: none; }
}
.cs-scene.cs-guardshot img { object-position: 66% 50%; } /* 좁은 화면에서도 오른쪽 위의 종이 잘리지 않게 */
/* 도박장 층(.casino, 화면 전체)이 HUD 를 덮어 날짜·금고 숫자가 안 보이던 것 — HUD 를 그 위로 */
#ui > .casino ~ .hud { position: relative; z-index: 6; }

/* ── 테이블 · 게임 버튼 · 판돈 · 칩 — 시안 1번(포커 칩과 황동 명판) ── */
.cs-table { border-radius: 10px; border: 2px solid #7a5a2a; background: radial-gradient(ellipse at 50% 40%, #5a1a2c 0%, #3a0f1c 75%); box-shadow: inset 0 0 30px rgba(0, 0, 0, .55); }
.pbtn.cs-play, .cs-num .pbtn { border-image: none; border: 2px solid #e3b04e; border-radius: 2px; min-width: 74px; min-height: 42px; padding: 8px 12px;
  background: transparent; color: #f6e2b0; letter-spacing: .04em; text-shadow: 0 1px 0 #000;
  box-shadow: inset 0 0 0 3px rgba(0, 0, 0, .3), inset 0 0 0 4px rgba(227, 176, 78, .35); }
.pbtn.cs-play:hover:not(:disabled) { border-image: none; background: rgba(227, 176, 78, .18); filter: none; }
.pbtn.cs-play:active:not(:disabled) { border-image: none; transform: translateY(2px); }
.pbtn.cs-play.red { background: #7a1a1e; color: #fff0d8; }
.pbtn.cs-play.black { background: #141014; color: #fff0d8; }
.pbtn.cs-play.gold, .ud-cash:not(:disabled) { border-image: none; background: linear-gradient(#f3d48a, #c4913c); color: #2a1808; border: 2px solid #8a5f1a; text-shadow: none;
  box-shadow: inset 0 1px 0 #fff3c4, inset 0 -2px 0 #8a5f1a, 0 2px 0 rgba(0, 0, 0, .5); }
.pbtn.cs-play.red:hover:not(:disabled), .pbtn.cs-play.black:hover:not(:disabled), .pbtn.cs-play.gold:hover:not(:disabled) { filter: brightness(1.12); }
.ud-btn { border: 2px solid #e3b04e !important; border-radius: 2px !important; box-shadow: inset 0 0 0 3px rgba(0, 0, 0, .3), inset 0 0 0 4px rgba(227, 176, 78, .35) !important; }
.cs-stake input, .cs-num input { border: 0; border-radius: 3px; font-weight: 700; color: #2a1808; background: linear-gradient(#f3d48a, #c4913c); box-shadow: inset 0 2px 3px rgba(90, 50, 10, .5), 0 0 0 1px #4a300c; }
.cs-stake input { width: 120px; font-size: 20px; }
.cs-chips { gap: 6px; align-items: center; }
.mini.cs-chip { border-image: none; border: 0; min-height: 0; width: 46px; height: 46px; padding: 0; border-radius: 50%; color: #fff; font-weight: 800; font-size: 13px; text-shadow: 0 1px 0 rgba(0, 0, 0, .6);
  background: radial-gradient(circle, var(--c) 0 55%, transparent 56%), repeating-conic-gradient(var(--c) 0 20deg, #f4ecdc 20deg 40deg);
  box-shadow: inset 0 0 0 3px var(--c), 0 3px 0 rgba(0, 0, 0, .5); }
.mini.cs-chip.c10 { --c: #6a6a72; } .mini.cs-chip.c50 { --c: #a82a2a; } .mini.cs-chip.c100 { --c: #2a4a8a; } .mini.cs-chip.c500 { --c: #1a1418; color: #f3d48a; }
.mini.cs-chip.word { width: auto; height: auto; padding: 7px 12px; border-radius: 14px; background: linear-gradient(#f3d48a, #c4913c); color: #2a1808; text-shadow: none; box-shadow: 0 2px 0 #6a4610; }
.mini.cs-chip:hover:not(:disabled) { border-image: none; filter: brightness(1.15); transform: translateY(-2px); }
.mini.cs-chip:active:not(:disabled) { border-image: none; transform: translateY(1px); }

/* ── 만화 칸 (v0.9.17) — 컷씬마다: 테두리 두른 그림 한 칸 + 칸 모서리에 걸친 해설 상자 + 칸 아래 말풍선 ── */
.cs-panel { position: relative; margin: 0; width: 100%; max-width: 1000px; margin-inline: auto; flex-shrink: 0; }
.cs-panel .cs-scene { border: 3px solid #0a0506; border-radius: 3px; box-shadow: 0 0 0 3px #e9dcc0, 0 0 0 5px #0a0506, 0 10px 24px rgba(0, 0, 0, .7); margin: 5px auto 0; }
.cs-panel .cs-scene::after { background: linear-gradient(180deg, rgba(0, 0, 0, 0) 70%, rgba(8, 2, 4, .45)); }
.cs-cap { position: absolute; left: 10px; bottom: -14px; z-index: 5; max-width: min(78%, 560px); margin: 0; padding: 8px 12px; background: #f3e6c4; color: #2a1a10;
  border: 2px solid #0a0506; box-shadow: 3px 3px 0 #0a0506; font-family: var(--serif, 'Gowun Batang', serif); font-size: 14px; line-height: 1.55; }
.cs-panel + * { margin-top: 18px; }
/* 말풍선 — 흰 풍선, 꼬리는 위로 (그림 속 인물 쪽) */
.casino .cs-say { position: relative; margin: 14px 4px 6px; padding: 10px 14px; background: #fffaf0; color: #1c1210; border: 2.5px solid #0a0506; border-radius: 18px;
  box-shadow: 3px 4px 0 rgba(10, 5, 6, .8); font-size: 15px; line-height: 1.6; border-left-width: 2.5px; }
.casino .cs-say::before { content: ''; position: absolute; top: -14px; left: 46px; border: 7px solid transparent; border-bottom: 9px solid #0a0506; }
.casino .cs-say::after { content: ''; position: absolute; top: -8px; left: 49px; border: 4px solid transparent; border-bottom: 6px solid #fffaf0; }
.casino .cs-say b { color: #8a2a24; font-size: 12.5px; letter-spacing: .04em; }
.casino .cs-say .cs-face { width: 54px; border: 2px solid #0a0506; border-radius: 50%; aspect-ratio: 1 / 1 !important; background-color: #3a1a22; }
.cs-think { margin: 12px 8px 0; font-size: 14px; font-style: italic; color: #e6d3ae; }
.cs-think::before { content: '— '; opacity: .7; }
.cs-tap { margin: 6px 0 0; text-align: center; font-size: 12px; color: #b89e78; animation: cs-blink 1.6s ease-in-out infinite; }
@keyframes cs-blink { 50% { opacity: .35; } }
/* 효과음 글자 — 만화처럼 기울고 굵게 */
.cs-panel .cs-scene-title { left: auto; right: 16px; top: 12px; bottom: auto; font-size: 34px; font-weight: 900; color: #ffe08a; transform: rotate(-6deg);
  -webkit-text-stroke: 2px #0a0506; text-shadow: 4px 4px 0 #0a0506; letter-spacing: .06em; }
.cs-panel .cs-scene-title.cs-sfx { font-size: 64px; color: #fff4dc; right: auto; left: 50%; top: 40%; transform: translate(-50%, -50%) rotate(-8deg); animation: cs-sfxpop .5s cubic-bezier(.2, 1.6, .4, 1) .15s both; }
@keyframes cs-sfxpop { from { transform: translate(-50%, -50%) rotate(-8deg) scale(2.2); opacity: 0; } }

/* ── 화면이 바뀔 때만 들어오는 효과 (.cs-in — CasinoView.html) ── */
.casino.cs-in:not(.cs-cine) > .cs-head, .casino.cs-in:not(.cs-cine) > .cs-seat { animation: cs-fadein .3s ease-out both; }
.casino.cs-in .cs-hallwrap { animation: cs-hallin .55s ease-out both; }
.casino.cs-in .cs-table { animation: cs-tablein .38s cubic-bezier(.2, .9, .3, 1) both; }
.casino.cs-in .cs-stake, .casino.cs-in .cs-foot, .casino.cs-in .cs-ask, .casino.cs-in .cs-swipe { animation: cs-fadein .35s ease-out .12s both; }
.casino.cs-cine.cs-in .cs-scene img { animation: cs-cinein .7s ease-out both; }
.casino.cs-cine.cs-in .cs-cap { animation: cs-rise .45s ease-out .35s both; }
.casino.cs-cine.cs-in .cs-say, .casino.cs-cine.cs-in .cs-think { animation: cs-rise .45s ease-out .75s both; }
.casino.cs-cine.cs-in .cs-sys, .casino.cs-cine.cs-in .cs-row, .casino.cs-cine.cs-in .cs-foot, .casino.cs-cine.cs-in .cs-tap { animation: cs-rise .4s ease-out 1.05s both; }
@keyframes cs-fadein { from { opacity: 0; } }
@keyframes cs-hallin { from { opacity: 0; transform: scale(1.04); filter: brightness(.3); } }
@keyframes cs-tablein { from { opacity: 0; transform: translateY(14px) scale(.98); } }
@keyframes cs-cinein { from { opacity: 0; transform: scale(1.06); filter: brightness(.2); } }
@media (prefers-reduced-motion: reduce) { .casino.cs-in *, .casino.cs-in { animation: none !important; } }

/* ── 들썩임 막기: 결과 자리는 늘 비워 두고, 기록은 높이 고정, 판이 도는 동안 판돈 칸은 잠근다 ── */
.cs-resslot { min-height: 44px; display: flex; align-items: center; justify-content: center; }
.cs-resslot .cs-result { width: 100%; }
.casino > .cs-log { height: 6.2em; overflow: hidden; }
.cs-stake.locked { opacity: .45; pointer-events: none; filter: saturate(.6); }
.cs-table.t-ladder { min-height: 462px; }
.cs-table.t-shell { min-height: 300px; }
.casino .cs-say::before { left: calc(var(--tail, 9%) - 8px); }
.casino .cs-say::after { left: calc(var(--tail, 9%) - 5px); }
/* 세로 화면: 홀 그림은 양옆 여백 없이 가장자리까지 (위의 .casino > * 가 음수 여백을 덮던 것) */
@media (max-aspect-ratio: 1/1) { .casino > .cs-hallwrap { width: calc(100% + 28px); max-width: none; margin-inline: -14px; } }
