@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&family=Rajdhani:wght@400;600;700&display=swap');

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

html {
    background: #0a0a0a;
}

body {
    font-family: 'Rajdhani', 'Arial', sans-serif;
    color: white;
    overflow: hidden;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        repeating-linear-gradient(0deg,
            transparent,
            transparent 2px,
            rgba(255, 255, 255, 0.02) 2px,
            rgba(255, 255, 255, 0.02) 4px);
    pointer-events: none;
    z-index: 1;
}

body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: 300% 300%;
    z-index: -1;
    opacity: 0.3;
    animation: borderGlow 10s ease infinite;
}

#gameContainer {
    width: 100vw;
    height: 100vh;
    position: relative;
}

/* 메뉴 스타일 */
.menu-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(15px);
    z-index: 1000;
    overflow-y: auto;
    padding: 20px 0;
}

.menu-screen::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
}

@keyframes backgroundPulse {

    0%,
    100% {
        opacity: 0.5;
    }

    50% {
        opacity: 1;
    }
}

.menu-content {
    text-align: center;
    background:
        linear-gradient(135deg, rgba(26, 26, 46, 0.95), rgba(22, 33, 62, 0.95));
    padding: 50px;
    border-radius: 15px;
    border: 2px solid;
    border-image: linear-gradient(135deg, rgba(255, 107, 107, 0.5), rgba(78, 205, 196, 0.5)) 1;
    box-shadow:
        0 0 40px rgba(255, 107, 107, 0.3),
        0 0 80px rgba(78, 205, 196, 0.2),
        0 20px 60px rgba(0, 0, 0, 0.6),
        inset 0 0 40px rgba(0, 0, 0, 0.3);
    max-width: 90vw;
    max-height: 90vh;
    overflow-y: auto;
    margin: 20px;
    position: relative;
}

.menu-content::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background-size: 200% 200%;
    border-radius: 15px;
    z-index: -1;
    opacity: 0.5;
    animation: borderGlow 3s ease infinite;
}

@keyframes borderGlow {

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

    50% {
        background-position: 100% 50%;
    }
}

.menu-content h1 {
    font-family: 'Orbitron', sans-serif;
    font-size: 4em;
    font-weight: 900;
    margin-bottom: 30px;
    color: #ffffff;
    text-shadow:
        0 0 10px rgba(255, 107, 107, 0.8),
        0 0 20px rgba(78, 205, 196, 0.6),
        2px 2px 4px rgba(0, 0, 0, 0.8);
    letter-spacing: 3px;
    position: relative;
}

@keyframes gradientShift {

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

    50% {
        background-position: 100% 50%;
    }
}

.menu-content h2 {
    font-family: 'Orbitron', sans-serif;
    font-size: 2.5em;
    font-weight: 700;
    margin-bottom: 20px;
    color: #4ecdc4;
    text-shadow:
        0 0 10px rgba(78, 205, 196, 0.8),
        0 0 20px rgba(78, 205, 196, 0.4),
        2px 2px 4px rgba(0, 0, 0, 0.8);
    letter-spacing: 2px;
}

.menu-content h3 {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.8em;
    font-weight: 600;
    margin: 20px 0 10px 0;
    color: #ff6b6b;
    text-shadow:
        0 0 8px rgba(255, 107, 107, 0.6),
        2px 2px 4px rgba(0, 0, 0, 0.8);
    letter-spacing: 1px;
}

.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
}

.menu-btn {
    padding: 18px 40px;
    font-size: 1.3em;
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.2), rgba(78, 205, 196, 0.2));
    border: 2px solid;
    border-image: linear-gradient(45deg, #ff6b6b, #4ecdc4) 1;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 250px;
    text-transform: uppercase;
    letter-spacing: 2px;
    position: relative;
    overflow: hidden;
    box-shadow:
        0 0 15px rgba(255, 107, 107, 0.3),
        0 0 30px rgba(78, 205, 196, 0.2),
        inset 0 0 20px rgba(0, 0, 0, 0.3);
}

