/* 삼국지 훌라 — 판 화면 (공통 core.css 뒤에 읽음) · 2026-12-04
 *  위: 장수 자리 한 줄(동작 그림 크게) · 가운데: 탁자(더미·버린 패·등록 묶음) · 아래: 내 손패 · 안내 · 단추
 *  각진 4px·가는 선 (칩 게임 공통 테마) */
html[data-game=hula] { --acc:#2f4f6a; --acc-hi:#4a6d8a; --acc-lo:#1f3549; }
#stage .hd { position:absolute; inset:0; display:flex; flex-direction:column; gap:5px; padding:4px 8px max(8px,env(safe-area-inset-bottom));
  max-width:560px; margin:0 auto; box-sizing:border-box; }
#stage .top h2 .bl { font-size:12.5px; color:var(--dim); font-weight:600; margin-left:4px; }
/* 주인 색 (나 · 장수 1~4) */
#stage { --o0:#a3261d; --o1:#2f5f8f; --o2:#3d7a3a; --o3:#8a5a17; --o4:#6a3d8f; }

/* ---------------- 장수 자리 */
#stage .opps { display:flex; justify-content:space-around; align-items:flex-end; gap:4px; flex:none; padding-top:18px; }
#stage .seat { position:relative; display:flex; flex-direction:column; align-items:center; flex:1 1 0; min-width:0; max-width:170px; cursor:pointer; transition:opacity .3s, filter .3s; }
#stage .seat .pt.sp { position:relative; display:flex; align-items:flex-end; justify-content:center; }
#stage .seat .pt.sp .sprf { animation:bob 2.6s ease-in-out infinite; }
#stage .seat .pt.sp .sprf.act { animation:none; }
#stage .seat .pt.sp img { height:72px; }
@keyframes bob { 50% { transform:translateY(-2px); } }
#stage .seat.turn .pt.sp .sprf { filter:drop-shadow(0 0 4px #e2b35a) drop-shadow(0 0 2px #e2b35a); }
#stage .seat.win .pt.sp .sprf { filter:drop-shadow(0 0 8px #f0c24a); }
#stage .seat .bt:not(:empty) { position:absolute; right:-10px; bottom:2px; padding:0 4px; border-radius:2px; background:#a3261d; color:#fff; font:700 10px/16px sans-serif; z-index:2; }
#stage .seat .lordt, #modal .lordt { position:absolute; left:50%; bottom:-6px; transform:translateX(-50%); background:linear-gradient(#e9c46a,#b8862c); color:#3a2608;
  font-size:10px; font-weight:800; padding:0 5px; border-radius:2px; border:1px solid #7a5512; white-space:nowrap; letter-spacing:.05em; z-index:2; }
#modal .lordt.in { position:static; transform:none; display:inline-block; vertical-align:2px; font-size:12px; }
#stage .seat .nm { font-size:12px; margin-top:3px; white-space:nowrap; line-height:1.15; text-align:center; border-bottom:2px solid var(--oc,#999); padding:0 4px 1px; }
#stage .seat.o1 { --oc:var(--o1); } #stage .seat.o2 { --oc:var(--o2); } #stage .seat.o3 { --oc:var(--o3); } #stage .seat.o4 { --oc:var(--o4); }
#stage .seat .nm b { font-size:13.5px; } #stage .seat .nm small { display:none; }
#stage .seat .sty { display:none; }
#stage .seat .ch { font-size:12px; color:var(--dim); white-space:nowrap; } #stage .seat .ch b { color:var(--ink); font-size:13px; }
#stage .seat .un, #stage .seat .oc { display:flex; flex-direction:column; align-items:center; gap:1px; min-height:0; }
#stage .seat .un .bk { display:flex; --cw:min(3.6vw,16px); } #stage .seat .un .bk .pc + .pc { margin-left:calc(var(--cw) * -.5); }
#stage .seat .cnt { font-size:10.5px; color:var(--dim); white-space:nowrap; }
#stage .seat .ocs { display:flex; flex-wrap:wrap; justify-content:center; --cw:min(6vw,26px); max-width:100%; }
#stage .seat .ocs .pc + .pc { margin-left:calc(var(--cw) * -.3); }
#stage .seat.out { filter:grayscale(1); opacity:.35; }
#stage .seat .say { position:absolute; left:50%; top:-18px; transform:translate(-50%,4px) scale(.9); opacity:0; pointer-events:none; z-index:6;
  background:#fffdf8; color:#2b2722; border:1px solid #b39a6c; border-radius:4px; padding:3px 8px; font-size:12.5px; font-weight:600; white-space:nowrap;
  box-shadow:0 3px 8px #0003; transition:opacity .2s, transform .2s; }
