/* ===== 기본 설정 ===== */
.family-game-wrap {
    width: 100%;
    height: 100vh;
    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;
    overflow: hidden;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    box-sizing: border-box;
}

.family-game-wrap *, .family-game-wrap *::before, .family-game-wrap *::after {
    box-sizing: border-box;
}

/* ===== 헤더 ===== */
.fg-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    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-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    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-logo-icon {
    font-size: 28px;
    filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.5));
}

.fg-room-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.fg-room-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: linear-gradient(180deg, #d4af37 0%, #aa8a1a 100%);
    border: 1px solid #ffd700;
    border-radius: 20px;
    color: #1a1a1a;
    font-weight: 700;
    font-size: 14px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.fg-copy-btn {
    width: 32px;
    height: 32px;
    border: 1px solid rgba(255, 215, 0, 0.4);
    background: linear-gradient(180deg, rgba(50, 50, 50, 0.8) 0%, rgba(30, 30, 30, 0.9) 100%);
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
}

.fg-copy-btn:hover {
    background: linear-gradient(180deg, rgba(60, 60, 60, 0.9) 0%, rgba(40, 40, 40, 1) 100%);
    border-color: #ffd700;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.3);
}

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

.fg-player-count {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: #f5f5f5;
    font-weight: 600;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

.fg-settings-btn {
    width: 40px;
    height: 40px;
    border: 1px solid rgba(255, 215, 0, 0.4);
    background: linear-gradient(180deg, rgba(50, 50, 50, 0.8) 0%, rgba(30, 30, 30, 0.9) 100%);
    border-radius: 8px;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.fg-settings-btn:hover {
    background: linear-gradient(180deg, rgba(60, 60, 60, 0.9) 0%, rgba(40, 40, 40, 1) 100%);
    border-color: #ffd700;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.3);
}

.fg-sound-btn {
    width: 40px;
    height: 40px;
    border: 1px solid rgba(76, 175, 80, 0.5);
    background: linear-gradient(180deg, #4CAF50 0%, #2E7D32 100%);
    border-radius: 8px;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    color: white;
}

.fg-sound-btn:hover {
    background: linear-gradient(180deg, #45a049 0%, #1B5E20 100%);
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
}

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

/* ===== 컨텐츠 래퍼 ===== */
.fg-content-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 0;
    overflow: hidden;
}

/* ===== 메인 컨텐츠 (3분할) ===== */
.fg-main {
    display: grid;
    grid-template-columns: 420px 1fr 400px;
    gap: 12px;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

/* ===== 왼쪽 사이드바 (QR + 참가자) ===== */
.fg-sidebar {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 0;
    overflow: hidden;
}

/* ===== QR 코드 섹션 ===== */
.fg-qr-section {
    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: 12px;
    padding: 16px;
    text-align: center;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    flex-shrink: 0;
}

.fg-qr-title {
    font-size: 13px;
    color: #d4af37;
    margin-bottom: 10px;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.fg-qr-code {
    width: 120px;
    height: 120px;
    margin: 0 auto 10px;
    background: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid #d4af37;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5), 0 0 20px rgba(255, 215, 0, 0.2);
    cursor: pointer;
    transition: all 0.2s;
}

.fg-qr-code:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.6), 0 0 30px rgba(255, 215, 0, 0.4);
}

.fg-qr-code canvas {
    border-radius: 6px;
}

.fg-room-code-display {
    margin-top: 10px;
}

.fg-room-code-label {
    font-size: 11px;
    color: #aa8a1a;
    margin-bottom: 4px;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.fg-room-code-number {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: 4px;
    color: #ffd700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8), 0 0 10px rgba(255, 215, 0, 0.5);
}

.fg-url-display {
    margin-top: 8px;
    padding: 6px 10px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 215, 0, 0.1);
    border-radius: 6px;
    font-size: 10px;
    color: #aaa;
    word-break: break-all;
}

/* ===== 참가자 목록 ===== */
.fg-players-section {
    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: 12px;
    padding: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.fg-section-title {
    font-size: 14px;
    font-weight: 700;
    color: #ffd700;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

.fg-players-list {
    list-style: none;
    padding: 0;
    margin: 0;
    flex: 1;
    overflow-y: auto;
}

.fg-player-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 215, 0, 0.1);
    border-radius: 8px;
    margin-bottom: 6px;
    transition: all 0.2s;
}

.fg-player-item:hover {
    background: rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 215, 0, 0.3);
}

.fg-player-item.master {
    background: linear-gradient(180deg, rgba(212, 175, 55, 0.2) 0%, rgba(170, 138, 26, 0.1) 100%);
    border: 2px solid #d4af37;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.2);
}

.fg-player-avatar {
    width: 28px;
    height: 28px;
    background: linear-gradient(180deg, #d4af37 0%, #aa8a1a 100%);
    border: 1px solid #ffd700;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #1a1a1a;
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

.fg-player-name {
    flex: 1;
    font-weight: 600;
    color: #f5f5f5;
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.fg-player-badge {
    padding: 3px 8px;
    background: linear-gradient(180deg, #d4af37 0%, #aa8a1a 100%);
    border: 1px solid #ffd700;
    color: #1a1a1a;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 700;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.fg-player-status {
    width: 8px;
    height: 8px;
    background: #4CAF50;
    border-radius: 50%;
    flex-shrink: 0;
}

.fg-player-status.offline {
    background: #ccc;
}

.fg-kick-btn {
    width: 24px;
    height: 24px;
    border: 1px solid rgba(255, 107, 107, 0.5);
    background: linear-gradient(180deg, #ff6b6b 0%, #d63031 100%);
    color: white;
    border-radius: 50%;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

.fg-kick-btn:hover {
    background: linear-gradient(180deg, #ff5252 0%, #c62828 100%);
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(255, 82, 82, 0.4);
}

.fg-empty-players {
    text-align: center;
    padding: 24px 12px;
    color: #888;
}

.fg-empty-players-icon {
    font-size: 36px;
    margin-bottom: 10px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.8));
}

.fg-empty-players p {
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

/* ===== 아이템 관련 스타일 ===== */
.fg-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    flex-shrink: 0;
}

.fg-section-header .fg-section-title {
    margin-bottom: 0;
}

.fg-item-actions {
    display: flex;
    gap: 4px;
}

.fg-item-btn-small {
    padding: 4px 10px;
    font-size: 10px;
    font-weight: 700;
    border: 1px solid rgba(255, 215, 0, 0.4);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

.fg-item-btn-small.add-all {
    background: linear-gradient(180deg, #667eea 0%, #5568d3 100%);
    color: white;
}

.fg-item-btn-small.add-all:hover {
    background: linear-gradient(180deg, #7c8ff0 0%, #667eea 100%);
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.4);
}

.fg-item-btn-small.reset {
    background: linear-gradient(180deg, #555 0%, #333 100%);
    color: #f5f5f5;
}

.fg-item-btn-small.reset:hover {
    background: linear-gradient(180deg, #666 0%, #444 100%);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
}

.fg-player-item-section {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
    margin-right: 6px;
}

.fg-item-count {
    display: flex;
    align-items: center;
    gap: 3px;
    padding: 3px 8px;
    background: linear-gradient(180deg, #667eea 0%, #5568d3 100%);
    border: 1px solid #667eea;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.fg-item-count.empty {
    background: linear-gradient(180deg, #555 0%, #333 100%);
    border-color: #444;
    color: #aaa;
}

.fg-item-btn {
    width: 22px;
    height: 22px;
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 50%;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.fg-item-btn.minus {
    background: linear-gradient(180deg, #ff6b6b 0%, #d63031 100%);
    color: white;
}

.fg-item-btn.minus:hover {
    background: linear-gradient(180deg, #ff5252 0%, #c62828 100%);
    transform: scale(1.1);
}

.fg-item-btn.plus {
    background: linear-gradient(180deg, #51cf66 0%, #37b24d 100%);
    color: white;
}

.fg-item-btn.plus:hover {
    background: linear-gradient(180deg, #69db7c 0%, #40c057 100%);
    transform: scale(1.1);
}

/* ===== 게임 선택 영역 (중앙) ===== */
.fg-games-grid-section {
    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: 12px;
    padding: 16px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.fg-games-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    flex: 1;
    align-content: start;
}

/* ===== 옵션 영역 (우측) ===== */
.fg-options-section {
    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: 12px;
    padding: 16px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow-y: auto;
}

.fg-game-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0;
    background: linear-gradient(180deg, #f5e6d3 0%, #e8d4b8 100%);
    border: 3px solid #d4af37;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
    overflow: hidden;
    position: relative;
    aspect-ratio: 1/1;
    box-shadow:
        0 6px 20px rgba(0, 0, 0, 0.6),
        0 0 0 1px rgba(255, 255, 255, 0.1) inset,
        0 0 15px rgba(255, 215, 0, 0.3);
}

.fg-game-btn::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.1) 50%, transparent 70%);
    transform: rotate(45deg);
    pointer-events: none;
}

.fg-game-btn:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow:
        0 10px 25px rgba(0, 0, 0, 0.8),
        0 0 0 1px rgba(255, 255, 255, 0.2) inset,
        0 0 20px rgba(255, 215, 0, 0.5);
    border-color: #ffd700;
    background: linear-gradient(180deg, #fff8e7 0%, #f5e6d3 100%);
}

.fg-game-btn.selected {
    border-color: #ffd700;
    box-shadow:
        0 10px 30px rgba(255, 215, 0, 0.6),
        0 0 0 2px rgba(255, 255, 255, 0.3) inset,
        0 0 30px rgba(255, 215, 0, 0.8);
    transform: translateY(-4px) scale(1.03);
    background: linear-gradient(180deg, #fff8e7 0%, #f5e6d3 100%);
}

.fg-game-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    filter: grayscale(0.8);
}

.fg-game-btn.disabled:hover {
    transform: none;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6);
    border-color: #d4af37;
}

.fg-game-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    background: linear-gradient(180deg, #f5e6d3 0%, #e8d4b8 100%);
    border-radius: 63px;
    overflow: hidden;
}

.fg-game-icon {
    font-size: 28px;
    margin-bottom: 6px;
}

.fg-game-name {
    font-size: 13px;
    font-weight: 700;
    color: #333;
    margin: 8px 0 4px 0;
    padding: 0 8px;
}

.fg-game-difficulty {
    font-size: 10px;
    color: #ffc107;
    margin-bottom: 4px;
}

.fg-game-min-players {
    font-size: 10px;
    color: #888;
}

.fg-game-need-more {
    font-size: 9px;
    color: #f44336;
    margin-top: 2px;
}

/* ===== 게임 옵션 영역 ===== */
.fg-game-options {
    display: none;
    padding: 16px;
    background: linear-gradient(180deg, rgba(212, 175, 55, 0.15) 0%, rgba(170, 138, 26, 0.1) 100%);
    border: 2px solid #d4af37;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    margin-bottom: 12px;
}

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

.fg-options-section .fg-section-title {
    font-size: 16px;
    font-weight: 700;
    color: #ffd700;
    margin-bottom: 16px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

.fg-options-placeholder {
    text-align: center;
    padding: 40px 20px;
    color: #888;
    font-size: 14px;
}

.fg-options-placeholder-icon {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.5;
}


.fg-option-title {
    font-size: 15px;
    font-weight: 700;
    color: #ffd700;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

.fg-option-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.fg-option-label {
    font-size: 13px;
    color: #f5f5f5;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.fg-frame-selector {
    display: flex;
    align-items: center;
    gap: 12px;
}

.fg-frame-btn {
    width: 32px;
    height: 32px;
    border: 1px solid #d4af37;
    border-radius: 50%;
    background: linear-gradient(180deg, #d4af37 0%, #aa8a1a 100%);
    color: #1a1a1a;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.fg-frame-btn:hover {
    background: linear-gradient(180deg, #ffd700 0%, #d4af37 100%);
    border-color: #ffd700;
    box-shadow: 0 4px 10px rgba(255, 215, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

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

.fg-frame-value {
    font-size: 22px;
    font-weight: 700;
    color: #ffd700;
    min-width: 50px;
    text-align: center;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8), 0 0 10px rgba(255, 215, 0, 0.4);
}

.fg-frame-hint {
    font-size: 11px;
    color: #d4af37;
    margin-top: 8px;
    text-align: right;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

/* ===== 시작 버튼 (하단) ===== */
.fg-start-section {
    flex-shrink: 0;
    padding: 0;
}

.fg-start-btn {
    width: 100%;
    padding: 20px 40px;
    font-size: 24px;
    font-weight: 800;
    color: #1a1a1a;
    background: linear-gradient(180deg, #ffd700 0%, #d4af37 100%);
    border: 3px solid #ffd700;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.3);
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.3);
}

.fg-start-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(255, 215, 0, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.4);
    background: linear-gradient(180deg, #ffed4e 0%, #ffd700 100%);
}

.fg-start-btn:active:not(:disabled) {
    transform: translateY(0);
}

.fg-start-btn:disabled {
    background: linear-gradient(180deg, #555 0%, #333 100%);
    border-color: #444;
    box-shadow: none;
    cursor: not-allowed;
    color: #888;
}

/* ===== 설정 모달 ===== */
.fg-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.fg-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.fg-modal {
    background: linear-gradient(180deg, #2d1f16 0%, #1a0f0a 100%);
    border: 2px solid #d4af37;
    border-radius: 20px;
    padding: 32px;
    max-width: 400px;
    width: 90%;
    transform: translateY(20px);
    transition: all 0.3s;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 215, 0, 0.2) inset;
}

.fg-modal-overlay.active .fg-modal {
    transform: translateY(0);
}

.fg-modal-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 24px;
    text-align: center;
    color: #ffd700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

.fg-modal-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid rgba(255, 215, 0, 0.2);
}

.fg-modal-option:last-child {
    border-bottom: none;
}

.fg-modal-option label,
.fg-modal-option span {
    color: #f5f5f5;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.fg-modal-close {
    width: 100%;
    padding: 16px;
    margin-top: 20px;
    font-size: 16px;
    font-weight: 700;
    color: #1a1a1a;
    background: linear-gradient(180deg, #ffd700 0%, #d4af37 100%);
    border: 2px solid #ffd700;
    border-radius: 12px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.fg-modal-close:hover {
    background: linear-gradient(180deg, #ffed4e 0%, #ffd700 100%);
}

.fg-modal-danger {
    width: 100%;
    padding: 16px;
    margin-top: 12px;
    font-size: 16px;
    font-weight: 600;
    color: #ff6b6b;
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid #ff6b6b;
    border-radius: 12px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.fg-modal-danger:hover {
    background: rgba(255, 107, 107, 0.1);
    border-color: #ff5252;
}

/* ===== 토글 스위치 ===== */
.fg-toggle {
    position: relative;
    width: 50px;
    height: 28px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.3s;
}

.fg-toggle.active {
    background: linear-gradient(180deg, #d4af37 0%, #aa8a1a 100%);
    border-color: #ffd700;
}

.fg-toggle::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 22px;
    height: 22px;
    background: linear-gradient(180deg, #f5f5f5 0%, #ddd 100%);
    border-radius: 50%;
    transition: all 0.3s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

.fg-toggle.active::after {
    left: 25px;
    background: linear-gradient(180deg, #fff 0%, #f0f0f0 100%);
}

/* ===== 윷놀이 팀 편성 ===== */
.fg-team-setup {
    display: flex;
    gap: 12px;
    margin-top: 12px;
}

.fg-team-column {
    flex: 1;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    padding: 12px;
    min-height: 100px;
}

.fg-team-column.team1 {
    border: 2px solid #3b82f6;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.3);
}

.fg-team-column.team2 {
    border: 2px solid #ef4444;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.3);
}

.fg-team-header {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
    gap: 6px;
}

.fg-team-header.team1 {
    color: #60a5fa;
}

.fg-team-header.team2 {
    color: #f87171;
}

.fg-team-members {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 50px;
}

.fg-team-member {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: linear-gradient(180deg, #f5e6d3 0%, #e8d4b8 100%);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.fg-team-member:hover {
    transform: translateX(3px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.4);
    background: linear-gradient(180deg, #fff8e7 0%, #f5e6d3 100%);
}

.fg-team-member.team1 {
    border-left: 4px solid #3b82f6;
}

.fg-team-member.team2 {
    border-left: 4px solid #ef4444;
}

.fg-team-member-avatar {
    width: 24px;
    height: 24px;
    background: linear-gradient(180deg, #d4af37 0%, #aa8a1a 100%);
    border: 1px solid #ffd700;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: #1a1a1a;
}

.fg-team-member-name {
    flex: 1;
    font-size: 12px;
    font-weight: 600;
    color: #1a1a1a;
}

.fg-team-member-badge {
    font-size: 9px;
    padding: 3px 6px;
    background: linear-gradient(180deg, #d4af37 0%, #aa8a1a 100%);
    border: 1px solid #ffd700;
    color: #1a1a1a;
    border-radius: 8px;
    font-weight: 700;
}

.fg-team-empty {
    color: #888;
    font-size: 11px;
    text-align: center;
    padding: 16px 8px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.fg-team-hint {
    font-size: 15px;
    color: #d4af37;
    margin-top: 10px;
    text-align: center;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.fg-auto-assign-btn {
    display: block;
    width: 100%;
    margin-top: 10px;
    padding: 10px;
    background: linear-gradient(180deg, #d4af37 0%, #aa8a1a 100%);
    border: 1px solid #ffd700;
    color: #1a1a1a;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.fg-auto-assign-btn:hover {
    background: linear-gradient(180deg, #ffd700 0%, #d4af37 100%);
    box-shadow: 0 4px 10px rgba(255, 215, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

/* ===== 섯다 게임 머니 설정 ===== */
.fg-money-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}

.fg-money-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    padding: 10px 12px;
    border: 1px solid rgba(255, 215, 0, 0.2);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.fg-money-player {
    display: flex;
    align-items: center;
    gap: 8px;
}

.fg-money-player-avatar {
    font-size: 16px;
}

.fg-money-player-name {
    font-size: 13px;
    font-weight: 600;
    color: #f5f5f5;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.fg-money-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.fg-money-btn {
    width: 30px;
    height: 30px;
    border: 1px solid #d4af37;
    border-radius: 6px;
    background: linear-gradient(180deg, #d4af37 0%, #aa8a1a 100%);
    color: #1a1a1a;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.fg-money-btn:hover {
    background: linear-gradient(180deg, #ffd700 0%, #d4af37 100%);
    border-color: #ffd700;
}

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

.fg-money-value {
    font-size: 15px;
    font-weight: 700;
    color: #ffd700;
    min-width: 80px;
    text-align: center;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8), 0 0 10px rgba(255, 215, 0, 0.3);
}

.money-icon {
    width: 20px;
    height: 20px;
    vertical-align: middle;
    margin-right: 4px;
}

.fg-money-bulk-controls {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.fg-money-bulk-btn {
    flex: 1;
    padding: 10px 10px;
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 8px;
    font-size: 20px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.fg-money-bulk-btn.decrease {
    background: linear-gradient(180deg, #ff6b6b 0%, #d63031 100%);
    color: white;
}

.fg-money-bulk-btn.decrease:hover {
    background: linear-gradient(180deg, #ff5252 0%, #c62828 100%);
    box-shadow: 0 4px 10px rgba(255, 82, 82, 0.4);
}

.fg-money-bulk-btn.reset {
    background: linear-gradient(180deg, #888 0%, #555 100%);
    color: white;
}

.fg-money-bulk-btn.reset:hover {
    background: linear-gradient(180deg, #999 0%, #666 100%);
    box-shadow: 0 4px 10px rgba(136, 136, 136, 0.4);
}

.fg-money-bulk-btn.increase {
    background: linear-gradient(180deg, #51cf66 0%, #37b24d 100%);
    color: white;
}

.fg-money-bulk-btn.increase:hover {
    background: linear-gradient(180deg, #69db7c 0%, #40c057 100%);
    box-shadow: 0 4px 10px rgba(81, 207, 102, 0.4);
}

/* ===== 반응형 ===== */
@media (max-width: 1024px) {
    .fg-main {
        grid-template-columns: 220px 1fr;
    }

    .fg-qr-code {
        width: 100px;
        height: 100px;
    }

    .fg-room-code-number {
        font-size: 24px;
    }
}

@media (max-width: 768px) {
    .family-game-wrap {
        padding: 8px;
    }

    .fg-header {
        padding: 8px 12px;
    }

    .fg-main {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .fg-sidebar {
        flex-direction: row;
    }

    .fg-qr-section {
        flex: 1;
    }

    .fg-players-section {
        flex: 1;
        max-height: 150px;
    }

    .fg-games-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }

    .fg-game-image {
        height: 120px;
    }

    .fg-room-code-number {
        font-size: 20px;
        letter-spacing: 3px;
    }

    .fg-qr-code {
        width: 80px;
        height: 80px;
    }

    .fg-game-difficulty,
    .fg-game-min-players,
    .fg-game-need-more {
        display: none;
    }
}

@media (max-width: 480px) {
    .fg-games-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
    }

    .fg-game-image {
        height: 100px;
    }

    .fg-sidebar {
        flex-direction: column;
    }

    .fg-qr-section {
        padding: 10px;
    }

    .fg-players-section {
        max-height: 120px;
    }
}

/* ===== 알림/확인 모달 ===== */
.alert-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.alert-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.alert-modal {
    background: linear-gradient(145deg, #1a1a2e 0%, #16213e 100%);
    border: 2px solid #667eea;
    border-radius: 20px;
    padding: 30px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 0 30px rgba(102, 126, 234, 0.3);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.alert-overlay.show .alert-modal {
    transform: scale(1);
}

.alert-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.alert-title {
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 15px;
}

.alert-message {
    font-size: 16px;
    color: #ccc;
    margin-bottom: 25px;
    line-height: 1.5;
    white-space: pre-line;
}

.alert-buttons {
    display: flex;
    justify-content: center;
    gap: 12px;
}

.alert-btn {
    padding: 12px 30px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.alert-btn.ok {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.alert-btn.ok:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.alert-btn.cancel {
    background: #444;
    color: #ccc;
}

.alert-btn.cancel:hover {
    background: #555;
}

.alert-btn.danger {
    background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
    color: white;
}

.alert-btn.danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(244, 67, 54, 0.4);
}

/* ===== QR 코드 모달 ===== */
.qr-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 3000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.qr-modal-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.qr-modal-content {
    background: linear-gradient(180deg, #2d1f16 0%, #1a0f0a 100%);
    border: 3px solid #d4af37;
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(255, 215, 0, 0.2) inset;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.qr-modal-overlay.show .qr-modal-content {
    transform: scale(1);
}

.qr-modal-title {
    font-size: 24px;
    font-weight: 700;
    color: #ffd700;
    margin-bottom: 20px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

.qr-modal-qr {
    width: 300px;
    height: 300px;
    margin: 0 auto 20px;
    background: white;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 4px solid #d4af37;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6), 0 0 30px rgba(255, 215, 0, 0.3);
}

.qr-modal-qr canvas {
    border-radius: 12px;
}

.qr-modal-info {
    font-size: 14px;
    color: #d4af37;
    margin-bottom: 20px;
    line-height: 1.6;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.qr-modal-room-code {
    font-size: 36px;
    font-weight: 800;
    letter-spacing: 6px;
    color: #ffd700;
    margin-bottom: 30px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8), 0 0 15px rgba(255, 215, 0, 0.5);
}

.qr-modal-close {
    width: 100%;
    padding: 16px;
    font-size: 16px;
    font-weight: 700;
    color: #1a1a1a;
    background: linear-gradient(180deg, #ffd700 0%, #d4af37 100%);
    border: 2px solid #ffd700;
    border-radius: 12px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.3);
    transition: all 0.2s;
}

.qr-modal-close:hover {
    background: linear-gradient(180deg, #ffed4e 0%, #ffd700 100%);
    box-shadow: 0 6px 16px rgba(255, 215, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}
