/* ========================================================
   TTEUM 총알피하기 (Dodge) 전용 스타일시트
   - PC: 3단 레이아웃 & 키보드 D-Pad 상태 시각화 (키보드 전용 조작)
   - 모바일: 모바일 전용 가상 터치 D-Pad & 폭탄 컨트롤러
   ======================================================== */

.dodge-body {
    margin: 0;
    padding: 0;
    background: #070a12;
    color: #ffffff;
    font-family: 'Outfit', 'Noto Sans KR', sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    user-select: none;
    -webkit-user-select: none;
}

.dodge-app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* 게임 헤더 */
.badge-dodge {
    font-size: 11px;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 4px;
    background: #4cc9f0;
    color: #080c16;
    letter-spacing: 0.5px;
    box-shadow: 0 0 10px rgba(76, 201, 240, 0.4);
}

.badge-capacity {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 7px;
    border-radius: 4px;
    background: #1e293b;
    color: #94a3b8;
    border: 1px solid #334155;
}

.btn-config-tuning {
    background: linear-gradient(135deg, #7209b7 0%, #3a0ca3 100%);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.25);
    font-size: 12px;
    font-weight: 800;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 0 10px rgba(114, 9, 183, 0.4);
}

.btn-config-tuning:hover {
    background: linear-gradient(135deg, #9d4edd 0%, #560bad 100%);
    box-shadow: 0 0 16px rgba(157, 78, 221, 0.7);
    transform: translateY(-1px);
}

.game-title {
    font-size: 16px;
    font-weight: 900;
    color: #ffffff;
    letter-spacing: -0.3px;
}

.game-subtitle {
    font-size: 12px;
    color: #64748b;
    font-weight: 500;
}

/* 3단 가로 나란히 메인 레이아웃 (PC 기본) */
.dodge-main-layout {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: flex-start;
    gap: 16px;
    max-width: 1140px;
    margin: 16px auto;
    padding: 0 12px;
    box-sizing: border-box;
    width: 100%;
}

.dodge-col {
    display: flex;
    flex-direction: column;
}

.dodge-col-game {
    width: 340px;
    flex-shrink: 0;
}

.dodge-col-control {
    width: 270px;
    flex-shrink: 0;
}

.dodge-col-leaderboard {
    width: 330px;
    flex-shrink: 0;
}

/* 패널 카드 공통 */
.dodge-panel-card {
    background: #0e1526;
    border: 1px solid #1e293b;
    border-radius: 12px;
    padding: 16px;
    box-sizing: border-box;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.panel-card-title {
    font-size: 14px;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    letter-spacing: -0.3px;
}

/* 상단 모드 컨트롤 바 */
.dodge-control-bar {
    width: 340px;
    background: #0e1526;
    border: 1px solid #1e293b;
    border-radius: 10px;
    padding: 8px 12px;
    margin-bottom: 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    box-sizing: border-box;
}

.mode-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    width: 100%;
}

.mode-label-group {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.mode-tag-icon {
    font-size: 14px;
}

.mode-tag-title {
    font-size: 12px;
    font-weight: 800;
    color: #94a3b8;
}

.mode-select-combo {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    justify-content: flex-end;
}

.dodge-mode-select {
    font-family: inherit;
    font-size: 12px;
    font-weight: 700;
    height: 30px;
    padding: 2px 8px;
    background: #1e293b;
    color: #00f5d4;
    border: 1px solid #00f5d4;
    border-radius: 6px;
    cursor: pointer;
}

.dodge-mode-select:focus {
    outline: none;
    box-shadow: 0 0 8px rgba(0, 245, 212, 0.5);
}

.btn-secret-key-icon {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 6px;
    color: #94a3b8;
    cursor: pointer;
    font-size: 13px;
    height: 30px;
    width: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.btn-secret-key-icon:hover {
    background: #334155;
    color: #fee440;
    border-color: #fee440;
}

/* 비밀 커맨드 미니 Popover */
.secret-command-popover {
    position: absolute;
    top: 50px;
    right: 12px;
    width: 250px;
    background: #0f172a;
    border: 1px solid #4cc9f0;
    border-radius: 10px;
    padding: 10px 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.8), 0 0 16px rgba(76, 201, 240, 0.3);
    z-index: 50;
}

.popover-title-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11.5px;
    font-weight: 800;
    color: #4cc9f0;
    margin-bottom: 6px;
}

.btn-popover-close {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 12px;
    cursor: pointer;
}

.popover-sequence-display {
    background: #070a12;
    border: 1px solid #1e293b;
    border-radius: 6px;
    padding: 6px 8px;
    min-height: 28px;
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
    font-size: 11px;
}

.seq-empty {
    color: #64748b;
    font-size: 10.5px;
}

.seq-key-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: rgba(76, 201, 240, 0.2);
    border: 1px solid #4cc9f0;
    color: #4cc9f0;
    font-weight: 800;
    border-radius: 4px;
    font-size: 10px;
}

.popover-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 6px;
}

