* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; overscroll-behavior: none; background: #0f1830; color: #eef2fa; font-family: 'Apple SD Gothic Neo', 'Malgun Gothic', system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
#stage3d, #ui { position: fixed; inset: 0; } #ui { pointer-events: none; } #ui .panel, #ui button { pointer-events: auto; }
.hidden { display: none !important; }
/* 오른쪽 미션 물질 공간(11-23 충쌤: 왼쪽 내 판, 오른쪽 미션 물질). 판처럼 보이지 않게 카드·모형 공간 */
#right { position: absolute; top: var(--bt); left: var(--rl); width: var(--rw); height: var(--bh); display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: 7% 4% 26% 31% 13% 1fr; gap: 0; padding: 0; overflow: hidden; }
.rtop { display: flex; align-items: center; gap: 14px; font-size: 14px; color: #a9b6d0; } .rtop > b { color: #eef2fa; font-size: 15px; }
.rtop .sc { display: flex; align-items: baseline; gap: 6px; margin-left: auto; } .rtop .sc em { font-style: normal; font-size: 10px; letter-spacing: 2px; font-weight: 800; } .rtop .sc b { font-size: 24px; color: #ffe08a; font-variant-numeric: tabular-nums; line-height: 1; } .rtop .bst b { color: #ffe08a; }
.rhead, .cap { font-size: 12px; font-weight: 800; letter-spacing: 1px; color: #8a97b2; display: flex; align-items: center; }
#cards { display: flex; gap: 10px; min-height: 0; }
.card { flex: 1; min-width: 0; background: #16223f; border: 1px solid #2a3858; border-radius: 10px; padding: 6px 9px; display: flex; flex-direction: column; justify-content: center; gap: 4px; overflow: hidden; }
.card.order { border-color: #ffd36e; box-shadow: 0 0 0 1px #ffd36e inset; }
.card.new { animation: cin .5s ease-out; } @keyframes cin { from { transform: translateY(16px); } to { transform: none; } }
.ctop { display: flex; min-height: 20px; } .tagO { display: inline-flex; align-items: center; justify-content: center; height: 20px; padding: 0 8px; border-radius: 5px; background: #ffd36e; color: #1a1606; font-size: 11px; font-weight: 900; line-height: 1; }
.cbody { display: flex; align-items: center; gap: 8px; min-width: 0; } .ico { flex: none; display: flex; align-items: center; justify-content: center; }
.ctx { display: flex; flex-direction: column; gap: 1px; min-width: 0; } .ctx b { font-size: 15px; white-space: nowrap; } .ctx .f { font-size: 22px; font-weight: 900; color: #ffe08a; line-height: 1.1; } .ctx small { font-size: 11px; color: #a9b6d0; line-height: 1.3; word-break: keep-all; }
.hands { display: flex; flex-wrap: wrap; gap: 3px 4px; }
.hand { display: inline-flex; align-items: center; gap: 3px; height: 22px; padding: 0 7px 0 2px; border-radius: 12px 6px 6px 12px; background: #0f1830; border: 1px solid #2a3858; font-size: 12px; }
.hand i { width: 19px; height: 19px; border-radius: 50%; background: var(--c); border: 2px solid var(--r); display: flex; align-items: center; justify-content: center; font-style: normal; font-size: 9px; font-weight: 900; color: var(--t, #fff); line-height: 1; }
.hand b { font-weight: 800; } .hand em { font-style: normal; color: #8fd0ff; letter-spacing: -2px; font-size: 10px; }
.prog { position: relative; height: 16px; border-radius: 4px; background: #0f1830; overflow: hidden; display: flex; align-items: center; justify-content: center; } .prog i { position: absolute; left: 0; top: 0; bottom: 0; background: #2fae6a; } .prog span { position: relative; font-size: 11px; font-weight: 800; line-height: 1; }
#showbox { position: relative; margin-top: 10px; border: 1px dashed #33456c; border-radius: 14px; background: transparent; display: flex; align-items: center; justify-content: center; }
#showbox .cap { position: absolute; left: 12px; top: 8px; } #showEmpty { color: #5f6f92; font-size: 13px; text-align: center; line-height: 1.5; }
#showbox.played #showEmpty { display: none; }
#namecard { display: flex; align-items: center; gap: 10px; padding: 6px 12px 6px 8px; margin-top: 8px; background: #16223f; border: 2px solid #ffd36e; border-radius: 12px; min-width: 0; }
#namecard:not(.show) { visibility: hidden; } #namecard.show { animation: nin .3s cubic-bezier(.3,1.6,.6,1); } @keyframes nin { from { transform: translateY(10px); } to { transform: none; } }
#namecard b { font-size: 17px; white-space: nowrap; } #namecard b span { color: #ffe08a; margin-left: 6px; } #namecard small { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 12px; color: #a9b6d0; margin-top: 2px; line-height: 1.3; word-break: keep-all; } #namecard em { display: block; font-style: normal; color: #7dffa8; font-size: 12px; font-weight: 800; margin-top: 2px; }
.rbot { display: flex; gap: 14px; align-items: flex-start; padding-top: 10px; min-height: 0; }
.nb, .db { display: flex; flex-direction: column; gap: 6px; } .db { flex: 1; min-width: 0; }
#next { display: flex; gap: 8px; } .pair { display: flex; flex-direction: column; gap: 3px; padding: 5px; background: #16223f; border: 1px solid #2a3858; border-radius: 8px; }
.ball { width: 26px; height: 26px; border-radius: 50%; background: var(--c); border: 3px solid var(--r); color: var(--t); display: flex; flex-direction: column; align-items: center; justify-content: center; font-weight: 900; font-size: 12px; line-height: 1; }
#dex { display: flex; flex-wrap: wrap; gap: 5px; } .dx { display: flex; align-items: center; gap: 3px; height: 34px; padding: 0 6px 0 2px; background: #16223f; border: 1px solid #2a3858; border-radius: 7px; } .dx small { color: #a9b6d0; font-size: 11px; }
/* 판 위 글 */
#fx > div { position: absolute; transform: translate(-50%, -50%); white-space: nowrap; pointer-events: none; }
.tag { padding: 4px 9px; border-radius: 6px; background: #22304f; border: 1px solid #44567e; font-size: 13px; font-weight: 800; animation: tagup 1.3s ease-out forwards; display: flex; align-items: center; justify-content: center; line-height: 1; height: 26px; }
.tag.hard { color: #c8d2e4; } @keyframes tagup { from { margin-top: 8px; } 30% { margin-top: 0; } to { margin-top: -14px; } }
.pts { font-size: 26px; font-weight: 900; color: #ffe08a; text-shadow: 0 2px 0 #0b1020; animation: ptsup 1.1s ease-out forwards; display: flex; flex-direction: column; align-items: center; } .pts em { font-style: normal; font-size: 18px; color: #7dffa8; }
@keyframes ptsup { 0% { margin-top: 10px; } 25% { margin-top: -18px; } 40% { margin-top: -12px; } 100% { margin-top: -40px; } }
#angle { position: absolute; transform: translate(-50%, -50%); padding: 4px 8px; border-radius: 6px; background: #1a1606; border: 1px solid #ffd36e; color: #ffe08a; font-size: 15px; font-weight: 900; display: none; line-height: 1; }
#angle.show { display: block; }
#banner { position: absolute; left: calc(var(--bl) + var(--bw) / 2); top: 42%; transform: translate(-50%, -50%); display: none; flex-direction: column; align-items: center; gap: 6px; padding: 16px 26px; background: #16223f; border: 2px solid #8fd0ff; border-radius: 14px; }
#banner.show { display: flex; animation: bin .35s cubic-bezier(.3,1.6,.6,1); } #banner b { font-size: 28px; } #banner span { font-size: 15px; color: #c8d2e4; }
@keyframes bin { from { margin-top: 30px; } to { margin-top: 0; } }
/* 창 */
.panel { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(560px, 92vw); padding: 28px; background: #16223f; border: 1px solid #2a3858; border-radius: 16px; text-align: center; }
.panel h1 { margin: 0; font-size: 44px; letter-spacing: 1px; color: #ffe08a; } .panel h2 { margin: 0 0 14px; font-size: 26px; } .sub { color: #c8d2e4; font-size: 15px; margin: 8px 0 16px; }
.demo { display: flex; justify-content: center; gap: 14px; margin-bottom: 16px; } .demo .ball { width: 54px; height: 54px; font-size: 20px; gap: 3px; } .demo .ball em { font-style: normal; font-size: 8px; color: #8fd0ff; letter-spacing: -1px; }
.keyline { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; margin: 8px 0 18px; }
.kgrp { display: inline-flex; align-items: center; gap: 6px; } .kgrp em { font-style: normal; font-size: 13px; color: #a9b6d0; } .kcs { display: inline-flex; gap: 4px; }
.kc { display: inline-flex; align-items: center; justify-content: center; min-width: 30px; height: 30px; padding: 0 7px; border-radius: 6px; background: #0f1830; border: 1px solid #44567e; border-bottom-width: 3px; font-size: 13px; font-weight: 800; line-height: 1; color: #eef2fa; }
.kc.w { min-width: 0; height: 22px; font-size: 11px; margin-left: 6px; background: rgba(0,0,0,.25); }
.btns { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
button { display: inline-flex; align-items: center; justify-content: center; height: 46px; padding: 0 20px; border-radius: 10px; border: 1px solid #44567e; background: #22304f; color: #eef2fa; font: 800 16px/1 'Apple SD Gothic Neo', system-ui, sans-serif; cursor: pointer; }
button.main { background: #ffd36e; color: #1a1606; border-color: #ffd36e; }
.best { color: #a9b6d0; font-size: 13px; margin: 14px 0 0; } .best b { color: #ffe08a; }
#overStats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 24px; margin-bottom: 14px; } #overStats div { display: flex; justify-content: space-between; align-items: center; } #overStats span { color: #a9b6d0; } #overStats b { font-size: 18px; }
#overNext { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 16px; color: #c8d2e4; } #overNext span { font-size: 13px; color: #a9b6d0; }

.rhead { justify-content: space-between; } .cap2 { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: 5px; background: #16223f; border: 1px solid #2a3858; font-size: 11px; color: #a9b6d0; letter-spacing: 0; line-height: 1; } .cap2 b { color: #8fd0ff; font-weight: 900; } .cap2 i { font-style: normal; color: #8fd0ff; letter-spacing: -1px; }

/* ===== 11-24 게임 HUD(충쌤 "게이미피케이션을 적용해서 밤티 제거해"): 웹 카드 대신 두툼한 판넬, 칸 채우기 게이지, 도장, 도감 칸 열기.
   알약 모양 없음(모서리는 6~10px), 칸 안 글자는 상하 가운데. 깜빡임·흰 번쩍임 없음 */
:root { --hud1: #22356e; --hud2: #15224a; --hudE: #3b5aa8; --hudD: #0b1430; --gold: #ffd36e; --gold2: #ffe9a8; }
body { background: radial-gradient(ellipse at 30% 20%, #1a2a5e 0%, #0b1430 60%); }
.hpanel, .card, #showbox, #namecard, .pair, .dx, #scorebox { background: linear-gradient(180deg, var(--hud1), var(--hud2)); border: 2px solid var(--hudE); border-bottom-width: 4px; border-radius: 10px; box-shadow: inset 0 2px 0 rgba(255,255,255,.10), 0 4px 0 rgba(0,0,0,.25); }
/* 맨 위: 스테이지·점수 */
.rtop { gap: 10px; }
#stageLbl { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border-radius: 8px; background: linear-gradient(180deg, #3d63c9, #2a4596); border: 2px solid #6d93ff; border-bottom-width: 4px; line-height: 1; }
#stageLbl em { font-style: normal; font-size: 11px; letter-spacing: 2px; color: #cfe0ff; font-weight: 900; } #stageLbl b { font-size: 20px; color: #fff; } #stageLbl i { font-style: normal; font-size: 12px; color: #a9c2ff; }
.rtop .sc { height: 36px; align-items: center; padding: 0 12px; border-radius: 8px; background: var(--hudD); border: 2px solid #2b3f78; gap: 8px; }
.rtop .sc em { color: #8a9ccc; } .rtop .sc b { font-size: 26px; color: var(--gold); text-shadow: 0 2px 0 #7a5410; }
.rtop .sc b.bump { animation: sbump .25s ease-out; } @keyframes sbump { 0% { transform: translateY(-4px); } 100% { transform: none; } }
.rtop .bst { font-size: 12px; } .rtop .bst b { font-size: 13px; }
/* 결합 한도 칩: 알약 말고 각진 칩 */
.cap2 { height: 24px; border-radius: 6px; background: var(--hudD); border: 2px solid #2b3f78; }
.rhead > span:first-child, .cap { font-size: 12px; letter-spacing: 2px; color: #9fb3e6; font-weight: 900; text-transform: none; }
/* 주문 카드 */
#cards { gap: 10px; padding-top: 2px; }
.card { position: relative; padding: 14px 10px 8px; gap: 6px; justify-content: center; overflow: visible; transition: transform .15s; }
.card.order { border-color: var(--gold); box-shadow: inset 0 2px 0 rgba(255,255,255,.15), 0 4px 0 #7a5410, 0 0 0 3px rgba(255,211,110,.18); transform: translateY(-2px); }
.card .tagO { position: absolute; left: 8px; top: -11px; height: 22px; padding: 0 9px; border-radius: 6px; background: linear-gradient(180deg, #ffe9a8, #ffc94a); border: 2px solid #b8861c; color: #3a2600; font-size: 11px; display: none; }
.card.order .tagO { display: inline-flex; }
.card.hit { animation: chit .55s ease-out; } @keyframes chit { 0% { box-shadow: 0 0 0 0 var(--hc), inset 0 2px 0 rgba(255,255,255,.15); transform: translateY(-6px); } 60% { box-shadow: 0 0 0 8px rgba(0,0,0,0), inset 0 2px 0 rgba(255,255,255,.15); } 100% { transform: translateY(-2px); } }
.ctx .f { font-size: 24px; text-shadow: 0 2px 0 #6a4a00; }
.hand { border-radius: 6px; background: var(--hudD); border: 1px solid #2b3f78; padding: 0 6px 0 2px; }
/* 게이지: 목표 수만큼 칸, 채워질 때 튀어 오름 */
.gauge { position: relative; display: flex; gap: 3px; height: 18px; padding: 2px; border-radius: 6px; background: var(--hudD); border: 2px solid #2b3f78; }
.gauge i { flex: 1; border-radius: 3px; background: #1d2a52; box-shadow: inset 0 -2px 0 rgba(0,0,0,.3); }
.gauge i.on { background: linear-gradient(180deg, #9dffb9, #2fbf68); box-shadow: inset 0 2px 0 rgba(255,255,255,.45), inset 0 -2px 0 #1a7a40; }
.gauge i.pop { animation: gpop .35s cubic-bezier(.3,1.8,.6,1); } @keyframes gpop { from { transform: translateY(-7px); } to { transform: none; } }
.gauge span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 900; line-height: 1; color: #fff; text-shadow: 0 1px 0 #000, 0 0 3px #000; }
/* 도장 */
.stamp { position: absolute; right: 8px; top: 8px; display: none; align-items: center; justify-content: center; width: 64px; height: 34px; border: 3px solid #ff5a5a; border-radius: 6px; color: #ff5a5a; font-size: 17px; font-weight: 900; line-height: 1; background: rgba(40,8,8,.85); transform: rotate(-12deg); }
.card.done .stamp { display: flex; animation: stamp .4s cubic-bezier(.2,1.6,.5,1); } @keyframes stamp { from { transform: translateY(-26px) rotate(-34deg); } to { transform: rotate(-12deg); } }
/* 분자 모형 무대 */
#showbox { border-style: solid; background: transparent; box-shadow: inset 0 2px 0 rgba(255,255,255,.10); }   /* 바탕은 3D 무대(판 뒤 상자·받침)가 그린다 */
#showbox .cap { top: 8px; left: 10px; height: 22px; padding: 0 8px; border-radius: 6px; background: var(--hudD); border: 1px solid #2b3f78; }
/* 이름표 */
#namecard { border-color: var(--gold); border-left: 8px solid var(--gold); }
/* 다음 */
#next { gap: 6px; align-items: flex-end; } .pair { padding: 5px; border-radius: 8px; } .pair.first { border-color: var(--gold); } .pair:not(.first) { opacity: 1; filter: saturate(.85); }
.pair.first .ball { width: 30px; height: 30px; font-size: 13px; }
/* 도감 칸 */
#dex { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; }
.dx { position: relative; height: 34px; padding: 0; display: flex; align-items: center; justify-content: center; border-radius: 6px; border-width: 1px; border-bottom-width: 3px; }
.dx.lock { background: var(--hudD); border-color: #22325f; box-shadow: none; } .dx .q { color: #3b4c7e; font-weight: 900; font-size: 14px; line-height: 1; }
.dx.open small { position: absolute; right: 1px; bottom: 0; font-size: 9px; color: #cfe0ff; line-height: 1; }
.dx .nw { position: absolute; left: 50%; top: -9px; transform: translateX(-50%); display: none; align-items: center; justify-content: center; height: 14px; padding: 0 4px; border-radius: 4px; background: #ff5a8a; color: #fff; font-size: 8px; line-height: 1; }
.dx.new { animation: dflip .5s ease-out; border-color: var(--gold); } .dx.new .nw { display: flex; } @keyframes dflip { from { transform: rotateY(90deg); } to { transform: none; } }
/* 콤보 표시(판 위쪽) */
#combo { position: absolute; left: calc(var(--bl) + var(--bw) / 2); top: calc(var(--bt) + var(--bh) * 0.16); transform: translate(-50%, -50%); display: none; align-items: center; gap: 8px; height: 64px; padding: 0 20px; border-radius: 10px; border: 3px solid #fff3c4; border-bottom-width: 6px; background: linear-gradient(180deg, #ffd36e, #ff9a3c); color: #3a1a00; }
#combo.show { display: flex; animation: cmb .4s cubic-bezier(.2,1.8,.5,1); } @keyframes cmb { from { margin-top: 40px; } to { margin-top: 0; } }
#combo b { font-size: 42px; font-weight: 900; line-height: 1; } #combo span { font-size: 20px; font-weight: 900; line-height: 1; }
#combo.lv3 { background: linear-gradient(180deg, #ff9ad5, #ff4f8a); color: #3a0018; } #combo.lv4 { background: linear-gradient(180deg, #b59cff, #6a4cff); color: #fff; border-color: #e6dcff; }
/* 점수 숫자 */
.pts { font-size: 30px; -webkit-text-stroke: 1px #3a2600; text-shadow: 0 3px 0 #7a5410; }
/* 배너: 스테이지 클리어는 큰 판 */
#banner { border-width: 3px; border-bottom-width: 6px; background: linear-gradient(180deg, #2c4aa0, #1a2b62); border-color: #8fd0ff; }
#banner.clear { padding: 18px 40px; background: linear-gradient(180deg, #ffe9a8, #ffb84a); border-color: #fff6d8; color: #3a2200; }
#banner.clear i { font-style: normal; font-size: 16px; font-weight: 900; letter-spacing: 3px; } #banner.clear b { font-size: 48px; font-weight: 900; line-height: 1; text-shadow: 0 3px 0 rgba(255,255,255,.6); } #banner.clear span { color: #5a3a00; font-size: 18px; font-weight: 900; }
.panel { background: linear-gradient(180deg, var(--hud1), var(--hud2)); border: 2px solid var(--hudE); border-bottom-width: 6px; }

/* 11-30 누적: 터지는 물질 줄 */
#popList { position: absolute; top: 38px; left: 10px; right: 10px; display: flex; flex-wrap: wrap; justify-content: flex-start; align-items: center; gap: 4px 5px; font-size: 11px; line-height: 1; color: #9fb0d8; z-index: 2; }
#popList .pl { display: inline-flex; align-items: center; height: 20px; font-weight: 700; color: #c8d4f4; margin-right: 2px; }
#popList .ps { display: inline-flex; align-items: center; gap: 3px; height: 20px; padding: 0 6px; border-radius: 4px; background: rgba(255,255,255,.06); }
#popList .ps em { font-style: normal; font-size: 9px; opacity: .7; display: inline-flex; align-items: center; justify-content: center; }
#popList .ps b { font-weight: 600; display: inline-flex; align-items: center; }
#popList .ps.now { background: rgba(255,211,110,.18); color: #ffe7a8; }
#showbox.many #showEmpty { display: none; }
#showbox.many #popList { gap: 3px 4px; font-size: 10px; }
#showbox.many #popList .ps { height: 18px; padding: 0 5px; }
#showbox.played #popList { opacity: .45; }
#popList .ps.out { background: transparent; border: 1px dashed rgba(159,176,216,.35); }
