:root{
  --bg:#fff8ec;--paper:#fff;--ink:#2b3a4a;--navy:#173b65;--muted:#617385;--line:#ecdcc0;--line-strong:#e0c391;
  --red:#e5484d;--red-deep:#b8323a;--gold:#f2b53a;--gold-deep:#b9831f;--green:#1f8f6a;--blue:#2468bd;--focus:#146ec4;
  --felt:#16704f;--felt-deep:#0d5038;--felt-line:#2c8a66;
  --shadow:0 22px 60px rgba(120,72,10,.16);--soft:0 10px 28px rgba(120,72,10,.10);
  --card-w:clamp(54px,min(8.4vw,10.5vh),98px);--card-h:calc(var(--card-w)*1.42);
  --radius:22px;--max:1220px;
  color-scheme:light;
}
*{box-sizing:border-box}
html{min-height:100%;background:var(--bg)}
body{margin:0;min-width:320px;min-height:100vh;color:var(--ink);font-family:Pretendard,"Noto Sans KR","Apple SD Gothic Neo","Malgun Gothic",system-ui,sans-serif;background:radial-gradient(circle at 6% 0,#ffe7b8 0,transparent 26rem),radial-gradient(circle at 96% 8%,#ffe0e3 0,transparent 24rem),linear-gradient(#fffaf2,#fff4e4);overflow-x:hidden;-webkit-font-smoothing:antialiased}
button,input,select{font:inherit;color:inherit}
button{-webkit-tap-highlight-color:transparent}
:focus-visible{outline:3px solid var(--focus);outline-offset:3px}
[hidden]{display:none!important}
.hg-skip{position:fixed;left:1rem;top:1rem;z-index:100;transform:translateY(-200%);padding:.7rem 1rem;border-radius:10px;background:var(--navy);color:#fff;font-weight:900}
.hg-skip:focus{transform:none}

/* top bar */
.hg-top{position:sticky;top:0;z-index:30;display:flex;align-items:center;gap:1rem;min-height:66px;padding:.6rem max(1rem,calc((100vw - var(--max))/2));border-bottom:1px solid #ecdcc0cc;background:#fffaf2e6;backdrop-filter:blur(14px)}
.hg-brand{display:flex;align-items:center;gap:.65rem;color:inherit;text-decoration:none}
.hg-brand-mark{display:grid;place-items:center;width:42px;height:42px;border:1px solid var(--line-strong);border-radius:14px;background:linear-gradient(145deg,#fff,#fff0cf);box-shadow:var(--soft)}
.hg-brand-copy{display:grid;line-height:1.05}
.hg-brand-copy strong{color:var(--navy);letter-spacing:.06em;font-size:.95rem}
.hg-brand-copy small{margin-top:.25rem;color:var(--muted);font-size:.68rem;font-weight:800}
.hg-nav{display:flex;gap:.2rem;margin-left:auto}
.hg-nav a{padding:.55rem .8rem;border-radius:999px;color:var(--muted);text-decoration:none;font-size:.86rem;font-weight:800}
.hg-nav a:hover{background:#fff;color:var(--navy)}
/* 효과음 켜기/끄기 버튼 (public/assets/sfx/sfx.js 가 data-sfx-toggle 을 자동 연결) */
.hg-nav{align-items:center}.sfx-toggle{width:38px;height:38px;flex:0 0 auto;display:inline-grid;place-items:center;margin-left:.2rem;padding:0;border:1px solid var(--line);border-radius:999px;background:#fff;color:var(--gold-deep);cursor:pointer;transition:background .16s ease,border-color .16s ease,color .16s ease,transform .16s ease}.sfx-toggle:hover{transform:translateY(-1px);color:var(--navy)}.sfx-toggle:focus-visible{outline:3px solid var(--navy);outline-offset:3px}.sfx-toggle svg{width:19px;height:19px;overflow:visible}.sfx-toggle .sfx-wave,.sfx-toggle .sfx-mute{transition:opacity .16s ease}.sfx-toggle .sfx-mute{opacity:0}.sfx-toggle[aria-pressed=false]{color:var(--muted);background:#f7f1e6}.sfx-toggle[aria-pressed=false] .sfx-wave{opacity:0}.sfx-toggle[aria-pressed=false] .sfx-mute{opacity:1}
@media(prefers-reduced-motion:reduce){.sfx-toggle,.sfx-toggle *{transition:none}}@media(forced-colors:active){.sfx-toggle{border-color:ButtonText;color:ButtonText}}
.hg-account{display:flex;align-items:center;gap:.65rem;padding:.4rem .5rem .4rem .8rem;border:1px solid var(--line);border-radius:999px;background:#fff;box-shadow:var(--soft);font-size:.84rem;white-space:nowrap}
.hg-account-name{max-width:9rem;overflow:hidden;text-overflow:ellipsis;color:var(--navy);font-weight:900}
.hg-account-money{color:var(--muted);font-variant-numeric:tabular-nums}
.hg-account-money b{color:var(--gold-deep)}
.hg-link-btn{border:0;padding:.35rem .6rem;border-radius:999px;background:#fff4e0;color:var(--muted);font-size:.74rem;font-weight:800;cursor:pointer}
.hg-link-btn:hover{background:#ffe9c2;color:var(--navy)}

.hg-main{width:min(calc(100% - 2rem),var(--max));margin:0 auto;padding:clamp(1.2rem,3.5vw,2.6rem) 0 4rem}
.hg-panel{animation:hg-in .3s ease both}
@keyframes hg-in{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}
.hg-eyebrow{display:inline-flex;align-items:center;gap:.55rem;margin:0 0 .6rem;color:var(--red-deep);font-size:.74rem;font-weight:950;letter-spacing:.12em}
.hg-eyebrow:before{content:"";width:26px;height:3px;border-radius:999px;background:linear-gradient(90deg,var(--red),var(--gold))}
h1,h2,h3,p{margin-top:0}

/* buttons */
.hg-btn{display:inline-flex;align-items:center;justify-content:center;gap:.45rem;min-height:44px;padding:.65rem 1rem;border:1px solid var(--line-strong);border-radius:14px;background:#fff;color:var(--navy);font-weight:850;cursor:pointer;box-shadow:0 6px 16px #78480a12;transition:transform .15s ease,box-shadow .15s ease,background .15s ease;touch-action:manipulation;user-select:none}
.hg-btn:hover:not(:disabled){transform:translateY(-1px);box-shadow:0 10px 22px #78480a1f}
.hg-btn:active:not(:disabled){transform:translateY(1px) scale(.99)}
.hg-btn:disabled{opacity:.5;cursor:not-allowed}
.hg-btn.primary{border-color:#c2573f;background:linear-gradient(135deg,var(--red),#e0761f);color:#fff;box-shadow:0 12px 26px #e5484d33}
.hg-btn.danger{border-color:#f0bcc3;background:#fff6f7;color:var(--red-deep)}
.hg-btn.ready{border-color:#9ed8c1;background:#effaf5;color:var(--green)}
.hg-btn.ready[aria-pressed=true]{border-color:var(--green);background:linear-gradient(135deg,#21a17a,#178062);color:#fff}
.hg-btn.wide{width:100%}
.hg-btn.big{min-height:56px;font-size:1.05rem;border-radius:16px}
.hg-btn kbd{padding:.1rem .4rem;border:1px solid #ffffff66;border-radius:6px;background:#ffffff26;font:inherit;font-size:.72rem;font-weight:900}
.hg-ring-btn kbd{border-color:var(--line-strong);background:#fff5e1}
.hg-form-status{min-height:1.3rem;margin:.6rem 0 0;color:var(--muted);font-size:.86rem;font-weight:750;line-height:1.5}
.hg-form-status.center{text-align:center}
.hg-form-status.bad{color:var(--red-deep)}
.hg-form-status.good{color:var(--green)}

/* loading / auth */
.hg-loading{display:grid;place-items:center;gap:1rem;min-height:50vh;color:var(--muted)}
.hg-spinner{width:44px;height:44px;border:4px solid #f4dcb0;border-top-color:var(--red);border-radius:50%;animation:hg-spin .8s linear infinite}
@keyframes hg-spin{to{transform:rotate(360deg)}}
.hg-auth{display:grid;place-items:center;min-height:60vh}
.hg-auth-card{width:min(100%,460px);padding:clamp(1.4rem,4vw,2.2rem);border:1px solid var(--line);border-radius:28px;background:#fffffff2;box-shadow:var(--shadow)}
.hg-auth-card h1{margin-bottom:.6rem;color:var(--navy);font-size:clamp(1.5rem,4vw,1.9rem);letter-spacing:-.04em}
.hg-auth-card>p{color:var(--muted);line-height:1.65;font-size:.92rem}
.hg-auth-card form{display:grid;gap:.8rem;margin-top:1.2rem}
.hg-auth-card label,.hg-settings label{display:grid;gap:.35rem;color:var(--navy);font-size:.8rem;font-weight:900}
.hg-auth-card input,.hg-settings input,.hg-settings select{min-height:48px;padding:.65rem .85rem;border:1px solid var(--line-strong);border-radius:13px;background:#fff;outline:0}
.hg-auth-card input:focus,.hg-settings input:focus,.hg-settings select:focus{border-color:var(--red);box-shadow:0 0 0 4px #e5484d1f}
.hg-auth-link{display:block;margin-top:1rem;text-align:center;color:var(--blue);font-size:.86rem;font-weight:800}

/* hub */
.hg-hub-hero{display:grid;grid-template-columns:minmax(0,1.1fr) minmax(280px,.9fr);gap:2rem;align-items:center;margin-bottom:1.6rem}
.hg-hub-hero h1{margin-bottom:.8rem;color:var(--navy);font-size:clamp(3rem,9vw,5.6rem);line-height:.95;letter-spacing:-.07em}
.hg-lead{max-width:600px;color:var(--muted);font-size:clamp(1rem,2vw,1.12rem);line-height:1.78;word-break:keep-all}
.hg-lead strong{color:var(--red-deep)}
.hg-hero-cards{position:relative;height:250px}
.hg-hero-cards .hg-card{position:absolute;left:calc(50% - var(--card-w)/2);top:calc(50% - var(--card-h)/2);--card-w:clamp(84px,11vw,120px);--card-h:calc(var(--card-w)*1.42);transform-origin:50% 130%;transform:rotate(var(--fan,0deg));animation:hg-fan .7s cubic-bezier(.2,.9,.25,1.2) both}
@keyframes hg-fan{from{opacity:0;transform:rotate(0deg) translateY(16px)}}
.hg-hub-actions{display:grid;grid-template-columns:1fr 1fr;gap:1rem}
.hg-action-card{display:flex;align-items:center;gap:1.1rem;min-height:132px;padding:1.4rem;border:1px solid var(--line);border-radius:26px;background:#fff;box-shadow:var(--soft);text-align:left;cursor:pointer;transition:transform .2s ease,box-shadow .2s ease}
.hg-action-card:hover:not(:disabled){transform:translateY(-3px);box-shadow:var(--shadow)}
.hg-action-card:disabled{opacity:.6;cursor:progress}
.hg-action-card strong{display:block;margin-bottom:.35rem;color:var(--navy);font-size:1.35rem;letter-spacing:-.03em}
.hg-action-card small{display:block;color:var(--muted);font-size:.88rem;line-height:1.55;word-break:keep-all}
.hg-action-icon{flex:0 0 64px;display:grid;place-items:center;width:64px;height:64px;border-radius:20px;font-size:1.8rem;font-weight:900}
.hg-action-card.create{background:radial-gradient(circle at 100% 0,#ffe3e5 0,transparent 55%),#fff}
.hg-action-card.create .hg-action-icon{background:linear-gradient(135deg,var(--red),#e0761f);color:#fff;box-shadow:0 12px 24px #e5484d40}
.hg-action-card.list{background:radial-gradient(circle at 100% 0,#fff0c9 0,transparent 55%),#fff}
.hg-action-card.list .hg-action-icon{background:linear-gradient(135deg,#f8cf5c,#e09a1c);color:#fff;box-shadow:0 12px 24px #e09a1c40}
.hg-rules{margin-top:1.4rem;padding:1rem 1.2rem;border:1px solid var(--line);border-radius:20px;background:#fffffff0}
.hg-rules summary{color:var(--navy);font-weight:900;cursor:pointer}
.hg-rules ul{margin:.8rem 0 0;padding-left:1.2rem;color:var(--muted);line-height:1.75;font-size:.9rem}
.hg-rules strong{color:var(--red-deep)}

/* list */
.hg-section-head{display:flex;align-items:flex-end;justify-content:space-between;gap:1rem;flex-wrap:wrap;margin-bottom:1rem}
.hg-section-head h1{margin:0;color:var(--navy);font-size:clamp(1.8rem,5vw,2.6rem);letter-spacing:-.05em}
.hg-section-tools{display:flex;gap:.5rem;flex-wrap:wrap}
.hg-room-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(270px,1fr));gap:.9rem;margin-top:.6rem}
.hg-room-card{display:flex;flex-direction:column;gap:.8rem;padding:1.15rem;border:1px solid var(--line);border-radius:22px;background:#fff;box-shadow:var(--soft)}
.hg-room-card-head{display:flex;align-items:flex-start;justify-content:space-between;gap:.6rem}
.hg-room-card h2{margin:0;color:var(--navy);font-size:1.08rem;line-height:1.35;word-break:break-all}
.hg-room-card .host{color:var(--muted);font-size:.8rem;font-weight:750}
.hg-room-stats{display:grid;grid-template-columns:1fr 1fr;gap:.5rem}
.hg-room-stats div{padding:.6rem .7rem;border-radius:13px;background:#fff8ea}
.hg-room-stats span{display:block;color:var(--muted);font-size:.7rem;font-weight:800}
.hg-room-stats b{display:block;margin-top:.15rem;color:var(--navy);font-variant-numeric:tabular-nums;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.hg-room-seats{display:flex;gap:.3rem}
.hg-room-seats i{flex:1;height:6px;border-radius:999px;background:#f1e3c8}
.hg-room-seats i.on{background:linear-gradient(90deg,var(--red),var(--gold))}
.hg-badge{flex:0 0 auto;padding:.28rem .55rem;border-radius:999px;font-size:.7rem;font-weight:950;white-space:nowrap}
.hg-badge.lobby{background:#e9f8f1;color:var(--green)}
.hg-badge.playing{background:#fff0e0;color:#b86200}
.hg-badge.full{background:#f1f3f6;color:var(--muted)}
.hg-empty{grid-column:1/-1;padding:3rem 1rem;border:1px dashed var(--line-strong);border-radius:22px;background:#fffdf8;text-align:center;color:var(--muted)}
.hg-empty strong{display:block;margin-bottom:.4rem;color:var(--navy);font-size:1.15rem}

/* room head */
.hg-room-head{display:flex;align-items:flex-start;justify-content:space-between;gap:1rem;margin-bottom:1rem}
.hg-room-head h1{margin:0 0 .55rem;color:var(--navy);font-size:clamp(1.5rem,4vw,2.2rem);letter-spacing:-.04em;word-break:break-all}
.hg-room-meta{display:flex;flex-wrap:wrap;gap:.4rem}
.hg-chip{display:inline-flex;align-items:center;gap:.35rem;padding:.32rem .65rem;border:1px solid var(--line);border-radius:999px;background:#fff;color:var(--muted);font-size:.78rem;font-weight:800;font-variant-numeric:tabular-nums}
.hg-chip b{color:var(--navy)}
.hg-chip.stake b,.hg-chip.pot b{color:var(--gold-deep)}
.hg-chip.net i{width:8px;height:8px;border-radius:50%;background:#c7ced6}
.hg-chip.net[data-quality=good] i{background:#20b37f;box-shadow:0 0 0 3px #20b37f2a}
.hg-chip.net[data-quality=ok] i{background:#e6a817;box-shadow:0 0 0 3px #e6a8172a}
.hg-chip.net[data-quality=bad] i{background:var(--red);box-shadow:0 0 0 3px #e5484d2a}

/* compact header while a match is on the table */
.hg-room.is-playing .hg-room-head{margin-bottom:.6rem}
.hg-room.is-playing .hg-room-head .hg-eyebrow{display:none}
.hg-room.is-playing .hg-room-head h1{margin-bottom:.35rem;font-size:clamp(1.15rem,2.6vw,1.45rem)}
.hg-room.is-playing .hg-room-head .hg-btn{min-height:38px;padding:.45rem .8rem}

/* lobby */
.hg-lobby{display:grid;grid-template-columns:minmax(0,1.5fr) minmax(280px,.8fr);gap:1rem;align-items:start}
.hg-seats{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.8rem}
.hg-seat{position:relative;display:flex;flex-direction:column;gap:.7rem;min-height:150px;padding:1.1rem;border:1px solid var(--line);border-radius:22px;background:#fff;box-shadow:var(--soft)}
.hg-seat.empty{align-items:center;justify-content:center;border-style:dashed;background:#fffdf8;box-shadow:none;color:#b6a383;font-weight:850}
.hg-seat.closed{opacity:.45}
.hg-seat.me{border-color:#f0a7ad;box-shadow:0 0 0 3px #e5484d14,var(--soft)}
.hg-seat-top{display:flex;align-items:center;gap:.7rem}
.hg-avatar{flex:0 0 46px;display:grid;place-items:center;width:46px;height:46px;border-radius:16px;color:#fff;font-weight:950;font-size:1.1rem}
.hg-seat-name{min-width:0}
.hg-seat-name strong{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--navy);font-size:1.02rem}
.hg-seat-name small{color:var(--muted);font-size:.74rem;font-weight:800}
.hg-seat-tags{display:flex;flex-wrap:wrap;gap:.35rem}
.hg-tag{padding:.25rem .55rem;border-radius:999px;background:#f4f6f8;color:var(--muted);font-size:.7rem;font-weight:900}
.hg-tag.host{background:#fff1cc;color:#8a5a00}
.hg-tag.ready{background:#e9f8f1;color:var(--green)}
.hg-tag.away{background:#fff0f1;color:var(--red-deep)}
.hg-kick{position:absolute;right:.7rem;top:.7rem;min-height:32px;padding:.3rem .65rem;border:1px solid #f0bcc3;border-radius:10px;background:#fff6f7;color:var(--red-deep);font-size:.74rem;font-weight:900;cursor:pointer}
.hg-kick:hover{background:#ffe9ec}
.hg-lobby-side{display:grid;gap:.8rem}
.hg-lobby-card{padding:1.1rem;border:1px solid var(--line);border-radius:22px;background:#fff;box-shadow:var(--soft)}
.hg-lobby-card h2{display:flex;align-items:center;gap:.5rem;margin-bottom:.8rem;color:var(--navy);font-size:1.05rem}
.hg-lobby-card h2 small{padding:.15rem .45rem;border-radius:999px;background:#fff1cc;color:#8a5a00;font-size:.66rem}
.hg-settings{display:grid;gap:.7rem}
.hg-stake-presets{display:flex;flex-wrap:wrap;gap:.35rem}
.hg-stake-presets button{min-height:32px;padding:.25rem .6rem;border:1px solid var(--line);border-radius:999px;background:#fffaf0;color:var(--navy);font-size:.76rem;font-weight:850;cursor:pointer}
.hg-stake-presets button:hover:not(:disabled){border-color:var(--gold)}
.hg-stake-presets button:disabled{opacity:.4;cursor:not-allowed}
.hg-lobby-controls{display:grid;gap:.6rem}
.hg-lobby-hint{margin:0;color:var(--muted);font-size:.88rem;line-height:1.55;word-break:keep-all}
.hg-last-result h2{margin-bottom:.6rem}
.hg-last-result ol{margin:0;padding:0;list-style:none;display:grid;gap:.4rem}
.hg-last-result li{display:flex;justify-content:space-between;gap:.5rem;padding:.5rem .65rem;border-radius:12px;background:#fffaf0;font-size:.85rem}
.hg-last-result li.win{background:#fff1cc;font-weight:900}
.hg-last-result li span:last-child{font-variant-numeric:tabular-nums;color:var(--gold-deep);font-weight:900;white-space:nowrap}

/* table */
.hg-table-wrap{display:grid;gap:.8rem}
.hg-table-top{display:flex;align-items:center;justify-content:space-between;gap:.8rem}
.hg-match-clock{display:flex;align-items:baseline;gap:.4rem;padding:.4rem .8rem;border:1px solid var(--line);border-radius:999px;background:#fff;color:var(--muted);font-size:.78rem;font-weight:800}
.hg-match-clock b{color:var(--navy);font-size:1rem;font-variant-numeric:tabular-nums}
.hg-turn-banner{flex:1;min-height:40px;display:flex;align-items:center;justify-content:center;padding:.45rem .9rem;border-radius:999px;background:#173b65;color:#fff;font-weight:900;text-align:center;font-size:.92rem;transition:background .2s ease}
.hg-turn-banner.mine{background:linear-gradient(135deg,var(--red),#e0761f);animation:hg-pulse 1.1s ease-in-out infinite}
@keyframes hg-pulse{50%{box-shadow:0 0 0 6px #e5484d26}}
.hg-table{position:relative;height:clamp(400px,calc(100dvh - 345px),760px);border-radius:min(48px,6vw);overflow:hidden;box-shadow:inset 0 0 0 10px #8a5a2b,inset 0 0 0 14px #6e4520,var(--shadow);background:#6e4520;user-select:none;-webkit-user-select:none;touch-action:manipulation}
.hg-table-felt{position:absolute;inset:14px;border-radius:min(36px,5vw);background:radial-gradient(ellipse at 50% 45%,#1d8a62 0,var(--felt) 45%,var(--felt-deep) 100%)}
.hg-table-felt:after{content:"";position:absolute;inset:7%;border:2px dashed #ffffff1c;border-radius:50%}
.hg-table-seats{position:absolute;inset:14px}
.hg-tseat{position:absolute;display:flex;align-items:center;gap:clamp(.4rem,1.2vw,.9rem);transform:translate(-50%,-50%)}
.hg-tseat[data-pos=bottom]{left:50%;top:83%}
.hg-tseat[data-pos=top]{left:50%;top:17%}
.hg-tseat[data-pos=left]{left:15%;top:50%;flex-direction:column}
.hg-tseat[data-pos=right]{left:85%;top:50%;flex-direction:column}
.hg-tseat[data-pos=topleft]{left:27%;top:19%}
.hg-tseat[data-pos=topright]{left:73%;top:19%}
.hg-tseat.out{filter:grayscale(.85);opacity:.6}
.hg-plate{flex:0 0 auto;display:flex;align-items:center;gap:.5rem;min-width:0;max-width:170px;padding:.35rem .6rem .35rem .4rem;border-radius:999px;background:#0b3a29d9;color:#fff;box-shadow:0 6px 16px #0006}
.hg-plate .hg-avatar{flex-basis:30px;width:30px;height:30px;border-radius:50%;font-size:.8rem}
.hg-plate-copy{display:grid;min-width:0;line-height:1.15}
.hg-plate-copy strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:.82rem}
.hg-plate-copy small{color:#cfe9dd;font-size:.68rem;font-variant-numeric:tabular-nums}
.hg-tseat.turn .hg-plate{background:#fff;color:var(--navy);box-shadow:0 0 0 3px var(--gold),0 8px 20px #0007}
.hg-tseat.turn .hg-plate-copy small{color:var(--muted)}
.hg-timer{position:relative;flex:0 0 26px;width:26px;height:26px}
.hg-timer svg{display:block;width:100%;height:100%;transform:rotate(-90deg)}
.hg-timer circle{fill:none;stroke-width:4}
.hg-timer .track{stroke:#0000001a}
.hg-timer .bar{stroke:var(--red);stroke-linecap:round}
.hg-cards{display:flex;align-items:center;gap:clamp(.3rem,1vw,.7rem)}
.hg-deck{position:relative;width:var(--card-w);height:var(--card-h)}
.hg-deck .hg-card-back{position:absolute;inset:0}
.hg-deck .hg-card-back:nth-child(2){transform:translate(-3px,-3px)}
.hg-deck .hg-card-back:nth-child(3){transform:translate(-6px,-6px)}
.hg-deck-count{position:absolute;right:-8px;bottom:-8px;z-index:3;min-width:28px;padding:.15rem .35rem;border-radius:999px;background:#fff;color:var(--navy);font-size:.72rem;font-weight:950;text-align:center;box-shadow:0 3px 8px #0004;font-variant-numeric:tabular-nums}
.hg-deck.empty{border:2px dashed #ffffff40;border-radius:12px}
.hg-pile{position:relative;width:var(--card-w);height:var(--card-h);border:2px dashed #ffffff30;border-radius:12px}
.hg-pile .hg-card{position:absolute;inset:0}
.hg-pile-count{position:absolute;left:50%;bottom:-20px;transform:translateX(-50%);color:#d8f0e5;font-size:.66rem;font-weight:800;white-space:nowrap}
.hg-card,.hg-card-back{width:var(--card-w);height:var(--card-h);border-radius:12px}
.hg-card{display:block;background:#fffdf7;border:2px solid #fff;box-shadow:0 6px 14px #0005}
.hg-card svg{display:block;width:100%;height:100%}
.hg-card-back{background:radial-gradient(circle at 50% 50%,#f6c24a 0 18%,transparent 19%),repeating-linear-gradient(45deg,#c8323a 0 6px,#b02a33 6px 12px);border:3px solid #fff;box-shadow:0 4px 10px #0005}
.hg-card.flip-in{animation:hg-flip .34s cubic-bezier(.2,.8,.25,1) both}
@keyframes hg-flip{0%{transform:translateY(-14px) rotateY(90deg) scale(.92);opacity:.4}100%{transform:none;opacity:1}}
.hg-pile.collect .hg-card{animation:hg-collect .55s ease-in forwards}
@keyframes hg-collect{to{transform:translate(var(--to-x,0),var(--to-y,0)) scale(.4) rotate(18deg);opacity:0}}
.hg-tseat.miss{animation:hg-shake .42s ease}
@keyframes hg-shake{20%,60%{translate:-6px 0}40%,80%{translate:6px 0}}

/* bell */
.hg-bell{position:absolute;left:50%;top:50%;width:clamp(104px,15vw,170px);aspect-ratio:1;transform:translate(-50%,-50%);border:0;padding:0;border-radius:50%;background:transparent;cursor:pointer;filter:drop-shadow(0 12px 18px #0007);touch-action:manipulation;z-index:5}
.hg-bell-svg{display:block;width:100%;height:100%;transition:transform .08s ease}
.hg-bell:active .hg-bell-svg,.hg-bell.pressed .hg-bell-svg{transform:translateY(5px) scale(.96)}
.hg-bell.rang .hg-bell-svg{animation:hg-ring .5s ease}
@keyframes hg-ring{15%{transform:rotate(-9deg)}35%{transform:rotate(8deg)}55%{transform:rotate(-5deg)}75%{transform:rotate(3deg)}}
.hg-bell-ripple{position:absolute;inset:8%;border-radius:50%;pointer-events:none}
.hg-bell.rang .hg-bell-ripple{animation:hg-ripple .6s ease-out}
@keyframes hg-ripple{from{box-shadow:0 0 0 0 #ffe08acc}to{box-shadow:0 0 0 46px #ffe08a00}}
.hg-bell-label{position:absolute;left:50%;bottom:-22px;transform:translateX(-50%);padding:.12rem .5rem;border-radius:999px;background:#0b3a29b3;color:#e9fff5;font-size:.62rem;font-weight:950;letter-spacing:.12em}
.hg-bell:disabled{cursor:default;filter:grayscale(.5) drop-shadow(0 12px 18px #0006)}
.hg-table-toast{position:absolute;left:50%;top:33%;z-index:6;transform:translate(-50%,-50%);padding:.55rem 1rem;border-radius:999px;background:#fff;color:var(--navy);font-weight:950;box-shadow:0 10px 26px #0006;white-space:nowrap;opacity:0;pointer-events:none}
.hg-table-toast.show{animation:hg-toast 1.6s ease both}
.hg-table-toast.good{background:linear-gradient(135deg,#fff3c4,#ffe08a);color:#6b4500}
.hg-table-toast.bad{background:#fff0f1;color:var(--red-deep)}
@keyframes hg-toast{0%{opacity:0;transform:translate(-50%,-30%) scale(.9)}12%{opacity:1;transform:translate(-50%,-50%) scale(1)}80%{opacity:1}100%{opacity:0;transform:translate(-50%,-70%)}}

.hg-controls{display:grid;grid-template-columns:auto 1fr 1fr;gap:.7rem;align-items:center}
.hg-my-stack{display:grid;justify-items:center;min-width:90px;padding:.45rem .8rem;border:1px solid var(--line);border-radius:16px;background:#fff}
.hg-my-stack-label{color:var(--muted);font-size:.7rem;font-weight:800}
.hg-my-stack b{color:var(--navy);font-size:1.4rem;font-variant-numeric:tabular-nums}

/* dialogs, toasts */
.hg-dialog{width:min(calc(100% - 2rem),520px);border:1px solid var(--line-strong);border-radius:24px;padding:0;background:#fff;color:var(--ink);box-shadow:var(--shadow)}
.hg-dialog::backdrop{background:#2b1a0855;backdrop-filter:blur(4px)}
.hg-dialog-body{padding:1.5rem 1.5rem .5rem}
.hg-dialog-body h2{margin-bottom:.5rem;color:var(--navy);font-size:1.35rem}
.hg-dialog-body p{color:var(--muted);line-height:1.6}
.hg-dialog-actions{display:flex;justify-content:flex-end;gap:.5rem;padding:1rem 1.5rem 1.4rem}
.hg-result-hero{text-align:center;padding:.4rem 0 .8rem}
.hg-result-hero .crown{font-size:2.6rem}
.hg-result-hero h2{margin:.2rem 0 .3rem;font-size:1.6rem}
.hg-result-hero p{margin:0}
.hg-result-amount{margin-top:.6rem;color:var(--gold-deep);font-size:1.4rem;font-weight:950;font-variant-numeric:tabular-nums;word-break:break-all}
.hg-result-list{margin:.6rem 0 0;padding:0;list-style:none;display:grid;gap:.4rem}
.hg-result-list li{display:grid;grid-template-columns:2rem 1fr auto;align-items:center;gap:.5rem;padding:.6rem .7rem;border-radius:14px;background:#fffaf0;font-size:.88rem}
.hg-result-list li.win{background:linear-gradient(135deg,#fff3c4,#ffe7a3);font-weight:900}
.hg-result-list li b{color:var(--navy)}
.hg-result-list li span{color:var(--muted);font-size:.78rem;font-variant-numeric:tabular-nums;text-align:right}
.hg-toasts{position:fixed;left:50%;bottom:calc(1rem + env(safe-area-inset-bottom));z-index:60;display:grid;gap:.45rem;width:min(calc(100% - 2rem),520px);transform:translateX(-50%);pointer-events:none}
.hg-toast{padding:.75rem 1rem;border:1px solid var(--line-strong);border-radius:14px;background:#fffffff7;color:var(--navy);font-weight:800;text-align:center;box-shadow:var(--shadow);animation:hg-in .25s ease both}
.hg-toast.bad{border-color:#f0bcc3;color:var(--red-deep)}
.hg-toast.good{border-color:#a9dfc8;color:var(--green)}

@media(max-width:900px){
  .hg-hub-hero{grid-template-columns:1fr}
  .hg-hero-cards{height:200px}
  .hg-lobby{grid-template-columns:1fr}
  .hg-table{height:clamp(420px,min(118vw,calc(100dvh - 250px)),640px)}
  .hg-tseat[data-pos=bottom]{top:85%}
  .hg-tseat[data-pos=top]{top:15%}
  .hg-tseat[data-pos=left]{left:16%}
  .hg-tseat[data-pos=right]{left:84%}
  .hg-tseat[data-pos=topleft]{left:25%;top:20%;flex-direction:column}
  .hg-tseat[data-pos=topright]{left:75%;top:20%;flex-direction:column}
}
@media(max-width:620px){
  .hg-top{position:static;flex-wrap:wrap;gap:.5rem}
  .hg-nav{margin-left:auto}
  .hg-account{order:3;width:100%;justify-content:space-between}
  .hg-main{width:min(calc(100% - 1rem),var(--max))}
  .hg-hub-actions{grid-template-columns:1fr}
  .hg-seats{grid-template-columns:1fr}
  .hg-room-head{flex-direction:column}
  .hg-room-head .hg-btn{align-self:flex-end}
  .hg-controls{grid-template-columns:1fr 1fr}
  .hg-my-stack{grid-column:1/-1;grid-auto-flow:column;gap:.5rem;justify-content:center}
  .hg-plate{max-width:120px}
  .hg-tseat{flex-direction:column;gap:.3rem}
  .hg-tseat[data-pos=bottom]{flex-direction:column-reverse}
  .hg-tseat[data-pos=left] .hg-cards,.hg-tseat[data-pos=right] .hg-cards{flex-direction:column}
  .hg-pile-count{display:none}
  :root{--card-w:clamp(48px,13vw,66px)}
}
@media(hover:none) and (pointer:coarse){
  .hg-btn kbd,.hg-bell-label{display:none}
}
@media(prefers-reduced-motion:reduce){
  *,*:before,*:after{animation-duration:.001ms!important;animation-iteration-count:1!important;transition-duration:.001ms!important}
}
@media(forced-colors:active){
  .hg-btn,.hg-action-card,.hg-seat,.hg-room-card,.hg-lobby-card{border:1px solid CanvasText}
}

/* ── v4.4 구조 레이어: 떠 있는 상단 도크 · 테이블(펠트) 히어로 · 2단 로비 · 분할 입장 카드 (색은 기존 팔레트 유지) ── */
.hg-top{position:sticky;top:12px;width:min(calc(100% - 24px),var(--max));margin:12px auto 0;min-height:60px;padding:.5rem .6rem .5rem .75rem;border:1px solid var(--line);border-radius:18px;background:rgba(255,255,255,.88);box-shadow:var(--soft)}
.hg-brand-mark{border-radius:12px}
.hg-nav a{border-radius:10px}
.hg-main{padding-top:clamp(1.2rem,3vw,2rem)}

/* 로비: 왼쪽 테이블 패널(고정) + 오른쪽 행동 목록 */
.hg-hub{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);grid-template-areas:"hero actions" "hero status" "hero rules";grid-template-rows:auto auto 1fr;column-gap:1.25rem;align-items:start}
.hg-hub[hidden]{display:none}
.hg-hub-hero{grid-area:hero;position:sticky;top:96px;display:grid;grid-template-columns:1fr;gap:.5rem;margin:0;padding:clamp(1.5rem,3.5vw,2.4rem);border-radius:26px;background:radial-gradient(420px 260px at 80% 100%,rgba(255,255,255,.12),transparent 70%),repeating-linear-gradient(45deg,rgba(255,255,255,.025) 0 2px,transparent 2px 6px),linear-gradient(165deg,var(--felt),var(--felt-deep));color:#fff;box-shadow:inset 0 0 0 6px rgba(255,255,255,.06),var(--shadow)}
.hg-hub-hero h1{color:#fff;font-size:clamp(2.8rem,6vw,4.6rem)}
.hg-hub-hero .hg-lead{color:rgba(255,255,255,.82)}
.hg-hub-hero .hg-lead strong{color:var(--gold)}
.hg-hub-hero .hg-eyebrow{color:var(--gold)}
.hg-hero-cards{height:230px;margin-top:.5rem}
.hg-hub-actions{grid-area:actions;grid-template-columns:1fr;gap:.85rem}
.hg-action-card{position:relative;min-height:150px;padding:1.5rem 3.4rem 1.5rem 1.5rem;border-radius:22px}
.hg-action-card:after{content:"→";position:absolute;right:1.4rem;top:50%;transform:translateY(-50%);color:var(--muted);font-size:1.3rem;font-weight:900;transition:transform .2s ease,color .2s ease}
.hg-action-card:hover:not(:disabled):after{transform:translate(4px,-50%);color:var(--navy)}
.hg-hub>.hg-form-status{grid-area:status;margin:.6rem 0 0}
.hg-rules{grid-area:rules;margin-top:.85rem;border-radius:22px}

/* 입장: 왼쪽 테이블 패널 + 오른쪽 입력 폼 */
.hg-auth-card{position:relative;width:min(100%,880px);display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);grid-template-areas:"eb form" "h form" "d form" ". link";column-gap:3rem;align-content:start;padding:clamp(1.6rem,4vw,2.6rem);overflow:hidden;isolation:isolate}
.hg-auth-card:before{content:"";position:absolute;left:0;top:0;bottom:0;width:calc(50% - 1.5rem + clamp(1.6rem,4vw,2.6rem)/2);background:repeating-linear-gradient(45deg,rgba(255,255,255,.03) 0 2px,transparent 2px 6px),linear-gradient(165deg,var(--felt),var(--felt-deep));z-index:-1}
.hg-auth-card>.hg-eyebrow{grid-area:eb;color:var(--gold)}
.hg-auth-card>h1{grid-area:h;color:#fff}
.hg-auth-card>p:not(.hg-eyebrow){grid-area:d;color:rgba(255,255,255,.8);line-height:1.7}
.hg-auth-card form{grid-area:form;margin-top:0;align-self:center}
.hg-auth-card>.hg-auth-link{grid-area:link;justify-self:center;margin-top:.8rem}

@media(max-width:860px){
  .hg-hub{grid-template-columns:1fr;grid-template-areas:"hero" "actions" "status" "rules";row-gap:1rem}
  .hg-hub-hero{position:static}
  .hg-auth-card{grid-template-columns:1fr;grid-template-areas:"eb" "h" "d" "form" "link";row-gap:0;padding-top:0}
  .hg-auth-card:before{width:auto;right:0;bottom:auto;height:0}
  .hg-auth-card>.hg-eyebrow{margin:-1px calc(-1 * clamp(1.6rem,4vw,2.6rem)) 0;padding:1.4rem clamp(1.6rem,4vw,2.6rem) .4rem;background:linear-gradient(165deg,var(--felt),var(--felt-deep))}
  .hg-auth-card>h1{margin-block:0;padding-block:.2rem .7rem}
  .hg-auth-card>h1,.hg-auth-card>p:not(.hg-eyebrow){margin-inline:calc(-1 * clamp(1.6rem,4vw,2.6rem));padding-inline:clamp(1.6rem,4vw,2.6rem);background:var(--felt-deep)}
  .hg-auth-card>p:not(.hg-eyebrow){padding-bottom:1.4rem;margin-bottom:1rem}
}
@media(max-width:620px){.hg-top{top:8px;width:calc(100% - 16px);margin-top:8px}}
