/* KAIT-PLAY 1.1.0 — 게임마다 얼굴 · 로비 포스터 · 시작 장면 (js/titlecard.js 와 짝). 사용자가 시안 A 를 고름 (2026-10-23) */
:root { --broken: #E6EBF5; --broken-d: #BEC8DA;
  /* 선물 상자 그림 — 이모지 🎁 는 윈도우에서 작게 그리면 누워 보여서 직접 그림 (아이템 블록 · 로비 작은 맵 · 전광판) */
  --gift: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='M16 9 C12 3 7 5 9 8.5 C10.5 10.5 14 9.6 16 9 C18 9.6 21.5 10.5 23 8.5 C25 5 20 3 16 9 Z' fill='%23FFD23F' stroke='%230B1030' stroke-width='1.6' stroke-linejoin='round'/%3E%3Crect x='5' y='9' width='22' height='6' rx='1.5' fill='%23FF5C8A' stroke='%230B1030' stroke-width='1.6'/%3E%3Crect x='7' y='15' width='18' height='13' rx='1.5' fill='%23FF7AA0' stroke='%230B1030' stroke-width='1.6'/%3E%3Crect x='14' y='9' width='4' height='19' fill='%23FFD23F' stroke='%230B1030' stroke-width='1.2'/%3E%3C/svg%3E"); }

/* ── 3 × 3 블록 아이콘 (같은 무늬, 색만 다름) ── */
.gicon { display: inline-grid; grid-template-columns: repeat(3, 1fr); gap: 8%; width: 1em; height: 1em; flex: none; vertical-align: -.12em; }
.gicon i { border-radius: 18%; }
.gicon.rush i.a { background: #45B1F5; } .gicon.rush i.b { background: #E6EAF5; }
.gicon.flip i.a { background: #FF4655; } .gicon.flip i.b { background: #2F80FF; }
/* 채운 이름표 안에서는 흰색 계열로 */
.gpill .gicon.rush i.a { background: #fff; } .gpill .gicon.rush i.b { background: rgba(255,255,255,.35); }
.gpill .gicon.flip i.a { background: #fff; } .gpill .gicon.flip i.b { background: rgba(255,255,255,.4); }

/* ── 게임 이름표 (대기실 · 게임 위쪽 · 공식전 팀 고르기 · 전광판) ── */
.pill.gpill { display: inline-flex; align-items: center; gap: 7px; color: #fff; }
.pill.gpill.rush { background: linear-gradient(90deg, #1C79C0, #45B1F5); }
.pill.gpill.flip { background: linear-gradient(90deg, #FF4655 0 50%, #2F80FF 50% 100%); }
.pill.gpill .gicon { font-size: 1.05em; }

/* ── 픽셀 글자 로고 ── */
.glogo { font-family: var(--pixel); letter-spacing: 1px; line-height: 1.3; }
.glogo.rush { color: var(--yellow); }
.glogo.flip { color: #fff; }

/* ── 로비 포스터 (시안 A) ── */
.poster { position: relative; height: 150px; display: flex; align-items: center; gap: 22px; padding: 0 22px; overflow: hidden; }
.poster.rush { background: linear-gradient(120deg, #13306A 0%, #12285A 60%, #0E2049 100%); border-bottom: 2px solid #27407A; }
.poster.flip { background: linear-gradient(105deg, #4A1830 0%, #2A1F55 50%, #142E6A 100%); border-bottom: 2px solid #3A3478; }
.poster .ptxt { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.poster .glogo { font-size: 13px; }
.poster .pname { margin: 0; font-family: var(--display); font-size: 30px; font-weight: 800; color: #fff; line-height: 1.1; }
.poster .win { font-size: 14px; color: var(--soft); }
.lc-tags { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 18px 10px; }
.lc-tags .chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 800; padding: 3px 9px; border-radius: 6px; border: 1px solid var(--line); color: var(--soft); }
.lc-tags .chip.opt { border-style: dashed; color: var(--muted); }
@media (max-width: 1100px) { .poster { gap: 14px; padding: 0 14px; } .poster .mini { transform: scale(.8); transform-origin: left center; margin-right: -30px; } }

/* 움직이는 작은 맵 */
.mini { position: relative; display: grid; gap: 5px; flex: none; }
.mini i { width: 26px; height: 24px; border-radius: 6px; display: block; transition: background .2s; }
.mini.rush { grid-template-columns: repeat(7, 26px); }
.mini.rush i { background: var(--blue); box-shadow: inset 0 -4px 0 var(--blue-dark); }
.mini.rush i.x { background: var(--broken); box-shadow: inset 0 -4px 0 var(--broken-d); animation: gtCrack .35s ease-out; }
@keyframes gtCrack { 0% { transform: scale(1.25) rotate(-6deg); filter: brightness(1.8); } 100% { transform: none; } }
.mini .stamp { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--pixel); font-size: 18px; color: var(--yellow); text-shadow: 3px 3px 0 #7A5A00, 0 0 18px rgba(255,210,63,.8); opacity: 0; transform: scale(2.4) rotate(-8deg); pointer-events: none; }
.mini .stamp.on { animation: gtStamp .45s cubic-bezier(.2, 1.6, .4, 1) forwards; }
@keyframes gtStamp { to { opacity: 1; transform: scale(1) rotate(-8deg); } }
.mini.flip { grid-template-columns: repeat(8, 24px); perspective: 300px; }
.mini.flip i { width: 24px; }
.mini.flip i.r { background: #FF4655; box-shadow: inset 0 -4px 0 #C2202E; }
.mini.flip i.b { background: #2F80FF; box-shadow: inset 0 -4px 0 #1652C9; }
.mini.flip i.g { background: linear-gradient(135deg, #E9EDF8, #AEB8D2); box-shadow: 0 0 0 2px #FFE27A, 0 0 12px rgba(255,226,122,.9); position: relative; }
.mini.flip i.g::after { content: ''; position: absolute; inset: 3px; background: var(--gift) center / contain no-repeat; }
.mini.flip i.g.f { animation: gtGift .45s cubic-bezier(.2, 1.6, .4, 1); } /* 선물 칸은 뒤집지 않고 톡 튀어나옴 */
@keyframes gtGift { 0% { transform: scale(.4); } 100% { transform: scale(1); } }
.mini.flip i.f { animation: gtFlip .4s ease-out; }
@keyframes gtFlip { 0% { transform: rotateY(0); } 50% { transform: rotateY(90deg) scale(1.15); } 100% { transform: rotateY(0); } }

/* ── 시작 장면 (게임 시작 카운트다운의 앞 2초쯤 — 화면 전체) ── */
.gtc { position: fixed; inset: 0; z-index: 9000; overflow: hidden; background: #070D22; font-family: var(--display); }
.gtc.out { animation: gtOut .35s ease-in forwards; }
@keyframes gtOut { to { opacity: 0; } }
.gtc .hint { position: absolute; left: 0; right: 0; bottom: 3vh; text-align: center; font-size: 15px; font-weight: 700; color: rgba(255,255,255,.55); }
.gtc.shake { animation: gtShake .35s; }
@keyframes gtShake { 20% { transform: translate(-8px, 4px); } 40% { transform: translate(6px, -5px); } 60% { transform: translate(-5px, 3px); } 80% { transform: translate(3px, -2px); } }
.gtc .center { position: absolute; left: 0; right: 0; top: 30%; display: flex; flex-direction: column; align-items: center; }
.gtc .ko { margin-top: 3vh; font-size: clamp(22px, 3.2vw, 44px); font-weight: 800; color: #fff; opacity: 0; }
.gtc .win { margin-top: 1.4vh; font-size: clamp(15px, 1.9vw, 26px); font-weight: 700; color: var(--soft); opacity: 0; }
.gtc .ko.on, .gtc .win.on { transition: opacity .3s; opacity: 1; }
/* 글자 블록 (두 게임 공통) */
.gtc .letters { display: flex; gap: .6vw; perspective: 800px; }
.gtc .letters span { position: relative; display: grid; place-items: center; width: clamp(40px, 6vw, 92px); height: clamp(48px, 7.2vw, 110px); border-radius: 12px; font-family: var(--pixel); font-size: clamp(26px, 4vw, 62px); color: #fff; box-shadow: inset 0 -7px 0 rgba(0,0,0,.25), 0 5px 0 rgba(0,0,0,.35); }
.gtc .letters span.sp { width: clamp(14px, 2vw, 30px); background: none !important; box-shadow: none; }
/* 블록 러시: 파랑 글자 블록이 떨어져 → 깨지며 노란 글자 */
.gtc.rush .letters span { background: var(--blue); color: rgba(255,255,255,.0); transform: translateY(-80vh); }
.gtc.rush .letters span.drop { transition: transform .42s cubic-bezier(.5, 0, .9, .6); transform: translateY(0); }
.gtc.rush .letters span.open { background: none; box-shadow: none; color: var(--yellow); text-shadow: .08em .08em 0 #1C79C0, 0 0 .5em rgba(255,210,63,.55); animation: gtPop .35s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes gtPop { 0% { transform: scale(1.5); } 100% { transform: scale(1); } }
.gtc .shard { position: absolute; width: 1.2vw; height: 1.2vw; min-width: 8px; min-height: 8px; border-radius: 3px; background: var(--broken); animation: gtShard .6s ease-out forwards; pointer-events: none; }
.gtc .shard.b { background: var(--blue); }
@keyframes gtShard { to { transform: translate(var(--dx), var(--dy)) rotate(220deg); opacity: 0; } }
/* 플립 배틀: 빨강 · 파랑이 양쪽에서 부딪히고, 글자 블록이 한 장씩 뒤집힘 → 두 팀 VS */
.gtc.flip .half { position: absolute; top: 0; bottom: 0; width: 56%; }
.gtc.flip .half.r { left: 0; background: linear-gradient(90deg, #B5172A, #FF4655); clip-path: polygon(0 0, 100% 0, 82% 100%, 0 100%); transform: translateX(-105%); }
.gtc.flip .half.b { right: 0; background: linear-gradient(270deg, #0E3FA8, #2F80FF); clip-path: polygon(18% 0, 100% 0, 100% 100%, 0 100%); transform: translateX(105%); }
.gtc.flip .half.go { transition: transform .38s cubic-bezier(.3, 1.3, .5, 1); transform: translateX(0); }
.gtc.flip .flash { position: absolute; inset: 0; background: #fff; opacity: 0; }
.gtc.flip .flash.on { animation: gtFlash .35s ease-out; }
@keyframes gtFlash { 0% { opacity: .85; } 100% { opacity: 0; } }
.gtc.flip .center { top: 22%; }
.gtc.flip .letters span { transform: rotateY(90deg); }
.gtc.flip .letters span.r { background: #FF4655; }
.gtc.flip .letters span.b { background: #2F80FF; }
.gtc.flip .letters span.on { transition: transform .3s ease-out; transform: rotateY(0); }
.gtc.flip .vs { margin-top: 7vh; display: flex; justify-content: center; align-items: center; gap: 3vw; opacity: 0; }
.gtc.flip .vs.on { animation: gtSlam .45s cubic-bezier(.2, 1.5, .4, 1) forwards; }
@keyframes gtSlam { 0% { opacity: 0; transform: scale(2.2); } 100% { opacity: 1; transform: scale(1); } }
.gtc.flip .vs b { font-size: clamp(24px, 3.4vw, 48px); font-weight: 800; color: #fff; text-shadow: 0 3px 0 rgba(0,0,0,.35); min-width: 22vw; }
.gtc.flip .vs b:first-child { text-align: right; }
.gtc.flip .vs .v { font-family: var(--pixel); font-size: clamp(30px, 4.4vw, 64px); color: var(--yellow); text-shadow: 4px 4px 0 #000; }
.gtc.flip .win { color: #fff; }
.gtc.calm.shake { animation: none; }
/* 플립 배틀 게임 화면 위쪽: 우리 팀 색 이름표 안의 아이콘 */
.pill > .gicon { margin-right: 6px; }
.pill.gpill > .gicon { margin-right: 0; }
.pill.flip-t1 .gicon i.a, .pill.flip-t2 .gicon i.a { background: #fff; }
.pill.flip-t1 .gicon i.b, .pill.flip-t2 .gicon i.b { background: rgba(255,255,255,.4); }
.pill.flip-t1, .pill.flip-t2 { display: inline-flex; align-items: center; }
/* 방 만들기 제목: 아이콘 · 글자 · '로비로' 를 한 줄 가운데에 맞춤 */
#cr-title { display: inline-flex; align-items: center; gap: .3em; margin: 0; line-height: 1.15; }
#cr-title .gicon { font-size: .85em; vertical-align: 0; }

/* ── 1.1.0 결과 화면: 승리 · 패배 포즈 · MVP (js/shared/hero.js) ── */
.hav { display: inline-block; width: 64px; height: 64px; flex: none; }
.hav.p-win { animation: hvWin 1.1s ease-in-out infinite; }
@keyframes hvWin { 0%, 100% { transform: translateY(0) rotate(0); } 30% { transform: translateY(-22%) rotate(-6deg); } 55% { transform: translateY(0) scaleY(.9) scaleX(1.08); } 75% { transform: translateY(-10%) rotate(5deg); } }
.hav.p-lose { animation: hvLose 2.4s ease-in-out infinite; filter: saturate(.55) brightness(.85); transform-origin: 50% 100%; }
@keyframes hvLose { 0%, 100% { transform: scaleY(.92) scaleX(1.05) rotate(-3deg); } 50% { transform: scaleY(.88) scaleX(1.08) rotate(3deg); } }
.hav.p-draw { animation: hvDraw 1.6s ease-in-out infinite; transform-origin: 50% 100%; }
@keyframes hvDraw { 0%, 100% { transform: rotate(-8deg); } 50% { transform: rotate(8deg); } }
.hconfetti { position: absolute; inset: 0; pointer-events: none; overflow: hidden; border-radius: inherit; }
.hconfetti i { position: absolute; top: -12px; width: 8px; height: 12px; border-radius: 2px; animation: hvFall linear infinite; }
@keyframes hvFall { to { transform: translateY(110vh) rotate(540deg); } }
.hcrown { position: absolute; left: 50%; top: -0.62em; transform: translateX(-50%); line-height: 1; filter: drop-shadow(0 3px 0 rgba(0,0,0,.4)); animation: hvCrown 1.1s ease-in-out infinite; pointer-events: none; }
@keyframes hvCrown { 50% { transform: translateX(-50%) translateY(-6px) rotate(6deg); } }
.hcloud { position: absolute; left: 50%; top: -40px; width: 64px; height: 54px; transform: translateX(-50%); animation: hvCloud 3s ease-in-out infinite; pointer-events: none; }
.hcloud .rain { animation: hvRain .8s linear infinite; }
@keyframes hvCloud { 50% { transform: translateX(-40%); } }
@keyframes hvRain { 0% { transform: translateY(-2px); opacity: 1; } 100% { transform: translateY(5px); opacity: .3; } }

/* 학생 결과 창 */
.result { position: relative; }
.result.hero .rs-title { font-size: 26px; margin-top: -6px; }
.rs-big { font-family: var(--pixel); font-size: 40px; letter-spacing: 2px; color: var(--yellow); text-shadow: 4px 4px 0 #1C79C0, 0 0 26px rgba(255,210,63,.45); line-height: 1.2; }
.result.m-lose { border-color: #5A6A96; }
.result.m-lose .rs-big { color: #A8B6DA; text-shadow: 4px 4px 0 #1A2244; }
.result.m-rank .rs-big { color: #E3E8F5; text-shadow: 4px 4px 0 #56607E; }
.result.m-draw { border-color: var(--yellow); }
.result.m-lose .rs-title, .result.m-rank .rs-title { color: #DCE4F5; }
.rs-hero { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 100%; }
.rs-me { position: relative; width: 130px; height: 130px; margin-top: 34px; }
.rs-me .hav { width: 130px; height: 130px; }
.rs-me .hcrown { font-size: 38px; }
.rs-me-nick { font-size: 15px; color: #fff; margin-top: 2px; }
.rs-mates { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 14px; margin-top: 18px; }
.rs-mate { position: relative; width: 58px; display: flex; flex-direction: column; align-items: center; font-size: 11px; color: var(--soft); }
.rs-mate .hav { width: 46px; height: 46px; }
.rs-mate .hcrown { font-size: 19px; }
.rs-mate span { max-width: 64px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rs-mvp { display: inline-flex; align-items: center; gap: 12px; padding: 10px 16px; border-radius: 14px; background: linear-gradient(90deg, rgba(255,210,63,.18), rgba(255,210,63,.05)); border: 2px solid rgba(255,210,63,.6); text-align: left; margin-top: 8px; }
.rs-mvp .mvp-badge { font-family: var(--pixel); font-size: 12px; color: #1A1400; background: var(--yellow); padding: 6px 8px; border-radius: 6px; }
.rs-mvp .hav { width: 46px; height: 46px; }
.rs-mvp .t1 { font-size: 18px; font-weight: 800; color: var(--yellow); }
.rs-mvp .t2 { font-size: 13px; color: var(--soft); }

/* 전광판: 판이 끝나면 화면 가득 축하 (약 9초, 아무 키 · 클릭이면 닫힘) */
.bhero { position: fixed; inset: 0; z-index: 8000; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2vh; background: radial-gradient(ellipse at 50% 40%, #1F3570 0%, #0A1230 70%); overflow: hidden; text-align: center; }
.bhero.lose, .bhero.draw { background: radial-gradient(ellipse at 50% 40%, #2A2F55 0%, #0A1230 70%); }
.bhero.out { animation: gtOut .4s ease-in forwards; }
.bhero .bh-big { font-family: var(--pixel); font-size: clamp(40px, 7vw, 110px); letter-spacing: 3px; color: var(--yellow); text-shadow: 6px 6px 0 #1C79C0, 0 0 40px rgba(255,210,63,.5); }
.bhero.draw .bh-big { color: #fff; text-shadow: 6px 6px 0 #56607E; }
.bhero .bh-sub { font-size: clamp(24px, 3.4vw, 52px); font-weight: 800; color: #fff; }
.bhero .bh-team { display: flex; flex-wrap: wrap; justify-content: center; gap: 2vh 2.4vw; max-width: 90vw; margin-top: 4vh; }
.bhero .bh-p { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: clamp(13px, 1.3vw, 20px); color: var(--soft); }
.bhero .bh-p .hcrown { font-size: 1.9em; }
.bhero .bh-mvp { display: inline-flex; align-items: center; gap: 1.4vw; margin-top: 3vh; padding: 1.4vh 2.2vw; border-radius: 20px; background: linear-gradient(90deg, rgba(255,210,63,.22), rgba(255,210,63,.06)); border: 3px solid rgba(255,210,63,.7); text-align: left; }
.bhero .bh-mvp .mvp-badge { font-family: var(--pixel); font-size: clamp(14px, 1.4vw, 22px); color: #1A1400; background: var(--yellow); padding: 8px 10px; border-radius: 8px; }
.bhero .bh-mvp .t1 { font-size: clamp(24px, 2.8vw, 44px); font-weight: 800; color: var(--yellow); }
.bhero .bh-mvp .t2 { font-size: clamp(15px, 1.5vw, 24px); color: var(--soft); }
.bhero .hint { position: absolute; left: 0; right: 0; bottom: 3vh; font-size: 15px; color: rgba(255,255,255,.5); }

/* ── 1.1.0: 플립 배틀 대기실 — 빨강 VS 파랑 ── */
.wteams.vs { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 10px; align-items: stretch; }
.wteams.vs .wteam { border-top-width: 3px; position: relative; overflow: visible; }
.wteams.vs .vs-red { background: linear-gradient(100deg, rgba(255, 70, 85, .30), var(--panel) 70%); border-color: rgba(255, 70, 85, .55); }
.wteams.vs .vs-blue { background: linear-gradient(260deg, rgba(47, 128, 255, .32), var(--panel) 70%); border-color: rgba(47, 128, 255, .55); }
.wteams.vs .wteam.mine { border-color: var(--yellow); }
.wteams.vs .vs-blue .wt-head { flex-direction: row-reverse; }
.wteams.vs .vs-blue .wt-head .vs-cnt, .wteams.vs .vs-blue .wt-head .wt-count { margin-left: 0; margin-right: auto; }
.wteams.vs .vs-cnt { margin-left: auto; font-size: 13px; font-weight: 800; color: var(--soft); white-space: nowrap; }
.wteams.vs .vs-blue .wt-slots .slot { flex-direction: row-reverse; padding: 0 5px 0 6px; }
.wteams.vs .vs-blue .wt-slots .slot b { text-align: right; }
.wteams.vs .vs-blue .av svg { transform: scaleX(-1); }   /* 파랑은 왼쪽(빨강)을 바라봄 */
.vs-mid { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-width: 96px; padding: 0 2px; }
.vs-v { font-family: var(--pixel); font-size: 44px; line-height: 1; color: var(--yellow);
  text-shadow: -3px 0 0 #FF4655, 3px 0 0 #2F80FF, 0 5px 0 #000; animation: vsBreath 2.4s ease-in-out infinite; }
.vs-v.pop { animation: vsPop .5s cubic-bezier(.2, 1.6, .4, 1), vsBreath 2.4s ease-in-out .5s infinite; }
.vs-mid.hot .vs-v { animation: vsHot .35s linear infinite; color: #FFF27A; text-shadow: -4px 0 0 #FF4655, 4px 0 0 #2F80FF, 0 5px 0 #000, 0 0 22px #FFB800; }
.vs-go { font-size: 13px; font-weight: 800; color: #1A1400; background: var(--yellow); padding: 2px 10px; border-radius: 999px; white-space: nowrap; animation: vsBlink .8s steps(2) infinite; }
.vs-note { font-size: 11px; color: var(--muted); text-align: center; word-break: keep-all; max-width: 92px; }
@keyframes vsBreath { 50% { transform: scale(1.08); } }
@keyframes vsPop { 0% { transform: scale(1.7); filter: brightness(2); } 100% { transform: scale(1); } }
@keyframes vsHot { 0% { transform: translate(0, 0) rotate(-3deg) scale(1.1); } 25% { transform: translate(-2px, 1px) rotate(3deg) scale(1.14); } 50% { transform: translate(2px, -1px) rotate(-2deg) scale(1.1); } 75% { transform: translate(-1px, -1px) rotate(2deg) scale(1.14); } }
@keyframes vsBlink { 50% { opacity: .55; } }
.vs-in-l { animation: vsInL .45s cubic-bezier(.2, 1.3, .4, 1); }
.vs-in-r { animation: vsInR .45s cubic-bezier(.2, 1.3, .4, 1); }
@keyframes vsInL { 0% { transform: translateX(-60px); opacity: 0; } 100% { transform: none; opacity: 1; } }
@keyframes vsInR { 0% { transform: translateX(60px); opacity: 0; } 100% { transform: none; opacity: 1; } }
@media (max-width: 1100px) { .vs-mid { min-width: 64px; } .vs-v { font-size: 30px; } }
@media (prefers-reduced-motion: reduce) { .vs-v, .vs-v.pop, .vs-mid.hot .vs-v, .vs-go, .vs-in-l, .vs-in-r { animation: none; } }