.menu-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.menu-btn:hover::before {
    left: 100%;
}

.menu-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow:
        0 0 25px rgba(255, 107, 107, 0.6),
        0 0 50px rgba(78, 205, 196, 0.4),
        0 10px 30px rgba(0, 0, 0, 0.5),
        inset 0 0 30px rgba(255, 255, 255, 0.1);
    border-color: #fff;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
}

.menu-btn:active {
    transform: translateY(-1px) scale(1.02);
}

/* 커스터마이즈 섹션 */
.customize-section {
    margin: 20px 0;
    padding: 25px;
    background: linear-gradient(135deg, rgba(26, 26, 46, 0.6), rgba(22, 33, 62, 0.6));
    border-radius: 15px;
    border: 2px solid rgba(255, 255, 255, 0.15);
    min-height: 200px;
    box-shadow:
        0 4px 20px rgba(0, 0, 0, 0.4),
        inset 0 0 30px rgba(0, 0, 0, 0.2);
}

.item-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    margin: 15px 0;
    max-width: 100%;
}

.item-card {
    background: linear-gradient(135deg, rgba(26, 26, 46, 0.8), rgba(22, 33, 62, 0.8));
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.item-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.1), rgba(78, 205, 196, 0.1));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.item-card:hover::before {
    opacity: 1;
}

.item-card:hover {
    background: linear-gradient(135deg, rgba(26, 26, 46, 0.95), rgba(22, 33, 62, 0.95));
    border-color: #4ecdc4;
    transform: translateY(-5px) scale(1.05);
    box-shadow:
        0 0 20px rgba(78, 205, 196, 0.5),
        0 8px 25px rgba(0, 0, 0, 0.4);
}

.item-card.selected {
    border-color: #ff6b6b;
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.3), rgba(78, 205, 196, 0.2));
    box-shadow:
        0 0 25px rgba(255, 107, 107, 0.6),
        0 8px 25px rgba(0, 0, 0, 0.4);
    transform: scale(1.05);
}

.item-card.locked {
    cursor: not-allowed;
    opacity: 0.52;
    filter: grayscale(0.45);
}

.item-card.locked:hover {
    transform: none;
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.item-card img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 10px;
}

.item-card h4 {
    font-size: 0.9em;
    margin-bottom: 5px;
}

.item-card p {
    font-size: 0.8em;
    color: #ccc;
}

/* 전장 선택 */
.arena-select-content {
    max-width: 960px;
}

.arena-mode-label {
    color: #4ecdc4;
    font-size: 1.05em;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: 0.04em;
}

.arena-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 18px;
    margin: 20px 0 28px;
}

.arena-card {
    background: linear-gradient(135deg, rgba(26, 26, 46, 0.85), rgba(22, 33, 62, 0.85));
    border: 2px solid rgba(255, 255, 255, 0.18);
    border-radius: 14px;
    padding: 14px;
    text-align: left;
    cursor: pointer;
    transition: all 0.28s ease;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

.arena-card:hover {
    transform: translateY(-4px);
    border-color: #4ecdc4;
    box-shadow: 0 0 22px rgba(78, 205, 196, 0.35);
}

.arena-card.selected {
    border-color: #ff6b6b;
    box-shadow: 0 0 24px rgba(255, 107, 107, 0.45);
    transform: translateY(-2px);
}

.arena-preview {
    width: 100%;
    height: 92px;
    border-radius: 10px;
    margin-bottom: 12px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    position: relative;
    overflow: hidden;
}

.arena-preview::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.04) 0, rgba(255, 255, 255, 0.04) 1px, transparent 1px, transparent 18px),
        repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.04) 0, rgba(255, 255, 255, 0.04) 1px, transparent 1px, transparent 18px);
    pointer-events: none;
}

.arena-card h4 {
    font-size: 1em;
    margin-bottom: 6px;
    color: #fff;
}

.arena-card p {
    font-size: 0.82em;
    color: #b8c0d0;
    line-height: 1.45;
}

