* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

body {
    background: #1a1a1a;
    font-family: Arial, sans-serif;
    color: white;
    touch-action: none;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
}

/* 헤더 스타일 */
.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.title-section h1 {
    font-size: 28px;
    color: #FFD700;
}

.button-section {
    display: flex;
    gap: 10px;
}

.control-button {
    padding: 8px 16px;
    background: #333;
    border: none;
    border-radius: 5px;
    color: white;
    text-decoration: none;
    font-size: 14px;
    cursor: pointer;
}

.control-button:hover {
    background: #444;
}

/* 점수 컨테이너 */
.score-container {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
}

.score-box {
    background: #333;
    padding: 10px 20px;
    border-radius: 5px;
    text-align: center;
    flex: 1;
    margin: 0 10px;
}

.score-label {
    font-size: 14px;
    color: #888;
}

.score-value {
    font-size: 24px;
    font-weight: bold;
    color: #FFD700;
}

/* 게임 인트로 */
.game-intro {
    text-align: center;
    margin-bottom: 20px;
}

.game-intro p {
    margin-bottom: 15px;
}

.new-game-button {
    padding: 10px 20px;
    background: #FFD700;
    border: none;
    border-radius: 5px;
    color: #000;
    font-size: 16px;
    cursor: pointer;
}

.new-game-button:hover {
    background: #FFC000;
}

/* 게임 컨테이너 */
.game-container {
    position: relative;
    background: #000;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 20px;
    aspect-ratio: 1;
}

#gameCanvas {
    display: block;
    width: 100%;
    height: 100%;
}

/* 조이스틱 */
#controls {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
}

.joystick-base {
    width: 120px;
    height: 120px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    position: relative;
}

.joystick-stick {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* 게임 메시지 */
.game-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.9);
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    z-index: 200;
}

.game-message p {
    font-size: 24px;
    margin-bottom: 10px;
}

.retry-button {
    padding: 10px 20px;
    background: #FFD700;
    border: none;
    border-radius: 5px;
    color: #000;
    font-size: 16px;
    cursor: pointer;
    margin-top: 15px;
}

/* 모달 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #333;
    padding: 20px;
    border-radius: 10px;
    max-width: 80%;
    width: 100%;
    max-width: 400px;
}

.close-button {
    position: absolute;
    right: 10px;
    top: 10px;
    font-size: 24px;
    cursor: pointer;
    color: #888;
}

.instruction-content {
    margin-top: 20px;
}

.rule-section {
    margin-top: 15px;
}

.rule-section h3 {
    margin-bottom: 10px;
    color: #FFD700;
}

.rule-section ul {
    list-style-type: none;
}

.rule-section li {
    margin-bottom: 8px;
    padding-left: 20px;
    position: relative;
}

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

.hidden {
    display: none !important;
}