#stage .seat .say.on { opacity:1; transform:translate(-50%,0) scale(1); }
#stage .opps .seat:first-child .say { left:0; transform:translate(0,4px) scale(.9); } #stage .opps .seat:first-child .say.on { transform:none; }
#stage .opps .seat:last-child:not(:first-child) .say { left:auto; right:0; transform:translate(0,4px) scale(.9); } #stage .opps .seat:last-child:not(:first-child) .say.on { transform:none; }
#modal .wstat { display:grid; grid-template-columns:auto 1fr auto; gap:4px 8px; align-items:center; font-size:13px; margin:8px 0; text-align:left; }
#modal .wstat i { height:7px; background:#0001; border-radius:2px; overflow:hidden; } #modal .wstat u { display:block; height:100%; background:var(--acc); }

/* ---------------- 탁자 */
#stage .hl-felt { position:relative; flex:1 1 auto; min-height:150px; display:flex; flex-direction:row; gap:8px; padding:8px; overflow:hidden;
  border-radius:4px; background:radial-gradient(ellipse at 50% 35%, #2b6e62, #17463d 75%, #10342d); border:1px solid #6d5631;
  box-shadow:inset 0 0 0 3px #10342d, inset 0 0 0 4px #b8955a88, inset 0 6px 24px #0006; }
#stage .fl { display:flex; flex-direction:row; align-items:flex-start; justify-content:center; gap:8px; flex:none; padding-right:8px; border-right:1px solid #ffffff1c; }
#stage .deckb, #stage .pileb { display:flex; flex-direction:column; align-items:center; gap:2px; cursor:pointer; padding:3px; border:1px solid transparent; border-radius:4px; }
#stage .deckb > span, #stage .pileb > span { font-size:11px; color:#d9ead9; white-space:nowrap; }
#stage .deckb.can, #stage .pileb.can { border-color:#f0c24a; background:#f0c24a22; animation:canp 1.1s ease-in-out infinite alternate; }
@keyframes canp { to { box-shadow:0 0 10px #f0c24a88; } }
#stage .stk { position:relative; display:flex; --cw:min(10.5vw,7.5vh,48px); }
#stage .stk .pc.under { position:absolute; left:3px; top:-3px; z-index:0; }
#stage .stk .pc:not(.under) { position:relative; z-index:1; }
#stage #pile .pc.under { left:auto; right:auto; }
#stage #pile .pc.u1 { position:absolute; left:6px; top:2px; transform:rotate(7deg); filter:brightness(.92); }
#stage #pile .pc.u2 { position:absolute; left:10px; top:4px; transform:rotate(13deg); filter:brightness(.85); }
#stage .finfo { position:absolute; right:8px; bottom:5px; display:flex; flex-direction:column; align-items:flex-end; gap:3px; color:#f3e3b8; font-size:11.5px; text-align:right; pointer-events:none; }
#stage .finfo b { color:#ffe39a; }
#trepot:empty { display:none; }
#stage .melds { flex:1 1 auto; display:flex; flex-wrap:wrap; align-content:flex-start; gap:6px 8px; overflow:auto; min-height:0; padding-bottom:18px; }
#stage .mempty { color:#cfe6dc99; font-size:12.5px; margin:auto; }
#stage .meld { display:flex; flex-direction:column; gap:1px; padding:2px 4px 4px; border-radius:3px; background:#0002; border:1px solid #ffffff22;
  border-left:3px solid var(--oc,#999); cursor:pointer; transition:transform .12s; }
#stage .meld.o0 { --oc:var(--o0); } #stage .meld.o1 { --oc:var(--o1); } #stage .meld.o2 { --oc:var(--o2); } #stage .meld.o3 { --oc:var(--o3); } #stage .meld.o4 { --oc:var(--o4); }
#stage .meld .mo { font-size:10px; line-height:12px; color:#e9f2e9; white-space:nowrap; }
#stage .meld .mcs { display:flex; --cw:min(7.4vw,34px); }
#stage .meld .mcs .pc + .pc { margin-left:calc(var(--cw) * -.38); }
#stage .meld.tgt { border-color:#f0c24a; box-shadow:0 0 0 1px #f0c24a, 0 0 10px #f0c24a88; background:#f0c24a22; }
#stage .meld.hint { animation:canp .8s ease-in-out infinite alternate; }
#stage .hl-felt .res { position:absolute; left:50%; top:60%; transform:translate(-50%,-50%); z-index:5; min-width:60%; color:#fff7df; font-size:14px; text-align:center; line-height:1.5;
  background:#0b231ee6; border:1px solid #b8955a; border-radius:4px; padding:8px 14px; box-shadow:0 6px 20px #0008; }
#stage .hl-felt .res:empty { display:none; }
#stage .hl-felt .res .rk b { font-size:22px; color:#ffe39a; letter-spacing:.1em; font-family:"Gowun Batang","Batang",serif; }
#stage .hl-felt .res b { color:#ffe39a; } #stage .hl-felt .res small { color:#cfe6dc; margin-left:4px; }

/* ---------------- 카드 — 실제 트럼프 모양 (♠♣ 검정 · ♥♦ 빨강) */
.pc { position:relative; width:var(--cw,48px); aspect-ratio:5/7; border-radius:calc(var(--cw,48px) * .07); background:#fffefb;
  border:1px solid #c9c2b4; box-shadow:0 1px 3px #0005; overflow:hidden; flex:none; font-family:Georgia,"Times New Roman",serif; box-sizing:border-box; }
.pc.red { color:#c41a24; } .pc.blk { color:#16161a; }
.pc .ix { position:absolute; left:3%; top:3%; width:22%; display:flex; flex-direction:column; align-items:center; line-height:.95; z-index:2; }
.pc .ix.b { left:auto; top:auto; right:3%; bottom:3%; transform:rotate(180deg); }
.pc .ix em { font-style:normal; font-weight:700; font-size:calc(var(--cw,48px) * .24); letter-spacing:-.1em; white-space:nowrap; }
.pc .ix i { font-style:normal; font-size:calc(var(--cw,48px) * .19); }
.pc .pips { position:absolute; inset:15% 25% 15%; }
.pc .pips i { position:absolute; transform:translate(-50%,-50%); font-style:normal; font-size:calc(var(--cw,48px) * .24); line-height:1; }
.pc .pips i.f { transform:translate(-50%,-50%) rotate(180deg); }
.pc .ace { position:absolute; inset:0; display:flex; align-items:center; justify-content:center; font-size:calc(var(--cw,48px) * .6); line-height:1; }
.pc.blk .ace { font-size:calc(var(--cw,48px) * .68); }
.pc .fc { position:absolute; inset:10% 19%; border:1px solid #2a2622; border-radius:2px; overflow:hidden; display:flex; align-items:center; justify-content:center; background:#fbf6ea; }
.pc .fc b { font-size:calc(var(--cw,48px) * .5); font-weight:700; }
.pc .fc img { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; }
/* 작은 카드(등록 묶음·자리·훈수·규칙 창)는 무늬 배치 대신 큰 글자 */
.pc.sm .pips, .pc.sm .ix.b, .pc.sm .fc, .pc.sm .ace { display:none; }
.pc.sm .ix { left:0; right:0; top:8%; width:auto; }
.pc.sm .ix em { font-size:calc(var(--cw,48px) * .42); }
.pc.sm .ix i { font-size:calc(var(--cw,48px) * .4); margin-top:2px; }
.pc.back { background:#fffefb; border:1px solid #c9c2b4; }
.pc.back i { position:absolute; inset:6%; border-radius:calc(var(--cw,48px) * .04);
  background:repeating-linear-gradient(45deg,#2f4f6a 0 3px,#3f6582 3px 6px); box-shadow:inset 0 0 0 2px #fffefb, inset 0 0 0 3px #2f4f6a; }
.pc.slot { background:#0002; border:1px dashed #ffffff40; box-shadow:none; }
.flylayer { position:fixed; inset:0; pointer-events:none; z-index:60; }
.flyc { position:fixed; width:var(--cw); } .flyc .pc { width:var(--cw); box-shadow:0 6px 14px #0007; }

/* ---------------- 내 자리 */
#stage .mine { flex:none; display:flex; flex-direction:column; align-items:center; gap:3px; padding:3px 0 0; border-top:2px solid transparent; }
#stage .mine.turn { border-top-color:#e2b35a; }
#stage .mine .mi { display:flex; flex-wrap:wrap; justify-content:center; align-items:center; gap:10px; font-size:14px; }
#stage .mine .mi b { font-size:15px; } #stage .mine .mi em { font-style:normal; color:#7a5a20; font-weight:700; }
#stage .mine .mi .tag:empty { display:none; }
#stage .mine .mi .tag { font-size:11px; padding:0 6px; border:1px solid #b39a6c; border-radius:2px; color:#5e4a26; }
#stage .mine .mc { display:flex; justify-content:center; gap:4px; --cw:min(12.4vw,8.6vh,76px); padding-top:10px; min-height:calc(var(--cw) * 1.4 + 10px); }
#stage .mine .mc.many { gap:0; } #stage .mine .mc.many .pc + .pc { margin-left:calc(var(--cw) * -.1); }
#stage .mine .mc .pc { cursor:default; transition:transform .15s, box-shadow .15s; }
#stage .mine .mc.choosing .pc { cursor:pointer; }
#stage .mine .mc .pc.can::before { content:""; position:absolute; left:0; right:0; top:0; height:3px; background:#c08a16; z-index:3; }
#stage .mine .mc .pc.x { transform:translateY(-10px); box-shadow:0 0 0 2px #e2a52a, 0 6px 10px #0004; z-index:2; }
#stage .mine .mc .pc.must::after { content:"꼭 쓰기"; position:absolute; left:0; right:0; bottom:0; background:#2f4f6acc; color:#fff; font:700 calc(var(--cw) * .15)/1.6 sans-serif; text-align:center; z-index:3; }
#stage .mine .mc .pc.hc { box-shadow:0 0 0 2px #3a8f5a, 0 0 10px #3a8f5a; }
#stage .mine .mc .pc.nw { animation:nw .5s ease; }
@keyframes nw { 0% { transform:translateY(-30px); opacity:0; } 60% { transform:translateY(3px); opacity:1; } }
#stage .msg { flex:none; padding:5px 8px; font-size:14px; line-height:1.45; min-height:20px; border-left:2px solid var(--acc); background:#0000000a; }
#stage .msg small { font-size:12.5px; }

/* ---------------- 단추 */
#stage .bar { flex:none; display:flex; flex-direction:column; gap:5px; }
#stage .acts { display:flex; flex-direction:column; gap:5px; min-height:48px; }
#stage .acts .r1, #stage .acts .r2 { display:flex; gap:5px; }
#stage .acts .r1 .btn { flex:1; min-height:48px; font-size:15.5px; font-weight:700; padding:3px 2px; line-height:1.15; }
#stage .acts .r1 .btn small { display:block; font-size:11px; font-weight:500; opacity:.9; }
#stage .acts .r2 .btn { flex:1; min-height:34px; font-size:13px; padding:2px; }
#stage .acts > .btn.wide { min-height:50px; font-size:17px; font-weight:700; }
html body #stage .acts .btn.go { background:linear-gradient(var(--acc-hi),var(--acc)); border:1px solid var(--acc-lo); color:#fff; text-shadow:0 1px 0 #0005; box-shadow:0 2px 0 var(--acc-lo); }
html body #stage .acts .btn.die { background:var(--tit); border:1px solid #b2aa9c; color:#6e2a22; }
html body #stage .acts .btn:disabled { filter:grayscale(.8) opacity(.45); }
#stage .acts .wait { flex:1; display:flex; align-items:center; justify-content:center; color:var(--dim); font-size:14px; }
#stage .tools { display:flex; gap:6px; }
#stage .tools .btn { flex:1; font-size:14px; padding:4px; min-height:36px; }

/* ---------------- 규칙·훈수 창 */
#modal .ranks { text-align:left; max-height:46vh; overflow:auto; border-top:1px solid var(--rule2); }
#modal .ranks .rr { display:flex; gap:10px; align-items:center; padding:6px 2px; border-bottom:1px solid var(--rule2); }
#modal .ranks .no { width:20px; text-align:center; color:var(--dim); font-size:13px; }
#modal .ranks b { font-size:14px; } #modal .ranks small { margin-left:6px; font-size:12px; color:var(--dim); }
#modal .mini { display:flex; gap:2px; margin-top:3px; --cw:30px; }
#modal .hints { display:flex; flex-direction:column; gap:6px; text-align:left; margin:6px 0; }
#modal .hg { display:flex; align-items:center; gap:10px; padding:4px 6px; border-left:2px solid var(--acc); background:#0000000a; }
#modal .hg > span { font-size:13px; min-width:76px; } #modal .hg .mini { --cw:32px; margin:0; }

/* ---------------- 낮은 화면 */
@media (max-height:700px) {
  #stage .mine .mc { --cw:min(11vw,8vh,62px); }
  #stage .msg { font-size:13px; padding:4px 8px; }
  #stage .acts .r2 .btn { min-height:30px; }
}
/* ---------------- 가로로 넓은 창(PC 팝업 1280×860 · 작게 740×540) */
@media (min-aspect-ratio:5/4) {
  #stage .hd { max-width:1080px; }
  #stage .opps { justify-content:center; gap:5%; }
  #stage .stk { --cw:min(5vw,7vh,58px); }
  #stage .meld .mcs { --cw:min(3.2vw,5vh,40px); }
  #stage .mine .mc { --cw:min(6.2vw,10vh,84px); }
  #stage .seat .ocs { --cw:min(2.6vw,26px); }
  #stage .seat .un .bk { --cw:16px; }
  #stage .bar { flex-direction:row; align-items:stretch; }
  #stage .acts { flex:3; } #stage .tools { flex:1.3; flex-direction:column; gap:4px; }
  #stage .tools .btn { min-height:30px; padding:2px; font-size:13px; }
  #stage .acts .r2 .btn { min-height:30px; }
}
@media (min-aspect-ratio:5/4) and (max-height:600px) {
  #stage .opps { padding-top:16px; }
  #stage .mine .mc { --cw:min(6vw,9.4vh,64px); padding-top:8px; }
  #stage .hl-felt { min-height:120px; padding:5px; }
  #stage .msg { font-size:12.5px; padding:3px 8px; }
  #stage .acts .r1 .btn { min-height:40px; font-size:14px; }
  #stage .tools { display:grid; grid-template-columns:1fr 1fr; gap:4px; } #stage .tools .btn { min-height:34px; } #stage .tools .btn:nth-child(3) { grid-column:1 / 3; }
  #stage .hl-felt { min-height:96px; } #stage .seat .cnt { display:none; } #stage .hd { gap:4px; }
}