.arena-tag {
    display: inline-block;
    margin-top: 8px;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 0.72em;
    font-weight: 700;
    letter-spacing: 0.03em;
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
}

/* 보상 섹션 */
.rewards-section {
    margin: 20px 0;
    padding: 25px;
    background: linear-gradient(135deg, rgba(26, 26, 46, 0.6), rgba(22, 33, 62, 0.6));
    border-radius: 15px;
    border: 2px solid rgba(255, 255, 255, 0.15);
    min-height: 150px;
    box-shadow:
        0 4px 20px rgba(0, 0, 0, 0.4),
        inset 0 0 30px rgba(0, 0, 0, 0.2);
}

#codeInput {
    padding: 12px 18px;
    font-size: 1em;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 600;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    margin: 10px;
    width: 100%;
    max-width: 300px;
    box-sizing: border-box;
    box-shadow:
        inset 0 2px 4px rgba(0, 0, 0, 0.5),
        0 0 10px rgba(78, 205, 196, 0.2);
    transition: all 0.3s ease;
}

.code-entry {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

.code-entry .menu-btn {
    min-width: 160px;
    padding: 12px 20px;
    font-size: 0.95em;
}

#codeInput:focus {
    outline: none;
    border-color: #4ecdc4;
    box-shadow:
        inset 0 2px 4px rgba(0, 0, 0, 0.5),
        0 0 20px rgba(78, 205, 196, 0.5);
}

#codeInput::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.level-progress {
    margin: 15px 0;
    width: 100%;
}

.progress-bar {
    width: 100%;
    height: 25px;
    background: rgba(0, 0, 0, 0.6);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    overflow: hidden;
    margin: 10px 0;
    min-width: 200px;
    box-shadow:
        inset 0 2px 4px rgba(0, 0, 0, 0.5),
        0 0 10px rgba(78, 205, 196, 0.3);
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff6b6b, #ff8e8e, #4ecdc4);
    transition: width 0.3s ease;
    border-radius: 10px;
    box-shadow:
        0 0 15px rgba(78, 205, 196, 0.6),
        inset 0 0 10px rgba(255, 255, 255, 0.2);
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: progressShine 2s ease-in-out infinite;
}

@keyframes progressShine {

    0%,
    100% {
        transform: translateX(-100%);
    }

    50% {
        transform: translateX(100%);
    }
}

/* 게임 화면 */
#gameScreen {
    position: relative;
    width: 100%;
    height: 100%;
    background: #0a0a0a;
    background: #0a0a0a;
    overflow: hidden;
}

#gameUI {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    min-height: 140px;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.85) 100%);
    border-bottom: 2px solid;
    border-image: linear-gradient(90deg, rgba(255, 107, 107, 0.5), rgba(78, 205, 196, 0.5)) 1;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 15px 30px;
    z-index: 100;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
}

.player-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 280px;
    background: linear-gradient(135deg, rgba(26, 26, 46, 0.6), rgba(22, 33, 62, 0.6));
    padding: 12px 15px;
    border-radius: 12px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    box-shadow:
        0 4px 15px rgba(0, 0, 0, 0.4),
        inset 0 0 20px rgba(0, 0, 0, 0.2);
}

.player-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.player-level {
    font-family: 'Orbitron', sans-serif;
    font-size: 1em;
    font-weight: 700;
    color: #f1c40f;
    text-shadow:
        0 0 8px rgba(241, 196, 15, 0.8),
        0 0 15px rgba(241, 196, 15, 0.4),
        2px 2px 4px rgba(0, 0, 0, 0.8);
    letter-spacing: 1px;
    background: rgba(241, 196, 15, 0.1);
    padding: 4px 10px;
    border-radius: 8px;
    border: 1px solid rgba(241, 196, 15, 0.3);
}

.player-stats {
    display: flex;
    gap: 15px;
    font-size: 0.9em;
}

.player-xp {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 600;
    color: #4ecdc4;
    text-shadow: 0 0 5px rgba(78, 205, 196, 0.6);
}

