* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    height: 100%;
    width: 100%;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #0d0d0d 0%, #1a1a1a 50%, #0d0d0d 100%);
    color: #ccc;
    width: 100%;
    height: 100vh;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

.container {
    width: 100%;
    max-width: 500px;
    height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    margin-left: auto;
    margin-right: auto;
    z-index: 10;
}

/* PC 레이아웃 확장 */
.main-layout {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    width: 100%;
    gap: 30px;
    padding: 20px;
}

.pc-sidebar {
    display: none;
    /* 모바일에서는 숨김 */
    width: 300px;
    position: sticky;
    top: 20px;
    height: calc(100vh - 40px);
    overflow-y: auto;
}

.sidebar-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.info-section {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid #333;
    border-radius: 15px;
    padding: 20px;
}

.info-section h2 {
    font-size: 1.2em;
    margin-bottom: 12px;
    color: #ffd700;
    text-align: left;
}

.info-section p {
    font-size: 0.9em;
    line-height: 1.6;
    color: #bbb;
    white-space: pre-line;
}

.info-section h3 {
    font-size: 1em;
    margin: 15px 0 10px 0;
    color: #ffd700;
}

.info-section .content-text ul {
    margin: 10px 0;
    padding-left: 20px;
    list-style-type: disc;
}

.info-section .content-text li {
    margin: 6px 0;
    line-height: 1.5;
    color: #bbb;
    font-size: 0.85em;
}