.btn-popover-clear {
    background: #1e293b;
    border: 1px solid #334155;
    color: #cbd5e1;
    font-size: 10.5px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    cursor: pointer;
}

/* SweetAlert 관리자 폼 스타일 */
.admin-input {
    background: #070a12;
    border: 1px solid #334155;
    color: #ffffff;
    border-radius: 6px;
    padding: 6px 8px;
    font-size: 12px;
    box-sizing: border-box;
}

.admin-input:focus {
    outline: none;
    border-color: #00f5d4;
}

.admin-select {
    background: #070a12;
    border: 1px solid #334155;
    color: #00f5d4;
    border-radius: 6px;
    padding: 6px 8px;
    font-size: 12px;
    font-weight: 700;
    box-sizing: border-box;
}

.mode-desc-text {
    font-size: 11px;
    color: #94a3b8;
    line-height: 1.3;
}

/* 340×340px 캔버스 래퍼 */
.dodge-canvas-wrapper {
    width: 340px;
    height: 340px;
    background: #05070d;
    border: 2px solid #4cc9f0;
    border-radius: 12px;
    position: relative;
    box-shadow: 0 0 24px rgba(76, 201, 240, 0.35), inset 0 0 20px rgba(0, 0, 0, 0.9);
    overflow: hidden;
    user-select: none;
    touch-action: none;
    box-sizing: border-box;
    margin: 0 auto;
}

#gameCanvas {
    display: block;
    width: 340px;
    height: 340px;
    cursor: default;
}

/* HUD 상단 */
.dodge-hud-top {
    position: absolute;
    top: 8px;
    left: 10px;
    right: 10px;
    display: flex;
    justify-content: space-between;
    pointer-events: none;
    z-index: 10;
}

.hud-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.hud-item.right {
    align-items: flex-end;
}

.hud-label {
    font-size: 9px;
    font-weight: 800;
    color: #94a3b8;
    letter-spacing: 0.8px;
}

.hud-value {
    font-family: 'Outfit', monospace;
    font-size: 15px;
    font-weight: 900;
    letter-spacing: 0.5px;
}

.time-val {
    color: #00f5d4;
    text-shadow: 0 0 8px rgba(0, 245, 212, 0.6);
}

.score-val {
    color: #fee440;
    text-shadow: 0 0 8px rgba(254, 228, 64, 0.6);
}

/* HUD 하단 */
.dodge-hud-bottom {
    position: absolute;
    bottom: 8px;
    left: 10px;
    right: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    pointer-events: none;
    z-index: 10;
}

