/* 비밀 번호 쟁탈전 — 파티게임/아케이드 톤 스타일 */

:root {
  --bg-0: #10061f;
  --bg-1: #1d0a38;
  --bg-2: #2a0b45;
  --pink: #ff2e88;
  --pink-soft: #ff7ab5;
  --cyan: #22e6ff;
  --lime: #7cff6b;
  --yellow: #ffd93d;
  --violet: #a86bff;
  --orange: #ff8a3d;
  --ink: #ffffff;
  --muted: #b9a8d6;
  --panel: rgba(255, 255, 255, 0.07);
  --panel-strong: rgba(255, 255, 255, 0.12);
  --line: rgba(255, 255, 255, 0.16);
  --radius: 18px;
  --shadow-neon: 0 0 0 2px rgba(255, 46, 136, 0.35), 0 12px 32px rgba(255, 46, 136, 0.25);
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg-0);
  color: var(--ink);
  font-family: 'Jua', 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.5;
  overscroll-behavior: none;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(1100px 600px at 12% -10%, rgba(255, 46, 136, 0.35), transparent 60%),
    radial-gradient(900px 560px at 92% 4%, rgba(34, 230, 255, 0.24), transparent 62%),
    radial-gradient(900px 700px at 50% 108%, rgba(168, 107, 255, 0.3), transparent 60%),
    linear-gradient(170deg, var(--bg-1), var(--bg-0) 55%, var(--bg-2));
}

body::after { /* 은은한 스캔라인 — 아케이드 느낌 */
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.28;
  background: repeating-linear-gradient(to bottom, rgba(255, 255, 255, 0.05) 0 1px, transparent 1px 4px);
}

h1, h2, h3, .display { font-family: 'Black Han Sans', 'Jua', sans-serif; font-weight: 400; letter-spacing: -0.01em; }