.player-equipment {
    display: flex;
    gap: 10px;
    margin-top: 5px;
}

.equipment-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.5), rgba(26, 26, 46, 0.5));
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    min-width: 120px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.equipment-item:hover {
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 0 15px rgba(78, 205, 196, 0.3);
    transform: translateY(-2px);
}

.weapon-item {
    border-left: 3px solid #4ecdc4;
}

.armor-item {
    border-left: 3px solid #f1c40f;
}

.equipment-icon {
    font-size: 1.5em;
    filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.5));
}

.equipment-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}

.equipment-name {
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.85em;
    font-weight: 600;
    color: #fff;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.3);
}

.equipment-ammo {
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.75em;
    font-weight: 600;
    color: #4ecdc4;
    text-shadow: 0 0 5px rgba(78, 205, 196, 0.6);
}

.equipment-ammo.low {
    color: #ff6b6b;
    text-shadow: 0 0 5px rgba(255, 107, 107, 0.6);
    animation: pulse 1s ease-in-out infinite;
}

.equipment-ammo.reloading {
    color: #f1c40f;
    text-shadow: 0 0 5px rgba(241, 196, 15, 0.6);
}

.equipment-durability {
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.75em;
    font-weight: 600;
    color: #f1c40f;
    text-shadow: 0 0 5px rgba(241, 196, 15, 0.6);
}

.equipment-durability.low {
    color: #ff6b6b;
    text-shadow: 0 0 5px rgba(255, 107, 107, 0.6);
    animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }
}

.player-name {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.4em;
    font-weight: 700;
    color: #4ecdc4;
    text-shadow:
        0 0 10px rgba(78, 205, 196, 0.8),
        0 0 20px rgba(78, 205, 196, 0.4),
        2px 2px 4px rgba(0, 0, 0, 0.8);
    letter-spacing: 1px;
    margin-bottom: 5px;
}

.player-health {
    display: flex;
    align-items: center;
    gap: 10px;
}

.health-bar {
    width: 250px;
    height: 20px;
    background: rgba(0, 0, 0, 0.6);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    overflow: hidden;
    box-shadow:
        inset 0 2px 4px rgba(0, 0, 0, 0.5),
        0 0 10px rgba(255, 107, 107, 0.3);
    position: relative;
}

.health-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff6b6b, #ff8e8e, #4ecdc4);
    transition: width 0.3s ease;
    border-radius: 8px;
    box-shadow:
        0 0 15px rgba(255, 107, 107, 0.6),
        inset 0 0 10px rgba(255, 255, 255, 0.2);
    position: relative;
}

.health-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: healthShine 2s ease-in-out infinite;
}

@keyframes healthShine {

    0%,
    100% {
        transform: translateX(-100%);
    }

    50% {
        transform: translateX(100%);
    }
}

.player-score {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.1em;
    font-weight: 600;
    color: #ff6b6b;
    text-shadow:
        0 0 8px rgba(255, 107, 107, 0.6),
        2px 2px 4px rgba(0, 0, 0, 0.8);
    letter-spacing: 1px;
}

#gameTimer {
    font-family: 'Orbitron', sans-serif;
    font-size: 2.5em;
    font-weight: 900;
    color: #4ecdc4;
    text-shadow:
        0 0 15px rgba(78, 205, 196, 0.8),
        0 0 30px rgba(78, 205, 196, 0.4),
        2px 2px 4px rgba(0, 0, 0, 0.8);
    letter-spacing: 3px;
    padding: 10px 25px;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(78, 205, 196, 0.5);
    border-radius: 10px;
    box-shadow:
        0 0 20px rgba(78, 205, 196, 0.3),
        inset 0 0 20px rgba(0, 0, 0, 0.3);
}

#centerHud {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex: 0 1 auto;
}

#timerControlInfo {
    padding: 8px 16px;
    font-size: 0.72em;
    text-align: center;
    max-width: 440px;
    line-height: 1.25;
}

#timerControlInfo p {
    margin: 2px 0;
}

