/* 그리드벳 카드게임 로비(/main/cardgame.php) · 카드게임 지갑 · 전환/앉기 창 · 공통 단추.
   원본 CSS 의 .pageTitle · .tabTitle.depth1(게임 탭)을 그대로 쓰고, 원본에 없는 칸만 원본 색 변수(--surface-* · --4246 · --a3a3 · --theme-color · --module-*)로 그린다.
   밝은 테마는 원본 변수가 [data-theme-mode=light] 에서 바뀌므로 대부분 따라온다(따로 고친 곳만 아래 light 절) */
.tr-cg{--cg-r:10px;--cg-line:var(--3838);--cg-sub:var(--a3a3);--cg-amt:var(--38ffa8);--cg-danger:var(--danger-color,#ef4444)}
.tr-cg:not(.cg-on){visibility:hidden}
.tr-cg [hidden]{display:none!important}

/* 공통 단추 — 원본 모듈 단추(--module-dark-button)와 파랑 단추(--module-primary-gradient) */
.cg-btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;height:36px;padding:0 16px;border:1px solid var(--4246);border-radius:8px;background:var(--module-dark-button);font-family:'p6';font-size:13px;line-height:1;color:var(--font-color);white-space:nowrap;cursor:pointer;transition:filter .18s,transform .18s,border-color .18s}
.cg-btn:hover{border-color:var(--theme-color)}
.cg-btn.pri{border-color:transparent;background:var(--module-primary-gradient);box-shadow:0 8px 18px rgba(0,123,254,.18);color:#fff}
.cg-btn.pri:hover{filter:brightness(1.1);transform:translateY(-1px)}
.cg-btn.lg{height:48px;padding:0 22px;border-radius:10px;font-family:'p7';font-size:15px}
.cg-btn.sm{height:30px;padding:0 12px;font-size:12px}
.cg-btn:disabled,.cg-btn[aria-disabled="true"]{opacity:.45;cursor:not-allowed;filter:none;transform:none;box-shadow:none}

/* 테스트 계정 · 메뉴 막힘 안내 */
.cg-test{display:flex;align-items:center;gap:10px;margin:0 0 12px;padding:12px 16px;border-radius:var(--cg-r);background:var(--surface-1);border-left:3px solid #3ca1e2;font-size:13px;line-height:1.5;color:var(--cg-sub)}
.cg-test b{flex:none;padding:3px 9px;border-radius:4px;background:rgba(60,161,226,.18);font-family:'p7';font-weight:normal;font-size:12px;color:#7cc3f0}
.cg-gate{display:flex;flex-direction:column;align-items:center;gap:10px;margin:0;padding:60px 20px;border-radius:var(--cg-r);background:var(--surface-1);text-align:center;font-size:13px;color:var(--cg-sub)}
.cg-gate b{font-family:'p7';font-weight:normal;font-size:17px;color:var(--font-color)}

/* ───── 로비 ───── */
.cg-tabs{margin-bottom:14px}
.cg-head{display:grid;grid-template-columns:minmax(0,1fr) 400px;gap:14px;margin-bottom:14px}
.cg-head-l{display:flex;flex-direction:column;gap:10px;min-width:0}
.cg-intro{display:flex;flex-direction:column;gap:6px;padding:18px 22px;border-radius:var(--cg-r);background:var(--surface-1)}
.cg-intro b{font-family:'p7';font-weight:normal;font-size:20px;color:var(--font-color)}
.cg-intro span{font-size:13px;line-height:1.6;color:var(--cg-sub);word-break:keep-all}
.cg-stats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin:0}
.cg-stats>div{display:flex;flex-direction:column;gap:6px;padding:14px 18px;border-radius:var(--cg-r);background:var(--surface-1)}
.cg-stats dt{font-size:12px;color:var(--cg-sub)}
.cg-stats dd{margin:0;font-family:'p7';font-size:19px;color:var(--font-color);font-variant-numeric:tabular-nums;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

/* 카드게임 지갑 */
.cg-wal{display:flex;flex-direction:column;gap:12px;padding:16px 18px;border-radius:var(--cg-r);background:var(--surface-1);border:1px solid var(--module-panel-border)}
.cg-wal-hd{display:flex;align-items:baseline;gap:8px}
.cg-wal-hd b{font-family:'p7';font-weight:normal;font-size:15px;color:var(--font-color)}
.cg-wal-hd span{font-size:12px;color:var(--cg-sub)}
.cg-wal-body{display:flex;flex-direction:column;gap:12px}
.cg-wal-guest p{margin:0 0 10px;font-size:13px;line-height:1.6;color:var(--cg-sub)}
.cg-wal-note{margin:0;padding:8px 10px;border-radius:6px;background:var(--surface-2);font-size:12px;line-height:1.55;color:var(--cg-sub)}
.cg-wal-act{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.cg-wal-act .cg-btn{width:100%;padding:0 8px}
.cg-kv{display:grid;gap:8px;margin:0}
.cg-kv>div{display:flex;align-items:baseline;justify-content:space-between;gap:12px;font-size:13px}
.cg-kv dt{color:var(--cg-sub)}
.cg-kv dd{margin:0;text-align:right;color:var(--font-color);font-variant-numeric:tabular-nums;word-break:keep-all}
.cg-kv dd.hi{font-family:'p7';color:var(--cg-amt)}
.cg-kv dd.dim{color:var(--cg-sub)}

/* 전체: 게임 카드 여섯 장(zxc 기본 허브 그림 + 글자는 화면 글자) */
.cg-games{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}
.cg-gcard{position:relative;display:block;aspect-ratio:3 / 1.55;overflow:hidden;border-radius:12px;background:var(--surface-2);isolation:isolate;transition:transform .2s,box-shadow .2s}
.cg-gcard:hover{transform:translateY(-2px);box-shadow:0 0 0 1px var(--theme-color),0 14px 28px rgba(0,0,0,.35)}
.cg-gimg{position:absolute;inset:0;z-index:-2;background-size:cover;background-position:62% 50%;transition:transform .35s}
.cg-gcard:hover .cg-gimg{transform:scale(1.04)}
.cg-gcard::before{content:"";position:absolute;inset:0;z-index:-1;background:linear-gradient(90deg,rgba(9,14,24,.92) 0%,rgba(9,14,24,.72) 42%,rgba(9,14,24,.05) 78%)}
.cg-gtxt{position:absolute;left:22px;top:50%;display:flex;flex-direction:column;gap:6px;max-width:58%;transform:translateY(-50%)}
.cg-gtxt b{font-family:'p7';font-weight:normal;font-size:24px;line-height:1.15;color:#fff}
.cg-gtxt small{font-size:13px;line-height:1.45;color:rgba(255,255,255,.82);word-break:keep-all}
.cg-gtxt em{font-style:normal;font-size:12px;color:#5ee6f5}
.cg-glive{position:absolute;right:12px;top:12px;display:inline-flex;align-items:center;gap:6px;height:26px;padding:0 10px;border-radius:999px;background:rgba(9,14,24,.72);font-size:12px;color:#fff;font-variant-numeric:tabular-nums}
.cg-glive i{width:7px;height:7px;border-radius:50%;background:#38e08a;box-shadow:0 0 8px rgba(56,224,138,.8)}

.cg-cols{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;margin-top:14px}
.cg-panel{min-width:0;padding:16px 18px;border-radius:var(--cg-r);background:var(--surface-1)}
.cg-panel-t{display:flex;align-items:center;gap:8px;margin:0 0 8px;font-family:'p6';font-weight:normal;font-size:15px;color:var(--font-color)}
.cg-panel-t::before{content:"";width:3px;height:14px;border-radius:2px;background:var(--theme-color)}
.cg-none{padding:22px 0;text-align:center;font-size:13px;color:var(--cg-sub);list-style:none}
.cg-gtag{flex:none;display:inline-flex;align-items:center;height:22px;padding:0 8px;border-radius:5px;background:var(--accent-panel);font-size:11px;color:var(--theme-color);white-space:nowrap}
.cg-rec,.cg-big{margin:0;padding:0;list-style:none}
.cg-rec li:not(.cg-none){display:grid;grid-template-columns:auto minmax(0,1fr) auto auto;align-items:center;gap:12px;padding:10px 0;border-top:1px solid var(--cg-line)}
.cg-rec li:first-child{border-top:0}
.cg-rec-m{display:flex;flex-direction:column;gap:2px;min-width:0}
.cg-rec-m b{overflow:hidden;font-family:'p6';font-weight:normal;font-size:14px;color:var(--font-color);white-space:nowrap;text-overflow:ellipsis}
.cg-rec-m small{font-size:12px;color:var(--cg-sub)}
.cg-rec-s{display:flex;align-items:center;gap:8px}
.cg-rec-s em,.c-seat em{font-style:normal;font-size:12px;color:var(--cg-sub);font-variant-numeric:tabular-nums}
.cg-big li:not(.cg-none){display:flex;align-items:center;gap:10px;padding:9px 0;border-top:1px solid var(--cg-line)}
.cg-big li:first-child{border-top:0}
.cg-big-t{flex:none;width:40px;font-size:12px;color:var(--cg-sub);font-variant-numeric:tabular-nums}
.cg-big-m{display:flex;flex:1;flex-direction:column;gap:2px;min-width:0}
.cg-big-m b{font-family:'p6';font-weight:normal;font-size:13px;color:var(--font-color)}
.cg-big-m small{overflow:hidden;font-size:12px;color:var(--cg-sub);white-space:nowrap;text-overflow:ellipsis}
.cg-big em{flex:none;font-style:normal;font-family:'p7';font-size:14px;color:var(--cg-amt);font-variant-numeric:tabular-nums}
.cg-dots{display:inline-flex;gap:4px}
.cg-dots i{width:9px;height:9px;border-radius:50%;box-shadow:inset 0 0 0 1px var(--outline-strong)}
.cg-dots i.on{background:var(--theme-color);box-shadow:none}

/* 게임 탭: 판돈 단계 · 빈자리만 · 빠른 시작 */
.cg-bar{display:flex;flex-wrap:wrap;align-items:center;gap:10px 14px;margin-bottom:6px}
.cg-chips{display:flex;flex-wrap:wrap;gap:6px}
.cg-chip{height:32px;padding:0 14px;border:1px solid var(--4246);border-radius:999px;background:var(--surface-1);font-family:'p6';font-size:13px;color:var(--cg-sub);cursor:pointer}
.cg-chip span{margin-left:2px;font-size:11px;opacity:.75}
.cg-chip:hover{color:var(--font-color)}
.cg-chip[aria-pressed="true"]{border-color:transparent;background:var(--module-primary-gradient);color:#fff}
.cg-open{display:inline-flex;align-items:center;gap:6px;font-size:13px;color:var(--cg-sub);cursor:pointer}
.cg-open input{width:16px;height:16px;accent-color:var(--theme-color)}
.cg-bar #cgQuick{margin-left:auto}

/* 테이블 목록(원본 .thead · ul.freeboard 목록 모양) */
.cg-thead,.cg-row{display:grid;grid-template-columns:minmax(0,1.6fr) 130px 160px 130px 170px 120px;align-items:center;gap:10px}
.cg-thead span{display:flex;align-items:center;justify-content:center;height:40px;font-size:11px;color:var(--cg-sub)}
.cg-thead span:first-child{justify-content:flex-start;padding-left:18px}
.cg-rows{margin:0;padding:0;list-style:none}
.cg-row{min-height:66px;margin-bottom:6px;padding:10px 14px 10px 18px;border-radius:8px;background:var(--surface-1);font-size:13px;color:var(--font-color);transition:box-shadow .18s}
.cg-row:hover{box-shadow:inset 0 0 0 1px var(--4246)}
.cg-row.mine{box-shadow:inset 0 0 0 1px var(--theme-color)}
.cg-row>div{display:flex;align-items:center;justify-content:center;gap:8px;min-width:0;font-variant-numeric:tabular-nums}
.cg-row .c-name{flex-wrap:wrap;justify-content:flex-start;gap:4px 8px}
.cg-row .c-name b{font-family:'p7';font-weight:normal;font-size:15px}
.cg-row .c-name small{flex-basis:100%;font-size:12px;color:var(--cg-sub)}
.cg-row .c-name small[data-st="wait"]{color:var(--cg-amt)}
.cg-row .c-name small[data-st="play"]{color:#3ca1e2}
.cg-row .c-stake{font-family:'p7';font-size:14px}
.cg-row .c-buy{font-size:12px;color:var(--cg-sub)}
.cg-row .c-go .cg-btn{min-width:84px}
.cg-tier{display:inline-flex;align-items:center;height:20px;padding:0 7px;border-radius:4px;background:var(--surface-4);font-size:11px;color:var(--font-color)}
.cg-tier[data-t="low"]{background:rgba(60,161,226,.2);color:#7cc3f0}
.cg-tier[data-t="mid"]{background:rgba(13,192,212,.18);color:var(--theme-color)}
.cg-tier[data-t="high"]{background:rgba(245,196,26,.18);color:#f5c41a}
.cg-mybadge{display:inline-flex;align-items:center;height:20px;padding:0 7px;border-radius:4px;background:var(--module-primary-gradient);font-size:11px;color:#fff}
.cg-empty{display:flex;flex-direction:column;align-items:center;gap:6px;margin:0;padding:40px 20px;border-radius:8px;background:var(--surface-1);text-align:center;font-size:13px;color:var(--cg-sub)}
.cg-empty b{font-family:'p6';font-weight:normal;font-size:15px;color:var(--font-color)}
.cg-empty .cg-btn{margin-top:6px}

/* 규칙(원본 FAQ 접기 모양) */
.cg-rules{display:flex;flex-direction:column;gap:6px}
.cg-acc{border-radius:8px;background:var(--surface-2)}
.cg-acc summary{position:relative;padding:12px 40px 12px 14px;font-family:'p6';font-size:13px;color:var(--font-color);list-style:none;cursor:pointer}
.cg-acc summary::-webkit-details-marker{display:none}
.cg-acc summary::after{content:"";position:absolute;right:16px;top:50%;width:7px;height:7px;border-right:1.5px solid var(--cg-sub);border-bottom:1.5px solid var(--cg-sub);transform:translateY(-70%) rotate(45deg);transition:transform .2s}
.cg-acc[open] summary::after{transform:translateY(-30%) rotate(-135deg)}
.cg-acc ul{margin:0;padding:0 14px 12px 28px;list-style:disc}
.cg-acc li{padding:2px 0;font-size:12.5px;line-height:1.65;color:var(--cg-sub);word-break:keep-all}

/* ───── 창(전환 · 앉기): 원본 로그인 창(.memberLayer .layerInner)의 색 변수 ───── */
dialog.cg-dlg{--cg-sub:var(--a3a3);position:fixed;inset:0;width:min(440px,calc(100% - 24px));max-height:calc(100% - 24px);margin:auto;padding:0;border:1px solid var(--login-divider-color,#2f3441);border-radius:18px;background:linear-gradient(180deg,var(--login-panel-top,#1b1f29) 0%,var(--login-panel-bottom,#11141b) 100%);box-shadow:var(--login-panel-shadow,0 20px 50px rgba(0,0,0,.5));color:var(--font-color);overflow:auto}
dialog.cg-dlg [hidden]{display:none!important}
dialog.cg-dlg::backdrop{background:var(--login-overlay-bg,rgba(0,0,0,.72))}
.cg-dlg-in{position:relative;padding:28px 24px 22px}
.cg-dlg h3{margin:0 0 16px;padding-right:30px;font-family:'p7';font-weight:normal;font-size:18px;line-height:1.35;color:var(--font-color);word-break:keep-all}
.cg-dlg-x{position:absolute;top:14px;right:14px;display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;padding:0;border:0;border-radius:8px;background:transparent;color:var(--cg-sub);cursor:pointer}
.cg-dlg-x:hover{color:var(--font-color)}
.cg-dlg-x svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round}
.cg-dlg .cg-kv{margin-bottom:14px;padding:12px 14px;border-radius:10px;background:var(--surface-2)}
.cg-seg{display:grid;grid-template-columns:1fr 1fr;gap:3px;margin:0 0 14px;padding:3px;border-radius:10px;background:var(--surface-2)}
.cg-seg button{min-height:40px;padding:0 8px;border:0;border-radius:8px;background:none;font-family:'p6';font-size:13px;color:var(--cg-sub);cursor:pointer}
.cg-seg button[aria-pressed="true"]{background:var(--module-primary-gradient);color:#fff}
.cg-fld{display:flex;flex-direction:column;gap:6px;margin-bottom:8px;font-size:12px;color:var(--cg-sub)}
.cg-fld input{height:46px;padding:0 14px;border:var(--login-input-border,1px solid #2f3441);border-radius:10px;background:var(--login-input-bg,#0f121b);font-family:'p7';font-size:16px;color:var(--font-color);text-align:right;font-variant-numeric:tabular-nums;outline:none}
.cg-fld input:focus{box-shadow:var(--login-focus-shadow,0 0 0 3px rgba(0,123,254,.2))}
.cg-amts{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px;margin:6px 0 12px}
.cg-amts.three{grid-template-columns:repeat(3,minmax(0,1fr));margin-top:10px}
.cg-amts button{height:38px;border:1px solid var(--4246);border-radius:8px;background:var(--module-dark-button);font-family:'p6';font-size:13px;color:var(--font-color);cursor:pointer}
.cg-amts button:hover{border-color:var(--theme-color)}
.cg-dlg-note{margin:0 0 6px;font-size:12px;line-height:1.65;color:var(--cg-sub);word-break:keep-all}
.cg-dlg-msg{min-height:18px;margin:4px 0 10px;text-align:center;font-size:13px;line-height:1.5;color:#ff6b6b}
.cg-dlg-act{display:flex;gap:8px}
.cg-dlg-act .cg-btn{flex:1 1 0;min-width:0}
.cg-buy-row{display:flex;align-items:baseline;justify-content:space-between;gap:12px;margin:0 0 10px}
.cg-buy-row label{font-size:13px;color:var(--cg-sub)}
.cg-buy-row b{font-family:'p7';font-weight:normal;font-size:22px;color:var(--38ffa8);font-variant-numeric:tabular-nums}
.cg-range{width:100%;height:28px;margin:0;accent-color:var(--theme-color);cursor:pointer}
.cg-buy-short{margin:0 0 12px;padding:12px 14px;border-radius:10px;background:rgba(239,68,68,.1);box-shadow:inset 0 0 0 1px rgba(239,68,68,.3)}
.cg-buy-short p{margin:0 0 10px;font-size:13px;line-height:1.6;color:var(--font-color);word-break:keep-all}

/* ───── 모바일(원본 layout_mobile.css 쪽) ───── */
html[device-mode="mobile"] .cg-head{grid-template-columns:minmax(0,1fr);gap:10px}
html[device-mode="mobile"] .cg-intro{padding:14px 16px}
html[device-mode="mobile"] .cg-intro b{font-size:17px}
html[device-mode="mobile"] .cg-intro span{font-size:12px}
html[device-mode="mobile"] .cg-stats{grid-template-columns:minmax(0,1.5fr) minmax(0,1fr) minmax(0,1fr);gap:6px}
html[device-mode="mobile"] .cg-stats>div{gap:4px;padding:10px 12px}
html[device-mode="mobile"] .cg-stats dt{font-size:11px}
html[device-mode="mobile"] .cg-stats dd{font-size:14px}
html[device-mode="mobile"] .cg-wal{padding:14px 14px}
html[device-mode="mobile"] .cg-games{grid-template-columns:minmax(0,1fr);gap:10px}
html[device-mode="mobile"] .cg-gcard{aspect-ratio:auto;height:128px}
html[device-mode="mobile"] .cg-gtxt{left:16px;max-width:62%;gap:4px}
html[device-mode="mobile"] .cg-gtxt b{font-size:20px}
html[device-mode="mobile"] .cg-gtxt small{font-size:12px}
html[device-mode="mobile"] .cg-glive{right:8px;top:8px;height:24px;font-size:11px}
html[device-mode="mobile"] .cg-cols{grid-template-columns:minmax(0,1fr);gap:10px;margin-top:10px}
html[device-mode="mobile"] .cg-panel{padding:14px}
html[device-mode="mobile"] .cg-rec li:not(.cg-none){grid-template-columns:minmax(0,1fr) auto;gap:6px 10px}
html[device-mode="mobile"] .cg-rec .cg-gtag{grid-column:1 / -1;justify-self:start}
html[device-mode="mobile"] .cg-rec .cg-rec-s{grid-column:1;grid-row:3}
html[device-mode="mobile"] .cg-rec .cg-btn{grid-column:2;grid-row:2 / span 2}
html[device-mode="mobile"] .cg-bar{gap:8px}
html[device-mode="mobile"] .cg-chips{flex-wrap:nowrap;width:100%;overflow-x:auto;scrollbar-width:none}
html[device-mode="mobile"] .cg-chips::-webkit-scrollbar{display:none}
html[device-mode="mobile"] .cg-chip{flex:none}
html[device-mode="mobile"] .cg-thead{display:none}
html[device-mode="mobile"] .cg-row{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px 10px;padding:12px 14px}
html[device-mode="mobile"] .cg-row>div{justify-content:flex-start}
html[device-mode="mobile"] .cg-row .c-name{grid-column:1 / -1}
html[device-mode="mobile"] .cg-row>div[data-th]::before{content:attr(data-th);margin-right:2px;font-size:11px;color:var(--cg-sub)}
html[device-mode="mobile"] .cg-row .c-buy{grid-column:1 / -1}
html[device-mode="mobile"] .cg-row .c-go{grid-column:1 / -1}
html[device-mode="mobile"] .cg-row .c-go .cg-btn{width:100%;height:40px}
html[device-mode="mobile"] .cg-dlg-in{padding:24px 16px 18px}
html[device-mode="mobile"] .cg-dlg-act{flex-direction:column-reverse}
html[device-mode="mobile"] .cg-dlg-act .cg-btn{flex:none;width:100%}

/* ───── 밝은 테마: 원본 변수로 안 따라오는 글자색만 ───── */
[data-theme-mode=light] .cg-tier[data-t="low"]{color:#2563eb}
[data-theme-mode=light] .cg-tier[data-t="high"]{color:#a16207}
[data-theme-mode=light] .cg-test b{color:#2563eb}
[data-theme-mode=light] .cg-btn.pri,[data-theme-mode=light] .cg-chip[aria-pressed="true"],[data-theme-mode=light] .cg-seg button[aria-pressed="true"],[data-theme-mode=light] .cg-mybadge{color:#fff}
