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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #fff;
    overflow: hidden;
    height: 100vh;
}

/* ===== 화면 전환 ===== */
.screen {
    display: none;
    width: 100%;
    height: 100vh;
    position: absolute;
    top: 0;
    left: 0;
}

.screen.active {
    display: flex;
}

/* ===== 모드 선택 화면 ===== */
#modeSelection {
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #0f0c29, #302b63, #24243e);
    animation: gradientShift 10s ease infinite;
}

#titleScreen {
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #0f0c29, #302b63, #24243e);
    animation: gradientShift 10s ease infinite;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.mode-container {
    text-align: center;
    animation: fadeIn 0.8s ease-out;
}

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

.game-title {
    font-size: 5rem;
    font-weight: bold;
    background: linear-gradient(45deg, #FFD700, #FFA500, #FF6B6B);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
    text-shadow: 0 0 30px rgba(255, 215, 0, 0.3);
    letter-spacing: 0.5rem;
}

.game-subtitle {
    font-size: 1.5rem;
    color: #aaa;
    margin-bottom: 3rem;
    letter-spacing: 0.3rem;
}

.loading-text {
    font-size: 1.2rem;
    color: #FFD700;
    animation: pulse 1.5s ease-in-out infinite;
}

.mode-buttons {
    display: flex;
    gap: 2rem;
    justify-content: center;
}

.mode-btn {
    background: linear-gradient(145deg, #2a2a3e, #1f1f2e);
    border: 2px solid #FFD700;
    border-radius: 20px;
    padding: 2rem 3rem;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 250px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.mode-btn:hover {
    transform: translateY(-10px) scale(1.05);
    box-shadow: 0 15px 45px rgba(255, 215, 0, 0.4);
    border-color: #FFA500;
}

.mode-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.mode-text {
    font-size: 1.8rem;
    font-weight: bold;
    color: #FFD700;
    margin-bottom: 0.5rem;
}

.mode-desc {
    font-size: 1rem;
    color: #999;
}

/* ===== 난이도 선택 ===== */
.difficulty-selection {
    width: 100%;
    max-width: 900px;
}

.difficulty-title {
    font-size: 2rem;
    color: #FFD700;
    margin-bottom: 2rem;
    letter-spacing: 0.2rem;
    text-transform: uppercase;
}

.difficulty-buttons {
    display: flex;
    gap: 2rem;
    justify-content: center;
    flex-wrap: wrap;
}

.difficulty-btn {
    background: linear-gradient(145deg, #2a2a3e, #1f1f2e);
    border: 3px solid transparent;
    border-radius: 20px;
    padding: 2rem 2.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 220px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    text-align: center;
}

.difficulty-btn:hover {
    transform: translateY(-10px) scale(1.05);
    box-shadow: 0 15px 45px rgba(255, 215, 0, 0.4);
}

.easy-btn {
    border-color: #51cf66;
}

.easy-btn:hover {
    border-color: #51cf66;
    box-shadow: 0 15px 45px rgba(81, 207, 102, 0.5);
}

.normal-btn {
    border-color: #FFD700;
}

.normal-btn:hover {
    border-color: #FFA500;
    box-shadow: 0 15px 45px rgba(255, 215, 0, 0.5);
}

.hard-btn {
    border-color: #ff6b6b;
}

.hard-btn:hover {
    border-color: #ff6b6b;
    box-shadow: 0 15px 45px rgba(255, 107, 107, 0.5);
}

.insane-btn {
    border-color: #9b59b6;
    background: linear-gradient(145deg, #3a2a4e, #2f1f3e);
}

.insane-btn:hover {
    border-color: #e056fd;
    box-shadow: 0 15px 45px rgba(155, 89, 182, 0.6);
    background: linear-gradient(145deg, #4a3a5e, #3f2f4e);
}

.insane-btn .difficulty-text {
    background: linear-gradient(45deg, #9b59b6, #e056fd);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.difficulty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.difficulty-text {
    font-size: 1.8rem;
    font-weight: bold;
    color: #FFD700;
    margin-bottom: 0.5rem;
    letter-spacing: 0.1rem;
}

.difficulty-desc {
    font-size: 0.9rem;
    color: #999;
}

/* ===== 게임 화면 ===== */
#gameScreen {
    flex-direction: column;
    justify-content: space-between;
    background:
        radial-gradient(ellipse at center, rgba(0, 100, 0, 0.3) 0%, transparent 70%),
        linear-gradient(135deg, #1a1a1a 0%, #0d0d0d 100%);
}

/* ===== 플레이어 영역 ===== */
.player-area {
    padding: 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(90deg, rgba(42, 42, 62, 0.6), rgba(30, 30, 46, 0.6));
    border-bottom: 2px solid rgba(255, 215, 0, 0.2);
}

.current-player-area {
    border-top: 2px solid rgba(255, 215, 0, 0.2);
    border-bottom: none;
}

.player-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.player-name {
    font-size: 1.5rem;
    font-weight: bold;
    color: #FFD700;
}

.player-chips {
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(145deg, #2a2a3e, #1f1f2e);
    padding: 0.5rem 1.5rem;
    border-radius: 30px;
    border: 2px solid #FFD700;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
}

.chip-icon {
    font-size: 1.5rem;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.player-cards {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    max-width: 600px;
}

.mini-card {
    width: 40px;
    height: 56px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease;
}

.mini-card.used {
    background: linear-gradient(145deg, #3a3a3a, #2a2a2a);
    color: #666;
    opacity: 0.5;
}

.mini-card.available {
    background: linear-gradient(145deg, #fff, #f0f0f0);
    color: #333;
    border: 2px solid #FFD700;
}

/* AI 선택 카드 표시 */
.ai-selected-card-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.ai-card-label {
    font-size: 0.9rem;
    color: #FFD700;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.1rem;
}

.ai-selected-card {
    width: 80px;
    height: 110px;
    border-radius: 10px;
    background: linear-gradient(145deg, #ffffff, #f0f0f0);
    border: 3px solid #FFD700;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    font-weight: bold;
    color: #333;
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.4);
    transition: all 0.3s ease;
}

.ai-selected-card.hidden {
    background: linear-gradient(145deg, #2a2a3e, #1f1f2e);
    border: 3px solid #666;
    color: #666;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.player-role {
    font-size: 1.2rem;
    padding: 0.5rem 1.5rem;
    border-radius: 20px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.1rem;
}

.role-player {
    background: linear-gradient(145deg, #FF6B6B, #C92A2A);
    border: 2px solid #FF8787;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
}

.role-bettor {
    background: linear-gradient(145deg, #4ECDC4, #2BA199);
    border: 2px solid #6FE7DD;
    box-shadow: 0 4px 15px rgba(78, 205, 196, 0.4);
}

/* ===== 게임 테이블 ===== */
.game-table {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    position: relative;
    background:
        radial-gradient(ellipse 80% 50% at 50% 50%,
            rgba(0, 128, 0, 0.4) 0%,
            rgba(0, 100, 0, 0.3) 30%,
            rgba(0, 80, 0, 0.2) 60%,
            transparent 100%
        );
    box-shadow: inset 0 0 100px rgba(0, 0, 0, 0.5);
}

/* ===== 라운드 정보 & 타이머 ===== */
.round-info {
    position: absolute;
    top: 2rem;
    right: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.round-number {
    font-size: 1.3rem;
    font-weight: bold;
    color: #FFD700;
    background: rgba(0, 0, 0, 0.6);
    padding: 0.5rem 1.5rem;
    border-radius: 20px;
    border: 2px solid #FFD700;
}

.timer-container {
    position: relative;
    width: 80px;
    height: 80px;
}

.timer-circle {
    transform: rotate(-90deg);
}

.timer-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.1);
    stroke-width: 6;
}

.timer-progress {
    fill: none;
    stroke: #FFD700;
    stroke-width: 6;
    stroke-linecap: round;
    transition: stroke-dashoffset 1s linear, stroke 0.3s ease;
    stroke-dasharray: 220;
    stroke-dashoffset: 0;
}

.timer-progress.warning {
    stroke: #FFA500;
}

.timer-progress.danger {
    stroke: #FF6B6B;
    animation: timerPulse 0.5s ease-in-out infinite;
}

@keyframes timerPulse {
    0%, 100% { stroke-width: 6; }
    50% { stroke-width: 8; }
}

.timer-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.8rem;
    font-weight: bold;
    color: #FFD700;
}

.timer-text.warning {
    color: #FFA500;
}

.timer-text.danger {
    color: #FF6B6B;
    animation: timerTextPulse 0.5s ease-in-out infinite;
}

@keyframes timerTextPulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.2); }
}

/* ===== 딜러 카드 사용 현황 ===== */
.dealer-status-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    background: rgba(0, 0, 0, 0.4);
    padding: 0.6rem 1rem;
    border-radius: 10px;
    border: 2px solid rgba(255, 215, 0, 0.3);
    margin: 1rem 0;
}

.dealer-status-label {
    font-size: 0.85rem;
    font-weight: bold;
    color: #FFD700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.dealer-status-cards {
    display: flex;
    gap: 0.3rem;
}

.dealer-mini-card {
    width: 28px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, #2a2a2a, #1a1a1a);
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: bold;
    border: 2px solid #444;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.dealer-mini-card.used {
    opacity: 0.3;
    background: linear-gradient(145deg, #3a3a3a, #2a2a2a);
    border-color: #666;
    text-decoration: line-through;
}

/* ===== 카드 영역 ===== */
.card-area {
    display: flex;
    align-items: center;
    gap: 3rem;
    margin-bottom: 2rem;
}

.dealer-card-container,
.player-card-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.card-label {
    font-size: 1.2rem;
    font-weight: bold;
    color: #FFD700;
    text-transform: uppercase;
    letter-spacing: 0.2rem;
}

.card {
    width: 140px;
    height: 200px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    font-weight: bold;
    position: relative;
    transition: all 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    transform-style: preserve-3d;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.card.flipped {
    transform: rotateY(180deg);
}

.card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 15px;
    background:
        linear-gradient(135deg, #1a1a2e 0%, #2d2d44 50%, #1a1a2e 100%);
    border: 3px solid #FFD700;
    display: flex;
    align-items: center;
    justify-content: center;
    backface-visibility: hidden;
}

.card-back::before {
    content: '♠♥♦♣';
    font-size: 2rem;
    color: #FFD700;
    opacity: 0.3;
}

.card-front {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 15px;
    background: linear-gradient(145deg, #ffffff, #f0f0f0);
    border: 3px solid #FFD700;
    display: flex;
    align-items: center;
    justify-content: center;
    backface-visibility: hidden;
    transform: rotateY(180deg);
    color: #333;
    font-size: 5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

/* 딜러 카드는 검은색 */
.dealer-card .card-front {
    background: linear-gradient(145deg, #2a2a2a, #1a1a1a);
    border: 3px solid #888;
    color: #ffffff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.vs-divider {
    font-size: 2rem;
    font-weight: bold;
    color: #FFD700;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

/* ===== 결과 표시 ===== */
.result-display {
    font-size: 2rem;
    font-weight: bold;
    padding: 1rem 2rem;
    border-radius: 15px;
    margin-top: 1rem;
    animation: resultAppear 0.5s ease-out;
}

@keyframes resultAppear {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

.result-display.win {
    background: linear-gradient(145deg, #51cf66, #37b24d);
    color: #fff;
    box-shadow: 0 8px 32px rgba(81, 207, 102, 0.4);
}

.result-display.lose {
    background: linear-gradient(145deg, #ff6b6b, #c92a2a);
    color: #fff;
    box-shadow: 0 8px 32px rgba(255, 107, 107, 0.4);
}

/* ===== 베팅 인터페이스 ===== */
.betting-interface,
.card-selection-interface {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    padding: 2rem;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 20px;
    border: 2px solid #FFD700;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.betting-interface.active,
.card-selection-interface.active {
    display: flex;
    animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.betting-title,
.selection-title {
    font-size: 1.5rem;
    font-weight: bold;
    color: #FFD700;
    text-transform: uppercase;
    letter-spacing: 0.2rem;
}

/* 베팅 타입 선택 */
.bet-type-selection {
    display: flex;
    gap: 1.5rem;
    width: 100%;
    max-width: 500px;
}

.bet-type-btn {
    flex: 1;
    padding: 1.5rem 2rem;
    border: 3px solid transparent;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    background: rgba(255, 255, 255, 0.1);
}

.bet-type-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

.bet-type-btn.selected {
    transform: scale(1.05);
    box-shadow: 0 8px 30px rgba(255, 215, 0, 0.5);
}

.small-type {
    border-color: #4ECDC4;
}

.small-type:hover,
.small-type.selected {
    background: linear-gradient(145deg, #4ECDC4, #2BA199);
    border-color: #6FE7DD;
}

.big-type {
    border-color: #FF6B6B;
}

.big-type:hover,
.big-type.selected {
    background: linear-gradient(145deg, #FF6B6B, #C92A2A);
    border-color: #FF8787;
}

.bet-type-label {
    font-size: 1.8rem;
    color: #fff;
    margin-bottom: 0.3rem;
}

.bet-type-desc {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
}

/* 배팅 금액 조절 */
.bet-amount-control {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    width: 100%;
    max-width: 500px;
}

.bet-amount-label {
    font-size: 1.2rem;
    color: #FFD700;
    font-weight: bold;
}

.bet-amount-adjuster {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.bet-adjust-btn {
    width: 50px;
    height: 50px;
    border: 2px solid #FFD700;
    border-radius: 50%;
    background: linear-gradient(145deg, #2a2a3e, #1f1f2e);
    color: #FFD700;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bet-adjust-btn:hover:not(:disabled) {
    transform: scale(1.1);
    box-shadow: 0 4px 20px rgba(255, 215, 0, 0.4);
    background: linear-gradient(145deg, #3a3a4e, #2f2f3e);
}

.bet-adjust-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.bet-amount-display {
    font-size: 2.5rem;
    font-weight: bold;
    color: #FFD700;
    min-width: 120px;
    text-align: center;
    padding: 0.5rem 1rem;
    background: rgba(255, 215, 0, 0.1);
    border-radius: 15px;
    border: 2px solid #FFD700;
}

.bet-amount-slider-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.bet-slider {
    width: 100%;
    height: 8px;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.2);
    outline: none;
    -webkit-appearance: none;
}

.bet-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    background: linear-gradient(145deg, #FFD700, #FFA500);
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(255, 215, 0, 0.5);
    transition: all 0.3s ease;
}

.bet-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.7);
}

.bet-slider::-moz-range-thumb {
    width: 25px;
    height: 25px;
    border-radius: 50%;
    background: linear-gradient(145deg, #FFD700, #FFA500);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 10px rgba(255, 215, 0, 0.5);
    transition: all 0.3s ease;
}

.bet-slider::-moz-range-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.7);
}

.bet-slider-labels {
    display: flex;
    justify-content: space-between;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
}

/* 베팅 확정 버튼 */
.confirm-bet-btn {
    background: linear-gradient(145deg, #FFD700, #FFA500);
    border: none;
    border-radius: 15px;
    padding: 1.2rem 3rem;
    font-size: 1.5rem;
    font-weight: bold;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.1rem;
    margin-top: 1rem;
}

.confirm-bet-btn:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(255, 215, 0, 0.6);
    background: linear-gradient(145deg, #FFA500, #FFD700);
}

.confirm-bet-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* ===== 카드 선택 ===== */
.hand-cards {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.selectable-card {
    width: 100px;
    height: 140px;
    border-radius: 12px;
    background: linear-gradient(145deg, #ffffff, #f0f0f0);
    border: 3px solid #FFD700;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    font-weight: bold;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.selectable-card:hover {
    transform: translateY(-10px) scale(1.05);
    box-shadow: 0 12px 35px rgba(255, 215, 0, 0.5);
    border-color: #FFA500;
}

.selectable-card.used {
    background: linear-gradient(145deg, #3a3a3a, #2a2a2a);
    color: #666;
    opacity: 0.3;
    cursor: not-allowed;
}

.selectable-card.used:hover {
    transform: none;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

/* ===== AI 배팅 표시 ===== */
.ai-betting-display {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 2rem;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 20px;
    border: 2px solid #4ECDC4;
    box-shadow: 0 4px 16px rgba(78, 205, 196, 0.2);
}

.ai-betting-display.active {
    display: flex;
}

.ai-betting-title {
    font-size: 1.5rem;
    font-weight: bold;
    color: #4ECDC4;
    text-transform: uppercase;
    letter-spacing: 0.2rem;
}

.ai-betting-info {
    display: flex;
    gap: 2rem;
    font-size: 1.2rem;
    color: #fff;
}

.ai-bet-type, .ai-bet-amount {
    padding: 0.5rem 1rem;
    background: rgba(78, 205, 196, 0.2);
    border-radius: 10px;
    border: 1px solid #4ECDC4;
}

/* ===== 액션 버튼 ===== */
.action-buttons {
    display: none;
    gap: 1rem;
    margin-top: 2rem;
}

.action-buttons.active {
    display: flex;
    animation: fadeIn 0.5s ease-out;
}

.action-btn {
    background: linear-gradient(145deg, #FFD700, #FFA500);
    border: none;
    border-radius: 15px;
    padding: 1rem 3rem;
    font-size: 1.3rem;
    font-weight: bold;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.1rem;
}

.action-btn:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(255, 215, 0, 0.6);
    background: linear-gradient(145deg, #FFA500, #FFD700);
}

.action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.open-btn {
    background: linear-gradient(145deg, #51cf66, #37b24d);
    box-shadow: 0 6px 20px rgba(81, 207, 102, 0.4);
    display: none;
}

.open-btn:hover:not(:disabled) {
    box-shadow: 0 10px 30px rgba(81, 207, 102, 0.6);
    background: linear-gradient(145deg, #61df76, #47c25d);
}

/* ===== 게임 종료 화면 ===== */
#gameOverScreen {
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #0f0c29, #302b63, #24243e);
}

.gameover-container {
    text-align: center;
    animation: fadeIn 0.8s ease-out;
}

.gameover-title {
    font-size: 5rem;
    font-weight: bold;
    margin-bottom: 2rem;
    text-shadow: 0 0 30px rgba(255, 215, 0, 0.5);
}

.gameover-title.victory {
    background: linear-gradient(45deg, #FFD700, #FFA500, #FFD700);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.gameover-title.defeat {
    background: linear-gradient(45deg, #FF6B6B, #C92A2A, #FF6B6B);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.gameover-stats {
    display: flex;
    gap: 3rem;
    justify-content: center;
    margin-bottom: 3rem;
}

.stat-item {
    background: rgba(0, 0, 0, 0.4);
    padding: 1.5rem 2rem;
    border-radius: 15px;
    border: 2px solid #FFD700;
    min-width: 150px;
}

.stat-label {
    font-size: 1rem;
    color: #aaa;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: bold;
    color: #FFD700;
}

/* ===== 반응형 ===== */
@media (max-width: 1024px) {
    .game-title {
        font-size: 3.5rem;
    }

    .difficulty-buttons {
        flex-direction: column;
        align-items: center;
    }

    .difficulty-btn {
        min-width: 280px;
    }

    .mode-buttons {
        flex-direction: column;
    }

    .card-area {
        flex-direction: column;
        gap: 1rem;
    }

    .betting-buttons {
        grid-template-columns: repeat(2, 1fr);
    }

    .player-area {
        padding: 1.5rem 1rem;
    }

    .round-info {
        top: 1rem;
        right: 1rem;
    }

    .top-buttons {
        top: 1rem;
        left: 1rem;
        flex-direction: column;
    }

    .sound-panel {
        top: 8rem;
        left: 1rem;
        right: 1rem;
        min-width: auto;
    }
}

@media (max-width: 768px) {
    body {
        overflow-y: auto;
    }

    .screen {
        height: auto;
        min-height: 100vh;
    }

    #gameScreen {
        overflow-y: auto;
    }

    .game-title {
        font-size: 2.5rem;
        letter-spacing: 0.3rem;
    }

    .game-subtitle {
        font-size: 1rem;
        margin-bottom: 2rem;
    }

    .difficulty-title {
        font-size: 1.5rem;
    }

    .difficulty-btn {
        padding: 1.5rem 2rem;
        min-width: 240px;
    }

    .difficulty-icon {
        font-size: 3rem;
    }

    .difficulty-text {
        font-size: 1.5rem;
    }

    .player-area {
        padding: 1rem;
        flex-wrap: wrap;
        gap: 1rem;
    }

    .player-info {
        order: 1;
    }

    .player-cards {
        max-width: 100%;
        order: 3;
        width: 100%;
        justify-content: center;
    }

    .player-role {
        order: 2;
        font-size: 1rem;
        padding: 0.4rem 1rem;
    }

    .dealer-status-container {
        order: 4;
        width: 100%;
    }

    .ai-selected-card-container {
        order: 2;
    }

    .mini-card {
        width: 32px;
        height: 44px;
        font-size: 0.9rem;
    }

    .card {
        width: 90px;
        height: 130px;
        font-size: 2.5rem;
    }

    .card-front {
        font-size: 4rem;
    }

    .vs-divider {
        font-size: 1.5rem;
    }

    .card-area {
        gap: 0.5rem;
        margin-bottom: 1rem;
    }

    .game-table {
        padding: 1rem;
    }

    .round-info {
        top: 0.5rem;
        right: 0.5rem;
        scale: 0.85;
    }

    .top-buttons {
        top: 0.5rem;
        left: 0.5rem;
        scale: 0.85;
        transform-origin: top left;
    }

    .rules-text, .sound-text {
        display: none;
    }

    .sound-panel {
        top: 5rem;
        left: 0.5rem;
        right: 0.5rem;
        padding: 1rem;
        min-width: auto;
    }

    .betting-interface,
    .card-selection-interface {
        padding: 1rem;
        width: 95%;
        max-width: none;
    }

    .bet-type-selection {
        flex-direction: column;
        gap: 1rem;
    }

    .bet-type-btn {
        padding: 1rem 1.5rem;
    }

    .hand-cards {
        gap: 0.5rem;
    }

    .selectable-card {
        width: 70px;
        height: 100px;
        font-size: 2rem;
    }

    .result-display {
        font-size: 1.2rem;
        padding: 0.8rem 1.5rem;
    }

    .gameover-stats {
        flex-direction: column;
        gap: 1rem;
    }

    .gameover-title {
        font-size: 3rem;
    }

    .modal-content {
        width: 95%;
        max-height: 85vh;
    }

    .dealer-mini-card {
        width: 24px;
        height: 32px;
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .game-title {
        font-size: 2rem;
    }

    .difficulty-btn {
        min-width: 200px;
        padding: 1.2rem 1.5rem;
    }

    .difficulty-icon {
        font-size: 2.5rem;
    }

    .difficulty-text {
        font-size: 1.3rem;
    }

    .player-name {
        font-size: 1.2rem;
    }

    .player-chips {
        font-size: 1.4rem;
        padding: 0.4rem 1rem;
    }

    .mini-card {
        width: 28px;
        height: 38px;
        font-size: 0.8rem;
    }

    .card {
        width: 80px;
        height: 115px;
    }

    .card-front {
        font-size: 3rem;
    }

    .ai-selected-card {
        width: 60px;
        height: 85px;
        font-size: 2rem;
    }

    .selectable-card {
        width: 60px;
        height: 85px;
        font-size: 1.8rem;
    }

    .bet-amount-display {
        font-size: 2rem;
        min-width: 100px;
    }

    .dealer-mini-card {
        width: 22px;
        height: 30px;
        font-size: 0.7rem;
    }
}

/* ===== 상단 버튼들 ===== */
.top-buttons {
    position: absolute;
    top: 2rem;
    left: 2rem;
    display: flex;
    gap: 1rem;
    z-index: 100;
}

.rules-btn, .sound-btn {
    background: linear-gradient(145deg, #2a2a3e, #1f1f2e);
    border: 2px solid #FFD700;
    border-radius: 15px;
    padding: 0.8rem 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
}

.rules-btn:hover, .sound-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(255, 215, 0, 0.5);
    background: linear-gradient(145deg, #3a3a4e, #2f2f3e);
}

.rules-icon, .sound-icon {
    font-size: 1.5rem;
}

.rules-text, .sound-text {
    font-size: 1rem;
    font-weight: bold;
    color: #FFD700;
    text-transform: uppercase;
    letter-spacing: 0.1rem;
}

/* ===== 사운드 패널 ===== */
.sound-panel {
    position: absolute;
    top: 6rem;
    left: 2rem;
    background: linear-gradient(145deg, #2a2a3e, #1f1f2e);
    border: 3px solid #FFD700;
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    z-index: 150;
    display: none;
    min-width: 320px;
}

.sound-panel.active {
    display: block;
    animation: slideDown 0.3s ease-out;
}

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

.sound-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid rgba(255, 215, 0, 0.3);
}

.sound-panel-header h3 {
    font-size: 1.3rem;
    color: #FFD700;
    margin: 0;
}

.close-btn-small {
    background: none;
    border: none;
    color: #FFD700;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.close-btn-small:hover {
    background: rgba(255, 215, 0, 0.2);
    transform: rotate(90deg);
}

.sound-controls {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.sound-control-item {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.sound-control-item label {
    font-size: 1rem;
    color: #FFD700;
    font-weight: bold;
}

.volume-slider {
    width: 100%;
    height: 6px;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.2);
    outline: none;
    -webkit-appearance: none;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(145deg, #FFD700, #FFA500);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.5);
    transition: all 0.2s ease;
}

.volume-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.7);
}

.volume-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(145deg, #FFD700, #FFA500);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.5);
    transition: all 0.2s ease;
}

.volume-slider::-moz-range-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.7);
}

.volume-value {
    font-size: 1rem;
    color: #fff;
    text-align: center;
    background: rgba(255, 215, 0, 0.1);
    padding: 0.3rem 0.8rem;
    border-radius: 8px;
    border: 1px solid rgba(255, 215, 0, 0.3);
}

/* ===== 모달 ===== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    animation: fadeIn 0.3s ease-out;
}

.modal.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: linear-gradient(145deg, #2a2a3e, #1f1f2e);
    border: 3px solid #FFD700;
    border-radius: 20px;
    max-width: 700px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.4s ease-out;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 2px solid rgba(255, 215, 0, 0.3);
}

.modal-header h2 {
    font-size: 2rem;
    color: #FFD700;
    margin: 0;
}

.close-btn {
    background: none;
    border: none;
    color: #FFD700;
    font-size: 2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.close-btn:hover {
    background: rgba(255, 215, 0, 0.2);
    transform: rotate(90deg);
}

.modal-body {
    padding: 2rem;
    color: #fff;
}

.rule-section {
    margin-bottom: 2rem;
}

.rule-section h3 {
    font-size: 1.5rem;
    color: #FFD700;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.rule-section p {
    margin: 0.5rem 0;
    color: #FFD700;
    font-weight: bold;
}

.rule-section ul {
    list-style: none;
    padding-left: 0;
}

.rule-section li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
    line-height: 1.6;
}

.rule-section li::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: #FFD700;
}

.example-box {
    background: rgba(0, 0, 0, 0.3);
    padding: 1rem;
    border-radius: 10px;
    border-left: 4px solid #FFD700;
    margin-bottom: 1rem;
    line-height: 1.8;
}

/* 모달 스크롤바 스타일 */
.modal-content::-webkit-scrollbar {
    width: 10px;
}

.modal-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
}

.modal-content::-webkit-scrollbar-thumb {
    background: #FFD700;
    border-radius: 10px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: #FFA500;
}
