* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 스크롤바 완전 제거 */
html {
    overflow: hidden;
    width: 100vw;
    height: 100vh;
}

body {
    overflow: hidden;
    width: 100vw;
    height: 100vh;
}

/* 모든 브라우저에서 스크롤바 숨기기 */
::-webkit-scrollbar {
    display: none;
}

html {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

html, body {
    font-family: 'Arial', sans-serif;
    background: #000;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    user-select: none;
    margin: 0;
    padding: 0;
    position: fixed;
}

/* 전체 화면 모드 최적화 */
html:-webkit-full-screen,
html:-moz-full-screen,
html:-ms-fullscreen,
html:fullscreen {
    width: 100vw;
    height: 100vh;
}

body:-webkit-full-screen,
body:-moz-full-screen,
body:-ms-fullscreen,
body:fullscreen {
    width: 100vw;
    height: 100vh;
}

/* 전체 화면에서 점수 영역 비율 고정 */
:-webkit-full-screen .player-section,
:-moz-full-screen .player-section,
:-ms-fullscreen .player-section,
:fullscreen .player-section {
    flex: 1 1 50% !important;
    width: 50% !important;
    min-width: 50% !important;
    max-width: 50% !important;
}

/* iOS Safari 전체 화면 지원 */
@supports (padding: max(0px)) {
    html, body {
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
    }
}

/* 세로 모드에서 화면을 90도 회전 */
@media (orientation: portrait) {
    html, body {
        overflow: hidden !important;
        position: fixed !important;
        width: 100vw !important;
        height: 100vh !important;
    }
    
    .scoreboard-container {
        transform: rotate(90deg);
        transform-origin: center center;
        width: 100vh;
        height: 100vw;
        position: absolute;
        top: 50vh;
        left: 50vw;
        margin-left: -50vh;
        margin-top: -50vw;
    }
}

.scoreboard-container {
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* 메뉴 힌트 표시 - 가로 모드 기본값 */
.menu-hint {
    position: absolute;
    top: 5px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 15;
    padding: 12px 20px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 0 0 15px 15px;
    backdrop-filter: blur(5px);
    animation: hintPulse 2s ease-in-out infinite;
    transition: opacity 0.3s ease;
}

/* 메뉴가 열렸을 때 힌트 숨기기 */
.menu-hint.hidden {
    opacity: 0;
    pointer-events: none;
}

/* 세로 모드에서 메뉴 힌트 완전 재정의 */
body.portrait-mode .menu-hint {
    position: fixed !important;
    top: 50% !important;
    right: 5px !important;
    left: unset !important;
    bottom: unset !important;
    transform: translateY(-50%) !important;
    padding: 12px 20px !important;
    background: rgba(0, 0, 0, 0.3) !important;
    border-radius: 15px 0 0 15px !important;
    backdrop-filter: blur(5px) !important;
    animation: hintPulse 2s ease-in-out infinite !important;
    z-index: 999 !important;
}

.hint-handle {
    width: 50px;
    height: 6px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 3px;
    margin: 0 auto;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    position: relative;
}

/* 세로 모드에서 핸들을 세로로 변경 */
body.portrait-mode .hint-handle {
    width: 6px !important;
    height: 50px !important;
    margin: 0 !important;
}

.hint-handle::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.3));
    border-radius: 5px;
    z-index: -1;
}

@keyframes hintPulse {
    0%, 100% { 
        opacity: 0.6;
    }
    50% { 
        opacity: 1;
    }
}

/* 설정 버튼 */
.settings-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 24px;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
    color: white;
}

.settings-btn.hidden {
    opacity: 0;
    pointer-events: none;
}

.settings-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

/* 점수 표시 영역 */
.score-display {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    gap: 0;
}

.player-section {
    flex: 1 1 50%;
    width: 50%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s ease;
    position: relative;
}

.player-section.left {
    background: #1a1a1a;
}

.player-section.right {
    background: #2a2a2a;
}

.player-section:hover {
    background: #333 !important;
}

.player-section:active {
    background: #444 !important;
}

.score {
    font-size: 76vw;
    font-weight: 900;
    color: white;
    text-shadow: none;
    line-height: 0.7;
    pointer-events: none;
    font-family: 'Arial Black', Arial, sans-serif;
}

