/* ===== 가족 오락실 - 플레이어 대기실 ===== */

/* ===== 기본 설정 ===== */
.fg-waiting-wrap {
    width: 100%;
    height: 100vh;
    height: calc(var(--vh, 1vh) * 100);
    margin: 0;
    padding: 16px;
    font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    background: radial-gradient(ellipse at center, #4a3728 0%, #2d1f16 100%);
    background-image:
        radial-gradient(ellipse at center, rgba(74, 55, 40, 0.9) 0%, rgba(45, 31, 22, 1) 100%),
        repeating-linear-gradient(90deg, transparent, transparent 2px, rgba(0,0,0,.03) 2px, rgba(0,0,0,.03) 4px),
        repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0,0,0,.03) 2px, rgba(0,0,0,.03) 4px);
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    overflow: hidden;
}

.fg-waiting-wrap *, .fg-waiting-wrap *::before, .fg-waiting-wrap *::after {
    box-sizing: border-box;
}

/* ===== 헤더 ===== */
.fg-waiting-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0.4) 100%);
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 8px;
    margin-bottom: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.fg-waiting-room {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    color: #ffd700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8), 0 0 10px rgba(255, 215, 0, 0.3);
}

.fg-waiting-room-code {
    padding: 4px 10px;
    background: linear-gradient(180deg, #d4af37 0%, #aa8a1a 100%);
    border: 1px solid #ffd700;
    color: #1a1a1a;
    border-radius: 12px;
    font-weight: 700;
    font-size: 12px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.fg-exit-btn {
    padding: 8px 16px;
    font-size: 13px;
    color: #ff6b6b;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0.8) 100%);
    border: 1px solid rgba(255, 107, 107, 0.5);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 700;
    transition: all 0.2s;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.fg-exit-btn:hover {
    background: linear-gradient(180deg, rgba(255, 107, 107, 0.2) 0%, rgba(0, 0, 0, 0.8) 100%);
    border-color: #ff6b6b;
}

.fg-exit-btn:active {
    transform: scale(0.95);
}

/* ===== 메인 카드 ===== */
.fg-waiting-card {
    flex: 1;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0.7) 100%);
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: 16px;
    padding: 24px 20px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    justify-content: center;
}

/* ===== 내 정보 ===== */
.fg-my-info {
    margin-bottom: 24px;
    flex-shrink: 0;
}

.fg-my-avatar {
    width: 80px;
    height: 80px;
    background: linear-gradient(145deg, #d4af37 0%, #aa8a1a 100%);
    border: 2px solid #ffd700;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    margin: 0 auto 14px;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.4), inset 0 2px 0 rgba(255, 255, 255, 0.3);
}

.fg-my-name {
    font-size: 22px;
    font-weight: 700;
    color: #ffd700;
    margin-bottom: 6px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8), 0 0 10px rgba(255, 215, 0, 0.3);
}

.fg-my-status {
    font-size: 13px;
    color: #4CAF50;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.fg-status-dot {
    width: 8px;
    height: 8px;
    background: #4CAF50;
    border-radius: 50%;
    animation: pulse 2s infinite;
    box-shadow: 0 0 8px rgba(76, 175, 80, 0.6);
}

/* ===== 대기 상태 ===== */
.fg-waiting-status {
    margin-bottom: 24px;
    flex-shrink: 0;
}

.fg-waiting-icon {
    font-size: 64px;
    margin-bottom: 12px;
    animation: bounce 2s infinite;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.8));
}

.fg-waiting-text {
    font-size: 17px;
    font-weight: 700;
    color: #ffd700;
    margin-bottom: 8px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8), 0 0 10px rgba(255, 215, 0, 0.3);
}

.fg-waiting-subtext {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

/* ===== 참가자 목록 ===== */
.fg-participants {
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.4) 0%, rgba(0, 0, 0, 0.6) 100%);
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.5);
    flex-shrink: 0;
}

.fg-participants-title {
    font-size: 13px;
    font-weight: 700;
    color: rgba(255, 215, 0, 0.8);
    margin-bottom: 14px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.fg-participants-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 14px;
}

.fg-participant {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.fg-participant-avatar {
    width: 52px;
    height: 52px;
    background: linear-gradient(145deg, rgba(100, 100, 100, 0.8) 0%, rgba(60, 60, 60, 0.9) 100%);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    position: relative;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
}

.fg-participant-avatar.master {
    background: linear-gradient(145deg, #d4af37 0%, #aa8a1a 100%);
    border-color: #ffd700;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.5);
}

.fg-participant-avatar.me {
    border: 3px solid #4CAF50;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.5);
}

.fg-participant-crown {
    position: absolute;
    top: -8px;
    font-size: 18px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.8));
}

