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

body {
    background-color: #000000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    padding: 10px;
}

.container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    padding: 30px;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}

/* 토글 스위치 스타일 - PC 기본 크기 (더 크게) */
.toggle-switch {
    position: relative;
    width: 120px;
    height: 60px;
}

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

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #333;
    transition: .4s;
    border-radius: 60px;
    box-shadow: 0 2px 5px rgba(255, 255, 255, 0.1);
}

.slider:before {
    position: absolute;
    content: "";
    height: 48px;
    width: 48px;
    left: 6px;
    top: 50%;
    transform: translateY(-50%);
    background-color: #666;
    transition: .4s;
    border-radius: 50%;
    box-shadow: 0 2px 3px rgba(0, 0, 0, 0.3);
}

input:checked + .slider {
    background-color: #00ff41;
    box-shadow: 0 0 20px rgba(0, 255, 65, 0.5);
}

input:checked + .slider:before {
    background-color: white;
    transform: translateX(60px) translateY(-50%);
}

/* 버튼 래퍼 스타일 */
.button-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.button-label {
    color: #888;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: color 0.3s;
    white-space: nowrap;
}

.button-wrapper:has(input:checked) .button-label {
    color: #00ff41;
    text-shadow: 0 0 10px rgba(0, 255, 65, 0.5);
}

/* 상태 표시 */
.status {
    color: #666;
    font-size: 11px;
    margin-top: 3px;
    transition: all 0.3s;
}

.button-wrapper:has(input:checked) .status {
    color: #00ff41;
}

/* 호버 효과 (데스크톱용) */
@media (hover: hover) {
    .slider:hover {
        box-shadow: 0 4px 8px rgba(255, 255, 255, 0.2);
    }
}

/* 태블릿 */
@media (max-width: 768px) {
    .container {
        max-width: 450px;
        gap: 20px;
        padding: 20px;
    }
    
    .toggle-switch {
        width: 90px;
        height: 45px;
    }
    
    .slider:before {
        height: 36px;
        width: 36px;
        left: 4.5px;
    }
    
    input:checked + .slider:before {
        transform: translateX(45px) translateY(-50%);
    }
}

/* 모바일 반응형 - 작은 화면 */
@media (max-width: 480px) {
    .container {
        gap: 10px;
        padding: 15px;
        max-width: 100%;
        grid-template-columns: repeat(4, 1fr);
    }
    
    .toggle-switch {
        width: 60px;
        height: 30px;
    }
    
    .slider {
        border-radius: 30px;
    }
    
    .slider:before {
        height: 24px;
        width: 24px;
        left: 3px;
        top: 50%;
        transform: translateY(-50%);
    }
    
    input:checked + .slider:before {
        transform: translateX(30px) translateY(-50%);
    }
    
    .button-label {
        font-size: 10px;
        letter-spacing: 0.5px;
    }
    
    .status {
        font-size: 8px;
    }
    
    .button-wrapper {
        gap: 5px;
    }
}

/* 매우 작은 화면 (360px 이하) */
@media (max-width: 360px) {
    .container {
        gap: 10px;
        padding: 12px;
    }
    
    .toggle-switch {
        width: 60px;
        height: 30px;
    }
    
    .slider {
        border-radius: 30px;
    }
    
    .slider:before {
        height: 24px;
        width: 24px;
        left: 3px;
        top: 50%;
        transform: translateY(-50%);
    }
    
    input:checked + .slider:before {
        transform: translateX(30px) translateY(-50%);
    }
    
    .button-label {
        font-size: 10px;
    }
    
    .status {
        font-size: 8px;
    }
}

/* 초소형 화면 (320px 이하) */
@media (max-width: 320px) {
    .container {
        gap: 8px;
        padding: 10px;
    }
    
    .toggle-switch {
        width: 55px;
        height: 28px;
    }
    
    .slider {
        border-radius: 28px;
    }
    
    .slider:before {
        height: 22px;
        width: 22px;
        left: 3px;
        top: 50%;
        transform: translateY(-50%);
    }
    
    input:checked + .slider:before {
        transform: translateX(27px) translateY(-50%);
    }
    
    .button-label {
        font-size: 9px;
    }
    
    .status {
        font-size: 8px;
    }
    
    .button-wrapper {
        gap: 5px;
    }
}