.divider {
    width: 4px;
    height: 100vh;
    background: linear-gradient(to bottom, #666, #999, #666);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

/* 승리 오버레이 */
.winner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.winner-message {
    background: white;
    padding: 50px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.winner-message h2 {
    font-size: 4rem;
    color: #4CAF50;
    margin-bottom: 30px;
}

.winner-message button {
    padding: 20px 40px;
    border: none;
    border-radius: 25px;
    background: #4CAF50;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.winner-message button:hover {
    background: #45a049;
    transform: scale(1.05);
}

/* 설정 모달 */
.settings-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.settings-content {
    background: white;
    padding: 40px;
    border-radius: 20px;
    min-width: 400px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.settings-content h3 {
    margin-bottom: 30px;
    text-align: center;
    color: #333;
    font-size: 2rem;
}

.setting-group {
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.setting-group label {
    font-size: 1.3rem;
    color: #333;
    font-weight: 500;
}

.setting-group input[type="number"] {
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1.2rem;
    width: 100px;
    text-align: center;
}

.setting-group input[type="checkbox"] {
    width: 24px;
    height: 24px;
    cursor: pointer;
}

.settings-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
}

.settings-buttons button {
    padding: 15px 30px;
    border: none;
    border-radius: 8px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
    color: white;
}

.settings-buttons button:nth-child(1) {
    background: #4CAF50;
}

.settings-buttons button:nth-child(2) {
    background: #f44336;
}

.settings-buttons button:nth-child(3) {
    background: #ff9800;
}

.settings-buttons button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

/* 점수 교환 효과 */
.swap-effect {
    animation: swapAnimation 0.5s ease-in-out;
}

@keyframes swapAnimation {
    0% { transform: scale(1); }
    25% { transform: scale(0.95) rotateY(5deg); }
    50% { transform: scale(0.9) rotateY(0deg); }
    75% { transform: scale(0.95) rotateY(-5deg); }
    100% { transform: scale(1); }
}

.swap-effect .score {
    animation: scoreSwap 0.5s ease-in-out;
}

@keyframes scoreSwap {
    0% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.1); }
    100% { opacity: 1; transform: scale(1); }
}

/* 세로 모드에서 회전된 화면의 점수 교환 효과 */
@media (orientation: portrait) {
    .swap-effect {
        animation: swapAnimationPortrait 0.5s ease-in-out;
    }
    
    @keyframes swapAnimationPortrait {
        0% { 
            transform: rotate(90deg) scale(1);
        }
        25% { 
            transform: rotate(90deg) scale(0.95) rotateX(5deg);
        }
        50% { 
            transform: rotate(90deg) scale(0.9) rotateX(0deg);
        }
        75% { 
            transform: rotate(90deg) scale(0.95) rotateX(-5deg);
        }
        100% { 
            transform: rotate(90deg) scale(1);
        }
    }
}

/* 가로 모드 (정상) */
@media (orientation: landscape) {
    .score {
        font-size: min(76vw, 68vh);
    }
}

/* 세로 모드에서 회전된 화면 최적화 */
@media (orientation: portrait) {
    .scoreboard-container {
        width: 100vh;
        height: 100vw;
    }
    
    .player-section {
        height: 100vw;
        flex: 1 1 50% !important;
        width: 50% !important;
        min-width: 50% !important;
        max-width: 50% !important;
    }
    
    .divider {
        height: 100vw;
    }
    
    .score {
        /* 세로 모드에서는 vh/vw가 바뀌므로 조정 */
        font-size: min(76vh, 68vw);
    }
    
    .slide-menu {
        /* 회전된 화면에서 메뉴 위치 조정 */
        width: 95vh;
        max-width: 400px;
        height: 45vw; /* 세로 모드에서 높이를 대폭 줄임 */
        max-height: 300px; /* 최대 높이 제한 */
    }
    
    /* 세로 모드에서 메뉴 콘텐츠 크기 조정 */
    .menu-header {
        padding: 8px 12px;
    }
    
    .menu-header h3 {
        font-size: 1rem;
    }
    
    .home-btn {
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }
    
    .menu-content {
        padding: 6px 10px;
        max-height: 180px; /* 콘텐츠 영역 최대 높이 제한 */
        overflow-y: auto;
    }
    
    .menu-item {
        margin-bottom: 8px;
    }
    
    .menu-item label {
        font-size: 0.9rem;
    }
    
    .score-selector {
        gap: 10px;
    }
    
    .score-selector input[type="number"] {
        font-size: 1rem;
        width: 40px;
        min-width: 40px;
        padding: 3px;
    }
    
    .score-selector button {
        width: 28px;
        height: 28px;
        font-size: 0.9rem;
    }
    
    .toggle-switch {
        width: 50px;
        height: 25px;
    }
    
    .slider:before {
        height: 18px;
        width: 18px;
        left: 3px;
        bottom: 3px;
    }
    
    input:checked + .slider:before {
        transform: translateX(25px);
    }
    
    .menu-buttons {
        padding: 6px 10px;
        gap: 6px;
    }
    
    .menu-btn {
        padding: 6px 4px;
        font-size: 0.8rem;
        min-height: 32px;
    }
    
    .fullscreen-btn {
        padding: 6px 12px;
        font-size: 1rem;
        min-width: 50px;
    }
    
    .winner-overlay {
        width: 100vh;
        height: 100vw;
    }
    
    .winner-message {
        padding: 30px;
    }
    
    .winner-message h2 {
        font-size: 2.5rem;
    }
}

/* 슬라이드 다운 메뉴 */
.slide-menu {
    position: fixed;
    top: -100vh;
    left: 50%;
    transform: translateX(-50%);
    width: 95%;
    max-width: 400px;
    height: 85vh;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    border-bottom-left-radius: 20px;
    border-bottom-right-radius: 20px;
    transition: top 0.3s ease;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
}

.slide-menu.active {
    top: 0;
}

.menu-header {
    padding: 15px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    flex-shrink: 0;
}

.home-btn {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
}

.home-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-50%) scale(1.1);
}

