/* ============================================================
   LOBBY — 시작 화면 (#start-overlay)
   레이아웃: 상단 바(레벨/XP·코인·사운드) → 로고 → 무대(3D 히어로 + 좌우 아이콘 레일)
            → 하단 독(메인 CAMPAIGN + 온라인 대전 + '다른 모드' 시트 버튼)
   세로: 한 컬럼 / 가로·데스크톱: 왼쪽 무대 + 오른쪽 로고·독
   색·반경·그림자는 base.css 토큰만 사용.
   ============================================================ */

/* ===== 오버레이 + 배경 ===== */
#start-overlay {
    position: fixed; inset: 0;
    z-index: 700;
    overflow: hidden;
    background:
        radial-gradient(120% 70% at 50% 42%, var(--bg-2) 0%, rgba(74,43,184,0) 70%),
        linear-gradient(180deg, var(--bg-1) 0%, var(--bg-0) 100%);
}
#start-overlay.hidden { display: none; }

.lobby-bg { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.lobby-bg > i { position: absolute; display: block; }
/* 히어로 뒤에서 천천히 도는 빛줄기 */
.lobby-bg-rays {
    left: 50%; top: 44%;
    width: 170vmax; height: 170vmax;
    margin: -85vmax 0 0 -85vmax;
    background: repeating-conic-gradient(from 0deg, rgba(255,255,255,0.075) 0deg 9deg, rgba(255,255,255,0) 9deg 24deg);
    -webkit-mask-image: radial-gradient(circle, #000 0%, rgba(0,0,0,0.5) 22%, transparent 46%);
            mask-image: radial-gradient(circle, #000 0%, rgba(0,0,0,0.5) 22%, transparent 46%);
    animation: lobby-rays 70s linear infinite;
}
/* 물방울 무늬 */
.lobby-bg-dots {
    inset: 0;
    background-image:
        radial-gradient(circle, rgba(255,255,255,0.07) 0 3px, transparent 4px),
        radial-gradient(circle, rgba(255,255,255,0.05) 0 2px, transparent 3px);
    background-size: 56px 56px, 56px 56px;
    background-position: 0 0, 28px 28px;
    -webkit-mask-image: linear-gradient(180deg, #000 0%, transparent 55%);
            mask-image: linear-gradient(180deg, #000 0%, transparent 55%);
}
/* 무대 바닥 (둥근 지평선) */
.lobby-bg-floor {
    left: -30%; right: -30%; bottom: -6%; height: 44%;
    border-radius: 50% 50% 0 0 / 34% 34% 0 0;
    border-top: var(--line) solid rgba(255,255,255,0.14);
    background:
        radial-gradient(60% 55% at 50% 0%, rgba(162,116,255,0.5) 0%, rgba(162,116,255,0) 100%),
        linear-gradient(180deg, var(--panel-2) 0%, var(--bg-0) 78%);
}
@keyframes lobby-rays { to { transform: rotate(360deg); } }

/* 구 2D 퍼레이드 컨테이너(현재 미사용, JS 가 존재 여부만 확인) */
#parade-container { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }

/* ===== 골격 ===== */
#start-box {
    --chip: 46px;          /* 레일 아이콘 지름 */
    --play-h: 70px;        /* 메인 버튼 높이 */
    --tile-h: 50px;        /* 보조 버튼 높이 */
    position: relative; z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    row-gap: 6px;
    width: 100%; max-width: 540px; height: 100%;
    margin: 0 auto;
    padding: calc(var(--sa-t) + 8px) calc(var(--sa-r) + 12px) calc(var(--sa-b) + 12px) calc(var(--sa-l) + 12px);
}

/* ===== 상단 바 ===== */
.lobby-top { min-height: 44px; padding-right: 52px; /* 사운드 버튼 자리 */ display: flex; align-items: center; }
#start-profile-info {
    flex: 1; min-width: 0;
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.profile-level-row { display: flex; align-items: center; min-width: 0; }
.profile-level-badge {
    position: relative; z-index: 1; flex: none;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    width: 44px; height: 44px;
    border: var(--line) solid var(--ink); border-radius: 14px;
    background: linear-gradient(180deg, rgba(255,255,255,0.4) 0%, rgba(255,255,255,0) 50%), var(--yellow);
    box-shadow: inset 0 -4px 0 var(--yellow-d), var(--shadow-sm);
    color: var(--text-on-bright);
    font-family: var(--font-display); font-size: var(--fs-lg); font-weight: 900; line-height: 1;
    padding-bottom: 3px;
    transform: rotate(-4deg);
}
.profile-level-badge small { font-size: 9px; font-weight: 900; letter-spacing: 0.5px; opacity: 0.75; }
.profile-level-meta {
    position: relative;
    width: clamp(96px, 34vw, 170px);
    margin-left: -8px;
}
.profile-xp-bar {
    position: relative;
    height: 22px;
    border: 2px solid var(--ink); border-left: 0;
    border-radius: 0 var(--r-pill) var(--r-pill) 0;
    background: rgba(18,11,51,0.75);
    overflow: hidden;
}
.profile-xp-fill {
    height: 100%; min-width: 10px;
    background: linear-gradient(180deg, rgba(255,255,255,0.45), rgba(255,255,255,0) 55%), var(--blue);
    transition: width 0.5s var(--ease-out);
}
.profile-xp-text {
    position: absolute; inset: 0; padding-left: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: var(--fs-xs); font-weight: 900; font-variant-numeric: tabular-nums;
    text-shadow: 0 1px 0 var(--ink), 0 0 3px var(--ink);
}
/* 프레스티지 ★ / 연승 🔥 태그: XP 바 아래에 매달림 */
.profile-tags {
    position: absolute; left: 12px; top: 100%; margin-top: -3px; z-index: 1;
    display: flex; gap: 4px; white-space: nowrap;
}
.profile-tags:empty { display: none; }
.profile-tags .prestige-badge, .profile-tags .profile-streak-badge {
    display: inline-flex; align-items: center;
    height: 18px; padding: 0 6px;
    border: 2px solid var(--ink); border-radius: var(--r-pill);
    font-size: 10px; font-weight: 900; line-height: 1;
}
.profile-tags .prestige-badge { background: var(--yellow); color: var(--text-on-bright); font-weight: 900; }
.profile-tags .profile-streak-badge { background: var(--red); color: #fff; margin: 0; box-shadow: none; }

.profile-coins-row {
    flex: none;
    display: inline-flex; align-items: center; gap: 5px;
    min-height: 34px; padding: 0 12px 0 6px;
    border: 2px solid var(--ink); border-radius: var(--r-pill);
    background: rgba(18,11,51,0.75);
    box-shadow: var(--shadow-sm);
}
.profile-coins-icon { font-size: 18px; line-height: 1; }
.profile-coins-text {
    font-family: var(--font-display); font-size: var(--fs-md); font-weight: 900;
    color: var(--yellow); font-variant-numeric: tabular-nums;
}

/* 사운드 버튼: audio.js 가 인라인 스타일로 만들기 때문에 !important 로 덮어쓴다 */
#start-sound-btn {
    position: absolute !important;
    top: calc(var(--sa-t) + 8px) !important; right: calc(var(--sa-r) + 12px) !important;
    z-index: 5 !important;
    width: 44px !important; height: 44px !important;
    border: var(--line) solid var(--ink) !important; border-radius: 14px !important;
    background: linear-gradient(180deg, rgba(255,255,255,0.22) 0%, rgba(255,255,255,0) 50%), var(--panel-3) !important;
    box-shadow: inset 0 -4px 0 var(--panel), var(--shadow-sm);
    padding-bottom: 3px !important;
    font-size: 20px !important;
}
#start-sound-btn:active { transform: translateY(2px); box-shadow: inset 0 -2px 0 var(--panel); }

/* ===== 로고 ===== */
.lobby-logo { text-align: center; pointer-events: none; padding-top: 4px; }
.lobby-logo h1 {
    display: inline-block;
    font-family: var(--font-display);
    font-size: clamp(28px, 9.4vw, 44px); font-weight: 900; line-height: 1;
    letter-spacing: -0.5px; white-space: nowrap;
    color: var(--yellow);
    text-shadow: var(--text-outline), 0 7px 0 rgba(0,0,0,0.25);
    transform: rotate(-3deg);
}
.lobby-logo p {
    margin-top: 10px;
    font-size: var(--fs-xs); font-weight: 700; line-height: 1.45;
    color: var(--text-dim);
}

/* ===== 무대: 히어로 ===== */
.lobby-stage { position: relative; min-height: 0; }
#start-hero {
    position: absolute; inset: 0;
    display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
    padding-bottom: 2px;
}
.hero-figure {
    position: relative;
    flex: 1 1 0; min-height: 0;
    aspect-ratio: 3 / 4; max-width: 100%;
    touch-action: none;           /* 가로 드래그로 회전 */
    cursor: grab;
    -webkit-user-select: none; user-select: none;
}
.hero-figure.dragging { cursor: grabbing; }
.hero-static .hero-figure { cursor: default; }
.hero-halo {
    position: absolute; left: 50%; top: 46%;
    width: 96%; aspect-ratio: 1;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, rgba(198,173,255,0.2) 38%, rgba(162,116,255,0) 68%);
    animation: hero-halo 4s ease-in-out infinite;
    pointer-events: none;
}
/* 발밑 원형 무대 (캐릭터 발은 프레임 아래에서 11% 지점 — char-preview.js createLive 의 FEET_AT) */
.hero-pedestal {
    position: absolute; left: 50%; bottom: 6.5%;
    width: 74%; aspect-ratio: 3.4 / 1;
    transform: translate(-50%, 56%);
    border: var(--line) solid var(--ink); border-radius: 50%;
    background:
        radial-gradient(ellipse at 50% 38%, rgba(255,255,255,0.55) 0%, rgba(255,255,255,0) 60%),
        var(--purple);
    box-shadow: 0 7px 0 var(--purple-d), 0 7px 0 3px var(--ink), 0 22px 30px rgba(0,0,0,0.4), 0 0 46px rgba(162,116,255,0.7);
    pointer-events: none;
}
.hero-char {
    position: absolute; inset: 0;
    display: block; width: 100%; height: 100%;
    object-fit: contain; object-position: 50% 100%;
    filter: drop-shadow(0 6px 0 rgba(18,11,51,0.3));
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;         /* 포인터는 .hero-figure 가 받는다 */
}
.hero-char.in { opacity: 1; animation: hero-pop 0.45s var(--ease-bounce); }
/* "돌려보기" 힌트 — 한 번 돌리면 사라짐 */
.hero-hint {
    position: absolute; left: 50%; bottom: 6.5%;
    transform: translate(-50%, 190%);
    padding: 2px 9px;
    border-radius: var(--r-pill);
    background: rgba(18,11,51,0.6);
    font-size: 10px; font-weight: 900; letter-spacing: 0.3px; white-space: nowrap;
    color: var(--text-dim);
    pointer-events: none;
    animation: hero-hint 2.4s ease-in-out infinite;
    transition: opacity 0.4s ease;
}
.hero-hint.used, .hero-static .hero-hint { opacity: 0; animation: none; }

/* 이름표 + 필살기 태그 */
.hero-caption {
    flex: none; position: relative; z-index: 1;
    display: flex; flex-direction: column; align-items: center;
    min-height: 52px;
    margin-top: 16px;
    opacity: 0; transform: translateY(6px) scale(0.96);
    transition: opacity 0.35s ease 0.08s, transform 0.35s var(--ease-bounce) 0.08s;
    pointer-events: none;
}
.hero-caption.in { opacity: 1; transform: none; }
.hero-name {
    min-width: 120px; padding: 4px 18px 6px;
    border: var(--line) solid var(--ink); border-radius: var(--r-pill);
    background: linear-gradient(180deg, var(--panel-3), var(--panel));
    box-shadow: inset 0 2px 0 rgba(255,255,255,0.16), var(--shadow-sm);
    font-family: var(--font-display); font-size: var(--fs-lg); font-weight: 900; line-height: 1.2;
    text-align: center; white-space: nowrap;
    text-shadow: var(--text-shadow);
}
.hero-skill {
    margin-top: -5px; padding: 2px 10px;
    border: 2px solid var(--ink); border-radius: var(--r-pill);
    background: var(--yellow); color: var(--text-on-bright);
    font-size: var(--fs-xs); font-weight: 900; white-space: nowrap;
}
@keyframes hero-halo { 0%, 100% { opacity: 0.75; } 50% { opacity: 1; } }
@keyframes hero-pop { from { transform: translateY(10px) scale(0.94); } to { transform: none; } }
@keyframes hero-hint { 0%, 100% { margin-left: -5px; } 50% { margin-left: 5px; } }

/* ===== 무대: 좌/우 아이콘 레일 ===== */
.lobby-rail {
    position: absolute; top: 0; bottom: 0; z-index: 2;
    display: flex; flex-direction: column; flex-wrap: wrap; justify-content: center; align-content: flex-start;
    gap: 9px 2px;
    padding-bottom: 56px;        /* 이름표 높이만큼 위로 */
    pointer-events: none;
}
.lobby-rail--l { left: -4px; }
.lobby-rail--r { right: -4px; flex-wrap: wrap-reverse; }
.missions-chip {
    --btn: var(--panel-3); --btn-d: var(--panel);
    position: relative;
    display: flex; flex-direction: column; align-items: center;
    width: calc(var(--chip) + 16px); min-height: 44px;
    pointer-events: auto;
    font-family: var(--font-display);
}
.missions-chip:empty { display: none; }
.chip-ico {
    order: 1;
    display: flex; align-items: center; justify-content: center;
    width: var(--chip); height: var(--chip);
    border: var(--line) solid var(--ink); border-radius: 50%;
    background: linear-gradient(180deg, rgba(255,255,255,0.35) 0%, rgba(255,255,255,0) 50%), var(--btn);
    box-shadow: inset 0 -4px 0 var(--btn-d), 0 3px 0 rgba(0,0,0,0.3);
    font-size: calc(var(--chip) * 0.48); line-height: 1;
    padding-bottom: 3px;
    transition: transform 0.08s ease;
}
.missions-chip:active .chip-ico { transform: translateY(2px); box-shadow: inset 0 -2px 0 var(--btn-d), 0 1px 0 rgba(0,0,0,0.3); }
/* 수치 뱃지 (1/3, 3일차, 티어 2 …) — 원 아래쪽에 걸침 */
.missions-chip b, .sync-off {
    order: 2; position: relative; z-index: 1;
    margin-top: -9px; padding: 1px 6px;
    border: 2px solid var(--ink); border-radius: var(--r-pill);
    background: #fff; color: var(--ink);
    font-size: 10px; font-weight: 900; line-height: 1.2; white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
.missions-chip .sync-off { background: var(--gray); color: #fff; font-size: 9px; }
.chip-label {
    order: 3;
    margin-top: 2px;
    font-size: var(--fs-xs); font-weight: 900; line-height: 1.2; white-space: nowrap;
    color: #fff;
    text-shadow: -1px -1px 0 var(--ink), 1px -1px 0 var(--ink), -1px 1px 0 var(--ink), 1px 1px 0 var(--ink), 0 2px 0 var(--ink);
}
/* 알림 점(●) / 완료 체크(✓) — 원의 오른쪽 위 */
.spin-free-dot, .attendance-chip-new, .missions-chip-done {
    position: absolute; top: -3px; right: 3px; z-index: 2;
    width: 18px; height: 18px;
    border: 2px solid var(--ink); border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    line-height: 1;
}
.spin-free-dot, .attendance-chip-new {
    background: var(--red); color: transparent; font-size: 0;
    animation: chip-dot 1.2s ease-in-out infinite;
}
.missions-chip-done { background: var(--green); color: #06331c; font-size: 10px; font-weight: 900; }
/* 칩별 색 */
#missions-chip   { --btn: var(--blue);   --btn-d: var(--blue-d); }
#attendance-chip { --btn: var(--green);  --btn-d: var(--green-d); }
#season-chip     { --btn: var(--purple); --btn-d: var(--purple-d); }
#spin-chip       { --btn: var(--red);    --btn-d: var(--red-d); }
#ranking-chip    { --btn: var(--yellow); --btn-d: var(--yellow-d); }
#collection-chip { --btn: var(--orange); --btn-d: var(--orange-d); }
#sync-chip       { --btn: var(--panel-3); --btn-d: var(--panel); }
#shop-btn        { --btn: var(--pink);   --btn-d: var(--pink-d); }
.prestige-chip   { --btn: var(--yellow); --btn-d: var(--yellow-d); }
.prestige-chip b { background: var(--red); color: #fff; }
.spin-chip-ready .chip-ico, .prestige-chip .chip-ico { animation: chip-wiggle 2.2s ease-in-out infinite; }
@keyframes chip-dot { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.25); } }
@keyframes chip-wiggle {
    0%, 70%, 100% { transform: rotate(0); }
    76% { transform: rotate(-12deg) scale(1.06); }
    84% { transform: rotate(10deg) scale(1.06); }
    92% { transform: rotate(-6deg); }
}

/* ===== 하단 독: 캠페인(메인) + 온라인 대전(보조) + 다른 모드(작게) ===== */
#start-buttons {
    position: relative; z-index: 3;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
}
#start-buttons button, .lobby-tile {
    --btn: var(--blue); --btn-d: var(--blue-d); --btn-text: #fff; --depth: 5px;
    position: relative;
    display: flex; align-items: center; justify-content: center;
    min-width: 0;
    border: var(--line) solid var(--ink); border-radius: var(--r-md);
    background: linear-gradient(180deg, rgba(255,255,255,0.3) 0%, rgba(255,255,255,0) 46%), var(--btn);
    box-shadow: inset 0 calc(-1 * var(--depth)) 0 var(--btn-d), 0 4px 0 rgba(0,0,0,0.3);
    padding: 0 10px var(--depth);
    color: var(--btn-text);
    font-family: var(--font-display); font-weight: 900;
    text-shadow: var(--text-shadow);
    transition: transform 0.08s ease, box-shadow 0.08s ease;
}
#start-buttons button:active, .lobby-tile:active {
    transform: translateY(3px);
    box-shadow: inset 0 -2px 0 var(--btn-d), 0 1px 0 rgba(0,0,0,0.3);
    animation: none;
}
/* 메인 PLAY (캠페인) */
#start-buttons #campaign-btn {
    --btn: var(--yellow); --btn-d: var(--yellow-d); --btn-text: var(--text-on-bright); --depth: 7px;
    grid-column: 1 / -1;
    gap: 10px;
    height: var(--play-h);
    border-radius: var(--r-lg);
    font-size: clamp(24px, 7.6vw, 30px); letter-spacing: 1px;
    text-shadow: 0 2px 0 rgba(255,255,255,0.5);
    overflow: hidden;
    animation: play-pulse 1.8s ease-in-out infinite;
}
#campaign-btn .play-ico {
    display: flex; align-items: center; justify-content: center;
    width: 1.9em; height: 1.9em; padding-left: 0.12em;
    border-radius: 50%;
    background: var(--text-on-bright); color: var(--yellow);
    font-size: 0.6em; text-shadow: none;
}
#campaign-btn::after {   /* 반짝임 */
    content: ''; position: absolute; top: -20%; bottom: -20%; left: 0; width: 34%;
    background: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.55) 50%, rgba(255,255,255,0) 100%);
    transform: translateX(-160%) skewX(-20deg);
    animation: play-shine 3.2s ease-in-out infinite;
    pointer-events: none;
}
@keyframes play-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.025); } }
@keyframes play-shine { 0%, 55% { transform: translateX(-160%) skewX(-20deg); } 85%, 100% { transform: translateX(420%) skewX(-20deg); } }
/* 보조: 온라인 대전 */
#start-buttons #online-btn {
    --btn: var(--blue); --btn-d: var(--blue-d);
    gap: 8px; height: var(--tile-h);
    font-size: var(--fs-lg);
}
#online-btn .tile-ico { font-size: 1.15em; line-height: 1; text-shadow: none; }
/* 작게: 다른 모드 (시트 열기) */
#start-buttons #modes-btn {
    --btn: var(--panel-3); --btn-d: var(--panel);
    gap: 5px; height: var(--tile-h); padding-left: 12px; padding-right: 12px;
    font-size: var(--fs-sm); color: var(--text-dim);
}
#modes-btn .tile-ico { font-size: 1.25em; line-height: 1; text-shadow: none; }
#modes-btn.has-dot::after {   /* 오늘의 챌린지 미클리어 알림 */
    content: ''; position: absolute; top: -7px; right: -6px;
    width: 18px; height: 18px;
    border: 2px solid var(--ink); border-radius: 50%;
    background: var(--red);
    animation: chip-dot 1.2s ease-in-out infinite;
}