#gameCanvas {
    position: absolute;
    top: 140px;
    left: 50%;
    transform: translateX(-50%);
    border: 3px solid;
    border-image: linear-gradient(135deg, rgba(255, 107, 107, 0.5), rgba(78, 205, 196, 0.5)) 1;
    background: #1a1a2e;
    box-shadow:
        0 0 40px rgba(0, 0, 0, 0.8),
        inset 0 0 40px rgba(0, 0, 0, 0.3);
}

#gameControls {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 20px;
    align-items: center;
}

#touchControls {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    bottom: 84px;
    z-index: 120;
    padding: 0 14px;
    justify-content: space-between;
    pointer-events: none;
}

.touch-pad {
    display: grid;
    grid-template-columns: repeat(3, 44px);
    grid-template-rows: repeat(3, 44px);
    gap: 6px;
    pointer-events: auto;
    touch-action: none;
}

.touch-pad[data-player="2"] {
    direction: rtl;
}

.touch-btn {
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.68);
    color: #fff;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    font-size: 0.82em;
    min-width: 44px;
    min-height: 44px;
    box-shadow: 0 0 12px rgba(78, 205, 196, 0.18);
}

.touch-btn:active,
.touch-btn.active {
    background: rgba(78, 205, 196, 0.36);
    border-color: #4ecdc4;
}

.touch-up {
    grid-column: 2;
    grid-row: 1;
}

.touch-left {
    grid-column: 1;
    grid-row: 2;
}

.touch-down {
    grid-column: 2;
    grid-row: 3;
}

.touch-right {
    grid-column: 3;
    grid-row: 2;
}

.touch-fire {
    grid-column: 3;
    grid-row: 1;
}

.touch-reload {
    grid-column: 3;
    grid-row: 3;
    font-size: 0.78em;
}

.control-info {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.8), rgba(26, 26, 46, 0.8));
    padding: 15px 25px;
    border-radius: 12px;
    font-size: 0.95em;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 600;
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow:
        0 4px 15px rgba(0, 0, 0, 0.5),
        inset 0 0 20px rgba(0, 0, 0, 0.3);
    letter-spacing: 0.5px;
}

.control-info p {
    margin: 5px 0;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.3);
}

.control-btn {
    padding: 12px 25px;
    font-family: 'Orbitron', sans-serif;
    font-weight: 600;
    font-size: 1em;
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.2), rgba(78, 205, 196, 0.2));
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 1px;
    text-transform: uppercase;
    box-shadow:
        0 4px 15px rgba(0, 0, 0, 0.4),
        inset 0 0 15px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.control-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.control-btn:hover::before {
    left: 100%;
}

.control-btn:hover {
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.4), rgba(78, 205, 196, 0.4));
    border-color: rgba(255, 255, 255, 0.6);
    box-shadow:
        0 0 20px rgba(255, 107, 107, 0.4),
        0 0 20px rgba(78, 205, 196, 0.4),
        0 6px 20px rgba(0, 0, 0, 0.5),
        inset 0 0 20px rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
}

/* 결과 화면 */
#resultContent {
    margin: 30px 0;
    font-size: 1.4em;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 600;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
    letter-spacing: 1px;
}

#resultTitle {
    animation: resultPulse 2s ease-in-out infinite;
}

@keyframes resultPulse {

    0%,
    100% {
        transform: scale(1);
        text-shadow:
            0 0 15px rgba(78, 205, 196, 0.8),
            0 0 30px rgba(78, 205, 196, 0.4);
    }

    50% {
        transform: scale(1.05);
        text-shadow:
            0 0 25px rgba(78, 205, 196, 1),
            0 0 50px rgba(78, 205, 196, 0.6);
    }
}