/* 가로 모드 대응 */
@media (max-height: 500px) and (orientation: landscape) {
    body {
        padding: 5px;
    }
    
    .container {
        gap: 10px;
        padding: 10px;
        max-width: 600px;
    }
    
    .toggle-switch {
        width: 70px;
        height: 35px;
    }
    
    .slider:before {
        height: 27px;
        width: 27px;
        left: 4px;
        top: 50%;
        transform: translateY(-50%);
    }
    
    input:checked + .slider:before {
        transform: translateX(35px) translateY(-50%);
    }
    
    .button-label {
        font-size: 10px;
    }
    
    .button-wrapper {
        gap: 5px;
    }
}

/* 대형 데스크톱 화면 */
@media (min-width: 1200px) {
    .container {
        gap: 35px;
        padding: 40px;
        max-width: 700px;
    }
    
    .toggle-switch {
        width: 140px;
        height: 70px;
    }
    
    .slider {
        border-radius: 70px;
    }
    
    .slider:before {
        height: 56px;
        width: 56px;
        left: 7px;
    }
    
    input:checked + .slider:before {
        transform: translateX(70px) translateY(-50%);
    }
    
    .button-label {
        font-size: 16px;
    }
    
    .status {
        font-size: 12px;
    }
}

/* 터치 디바이스 최적화 */
@media (pointer: coarse) {
    .button-wrapper {
        min-height: 80px;
        justify-content: center;
    }
}

/* 전체 제어 버튼 스타일 */
.control-buttons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 30px;
    padding: 0 20px;
    width: 100%;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.control-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 25px;
    background: linear-gradient(145deg, #2a2a2a, #1a1a1a);
    border: 2px solid #444;
    border-radius: 50px;
    color: #999;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 
        0 4px 15px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
    white-space: nowrap;
}

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

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

.btn-icon {
    font-size: 20px;
    display: inline-block;
}

.btn-text {
    font-size: 12px;
}

