/* 테트리스 게임 스타일시트 */
:root {
    --primary-color: #3498db;
    --secondary-color: #2ecc71;
    --accent-color: #e74c3c;
    --dark-color: #2c3e50;
    --light-color: #ecf0f1;
    --grid-color: #34495e;
    --text-color: #333;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --border-radius: 8px;
}

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

body {
    font-family: 'Roboto Mono', monospace;
    background: linear-gradient(135deg, #1a2980, #26d0ce);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    max-width: 1200px;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    padding: 30px;
}

.header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 3px solid var(--primary-color);
}

.header h1 {
    font-family: 'Press Start 2P', cursive;
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.header .subtitle {
    font-size: 1.2rem;
    color: var(--dark-color);
    opacity: 0.8;
}

.game-area {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
}

@media (min-width: 768px) {
    .game-area {
        grid-template-columns: 2fr 1fr;
    }
}

.game-board-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.game-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--light-color);
    padding: 20px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.score-board {
    display: flex;
    gap: 30px;
}

.info-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.info-label {
    font-size: 0.9rem;
    font-weight: bold;
    color: var(--dark-color);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 5px;
}

.info-value {
    font-family: 'Press Start 2P', monospace;
    font-size: 1.5rem;
    color: var(--primary-color);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

.next-piece-container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.next-piece-container h3 {
    font-size: 1rem;
    margin-bottom: 10px;
    color: var(--dark-color);
}

#next-piece {
    background: white;
    border: 2px solid var(--grid-color);
    border-radius: 4px;
    box-shadow: var(--shadow);
}

.game-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

#game-board {
    background: black;
    border: 4px solid var(--grid-color);
    border-radius: 4px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
}

.game-controls {
    display: flex;
    gap: 15px;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: var(--border-radius);
    font-family: 'Roboto Mono', monospace;
    font-weight: bold;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: var(--shadow);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
}

.btn:active {
    transform: translateY(1px);
}

.btn-start {
    background: var(--secondary-color);
    color: white;
}

.btn-pause {
    background: #f39c12;
    color: white;
}

.btn-reset {
    background: var(--accent-color);
    color: white;
}

.btn-share {
    background: #9b59b6;
    color: white;
}

.instructions {
    background: var(--light-color);
    padding: 25px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.instruction-section {
    margin-bottom: 25px;
}

.instruction-section:last-child {
    margin-bottom: 0;
}

.instruction-section h3 {
    font-size: 1.2rem;
    color: var(--dark-color);
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.controls-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

@media (min-width: 480px) {
    .controls-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.control-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 15px;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

kbd {
    background: var(--dark-color);
    color: white;
    padding: 6px 12px;
    border-radius: 4px;
    font-family: 'Press Start 2P', monospace;
    font-size: 0.9rem;
    min-width: 40px;
    text-align: center;
    display: inline-block;
}

.touch-controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.touch-row {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.touch-btn {
    width: 60px;
    height: 60px;
    border: none;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.touch-btn:hover {
    background: #2980b9;
    transform: scale(1.05);
}

.touch-btn:active {
    transform: scale(0.95);
}

.move-left { background: #3498db; }
.move-down { background: #2ecc71; }
.move-right { background: #3498db; }
.rotate-left { background: #9b59b6; }
.hard-drop { background: #e74c3c; }
.rotate-right { background: #9b59b6; }

.footer {
    text-align: center;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #ddd;
    color: var(--dark-color);
    opacity: 0.7;
    font-size: 0.9rem;
}

.footer p {
    margin-bottom: 5px;
}

.footer .version {
    font-size: 0.8rem;
    color: #7f8c8d;
}

/* 모달 스타일 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: white;
    padding: 40px;
    border-radius: var(--border-radius);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    text-align: center;
    max-width: 500px;
    width: 90%;
}

.modal h2 {
    font-family: 'Press Start 2P', cursive;
    color: var(--accent-color);
    margin-bottom: 20px;
    font-size: 2rem;
}

.final-score {
    margin: 25px 0;
    font-size: 1.2rem;
}

.final-score p {
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    padding: 0 20px;
}

.final-score span {
    font-weight: bold;
    color: var(--primary-color);
    font-family: 'Press Start 2P', monospace;
}

.modal-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
}

/* 반응형 조정 */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    #game-board {
        width: 300px;
        height: 600px;
    }
    
    .game-info {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
    
    .score-board {
        justify-content: center;
    }
    
    .game-controls {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .btn {
        flex: 1;
        min-width: 120px;
    }
    
    .modal-content {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.5rem;
    }
    
    #game-board {
        width: 250px;
        height: 500px;
    }
    
    .controls-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .touch-btn {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }
}

/* 애니메이션 */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.btn-start:hover {
    animation: pulse 0.5s ease infinite;
}

@keyframes score-pop {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.info-value.updated {
    animation: score-pop 0.3s ease;
}

/* 블록 색상 클래스 */
.block-i { background-color: #00f0f0; }
.block-j { background-color: #0000f0; }
.block-l { background-color: #f0a000; }
.block-o { background-color: #f0f000; }
.block-s { background-color: #00f000; }
.block-t { background-color: #a000f0; }
.block-z { background-color: #f00000; }