/* 공용 패널(.g-pane)과 덮는 창: 조합표, 도움말, 구독, 광고. 결과·멈춤·비급 고르기는 play.css.
   패널 문법: 먹빛 종이 결 위에 금 겹테와 네 모서리 금박 꺾쇠. 움직임은 아래에서 120ms 미끄러져 뜬다. */
.g-pane{position:relative;color:var(--g-text);background:var(--g-grain),linear-gradient(180deg,rgba(20,34,41,.97),rgba(9,16,20,.98));
  box-shadow:var(--g-frame),0 .5em 1.6em rgba(0,0,0,.5)}

/* 금박 꺾쇠는 안쪽 겹테(box-shadow) 위에 얹혀야 보이므로 덧그림 층(::before, 이미 쓰는 곳은 ::after)에 그린다. */
.g-pane:not(.g-codex)::before,.g-codex::after,.g-plaque::before,.g-boss::before,.g-next::before,.g-brief::before,.g-side-btn::before,.g-card::before,.g-summon::before,.g-tok.can:not(.p-merge)::before,.g-demo::before{
  content:"";position:absolute;inset:0;z-index:1;pointer-events:none;background:var(--g-corners)}
.g-boss,.g-next,.g-brief,.g-card{position:relative}

/* ---------- 조합표 ---------- */
/* 위쪽 HUD는 남기고 그 아래를 덮는다. */
.g-codex{position:absolute;inset:calc(var(--g-top-h) + .4em) .45em max(.45em,var(--sab));z-index:3;display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:auto auto auto minmax(0,1fr);gap:.5em;padding:.7em .7em .7em;animation:g-rise .12s ease-out both}
/* 조합표 밖을 어둡게 덮어, 가려진 조작이 눌리지 않게 한다. 위 줄(배속, 멈춤)은 그 위에 남아 눌린다. */
.g-codex::before{content:"";position:absolute;inset:-100vmax;z-index:-1;background:rgba(6,10,12,.66)}
/* 조합표가 열린 동안에는 그 위로 겹치는 소식을 감춘다. */
.g-root:has(.g-codex:not([hidden])) .g-log{display:none}
.cx-head{position:relative;display:flex;flex-wrap:wrap;align-items:center;gap:.3em .7em;padding:0 2.8em .45em 0;border-bottom:1px solid var(--g-hair)}
.cx-head > b{font:400 1.55em/1.1 var(--g-display);color:var(--g-paper);letter-spacing:.06em}
.cx-head > span{flex:1;min-width:6em;color:var(--g-foil);font-size:.76em}
.g-root .cx-head .g-close{top:-.55em;right:-.45em}
.g-root .g-auto{display:flex;align-items:center;gap:.45em;min-height:max(2.6em,var(--g-tap));padding:0 .8em 0 .5em;color:var(--g-dim);font-weight:600;font-size:.82em;border-radius:2em;box-shadow:inset 0 0 0 1px var(--g-hair)}
.g-auto .g-lamp{width:1.05em;height:1.05em;border-radius:50%;background:#2a3a40;box-shadow:inset 0 0 0 1px rgba(0,0,0,.6),0 0 0 1px var(--g-hair)}
.g-root .g-auto[aria-checked="true"]{color:var(--g-foil-hi);box-shadow:inset 0 0 0 1px var(--g-rim)}
.g-auto[aria-checked="true"] .g-lamp{background:radial-gradient(circle at 40% 35%,#fff3cf,#e3c27a 60%,#a17a35);box-shadow:0 0 .5em rgba(227,194,122,.7)}
/* 탭: 금박 밑줄과 인주 점 */
.cx-tabs{display:flex;gap:.2em;overflow-x:auto;scrollbar-width:none;box-shadow:inset 0 -1px 0 var(--g-hair)}
.cx-tabs::-webkit-scrollbar{display:none}
.g-root .cx-tabs button{position:relative;flex:1 0 auto;min-height:max(2.8em,var(--g-tap));padding:.4em .75em;color:var(--g-dim);font-weight:600;font-size:.86em;text-align:center;white-space:nowrap}
.g-root .cx-tabs button.on{color:var(--g-foil-hi);background:linear-gradient(0deg,rgba(227,194,122,.14),transparent)}
.cx-tabs button.on::after{content:"";position:absolute;left:.4em;right:.4em;bottom:0;height:2px;background:var(--g-foil)}
.cx-tabs button.on::before{content:"";position:absolute;left:50%;bottom:-.22em;width:.42em;height:.42em;background:var(--g-cinnabar);transform:translateX(-50%) rotate(45deg)}
/* 문파 고르기: 문파 색 실선의 작은 패 */
.cx-facs{max-height:5.6em;overflow-y:auto;display:flex;flex-wrap:wrap;align-content:flex-start;gap:.3em;scrollbar-width:none}
.g-root .cx-facs button{min-height:2.5em;padding:.3em .7em;color:var(--g-paper-2);font-size:.8em;white-space:nowrap;background:rgba(239,232,214,.03);box-shadow:inset .2em 0 0 var(--fc),inset 0 0 0 1px var(--g-hair)}
.g-root .cx-facs button.on{color:#10161a;font-weight:700;background:var(--fc);box-shadow:inset 0 0 0 1px rgba(255,255,255,.5)}
.cx-list{grid-row:4;min-height:0;overflow-y:auto;display:grid;grid-template-columns:minmax(0,1fr);align-content:start;gap:.4em;padding-right:.15em;overscroll-behavior:contain}
.cx-group{grid-column:1/-1;display:flex;align-items:center;gap:.6em;margin:.35em 0 0;font:400 .95em/1.3 var(--g-display);color:var(--g-foil);letter-spacing:.06em}
.cx-group::after{content:"";flex:1;height:1px;background:linear-gradient(90deg,var(--g-rim),transparent)}
.cx-empty{grid-column:1/-1;padding:2em .6em;text-align:center;color:var(--g-dim)}
/* 조합식 한 장: 경지 색 왼쪽 띠, 되는 것은 금테로 밝힌다. 목표로 정한 것은 인주 띠. */
.cx-row{position:relative;display:flex;flex-direction:column;gap:.4em;padding:.5em .55em .5em .7em;background:linear-gradient(90deg,color-mix(in srgb,var(--gc) 10%,transparent),rgba(10,18,22,.35) 60%);box-shadow:inset .2em 0 0 var(--gc),inset 0 0 0 1px var(--g-hair)}
.cx-row.can{background:linear-gradient(90deg,rgba(227,194,122,.14),rgba(10,18,22,.35) 70%);box-shadow:inset .2em 0 0 var(--gc),inset 0 0 0 1px var(--g-foil),0 0 .7em rgba(227,194,122,.18)}
.cx-row.pinned{box-shadow:inset .2em 0 0 var(--g-cinnabar),inset 0 0 0 1px rgba(224,96,74,.75)}
.cx-row.pinned::after{content:"";position:absolute;top:-.25em;left:.9em;width:.6em;height:.95em;background:var(--g-cinnabar);clip-path:polygon(0 0,100% 0,100% 100%,50% 75%,0 100%)}
.cx-top{display:flex;align-items:center;gap:.55em}
.cx-top .pt{width:2.8em;border-radius:.15em}
.cx-label{flex:1;min-width:0}
.cx-label b{display:block;font:400 1.02em/1.25 var(--g-display);color:var(--g-paper);overflow-wrap:anywhere}
.cx-row.can .cx-label b{color:var(--g-foil-hi)}
.cx-label small{color:var(--g-dim);font-size:.72em}
.g-root .cx-pin{min-height:max(2.4em,var(--g-tap));padding:0 .7em;color:var(--g-dim);font-weight:600;font-size:.74em;white-space:nowrap;box-shadow:inset 0 0 0 1px var(--g-hair)}
.g-root .cx-row.pinned .cx-pin{color:#ffb3a3;box-shadow:inset 0 0 0 1px rgba(224,96,74,.85);background:rgba(192,57,43,.12)}
.g-root .cx-go{min-height:max(2.4em,var(--g-tap));padding:0 .85em;color:#7d8784;font-weight:700;font-size:.8em;white-space:nowrap;box-shadow:inset 0 0 0 1px rgba(159,169,166,.2)}
.g-root .cx-go:not(:disabled){color:#17140f;background:linear-gradient(180deg,#f6e3ae,#d6b067);box-shadow:inset 0 0 0 1px #fff3cf,0 .15em 0 #6b5428}
.g-root .cx-go:not(:disabled):active{transform:scale(.96)}
.cx-needs{display:flex;flex-wrap:wrap;gap:.3em .35em}
.cx-need{display:flex;align-items:center;gap:.3em;padding:.12em .55em .12em .12em;border-radius:1.2em;background:rgba(0,0,0,.25);color:#7f8a87;font-size:.76em;box-shadow:inset 0 0 0 1px rgba(159,169,166,.16)}
.cx-need .pt{width:1.85em;filter:grayscale(.8) brightness(.65)}
.cx-need.have{color:var(--g-paper);box-shadow:inset 0 0 0 1px rgba(125,191,168,.5)}
.cx-need.have .pt{filter:none}
.cx-need.have::after{content:"";width:.5em;height:.28em;margin-left:.1em;border-left:.13em solid var(--g-jade);border-bottom:.13em solid var(--g-jade);transform:translateY(-.08em) rotate(-45deg)}
.cx-skill{margin:0;color:#c4bba6;font-size:.74em;line-height:1.4}
/* 기인의 풍문과 아직 모르는 재료: 한지 쪽지 */
.cx-rumor{margin:0;padding:.35em .6em;color:#3a3125;font-size:.74em;font-style:italic;line-height:1.4;background:linear-gradient(180deg,#efe6cf,#dfd2b2);box-shadow:inset .2em 0 0 var(--g-cinnabar),0 .1em .3em rgba(0,0,0,.35)}
.cx-needs .cx-rumor{padding:0;color:var(--g-dim);background:none;box-shadow:none}
.cx-row.veiled .cx-top .pt{border-style:dashed;color:var(--g-foil)}

/* ---------- 화면을 덮는 것: 도움말, 구독, 광고 ---------- */
.g-over{position:absolute;inset:0;z-index:5;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1em;padding:max(1.2em,var(--sat)) .8em max(1.2em,var(--sab));text-align:center;background:rgba(6,10,12,.86)}
.g-over h2{font-family:var(--g-display);font-weight:400;font-size:2.4em;line-height:1.15;color:var(--g-paper);letter-spacing:.06em}
.g-over p{color:var(--g-dim)}
.g-over-acts{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:.6em;max-width:100%}
.g-root .g-cta{min-width:11em;min-height:max(3.3em,var(--g-tap));padding:.45em 1.8em;color:#fff4e6;font:400 1.4em/1.2 var(--g-display);letter-spacing:.06em;
  background:linear-gradient(180deg,#d1513c 0%,#ad3222 55%,#8e2418 100%);box-shadow:inset 0 0 0 1px rgba(244,222,163,.85),inset 0 0 0 4px rgba(142,36,24,.9),inset 0 0 0 5px rgba(244,222,163,.35),0 .25em 0 #4e130c;transition:transform .08s}
.g-root .g-ghost{min-height:max(3em,var(--g-tap));padding:.5em 1.4em;color:var(--g-paper);font-weight:600;box-shadow:inset 0 0 0 1px var(--g-rim)}
.g-root .g-cta:active,.g-root .g-ghost:active{transform:scale(.96)}
.g-pane.g-shop-box,.g-pane.g-ad-box,.g-help-sheet{animation:g-rise .12s ease-out both}
/* 구독 */
.g-shop,.g-ad{z-index:7}
.g-shop-box{display:flex;flex-direction:column;align-items:center;gap:.8em;width:min(100%,30em);padding:1.3em 1em 1.1em}
.g-shop-box > p{font-size:.86em;line-height:1.5}
.g-perks{display:flex;flex-direction:column;gap:.45em;width:100%;list-style:none;margin:0;padding:0}
.g-perks li{display:flex;align-items:center;gap:.7em;padding:.6em .8em;text-align:left;background:linear-gradient(90deg,rgba(227,194,122,.1),rgba(227,194,122,.02));box-shadow:inset 0 0 0 1px var(--g-hair)}
.g-perks .ic{width:2.4em}
.g-perks span{display:flex;flex-direction:column;gap:.15em}
.g-perks b{font:400 1.2em/1.2 var(--g-display);color:var(--g-foil-hi)}
.g-perks small{color:#c4bba6;font-size:.82em}
.g-over .g-shop-state{min-height:1.4em;color:var(--g-foil);font-size:.82em}
/* 광고 자리 */
.g-ad{background:rgba(0,0,0,.94)}
.g-ad-box{display:flex;flex-direction:column;align-items:center;gap:.6em;width:min(100%,26em);padding:1.6em 1em 1.2em}
.g-ad-box p{font:400 1.3em/1.3 var(--g-display);color:var(--g-paper)}
.g-ad-box small{color:var(--g-dim)}
.g-ad-bar{display:block;width:70%;height:.25em;margin-top:.4em;background:linear-gradient(90deg,transparent,var(--g-foil),transparent) 0 0/40% 100% no-repeat,rgba(239,232,214,.08);animation:g-scan 1.4s linear infinite}
/* 도움말: 금테 패널 한 장. 길면 안에서 밀어 본다. */
.g-help{z-index:6;padding:max(1em,var(--sat)) .6em max(1em,var(--sab))}
.g-help-sheet{display:flex;flex-direction:column;width:min(100%,52em);max-height:100%;text-align:left}
.g-help-head{position:relative;display:flex;align-items:center;justify-content:space-between;padding:.7em 3em .6em 1em;border-bottom:1px solid var(--g-hair)}
.g-over .g-help-head h2{font-size:1.7em;color:var(--g-paper)}
.g-root .g-help-head .g-close{top:50%;right:.2em;transform:translateY(-50%)}
.g-help-body{overflow-y:auto;display:grid;grid-template-columns:repeat(auto-fit,minmax(17em,1fr));gap:.9em 1.6em;padding:.9em 1em 1.1em;overscroll-behavior:contain}
.g-help-body > div{padding-top:.5em;border-top:1px dashed var(--g-hair)}
.g-help-body h3{display:flex;align-items:center;gap:.45em;margin-bottom:.3em;font:400 1.15em/1.3 var(--g-display);color:var(--g-foil-hi)}
.g-help-body h3::before{content:"";width:.42em;height:.42em;background:var(--g-cinnabar);transform:rotate(45deg)}
.g-over .g-help-body p{color:#d6cdb8;font-size:max(.88em,12px);line-height:1.6}
.g-help-body p + p{margin-top:.4em}

@keyframes g-scan{from{background-position:-40% 0,0 0}to{background-position:140% 0,0 0}}

/* 움직임 줄이기: 기기 설정(prefers-reduced-motion)과 연출 줄이기 설정(.g-calm)에서는 등장·맥동·튐을 끈다. */
@media (prefers-reduced-motion:reduce){
  .g-root .g-banner,.g-root .g-sheet,.g-root .g-board,.g-root .g-codex,.g-root .g-tok,.g-root .g-demo.nudge,.g-root .g-log-line,.g-root .g-coin b,.g-root .g-sub,.g-root .g-siege-top.danger,.g-root .g-doom-top,.g-root .g-boss.rage,.g-root .g-badge,.g-root .g-summon::after,.g-root .g-pane,.g-root .g-ad-bar{animation:none!important}
  .g-root.danger .g-vignette{animation:none;opacity:.7}
  .g-root .g-bar i{transition:none}
}
.g-root.g-calm :is(.g-banner,.g-sheet,.g-board,.g-codex,.g-tok,.g-demo.nudge,.g-log-line,.g-coin b,.g-sub,.g-siege-top.danger,.g-doom-top,.g-boss.rage,.g-badge,.g-pane,.g-ad-bar),.g-root.g-calm .g-summon::after{animation:none!important}
.g-root.g-calm.danger .g-vignette{animation:none;opacity:.6}
.g-root.g-calm .g-siege-top.danger{box-shadow:inset 0 0 0 1px rgba(255,150,125,.95),0 0 .6em rgba(224,96,74,.6)}