/* 유틸리티 클래스 */
.hidden {
    display: none !important;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .menu-content {
        padding: 20px;
        margin: 10px;
        max-width: 95vw;
        max-height: 95vh;
    }

    .menu-content h1 {
        font-size: 2em;
    }

    .menu-content h2 {
        font-size: 1.5em;
    }

    .item-grid {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: 10px;
    }

    .item-card {
        padding: 10px;
    }

    .item-card img {
        width: 40px;
        height: 40px;
    }

    .customize-section {
        padding: 15px;
        margin: 15px 0;
    }

    .rewards-section {
        padding: 15px;
        margin: 15px 0;
        min-height: 120px;
    }

    #codeInput {
        width: 100%;
        max-width: 250px;
        margin: 10px 0;
    }

    .progress-bar {
        min-width: 150px;
    }

    #gameCanvas {
        width: 100%;
        height: calc(100vh - 260px);
        top: 120px;
    }

    #gameUI {
        flex-direction: column;
        height: auto;
        padding: 8px;
        gap: 6px;
        min-height: auto;
    }

    .player-info {
        min-width: 100%;
        padding: 8px 10px;
    }

    .player-equipment {
        flex-wrap: wrap;
    }

    .player-name {
        font-size: 1em;
    }

    .health-bar {
        width: 100%;
    }

    #gameTimer {
        position: absolute;
        top: 8px;
        right: 8px;
        font-size: 1.1em;
        padding: 6px 10px;
    }

    #gameControls {
        bottom: 8px;
        width: calc(100% - 16px);
        gap: 8px;
        justify-content: center;
        flex-wrap: wrap;
    }

    .control-info {
        width: 100%;
        padding: 8px 10px;
        font-size: 0.76em;
        text-align: center;
    }

    .control-btn {
        padding: 9px 14px;
        font-size: 0.82em;
    }

    #touchControls {
        display: flex;
    }
}

@media (max-width: 480px) {
    .menu-content {
        padding: 15px;
        margin: 5px;
    }

    .item-grid {
        grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
        gap: 8px;
    }

    .item-card {
        padding: 8px;
    }

    .item-card h4 {
        font-size: 0.8em;
    }

    .item-card p {
        font-size: 0.7em;
    }

    .rewards-section {
        padding: 10px;
        margin: 10px 0;
        min-height: 100px;
    }

    #codeInput {
        max-width: 200px;
        font-size: 0.9em;
    }

    .progress-bar {
        min-width: 120px;
        height: 15px;
    }
}

/* 애니메이션 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.menu-content {
    animation: fadeIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.menu-btn {
    animation: slideIn 0.5s ease-out backwards;
}

.menu-btn:nth-child(1) {
    animation-delay: 0.1s;
}

.menu-btn:nth-child(2) {
    animation-delay: 0.2s;
}

.menu-btn:nth-child(3) {
    animation-delay: 0.3s;
}

.menu-btn:nth-child(4) {
    animation-delay: 0.4s;
}

/* 스크롤바 스타일 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* 메뉴 스크롤바 스타일 */
.menu-screen::-webkit-scrollbar {
    width: 6px;
}

.menu-screen::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

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

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

/* 피드백 메시지 스타일 */
.feedback-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, rgba(26, 26, 46, 0.95), rgba(22, 33, 62, 0.95));
    color: white;
    padding: 25px 40px;
    border-radius: 15px;
    border: 2px solid;
    border-image: linear-gradient(135deg, #ff6b6b, #4ecdc4) 1;
    font-family: 'Orbitron', sans-serif;
    font-size: 1.3em;
    font-weight: 700;
    z-index: 2000;
    animation: feedbackPulse 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow:
        0 0 40px rgba(78, 205, 196, 0.6),
        0 20px 60px rgba(0, 0, 0, 0.8);
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
    letter-spacing: 2px;
    text-transform: uppercase;
}

@keyframes feedbackPulse {
    0% {
        transform: translate(-50%, -50%) scale(0.5) rotate(-10deg);
        opacity: 0;
    }

    50% {
        transform: translate(-50%, -50%) scale(1.15) rotate(5deg);
        opacity: 1;
    }

    100% {
        transform: translate(-50%, -50%) scale(1) rotate(0deg);
        opacity: 1;
    }
}