.faq-list .faq-item {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.faq-list .faq-item:last-child {
    border-bottom: none;
}

.faq-list .faq-item strong {
    display: block;
    margin-bottom: 5px;
    color: #ffd700;
    font-size: 0.9em;
}

.faq-list .faq-item p {
    margin: 0;
    padding-left: 10px;
    font-size: 0.85em;
}

.tip-content {
    font-style: italic;
}


.ad-slot {
    background: rgba(0, 0, 0, 0.2);
    border: 1px dashed #444;
    border-radius: 10px;
    min-height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #555;
    font-size: 12px;
}

/* PC 버전 (1024px 이상) */
@media (min-width: 1024px) {
    .pc-sidebar {
        display: block;
    }

    .container {
        margin: 0;
        max-width: 500px;
        height: calc(100vh - 40px);
        flex-shrink: 0;
        display: flex;
        flex-direction: column;
    }

    /* PC에서는 로비의 일부 요소를 숨기거나 축소하여 스크롤 방지 */
    .rule-info {
        display: none !important;
    }

    .screen {
        height: 100%;
        overflow-y: hidden !important;
        /* PC 버전에서는 스크롤 절대 금지 */
    }

    body {
        overflow: hidden;
        /* 전체 페이지 스크롤 방지 */
    }
}

/* 모바일 뷰 최적화 (가로 모드 등) */
@media (max-width: 1023px) {
    .main-layout {
        padding: 0;
        gap: 0;
    }

    .container {
        max-width: 100%;
    }
}

.screen {
    display: none;
    background: rgba(20, 20, 20, 0.95);
    border: 1px solid #333;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.screen.active {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    animation: fadeIn 0.3s ease-in;
}

.screen.game-screen {
    padding: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 전역 사운드 토글 (모든 화면에서 표시) */
.sound-toggle-global {
    position: fixed;
    top: 15px;
    right: 15px;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sound-toggle-global .btn-icon {
    font-size: 20px;
    padding: 8px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    transition: all 0.2s;
    cursor: pointer;
}

.sound-toggle-global .btn-icon:hover {
    background: rgba(0, 0, 0, 0.7);
    transform: scale(1.1);
}

.sound-toggle-global .btn-icon.sound-on {
    color: #4CAF50;
}

.sound-toggle-global .btn-icon.sound-off {
    color: #f44336;
    opacity: 0.8;
}

/* 볼륨 컨트롤 */
.volume-control {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 20px;
    backdrop-filter: blur(10px);
}

.volume-slider {
    width: 100px;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: linear-gradient(to right, #4CAF50 0%, #4CAF50 var(--volume-percent, 70%), rgba(255, 255, 255, 0.3) var(--volume-percent, 70%), rgba(255, 255, 255, 0.3) 100%);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    background: #fff;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s;
}

.volume-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.volume-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: #fff;
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s;
}

.volume-slider::-moz-range-thumb:hover {
    transform: scale(1.2);
}

.volume-value {
    font-size: 12px;
    color: #fff;
    min-width: 35px;
    text-align: right;
    font-weight: 600;
}

/* 화면 헤더 (제목 + 코인) */
.screen-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 15px;
}

.screen-header h1,
.screen-header h2 {
    margin: 0;
}

h1 {
    text-align: center;
    font-size: 3em;
    margin-bottom: 10px;
}

h2 {
    text-align: center;
    margin-bottom: 20px;
}

/* 닉네임 + 코인 한 줄 */
.user-info-row {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    align-items: center;
}

.nickname-wrap {
    flex: 1;
    display: flex;
    gap: 5px;
}

.user-info-row input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #444;
    border-radius: 8px;
    background: #1a1a1a;
    color: #fff;
    font-size: 14px;
    text-align: center;
}

.btn-save-nickname {
    padding: 0 12px;
    background: #333;
    color: #ffd700;
    border: 1px solid #444;
    border-radius: 8px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    font-weight: bold;
}

.btn-save-nickname:hover {
    background: #444;
    border-color: #555;
    transform: translateY(-1px);
}

.btn-save-nickname:active {
    transform: translateY(0);
}

.coin-display {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 10px 15px;
    background: rgba(255, 215, 0, 0.1);
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 8px;
    font-weight: bold;
    color: #ffd700;
    white-space: nowrap;
}

/* 티켓 스타일 (친구끼리 방 전용) */
.coin-display.silver-coin {
    background: rgba(255, 165, 0, 0.1);
    border: 1px solid rgba(255, 165, 0, 0.3);
    color: #ffa500;
}

.silver-coin-display {
    color: #ffa500;
    font-weight: bold;
}

.prize-display.silver {
    color: #ffa500;
    font-size: 24px;
    margin-top: 15px;
}

.prize-display.silver.lose {
    color: #ff6b6b;
}

.coin-icon {
    font-size: 16px;
}

.subtitle {
    text-align: center;
    color: #aaa;
    margin-bottom: 20px;
}

.lobby-buttons {
    display: flex;
    flex-direction: column;
    gap: 20px;
    text-align: center;
}

.queue-info {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 10px;
    font-size: 13px;
    color: #888;
}

.divider {
    text-align: center;
    color: #666;
    font-size: 14px;
}

.join-section {
    display: flex;
    gap: 10px;
}

.join-section input {
    flex: 1;
    padding: 15px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 18px;
    text-transform: uppercase;
    text-align: center;
    letter-spacing: 3px;
}

.join-section input::placeholder {
    color: #888;
    text-transform: none;
    letter-spacing: normal;
}

.btn {
    padding: 15px 30px;
    border: none;
    border-radius: 10px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: linear-gradient(135deg, #444 0%, #222 100%);
    color: #fff;
    border: 1px solid #555;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: #aaa;
    border: 1px solid #444;
}

.btn-danger {
    background: linear-gradient(135deg, #8b0000 0%, #5c0000 100%);
    color: #fff;
    border: 1px solid #aa0000;
}

.btn-success {
    background: linear-gradient(135deg, #1b4d3e 0%, #0d2b21 100%);
    color: #fff;
    border: 1px solid #2e7d32;
}

.btn-small {
    padding: 8px 15px;
    font-size: 14px;
}

.btn-full {
    width: 100%;
}

.btn-link {
    background: #4CAF50;
    color: white;
}

.btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 랭킹 섹션 */
.ranking-section {
    margin-top: 20px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 15px;
}

.ranking-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.ranking-header h3 {
    margin: 0;
    font-size: 16px;
}

.btn-icon {
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    padding: 5px;
    opacity: 0.7;
    transition: opacity 0.2s, transform 0.2s;
    display: inline-block;
}

.btn-icon:hover {
    opacity: 1;
}

.btn-icon:active {
    transform: scale(0.9);
}

.btn-icon.spinning {
    animation: spin 0.6s linear infinite;
    opacity: 1;
    color: #ffd700;
}

.btn-icon:disabled {
    cursor: not-allowed;
    pointer-events: none;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.ranking-list {
    transition: opacity 0.2s;
}

.ranking-list.loading {
    opacity: 0.4;
}

.ranking-buttons {
    display: flex;
    gap: 5px;
}

.ranking-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    margin-bottom: 5px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    font-size: 13px;
}

.ranking-item.top-3 {
    background: rgba(255, 215, 0, 0.1);
}

.ranking-item.me {
    background: rgba(255, 107, 107, 0.2);
    border: 1px solid rgba(255, 107, 107, 0.3);
}

.ranking-rank {
    font-weight: bold;
    min-width: 30px;
}

.ranking-rank.gold {
    color: #ffd700;
}

.ranking-rank.silver {
    color: #c0c0c0;
}

.ranking-rank.bronze {
    color: #cd7f32;
}

.ranking-name {
    flex: 1;
    margin: 0 10px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ranking-coins {
    color: #ffd700;
    font-weight: bold;
}

.ranking-empty {
    text-align: center;
    color: #666;
    padding: 20px;
    font-size: 13px;
}

.my-rank-info {
    margin-top: 10px;
    padding: 8px 12px;
    background: rgba(255, 107, 107, 0.1);
    border-radius: 8px;
    text-align: center;
    font-size: 12px;
    color: #aaa;
}

.my-rank-info:empty {
    display: none;
}

/* 모달 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease;
}

.modal-content {
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 15px;
    width: 90%;
    max-width: 400px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #333;
}

.modal-header h3 {
    margin: 0;
    font-size: 16px;
}

.full-ranking-list {
    padding: 15px;
    overflow-y: auto;
    flex: 1;
}

.rule-info {
    margin-top: 20px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 15px;
}

.rule-info h3 {
    margin-bottom: 15px;
    text-align: center;
}

.rule-item {
    padding: 10px 15px;
    margin-bottom: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    font-size: 14px;
}

/* SNS 공유 */
.share-section {
    margin-top: 20px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 15px;
}

.share-section h3 {
    margin-bottom: 15px;
    text-align: center;
}

.share-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.btn-share {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.btn-share i {
    font-size: 20px;
}

.btn-share:hover {
    transform: scale(1.15);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.btn-share:active {
    transform: scale(1.05);
}

.btn-share.kakao {
    background: #FEE500;
    color: #3C1E1E;
}

.btn-share.twitter {
    background: #000;
    color: #fff;
}

.btn-share.facebook {
    background: #1877F2;
    color: #fff;
}

.btn-share.link {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

.bullet-selection {
    margin-bottom: 30px;
}

.bullet-selection h3 {
    margin-bottom: 15px;
}

.bullet-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.bullet-option {
    display: flex;
    align-items: center;
    padding: 15px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
}

.bullet-option:hover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.2);
}

.bullet-option input {
    margin-right: 15px;
    width: 20px;
    height: 20px;
}

.room-info {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 15px;
}

.room-code {
    font-size: 2.5em;
    font-weight: bold;
    letter-spacing: 8px;
    color: #aa0000;
    margin: 10px 0;
}

.my-number-display {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(135deg, #1a1a1a 0%, #0d0d0d 100%);
    border: 1px solid #aa0000;
    border-radius: 15px;
}

.my-number {
    font-size: 4em;
    font-weight: bold;
    color: #fff;
}

.players-list {
    margin-bottom: 30px;
}

.players-list h3 {
    margin-bottom: 15px;
}

#playersList {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.player-tag {
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    font-size: 16px;
}

.player-tag.me {
    background: linear-gradient(135deg, #8b0000 0%, #5c0000 100%);
    border: 1px solid #aa0000;
}

.player-tag.host::after {
    content: ' 👑';
}

.host-controls {
    margin-bottom: 20px;
}

.waiting-message {
    text-align: center;
    color: #aaa;
    font-style: italic;
}

/* 게임 프레임 - 고정 레이아웃 */
.game-frame {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    overflow: hidden;
}

.game-header {
    flex-shrink: 0;
    text-align: center;
    padding: 10px 15px;
    background: rgba(0, 0, 0, 0.5);
    border-bottom: 1px solid #333;
}

.game-stats {
    display: flex;
    justify-content: center;
    gap: 15px;
    font-size: 13px;
    color: #aaa;
    margin-top: 5px;
}

.round-info {
    font-size: 16px;
    font-weight: bold;
    color: #aa0000;
}

.game-arena {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 10px;
    min-height: 0;
}

.players-circle {
    position: relative;
    width: 100%;
    height: 100%;
    max-width: 400px;
    max-height: 400px;
    aspect-ratio: 1;
}

.center-bulb {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.bulb-wire {
    width: 2px;
    height: clamp(10px, 3vw, 15px);
    background: #222;
}

.bulb-socket {
    width: clamp(10px, 3vw, 14px);
    height: clamp(7px, 2vw, 10px);
    background: linear-gradient(180deg, #a08060 0%, #705030 50%, #a08060 100%);
    border-radius: 3px 3px 0 0;
}

.bulb {
    width: clamp(30px, 10vw, 45px);
    height: clamp(30px, 10vw, 45px);
    border-radius: 50%;
    transition: all 0.15s;
    position: relative;
}

.bulb.off {
    background: radial-gradient(circle at 30% 30%, #555 0%, #333 50%, #222 100%);
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5);
}

.bulb.on {
    background: radial-gradient(circle at 30% 30%, #ffffff 0%, #fffacd 30%, #ffd700 70%, #ffaa00 100%);
    box-shadow:
        0 0 30px #ffd700,
        0 0 60px #ffa500,
        0 0 90px rgba(255, 150, 0, 0.4),
        inset 0 0 10px rgba(255, 255, 255, 0.3);
    animation: bulbGlow 0.4s infinite;
}

.bulb::after {
    content: '';
    position: absolute;
    top: 8px;
    left: 10px;
    width: 10px;
    height: 10px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.6) 0%, transparent 70%);
    border-radius: 50%;
}

.arrows-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.target-line {
    animation: laserPulse 1.5s infinite;
}

.target-cross {
    animation: crossPulse 1s infinite;
}

.gun-icon {
    filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.5));
    transition: transform 0.2s;
}

@keyframes laserPulse {

    0%,
    100% {
        stroke-opacity: 0.3;
    }

    50% {
        stroke-opacity: 0.7;
    }
}

@keyframes crossPulse {

    0%,
    100% {
        opacity: 0.6;
    }

    50% {
        opacity: 1;
    }
}

.player-node {
    position: absolute;
    width: 70px;
    height: 70px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    z-index: 2;
}

.player-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #333 0%, #1a1a1a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: bold;
    border: 2px solid #555;
    position: relative;
    color: #ccc;
}

.player-node.me .player-avatar {
    border-color: #aa0000;
    box-shadow: 0 0 15px rgba(170, 0, 0, 0.5);
    color: #fff;
}

.action-buttons-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    width: 100%;
    margin-bottom: 15px;
}

.btn-item {
    font-size: 28px;
    padding: 10px 5px;
    margin: 0;
    flex: 1;
    min-width: 80px;
    max-width: 100px;
    height: auto;
    min-height: 85px;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.btn-item:not(:disabled):hover {
    transform: translateY(-2px);
    border-color: #aaa;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.btn-item:disabled {
    opacity: 0.3;
    filter: grayscale(1);
    cursor: not-allowed;
}

.btn-item.active {
    background: rgba(255, 215, 0, 0.1);
    border-color: #ffd700;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.2);
}

.btn-item:active {
    transform: scale(0.95);
    background: rgba(255, 255, 255, 0.1);
}

.btn-item.clicked {
    transform: scale(0.95);
    background: rgba(255, 255, 255, 0.05);
    border-color: #666;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.5);
}

.btn-item .item-count {
    position: static;
    background: none;
    color: #ffd700;
    font-size: 14px;
    font-weight: bold;
    min-width: auto;
    height: auto;
    line-height: 1;
    text-align: center;
    border-radius: 0;
    border: none;
    box-shadow: none;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.player-node.eliminated .player-avatar {
    background: #111;
    border-color: #333;
    color: #444;
}

.player-node.eliminated .player-avatar::after {
    content: '✕';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 35px;
    color: #660000;
    font-weight: bold;
    opacity: 0.7;
}

.player-node.surrendered.eliminated .player-avatar {
    background: #111;
    border-color: #333;
}

.player-node.surrendered .player-avatar::after {
    content: '🏳️' !important;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 30px;
    opacity: 1 !important;
    z-index: 10 !important;
    display: block !important;
}

/* 백기 상태면 X표시 숨김 */
.player-node.surrendered.eliminated .player-avatar::after {
    content: '🏳️' !important;
}

.player-node.shot .player-avatar {
    animation: shotPulse 0.3s ease-out;
    box-shadow: 0 0 20px rgba(255, 50, 50, 0.8);
}

/* 총알 발사 효과 */
.bullet-effect {
    position: absolute;
    width: 20px;
    height: 20px;
    background: radial-gradient(circle, #fff 0%, #ffd700 40%, #ff6600 70%, transparent 100%);
    border-radius: 50%;
    z-index: 100;
    pointer-events: none;
    box-shadow:
        0 0 15px #ffd700,
        0 0 30px rgba(255, 150, 0, 1),
        0 0 45px rgba(255, 100, 0, 0.8);
}

/* 총알 타격 이펙트 */
.bullet-impact {
    position: absolute;
    width: 50px;
    height: 50px;
    transform: translate(-50%, -50%);
    z-index: 100;
    pointer-events: none;
    background: radial-gradient(circle, rgba(255, 255, 200, 1) 0%, rgba(255, 150, 0, 0.8) 30%, rgba(255, 50, 0, 0.4) 60%, transparent 80%);
    border-radius: 50%;
    animation: impactBurst 0.4s ease-out forwards;
}

@keyframes impactBurst {
    0% {
        transform: translate(-50%, -50%) scale(0.3);
        opacity: 1;
    }

    50% {
        transform: translate(-50%, -50%) scale(1.5);
        opacity: 0.8;
    }

    100% {
        transform: translate(-50%, -50%) scale(2.5);
        opacity: 0;
    }
}

/* 총구 화염 효과 */
.muzzle-flash {
    position: absolute;
    width: 35px;
    height: 35px;
    background: radial-gradient(circle, #fff 0%, #ffff00 20%, #ff6600 50%, transparent 70%);
    border-radius: 50%;
    z-index: 99;
    animation: muzzleFlash 0.2s ease-out forwards;
    pointer-events: none;
}

@keyframes muzzleFlash {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(2);
    }

    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.5);
    }
}

/* 발사 효과 - 불꽃 */
.fire-effect {
    position: absolute;
    font-size: 28px;
    z-index: 100;
    pointer-events: none;
    animation: fireAnim 0.6s ease-out forwards;
}

@keyframes fireAnim {
    0% {
        opacity: 0;
        scale: 0.5;
    }

    20% {
        opacity: 1;
        scale: 1.3;
    }

    80% {
        opacity: 1;
        scale: 1;
    }

    100% {
        opacity: 0;
        scale: 0.8;
    }
}

/* 불발 효과 - 단순히 나타났다 사라짐 */
.misfire-effect {
    position: absolute;
    font-size: 24px;
    z-index: 100;
    pointer-events: none;
    animation: misfireAnim 0.6s ease-out forwards;
}

@keyframes misfireAnim {
    0% {
        opacity: 0;
        scale: 0.5;
    }

    20% {
        opacity: 1;
        scale: 1.2;
    }

    80% {
        opacity: 1;
        scale: 1;
    }

    100% {
        opacity: 0;
        scale: 0.8;
    }
}

.player-node.misfired .player-avatar {
    animation: misfireShake 0.3s ease-out;
}

@keyframes misfireShake {

    0%,
    100% {
        transform: rotate(0deg);
    }

    25% {
        transform: rotate(-5deg);
    }

    75% {
        transform: rotate(5deg);
    }
}

@keyframes shotPulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
    }
}

.player-node.just-hit .player-avatar {
    animation: hitShake 0.5s ease-out;
}

@keyframes hitShake {

    0%,
    100% {
        transform: translateX(0);
    }

    20% {
        transform: translateX(-10px);
    }

    40% {
        transform: translateX(10px);
    }

    60% {
        transform: translateX(-5px);
    }

    80% {
        transform: translateX(5px);
    }
}

.hit-message {
    position: absolute;
    /* top은 JS에서 동적 설정 */
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    padding: 15px 30px;
    border-radius: 20px;
    font-size: 20px;
    font-weight: bold;
    z-index: 1000;
    border: 1px solid #aa0000;
    animation: hitMessageSlideIn 0.3s ease-out;
    transition: top 0.3s ease-out, opacity 0.3s ease-out;
}

@keyframes hitMessageSlideIn {
    0% {
        transform: translateX(-50%) scale(0.8);
        opacity: 0;
    }

    100% {
        transform: translateX(-50%) scale(1);
        /* opacity는 JS에서 설정 */
    }
}


.player-label {
    margin-top: 5px;
    font-size: 12px;
    color: #aaa;
}

.player-node.me .player-label {
    color: #aa0000;
    font-weight: bold;
}

.game-controls {
    flex-shrink: 0;
    text-align: center;
    padding: 15px;
    background: rgba(0, 0, 0, 0.5);
    border-top: 1px solid #333;
}

.shooting-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.phase {
    text-align: center;
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

@keyframes bulbGlow {

    0%,
    100% {
        transform: scale(1);
        filter: brightness(1);
    }

    50% {
        transform: scale(1.05);
        filter: brightness(1.2);
    }
}

.wait-hint {
    color: #888;
    font-size: 14px;
    margin-top: 10px;
}

.countdown {
    font-size: 80px;
    font-weight: bold;
    color: #ffd700;
    animation: pulse 1s infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

.shoot-instruction {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 15px;
    min-height: 28px;
}

.shoot-instruction.wait-mode {
    color: #666;
    animation: none;
}

.shoot-instruction.fire-mode {
    color: #ff3333;
    animation: blink 0.3s infinite;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.btn-shoot {
    font-size: 36px;
    padding: 0;
    margin: 0;
    flex: 2;
    min-width: 180px;
    height: 95px;
}

.btn-shoot:disabled {
    background: transparent;
    border: 2px dashed rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.2);
    box-shadow: none;
    transform: none;
}

.timer-bar {
    width: 100%;
    max-width: 300px;
    height: 8px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}

.timer-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #aa0000 0%, #ff3333 100%);
    width: 100%;
    transition: width 3s linear;
}

.timer-text {
    color: #555;
    font-size: 14px;
    min-height: 20px;
}

/* 소생 배지 */
.resurrect-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #4CAF50;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 12px;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
    z-index: 10;
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.player-node.resurrected .player-avatar {
    border-color: #4CAF50 !important;
    box-shadow: 0 0 15px rgba(76, 175, 80, 0.6) !important;
}

@keyframes popIn {
    from {
        transform: scale(0);
    }

    to {
        transform: scale(1);
    }
}

.timer-text.active {
    color: #aa0000;
}

/* 라운드 결과 모달 */
.result-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.result-modal-content {
    background: linear-gradient(135deg, rgba(20, 20, 20, 0.95), rgba(40, 40, 40, 0.95));
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 30px;
    max-width: 400px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.round-results {
    margin-bottom: 15px;
    width: 100%;
}

.round-results h3 {
    margin-bottom: 15px;
    font-size: 18px;
    text-align: center;
    color: #fff;
}

.next-round-countdown {
    color: #ff6b6b;
    font-size: 18px;
    font-weight: bold;
    text-align: center;
    margin-top: 15px;
}

.result-item {
    padding: 12px 15px;
    margin-bottom: 10px;
    border-radius: 10px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s;
}

.result-item:hover {
    transform: translateX(5px);
}

.result-item.hit {
    background: rgba(139, 0, 0, 0.4);
    border: 2px solid #aa0000;
    box-shadow: 0 0 15px rgba(170, 0, 0, 0.3);
}

.result-item.survived {
    background: rgba(76, 175, 80, 0.2);
    border: 2px solid rgba(76, 175, 80, 0.5);
}

/* 승리자 화면 배경 */
/* 승리자 화면 - 박스만 초록색 */
#endScreen.winner-screen .winner-info {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.3) 0%, rgba(46, 125, 50, 0.3) 100%);
    border-color: #4CAF50;
}

.winner-info {
    text-align: center;
    margin: 20px 0;
    padding: 20px;
    background: linear-gradient(135deg, rgba(139, 0, 0, 0.3) 0%, rgba(92, 0, 0, 0.3) 100%);
    border-radius: 15px;
    border: 2px solid #aa0000;
}

.winner-info .winner-name {
    font-size: 1.8em;
    font-weight: bold;
    color: #ffc107;
    margin-bottom: 12px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.winner-info p {
    font-size: 1.1em;
    margin: 0;
    color: rgba(255, 255, 255, 0.9);
}

.winner-info .prize-display {
    font-size: 2em;
    font-weight: bold;
    color: #ffd700;
    margin-top: 15px;
    text-shadow: 0 2px 10px rgba(255, 215, 0, 0.5);
}

.end-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* 모바일 반응형 */
@media (max-width: 480px) {
    .screen {
        padding: 15px;
    }

    h1 {
        font-size: 2em;
    }

    .room-code {
        font-size: 1.8em;
        letter-spacing: 4px;
    }

    .my-number {
        font-size: 2.5em;
    }

    .player-node {
        width: 55px;
        height: 55px;
    }

    .player-avatar {
        width: 38px;
        height: 38px;
        font-size: 14px;
    }

    .player-label {
        font-size: 10px;
    }

    .btn-shoot {
        font-size: 26px;
        padding: 15px 0;
        min-width: 140px;
        height: 75px;
    }

    .btn-item {
        font-size: 26px;
        padding: 12px 0;
        min-width: 70px;
        height: 65px;
    }

    .shoot-instruction {
        font-size: 16px;
    }

    .game-stats {
        font-size: 11px;
        gap: 10px;
    }

    .rule-info {
        padding: 15px;
    }

    .rule-item {
        font-size: 12px;
        padding: 8px 12px;
    }
}

@media (max-height: 600px) {
    .game-header {
        padding: 8px 10px;
    }

    .round-info {
        font-size: 14px;
    }

    .game-stats {
        font-size: 10px;
    }

    .game-controls {
        padding: 10px;
    }

    .btn-shoot {
        font-size: 20px;
        padding: 10px 0;
        min-width: 120px;
        height: 60px;
    }

    .btn-item {
        font-size: 20px;
        padding: 8px 0;
        min-width: 60px;
        height: 55px;
    }

    .shoot-instruction {
        font-size: 14px;
        margin-bottom: 10px;
    }

    .timer-bar {
        max-width: 200px;
        height: 6px;
    }
}

@media (max-width: 360px) {
    .player-node {
        width: 45px;
        height: 45px;
    }

    .player-avatar {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }
}

/* 대기 화면 코인 표시 */
.queue-coin-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 15px 0;
    padding: 12px 20px;
    background: rgba(255, 193, 7, 0.15);
    border: 2px solid rgba(255, 193, 7, 0.3);
    border-radius: 12px;
    font-size: 20px;
    font-weight: bold;
    color: #ffc107;
}

.queue-coin-display .coin-icon {
    font-size: 24px;
}

/* 대기 정보 카드 */
.queue-info-cards {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 20px 0;
}

.queue-card-row {
    display: flex;
    gap: 12px;
}

.queue-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    padding: 15px;
    position: relative;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.queue-card-half {
    flex: 1;
}

.queue-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.25);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

.queue-card-main {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.2), rgba(76, 175, 80, 0.1));
    border-color: rgba(76, 175, 80, 0.4);
}

.queue-card-prize {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.2), rgba(255, 193, 7, 0.1));
    border-color: rgba(255, 193, 7, 0.4);
}

