/* =========================================================================
   Seven Poker Hi-Lo — Table UI
   스테이지는 고정 해상도(PC 1600×900 / 모바일 720×1280)로 설계 후 화면에 맞춰 스케일
   ========================================================================= */
:root {
  --gold-metal: linear-gradient(135deg, #7a5512 0%, #e9c46a 18%, #fff2c2 32%, #c99a3b 48%, #f7dd8f 64%, #a7781f 82%, #f3d27a 100%);
  --gold-edge: linear-gradient(180deg, #fff0bd 0%, #e2b24d 30%, #8f661c 52%, #d9aa4a 75%, #fbe39c 100%);
  --gold: #e8c26a;
  --gold-hi: #fbe2a0;
  --gold-lo: #9b7426;
  --panel: linear-gradient(180deg, rgba(30, 34, 39, .95), rgba(9, 11, 13, .97));
  --ui: 'Noto Sans KR', 'Malgun Gothic', system-ui, sans-serif;
  --deco: 'Cinzel', 'Noto Serif', Georgia, serif;
  --noise: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 .55 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  --damask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='90' height='90' viewBox='0 0 90 90'><g fill='none' stroke='%23e8c26a' stroke-opacity='.07' stroke-width='1.2'><path d='M45 6 C60 22 60 34 45 45 C30 34 30 22 45 6Z'/><path d='M45 84 C60 68 60 56 45 45 C30 56 30 68 45 84Z'/><path d='M6 45 C22 30 34 30 45 45 C34 60 22 60 6 45Z'/><path d='M84 45 C68 30 56 30 45 45 C56 60 68 60 84 45Z'/><circle cx='45' cy='45' r='3'/><circle cx='0' cy='0' r='6'/><circle cx='90' cy='0' r='6'/><circle cx='0' cy='90' r='6'/><circle cx='90' cy='90' r='6'/></g></svg>");
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #040607; }
body { font-family: var(--ui); color: #fff; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
button { font-family: inherit; color: inherit; border: 0; background: none; cursor: pointer; padding: 0; }

#viewport {
  position: fixed; inset: 0; overflow: hidden;
  background:
    radial-gradient(ellipse 80% 70% at 50% 45%, rgba(24, 58, 48, .55), transparent 70%),
    var(--damask), #05080a;
}
#stage {
  position: absolute; left: 0; top: 0; transform-origin: 0 0; overflow: hidden;
  background:
    radial-gradient(ellipse 75% 65% at 50% 42%, rgba(52, 110, 88, .35), transparent 70%),
    radial-gradient(ellipse 60% 30% at 50% 0%, rgba(232, 194, 106, .10), transparent 70%),
    var(--damask), #060a0b;
  box-shadow: 0 0 0 1px rgba(232, 194, 106, .08);
}
#stage.landscape { width: 1600px; height: 900px; }
#stage.portrait { width: 720px; height: 1280px; }
#stage.no-anim * { transition: none !important; }

.ic { width: 1em; height: 1em; fill: currentColor; display: inline-block; vertical-align: middle; }

/* ---------------------------------------------------------------- 상단바 */
.topbar {
  position: absolute; left: 0; top: 0; right: 0; height: 66px; z-index: 30;
  display: flex; align-items: center; justify-content: space-between; padding: 0 18px;
  background: linear-gradient(180deg, rgba(8, 10, 12, .96), rgba(8, 10, 12, .78));
  border-bottom: 1px solid rgba(232, 194, 106, .28);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .45);
}
.topbar::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; background: linear-gradient(90deg, transparent, rgba(251, 226, 160, .9), transparent); }
.tb-left, .tb-right { display: flex; align-items: center; gap: 12px; }
.icon-btn {
  width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-size: 21px; color: #e9dcc0;
  background: linear-gradient(180deg, #272b31, #121417); border: 1px solid rgba(232, 194, 106, .3);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 3px 8px rgba(0, 0, 0, .4); transition: transform .15s, color .15s;
}
.icon-btn:hover { color: var(--gold-hi); transform: translateY(-1px); }
.brand { line-height: 1; padding: 0 6px 0 4px; }
.brand-main {
  font-family: var(--deco); font-weight: 900; font-size: 25px; letter-spacing: 3px;
  background: var(--gold-metal); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .6));
}
.brand-sub { display: flex; align-items: center; gap: 6px; margin-top: 4px; font-family: var(--deco); font-size: 11px; font-weight: 700; letter-spacing: 3px; color: #cdb98a; }
.brand-sub i { width: 4px; height: 4px; transform: rotate(45deg); background: var(--gold); }
.room-pill {
  display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 14px; border-radius: 17px; font-size: 13px; color: #bfc5c9;
  background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .08);
}
.room-pill b { color: #fff; font-weight: 700; }
.room-pill b.gold { color: var(--gold-hi); }
.room-pill .sep { width: 1px; height: 12px; background: rgba(255, 255, 255, .18); }
.stat-pill {
  position: relative; display: flex; align-items: center; gap: 10px; height: 46px; padding: 0 14px 0 6px; border-radius: 23px;
  background: linear-gradient(180deg, rgba(36, 30, 18, .95), rgba(14, 12, 8, .95));
  border: 1px solid rgba(232, 194, 106, .45);
  box-shadow: inset 0 1px 0 rgba(255, 240, 200, .12), 0 4px 12px rgba(0, 0, 0, .45);
}
.sp-ic { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: 19px; color: #3a2405; background: var(--gold-metal); box-shadow: 0 2px 5px rgba(0, 0, 0, .5), inset 0 -2px 3px rgba(0, 0, 0, .25); }
.sp-ic.gift { background: linear-gradient(135deg, #8ff0c9, #19a477 55%, #0c6b4c); color: #04261b; }
.sp-txt { display: flex; flex-direction: column; line-height: 1.05; }
.sp-txt small { font-size: 11px; color: #c7b48a; font-weight: 500; }
.sp-txt b { font-size: 19px; font-weight: 900; color: #fff; font-variant-numeric: tabular-nums; }
.sp-txt b em { font-style: normal; font-size: 12px; color: #c7b48a; margin-left: 2px; font-weight: 700; }
.rank-delta { font-size: 11px; font-weight: 700; color: #ff6b6b; }
.charge-btn {
  height: 30px; padding: 0 14px; border-radius: 15px; font-size: 13px; font-weight: 900; color: #052a1d;
  background: linear-gradient(180deg, #a9ffdc, #2fd197 50%, #12996b); box-shadow: inset 0 1px 0 #fff, 0 2px 6px rgba(0, 0, 0, .5);
}
.charge-btn:disabled { filter: grayscale(1) brightness(.6); cursor: default; }

/* ---------------------------------------------------------------- 테이블 */
.table { position: absolute; z-index: 1; }
.table-shadow { position: absolute; inset: 18px -10px -34px; border-radius: 9999px; background: rgba(0, 0, 0, .75); filter: blur(28px); }
.table-edge, .rail, .trim, .felt { border-radius: 9999px; }
.portrait .table-edge, .portrait .rail, .portrait .trim, .portrait .felt, .portrait .table-shadow { border-radius: 230px; }
.table-edge { position: absolute; inset: 0; padding: 4px; background: var(--gold-edge); box-shadow: 0 2px 0 rgba(255, 240, 190, .25), 0 30px 60px rgba(0, 0, 0, .6); }
.rail {
  position: relative; width: 100%; height: 100%; padding: 30px;
  background:
    var(--noise),
    radial-gradient(ellipse 60% 40% at 50% 8%, rgba(255, 210, 160, .18), transparent 70%),
    linear-gradient(180deg, #3d2516 0%, #24150c 35%, #160c06 65%, #2a180d 100%);
  background-blend-mode: overlay, normal, normal;
  box-shadow: inset 0 3px 2px rgba(255, 220, 180, .18), inset 0 -8px 14px rgba(0, 0, 0, .6), inset 0 0 0 1px rgba(0, 0, 0, .6);
}
.portrait .rail { padding: 22px; }
.rail-stitch { position: absolute; inset: 9px; border-radius: inherit; border: 1.5px dashed rgba(232, 194, 106, .28); pointer-events: none; }
.portrait .rail-stitch { border-radius: 222px; inset: 7px; }
.trim { width: 100%; height: 100%; padding: 5px; background: var(--gold-edge); box-shadow: 0 0 0 2px rgba(0, 0, 0, .55), 0 0 18px rgba(232, 194, 106, .25); }
.felt {
  position: relative; width: 100%; height: 100%; overflow: hidden;
  background: radial-gradient(ellipse 70% 75% at 50% 42%, #23946b 0%, #157252 32%, #0c5139 62%, #062d1f 100%);
  box-shadow: inset 0 0 70px rgba(0, 0, 0, .7), inset 0 0 10px rgba(0, 0, 0, .85), inset 0 0 0 2px rgba(0, 0, 0, .4);
}
.felt-noise { position: absolute; inset: 0; background: var(--noise); opacity: .55; mix-blend-mode: overlay; }
.felt-light { position: absolute; inset: 0; background: radial-gradient(ellipse 45% 38% at 50% 38%, rgba(190, 255, 220, .16), transparent 70%); }
.bet-line { position: absolute; inset: 11% 12%; border-radius: inherit; border: 2px solid rgba(232, 194, 106, .22); border-radius: 9999px; }
.bet-line.inner { inset: calc(11% + 7px) calc(12% + 7px); border: 1px dashed rgba(232, 194, 106, .16); }
.portrait .bet-line { inset: 13% 15%; border-radius: 170px; }
.portrait .bet-line.inner { inset: calc(13% + 7px) calc(15% + 7px); border-radius: 163px; }

.felt-logo { position: absolute; z-index: 2; transform: translate(-50%, -50%); text-align: center; pointer-events: none; white-space: nowrap; }
.fl-suits { display: flex; justify-content: center; gap: 14px; font-size: 18px; color: rgba(232, 194, 106, .22); margin-bottom: 6px; }
.fl-main { font-family: var(--deco); font-weight: 900; font-size: 44px; letter-spacing: 10px; color: rgba(232, 194, 106, .19); text-shadow: 0 2px 1px rgba(0, 0, 0, .35), 0 -1px 0 rgba(255, 255, 255, .04); }
.fl-sub { margin-top: 4px; font-family: var(--deco); font-weight: 700; font-size: 15px; letter-spacing: 8px; color: rgba(232, 194, 106, .2); }
.portrait .fl-main { font-size: 40px; letter-spacing: 7px; }

/* ---------------------------------------------------------------- 덱 / 팟 */
.deck { position: absolute; z-index: 5; }
.deck .dk { position: absolute; left: 0; top: 0; width: 100%; height: 100%; border-radius: 7.2% / 5.1%; overflow: hidden; box-shadow: 0 2px 4px rgba(0, 0, 0, .5); }
.deck .dk svg { display: block; width: 100%; height: 100%; }
.deck::after { content: 'DEALER'; position: absolute; left: 50%; bottom: -22px; transform: translateX(-50%); font: 700 10px var(--deco); letter-spacing: 3px; color: rgba(232, 194, 106, .45); }

.pot { position: absolute; z-index: 6; transform: translate(-50%, -50%); width: 300px; height: 190px; pointer-events: none; }
.pot-chips { position: absolute; left: 0; right: 0; top: 0; height: 104px; }
.pstack { position: absolute; transform: translate(-50%, -100%); filter: drop-shadow(0 3px 2px rgba(0, 0, 0, .35)); transition: opacity .3s; }
.pstack svg { display: block; }
.pchip { position: absolute; width: 26px; height: 26px; transform: translate(-50%, -50%) rotateX(55deg); filter: drop-shadow(0 2px 1px rgba(0, 0, 0, .5)); }
.pot-plate {
  position: absolute; left: 50%; top: 108px; transform: translateX(-50%); min-width: 230px; padding: 8px 22px 9px; text-align: center; border-radius: 16px;
  background: linear-gradient(180deg, rgba(5, 18, 13, .82), rgba(2, 10, 7, .9));
  border: 1px solid rgba(232, 194, 106, .55);
  box-shadow: 0 8px 20px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 240, 200, .12);
}
.pot-label { font: 700 11px var(--deco); letter-spacing: 4px; color: #cdb37a; }
.pot-amount {
  font-family: var(--ui); font-weight: 900; font-size: 34px; line-height: 1.1; font-variant-numeric: tabular-nums; letter-spacing: .5px;
  background: linear-gradient(180deg, #fff6d4 0%, #f4d27c 45%, #c4912f 100%); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .7));
}
.pot-amount.bump { animation: bump .35s ease-out; }
@keyframes bump { 40% { transform: scale(1.12); } }
.pot-sub { font-size: 12px; color: #a8b8b0; }
.pot-sub b { color: #fff; font-weight: 700; }

/* ---------------------------------------------------------------- 좌석 */
#seatLayer, #betLayer, #cardLayer, #fxLayer { position: absolute; inset: 0; pointer-events: none; }
#seatLayer { z-index: 8; }
#betLayer { z-index: 9; }
#cardLayer { z-index: 12; }
#fxLayer { z-index: 60; }
.pod { position: absolute; pointer-events: auto; display: flex; align-items: center; gap: 12px; padding: 10px 16px 10px 10px; border-radius: 20px; background: var(--panel); box-shadow: 0 14px 30px rgba(0, 0, 0, .6), inset 0 1px 0 rgba(255, 255, 255, .06); transition: box-shadow .3s, filter .3s; }
.pod::before { content: ''; position: absolute; inset: 0; border-radius: inherit; padding: 1.5px; background: linear-gradient(180deg, rgba(251, 226, 160, .95), rgba(155, 116, 38, .45) 55%, rgba(251, 226, 160, .7)); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none; }
.pod.right { flex-direction: row-reverse; text-align: right; padding: 10px 10px 10px 16px; }
.pod.active { box-shadow: 0 0 0 2px rgba(255, 210, 87, .9), 0 0 28px rgba(255, 196, 64, .55), 0 14px 30px rgba(0, 0, 0, .6); animation: glow 1.4s ease-in-out infinite; }
@keyframes glow { 50% { box-shadow: 0 0 0 2px rgba(255, 210, 87, .6), 0 0 40px rgba(255, 196, 64, .75), 0 14px 30px rgba(0, 0, 0, .6); } }
.pod.folded { filter: grayscale(.9) brightness(.6); }
.pod.winner { box-shadow: 0 0 0 3px #ffd75e, 0 0 50px rgba(255, 205, 80, .85), 0 14px 30px rgba(0, 0, 0, .6); }

.avatar { position: relative; flex: 0 0 auto; width: 80px; height: 80px; border-radius: 50%; padding: 3px; background: var(--gold-metal); box-shadow: 0 5px 12px rgba(0, 0, 0, .65); }
.avatar .av { width: 100%; height: 100%; border-radius: 50%; overflow: hidden; background: #000; box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .6); }
.avatar .av svg { display: block; width: 100%; height: 100%; }
.timer { position: absolute; left: -8px; top: -8px; width: calc(100% + 16px); height: calc(100% + 16px); transform: rotate(-90deg); opacity: 0; transition: opacity .2s; }
.pod.active .timer { opacity: 1; }
.timer circle { fill: none; stroke-width: 5; stroke-linecap: round; }
.timer .trk { stroke: rgba(0, 0, 0, .55); }
.timer .bar { stroke: #7dff8a; stroke-dasharray: 100 100; }
.pod.active .timer .bar { animation: countdown var(--t, 15s) linear forwards; }
@keyframes countdown { 0% { stroke-dashoffset: 0; stroke: #7dff8a; } 55% { stroke: #ffd257; } 100% { stroke-dashoffset: 100; stroke: #ff4d4d; } }

.p-info { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 3px; }
.p-tags { display: flex; gap: 5px; align-items: center; }
.pod.right .p-tags { justify-content: flex-end; }
.badge { height: 18px; padding: 0 7px; border-radius: 9px; font-size: 10.5px; font-weight: 900; letter-spacing: .5px; display: inline-flex; align-items: center; line-height: 1; }
.badge.ai { color: #052a33; background: linear-gradient(180deg, #a7f3ff, #3fc7e0); }
.badge.me { color: #3a2405; background: var(--gold-metal); }
.badge.lv { color: #e9dcc0; background: rgba(255, 255, 255, .09); border: 1px solid rgba(255, 255, 255, .14); font-weight: 700; }
.p-name { font-size: 17px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 1px 2px rgba(0, 0, 0, .8); }
.p-pts { display: flex; align-items: center; gap: 5px; font-size: 16px; font-weight: 900; color: var(--gold-hi); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pod.right .p-pts { justify-content: flex-end; }
.p-pts .ic { font-size: 19px; color: #f2c24e; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .6)); }
.p-sub { font-size: 12px; color: #a9b0b5; white-space: nowrap; }
.p-sub b { color: #fff; font-variant-numeric: tabular-nums; }

.pod.me { padding: 14px 18px 14px 14px; gap: 16px; }
.pod.me .avatar { width: 100px; height: 100px; }
.pod.me .p-name { font-size: 20px; }
.pod.me .p-pts { font-size: 20px; }

/* 액션 말풍선 */
.bubble {
  position: absolute; top: -20px; left: 50px; transform: translate(-50%, 0) scale(.4); opacity: 0;
  padding: 5px 14px 6px; border-radius: 14px; font-size: 16px; font-weight: 900; white-space: nowrap; color: #fff; z-index: 3;
  background: var(--bc, #3a4048); box-shadow: 0 6px 14px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .35); text-shadow: 0 1px 2px rgba(0, 0, 0, .5);
  transition: transform .28s cubic-bezier(.3, 1.6, .5, 1), opacity .2s;
}
.bubble::after { content: ''; position: absolute; left: 50%; bottom: -6px; width: 12px; height: 12px; transform: translateX(-50%) rotate(45deg); background: var(--bc2, var(--bc, #3a4048)); border-radius: 2px; z-index: -1; }
.bubble.show { transform: translate(-50%, 0) scale(1); opacity: 1; }
.pod.right .bubble { left: auto; right: 50px; transform: translate(50%, 0) scale(.4); }
.pod.right .bubble.show { transform: translate(50%, 0) scale(1); }
.pod.me .bubble { left: 64px; }

/* 선 / 하이로 선택 배지 */
.boss { position: absolute; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 900; color: #3a2405; background: var(--gold-metal); box-shadow: 0 3px 6px rgba(0, 0, 0, .6), inset 0 -2px 2px rgba(0, 0, 0, .25); bottom: -8px; left: 70px; border: 2px solid #1a1206; opacity: 0; transform: scale(.4); transition: .3s cubic-bezier(.3, 1.6, .5, 1); }
.pod.right .boss { left: auto; right: 70px; }
.pod.me .boss { left: 88px; }
.boss.show { opacity: 1; transform: scale(1); }
.declare { position: absolute; top: -12px; right: 12px; height: 24px; padding: 0 10px; border-radius: 12px; font: 900 12px var(--deco); letter-spacing: 1.5px; display: flex; align-items: center; gap: 4px; opacity: 0; transform: translateY(6px) scale(.6); transition: .35s cubic-bezier(.3, 1.6, .5, 1); box-shadow: 0 4px 10px rgba(0, 0, 0, .5); }
.pod.right .declare { right: auto; left: 12px; }
.declare.show { opacity: 1; transform: none; }
.declare.HIGH { color: #fff; background: linear-gradient(180deg, #ff6a5c, #c4172a); }
.declare.LOW { color: #fff; background: linear-gradient(180deg, #59a8ff, #1b4fc4); }
.declare.SWING { color: #2a1640; background: linear-gradient(90deg, #ffb36b, #ffe08a 50%, #b99cff); }

/* 베팅 금액 표시 */
.bet { position: absolute; transform: translate(-50%, -50%); display: flex; align-items: flex-end; gap: 4px; opacity: 0; transition: opacity .25s; }
.bet.show { opacity: 1; }
.bet-stack svg { display: block; }
.bet-amt { margin-bottom: 4px; padding: 3px 11px 4px; border-radius: 12px; font-size: 15px; font-weight: 900; color: var(--gold-hi); font-variant-numeric: tabular-nums; background: rgba(0, 0, 0, .62); border: 1px solid rgba(232, 194, 106, .45); box-shadow: 0 3px 8px rgba(0, 0, 0, .4); white-space: nowrap; }

/* 카드 하단 족보 태그 (쇼다운) */
.hand-tag { position: absolute; transform: translate(-50%, 0) scale(.6); opacity: 0; z-index: 40; padding: 3px 10px; border-radius: 10px; font-size: 13px; font-weight: 900; white-space: nowrap; color: #fff; background: rgba(0, 0, 0, .78); border: 1px solid rgba(232, 194, 106, .5); transition: .3s cubic-bezier(.3, 1.6, .5, 1); }
.hand-tag.show { opacity: 1; transform: translate(-50%, 0) scale(1); }
.hand-tag b { color: var(--gold-hi); }

/* ---------------------------------------------------------------- 카드 */
.card { position: absolute; perspective: 1000px; transition: left .5s cubic-bezier(.2, .8, .25, 1), top .5s cubic-bezier(.2, .8, .25, 1), width .5s cubic-bezier(.2, .8, .25, 1), height .5s cubic-bezier(.2, .8, .25, 1), transform .5s cubic-bezier(.2, .8, .25, 1), filter .3s; }
.card.no-trans { transition: none !important; }
.card-inner { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transform: rotateY(180deg); transition: transform .6s cubic-bezier(.45, .15, .2, 1); }
.card.up .card-inner { transform: rotateY(0deg); }
.card.lift { transform: translateY(-14px) scale(1.07) !important; }
.card-face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 7.2% / 5.1%; overflow: hidden; box-shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 6px 14px rgba(0, 0, 0, .4); }
.card-face.back { transform: rotateY(180deg); }
.card-face svg { display: block; width: 100%; height: 100%; }
.card.folded { filter: grayscale(.9) brightness(.5); }
.card.best .card-face { box-shadow: 0 0 0 3px #ffd75e, 0 0 18px rgba(255, 210, 80, .9); }
.secret-tag { position: absolute; left: 6%; bottom: 4%; padding: 2px 6px; border-radius: 6px; font-size: 11px; font-weight: 900; color: #fff; background: linear-gradient(180deg, #7b5cff, #4a2fc9); box-shadow: 0 2px 4px rgba(0, 0, 0, .4); letter-spacing: .5px; }
.portrait .secret-tag { font-size: 10px; padding: 1px 5px; }

/* ---------------------------------------------------------------- 하단 독 */
.dock { position: absolute; left: 0; right: 0; bottom: 0; z-index: 3; background: linear-gradient(180deg, rgba(6, 8, 10, 0), rgba(6, 8, 10, .92) 30%, #050708); }
.dock::before { content: ''; position: absolute; left: 0; right: 0; top: 30%; height: 1px; background: linear-gradient(90deg, transparent, rgba(232, 194, 106, .35), transparent); }

.log { position: absolute; z-index: 10; padding: 12px 14px; border-radius: 16px; background: rgba(10, 12, 14, .85); border: 1px solid rgba(255, 255, 255, .08); overflow: hidden; }
.log-title { font-size: 12px; font-weight: 700; color: #cdb37a; margin-bottom: 6px; letter-spacing: 1px; }
.log ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 5px; }
.log li { font-size: 12.5px; color: #c9cfd3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; animation: logIn .3s ease-out; }
.log li b { color: #fff; }
.log li i { font-style: normal; font-weight: 900; }
@keyframes logIn { from { opacity: 0; transform: translateX(-10px); } }
.portrait .log { display: none; }

.hand-label { position: absolute; z-index: 13; display: flex; justify-content: center; align-items: center; gap: 10px; opacity: 0; transition: opacity .4s; }
.hand-label.show { opacity: 1; }
.hl-pill { display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 14px 0 5px; border-radius: 17px; background: rgba(0, 0, 0, .75); border: 1px solid rgba(255, 255, 255, .14); font-size: 15px; font-weight: 700; white-space: nowrap; box-shadow: 0 4px 10px rgba(0, 0, 0, .4); }
.hl-pill .k { height: 24px; padding: 0 9px; border-radius: 12px; display: grid; place-items: center; font: 900 11px var(--deco); letter-spacing: 1.5px; }
.hl-pill.high .k { background: linear-gradient(180deg, #ff6a5c, #c4172a); }
.hl-pill.low .k { background: linear-gradient(180deg, #59a8ff, #1b4fc4); }
.portrait .hand-label { flex-direction: column; align-items: stretch; gap: 8px; }
.portrait .hl-pill { height: 40px; font-size: 16px; }

/* 액션 버튼 */
.actions { position: absolute; z-index: 14; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.act {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; overflow: hidden;
  border-radius: 16px; color: #fff; background: linear-gradient(180deg, var(--c1), var(--c2));
  border: 1px solid rgba(255, 255, 255, .22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), inset 0 -5px 0 rgba(0, 0, 0, .28), 0 8px 16px rgba(0, 0, 0, .55), 0 0 0 2px rgba(0, 0, 0, .55);
  transition: transform .1s, filter .2s, box-shadow .2s;
}
.act::before { content: ''; position: absolute; left: 4px; right: 4px; top: 3px; height: 45%; border-radius: 13px 13px 40% 40% / 13px 13px 14px 14px; background: linear-gradient(180deg, rgba(255, 255, 255, .38), rgba(255, 255, 255, .04)); pointer-events: none; }
.act:hover:not(:disabled) { filter: brightness(1.12); }
.act:active:not(:disabled), .act.pressed { transform: translateY(3px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), inset 0 -2px 0 rgba(0, 0, 0, .28), 0 4px 8px rgba(0, 0, 0, .55), 0 0 0 2px rgba(0, 0, 0, .55); }
.act:disabled { filter: grayscale(.85) brightness(.5); cursor: default; }
.act .a-name { position: relative; font-size: 26px; font-weight: 900; letter-spacing: 1px; text-shadow: 0 2px 3px rgba(0, 0, 0, .45); line-height: 1.1; }
.act .a-amt { position: relative; font-size: 14px; font-weight: 700; color: rgba(255, 255, 255, .92); font-variant-numeric: tabular-nums; text-shadow: 0 1px 2px rgba(0, 0, 0, .5); }
.act .a-key { position: absolute; left: 9px; top: 7px; width: 20px; height: 20px; border-radius: 6px; font-size: 11px; font-weight: 900; display: grid; place-items: center; background: rgba(0, 0, 0, .3); color: rgba(255, 255, 255, .8); }
.act.check { --c1: #5f86c2; --c2: #284778; }
.act.call { --c1: #3fc77b; --c2: #157140; }
.act.bbing { --c1: #31bfd0; --c2: #0d6977; }
.act.ddadang { --c1: #ffb444; --c2: #b8620a; }
.act.half { --c1: #ff5b62; --c2: #a2141f; }
.act.die { --c1: #686d75; --c2: #2a2d33; }
.actions.my-turn .act.half:not(:disabled) { animation: halfGlow 1.6s ease-in-out infinite; }
@keyframes halfGlow { 50% { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), inset 0 -5px 0 rgba(0, 0, 0, .28), 0 0 22px rgba(255, 80, 80, .75), 0 0 0 2px rgba(0, 0, 0, .55); } }
.actions-turn { position: absolute; z-index: 14; font: 700 12px var(--deco); letter-spacing: 3px; color: var(--gold); }

/* ---------------------------------------------------------------- FX */
.fly-chip { position: absolute; left: 0; top: 0; width: 30px; height: 30px; margin: -15px 0 0 -15px; filter: drop-shadow(0 5px 4px rgba(0, 0, 0, .55)); will-change: transform; }
.fly-chip svg { display: block; width: 100%; height: 100%; }
.portrait .fly-chip { width: 26px; height: 26px; margin: -13px 0 0 -13px; }

.win-banner { position: absolute; transform: translate(-50%, -50%) scale(.3); opacity: 0; text-align: center; transition: transform .5s cubic-bezier(.3, 1.6, .4, 1), opacity .3s; z-index: 5; }
.win-banner.show { transform: translate(-50%, -50%) scale(1); opacity: 1; }
.wb-ribbon {
  position: relative; padding: 8px 34px 10px; font: 900 30px var(--deco); letter-spacing: 3px; color: #3a2405; white-space: nowrap;
  background: var(--gold-metal); clip-path: polygon(0 0, 100% 0, 94% 50%, 100% 100%, 0 100%, 6% 50%);
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .6));
}
.wb-amt { margin-top: 6px; font-size: 24px; font-weight: 900; color: #fff3c4; text-shadow: 0 2px 4px #000, 0 0 14px rgba(255, 200, 80, .8); font-variant-numeric: tabular-nums; }
.wb-sub { display: inline-block; margin-left: 8px; padding: 2px 8px; border-radius: 9px; vertical-align: 4px; background: rgba(0, 0, 0, .6); font-size: 12px; font-weight: 700; color: #ffe39a; letter-spacing: .3px; text-shadow: none; white-space: nowrap; }
.spark { position: absolute; width: 8px; height: 8px; border-radius: 50%; background: radial-gradient(circle, #fff 0, #ffe18a 40%, rgba(255, 190, 60, 0) 70%); }

.toast { position: absolute; left: 50%; top: 92px; z-index: 300; transform: translate(-50%, -20px); opacity: 0; padding: 10px 22px; border-radius: 22px; font-size: 15px; font-weight: 700; background: rgba(0, 0, 0, .85); border: 1px solid rgba(232, 194, 106, .55); color: #fff; transition: .3s; white-space: nowrap; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast b { color: var(--gold-hi); }

/* ---------------------------------------------------------------- 하이·로우·스윙 */
.hilo-overlay { position: absolute; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; background: radial-gradient(ellipse at center, rgba(0, 0, 0, .45), rgba(0, 0, 0, .78)); opacity: 0; pointer-events: none; transition: opacity .3s; }
.hilo-overlay.show { opacity: 1; pointer-events: auto; }
.hilo-panel {
  position: relative; width: 860px; padding: 26px 34px 24px; border-radius: 26px; text-align: center;
  background: radial-gradient(ellipse 80% 50% at 50% 0%, rgba(232, 194, 106, .14), transparent 70%), linear-gradient(180deg, #1b2025, #0a0c0f);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .8), inset 0 1px 0 rgba(255, 255, 255, .08);
  transform: translateY(30px) scale(.94); transition: transform .45s cubic-bezier(.3, 1.4, .5, 1);
}
.hilo-panel::before { content: ''; position: absolute; inset: 0; border-radius: inherit; padding: 2px; background: var(--gold-edge); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none; }
.hilo-overlay.show .hilo-panel { transform: none; }
.hilo-eyebrow { font: 700 13px var(--deco); letter-spacing: 8px; color: var(--gold); }
.hilo-title { margin-top: 4px; font-size: 30px; font-weight: 900; }
.hilo-desc { margin-top: 4px; font-size: 14px; color: #9aa3a9; }
.hilo-hand { display: flex; justify-content: center; align-items: center; gap: 18px; margin: 18px 0 20px; }
.hh-cards { display: flex; }
.hh-cards .mini { width: 52px; height: 73px; margin-left: -14px; border-radius: 7.2% / 5.1%; overflow: hidden; box-shadow: 0 4px 10px rgba(0, 0, 0, .5); }
.hh-cards .mini:first-child { margin-left: 0; }
.hh-cards .mini svg { display: block; width: 100%; height: 100%; }
.hh-rank { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.hilo-choices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.choice {
  position: relative; height: 196px; border-radius: 20px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; overflow: hidden;
  background: linear-gradient(180deg, var(--c1), var(--c2)); border: 1px solid rgba(255, 255, 255, .25);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), inset 0 -6px 0 rgba(0, 0, 0, .25), 0 12px 24px rgba(0, 0, 0, .55);
  transition: transform .18s, box-shadow .2s, filter .2s;
}
.choice::before { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse 80% 50% at 50% 0%, rgba(255, 255, 255, .35), transparent 70%); pointer-events: none; }
.choice:hover { transform: translateY(-4px); }
.choice.picked { transform: translateY(-4px) scale(1.04); box-shadow: 0 0 0 3px #ffe08a, 0 0 40px rgba(255, 220, 120, .7), 0 12px 24px rgba(0, 0, 0, .55); }
.hilo-choices.done .choice:not(.picked) { filter: grayscale(.8) brightness(.45); }
.choice.high { --c1: #f2545a; --c2: #8c0f1d; }
.choice.low { --c1: #4d93f5; --c2: #13358c; }
.choice.swing { --c1: #a46cf2; --c2: #43188c; }
.ch-ic { position: relative; height: 54px; display: flex; gap: 2px; align-items: center; justify-content: center; }
.ch-ic svg { width: 46px; height: 46px; fill: #fff; filter: drop-shadow(0 3px 3px rgba(0, 0, 0, .4)); }
.ch-en { position: relative; font: 900 30px var(--deco); letter-spacing: 3px; text-shadow: 0 2px 4px rgba(0, 0, 0, .45); }
.ch-ko { position: relative; font-size: 15px; font-weight: 700; opacity: .9; margin-top: -4px; }
.ch-info { position: relative; font-size: 12.5px; opacity: .75; margin-top: 6px; }
.ch-key { position: absolute; right: 12px; top: 10px; width: 22px; height: 22px; border-radius: 6px; font-size: 11px; font-weight: 900; display: grid; place-items: center; background: rgba(0, 0, 0, .28); }
.hilo-timer { position: relative; margin-top: 20px; height: 12px; border-radius: 6px; background: rgba(255, 255, 255, .08); overflow: visible; }
.ht-bar { height: 100%; border-radius: 6px; width: 100%; background: linear-gradient(90deg, #ff5a5a, #ffd257 40%, #7dff8a); transform-origin: left; }
.hilo-timer span { position: absolute; right: -2px; top: -26px; font: 900 16px var(--ui); color: var(--gold-hi); }
.portrait .hilo-panel { width: 680px; padding: 24px 22px; }
.portrait .hilo-hand { flex-direction: column; gap: 12px; }
.portrait .choice { height: 220px; }
.portrait .ch-info { font-size: 12px; padding: 0 8px; }

/* ---------------------------------------------------------------- 데모 컨트롤 */
.demo { position: fixed; left: 50%; bottom: 6px; transform: translateX(-50%); z-index: 1000; font-family: var(--ui); display: flex; align-items: center; gap: 6px; flex-direction: column-reverse; }
.demo-toggle { opacity: .75; height: 24px; padding: 0 12px; border-radius: 15px; font-size: 11px; font-weight: 900; letter-spacing: 2px; color: #3a2405; background: var(--gold-metal); box-shadow: 0 3px 10px rgba(0, 0, 0, .6); }
.demo-panel { display: none; flex-wrap: wrap; gap: 6px; max-width: min(640px, calc(100vw - 20px)); justify-content: center; padding: 8px; border-radius: 14px; background: rgba(8, 10, 12, .9); border: 1px solid rgba(232, 194, 106, .35); box-shadow: 0 8px 24px rgba(0, 0, 0, .6); }
.demo.open .demo-panel { display: flex; }
.demo-panel button { height: 30px; padding: 0 12px; border-radius: 10px; font-size: 12px; font-weight: 700; color: #f1e6cc; background: linear-gradient(180deg, #2a2f35, #15181c); border: 1px solid rgba(255, 255, 255, .1); }
.demo-panel button:hover { border-color: rgba(232, 194, 106, .6); color: #fff; }
.demo-panel button:first-child { color: #3a2405; background: var(--gold-metal); }

/* ---------------------------------------------------------------- 모바일(세로) 보정 */
.portrait .topbar { height: 78px; padding: 0 12px; }
.portrait .room-pill, .portrait .tb-right .icon-btn[title="채팅"], .portrait .tb-right .icon-btn[title="사운드"] { display: none; }
.portrait .tb-left { gap: 8px; }
.portrait .brand-main { font-size: 20px; letter-spacing: 2px; }
.portrait .tb-right { gap: 8px; }
.portrait .stat-pill { height: 44px; padding: 0 10px 0 5px; gap: 7px; }
.portrait .sp-ic { width: 32px; height: 32px; font-size: 17px; }
.portrait .sp-txt b { font-size: 17px; }
.portrait .rank-delta { display: none; }
.portrait .charge-btn { padding: 0 10px; }
.portrait .pod { padding: 8px 10px 8px 8px; gap: 8px; border-radius: 16px; }
.portrait .pod.right { padding: 8px 8px 8px 10px; }
.portrait .avatar { width: 64px; height: 64px; }
.portrait .p-name { font-size: 15px; }
.portrait .p-pts { font-size: 14px; gap: 4px; }
.portrait .p-pts .ic { font-size: 14px; }
.portrait .badge { height: 16px; font-size: 9.5px; padding: 0 6px; }
.portrait .bubble { font-size: 14px; left: 40px; padding: 4px 11px 5px; }
.portrait .pod.right .bubble { right: 40px; }
.portrait .boss { left: 52px; width: 26px; height: 26px; font-size: 12px; }
.portrait .pod.right .boss { right: 52px; }
.portrait .pod.me { padding: 10px 14px 10px 10px; gap: 12px; }
.portrait .pod.me .avatar { width: 88px; height: 88px; }
.portrait .pod.me .boss { left: 76px; }
.portrait .pod.me .bubble { left: 54px; }
.portrait .bet-amt { font-size: 13px; padding: 2px 9px 3px; }
.portrait .pot-amount { font-size: 30px; }
.portrait .act .a-name { font-size: 30px; }
.portrait .act .a-amt { font-size: 15px; }
.portrait .hand-tag { font-size: 11px; padding: 2px 7px; }
.portrait .wb-ribbon { font-size: 22px; padding: 6px 24px 8px; }
.portrait .wb-amt { font-size: 18px; }
.portrait .wb-sub { font-size: 10px; margin-left: 5px; padding: 1px 6px; }
