/* 일부러 싸구려 밈 스타일. 임팩트 폰트 + 만화 그림자. */
:root {
  --ink: #0b0614;
  --paper: #fff8e7;
  --pink: #ff2a7a;
  --gold: #ffd21f;
  --cyan: #19e3e8;
  --green: #4dff6a;
  --red: #ff2d2d;
  --meme: Impact, "Arial Black", "Malgun Gothic", sans-serif;
  --ui: "Malgun Gothic", "Apple SD Gothic Neo", sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #12062e; color: var(--paper); font-family: var(--ui); }
#view { position: fixed; inset: 0; width: 100%; height: 100%; display: block; transition: filter .25s; }
#view.dead { filter: grayscale(1) contrast(1.25) brightness(.8); }

button { font: inherit; cursor: pointer; }
input { font: inherit; }

/* ------- 공용 패널 ------- */
.panelScreen { position: fixed; inset: 0; z-index: 20; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 16px; gap: 14px; pointer-events: none; }
.panelScreen > * { pointer-events: auto; }
.card { width: min(520px, 100%); background: var(--paper); color: var(--ink); border: 4px solid var(--ink); border-radius: 6px; box-shadow: 8px 8px 0 var(--pink); padding: 18px; display: flex; flex-direction: column; gap: 11px; }
.card h2 { margin: 6px 0 0; font: 400 22px var(--meme); letter-spacing: .5px; }
.card h3 { margin: 4px 0 0; font: 400 17px var(--meme); letter-spacing: .5px; }
.card label { font-weight: 800; font-size: 14px; display: flex; flex-direction: column; gap: 4px; }
.card input[type=text], .card input:not([type]) { width: 100%; min-width: 0; padding: 10px 11px; border: 3px solid var(--ink); border-radius: 4px; background: #fff; color: var(--ink); font-weight: 700; }
.card input:focus { outline: 3px solid var(--cyan); outline-offset: 1px; }
.row { display: flex; gap: 8px; align-items: stretch; }
.row > input { flex: 1; }
.primary { background: var(--pink); color: #fff; border: 3px solid var(--ink); border-radius: 4px; padding: 10px 16px; font: 400 19px var(--meme); letter-spacing: .5px; white-space: nowrap; box-shadow: 3px 3px 0 var(--ink); }
.primary:hover { filter: brightness(1.12); }
.primary:active { transform: translate(3px, 3px); box-shadow: none; }
.primary.big { padding: 15px; font-size: 26px; }
.primary.on { background: var(--green); color: var(--ink); }
.primary:disabled { opacity: .55; cursor: default; }
.ghost { background: #fff; color: var(--ink); border: 3px solid var(--ink); border-radius: 4px; padding: 8px 12px; font-weight: 800; font-size: 14px; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ghost:hover { background: var(--gold); }
.ghost:disabled { opacity: .5; cursor: default; }
:focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; }

/* ------- 로고 ------- */
.logo { text-align: center; pointer-events: none; }
.logo h1 { margin: 0; font: 400 clamp(46px, 9vw, 96px)/.95 var(--meme); color: #fff; -webkit-text-stroke: 3px #000; paint-order: stroke fill; text-shadow: 6px 6px 0 var(--pink); transform: rotate(-2deg); display: flex; gap: .25em; justify-content: center; flex-wrap: wrap; animation: logoWob 2.4s ease-in-out infinite; }
.logo h1 em { color: var(--gold); font-style: normal; }
.logo p { margin: 8px 0 0; font-weight: 900; font-size: 18px; color: #fff; text-shadow: 2px 2px 0 #000; }
@keyframes logoWob { 50% { transform: rotate(1.5deg) scale(1.03); } }

#roomList { display: flex; flex-direction: column; gap: 6px; max-height: 26vh; overflow-y: auto; }
.empty { margin: 4px 0; color: #5a5266; font-weight: 700; font-size: 14px; }
.roomRow { display: flex; justify-content: space-between; gap: 10px; background: #fff; border: 3px solid var(--ink); border-radius: 4px; padding: 10px 12px; font-weight: 800; color: var(--ink); text-align: left; }
.roomRow span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.roomRow em { font-style: normal; color: var(--pink); flex: none; }
.roomRow:hover:not(:disabled) { background: var(--gold); }
.roomRow:disabled { opacity: .55; cursor: default; }
.foot { display: flex; align-items: center; gap: 12px; font-size: 13px; color: #5a5266; font-weight: 700; flex-wrap: wrap; }
#ping { margin-right: auto; }
#connStatus.ok { color: #0a8a2a; }
#langPick { display: flex; border: 3px solid var(--ink); border-radius: 4px; overflow: hidden; }
#langPick button { border: 0; background: #fff; color: var(--ink); font-weight: 900; font-size: 13px; padding: 4px 10px; }
#langPick button + button { border-left: 3px solid var(--ink); }
#langPick button:hover { background: #fff1b8; }
#langPick button.on { background: var(--gold); }
.card label.vol { flex-direction: row; align-items: center; font-size: 14px; gap: 6px; }
.vol input { width: 96px; accent-color: var(--pink); }

/* ------- 대기실 ------- */
.roomLayout { flex-direction: row; justify-content: space-between; align-items: stretch; }
.side { width: min(370px, 42vw); max-height: 100%; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--ink) transparent; }
.side > * { flex-shrink: 0; }
.side > #chatLog { flex-shrink: 1; }
.side.right { box-shadow: -8px 8px 0 var(--cyan); }
.titleRow { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.titleRow h2 { margin: 0; font-size: 26px; line-height: 1.05; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.titleRow .iconBtn { flex: none; }

/* 그려 넣은 아이콘: 같은 굵기 선 */
.ico { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.iconBtn { width: 40px; height: 40px; display: grid; place-items: center; padding: 0; background: #fff; color: var(--ink); border: 3px solid var(--ink); border-radius: 4px; }
.iconBtn:hover:not(:disabled) { background: var(--gold); }
.iconBtn:disabled { opacity: .4; cursor: default; }

/* 자리: 큰 얼굴이 판 밖으로 살짝 튀어나온다 */
#slots { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 6px; padding-top: 6px; }
.slot { position: relative; display: flex; align-items: center; gap: 6px; padding: 4px 6px 4px 2px; border: 3px solid var(--ink); border-radius: 4px; background: #fff; min-width: 0; min-height: 54px; }
.slot.me { background: #fff1b8; }
.slot .face { flex: none; width: 50px; height: 50px; margin: -12px 0 -4px; display: grid; place-items: center; font: 400 26px var(--meme); color: #b3abc0; }
.slot .face .portrait { width: 58px; height: 58px; object-fit: contain; filter: drop-shadow(2px 2px 0 rgba(11, 6, 20, .25)); }
.slot.open { border-style: dashed; background: rgba(255, 255, 255, .5); }
.slot.open .face::before { content: "?"; }
.who { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.who strong { font: 400 16px/1.1 var(--meme); letter-spacing: .3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who small { display: flex; gap: 3px; color: #5a5266; font-weight: 700; font-size: 11px; white-space: nowrap; overflow: hidden; }
.tag { font-style: normal; font: 400 11px/1 var(--meme); letter-spacing: .5px; padding: 2px 4px 1px; border-radius: 2px; background: var(--ink); color: #fff; }
.tag.bot { background: #8c84a0; }
.tag.wins { background: var(--gold); color: var(--ink); }
.slotStamp { position: absolute; right: 4px; top: -13px; font: 400 11px/1 var(--meme); letter-spacing: .5px; padding: 3px 5px 2px; border: 2px solid var(--ink); border-radius: 2px; background: #fff; color: #7a7288; transform: rotate(4deg); }
.slot.ready .slotStamp { background: var(--green); color: var(--ink); transform: rotate(-5deg); }

#readyBtn { position: relative; }
.actions { align-items: center; }
.invite { flex: 1; display: flex; align-items: center; justify-content: center; gap: 7px; height: 40px; background: var(--cyan); color: var(--ink); border: 3px solid var(--ink); border-radius: 4px; font: 400 18px var(--meme); letter-spacing: .5px; box-shadow: 3px 3px 0 var(--ink); }
.invite:hover { filter: brightness(1.08); }
.invite:active { transform: translate(3px, 3px); box-shadow: none; }
.botPair { display: flex; align-items: center; border: 3px solid var(--ink); border-radius: 4px; background: #fff; overflow: hidden; flex: none; }
.botPair .iconBtn { border: 0; border-radius: 0; width: 36px; height: 34px; }
.botLabel { width: 30px; height: 34px; display: grid; place-items: center; border-inline: 3px solid var(--ink); background: #efeaf6; color: var(--ink); }

/* 고른 캐릭터: 어두운 판 위에 크게 */
#skinDesc { position: relative; margin: 0; min-height: 112px; display: grid; grid-template-columns: 104px 1fr; grid-template-rows: auto auto 1fr; column-gap: 10px; padding: 10px 12px 10px 4px; background: var(--ink); color: #efe9f7; border-radius: 4px; overflow: hidden; font-size: 12px; font-weight: 700; line-height: 1.35; }
#skinDesc::before { content: ""; position: absolute; left: -30px; top: -20px; width: 150px; height: 170px; background: var(--pink); transform: rotate(14deg); }
#skinDesc .descFace { position: relative; grid-row: 1 / span 3; width: 104px; height: 104px; object-fit: contain; align-self: center; animation: descIn .35s cubic-bezier(.16, 1, .3, 1); }
#skinDesc strong { position: relative; font: 400 28px/1 var(--meme); color: #fff; letter-spacing: .3px; -webkit-text-stroke: 1px #000; paint-order: stroke fill; text-shadow: 3px 3px 0 var(--pink); align-self: end; }
#skinDesc b { position: relative; display: flex; align-items: center; gap: 6px; margin-top: 5px; font: 400 17px/1.1 var(--meme); color: var(--gold); letter-spacing: .3px; }
#skinDesc kbd { font: 400 13px/1 var(--meme); padding: 3px 6px 2px; }
#skinDesc span { position: relative; margin-top: 4px; color: #cfc7dc; }
@keyframes descIn { from { transform: scale(.6) rotate(-8deg); opacity: .2; } }

/* 캐릭터 고르기: 얼굴만, 고른 것만 테두리 */
#skinPick { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.skinBtn { position: relative; border: 3px solid transparent; border-radius: 50%; background: #efe9dc; padding: 0; aspect-ratio: 1; display: grid; place-items: center; min-width: 0; overflow: hidden; }
.skinBtn .portrait { width: 118%; height: 118%; object-fit: contain; margin-top: 14%; transition: transform .18s cubic-bezier(.16, 1, .3, 1); }
.skinBtn .emojiFace { font-style: normal; font-size: 24px; }
.skinBtn:hover { background: #fff1b8; }
.skinBtn:hover .portrait { transform: translateY(-3px) scale(1.06); }
.skinBtn.on { background: var(--gold); border-color: var(--ink); box-shadow: 0 0 0 3px var(--pink); }
.skinBtn.on .portrait { transform: scale(1.08); }

/* 맵: 맵마다 색 띠, 이름은 임팩트 */
#mapPick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; }
.mapBtn { --m: #6b5c8a; position: relative; height: 46px; border: 3px solid var(--ink); border-radius: 4px; background: var(--m); padding: 2px 4px; display: grid; place-items: center; color: #fff; min-width: 0; overflow: hidden; }
.mapBtn::after { content: ""; position: absolute; inset: auto 0 0 0; height: 35%; background: rgba(11, 6, 20, .28); }
.mapBtn span { position: relative; z-index: 1; font: 400 13px/1.05 var(--meme); letter-spacing: .3px; -webkit-text-stroke: 2px var(--ink); paint-order: stroke fill; word-break: keep-all; text-shadow: 1px 1px 0 var(--ink); text-align: center; }
.mapBtn[data-map=ohio] { --m: #8a3ffc; }
.mapBtn[data-map=roof] { --m: #ff7a1a; }
.mapBtn[data-map=office] { --m: #c9a92c; }
.mapBtn[data-map=boat] { --m: #1f8fe0; }
.mapBtn[data-map=restroom] { --m: #22b3a5; }
.mapBtn[data-map=arena] { --m: #e8344a; }
.mapBtn[data-map=random] { background: repeating-linear-gradient(-45deg, var(--pink) 0 8px, var(--gold) 8px 16px); }
.mapBtn:hover:not(:disabled) { filter: brightness(1.12); }
.mapBtn.on { box-shadow: 0 0 0 3px var(--gold), 0 0 0 6px var(--ink); transform: rotate(-2deg); z-index: 1; }
.mapBtn:disabled { opacity: .6; cursor: default; }

#chatLog { flex: 1 1 60px; min-height: 60px; max-height: 32vh; overflow-y: auto; background: #fff; border: 3px solid var(--ink); border-radius: 4px; padding: 8px; font-size: 14px; display: flex; flex-direction: column; gap: 3px; overflow-wrap: anywhere; }
#chatForm .ghost, #renameForm .ghost { flex: none; }
.help { margin: 0; padding: 0; list-style: none; font-size: 12.5px; line-height: 1.5; color: #3d3549; display: flex; flex-direction: column; gap: 5px; }
.help b { display: inline-block; font: 400 12px/1 var(--meme); letter-spacing: .4px; padding: 3px 5px 2px; margin: 0 1px; background: #fff; color: var(--ink); border: 2px solid var(--ink); border-bottom-width: 3px; border-radius: 3px; }
::selection { background: var(--gold); color: var(--ink); }

@media (max-width: 780px) {
  .roomLayout { flex-direction: column; overflow-y: auto; justify-content: flex-start; }
  .side { width: 100%; max-height: none; overflow: visible; }
}

/* ------- 결과 ------- */
#result { background: rgba(10, 2, 26, .62); pointer-events: auto; }
.resultBox { width: min(1040px, 100%); text-align: center; }
#resultTitle { margin: 0; font: 400 clamp(48px, 9vw, 104px)/1 var(--meme); -webkit-text-stroke: 3px #000; paint-order: stroke fill; text-shadow: 6px 6px 0 var(--pink); animation: stamp .35s cubic-bezier(.2, 2, .4, 1); }
#result[data-outcome=win] #resultTitle { color: var(--gold); }
#result[data-outcome=lose] #resultTitle { color: #cfcfd8; text-shadow: 6px 6px 0 #333; }
#result[data-outcome=draw] #resultTitle { color: var(--cyan); }
#resultSub { font: 400 24px var(--meme); margin: 10px 0 18px; letter-spacing: 1px; }
#sixSevenBanner { display: inline-block; background: var(--gold); color: #000; padding: 6px 16px; font: 400 28px var(--meme); transform: rotate(-3deg); margin-bottom: 10px; border: 3px solid #000; animation: logoWob .5s infinite; }
#resultStats { display: flex; flex-direction: column; gap: 8px; width: min(720px, 100%); margin: 0 auto; text-align: left; }
.rankRow { display: grid; grid-template-columns: 44px 64px 1fr auto; align-items: center; gap: 10px; padding: 4px 16px 4px 10px; background: var(--paper); color: var(--ink); border: 4px solid var(--ink); border-radius: 6px; animation: rowIn .45s cubic-bezier(.16, 1, .3, 1) backwards; }
.rankRow:nth-child(2) { animation-delay: .08s; }
.rankRow:nth-child(3) { animation-delay: .16s; }
.rankRow:nth-child(4) { animation-delay: .24s; }
@keyframes rowIn { from { transform: translateX(-40px); opacity: 0; } }
.rankRow .rank { font: 400 40px/1 var(--meme); color: #b3abc0; text-align: center; }
.rankFace { width: 64px; height: 64px; object-fit: contain; margin: -10px 0 -6px; font-style: normal; font-size: 34px; display: grid; place-items: center; }
.rankRow .who strong { font-size: 24px; }
.rankRow .who small { display: block; font-size: 12px; color: #5a5266; white-space: normal; }
.rankRow .kills { text-align: center; line-height: 1; }
.rankRow .kills b { display: block; font: 400 44px/1 var(--meme); color: var(--pink); -webkit-text-stroke: 2px var(--ink); paint-order: stroke fill; font-variant-numeric: tabular-nums; }
.rankRow .kills small { font: 400 12px var(--meme); letter-spacing: .5px; color: #5a5266; }
.rankRow.winner { background: var(--gold); transform: scale(1.04); box-shadow: 8px 8px 0 var(--pink); margin-bottom: 6px; }
.rankRow.winner .rank { color: var(--ink); }
.rankRow.winner .rankFace { width: 84px; height: 84px; margin: -22px 0 -10px; animation: logoWob .8s ease-in-out infinite; }
.rankRow.me { outline: 3px dashed var(--cyan); outline-offset: 3px; }
#resultCountdown { margin-top: 16px; font-weight: 900; font-size: 18px; text-shadow: 1px 1px 0 #000; }

/* ------- HUD ------- */
#hud { position: fixed; inset: 0; z-index: 10; pointer-events: none; overflow: hidden; user-select: none; }
#hudGameLayer { position: absolute; inset: 0; }
.mem { font-family: var(--meme); }

#scoreBox { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 12px; background: rgba(0, 0, 0, .55); border: 3px solid #000; padding: 4px 14px; border-radius: 4px; max-width: 94vw; }
#scoreChips { display: flex; gap: 8px; min-width: 0; }
.chip { display: flex; align-items: center; gap: 5px; padding: 1px 7px; border-radius: 3px; min-width: 0; }
.chip.me { background: rgba(255, 210, 31, .24); box-shadow: inset 0 0 0 2px var(--gold); }
.chipFace { width: 24px; height: 24px; object-fit: contain; flex: none; font-style: normal; font-size: 16px; }
.chip span { font-weight: 900; font-size: 13px; max-width: 13vw; flex: 0 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip b { font: 400 32px/1.05 var(--meme); color: var(--pink); -webkit-text-stroke: 1.5px #000; paint-order: stroke fill; font-variant-numeric: tabular-nums; }
.chip.me b { color: var(--gold); }
#timerBox { flex: none; display: flex; flex-direction: column; align-items: center; line-height: 1.05; }
#timerBox small { font-size: 10px; font-weight: 800; color: #ddd; white-space: nowrap; }
#timerBox i { font: 400 20px var(--meme); font-style: normal; font-variant-numeric: tabular-nums; }

#killfeed { position: absolute; top: 12px; right: 12px; display: flex; flex-direction: column; gap: 4px; align-items: flex-end; max-width: 40vw; }
.feed { background: rgba(0, 0, 0, .7); padding: 4px 9px; border-radius: 3px; font-size: 13px; animation: feedIn .2s; }
.feed b { color: var(--gold); }
.feed b:last-child { color: var(--pink); }
@keyframes feedIn { from { transform: translateX(30px); opacity: 0; } }

#eventBanner { position: absolute; top: 82px; left: 50%; transform: translateX(-50%); background: var(--gold); color: #000; border: 3px solid #000; padding: 6px 16px; font-weight: 900; font-size: clamp(14px, 2.4vw, 22px); text-align: center; white-space: nowrap; max-width: 94vw; overflow: hidden; text-overflow: ellipsis; }
#eventBanner.stamp { animation: bannerIn .4s cubic-bezier(.2, 2, .4, 1); }
@keyframes bannerIn { from { transform: translateX(-50%) scale(2.4) rotate(6deg); opacity: 0; } }

/* 조준선 */
#crosshair { --gap: 10px; position: absolute; left: 50%; top: 50%; width: 0; height: 0; }
#crosshair i { position: absolute; background: #fff; box-shadow: 0 0 0 1px #000; transition: transform .05s linear; }
#crosshair i:nth-child(1), #crosshair i:nth-child(2) { width: 3px; height: 11px; left: -1.5px; }
#crosshair i:nth-child(3), #crosshair i:nth-child(4) { width: 11px; height: 3px; top: -1.5px; }
#crosshair i:nth-child(1) { bottom: var(--gap); }
#crosshair i:nth-child(2) { top: var(--gap); }
#crosshair i:nth-child(3) { right: var(--gap); }
#crosshair i:nth-child(4) { left: var(--gap); }
#hitmarker { position: absolute; left: 50%; top: 50%; width: 0; height: 0; opacity: 0; }
#hitmarker i { position: absolute; width: 16px; height: 3px; background: #fff; left: -8px; top: -1.5px; box-shadow: 0 0 0 1px #000; }
#hitmarker i:nth-child(1) { transform: rotate(45deg) translateX(15px); }
#hitmarker i:nth-child(2) { transform: rotate(135deg) translateX(15px); }
#hitmarker i:nth-child(3) { transform: rotate(225deg) translateX(15px); }
#hitmarker i:nth-child(4) { transform: rotate(315deg) translateX(15px); }
#hitmarker.head i { background: var(--red); }
#hitmarker.show { animation: fadeFast .22s ease-out; }
@keyframes fadeFast { from { opacity: 1; transform: scale(1.5); } to { opacity: 0; transform: scale(1); } }

#damageDir { --a: 0rad; position: absolute; left: 50%; top: 50%; width: 0; height: 0; opacity: 0; transform: rotate(var(--a)); }
#damageDir::before { content: ""; position: absolute; left: -46px; top: -190px; width: 92px; height: 34px; background: var(--red); clip-path: polygon(50% 0, 100% 100%, 0 100%); }
#damageDir.show { animation: fadeDir .75s ease-out; }
@keyframes fadeDir { from { opacity: .95; } to { opacity: 0; } }

#sixSeven { --x: 0px; position: absolute; left: calc(50% + 34px + var(--x)); top: calc(50% + 14px); font: 400 40px var(--meme); color: var(--gold); -webkit-text-stroke: 2px #000; paint-order: stroke fill; opacity: 0; }
#sixSeven.show { animation: sixPop .34s ease-out; }
@keyframes sixPop { from { opacity: 1; transform: scale(1.8); } to { opacity: 0; transform: translateY(-28px) scale(1); } }

#bigCount { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); font: 400 clamp(90px, 22vw, 260px)/1 var(--meme); color: var(--gold); -webkit-text-stroke: 5px #000; paint-order: stroke fill; text-shadow: 10px 10px 0 var(--pink); white-space: nowrap; }
#bigCount.stamp { animation: countIn .4s cubic-bezier(.2, 2, .4, 1); }
@keyframes countIn { from { transform: translate(-50%, -50%) scale(3) rotate(-14deg); opacity: 0; } }

#shout { position: absolute; left: 50%; top: 26%; transform: translateX(-50%); font: 400 clamp(26px, 5vw, 56px) var(--meme); -webkit-text-stroke: 2.5px #000; paint-order: stroke fill; white-space: nowrap; opacity: 0; color: var(--gold); }
#shout[data-tone=red] { color: var(--red); }
#shout.show { animation: shoutAnim 1.1s ease-out; }
@keyframes shoutAnim { 0% { opacity: 1; transform: translateX(-50%) scale(2) rotate(-5deg); } 16% { transform: translateX(-50%) scale(1) rotate(-2deg); opacity: 1; } 70% { opacity: 1; } 100% { opacity: 0; transform: translateX(-50%) translateY(-30px) rotate(-2deg); } }

#auraPops { position: absolute; left: 92px; bottom: 150px; display: flex; flex-direction: column-reverse; gap: 2px; align-items: flex-start; }
.aurapop { --r: 0deg; font: 400 clamp(24px, 3.4vw, 38px)/1.05 var(--meme); -webkit-text-stroke: 2px #000; paint-order: stroke fill; animation: auraUp 1.5s ease-out forwards; transform-origin: left center; }
.aurapop small { display: block; font: 900 14px var(--ui); -webkit-text-stroke: 0; color: #fff; text-shadow: 1px 1px 0 #000; }
.aurapop.up { color: var(--gold); }
.aurapop.down { color: var(--red); }
@keyframes auraUp { 0% { transform: scale(1.8) rotate(var(--r)); opacity: 1; } 16% { transform: scale(1) rotate(var(--r)); opacity: 1; } 75% { opacity: 1; } 100% { transform: translateY(-40px) rotate(var(--r)); opacity: 0; } }

/* 눈깔 */
.bigeye { position: absolute; border-radius: 50%; background: radial-gradient(circle at 42% 38%, #fff 0 52%, #ffd6d6 74%, #ff5a5a 100%); border: 5px solid #000; overflow: hidden; }
.bigeye u { position: absolute; left: 50%; top: 50%; width: 36%; height: 36%; transform: translate(-50%, -50%); background: radial-gradient(circle at 36% 34%, #fff 0 12%, #000 14%); border-radius: 50%; }
#bigEyes { position: absolute; inset: 0; opacity: 0; }
#bigEyes .bigeye { width: 26vmin; height: 26vmin; bottom: -8vmin; }
#bigEyes .l { left: -5vmin; }
#bigEyes .r { right: -5vmin; }
#bigEyes.pop { animation: eyesFade .55s ease-out; }
#bigEyes.pop .bigeye { animation: eyeSpring .55s cubic-bezier(.3, 2.2, .5, 1); }
#bigEyes.big .bigeye { width: 44vmin; height: 44vmin; bottom: -6vmin; }
#bigEyes.big.pop { animation-duration: .85s; }
#bigEyes.big.pop .bigeye { animation-duration: .85s; }
@keyframes eyesFade { 0%, 60% { opacity: 1; } 100% { opacity: 0; } }
@keyframes eyeSpring { 0% { transform: translateY(70%) scale(.3); } 45% { transform: translateY(-12%) scale(1.12) rotate(7deg); } 72% { transform: translateY(4%) scale(.96) rotate(-6deg); } 100% { transform: none; } }

#vignette { position: absolute; inset: 0; opacity: 0; background: radial-gradient(ellipse at center, transparent 45%, rgba(255, 0, 40, .75) 100%); }
#vignette.hurt { animation: fadeDir .5s ease-out; }

/* 바 */
#hudFace { position: absolute; left: 12px; bottom: 36px; width: 84px; height: 84px; z-index: 1; filter: drop-shadow(2px 3px 0 rgba(0, 0, 0, .75)); }
.hudPortrait { width: 100%; height: 100%; object-fit: contain; font-style: normal; font-size: 54px; }
#vitals { position: absolute; left: 92px; bottom: 44px; width: min(320px, 40vw); display: flex; flex-direction: column; gap: 5px; }
.bar { position: relative; height: 28px; background: rgba(0, 0, 0, .65); border: 3px solid #000; border-radius: 3px; overflow: hidden; }
.bar > div { position: absolute; inset: 0 auto 0 0; transition: width .12s linear; }
.bar span { position: absolute; inset: 0; display: flex; align-items: center; padding-left: 8px; font-weight: 900; font-size: 13px; text-shadow: 1px 1px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000; white-space: nowrap; }
.bar.hp > div { background: linear-gradient(#55ff7a, #12b83b); }
.bar.hp > div.low { background: linear-gradient(#ff6a6a, #d40000); }
.bar.aura > div { background: linear-gradient(#ffe45c, #ff9d00); }
.bar.aura > div.full { background: repeating-linear-gradient(60deg, #ffe45c 0 14px, #fff 14px 28px); }
.bar.jolt { animation: jolt .22s; }
@keyframes jolt { 25% { transform: translateX(-6px) rotate(-1deg); } 75% { transform: translateX(5px) rotate(1deg); } }
#ultraReady { font: 400 22px var(--meme); color: var(--gold); -webkit-text-stroke: 1.5px #000; paint-order: stroke fill; animation: logoWob .5s infinite; }

#weaponBox { position: absolute; right: 20px; bottom: 44px; text-align: right; }
#weaponName { font-weight: 900; font-size: 18px; text-shadow: 2px 2px 0 #000; display: inline-block; }
#weaponName.wobble { animation: jolt .25s; }
#ammo { font: 400 44px/1 var(--meme); color: #fff; -webkit-text-stroke: 2px #000; paint-order: stroke fill; font-variant-numeric: tabular-nums; }
#reloadText { color: var(--cyan); font-weight: 900; text-shadow: 1px 1px 0 #000; animation: jolt .25s infinite; }

#keys { position: absolute; right: 20px; top: 120px; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; font-size: 12px; font-weight: 700; color: #fff; text-shadow: 1px 1px 0 #000; opacity: .82; animation: keysAway .8s ease-out 14s forwards; }
@keyframes keysAway { to { opacity: .2; } }
kbd { background: #fff; color: #000; border-radius: 3px; padding: 0 5px; font-family: inherit; font-weight: 900; text-shadow: none; }

#ticker { position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: center; gap: 10px; background: var(--red); color: #fff; font-weight: 900; font-size: 13px; padding: 0 12px 0 0; height: 26px; white-space: nowrap; overflow: hidden; border-top: 3px solid #000; }
#ticker b { align-self: stretch; display: grid; place-items: center; padding: 0 10px; background: #fff; color: var(--red); font: 400 15px var(--meme); letter-spacing: 1px; }

/* 킬 컷인 */
#killCut { position: absolute; left: 50%; bottom: 14%; width: min(44vmin, 420px); height: min(44vmin, 420px); transform: translateX(-50%); }
#killCut .lines { position: absolute; inset: -30%; background: repeating-conic-gradient(from 0deg, rgba(255, 210, 31, .95) 0 6deg, transparent 6deg 16deg); border-radius: 50%; -webkit-mask: radial-gradient(circle, #000 0 42%, transparent 70%); mask: radial-gradient(circle, #000 0 42%, transparent 70%); animation: spin .6s linear infinite; }
.cutface { position: absolute; inset: 14%; background: var(--gold); border: 6px solid #000; border-radius: 50%; }
.cutface .bigeye { width: 46%; height: 46%; top: 12%; }
.cutface .l { left: 4%; }
.cutface .r { right: 4%; }
.cutmouth { position: absolute; left: 30%; right: 30%; top: 66%; height: 24%; background: #300; border: 5px solid #000; border-radius: 40% 40% 60% 60%; }
#killCut.play .cutface { animation: eyeSpring .4s cubic-bezier(.3, 2.2, .5, 1); }
#killCut.play .bigeye { animation: eyeOut .6s cubic-bezier(.3, 2.4, .5, 1) forwards; }
#killCut.head .cutface { background: var(--pink); }
@keyframes eyeOut { 0% { transform: scale(.5); } 100% { transform: scale(1.5); } }
@keyframes spin { to { transform: rotate(360deg); } }
#killCutText { position: absolute; left: 50%; bottom: -18px; transform: translateX(-50%) rotate(-4deg); font: 400 clamp(30px, 5vw, 58px)/1 var(--meme); color: #fff; -webkit-text-stroke: 3px #000; paint-order: stroke fill; white-space: nowrap; }

/* 사망 */
#death { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; padding: 16px; }
#death h2 { margin: 0; font: 400 clamp(52px, 12vw, 140px)/1 var(--meme); color: var(--red); -webkit-text-stroke: 4px #000; paint-order: stroke fill; transform: rotate(-3deg); animation: countInFlat .35s cubic-bezier(.2, 2, .4, 1); overflow-wrap: anywhere; }
@keyframes countInFlat { from { transform: scale(3) rotate(-12deg); opacity: 0; } }
#death p { margin: 0; font-weight: 900; font-size: 19px; text-shadow: 2px 2px 0 #000; }
#death small { font-weight: 700; text-shadow: 1px 1px 0 #000; }
.respawn { width: min(320px, 70vw); height: 12px; border: 3px solid #000; background: rgba(0, 0, 0, .6); margin-top: 8px; }
#deathBar { height: 100%; background: var(--gold); width: 100%; }

/* 고양이 */
#claws { position: absolute; inset: 0; overflow: hidden; }
#claws i { --r: 0deg; position: absolute; width: 170px; height: 150px; transform: rotate(var(--r)); background:
  linear-gradient(100deg, transparent 46%, #d4001a 47% 51%, transparent 52%) 0 0 / 34% 100% no-repeat,
  linear-gradient(100deg, transparent 46%, #ff2d44 47% 52%, transparent 53%) 50% 0 / 34% 100% no-repeat,
  linear-gradient(100deg, transparent 46%, #d4001a 47% 51%, transparent 52%) 100% 0 / 34% 100% no-repeat;
  animation: clawIn 1.1s ease-out forwards; }
@keyframes clawIn { 0% { clip-path: inset(0 0 100% 0); opacity: 1; } 12% { clip-path: inset(0); opacity: 1; } 60% { opacity: .9; } 100% { clip-path: inset(0); opacity: 0; } }
#grabFace { position: absolute; left: 50%; top: 50%; font-size: min(74vmin, 620px); line-height: 1; transform: translate(-50%, -50%); opacity: .5; animation: jolt .14s infinite; }

/* 리즈 매혹 */
#charmFx { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: min(50vmin, 420px); background: radial-gradient(ellipse at center, transparent 35%, rgba(255, 40, 150, .6) 100%); opacity: .75; animation: charmBeat .5s ease-in-out infinite alternate; }
@keyframes charmBeat { to { font-size: min(58vmin, 480px); } }

/* 칠가이: 세상이 느려진다 */
#slowFx { position: absolute; inset: 0; background: radial-gradient(ellipse at center, transparent 40%, rgba(90, 170, 255, .55) 100%); }

/* 오펜하이머 */
#nukeFlash { position: absolute; inset: 0; background: #fff; opacity: 0; }
#nukeFlash.show { animation: nukeFlash 2.4s ease-out; }
@keyframes nukeFlash { 0%, 22% { opacity: 1; background: #fff; } 45% { opacity: .75; background: #ffcc80; } 100% { opacity: 0; background: #ff8a3c; } }
#oppen .bar-top, #oppen .bar-bottom { position: absolute; left: 0; right: 0; background: #000; animation: barIn .5s ease-out; }
#oppen .bar-top { top: 0; height: 13vh; }
#oppen .bar-bottom { bottom: 0; height: 17vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 0 16px; text-align: center; }
#oppen p { margin: 0; font-family: Georgia, "Batang", serif; font-size: clamp(16px, 2.6vw, 30px); color: #f6e7c8; letter-spacing: .04em; }
#oppen small { color: #ffb347; font-weight: 800; font-size: 14px; }
@keyframes barIn { from { transform: scaleY(0); } }

/* 각성 */
#ultraFrame { --u: #ffc800; position: absolute; inset: 0; box-shadow: inset 0 0 70px 12px color-mix(in srgb, var(--u) 62%, transparent); animation: ultraPulse .35s ease-in-out infinite alternate; }
#ultraTimeBox { position: absolute; top: 112px; left: 50%; width: min(240px, 50vw); height: 9px; transform: translateX(-50%); background: rgba(0, 0, 0, .65); border: 2px solid #000; border-radius: 2px; overflow: hidden; }
#ultraTime { width: 100%; height: 100%; background: var(--u); transform-origin: left; }
#ultraFrame span { position: absolute; top: 72px; left: 50%; transform: translateX(-50%); font: 400 30px var(--meme); color: var(--u); -webkit-text-stroke: 2px #000; paint-order: stroke fill; white-space: nowrap; }
@keyframes ultraPulse { to { box-shadow: inset 0 0 110px 24px color-mix(in srgb, var(--u) 72%, transparent); } }

#lockHint { position: absolute; left: 50%; top: 72%; transform: translateX(-50%); background: var(--paper); color: #000; border: 4px solid #000; box-shadow: 6px 6px 0 var(--pink); padding: 12px 22px; text-align: center; display: flex; flex-direction: column; animation: logoWob 1s infinite; }
#lockHint b { font: 400 30px var(--meme); }
#lockHint small { font-weight: 700; }

#rain { position: absolute; inset: 0; overflow: hidden; }
#rain span { position: absolute; top: -90px; font-family: var(--meme); color: var(--gold); -webkit-text-stroke: 2px #000; paint-order: stroke fill; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(calc(100vh + 120px)) rotate(420deg); } }

#toast { position: fixed; left: 50%; bottom: 40px; transform: translateX(-50%); z-index: 40; background: #000; color: #fff; padding: 10px 16px; border-radius: 4px; font-weight: 800; max-width: 90vw; }

@media (max-width: 760px), (max-height: 520px) {
  #keys { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .logo h1, #lockHint, #ultraReady, #sixSevenBanner, #ultraFrame, .card, #skinDesc .descFace, .statCol.winner .statFace { animation: none; }
}

/* ------- 마감 ------- */
::selection { background: var(--pink); color: #fff; }
input { caret-color: var(--pink); }
input::placeholder { color: #6d6578; opacity: 1; }
* { scrollbar-width: thin; scrollbar-color: var(--ink) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--ink); border: 2px solid var(--paper); border-radius: 5px; }
::-webkit-scrollbar-track { background: transparent; }

/* 화면이 뜰 때 쿵 하고 놓인다 */
.card { animation: cardIn .42s cubic-bezier(.16, 1, .3, 1) backwards; }
.side.right { animation-delay: .06s; }
@keyframes cardIn { from { transform: translateY(22px) rotate(-1.2deg) scale(.97); opacity: 0; } }

/* 버튼: 올라오고, 누르면 그림자로 내려앉는다 */
.primary, .ghost, .roomRow, .skinBtn, .mapBtn { transition: transform .12s cubic-bezier(.16, 1, .3, 1), box-shadow .12s cubic-bezier(.16, 1, .3, 1), background-color .12s; }
.primary:hover:not(:disabled) { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
.primary:active:not(:disabled) { transform: translate(3px, 3px); box-shadow: none; transition-duration: .04s; }
.ghost:hover:not(:disabled), .roomRow:hover:not(:disabled), .skinBtn:hover, .mapBtn:hover:not(:disabled) { transform: translate(-1px, -1px); box-shadow: 2px 2px 0 var(--ink); }
.ghost:active:not(:disabled), .roomRow:active:not(:disabled), .skinBtn:active, .mapBtn:active:not(:disabled) { transform: translate(1px, 1px); box-shadow: none; transition-duration: .04s; }
.skinBtn.on, .mapBtn.on { box-shadow: 2px 2px 0 var(--ink); transform: translate(-1px, -1px); }
.primary.on { animation: readyPop .3s cubic-bezier(.2, 2, .4, 1); }
@keyframes readyPop { from { transform: scale(.92); } }
.slot { transition: background-color .15s; }
.skinBtn { padding: 3px 2px 5px; }

/* 전체 화면 길이에서 대기실 카드가 넘치지 않게 */
#chatLog { scrollbar-gutter: stable; }
body.noChat .chatBit { display: none; }
#adBlock { position: fixed; inset: 0; z-index: 9999; }
#adBlock[hidden] { display: none; }
.feed { border: 2px solid #000; }
#ticker { letter-spacing: .2px; }

@media (max-width: 780px) {
  #hudFace { width: 58px; height: 58px; left: 6px; bottom: 40px; }
  #vitals { left: 62px; width: 44vw; }
  #auraPops { left: 62px; }
  .chipFace { display: none; }
}

/* ------- 진행: 레벨, 코인, 미션, 보상 ------- */
.coin { width: 18px; height: 18px; flex: none; fill: var(--gold); stroke: var(--ink); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.coin path { fill: none; }
#profileBar { display: flex; align-items: center; gap: 8px; }
#profileBar .lv { font: 400 18px/1 var(--meme); background: var(--ink); color: var(--gold); padding: 4px 7px 3px; border-radius: 3px; white-space: nowrap; }
.xp { flex: 1; height: 12px; border: 3px solid var(--ink); border-radius: 3px; background: #fff; overflow: hidden; }
.xp i { display: block; height: 100%; background: repeating-linear-gradient(-45deg, var(--pink) 0 6px, #ff5c9b 6px 12px); transition: width 1.1s cubic-bezier(.16, 1, .3, 1); }
.coins { display: flex; align-items: center; gap: 4px; font: 400 18px/1 var(--meme); }
#missions { display: flex; flex-direction: column; gap: 4px; }
.mission { position: relative; display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 8px; padding: 6px 8px; border: 3px solid var(--ink); border-radius: 4px; background: #fff; overflow: hidden; font-size: 12.5px; font-weight: 800; }
.mission > i { position: absolute; inset: 0 auto 0 0; background: #fff1b8; z-index: 0; }
.mission > * { position: relative; }
.mission small { font-weight: 800; color: #5a5266; font-variant-numeric: tabular-nums; }
.mission b { display: flex; align-items: center; gap: 3px; font: 400 15px/1 var(--meme); }
.mission b .coin { width: 15px; height: 15px; }
.mission.done { background: #c7ffd1; }
.mission.done > i { background: transparent; }
.mission.done span { text-decoration: line-through; text-decoration-thickness: 2px; }
.skinBtn.locked { background: #d9d3e3; cursor: default; }
.skinBtn.locked .portrait { filter: grayscale(1) brightness(.55) contrast(1.2); }
.skinBtn.locked em { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; color: #fff; font: 400 14px/1 var(--meme); -webkit-text-stroke: 2px var(--ink); paint-order: stroke fill; font-style: normal; }
.skinBtn.locked em .ico { width: 18px; height: 18px; stroke: #fff; filter: drop-shadow(1px 1px 0 var(--ink)); }
.skinBtn.locked:hover { background: #d9d3e3; }
.skinBtn.locked:hover .portrait { transform: none; }

#reward { width: min(720px, 100%); margin: 14px auto 0; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.gain { display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px 14px; background: var(--ink); border-radius: 6px; animation: rowIn .45s .3s cubic-bezier(.16, 1, .3, 1) backwards; }
.gain b { display: flex; align-items: center; gap: 5px; font: 400 22px/1 var(--meme); white-space: nowrap; }
.gain .c { color: var(--gold); }
.gain .c .coin { width: 22px; height: 22px; }
.gain .x { color: #fff; }
.gain .lv { font: 400 18px/1 var(--meme); color: var(--cyan); white-space: nowrap; }
.gain .xp { border-color: #fff; }
.note { margin: 0; display: flex; align-items: center; gap: 8px; font: 400 20px/1.1 var(--meme); color: #fff; -webkit-text-stroke: 1px #000; paint-order: stroke fill; text-shadow: 2px 2px 0 #000; animation: stamp .35s .6s cubic-bezier(.2, 2, .4, 1) backwards; }
.note.up { font-size: 34px; color: var(--gold); text-shadow: 4px 4px 0 var(--pink); }
.note.done { color: #c7ffd1; font-size: 17px; }
.noteFace { width: 44px; height: 44px; object-fit: contain; }
@keyframes stamp { from { transform: scale(2.2) rotate(-6deg); opacity: 0; } }

/* ------- 상점 ------- */
.shopBtn { display: flex; align-items: center; gap: 6px; padding: 3px 8px 3px 5px; background: var(--gold); color: var(--ink); border: 3px solid var(--ink); border-radius: 4px; box-shadow: 2px 2px 0 var(--ink); }
.shopBtn .lbl { font: 400 15px/1 var(--meme); letter-spacing: .4px; }
.shopBtn:hover { filter: brightness(1.08); }
.shopBtn:active { transform: translate(2px, 2px); box-shadow: none; }
#shop { z-index: 40; background: rgba(10, 2, 26, .55); pointer-events: auto; }
.shopCard { width: min(560px, 100%); max-height: 100%; overflow-y: auto; box-shadow: 8px 8px 0 var(--gold); }
.shopCard .titleRow h2 { flex: 1; font-size: 30px; }
#shopCoins { font-size: 22px; }
#shopTabs { display: flex; gap: 6px; }
#shopTabs button { flex: 1; padding: 7px; background: #fff; color: var(--ink); border: 3px solid var(--ink); border-radius: 4px; font: 400 18px var(--meme); letter-spacing: .5px; }
#shopTabs button[aria-selected=true] { background: var(--ink); color: var(--gold); }
#shopGrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.item { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 4px 8px; background: #fff; color: var(--ink); border: 3px solid var(--ink); border-radius: 4px; min-width: 0; }
.item img { width: 100%; max-width: 140px; aspect-ratio: 1; object-fit: contain; background: radial-gradient(circle at 50% 60%, #fff1b8 0 45%, transparent 46%); transition: transform .18s cubic-bezier(.16, 1, .3, 1); }
.item:hover img { transform: translateY(-3px) scale(1.04); }
.item strong { font: 400 16px/1.1 var(--meme); letter-spacing: .3px; text-align: center; }
.item .price { display: flex; align-items: center; gap: 4px; font: 400 16px/1 var(--meme); }
.item .price .coin { width: 16px; height: 16px; }
.item.poor .price { color: #a39cb0; }
.item.owned .price { color: #5a5266; font-size: 13px; }
.item.on { background: var(--gold); box-shadow: 0 0 0 3px var(--pink); }
.item.on .price { background: var(--ink); color: var(--green); padding: 3px 7px 2px; border-radius: 2px; font-size: 13px; }
.shopNote { margin: 0; font-size: 12px; font-weight: 700; color: #5a5266; text-align: center; }
@media (max-width: 480px) { #shopGrid { grid-template-columns: repeat(2, 1fr); } }

/* ------- 모드 ------- */
#modePick { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
.modeBtn { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 6px 8px; text-align: left; background: #fff; color: var(--ink); border: 3px solid var(--ink); border-radius: 4px; min-width: 0; }
.modeBtn strong { font: 400 17px/1 var(--meme); letter-spacing: .3px; }
.modeBtn small { font-size: 11px; font-weight: 700; line-height: 1.25; color: #5a5266; }
.modeBtn:hover:not(:disabled) { background: #fff1b8; }
.modeBtn.on { background: var(--ink); color: #fff; box-shadow: 3px 3px 0 var(--pink); }
.modeBtn.on small { color: #cfc7dc; }
.modeBtn[data-mode=rush].on strong { color: var(--gold); }
.modeBtn:disabled { opacity: .6; cursor: default; }

/* ------- 휴대폰 조작 ------- */
#touchUi, #rotateHint { display: none; }
body.touch.playing #touchUi { display: block; position: fixed; inset: 0; z-index: 15; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
body.touch { touch-action: manipulation; }
body.touch #keys, body.touch #lockHint { display: none !important; }
#lookZone { position: absolute; inset: 0 0 0 40%; }
#moveZone { position: absolute; inset: 22% 60% 0 0; }
#stick { position: absolute; width: 120px; height: 120px; margin: -60px 0 0 -60px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, .7); background: rgba(11, 6, 20, .25); pointer-events: none; }
#stick i { position: absolute; left: 50%; top: 50%; width: 52px; height: 52px; margin: -26px 0 0 -26px; border-radius: 50%; background: rgba(255, 255, 255, .85); border: 3px solid var(--ink); }
.tb { position: absolute; display: grid; place-items: center; width: 58px; height: 58px; padding: 0; border-radius: 50%; border: 3px solid var(--ink); background: rgba(255, 248, 231, .82); color: var(--ink); touch-action: none; }
.tb .ico { width: 26px; height: 26px; }
.tb b { font: 400 24px/1 var(--meme); }
.tb.down { transform: scale(.9); background: var(--gold); }
.tb.fire { right: 22px; bottom: 64px; width: 92px; height: 92px; background: rgba(255, 42, 122, .9); color: #fff; }
.tb.fire .ico { width: 40px; height: 40px; }
.tb.jump { right: 128px; bottom: 40px; }
.tb.dash { right: 196px; bottom: 60px; }
.tb.slap { right: 132px; bottom: 112px; }
.tb.swap { right: 32px; bottom: 170px; width: 48px; height: 48px; }
.tb.zoom { right: 88px; bottom: 182px; width: 48px; height: 48px; }
.tb.zoom.on { background: var(--cyan); }
.tb.ultra { right: 196px; bottom: 132px; opacity: .55; }
.tb.ultra.ready { opacity: 1; background: var(--gold); box-shadow: 0 0 0 4px var(--pink); animation: logoWob .6s ease-in-out infinite; }
.tb.farm { left: 22px; top: 96px; width: 48px; height: 48px; }
body.touch #weaponBox { top: 64px; bottom: auto; right: 16px; transform: scale(.7); transform-origin: right top; }
@media (orientation: portrait) {
  body.touch.playing #rotateHint { display: grid; place-items: center; position: fixed; inset: 0; z-index: 60; background: rgba(10, 2, 26, .92); }
  #rotateHint b { font: 400 30px var(--meme); color: var(--gold); text-align: center; padding: 0 24px; }
}

/* ------- 첫 화면: 큰 플레이 버튼 하나 ------- */
.homeLayout { justify-content: space-between; padding: 4vh 16px 3vh; }
.homeMain { width: min(420px, 100%); display: flex; flex-direction: column; align-items: stretch; gap: 10px; }
.nameTag { display: flex; flex-direction: column; background: #fff; border: 4px solid var(--ink); border-radius: 6px; overflow: hidden; transform: rotate(-1.5deg); box-shadow: 5px 5px 0 var(--ink); align-self: center; width: 78%; }
.nameTag span { background: var(--pink); color: #fff; font: 400 15px/1 var(--meme); letter-spacing: 1.5px; text-align: center; padding: 5px 0 4px; text-transform: uppercase; }
.nameTag input { border: 0; padding: 8px 10px 9px; font: 400 26px/1 var(--meme); text-align: center; color: var(--ink); background: #fff; min-width: 0; }
.nameTag input::placeholder { color: #b3abc0; }
.nameTag input:focus { outline: none; background: #fff8d6; }
.mega { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 16px 10px; border-width: 4px; border-radius: 6px; box-shadow: 6px 6px 0 var(--ink); }
.mega b { font: 400 clamp(40px, 7vw, 58px)/1 var(--meme); letter-spacing: 1px; -webkit-text-stroke: 2px var(--ink); paint-order: stroke fill; text-shadow: 3px 3px 0 var(--ink); }
.mega small { font-weight: 900; font-size: 15px; letter-spacing: .3px; color: #fff; text-shadow: 1px 1px 0 var(--ink); }
.mega:active { transform: translate(6px, 6px); box-shadow: none; }
.homeSub { display: flex; gap: 8px; }
.homeSub > .ghost { flex: 1; padding: 10px 12px; font-size: 15px; box-shadow: 3px 3px 0 var(--ink); }
#joinRow { display: flex; gap: 0; flex: 1; }
#joinRow:not([hidden]) { display: flex; }
#joinRow input { flex: 1; min-width: 0; width: 100%; padding: 8px 10px; border: 3px solid var(--ink); border-right: 0; border-radius: 4px 0 0 4px; font: 400 18px var(--meme); letter-spacing: 2px; text-transform: uppercase; color: var(--ink); background: #fff; }
#joinRow input::placeholder { letter-spacing: .5px; text-transform: none; font: 700 14px var(--ui); color: #8c84a0; }
#joinRow .iconBtn { border-radius: 0 4px 4px 0; height: auto; background: var(--cyan); }
.roomsBox { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); width: min(300px, 40vw); padding: 12px; box-shadow: 6px 6px 0 var(--cyan); }
.roomsBox h2 { margin: 0; }
.homeFoot { position: absolute; left: 16px; bottom: 16px; width: auto; padding: 6px 10px; box-shadow: 4px 4px 0 var(--pink); }
.homeFoot .foot { gap: 10px; }
@media (max-width: 760px) {
  .roomsBox { position: static; transform: none; width: min(420px, 100%); }
  .homeFoot { position: static; }
  .homeLayout { justify-content: flex-start; overflow-y: auto; }
}
.homeFoot #connStatus.ok, .homeFoot #ping { display: none; }

/* ------- 저격 조준경 ------- */
#scope { display: none; position: fixed; inset: 0; z-index: 4; pointer-events: none;
  background: radial-gradient(circle at 50% 50%, transparent 0 min(36vh, 36vw), rgba(5, 2, 12, .55) calc(min(36vh, 36vw) + 1px), #07030f calc(min(36vh, 36vw) + 10px)); }
#scope::before, #scope::after { content: ''; position: absolute; left: 50%; top: 50%; background: #07030f; }
#scope::before { width: min(72vh, 72vw); height: 2px; transform: translate(-50%, -50%); }
#scope::after { width: 2px; height: min(72vh, 72vw); transform: translate(-50%, -50%); }
#scope i { position: absolute; left: 50%; top: 50%; width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%; background: #ff2a6d; box-shadow: 0 0 0 2px #07030f; }
body.scoped #scope { display: block; }
body.scoped #crosshair, body.scoped .crosshair { visibility: hidden; }

/* ------- 무기 고르기 ------- */
#loadoutPick { display: flex; flex-direction: column; gap: 6px; }
.wRow { display: grid; grid-template-columns: 22px 1fr 1fr; gap: 6px; }
.wSlot { grid-row: span 2; display: grid; place-items: center; width: 22px; font: 400 18px var(--meme); color: #fff; background: var(--ink); border-radius: 4px; }
.wBtn { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 6px 7px; border: 3px solid var(--ink); border-radius: 4px; background: #fff; color: var(--ink); text-align: left; box-shadow: 2px 2px 0 var(--ink); }
.wBtn strong { font: 800 12px/1.1 var(--ui); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.wBtn.on { background: var(--gold); transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--pink); }
.wBtn:disabled { opacity: .55; }
.wBars { display: flex; gap: 3px; width: 100%; }
.wBars i { flex: 1; height: 5px; border-radius: 2px; background: linear-gradient(90deg, var(--ink) calc(var(--v) * 100%), rgba(11, 6, 20, .15) 0); }
.mapBtn[data-map=school] { --m: #4fae5f; }
.mapBtn[data-map=mart] { --m: #2f6fd6; }

/* ------- 6인 데스매치: 킬피드는 점수판 아래로, 키 안내는 오른쪽 아래로 ------- */
#killfeed { top: 72px; }
#keys { top: auto; bottom: 150px; }
/* Tab 점수판 */
#board { position: absolute; left: 50%; top: 16%; transform: translateX(-50%); width: min(460px, 92vw); padding: 10px 12px 12px; background: var(--paper); color: var(--ink); border: 4px solid var(--ink); border-radius: 6px; box-shadow: 8px 8px 0 var(--pink); z-index: 6; }
#board .bHead { display: grid; grid-template-columns: 1fr 44px 44px; align-items: end; padding: 0 6px 6px; border-bottom: 3px solid var(--ink); font: 400 22px/1 var(--meme); }
#board .bHead b { text-align: center; font: 400 16px var(--meme); color: #5a5266; }
#board ol { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
#board li { display: grid; grid-template-columns: 26px 30px 1fr 44px 44px; align-items: center; gap: 6px; padding: 3px 6px; border-radius: 4px; background: #fff; border: 2px solid rgba(11, 6, 20, .15); }
#board li.me { background: var(--gold); border-color: var(--ink); }
#board .bRank { font: 400 22px/1 var(--meme); color: #8c84a0; text-align: center; }
#board .bName { font-weight: 900; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#board .bK, #board .bD { text-align: center; font: 400 26px/1 var(--meme); font-variant-numeric: tabular-nums; }
#board .bK { color: var(--pink); -webkit-text-stroke: 1px var(--ink); paint-order: stroke fill; }
#board .chipFace { width: 30px; height: 30px; }
/* 결과: 6명이면 줄을 얇게 */
#resultStats.many { gap: 5px; }
#resultStats.many .rankRow { grid-template-columns: 36px 48px 1fr auto; padding: 1px 14px 1px 8px; border-width: 3px; }
#resultStats.many .rankRow .rank { font-size: 30px; }
#resultStats.many .rankRow .rankFace { width: 46px; height: 46px; margin: -6px 0; }
#resultStats.many .rankRow .who strong { font-size: 19px; }
#resultStats.many .rankRow:not(.me):not(.winner) .who small { display: none; }
#resultStats.many .rankRow .kills b { font-size: 32px; }
#resultStats.many .rankRow.winner { transform: scale(1.02); margin-bottom: 2px; }
#resultStats.many .rankRow.winner .rankFace { width: 60px; height: 60px; margin: -14px 0 -8px; }
#result:has(#resultStats.many) #resultTitle { font-size: clamp(40px, 6vw, 72px); }
#result { overflow-y: auto; justify-content: safe center; }
#result:has(#resultStats.many) #resultTitle { font-size: clamp(34px, 5vw, 56px); text-shadow: 4px 4px 0 var(--pink); }
/* 키 작은 화면(휴대폰 가로): 준비 버튼이 스크롤 아래로 숨지 않게 */
@media (max-height: 560px) { #readyBtn { position: sticky; bottom: 0; z-index: 3; box-shadow: 0 -6px 0 var(--paper), 5px 5px 0 var(--ink); } }