.queue-card-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 32px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
    opacity: 0.3;
}

.queue-card-icon-small {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 24px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
    opacity: 0.3;
}

.queue-card-content {
    width: 100%;
    text-align: center;
}

.queue-card-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    margin: 3px 0 0 0;
}

.queue-players-count {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 6px;
    font-weight: bold;
    margin-bottom: 3px;
}

.queue-players-count .current-count {
    font-size: 36px;
    color: #4CAF50;
    line-height: 1;
    text-shadow: 0 2px 8px rgba(76, 175, 80, 0.5);
}

.queue-players-count .divider {
    font-size: 24px;
    color: rgba(255, 255, 255, 0.5);
}

.queue-players-count .max-count {
    font-size: 24px;
    color: rgba(255, 255, 255, 0.8);
}

.countdown-display-small {
    font-size: 24px;
    font-weight: bold;
    color: #fff;
    margin-top: 3px;
    text-shadow: 0 2px 8px rgba(255, 255, 255, 0.3);
}

.prize-amount-small {
    font-size: 24px;
    font-weight: bold;
    color: #ffc107;
    margin-top: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    text-shadow: 0 2px 8px rgba(255, 193, 7, 0.5);
}

.prize-amount-small .coin-icon {
    font-size: 20px;
}

/* 내 통계 */
.my-stats {
    margin: 30px 0 20px 0;
    padding: 20px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.stats-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.stats-header h3 {
    margin: 0;
    font-size: 16px;
    color: #fff;
    order: 1;
}

.stats-tabs {
    display: flex;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 3px;
    order: 2;
}

.stats-tab {
    padding: 6px 12px;
    border: none;
    background: none;
    color: #888;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
}

.stats-tab.active {
    background: rgba(76, 175, 80, 0.2);
    color: #4CAF50;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.stats-tab:not(.active):hover {
    color: #ccc;
    background: rgba(255, 255, 255, 0.05);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    transition: all 0.2s;
}

.stat-item:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.stat-label {
    font-size: 12px;
    color: #888;
    margin-bottom: 5px;
    order: 1;
}

.stat-value {
    font-size: 24px;
    font-weight: bold;
    color: #4CAF50;
    order: 2;
}

/* 모바일 대응 */
@media (max-width: 600px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .stat-value {
        font-size: 20px;
    }

    .stat-label {
        font-size: 11px;
    }
}

/* 광고 모달 */
.ad-modal {
    max-width: 600px;
    padding: 30px;
}

.ad-modal h3 {
    margin: 0 0 15px 0;
    font-size: 24px;
    color: #ffc107;
}

.ad-modal p {
    margin: 10px 0;
    color: #ccc;
}

.ad-modal strong {
    color: #4CAF50;
    font-size: 20px;
}

.ad-note {
    font-size: 14px;
    color: #888;
    font-style: italic;
}

.ad-container {
    margin: 20px 0;
    min-height: 250px;
    background: #2a2a2a;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px dashed #444;
}

.ad-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
}

