/* 스노우 스쿼드 화면 꾸밈: 밝은 겨울 마을 · 두꺼운 남색 테두리 · 말랑한 장난감 버튼 (그림과 같은 모양)
   배치는 흔한 게임 화면 방식 (브롤스타즈·롤·왕자영요): 로비 오른쪽 아래 시작, 위 줄 뒤로·코인, 결과 띠, 오른쪽 아래 공격 버튼 */
:root {
  --ink: #23324d; --ink2: rgba(35,50,77,0.82); --sun: #ffc23a; --pink: #ff8fab; --mint: #5eead4; --sky: #7cc8ff; --blue: #3b9cf0;
  --card: #f5fbff; --text: #23324d; --text2: #5b6b88;
  --font: "Trebuchet MS", "Arial Rounded MT Bold", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  --ol: 0 2px 0 var(--ink), 2px 0 0 var(--ink), -2px 0 0 var(--ink), 0 -2px 0 var(--ink), 1.5px 1.5px 0 var(--ink), -1.5px 1.5px 0 var(--ink), 1.5px -1.5px 0 var(--ink), -1.5px -1.5px 0 var(--ink), 0 4px 0 rgba(35,50,77,0.45);
  --ol1: 0 1px 0 var(--ink), 1px 0 0 var(--ink), -1px 0 0 var(--ink), 0 -1px 0 var(--ink), 0 2px 0 rgba(35,50,77,0.4);
  --sl: max(10px, env(safe-area-inset-left)); --sr: max(10px, env(safe-area-inset-right)); --st: max(8px, env(safe-area-inset-top)); --sb: max(8px, env(safe-area-inset-bottom));
  --cornerW: 160px;
  color-scheme: light;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; overflow: hidden; background: linear-gradient(#bfe7ff, #eef8ff); font-family: var(--font); color: var(--text); user-select: none; -webkit-user-select: none; touch-action: none; overscroll-behavior: none; }
/* 한국어는 낱말 중간에서 줄을 바꾸지 않음 (별/을 → 별을) */
html:lang(ko) body { word-break: keep-all; overflow-wrap: break-word; }
#c { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
#ui { position: fixed; inset: 0; pointer-events: none; }
#ui button, #ui input, #ui .pe { pointer-events: auto; }
button { font: inherit; cursor: pointer; border: 0; color: inherit; }
img { -webkit-user-drag: none; }
/* 그림 아이콘 · 선 그림 */
.ic { width: 1.25em; height: 1.25em; object-fit: contain; vertical-align: middle; flex: none; pointer-events: none; }
.ic.off { filter: grayscale(1) brightness(1.3) opacity(0.45); }
.art { object-fit: contain; pointer-events: none; }
.gl { width: 1.1em; height: 1.1em; flex: none; vertical-align: middle; }

/* ── 메뉴 화면 공통 ── */
.screen { position: absolute; inset: 0; z-index: 5; overflow-y: auto; display: flex; flex-direction: column; align-items: center; justify-content: safe center; gap: 12px; padding: 14px; text-align: center; }
.screen:empty { display: none; }
.screen.menu { padding-top: calc(var(--st) + 60px); }
/* 위 줄이 있는 화면: 판은 남은 칸 안에서 (넘치지 않게) */
.screen.menu .panel { max-height: 100%; max-width: 100%; }
.screen.ttl { background: radial-gradient(ellipse 60% 55% at 50% 42%, rgba(255,255,255,0.55), rgba(255,255,255,0) 72%); padding-bottom: 96px; }
.screen.dim { background: radial-gradient(ellipse at 50% 40%, rgba(214,236,255,0.55), rgba(120,170,225,0.6)); pointer-events: auto; }
/* 버튼: 두꺼운 테두리 + 아래 턱 (눌리면 내려감) */
.btn { pointer-events: auto; display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-width: 170px; min-height: 48px; padding: 9px 24px; border-radius: 16px; font-size: 20px; font-weight: 900; color: #fff; text-shadow: var(--ol);
  border: 3px solid var(--ink); background: linear-gradient(#93d5ff, #3b9cf0 58%, #2f86d8); box-shadow: inset 0 3px 0 rgba(255,255,255,0.55), inset 0 -5px 0 rgba(0,0,0,0.16), 0 4px 0 var(--ink), 0 8px 14px rgba(30,70,130,0.22); transition: transform 0.07s; }
.btn:active { transform: translateY(3px); box-shadow: inset 0 3px 0 rgba(255,255,255,0.55), inset 0 -3px 0 rgba(0,0,0,0.16), 0 1px 0 var(--ink); }
.btn.go { background: linear-gradient(#fff3a0, #ffc23a 55%, #f5a000); }
.btn.buy { background: linear-gradient(#b7f5a8, #3fc46a 58%, #2fa857); }
.btn.alt { background: linear-gradient(#ffffff, #dcebf8); color: var(--ink); text-shadow: none; }
.btn.small { min-width: 0; min-height: 44px; padding: 6px 14px; font-size: 16px; border-radius: 13px; }
.btn .ic { width: 1.3em; height: 1.3em; }
.btn[disabled] { opacity: 0.55; cursor: default; filter: grayscale(0.4); }
.row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; align-items: center; }
.panel { pointer-events: auto; background: linear-gradient(#f9fdff, #e2f1fe); border: 3px solid var(--ink); border-radius: 22px; padding: 14px 18px;
  box-shadow: inset 0 3px 0 #fff, 0 5px 0 rgba(35,50,77,0.35), 0 14px 30px rgba(30,70,130,0.22); max-width: min(94vw, 780px); max-height: calc(100% - 70px); overflow-y: auto; }
.panel.wide { max-width: min(96vw, 820px); }
.panel.solo { min-width: min(92vw, 360px); }
.panel.bare { background: none; border: 0; box-shadow: none; padding: 0 0 6px; overflow: visible; max-height: none; }
.panel h2 { margin: 0 0 10px; font-size: 24px; }
.ph { margin: -14px -18px 10px; padding: 8px 18px; background: linear-gradient(#73c2ff, #3b8fe8); border-bottom: 3px solid var(--ink); border-radius: 19px 19px 0 0; font-size: 22px; font-weight: 900; color: #fff; text-shadow: var(--ol); }
.note { color: var(--text2); font-size: 13px; margin: 8px 0 0; }
.sub2 { font-weight: 900; margin: 10px 0 6px; }
.code { font-size: 44px; font-weight: 900; letter-spacing: 8px; color: #fff; text-shadow: var(--ol); }
input.codein { pointer-events: auto; font: inherit; font-size: 28px; font-weight: 900; letter-spacing: 6px; text-align: center; text-transform: uppercase; width: 220px; padding: 6px; border-radius: 14px; border: 3px solid var(--ink); background: #fff; color: var(--ink); box-shadow: inset 0 3px 0 #dbe9f6; }
.err { color: #e11d48; font-weight: 800; min-height: 1.2em; }
.hero .ic { width: 84px; height: 84px; }
.spin { width: 52px; height: 52px; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.ctl { max-width: 480px; color: var(--text2); font-size: 14px; margin: 6px auto 10px; }
/* 오른쪽 위: 언어·소리·전체 화면 */
.corner { position: absolute; top: var(--st); right: var(--sr); display: flex; gap: 8px; z-index: 3; }
.round { pointer-events: auto; width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; padding: 0; background: linear-gradient(#ffffff, #d9eaf9); border: 3px solid var(--ink); font-size: 17px; color: var(--ink); font-weight: 900; box-shadow: 0 3px 0 var(--ink); }
.round:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.round .ic { width: 30px; height: 30px; }
/* 위 줄: 뒤로 · 화면 이름 · 코인 */
.topbar { position: absolute; top: var(--st); left: var(--sl); right: calc(var(--sr) + var(--cornerW)); display: flex; align-items: center; gap: 10px; pointer-events: none; z-index: 2; height: 44px; }
.topbar .back { pointer-events: auto; flex: none; width: 52px; height: 44px; border-radius: 14px; display: grid; place-items: center; border: 3px solid var(--ink); background: linear-gradient(#ffe27a, #ffb020); color: var(--ink); box-shadow: 0 3px 0 var(--ink); }
.topbar .back .gl { width: 24px; height: 24px; }
.topbar .back:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.topbar h1 { margin: 0; min-width: 0; font-size: 26px; font-weight: 900; color: #fff; text-shadow: var(--ol); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 10px; padding: 4px 4px 6px; }
.topbar h1 .hs { font-size: 16px; display: inline-flex; align-items: center; gap: 3px; }
.topbar .res { margin-left: auto; }
.topbar .tb { pointer-events: auto; margin-left: auto; flex: none; } .topbar .tb + .res { margin-left: 14px; }
.go1 { margin-top: 12px; }
/* 재화 칸 (위 오른쪽 자원 칸): 어두운 반투명 + 왼쪽 큰 그림 */
.res { display: inline-flex; align-items: center; gap: 4px; height: 34px; padding: 0 14px 0 4px; margin-left: 14px; border-radius: 99px; background: var(--ink2); border: 2px solid rgba(255,255,255,0.85); color: #fff; font-weight: 900; font-size: 17px; font-variant-numeric: tabular-nums; white-space: nowrap; flex: none; }
.res .ic { width: 36px; height: 36px; margin-left: -18px; filter: drop-shadow(0 2px 0 rgba(35,50,77,0.4)); }
.res.top { position: absolute; top: calc(var(--st) + 5px); right: calc(var(--sr) + var(--cornerW)); }
.foot { position: absolute; bottom: 8px; left: 12px; right: 270px; font-size: 12px; color: #3b5578; text-shadow: 0 1px 0 #fff; text-align: left; }

/* ── 로비 (시작 화면) ── */
.logo { font-size: clamp(40px, 9.5vw, 92px); font-weight: 900; line-height: 0.95; color: #fff; letter-spacing: 1px; transform: rotate(-3deg);
  text-shadow: 0 4px 0 #ff8fab, 0 8px 0 #f472b6, 0 12px 0 #db2777, 0 16px 26px rgba(120,40,90,0.35); -webkit-text-stroke: 2px #db2777; }
.logo small { display: block; font-size: 0.3em; letter-spacing: 4px; color: #fff7d6; -webkit-text-stroke: 1px #d97706; text-shadow: 0 3px 0 #f59e0b; margin-top: 10px; }
.tag { font-size: clamp(15px, 2.4vw, 21px); font-weight: 900; color: var(--ink); background: #fff; border: 3px solid var(--ink); padding: 3px 16px; border-radius: 99px; box-shadow: 0 3px 0 var(--ink); }
.btn.play { position: absolute; right: calc(var(--sr) + 8px); bottom: calc(var(--sb) + 10px); min-width: 230px; min-height: 76px; font-size: 32px; border-radius: 22px; gap: 10px; padding: 8px 30px 8px 18px; }
.btn.play .ic { width: 54px; height: 54px; margin: -6px 0; filter: drop-shadow(0 3px 0 rgba(35,50,77,0.35)); }
.mechip { position: absolute; top: var(--st); left: var(--sl); pointer-events: auto; display: flex; align-items: center; gap: 0; min-height: 50px; padding: 3px 14px 3px 3px; border-radius: 16px; background: var(--ink2); border: 2px solid rgba(255,255,255,0.85); color: #fff; max-width: calc(50vw - 30px); text-align: left; }
.mechip .av { width: 44px; height: 44px; border-radius: 12px; background: radial-gradient(circle at 50% 30%, #fff, #bfe3ff); border: 2px solid #fff; object-fit: cover; }
.mechip .lvb { margin: 0 8px 0 -12px; align-self: flex-end; transform: scale(0.8); }
.mechip .mn { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.mechip b { font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 9em; text-shadow: var(--ol1); }
.xpb { display: block; width: 96px; height: 8px; border-radius: 5px; background: rgba(255,255,255,0.25); overflow: hidden; }
.xpb i { display: block; height: 100%; background: linear-gradient(90deg, #7dd3fc, #38bdf8); border-radius: 5px; }
.lvb { display: inline-grid; place-items: center; flex: none; min-width: 34px; height: 34px; padding: 0 4px; border-radius: 11px; background: linear-gradient(#8fd6ff, #2f86d8); border: 2.5px solid var(--ink); color: #fff; font-weight: 900; font-size: 16px; text-shadow: var(--ol1); box-shadow: 0 2px 0 var(--ink); }
/* 왼쪽 세로 줄: 상점 · 미션 */
.side { position: absolute; left: var(--sl); top: calc(var(--st) + 66px); display: flex; flex-direction: column; gap: 10px; }
.sbtn { position: relative; pointer-events: auto; width: 82px; height: 82px; border-radius: 18px; padding: 4px 2px 2px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0;
  background: linear-gradient(#ffffff, #d6e9fa); border: 3px solid var(--ink); box-shadow: 0 4px 0 var(--ink); color: #fff; }
.sbtn .ic { width: 52px; height: 52px; }
.sbtn b { font-size: 14px; font-weight: 900; text-shadow: var(--ol1); line-height: 1.1; margin-top: -2px; }
.sbtn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.dot { position: absolute; top: -6px; right: -6px; width: 18px; height: 18px; border-radius: 50%; background: #ef4444; border: 2.5px solid #fff; box-shadow: 0 0 0 2px var(--ink); }

/* ── 모드 고르기 (모드 카드) ── */
.modes { display: grid; grid-template-columns: repeat(4, minmax(0, 200px)); gap: 12px; justify-content: center; }
.mcard { pointer-events: auto; position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 0 0 12px; border-radius: 20px; overflow: hidden; background: linear-gradient(#ffffff, #eaf4fd); border: 3px solid var(--ink); box-shadow: 0 5px 0 var(--ink), 0 10px 18px rgba(30,70,130,0.2); text-align: center; transition: transform 0.08s; }
.mcard:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--ink); }
.mcard .mart { width: 100%; height: 112px; display: grid; place-items: center; border-bottom: 3px solid var(--ink); background: var(--mbg); }
.mcard .mart .ic { width: 96px; height: 96px; filter: drop-shadow(0 4px 0 rgba(35,50,77,0.25)); }
.mcard b { font-size: 20px; font-weight: 900; color: #fff; text-shadow: var(--ol); margin-top: 6px; padding: 0 6px; }
.mcard .md { font-size: 13px; line-height: 1.3; color: var(--text2); padding: 0 10px; }
.mcard .st { display: inline-flex; align-items: center; gap: 3px; font-weight: 900; font-size: 14px; color: #b45309; }
.m-camp { --mbg: radial-gradient(circle at 50% 30%, #d6fff2, #5fdcc0); }
.m-quick { --mbg: radial-gradient(circle at 50% 30%, #fff6c2, #ffb84a); }
.m-private { --mbg: radial-gradient(circle at 50% 30%, #ffe1ee, #ff8fbf); }
.m-bot { --mbg: radial-gradient(circle at 50% 30%, #e0f2ff, #7cb8ff); }

/* ── 캠페인 단계 ── */
.stages { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; padding-top: 8px; }
.stage { position: relative; height: 78px; border-radius: 18px; padding: 0; background: linear-gradient(#c9ebff, #7cc0f5); border: 3px solid var(--ink); box-shadow: 0 4px 0 var(--ink); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.stage b { font-size: 26px; font-weight: 900; color: #fff; text-shadow: var(--ol); line-height: 1; }
.stage .stars { display: flex; gap: 0; } .stage .stars .ic { width: 20px; height: 20px; }
.stage .wd { position: absolute; top: -8px; right: -6px; width: 28px; height: 28px; }
.stage .bossic { position: absolute; top: -10px; left: -8px; width: 34px; height: 34px; }
.stage .lk { width: 34px; height: 34px; }
.stage.lock { background: linear-gradient(#e6edf5, #b9c8da); cursor: default; }
.stage.boss { background: linear-gradient(#e8dcff, #a98bf5); }
.stage.new { box-shadow: 0 4px 0 var(--ink), 0 0 0 4px #ffd23f; }
.stage:not(.lock):active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.chips { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: center; font-size: 14px; }
.chip { display: inline-flex; align-items: center; gap: 4px; background: #fff7d6; border: 2px solid var(--ink); border-radius: 99px; padding: 1px 10px 1px 3px; font-weight: 800; }
.chip .ic { width: 24px; height: 24px; }
.chip.off { background: #f1f5f9; color: var(--text2); padding: 2px 10px; }
.rule .btn { margin-left: auto; }
.rule { display: flex; flex-wrap: wrap; gap: 4px 12px; justify-content: center; align-items: center; } .rule span { display: inline-flex; align-items: center; gap: 2px; }
.seg { display: inline-flex; background: #d5e9fa; border: 2.5px solid var(--ink); border-radius: 14px; padding: 3px; gap: 3px; }
.seg button { padding: 8px 14px; border-radius: 10px; background: transparent; font-weight: 900; color: var(--text2); }
.seg button.on { background: linear-gradient(#93d5ff, #3b9cf0); color: #fff; text-shadow: var(--ol1); box-shadow: inset 0 -3px 0 rgba(0,0,0,0.15); }
.diff { margin-top: 8px; display: flex; gap: 10px; align-items: center; justify-content: center; flex-wrap: wrap; }

/* ── 결과 ── */
.result { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.banner { display: inline-flex; align-items: center; gap: 10px; padding: 4px 36px 8px; font-size: clamp(38px, 6.6vw, 72px); font-weight: 900; color: #fff; text-shadow: var(--ol); line-height: 1.05;
  background: linear-gradient(#ffe98a, #ffb020); border: 4px solid var(--ink); border-radius: 20px; transform: rotate(-2deg); box-shadow: inset 0 4px 0 rgba(255,255,255,0.6), 0 6px 0 var(--ink), 0 14px 30px rgba(160,90,0,0.3); animation: pop 0.35s backwards; }
.banner.lose { background: linear-gradient(#cfdbea, #8a9fbd); }
.banner.draw { background: linear-gradient(#bfe6ff, #5aaef0); }
.banner .bt { width: 1.05em; height: 1.05em; margin: -0.1em 0; }
.result .sub { font-weight: 900; color: #fff; text-shadow: var(--ol1); min-height: 1em; }
.rtop { display: flex; gap: 16px; align-items: center; justify-content: center; flex-wrap: wrap; }
.mvp { display: flex; align-items: center; gap: 10px; text-align: left; background: linear-gradient(#fff8d6, #ffe58a); border: 3px solid var(--ink); border-radius: 18px; padding: 6px 14px 6px 6px; box-shadow: 0 3px 0 var(--ink); }
.mvp .mvpface { width: 64px; height: 64px; border-radius: 14px; background: radial-gradient(circle at 50% 30%, #fff, #ffd76a); border: 2.5px solid var(--ink); }
.mvp em { display: inline-block; font-style: normal; font-size: 13px; font-weight: 900; color: #fff; background: #f59e0b; border: 2px solid var(--ink); border-radius: 8px; padding: 0 6px; text-shadow: var(--ol1); }
.mvp b { display: block; font-size: 18px; } .mvp span { font-size: 13px; color: #92400e; font-weight: 800; }
.stats { display: grid; grid-template-columns: repeat(4, auto); gap: 6px; }
.stats div { display: flex; flex-direction: column; align-items: center; min-width: 74px; padding: 4px 6px; background: #fff; border: 2.5px solid var(--ink); border-radius: 14px; }
.stats .ic { width: 30px; height: 30px; } .stats span { color: var(--text2); font-weight: 800; font-size: 11px; } .stats b { font-size: 20px; font-weight: 900; line-height: 1.1; font-variant-numeric: tabular-nums; }
.bigstars { display: flex; justify-content: center; gap: 6px; }
.bigstars img { width: 70px; height: 70px; filter: grayscale(1) brightness(1.3) opacity(0.4); }
.bigstars img.on { filter: drop-shadow(0 4px 0 rgba(35,50,77,0.35)); animation: starpop 0.5s backwards; }
@keyframes starpop { from { transform: scale(0.2) rotate(-40deg); opacity: 0; } 70% { transform: scale(1.3); } }
.starwhy { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; font-size: 13px; font-weight: 800; color: #94a3b8; margin-top: 6px; } .starwhy .ok { color: #15803d; }
.starwhy span { display: inline-flex; align-items: center; gap: 4px; }
.okm { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: #cbd5e1; color: #fff; border: 2px solid var(--ink); }
.okm.on { background: #22c55e; } .okm .gl { width: 12px; height: 12px; }
.pick { font-weight: 900; margin: 10px 0 6px; display: flex; align-items: center; justify-content: center; gap: 6px; } .pick .inl { width: 36px; height: 36px; }
.cards { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.card { pointer-events: auto; width: 150px; padding: 8px 8px 10px; border-radius: 18px; background: linear-gradient(#fffbea, #ffe08a); color: #5a3b00; border: 3px solid var(--ink); box-shadow: 0 4px 0 var(--ink), 0 0 18px rgba(250,204,21,0.45); text-align: center; animation: pop 0.3s backwards; display: flex; flex-direction: column; align-items: center; }
.card .cart { width: 64px; height: 64px; }
.card b { display: block; font-size: 16px; } .card span { font-size: 12.5px; line-height: 1.25; display: block; margin-top: 3px; }
.card:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
@keyframes pop { from { transform: scale(0.6); opacity: 0; } }
.rwd { margin-top: 10px; font-size: 14px; font-weight: 800; color: var(--ink); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: center; } .rwd:empty { display: none; }
.rwd .dim { color: var(--text2); font-weight: 700; font-size: 12px; }
.gchip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px 2px 3px; border-radius: 99px; background: #fff; border: 2px solid var(--ink); font-weight: 900; font-size: 15px; }
.gchip .ic { width: 26px; height: 26px; } .gchip.hot { background: #fff2b8; } .gchip.dim { background: #eef2f7; font-size: 12px; color: var(--text2); }

/* ── 상점 (종류 탭 · 아이템 카드 · 오른쪽 자세히) ── */
.panel.shop { width: min(96vw, 980px); max-width: none; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.tabs { display: flex; flex-wrap: nowrap; justify-content: center; align-self: center; }
.tabs button { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; padding: 3px 12px 3px 4px; border: 2.5px solid transparent; }
.tabs button .ti { width: 34px; height: 34px; }
.tabs button.on { background: linear-gradient(#ffffff, #e8f4ff); border-color: var(--ink); color: var(--ink); text-shadow: none; box-shadow: 0 3px 0 var(--ink); }
.shopbody { display: flex; gap: 10px; min-height: 0; align-items: stretch; }
/* 칸 목록은 스스로 스크롤. 고른 칸 테두리(outline 4px+1px)가 안 잘리게 안쪽 여백 7px, 바깥 여백 -5px로 자리는 그대로 */
.tiles { flex: 1; display: flex; flex-wrap: wrap; gap: 8px; align-content: flex-start; justify-content: center; --s: 92px; padding: 7px; margin: -5px; overflow-y: auto; overscroll-behavior: contain; }
.tile { position: relative; flex: none; width: var(--s); height: var(--s); border-radius: 16px; padding: 0; overflow: hidden; border: 3px solid var(--ink); background: radial-gradient(circle at 50% 38%, #ffffff 10%, var(--rb, #cfe7ff) 78%); box-shadow: 0 3px 0 var(--ink); transition: transform 0.08s; }
.tile .art { position: absolute; left: 7%; top: 5%; width: 86%; height: 80%; }
.r-shop { --rb: #9fd4ff; } .r-pack { --rb: #d4b8ff; } .r-link { --rb: #ffb8cc; } .r-star { --rb: #ffe08a; } .r-free { --rb: #c4f0d8; }
.tile.sel { outline: 4px solid #ffd23f; outline-offset: 1px; z-index: 1; }
.tile.on { box-shadow: 0 3px 0 var(--ink), inset 0 0 0 3px #22c55e; }
.tile .ck { position: absolute; top: 3px; right: 3px; min-width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: #22c55e; border: 2px solid var(--ink); color: #fff; font-size: 12px; font-weight: 900; padding: 0 3px; }
.tile .ck .gl { width: 13px; height: 13px; }
.tile .role { position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; border: 2px solid var(--ink); }
.tile .price { position: absolute; left: 0; right: 0; bottom: 0; height: 22px; display: flex; align-items: center; justify-content: center; background: var(--ink2); color: #fff; font-size: 13px; font-weight: 900; text-decoration: none; }
.tile .price .ic { width: 18px; height: 18px; }
.cn { display: inline-flex; align-items: center; gap: 2px; font-variant-numeric: tabular-nums; }
.tile:active { transform: translateY(2px); }
.tiles.cash { flex-wrap: nowrap; align-items: flex-start; }
.tile.wide { flex: 1 1 0; min-width: 0; max-width: 200px; width: auto; height: auto; display: flex; flex-direction: column; align-items: center; padding: 6px 6px 8px; gap: 2px; background: linear-gradient(#ffffff, #e5f2ff); }
.tile.wide .art { position: static; width: 100%; height: auto; aspect-ratio: 1; border-radius: 12px; }
.tile.wide b { font-size: 14px; line-height: 1.2; } .tile.wide span { font-size: 12px; color: #b45309; font-weight: 900; }
.detail { width: 34%; min-width: 196px; max-width: 300px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 10px; text-align: center; background: linear-gradient(#ffffff, #eaf5ff); border: 3px solid var(--ink); border-radius: 18px; }
.detail .dart { position: relative; width: 128px; height: 128px; flex: none; border-radius: 18px; border: 3px solid var(--ink); background: radial-gradient(circle at 50% 38%, #ffffff 10%, var(--rb, #cfe7ff) 78%); overflow: hidden; }
.detail .dart .art { width: 100%; height: 100%; }
.detail .dart .role { position: absolute; top: 4px; left: 4px; width: 32px; height: 32px; border-radius: 50%; background: #fff; border: 2px solid var(--ink); }
.detail .dt { display: flex; flex-direction: column; gap: 2px; min-width: 0; align-items: center; }
.detail .dt b { font-size: 18px; } .detail .dt span { font-size: 13px; color: var(--text2); } .detail .dt small { font-size: 11px; color: #9a3412; line-height: 1.3; margin-top: 2px; }
.detail .dt.empty .big { width: 64px; height: 64px; opacity: 0.6; }
.detail .inside { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px; } .detail .inside .mini { width: 30px; height: 30px; }
.detail .btn, a.btn { flex: none; text-decoration: none; pointer-events: auto; }
.btn .cn .ic { width: 22px; height: 22px; }

/* ── 미션 ── */
.panel.miss { width: min(94vw, 600px); }
.lv { display: flex; align-items: center; gap: 10px; margin-bottom: 2px; flex-wrap: wrap; } .lv .bar { flex: 1; margin: 0; min-width: 160px; } .lv small { font-size: 12px; color: var(--text2); font-weight: 800; }
.mrow { display: flex; align-items: center; gap: 10px; padding: 6px 8px; margin-top: 8px; text-align: left; background: #fff; border: 2.5px solid var(--ink); border-radius: 16px; box-shadow: 0 3px 0 rgba(35,50,77,0.35); }
.mrow.ready { background: linear-gradient(#fffbe0, #ffefa6); } .mrow.got { opacity: 0.6; }
.mic { flex: none; width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: radial-gradient(circle at 50% 35%, #fff, #cfe8ff); border: 2px solid var(--ink); }
.mic .ic { width: 40px; height: 40px; }
.mrow .mt { flex: 1; min-width: 0; } .mrow .mt b { font-size: 14px; display: block; }
.rw { flex: none; font-weight: 900; font-size: 15px; color: #92400e; } .rw .ic { width: 24px; height: 24px; }
.bar { position: relative; display: block; height: 18px; border-radius: 9px; background: #dbe7f3; border: 2px solid var(--ink); overflow: hidden; margin-top: 3px; }
.bar i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(#ffe27a, #ffb020); }
.bar em { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 3px; font-style: normal; font-size: 11px; font-weight: 900; }
.bar em .ic { width: 16px; height: 16px; }
.bar.xp i { background: linear-gradient(#a5f3fc, #38bdf8); }
.okk { color: #15803d; font-weight: 900; margin: 4px 0; display: inline-flex; align-items: center; gap: 4px; }

/* ── 내 정보 ── */
.panel.prof { width: min(94vw, 740px); text-align: left; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; } .col { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.frow { display: flex; gap: 6px; align-items: center; } .frow .txt { flex: 1; min-width: 0; }
.frow.who .av { width: 48px; height: 48px; flex: none; border-radius: 12px; background: radial-gradient(circle at 50% 30%, #fff, #bfe3ff); border: 2.5px solid var(--ink); }
.frow.who .lvb { margin-left: -16px; align-self: flex-end; transform: scale(0.8); }
input.txt { pointer-events: auto; font: inherit; font-size: 16px; font-weight: 800; padding: 8px 10px; border-radius: 12px; border: 2.5px solid var(--ink); background: #fff; color: var(--ink); min-height: 44px; user-select: text; -webkit-user-select: text; box-shadow: inset 0 3px 0 #dbe9f6; }
button.rc { flex: 1; min-width: 0; min-height: 44px; font-family: Consolas, monospace; font-size: 13px; font-weight: 900; background: #fff7d6; border: 2.5px solid var(--ink); border-radius: 12px; padding: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.statl { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.statl span { display: flex; flex-direction: column; align-items: center; background: #fff; border: 2px solid var(--ink); border-radius: 12px; padding: 2px 4px; }
.statl .ic { width: 26px; height: 26px; } .statl em { font-style: normal; font-size: 11px; color: var(--text2); font-weight: 800; } .statl b { font-size: 16px; }
.acct { display: flex; gap: 8px; align-items: flex-start; } .acct .scarf { width: 54px; height: 54px; flex: none; }
.acct .note { margin: 0 0 4px; }
.lbl { font-size: 14px; }

/* ── 경기 중 HUD ── */
#hud { position: absolute; inset: 0; }
/* 왼쪽 위 분대 얼굴: 얼굴 그림 · 체력 · 눈덩이 수 · 스킬 준비 점 */
#squad { position: absolute; top: max(6px, env(safe-area-inset-top)); left: max(8px, env(safe-area-inset-left)); display: flex; gap: 6px; }
.pt { position: relative; width: 58px; height: 64px; border-radius: 14px; padding: 0; overflow: hidden; background: radial-gradient(circle at 50% 30%, #ffffff, #b9dcfa); border: 3px solid var(--ink); box-shadow: 0 3px 0 var(--ink); transition: transform 0.1s; touch-action: none; }
.pt .face { position: absolute; left: 0; right: 0; top: -2px; width: 100%; height: calc(100% - 6px); object-fit: cover; object-position: 50% 20%; }
.pt .snowm { position: absolute; left: 10%; top: 4%; width: 80%; height: 76%; object-fit: contain; display: none; }
.pt em { position: absolute; top: 1px; left: 3px; font-style: normal; font-size: 11px; font-weight: 900; color: #fff; text-shadow: var(--ol1); }
.pt .hp { position: absolute; left: 0; right: 0; bottom: 0; height: 8px; background: var(--ink); overflow: hidden; }
.pt .hp u { display: block; height: 100%; background: linear-gradient(#86efac, #22c55e); text-decoration: none; }
.pt.low .hp u { background: linear-gradient(#fca5a5, #ef4444); }
.pt .am { position: absolute; right: 1px; bottom: 9px; display: flex; align-items: center; text-decoration: none; font-size: 11px; font-weight: 900; color: #fff; text-shadow: var(--ol1); background: var(--ink2); border-radius: 8px; padding: 0 4px 0 1px; line-height: 14px; }
.pt .am img { width: 13px; height: 13px; }
.pt .am b:empty, .pt.out .am { display: none; }
.pt .sk { position: absolute; top: 3px; right: 3px; width: 10px; height: 10px; border-radius: 50%; background: rgba(35,50,77,0.35); }
.pt .sk.on { background: #fde047; box-shadow: 0 0 0 1.5px var(--ink), 0 0 6px #fde047; }
.pt.sel { border-color: #ffd23f; transform: translateY(2px) scale(1.06); box-shadow: 0 0 0 2px var(--ink), 0 4px 0 var(--ink); background: radial-gradient(circle at 50% 30%, #fffbe6, #ffd76a); }
.pt.out .face { filter: grayscale(1) brightness(1.2); opacity: 0.35; }
.pt.out .snowm { display: block; }
.pt.scoop .face { animation: wig 0.3s infinite alternate; }
@keyframes wig { to { transform: rotate(6deg); } }
/* 위 가운데: 우리 팀 · 시간 · 상대 팀 · 바람 (어두운 반투명 칸) */
.hud-top { position: absolute; top: max(6px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); display: flex; gap: 5px; align-items: center; }
.pill { display: flex; align-items: center; gap: 3px; height: 34px; background: var(--ink2); border: 2px solid rgba(255,255,255,0.85); color: #fff; border-radius: 12px; padding: 0 8px; font-weight: 900; font-size: 15px; white-space: nowrap; font-variant-numeric: tabular-nums; text-shadow: var(--ol1); }
.pill.clock { font-size: 19px; min-width: 64px; justify-content: center; border-radius: 10px; background: rgba(20,30,50,0.88); }
.pill.clock.urgent { color: #fecaca; background: rgba(160,25,45,0.9); }
.pill.team { padding: 0 4px; gap: 2px; box-shadow: inset 0 -3px 0 var(--tc, #f59e0b); }
.pill .mf { width: 26px; height: 26px; border-radius: 50%; background: radial-gradient(circle at 50% 30%, #fff, #cfe6fb); border: 2px solid var(--tc, #f59e0b); object-fit: cover; }
.pill .mf.dead { filter: grayscale(1); opacity: 0.4; }
.pill .ic { width: 26px; height: 26px; }
.pill.wind { padding: 0 8px 0 2px; }
#menuBtn { position: absolute; top: max(6px, env(safe-area-inset-top)); right: max(8px, env(safe-area-inset-right)); }
#menuBtn .gl { width: 22px; height: 22px; }
#emoBtn { position: absolute; top: max(6px, env(safe-area-inset-top)); right: calc(max(8px, env(safe-area-inset-right)) + 52px); }
/* 이모트 고르기: 가로 한 줄 스티커 */
#emoPick { position: absolute; top: calc(max(6px, env(safe-area-inset-top)) + 54px); right: max(8px, env(safe-area-inset-right)); display: flex; gap: 6px; padding: 5px; border-radius: 18px; background: var(--ink2); border: 2px solid rgba(255,255,255,0.85); animation: pop 0.18s backwards; }
#emoPick .emo { pointer-events: auto; width: 56px; height: 56px; padding: 2px; border-radius: 14px; background: radial-gradient(circle at 50% 35%, #ffffff, #d6ebff); border: 2.5px solid var(--ink); display: grid; place-items: center; }
#emoPick .emo img { width: 100%; height: 100%; object-fit: contain; }
#emoPick .emo:active { transform: scale(0.92); }
#hud[data-kind="campaign"] #emoBtn, body.scr #emoBtn, body.scr #emoPick { display: none; }
/* 알림 띠 */
#msgs { position: absolute; top: 50px; left: 0; right: 0; display: flex; flex-direction: column; align-items: center; gap: 5px; }
#toasts { display: flex; flex-direction: column; align-items: center; gap: 5px; max-width: calc(100% - 24px); }
.toast { display: flex; align-items: center; gap: 6px; background: var(--ink2); border: 2px solid rgba(255,255,255,0.85); color: #fff; padding: 4px 16px 4px 6px; border-radius: 12px; font-weight: 900; font-size: 15px; animation: toast 2.5s forwards; text-align: left; text-shadow: var(--ol1); }
.toast .ic { width: 28px; height: 28px; margin: -4px 0; }
.toast:not(:has(.ic)) { padding-left: 16px; }
.toast.good { box-shadow: inset 4px 0 0 #4ade80; background: rgba(21,83,45,0.86); } .toast.bad { box-shadow: inset 4px 0 0 #fb7185; background: rgba(136,19,55,0.86); }
@keyframes toast { 0% { opacity: 0; transform: translateY(-8px) scale(0.9); } 8% { opacity: 1; transform: none; } 85% { opacity: 1; } 100% { opacity: 0; } }
#hint { position: fixed; bottom: 104px; left: 50%; transform: translateX(-50%); background: #fff7d6; border: 3px solid var(--ink); color: #6b4300; border-radius: 16px; padding: 7px 14px; font-weight: 900; font-size: 15px; max-width: min(90vw, 720px); text-align: center; box-shadow: 0 4px 0 var(--ink); }
/* PC: 아래 가운데 기술 칸 (얼굴 · 체력 · 눈덩이 · Q W E) */
#bar { position: absolute; bottom: max(8px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; background: linear-gradient(#f9fdff, #dcecfb); border: 3px solid var(--ink); border-radius: 20px; padding: 6px 10px 6px 6px; box-shadow: 0 4px 0 var(--ink), 0 10px 20px rgba(30,70,130,0.25); }
#bar .face { width: 58px; height: 58px; border-radius: 14px; background: radial-gradient(circle at 50% 30%, #fff, #ffd76a); border: 2.5px solid var(--ink); object-fit: cover; }
#bar .who { width: 200px; display: flex; flex-direction: column; gap: 4px; }
#bar .who b { font-size: 14px; }
#bar .hp { position: relative; height: 16px; border-radius: 8px; background: #dbe7f3; border: 2px solid var(--ink); overflow: hidden; }
#bar .hp i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(#86efac, #22c55e); transition: width 0.15s; }
#bar .hp span { position: absolute; inset: 0; display: flex; align-items: center; font-size: 11px; font-weight: 900; padding-left: 8px; line-height: 1; }
#bar .ammo { display: flex; gap: 4px; height: 14px; }
#bar .ammo b { width: 14px; height: 14px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff 40%, #cfe3f7); border: 2px solid var(--ink); }
#bar .ammo b.off { background: #e2e8f0; border-color: #9fb1c8; }
#bar .ammo b.prog { background: conic-gradient(#fff var(--p), #e2e8f0 0); }
.slots { display: flex; gap: 6px; }
.slot { position: relative; width: 62px; height: 58px; border-radius: 14px; background: radial-gradient(circle at 50% 30%, #ffffff, #cfe3f7); border: 2.5px solid var(--ink); display: flex; flex-direction: column; align-items: center; justify-content: flex-end; overflow: hidden; padding-bottom: 2px; }
.slot .si { position: absolute; top: 2px; left: 50%; width: 38px; height: 38px; transform: translateX(-50%); }
.slot kbd { position: absolute; top: 1px; left: 3px; font: inherit; font-size: 11px; font-weight: 900; color: #fff; background: var(--ink); border-radius: 5px; padding: 0 4px; line-height: 14px; }
.slot b { position: relative; font-size: 10.5px; font-weight: 900; white-space: nowrap; color: var(--ink); background: rgba(255,255,255,0.85); border-radius: 6px; padding: 0 4px; }
.slot i { position: absolute; left: 0; right: 0; bottom: 0; background: rgba(35,50,77,0.5); }
.slot em { position: absolute; inset: 0; display: grid; place-items: center; font-style: normal; font-size: 20px; font-weight: 900; color: #fff; text-shadow: var(--ol); }
.slot.sk { background: radial-gradient(circle at 50% 30%, #ffe1ee, #ff8fbf); }
.slot:has(em:not(:empty)) b { opacity: 0; }
.slot.on { box-shadow: inset 0 0 0 3px #ffd23f; } .slot.off { opacity: 0.55; }

/* 터치 조작: 왼쪽 스틱 · 오른쪽 큰 던지기 + 스킬 · 뭉치기 */
#touch { position: absolute; inset: 0; }
body.touch #bar { display: none; }
#joyZone { position: absolute; left: 0; top: 78px; bottom: 0; width: 45%; pointer-events: auto; touch-action: none; }
.joy { position: absolute; width: 120px; height: 120px; left: max(26px, env(safe-area-inset-left)); bottom: 22px; border-radius: 50%; background: radial-gradient(circle, rgba(35,50,77,0.08) 55%, rgba(35,50,77,0.2)); border: 3px solid rgba(255,255,255,0.95); box-shadow: 0 0 0 2.5px rgba(35,50,77,0.55), inset 0 0 0 2.5px rgba(35,50,77,0.25); pointer-events: none; }
.joy.live { bottom: auto; background: radial-gradient(circle, rgba(35,50,77,0.12) 55%, rgba(35,50,77,0.28)); }
.joy .knob { position: absolute; left: 50%; top: 50%; width: 54px; height: 54px; margin: -27px 0 0 -27px; border-radius: 50%; background: radial-gradient(circle at 38% 30%, #ffffff, #cfe6fb 70%); border: 3px solid var(--ink); box-shadow: 0 3px 0 rgba(35,50,77,0.5); }
.tbtn { position: absolute; border-radius: 50%; font-weight: 900; font-size: 11px; white-space: nowrap; color: #fff; border: 3px solid var(--ink); box-shadow: inset 0 3px 0 rgba(255,255,255,0.55), inset 0 -4px 0 rgba(0,0,0,0.15), 0 4px 0 var(--ink); touch-action: none; line-height: 1.1; display: flex; flex-direction: column; align-items: center; justify-content: center; overflow: hidden; pointer-events: auto; text-shadow: var(--ol1); padding: 0; }
.tbtn .bi { width: 58%; height: 58%; object-fit: contain; margin-top: -4px; filter: drop-shadow(0 2px 0 rgba(35,50,77,0.3)); }
.tbtn > b { position: relative; margin-top: -2px; }
.tbtn u { position: absolute; left: 0; right: 0; bottom: 0; background: rgba(30,45,70,0.55); }
.tbtn s { position: absolute; inset: 0; display: grid; place-items: center; text-decoration: none; font-size: 22px; text-shadow: var(--ol); }
.tbtn em { position: absolute; top: 8px; right: 12px; font-style: normal; font-size: 13px; min-width: 22px; height: 22px; display: grid; place-items: center; background: #fff; color: var(--ink); border: 2px solid var(--ink); border-radius: 99px; padding: 0 4px; text-shadow: none; }
#tThrow { --R: max(30px, calc(env(safe-area-inset-right) + 14px)); width: 96px; height: 96px; right: var(--R); bottom: 24px; font-size: 13px; background: radial-gradient(circle at 35% 30%, #fff6c2, #ffc23a 60%, #f59e0b); }
#tThrow .bi { width: 60%; height: 60%; }
#tScoop { width: 60px; height: 60px; right: calc(max(30px, calc(env(safe-area-inset-right) + 14px)) + 110px); bottom: 16px; background: radial-gradient(circle at 35% 30%, #ffffff, #cfe3f7 70%); color: var(--ink); text-shadow: none; }
#tSkill { width: 66px; height: 66px; right: calc(max(30px, calc(env(safe-area-inset-right) + 14px)) + 62px); bottom: 124px; background: radial-gradient(circle at 35% 30%, #ffd6e7, #ff6fa3 70%); }
#tSkill.ready { box-shadow: inset 0 3px 0 rgba(255,255,255,0.55), inset 0 -4px 0 rgba(0,0,0,0.15), 0 4px 0 var(--ink), 0 0 0 4px rgba(253,224,71,0.9); }
#tCancel { position: absolute; width: 56px; height: 56px; right: calc(max(30px, calc(env(safe-area-inset-right) + 14px)) + 146px); bottom: 150px; border-radius: 50%; background: rgba(239,68,68,0.35); border: 3px solid #fff; box-shadow: 0 0 0 2px var(--ink); display: flex; flex-direction: column; align-items: center; justify-content: center; color: #fff; font-weight: 900; font-size: 10px; transition: transform 0.1s; text-shadow: var(--ol1); }
#tCancel .gl { width: 20px; height: 20px; }
#tCancel.hot { background: rgba(239,68,68,0.92); transform: scale(1.15); }
.tbtn.on { transform: scale(0.92); filter: brightness(1.12); }
.tbtn.cd { filter: saturate(0.4) brightness(0.92); }
body.touch #hint { position: static; transform: none; max-width: calc(100% - 140px); min-width: 180px; font-size: 13px; padding: 5px 10px; }
body.touch #msgs { top: 76px; gap: 3px; } /* 분대 얼굴 아래부터 */
body.touch .toast { font-size: 12.5px; padding: 2px 11px 2px 4px; } body.touch .toast .ic { width: 22px; height: 22px; }
body.scr #touch, body.scr #hint, body.scr #menuBtn, body.scr #bar { display: none; }
#rotate { position: absolute; inset: 0; z-index: 6; background: rgba(191,231,255,0.97); color: var(--ink); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; pointer-events: auto; font-weight: 900; text-align: center; padding: 20px; }
#rotate .gl { width: 84px; height: 84px; }
#rotate button { min-height: 44px; padding: 10px 18px; border-radius: 14px; background: #fff; border: 3px solid var(--ink); font-weight: 900; box-shadow: 0 3px 0 var(--ink); }
body.touch .btn, body.touch .seg button { min-height: 44px; }

/* ── 낮은 화면 (가로 폰) ── */
@media (max-height: 520px) {
  .btn { padding: 7px 18px; font-size: 17px; min-height: 44px; } .panel { padding: 10px 14px; max-height: calc(100% - 56px); } .screen { gap: 7px; padding: 8px; }
  .screen.menu { padding-top: calc(var(--st) + 52px); }
  .ph { margin: -10px -14px 8px; padding: 5px 14px; font-size: 19px; }
  .topbar h1 { font-size: 21px; }
  .logo { font-size: clamp(34px, 8vw, 64px); }
  .screen.ttl { padding-bottom: 70px; }
  .screen.ttl:has(.mechip) { padding-top: 58px; } .screen.ttl:has(.mechip) .foot { display: none; }
  .btn.play { min-width: 180px; min-height: 60px; font-size: 25px; border-radius: 18px; padding: 6px 22px 6px 12px; } .btn.play .ic { width: 42px; height: 42px; }
  .side { top: calc(var(--st) + 60px); gap: 8px; } .sbtn { width: 66px; height: 66px; border-radius: 15px; } .sbtn .ic { width: 40px; height: 40px; } .sbtn b { font-size: 12px; }
  .mechip { min-height: 44px; } .mechip .av { width: 38px; height: 38px; }
  .modes { gap: 8px; } .mcard .mart { height: 76px; } .mcard .mart .ic { width: 66px; height: 66px; } .mcard b { font-size: 17px; margin-top: 2px; } .mcard .md { font-size: 12px; } .mcard { padding-bottom: 8px; }
  .stage { height: 58px; } .stage b { font-size: 21px; } .stage .stars .ic { width: 16px; height: 16px; } .stage .lk { width: 26px; height: 26px; } .stages { gap: 8px; }
  .stage .wd { width: 22px; height: 22px; top: -6px; right: -5px; } .stage .bossic { width: 26px; height: 26px; top: -7px; left: -5px; }
  .chips { margin-top: 8px; } .chip .ic { width: 20px; height: 20px; }
  .banner { font-size: clamp(30px, 6vw, 46px); padding: 2px 26px 5px; } .bigstars img { width: 46px; height: 46px; }
  .card { width: 150px; padding: 5px 7px 7px; flex-direction: row; flex-wrap: wrap; text-align: left; gap: 0 6px; } .card .cart { width: 38px; height: 38px; } .card b { flex: 1; font-size: 14px; align-self: center; } .card span { width: 100%; font-size: 11.5px; }
  .starwhy { margin-top: 3px; } .pick { margin: 6px 0 4px; } .pick .inl { width: 28px; height: 28px; }
  .mvp .mvpface { width: 50px; height: 50px; } .stats div { min-width: 62px; padding: 2px 4px; } .stats .ic { width: 24px; height: 24px; } .stats b { font-size: 17px; }
  .pt { width: 50px; height: 56px; border-radius: 12px; }
  body.touch #msgs { top: 70px; }
  .pill { height: 30px; font-size: 13px; padding: 0 6px; } .pill.clock { font-size: 15px; min-width: 50px; } .pill .mf { width: 22px; height: 22px; } .pill .ic { width: 22px; height: 22px; }
  .tabs button { padding: 2px 8px 2px 3px; font-size: 14px; } .tabs button .ti { width: 30px; height: 30px; }
  .tiles { --s: 66px; gap: 6px; } .tile .price { height: 18px; font-size: 11px; } .tile .price .ic { width: 15px; height: 15px; } .tile .role { width: 20px; height: 20px; } .tile .ck { min-width: 18px; height: 18px; font-size: 10px; }
  .detail { min-width: 170px; padding: 6px; gap: 4px; } .detail .dart { width: 84px; height: 84px; } .detail .dt b { font-size: 15px; } .detail .dt span { font-size: 12px; }
  .detail .inside { display: none; } .tile.wide b { font-size: 12.5px; }
  .cols { gap: 10px; } .mrow { padding: 4px 6px; margin-top: 6px; } .mic { width: 40px; height: 40px; } .mic .ic { width: 34px; height: 34px; }
  .lvb { min-width: 30px; height: 30px; font-size: 14px; }
  .prof .acct .note { font-size: 11.5px; line-height: 1.25; } .prof .col { gap: 5px; } .frow.who .lvb { display: none; }
  #emoPick .emo { width: 48px; height: 48px; }
}
@media (max-height: 380px) {
  #tThrow { width: 84px; height: 84px; bottom: 14px; }
  #tSkill { width: 58px; height: 58px; bottom: 106px; right: calc(max(30px, calc(env(safe-area-inset-right) + 14px)) + 54px); }
  #tScoop { width: 54px; height: 54px; bottom: 10px; right: calc(max(30px, calc(env(safe-area-inset-right) + 14px)) + 96px); }
  #tCancel { bottom: 100px; right: calc(max(30px, calc(env(safe-area-inset-right) + 14px)) + 128px); width: 50px; height: 50px; }
  .tbtn em { top: 5px; right: 8px; }
  body.touch #msgs { top: 66px; }
  .ph { font-size: 17px; } .topbar h1 { font-size: 19px; }
  .joy { width: 104px; height: 104px; } .pt { width: 46px; height: 52px; } #squad { gap: 4px; }
  .hud-top { gap: 3px; } .pill { height: 28px; padding: 0 5px; font-size: 12px; } .pill.team { padding: 0 3px; } .pill .mf { width: 19px; height: 19px; border-width: 1.5px; } .pill .ic { width: 20px; height: 20px; } .pill.clock { min-width: 46px; font-size: 14px; }
  .shop .note { display: none; } .panel.shop { padding: 6px; gap: 6px; } .detail { min-height: 44px; width: 140px; min-width: 140px; }
  .prof .note:not(.keep) { display: none; } .frow.who .av { width: 40px; height: 40px; } .statl span { flex-direction: row; gap: 3px; justify-content: center; padding: 2px; } .statl em { display: none; } .detail .dt small { font-size: 10px; } .detail .dart { width: 64px; height: 64px; }
  .tiles { --s: 56px; gap: 5px; } .tiles.cash .art { max-width: 76px; }
  .tabs button { font-size: 13px; }
  .mcard .mart { height: 62px; } .mcard .mart .ic { width: 54px; height: 54px; } .mcard .md { font-size: 11px; line-height: 1.2; }
  .banner { font-size: 30px; } .bigstars img { width: 38px; height: 38px; } .result .sub { font-size: 13px; }
  .mrow .mt b { font-size: 13px; } .lv { margin-bottom: 0; } .bar { height: 16px; }
  .statl .ic { width: 20px; height: 20px; } .statl b { font-size: 14px; } .acct .scarf { width: 40px; height: 40px; }
  .cards { gap: 6px; } .card { width: 140px; } .card span { font-size: 11px; }
  .detail.cashd .dart { display: none; } .hero .ic { width: 56px; height: 56px; } .go1 { margin-top: 6px; } .diff { margin-top: 4px; }
  .rwd { margin-top: 5px; gap: 4px; } .gchip { font-size: 13px; padding: 1px 8px 1px 2px; } .gchip .ic { width: 20px; height: 20px; } .pick { margin: 4px 0 3px; font-size: 14px; } .bigstars img { width: 34px; height: 34px; }
}
@media (max-height: 520px) and (orientation: landscape) {
  /* 오른쪽 위 버튼(언어·소리·전체 화면)을 세로로 세워 가운데 판과 겹치지 않게 */
  :root { --cornerW: 58px; }
  .corner { flex-direction: column; top: var(--st); right: var(--sr); }
  .screen:not(.menu):has(.corner) .panel:not(.bare) { max-width: calc(100vw - 132px); }
  .screen.menu:has(.corner) { padding-right: calc(var(--sr) + 58px); }
  .modes { grid-template-columns: repeat(4, minmax(0, 1fr)); width: calc(100vw - 140px); }
}
@media (max-height: 520px) and (max-width: 760px) and (orientation: landscape) {
  .mcard .md { display: none; } .tabs button span { display: none; } .tabs button { padding: 2px 6px; }
  .detail { min-width: 150px; width: 150px; } .detail .btn { padding: 4px 10px; font-size: 14px; }
}
@media (max-width: 620px) { #hud[data-kind="campaign"] .hud-top #stageL { display: none; } }
@media (orientation: portrait) {
  /* 세로: 위 가운데 칸은 분대 얼굴 아래로 */
  .hud-top { top: calc(max(6px, env(safe-area-inset-top)) + 74px); }
  body.touch #msgs { top: calc(max(6px, env(safe-area-inset-top)) + 116px); }
  body.touch #hint { max-width: 90%; }
  .stages { grid-template-columns: repeat(3, 1fr); }
  .modes { grid-template-columns: repeat(2, minmax(0, 170px)); }
  .cols { grid-template-columns: 1fr; }
  .shopbody { flex-direction: column; } .detail { width: auto; max-width: none; flex-direction: row; flex-wrap: wrap; } .detail .dart { width: 84px; height: 84px; } .tiles { --s: 76px; }
  .btn.play { right: 50%; transform: translateX(50%); } .btn.play:active { transform: translateX(50%) translateY(3px); }
  .screen.ttl { padding-bottom: 120px; }
  .tabs button span { display: none; } .tabs button { padding: 3px 8px; }
}
@media (orientation: portrait) and (max-width: 480px) {
  .topbar h1 { font-size: 20px; } .topbar .hs { display: none; } .res { font-size: 15px; } .statl { grid-template-columns: repeat(2, 1fr); }
  .res.top { top: calc(var(--st) + 56px); right: var(--sr); } .foot { display: none; }
  /* 좁은 세로: 이모트 고르기 판이 고른 아이 얼굴(노란 테두리)을 덮지 않게 얼굴 줄 아래로 */
  #emoPick { top: calc(max(6px, env(safe-area-inset-top)) + 84px); }
}
/* 큰 PC 화면: 경기 HUD를 조금 크게 */
@media (min-width: 1600px) and (min-height: 900px) { body:not(.touch) #hud, body:not(.touch) .screen { zoom: 1.3; } }
