/* GNSOFT 2026 송년회 — 회사 컬러 시스템: Orange Gradient #EF7F1B → #E94820, Gray #303D47
 * 밝은 행사장·작은 빔 화면 기준: 흰 바탕 + 진한 회색 글자 + 큰 글씨, 주황은 띠·강조·버튼 */
@font-face { font-family: 'Paperlogy'; font-weight: 400; font-display: swap; src: url('/fonts/Paperlogy-4Regular.woff2') format('woff2'); }
@font-face { font-family: 'Paperlogy'; font-weight: 600; font-display: swap; src: url('/fonts/Paperlogy-6SemiBold.woff2') format('woff2'); }
@font-face { font-family: 'Paperlogy'; font-weight: 800; font-display: swap; src: url('/fonts/Paperlogy-8ExtraBold.woff2') format('woff2'); }
@font-face { font-family: 'Paperlogy'; font-weight: 900; font-display: swap; src: url('/fonts/Paperlogy-9Black.woff2') format('woff2'); }
:root {
  --o1: #EF7F1B;
  --o2: #E94820;
  --orange: linear-gradient(100deg, #EF7F1B 0%, #E94820 100%);
  --grad: linear-gradient(100deg, #3d4d56 0%, #2a353c 100%);   /* 버튼·채움: 로고 회청 */
  --gray: #303D47;
  --bg: #EE6A22;
  --card: rgba(255, 255, 255, 0.13);
  --card2: rgba(255, 255, 255, 0.18);
  --line: rgba(255, 255, 255, 0.30);
  --tx: #ffffff;
  --tx2: rgba(255, 255, 255, 0.92);
  --tx3: rgba(255, 255, 255, 0.72);
  --soft: rgba(255, 255, 255, 0.15);
  --hl: #FFE6A6;      /* 주황 바탕 위 강조 */
  --bar: #ffffff;
  --ok: #ffffff;
  --ng: #2a353c;
  --gold: #ffcf4a;
  --silver: #d5dde2;
  --bronze: #e09a63;
  --r: 22px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: 'Paperlogy', 'Malgun Gothic', sans-serif; font-weight: 600; color: var(--tx); background: var(--bg); -webkit-font-smoothing: antialiased; overflow-x: hidden;
  background-image: radial-gradient(1100px 700px at 85% -10%, rgba(255, 214, 120, 0.35), transparent 60%), radial-gradient(900px 600px at -10% 110%, rgba(190, 40, 20, 0.35), transparent 60%), linear-gradient(150deg, #F59331 0%, #EE6A22 55%, #E24A24 100%);
  background-attachment: fixed; }
#sparkle { position: fixed; inset: 0; pointer-events: none; z-index: 0; }
button { font: inherit; cursor: pointer; }
.og { background: linear-gradient(180deg, #ffffff 20%, #FFE0A0 100%); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 2px 6px rgba(120, 30, 0, .25)); }
.btn { border: 0; border-radius: 16px; padding: 14px 24px; font-weight: 800; font-size: 18px; color: #fff; background: var(--grad); box-shadow: 0 8px 24px rgba(40, 20, 10, .30); transition: transform .1s, filter .1s; }
.btn:hover { filter: brightness(1.05); }
.btn:active { transform: scale(.97); }
.btn.gray { background: var(--gray); box-shadow: none; }
.btn.line { background: var(--card2); color: #fff; border: 2px solid var(--line); box-shadow: none; }
.btn.red { background: #b8332a; box-shadow: none; }
.btn:disabled { opacity: .45; cursor: default; }
.card { background: var(--card); border-radius: var(--r); border: 1px solid var(--line); position: relative; z-index: 1; }
.pill { display: inline-block; padding: 8px 16px; border-radius: 99px; background: rgba(255, 255, 255, .22); color: #fff; font-weight: 800; font-size: 18px; white-space: nowrap; }
.pill.live::before { content: ''; display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: #fff; margin-right: 8px; animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .2; } }
@keyframes pop { from { transform: scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fadein { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes slidein { from { opacity: 0; transform: translateX(-24px); } to { opacity: 1; transform: none; } }
.shake { animation: shake .3s; }
@keyframes shake { 25% { transform: translateX(-7px); } 75% { transform: translateX(7px); } }

/* ================= 메인 화면 ================= */
.display { height: 100vh; display: flex; flex-direction: column; overflow: hidden; }
.display > header { position: relative; z-index: 2; display: flex; align-items: center; gap: 26px; padding: 18px 40px; background: rgba(255, 255, 255, .08); border-bottom: 1px solid var(--line); color: #fff; backdrop-filter: blur(8px); }
.display > header img { height: 38px; }
.display > header .title { margin-left: auto; font-size: 34px; font-weight: 900; letter-spacing: -.5px; }
.display > header .right { margin-left: auto; display: flex; gap: 12px; align-items: center; }
.stage { flex: 1; min-height: 0; padding: 24px 40px 118px; position: relative; z-index: 1; }
.view { height: 100%; display: none; }
.view.on { display: flex; animation: fadein .4s ease; }

/* 로그인 */
.login { align-items: center; justify-content: center; }
.loginbox { width: 560px; padding: 48px 50px; display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; }
.loginbox h2 { margin: 10px 0 0; font-size: 40px; font-weight: 900; }
.loginbox p { margin: 0 0 8px; font-size: 20px; color: var(--tx2); }
.loginbox input { width: 100%; padding: 18px 20px; border-radius: 16px; border: 2px solid var(--line); background: rgba(255, 255, 255, .18); color: #fff; font: inherit; font-size: 24px; font-weight: 800; text-align: center; outline: none; }
.loginbox input::placeholder { color: rgba(255, 255, 255, .7); }
.loginbox input:focus { border-color: #fff; }
.loginbox .btn.start { width: 100%; background: #fff; color: #E94820; font-size: 26px; padding: 18px; border-radius: 16px; box-shadow: 0 12px 34px rgba(90, 25, 0, .35); }

/* 대기: QR 왼쪽, 조 현황 오른쪽 */
.lobby { gap: 30px; }
.lobby .qrbox { width: 37%; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 28px; text-align: center; }
.lobby .qrbox h2 { font-size: 46px; font-weight: 900; margin: 0 0 6px; letter-spacing: -1px; }
.lobby .qrbox p { margin: 0 0 22px; color: var(--tx2); font-size: 24px; }
.lobby .qr { padding: 16px; border-radius: 24px; background: #fff; box-shadow: 0 20px 60px rgba(90, 25, 0, .40), 0 0 0 8px rgba(255, 255, 255, .55); }
.lobby .qr img { display: block; width: min(29vw, 50vh); height: auto; aspect-ratio: 1; }
.lobby .url { margin-top: 18px; font-size: 26px; font-weight: 800; color: var(--tx2); }
.lobby .teams { flex: 1; display: flex; flex-direction: column; padding: 26px 30px; min-width: 0; }
.lobby .teams h3 { margin: 0 0 18px; font-size: 32px; font-weight: 900; display: flex; align-items: baseline; gap: 12px; }
.lobby .teams h3 b { font-size: 54px; }
.tgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; align-content: start; flex: 1; min-height: 0; overflow: hidden; }
.tchip { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: 18px; background: var(--card2); border: 2px solid var(--line); animation: pop .5s cubic-bezier(.2, 1.6, .4, 1); }
.tchip .no { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--gray); color: #fff; font-size: 20px; font-weight: 900; flex: none; }
.tchip .nm { font-size: 28px; font-weight: 900; line-height: 1.15; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tchip .sub { font-size: 18px; color: var(--tx2); font-weight: 800; }
.tchip .cnt { margin-left: auto; font-size: 26px; font-weight: 900; color: var(--hl); white-space: nowrap; }
.tchip.bump { animation: pop .45s; }
.tempty { grid-column: 1 / -1; text-align: center; color: var(--tx3); font-size: 26px; line-height: 1.6; padding: 0; }
.tgrid:has(.tempty) { align-content: center; padding-bottom: 50px; }   /* 팀이 없을 때 안내 문구를 카드 한가운데로 */
.tcell { border-radius: 18px; background: var(--soft); border: 2px solid var(--line); display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 4px; padding: 10px; transition: all .3s; }
.tcell .nm { font-size: 34px; font-weight: 900; }
.tcell .cnt { font-size: 24px; color: var(--tx2); font-weight: 800; }
.tcell.has { background: var(--card2); border-color: #fff; }
.tcell.has .cnt { color: var(--hl); }
.tcell.bump { animation: pop .45s; }

/* 게임 고르기 */
.select { flex-direction: column; gap: 18px; }
.select h2 { margin: 0; font-size: 40px; font-weight: 900; }
.ggrid { flex: 1; display: grid; grid-template-columns: repeat(5, 1fr); grid-auto-rows: 1fr; gap: 18px; }
.gcard { border: 3px solid var(--line); background: var(--card2); border-radius: 22px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 14px; text-align: center; position: relative; transition: transform .15s, border-color .15s; color: #fff; }
.gcard .ic { font-size: 74px; line-height: 1; }
.gcard .nm { font-size: 30px; font-weight: 900; letter-spacing: -.5px; }
.gcard .no { position: absolute; left: 14px; top: 10px; font-size: 20px; font-weight: 900; color: var(--tx3); }
.gcard.done { opacity: .85; }
.gcard.done::after { content: attr(data-n); position: absolute; right: 12px; top: 10px; background: var(--gray); color: #fff; font-size: 16px; padding: 4px 10px; border-radius: 99px; }
.host-on .gcard:hover { transform: translateY(-4px); border-color: #fff; }

/* 게임 설명 */
.intro { flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 10px; }
.intro .icon { font-size: 110px; line-height: 1; animation: pop .5s; }
.intro h2 { font-size: 78px; margin: 4px 0 14px; font-weight: 900; letter-spacing: -2px; }
.intro .desc { font-size: 36px; line-height: 1.55; font-weight: 800; color: var(--tx); }
.intro .desc div::before { content: '•'; color: var(--hl); margin-right: 12px; }
.intro .optshow { margin-top: 18px; font-size: 32px; font-weight: 900; color: var(--hl); }
.intro .hint { margin-top: 14px; font-size: 26px; color: var(--tx2); }

/* 게임 진행 */
.play { flex-direction: column; gap: 14px; }
.play .bar { display: flex; align-items: center; gap: 16px; }
.play .bar .gname { font-size: 40px; font-weight: 900; }
.play .bar .sub { font-size: 24px; color: var(--tx2); font-weight: 800; }
.play .bar .timer { margin-left: auto; font-size: 54px; font-weight: 900; font-variant-numeric: tabular-nums; color: var(--hl); }
.play .bar .timer.warn { animation: blink .5s infinite; }
.ghead:empty { display: none; }
.board { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(4, 1fr); grid-template-rows: repeat(3, 1fr); gap: 14px; position: relative; }
.btile { background: var(--card2); border: 3px solid var(--line); border-radius: 20px; padding: 12px 18px; display: flex; flex-direction: column; justify-content: center; position: relative; overflow: hidden; transition: border-color .3s; }
.btile .top { display: flex; align-items: center; gap: 10px; }
.btile .nm { font-size: 30px; font-weight: 900; }
.btile .rk { margin-left: auto; min-width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; font-size: 22px; font-weight: 900; background: var(--gray); color: #fff; }
.btile .val { font-size: 50px; font-weight: 900; letter-spacing: -1px; font-variant-numeric: tabular-nums; line-height: 1.15; margin: 4px 0; }
.btile .meta { font-size: 19px; color: var(--tx2); font-weight: 800; }
.btile .pb { height: 10px; border-radius: 5px; background: rgba(52, 66, 74, .3); margin-top: 8px; overflow: hidden; }
.btile .pb i { display: block; height: 100%; background: var(--bar); transition: width .3s; }
.btile.r1 { border-color: var(--hl); box-shadow: 0 6px 20px rgba(120, 30, 0, .25); }
.btile.r1 .rk { background: var(--gold); color: #3b2a00; }
.btile.r2 .rk { background: var(--silver); color: #222; }
.btile.r3 .rk { background: var(--bronze); color: #3a1d06; }
.btile.empty { opacity: .35; }
.countdown { position: absolute; inset: 0; display: grid; place-items: center; z-index: 5; background: rgba(52, 66, 74, .78); border-radius: var(--r); }
.countdown b { font-size: 300px; font-weight: 900; animation: zoom 1s ease-out infinite; }
@keyframes zoom { from { transform: scale(1.5); opacity: .2; } 30% { opacity: 1; } to { transform: scale(1); } }

/* 결과 */
.result { gap: 26px; }
.result .main { flex: 1.3; display: flex; flex-direction: column; padding: 24px 30px; min-width: 0; }
.result .side { flex: 1; display: flex; flex-direction: column; padding: 24px 28px; min-width: 0; }
.result h2 { margin: 0 0 12px; font-size: 34px; font-weight: 900; }
.winner { font-size: 30px; font-weight: 900; margin-bottom: 6px; }
.winner b { font-size: 46px; }
.note { font-size: 22px; color: var(--tx2); margin-bottom: 12px; font-weight: 800; }
.rlist { display: flex; flex-direction: column; gap: 7px; overflow: hidden; }
.rrow { display: flex; align-items: center; gap: 14px; padding: 8px 16px; border-radius: 14px; background: var(--soft); font-size: 26px; font-weight: 900; animation: slidein .45s both; }
.rrow .pl { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--gray); color: #fff; flex: none; font-size: 22px; }
.rrow.p1 { background: linear-gradient(90deg, rgba(255, 207, 74, .35), rgba(255, 255, 255, .12)); }
.rrow.p1 .pl { background: var(--gold); color: #3b2a00; }
.rrow.p2 .pl { background: var(--silver); color: #222; }
.rrow.p3 .pl { background: var(--bronze); color: #3a1d06; }
.rrow .nm { flex: 1; }
.rrow .lb { color: var(--tx2); font-variant-numeric: tabular-nums; }
.rrow .pt { min-width: 86px; text-align: right; color: var(--hl); }
.rlist.small .rrow { font-size: 23px; padding: 6px 14px; }
.rlist.small .rrow .pl { width: 38px; height: 38px; font-size: 19px; }

/* 경품 추첨 */
.draw { flex-direction: column; gap: 18px; }
.drawhead { text-align: center; }
.drawhead h2 { margin: 0; font-size: 56px; font-weight: 900; letter-spacing: -1px; }
.drawhead .sub { font-size: 24px; color: var(--tx2); font-weight: 800; margin-top: 4px; }
.dgrid { flex: 1; min-height: 0; display: flex; flex-wrap: wrap; gap: 18px; justify-content: center; align-content: center; overflow: hidden; }
.dcard { width: 300px; padding: 22px 18px; border-radius: 22px; background: var(--card2); border: 2px solid var(--line); text-align: center; transition: all .35s; }
.dcard .dno { font-size: 84px; font-weight: 900; line-height: 1; font-variant-numeric: tabular-nums; opacity: .55; }
.dcard .dno small { font-size: 34px; margin-right: 2px; }
.dcard .dnm { font-size: 34px; font-weight: 900; margin-top: 10px; min-height: 44px; }
.dcard .dtm { font-size: 20px; color: var(--tx2); font-weight: 800; min-height: 26px; }
.dcard.on { background: #fff; color: #E94820; border-color: #fff; box-shadow: 0 16px 40px rgba(90, 25, 0, .35); transform: scale(1.04); animation: pop .5s; }
.dcard.on .dno { opacity: 1; }
.dcard.on .dtm { color: #56636D; }
.dgrid.many .dcard { width: 220px; padding: 14px 12px; }
.dgrid.many .dcard .dno { font-size: 56px; }
.dgrid.many .dcard .dnm { font-size: 26px; min-height: 34px; }
/* QR 띄우기 */
.qrpop { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; background: rgba(40, 20, 10, .55); backdrop-filter: blur(6px); cursor: pointer; }
.qrpop[hidden] { display: none; }
.qrcard { padding: 34px 46px; text-align: center; background: rgba(240, 110, 40, .96); }
.qrcard h2 { margin: 0 0 4px; font-size: 48px; font-weight: 900; }
.qrcard p { margin: 0 0 20px; font-size: 24px; color: var(--tx2); }
.qrcard .qrimg { background: #fff; padding: 18px; border-radius: 24px; display: inline-block; }
.qrcard .qrimg img { display: block; width: min(62vh, 640px); height: auto; aspect-ratio: 1; }
.qrcard .hint { margin-top: 14px; font-size: 18px; color: var(--tx3); }
.host .drawform { display: flex; align-items: center; gap: 10px; color: #fff; font-size: 16px; }
.host .drawform input[type=text] { width: 180px; }
.host .drawform input[type=checkbox] { width: auto; }

/* 최종 */
.final { flex-direction: column; align-items: center; gap: 16px; }
.final h2 { font-size: 58px; margin: 0; font-weight: 900; }
.podium { display: flex; align-items: flex-end; gap: 22px; height: 40%; }
.podium .col { width: 270px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 8px; }
.podium .nm { font-size: 40px; font-weight: 900; }
.podium .sc { color: var(--tx2); font-size: 22px; font-weight: 800; }
.podium .blk { width: 100%; border-radius: 18px 18px 0 0; display: grid; place-items: center; font-size: 70px; font-weight: 900; color: #fff; animation: rise 1s cubic-bezier(.2, 1, .3, 1) both; transform-origin: bottom; }
.podium .c1 .blk { height: 100%; min-height: 170px; background: linear-gradient(180deg, #ffd65e, #d79a17); color: #4a3300; animation-delay: .9s; }
.podium .c2 .blk { height: 72%; min-height: 120px; background: linear-gradient(180deg, #e9eef1, #a8b4bb); color: #2c3439; animation-delay: .45s; }
.podium .c3 .blk { height: 55%; min-height: 90px; background: linear-gradient(180deg, #f0b17f, #b86a33); color: #3a1d06; }
@keyframes rise { from { transform: scaleY(0); } to { transform: scaleY(1); } }
.final .bottom { display: flex; gap: 24px; width: 100%; flex: 1; min-height: 0; }
.final .bottom .card { flex: 1; padding: 18px 24px; overflow: hidden; }
.final .bottom h3 { margin: 0 0 10px; font-size: 26px; font-weight: 900; }
.wins { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.wins div { padding: 8px 14px; border-radius: 12px; background: var(--soft); font-size: 21px; font-weight: 800; }
.wins div span { color: var(--tx3); margin-right: 6px; }

/* 진행자 도구 */
.host { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 10; display: flex; gap: 10px; align-items: center; padding: 10px; border-radius: 20px; background: rgba(48, 61, 71, .94); box-shadow: 0 10px 30px rgba(0, 0, 0, .25); opacity: .9; transition: opacity .2s; }
.host:hover, .host:focus-within { opacity: 1; }
.host[hidden] { display: none; }
.host .btn.big { padding: 16px 44px; font-size: 24px; }
.host.solo { background: none; box-shadow: none; padding: 0; opacity: 1; }
.host .btn.start { background: #fff; color: #E94820; font-size: 30px; padding: 18px 64px; border-radius: 20px; box-shadow: 0 12px 34px rgba(90, 25, 0, .35); }
.host .btn { padding: 11px 18px; font-size: 17px; }
.host .btn.line { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .3); }
.host label { color: #fff; font-size: 16px; display: flex; align-items: center; gap: 8px; }
.host input { width: 90px; padding: 9px 10px; border-radius: 10px; border: 0; font: inherit; font-size: 18px; font-weight: 800; }
.host input[type=password] { width: 120px; }
.toast { position: fixed; left: 50%; top: 110px; transform: translateX(-50%); padding: 14px 22px; border-radius: 14px; background: var(--gray); color: #fff; z-index: 50; font-weight: 800; font-size: 18px; }

/* ================= 핸드폰 ================= */
.mobile { min-height: 100dvh; display: flex; flex-direction: column; touch-action: manipulation; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
.mobile .top { display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: rgba(255, 255, 255, .08); border-bottom: 1px solid var(--line); backdrop-filter: blur(8px); color: #fff; position: sticky; top: 0; z-index: 3; }
.mobile .top img { height: 20px; }
.mobile .top .me { margin-left: auto; text-align: right; line-height: 1.25; }
.mobile .top .me b { display: block; font-size: 19px; font-weight: 900; }
.mobile .top .me small { font-size: 12px; opacity: .9; }
.mobile main { flex: 1; display: flex; flex-direction: column; padding: 16px; position: relative; z-index: 1; }
.m-center { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 10px; }
.m-center .big { font-size: 64px; line-height: 1.1; }
.m-center h2 { margin: 0; font-size: 28px; font-weight: 900; }
.m-center p { margin: 0; color: var(--tx2); font-size: 17px; line-height: 1.55; }
.m-desc { text-align: left; background: var(--card2); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; font-size: 16px; line-height: 1.6; color: var(--tx); width: 100%; }
.m-desc div::before { content: '•'; color: var(--hl); margin-right: 8px; }
.teampick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; width: 100%; }
.teampick button { padding: 20px 0; border-radius: 16px; border: 2px solid var(--line); background: var(--card2); font-size: 22px; font-weight: 900; color: #fff; }
.teampick button.on { background: var(--grad); color: #fff; border-color: transparent; }
.m-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; font-weight: 800; font-size: 17px; }
.m-head .t { font-variant-numeric: tabular-nums; color: var(--hl); font-size: 22px; font-weight: 900; }
.m-bar { height: 8px; border-radius: 4px; background: rgba(52, 66, 74, .3); overflow: hidden; margin-bottom: 12px; }
.m-bar i { display: block; height: 100%; background: var(--bar); }
.m-big { font-size: 96px; font-weight: 900; font-variant-numeric: tabular-nums; line-height: 1; }
.tapbtn { width: min(74vw, 330px); aspect-ratio: 1; border-radius: 50%; border: 0; color: #E94820; font-size: 48px; font-weight: 900; background: radial-gradient(circle at 35% 30%, #ffffff, #ffe9d6 70%); box-shadow: 0 18px 44px rgba(120, 30, 0, .4), inset 0 -10px 0 rgba(233, 72, 32, .18); touch-action: none; transition: transform .05s; }
.tapbtn.hit { transform: scale(.93); }
.tapbtn:disabled { filter: grayscale(.7); opacity: .55; }
.m-result { padding: 22px; border-radius: 20px; background: var(--card2); border: 1px solid var(--line); text-align: center; width: 100%; }
.m-result .pl { font-size: 58px; font-weight: 900; }
.m-input { width: 100%; padding: 16px; border-radius: 14px; border: 2px solid var(--line); background: rgba(255, 255, 255, .18); color: #fff; font: inherit; font-size: 30px; font-weight: 900; text-align: center; outline: none; }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; width: 100%; margin-top: 10px; }
.keypad button { padding: 16px 0; border-radius: 14px; border: 0; background: var(--card2); box-shadow: 0 2px 0 rgba(0, 0, 0, .12); font-size: 28px; font-weight: 900; color: var(--tx); }
.keypad button:active { background: var(--soft); }
.keypad button.go { background: var(--grad); color: #fff; }
.mutelink { color: var(--tx2); font-size: 15px; text-decoration: underline; background: none; border: 0; }
.mobile .countdown { position: fixed; background: rgba(52, 66, 74, .9); border-radius: 0; }
.mobile .countdown b { font-size: 170px; }

/* ================= 관리 ================= */
/* 한 화면: 머리줄 + 탭 + 내용(내용만 스크롤) + 저장 줄 */
body.adminpage { height: 100vh; overflow: hidden; }
.admin { max-width: 1280px; height: 100vh; margin: 0 auto; padding: 0 24px; display: flex; flex-direction: column; }
.admin .ah { flex: none; color: #fff; padding: 18px 4px 14px; display: flex; align-items: center; gap: 14px; }
.admin .ah img { height: 26px; display: block; }
.admin .ah h1 { margin: 0; font-size: 24px; font-weight: 900; }
.admin .ahr { margin-left: auto; display: flex; gap: 10px; }
.admin .ahr .btn { text-decoration: none; }
.admin #body:not([hidden]) { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.atabs { flex: none; display: flex; gap: 6px; padding: 6px; border-radius: 18px; background: rgba(42, 53, 60, .28); margin-bottom: 16px; overflow-x: auto; }
.atabs button { flex: 1; min-width: max-content; border: 0; border-radius: 13px; padding: 13px 18px; font: inherit; font-size: 17px; font-weight: 800; color: var(--tx2); background: transparent; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: background .15s, color .15s; }
.atabs button:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.atabs button.on { background: #fff; color: var(--o2); box-shadow: 0 6px 18px rgba(90, 25, 0, .18); }
.atabs .badge:empty { display: none; }
.atabs .badge { min-width: 24px; padding: 2px 8px; border-radius: 99px; font-size: 13px; background: var(--gray); color: #fff; }
.apanel { display: none; flex: 1; min-height: 0; overflow-y: auto; padding: 2px 4px 20px; }
.apanel.on { display: block; }
.acols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: stretch; }   /* 좌우 카드 높이 맞춤 */
.acols > section { display: flex; flex-direction: column; }
.acols > section > .help:first-of-type { min-height: 3.2em; }
.acols > section > textarea { flex: 1 1 auto; }
.acols > section { margin-bottom: 0; }
.admin section { padding: 22px 24px; margin-bottom: 16px; }
.admin h2 { margin: 0 0 8px; font-size: 20px; font-weight: 900; }
.admin .help { color: var(--tx2); font-size: 14px; margin: 4px 0 12px; line-height: 1.6; }
.admin .help.inl { font-weight: 600; margin-left: 6px; }
.admin .help.err { color: #fff3b0; margin: 8px 0 0; }
.admin .help.err:empty { display: none; }
.ggrid2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.gchk { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 14px; border: 2px solid var(--line); background: rgba(0, 0, 0, .08); font-size: 16px; font-weight: 800; cursor: pointer; transition: background .15s, border-color .15s; }
.gchk:has(input:checked) { background: rgba(255, 255, 255, .2); border-color: #fff; }
.gchk .gi { font-size: 22px; }
.gchk input { width: 18px; height: 18px; accent-color: var(--gray); }
.admin textarea { width: 100%; height: 340px; min-height: 340px; resize: vertical; border-radius: 12px; border: 2px solid var(--line); padding: 12px 14px; font: 15px/1.7 ui-monospace, Consolas, monospace; color: #fff; background: rgba(0, 0, 0, .15); }
.admin textarea:focus, .admin input:focus { outline: none; border-color: #fff; }
.admin .row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.admin .btn { padding: 10px 16px; font-size: 15px; }
.admin .btn.sm { padding: 6px 12px; font-size: 14px; }
.admin a.btn { text-decoration: none; }
.admin input[type=number], .admin input[type=text] { padding: 8px 10px; border-radius: 10px; border: 2px solid var(--line); font: inherit; font-size: 16px; color: #fff; background: rgba(0, 0, 0, .15); }
.admin input[type=number] { width: 80px; }
.admin table { width: 100%; border-collapse: collapse; font-size: 16px; }
.admin th { position: sticky; top: 0; font-size: 14px; color: var(--tx2); }
.admin td, .admin th { padding: 10px 8px; border-bottom: 1px solid var(--line); text-align: left; }
.admin .empty { color: var(--tx3); padding: 14px 0; }
.admin .tag { font-size: 12px; padding: 2px 8px; border-radius: 99px; background: var(--grad); color: #fff; }
.dlist { display: flex; flex-direction: column; gap: 8px; font-size: 15px; }
.dlist .ditem { padding: 12px 14px; border-radius: 12px; background: rgba(0, 0, 0, .1); line-height: 1.6; }
.dlist .ditem b { font-size: 16px; }
.resetrow { display: flex; align-items: center; gap: 20px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.resetrow:last-child { border-bottom: 0; }
.resetrow > div { flex: 1; }
.resetrow .help { margin-bottom: 0; }
.asave { flex: none; display: flex; align-items: center; justify-content: flex-end; gap: 14px; padding: 14px 4px 20px; border-top: 1px solid var(--line); }
.asave[hidden] { display: none; }
.asave .btn { padding: 12px 30px; font-size: 17px; }
.asave .dirty { visibility: hidden; color: #fff3b0; font-weight: 800; }
.asave .dirty.on { visibility: visible; }
@media (max-width: 860px) {
  body.adminpage { height: auto; overflow: auto; }
  .admin { height: auto; padding: 0 16px; }
  .admin .ah { flex-wrap: wrap; }
  .admin .ahr { margin-left: 0; width: 100%; }
  .acols { grid-template-columns: 1fr; }
  .apanel { overflow: visible; }
  .admin table { font-size: 14px; }
}
.tn-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.tn-grid input { width: 100%; }
.warnbox { background: #FFF3D6; border: 1px solid #F6C76B; color: #6b4300; padding: 10px 14px; border-radius: 12px; font-size: 15px; margin-bottom: 10px; }

/* 대기 화면 우측 하단: 설정(관리) 페이지로 */
.btn.setlink { position: fixed; right: 24px; bottom: 24px; z-index: 10; text-decoration: none; padding: 11px 18px; font-size: 17px; background: transparent; color: #fff; border: 1px solid rgba(255, 255, 255, .35); box-shadow: none; }
.setlink[hidden] { display: none; }
.btn.setlink:hover { border-color: #fff; }
.host .drawform .dfnext { padding: 6px 12px; border-radius: 99px; background: rgba(255, 255, 255, .15); font-weight: 800; white-space: nowrap; }

/* 스크롤바: 얇고 반투명한 흰색 막대, 화살표·흰 바탕 없음 */
.admin ::-webkit-scrollbar, .admin::-webkit-scrollbar { width: 10px; height: 10px; }
.admin ::-webkit-scrollbar-track { background: transparent; }
.admin ::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .38); border-radius: 99px; border: 2px solid transparent; background-clip: padding-box; }
.admin ::-webkit-scrollbar-thumb:hover { background-color: rgba(255, 255, 255, .6); }
.admin ::-webkit-scrollbar-button { display: none; height: 0; width: 0; }
.admin ::-webkit-scrollbar-corner { background: transparent; }
@supports not selector(::-webkit-scrollbar) { .admin * { scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .45) transparent; } }
.admin textarea::-webkit-resizer { background: transparent; }

/* 경품 목록 편집: 손잡이 · 등수(자동) · 경품 이름 · 인원 · 삭제 */
.pzhead, .pzrow { display: grid; grid-template-columns: 28px 64px 1fr 84px 38px; gap: 8px; align-items: center; }
.pzhead { font-size: 13px; color: var(--tx2); padding: 0 2px 6px; }
.pzrows { display: flex; flex-direction: column; gap: 8px; }
.pzrow { padding: 4px; margin: -4px; border-radius: 14px; transition: background .12s, box-shadow .12s; }
.pzrow.dragging { background: rgba(42, 53, 60, .35); box-shadow: 0 10px 26px rgba(60, 20, 0, .3); }
.pzrow .grip { cursor: grab; touch-action: none; user-select: none; text-align: center; font-size: 22px; line-height: 38px; color: var(--tx2); border-radius: 8px; }
.pzrow .grip:hover { color: #fff; background: rgba(255, 255, 255, .12); }
.pzrow.dragging .grip { cursor: grabbing; }
.pzrow .rk { text-align: center; font-weight: 900; font-size: 16px; padding: 8px 0; border-radius: 10px; background: rgba(42, 53, 60, .3); }
.admin .pzrow input { width: 100%; min-width: 0; }
.pzrow .ib { width: 38px; height: 38px; border-radius: 10px; border: 2px solid var(--line); background: transparent; color: #fff; font: inherit; font-size: 13px; cursor: pointer; }
.pzrow .ib.del:hover { background: #b8332a; border-color: #b8332a; }
.admin .pzadd { width: 100%; margin-top: 10px; padding: 12px; border-style: dashed; font-size: 16px; }
.pzempty { text-align: center; padding: 24px 0; }
.sechead { display: flex; align-items: center; gap: 16px; margin-bottom: 10px; }
.sechead h2 { margin: 0; flex: 1; min-width: 0; }
.sechead .btn { flex: none; }
.admin .pcount { font-size: 15px; padding: 2px 10px; border-radius: 99px; background: rgba(42, 53, 60, .35); vertical-align: middle; }
@media (max-width: 860px) { .sechead { flex-wrap: wrap; } }

/* 경품 추첨 대기 화면 */
.dready { display: none; }
.view.draw.ready .drawhead, .view.draw.ready .dgrid { display: none; }
.view.draw.ready .dready { display: flex; flex-direction: column; align-items: center; gap: 14px; width: 100%; flex: 1; min-height: 0; justify-content: center; }
.dready h2 { margin: 0; font-size: 64px; font-weight: 900; letter-spacing: -1px; }
.dready .drsub { font-size: 24px; color: var(--tx2); font-weight: 800; }
.dready .drnext { display: flex; align-items: baseline; gap: 18px; padding: 18px 40px; border-radius: 24px; background: #fff; color: var(--o2); box-shadow: 0 14px 40px rgba(90, 25, 0, .3); margin: 10px 0 8px; }
.dready .drnext small { font-size: 22px; color: var(--gray); font-weight: 900; }
.dready .drnext b { font-size: 46px; font-weight: 900; }
.dready .drnext span { font-size: 26px; font-weight: 900; color: var(--gray); }
.dready .drlist { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; max-width: 1500px; overflow: hidden; }
.dready .dritem { display: flex; align-items: center; gap: 14px; min-width: 300px; padding: 16px 22px; border-radius: 18px; background: var(--card2); border: 2px solid var(--line); font-size: 24px; font-weight: 900; }
.dready .dritem .rk { padding: 4px 12px; border-radius: 10px; background: var(--gray); font-size: 18px; }
.dready .dritem .nm { flex: 1; }
.dready .dritem .ct { color: var(--tx2); font-size: 20px; }
.dready .dritem.next { border-color: #fff; background: rgba(255, 255, 255, .28); }
.dready .dritem.done { opacity: .5; }
.dready .dritem.done .ct { color: #fff; }

/* ===== 서바이벌(OX · 가위바위보) ===== */
.svtop { display: flex; align-items: center; gap: 22px; width: 100%; }
.svtop .svq { flex: none; padding: 6px 16px; border-radius: 99px; background: var(--gray); font-size: 22px; font-weight: 900; }
.svtop .svqt { flex: 1; min-width: 0; font-size: 40px; font-weight: 900; line-height: 1.3; word-break: keep-all; }
.svtop .svalive { flex: none; font-size: 24px; font-weight: 900; }
.svtop .svalive b { font-size: 44px; color: var(--hl); }
.svrev { margin-top: 10px; font-size: 30px; font-weight: 900; text-align: center; animation: pop .45s; }
.gstage.sv { display: flex; gap: 14px; min-height: 0; height: 100%; }
.sv .svz { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; border-radius: 22px; background: var(--card2); border: 3px solid var(--line); overflow: hidden; transition: background .3s, border-color .3s, opacity .3s; }
.sv .svz.none { flex: .6 1 0; background: rgba(42, 53, 60, .18); border-style: dashed; }
.sv .svz.o { background: rgba(47, 111, 214, .28); }
.sv .svz.x { background: rgba(214, 69, 47, .3); }
.sv .svz.win { border-color: #fff; box-shadow: 0 0 0 4px rgba(255, 255, 255, .5) inset; }
.sv .svz.lose { opacity: .55; }
.sv .svzh { display: flex; align-items: center; justify-content: space-between; padding: 12px 18px; font-size: 30px; font-weight: 900; }
.sv .svzh .cnt { font-size: 34px; color: var(--hl); }
.sv .svzb { flex: 1; min-height: 0; overflow: hidden; display: flex; flex-wrap: wrap; align-content: flex-start; gap: 6px; padding: 4px 12px 12px; }
.sv .svc { font-size: var(--fs, 20px); font-weight: 800; padding: .2em .6em; border-radius: 99px; background: #fff; color: #2a353c; border-left: .45em solid var(--tc, #888); white-space: nowrap; will-change: transform; }
.sv .svc.dead { background: #2a353c; color: rgba(255, 255, 255, .55); text-decoration: line-through; animation: shake .4s; }
.svmq { font-size: 22px; font-weight: 900; line-height: 1.4; text-align: center; padding: 6px 4px 14px; word-break: keep-all; }
.svpick { display: grid; gap: 12px; flex: 1; min-height: 0; }
.svpick.n2 { grid-template-columns: 1fr 1fr; }
.svpick.n3 { grid-template-rows: repeat(3, 1fr); }
.svpick button { border: 4px solid transparent; border-radius: 22px; background: var(--card2); color: #fff; font: inherit; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 110px; transition: transform .1s, border-color .15s, background .15s; }
.svpick.n2 button { min-height: 220px; }
.svpick button .pl { font-size: 64px; line-height: 1; display: flex; align-items: center; gap: 12px; }
.svpick button .pl small { font-size: 26px; font-weight: 900; }
.svpick button .pc { font-size: 16px; color: var(--tx2); font-weight: 800; }
.svpick button.o { background: rgba(47, 111, 214, .55); }
.svpick button.x { background: rgba(214, 69, 47, .55); }
.svpick button.on { border-color: #fff; background: #fff; color: #E94820; transform: scale(1.03); }
.svpick button.on .pc { color: #56636D; }
.svhint { text-align: center; color: var(--tx2); font-size: 15px; margin: 10px 0 0; }

/* 한글이 글자 중간에서 줄바꿈되지 않게(낱말 단위), 버튼 글자는 한 줄 */
body { word-break: keep-all; overflow-wrap: anywhere; }
.btn, .atabs button, .tag, .pcount { white-space: nowrap; }
.host { max-width: calc(100vw - 24px); flex-wrap: wrap; justify-content: center; }
.gchk span:last-child { min-width: 0; }

.host-on .tchip { cursor: pointer; }
.host-on .tchip:hover { border-color: #fff; background: rgba(255, 255, 255, .26); }

/* OX 무기명: 이름 없이 팀 색 점만 움직임 */
.sv.anon .svzb { gap: 8px; padding: 8px 16px 16px; }
.sv.anon .svc { width: calc(var(--fs, 20px) * 1.6); height: calc(var(--fs, 20px) * 1.6); padding: 0; border: 0; border-radius: 50%; background: var(--tc, #fff); box-shadow: 0 0 0 3px rgba(255, 255, 255, .85); }
.sv.anon .svc.dead { background: #2a353c; box-shadow: 0 0 0 3px rgba(255, 255, 255, .25); text-decoration: none; }

/* ===== 아이폰: 노치·홈 막대 피하기, 주소창 높이 변화, 작은 화면 ===== */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
.mobile { min-height: 100vh; min-height: -webkit-fill-available; min-height: 100dvh; }
.mobile .top { padding-top: calc(12px + env(safe-area-inset-top, 0px)); padding-left: calc(16px + env(safe-area-inset-left, 0px)); padding-right: calc(16px + env(safe-area-inset-right, 0px)); }
.mobile main { padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px)); padding-left: calc(16px + env(safe-area-inset-left, 0px)); padding-right: calc(16px + env(safe-area-inset-right, 0px)); }
.mobile .countdown { padding-bottom: env(safe-area-inset-bottom, 0px); }
@media (max-height: 720px) {
  .m-big { font-size: 72px; }
  .m-center .big { font-size: 48px; }
  .m-center h2 { font-size: 24px; }
  .tapbtn { width: min(62vw, 260px); font-size: 40px; }
  .svpick.n2 button { min-height: 160px; }
  .svpick button { min-height: 84px; }
  .svpick button .pl { font-size: 50px; }
  .svmq { font-size: 19px; padding-bottom: 8px; }
}