/* ALL OFF 버튼 스타일 */
.off-btn {
    background: linear-gradient(145deg, #3a1a1a, #2a0a0a);
    border-color: #ff4444;
    color: #ff6666;
}

.off-btn:hover {
    background: linear-gradient(145deg, #4a2a2a, #3a1a1a);
    border-color: #ff6666;
    color: #ff8888;
    box-shadow: 
        0 4px 20px rgba(255, 68, 68, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.off-btn:active {
    transform: translateY(0);
    box-shadow: 
        0 2px 10px rgba(255, 68, 68, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* 모바일 반응형 - 제어 버튼 */
@media (max-width: 768px) {
    .control-buttons {
        flex-direction: column;
        gap: 12px;
        margin-top: 20px;
        padding: 0 15px;
        max-width: 300px;
    }
    
    .control-btn {
        width: 100%;
        padding: 14px 30px;
        font-size: 13px;
    }
    
    .btn-icon {
        font-size: 18px;
    }
    
    .btn-text {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .control-buttons {
        gap: 10px;
        padding: 0 10px;
    }
    
    .control-btn {
        padding: 12px 25px;
        font-size: 12px;
    }
    
    .btn-icon {
        font-size: 16px;
    }
    
    .btn-text {
        font-size: 11px;
    }
}

@media (max-width: 360px) {
    .control-buttons {
        padding: 0 12px;
    }
    
    .control-btn {
        padding: 9px 20px;
        gap: 6px;
    }
    
    .btn-icon {
        font-size: 14px;
    }
    
    .btn-text {
        font-size: 9px;
    }
}

/* 대형 데스크톱 화면 - 제어 버튼 */
@media (min-width: 1200px) {
    .control-buttons {
        max-width: 800px;
        margin-top: 40px;
        gap: 20px;
    }
    
    .control-btn {
        padding: 15px 35px;
        font-size: 14px;
    }
    
    .btn-icon {
        font-size: 22px;
    }
    
    .btn-text {
        font-size: 13px;
    }
}

/* 스플래시 화면 스타일 */
.splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, #1a1a1a 0%, #000000 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.splash-content {
    text-align: center;
    padding: 40px;
    max-width: 600px;
}

.splash-title {
    font-size: 48px;
    font-weight: 700;
    color: #ff4444;
    margin-bottom: 10px;
    text-shadow: 
        0 0 10px rgba(255, 68, 68, 0.8),
        0 0 20px rgba(255, 68, 68, 0.6),
        0 0 30px rgba(255, 68, 68, 0.4),
        0 0 40px rgba(255, 68, 68, 0.2);
    letter-spacing: 3px;
}

.splash-subtitle {
    font-size: 18px;
    color: #666;
    margin-bottom: 40px;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.splash-message {
    margin: 40px 0;
    padding: 30px;
    border: 1px solid #333;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.5);
}

.splash-message p {
    font-size: 20px;
    color: #888;
    margin: 15px 0;
    line-height: 1.5;
    animation: fadeInUp 1s ease forwards;
    opacity: 0;
}

.splash-message p:nth-child(1) { animation-delay: 0.5s; }
.splash-message p:nth-child(2) { animation-delay: 0.7s; }
.splash-message p:nth-child(3) { animation-delay: 0.9s; }

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

.splash-button {
    padding: 15px 40px;
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    background: linear-gradient(145deg, #ff4444, #cc0000);
    border: none;
    border-radius: 50px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 
        0 5px 20px rgba(255, 68, 68, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    animation: pulse 2s infinite;
    margin-top: 20px;
}

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

.splash-button:hover {
    background: linear-gradient(145deg, #ff6666, #ff2222);
    transform: translateY(-2px);
    box-shadow: 
        0 7px 25px rgba(255, 68, 68, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.splash-button:active {
    transform: translateY(0);
}

.splash-footer {
    margin-top: 30px;
    font-size: 14px;
    color: #555;
    letter-spacing: 1px;
    animation: blink 1.5s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* 게임 컨테이너 */
.game-container {
    width: 100%;
    animation: fadeIn 0.5s ease;
}

/* 모바일 반응형 - 스플래시 */
@media (max-width: 768px) {
    .splash-title {
        font-size: 36px;
    }
    
    .splash-subtitle {
        font-size: 14px;
    }
    
    .splash-message p {
        font-size: 16px;
    }
    
    .splash-button {
        font-size: 16px;
        padding: 12px 30px;
    }
}

@media (max-width: 480px) {
    .splash-title {
        font-size: 28px;
        letter-spacing: 1px;
    }
    
    .splash-message {
        padding: 20px;
    }
    
    .splash-message p {
        font-size: 14px;
    }
}

/* body 스타일 수정 - 컨테이너 중앙 정렬 */
body {
    background-color: #000000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    padding: 10px;
}

/* 스테이지 표시 스타일 */
.stage-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-bottom: 30px;
    padding: 20px 40px;
    background: linear-gradient(145deg, #1a1a1a, #0a0a0a);
    border: 2px solid #333;
    border-radius: 20px;
    box-shadow: 
        0 10px 30px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    position: relative;
    margin: 0 auto 30px auto;
}

.stage-label {
    color: #666;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 3px;
    text-transform: uppercase;
}

.stage-number {
    color: #00ff41;
    font-size: 48px;
    font-weight: 700;
    line-height: 1;
    text-shadow: 
        0 0 20px rgba(0, 255, 65, 0.5),
        0 0 40px rgba(0, 255, 65, 0.3);
    font-family: 'Courier New', monospace;
    letter-spacing: 5px;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

.stage-progress {
    width: 150px;
    height: 4px;
    background: #222;
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #00ff41, #00cc33);
    border-radius: 2px;
    transition: width 0.5s ease;
    box-shadow: 0 0 10px rgba(0, 255, 65, 0.5);
}

/* 스테이지 표시 - 모바일 반응형 */
@media (max-width: 768px) {
    .stage-display {
        margin-bottom: 20px;
        padding: 15px 30px;
        gap: 8px;
    }
    
    .stage-label {
        font-size: 11px;
        letter-spacing: 2px;
    }
    
    .stage-number {
        font-size: 36px;
        letter-spacing: 3px;
    }
    
    .stage-progress {
        width: 120px;
        height: 3px;
    }
}

@media (max-width: 480px) {
    .stage-display {
        margin-bottom: 15px;
        padding: 12px 25px;
        gap: 6px;
    }
    
    .stage-label {
        font-size: 10px;
        letter-spacing: 2px;
    }
    
    .stage-number {
        font-size: 30px;
        letter-spacing: 2px;
    }
    
    .stage-progress {
        width: 100px;
        height: 3px;
    }
}

@media (max-width: 360px) {
    .stage-display {
        margin-bottom: 12px;
        padding: 10px 20px;
    }
    
    .stage-number {
        font-size: 28px;
    }
    
    .stage-progress {
        width: 90px;
    }
}

/* 대형 데스크톱 화면 - 스테이지 표시 */
@media (min-width: 1200px) {
    .stage-display {
        margin-bottom: 40px;
        padding: 25px 50px;
        gap: 12px;
    }
    
    .stage-label {
        font-size: 14px;
        letter-spacing: 4px;
    }
    
    .stage-number {
        font-size: 56px;
        letter-spacing: 6px;
    }
    
    .stage-progress {
        width: 180px;
        height: 5px;
    }
}

/* 스테이지 클리어 효과 */
.stage-display.stage-clear {
    animation: stageClear 1s ease;
}

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

.stage-number.level-up {
    animation: levelUp 0.5s ease;
}

@keyframes levelUp {
    0% { 
        transform: scale(1) rotateY(0deg);
        color: #00ff41;
    }
    50% { 
        transform: scale(1.3) rotateY(180deg);
        color: #00ffff;
    }
    100% { 
        transform: scale(1) rotateY(360deg);
        color: #00ff41;
    }
}

/* 버튼 상호작용 힌트 스타일 */
.interaction-hint {
    color: #555;
    font-size: 9px;
    margin-top: 3px;
    font-family: 'Courier New', monospace;
    letter-spacing: 1px;
    opacity: 0.7;
    transition: opacity 0.3s;
}

.button-wrapper:hover .interaction-hint {
    opacity: 1;
    color: #777;
}

/* 상호작용 효과 애니메이션 */
.button-wrapper.interaction-effect {
    animation: interactionPulse 0.5s ease;
}

@keyframes interactionPulse {
    0% { transform: scale(1); }
    50% { 
        transform: scale(1.1);
        filter: brightness(1.5);
    }
    100% { transform: scale(1); }
}

.button-wrapper.activation-effect .slider {
    animation: activationGlow 0.5s ease;
}

@keyframes activationGlow {
    0% { 
        box-shadow: 0 0 5px rgba(0, 255, 65, 0.5);
    }
    50% { 
        box-shadow: 0 0 30px rgba(0, 255, 65, 0.8),
                    0 0 50px rgba(0, 255, 65, 0.5);
    }
    100% { 
        box-shadow: 0 0 20px rgba(0, 255, 65, 0.5);
    }
}

.button-wrapper.deactivation-effect .slider {
    animation: deactivationFlash 0.5s ease;
}

@keyframes deactivationFlash {
    0% { 
        background-color: #333;
    }
    50% { 
        background-color: #ff4444;
        box-shadow: 0 0 20px rgba(255, 68, 68, 0.5);
    }
    100% { 
        background-color: #333;
    }
}

/* 연결선 효과 (옵션) */
.interaction-line {
    position: absolute;
    background: linear-gradient(90deg, transparent, rgba(0, 255, 65, 0.3), transparent);
    height: 2px;
    pointer-events: none;
    animation: lineFlow 1s ease;
    z-index: 1;
}

@keyframes lineFlow {
    0% { 
        opacity: 0;
        transform: scaleX(0);
    }
    50% { 
        opacity: 1;
        transform: scaleX(1);
    }
    100% { 
        opacity: 0;
        transform: scaleX(1);
    }
}

/* TARGET 버튼 스타일 */
.target-btn {
    background: linear-gradient(145deg, #2a1a3a, #1a0a2a);
    border-color: #ff44ff;
    color: #ff66ff;
}

.target-btn:hover {
    background: linear-gradient(145deg, #3a2a4a, #2a1a3a);
    border-color: #ff66ff;
    color: #ff88ff;
    box-shadow: 
        0 4px 20px rgba(255, 68, 255, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.target-btn:active {
    transform: translateY(0);
    box-shadow: 
        0 2px 10px rgba(255, 68, 255, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* 목표 패턴 표시 */
.target-display {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(145deg, #1a1a1a, #0a0a0a);
    border: 2px solid #ff44ff;
    border-radius: 15px;
    padding: 20px;
    z-index: 500;
    box-shadow: 
        0 10px 30px rgba(0, 0, 0, 0.8),
        0 0 30px rgba(255, 68, 255, 0.3);
    animation: fadeInScale 0.3s;
}

.target-display.show {
    display: block;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.target-title {
    text-align: center;
    color: #ff66ff;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 15px;
    text-shadow: 0 0 10px rgba(255, 68, 255, 0.5);
}

.target-grid {
    display: grid;
    grid-template-columns: repeat(4, 40px);
    grid-template-rows: repeat(4, 40px);
    gap: 5px;
    margin: 0 auto;
}

.target-cell {
    background: #222;
    border: 1px solid #444;
    border-radius: 8px;
    transition: all 0.3s;
}

.target-cell.active {
    background: linear-gradient(145deg, #ff44ff, #ff00ff);
    border-color: #ff66ff;
    box-shadow: 
        0 0 15px rgba(255, 68, 255, 0.6),
        inset 0 0 10px rgba(255, 255, 255, 0.3);
    animation: targetPulse 1s infinite;
}

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

/* 모바일 반응형 - 목표 표시 */
@media (max-width: 480px) {
    .target-grid {
        grid-template-columns: repeat(4, 30px);
        grid-template-rows: repeat(4, 30px);
        gap: 3px;
    }
    
    .target-display {
        padding: 15px;
    }
    
    .target-title {
        font-size: 12px;
    }
}

/* 모바일에서 힌트 크기 조절 */
@media (max-width: 480px) {
    .interaction-hint {
        font-size: 8px;
    }
}

@media (max-width: 360px) {
    .interaction-hint {
        font-size: 7px;
        letter-spacing: 0.5px;
    }
}

/* RESTART 버튼 스타일 */
.restart-btn {
    background: linear-gradient(145deg, #2a2a1a, #1a1a0a);
    border-color: #ffaa44;
    color: #ffcc66;
}

.restart-btn:hover {
    background: linear-gradient(145deg, #3a3a2a, #2a2a1a);
    border-color: #ffcc66;
    color: #ffdd88;
    box-shadow: 
        0 4px 20px rgba(255, 170, 68, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.restart-btn:active {
    transform: translateY(0);
    box-shadow: 
        0 2px 10px rgba(255, 170, 68, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.restart-btn .btn-icon {
    font-size: 20px;
    animation: rotate 2s linear infinite paused;
}

.restart-btn:hover .btn-icon {
    animation-play-state: running;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* RESET 버튼 스타일 */
.reset-btn {
    background: linear-gradient(145deg, #1a1a2a, #0a0a1a);
    border-color: #8844ff;
    color: #aa66ff;
}

.reset-btn:hover {
    background: linear-gradient(145deg, #2a2a3a, #1a1a2a);
    border-color: #aa66ff;
    color: #cc88ff;
    box-shadow: 
        0 4px 20px rgba(136, 68, 255, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.reset-btn:active {
    transform: translateY(0);
    box-shadow: 
        0 2px 10px rgba(136, 68, 255, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* HELP 버튼 스타일 */
.help-btn {
    background: linear-gradient(145deg, #1a2a3a, #0a1a2a);
    border-color: #4488ff;
    color: #6699ff;
}

.help-btn:hover {
    background: linear-gradient(145deg, #2a3a4a, #1a2a3a);
    border-color: #6699ff;
    color: #88aaff;
    box-shadow: 
        0 4px 20px rgba(68, 136, 255, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.help-btn:active {
    transform: translateY(0);
    box-shadow: 
        0 2px 10px rgba(68, 136, 255, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.help-btn .btn-icon {
    font-weight: bold;
    font-size: 22px;
}

/* 모달 스타일 */
.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;
}

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

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: linear-gradient(145deg, #1a1a1a, #0a0a0a);
    border: 2px solid #333;
    border-radius: 20px;
    padding: 30px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    animation: slideIn 0.3s;
}

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

.close-modal {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 28px;
    font-weight: bold;
    color: #666;
    cursor: pointer;
    transition: color 0.3s;
}

.close-modal:hover {
    color: #ff4444;
}

.modal-content h2 {
    color: #00ff41;
    margin-bottom: 20px;
    text-align: center;
    font-size: 24px;
    text-shadow: 0 0 10px rgba(0, 255, 65, 0.5);
}

.modal-content h3 {
    color: #888;
    margin-top: 20px;
    margin-bottom: 10px;
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.modal-content p {
    color: #aaa;
    line-height: 1.6;
    margin-bottom: 10px;
    font-size: 14px;
}

.modal-content kbd {
    background: #333;
    border: 1px solid #555;
    border-radius: 4px;
    padding: 2px 6px;
    color: #00ff41;
    font-family: 'Courier New', monospace;
    font-size: 13px;
}

.pattern-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin: 15px 0;
}

.pattern-info {
    background: #222;
    border: 1px solid #444;
    border-radius: 8px;
    padding: 8px;
    text-align: center;
    color: #999;
    font-size: 12px;
}

/* 모바일 반응형 - 모달 */
@media (max-width: 600px) {
    .modal-content {
        width: 95%;
        padding: 20px;
        max-height: 90vh;
    }
    
    .modal-content h2 {
        font-size: 20px;
    }
    
    .modal-content h3 {
        font-size: 14px;
    }
    
    .modal-content p {
        font-size: 12px;
    }
    
    .pattern-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .pattern-info {
        font-size: 11px;
    }
}