.ad-buttons .btn {
    margin: 0;
}

/* 하단 고정 배너 광고 */
.bottom-banner-ad {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #1a1a1a;
    border-top: 2px solid #333;
    padding: 10px;
    z-index: 999;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 90px;
    max-height: 120px;
}

.bottom-banner-ad.hidden {
    display: none;
}

.close-banner-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 1000;
}

.close-banner-btn:hover {
    background: rgba(255, 0, 0, 0.8);
    transform: scale(1.1);
}

/* 하단 광고가 있을 때 컨테이너 여백 */
body.has-banner-ad .container {
    padding-bottom: 120px;
}

/* 모바일 대응 */
@media (max-width: 600px) {
    .bottom-banner-ad {
        min-height: 70px;
        max-height: 100px;
        padding: 5px;
    }

    body.has-banner-ad .container {
        padding-bottom: 100px;
    }
}

/* 공유 토스트 메시지 */
.share-toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: bold;
    z-index: 10000;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
}

.share-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}


/* 로그인 섹션 */
.login-section {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 15px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.login-section.logged-in {
    background: rgba(76, 175, 80, 0.1);
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.btn-login {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: #fff;
    color: #333;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-login:hover {
    background: #f5f5f5;
    transform: translateY(-1px);
}

.btn-login img {
    width: 18px;
    height: 18px;
}

.user-info {
    color: #4CAF50;
    font-weight: bold;
    font-size: 14px;
}


/* 하단 버튼 (공유 + 설정) */
.bottom-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
    padding: 15px 0;
}

.btn-share.settings {
    background: #555;
}

.btn-share.settings:hover {
    background: #666;
}

/* 설정 모달 */
.settings-list {
    padding: 10px 20px;
}

.settings-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.settings-item:last-child {
    border-bottom: none;
}

/* 설정 모달 볼륨 컨트롤 */
.settings-item.volume-setting {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
}

.volume-control-setting {
    display: flex;
    align-items: center;
    gap: 10px;
}

.volume-slider-setting {
    flex: 1;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: linear-gradient(to right, #4CAF50 0%, #4CAF50 var(--volume-percent, 70%), rgba(255, 255, 255, 0.3) var(--volume-percent, 70%), rgba(255, 255, 255, 0.3) 100%);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

.volume-slider-setting::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    background: #fff;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.volume-slider-setting::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: #fff;
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.volume-value-setting {
    font-size: 14px;
    color: #fff;
    min-width: 40px;
    text-align: right;
    font-weight: 600;
}

.settings-label {
    font-size: 16px;
    color: #ccc;
}

.btn-toggle {
    padding: 8px 20px;
    border: none;
    border-radius: 20px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-toggle.on {
    background: #4CAF50;
    color: white;
}

.btn-toggle.off {
    background: #666;
    color: #ccc;
}

.account-section {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
}

.account-status {
    width: 100%;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    text-align: center;
}

.account-status .not-logged-in {
    color: #888;
}

.account-status .logged-in {
    color: #4CAF50;
}

.settings-buttons {
    margin-top: 15px;
}

.settings-buttons .btn {
    width: 100%;
    margin-bottom: 10px;
}

.settings-note {
    font-size: 12px;
    color: #666;
    text-align: center;
    margin-top: 10px;
}


/* 이모지 이미지 */
.emoji-img {
    display: inline-block;
    vertical-align: middle;
    margin: 0 2px;
}

/* 관전자 전용 버튼 */
.btn-spectator-leave {
    margin-top: 20px;
    margin-bottom: 25px;
    padding: 10px 20px;
    font-size: 16px;
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #eee;
    transition: all 0.3s ease;
    width: auto !important;
    min-width: 180px;
}

.btn-spectator-leave:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* 게임 코인이력 상세 */
.game-coin-history {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
    text-align: left;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.history-title {
    font-size: 14px;
    color: #aaa;
    margin-bottom: 15px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 10px;
}

.coin-history-list {
    list-style: none;
    padding: 0 !important;
    margin: 0 !important;
}

.coin-history-list li {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 16px;
}

.coin-history-list li .label {
    color: #eee;
}

.coin-history-list li .amount {
    font-weight: bold;
}

.coin-history-list li .amount.plus {
    color: #4CAF50;
}

.coin-history-list li .amount.minus {
    color: #ff3333;
}

.total-change {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 2px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    font-size: 18px;
    font-weight: bold;
}

.total-change .amount.plus {
    color: #4CAF50;
    text-shadow: 0 0 10px rgba(76, 175, 80, 0.3);
}

.total-change .amount.minus {
    color: #ff3333;
    text-shadow: 0 0 10px rgba(255, 51, 51, 0.3);
}

.winner-screen .game-coin-history {
    border-color: rgba(255, 215, 0, 0.3);
    background: rgba(255, 215, 0, 0.05);
}

/* === 아이템 상점 === */
.btn-shop {
    background-color: #4CAF50;
    color: white;
    font-weight: bold;
    margin-bottom: 20px;
    /* 친구끼리 버튼과 간격 */
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
}

.btn-shop:hover {
    background-color: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
}

.shop-modal {
    max-width: 500px;
    width: 90%;
    padding: 25px;
}

.shop-title {
    font-size: 1.8em;
    /* 폰트 크기 확대 */
    margin: 0;
}

.shop-header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-close-red {
    background-color: #dc3545;
    color: white;
    border: none;
    border-radius: 8px;
    /* 둥근 사각형 */
    width: 36px;
    height: 36px;
    font-size: 1.2em;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(220, 53, 69, 0.4);
    transition: all 0.2s;
}

.btn-close-red:hover {
    background-color: #c82333;
    transform: scale(1.05);
}

.shop-coin-display {
    background: rgba(0, 0, 0, 0.3);
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 1.1em;
    font-weight: bold;
    color: #ffd700;
    border: 1px solid rgba(255, 215, 0, 0.3);
}

.shop-item-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
}

.shop-item {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 15px;
    transition: transform 0.2s, background 0.2s;
    position: relative;
    /* 이펙트 위치 기준 */
    overflow: hidden;
    /* 이펙트 넘침 방지 */
}

.shop-item:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 215, 0, 0.3);
}

/* 구매 성공 이펙트 */
@keyframes purchaseFlash {
    0% {
        background-color: rgba(255, 215, 0, 0.8);
    }

    100% {
        background-color: rgba(255, 255, 255, 0.05);
    }
}

.purchase-success {
    animation: purchaseFlash 0.5s ease-out;
}

.shop-item-icon {
    font-size: 2.5em;
    margin-right: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 50%;
}

.shop-item-info {
    flex: 1;
}

.shop-item-name {
    font-size: 1.2em;
    font-weight: bold;
    color: #fff;
    margin-bottom: 4px;
}

.shop-item-desc {
    font-size: 0.9em;
    color: #aaa;
    line-height: 1.3;
}

.btn-buy {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px 15px;
    /* 패딩 증가 */
    min-width: 80px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-buy:hover {
    filter: brightness(1.1);
    transform: scale(1.05);
}

.btn-buy:active {
    transform: scale(0.95);
}

.btn-buy .price {
    font-size: 1.1em;
    /* 가격 폰트 확대 */
    font-weight: bold;
    color: #ffeb3b;
    margin-bottom: 0px;
    /* 마진 제거 */
}

.shop-item-stock {
    font-size: 0.9em;
    color: #4CAF50;
    margin-top: 5px;
    font-weight: bold;
}

/* === 토스트 메시지 === */
.toast-message {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 14px;
    z-index: 2000;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
    white-space: nowrap;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

/* 범용 알림 메시지 (사망 메시지 스타일) */
.notification-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    padding: 20px 40px;
    border-radius: 15px;
    font-size: 24px;
    font-weight: bold;
    z-index: 3000;
    border: 2px solid #aa0000;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.8), 0 0 15px rgba(170, 0, 0, 0.3);
    pointer-events: none;
    white-space: nowrap;
    animation: notificationAnim 2.5s ease-out forwards;
}

.notification-message.error {
    border-color: #ff3333;
    color: #fff;
    text-shadow: 0 0 10px rgba(255, 51, 51, 0.5);
}

.notification-message.success {
    border-color: #4CAF50;
    color: #fff;
    text-shadow: 0 0 10px rgba(76, 175, 80, 0.5);
}

@keyframes notificationAnim {
    0% {
        opacity: 0;
        transform: translate(-50%, -40%) scale(0.8);
    }

    10% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.1);
    }

    15% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }

    85% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }

    100% {
        opacity: 0;
        transform: translate(-50%, -60%) scale(0.9);
    }
}

.toast-message.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast-message.error {
    background: rgba(220, 53, 69, 0.9);
}

.toast-message.success {
    background: rgba(40, 167, 69, 0.9);
}

/* 계정 데이터 충돌 해결 모달 */
.migration-desc {
    color: #bbb;
    font-size: 14px;
    margin-bottom: 20px;
    line-height: 1.5;
    text-align: center;
}

.migration-cards {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.migration-card {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    transition: all 0.3s ease;
}

.migration-card:hover {
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-5px);
}

.migration-card.selected {
    border-color: #4CAF50;
    background: rgba(76, 175, 80, 0.1);
}

.card-title {
    font-size: 16px;
    font-weight: bold;
    text-align: center;
    color: #fff;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.card-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-size: 18px;
    font-weight: bold;
}

.card-item {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #ffc107;
}

.card-stats {
    font-size: 13px;
    color: #888;
    margin-top: 5px;
    font-weight: normal;
}

#chooseGuestBtn {
    margin-top: auto;
}

@media (max-width: 600px) {
    .migration-cards {
        flex-direction: column;
    }
}