.menu-handle {
    width: 40px;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    margin: 0 auto 15px;
}

.menu-header h3 {
    color: white;
    font-size: 1.3rem;
    margin: 0;
}

.menu-content {
    padding: 15px;
    flex: 1;
    overflow-y: auto;
    min-height: 0; /* flexbox에서 스크롤이 제대로 작동하도록 */
}

/* 메뉴 콘텐츠 스크롤바 스타일링 */
.menu-content::-webkit-scrollbar {
    width: 6px;
    display: block;
}

.menu-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.menu-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.4);
    border-radius: 3px;
}

.menu-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.6);
}

/* Firefox 스크롤바 */
.menu-content {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.4) rgba(255, 255, 255, 0.1);
}

.menu-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    color: white;
}

.menu-item label {
    font-size: 1.1rem;
    font-weight: 500;
}

.score-selector {
    display: flex;
    align-items: center;
    gap: 15px;
}

.score-selector button {
    width: 35px;
    height: 35px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.score-selector button:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.score-selector span {
    font-size: 1.5rem;
    font-weight: bold;
    min-width: 40px;
    text-align: center;
}

.score-selector input[type="number"] {
    font-size: 1.3rem;
    font-weight: bold;
    min-width: 50px;
    width: 50px;
    text-align: center;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    color: white;
    padding: 6px;
    margin: 0 5px;
}

.score-selector input[type="number"]:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.2);
}

.toggle-switch {
    position: relative;
    width: 60px;
    height: 30px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.2);
    transition: 0.3s;
    border-radius: 30px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #4CAF50;
}

input:checked + .slider:before {
    transform: translateX(30px);
}

.fullscreen-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    color: white;
    font-size: 1.2rem;
    padding: 8px 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fullscreen-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.05);
}

.menu-buttons {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
    padding: 12px 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.2);
}

.menu-btn {
    flex: 1;
    padding: 12px 8px;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    color: white;
    min-height: 44px;
}