.fg-participant-name {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.9);
    max-width: 65px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.fg-participant-items {
    font-size: 10px;
    color: #4caf50;
    font-weight: 600;
    margin-top: 2px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

/* ===== 선택된 게임 ===== */
.fg-selected-game {
    background: linear-gradient(180deg, rgba(212, 175, 55, 0.2) 0%, rgba(170, 138, 26, 0.15) 100%);
    border: 2px solid rgba(255, 215, 0, 0.5);
    border-radius: 12px;
    padding: 18px;
    margin-bottom: 20px;
    display: none;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.fg-selected-game.active {
    display: block;
}

.fg-selected-game-label {
    font-size: 12px;
    color: rgba(255, 215, 0, 0.9);
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.fg-selected-game-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.fg-selected-game-icon {
    font-size: 40px;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.8));
}

.fg-selected-game-name {
    font-size: 20px;
    font-weight: 700;
    color: #ffd700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8), 0 0 10px rgba(255, 215, 0, 0.3);
}

/* ===== 게임 준비 중 ===== */
.fg-game-starting {
    display: none;
    padding: 40px 20px;
    flex-shrink: 0;
}

.fg-game-starting.active {
    display: block;
}

.fg-countdown {
    font-size: 80px;
    font-weight: 800;
    color: #ffd700;
    animation: countPulse 1s ease-in-out infinite;
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.8), 0 0 20px rgba(255, 215, 0, 0.5);
}

.fg-starting-text {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.9);
    margin-top: 16px;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

/* ===== 반응형 ===== */
@media (max-width: 480px) {
    .fg-waiting-wrap {
        padding: 10px;
    }

    .fg-waiting-card {
        padding: 16px 12px;
    }

    .fg-my-avatar {
        width: 70px;
        height: 70px;
        font-size: 36px;
    }

    .fg-my-name {
        font-size: 20px;
    }

    .fg-waiting-icon {
        font-size: 52px;
    }

    .fg-countdown {
        font-size: 68px;
    }
}

/* 아이폰 SE 및 작은 화면 대응 (375px 이하) */
@media (max-width: 375px) {
    .fg-waiting-wrap {
        padding: 8px;
    }

    .fg-waiting-header {
        padding: 8px 10px;
        margin-bottom: 8px;
    }

    .fg-waiting-room {
        font-size: 13px;
    }

    .fg-waiting-room-code {
        padding: 3px 8px;
        font-size: 11px;
    }

    .fg-exit-btn {
        padding: 6px 12px;
        font-size: 12px;
    }

    .fg-waiting-card {
        padding: 12px 10px;
        border-radius: 12px;
    }

    .fg-my-info {
        margin-bottom: 12px;
        flex-shrink: 1;
    }

    .fg-my-avatar {
        width: 56px;
        height: 56px;
        font-size: 28px;
        margin-bottom: 10px;
        border-width: 2px;
    }

    .fg-my-name {
        font-size: 18px;
        margin-bottom: 4px;
    }

    .fg-my-status {
        font-size: 11px;
    }

    .fg-status-dot {
        width: 6px;
        height: 6px;
    }

    .fg-waiting-status {
        margin-bottom: 12px;
        flex-shrink: 1;
    }

    .fg-waiting-icon {
        font-size: 48px;
        margin-bottom: 8px;
    }

    .fg-waiting-text {
        font-size: 15px;
        margin-bottom: 6px;
    }

    .fg-waiting-subtext {
        font-size: 11px;
    }

    .fg-participants {
        padding: 12px;
        margin-bottom: 12px;
        border-radius: 10px;
        flex-shrink: 1;
    }

    .fg-participants-title {
        font-size: 12px;
        margin-bottom: 10px;
    }

    .fg-participants-list {
        gap: 10px;
    }

    .fg-participant-avatar {
        width: 44px;
        height: 44px;
        font-size: 22px;
        border-width: 2px;
    }

    .fg-participant-avatar.me {
        border-width: 2px;
    }

    .fg-participant-crown {
        top: -6px;
        font-size: 14px;
    }

    .fg-participant-name {
        font-size: 11px;
        max-width: 55px;
    }

    .fg-participant-items {
        font-size: 9px;
    }

    .fg-selected-game {
        padding: 12px;
        margin-bottom: 12px;
        border-radius: 10px;
        border-width: 1px;
        flex-shrink: 1;
    }

    .fg-selected-game-label {
        font-size: 11px;
        margin-bottom: 8px;
    }

    .fg-selected-game-icon {
        font-size: 32px;
    }

    .fg-selected-game-name {
        font-size: 17px;
    }

    .fg-game-starting {
        padding: 30px 16px;
        flex-shrink: 1;
    }

    .fg-countdown {
        font-size: 60px;
    }

    .fg-starting-text {
        font-size: 14px;
        margin-top: 12px;
    }
}

/* 매우 작은 화면 (360px 이하) */
@media (max-width: 360px) {
    .fg-my-avatar {
        width: 50px;
        height: 50px;
        font-size: 26px;
    }

    .fg-my-name {
        font-size: 16px;
    }

    .fg-waiting-icon {
        font-size: 42px;
    }

    .fg-participant-avatar {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }

    .fg-countdown {
        font-size: 54px;
    }
}