/* ---------------- 레이아웃 ---------------- */
.app { min-height: 100dvh; display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  background: rgba(16, 6, 31, 0.72);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar .brand {
  font-family: 'Black Han Sans', sans-serif; font-size: 17px; letter-spacing: -0.02em;
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.topbar .brand span { color: var(--pink); }
.topbar .spacer { flex: 1; }

.chip {
  font-size: 12px; padding: 4px 10px; border-radius: 999px;
  background: var(--panel); border: 1px solid var(--line); color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0;
}
.topbar .btn { flex: none; }
.chip.live { color: var(--lime); border-color: rgba(124, 255, 107, 0.45); }

.screen {
  flex: 1; width: 100%; max-width: 720px; margin: 0 auto;
  padding: 18px 16px calc(28px + var(--safe-b));
  display: flex; flex-direction: column; gap: 16px;
  animation: screen-in 0.32s ease both;
  /* 등장 애니메이션의 scale 오버슈트가 순간적으로 뷰포트를 넘겨
     가로 스크롤이 생기는 것을 막는다. clip 이라 세로 스크롤은 그대로. */
  overflow-x: clip;
}
@keyframes screen-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.card.tight { padding: 14px; }
.card, .screen, .name-tag, .vs-player, .res-row, .rank-item { min-width: 0; }
.lt-name, .res-name, .name-tag, .vs-player, .title { overflow-wrap: anywhere; }

.eyebrow { font-size: 12px; letter-spacing: 0.16em; color: var(--pink-soft); text-transform: uppercase; margin: 0 0 6px; }
.title { font-size: clamp(26px, 7vw, 40px); margin: 0 0 6px; line-height: 1.15; }
.subtitle { color: var(--muted); margin: 0; font-size: 15px; }
.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* ---------------- 버튼 ---------------- */
.btn {
  appearance: none; border: none; cursor: pointer;
  font-family: inherit; font-size: 16px; font-weight: 400;
  padding: 13px 20px; border-radius: 14px;
  background: linear-gradient(135deg, var(--pink), #ff5f4d);
  color: #fff;
  box-shadow: 0 5px 0 #a5185a, 0 10px 24px rgba(255, 46, 136, 0.3);
  transition: transform 0.08s ease, box-shadow 0.08s ease, filter 0.15s ease;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 #a5185a; }
.btn:disabled { opacity: 0.42; cursor: not-allowed; transform: none; box-shadow: 0 5px 0 rgba(0,0,0,0.3); filter: none; }
.btn-hero { width: 100%; font-size: 20px; padding: 17px 20px; font-family: 'Black Han Sans', sans-serif; }
.btn-cyan { background: linear-gradient(135deg, var(--cyan), #3a7bff); box-shadow: 0 5px 0 #0d6b87, 0 10px 24px rgba(34, 230, 255, 0.25); }
.btn-cyan:active { box-shadow: 0 1px 0 #0d6b87; }
.btn-lime { background: linear-gradient(135deg, var(--lime), #21c97a); color: #06301b; box-shadow: 0 5px 0 #2b8a52; }
.btn-lime:active { box-shadow: 0 1px 0 #2b8a52; }
.btn-ghost { background: transparent; border: 1px solid var(--line); color: var(--muted); box-shadow: none; }
.btn-ghost:hover { background: var(--panel); color: #fff; }
.btn-ghost:active { transform: translateY(2px); box-shadow: none; }
.btn-sm { font-size: 14px; padding: 9px 14px; border-radius: 11px; box-shadow: 0 3px 0 rgba(0,0,0,0.35); }
.btn-danger { background: linear-gradient(135deg, #ff4d4d, #b8002f); box-shadow: 0 4px 0 #7c0020; }
.btn-row { display: flex; gap: 10px; }
.btn-row > * { flex: 1; }

.field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.field label { font-size: 14px; color: var(--muted); }
input[type="text"], input[type="number"], input[type="password"], select {
  width: 100%; font-family: inherit; font-size: 18px;
  padding: 14px 16px; border-radius: 14px;
  background: rgba(0, 0, 0, 0.32); color: #fff;
  border: 2px solid var(--line); outline: none;
  /* iOS WebKit 은 select/input 을 고유 콘텐츠 폭 아래로 줄이지 않는다.
     이 세 줄이 없으면 긴 option 텍스트가 뷰포트를 넘겨 화면 전체가 축소된다. */
  min-width: 0; max-width: 100%;
  text-overflow: ellipsis;
}
/* iOS 는 기본 appearance 상태의 select 에 background/color 를 적용하지 않는다.
   직접 그리고 화살표도 data URI 로 붙인다. */
select {
  -webkit-appearance: none; appearance: none;
  padding-right: 44px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23b9a8d6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 12px 8px;
}
/* 체크박스/라디오는 네이티브 렌더링을 유지해야 하므로 텍스트 입력에만 적용 */
input[type="text"], input[type="number"], input[type="password"] {
  -webkit-appearance: none; appearance: none;
}
.game-picker + .game-picker { margin-top: 14px; }
.picker-note { margin: 0; font-size: 13px; color: var(--muted); }
input:focus, select:focus { border-color: var(--pink); box-shadow: 0 0 0 4px rgba(255, 46, 136, 0.18); }
select option { background: #1d0a38; }

/* ---------------- 번호 그리드 ---------------- */
.num-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 10px; }
.num-grid.dense { grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 8px; }

.num {
  position: relative; aspect-ratio: 1 / 1;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Black Han Sans', sans-serif; font-size: clamp(20px, 5.5vw, 26px);
  border-radius: 16px; cursor: pointer;
  background: linear-gradient(160deg, rgba(255,255,255,0.14), rgba(255,255,255,0.05));
  border: 2px solid var(--line); color: #fff;
  transition: transform 0.1s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  appearance: none; font-weight: 400;
}
.num:hover:not(:disabled) { border-color: var(--pink); transform: translateY(-3px); box-shadow: var(--shadow-neon); }
.num:active:not(:disabled) { transform: scale(0.94); }
.num.is-selected { border-color: var(--yellow); background: linear-gradient(160deg, rgba(255,217,61,0.35), rgba(255,138,61,0.2)); box-shadow: 0 0 0 3px rgba(255,217,61,0.3); }
.num.is-locked { opacity: 0.4; cursor: not-allowed; border-style: dashed; }
.num.is-empty { border-color: rgba(34,230,255,0.5); }
.num .num-owner {
  position: absolute; bottom: 4px; left: 4px; right: 4px;
  font-family: 'Jua', sans-serif; font-size: 10px; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ---------------- 공개(REVEAL) ---------------- */
.reveal-stage { min-height: 210px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; }
.reveal-num {
  font-family: 'Black Han Sans', sans-serif; font-size: clamp(56px, 18vw, 96px); line-height: 1;
  animation: pop 0.45s cubic-bezier(0.2, 1.5, 0.4, 1) both;
}
@keyframes pop { 0% { transform: scale(0.3) rotate(-12deg); opacity: 0; } 60% { transform: scale(1.15) rotate(3deg); } 100% { transform: scale(1); opacity: 1; } }
.reveal-verdict { font-family: 'Black Han Sans', sans-serif; font-size: 22px; }
.reveal-verdict.empty { color: var(--muted); }
.reveal-verdict.safe { color: var(--lime); text-shadow: 0 0 18px rgba(124,255,107,0.6); }
.reveal-verdict.battle { color: var(--pink); text-shadow: 0 0 22px rgba(255,46,136,0.8); animation: shake 0.4s ease 2; }
@keyframes shake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.reveal-names { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.name-tag {
  padding: 7px 14px; border-radius: 999px; background: var(--panel-strong);
  border: 1px solid var(--line); font-size: 15px;
  animation: pop 0.35s cubic-bezier(0.2, 1.5, 0.4, 1) both;
}
.name-tag.hot { border-color: var(--pink); background: rgba(255,46,136,0.22); }
.name-tag.win { border-color: var(--yellow); background: rgba(255,217,61,0.22); color: var(--yellow); }

.reveal-board { display: grid; grid-template-columns: repeat(auto-fill, minmax(56px, 1fr)); gap: 7px; }
.rv { aspect-ratio: 1/1; border-radius: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-size: 18px; font-family: 'Black Han Sans', sans-serif; border: 2px solid var(--line); background: rgba(0,0,0,0.25); color: rgba(255,255,255,0.25); }
.rv.done { color: #fff; animation: pop 0.3s ease both; }
.rv.k-EMPTY.done { border-color: rgba(34,230,255,0.45); color: var(--cyan); }
.rv.k-SAFE.done { border-color: rgba(124,255,107,0.55); color: var(--lime); background: rgba(124,255,107,0.12); }
.rv.k-BATTLE.done { border-color: var(--pink); color: var(--pink); background: rgba(255,46,136,0.18); box-shadow: 0 0 14px rgba(255,46,136,0.4); }
.rv small { font-family: 'Jua', sans-serif; font-size: 10px; opacity: 0.95; margin-top: 1px; }

/* ---------------- VS 연출 ---------------- */
.vs-stage { text-align: center; padding: 12px 0; }
.vs-number {
  display: inline-block; /* 블록이면 컨테이너 폭 전체가 scale 되어 화면 밖으로 나간다 */
  font-family: 'Black Han Sans', sans-serif; font-size: clamp(44px, 14vw, 76px); line-height: 1;
  color: var(--yellow); text-shadow: 0 0 30px rgba(255, 217, 61, 0.7);
  animation: pop 0.5s cubic-bezier(0.2, 1.6, 0.4, 1) both;
}
.vs-list { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px; margin-top: 14px; }
.vs-player {
  padding: 10px 18px; border-radius: 14px; font-size: 18px;
  background: linear-gradient(150deg, rgba(255,46,136,0.28), rgba(168,107,255,0.2));
  border: 2px solid rgba(255,46,136,0.55);
  animation: pop 0.4s cubic-bezier(0.2, 1.5, 0.4, 1) both;
}
.vs-pair { display: inline-flex; align-items: center; gap: 10px; }
.vs-sep { font-family: 'Black Han Sans', sans-serif; font-size: 22px; color: var(--cyan); text-shadow: 0 0 16px var(--cyan); animation: blink 0.9s infinite; }
@keyframes blink { 50% { opacity: 0.35; } }

/* ---------------- 럭키 타이밍 ---------------- */
.lt, .fc { display: flex; flex-direction: column; gap: 16px; align-items: center; text-align: center; }
.lt-turn-label { font-size: 12px; letter-spacing: 0.14em; color: var(--muted); }
.lt-name { font-size: clamp(26px, 8vw, 38px); margin: 4px 0 2px; }
.lt-sub { margin: 0; color: var(--muted); font-size: 14px; }
.lt-gauge { width: 100%; }
.lt-track {
  position: relative; height: 46px; border-radius: 14px;
  background: linear-gradient(90deg, #2b1150, #4a1470 40%, #7a1f6b 70%, #b8235c);
  border: 2px solid var(--line); overflow: hidden;
}
.lt-track::after {
  content: ''; position: absolute; inset: 0;
  background: repeating-linear-gradient(90deg, rgba(255,255,255,0.13) 0 2px, transparent 2px 10%);
}
.lt-marker {
  position: absolute; top: -4px; bottom: -4px; width: 6px; margin-left: -3px;
  background: #fff; border-radius: 4px; box-shadow: 0 0 14px 3px rgba(255,255,255,0.85); z-index: 2;
}
.lt-scale { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-top: 5px; }
.lt-action { max-width: 420px; }
.lt-action.is-stop { background: linear-gradient(135deg, #ff3b3b, #ff8a3d); box-shadow: 0 5px 0 #a01414, 0 10px 26px rgba(255,60,60,0.4); animation: pulse 0.6s infinite; }
@keyframes pulse { 50% { filter: brightness(1.22); } }
.lt-secret { font-size: 12px; color: var(--muted); margin: 0; }
.lt-done { list-style: none; padding: 0; margin: 0; width: 100%; display: flex; flex-direction: column; gap: 6px; }
.lt-done li { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; padding: 8px 12px; background: rgba(0,0,0,0.25); border-radius: 10px; }
.lt-done li b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lt-done span { color: var(--cyan); }
.lt-stopped .lt-stamp {
  font-family: 'Black Han Sans', sans-serif; font-size: 32px; color: var(--pink);
  border: 4px solid var(--pink); border-radius: 12px; padding: 2px 18px; transform: rotate(-8deg);
  animation: stamp 0.35s cubic-bezier(0.2, 1.8, 0.4, 1) both;
}
@keyframes stamp { 0% { transform: scale(1.8) rotate(-8deg); opacity: 0; } 100% { transform: scale(1) rotate(-8deg); opacity: 1; } }
.lt-value { font-family: 'Black Han Sans', sans-serif; font-size: 64px; line-height: 1; color: var(--yellow); }

/* ---------------- 운명의 카드 ---------------- */
.fc-deck { display: grid; grid-template-columns: repeat(auto-fit, minmax(64px, 1fr)); column-gap: 10px; row-gap: 32px; width: 100%; }
.fc-card {
  position: relative; aspect-ratio: 3 / 4.4; border-radius: 14px; cursor: pointer;
  border: none; padding: 0; background: none; transform-style: preserve-3d;
  transition: transform 0.5s cubic-bezier(0.3, 1.2, 0.4, 1);
  animation: deal 0.4s ease both; animation-delay: calc(var(--i) * 60ms);
}
@keyframes deal { from { opacity: 0; transform: translateY(24px) rotate(6deg); } to { opacity: 1; transform: none; } }
.fc-face {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  border-radius: 14px; backface-visibility: hidden; font-family: 'Black Han Sans', sans-serif;
}
.fc-back {
  font-size: 30px; color: rgba(255,255,255,0.9);
  background: linear-gradient(150deg, #3d1163, #7a1f8f 60%, #b8235c);
  border: 2px solid rgba(255,255,255,0.35);
  box-shadow: inset 0 0 22px rgba(0,0,0,0.45);
}
.fc-front {
  font-size: 20px; color: #2a0b45; transform: rotateY(180deg);
  background: linear-gradient(150deg, #fff3c4, var(--yellow));
  border: 2px solid #fff;
}
.fc-card.is-open { transform: rotateY(180deg); }
.fc-card.is-taken:not(.is-open) .fc-back { filter: grayscale(0.6) brightness(0.55); }
.fc-card:hover:not([disabled]) { transform: translateY(-8px) scale(1.03); }
.fc-card.just-taken { animation: pop 0.35s ease both; }
.fc-owner {
  position: absolute; left: -4px; right: -4px; bottom: -21px; font-size: 11px; color: var(--muted);
  font-family: 'Jua', sans-serif; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center;
}
.fc-deck { padding-bottom: 8px; }
.fc-card.is-taken { cursor: default; }
.fc-card.is-taken:hover:not([disabled]) { transform: none; }

/* ---------------- 결과 / 순위 ---------------- */
.headline-box {
  text-align: center; padding: 18px; border-radius: var(--radius);
  background: linear-gradient(150deg, rgba(255,217,61,0.2), rgba(255,138,61,0.12));
  border: 2px solid rgba(255,217,61,0.5);
}
.headline-box .hl-label { font-size: 12px; letter-spacing: 0.2em; color: var(--yellow); }
.headline-box .hl-value { font-family: 'Black Han Sans', sans-serif; font-size: clamp(44px, 14vw, 72px); line-height: 1.05; }

.rank-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.rank-item {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  border-radius: 14px; background: var(--panel); border: 1px solid var(--line);
  animation: slide-in 0.4s cubic-bezier(0.2, 1.3, 0.4, 1) both;
}
@keyframes slide-in { from { opacity: 0; transform: translateX(-26px); } to { opacity: 1; transform: none; } }
.rank-item .medal { font-family: 'Black Han Sans', sans-serif; font-size: 20px; min-width: 46px; text-align: center; color: var(--muted); }
.rank-item .who { flex: 1; min-width: 0; font-size: 17px; overflow-wrap: anywhere; }
.rank-item .val { font-size: 14px; color: var(--cyan); text-align: right; white-space: nowrap; }
.rank-item .note { font-size: 12px; color: var(--muted); }
.rank-item.top {
  border-color: var(--yellow); background: linear-gradient(120deg, rgba(255,217,61,0.24), rgba(255,138,61,0.12));
  box-shadow: 0 0 26px rgba(255,217,61,0.32);
}
.rank-item.top .medal { color: var(--yellow); font-size: 24px; }

/* ---------------- KEEP / PASS ---------------- */
.kp-question { text-align: center; }
.kp-number {
  font-family: 'Black Han Sans', sans-serif; font-size: clamp(52px, 17vw, 88px); line-height: 1;
  color: var(--yellow); text-shadow: 0 0 28px rgba(255,217,61,0.55);
}
.kp-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.kp-btn {
  appearance: none; border: none; cursor: pointer; font-family: 'Black Han Sans', sans-serif;
  padding: 22px 12px; border-radius: 18px; font-size: 24px; color: #fff;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  transition: transform 0.09s ease, filter 0.15s;
}
.kp-btn small { font-family: 'Jua', sans-serif; font-size: 12px; opacity: 0.9; font-weight: 400; }
.kp-keep { background: linear-gradient(140deg, var(--lime), #1fae6a); color: #052a17; box-shadow: 0 6px 0 #16794a; }
.kp-pass { background: linear-gradient(140deg, var(--cyan), #3a7bff); box-shadow: 0 6px 0 #14607f; }
.kp-btn:hover { filter: brightness(1.1); }
.kp-btn:active { transform: translateY(5px); box-shadow: none; }
.kp-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.kp-queue { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.kp-queue .name-tag { font-size: 13px; opacity: 0.75; }
.kp-queue .name-tag.now { opacity: 1; border-color: var(--yellow); color: var(--yellow); }

/* ---------------- 최종 결과 ---------------- */
.result-grid { display: flex; flex-direction: column; gap: 8px; }
.res-row {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px;
  background: var(--panel); border: 1px solid var(--line);
  animation: slide-in 0.35s cubic-bezier(0.2, 1.3, 0.4, 1) both;
}
.res-row .res-num {
  font-family: 'Black Han Sans', sans-serif; font-size: 24px; min-width: 54px; height: 46px;
  display: flex; align-items: center; justify-content: center; border-radius: 12px;
  background: linear-gradient(150deg, rgba(255,217,61,0.28), rgba(255,138,61,0.16));
  border: 2px solid rgba(255,217,61,0.5); color: var(--yellow);
}
.res-row .res-body { flex: 1; min-width: 0; }
.res-row .res-name { font-size: 17px; }
.res-row .res-meta { font-size: 12px; color: var(--muted); }
.badge {
  font-size: 11px; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line);
  color: var(--muted); white-space: nowrap;
}
.badge.KEEP, .badge.AUTO_KEEP { color: var(--lime); border-color: rgba(124,255,107,0.5); }
.badge.PASS { color: var(--cyan); border-color: rgba(34,230,255,0.5); }
.badge.SOLO { color: var(--yellow); border-color: rgba(255,217,61,0.5); }
.badge.FINAL { color: var(--violet); border-color: rgba(168,107,255,0.55); }
.changed { color: var(--pink); }

.tabs { display: flex; gap: 8px; }
.tab {
  flex: 1; padding: 10px; border-radius: 12px; text-align: center; cursor: pointer;
  background: var(--panel); border: 1px solid var(--line); color: var(--muted); font-family: inherit; font-size: 14px;
}
.tab.on { background: rgba(255,46,136,0.2); border-color: var(--pink); color: #fff; }

/* ---------------- 오버레이 ---------------- */
.overlay {
  position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center;
  background: rgba(8, 3, 16, 0.82); padding: 20px;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  animation: fade 0.2s ease both;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.countdown {
  font-family: 'Black Han Sans', sans-serif; font-size: min(46vw, 220px); line-height: 1; color: #fff;
  text-shadow: 0 0 60px var(--pink), 0 0 120px var(--pink);
  animation: count 0.85s cubic-bezier(0.2, 1.2, 0.4, 1) both;
}
.countdown.go { font-size: min(24vw, 140px); color: var(--lime); text-shadow: 0 0 60px var(--lime); }
@keyframes count { 0% { transform: scale(2.6); opacity: 0; } 30% { transform: scale(1); opacity: 1; } 80% { transform: scale(1); opacity: 1; } 100% { transform: scale(0.6); opacity: 0; } }

.modal {
  width: 100%; max-width: 420px; background: linear-gradient(160deg, #2a0f4d, #1a0733);
  border: 2px solid var(--line); border-radius: 22px; padding: 22px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.6);
  animation: pop 0.28s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}
.modal h3 { margin: 0 0 10px; font-size: 22px; }
.modal p { margin: 0 0 18px; color: var(--muted); font-size: 15px; white-space: pre-line; }

.drawer {
  position: fixed; inset: 0; z-index: 55; display: flex; justify-content: flex-end;
  background: rgba(8, 3, 16, 0.65); animation: fade 0.18s ease both;
}
.drawer-panel {
  width: min(400px, 92vw); height: 100%; overflow-y: auto;
  background: linear-gradient(180deg, #240c44, #150629);
  border-left: 2px solid var(--line); padding: 18px 16px calc(28px + var(--safe-b));
  display: flex; flex-direction: column; gap: 14px;
  animation: slide-left 0.26s cubic-bezier(0.2, 1, 0.3, 1) both;
}
@keyframes slide-left { from { transform: translateX(100%); } to { transform: none; } }
.drawer h3 { margin: 0; font-size: 20px; }
.drawer .kv { display: flex; justify-content: space-between; font-size: 14px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.drawer .kv b { color: var(--cyan); font-weight: 400; }
.drawer .group { display: flex; flex-direction: column; gap: 8px; }
.drawer .group-title { font-size: 12px; letter-spacing: 0.14em; color: var(--pink-soft); }
.roster { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.roster li { font-size: 13px; padding: 5px 11px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); }

.toast {
  position: fixed; left: 50%; bottom: calc(22px + var(--safe-b)); transform: translateX(-50%);
  z-index: 70; max-width: 90vw; padding: 12px 18px; border-radius: 14px;
  background: rgba(255, 46, 136, 0.95); color: #fff; font-size: 14px; text-align: center;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
  animation: toast-in 0.25s ease both;
}
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 16px); } to { opacity: 1; transform: translate(-50%, 0); } }

#confetti { position: fixed; inset: 0; z-index: 65; pointer-events: none; }

.handoff {
  text-align: center; padding: 30px 18px;
  border-radius: var(--radius);
  background: linear-gradient(150deg, rgba(124,255,107,0.16), rgba(34,230,255,0.1));
  border: 2px solid rgba(124,255,107,0.4);
}
.handoff .lock { font-size: 62px; animation: pop 0.5s cubic-bezier(0.2, 1.6, 0.4, 1) both; }

.stepper { display: flex; align-items: center; gap: 12px; justify-content: center; }
.stepper button {
  width: 54px; height: 54px; border-radius: 16px; font-size: 26px; font-family: 'Black Han Sans', sans-serif;
  border: 2px solid var(--line); background: var(--panel); color: #fff; cursor: pointer;
}
.stepper button:active { transform: scale(0.93); }
.stepper .val { font-family: 'Black Han Sans', sans-serif; font-size: 52px; min-width: 100px; text-align: center; color: var(--yellow); }

.hidden { display: none !important; }

@media (max-width: 380px) {
  .num-grid { grid-template-columns: repeat(auto-fill, minmax(56px, 1fr)); }
  .kp-btn { font-size: 20px; padding: 18px 8px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ================================================================
   홈 · 대메뉴
   ================================================================ */
.home-hero .title { font-size: clamp(30px, 9vw, 46px); }

.menu-list { display: flex; flex-direction: column; gap: 12px; }

.menu-card {
  display: flex; align-items: center; gap: 14px; width: 100%; min-width: 0;
  padding: 18px 16px; border-radius: var(--radius); cursor: pointer;
  font-family: inherit; text-align: left; color: #fff;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 26%, transparent), rgba(255,255,255,0.05));
  border: 2px solid color-mix(in srgb, var(--accent) 55%, transparent);
  transition: transform 0.1s ease, box-shadow 0.18s ease, filter 0.18s ease;
}
@supports not (color: color-mix(in srgb, red, blue)) {
  .menu-card { background: var(--panel); border-color: var(--line); }
}
.menu-card:hover { transform: translateY(-3px); filter: brightness(1.08); box-shadow: 0 12px 30px rgba(0,0,0,0.35); }
.menu-card:active { transform: translateY(2px); }
.menu-icon { font-size: 38px; line-height: 1; flex: none; }
.menu-body { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.menu-title { font-family: 'Black Han Sans', sans-serif; font-size: 22px; }
.menu-desc { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.menu-status {
  margin-top: 4px; font-size: 12px; color: var(--lime);
  border: 1px solid rgba(124,255,107,0.4); border-radius: 999px;
  padding: 3px 10px; align-self: flex-start;
}
.menu-arrow { font-size: 30px; color: var(--muted); flex: none; line-height: 1; }

.topbar-home { flex: none; }