.bomb-status-wrap {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.bomb-icons {
    display: flex;
    gap: 4px;
    font-size: 14px;
}

.bomb-gauge-container {
    width: 60px;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.bomb-gauge-bar {
    height: 100%;
    background: #00f5d4;
    box-shadow: 0 0 6px #00f5d4;
    transition: width 0.1s linear;
}

.hud-center-lives {
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(14, 21, 38, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 800;
    color: #4cc9f0;
}

.wave-tag {
    font-size: 11px;
    font-weight: 900;
    color: #f72585;
    background: rgba(247, 37, 133, 0.15);
    border: 1px solid #f72585;
    padding: 2px 7px;
    border-radius: 4px;
    letter-spacing: 0.5px;
}

/* 오버레이 공통 */
.dodge-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(7, 10, 18, 0.85);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
    padding: 16px;
    box-sizing: border-box;
}

.overlay-box {
    background: #0e1526;
    border: 1px solid #334155;
    border-radius: 14px;
    padding: 20px;
    width: 100%;
    max-width: 300px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.7);
}

.overlay-icon {
    font-size: 32px;
}

.overlay-title {
    font-size: 20px;
    font-weight: 900;
    letter-spacing: -0.5px;
    color: #ffffff;
}

.overlay-sub {
    font-size: 12px;
    color: #94a3b8;
    line-height: 1.5;
}

.btn-start-launch {
    width: 100%;
    padding: 12px 16px;
    border-radius: 10px;
    background: #4cc9f0;
    color: #080c16;
    font-size: 14px;
    font-weight: 800;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
    box-shadow: 0 4px 14px rgba(76, 201, 240, 0.4);
}

.btn-start-launch:hover {
    filter: brightness(1.15);
    transform: scale(1.02);
}

.btn-overlay-action {
    width: 100%;
    padding: 10px 16px;
    border-radius: 8px;
    background: #1e293b;
    color: #00f5d4;
    border: 1px solid #00f5d4;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-overlay-action:hover {
    background: #00f5d4;
    color: #080c16;
}

.btn-overlay-sub {
    font-size: 12px;
    color: #64748b;
    text-decoration: none;
    margin-top: 4px;
    transition: color 0.2s ease;
}

.btn-overlay-sub:hover {
    color: #94a3b8;
}

/* 컨티뉴 오버레이 */
.continue-box {
    border-color: #fee440;
    box-shadow: 0 0 30px rgba(254, 228, 64, 0.25);
}

.continue-title {
    font-size: 22px;
    font-weight: 900;
    color: #fee440;
    letter-spacing: 1px;
}

.continue-countdown {
    font-size: 48px;
    font-weight: 900;
    color: #f72585;
    text-shadow: 0 0 16px rgba(247, 37, 133, 0.6);
    line-height: 1;
}

.continue-sub {
    font-size: 11.5px;
    color: #cbd5e1;
    line-height: 1.4;
}

.continue-btn-group {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.btn-continue-accept {
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    background: #fee440;
    color: #080c16;
    font-size: 13.5px;
    font-weight: 900;
    border: none;
    cursor: pointer;
}

.btn-continue-decline {
    width: 100%;
    padding: 8px;
    border-radius: 8px;
    background: transparent;
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
    border: 1px solid #334155;
    cursor: pointer;
}

.btn-continue-decline:hover {
    background: #1e293b;
    color: #cbd5e1;
}

/* 게임 오버 통계 & 닉네임 입력 */
.gameover-stats {
    width: 100%;
    background: #070a12;
    border-radius: 8px;
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    box-sizing: border-box;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    font-size: 12.5px;
    color: #94a3b8;
}

.arcade-entry-box {
    width: 100%;
    background: rgba(0, 245, 212, 0.08);
    border: 1px dashed #00f5d4;
    border-radius: 8px;
    padding: 10px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.arcade-trophy-tag {
    font-size: 11px;
    font-weight: 800;
    color: #00f5d4;
}

.arcade-entry-desc {
    font-size: 10.5px;
    color: #94a3b8;
}

.arcade-input-row {
    display: flex;
    gap: 6px;
}

.arcade-input {
    flex: 1;
    height: 32px;
    background: #070a12;
    border: 1px solid #334155;
    border-radius: 6px;
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    padding: 0 8px;
    text-align: center;
}

.arcade-input:focus {
    outline: none;
    border-color: #00f5d4;
}

.btn-arcade-submit {
    padding: 0 12px;
    height: 32px;
    background: #00f5d4;
    color: #080c16;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
}

/* PC 키보드 컨트롤 상태 패널 */
.keyboard-visualizer {
    display: flex;
    flex-direction: column;
    gap: 14px;
    align-items: center;
}

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

.dpad-row {
    display: flex;
    gap: 6px;
}

.dpad-btn {
    width: 52px;
    height: 52px;
    background: #111a2e;
    border: 1px solid #1e293b;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    transition: all 0.1s ease;
}

.dpad-btn .key-alpha {
    font-size: 14px;
    font-weight: 800;
}

.dpad-btn .key-sym {
    font-size: 10px;
}

.dpad-btn.active {
    background: #00f5d4;
    color: #080c16;
    border-color: #00f5d4;
    box-shadow: 0 0 14px rgba(0, 245, 212, 0.6);
    transform: translateY(2px);
}

.key-action-row {
    display: flex;
    gap: 8px;
    width: 100%;
}

.key-action-btn {
    flex: 1;
    padding: 10px 8px;
    background: #111a2e;
    border: 1px solid #1e293b;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    font-size: 12px;
    font-weight: 800;
    color: #94a3b8;
    transition: all 0.1s ease;
}

.key-action-btn.active {
    background: #4cc9f0;
    color: #080c16;
    border-color: #4cc9f0;
    box-shadow: 0 0 12px rgba(76, 201, 240, 0.6);
    transform: translateY(2px);
}

.key-action-btn.active small {
    color: #080c16 !important;
}

/* 명예의 전당 테이블 */
.dodge-table {
    border-collapse: collapse;
    width: 100%;
}

.dodge-table th {
    background: #111a2e;
    color: #94a3b8;
    padding: 8px 6px;
    font-size: 11px;
    font-weight: 700;
    border-bottom: 1px solid #1e293b;
}

.dodge-table td {
    padding: 8px 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 12px;
}

.badge-rank {
    display: inline-block;
    width: 20px;
    height: 20px;
    line-height: 20px;
    text-align: center;
    border-radius: 4px;
    background: #1e293b;
    color: #cbd5e1;
    font-weight: 800;
    font-size: 11px;
}

.badge-rank.gold {
    background: #fee440;
    color: #080c16;
    box-shadow: 0 0 8px rgba(254, 228, 64, 0.5);
}

.badge-rank.silver {
    background: #e2e8f0;
    color: #080c16;
}

.badge-rank.bronze {
    background: #b45309;
    color: #ffffff;
}

.btn-refresh-clean {
    background: transparent;
    border: 1px solid #334155;
    color: #94a3b8;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
}

.btn-refresh-clean:hover {
    background: #1e293b;
    color: #00f5d4;
}

.btn-del-score {
    background: transparent;
    border: none;
    color: #f72585;
    cursor: pointer;
    font-size: 12px;
}

/* ========================================================
   📱 모바일 전용 가상 아날로그 원형 조이스틱 & 원형 버튼
   ======================================================== */
.mobile-controls-wrapper {
    display: none; /* 기본(PC) 숨김 */
    width: 340px;
    margin: 10px auto 0;
    padding: 10px 14px;
    box-sizing: border-box;
    background: #0e1526;
    border: 1px solid #1e293b;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
}

.mobile-controls-layout {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    width: 100%;
}

/* 🕹️ 좌측: 가상 아날로그 원형 조이스틱 패드 */
.virtual-joystick-zone {
    width: 130px;
    height: 130px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}

.joystick-base {
    width: 114px;
    height: 114px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(14, 21, 38, 0.9) 0%, rgba(7, 10, 18, 0.95) 100%);
    border: 2px solid rgba(0, 245, 212, 0.4);
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.9), 0 0 16px rgba(0, 245, 212, 0.25);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.joystick-base::after {
    content: '';
    position: absolute;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 1px dashed rgba(76, 201, 240, 0.3);
}

.joystick-stick {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #00f5d4 0%, #4cc9f0 60%, #0f172a 100%);
    border: 2px solid #00f5d4;
    box-shadow: 0 0 16px rgba(0, 245, 212, 0.6), inset 0 0 8px rgba(255, 255, 255, 0.6);
    position: absolute;
    top: calc(50% - 25px);
    left: calc(50% - 25px);
    pointer-events: none;
    transform: translate(0px, 0px);
    transition: transform 0.04s ease-out;
}

.virtual-joystick-zone.active .joystick-stick {
    box-shadow: 0 0 24px rgba(0, 245, 212, 0.9), inset 0 0 10px #ffffff;
    filter: brightness(1.15);
}

/* 💣 우측: 원형 액션 버튼 그룹 */
.virtual-action-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
    justify-content: center;
    flex: 1;
}

.v-bomb-circle-btn {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #ff0055 0%, #f72585 50%, #7209b7 100%);
    border: 2px solid #ff0055;
    color: #ffffff;
    box-shadow: 0 0 20px rgba(247, 37, 133, 0.5), inset 0 0 10px rgba(255, 255, 255, 0.4);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    cursor: pointer;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    transition: transform 0.1s ease;
}

.v-bomb-circle-btn:active, .v-bomb-circle-btn.touched {
    transform: scale(0.92);
    box-shadow: 0 0 30px rgba(247, 37, 133, 0.9), inset 0 0 14px #ffffff;
    filter: brightness(1.25);
}

.bomb-btn-icon {
    font-size: 24px;
    line-height: 1;
}

.bomb-btn-text {
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.5px;
    text-shadow: 0 0 6px rgba(0, 0, 0, 0.8);
}

.v-pause-circle-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #1e293b;
    border: 1px solid #334155;
    color: #94a3b8;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    touch-action: none;
    transition: all 0.1s ease;
}

.v-pause-circle-btn:active {
    background: #334155;
    color: #00f5d4;
    border-color: #00f5d4;
    transform: scale(0.94);
}

/* ========================================================
   반응형 미디어 쿼리 (모바일 / PC 분기)
   ======================================================== */
@media (max-width: 960px) {
    .dodge-main-layout {
        flex-direction: column;
        align-items: center;
        gap: 20px;
        margin: 10px auto 40px;
    }

    /* 🚫 모바일에서는 PC 키보드 상태 패널 숨김 */
    .dodge-col-control {
        display: none !important;
    }

    /* ✅ 모바일 가상 D-Pad 활성화 */
    .mobile-controls-wrapper {
        display: block;
    }

    .dodge-col-leaderboard {
        width: 340px;
    }
}