/* ===== "다른 모드" 시트 (#start-overlay 안 — 로비가 숨으면 같이 숨는다) ===== */
#modes-overlay { z-index: 20; animation: fadeIn 0.2s ease; }
#modes-overlay.hidden { display: none; }
.lobby-modes { display: flex; flex-direction: column; gap: 10px; }
.lobby-tile {
    flex: none;
    justify-content: flex-start; gap: 12px;
    width: 100%; height: 66px; padding-left: 12px; padding-right: 12px;
    text-align: left;
}
#daily-btn.lobby-tile   { --btn: var(--orange); --btn-d: var(--orange-d); }
#endless-btn.lobby-tile { --btn: var(--blue);   --btn-d: var(--blue-d); }
#start-btn.lobby-tile   { --btn: var(--green);  --btn-d: var(--green-d); }
.lobby-tile .tile-ico {
    flex: none;
    display: flex; align-items: center; justify-content: center;
    width: 42px; height: 42px;
    border-radius: 12px;
    background: rgba(18,11,51,0.28);
    font-size: 24px; line-height: 1; text-shadow: none;
}
.tile-text { display: flex; flex-direction: column; min-width: 0; flex: 1; gap: 2px; }
.lobby-tile .tile-label {
    font-size: var(--fs-lg); line-height: 1.15;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.lobby-tile::after {   /* 진입 화살표 */
    content: '›'; flex: none;
    font-size: 26px; line-height: 1; opacity: 0.7; padding-bottom: 3px;
}
.daily-btn-sub, .endless-best {
    display: flex; align-items: center; gap: 6px;
    font-size: var(--fs-sm); font-weight: 800; line-height: 1.2;
    white-space: nowrap; overflow: hidden;
    color: rgba(255,255,255,0.92); text-shadow: 0 1px 0 rgba(0,0,0,0.3);
}
.daily-mutator { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.daily-reward, .daily-cleared, .daily-retry-ad {
    flex: none;
    padding: 0 7px; border-radius: var(--r-pill);
    background: rgba(18,11,51,0.45);
}
.daily-reward { color: var(--yellow); }
.daily-cleared { color: var(--green); }
.daily-retry-ad { color: #fff; }
.endless-best { color: var(--c-accent-soft); }

/* ===== 프레스티지 알림 (Lv.50 달성 시에만 나타나는 가로 알약) ===== */
.lobby-callout {
    position: absolute; top: 2px; left: 0; right: 0; z-index: 2;
    display: flex; justify-content: center;
    pointer-events: none;
}
.lobby-callout .missions-chip {
    flex-direction: row; gap: 6px;
    width: auto; min-height: 40px; padding: 0 12px 3px 6px;
    border: var(--line) solid var(--ink); border-radius: var(--r-pill);
    background: linear-gradient(180deg, rgba(255,255,255,0.3) 0%, rgba(255,255,255,0) 46%), var(--yellow);
    box-shadow: inset 0 -4px 0 var(--yellow-d), 0 3px 0 rgba(0,0,0,0.3);
    animation: play-pulse 1.6s ease-in-out infinite;
}
.lobby-callout .chip-ico { width: 28px; height: 28px; border: 0; background: none; box-shadow: none; font-size: 18px; padding: 0; }
.lobby-callout .chip-label { order: 2; margin: 0; font-size: var(--fs-sm); letter-spacing: 0; color: var(--text-on-bright); text-shadow: none; }
.lobby-callout .missions-chip b { order: 3; margin: 0; }

/* ===== 치명적 로드 실패 안내 (three.js 로드 실패) ===== */
#load-error {
    position: fixed; top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2000;
    width: max-content; max-width: min(86vw, 420px);
    padding: 22px 24px;
    border: var(--line) solid var(--ink); border-radius: var(--r-lg);
    background: var(--panel);
    box-shadow: inset 0 0 0 3px var(--red), var(--shadow-lg);
    color: #fff; font-size: var(--fs-md); font-weight: 800; line-height: 1.7; text-align: center;
}
#load-error::before { content: '⚠️'; display: block; font-size: 34px; line-height: 1.2; margin-bottom: 6px; }

/* ============================================================
   반응형
   ============================================================ */
/* 아주 좁은 폰 */
@media (max-width: 359px) {
    #start-box { --chip: 42px; padding-left: calc(var(--sa-l) + 8px); padding-right: calc(var(--sa-r) + 8px); }
    #start-sound-btn { right: calc(var(--sa-r) + 8px) !important; }
}
/* 세로: 낮은 화면에서는 설명 문구 숨김 */
@media (orientation: portrait) and (max-height: 739px) {
    .lobby-logo p { display: none; }
    #start-box { --chip: 42px; }
    .lobby-rail { gap: 6px 2px; padding-bottom: 24px; }
    .lobby-logo h1 { font-size: clamp(26px, 8.4vw, 36px); }
}
@media (orientation: portrait) and (max-height: 599px) {
    #start-box { --chip: 40px; --play-h: 56px; --tile-h: 46px; row-gap: 4px; }
    .lobby-logo h1 { font-size: 26px; }
    .lobby-rail { gap: 5px 2px; }
}
/* 세로: 큰 폰/태블릿 */
@media (orientation: portrait) and (min-height: 760px) {
    #start-box { --chip: 52px; --play-h: 80px; --tile-h: 54px; row-gap: 8px; }
    .lobby-rail { gap: 12px 2px; }
    .hero-name { font-size: var(--fs-xl); }
    .hero-skill { font-size: var(--fs-sm); }
}
@media (orientation: portrait) and (min-width: 520px) {
    .lobby-rail--l { left: 4px; } .lobby-rail--r { right: 4px; }
    .lobby-logo h1 { font-size: var(--fs-display); }
}

/* 가로 (모바일 가로 · 데스크톱): 왼쪽 무대 / 오른쪽 로고 + 독 */
@media (orientation: landscape) and (min-width: 560px) {
    #start-box {
        --chip: 40px; --play-h: 58px; --tile-h: 46px;
        max-width: 1180px;
        grid-template-columns: minmax(0, 1fr) minmax(300px, 42%);
        grid-template-rows: auto minmax(0, 1fr) auto;
        column-gap: 16px; row-gap: 6px;
        padding: calc(var(--sa-t) + 6px) calc(var(--sa-r) + 14px) calc(var(--sa-b) + 10px) calc(var(--sa-l) + 14px);
    }
    #start-sound-btn { top: calc(var(--sa-t) + 6px) !important; right: calc(var(--sa-r) + 14px) !important; }
    .lobby-top   { grid-column: 1 / -1; grid-row: 1; }
    .lobby-stage { grid-column: 1; grid-row: 2 / 4; }
    .lobby-logo  { grid-column: 2; grid-row: 2; align-self: center; padding: 0; }
    #start-buttons { grid-column: 2; grid-row: 3; }
    .lobby-logo h1 { font-size: clamp(26px, 4.6vw, 54px); }
    .lobby-logo p { display: none; }
    .lobby-bg-rays { left: 32%; top: 52%; }
    .lobby-rail { gap: 5px 2px; padding-bottom: 0; }
    .lobby-rail--l { left: 0; } .lobby-rail--r { right: 0; }
    .hero-caption { min-height: 46px; margin-top: 12px; }
    .hero-name { font-size: var(--fs-md); }
    #start-buttons #campaign-btn { font-size: 24px; }
    #modes-overlay { align-items: center; }
    #modes-sheet { border-bottom: var(--line) solid var(--ink); border-radius: var(--r-lg); padding-bottom: 0; }
    .lobby-modes { gap: 8px; padding-top: 12px; padding-bottom: 12px; }
    .lobby-tile { height: 58px; }
}
/* 가로 + 충분한 높이 (데스크톱 / 태블릿 가로) */
@media (orientation: landscape) and (min-width: 560px) and (min-height: 540px) {
    #start-box {
        --chip: 56px; --play-h: 92px; --tile-h: 60px;
        grid-template-columns: minmax(0, 1fr) minmax(300px, 36%);
        column-gap: 28px; row-gap: 10px;
        padding: calc(var(--sa-t) + 16px) calc(var(--sa-r) + 28px) calc(var(--sa-b) + 28px) calc(var(--sa-l) + 28px);
    }
    #start-sound-btn { top: calc(var(--sa-t) + 16px) !important; right: calc(var(--sa-r) + 28px) !important; }
    .lobby-logo p { display: block; font-size: var(--fs-sm); margin-top: 14px; }
    .lobby-rail { gap: 14px 6px; padding-bottom: 40px; }
    .lobby-rail--l { left: 4%; } .lobby-rail--r { right: 4%; }
    .chip-label { font-size: var(--fs-sm); }
    .missions-chip b, .sync-off { font-size: 11px; }
    .hero-name { font-size: var(--fs-xl); padding: 5px 24px 7px; }
    .hero-skill { font-size: var(--fs-sm); }
    .hero-hint { font-size: var(--fs-xs); }
    #start-buttons { gap: 10px; }
    #start-buttons #campaign-btn { font-size: 34px; }
    #start-buttons #online-btn { font-size: var(--fs-xl); }
    #start-buttons #modes-btn { font-size: var(--fs-md); padding-left: 16px; padding-right: 16px; }
    .lobby-modes { gap: 10px; padding: var(--gutter); }
    .lobby-tile { height: 66px; }
    .profile-level-meta { width: 200px; }
}