.menu-btn.guide {
    background: linear-gradient(135deg, #2196F3, #1976D2);
}

.menu-btn.reset {
    background: linear-gradient(135deg, #ff9800, #f57c00);
}

.menu-btn.close {
    background: linear-gradient(135deg, #666, #444);
}

.menu-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

/* 코트 체인지 팝업 */
.court-change-overlay,
.game-reset-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    backdrop-filter: blur(5px);
}

.court-change-popup,
.game-reset-popup {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    max-width: 400px;
    width: 90%;
    animation: popupSlideIn 0.3s ease-out;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

/* 게임 리셋 팝업 전용 스타일 */
.game-reset-popup {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
}

@keyframes popupSlideIn {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.popup-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    animation: rotateIcon 2s ease-in-out infinite;
}

@keyframes rotateIcon {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(180deg); }
}

.court-change-popup h3,
.game-reset-popup h3 {
    color: white;
    font-size: 2rem;
    margin: 0 0 20px 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.court-change-popup p,
.game-reset-popup p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.3rem;
    line-height: 1.5;
    margin: 0 0 30px 0;
}

.popup-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
}

.popup-btn {
    padding: 15px 30px;
    border: none;
    border-radius: 25px;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 100px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.popup-btn.confirm {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
}

.popup-btn.cancel {
    background: linear-gradient(135deg, #f44336, #d32f2f);
    color: white;
}

.popup-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.popup-btn:active {
    transform: translateY(0);
}

/* 사용법 가이드 팝업 */
.guide-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 3000;
    backdrop-filter: blur(10px);
}

.guide-popup {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    max-width: 400px;
    width: 85%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    animation: guideSlideIn 0.4s ease-out;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

@keyframes guideSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-30px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.guide-header {
    padding: 12px 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    flex-shrink: 0;
}

.guide-header h3 {
    color: white;
    font-size: 1.2rem;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.guide-close {
    position: absolute;
    top: 8px;
    right: 12px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    font-size: 1.2rem;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.guide-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.guide-content {
    padding: 25px 20px;
    flex: 1;
    overflow-y: auto;
    position: relative;
}

/* 가이드 콘텐츠 스크롤바 스타일링 */
.guide-content::-webkit-scrollbar {
    width: 6px;
    display: block;
}

.guide-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.guide-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.4);
    border-radius: 3px;
}

.guide-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.6);
}

/* Firefox 스크롤바 */
.guide-content {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.4) rgba(255, 255, 255, 0.1);
}

.guide-step {
    display: none;
    text-align: center;
    color: white;
}

.guide-step.active {
    display: block;
    animation: stepFadeIn 0.3s ease-in-out;
}

@keyframes stepFadeIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.step-number {
    display: inline-block;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    line-height: 40px;
    font-size: 1.3rem;
    font-weight: bold;
    margin-bottom: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.guide-step h4 {
    font-size: 1.3rem;
    margin: 0 0 15px 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.guide-step p {
    font-size: 1rem;
    line-height: 1.6;
    margin: 0 0 20px 0;
    color: rgba(255, 255, 255, 0.9);
}

.guide-visual {
    background: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 10px;
    font-size: 1.2rem;
    font-weight: bold;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
}

.guide-navigation {
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.guide-nav-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 70px;
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.guide-nav-btn:disabled {
    background: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.5);
    cursor: not-allowed;
    box-shadow: none;
}

.guide-nav-btn:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.guide-dots {
    display: flex;
    gap: 10px;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
}

.dot.active {
    background: white;
    transform: scale(1.2);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.dot:hover {
    background: rgba(255, 255, 255, 0.6);
    transform: scale(1.1);
}

/* 세로 모드에서 가이드 팝업도 가로 방향으로 회전 */
@media (orientation: portrait) {
    .guide-overlay {
        /* 세로 모드에서도 가이드 오버레이는 전체 화면 덮기 */
        width: 100vw;
        height: 100vh;
    }
    
    .guide-popup {
        /* 세로 모드에서 가이드 팝업을 90도 회전 */
        transform: rotate(90deg);
        transform-origin: center center;
        max-width: 85vh; /* 세로 모드에서는 vh가 가로 길이 */
        width: 80vh;
        max-height: 85vw; /* 세로 모드에서는 vw가 세로 길이 */
        position: absolute;
        top: 50%;
        left: 50%;
        margin-left: -40vh; /* width의 절반 */
        margin-top: -42.5vw; /* max-height의 절반 */
    }
    
    .guide-header {
        padding: 15px;
    }
    
    .guide-header h3 {
        font-size: 1.3rem;
    }
    
    .guide-content {
        padding: 15px;
    }
    
    .guide-step h4 {
        font-size: 1.2rem;
    }
    
    .guide-step p {
        font-size: 0.9rem;
    }
    
    .guide-visual {
        padding: 12px;
        font-size: 1rem;
    }
    
    .guide-navigation {
        padding: 12px 15px;
    }
    
    .guide-nav-btn {
        padding: 8px 16px;
        font-size: 0.8rem;
        min-width: 60px;
    }
    
    .dot {
        width: 10px;
        height: 10px;
    }
}